From 5a9bd01ce3c6b937a69139e6ffe7832a07998f6e Mon Sep 17 00:00:00 2001 From: Nico Sallembien Date: Wed, 20 Jan 2010 11:13:13 -0800 Subject: [PATCH 001/945] new project, first commit From b4c4f2016ae47fdd00e26b57d1766cf180d6f51a Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 21 Jan 2010 23:49:31 -0500 Subject: [PATCH 002/945] Initial commit of Qualcomm's loc_api GPS library for the MSM platform. Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 9 + loc_api/NOTICE | 13 + loc_api/libloc_api-rpc/Android.mk | 66 + loc_api/libloc_api-rpc/gen-6356/Makefile.xdr | 38 + loc_api/libloc_api-rpc/gen-6356/loc_api.xdr | 164 ++ .../libloc_api-rpc/gen-6356/loc_api_cb.xdr | 90 + .../libloc_api-rpc/gen-6356/loc_api_cb_svc.c | 81 + .../libloc_api-rpc/gen-6356/loc_api_cb_xdr.c | 49 + .../libloc_api-rpc/gen-6356/loc_api_clnt.c | 99 ++ .../gen-6356/loc_api_common.xdr | 803 +++++++++ .../gen-6356/loc_api_common_xdr.c | 1458 +++++++++++++++++ .../libloc_api-rpc/gen-6356/loc_api_fixup.c | 48 + loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c | 188 +++ loc_api/libloc_api-rpc/rpc_inc/debug.h | 57 + loc_api/libloc_api-rpc/rpc_inc/loc_api.h | 214 +++ loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h | 81 + .../libloc_api-rpc/rpc_inc/loc_api_common.h | 1047 ++++++++++++ .../libloc_api-rpc/rpc_inc/loc_api_fixup.h | 188 +++ .../libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h | 100 ++ .../rpc_inc/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c | 339 ++++ .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 + loc_api/libloc_api/Android.mk | 45 + loc_api/libloc_api/loc_eng.cpp | 1380 ++++++++++++++++ loc_api/libloc_api/loc_eng.h | 100 ++ loc_api/libloc_api/loc_eng_ioctl.cpp | 358 ++++ loc_api/libloc_api/loc_eng_ioctl.h | 75 + loc_api/libloc_api/loc_eng_ni.cpp | 616 +++++++ loc_api/libloc_api/loc_eng_ni.h | 56 + loc_api/libloc_api/loc_eng_xtra.cpp | 184 +++ loc_api/libloc_api/loc_eng_xtra.h | 47 + 31 files changed, 8088 insertions(+) create mode 100755 loc_api/Android.mk create mode 100644 loc_api/NOTICE create mode 100755 loc_api/libloc_api-rpc/Android.mk create mode 100755 loc_api/libloc_api-rpc/gen-6356/Makefile.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c create mode 100755 loc_api/libloc_api-rpc/rpc_inc/debug.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c create mode 100755 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api/Android.mk create mode 100755 loc_api/libloc_api/loc_eng.cpp create mode 100755 loc_api/libloc_api/loc_eng.h create mode 100755 loc_api/libloc_api/loc_eng_ioctl.cpp create mode 100755 loc_api/libloc_api/loc_eng_ioctl.h create mode 100755 loc_api/libloc_api/loc_eng_ni.cpp create mode 100755 loc_api/libloc_api/loc_eng_ni.h create mode 100755 loc_api/libloc_api/loc_eng_xtra.cpp create mode 100755 loc_api/libloc_api/loc_eng_xtra.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk new file mode 100755 index 00000000..cdb2dbde --- /dev/null +++ b/loc_api/Android.mk @@ -0,0 +1,9 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 $(call all-subdir-makefiles) diff --git a/loc_api/NOTICE b/loc_api/NOTICE new file mode 100644 index 00000000..85b5740d --- /dev/null +++ b/loc_api/NOTICE @@ -0,0 +1,13 @@ +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk new file mode 100755 index 00000000..f5d40089 --- /dev/null +++ b/loc_api/libloc_api-rpc/Android.mk @@ -0,0 +1,66 @@ +#Copyright (c) 2009, QUALCOMM USA, INC. +#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +RPC_INC:=rpc_inc + +AMSS_VERSION:=6356 + +generated_files:= \ + gen-$(AMSS_VERSION)/loc_api_clnt.c \ + gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ + gen-$(AMSS_VERSION)/loc_api_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_fixup.c \ + src/loc_api_rpc_glue.c \ + src/loc_apicb_appinit.c + +LOCAL_SRC_FILES:= $(generated_files) + +# removed from library build since the client should implement this code. +# src/loc_api_cb_server.c + +LOCAL_CFLAGS:=-fno-short-enums +# LOCAL_CFLAGS+=-include $(RPC_INC)/commondefs.h +LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h +LOCAL_CFLAGS+=-DDEBUG +# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE + +LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL + +LOCAL_SHARED_LIBRARIES:= librpc +LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc + +LOCAL_PRELINK_MODULE:= false + +LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/$(RPC_INC) +LOCAL_COPY_HEADERS:= \ + $(RPC_INC)/debug.h \ + $(RPC_INC)/loc_api_cb.h \ + $(RPC_INC)/loc_api_common.h \ + $(RPC_INC)/loc_api.h \ + $(RPC_INC)/loc_api_fixup.h \ + $(RPC_INC)/loc_api_rpc_glue.h \ + $(RPC_INC)/loc_apicb_appinit.h + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/$(RPC_INC) \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_MODULE:= libloc_api-rpc + +include $(BUILD_STATIC_LIBRARY) + +endif diff --git a/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr b/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr new file mode 100755 index 00000000..e6e863fa --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr @@ -0,0 +1,38 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + + +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:=rpc_inc + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr new file mode 100755 index 00000000..981266b3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr @@ -0,0 +1,164 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3000008c; + +const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr new file mode 100755 index 00000000..3f53504b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr @@ -0,0 +1,90 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3100008c; + +const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c new file mode 100755 index 00000000..3b94e624 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c @@ -0,0 +1,81 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c new file mode 100755 index 00000000..51bb47f6 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c @@ -0,0 +1,49 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c new file mode 100755 index 00000000..886e5e53 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c @@ -0,0 +1,99 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr new file mode 100755 index 00000000..7ef6357c --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr @@ -0,0 +1,803 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_OPEN_VERSION = 0x00010001; +const RPC_LOC_CLOSE_VERSION = 0x00010001; +const RPC_LOC_START_FIX_VERSION = 0x00010001; +const RPC_LOC_STOP_FIX_VERSION = 0x00010001; +const RPC_LOC_IOCTL_VERSION = 0x00010001; +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; +const RPC_LOC_API_API_MAJOR_NUM = 0x0001; +typedef bool rpc_boolean; +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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; +}; + +struct rpc_loc_nmea_report_s_type { + rpc_uint16 length; + opaque nmea_sentences; +}; + +enum rpc_loc_status_event_e_type { + RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, + 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 +}; + +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; + 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_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; +}; + +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; + 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_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; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_qop_s_type { + unsigned char bit_mask; + unsigned char horacc; + unsigned char veracc; + unsigned char 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; +}; + +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; + 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; + 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; +}; + +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; + 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_MAX = 268435456 +}; + +typedef string 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 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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + default: + void; +}; + +struct rpc_loc_server_request_s_type { + rpc_loc_server_request_e_type event; + rpc_loc_server_request_u_type payload; +}; + +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_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_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_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_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; +}; + +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 +}; + +struct rpc_loc_server_open_status_s_type { + rpc_loc_server_connection_handle conn_handle; + rpc_loc_server_open_status_e_type open_status; + string apn_name<>; +}; + +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; +}; + +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_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; + 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: + 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; + 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: + 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_RESERVED: + rpc_loc_reserved_payload_s_type reserved; + default: + void; +}; + +const RPC_LOC_API_NULL_VERSION = 0x00010001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c new file mode 100755 index 00000000..a68d94ff --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c @@ -0,0 +1,1458 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, RPC_LOC_API_MAX_SV_COUNT, + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) + 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_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; + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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; + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_u_char (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; + + if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) + 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; + + 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_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; + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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_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; + 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_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_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; + 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_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; + 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) + return FALSE; + if (!xdr_string (xdrs, &objp->apn_name, ~0)) + 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_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_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; + 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: + 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; + 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: + 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_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/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c new file mode 100755 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c new file mode 100755 index 00000000..7e6a3e16 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c @@ -0,0 +1,188 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/rpc_inc/debug.h b/loc_api/libloc_api-rpc/rpc_inc/debug.h new file mode 100755 index 00000000..a71b23a0 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/debug.h @@ -0,0 +1,57 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" +#include + +#define PRINT(x...) do { \ + fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ + fprintf(stdout, ##x); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api.h new file mode 100755 index 00000000..95f9be52 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api.h @@ -0,0 +1,214 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(); +extern bool_t rpc_loc_api_null_0x00010001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00010001(); +extern bool_t rpc_loc_open_0x00010001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(); +extern bool_t rpc_loc_close_0x00010001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00010001(); +extern bool_t rpc_loc_start_fix_0x00010001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); +extern bool_t rpc_loc_stop_fix_0x00010001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00010001(); +extern bool_t rpc_loc_ioctl_0x00010001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); +extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h new file mode 100755 index 00000000..cbc783d5 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h @@ -0,0 +1,81 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00010001_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_0x00010001(); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); +extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h new file mode 100755 index 00000000..66bfcb4f --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h @@ -0,0 +1,1047 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "rpc_inc/loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_OPEN_VERSION 0x00010001 +#define RPC_LOC_CLOSE_VERSION 0x00010001 +#define RPC_LOC_START_FIX_VERSION 0x00010001 +#define RPC_LOC_STOP_FIX_VERSION 0x00010001 +#define RPC_LOC_IOCTL_VERSION 0x00010001 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 +#define RPC_LOC_API_API_MAJOR_NUM 0x0001 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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; + struct { + u_int nmea_sentences_len; + char *nmea_sentences_val; + } nmea_sentences; +}; +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_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; + +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_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_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; + struct { + u_int addr_len; + char *addr_val; + } addr; +}; +typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; + struct { + u_int requestor_id_string_len; + char *requestor_id_string_val; + } requestor_id_string; + 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; + struct { + u_int client_name_string_len; + char *client_name_string_val; + } client_name_string; + 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; + u_char 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; + struct { + u_int ext_client_address_len; + char *ext_client_address_val; + } ext_client_address; +}; +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; + struct { + u_int lcs_codeword_string_len; + char *lcs_codeword_string_val; + } lcs_codeword_string; + 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; + struct { + u_int notification_text_len; + char *notification_text_val; + } notification_text; + 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; + +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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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; + +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_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_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_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_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; +}; +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; + +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; +}; +typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; + +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_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_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_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_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; +#define RPC_LOC_API_NULL_VERSION 0x00010001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h new file mode 100755 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h new file mode 100755 index 00000000..e855162e --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_api_rpc_glue.h + @brief: Loc API Android glue code header + + DESCRIPTION + Loc API Android glue code header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/17/09 dx Initial version + +$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ +======================================================================*/ + +#ifndef LOC_API_RPC_GLUE_H +#define LOC_API_RPC_GLUE_H + +/* Include RPC headers */ +#include "rpc_inc/loc_api_common.h" +#include "rpc_inc/loc_api.h" +#include "rpc_inc/loc_api_cb.h" +#include "rpc_inc/loc_api_fixup.h" + +#ifdef __cplusplus +extern "C" +{ +#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 + +extern int loc_api_glue_init(void); +extern int loc_api_null(void); + +typedef int32 (loc_event_cb_f_type)( + 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 */ +); + +extern rpc_loc_client_handle_type loc_open( + rpc_loc_event_mask_type event_reg_mask, + loc_event_cb_f_type *event_callback +); + +extern int32 loc_close +( + 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 +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h new file mode 100755 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c new file mode 100755 index 00000000..930ff1c4 --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#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 "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00010001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c new file mode 100755 index 00000000..511080c0 --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c @@ -0,0 +1,61 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_inc/loc_api_common.h" +#include "rpc_inc/loc_api.h" +#include "rpc_inc/loc_api_cb.h" +#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; + } + xprt_unregister(svrPort); + svc_destroy(svrPort); + //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); + svrPort = NULL; +} diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk new file mode 100755 index 00000000..bc8e4ae2 --- /dev/null +++ b/loc_api/libloc_api/Android.mk @@ -0,0 +1,45 @@ +#Copyright (c) 2009, QUALCOMM USA, INC. +#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + +ifneq ($(BUILD_TINY_ANDROID),true) + +AMSS_VERSION:=6356 + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api + +LOCAL_STATIC_LIBRARIES:= \ + libloc_api-rpc + +LOCAL_SHARED_LIBRARIES := \ + librpc \ + libutils \ + libcutils + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_ioctl.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_PRELINK_MODULE := false +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID + diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp new file mode 100755 index 00000000..acc4dfd6 --- /dev/null +++ b/loc_api/libloc_api/loc_eng.cpp @@ -0,0 +1,1380 @@ +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "loc_api_rpc_glue.h" +#include "loc_apicb_appinit.h" + +#include +#include +#include +#include + +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define DEBUG_MOCK_NI 0 + +// Function declarations for sLocEngInterface +static int loc_eng_init(GpsCallbacks* callbacks); +static int loc_eng_start(); +static int loc_eng_stop(); +static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency); +static void loc_eng_cleanup(); +static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); +static int loc_eng_inject_location(double latitude, double longitude, float accuracy); +static void loc_eng_delete_aiding_data (GpsAidingData f); +static const void* loc_eng_get_extension(const char* name); + +// Function declarations for sLocEngAGpsInterface +static void loc_eng_agps_init(AGpsCallbacks* callbacks); +static int loc_eng_agps_data_conn_open(const char* apn); +static int loc_eng_agps_data_conn_closed(); +static int loc_eng_agps_data_conn_failed(); +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); + + +static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload); +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); +static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_report_ptr); +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); + +static void* loc_eng_process_deferred_action (void* arg); +static void loc_eng_process_atl_deferred_action (void); +static void loc_eng_delete_aiding_data_deferred_action (void); + +static int set_agps_server(); + +// Defines the GpsInterface in gps.h +static const GpsInterface sLocEngInterface = +{ + loc_eng_init, + loc_eng_start, + loc_eng_stop, + loc_eng_cleanup, + loc_eng_inject_time, + loc_eng_inject_location, + loc_eng_delete_aiding_data, + loc_eng_set_position_mode, + loc_eng_get_extension, +}; + +static const AGpsInterface sLocEngAGpsInterface = +{ + loc_eng_agps_init, + loc_eng_agps_data_conn_open, + loc_eng_agps_data_conn_closed, + loc_eng_agps_data_conn_failed, + loc_eng_agps_set_server, +}; + +// Global data structure for location engine +loc_eng_data_s_type loc_eng_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + property_get("gps.disable", propBuf, ""); + if (propBuf[0] == '1') + { + LOGD("gps_get_interface returning NULL because gps.disable=1\n"); + return NULL; + } + + return &sLocEngInterface; +} + +/*=========================================================================== +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 + +===========================================================================*/ +static int loc_eng_init(GpsCallbacks* callbacks) +{ + // Start the LOC api RPC service + loc_api_glue_init (); + + memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); + + // LOC ENG module data initialization + 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; + + rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | + RPC_LOC_EVENT_SATELLITE_REPORT | + RPC_LOC_EVENT_LOCATION_SERVER_REQUEST | + RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST | + RPC_LOC_EVENT_IOCTL_REPORT | + RPC_LOC_EVENT_STATUS_REPORT | + RPC_LOC_EVENT_NMEA_POSITION_REPORT | + RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + + loc_eng_data.client_handle = loc_open (event, loc_event_cb); + + pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); + pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); + loc_eng_data.deferred_action_thread_need_exit = FALSE; + + loc_eng_data.data_connection_succeeded = FALSE; + loc_eng_data.data_connection_closed = FALSE; + loc_eng_data.data_connection_failed = FALSE; + memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); + + loc_eng_data.aiding_data_for_deletion = 0; + loc_eng_data.engine_status = GPS_STATUS_NONE; + + // XTRA module data initialization + loc_eng_data.xtra_module_data.download_request_cb = NULL; + + // IOCTL module data initialization + loc_eng_data.ioctl_data.cb_is_selected = FALSE; + loc_eng_data.ioctl_data.cb_is_waiting = FALSE; + loc_eng_data.ioctl_data.client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; + memset (&(loc_eng_data.ioctl_data.cb_payload), + 0, + sizeof (rpc_loc_ioctl_callback_s_type)); + + pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); + pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); + + loc_eng_data.deferred_action_thread = NULL; + pthread_create (&(loc_eng_data.deferred_action_thread), + NULL, + loc_eng_process_deferred_action, + NULL); + + LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_cleanup + +DESCRIPTION + Cleans location engine. The location client handle will be released. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_cleanup() +{ + if (loc_eng_data.deferred_action_thread) + { + /* Terminate deferred action working thread */ + pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); + loc_eng_data.deferred_action_thread_need_exit = TRUE; + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + + void* ignoredValue; + pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); + loc_eng_data.deferred_action_thread = NULL; + } + + // clean up + (void) loc_close (loc_eng_data.client_handle); + + pthread_mutex_destroy (&loc_eng_data.deferred_action_mutex); + pthread_cond_destroy (&loc_eng_data.deferred_action_cond); + + pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); + pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); + + // RPC glue code + loc_apicb_app_deinit(); +} + + +/*=========================================================================== +FUNCTION loc_eng_start + +DESCRIPTION + Starts the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_start() +{ + int ret_val; + LOGD ("loc_eng_start\n"); + + if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && + loc_eng_data.agps_server_host[0] != 0 && + loc_eng_data.agps_server_port != 0) { + int result = set_agps_server(); + LOGD ("set_agps_server returned = %d\n", result); + } + + ret_val = loc_start_fix (loc_eng_data.client_handle); + + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_start returned error = %d\n", ret_val); + } + + return 0; +} + + +/*=========================================================================== +FUNCTION loc_eng_stop + +DESCRIPTION + Stops the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_stop() +{ + int ret_val; + + LOGD ("loc_eng_stop\n"); + + ret_val = loc_stop_fix (loc_eng_data.client_handle); + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_stop returned error = %d\n", ret_val); + } + + return 0; +} + +static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + + LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + (int32) loc_eng_data.client_handle, lock_type); + + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; + 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*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_gps_lock mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_set_position_mode + +DESCRIPTION + Sets the mode and fix frequnecy (in seconds) for the tracking session. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + boolean ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) loc_eng_data.client_handle, fix_frequency, mode); + + loc_eng_data.position_mode = mode; + ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + + fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); + fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL | + RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | + RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; + fix_criteria_ptr->min_interval = fix_frequency * 1000; // Translate to ms + fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX; + + if (mode == GPS_POSITION_MODE_MS_BASED) + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; + } + else if (mode == GPS_POSITION_MODE_MS_ASSISTED) + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; + } + // Default: standalone + else + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; + } + + ret_val = loc_eng_ioctl(loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_FIX_CRITERIA, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_position mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_time + +DESCRIPTION + This is used by Java native function to do time injection. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_inject_time (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; + boolean ret_val; + + LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; + + 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)(android::elapsedRealtime() - timeReference); + time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_UTC_TIME, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_inject_time failed\n"); + } + + return 0; +} + +static int loc_eng_inject_location (double latitude, double longitude, float accuracy) +{ + /* not yet implemented */ + 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 + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data (GpsAidingData f) +{ + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + // If this is DELETE ALL + if (f == GPS_DELETE_ALL) + { + loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; + } + else + { + // Currently, LOC API only support deletion of all aiding data, + // since the Android defined aiding data mask matches with modem, + // so just pass them down without any translation + loc_eng_data.aiding_data_for_deletion |= f; + } + + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); +} + +/*=========================================================================== +FUNCTION loc_eng_get_extension + +DESCRIPTION + Get the gps extension to support XTRA. + +DEPENDENCIES + N/A + +RETURN VALUE + The GPS extension interface. + +SIDE EFFECTS + N/A + +===========================================================================*/ +static const void* loc_eng_get_extension(const char* name) +{ + if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + { + return &sLocEngXTRAInterface; + } + else if (strcmp(name, AGPS_INTERFACE) == 0) + { + return &sLocEngAGpsInterface; + } + else if (strcmp(name, GPS_NI_INTERFACE) == 0) + { + return &sLocEngNiInterface; + } + + return NULL; +} + +#if DEBUG_MOCK_NI == 1 +/*=========================================================================== +FUNCTION mock_ni + +DESCRIPTION + DEBUG tool: simulate an NI request + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void* mock_ni(void* arg) +{ + static int busy = 0; + + if (busy) return NULL; + + busy = 1; + + sleep(5); + + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type payload; + rpc_loc_ni_event_s_type *ni_req; + rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + + client_handle = (rpc_loc_client_handle_type) arg; + + loc_event = RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + payload.disc = loc_event; + + ni_req = &payload.rpc_loc_event_payload_u_type_u.ni_request; + ni_req->event = RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ; + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + + // Encodings for Spirent Communications + char client_name[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + char requestor_id[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + + supl_req->flags = RPC_LOC_NI_CLIENT_NAME_PRESENT | + RPC_LOC_NI_REQUESTOR_ID_PRESENT | + RPC_LOC_NI_ENCODING_TYPE_PRESENT; + + supl_req->datacoding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + + supl_req->client_name.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; // no coding + supl_req->client_name.client_name_string.client_name_string_len = strlen(client_name); + supl_req->client_name.client_name_string.client_name_string_val = client_name; + supl_req->client_name.string_len = strlen(client_name); + + supl_req->requestor_id.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + supl_req->requestor_id.requestor_id_string.requestor_id_string_len = strlen(requestor_id); + supl_req->requestor_id.requestor_id_string.requestor_id_string_val = requestor_id; + supl_req->requestor_id.string_len = strlen(requestor_id); + + supl_req->notification_priv_type = RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP; + supl_req->user_response_timer = 10; + + loc_event_cb(client_handle, loc_event, &payload); + + busy = 0; + + return NULL; +} +#endif // DEBUG_MOCK_NI + +/*=========================================================================== +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( + rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload + ) +{ + LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + if (client_handle == loc_eng_data.client_handle) + { + if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) + { + loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); + } + + if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) + { + loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); + } + + if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) + { + loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); + } + + if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) + { + loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); + } + + // Android XTRA interface 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) + { + LOGD ("loc_event_cb: xtra download requst"); + + // Call Registered callback + if (loc_eng_data.xtra_module_data.download_request_cb != NULL) + { + loc_eng_data.xtra_module_data.download_request_cb (); + } + } + } + + if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) + { + // Process the received RPC_LOC_EVENT_IOCTL_REPORT + (void) loc_eng_ioctl_process_cb (client_handle, + &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); + } + + if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) + { + loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); + } + + loc_eng_ni_callback(loc_event, loc_event_payload); + +#if DEBUG_MOCK_NI == 1 + // DEBUG only + if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && + loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. + payload.rpc_loc_status_event_payload_u_type_u.engine_state + == RPC_LOC_ENGINE_STATE_OFF) + { + // Mock an NI request + pthread_t th; + pthread_create (&th, NULL, mock_ni, (void*) client_handle); + } +#endif /* DEBUG_MOCK_NI == 1 */ + } + else + { + LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + } + + return RPC_LOC_API_SUCCESS; +} + +/*=========================================================================== +FUNCTION loc_eng_report_position + +DESCRIPTION + Reports position information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location; + + LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); + + memset (&location, 0, sizeof (GpsLocation)); + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) + { + // Not a position report, return + if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS) + { + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + if (loc_eng_data.location_cb != NULL) + { + LOGV ("loc_eng_report_position: fire callback\n"); + loc_eng_data.location_cb (&location); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + } +} + +/*=========================================================================== +FUNCTION loc_eng_report_sv + +DESCRIPTION + Reports GPS satellite information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const rpc_loc_sv_info_s_type *sv_info_ptr; + + LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + (uint32) gnss_report_ptr->valid_mask, + gnss_report_ptr->sv_count); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + 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 (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].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.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) + { + 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++; + } + } + + LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) + { + loc_eng_data.sv_status_cb(&SvStatus); + } +} + +/*=========================================================================== +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 (const rpc_loc_status_event_s_type *status_report_ptr) +{ + GpsStatus status; + + LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + + memset (&status, 0, sizeof (GpsStatus)); + status.status = GPS_STATUS_NONE; + 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) + { + status.status = 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) + { + status.status = GPS_STATUS_SESSION_END; + } + } + + if ((status.status != GPS_STATUS_NONE) && (loc_eng_data.status_cb != NULL)) + { + LOGV ("loc_eng_report_status: issue callback with status %d\n", status.status); + loc_eng_data.status_cb (&status); + } + + pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); + loc_eng_data.engine_status = status.status; + + // Wake up the thread for aiding data deletion. + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); +} + +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + if (loc_eng_data.nmea_cb != NULL) + { + struct timeval tv; + + gettimeofday(&tv, (struct timezone *) NULL); + long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + + loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); + } +} + +/*=========================================================================== +FUNCTION loc_eng_process_conn_request + +DESCRIPTION + Requests data connection to be brought up/tore down with the location server. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) +{ + LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + + // Signal DeferredActionThread to send the APN name + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + + // This implemenation is based on the fact that modem now at any time has only one data connection for AGPS at any given time + if (server_request_ptr->event == RPC_LOC_SERVER_REQUEST_OPEN) + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; + loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; + } + else + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; + loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; + } + + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); +} + +/*=========================================================================== +FUNCTION loc_eng_agps_init + +DESCRIPTION + + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_agps_init(AGpsCallbacks* callbacks) +{ + LOGV("loc_eng_agps_init\n"); + loc_eng_data.agps_status_cb = callbacks->status_cb; +} + +static int loc_eng_agps_data_conn_open(const char* apn) +{ + int apn_len; + LOGD("loc_eng_agps_data_conn_open: %s\n", apn); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_succeeded = TRUE; + + if (apn != NULL) + { + apn_len = strlen (apn); + + if (apn_len >= sizeof(loc_eng_data.apn_name)) + { + LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + apn_len = sizeof(loc_eng_data.apn_name) - 1; + } + + memcpy (loc_eng_data.apn_name, apn, apn_len); + loc_eng_data.apn_name[apn_len] = '\0'; + } + + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_closed() +{ + LOGD("loc_eng_agps_data_conn_closed\n"); + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_closed = TRUE; +// DO WE NEED TO SIGNAL HERE? + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_failed() +{ + LOGD("loc_eng_agps_data_conn_failed\n"); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_failed = TRUE; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int set_agps_server() +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_server_info_s_type *server_info_ptr; + boolean ret_val; + uint16 port_temp; + char url[24]; + int len; + unsigned char *b_ptr; + + if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) + return -1; + + if (loc_eng_data.agps_server_address == 0) { + struct hostent* he = gethostbyname(loc_eng_data.agps_server_host); + if (he) + loc_eng_data.agps_server_address = *(uint32_t *)he->h_addr_list[0]; + } + if (loc_eng_data.agps_server_address == 0) + return -1; + + b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); + memset(url, 0, sizeof(url)); + snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + len = strlen (url); + + server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); + ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; + server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; + server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = len; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len= len; + + LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("set_agps_server failed\n"); + return -1; + } + else + { + LOGV ("set_agps_server successful\n"); + return 0; + } +} + +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) +{ + LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + + if (type != AGPS_TYPE_SUPL) + return -1; + + strncpy(loc_eng_data.agps_server_host, hostname, sizeof(loc_eng_data.agps_server_host) - 1); + loc_eng_data.agps_server_port = port; + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_delete_aiding_data_deferred_action + +DESCRIPTION + This is used to remove the aiding data when GPS engine is off. + +DEPENDENCIES + Assumes the aiding data type specified in GpsAidingData matches with + LOC API specification. + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data_deferred_action (void) +{ + // Currently, we only support deletion of all aiding data, + // since the Android defined aiding data mask matches with modem, + // so just pass them down without any translation + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_assist_data_delete_s_type *assist_data_ptr; + boolean ret_val; + + ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; + + assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); + if (loc_eng_data.aiding_data_for_deletion == GPS_DELETE_ALL) + { + assist_data_ptr->type = RPC_LOC_ASSIST_DATA_ALL; + } + else + { + assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; + } + memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_DELETE_ASSIST_DATA , + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_atl_deferred_action + +DESCRIPTION + This is used to inform the location engine of the processing status for + data connection open/close request. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_atl_deferred_action (void) +{ + rpc_loc_server_open_status_s_type *conn_open_status_ptr; + rpc_loc_server_close_status_s_type *conn_close_status_ptr; + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + int agps_status = -1; + + LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + + memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); + + if (loc_eng_data.data_connection_closed) + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; + conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); + conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; + conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; + loc_eng_data.data_connection_closed = FALSE; + } + else + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; + conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; + conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; + if (loc_eng_data.data_connection_succeeded) + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; + // Both buffer are of the same maximum size, and the source is null terminated + // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); + conn_open_status_ptr->apn_name = loc_eng_data.apn_name; + // Delay this so that PDSM ATL module will behave properly + sleep (1); + LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + loc_eng_data.data_connection_succeeded = FALSE; + } + else // data_connection_failed + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; + loc_eng_data.data_connection_failed = FALSE; + } + // Delay this so that PDSM ATL module will behave properly + sleep (1); + } + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + ioctl_data.disc, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_deferred_action + +DESCRIPTION + Main routine for the thread to execute certain commands + that are not safe to be done from within an RPC callback. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void* loc_eng_process_deferred_action (void* arg) +{ + LOGD("loc_eng_process_deferred_action started\n"); + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + // disable GPS lock + loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); + + while (loc_eng_data.deferred_action_thread_need_exit == FALSE) + { + // Wait until we are signalled to do a deferred action, or exit + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + pthread_cond_wait(&loc_eng_data.deferred_action_cond, + &loc_eng_data.deferred_action_mutex); + + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); + + if (loc_eng_data.deferred_action_thread_need_exit == TRUE) + { + break; + } + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + // send_delete_aiding_data must be done when GPS engine is off + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + loc_eng_delete_aiding_data_deferred_action (); + loc_eng_data.aiding_data_for_deletion = 0; + } + + if (loc_eng_data.data_connection_succeeded || + loc_eng_data.data_connection_closed || + loc_eng_data.data_connection_failed) + { + loc_eng_process_atl_deferred_action (); + } + + if (loc_eng_data.agps_status != 0 && loc_eng_data.agps_status_cb) { + AGpsStatus status; + status.type = AGPS_TYPE_SUPL; + status.status = loc_eng_data.agps_status; + loc_eng_data.agps_status_cb(&status); + loc_eng_data.agps_status = 0; + } + + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + } + + LOGD("loc_eng_process_deferred_action thread exiting\n"); + return NULL; +} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h new file mode 100755 index 00000000..bb8fe9d1 --- /dev/null +++ b/loc_api/libloc_api/loc_eng.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_eng.h + @brief: + + DESCRIPTION + This file defines the global data structure used by this module. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_H +#define LOC_ENG_H + +// 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 + +#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds + +// Module data +typedef struct +{ + rpc_loc_client_handle_type client_handle; + + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + int agps_status; + + loc_eng_xtra_data_s_type xtra_module_data; + + loc_eng_ioctl_data_s_type ioctl_data; + + boolean data_connection_succeeded; + boolean data_connection_closed; + boolean data_connection_failed; + // TBD: + char agps_server_host[256]; + int agps_server_port; + uint32 agps_server_address; + char apn_name[100]; + int position_mode; + rpc_loc_server_connection_handle conn_handle; + + // GPS engine status + GpsStatusValue engine_status; + + // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off + GpsAidingData aiding_data_for_deletion; + + // Data variables used by deferred action thread + pthread_t deferred_action_thread; + // Signal deferred action thread to exit + boolean deferred_action_thread_need_exit; + // Mutex used by deferred action thread + pthread_mutex_t deferred_action_mutex; + // Condition variable used by deferred action thread + pthread_cond_t deferred_action_cond; +} loc_eng_data_s_type; + +extern loc_eng_data_s_type loc_eng_data; + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp new file mode 100755 index 00000000..ff9d4813 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -0,0 +1,358 @@ + +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +// Function declarations +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type +); + +static boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr // Output parameter for IOCTL calls +); + +/*=========================================================================== + +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 + +===========================================================================*/ +boolean 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 + ) +{ + boolean ret_val; + int rpc_ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + // Select the callback we are waiting for + ret_val = loc_eng_ioctl_setup_cb (handle, ioctl_type); + + if (ret_val == TRUE) + { + rpc_ret_val = loc_ioctl (handle, + ioctl_type, + ioctl_data_ptr); + + LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + + if (rpc_ret_val == RPC_LOC_API_SUCCESS) + { + // Wait for the callback of loc_ioctl + ret_val = loc_eng_ioctl_wait_cb (timeout_msec, cb_data_ptr); + } + else + { + ret_val = FALSE; + } + } + + // Reset the state when we are done + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + ioctl_cb_data_ptr->cb_is_selected = FALSE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_setup_cb + +DESCRIPTION + Selects which callback is going to be waited for + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type + ) +{ + boolean ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (ioctl_cb_data_ptr->cb_is_selected == TRUE) + { + LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + ret_val = FALSE; + } + else + { + ioctl_cb_data_ptr->cb_is_selected = TRUE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + ioctl_cb_data_ptr->client_handle = handle; + ioctl_cb_data_ptr->ioctl_type = ioctl_type; + memset (&(ioctl_cb_data_ptr->cb_payload), 0, sizeof (rpc_loc_ioctl_callback_s_type)); + ret_val = TRUE; + } + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_wait_cb + +DESCRIPTION + Waits for a selected callback. The wait expires in timeout_msec. + + If the function is called before an existing wait has finished, it will + immediately return EBUSY. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + int rc; // return code from pthread calls + + struct timeval present_time; + struct timespec expire_time; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + + do { + if (ioctl_cb_data_ptr->cb_is_selected == FALSE) + { + LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + ret_val = FALSE; + break; + } + + // Calculate absolute expire time + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_sec += timeout_msec / 1000; + if ((present_time.tv_usec + timeout_msec) >= 1000) + { + expire_time.tv_sec += 1; + } + expire_time.tv_nsec = (present_time.tv_usec + timeout_msec) % 1000 * 1000; + + // Special case where callback is issued before loc_ioctl ever returns + if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) + { + LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + ret_val = TRUE; + break; + } + + ioctl_cb_data_ptr->cb_is_waiting = TRUE; + // Wait for the callback until timeout expires + rc = pthread_cond_timedwait(&ioctl_cb_data_ptr->cb_arrived_cond, + &ioctl_cb_data_ptr->cb_data_mutex, + &expire_time); + + if (rc == 0) + { + ret_val = TRUE; + } + else + { + ret_val = FALSE; + } + + LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + + } while (0); + + // Process the ioctl callback data when IOCTL is successful + if (ret_val == TRUE) + { + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + if (ioctl_cb_data_ptr->cb_payload.status == RPC_LOC_API_SUCCESS) + { + ret_val = TRUE; + if (cb_data_ptr != NULL) + { + memcpy (cb_data_ptr, + &(ioctl_cb_data_ptr->cb_payload), + sizeof (rpc_loc_ioctl_callback_s_type)); + } + } + else + { + ret_val = FALSE; + } + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_process_cb + +DESCRIPTION + This function process the IOCTL callback, parameter specifies the client + that receives the IOCTL callback. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_process_cb ( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (client_handle != ioctl_cb_data_ptr->client_handle) + { + LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); + ret_val = FALSE; + } + else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) + { + LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); + ret_val = FALSE; + } + else // both matches + { + memcpy (&(ioctl_cb_data_ptr->cb_payload), + cb_data_ptr, + sizeof (rpc_loc_ioctl_callback_s_type)); + + ioctl_cb_data_ptr->cb_has_arrived = TRUE; + + LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, + (int32) ioctl_cb_data_ptr->cb_payload.status); + + ret_val = TRUE; + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + // Signal the waiting thread that callback has arrived + if (ret_val == TRUE) + { + pthread_cond_signal (&ioctl_cb_data_ptr->cb_arrived_cond); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h new file mode 100755 index 00000000..4090a4d8 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -0,0 +1,75 @@ +/****************************************************************************** + @file: loc_eng_ioctl.h + @brief: + + DESCRIPTION + This file defines the data structure used by any location client that + waits for the ioctl particular event to occur. Any one IOCTL can be pending + at any time. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_IOCTL_H +#define LOC_ENG_IOCTL_H + +// Module data +typedef struct loc_eng_ioctl_data_s_type +{ + // We are waiting for an ioctl callback + boolean cb_is_selected; + // The thread has been put in a wait state for an ioctl callback + boolean cb_is_waiting; + // Loc client handle that is waiting for the callback + rpc_loc_client_handle_type client_handle; + // IOCTL type that the loc client is waiting for + rpc_loc_ioctl_e_type ioctl_type; + // The IOCLT report has arrived for the waiting client + boolean cb_has_arrived; + // The payload for the RPC_LOC_EVENT_IOCTL_REPORT + rpc_loc_ioctl_callback_s_type cb_payload; + // Mutex to access this data structure + pthread_mutex_t cb_data_mutex; + // LOC ioctl callback arrived mutex + pthread_cond_t cb_arrived_cond; +} loc_eng_ioctl_data_s_type; + + +extern boolean 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 +); + +extern boolean loc_eng_ioctl_process_cb +( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr +); +#endif // LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp new file mode 100755 index 00000000..d923855a --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -0,0 +1,616 @@ +/****************************************************************************** + @file: loc_eng_ni.cpp + @brief: module for network initiated interactions + + DESCRIPTION + LOC_API network initiated operation support + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- + Copyright (c) 2009 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + ----------------------------------------------------------------------------- +******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +07/30/09 dx Initial version + +$Id: +======================================================================*/ + +#define LOG_NDDEBUG 0 +#define LOG_NIDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +const GpsNiInterface sLocEngNiInterface = +{ + loc_eng_ni_init, + loc_eng_ni_respond, +}; + +boolean loc_eng_ni_data_init = FALSE; +loc_eng_ni_data_s_type loc_eng_ni_data; + +extern loc_eng_data_s_type loc_eng_data; + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ + +/*=========================================================================== + +FUNCTION respond_from_enum + +DESCRIPTION + Returns the name of the response + +RETURN VALUE + response name string + +===========================================================================*/ +static const char* respond_from_enum(rpc_loc_ni_user_resp_e_type resp) +{ + switch (resp) + { + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT: + return "accept"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY: + return "deny"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP: + return "no response"; + default: + return NULL; + } +} + +/*=========================================================================== + +FUNCTION loc_ni_respond + +DESCRIPTION + Displays the NI request and awaits user input. If a previous request is + in session, the new one is handled using sys.ni_default_response (if exists); + otherwise, it is denied. + +DEPENDENCY + Do not lock the data by mutex loc_ni_lock + +RETURN VALUE + none + +===========================================================================*/ +static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, + const rpc_loc_ni_event_s_type *request_pass_back +) +{ + LOGD("Sending NI response: %s\n", respond_from_enum(resp)); + + 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, + request_pass_back, sizeof (rpc_loc_ni_event_s_type)); + data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = resp; + + loc_eng_ioctl( + loc_eng_data.client_handle, + RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, + &data, + LOC_IOCTL_DEFAULT_TIMEOUT, + &callback_payload + ); +} + +/*=========================================================================== + +FUNCTION loc_ni_fill_notif_verify_type + +DESCRIPTION + Fills need_notify, need_verify, etc. + +RETURN VALUE + none + +===========================================================================*/ +static boolean loc_ni_fill_notif_verify_type(GpsNiNotification *notif, + rpc_loc_ni_notify_verify_e_type notif_priv) +{ + notif->notify_flags = 0; + notif->default_response = GPS_NI_RESPONSE_NORESP; + + switch (notif_priv) + { + case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: + notif->notify_flags = 0; + break; + + case RPC_LOC_NI_USER_NOTIFY_ONLY: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + 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; + break; + + 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; + break; + + case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return FALSE; + } + + return TRUE; +} + +/*=========================================================================== + +FUNCTION hexcode + +DESCRIPTION + Converts a binary array into a Hex string. E.g., 1F 00 3F --> "1F003F" + +RETURN VALUE + bytes encoded + +===========================================================================*/ +static 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; +} + +static GpsNiEncodingType convert_encoding_type(int loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case RPC_LOC_NI_SUPL_UTF8: + enc = GPS_ENC_SUPL_UTF8; + break; + case RPC_LOC_NI_SUPL_UCS2: + enc = GPS_ENC_SUPL_UCS2; + break; + case RPC_LOC_NI_SUPL_GSM_DEFAULT: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + default: + break; + } + + return enc; +} + +/*=========================================================================== + +FUNCTION loc_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 + +===========================================================================*/ +static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) +{ + GpsNiNotification notif; + strlcpy(notif.text, "[text]", sizeof notif.text); // defaults + strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); + + /* If busy, use default or deny */ + if (loc_eng_ni_data.notif_in_progress) + { +#if 0 + /* Cannot be here because the current thread is in RPC client */ + /* XXX Consider adding an event queue to process overlapped NI requests */ + loc_ni_user_resp_e_type response = + sys.ni_default_resp == 1 /* accept */ ? + LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT : + LOC_NI_LCS_NOTIFY_VERIFY_DENY; + + loc_ni_respond(response, ni_req); */ +#endif + LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + ni_req->event); + } + else { + /* Print notification */ + LOGD("NI Notification: %s, event: %d", msg, ni_req->event); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + /* Save request */ + memcpy(&loc_eng_ni_data.loc_ni_request, ni_req, sizeof loc_eng_ni_data.loc_ni_request); + + /* Set up NI response waiting */ + loc_eng_ni_data.notif_in_progress = TRUE; + loc_eng_ni_data.current_notif_id = abs(rand()); + + /* Fill in notification */ + notif.notification_id = loc_eng_ni_data.current_notif_id; + + const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req; + const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req; + + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + vx_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; + notif.ni_type = GPS_NI_TYPE_VOICE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // vx_req->user_resp_timer_val; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // 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 = convert_encoding_type(vx_req->encoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, vx_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + umts_cp_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // umts_cp_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Stores notification text + hexcode(notif.text, sizeof notif.text, + umts_cp_req->notification_text.notification_text_val, + umts_cp_req->notification_length); + + // Stores requestor ID + 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); + + notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, umts_cp_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // supl_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Client name + if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) + { + 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 */ + ); + LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + } else { + LOGD("SUPL NI: client_name not present."); + } + + // Requestor ID + if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) + { + 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 */ + ); + LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + } else { + LOGD("SUPL NI: requestor_id not present."); + } + + // Encoding type + if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) + { + notif.text_encoding = convert_encoding_type(supl_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(supl_req->datacoding_scheme); + } else { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); + + break; + + default: + LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + return; + } + + /* Log requestor ID and text for debugging */ + LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + + /* For robustness, always sets a timeout to clear up the notification status, even though + * the OEM layer in java does not do so. + **/ + loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); + LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + /* Notify callback */ + if (loc_eng_data.ni_notify_cb != NULL) + { + loc_eng_data.ni_notify_cb(¬if); + } + } +} + +/*=========================================================================== + +FUNCTION loc_ni_process_user_response + +DESCRIPTION + Handles user input from the UI + +RETURN VALUE + error code (0 for successful, -1 for error) + +===========================================================================*/ +int loc_ni_process_user_response(GpsUserResponseType userResponse) +{ + LOGD("NI response from UI: %d", userResponse); + + rpc_loc_ni_user_resp_e_type resp; + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; + break; + case GPS_NI_RESPONSE_DENY: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; + break; + case GPS_NI_RESPONSE_NORESP: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; + break; + default: + return -1; + } + + loc_ni_respond(resp, &loc_eng_ni_data.loc_ni_request); + + /* Make the NI respond */ + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.response_time_left = 0; + loc_eng_ni_data.current_notif_id = -1; + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + return 0; +} + +/*=========================================================================== + +FUNCTION loc_eng_ni_callback + +DESCRIPTION + Loc API callback handler + +RETURN VALUE + error code (0 for success) + +===========================================================================*/ +int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +) +{ + int rc = 0; + const rpc_loc_ni_event_s_type *ni_req = &loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request; + if (loc_event == RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) + { + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + LOGI("VX Notification"); + loc_ni_request_handler("VX Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + LOGI("UMTS CP Notification\n"); + loc_ni_request_handler("UMTS CP Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + LOGI("SUPL Notification\n"); + loc_ni_request_handler("SUPL Notify", ni_req); + break; + + default: + LOGE("Unknown NI event: %x\n", (int) ni_req->event); + break; + } + } + return rc; +} + +/*=========================================================================== + +FUNCTION loc_ni_thread_proc + +===========================================================================*/ +static void* loc_ni_thread_proc(void *threadid) +{ + LOGI("Starting Loc NI thread...\n"); + + while (1) + { + /* wakes up every second to check timed out requests */ + sleep(1); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + if (loc_eng_ni_data.notif_in_progress && loc_eng_ni_data.response_time_left > 0) + { + loc_eng_ni_data.response_time_left--; + if (loc_eng_ni_data.response_time_left <= 0) + { + loc_ni_respond(RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP, &loc_eng_ni_data.loc_ni_request); + loc_eng_ni_data.notif_in_progress = FALSE; + } + } + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + } /* while (1) */ + + pthread_exit(NULL); + return NULL; +} + +/*=========================================================================== + +FUNCTION loc_ni_thread_start + +===========================================================================*/ +static int loc_ni_thread_start(void) +{ + int rc = 0; + + rc = pthread_create(&loc_eng_ni_data.loc_ni_thread, NULL, loc_ni_thread_proc, NULL); + + if (rc) + { + LOGE("Loc NI thread is not created.\n"); + return -1; + } + + return 0; +} + +/*=========================================================================== +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(GpsNiCallbacks *callbacks) +{ + LOGD("loc_eng_ni_init: entered."); + + if (!loc_eng_ni_data_init) + { + pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); + loc_ni_thread_start(); + loc_eng_ni_data_init = TRUE; + } + + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.current_notif_id = -1; + loc_eng_ni_data.response_time_left = 0; + + srand(time(NULL)); + loc_eng_data.ni_notify_cb = callbacks->notify_cb; +} + +/*=========================================================================== +FUNCTION loc_eng_ni_respond + +DESCRIPTION + This function sends an NI respond to the modem processor + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) +{ + if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) + { + LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + loc_ni_process_user_response(user_response); + } else { + LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + notif_id, user_response); + } +} diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h new file mode 100755 index 00000000..b975b946 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -0,0 +1,56 @@ +/****************************************************************************** + @file: loc_eng_ni.cpp + @brief: module for network initiated interactions + + DESCRIPTION + LOC_API network initiated operation support + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- + Copyright (c) 2009 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + ----------------------------------------------------------------------------- +******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +07/30/09 dx Initial version + +$Id: +======================================================================*/ + +#ifndef LOC_ENG_NI_H +#define LOC_ENG_NI_H + +#include + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ + +extern const GpsNiInterface sLocEngNiInterface; + +typedef struct { + pthread_t loc_ni_thread; /* NI thread */ + pthread_mutex_t loc_ni_lock; + int response_time_left; /* examine time for NI response */ + boolean notif_in_progress; /* NI notification/verification in progress */ + rpc_loc_ni_event_s_type loc_ni_request; + int current_notif_id; /* ID to check against response */ +} loc_eng_ni_data_s_type; + +// Functions for sLocEngNiInterface +extern void loc_eng_ni_init(GpsNiCallbacks *callbacks); +extern void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response); + +extern int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +); + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp new file mode 100755 index 00000000..a3216531 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -0,0 +1,184 @@ +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) +#define XTRA_BLOCK_SIZE (400) + +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks); +static int qct_loc_eng_inject_xtra_data(char* data, int length); + +const GpsXtraInterface sLocEngXTRAInterface = +{ + qct_loc_eng_xtra_init, + qct_loc_eng_inject_xtra_data, +}; + +/*=========================================================================== +FUNCTION qct_loc_eng_xtra_init + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks) +{ + rpc_loc_event_mask_type event; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &(loc_eng_data.xtra_module_data); + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +FUNCTION qct_loc_eng_inject_xtra_data + +DESCRIPTION + Injects XTRA file into the engine. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_inject_xtra_data(char* data, int length) +{ + int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; + boolean ret_val = 0; + int total_parts; + uint8 part; + uint16 part_len; + uint16 len_injected; + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; + + LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_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 / XTRA_BLOCK_SIZE); + if ((total_parts % XTRA_BLOCK_SIZE) != 0) + { + total_parts += 1; + } + predicted_orbits_data_ptr->total_parts = total_parts; + + len_injected = 0; // O bytes injected + // 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; + + LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + + if (part < total_parts) + { + // No callback in this case + rpc_ret_val = loc_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data); + + if (rpc_ret_val != RPC_LOC_API_SUCCESS) + { + LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + ret_val = EINVAL; // return error + break; + } + } + else // part == total_parts + { + // Last part injection, will need to wait for callback + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data, + LOC_XTRA_INJECT_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + break; // done with injection + } + + len_injected += predicted_orbits_data_ptr->part_len; + LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h new file mode 100755 index 00000000..839fc06e --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -0,0 +1,47 @@ +/****************************************************************************** + @file: loc_eng.h + @brief: + + DESCRIPTION + This file defines the data structure used by this XTRA module. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_XTRA_H +#define LOC_ENG_XTRA_H + +extern const GpsXtraInterface sLocEngXTRAInterface; + +// Module data +typedef struct +{ + // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; + gps_xtra_download_request download_request_cb; + +} loc_eng_xtra_data_s_type; + +#endif // LOC_ENG_XTRA_H From 6774225c7860662a75ff580ded6f23b50dd8f324 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Fri, 22 Jan 2010 08:47:48 -0500 Subject: [PATCH 003/945] loc_api: Send GPS_STATUS_ENGINE_ON and GPS_STATUS_SESSION_END so GpsLocationProvider will release its wake lock when the GPS shuts down. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index acc4dfd6..8a1b05bb 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -523,7 +523,7 @@ static void loc_eng_delete_aiding_data (GpsAidingData f) loc_eng_data.aiding_data_for_deletion |= f; } - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); @@ -966,25 +966,25 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON) { + status.status = GPS_STATUS_ENGINE_ON; + loc_eng_data.status_cb (&status); status.status = GPS_STATUS_SESSION_BEGIN; + loc_eng_data.status_cb (&status); } else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) { status.status = GPS_STATUS_SESSION_END; + loc_eng_data.status_cb (&status); + status.status = GPS_STATUS_ENGINE_OFF; + loc_eng_data.status_cb (&status); } } - if ((status.status != GPS_STATUS_NONE) && (loc_eng_data.status_cb != NULL)) - { - LOGV ("loc_eng_report_status: issue callback with status %d\n", status.status); - loc_eng_data.status_cb (&status); - } - pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); loc_eng_data.engine_status = status.status; // Wake up the thread for aiding data deletion. - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); @@ -1350,7 +1350,7 @@ static void* loc_eng_process_deferred_action (void* arg) pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); // send_delete_aiding_data must be done when GPS engine is off - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { loc_eng_delete_aiding_data_deferred_action (); From a28682a1351a2d5ea29d66f2d091b19e28c261ad Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Fri, 22 Jan 2010 14:41:54 -0500 Subject: [PATCH 004/945] Do not build unless BOARD_GPS_LIBRARIES is set to libloc_api Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index cdb2dbde..39bc7414 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,4 +6,6 @@ # · Neither the name of the QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. +ifeq ($(BOARD_GPS_LIBRARIES),libloc_api) include $(call all-subdir-makefiles) +endif From 24d7556a88537061aaef7c58588813c0faf98c21 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 2 Feb 2010 11:51:35 -0500 Subject: [PATCH 005/945] loc_api: Process all events in deferred action thread. It is not safe to call into framework code from an RPC callback. Change-Id: Idb85590f5648b85ba4dd352136f89652b3128fbe Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 226 ++++++++++++++++++++------------- loc_api/libloc_api/loc_eng.h | 4 + 2 files changed, 142 insertions(+), 88 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 8a1b05bb..fd1db4e3 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -92,7 +92,8 @@ static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_p static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); static void* loc_eng_process_deferred_action (void* arg); -static void loc_eng_process_atl_deferred_action (void); +static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, + boolean data_connection_closed); static void loc_eng_delete_aiding_data_deferred_action (void); static int set_agps_server(); @@ -200,6 +201,7 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); loc_eng_data.deferred_action_thread_need_exit = FALSE; + loc_eng_data.loc_event = 0; loc_eng_data.data_connection_succeeded = FALSE; loc_eng_data.data_connection_closed = FALSE; loc_eng_data.data_connection_failed = FALSE; @@ -668,68 +670,12 @@ static int32 loc_event_cb( LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); if (client_handle == loc_eng_data.client_handle) { - if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) - { - loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); - } + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + loc_eng_data.loc_event = loc_event; + memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); - if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) - { - loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); - } - - if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) - { - loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); - } - - if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) - { - loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); - } - - // Android XTRA interface 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) - { - LOGD ("loc_event_cb: xtra download requst"); - - // Call Registered callback - if (loc_eng_data.xtra_module_data.download_request_cb != NULL) - { - loc_eng_data.xtra_module_data.download_request_cb (); - } - } - } - - if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) - { - // Process the received RPC_LOC_EVENT_IOCTL_REPORT - (void) loc_eng_ioctl_process_cb (client_handle, - &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); - } - - if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) - { - loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); - } - - loc_eng_ni_callback(loc_event, loc_event_payload); - -#if DEBUG_MOCK_NI == 1 - // DEBUG only - if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && - loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. - payload.rpc_loc_status_event_payload_u_type_u.engine_state - == RPC_LOC_ENGINE_STATE_OFF) - { - // Mock an NI request - pthread_t th; - pthread_create (&th, NULL, mock_ni, (void*) client_handle); - } -#endif /* DEBUG_MOCK_NI == 1 */ + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); } else { @@ -966,15 +912,13 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON) { - status.status = GPS_STATUS_ENGINE_ON; - loc_eng_data.status_cb (&status); + // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON status.status = GPS_STATUS_SESSION_BEGIN; loc_eng_data.status_cb (&status); } else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) { - status.status = GPS_STATUS_SESSION_END; - loc_eng_data.status_cb (&status); + // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF status.status = GPS_STATUS_ENGINE_OFF; loc_eng_data.status_cb (&status); } @@ -1252,7 +1196,8 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_eng_process_atl_deferred_action (void) +static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, + boolean data_connection_closed) { rpc_loc_server_open_status_s_type *conn_open_status_ptr; rpc_loc_server_close_status_s_type *conn_close_status_ptr; @@ -1264,20 +1209,19 @@ static void loc_eng_process_atl_deferred_action (void) memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - if (loc_eng_data.data_connection_closed) + if (data_connection_closed) { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; - loc_eng_data.data_connection_closed = FALSE; } else { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; - if (loc_eng_data.data_connection_succeeded) + if (data_connection_succeeded) { conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; // Both buffer are of the same maximum size, and the source is null terminated @@ -1286,12 +1230,10 @@ static void loc_eng_process_atl_deferred_action (void) // Delay this so that PDSM ATL module will behave properly sleep (1); LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); - loc_eng_data.data_connection_succeeded = FALSE; } else // data_connection_failed { conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; - loc_eng_data.data_connection_failed = FALSE; } // Delay this so that PDSM ATL module will behave properly sleep (1); @@ -1306,6 +1248,89 @@ static void loc_eng_process_atl_deferred_action (void) LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); } +/*=========================================================================== +FUNCTION loc_eng_process_loc_event + +DESCRIPTION + This is used to process events received from the location engine. + +DEPENDENCIES + None + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, + rpc_loc_event_payload_u_type* loc_event_payload) +{ + if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) + { + loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); + } + + if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) + { + loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); + } + + if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) + { + loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); + } + + if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) + { + loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); + } + + // Android XTRA interface 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) + { + LOGD ("loc_event_cb: xtra download requst"); + + // Call Registered callback + if (loc_eng_data.xtra_module_data.download_request_cb != NULL) + { + loc_eng_data.xtra_module_data.download_request_cb (); + } + } + } + + if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) + { + // Process the received RPC_LOC_EVENT_IOCTL_REPORT + (void) loc_eng_ioctl_process_cb (loc_eng_data.client_handle, + &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); + } + + if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) + { + loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); + } + + loc_eng_ni_callback(loc_event, loc_event_payload); + +#if DEBUG_MOCK_NI == 1 + // DEBUG only + if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && + loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. + payload.rpc_loc_status_event_payload_u_type_u.engine_state + == RPC_LOC_ENGINE_STATE_OFF) + { + // Mock an NI request + pthread_t th; + pthread_create (&th, NULL, mock_ni, (void*) client_handle); + } +#endif /* DEBUG_MOCK_NI == 1 */ +} + /*=========================================================================== FUNCTION loc_eng_process_deferred_action @@ -1325,6 +1350,9 @@ SIDE EFFECTS ===========================================================================*/ static void* loc_eng_process_deferred_action (void* arg) { + AGpsStatus status; + status.type = AGPS_TYPE_SUPL; + LOGD("loc_eng_process_deferred_action started\n"); // make sure we do not run in background scheduling group @@ -1335,44 +1363,66 @@ static void* loc_eng_process_deferred_action (void* arg) while (loc_eng_data.deferred_action_thread_need_exit == FALSE) { + GpsAidingData aiding_data_for_deletion; + GpsStatusValue engine_status; + boolean data_connection_succeeded; + boolean data_connection_closed; + boolean data_connection_failed; + + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + // Wait until we are signalled to do a deferred action, or exit pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); pthread_cond_wait(&loc_eng_data.deferred_action_cond, &loc_eng_data.deferred_action_mutex); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - if (loc_eng_data.deferred_action_thread_need_exit == TRUE) { + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); break; } - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + // copy anything we need before releasing the mutex + loc_event = loc_eng_data.loc_event; + if (loc_event != 0) { + memcpy(&loc_event_payload, &loc_eng_data.loc_event_payload, sizeof(loc_event_payload)); + loc_eng_data.loc_event = 0; + } + + engine_status = loc_eng_data.agps_status; + aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; + status.status = loc_eng_data.agps_status; + loc_eng_data.agps_status = 0; + data_connection_succeeded = loc_eng_data.data_connection_succeeded; + data_connection_closed = loc_eng_data.data_connection_closed; + data_connection_failed = loc_eng_data.data_connection_failed; + loc_eng_data.data_connection_closed = FALSE; + loc_eng_data.data_connection_succeeded = FALSE; + loc_eng_data.data_connection_failed = FALSE; + + // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + + if (loc_event != 0) { + loc_eng_process_loc_event(loc_event, &loc_event_payload); + } // send_delete_aiding_data must be done when GPS engine is off - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) + if ((engine_status != GPS_STATUS_SESSION_BEGIN) && (aiding_data_for_deletion != 0)) { loc_eng_delete_aiding_data_deferred_action (); - loc_eng_data.aiding_data_for_deletion = 0; } - if (loc_eng_data.data_connection_succeeded || - loc_eng_data.data_connection_closed || - loc_eng_data.data_connection_failed) + if (data_connection_succeeded || data_connection_closed || data_connection_failed) { - loc_eng_process_atl_deferred_action (); + loc_eng_process_atl_deferred_action(data_connection_succeeded, data_connection_closed); } - if (loc_eng_data.agps_status != 0 && loc_eng_data.agps_status_cb) { - AGpsStatus status; - status.type = AGPS_TYPE_SUPL; - status.status = loc_eng_data.agps_status; + if (status.status != 0 && loc_eng_data.agps_status_cb) { loc_eng_data.agps_status_cb(&status); - loc_eng_data.agps_status = 0; } - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); } LOGD("loc_eng_process_deferred_action thread exiting\n"); diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index bb8fe9d1..979e4231 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -68,6 +68,10 @@ typedef struct loc_eng_ioctl_data_s_type ioctl_data; + // data from loc_event_cb + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + boolean data_connection_succeeded; boolean data_connection_closed; boolean data_connection_failed; From ffaff8a84abb8e3e0fa7fa94669265dac5ef3165 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 2 Feb 2010 09:49:50 -0800 Subject: [PATCH 006/945] empty first commit From dd710e32d553fb458283b12d4d32b45d0e205e70 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 21 Jan 2010 23:49:31 -0500 Subject: [PATCH 007/945] Initial commit of Qualcomm's loc_api GPS library for the MSM platform. Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 9 + loc_api/NOTICE | 13 + loc_api/libloc_api-rpc/Android.mk | 66 + loc_api/libloc_api-rpc/gen-6356/Makefile.xdr | 38 + loc_api/libloc_api-rpc/gen-6356/loc_api.xdr | 164 ++ .../libloc_api-rpc/gen-6356/loc_api_cb.xdr | 90 + .../libloc_api-rpc/gen-6356/loc_api_cb_svc.c | 81 + .../libloc_api-rpc/gen-6356/loc_api_cb_xdr.c | 49 + .../libloc_api-rpc/gen-6356/loc_api_clnt.c | 99 ++ .../gen-6356/loc_api_common.xdr | 803 +++++++++ .../gen-6356/loc_api_common_xdr.c | 1458 +++++++++++++++++ .../libloc_api-rpc/gen-6356/loc_api_fixup.c | 48 + loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c | 188 +++ loc_api/libloc_api-rpc/rpc_inc/debug.h | 57 + loc_api/libloc_api-rpc/rpc_inc/loc_api.h | 214 +++ loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h | 81 + .../libloc_api-rpc/rpc_inc/loc_api_common.h | 1047 ++++++++++++ .../libloc_api-rpc/rpc_inc/loc_api_fixup.h | 188 +++ .../libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h | 100 ++ .../rpc_inc/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c | 339 ++++ .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 + loc_api/libloc_api/Android.mk | 45 + loc_api/libloc_api/loc_eng.cpp | 1380 ++++++++++++++++ loc_api/libloc_api/loc_eng.h | 100 ++ loc_api/libloc_api/loc_eng_ioctl.cpp | 358 ++++ loc_api/libloc_api/loc_eng_ioctl.h | 75 + loc_api/libloc_api/loc_eng_ni.cpp | 616 +++++++ loc_api/libloc_api/loc_eng_ni.h | 56 + loc_api/libloc_api/loc_eng_xtra.cpp | 184 +++ loc_api/libloc_api/loc_eng_xtra.h | 47 + 31 files changed, 8088 insertions(+) create mode 100755 loc_api/Android.mk create mode 100644 loc_api/NOTICE create mode 100755 loc_api/libloc_api-rpc/Android.mk create mode 100755 loc_api/libloc_api-rpc/gen-6356/Makefile.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c create mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c create mode 100755 loc_api/libloc_api-rpc/rpc_inc/debug.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h create mode 100755 loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c create mode 100755 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api/Android.mk create mode 100755 loc_api/libloc_api/loc_eng.cpp create mode 100755 loc_api/libloc_api/loc_eng.h create mode 100755 loc_api/libloc_api/loc_eng_ioctl.cpp create mode 100755 loc_api/libloc_api/loc_eng_ioctl.h create mode 100755 loc_api/libloc_api/loc_eng_ni.cpp create mode 100755 loc_api/libloc_api/loc_eng_ni.h create mode 100755 loc_api/libloc_api/loc_eng_xtra.cpp create mode 100755 loc_api/libloc_api/loc_eng_xtra.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk new file mode 100755 index 00000000..cdb2dbde --- /dev/null +++ b/loc_api/Android.mk @@ -0,0 +1,9 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 $(call all-subdir-makefiles) diff --git a/loc_api/NOTICE b/loc_api/NOTICE new file mode 100644 index 00000000..85b5740d --- /dev/null +++ b/loc_api/NOTICE @@ -0,0 +1,13 @@ +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk new file mode 100755 index 00000000..f5d40089 --- /dev/null +++ b/loc_api/libloc_api-rpc/Android.mk @@ -0,0 +1,66 @@ +#Copyright (c) 2009, QUALCOMM USA, INC. +#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +RPC_INC:=rpc_inc + +AMSS_VERSION:=6356 + +generated_files:= \ + gen-$(AMSS_VERSION)/loc_api_clnt.c \ + gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ + gen-$(AMSS_VERSION)/loc_api_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_fixup.c \ + src/loc_api_rpc_glue.c \ + src/loc_apicb_appinit.c + +LOCAL_SRC_FILES:= $(generated_files) + +# removed from library build since the client should implement this code. +# src/loc_api_cb_server.c + +LOCAL_CFLAGS:=-fno-short-enums +# LOCAL_CFLAGS+=-include $(RPC_INC)/commondefs.h +LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h +LOCAL_CFLAGS+=-DDEBUG +# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE + +LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL + +LOCAL_SHARED_LIBRARIES:= librpc +LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc + +LOCAL_PRELINK_MODULE:= false + +LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/$(RPC_INC) +LOCAL_COPY_HEADERS:= \ + $(RPC_INC)/debug.h \ + $(RPC_INC)/loc_api_cb.h \ + $(RPC_INC)/loc_api_common.h \ + $(RPC_INC)/loc_api.h \ + $(RPC_INC)/loc_api_fixup.h \ + $(RPC_INC)/loc_api_rpc_glue.h \ + $(RPC_INC)/loc_apicb_appinit.h + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/$(RPC_INC) \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_MODULE:= libloc_api-rpc + +include $(BUILD_STATIC_LIBRARY) + +endif diff --git a/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr b/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr new file mode 100755 index 00000000..e6e863fa --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr @@ -0,0 +1,38 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + + +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:=rpc_inc + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr new file mode 100755 index 00000000..981266b3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr @@ -0,0 +1,164 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3000008c; + +const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr new file mode 100755 index 00000000..3f53504b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr @@ -0,0 +1,90 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3100008c; + +const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c new file mode 100755 index 00000000..3b94e624 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c @@ -0,0 +1,81 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c new file mode 100755 index 00000000..51bb47f6 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c @@ -0,0 +1,49 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c new file mode 100755 index 00000000..886e5e53 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c @@ -0,0 +1,99 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr new file mode 100755 index 00000000..7ef6357c --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr @@ -0,0 +1,803 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_OPEN_VERSION = 0x00010001; +const RPC_LOC_CLOSE_VERSION = 0x00010001; +const RPC_LOC_START_FIX_VERSION = 0x00010001; +const RPC_LOC_STOP_FIX_VERSION = 0x00010001; +const RPC_LOC_IOCTL_VERSION = 0x00010001; +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; +const RPC_LOC_API_API_MAJOR_NUM = 0x0001; +typedef bool rpc_boolean; +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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; +}; + +struct rpc_loc_nmea_report_s_type { + rpc_uint16 length; + opaque nmea_sentences; +}; + +enum rpc_loc_status_event_e_type { + RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, + 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 +}; + +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; + 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_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; +}; + +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; + 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_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; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_qop_s_type { + unsigned char bit_mask; + unsigned char horacc; + unsigned char veracc; + unsigned char 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; +}; + +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; + 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; + 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; +}; + +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; + 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_MAX = 268435456 +}; + +typedef string 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 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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + default: + void; +}; + +struct rpc_loc_server_request_s_type { + rpc_loc_server_request_e_type event; + rpc_loc_server_request_u_type payload; +}; + +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_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_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_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_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; +}; + +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 +}; + +struct rpc_loc_server_open_status_s_type { + rpc_loc_server_connection_handle conn_handle; + rpc_loc_server_open_status_e_type open_status; + string apn_name<>; +}; + +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; +}; + +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_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; + 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: + 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; + 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: + 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_RESERVED: + rpc_loc_reserved_payload_s_type reserved; + default: + void; +}; + +const RPC_LOC_API_NULL_VERSION = 0x00010001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c new file mode 100755 index 00000000..a68d94ff --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c @@ -0,0 +1,1458 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, RPC_LOC_API_MAX_SV_COUNT, + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) + 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_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; + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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; + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_u_char (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; + + if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) + 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; + + 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_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; + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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_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; + 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_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_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; + 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_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; + 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) + return FALSE; + if (!xdr_string (xdrs, &objp->apn_name, ~0)) + 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_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_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; + 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: + 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; + 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: + 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_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/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c new file mode 100755 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c new file mode 100755 index 00000000..7e6a3e16 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c @@ -0,0 +1,188 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/rpc_inc/debug.h b/loc_api/libloc_api-rpc/rpc_inc/debug.h new file mode 100755 index 00000000..a71b23a0 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/debug.h @@ -0,0 +1,57 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" +#include + +#define PRINT(x...) do { \ + fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ + fprintf(stdout, ##x); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api.h new file mode 100755 index 00000000..95f9be52 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api.h @@ -0,0 +1,214 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(); +extern bool_t rpc_loc_api_null_0x00010001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00010001(); +extern bool_t rpc_loc_open_0x00010001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(); +extern bool_t rpc_loc_close_0x00010001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00010001(); +extern bool_t rpc_loc_start_fix_0x00010001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); +extern bool_t rpc_loc_stop_fix_0x00010001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00010001(); +extern bool_t rpc_loc_ioctl_0x00010001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); +extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h new file mode 100755 index 00000000..cbc783d5 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h @@ -0,0 +1,81 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00010001_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_0x00010001(); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); +extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h new file mode 100755 index 00000000..66bfcb4f --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h @@ -0,0 +1,1047 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "rpc_inc/loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_OPEN_VERSION 0x00010001 +#define RPC_LOC_CLOSE_VERSION 0x00010001 +#define RPC_LOC_START_FIX_VERSION 0x00010001 +#define RPC_LOC_STOP_FIX_VERSION 0x00010001 +#define RPC_LOC_IOCTL_VERSION 0x00010001 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 +#define RPC_LOC_API_API_MAJOR_NUM 0x0001 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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; + struct { + u_int nmea_sentences_len; + char *nmea_sentences_val; + } nmea_sentences; +}; +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_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; + +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_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_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; + struct { + u_int addr_len; + char *addr_val; + } addr; +}; +typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; + struct { + u_int requestor_id_string_len; + char *requestor_id_string_val; + } requestor_id_string; + 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; + struct { + u_int client_name_string_len; + char *client_name_string_val; + } client_name_string; + 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; + u_char 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; + struct { + u_int ext_client_address_len; + char *ext_client_address_val; + } ext_client_address; +}; +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; + struct { + u_int lcs_codeword_string_len; + char *lcs_codeword_string_val; + } lcs_codeword_string; + 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; + struct { + u_int notification_text_len; + char *notification_text_val; + } notification_text; + 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; + +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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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; + +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_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_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_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_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; +}; +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; + +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; +}; +typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; + +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_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_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_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_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; +#define RPC_LOC_API_NULL_VERSION 0x00010001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h new file mode 100755 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h new file mode 100755 index 00000000..e855162e --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_api_rpc_glue.h + @brief: Loc API Android glue code header + + DESCRIPTION + Loc API Android glue code header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/17/09 dx Initial version + +$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ +======================================================================*/ + +#ifndef LOC_API_RPC_GLUE_H +#define LOC_API_RPC_GLUE_H + +/* Include RPC headers */ +#include "rpc_inc/loc_api_common.h" +#include "rpc_inc/loc_api.h" +#include "rpc_inc/loc_api_cb.h" +#include "rpc_inc/loc_api_fixup.h" + +#ifdef __cplusplus +extern "C" +{ +#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 + +extern int loc_api_glue_init(void); +extern int loc_api_null(void); + +typedef int32 (loc_event_cb_f_type)( + 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 */ +); + +extern rpc_loc_client_handle_type loc_open( + rpc_loc_event_mask_type event_reg_mask, + loc_event_cb_f_type *event_callback +); + +extern int32 loc_close +( + 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 +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h new file mode 100755 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c new file mode 100755 index 00000000..930ff1c4 --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#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 "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00010001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c new file mode 100755 index 00000000..511080c0 --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c @@ -0,0 +1,61 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_inc/loc_api_common.h" +#include "rpc_inc/loc_api.h" +#include "rpc_inc/loc_api_cb.h" +#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; + } + xprt_unregister(svrPort); + svc_destroy(svrPort); + //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); + svrPort = NULL; +} diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk new file mode 100755 index 00000000..bc8e4ae2 --- /dev/null +++ b/loc_api/libloc_api/Android.mk @@ -0,0 +1,45 @@ +#Copyright (c) 2009, QUALCOMM USA, INC. +#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + +ifneq ($(BUILD_TINY_ANDROID),true) + +AMSS_VERSION:=6356 + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api + +LOCAL_STATIC_LIBRARIES:= \ + libloc_api-rpc + +LOCAL_SHARED_LIBRARIES := \ + librpc \ + libutils \ + libcutils + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_ioctl.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_PRELINK_MODULE := false +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID + diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp new file mode 100755 index 00000000..acc4dfd6 --- /dev/null +++ b/loc_api/libloc_api/loc_eng.cpp @@ -0,0 +1,1380 @@ +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "loc_api_rpc_glue.h" +#include "loc_apicb_appinit.h" + +#include +#include +#include +#include + +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define DEBUG_MOCK_NI 0 + +// Function declarations for sLocEngInterface +static int loc_eng_init(GpsCallbacks* callbacks); +static int loc_eng_start(); +static int loc_eng_stop(); +static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency); +static void loc_eng_cleanup(); +static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); +static int loc_eng_inject_location(double latitude, double longitude, float accuracy); +static void loc_eng_delete_aiding_data (GpsAidingData f); +static const void* loc_eng_get_extension(const char* name); + +// Function declarations for sLocEngAGpsInterface +static void loc_eng_agps_init(AGpsCallbacks* callbacks); +static int loc_eng_agps_data_conn_open(const char* apn); +static int loc_eng_agps_data_conn_closed(); +static int loc_eng_agps_data_conn_failed(); +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); + + +static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload); +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); +static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_report_ptr); +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); + +static void* loc_eng_process_deferred_action (void* arg); +static void loc_eng_process_atl_deferred_action (void); +static void loc_eng_delete_aiding_data_deferred_action (void); + +static int set_agps_server(); + +// Defines the GpsInterface in gps.h +static const GpsInterface sLocEngInterface = +{ + loc_eng_init, + loc_eng_start, + loc_eng_stop, + loc_eng_cleanup, + loc_eng_inject_time, + loc_eng_inject_location, + loc_eng_delete_aiding_data, + loc_eng_set_position_mode, + loc_eng_get_extension, +}; + +static const AGpsInterface sLocEngAGpsInterface = +{ + loc_eng_agps_init, + loc_eng_agps_data_conn_open, + loc_eng_agps_data_conn_closed, + loc_eng_agps_data_conn_failed, + loc_eng_agps_set_server, +}; + +// Global data structure for location engine +loc_eng_data_s_type loc_eng_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + property_get("gps.disable", propBuf, ""); + if (propBuf[0] == '1') + { + LOGD("gps_get_interface returning NULL because gps.disable=1\n"); + return NULL; + } + + return &sLocEngInterface; +} + +/*=========================================================================== +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 + +===========================================================================*/ +static int loc_eng_init(GpsCallbacks* callbacks) +{ + // Start the LOC api RPC service + loc_api_glue_init (); + + memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); + + // LOC ENG module data initialization + 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; + + rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | + RPC_LOC_EVENT_SATELLITE_REPORT | + RPC_LOC_EVENT_LOCATION_SERVER_REQUEST | + RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST | + RPC_LOC_EVENT_IOCTL_REPORT | + RPC_LOC_EVENT_STATUS_REPORT | + RPC_LOC_EVENT_NMEA_POSITION_REPORT | + RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + + loc_eng_data.client_handle = loc_open (event, loc_event_cb); + + pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); + pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); + loc_eng_data.deferred_action_thread_need_exit = FALSE; + + loc_eng_data.data_connection_succeeded = FALSE; + loc_eng_data.data_connection_closed = FALSE; + loc_eng_data.data_connection_failed = FALSE; + memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); + + loc_eng_data.aiding_data_for_deletion = 0; + loc_eng_data.engine_status = GPS_STATUS_NONE; + + // XTRA module data initialization + loc_eng_data.xtra_module_data.download_request_cb = NULL; + + // IOCTL module data initialization + loc_eng_data.ioctl_data.cb_is_selected = FALSE; + loc_eng_data.ioctl_data.cb_is_waiting = FALSE; + loc_eng_data.ioctl_data.client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; + memset (&(loc_eng_data.ioctl_data.cb_payload), + 0, + sizeof (rpc_loc_ioctl_callback_s_type)); + + pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); + pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); + + loc_eng_data.deferred_action_thread = NULL; + pthread_create (&(loc_eng_data.deferred_action_thread), + NULL, + loc_eng_process_deferred_action, + NULL); + + LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_cleanup + +DESCRIPTION + Cleans location engine. The location client handle will be released. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_cleanup() +{ + if (loc_eng_data.deferred_action_thread) + { + /* Terminate deferred action working thread */ + pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); + loc_eng_data.deferred_action_thread_need_exit = TRUE; + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + + void* ignoredValue; + pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); + loc_eng_data.deferred_action_thread = NULL; + } + + // clean up + (void) loc_close (loc_eng_data.client_handle); + + pthread_mutex_destroy (&loc_eng_data.deferred_action_mutex); + pthread_cond_destroy (&loc_eng_data.deferred_action_cond); + + pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); + pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); + + // RPC glue code + loc_apicb_app_deinit(); +} + + +/*=========================================================================== +FUNCTION loc_eng_start + +DESCRIPTION + Starts the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_start() +{ + int ret_val; + LOGD ("loc_eng_start\n"); + + if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && + loc_eng_data.agps_server_host[0] != 0 && + loc_eng_data.agps_server_port != 0) { + int result = set_agps_server(); + LOGD ("set_agps_server returned = %d\n", result); + } + + ret_val = loc_start_fix (loc_eng_data.client_handle); + + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_start returned error = %d\n", ret_val); + } + + return 0; +} + + +/*=========================================================================== +FUNCTION loc_eng_stop + +DESCRIPTION + Stops the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_stop() +{ + int ret_val; + + LOGD ("loc_eng_stop\n"); + + ret_val = loc_stop_fix (loc_eng_data.client_handle); + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_stop returned error = %d\n", ret_val); + } + + return 0; +} + +static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + + LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + (int32) loc_eng_data.client_handle, lock_type); + + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; + 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*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_gps_lock mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_set_position_mode + +DESCRIPTION + Sets the mode and fix frequnecy (in seconds) for the tracking session. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + boolean ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) loc_eng_data.client_handle, fix_frequency, mode); + + loc_eng_data.position_mode = mode; + ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + + fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); + fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL | + RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | + RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; + fix_criteria_ptr->min_interval = fix_frequency * 1000; // Translate to ms + fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX; + + if (mode == GPS_POSITION_MODE_MS_BASED) + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; + } + else if (mode == GPS_POSITION_MODE_MS_ASSISTED) + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; + } + // Default: standalone + else + { + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; + } + + ret_val = loc_eng_ioctl(loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_FIX_CRITERIA, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_position mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_time + +DESCRIPTION + This is used by Java native function to do time injection. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_inject_time (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; + boolean ret_val; + + LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; + + 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)(android::elapsedRealtime() - timeReference); + time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_UTC_TIME, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_inject_time failed\n"); + } + + return 0; +} + +static int loc_eng_inject_location (double latitude, double longitude, float accuracy) +{ + /* not yet implemented */ + 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 + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data (GpsAidingData f) +{ + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + // If this is DELETE ALL + if (f == GPS_DELETE_ALL) + { + loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; + } + else + { + // Currently, LOC API only support deletion of all aiding data, + // since the Android defined aiding data mask matches with modem, + // so just pass them down without any translation + loc_eng_data.aiding_data_for_deletion |= f; + } + + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); +} + +/*=========================================================================== +FUNCTION loc_eng_get_extension + +DESCRIPTION + Get the gps extension to support XTRA. + +DEPENDENCIES + N/A + +RETURN VALUE + The GPS extension interface. + +SIDE EFFECTS + N/A + +===========================================================================*/ +static const void* loc_eng_get_extension(const char* name) +{ + if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + { + return &sLocEngXTRAInterface; + } + else if (strcmp(name, AGPS_INTERFACE) == 0) + { + return &sLocEngAGpsInterface; + } + else if (strcmp(name, GPS_NI_INTERFACE) == 0) + { + return &sLocEngNiInterface; + } + + return NULL; +} + +#if DEBUG_MOCK_NI == 1 +/*=========================================================================== +FUNCTION mock_ni + +DESCRIPTION + DEBUG tool: simulate an NI request + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void* mock_ni(void* arg) +{ + static int busy = 0; + + if (busy) return NULL; + + busy = 1; + + sleep(5); + + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type payload; + rpc_loc_ni_event_s_type *ni_req; + rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + + client_handle = (rpc_loc_client_handle_type) arg; + + loc_event = RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + payload.disc = loc_event; + + ni_req = &payload.rpc_loc_event_payload_u_type_u.ni_request; + ni_req->event = RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ; + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + + // Encodings for Spirent Communications + char client_name[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + char requestor_id[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + + supl_req->flags = RPC_LOC_NI_CLIENT_NAME_PRESENT | + RPC_LOC_NI_REQUESTOR_ID_PRESENT | + RPC_LOC_NI_ENCODING_TYPE_PRESENT; + + supl_req->datacoding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + + supl_req->client_name.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; // no coding + supl_req->client_name.client_name_string.client_name_string_len = strlen(client_name); + supl_req->client_name.client_name_string.client_name_string_val = client_name; + supl_req->client_name.string_len = strlen(client_name); + + supl_req->requestor_id.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + supl_req->requestor_id.requestor_id_string.requestor_id_string_len = strlen(requestor_id); + supl_req->requestor_id.requestor_id_string.requestor_id_string_val = requestor_id; + supl_req->requestor_id.string_len = strlen(requestor_id); + + supl_req->notification_priv_type = RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP; + supl_req->user_response_timer = 10; + + loc_event_cb(client_handle, loc_event, &payload); + + busy = 0; + + return NULL; +} +#endif // DEBUG_MOCK_NI + +/*=========================================================================== +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( + rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload + ) +{ + LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + if (client_handle == loc_eng_data.client_handle) + { + if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) + { + loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); + } + + if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) + { + loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); + } + + if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) + { + loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); + } + + if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) + { + loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); + } + + // Android XTRA interface 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) + { + LOGD ("loc_event_cb: xtra download requst"); + + // Call Registered callback + if (loc_eng_data.xtra_module_data.download_request_cb != NULL) + { + loc_eng_data.xtra_module_data.download_request_cb (); + } + } + } + + if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) + { + // Process the received RPC_LOC_EVENT_IOCTL_REPORT + (void) loc_eng_ioctl_process_cb (client_handle, + &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); + } + + if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) + { + loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); + } + + loc_eng_ni_callback(loc_event, loc_event_payload); + +#if DEBUG_MOCK_NI == 1 + // DEBUG only + if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && + loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. + payload.rpc_loc_status_event_payload_u_type_u.engine_state + == RPC_LOC_ENGINE_STATE_OFF) + { + // Mock an NI request + pthread_t th; + pthread_create (&th, NULL, mock_ni, (void*) client_handle); + } +#endif /* DEBUG_MOCK_NI == 1 */ + } + else + { + LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + } + + return RPC_LOC_API_SUCCESS; +} + +/*=========================================================================== +FUNCTION loc_eng_report_position + +DESCRIPTION + Reports position information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location; + + LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); + + memset (&location, 0, sizeof (GpsLocation)); + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) + { + // Not a position report, return + if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS) + { + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + if (loc_eng_data.location_cb != NULL) + { + LOGV ("loc_eng_report_position: fire callback\n"); + loc_eng_data.location_cb (&location); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + } +} + +/*=========================================================================== +FUNCTION loc_eng_report_sv + +DESCRIPTION + Reports GPS satellite information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const rpc_loc_sv_info_s_type *sv_info_ptr; + + LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + (uint32) gnss_report_ptr->valid_mask, + gnss_report_ptr->sv_count); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + 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 (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].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.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) + { + 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++; + } + } + + LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) + { + loc_eng_data.sv_status_cb(&SvStatus); + } +} + +/*=========================================================================== +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 (const rpc_loc_status_event_s_type *status_report_ptr) +{ + GpsStatus status; + + LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + + memset (&status, 0, sizeof (GpsStatus)); + status.status = GPS_STATUS_NONE; + 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) + { + status.status = 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) + { + status.status = GPS_STATUS_SESSION_END; + } + } + + if ((status.status != GPS_STATUS_NONE) && (loc_eng_data.status_cb != NULL)) + { + LOGV ("loc_eng_report_status: issue callback with status %d\n", status.status); + loc_eng_data.status_cb (&status); + } + + pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); + loc_eng_data.engine_status = status.status; + + // Wake up the thread for aiding data deletion. + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); +} + +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + if (loc_eng_data.nmea_cb != NULL) + { + struct timeval tv; + + gettimeofday(&tv, (struct timezone *) NULL); + long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + + loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); + } +} + +/*=========================================================================== +FUNCTION loc_eng_process_conn_request + +DESCRIPTION + Requests data connection to be brought up/tore down with the location server. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) +{ + LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + + // Signal DeferredActionThread to send the APN name + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + + // This implemenation is based on the fact that modem now at any time has only one data connection for AGPS at any given time + if (server_request_ptr->event == RPC_LOC_SERVER_REQUEST_OPEN) + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; + loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; + } + else + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; + loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; + } + + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); +} + +/*=========================================================================== +FUNCTION loc_eng_agps_init + +DESCRIPTION + + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_agps_init(AGpsCallbacks* callbacks) +{ + LOGV("loc_eng_agps_init\n"); + loc_eng_data.agps_status_cb = callbacks->status_cb; +} + +static int loc_eng_agps_data_conn_open(const char* apn) +{ + int apn_len; + LOGD("loc_eng_agps_data_conn_open: %s\n", apn); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_succeeded = TRUE; + + if (apn != NULL) + { + apn_len = strlen (apn); + + if (apn_len >= sizeof(loc_eng_data.apn_name)) + { + LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + apn_len = sizeof(loc_eng_data.apn_name) - 1; + } + + memcpy (loc_eng_data.apn_name, apn, apn_len); + loc_eng_data.apn_name[apn_len] = '\0'; + } + + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_closed() +{ + LOGD("loc_eng_agps_data_conn_closed\n"); + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_closed = TRUE; +// DO WE NEED TO SIGNAL HERE? + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_failed() +{ + LOGD("loc_eng_agps_data_conn_failed\n"); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + loc_eng_data.data_connection_failed = TRUE; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int set_agps_server() +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_server_info_s_type *server_info_ptr; + boolean ret_val; + uint16 port_temp; + char url[24]; + int len; + unsigned char *b_ptr; + + if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) + return -1; + + if (loc_eng_data.agps_server_address == 0) { + struct hostent* he = gethostbyname(loc_eng_data.agps_server_host); + if (he) + loc_eng_data.agps_server_address = *(uint32_t *)he->h_addr_list[0]; + } + if (loc_eng_data.agps_server_address == 0) + return -1; + + b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); + memset(url, 0, sizeof(url)); + snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + len = strlen (url); + + server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); + ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; + server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; + server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = len; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len= len; + + LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("set_agps_server failed\n"); + return -1; + } + else + { + LOGV ("set_agps_server successful\n"); + return 0; + } +} + +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) +{ + LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + + if (type != AGPS_TYPE_SUPL) + return -1; + + strncpy(loc_eng_data.agps_server_host, hostname, sizeof(loc_eng_data.agps_server_host) - 1); + loc_eng_data.agps_server_port = port; + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_delete_aiding_data_deferred_action + +DESCRIPTION + This is used to remove the aiding data when GPS engine is off. + +DEPENDENCIES + Assumes the aiding data type specified in GpsAidingData matches with + LOC API specification. + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data_deferred_action (void) +{ + // Currently, we only support deletion of all aiding data, + // since the Android defined aiding data mask matches with modem, + // so just pass them down without any translation + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_assist_data_delete_s_type *assist_data_ptr; + boolean ret_val; + + ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; + + assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); + if (loc_eng_data.aiding_data_for_deletion == GPS_DELETE_ALL) + { + assist_data_ptr->type = RPC_LOC_ASSIST_DATA_ALL; + } + else + { + assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; + } + memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_DELETE_ASSIST_DATA , + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_atl_deferred_action + +DESCRIPTION + This is used to inform the location engine of the processing status for + data connection open/close request. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_atl_deferred_action (void) +{ + rpc_loc_server_open_status_s_type *conn_open_status_ptr; + rpc_loc_server_close_status_s_type *conn_close_status_ptr; + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + int agps_status = -1; + + LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + + memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); + + if (loc_eng_data.data_connection_closed) + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; + conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); + conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; + conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; + loc_eng_data.data_connection_closed = FALSE; + } + else + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; + conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; + conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; + if (loc_eng_data.data_connection_succeeded) + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; + // Both buffer are of the same maximum size, and the source is null terminated + // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); + conn_open_status_ptr->apn_name = loc_eng_data.apn_name; + // Delay this so that PDSM ATL module will behave properly + sleep (1); + LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + loc_eng_data.data_connection_succeeded = FALSE; + } + else // data_connection_failed + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; + loc_eng_data.data_connection_failed = FALSE; + } + // Delay this so that PDSM ATL module will behave properly + sleep (1); + } + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + ioctl_data.disc, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_deferred_action + +DESCRIPTION + Main routine for the thread to execute certain commands + that are not safe to be done from within an RPC callback. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void* loc_eng_process_deferred_action (void* arg) +{ + LOGD("loc_eng_process_deferred_action started\n"); + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + // disable GPS lock + loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); + + while (loc_eng_data.deferred_action_thread_need_exit == FALSE) + { + // Wait until we are signalled to do a deferred action, or exit + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + pthread_cond_wait(&loc_eng_data.deferred_action_cond, + &loc_eng_data.deferred_action_mutex); + + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); + + if (loc_eng_data.deferred_action_thread_need_exit == TRUE) + { + break; + } + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + // send_delete_aiding_data must be done when GPS engine is off + if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + loc_eng_delete_aiding_data_deferred_action (); + loc_eng_data.aiding_data_for_deletion = 0; + } + + if (loc_eng_data.data_connection_succeeded || + loc_eng_data.data_connection_closed || + loc_eng_data.data_connection_failed) + { + loc_eng_process_atl_deferred_action (); + } + + if (loc_eng_data.agps_status != 0 && loc_eng_data.agps_status_cb) { + AGpsStatus status; + status.type = AGPS_TYPE_SUPL; + status.status = loc_eng_data.agps_status; + loc_eng_data.agps_status_cb(&status); + loc_eng_data.agps_status = 0; + } + + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + } + + LOGD("loc_eng_process_deferred_action thread exiting\n"); + return NULL; +} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h new file mode 100755 index 00000000..bb8fe9d1 --- /dev/null +++ b/loc_api/libloc_api/loc_eng.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_eng.h + @brief: + + DESCRIPTION + This file defines the global data structure used by this module. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_H +#define LOC_ENG_H + +// 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 + +#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds + +// Module data +typedef struct +{ + rpc_loc_client_handle_type client_handle; + + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + int agps_status; + + loc_eng_xtra_data_s_type xtra_module_data; + + loc_eng_ioctl_data_s_type ioctl_data; + + boolean data_connection_succeeded; + boolean data_connection_closed; + boolean data_connection_failed; + // TBD: + char agps_server_host[256]; + int agps_server_port; + uint32 agps_server_address; + char apn_name[100]; + int position_mode; + rpc_loc_server_connection_handle conn_handle; + + // GPS engine status + GpsStatusValue engine_status; + + // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off + GpsAidingData aiding_data_for_deletion; + + // Data variables used by deferred action thread + pthread_t deferred_action_thread; + // Signal deferred action thread to exit + boolean deferred_action_thread_need_exit; + // Mutex used by deferred action thread + pthread_mutex_t deferred_action_mutex; + // Condition variable used by deferred action thread + pthread_cond_t deferred_action_cond; +} loc_eng_data_s_type; + +extern loc_eng_data_s_type loc_eng_data; + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp new file mode 100755 index 00000000..ff9d4813 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -0,0 +1,358 @@ + +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +// Function declarations +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type +); + +static boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr // Output parameter for IOCTL calls +); + +/*=========================================================================== + +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 + +===========================================================================*/ +boolean 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 + ) +{ + boolean ret_val; + int rpc_ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + // Select the callback we are waiting for + ret_val = loc_eng_ioctl_setup_cb (handle, ioctl_type); + + if (ret_val == TRUE) + { + rpc_ret_val = loc_ioctl (handle, + ioctl_type, + ioctl_data_ptr); + + LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + + if (rpc_ret_val == RPC_LOC_API_SUCCESS) + { + // Wait for the callback of loc_ioctl + ret_val = loc_eng_ioctl_wait_cb (timeout_msec, cb_data_ptr); + } + else + { + ret_val = FALSE; + } + } + + // Reset the state when we are done + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + ioctl_cb_data_ptr->cb_is_selected = FALSE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_setup_cb + +DESCRIPTION + Selects which callback is going to be waited for + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type + ) +{ + boolean ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (ioctl_cb_data_ptr->cb_is_selected == TRUE) + { + LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + ret_val = FALSE; + } + else + { + ioctl_cb_data_ptr->cb_is_selected = TRUE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + ioctl_cb_data_ptr->client_handle = handle; + ioctl_cb_data_ptr->ioctl_type = ioctl_type; + memset (&(ioctl_cb_data_ptr->cb_payload), 0, sizeof (rpc_loc_ioctl_callback_s_type)); + ret_val = TRUE; + } + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_wait_cb + +DESCRIPTION + Waits for a selected callback. The wait expires in timeout_msec. + + If the function is called before an existing wait has finished, it will + immediately return EBUSY. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + int rc; // return code from pthread calls + + struct timeval present_time; + struct timespec expire_time; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + + do { + if (ioctl_cb_data_ptr->cb_is_selected == FALSE) + { + LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + ret_val = FALSE; + break; + } + + // Calculate absolute expire time + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_sec += timeout_msec / 1000; + if ((present_time.tv_usec + timeout_msec) >= 1000) + { + expire_time.tv_sec += 1; + } + expire_time.tv_nsec = (present_time.tv_usec + timeout_msec) % 1000 * 1000; + + // Special case where callback is issued before loc_ioctl ever returns + if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) + { + LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + ret_val = TRUE; + break; + } + + ioctl_cb_data_ptr->cb_is_waiting = TRUE; + // Wait for the callback until timeout expires + rc = pthread_cond_timedwait(&ioctl_cb_data_ptr->cb_arrived_cond, + &ioctl_cb_data_ptr->cb_data_mutex, + &expire_time); + + if (rc == 0) + { + ret_val = TRUE; + } + else + { + ret_val = FALSE; + } + + LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + + } while (0); + + // Process the ioctl callback data when IOCTL is successful + if (ret_val == TRUE) + { + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + if (ioctl_cb_data_ptr->cb_payload.status == RPC_LOC_API_SUCCESS) + { + ret_val = TRUE; + if (cb_data_ptr != NULL) + { + memcpy (cb_data_ptr, + &(ioctl_cb_data_ptr->cb_payload), + sizeof (rpc_loc_ioctl_callback_s_type)); + } + } + else + { + ret_val = FALSE; + } + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_process_cb + +DESCRIPTION + This function process the IOCTL callback, parameter specifies the client + that receives the IOCTL callback. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_process_cb ( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (client_handle != ioctl_cb_data_ptr->client_handle) + { + LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); + ret_val = FALSE; + } + else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) + { + LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); + ret_val = FALSE; + } + else // both matches + { + memcpy (&(ioctl_cb_data_ptr->cb_payload), + cb_data_ptr, + sizeof (rpc_loc_ioctl_callback_s_type)); + + ioctl_cb_data_ptr->cb_has_arrived = TRUE; + + LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, + (int32) ioctl_cb_data_ptr->cb_payload.status); + + ret_val = TRUE; + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + // Signal the waiting thread that callback has arrived + if (ret_val == TRUE) + { + pthread_cond_signal (&ioctl_cb_data_ptr->cb_arrived_cond); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h new file mode 100755 index 00000000..4090a4d8 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -0,0 +1,75 @@ +/****************************************************************************** + @file: loc_eng_ioctl.h + @brief: + + DESCRIPTION + This file defines the data structure used by any location client that + waits for the ioctl particular event to occur. Any one IOCTL can be pending + at any time. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_IOCTL_H +#define LOC_ENG_IOCTL_H + +// Module data +typedef struct loc_eng_ioctl_data_s_type +{ + // We are waiting for an ioctl callback + boolean cb_is_selected; + // The thread has been put in a wait state for an ioctl callback + boolean cb_is_waiting; + // Loc client handle that is waiting for the callback + rpc_loc_client_handle_type client_handle; + // IOCTL type that the loc client is waiting for + rpc_loc_ioctl_e_type ioctl_type; + // The IOCLT report has arrived for the waiting client + boolean cb_has_arrived; + // The payload for the RPC_LOC_EVENT_IOCTL_REPORT + rpc_loc_ioctl_callback_s_type cb_payload; + // Mutex to access this data structure + pthread_mutex_t cb_data_mutex; + // LOC ioctl callback arrived mutex + pthread_cond_t cb_arrived_cond; +} loc_eng_ioctl_data_s_type; + + +extern boolean 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 +); + +extern boolean loc_eng_ioctl_process_cb +( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr +); +#endif // LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp new file mode 100755 index 00000000..d923855a --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -0,0 +1,616 @@ +/****************************************************************************** + @file: loc_eng_ni.cpp + @brief: module for network initiated interactions + + DESCRIPTION + LOC_API network initiated operation support + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- + Copyright (c) 2009 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + ----------------------------------------------------------------------------- +******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +07/30/09 dx Initial version + +$Id: +======================================================================*/ + +#define LOG_NDDEBUG 0 +#define LOG_NIDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +const GpsNiInterface sLocEngNiInterface = +{ + loc_eng_ni_init, + loc_eng_ni_respond, +}; + +boolean loc_eng_ni_data_init = FALSE; +loc_eng_ni_data_s_type loc_eng_ni_data; + +extern loc_eng_data_s_type loc_eng_data; + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ + +/*=========================================================================== + +FUNCTION respond_from_enum + +DESCRIPTION + Returns the name of the response + +RETURN VALUE + response name string + +===========================================================================*/ +static const char* respond_from_enum(rpc_loc_ni_user_resp_e_type resp) +{ + switch (resp) + { + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT: + return "accept"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY: + return "deny"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP: + return "no response"; + default: + return NULL; + } +} + +/*=========================================================================== + +FUNCTION loc_ni_respond + +DESCRIPTION + Displays the NI request and awaits user input. If a previous request is + in session, the new one is handled using sys.ni_default_response (if exists); + otherwise, it is denied. + +DEPENDENCY + Do not lock the data by mutex loc_ni_lock + +RETURN VALUE + none + +===========================================================================*/ +static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, + const rpc_loc_ni_event_s_type *request_pass_back +) +{ + LOGD("Sending NI response: %s\n", respond_from_enum(resp)); + + 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, + request_pass_back, sizeof (rpc_loc_ni_event_s_type)); + data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = resp; + + loc_eng_ioctl( + loc_eng_data.client_handle, + RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, + &data, + LOC_IOCTL_DEFAULT_TIMEOUT, + &callback_payload + ); +} + +/*=========================================================================== + +FUNCTION loc_ni_fill_notif_verify_type + +DESCRIPTION + Fills need_notify, need_verify, etc. + +RETURN VALUE + none + +===========================================================================*/ +static boolean loc_ni_fill_notif_verify_type(GpsNiNotification *notif, + rpc_loc_ni_notify_verify_e_type notif_priv) +{ + notif->notify_flags = 0; + notif->default_response = GPS_NI_RESPONSE_NORESP; + + switch (notif_priv) + { + case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: + notif->notify_flags = 0; + break; + + case RPC_LOC_NI_USER_NOTIFY_ONLY: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + 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; + break; + + 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; + break; + + case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return FALSE; + } + + return TRUE; +} + +/*=========================================================================== + +FUNCTION hexcode + +DESCRIPTION + Converts a binary array into a Hex string. E.g., 1F 00 3F --> "1F003F" + +RETURN VALUE + bytes encoded + +===========================================================================*/ +static 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; +} + +static GpsNiEncodingType convert_encoding_type(int loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case RPC_LOC_NI_SUPL_UTF8: + enc = GPS_ENC_SUPL_UTF8; + break; + case RPC_LOC_NI_SUPL_UCS2: + enc = GPS_ENC_SUPL_UCS2; + break; + case RPC_LOC_NI_SUPL_GSM_DEFAULT: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + default: + break; + } + + return enc; +} + +/*=========================================================================== + +FUNCTION loc_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 + +===========================================================================*/ +static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) +{ + GpsNiNotification notif; + strlcpy(notif.text, "[text]", sizeof notif.text); // defaults + strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); + + /* If busy, use default or deny */ + if (loc_eng_ni_data.notif_in_progress) + { +#if 0 + /* Cannot be here because the current thread is in RPC client */ + /* XXX Consider adding an event queue to process overlapped NI requests */ + loc_ni_user_resp_e_type response = + sys.ni_default_resp == 1 /* accept */ ? + LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT : + LOC_NI_LCS_NOTIFY_VERIFY_DENY; + + loc_ni_respond(response, ni_req); */ +#endif + LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + ni_req->event); + } + else { + /* Print notification */ + LOGD("NI Notification: %s, event: %d", msg, ni_req->event); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + /* Save request */ + memcpy(&loc_eng_ni_data.loc_ni_request, ni_req, sizeof loc_eng_ni_data.loc_ni_request); + + /* Set up NI response waiting */ + loc_eng_ni_data.notif_in_progress = TRUE; + loc_eng_ni_data.current_notif_id = abs(rand()); + + /* Fill in notification */ + notif.notification_id = loc_eng_ni_data.current_notif_id; + + const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req; + const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req; + + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + vx_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; + notif.ni_type = GPS_NI_TYPE_VOICE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // vx_req->user_resp_timer_val; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // 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 = convert_encoding_type(vx_req->encoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, vx_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + umts_cp_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // umts_cp_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Stores notification text + hexcode(notif.text, sizeof notif.text, + umts_cp_req->notification_text.notification_text_val, + umts_cp_req->notification_length); + + // Stores requestor ID + 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); + + notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, umts_cp_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // supl_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Client name + if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) + { + 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 */ + ); + LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + } else { + LOGD("SUPL NI: client_name not present."); + } + + // Requestor ID + if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) + { + 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 */ + ); + LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + } else { + LOGD("SUPL NI: requestor_id not present."); + } + + // Encoding type + if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) + { + notif.text_encoding = convert_encoding_type(supl_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(supl_req->datacoding_scheme); + } else { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); + + break; + + default: + LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + return; + } + + /* Log requestor ID and text for debugging */ + LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + + /* For robustness, always sets a timeout to clear up the notification status, even though + * the OEM layer in java does not do so. + **/ + loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); + LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + /* Notify callback */ + if (loc_eng_data.ni_notify_cb != NULL) + { + loc_eng_data.ni_notify_cb(¬if); + } + } +} + +/*=========================================================================== + +FUNCTION loc_ni_process_user_response + +DESCRIPTION + Handles user input from the UI + +RETURN VALUE + error code (0 for successful, -1 for error) + +===========================================================================*/ +int loc_ni_process_user_response(GpsUserResponseType userResponse) +{ + LOGD("NI response from UI: %d", userResponse); + + rpc_loc_ni_user_resp_e_type resp; + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; + break; + case GPS_NI_RESPONSE_DENY: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; + break; + case GPS_NI_RESPONSE_NORESP: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; + break; + default: + return -1; + } + + loc_ni_respond(resp, &loc_eng_ni_data.loc_ni_request); + + /* Make the NI respond */ + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.response_time_left = 0; + loc_eng_ni_data.current_notif_id = -1; + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + return 0; +} + +/*=========================================================================== + +FUNCTION loc_eng_ni_callback + +DESCRIPTION + Loc API callback handler + +RETURN VALUE + error code (0 for success) + +===========================================================================*/ +int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +) +{ + int rc = 0; + const rpc_loc_ni_event_s_type *ni_req = &loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request; + if (loc_event == RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) + { + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + LOGI("VX Notification"); + loc_ni_request_handler("VX Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + LOGI("UMTS CP Notification\n"); + loc_ni_request_handler("UMTS CP Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + LOGI("SUPL Notification\n"); + loc_ni_request_handler("SUPL Notify", ni_req); + break; + + default: + LOGE("Unknown NI event: %x\n", (int) ni_req->event); + break; + } + } + return rc; +} + +/*=========================================================================== + +FUNCTION loc_ni_thread_proc + +===========================================================================*/ +static void* loc_ni_thread_proc(void *threadid) +{ + LOGI("Starting Loc NI thread...\n"); + + while (1) + { + /* wakes up every second to check timed out requests */ + sleep(1); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + if (loc_eng_ni_data.notif_in_progress && loc_eng_ni_data.response_time_left > 0) + { + loc_eng_ni_data.response_time_left--; + if (loc_eng_ni_data.response_time_left <= 0) + { + loc_ni_respond(RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP, &loc_eng_ni_data.loc_ni_request); + loc_eng_ni_data.notif_in_progress = FALSE; + } + } + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + } /* while (1) */ + + pthread_exit(NULL); + return NULL; +} + +/*=========================================================================== + +FUNCTION loc_ni_thread_start + +===========================================================================*/ +static int loc_ni_thread_start(void) +{ + int rc = 0; + + rc = pthread_create(&loc_eng_ni_data.loc_ni_thread, NULL, loc_ni_thread_proc, NULL); + + if (rc) + { + LOGE("Loc NI thread is not created.\n"); + return -1; + } + + return 0; +} + +/*=========================================================================== +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(GpsNiCallbacks *callbacks) +{ + LOGD("loc_eng_ni_init: entered."); + + if (!loc_eng_ni_data_init) + { + pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); + loc_ni_thread_start(); + loc_eng_ni_data_init = TRUE; + } + + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.current_notif_id = -1; + loc_eng_ni_data.response_time_left = 0; + + srand(time(NULL)); + loc_eng_data.ni_notify_cb = callbacks->notify_cb; +} + +/*=========================================================================== +FUNCTION loc_eng_ni_respond + +DESCRIPTION + This function sends an NI respond to the modem processor + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) +{ + if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) + { + LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + loc_ni_process_user_response(user_response); + } else { + LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + notif_id, user_response); + } +} diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h new file mode 100755 index 00000000..b975b946 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -0,0 +1,56 @@ +/****************************************************************************** + @file: loc_eng_ni.cpp + @brief: module for network initiated interactions + + DESCRIPTION + LOC_API network initiated operation support + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- + Copyright (c) 2009 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + ----------------------------------------------------------------------------- +******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +07/30/09 dx Initial version + +$Id: +======================================================================*/ + +#ifndef LOC_ENG_NI_H +#define LOC_ENG_NI_H + +#include + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ + +extern const GpsNiInterface sLocEngNiInterface; + +typedef struct { + pthread_t loc_ni_thread; /* NI thread */ + pthread_mutex_t loc_ni_lock; + int response_time_left; /* examine time for NI response */ + boolean notif_in_progress; /* NI notification/verification in progress */ + rpc_loc_ni_event_s_type loc_ni_request; + int current_notif_id; /* ID to check against response */ +} loc_eng_ni_data_s_type; + +// Functions for sLocEngNiInterface +extern void loc_eng_ni_init(GpsNiCallbacks *callbacks); +extern void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response); + +extern int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +); + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp new file mode 100755 index 00000000..a3216531 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -0,0 +1,184 @@ +/****************************************************************************** + @file: loc_eng.cpp + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ +#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) +#define XTRA_BLOCK_SIZE (400) + +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks); +static int qct_loc_eng_inject_xtra_data(char* data, int length); + +const GpsXtraInterface sLocEngXTRAInterface = +{ + qct_loc_eng_xtra_init, + qct_loc_eng_inject_xtra_data, +}; + +/*=========================================================================== +FUNCTION qct_loc_eng_xtra_init + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks) +{ + rpc_loc_event_mask_type event; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &(loc_eng_data.xtra_module_data); + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +FUNCTION qct_loc_eng_inject_xtra_data + +DESCRIPTION + Injects XTRA file into the engine. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_inject_xtra_data(char* data, int length) +{ + int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; + boolean ret_val = 0; + int total_parts; + uint8 part; + uint16 part_len; + uint16 len_injected; + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; + + LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_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 / XTRA_BLOCK_SIZE); + if ((total_parts % XTRA_BLOCK_SIZE) != 0) + { + total_parts += 1; + } + predicted_orbits_data_ptr->total_parts = total_parts; + + len_injected = 0; // O bytes injected + // 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; + + LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + + if (part < total_parts) + { + // No callback in this case + rpc_ret_val = loc_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data); + + if (rpc_ret_val != RPC_LOC_API_SUCCESS) + { + LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + ret_val = EINVAL; // return error + break; + } + } + else // part == total_parts + { + // Last part injection, will need to wait for callback + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data, + LOC_XTRA_INJECT_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + break; // done with injection + } + + len_injected += predicted_orbits_data_ptr->part_len; + LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h new file mode 100755 index 00000000..839fc06e --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -0,0 +1,47 @@ +/****************************************************************************** + @file: loc_eng.h + @brief: + + DESCRIPTION + This file defines the data structure used by this XTRA module. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + +******************************************************************************/ + +/*===================================================================== +$Header: $ +$DateTime: $ +$Author: $ +======================================================================*/ + +#ifndef LOC_ENG_XTRA_H +#define LOC_ENG_XTRA_H + +extern const GpsXtraInterface sLocEngXTRAInterface; + +// Module data +typedef struct +{ + // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; + gps_xtra_download_request download_request_cb; + +} loc_eng_xtra_data_s_type; + +#endif // LOC_ENG_XTRA_H From 91cfd13d2926018bd1da9166d99a47fd88255ef6 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Fri, 22 Jan 2010 08:47:48 -0500 Subject: [PATCH 008/945] loc_api: Send GPS_STATUS_ENGINE_ON and GPS_STATUS_SESSION_END so GpsLocationProvider will release its wake lock when the GPS shuts down. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index acc4dfd6..8a1b05bb 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -523,7 +523,7 @@ static void loc_eng_delete_aiding_data (GpsAidingData f) loc_eng_data.aiding_data_for_deletion |= f; } - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); @@ -966,25 +966,25 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON) { + status.status = GPS_STATUS_ENGINE_ON; + loc_eng_data.status_cb (&status); status.status = GPS_STATUS_SESSION_BEGIN; + loc_eng_data.status_cb (&status); } else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) { status.status = GPS_STATUS_SESSION_END; + loc_eng_data.status_cb (&status); + status.status = GPS_STATUS_ENGINE_OFF; + loc_eng_data.status_cb (&status); } } - if ((status.status != GPS_STATUS_NONE) && (loc_eng_data.status_cb != NULL)) - { - LOGV ("loc_eng_report_status: issue callback with status %d\n", status.status); - loc_eng_data.status_cb (&status); - } - pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); loc_eng_data.engine_status = status.status; // Wake up the thread for aiding data deletion. - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); @@ -1350,7 +1350,7 @@ static void* loc_eng_process_deferred_action (void* arg) pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); // send_delete_aiding_data must be done when GPS engine is off - if ((loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON) && + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { loc_eng_delete_aiding_data_deferred_action (); From 16b7141d372ab807fb0ddf3670fde32f144afb92 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Fri, 22 Jan 2010 14:41:54 -0500 Subject: [PATCH 009/945] Do not build unless BOARD_GPS_LIBRARIES is set to libloc_api Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index cdb2dbde..39bc7414 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,4 +6,6 @@ # · Neither the name of the QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. +ifeq ($(BOARD_GPS_LIBRARIES),libloc_api) include $(call all-subdir-makefiles) +endif From ac4e54a28160c03270d7b750f18b31868db417b3 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 2 Feb 2010 11:51:35 -0500 Subject: [PATCH 010/945] loc_api: Process all events in deferred action thread. It is not safe to call into framework code from an RPC callback. Change-Id: Idb85590f5648b85ba4dd352136f89652b3128fbe Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 226 ++++++++++++++++++++------------- loc_api/libloc_api/loc_eng.h | 4 + 2 files changed, 142 insertions(+), 88 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 8a1b05bb..fd1db4e3 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -92,7 +92,8 @@ static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_p static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); static void* loc_eng_process_deferred_action (void* arg); -static void loc_eng_process_atl_deferred_action (void); +static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, + boolean data_connection_closed); static void loc_eng_delete_aiding_data_deferred_action (void); static int set_agps_server(); @@ -200,6 +201,7 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); loc_eng_data.deferred_action_thread_need_exit = FALSE; + loc_eng_data.loc_event = 0; loc_eng_data.data_connection_succeeded = FALSE; loc_eng_data.data_connection_closed = FALSE; loc_eng_data.data_connection_failed = FALSE; @@ -668,68 +670,12 @@ static int32 loc_event_cb( LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); if (client_handle == loc_eng_data.client_handle) { - if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) - { - loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); - } + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + loc_eng_data.loc_event = loc_event; + memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); - if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) - { - loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); - } - - if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) - { - loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); - } - - if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) - { - loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); - } - - // Android XTRA interface 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) - { - LOGD ("loc_event_cb: xtra download requst"); - - // Call Registered callback - if (loc_eng_data.xtra_module_data.download_request_cb != NULL) - { - loc_eng_data.xtra_module_data.download_request_cb (); - } - } - } - - if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) - { - // Process the received RPC_LOC_EVENT_IOCTL_REPORT - (void) loc_eng_ioctl_process_cb (client_handle, - &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); - } - - if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) - { - loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); - } - - loc_eng_ni_callback(loc_event, loc_event_payload); - -#if DEBUG_MOCK_NI == 1 - // DEBUG only - if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && - loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. - payload.rpc_loc_status_event_payload_u_type_u.engine_state - == RPC_LOC_ENGINE_STATE_OFF) - { - // Mock an NI request - pthread_t th; - pthread_create (&th, NULL, mock_ni, (void*) client_handle); - } -#endif /* DEBUG_MOCK_NI == 1 */ + pthread_cond_signal (&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); } else { @@ -966,15 +912,13 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON) { - status.status = GPS_STATUS_ENGINE_ON; - loc_eng_data.status_cb (&status); + // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON status.status = GPS_STATUS_SESSION_BEGIN; loc_eng_data.status_cb (&status); } else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) { - status.status = GPS_STATUS_SESSION_END; - loc_eng_data.status_cb (&status); + // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF status.status = GPS_STATUS_ENGINE_OFF; loc_eng_data.status_cb (&status); } @@ -1252,7 +1196,8 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_eng_process_atl_deferred_action (void) +static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, + boolean data_connection_closed) { rpc_loc_server_open_status_s_type *conn_open_status_ptr; rpc_loc_server_close_status_s_type *conn_close_status_ptr; @@ -1264,20 +1209,19 @@ static void loc_eng_process_atl_deferred_action (void) memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - if (loc_eng_data.data_connection_closed) + if (data_connection_closed) { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; - loc_eng_data.data_connection_closed = FALSE; } else { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; - if (loc_eng_data.data_connection_succeeded) + if (data_connection_succeeded) { conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; // Both buffer are of the same maximum size, and the source is null terminated @@ -1286,12 +1230,10 @@ static void loc_eng_process_atl_deferred_action (void) // Delay this so that PDSM ATL module will behave properly sleep (1); LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); - loc_eng_data.data_connection_succeeded = FALSE; } else // data_connection_failed { conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; - loc_eng_data.data_connection_failed = FALSE; } // Delay this so that PDSM ATL module will behave properly sleep (1); @@ -1306,6 +1248,89 @@ static void loc_eng_process_atl_deferred_action (void) LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); } +/*=========================================================================== +FUNCTION loc_eng_process_loc_event + +DESCRIPTION + This is used to process events received from the location engine. + +DEPENDENCIES + None + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, + rpc_loc_event_payload_u_type* loc_event_payload) +{ + if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) + { + loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); + } + + if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) + { + loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); + } + + if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) + { + loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); + } + + if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) + { + loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); + } + + // Android XTRA interface 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) + { + LOGD ("loc_event_cb: xtra download requst"); + + // Call Registered callback + if (loc_eng_data.xtra_module_data.download_request_cb != NULL) + { + loc_eng_data.xtra_module_data.download_request_cb (); + } + } + } + + if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) + { + // Process the received RPC_LOC_EVENT_IOCTL_REPORT + (void) loc_eng_ioctl_process_cb (loc_eng_data.client_handle, + &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); + } + + if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) + { + loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); + } + + loc_eng_ni_callback(loc_event, loc_event_payload); + +#if DEBUG_MOCK_NI == 1 + // DEBUG only + if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && + loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. + payload.rpc_loc_status_event_payload_u_type_u.engine_state + == RPC_LOC_ENGINE_STATE_OFF) + { + // Mock an NI request + pthread_t th; + pthread_create (&th, NULL, mock_ni, (void*) client_handle); + } +#endif /* DEBUG_MOCK_NI == 1 */ +} + /*=========================================================================== FUNCTION loc_eng_process_deferred_action @@ -1325,6 +1350,9 @@ SIDE EFFECTS ===========================================================================*/ static void* loc_eng_process_deferred_action (void* arg) { + AGpsStatus status; + status.type = AGPS_TYPE_SUPL; + LOGD("loc_eng_process_deferred_action started\n"); // make sure we do not run in background scheduling group @@ -1335,44 +1363,66 @@ static void* loc_eng_process_deferred_action (void* arg) while (loc_eng_data.deferred_action_thread_need_exit == FALSE) { + GpsAidingData aiding_data_for_deletion; + GpsStatusValue engine_status; + boolean data_connection_succeeded; + boolean data_connection_closed; + boolean data_connection_failed; + + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + // Wait until we are signalled to do a deferred action, or exit pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); pthread_cond_wait(&loc_eng_data.deferred_action_cond, &loc_eng_data.deferred_action_mutex); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - if (loc_eng_data.deferred_action_thread_need_exit == TRUE) { + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); break; } - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + // copy anything we need before releasing the mutex + loc_event = loc_eng_data.loc_event; + if (loc_event != 0) { + memcpy(&loc_event_payload, &loc_eng_data.loc_event_payload, sizeof(loc_event_payload)); + loc_eng_data.loc_event = 0; + } + + engine_status = loc_eng_data.agps_status; + aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; + status.status = loc_eng_data.agps_status; + loc_eng_data.agps_status = 0; + data_connection_succeeded = loc_eng_data.data_connection_succeeded; + data_connection_closed = loc_eng_data.data_connection_closed; + data_connection_failed = loc_eng_data.data_connection_failed; + loc_eng_data.data_connection_closed = FALSE; + loc_eng_data.data_connection_succeeded = FALSE; + loc_eng_data.data_connection_failed = FALSE; + + // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + + if (loc_event != 0) { + loc_eng_process_loc_event(loc_event, &loc_event_payload); + } // send_delete_aiding_data must be done when GPS engine is off - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) + if ((engine_status != GPS_STATUS_SESSION_BEGIN) && (aiding_data_for_deletion != 0)) { loc_eng_delete_aiding_data_deferred_action (); - loc_eng_data.aiding_data_for_deletion = 0; } - if (loc_eng_data.data_connection_succeeded || - loc_eng_data.data_connection_closed || - loc_eng_data.data_connection_failed) + if (data_connection_succeeded || data_connection_closed || data_connection_failed) { - loc_eng_process_atl_deferred_action (); + loc_eng_process_atl_deferred_action(data_connection_succeeded, data_connection_closed); } - if (loc_eng_data.agps_status != 0 && loc_eng_data.agps_status_cb) { - AGpsStatus status; - status.type = AGPS_TYPE_SUPL; - status.status = loc_eng_data.agps_status; + if (status.status != 0 && loc_eng_data.agps_status_cb) { loc_eng_data.agps_status_cb(&status); - loc_eng_data.agps_status = 0; } - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); } LOGD("loc_eng_process_deferred_action thread exiting\n"); diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index bb8fe9d1..979e4231 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -68,6 +68,10 @@ typedef struct loc_eng_ioctl_data_s_type ioctl_data; + // data from loc_event_cb + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + boolean data_connection_succeeded; boolean data_connection_closed; boolean data_connection_failed; From 463321860904029ebf9a62024c02f7bd82215ae4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Mon, 8 Mar 2010 18:04:53 -0800 Subject: [PATCH 011/945] Add an empty CleanSpec.mk Change-Id: I304694bc9032ccaa3777885615be15c41447f6a5 --- CleanSpec.mk | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CleanSpec.mk diff --git a/CleanSpec.mk b/CleanSpec.mk new file mode 100644 index 00000000..b84e1b65 --- /dev/null +++ b/CleanSpec.mk @@ -0,0 +1,49 @@ +# 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 +# ************************************************ From 300b715b0dc36ae82b442a201432a5f2065e664b Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 9 Mar 2010 19:33:20 -0500 Subject: [PATCH 012/945] loc_api: Repackage as a new GPS HAL module. Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 2 +- loc_api/libloc_api/Android.mk | 11 +++-- loc_api/libloc_api/gps.c | 66 ++++++++++++++++++++++++++++ loc_api/libloc_api/loc_eng.cpp | 17 +++++-- loc_api/libloc_api/loc_eng.h | 2 +- loc_api/libloc_api/loc_eng_ioctl.cpp | 2 +- loc_api/libloc_api/loc_eng_ni.cpp | 4 +- loc_api/libloc_api/loc_eng_ni.h | 2 +- loc_api/libloc_api/loc_eng_xtra.cpp | 3 +- loc_api/libloc_api/loc_eng_xtra.h | 2 + 10 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 loc_api/libloc_api/gps.c diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 39bc7414..293b2da1 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,6 +6,6 @@ # · Neither the name of the QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. -ifeq ($(BOARD_GPS_LIBRARIES),libloc_api) +ifneq ($(GPS_LOC_API_HARDWARE),) include $(call all-subdir-makefiles) endif diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index bc8e4ae2..040a57c3 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -6,14 +6,12 @@ #· Neither the name of the QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. -ifneq ($(BUILD_TINY_ANDROID),true) - AMSS_VERSION:=6356 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := libloc_api +LOCAL_MODULE := gps.$(GPS_LOC_API_HARDWARE) LOCAL_STATIC_LIBRARIES:= \ libloc_api-rpc @@ -27,7 +25,8 @@ LOCAL_SRC_FILES += \ loc_eng.cpp \ loc_eng_ioctl.cpp \ loc_eng_xtra.cpp \ - loc_eng_ni.cpp + loc_eng_ni.cpp \ + gps.c LOCAL_CFLAGS += \ -fno-short-enums @@ -39,7 +38,7 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/librpc LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw + include $(BUILD_SHARED_LIBRARY) -endif # not BUILD_TINY_ANDROID - diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c new file mode 100644 index 00000000..ec6fbd0b --- /dev/null +++ b/loc_api/libloc_api/gps.c @@ -0,0 +1,66 @@ +/****************************************************************************** + @file: gps.c + @brief: + + DESCRIPTION + This file defines the implemenation for GPS hardware abstraction layer. + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 + +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 = malloc(sizeof(struct gps_device_t)); + 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 +}; + +const struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = GPS_HARDWARE_MODULE_ID, + .name = "loc_api GPS Module", + .author = "Qualcomm USA, Inc.", + .methods = &gps_module_methods, +}; diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index fd1db4e3..d8f5c277 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -46,7 +46,6 @@ $Author: $ #include "loc_api_rpc_glue.h" #include "loc_apicb_appinit.h" -#include #include #include #include @@ -101,6 +100,7 @@ static int set_agps_server(); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = { + sizeof(GpsInterface), loc_eng_init, loc_eng_start, loc_eng_stop, @@ -114,6 +114,7 @@ static const GpsInterface sLocEngInterface = static const AGpsInterface sLocEngAGpsInterface = { + sizeof(AGpsInterface), loc_eng_agps_init, loc_eng_agps_data_conn_open, loc_eng_agps_data_conn_closed, @@ -708,7 +709,8 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); - memset (&location, 0, sizeof (GpsLocation)); + memset (&location, 0, sizeof(location)); + location.size = sizeof(location); if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) { // Not a position report, return @@ -818,6 +820,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) { if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS) { + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn; // We only have the data field to report gps eph and alm mask @@ -906,7 +909,8 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); - memset (&status, 0, sizeof (GpsStatus)); + memset (&status, 0, sizeof(status)); + status.size = sizeof(status); status.status = GPS_STATUS_NONE; if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_ENGINE_STATE) { @@ -1351,6 +1355,7 @@ SIDE EFFECTS static void* loc_eng_process_deferred_action (void* arg) { AGpsStatus status; + status.size = sizeof(status); status.type = AGPS_TYPE_SUPL; LOGD("loc_eng_process_deferred_action started\n"); @@ -1428,3 +1433,9 @@ static void* loc_eng_process_deferred_action (void* arg) LOGD("loc_eng_process_deferred_action thread exiting\n"); return NULL; } + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + return &sLocEngInterface; +} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 979e4231..f13df31a 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -47,7 +47,7 @@ typedef unsigned char boolean; #include #include -#include +#include #define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index ff9d4813..87ca5b00 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -44,7 +44,7 @@ $Author: $ #include #include -#include +#include #include diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index d923855a..9888d4df 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -37,8 +37,6 @@ $Id: #include #include -#include - #include #include #include @@ -59,6 +57,7 @@ $Id: const GpsNiInterface sLocEngNiInterface = { + sizeof(GpsNiInterface), loc_eng_ni_init, loc_eng_ni_respond, }; @@ -251,6 +250,7 @@ RETURN VALUE static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) { GpsNiNotification notif; + notif.size = sizeof(notif); strlcpy(notif.text, "[text]", sizeof notif.text); // defaults strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index b975b946..be234054 100755 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -29,7 +29,7 @@ $Id: #ifndef LOC_ENG_NI_H #define LOC_ENG_NI_H -#include +#include #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index a3216531..9dda092b 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -43,8 +43,6 @@ $Author: $ #include #include -#include - #include #define LOG_TAG "lib_locapi" @@ -62,6 +60,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length); const GpsXtraInterface sLocEngXTRAInterface = { + sizeof(GpsXtraInterface), qct_loc_eng_xtra_init, qct_loc_eng_inject_xtra_data, }; diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h index 839fc06e..b5c79451 100755 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -34,6 +34,8 @@ $Author: $ #ifndef LOC_ENG_XTRA_H #define LOC_ENG_XTRA_H +#include + extern const GpsXtraInterface sLocEngXTRAInterface; // Module data From ae1989429bcdce118229b4b728daaed99b039e8f Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 31 Mar 2010 16:18:10 -0700 Subject: [PATCH 013/945] Remove call to loc_apicb_app_deinit() to avoid ARM9 crashes after disabling. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index d8f5c277..cddf3d53 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -275,8 +275,8 @@ static void loc_eng_cleanup() pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); - // RPC glue code - loc_apicb_app_deinit(); +// Do not call this as it can result in the ARM9 crashing if it sends events while we are disabled +// loc_apicb_app_deinit(); } From 237c22f03d1800ec68b47e7df072efeab6c04199 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 31 Mar 2010 11:14:35 -0700 Subject: [PATCH 014/945] Enable GPS privacy lock when GPS is disabled. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index cddf3d53..d3d7b418 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1360,10 +1360,11 @@ static void* loc_eng_process_deferred_action (void* arg) LOGD("loc_eng_process_deferred_action started\n"); - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); - // disable GPS lock + // disable the GPS lock + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); while (loc_eng_data.deferred_action_thread_need_exit == FALSE) @@ -1430,6 +1431,10 @@ static void* loc_eng_process_deferred_action (void* arg) } + // reenable the GPS lock + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); + loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); + LOGD("loc_eng_process_deferred_action thread exiting\n"); return NULL; } From a4977cd631b6f4bc1ee74d0ed60977cb06d12e6f Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 31 Mar 2010 16:41:29 -0700 Subject: [PATCH 015/945] Fix deleting aiding data. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index d3d7b418..514328ca 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -513,18 +513,9 @@ static void loc_eng_delete_aiding_data (GpsAidingData f) { pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - // If this is DELETE ALL - if (f == GPS_DELETE_ALL) - { + // Currently, LOC API only support deletion of all aiding data, + if (f) loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; - } - else - { - // Currently, LOC API only support deletion of all aiding data, - // since the Android defined aiding data mask matches with modem, - // so just pass them down without any translation - loc_eng_data.aiding_data_for_deletion |= f; - } if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) @@ -1162,16 +1153,10 @@ static void loc_eng_delete_aiding_data_deferred_action (void) boolean ret_val; ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; - assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); - if (loc_eng_data.aiding_data_for_deletion == GPS_DELETE_ALL) - { - assist_data_ptr->type = RPC_LOC_ASSIST_DATA_ALL; - } - else - { - assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; - } + assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; + loc_eng_data.aiding_data_for_deletion = 0; + memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); ret_val = loc_eng_ioctl (loc_eng_data.client_handle, From 2c115de4096177477cf9495de9dd533267d0607e Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 7 Apr 2010 09:06:06 -0400 Subject: [PATCH 016/945] Hold a wake lock while events are pending for the deferred action thread. Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 99 +++++++++++++++++++--------------- loc_api/libloc_api/loc_eng.h | 60 ++++++++++++--------- 2 files changed, 92 insertions(+), 67 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 514328ca..46827efd 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -91,8 +91,7 @@ static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_p static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); static void* loc_eng_process_deferred_action (void* arg); -static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, - boolean data_connection_closed); +static void loc_eng_process_atl_deferred_action (int flags); static void loc_eng_delete_aiding_data_deferred_action (void); static int set_agps_server(); @@ -182,10 +181,12 @@ static int loc_eng_init(GpsCallbacks* callbacks) memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); // LOC ENG module data initialization - 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.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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | RPC_LOC_EVENT_SATELLITE_REPORT | @@ -200,12 +201,9 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); - loc_eng_data.deferred_action_thread_need_exit = FALSE; loc_eng_data.loc_event = 0; - loc_eng_data.data_connection_succeeded = FALSE; - loc_eng_data.data_connection_closed = FALSE; - loc_eng_data.data_connection_failed = FALSE; + loc_eng_data.deferred_action_flags = 0; memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); loc_eng_data.aiding_data_for_deletion = 0; @@ -256,10 +254,12 @@ static void loc_eng_cleanup() if (loc_eng_data.deferred_action_thread) { /* Terminate deferred action working thread */ - pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); - loc_eng_data.deferred_action_thread_need_exit = TRUE; - pthread_cond_signal (&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_QUIT; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); void* ignoredValue; pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); @@ -520,6 +520,9 @@ static void loc_eng_delete_aiding_data (GpsAidingData f) if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); // In case gps engine is ON, the assistance data will be deleted when the engine is OFF @@ -666,8 +669,11 @@ static int32 loc_event_cb( loc_eng_data.loc_event = loc_event; memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); - pthread_cond_signal (&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_EVENT; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); } else { @@ -919,18 +925,21 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep } } - pthread_mutex_lock (&loc_eng_data.deferred_action_mutex); + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); loc_eng_data.engine_status = status.status; // Wake up the thread for aiding data deletion. if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && (loc_eng_data.aiding_data_for_deletion != 0)) { + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); // In case gps engine is ON, the assistance data will be deleted when the engine is OFF } - pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); } static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) @@ -982,8 +991,11 @@ static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *s loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; } - pthread_cond_signal (&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock (&loc_eng_data.deferred_action_mutex); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_STATUS; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); } /*=========================================================================== @@ -1014,7 +1026,6 @@ static int loc_eng_agps_data_conn_open(const char* apn) LOGD("loc_eng_agps_data_conn_open: %s\n", apn); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - loc_eng_data.data_connection_succeeded = TRUE; if (apn != NULL) { @@ -1030,6 +1041,9 @@ static int loc_eng_agps_data_conn_open(const char* apn) loc_eng_data.apn_name[apn_len] = '\0'; } + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_SUCCESS; pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); return 0; @@ -1039,8 +1053,9 @@ static int loc_eng_agps_data_conn_closed() { LOGD("loc_eng_agps_data_conn_closed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - loc_eng_data.data_connection_closed = TRUE; -// DO WE NEED TO SIGNAL HERE? + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_CLOSED; pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); return 0; @@ -1051,7 +1066,9 @@ static int loc_eng_agps_data_conn_failed() LOGD("loc_eng_agps_data_conn_failed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - loc_eng_data.data_connection_failed = TRUE; + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_FAILED; pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); return 0; @@ -1185,8 +1202,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_eng_process_atl_deferred_action (boolean data_connection_succeeded, - boolean data_connection_closed) +static void loc_eng_process_atl_deferred_action (int flags) { rpc_loc_server_open_status_s_type *conn_open_status_ptr; rpc_loc_server_close_status_s_type *conn_close_status_ptr; @@ -1198,7 +1214,7 @@ static void loc_eng_process_atl_deferred_action (boolean data_connection_succeed memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - if (data_connection_closed) + if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); @@ -1210,7 +1226,7 @@ static void loc_eng_process_atl_deferred_action (boolean data_connection_succeed ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; - if (data_connection_succeeded) + if (flags & DEFERRED_ACTION_AGPS_DATA_SUCCESS) { conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; // Both buffer are of the same maximum size, and the source is null terminated @@ -1352,23 +1368,24 @@ static void* loc_eng_process_deferred_action (void* arg) LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); - while (loc_eng_data.deferred_action_thread_need_exit == FALSE) + while (1) { GpsAidingData aiding_data_for_deletion; GpsStatusValue engine_status; - boolean data_connection_succeeded; - boolean data_connection_closed; - boolean data_connection_failed; rpc_loc_event_mask_type loc_event; rpc_loc_event_payload_u_type loc_event_payload; // Wait until we are signalled to do a deferred action, or exit pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + + if (loc_eng_data.deferred_action_flags == 0) + loc_eng_data.release_wakelock_cb(); + pthread_cond_wait(&loc_eng_data.deferred_action_cond, &loc_eng_data.deferred_action_mutex); - if (loc_eng_data.deferred_action_thread_need_exit == TRUE) + if (loc_eng_data.deferred_action_flags & DEFERRED_ACTION_QUIT) { pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); break; @@ -1381,16 +1398,12 @@ static void* loc_eng_process_deferred_action (void* arg) loc_eng_data.loc_event = 0; } + int flags = loc_eng_data.deferred_action_flags; + loc_eng_data.deferred_action_flags = 0; engine_status = loc_eng_data.agps_status; aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; status.status = loc_eng_data.agps_status; loc_eng_data.agps_status = 0; - data_connection_succeeded = loc_eng_data.data_connection_succeeded; - data_connection_closed = loc_eng_data.data_connection_closed; - data_connection_failed = loc_eng_data.data_connection_failed; - loc_eng_data.data_connection_closed = FALSE; - loc_eng_data.data_connection_succeeded = FALSE; - loc_eng_data.data_connection_failed = FALSE; // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); @@ -1405,15 +1418,16 @@ static void* loc_eng_process_deferred_action (void* arg) loc_eng_delete_aiding_data_deferred_action (); } - if (data_connection_succeeded || data_connection_closed || data_connection_failed) + if (flags & (DEFERRED_ACTION_AGPS_DATA_SUCCESS | + DEFERRED_ACTION_AGPS_DATA_CLOSED | + DEFERRED_ACTION_AGPS_DATA_FAILED)) { - loc_eng_process_atl_deferred_action(data_connection_succeeded, data_connection_closed); + loc_eng_process_atl_deferred_action(flags); } if (status.status != 0 && loc_eng_data.agps_status_cb) { loc_eng_data.agps_status_cb(&status); } - } // reenable the GPS lock @@ -1421,6 +1435,7 @@ static void* loc_eng_process_deferred_action (void* arg) loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); LOGD("loc_eng_process_deferred_action thread exiting\n"); + loc_eng_data.release_wakelock_cb(); return NULL; } diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index f13df31a..6a09a370 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -51,52 +51,62 @@ typedef unsigned char boolean; #define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds +enum { + DEFERRED_ACTION_EVENT = 0x01, + DEFERRED_ACTION_DELETE_AIDING = 0x02, + DEFERRED_ACTION_AGPS_STATUS = 0x04, + DEFERRED_ACTION_AGPS_DATA_SUCCESS = 0x08, + DEFERRED_ACTION_AGPS_DATA_CLOSED = 0x10, + DEFERRED_ACTION_AGPS_DATA_FAILED = 0x20, + DEFERRED_ACTION_QUIT = 0x40, +}; + // Module data typedef struct { - rpc_loc_client_handle_type client_handle; + rpc_loc_client_handle_type client_handle; - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - agps_status_callback agps_status_cb; - gps_nmea_callback nmea_cb; - gps_ni_notify_callback ni_notify_cb; - int agps_status; + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + int agps_status; - loc_eng_xtra_data_s_type xtra_module_data; + loc_eng_xtra_data_s_type xtra_module_data; - loc_eng_ioctl_data_s_type ioctl_data; + loc_eng_ioctl_data_s_type ioctl_data; // data from loc_event_cb rpc_loc_event_mask_type loc_event; rpc_loc_event_payload_u_type loc_event_payload; - boolean data_connection_succeeded; - boolean data_connection_closed; - boolean data_connection_failed; // TBD: - char agps_server_host[256]; - int agps_server_port; - uint32 agps_server_address; - char apn_name[100]; - int position_mode; + char agps_server_host[256]; + int agps_server_port; + uint32 agps_server_address; + char apn_name[100]; + int position_mode; rpc_loc_server_connection_handle conn_handle; // GPS engine status - GpsStatusValue engine_status; + GpsStatusValue engine_status; // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off - GpsAidingData aiding_data_for_deletion; + GpsAidingData aiding_data_for_deletion; // Data variables used by deferred action thread - pthread_t deferred_action_thread; - // Signal deferred action thread to exit - boolean deferred_action_thread_need_exit; + pthread_t deferred_action_thread; // Mutex used by deferred action thread - pthread_mutex_t deferred_action_mutex; + pthread_mutex_t deferred_action_mutex; // Condition variable used by deferred action thread - pthread_cond_t deferred_action_cond; + pthread_cond_t deferred_action_cond; + + // flags for pending events for deferred action thread + int deferred_action_flags; } loc_eng_data_s_type; extern loc_eng_data_s_type loc_eng_data; From 3c865ec2f9efbe5e21b55c1b43a2fbe9ffe1000a Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Fri, 9 Apr 2010 16:18:01 -0400 Subject: [PATCH 017/945] Add more parameters to set_position_mode, notify framework of our capabilities. Change-Id: Ie53106b89030d48187d17be47482a3c74b837f3e Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 58 +++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 46827efd..f49e80d1 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -66,7 +66,8 @@ $Author: $ static int loc_eng_init(GpsCallbacks* callbacks); static int loc_eng_start(); static int loc_eng_stop(); -static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency); +static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static void loc_eng_cleanup(); static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); static int loc_eng_inject_location(double latitude, double longitude, float accuracy); @@ -178,6 +179,8 @@ static int loc_eng_init(GpsCallbacks* callbacks) // Start the LOC api RPC service loc_api_glue_init (); + callbacks->set_capabilities_cb(GPS_CAPABILITY_SCHEDULING | GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); // LOC ENG module data initialization @@ -379,7 +382,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) FUNCTION loc_eng_set_position_mode DESCRIPTION - Sets the mode and fix frequnecy (in seconds) for the tracking session. + Sets the mode and fix frequency for the tracking session. DEPENDENCIES None @@ -391,37 +394,56 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_eng_set_position_mode(GpsPositionMode mode, int fix_frequency) +static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_fix_criteria_s_type *fix_criteria_ptr; boolean ret_val; LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) loc_eng_data.client_handle, fix_frequency, mode); + (int32) loc_eng_data.client_handle, min_interval, mode); loc_eng_data.position_mode = mode; ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); - fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL | - RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | + 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 = fix_frequency * 1000; // Translate to ms - fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX; - if (mode == GPS_POSITION_MODE_MS_BASED) - { - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; + switch (mode) { + case GPS_POSITION_MODE_MS_BASED: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; + break; + case GPS_POSITION_MODE_MS_ASSISTED: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; + break; + case GPS_POSITION_MODE_STANDALONE: + default: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; + break; } - else if (mode == GPS_POSITION_MODE_MS_ASSISTED) - { - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; + if (min_interval > 0) { + fix_criteria_ptr->min_interval = min_interval; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; } - // Default: standalone - else - { - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; + if (preferred_accuracy > 0) { + fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; + } + if (preferred_time > 0) { + fix_criteria_ptr->preferred_response_time = preferred_time; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; + } + + switch (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; } ret_val = loc_eng_ioctl(loc_eng_data.client_handle, From fba22d5c621727a7a5f0334f9a07b6bf980a5a52 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 17 Jun 2010 07:45:52 -0700 Subject: [PATCH 018/945] loc_api: rearrange RPC glue to allow having multiple versions of the API. The API version can be chosen by specifying the AMSS version in the board config by setting the BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION variable. The existing GPS_LOC_API_HARDWARE has been renamed BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE Change-Id: I25aa313d7f291b874d52dfb7edf151e280061438 Signed-off-by: Mike Lockwood --- loc_api/Android.mk | 2 +- loc_api/libloc_api-rpc/Android.mk | 19 ++++--- .../{gen-6356 => gen-3200}/Makefile.xdr | 4 +- .../{gen-6356 => gen-3200}/loc_api.xdr | 0 .../{gen-6356 => gen-3200}/loc_api_cb.xdr | 0 .../{gen-6356 => gen-3200}/loc_api_cb_svc.c | 19 +------ .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 ++++++++++++ .../{gen-6356 => gen-3200}/loc_api_clnt.c | 17 ------- .../{gen-6356 => gen-3200}/loc_api_common.xdr | 0 .../loc_api_common_xdr.c | 17 ------- .../{gen-6356 => gen-3200}/loc_api_fixup.c | 0 .../{src => gen-3200}/loc_api_rpc_glue.c | 4 +- .../{gen-6356 => gen-3200}/loc_api_xdr.c | 17 ------- .../libloc_api-rpc/gen-6356/loc_api_cb_xdr.c | 49 ------------------- .../{rpc_inc => inc-3200}/loc_api.h | 18 +------ .../{rpc_inc => inc-3200}/loc_api_cb.h | 17 ------- .../{rpc_inc => inc-3200}/loc_api_common.h | 20 +------- .../{rpc_inc => inc-3200}/loc_api_fixup.h | 0 .../{rpc_inc => inc-3200}/loc_apicb_appinit.h | 0 .../libloc_api-rpc/{rpc_inc => inc}/debug.h | 0 .../{rpc_inc => inc}/loc_api_rpc_glue.h | 8 +-- .../libloc_api-rpc/src/loc_apicb_appinit.c | 8 +-- loc_api/libloc_api/Android.mk | 9 ++-- 23 files changed, 62 insertions(+), 198 deletions(-) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/Makefile.xdr (96%) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api.xdr (100%) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_cb.xdr (100%) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_cb_svc.c (53%) mode change 100755 => 100644 create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_clnt.c (62%) mode change 100755 => 100644 rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_common.xdr (100%) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_common_xdr.c (96%) mode change 100755 => 100644 rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_fixup.c (100%) rename loc_api/libloc_api-rpc/{src => gen-3200}/loc_api_rpc_glue.c (99%) rename loc_api/libloc_api-rpc/{gen-6356 => gen-3200}/loc_api_xdr.c (71%) mode change 100755 => 100644 delete mode 100755 loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c rename loc_api/libloc_api-rpc/{rpc_inc => inc-3200}/loc_api.h (83%) mode change 100755 => 100644 rename loc_api/libloc_api-rpc/{rpc_inc => inc-3200}/loc_api_cb.h (54%) mode change 100755 => 100644 rename loc_api/libloc_api-rpc/{rpc_inc => inc-3200}/loc_api_common.h (96%) mode change 100755 => 100644 rename loc_api/libloc_api-rpc/{rpc_inc => inc-3200}/loc_api_fixup.h (100%) rename loc_api/libloc_api-rpc/{rpc_inc => inc-3200}/loc_apicb_appinit.h (100%) rename loc_api/libloc_api-rpc/{rpc_inc => inc}/debug.h (100%) rename loc_api/libloc_api-rpc/{rpc_inc => inc}/loc_api_rpc_glue.h (96%) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 293b2da1..52942bfe 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,6 +6,6 @@ # · Neither the name of the QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. -ifneq ($(GPS_LOC_API_HARDWARE),) +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) include $(call all-subdir-makefiles) endif diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk index f5d40089..dc4d53d2 100755 --- a/loc_api/libloc_api-rpc/Android.mk +++ b/loc_api/libloc_api-rpc/Android.mk @@ -11,9 +11,8 @@ ifneq ($(BUILD_TINY_ANDROID),true) LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -RPC_INC:=rpc_inc - -AMSS_VERSION:=6356 +AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) +RPC_INC:=inc-$(AMSS_VERSION) generated_files:= \ gen-$(AMSS_VERSION)/loc_api_clnt.c \ @@ -21,8 +20,8 @@ generated_files:= \ gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - src/loc_api_rpc_glue.c \ + gen-$(AMSS_VERSION)/loc_api_fixup.c \ + gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ src/loc_apicb_appinit.c LOCAL_SRC_FILES:= $(generated_files) @@ -31,7 +30,6 @@ LOCAL_SRC_FILES:= $(generated_files) # src/loc_api_cb_server.c LOCAL_CFLAGS:=-fno-short-enums -# LOCAL_CFLAGS+=-include $(RPC_INC)/commondefs.h LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h LOCAL_CFLAGS+=-DDEBUG # LOCAL_CFLAGS+=-DDEBUG -DVERBOSE @@ -43,18 +41,19 @@ LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc LOCAL_PRELINK_MODULE:= false -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/$(RPC_INC) +LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/debug.h \ $(RPC_INC)/loc_api_cb.h \ $(RPC_INC)/loc_api_common.h \ $(RPC_INC)/loc_api.h \ $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_api_rpc_glue.h \ - $(RPC_INC)/loc_apicb_appinit.h + $(RPC_INC)/loc_apicb_appinit.h \ + inc/debug.h \ + inc/loc_api_rpc_glue.h LOCAL_C_INCLUDES:= \ $(LOCAL_PATH) \ + $(LOCAL_PATH)/inc \ $(LOCAL_PATH)/$(RPC_INC) \ $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ $(TARGET_OUT_HEADERS)/librpc diff --git a/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr similarity index 96% rename from loc_api/libloc_api-rpc/gen-6356/Makefile.xdr rename to loc_api/libloc_api-rpc/gen-3200/Makefile.xdr index e6e863fa..60f730c2 100755 --- a/loc_api/libloc_api-rpc/gen-6356/Makefile.xdr +++ b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr @@ -10,7 +10,7 @@ CLIENTS:= loc_api SERVERS:= loc_api_cb COMMON:= loc_api_common -RPC_INC:=rpc_inc +RPC_INC:= inc-$(AMSS_VERSION) all: $(CLIENTS) $(SERVERS) $(COMMON) fixup @@ -28,7 +28,7 @@ $(SERVERS):: fixup: mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h rm -f ../$(RPC_INC)/loc_api_common.h.bak clean: diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr similarity index 100% rename from loc_api/libloc_api-rpc/gen-6356/loc_api.xdr rename to loc_api/libloc_api-rpc/gen-3200/loc_api.xdr diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr similarity index 100% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_cb.xdr rename to loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c old mode 100755 new mode 100644 similarity index 53% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c index 3b94e624..b1aa1998 --- a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_svc.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c @@ -1,21 +1,4 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. */ diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c old mode 100755 new mode 100644 similarity index 62% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c index 886e5e53..79814d42 --- a/loc_api/libloc_api-rpc/gen-6356/loc_api_clnt.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c @@ -1,20 +1,3 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr similarity index 100% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_common.xdr rename to loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c old mode 100755 new mode 100644 similarity index 96% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c index a68d94ff..7b37b9c3 --- a/loc_api/libloc_api-rpc/gen-6356/loc_api_common_xdr.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c @@ -1,20 +1,3 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c similarity index 100% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_fixup.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c diff --git a/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c similarity index 99% rename from loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c index 930ff1c4..8c171222 100755 --- a/loc_api/libloc_api-rpc/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -57,10 +57,10 @@ when who what, where, why #include /* Include RPC headers */ -#include "rpc_inc/loc_api_rpc_glue.h" +#include "loc_api_rpc_glue.h" /* Callback init */ -#include "rpc_inc/loc_apicb_appinit.h" +#include "loc_apicb_appinit.h" /* Logging */ #define LOG_TAG "lib_api_rpc_glue" diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c old mode 100755 new mode 100644 similarity index 71% rename from loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c rename to loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c index 7e6a3e16..835f6b18 --- a/loc_api/libloc_api-rpc/gen-6356/loc_api_xdr.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c @@ -1,20 +1,3 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c deleted file mode 100755 index 51bb47f6..00000000 --- a/loc_api/libloc_api-rpc/gen-6356/loc_api_cb_xdr.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h old mode 100755 new mode 100644 similarity index 83% rename from loc_api/libloc_api-rpc/rpc_inc/loc_api.h rename to loc_api/libloc_api-rpc/inc-3200/loc_api.h index 95f9be52..8998aca4 --- a/loc_api/libloc_api-rpc/rpc_inc/loc_api.h +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api.h @@ -1,20 +1,4 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. */ diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h old mode 100755 new mode 100644 similarity index 54% rename from loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h rename to loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h index cbc783d5..4f2f8f91 --- a/loc_api/libloc_api-rpc/rpc_inc/loc_api_cb.h +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h @@ -1,20 +1,3 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h old mode 100755 new mode 100644 similarity index 96% rename from loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h rename to loc_api/libloc_api-rpc/inc-3200/loc_api_common.h index 66bfcb4f..04be079f --- a/loc_api/libloc_api-rpc/rpc_inc/loc_api_common.h +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h @@ -1,20 +1,4 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. */ @@ -23,7 +7,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define _LOC_API_COMMON_H_RPCGEN #include -#include "rpc_inc/loc_api_fixup.h" +#include "loc_api_fixup.h" #include diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h similarity index 100% rename from loc_api/libloc_api-rpc/rpc_inc/loc_api_fixup.h rename to loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h similarity index 100% rename from loc_api/libloc_api-rpc/rpc_inc/loc_apicb_appinit.h rename to loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h diff --git a/loc_api/libloc_api-rpc/rpc_inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h similarity index 100% rename from loc_api/libloc_api-rpc/rpc_inc/debug.h rename to loc_api/libloc_api-rpc/inc/debug.h diff --git a/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h similarity index 96% rename from loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h rename to loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h index e855162e..ef972bd6 100755 --- a/loc_api/libloc_api-rpc/rpc_inc/loc_api_rpc_glue.h +++ b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h @@ -41,10 +41,10 @@ $Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/so #define LOC_API_RPC_GLUE_H /* Include RPC headers */ -#include "rpc_inc/loc_api_common.h" -#include "rpc_inc/loc_api.h" -#include "rpc_inc/loc_api_cb.h" -#include "rpc_inc/loc_api_fixup.h" +#include "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "loc_api_fixup.h" #ifdef __cplusplus extern "C" diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c index 511080c0..7fcfd6cb 100755 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c @@ -15,10 +15,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ------------------------------------------------------------------------------- */ #include "rpc/rpc.h" -#include "rpc_inc/loc_api_common.h" -#include "rpc_inc/loc_api.h" -#include "rpc_inc/loc_api_cb.h" -#include "rpc_inc/loc_api_fixup.h" +#include "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "loc_api_fixup.h" #include "loc_apicb_appinit.h" diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index 040a57c3..74979183 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -6,12 +6,10 @@ #· Neither the name of the QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. -AMSS_VERSION:=6356 - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := gps.$(GPS_LOC_API_HARDWARE) +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) LOCAL_STATIC_LIBRARIES:= \ libloc_api-rpc @@ -29,11 +27,12 @@ LOCAL_SRC_FILES += \ gps.c LOCAL_CFLAGS += \ - -fno-short-enums + -fno-short-enums \ + -DAMSS_VERSION=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/libloc_api-rpc \ - $(TARGET_OUT_HEADERS)/libloc_api-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc/inc \ $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ $(TARGET_OUT_HEADERS)/librpc From c6419effb6a1da6dbc86432e66d64b5bfcacbad6 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 17 Jun 2010 10:58:49 -0700 Subject: [PATCH 019/945] librpc: XDRs and glue code for AMSS 1240 Change-Id: Ic69d0085ab8793c6d32f811892cb3e0375b2ef6c Signed-off-by: Mike Lockwood --- loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 38 + loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 ++ .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 + .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 + .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 + .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 + .../gen-1240/loc_api_common.xdr | 906 +++++++++ .../gen-1240/loc_api_common_xdr.c | 1650 +++++++++++++++++ .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 + .../gen-1240/loc_api_rpc_glue.c | 339 ++++ loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 ++ loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 +++ loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 + .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ++++++++++++ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 ++ .../inc-1240/loc_apicb_appinit.h | 34 + loc_api/libloc_api/loc_eng.cpp | 44 +- loc_api/libloc_api/loc_eng_ni.cpp | 16 + 18 files changed, 5295 insertions(+), 11 deletions(-) create mode 100755 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c create mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h create mode 100755 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h create mode 100755 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr new file mode 100755 index 00000000..60f730c2 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr @@ -0,0 +1,38 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + + +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:= inc-$(AMSS_VERSION) + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr new file mode 100644 index 00000000..a9d60aa4 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr @@ -0,0 +1,172 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + + + version LOC_APIVERS_0002 { + +/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 +RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ +*/ + + void + rpc_loc_api_null( void ) = 0; + + } = 0x00040002; + + +} = 0x3000008c; + +const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr new file mode 100644 index 00000000..1bd4e151 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr @@ -0,0 +1,85 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + +} = 0x3100008c; + +const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c new file mode 100644 index 00000000..52a0d15b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c new file mode 100644 index 00000000..dca1e8d5 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c @@ -0,0 +1,91 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "loc_api.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr new file mode 100644 index 00000000..4e01607d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr @@ -0,0 +1,906 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + +const LOC_API_TOOLVERS = 0x00040024; +const LOC_API_FEATURES = 0x00000001; + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; +const RPC_LOC_OPEN_VERSION = 0x00040001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; +const RPC_LOC_API_NULL_VERSION = 0x00040001; +const RPC_LOC_STOP_FIX_VERSION = 0x00040001; +const RPC_LOC_IOCTL_VERSION = 0x00040001; +const RPC_LOC_START_FIX_VERSION = 0x00040001; +const RPC_LOC_CLOSE_VERSION = 0x00040001; +const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; +const RPC_LOC_API_API_MAJOR_NUM = 0x0004; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; + +typedef bool rpc_boolean; + +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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[1200]; /* EVAL:[1200]*/ +}; + +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_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]; /* EVAL:[256]*/ +}; + +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; + 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ + + typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + 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_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_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_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 +}; + +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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c new file mode 100644 index 00000000..7c860bf3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c @@ -0,0 +1,1650 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, 1200)) + 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_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; + 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_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; + 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_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_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; + 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_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_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_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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c new file mode 100755 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c new file mode 100755 index 00000000..fbaca8b6 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Include RPC headers */ +#include "loc_api_rpc_glue.h" + +/* Callback init */ +#include "loc_apicb_appinit.h" + +/* Logging */ +#define LOG_TAG "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00040001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c new file mode 100644 index 00000000..835f6b18 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c @@ -0,0 +1,171 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h new file mode 100644 index 00000000..e02648cc --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api.h @@ -0,0 +1,210 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(); +extern bool_t rpc_loc_api_null_0x00040001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00040001(); +extern bool_t rpc_loc_open_0x00040001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(); +extern bool_t rpc_loc_close_0x00040001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00040001(); +extern bool_t rpc_loc_start_fix_0x00040001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); +extern bool_t rpc_loc_stop_fix_0x00040001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00040001(); +extern bool_t rpc_loc_ioctl_0x00040001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); +extern int loc_apiprog_0x00040001_freeresult (); +#endif /* K&R C */ +#define LOC_APIVERS_0002 0x00040002 + +#if defined(__STDC__) || defined(__cplusplus) +extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); +extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +extern enum clnt_stat rpc_loc_api_null_0x00040002(); +extern bool_t rpc_loc_api_null_0x00040002_svc(); +extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h new file mode 100644 index 00000000..67ac0846 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_CB_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00040001_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_0x00040001(); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); +extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h new file mode 100644 index 00000000..6ff3baf1 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h @@ -0,0 +1,1154 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_COMMON_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOC_API_TOOLVERS 0x00040024 +#define LOC_API_FEATURES 0x00000001 +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 +#define RPC_LOC_OPEN_VERSION 0x00040001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 +#define RPC_LOC_API_NULL_VERSION 0x00040001 +#define RPC_LOC_STOP_FIX_VERSION 0x00040001 +#define RPC_LOC_IOCTL_VERSION 0x00040001 +#define RPC_LOC_START_FIX_VERSION 0x00040001 +#define RPC_LOC_CLOSE_VERSION 0x00040001 +#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 +#define RPC_LOC_API_API_MAJOR_NUM 0x0004 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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[1200]; +}; +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_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_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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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_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_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_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; + +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; + +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_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_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_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_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h new file mode 100755 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h new file mode 100755 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index f49e80d1..87c26f49 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -973,8 +973,12 @@ static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_p gettimeofday(&tv, (struct timezone *) NULL); long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; +#if (AMSS_VERSION==3200) loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, nmea_report_ptr->nmea_sentences.nmea_sentences_len); +#else + loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences, nmea_report_ptr->length); +#endif } } @@ -1102,8 +1106,6 @@ static int set_agps_server() rpc_loc_server_info_s_type *server_info_ptr; boolean ret_val; uint16 port_temp; - char url[24]; - int len; unsigned char *b_ptr; if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) @@ -1118,22 +1120,36 @@ static int set_agps_server() return -1; b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); - memset(url, 0, sizeof(url)); - snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", - (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), - (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), - (loc_eng_data.agps_server_port & (0x0000ffff))); - len = strlen (url); + server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = len; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len= len; +#if (AMSS_VERSION==3200) + char url[24]; + memset(url, 0, sizeof(url)); + snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); +#else + char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; + int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); + memset(buf, 0, buf_len); + snprintf(buf, buf_len - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; + LOGD ("set_agps_server, addr = %s\n", buf); +#endif ret_val = loc_eng_ioctl (loc_eng_data.client_handle, RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, @@ -1253,7 +1269,13 @@ static void loc_eng_process_atl_deferred_action (int flags) conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; // Both buffer are of the same maximum size, and the source is null terminated // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); +#if (AMSS_VERSION==3200) conn_open_status_ptr->apn_name = loc_eng_data.apn_name; +#else + memset(conn_open_status_ptr->apn_name, 0, sizeof(conn_open_status_ptr->apn_name)); + strncpy(conn_open_status_ptr->apn_name, loc_eng_data.apn_name, + sizeof(conn_open_status_ptr->apn_name) - 1); +#endif // Delay this so that PDSM ATL module will behave properly sleep (1); LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 9888d4df..fec86b6e 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -323,12 +323,20 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ // Stores notification text hexcode(notif.text, sizeof notif.text, +#if (AMSS_VERSION==3200) umts_cp_req->notification_text.notification_text_val, +#else + umts_cp_req->notification_text, +#endif umts_cp_req->notification_length); // Stores requestor ID hexcode(notif.requestor_id, sizeof notif.requestor_id, +#if (AMSS_VERSION==3200) umts_cp_req->requestor_id.requestor_id_string.requestor_id_string_val, +#else + umts_cp_req->requestor_id.requestor_id_string, +#endif umts_cp_req->requestor_id.string_len); notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); @@ -351,7 +359,11 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) { hexcode(notif.text, sizeof notif.text, +#if (AMSS_VERSION==3200) supl_req->client_name.client_name_string.client_name_string_val, /* buffer */ +#else + supl_req->client_name.client_name_string, /* buffer */ +#endif supl_req->client_name.string_len /* length */ ); LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); @@ -363,7 +375,11 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) { hexcode(notif.requestor_id, sizeof notif.requestor_id, +#if (AMSS_VERSION==3200) supl_req->requestor_id.requestor_id_string.requestor_id_string_val, /* buffer */ +#else + supl_req->requestor_id.requestor_id_string, /* buffer */ +#endif supl_req->requestor_id.string_len /* length */ ); LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); From 5153d56321e20974d29c0649839d96e8351775b6 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Sun, 20 Jun 2010 14:31:24 -0700 Subject: [PATCH 020/945] loc_api: Use create_thread_cb for all threads that call back into the framework. Change-Id: I07c2d5664d3f1a167af56ddd76b60393de170931 Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 17 ++++++++--------- loc_api/libloc_api/loc_eng_ni.cpp | 27 ++------------------------- loc_api/libloc_api/loc_eng_ni.h | 1 - 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 87c26f49..fa0a598b 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -91,7 +91,7 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); -static void* loc_eng_process_deferred_action (void* arg); +static void loc_eng_process_deferred_action (void* arg); static void loc_eng_process_atl_deferred_action (int flags); static void loc_eng_delete_aiding_data_deferred_action (void); @@ -227,10 +227,8 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); loc_eng_data.deferred_action_thread = NULL; - pthread_create (&(loc_eng_data.deferred_action_thread), - NULL, - loc_eng_process_deferred_action, - NULL); + loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", + loc_eng_process_deferred_action, NULL); LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); return 0; @@ -937,13 +935,13 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON status.status = GPS_STATUS_SESSION_BEGIN; - loc_eng_data.status_cb (&status); + loc_eng_data.status_cb(&status); } else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) { // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF status.status = GPS_STATUS_ENGINE_OFF; - loc_eng_data.status_cb (&status); + loc_eng_data.status_cb(&status); } } @@ -1397,7 +1395,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void* loc_eng_process_deferred_action (void* arg) +static void loc_eng_process_deferred_action (void* arg) { AGpsStatus status; status.size = sizeof(status); @@ -1480,7 +1478,8 @@ static void* loc_eng_process_deferred_action (void* arg) LOGD("loc_eng_process_deferred_action thread exiting\n"); loc_eng_data.release_wakelock_cb(); - return NULL; + + loc_eng_data.deferred_action_thread = 0; } // for gps.c diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index fec86b6e..958103a1 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -520,7 +520,7 @@ int loc_eng_ni_callback ( FUNCTION loc_ni_thread_proc ===========================================================================*/ -static void* loc_ni_thread_proc(void *threadid) +static void loc_ni_thread_proc(void *unused) { LOGI("Starting Loc NI thread...\n"); @@ -543,29 +543,6 @@ static void* loc_ni_thread_proc(void *threadid) pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); } /* while (1) */ - - pthread_exit(NULL); - return NULL; -} - -/*=========================================================================== - -FUNCTION loc_ni_thread_start - -===========================================================================*/ -static int loc_ni_thread_start(void) -{ - int rc = 0; - - rc = pthread_create(&loc_eng_ni_data.loc_ni_thread, NULL, loc_ni_thread_proc, NULL); - - if (rc) - { - LOGE("Loc NI thread is not created.\n"); - return -1; - } - - return 0; } /*=========================================================================== @@ -591,7 +568,7 @@ void loc_eng_ni_init(GpsNiCallbacks *callbacks) if (!loc_eng_ni_data_init) { pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); - loc_ni_thread_start(); + callbacks->create_thread_cb("loc_api_ni", loc_ni_thread_proc, NULL); loc_eng_ni_data_init = TRUE; } diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index be234054..88d285ae 100755 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -36,7 +36,6 @@ $Id: extern const GpsNiInterface sLocEngNiInterface; typedef struct { - pthread_t loc_ni_thread; /* NI thread */ pthread_mutex_t loc_ni_lock; int response_time_left; /* examine time for NI response */ boolean notif_in_progress; /* NI notification/verification in progress */ From 9391343952a0ab27a738f5b3de5c5525ecbc096d Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 22 Sep 2010 14:27:57 -0400 Subject: [PATCH 021/945] loc_api: Disable code that completely shuts down our connection with the GPS This avoids a race condition that can crash the BP if the GPS is disabled in settings while it is running. This also fixes a problem with the GPS icon in the status bar not getting removed when the GPS is disabled. BUG: 3005091 Change-Id: I539eef716231cefae3d4d0a8203135da9827b45d Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index fa0a598b..7fed937e 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -174,8 +174,18 @@ SIDE EFFECTS N/A ===========================================================================*/ + +// fully shutting down the GPS is temporarily disabled to avoid intermittent BP crash +#define DISABLE_CLEANUP 1 + static int loc_eng_init(GpsCallbacks* callbacks) { +#if DISABLE_CLEANUP + if (loc_eng_data.deferred_action_thread) { + // already initialized + return 0; + } +#endif // Start the LOC api RPC service loc_api_glue_init (); @@ -226,7 +236,6 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); - loc_eng_data.deferred_action_thread = NULL; loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", loc_eng_process_deferred_action, NULL); @@ -252,6 +261,9 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_cleanup() { +#if DISABLE_CLEANUP + return; +#else if (loc_eng_data.deferred_action_thread) { /* Terminate deferred action working thread */ @@ -278,6 +290,7 @@ static void loc_eng_cleanup() // Do not call this as it can result in the ARM9 crashing if it sends events while we are disabled // loc_apicb_app_deinit(); +#endif } From bd3166c592f9f578040bb94bd7c68e4f01a0038d Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Mon, 25 Oct 2010 16:11:45 -0400 Subject: [PATCH 022/945] Work around a problem stopping the GPS engine while an AGPS data call is active Sometimes the engine does not send us the GPS_STATUS_ENGINE_OFF message, so we end up blinking the GPS icon forever. Deferring the loc_eng_stop call until the AGPS activity is done works around this problem. Change-Id: Iad0d15323ff909c0d371f9db3a6e899e51375a99 Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 27 ++++++++++++++++++++++++++- loc_api/libloc_api/loc_eng.h | 5 +++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 7fed937e..f9a3fa37 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -214,7 +214,8 @@ static int loc_eng_init(GpsCallbacks* callbacks) pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); - + pthread_mutex_init (&(loc_eng_data.deferred_stop_mutex), NULL); + loc_eng_data.loc_event = 0; loc_eng_data.deferred_action_flags = 0; memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); @@ -355,6 +356,18 @@ static int loc_eng_stop() LOGD ("loc_eng_stop\n"); + pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); + // work around problem with loc_eng_stop when AGPS requests are pending + // we defer stopping the engine until the AGPS request is done + if (loc_eng_data.agps_request_pending) + { + loc_eng_data.stop_request_pending = true; + LOGD ("deferring stop until AGPS data call is finished\n"); + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); + return 0; + } + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); + ret_val = loc_stop_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { @@ -1021,11 +1034,13 @@ static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *s { loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; + loc_eng_data.agps_request_pending = true; } else { loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; + loc_eng_data.agps_request_pending = false; } /* hold a wake lock while events are pending for deferred_action_thread */ @@ -1478,6 +1493,16 @@ static void loc_eng_process_deferred_action (void* arg) DEFERRED_ACTION_AGPS_DATA_FAILED)) { loc_eng_process_atl_deferred_action(flags); + + pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); + // work around problem with loc_eng_stop when AGPS requests are pending + // we defer stopping the engine until the AGPS request is done + loc_eng_data.agps_request_pending = false; + if (loc_eng_data.stop_request_pending) + { + loc_eng_stop(); + } + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); } if (status.status != 0 && loc_eng_data.agps_status_cb) { diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 6a09a370..39f3d91b 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -76,6 +76,11 @@ typedef struct gps_release_wakelock release_wakelock_cb; int agps_status; + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; + pthread_mutex_t deferred_stop_mutex; + loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ioctl_data_s_type ioctl_data; From 0b602e40b8dc1f134ed94f7a781b1be2b88e760d Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 26 Oct 2010 00:09:25 -0400 Subject: [PATCH 023/945] Fix recursive use of mutex introduced in previous change. Change-Id: I2ef4e1187a03f28712d16920b275d39963ff5ac7 Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index f9a3fa37..ed278243 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1500,7 +1500,11 @@ static void loc_eng_process_deferred_action (void* arg) loc_eng_data.agps_request_pending = false; if (loc_eng_data.stop_request_pending) { - loc_eng_stop(); + LOGD ("handling deferred stop\n"); + if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_stop_fix failed!\n"); + } } pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); } From a162c4351926285892214b0726aaf07f0631dc72 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 27 Oct 2010 14:53:57 -0400 Subject: [PATCH 024/945] Fix threading problem that resulted in the wakelock being held too long. In some circumstances we were calling wait after we had been signalled, causing us to wait until we are signalled again (while holding a wakelock). Now we only want to wait in the deferred action thread if no events are pending and only hold the wakelock while not waiting. BUG: 3127617 Change-Id: I4c6886b2bbdcbcb2c0cf348d89bc5408f0d875b9 Signed-off-by: Mike Lockwood --- loc_api/libloc_api/loc_eng.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index ed278243..8a3d4120 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1449,11 +1449,17 @@ static void loc_eng_process_deferred_action (void* arg) // Wait until we are signalled to do a deferred action, or exit pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - if (loc_eng_data.deferred_action_flags == 0) + // If we have an event we should process it immediately, + // otherwise wait until we are signalled + if (loc_eng_data.deferred_action_flags == 0) { + // do not hold a wake lock while waiting for an event... loc_eng_data.release_wakelock_cb(); - - pthread_cond_wait(&loc_eng_data.deferred_action_cond, - &loc_eng_data.deferred_action_mutex); + pthread_cond_wait(&loc_eng_data.deferred_action_cond, + &loc_eng_data.deferred_action_mutex); + // but after we are signalled reacquire the wake lock + // until we are done processing the event. + loc_eng_data.acquire_wakelock_cb(); + } if (loc_eng_data.deferred_action_flags & DEFERRED_ACTION_QUIT) { From 13e995a1fec4d7b529367654f13d203e6ac3147d Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Mon, 14 Mar 2011 14:02:15 -0700 Subject: [PATCH 025/945] hardware/qcom/gps: remove LOCAL_PRELINK_MODULE Change-Id: Ief16d1230650afb07a395a03c7ecefa9b6434376 Signed-off-by: Iliyan Malchev --- loc_api/libloc_api-rpc/Android.mk | 2 +- loc_api/libloc_api/Android.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk index dc4d53d2..a0fec50f 100755 --- a/loc_api/libloc_api-rpc/Android.mk +++ b/loc_api/libloc_api-rpc/Android.mk @@ -39,7 +39,7 @@ LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL LOCAL_SHARED_LIBRARIES:= librpc LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc -LOCAL_PRELINK_MODULE:= false + LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc LOCAL_COPY_HEADERS:= \ diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index 74979183..1fd409f5 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -36,7 +36,7 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ $(TARGET_OUT_HEADERS)/librpc -LOCAL_PRELINK_MODULE := false + LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw include $(BUILD_SHARED_LIBRARY) From 7c2f7b69f91e660f872d0ca15ab14b32d23e53d4 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 20 Oct 2011 11:56:19 +0100 Subject: [PATCH 026/945] Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: Idd9e9b1c42806438a86507d614c64aa42ef42e16 --- loc_api/libloc_api/loc_eng.cpp | 22 +++++++++++----------- loc_api/libloc_api/loc_eng_ioctl.cpp | 10 +++++----- loc_api/libloc_api/loc_eng_xtra.cpp | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 8a3d4120..03286313 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -708,7 +708,7 @@ static int32 loc_event_cb( const rpc_loc_event_payload_u_type* loc_event_payload ) { - LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + ALOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); if (client_handle == loc_eng_data.client_handle) { pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -749,7 +749,7 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat { GpsLocation location; - LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + ALOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); memset (&location, 0, sizeof(location)); @@ -800,18 +800,18 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat if (loc_eng_data.location_cb != NULL) { - LOGV ("loc_eng_report_position: fire callback\n"); + ALOGV ("loc_eng_report_position: fire callback\n"); loc_eng_data.location_cb (&location); } } else { - LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + ALOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); } } else { - LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + ALOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); } } @@ -837,7 +837,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) int num_svs_max, i; const rpc_loc_sv_info_s_type *sv_info_ptr; - LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + ALOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", (uint32) gnss_report_ptr->valid_mask, gnss_report_ptr->sv_count); @@ -923,7 +923,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) } } - LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + ALOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) { loc_eng_data.sv_status_cb(&SvStatus); @@ -950,7 +950,7 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { GpsStatus status; - LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + ALOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); memset (&status, 0, sizeof(status)); status.size = sizeof(status); @@ -1068,7 +1068,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_agps_init(AGpsCallbacks* callbacks) { - LOGV("loc_eng_agps_init\n"); + ALOGV("loc_eng_agps_init\n"); loc_eng_data.agps_status_cb = callbacks->status_cb; } @@ -1190,7 +1190,7 @@ static int set_agps_server() } else { - LOGV ("set_agps_server successful\n"); + ALOGV ("set_agps_server successful\n"); return 0; } } @@ -1274,7 +1274,7 @@ static void loc_eng_process_atl_deferred_action (int flags) boolean ret_val; int agps_status = -1; - LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + ALOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index 87ca5b00..6ea17f7d 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -97,7 +97,7 @@ boolean loc_eng_ioctl( int rpc_ret_val; loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + ALOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); // Select the callback we are waiting for @@ -109,7 +109,7 @@ boolean loc_eng_ioctl( ioctl_type, ioctl_data_ptr); - LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + ALOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); if (rpc_ret_val == RPC_LOC_API_SUCCESS) { @@ -260,7 +260,7 @@ boolean loc_eng_ioctl_wait_cb( ret_val = FALSE; } - LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + ALOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); } while (0); @@ -286,7 +286,7 @@ boolean loc_eng_ioctl_wait_cb( pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + ALOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); return ret_val; } @@ -339,7 +339,7 @@ boolean loc_eng_ioctl_process_cb ( ioctl_cb_data_ptr->cb_has_arrived = TRUE; - LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + ALOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, (int32) ioctl_cb_data_ptr->cb_payload.status); diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index 9dda092b..8ac8044c 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -120,7 +120,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + ALOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA; @@ -147,8 +147,8 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) 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; - LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); - LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + ALOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + ALOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); if (part < total_parts) { @@ -176,7 +176,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) } len_injected += predicted_orbits_data_ptr->part_len; - LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + ALOGV ("loc_ioctl for xtra len injected %d \n", len_injected); } return ret_val; From b80e8ff4f8022a07a34ed2bc9395c73bbcc82759 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 20 Dec 2011 16:25:13 +0000 Subject: [PATCH 027/945] Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I5a8da519f9d62f6b2978313462e32cba4cec6304 --- .../gen-1240/loc_api_rpc_glue.c | 18 ++--- .../gen-3200/loc_api_rpc_glue.c | 18 ++--- loc_api/libloc_api-rpc/inc/debug.h | 2 +- loc_api/libloc_api/loc_eng.cpp | 72 +++++++++---------- loc_api/libloc_api/loc_eng_ioctl.cpp | 14 ++-- loc_api/libloc_api/loc_eng_ni.cpp | 20 +++--- loc_api/libloc_api/loc_eng_xtra.cpp | 4 +- 7 files changed, 74 insertions(+), 74 deletions(-) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c index fbaca8b6..571bbda7 100755 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} +#undef ALOGD +#define ALOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00040001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - LOGD("Warning: No callback handler.\n"); + ALOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - LOGD("proc: %x prog: %x vers: %x\n", + ALOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // LOGD("***** loc_apicbprog_freeresult\n"); + // ALOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - LOGD("Trying to create RPC client...\n"); + ALOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - LOGD("Loc API callback initialized.\n"); + ALOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c index 8c171222..cb9350ed 100755 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} +#undef ALOGD +#define ALOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00010001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - LOGD("Warning: No callback handler.\n"); + ALOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - LOGD("proc: %x prog: %x vers: %x\n", + ALOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // LOGD("***** loc_apicbprog_freeresult\n"); + // ALOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - LOGD("Trying to create RPC client...\n"); + ALOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - LOGD("Loc API callback initialized.\n"); + ALOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h index a71b23a0..4124c2a1 100755 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -25,7 +25,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define PRINT(x...) do { \ fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stdout, ##x); \ - LOGD(x); \ + ALOGD(x); \ } while(0) #ifdef DEBUG diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 03286313..48c94f31 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -57,8 +57,8 @@ $Author: $ #include // comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} +// #undef ALOGD +// #define ALOGD(...) {} #define DEBUG_MOCK_NI 0 @@ -150,7 +150,7 @@ const GpsInterface* gps_get_hardware_interface () property_get("gps.disable", propBuf, ""); if (propBuf[0] == '1') { - LOGD("gps_get_interface returning NULL because gps.disable=1\n"); + ALOGD("gps_get_interface returning NULL because gps.disable=1\n"); return NULL; } @@ -240,7 +240,7 @@ static int loc_eng_init(GpsCallbacks* callbacks) loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", loc_eng_process_deferred_action, NULL); - LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + ALOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); return 0; } @@ -314,20 +314,20 @@ SIDE EFFECTS static int loc_eng_start() { int ret_val; - LOGD ("loc_eng_start\n"); + ALOGD ("loc_eng_start\n"); if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && loc_eng_data.agps_server_host[0] != 0 && loc_eng_data.agps_server_port != 0) { int result = set_agps_server(); - LOGD ("set_agps_server returned = %d\n", result); + ALOGD ("set_agps_server returned = %d\n", result); } ret_val = loc_start_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - LOGD ("loc_eng_start returned error = %d\n", ret_val); + ALOGD ("loc_eng_start returned error = %d\n", ret_val); } return 0; @@ -354,7 +354,7 @@ static int loc_eng_stop() { int ret_val; - LOGD ("loc_eng_stop\n"); + ALOGD ("loc_eng_stop\n"); pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); // work around problem with loc_eng_stop when AGPS requests are pending @@ -362,7 +362,7 @@ static int loc_eng_stop() if (loc_eng_data.agps_request_pending) { loc_eng_data.stop_request_pending = true; - LOGD ("deferring stop until AGPS data call is finished\n"); + ALOGD ("deferring stop until AGPS data call is finished\n"); pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); return 0; } @@ -371,7 +371,7 @@ static int loc_eng_stop() ret_val = loc_stop_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - LOGD ("loc_eng_stop returned error = %d\n", ret_val); + ALOGD ("loc_eng_stop returned error = %d\n", ret_val); } return 0; @@ -382,7 +382,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + ALOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", (int32) loc_eng_data.client_handle, lock_type); ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; @@ -396,7 +396,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) if (ret_val != TRUE) { - LOGD ("loc_eng_set_gps_lock mode failed\n"); + ALOGD ("loc_eng_set_gps_lock mode failed\n"); } return 0; @@ -425,7 +425,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence rpc_loc_fix_criteria_s_type *fix_criteria_ptr; boolean ret_val; - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + ALOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", (int32) loc_eng_data.client_handle, min_interval, mode); loc_eng_data.position_mode = mode; @@ -478,7 +478,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence if (ret_val != TRUE) { - LOGD ("loc_eng_set_position mode failed\n"); + ALOGD ("loc_eng_set_position mode failed\n"); } return 0; @@ -506,7 +506,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce rpc_loc_assist_data_time_s_type *time_info_ptr; boolean ret_val; - LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + ALOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; @@ -523,7 +523,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce if (ret_val != TRUE) { - LOGD ("loc_eng_inject_time failed\n"); + ALOGD ("loc_eng_inject_time failed\n"); } return 0; @@ -723,7 +723,7 @@ static int32 loc_event_cb( } else { - LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + ALOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); } return RPC_LOC_API_SUCCESS; @@ -1024,7 +1024,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) { - LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + ALOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); // Signal DeferredActionThread to send the APN name pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -1075,7 +1075,7 @@ static void loc_eng_agps_init(AGpsCallbacks* callbacks) static int loc_eng_agps_data_conn_open(const char* apn) { int apn_len; - LOGD("loc_eng_agps_data_conn_open: %s\n", apn); + ALOGD("loc_eng_agps_data_conn_open: %s\n", apn); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); @@ -1085,7 +1085,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) if (apn_len >= sizeof(loc_eng_data.apn_name)) { - LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + ALOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); apn_len = sizeof(loc_eng_data.apn_name) - 1; } @@ -1103,7 +1103,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) static int loc_eng_agps_data_conn_closed() { - LOGD("loc_eng_agps_data_conn_closed\n"); + ALOGD("loc_eng_agps_data_conn_closed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ loc_eng_data.acquire_wakelock_cb(); @@ -1115,7 +1115,7 @@ static int loc_eng_agps_data_conn_closed() static int loc_eng_agps_data_conn_failed() { - LOGD("loc_eng_agps_data_conn_failed\n"); + ALOGD("loc_eng_agps_data_conn_failed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ @@ -1163,7 +1163,7 @@ static int set_agps_server() server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); - LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); + ALOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); #else char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); @@ -1174,7 +1174,7 @@ static int set_agps_server() (loc_eng_data.agps_server_port & (0x0000ffff))); server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; - LOGD ("set_agps_server, addr = %s\n", buf); + ALOGD ("set_agps_server, addr = %s\n", buf); #endif ret_val = loc_eng_ioctl (loc_eng_data.client_handle, @@ -1185,7 +1185,7 @@ static int set_agps_server() if (ret_val != TRUE) { - LOGD ("set_agps_server failed\n"); + ALOGD ("set_agps_server failed\n"); return -1; } else @@ -1197,7 +1197,7 @@ static int set_agps_server() static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) { - LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + ALOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); if (type != AGPS_TYPE_SUPL) return -1; @@ -1246,7 +1246,7 @@ static void loc_eng_delete_aiding_data_deferred_action (void) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); + ALOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); } /*=========================================================================== @@ -1304,7 +1304,7 @@ static void loc_eng_process_atl_deferred_action (int flags) #endif // Delay this so that PDSM ATL module will behave properly sleep (1); - LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + ALOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); } else // data_connection_failed { @@ -1320,7 +1320,7 @@ static void loc_eng_process_atl_deferred_action (int flags) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); + ALOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); } /*=========================================================================== @@ -1368,7 +1368,7 @@ static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ) { - LOGD ("loc_event_cb: xtra download requst"); + ALOGD ("loc_event_cb: xtra download requst"); // Call Registered callback if (loc_eng_data.xtra_module_data.download_request_cb != NULL) @@ -1429,13 +1429,13 @@ static void loc_eng_process_deferred_action (void* arg) status.size = sizeof(status); status.type = AGPS_TYPE_SUPL; - LOGD("loc_eng_process_deferred_action started\n"); + ALOGD("loc_eng_process_deferred_action started\n"); // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); // disable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); + ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); while (1) @@ -1506,10 +1506,10 @@ static void loc_eng_process_deferred_action (void* arg) loc_eng_data.agps_request_pending = false; if (loc_eng_data.stop_request_pending) { - LOGD ("handling deferred stop\n"); + ALOGD ("handling deferred stop\n"); if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) { - LOGD ("loc_stop_fix failed!\n"); + ALOGD ("loc_stop_fix failed!\n"); } } pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); @@ -1521,10 +1521,10 @@ static void loc_eng_process_deferred_action (void* arg) } // reenable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); + ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); - LOGD("loc_eng_process_deferred_action thread exiting\n"); + ALOGD("loc_eng_process_deferred_action thread exiting\n"); loc_eng_data.release_wakelock_cb(); loc_eng_data.deferred_action_thread = 0; diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index 6ea17f7d..f59cc4eb 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -52,8 +52,8 @@ $Author: $ #include // comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} +// #undef ALOGD +// #define ALOGD(...) {} // Function declarations static boolean loc_eng_ioctl_setup_cb( @@ -164,7 +164,7 @@ static boolean loc_eng_ioctl_setup_cb( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (ioctl_cb_data_ptr->cb_is_selected == TRUE) { - LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + ALOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); ret_val = FALSE; } else @@ -222,7 +222,7 @@ boolean loc_eng_ioctl_wait_cb( do { if (ioctl_cb_data_ptr->cb_is_selected == FALSE) { - LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + ALOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); ret_val = FALSE; break; } @@ -240,7 +240,7 @@ boolean loc_eng_ioctl_wait_cb( // Special case where callback is issued before loc_ioctl ever returns if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) { - LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + ALOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); ret_val = TRUE; break; } @@ -321,13 +321,13 @@ boolean loc_eng_ioctl_process_cb ( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (client_handle != ioctl_cb_data_ptr->client_handle) { - LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + ALOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); ret_val = FALSE; } else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) { - LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + ALOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); ret_val = FALSE; } diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 958103a1..faad63b0 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -46,8 +46,8 @@ $Id: #include // comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} +// #undef ALOGD +// #define ALOGD(...) {} /*============================================================================= * @@ -119,7 +119,7 @@ static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, const rpc_loc_ni_event_s_type *request_pass_back ) { - LOGD("Sending NI response: %s\n", respond_from_enum(resp)); + ALOGD("Sending NI response: %s\n", respond_from_enum(resp)); rpc_loc_ioctl_data_u_type data; rpc_loc_ioctl_callback_s_type callback_payload; @@ -272,7 +272,7 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ } else { /* Print notification */ - LOGD("NI Notification: %s, event: %d", msg, ni_req->event); + ALOGD("NI Notification: %s, event: %d", msg, ni_req->event); pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); @@ -366,9 +366,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->client_name.string_len /* length */ ); - LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + ALOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); } else { - LOGD("SUPL NI: client_name not present."); + ALOGD("SUPL NI: client_name not present."); } // Requestor ID @@ -382,9 +382,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->requestor_id.string_len /* length */ ); - LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + ALOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); } else { - LOGD("SUPL NI: requestor_id not present."); + ALOGD("SUPL NI: requestor_id not present."); } // Encoding type @@ -440,7 +440,7 @@ RETURN VALUE ===========================================================================*/ int loc_ni_process_user_response(GpsUserResponseType userResponse) { - LOGD("NI response from UI: %d", userResponse); + ALOGD("NI response from UI: %d", userResponse); rpc_loc_ni_user_resp_e_type resp; switch (userResponse) @@ -563,7 +563,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_ni_init(GpsNiCallbacks *callbacks) { - LOGD("loc_eng_ni_init: entered."); + ALOGD("loc_eng_ni_init: entered."); if (!loc_eng_ni_data_init) { diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index 8ac8044c..1bef6caa 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -49,8 +49,8 @@ $Author: $ #include // comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} +// #undef ALOGD +// #define ALOGD(...) {} #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (400) From b72262b057060a7265d42058e2efb67b052c9cee Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 4 Jan 2012 20:07:13 +0000 Subject: [PATCH 028/945] Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: I3fc8b0f9a0da503ff9e79a166a08e13e0ce9730d --- loc_api/libloc_api/loc_eng_ni.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index faad63b0..01a7ba84 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -407,15 +407,15 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ } /* Log requestor ID and text for debugging */ - LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); - LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); - LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + ALOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + ALOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + ALOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); /* For robustness, always sets a timeout to clear up the notification status, even though * the OEM layer in java does not do so. **/ loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); - LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + ALOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); @@ -493,17 +493,17 @@ int loc_eng_ni_callback ( switch (ni_req->event) { case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - LOGI("VX Notification"); + ALOGI("VX Notification"); loc_ni_request_handler("VX Notify", ni_req); break; case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - LOGI("UMTS CP Notification\n"); + ALOGI("UMTS CP Notification\n"); loc_ni_request_handler("UMTS CP Notify", ni_req); break; case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - LOGI("SUPL Notification\n"); + ALOGI("SUPL Notification\n"); loc_ni_request_handler("SUPL Notify", ni_req); break; @@ -522,7 +522,7 @@ FUNCTION loc_ni_thread_proc ===========================================================================*/ static void loc_ni_thread_proc(void *unused) { - LOGI("Starting Loc NI thread...\n"); + ALOGI("Starting Loc NI thread...\n"); while (1) { @@ -600,7 +600,7 @@ void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) { if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) { - LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + ALOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); loc_ni_process_user_response(user_response); } else { LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", From 2ce310228874d0f077967c96455c5a0607af66dd Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 5 Jan 2012 23:27:52 +0000 Subject: [PATCH 029/945] Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: Ia13cca6426a15037e01069954308e95f31c17336 --- loc_api/libloc_api/loc_eng_ni.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 01a7ba84..003d63af 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -267,7 +267,7 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ loc_ni_respond(response, ni_req); */ #endif - LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + ALOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", ni_req->event); } else { From 8b3fe9b3cff6b59b2f4977dcce9b3c1ae47c2e25 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Sun, 8 Jan 2012 10:17:54 +0000 Subject: [PATCH 030/945] Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I9d2c4a1a9b0edda94f2eeacc1f4d270bf4d66804 --- loc_api/libloc_api-rpc/inc/debug.h | 4 ++-- loc_api/libloc_api/loc_eng_ni.cpp | 6 +++--- loc_api/libloc_api/loc_eng_xtra.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h index 4124c2a1..bef0ad39 100755 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -43,14 +43,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define E(x...) do { \ fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stderr, ##x); \ - LOGE(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); \ - LOGE(##msg); \ + ALOGE(##msg); \ } \ } while(0) diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 003d63af..c7636831 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -402,7 +402,7 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ break; default: - LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + ALOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); return; } @@ -508,7 +508,7 @@ int loc_eng_ni_callback ( break; default: - LOGE("Unknown NI event: %x\n", (int) ni_req->event); + ALOGE("Unknown NI event: %x\n", (int) ni_req->event); break; } } @@ -603,7 +603,7 @@ void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) ALOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); loc_ni_process_user_response(user_response); } else { - LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + ALOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", notif_id, user_response); } } diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index 1bef6caa..c713c270 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -159,7 +159,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) if (rpc_ret_val != RPC_LOC_API_SUCCESS) { - LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + ALOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); ret_val = EINVAL; // return error break; } From 7573253c2637e026e0943620d62ec335e5a9dc10 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Thu, 1 Mar 2012 17:07:59 -0800 Subject: [PATCH 031/945] remove HAL_MODULE_INFO_SYM const HAL_MODULE_INFO_SYM was declared as read-only, but the struct is written to by libhardware. This causes a segfault when -Wl,-z,relro is enabled. Fixed. Change-Id: Ied24f54a294ea705b06754a419823d595e3def62 --- loc_api/libloc_api/gps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c index ec6fbd0b..a28a608e 100644 --- a/loc_api/libloc_api/gps.c +++ b/loc_api/libloc_api/gps.c @@ -55,7 +55,7 @@ static struct hw_module_methods_t gps_module_methods = { .open = open_gps }; -const struct hw_module_t HAL_MODULE_INFO_SYM = { +struct hw_module_t HAL_MODULE_INFO_SYM = { .tag = HARDWARE_MODULE_TAG, .version_major = 1, .version_minor = 0, From f77c85bb51137f5ba854184e5e9194197027438a Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Mon, 9 Jul 2012 15:27:30 -0700 Subject: [PATCH 032/945] gps: Initial implementation of msm gps hal Change-Id: Icf126a0bbb9dec414144b9b405694e41777920d5 --- CleanSpec.mk | 0 etc/Android.mk | 11 + etc/gps.conf | 91 + loc_api/Android.mk | 26 +- loc_api/NOTICE | 0 loc_api/libloc_api-rpc-50001/Android.mk | 3 + .../libloc_api-rpc-glue/Android.mk | 59 + .../rpc_inc/LocApiRpcAdapter.h | 102 + .../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 + .../src/LocApiRpcAdapter.cpp | 1225 ++++ .../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 | 621 ++ .../src/loc_api_sync_call.c | 510 ++ .../src/loc_apicb_appinit.c | 86 + .../libloc_api-rpc-stub/Android.mk | 35 + .../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 +++ loc_api/libloc_api-rpc/Android.mk | 11 +- loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 9 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 0 .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 0 .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 0 .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 0 .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 0 .../gen-1240/loc_api_common.xdr | 0 .../gen-1240/loc_api_common_xdr.c | 0 .../gen-1240/loc_api_rpc_glue.c | 18 +- loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 0 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 9 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 0 .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 0 .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 0 .../gen-3200/loc_api_common_xdr.c | 0 .../gen-3200/loc_api_rpc_glue.c | 18 +- loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 0 loc_api/libloc_api-rpc/inc-1240/loc_api.h | 0 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 0 .../libloc_api-rpc/inc-1240/loc_api_common.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 0 .../libloc_api-rpc/inc-3200/loc_api_common.h | 0 loc_api/libloc_api-rpc/inc/debug.h | 6 +- loc_api/libloc_api/Android.mk | 14 +- loc_api/libloc_api/gps.c | 56 +- loc_api/libloc_api/loc_eng.cpp | 154 +- loc_api/libloc_api/loc_eng.h | 60 +- loc_api/libloc_api/loc_eng_ioctl.cpp | 84 +- loc_api/libloc_api/loc_eng_ioctl.h | 62 +- loc_api/libloc_api/loc_eng_ni.cpp | 102 +- loc_api/libloc_api/loc_eng_ni.h | 55 +- loc_api/libloc_api/loc_eng_xtra.cpp | 73 +- loc_api/libloc_api/loc_eng_xtra.h | 60 +- loc_api/libloc_api_50001/Android.mk | 131 + loc_api/libloc_api_50001/LocApiAdapter.cpp | 196 + loc_api/libloc_api_50001/LocApiAdapter.h | 205 + loc_api/libloc_api_50001/gps.c | 68 + loc_api/libloc_api_50001/loc.cpp | 870 +++ loc_api/libloc_api_50001/loc.h | 86 + loc_api/libloc_api_50001/loc_eng.cpp | 1838 +++++ loc_api/libloc_api_50001/loc_eng.h | 204 + loc_api/libloc_api_50001/loc_eng_agps.cpp | 702 ++ loc_api/libloc_api_50001/loc_eng_agps.h | 274 + loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 180 + loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 53 + .../loc_eng_dmn_conn_glue_msg.c | 223 + .../loc_eng_dmn_conn_glue_msg.h | 51 + .../loc_eng_dmn_conn_glue_pipe.c | 206 + .../loc_eng_dmn_conn_glue_pipe.h | 50 + .../loc_eng_dmn_conn_handler.cpp | 78 + .../loc_eng_dmn_conn_handler.h | 82 + .../loc_eng_dmn_conn_thread_helper.c | 398 ++ .../loc_eng_dmn_conn_thread_helper.h | 74 + loc_api/libloc_api_50001/loc_eng_log.cpp | 292 + loc_api/libloc_api_50001/loc_eng_log.h | 62 + loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 + loc_api/libloc_api_50001/loc_eng_msg.h | 584 ++ loc_api/libloc_api_50001/loc_eng_msg_id.h | 90 + loc_api/libloc_api_50001/loc_eng_ni.cpp | 313 + loc_api/libloc_api_50001/loc_eng_ni.h | 50 + loc_api/libloc_api_50001/loc_eng_xtra.cpp | 90 + loc_api/libloc_api_50001/loc_eng_xtra.h | 46 + loc_api/loc_api_v02/Android.mk | 43 + loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2056 ++++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 197 + loc_api/loc_api_v02/loc_api_sync_req.c | 548 ++ loc_api/loc_api_v02/loc_api_sync_req.h | 68 + loc_api/loc_api_v02/loc_api_v02_client.c | 1867 ++++++ loc_api/loc_api_v02/loc_api_v02_client.h | 1255 ++++ loc_api/loc_api_v02/loc_api_v02_log.c | 243 + loc_api/loc_api_v02/loc_api_v02_log.h | 50 + loc_api/loc_api_v02/loc_util_log.h | 81 + loc_api/loc_api_v02/location_service_v02.c | 2223 +++++++ loc_api/loc_api_v02/location_service_v02.h | 5914 +++++++++++++++++ loc_api/ulp/inc/ulp.h | 76 + utils/Android.mk | 45 + utils/linked_list.c | 328 + utils/linked_list.h | 217 + utils/loc_cfg.cpp | 272 + utils/loc_cfg.h | 98 + utils/loc_log.cpp | 183 + utils/loc_log.h | 66 + utils/log_util.h | 151 + utils/msg_q.c | 322 + utils/msg_q.h | 189 + 121 files changed, 34065 insertions(+), 422 deletions(-) mode change 100644 => 100755 CleanSpec.mk create mode 100755 etc/Android.mk create mode 100755 etc/gps.conf mode change 100644 => 100755 loc_api/NOTICE create mode 100755 loc_api/libloc_api-rpc-50001/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-1240/loc_api.h mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-3200/loc_api.h mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h mode change 100644 => 100755 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h mode change 100644 => 100755 loc_api/libloc_api/gps.c create mode 100755 loc_api/libloc_api_50001/Android.mk create mode 100755 loc_api/libloc_api_50001/LocApiAdapter.cpp create mode 100755 loc_api/libloc_api_50001/LocApiAdapter.h create mode 100755 loc_api/libloc_api_50001/gps.c create mode 100755 loc_api/libloc_api_50001/loc.cpp create mode 100755 loc_api/libloc_api_50001/loc.h create mode 100755 loc_api/libloc_api_50001/loc_eng.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng.h create mode 100755 loc_api/libloc_api_50001/loc_eng_agps.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_agps.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h create mode 100755 loc_api/libloc_api_50001/loc_eng_log.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_log.h create mode 100755 loc_api/libloc_api_50001/loc_eng_msg.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_msg.h create mode 100755 loc_api/libloc_api_50001/loc_eng_msg_id.h create mode 100755 loc_api/libloc_api_50001/loc_eng_ni.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_ni.h create mode 100755 loc_api/libloc_api_50001/loc_eng_xtra.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_xtra.h create mode 100755 loc_api/loc_api_v02/Android.mk create mode 100755 loc_api/loc_api_v02/LocApiV02Adapter.cpp create mode 100755 loc_api/loc_api_v02/LocApiV02Adapter.h create mode 100755 loc_api/loc_api_v02/loc_api_sync_req.c create mode 100755 loc_api/loc_api_v02/loc_api_sync_req.h create mode 100755 loc_api/loc_api_v02/loc_api_v02_client.c create mode 100755 loc_api/loc_api_v02/loc_api_v02_client.h create mode 100755 loc_api/loc_api_v02/loc_api_v02_log.c create mode 100755 loc_api/loc_api_v02/loc_api_v02_log.h create mode 100755 loc_api/loc_api_v02/loc_util_log.h create mode 100755 loc_api/loc_api_v02/location_service_v02.c create mode 100755 loc_api/loc_api_v02/location_service_v02.h create mode 100755 loc_api/ulp/inc/ulp.h create mode 100755 utils/Android.mk create mode 100755 utils/linked_list.c create mode 100755 utils/linked_list.h create mode 100755 utils/loc_cfg.cpp create mode 100755 utils/loc_cfg.h create mode 100755 utils/loc_log.cpp create mode 100755 utils/loc_log.h create mode 100755 utils/log_util.h create mode 100755 utils/msg_q.c create mode 100755 utils/msg_q.h diff --git a/CleanSpec.mk b/CleanSpec.mk old mode 100644 new mode 100755 diff --git a/etc/Android.mk b/etc/Android.mk new file mode 100755 index 00000000..26a39dbd --- /dev/null +++ b/etc/Android.mk @@ -0,0 +1,11 @@ + +#LOCAL_PATH := $(call my-dir) +#include $(CLEAR_VARS) + +#LOCAL_MODULE := gps.conf +#LOCAL_MODULE_TAGS := optional +#LOCAL_MODULE_CLASS := ETC +#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ +#LOCAL_SRC_FILES := gps.conf +#include $(BUILD_PREBUILT) + diff --git a/etc/gps.conf b/etc/gps.conf new file mode 100755 index 00000000..cd3dadaf --- /dev/null +++ b/etc/gps.conf @@ -0,0 +1,91 @@ +#Test +NTP_SERVER=time.gpsonextra.net +#Asia +# NTP_SERVER=asia.pool.ntp.org +#Europe +# NTP_SERVER=europe.pool.ntp.org +#North America +# NTP_SERVER=north-america.pool.ntp.org + +XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin + +# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info +# 4 - Debug, 5 - Verbose +DEBUG_LEVEL = 3 + +# Intermediate position report, 1=enable, 0=disable +INTERMEDIATE_POS=0 + +# supl version 1.0 +SUPL_VER=0x10000 + +# Error Estimate +# _SET = 1 +# _CLEAR = 0 +ERR_ESTIMATE=0 + +# GPS Capabilities bit mask +# SCHEDULING = 1 +# MSB = 2 +# MSA = 4 +# ULP = 0x20 +# default = MSA | MSB | SCHEDULING | ULP +CAPABILITIES=0x27 + +# 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 + +################################ +# Sensor Settings +################################ + +# Needs to be set explicitly based on sensor +# There is no default value. +#GYRO_BIAS_RANDOM_WALK= + +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 Control Mode (0=AUTO, 1=FORCE_ON) +SENSOR_CONTROL_MODE=0 + +# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) +SENSOR_USAGE=0 + +# Choose GSIFF sensor provider (1=DSPS, 2=Android NDK) +SENSOR_PROVIDER=1 + +################################ +# Indoor Positioning Settings +################################ +# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only +QUIPC_ENABLED = 0 + +################################ +# EXTRA SETTINGS +################################ +# Enable or Disable Wiper (1=Enable, 0=Disable) +ENABLE_WIPER=1 + +#################################### +# LTE Positioning Profile Settings +#################################### +# 0: Enable RRLP on LTE(Default) 1: Enable LPP_User_Plane on LTE +LPP_PROFILE = 0 \ No newline at end of file diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 52942bfe..7e09d5f9 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -7,5 +7,27 @@ # 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -include $(call all-subdir-makefiles) -endif + +LOCAL_PATH := $(call my-dir) + +GPS_DIR_LIST := + +# add RPC dirs if RPC is available +ifneq ($(TARGET_NO_RPC),true) + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ + +else + +GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ + +endif #TARGET_NO_RPC + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ + +#call the subfolders +include $(addsuffix Android.mk, $(GPS_DIR_LIST)) + +endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/loc_api/NOTICE b/loc_api/NOTICE old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk new file mode 100755 index 00000000..6c5d5339 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/Android.mk @@ -0,0 +1,3 @@ +ifeq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) +include $(call all-subdir-makefiles) +endif diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk new file mode 100755 index 00000000..1287c69e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -0,0 +1,59 @@ +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/LocApiRpcAdapter.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_adapter + +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)/loc_api/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/librpc \ + $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + 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 + +LOCAL_MODULE:= libloc_api-rpc-qc + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h new file mode 100755 index 00000000..7b1f59ba --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -0,0 +1,102 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ADAPTER_H +#define LOC_API_RPC_ADAPTER_H + +#include +#include +#include + + +class LocApiRpcAdapter : public LocApiAdapter { + // RPC communication establishment + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type eMask; + + static const rpc_loc_event_mask_type locBits[]; + static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + static enum loc_api_adapter_err convertErr(int rpcErr); + + 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); + int NIEventFillVerfiyType(GpsNiNotification ¬if, + rpc_loc_ni_notify_verify_e_type notif_priv); + GpsNiEncodingType convertNiEncodingType(int loc_encoding); + +public: + LocApiRpcAdapter(LocEng &locEng); + ~LocApiRpcAdapter(); + + 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 + reinit(); + virtual enum loc_api_adapter_err + startFix(); + virtual enum loc_api_adapter_err + stopFix(); + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + virtual enum loc_api_adapter_err + enableData(int enable); + 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); + virtual enum loc_api_adapter_err + setAPN(char* apn, int len); + 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 + 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); +}; + +#endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h new file mode 100755 index 00000000..8b20a3f5 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h new file mode 100755 index 00000000..9bfe5f0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h @@ -0,0 +1,226 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h new file mode 100755 index 00000000..c0bcda16 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h @@ -0,0 +1,59 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h new file mode 100755 index 00000000..16552a0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -0,0 +1,123 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "rpc_inc/loc_api_fixup.h" +#include "rpc_inc/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h new file mode 100755 index 00000000..266f8ec8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h new file mode 100755 index 00000000..8dbcb9ac --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp new file mode 100755 index 00000000..48b3a0fe --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -0,0 +1,1225 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include +#include +#include "LocApiRpcAdapter.h" +#include "loc_api_rpcgen_common_rpc.h" +#include "log_util.h" +#include "loc_log.h" +#include "loc_api_log.h" + +#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 = ((LocApiRpcAdapter*)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)); + ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, event); + EXIT_LOG(%p, VOID_RET); +} + + +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return new LocApiRpcAdapter(locEng); +} + +const rpc_loc_event_mask_type LocApiRpcAdapter::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 +}; + +LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : + LocApiAdapter(locEng), + client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), + eMask(convertMask(locEng.eventMask)) +{ + loc_api_glue_init(); +} + +LocApiRpcAdapter::~LocApiRpcAdapter() +{ + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + loc_close(client_handle); +} + +rpc_loc_event_mask_type +LocApiRpcAdapter::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; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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) +{ + locEngHandle.acquireWakelock(); + + // 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); + } + + locEngHandle.releaseWakeLock(); + 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 +LocApiRpcAdapter::reinit() +{ + enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); + + if (client_handle < 0) { + ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + return ret_val; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::startFix() { + LOC_LOGD("LocApiRpcAdapter::startFix() called"); + return convertErr( + loc_start_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::stopFix() { + LOC_LOGD("LocApiRpcAdapter::stopFix() called"); + return convertErr( + loc_stop_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::setPositionMode(LocPositionMode mode, + GpsPositionRecurrence recurrence, uint32_t min_interval, + uint32_t preferred_accuracy, uint32_t preferred_time) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + rpc_loc_operation_mode_e_type op_mode; + int ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) client_handle, min_interval, mode); + + switch (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: + 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 = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; + 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 = min_interval; + fix_criteria_ptr->preferred_operation_mode = op_mode; + + if (min_interval > 0) { + fix_criteria_ptr->min_interval = min_interval; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + }else if(min_interval == 0) + { + /*If the framework passes in 0 transalate it into the maximum frequency we can report positions + which is 1 Hz or once very second */ + fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + } + if (preferred_accuracy > 0) { + fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; + } + if (preferred_time > 0) { + fix_criteria_ptr->preferred_response_time = preferred_time; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; + } + + switch (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 +LocApiRpcAdapter::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)(android::elapsedRealtime() - 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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 + LocApiRpcAdapter::setAPN(char* apn, int len) +{ + 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, len+1); + + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::enableData(int enable) +{ + 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; + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_DATA_ENABLE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location = {0}; + + location.size = sizeof(location); + 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.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + // Altitude + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + // Speed + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + // Heading + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + LOC_LOGV("reportPosition: fire callback\n"); + LocApiAdapter::reportPosition(location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + 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 LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus = {0}; + 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(GpsSvStatus); + 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.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) + { + 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 (SvStatus.num_svs >= 0) + { + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) +{ + GpsStatusValue status = GPS_STATUS_NONE; + + 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) + { + status = GPS_STATUS_ENGINE_ON; + } + else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) + { + status = GPS_STATUS_ENGINE_OFF; + } + } else if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE) { + if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_BEGIN) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_END) + { + status = GPS_STATUS_SESSION_END; + } + } + + LocApiAdapter::reportStatus(status); +} + +void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + +#if (AMSS_VERSION==3200) + LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); +#else + LocApiAdapter::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 +LocApiRpcAdapter::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); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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 = LocApiAdapter::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)); + LocApiAdapter::requestNiNotify(notif, (const void*)copy); +} + +int LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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; + } +} diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c new file mode 100755 index 00000000..32e3cda8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c @@ -0,0 +1,52 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c new file mode 100755 index 00000000..6aa5254f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -0,0 +1,344 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c new file mode 100755 index 00000000..10b2d221 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -0,0 +1,621 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/* Logging Improvement */ +#include "log_util.h" + +/* Uncomment to force LOGD messages */ +// #define LOGD LOGI + +/*===================================================================== + 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 +) +{ + 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; + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == event_callback || + loc_glue_callback_table[i].user == userData) + { + LOC_LOGW("Client already opened service (callback=%p)...\n", + event_callback); + break; + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == NULL) + { + 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; + break; + } + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + LOC_LOGE("Too many clients opened at once...\n"); + return RPC_LOC_CLIENT_HANDLE_INVALID; + } + + 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"); + stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); + 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; + + ret_val = (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; + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c new file mode 100755 index 00000000..e2a5786f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -0,0 +1,510 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/*************************************************************************** + * 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; + + LOGV("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; + + LOGV("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) + { + LOGV("trylock EBUSY : %d", i); + continue; + } + + if (!slot->in_use && !slot->not_available) + { + select_id = i; + slot->in_use = 1; + slot->signal_sent = 0; + /* Return from here and leave the mutex locked. + * will unlock it in loc_unlock_slot() + */ + break; + } + /* LOGV("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 + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_unlock_slot(int select_id) +{ + loc_sync_data.slots[select_id].in_use = 0; + + pthread_mutex_unlock(&loc_sync_data.slots[select_id].lock); +} + +/*=========================================================================== + +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; /* 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 */ + LOGE("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) + { + LOGE("slot not available ioctl_type = %s", + loc_get_ioctl_type_name(ioctl_type)); + return rc; + } + + // Select the callback we are waiting for + loc_api_save_callback(select_id, handle, 0, ioctl_type); + + rc = loc_ioctl(handle, ioctl_type, ioctl_data_ptr); + + if (rc != RPC_LOC_API_SUCCESS) + { + LOGE("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 { + LOGV("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 + LOGE("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; + LOGE("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 { + LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", + select_id, ioctl_type, rc); + } + } /* wait callback */ + } /* loc_ioctl */ + + loc_unlock_slot(select_id); + + return rc; +} + + diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c new file mode 100755 index 00000000..b257fb81 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk new file mode 100755 index 00000000..abd15c8f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk @@ -0,0 +1,35 @@ +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_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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h new file mode 100755 index 00000000..47478e80 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h @@ -0,0 +1,156 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h new file mode 100755 index 00000000..507103ce --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h @@ -0,0 +1,1261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h new file mode 100755 index 00000000..f11bb654 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h @@ -0,0 +1,288 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h new file mode 100755 index 00000000..e109852c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c new file mode 100755 index 00000000..b0443487 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c @@ -0,0 +1,327 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c new file mode 100755 index 00000000..7f519281 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c @@ -0,0 +1,60 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c new file mode 100755 index 00000000..d2152ab4 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c @@ -0,0 +1,155 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c new file mode 100755 index 00000000..da066b42 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c @@ -0,0 +1,1775 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c new file mode 100755 index 00000000..e8a2aa78 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c @@ -0,0 +1,199 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c new file mode 100755 index 00000000..b4aeb5e7 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr new file mode 100755 index 00000000..3d6c759e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr @@ -0,0 +1,261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr new file mode 100755 index 00000000..36d0e6d2 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr @@ -0,0 +1,187 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr new file mode 100755 index 00000000..fcdaf57f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr @@ -0,0 +1,1021 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk index a0fec50f..f70cba50 100755 --- a/loc_api/libloc_api-rpc/Android.mk +++ b/loc_api/libloc_api-rpc/Android.mk @@ -1,13 +1,7 @@ -#Copyright (c) 2009, QUALCOMM USA, INC. -#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ifneq ($(BUILD_TINY_ANDROID),true) +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) + LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) @@ -63,3 +57,4 @@ LOCAL_MODULE:= libloc_api-rpc include $(BUILD_STATIC_LIBRARY) endif +endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr index 60f730c2..5d9cf6c8 100755 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr @@ -1,12 +1,3 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - CLIENTS:= loc_api SERVERS:= loc_api_cb COMMON:= loc_api_common diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c index 571bbda7..fbaca8b6 100755 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef ALOGD -#define ALOGD(...) {} +#undef LOGD +#define LOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00040001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - ALOGD("Warning: No callback handler.\n"); + LOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - ALOGD("proc: %x prog: %x vers: %x\n", + LOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // ALOGD("***** loc_apicbprog_freeresult\n"); + // LOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - ALOGD("Trying to create RPC client...\n"); + LOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - ALOGD("Loc API callback initialized.\n"); + LOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr index 60f730c2..5d9cf6c8 100755 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr @@ -1,12 +1,3 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - CLIENTS:= loc_api SERVERS:= loc_api_cb COMMON:= loc_api_common diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c index cb9350ed..8c171222 100755 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef ALOGD -#define ALOGD(...) {} +#undef LOGD +#define LOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00010001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - ALOGD("Warning: No callback handler.\n"); + LOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - ALOGD("proc: %x prog: %x vers: %x\n", + LOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // ALOGD("***** loc_apicbprog_freeresult\n"); + // LOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - ALOGD("Trying to create RPC client...\n"); + LOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - ALOGD("Loc API callback initialized.\n"); + LOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h old mode 100644 new mode 100755 diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h index bef0ad39..a71b23a0 100755 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -25,7 +25,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define PRINT(x...) do { \ fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stdout, ##x); \ - ALOGD(x); \ + LOGD(x); \ } while(0) #ifdef DEBUG @@ -43,14 +43,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define E(x...) do { \ fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stderr, ##x); \ - ALOGE(x); \ + LOGE(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); \ + LOGE(##msg); \ } \ } while(0) diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index 1fd409f5..f20280ee 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -1,16 +1,12 @@ -#Copyright (c) 2009, QUALCOMM USA, INC. -#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - +#Compile the old library version from Google push for Passion builds with old modem image +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_TAGS := optional + LOCAL_STATIC_LIBRARIES:= \ libloc_api-rpc @@ -40,4 +36,4 @@ LOCAL_C_INCLUDES:= \ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw include $(BUILD_SHARED_LIBRARY) - +endif #BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION = 50001 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c old mode 100644 new mode 100755 index a28a608e..5f6d8095 --- a/loc_api/libloc_api/gps.c +++ b/loc_api/libloc_api/gps.c @@ -1,29 +1,31 @@ -/****************************************************************************** - @file: gps.c - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 @@ -55,7 +57,7 @@ static struct hw_module_methods_t gps_module_methods = { .open = open_gps }; -struct hw_module_t HAL_MODULE_INFO_SYM = { +const struct hw_module_t HAL_MODULE_INFO_SYM = { .tag = HARDWARE_MODULE_TAG, .version_major = 1, .version_minor = 0, diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 48c94f31..68ac002c 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.cpp - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 @@ -57,8 +53,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} #define DEBUG_MOCK_NI 0 @@ -150,7 +146,7 @@ const GpsInterface* gps_get_hardware_interface () property_get("gps.disable", propBuf, ""); if (propBuf[0] == '1') { - ALOGD("gps_get_interface returning NULL because gps.disable=1\n"); + LOGD("gps_get_interface returning NULL because gps.disable=1\n"); return NULL; } @@ -240,7 +236,7 @@ static int loc_eng_init(GpsCallbacks* callbacks) loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", loc_eng_process_deferred_action, NULL); - ALOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); return 0; } @@ -314,20 +310,20 @@ SIDE EFFECTS static int loc_eng_start() { int ret_val; - ALOGD ("loc_eng_start\n"); + LOGD ("loc_eng_start\n"); if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && loc_eng_data.agps_server_host[0] != 0 && loc_eng_data.agps_server_port != 0) { int result = set_agps_server(); - ALOGD ("set_agps_server returned = %d\n", result); + LOGD ("set_agps_server returned = %d\n", result); } ret_val = loc_start_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_eng_start returned error = %d\n", ret_val); + LOGD ("loc_eng_start returned error = %d\n", ret_val); } return 0; @@ -354,7 +350,7 @@ static int loc_eng_stop() { int ret_val; - ALOGD ("loc_eng_stop\n"); + LOGD ("loc_eng_stop\n"); pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); // work around problem with loc_eng_stop when AGPS requests are pending @@ -362,7 +358,7 @@ static int loc_eng_stop() if (loc_eng_data.agps_request_pending) { loc_eng_data.stop_request_pending = true; - ALOGD ("deferring stop until AGPS data call is finished\n"); + LOGD ("deferring stop until AGPS data call is finished\n"); pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); return 0; } @@ -371,7 +367,7 @@ static int loc_eng_stop() ret_val = loc_stop_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_eng_stop returned error = %d\n", ret_val); + LOGD ("loc_eng_stop returned error = %d\n", ret_val); } return 0; @@ -382,7 +378,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - ALOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", (int32) loc_eng_data.client_handle, lock_type); ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; @@ -396,7 +392,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) if (ret_val != TRUE) { - ALOGD ("loc_eng_set_gps_lock mode failed\n"); + LOGD ("loc_eng_set_gps_lock mode failed\n"); } return 0; @@ -425,7 +421,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence rpc_loc_fix_criteria_s_type *fix_criteria_ptr; boolean ret_val; - ALOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", (int32) loc_eng_data.client_handle, min_interval, mode); loc_eng_data.position_mode = mode; @@ -478,7 +474,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence if (ret_val != TRUE) { - ALOGD ("loc_eng_set_position mode failed\n"); + LOGD ("loc_eng_set_position mode failed\n"); } return 0; @@ -506,7 +502,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce rpc_loc_assist_data_time_s_type *time_info_ptr; boolean ret_val; - ALOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; @@ -523,7 +519,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce if (ret_val != TRUE) { - ALOGD ("loc_eng_inject_time failed\n"); + LOGD ("loc_eng_inject_time failed\n"); } return 0; @@ -708,7 +704,7 @@ static int32 loc_event_cb( const rpc_loc_event_payload_u_type* loc_event_payload ) { - ALOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); if (client_handle == loc_eng_data.client_handle) { pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -723,7 +719,7 @@ static int32 loc_event_cb( } else { - ALOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); } return RPC_LOC_API_SUCCESS; @@ -749,7 +745,7 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat { GpsLocation location; - ALOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); memset (&location, 0, sizeof(location)); @@ -800,18 +796,18 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat if (loc_eng_data.location_cb != NULL) { - ALOGV ("loc_eng_report_position: fire callback\n"); + LOGV ("loc_eng_report_position: fire callback\n"); loc_eng_data.location_cb (&location); } } else { - ALOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); } } else { - ALOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); } } @@ -837,7 +833,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) int num_svs_max, i; const rpc_loc_sv_info_s_type *sv_info_ptr; - ALOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", (uint32) gnss_report_ptr->valid_mask, gnss_report_ptr->sv_count); @@ -923,7 +919,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) } } - ALOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) { loc_eng_data.sv_status_cb(&SvStatus); @@ -950,7 +946,7 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { GpsStatus status; - ALOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); memset (&status, 0, sizeof(status)); status.size = sizeof(status); @@ -1024,7 +1020,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) { - ALOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); // Signal DeferredActionThread to send the APN name pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -1068,14 +1064,14 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_agps_init(AGpsCallbacks* callbacks) { - ALOGV("loc_eng_agps_init\n"); + LOGV("loc_eng_agps_init\n"); loc_eng_data.agps_status_cb = callbacks->status_cb; } static int loc_eng_agps_data_conn_open(const char* apn) { int apn_len; - ALOGD("loc_eng_agps_data_conn_open: %s\n", apn); + LOGD("loc_eng_agps_data_conn_open: %s\n", apn); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); @@ -1085,7 +1081,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) if (apn_len >= sizeof(loc_eng_data.apn_name)) { - ALOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); apn_len = sizeof(loc_eng_data.apn_name) - 1; } @@ -1103,7 +1099,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) static int loc_eng_agps_data_conn_closed() { - ALOGD("loc_eng_agps_data_conn_closed\n"); + LOGD("loc_eng_agps_data_conn_closed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ loc_eng_data.acquire_wakelock_cb(); @@ -1115,7 +1111,7 @@ static int loc_eng_agps_data_conn_closed() static int loc_eng_agps_data_conn_failed() { - ALOGD("loc_eng_agps_data_conn_failed\n"); + LOGD("loc_eng_agps_data_conn_failed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ @@ -1163,7 +1159,7 @@ static int set_agps_server() server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); - ALOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); + LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); #else char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); @@ -1174,7 +1170,7 @@ static int set_agps_server() (loc_eng_data.agps_server_port & (0x0000ffff))); server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; - ALOGD ("set_agps_server, addr = %s\n", buf); + LOGD ("set_agps_server, addr = %s\n", buf); #endif ret_val = loc_eng_ioctl (loc_eng_data.client_handle, @@ -1185,19 +1181,19 @@ static int set_agps_server() if (ret_val != TRUE) { - ALOGD ("set_agps_server failed\n"); + LOGD ("set_agps_server failed\n"); return -1; } else { - ALOGV ("set_agps_server successful\n"); + LOGV ("set_agps_server successful\n"); return 0; } } static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) { - ALOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); if (type != AGPS_TYPE_SUPL) return -1; @@ -1246,7 +1242,7 @@ static void loc_eng_delete_aiding_data_deferred_action (void) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - ALOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); + LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); } /*=========================================================================== @@ -1274,7 +1270,7 @@ static void loc_eng_process_atl_deferred_action (int flags) boolean ret_val; int agps_status = -1; - ALOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); @@ -1304,7 +1300,7 @@ static void loc_eng_process_atl_deferred_action (int flags) #endif // Delay this so that PDSM ATL module will behave properly sleep (1); - ALOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); } else // data_connection_failed { @@ -1320,7 +1316,7 @@ static void loc_eng_process_atl_deferred_action (int flags) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - ALOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); + LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); } /*=========================================================================== @@ -1368,7 +1364,7 @@ static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ) { - ALOGD ("loc_event_cb: xtra download requst"); + LOGD ("loc_event_cb: xtra download requst"); // Call Registered callback if (loc_eng_data.xtra_module_data.download_request_cb != NULL) @@ -1429,13 +1425,13 @@ static void loc_eng_process_deferred_action (void* arg) status.size = sizeof(status); status.type = AGPS_TYPE_SUPL; - ALOGD("loc_eng_process_deferred_action started\n"); + LOGD("loc_eng_process_deferred_action started\n"); // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); // disable the GPS lock - ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); while (1) @@ -1506,10 +1502,10 @@ static void loc_eng_process_deferred_action (void* arg) loc_eng_data.agps_request_pending = false; if (loc_eng_data.stop_request_pending) { - ALOGD ("handling deferred stop\n"); + LOGD ("handling deferred stop\n"); if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_stop_fix failed!\n"); + LOGD ("loc_stop_fix failed!\n"); } } pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); @@ -1521,10 +1517,10 @@ static void loc_eng_process_deferred_action (void* arg) } // reenable the GPS lock - ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); - ALOGD("loc_eng_process_deferred_action thread exiting\n"); + LOGD("loc_eng_process_deferred_action thread exiting\n"); loc_eng_data.release_wakelock_cb(); loc_eng_data.deferred_action_thread = 0; diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 39f3d91b..553a97e0 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.h - @brief: - - DESCRIPTION - This file defines the global data structure used by this module. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index f59cc4eb..a43d8cca 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -1,36 +1,32 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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. + * + */ -/****************************************************************************** - @file: loc_eng.cpp - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ #define LOG_NDDEBUG 0 #include @@ -52,8 +48,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} // Function declarations static boolean loc_eng_ioctl_setup_cb( @@ -97,7 +93,7 @@ boolean loc_eng_ioctl( int rpc_ret_val; loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - ALOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); // Select the callback we are waiting for @@ -109,7 +105,7 @@ boolean loc_eng_ioctl( ioctl_type, ioctl_data_ptr); - ALOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); if (rpc_ret_val == RPC_LOC_API_SUCCESS) { @@ -164,7 +160,7 @@ static boolean loc_eng_ioctl_setup_cb( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (ioctl_cb_data_ptr->cb_is_selected == TRUE) { - ALOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); ret_val = FALSE; } else @@ -222,7 +218,7 @@ boolean loc_eng_ioctl_wait_cb( do { if (ioctl_cb_data_ptr->cb_is_selected == FALSE) { - ALOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); ret_val = FALSE; break; } @@ -240,7 +236,7 @@ boolean loc_eng_ioctl_wait_cb( // Special case where callback is issued before loc_ioctl ever returns if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) { - ALOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); ret_val = TRUE; break; } @@ -260,7 +256,7 @@ boolean loc_eng_ioctl_wait_cb( ret_val = FALSE; } - ALOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); } while (0); @@ -286,7 +282,7 @@ boolean loc_eng_ioctl_wait_cb( pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - ALOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); return ret_val; } @@ -321,13 +317,13 @@ boolean loc_eng_ioctl_process_cb ( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (client_handle != ioctl_cb_data_ptr->client_handle) { - ALOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); ret_val = FALSE; } else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) { - ALOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); ret_val = FALSE; } @@ -339,7 +335,7 @@ boolean loc_eng_ioctl_process_cb ( ioctl_cb_data_ptr->cb_has_arrived = TRUE; - ALOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, (int32) ioctl_cb_data_ptr->cb_payload.status); diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h index 4090a4d8..eb0c201a 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -1,37 +1,31 @@ -/****************************************************************************** - @file: loc_eng_ioctl.h - @brief: - - DESCRIPTION - This file defines the data structure used by any location client that - waits for the ioctl particular event to occur. Any one IOCTL can be pending - at any time. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_IOCTL_H #define LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index c7636831..3df0af14 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -1,33 +1,33 @@ -/****************************************************************************** - @file: loc_eng_ni.cpp - @brief: module for network initiated interactions - - DESCRIPTION - LOC_API network initiated operation support - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - ----------------------------------------------------------------------------- -******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -07/30/09 dx Initial version - -$Id: -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_NIDEBUG 0 #include #include @@ -46,8 +46,8 @@ $Id: #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} /*============================================================================= * @@ -119,7 +119,7 @@ static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, const rpc_loc_ni_event_s_type *request_pass_back ) { - ALOGD("Sending NI response: %s\n", respond_from_enum(resp)); + LOGD("Sending NI response: %s\n", respond_from_enum(resp)); rpc_loc_ioctl_data_u_type data; rpc_loc_ioctl_callback_s_type callback_payload; @@ -267,12 +267,12 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ loc_ni_respond(response, ni_req); */ #endif - ALOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", ni_req->event); } else { /* Print notification */ - ALOGD("NI Notification: %s, event: %d", msg, ni_req->event); + LOGD("NI Notification: %s, event: %d", msg, ni_req->event); pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); @@ -366,9 +366,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->client_name.string_len /* length */ ); - ALOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); } else { - ALOGD("SUPL NI: client_name not present."); + LOGD("SUPL NI: client_name not present."); } // Requestor ID @@ -382,9 +382,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->requestor_id.string_len /* length */ ); - ALOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); } else { - ALOGD("SUPL NI: requestor_id not present."); + LOGD("SUPL NI: requestor_id not present."); } // Encoding type @@ -402,20 +402,20 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ break; default: - ALOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); return; } /* Log requestor ID and text for debugging */ - ALOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); - ALOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); - ALOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); /* For robustness, always sets a timeout to clear up the notification status, even though * the OEM layer in java does not do so. **/ loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); - ALOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); @@ -440,7 +440,7 @@ RETURN VALUE ===========================================================================*/ int loc_ni_process_user_response(GpsUserResponseType userResponse) { - ALOGD("NI response from UI: %d", userResponse); + LOGD("NI response from UI: %d", userResponse); rpc_loc_ni_user_resp_e_type resp; switch (userResponse) @@ -493,22 +493,22 @@ int loc_eng_ni_callback ( switch (ni_req->event) { case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - ALOGI("VX Notification"); + LOGI("VX Notification"); loc_ni_request_handler("VX Notify", ni_req); break; case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - ALOGI("UMTS CP Notification\n"); + LOGI("UMTS CP Notification\n"); loc_ni_request_handler("UMTS CP Notify", ni_req); break; case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - ALOGI("SUPL Notification\n"); + LOGI("SUPL Notification\n"); loc_ni_request_handler("SUPL Notify", ni_req); break; default: - ALOGE("Unknown NI event: %x\n", (int) ni_req->event); + LOGE("Unknown NI event: %x\n", (int) ni_req->event); break; } } @@ -522,7 +522,7 @@ FUNCTION loc_ni_thread_proc ===========================================================================*/ static void loc_ni_thread_proc(void *unused) { - ALOGI("Starting Loc NI thread...\n"); + LOGI("Starting Loc NI thread...\n"); while (1) { @@ -563,7 +563,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_ni_init(GpsNiCallbacks *callbacks) { - ALOGD("loc_eng_ni_init: entered."); + LOGD("loc_eng_ni_init: entered."); if (!loc_eng_ni_data_init) { @@ -600,10 +600,10 @@ void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) { if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) { - ALOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); loc_ni_process_user_response(user_response); } else { - ALOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", notif_id, user_response); } } diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index 88d285ae..193b9f85 100755 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -1,30 +1,31 @@ -/****************************************************************************** - @file: loc_eng_ni.cpp - @brief: module for network initiated interactions - - DESCRIPTION - LOC_API network initiated operation support - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - ----------------------------------------------------------------------------- -******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -07/30/09 dx Initial version - -$Id: -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index c713c270..1ec3bf07 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -1,35 +1,32 @@ -/****************************************************************************** - @file: loc_eng.cpp - @brief: +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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. + * + */ - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ #define LOG_NDDEBUG 0 #include @@ -49,8 +46,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (400) @@ -120,7 +117,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - ALOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA; @@ -147,8 +144,8 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) 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; - ALOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); - ALOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); if (part < total_parts) { @@ -159,7 +156,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) if (rpc_ret_val != RPC_LOC_API_SUCCESS) { - ALOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); ret_val = EINVAL; // return error break; } @@ -176,7 +173,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) } len_injected += predicted_orbits_data_ptr->part_len; - ALOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); } return ret_val; diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h index b5c79451..82778ae5 100755 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.h - @brief: - - DESCRIPTION - This file defines the data structure used by this XTRA module. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk new file mode 100755 index 00000000..0a5a0a10 --- /dev/null +++ b/loc_api/libloc_api_50001/Android.mk @@ -0,0 +1,131 @@ +ifneq ($(BUILD_TINY_ANDROID),true) +#Compile this library only for builds with the latest modem image + +BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion +BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 +ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) +FEATURE_GNSS_BIT_API := true +endif # is-board-platform-in-list + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_adapter + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc_eng_log.cpp \ + LocApiAdapter.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_COPY_HEADERS_TO:= libloc_eng/ +LOCAL_COPY_HEADERS:= \ + LocApiAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_msg_id.h \ + loc_eng_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_eng + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_adapter \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_agps.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + loc_eng_log.cpp + +ifeq ($(FEATURE_GNSS_BIT_API), true) +LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API +endif # FEATURE_GNSS_BIT_API + +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 + +## Check if RPC is not unsupported +ifneq ($(TARGET_NO_RPC),true) +LOCAL_SHARED_LIBRARIES += libloc_api-rpc-qc +else +LOCAL_SHARED_LIBRARIES += libloc_api_v02 +endif #TARGET_NO_RPC + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/ulp/inc + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) + +LOCAL_MODULE_TAGS := optional + +## Libs + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_eng \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc.cpp \ + gps.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ \ + +## Includes +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp new file mode 100755 index 00000000..e631642d --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -0,0 +1,196 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include "loc_eng_msg.h" +#include "loc_log.h" +#include "loc_eng_ni.h" + +static void* noProc(void* data) +{ + return NULL; +} + +LocEng::LocEng(void* caller, + LOC_API_ADAPTER_EVENT_MASK_T emask, + gps_acquire_wakelock acqwl, + gps_release_wakelock relwl, + loc_msg_sender msgSender, + loc_ext_parser posParser, + loc_ext_parser svParser) : + owner(caller), + eventMask(emask), acquireWakelock(acqwl), + releaseWakeLock(relwl), sendMsge(msgSender), + extPosInfo(NULL == posParser ? noProc : posParser), + extSvInfo(NULL == svParser ? noProc : svParser) +{ + LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); +} + +LocApiAdapter::LocApiAdapter(LocEng &locEng) : + locEngHandle(locEng) +{ + LOC_LOGD("LocApiAdapter created"); +} + +LocApiAdapter::~LocApiAdapter() +{ + LOC_LOGV("LocApiAdapter deleted"); +} + +int LocApiAdapter::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 LocApiAdapter::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; +} + +void LocApiAdapter::reportPosition(GpsLocation &location, + void* locationExt, + enum loc_sess_status status) +{ + loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, + location, + locationExt, + status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) +{ + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportStatus(GpsStatusValue status) +{ + loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportNmea(const char* nmea, int length) +{ + loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseATL(int connHandle) +{ + loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestXtraData() +{ + LOC_LOGD("XTRA download request"); + + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestTime() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestLocation() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineDownEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineUpEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h new file mode 100755 index 00000000..033a034c --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -0,0 +1,205 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define LOC_API_ADAPTER_H + +#include +#include +#include +#include + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< + +#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)); + 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/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp new file mode 100755 index 00000000..16bed3b1 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.cpp @@ -0,0 +1,870 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static gps_location_callback gps_loc_cb = NULL; +static gps_sv_status_callback gps_sv_cb = NULL; + +static void loc_cb(GpsLocation* location, void* locExt); +static void sv_cb(GpsSvStatus* sv_status, void* svExt); + +// 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); +#ifdef QCOM_FEATURE_ULP +static int loc_update_criteria(UlpLocationCriteria criteria); +#endif + +// 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 +#ifdef QCOM_FEATURE_ULP + ,loc_update_criteria +#endif +}; + +// Function declarations for sLocEngAGpsInterface +static void loc_agps_init(AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +static int loc_agps_closed(AGpsType agpsType); +static int loc_agps_open_failed(AGpsType agpsType); +#else +static int loc_agps_open(const char* apn); +static int loc_agps_closed(); +static int loc_agps_open_failed(); +#endif +static int loc_agps_set_server(AGpsType type, const char *hostname, int port); + +static const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server +}; + +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); + +const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + +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 +}; + +#ifdef QCOM_FEATURE_ULP +static bool loc_inject_raw_command(char* command, int length); + +static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = +{ + sizeof(InjectRawCmdInterface), + loc_inject_raw_command +}; +#endif + +static loc_eng_data_s_type loc_afw_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + ENTRY_LOG_CALLFLOW(); + const GpsInterface* ret_val; + + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + 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; + } + + EXIT_LOG(%p, ret_val); + return ret_val; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + 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) +{ + ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event = + 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; + LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ + callbacks->status_cb, /* status_cb */ + 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 */}; + gps_loc_cb = callbacks->location_cb; + gps_sv_cb = callbacks->sv_status_cb; + + int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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_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 = 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(); + 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; + } + int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, + recurrence, min_interval, + preferred_accuracy, preferred_time); + + 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 = 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 = 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_update_criteria(UlpLocationCriteria criteria) +{ + ENTRY_LOG(); + int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +static const void* loc_get_extension(const char* name) +{ + ENTRY_LOG(); + const void* ret_val = NULL; + + 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) + { + ret_val = &sLocEngAGpsRilInterface; + } +#ifdef QCOM_FEATURE_ULP + else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) + { + ret_val = &sLocEngInjectRawCmdInterface; + } +#endif + 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, 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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_open(const char* apn) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, apn); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_closed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_closed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_agps_open_failed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +int loc_agps_open_failed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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; + } + int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION 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(); + int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks); + + 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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(); + loc_eng_ni_init(loc_afw_data, callbacks); + 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static bool loc_inject_raw_command(char* command, int length) +{ + ENTRY_LOG(); + int ret_val = loc_eng_inject_raw_command(loc_afw_data, command, length); + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +#endif + + +static void loc_cb(GpsLocation* location, void* locExt) +{ + ENTRY_LOG(); + if (NULL != gps_loc_cb && NULL != location) { +#ifdef QCOM_FEATURE_ULP + CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); +#else + CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); +#endif + gps_loc_cb(location); + } + EXIT_LOG(%s, VOID_RET); +} + +static void 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); +} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h new file mode 100755 index 00000000..bf942373 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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_STANDALONE, + 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 +} LocPositionMode; + +typedef void (*loc_location_cb_ext) (GpsLocation* 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; +} LocCallbacks; + +enum loc_sess_status { + LOC_SESS_SUCCESS, + LOC_SESS_INTERMEDIATE, + LOC_SESS_FAILURE +}; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_H__ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp new file mode 100755 index 00000000..4d032dce --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -0,0 +1,1838 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 /* struct sockaddr_in */ +#include +#include +#include +#include +#include + +#include "LocApiAdapter.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ulp.h" + +#include "log_util.h" +#include "loc_eng_log.h" + +#define SUCCESS TRUE +#define FAILURE FALSE + + +static void loc_eng_deferred_action_thread(void* context); +static void* loc_eng_create_msg_q(); +static void loc_eng_free_msg(void* msg); + +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + +pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; +LocEngContext* LocEngContext::me = NULL; + +LocEngContext::LocEngContext(gps_create_thread threadCreator) : + deferred_q((const void*)loc_eng_create_msg_q()), + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), + counter(0) +{ + LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", + getpid(), gettid(), + deferred_action_thread); +} + +LocEngContext* LocEngContext::get(gps_create_thread threadCreator) +{ + pthread_mutex_lock(&lock); + // gonna need mutex protection here... + if (NULL == me) { + // gps.conf is not part of the context class. But we only want to parse the conf + // file once. This is the only good place to ensure that. + // In fact one day the conf file should go into context as well. + loc_read_gps_conf(); + + me = new LocEngContext(threadCreator); + } + me->counter++; + + pthread_mutex_unlock(&lock); + return me; +} + +void LocEngContext::drop() +{ + if (deferred_action_thread != pthread_self()) { + pthread_mutex_lock(&lock); + counter--; + if (counter == 0) { + loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); + msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); + + // I am not sure if this is going to be hazardous. The calling thread + // might be blocked for a while, if the q is loaded. I am wondering + // if we should just dump all the msgs in the q upon QUIT. + pthread_cond_wait(&cond, &lock); + + msg_q_destroy((void**)&deferred_q); + delete me; + me = NULL; + } + pthread_mutex_unlock(&lock); + } else { + LOC_LOGE("The HAL thread cannot free itself"); + } +} + +// 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 char extra_data[100]; + +#ifdef QCOM_FEATURE_ULP +// ULP integration +static const ulpInterface* locEngUlpInf = NULL; +static int loc_eng_ulp_init(void* handle) ; +#endif + +/********************************************************************* + * 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) + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); +} + +static void* loc_eng_create_msg_q() +{ + void* q = NULL; + if (eMSG_Q_SUCCESS != msg_q_init(&q)) { + LOC_LOGE("loc_eng_create_msg_q Q init failed."); + q = NULL; + } + return q; +} + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +/*=========================================================================== +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) +{ + ENTRY_LOG_CALLFLOW(); + + if (NULL == callbacks || 0 == event) { + LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); + EXIT_LOG(%d, 0); + return 0; + } + + STATE_CHECK((NULL == loc_eng_data.context), + "instance already initialized", return 0); + + memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + + // Create context (msg q + thread) (if not yet created) + // This will also parse gps.conf, if not done. + loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + + // 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; + + 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; + +#ifdef QCOM_FEATURE_ULP + loc_eng_ulp_init(&loc_eng_data); +#endif + + LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, + callbacks->location_ext_parser, callbacks->sv_ext_parser); + loc_eng_data.client_handle = getLocApiAdapter(locEngHandle); + + int ret_val =-1; + if (NULL == loc_eng_data.client_handle) { + // drop the context and declare failure + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + } else { + LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); + + // call reinit to send initialization messages + int tries = 30; + while (tries > 0 && + LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { + tries--; + LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); + sleep(1); + } + } + + 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_eng_data.client_handle->reinit(); + + if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { + LOC_LOGD("loc_eng_reinit reinit() successful"); + + loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, + gps_conf.SUPL_VER)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + supl_msg, loc_eng_free_msg); + + loc_eng_msg_sensor_control_config *sensor_control_config_msg( + new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_control_config_msg, loc_eng_free_msg); + + /* Make sure this is specified by the user in the gps.conf file */ + if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) + { + loc_eng_msg_sensor_properties *sensor_properties_msg( + new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_properties_msg, loc_eng_free_msg); + } + + loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( + new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, + gps_conf.SENSOR_CONTROL_MODE, + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_perf_control_conf_msg, loc_eng_free_msg); + } + + 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.context, return); + + // XTRA has no state, so we are fine with it. + + // we need to check and clear NI + + // 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; + } + + if (loc_eng_data.navigating) + { + 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. + + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + + // De-initialize ulp + if (locEngUlpInf != NULL) + { + locEngUlpInf->destroy (); + locEngUlpInf = NULL; + } + + if (loc_eng_data.client_handle != NULL) + { + LOC_LOGD("loc_eng_init: client opened. close it now."); + delete loc_eng_data.client_handle; + loc_eng_data.client_handle = NULL; + } + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + +#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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + if (NULL == locEngUlpInf || + locEngUlpInf->start_fix () == 1) { + ret_val = loc_eng_data.client_handle->startFix(); + } +#else + ret_val = loc_eng_data.client_handle->startFix(); +#endif + + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) + { + loc_eng_data.navigating = TRUE; + } + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_stop + +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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + // Stops the ULP + if (locEngUlpInf != NULL) + { + locEngUlpInf->stop_fix (); + } +#endif + + ret_val = loc_eng_data.client_handle->stopFix(); + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS && + loc_eng_data.fix_session_status != GPS_STATUS_SESSION_BEGIN) + { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); + } + + loc_eng_data.navigating = 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, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + loc_eng_msg_position_mode *msg( + new loc_eng_msg_position_mode(&loc_eng_data, mode, + recurrence, min_interval, + preferred_accuracy, preferred_time)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_set_time *msg( + new loc_eng_msg_set_time(&loc_eng_data, + time, + timeReference, + uncertainty)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_inject_location *msg( + new loc_eng_msg_inject_location(&loc_eng_data, + latitude, + longitude, + accuracy)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return); + + loc_eng_msg_delete_aiding_data *msg( + new loc_eng_msg_delete_aiding_data(&loc_eng_data, + f)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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(); + + static GpsStatusValue last_status = GPS_STATUS_NONE; + + GpsStatus gs = { sizeof(gs),status }; + + + if (loc_eng_data.status_cb) + { + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); + loc_eng_data.status_cb(&gs); + + // Restore session begin if needed + if (status == GPS_STATUS_ENGINE_ON && last_status == GPS_STATUS_SESSION_BEGIN) + { + GpsStatus gs_sess_begin = { sizeof(gs_sess_begin),GPS_STATUS_SESSION_BEGIN }; + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs_sess_begin.status)); + loc_eng_data.status_cb(&gs_sess_begin); + } + } + + last_status = status; + + EXIT_LOG(%s, VOID_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(%p, 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, AGpsCallbacks* callbacks) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return); + STATE_CHECK((NULL == loc_eng_data.agps_status_cb), + "agps instance already initialized", + return); + loc_eng_data.agps_status_cb = callbacks->status_cb; + + loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#ifdef QCOM_FEATURE_IPV6 + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_WWAN_ANY); +#else + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#endif + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + + loc_eng_agps_reinit(loc_eng_data); + EXIT_LOG(%p, VOID_RET); +} + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, + apn_len, bearerType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, + const char* apn) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, apn, + apn_len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== + +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; + + if (LOC_AGPS_SUPL_SERVER == type) { + char url[MAX_URL_LEN]; + unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + + if (sizeof(url) > len) { + loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, + url, len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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); + loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, + ip, + port, + type)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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; + + if (NULL != loc_eng_data.context) + { + ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); + } else { + LOC_LOGW("set_server called before init. 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); + } + } + + 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(); + INIT_CHECK(loc_eng_data.context, 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); + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, + apn_len, available)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + 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 + if (status != GPS_STATUS_NONE && + !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.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); + + if (loc_eng_data.agps_status_cb != NULL) { + loc_eng_data.agnss_nif->dropAllSubscribers(); + loc_eng_data.internet_nif->dropAllSubscribers(); + + loc_eng_agps_reinit(loc_eng_data); + } + + loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); + + // modem is back up. If we crashed in the middle of navigating, we restart. + if (loc_eng_data.navigating) { + loc_eng_data.client_handle->setPositionMode( + loc_eng_data.position_mode.pMode, + loc_eng_data.position_mode.pRecurrence, + loc_eng_data.position_mode.minInterval, + loc_eng_data.position_mode.preferredAccuracy, + loc_eng_data.position_mode.preferredTime); + // not mutex protected, assuming fw won't call start twice without a + // stop call in between. + loc_eng_start_handler(loc_eng_data); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_deferred_action_thread + +DESCRIPTION + Main routine for the thread to execute loc_eng commands. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_deferred_action_thread(void* arg) +{ + ENTRY_LOG(); + loc_eng_msg *msg; + static int cnt = 0; + LocEngContext* context = (LocEngContext*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + while (1) + { + LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); + + // we are only sending / receiving msg pointers + msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; + } + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; + + LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", + __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); + + // need to ensure the instance data is valid + STATE_CHECK(NULL != loc_eng_data_p->context, + "instance cleanup happened", + delete msg; return); + + switch(msg->msgid) { + case LOC_ENG_MSG_QUIT: + { + LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; + pthread_mutex_lock(&(context->lock)); + pthread_cond_signal(&(context->cond)); + pthread_mutex_unlock(&(context->lock)); + EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); + } + return; + + case LOC_ENG_MSG_REQUEST_NI: + { + loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; + loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_INFORM_NI_RESPONSE: + { + loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; + loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, + nrMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_START_FIX: + loc_eng_start_handler(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_STOP_FIX: + if (loc_eng_data_p->agps_request_pending) + { + loc_eng_data_p->stop_request_pending = true; + LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); + } else { + loc_eng_stop_handler(*loc_eng_data_p); + } + break; + + case LOC_ENG_MSG_SET_POSITION_MODE: + { + loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; + loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, + pmMsg->minInterval,pmMsg->preferredAccuracy, + pmMsg->preferredTime); + memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); + } + break; + + case LOC_ENG_MSG_SET_TIME: + { + loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; + loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, + tMsg->uncertainty); + } + break; + + case LOC_ENG_MSG_INJECT_LOCATION: + { + loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; + loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, + ilMsg->accuracy); + } + break; + + case LOC_ENG_MSG_SET_SERVER_IPV4: + { + loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; + loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, + ssiMsg->port, + ssiMsg->serverType); + } + break; + + case LOC_ENG_MSG_SET_SERVER_URL: + { + loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; + loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); + } + break; + + case LOC_ENG_MSG_SUPL_VERSION: + { + loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; + loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: + { + loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; + loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: + { + loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: + { + loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; + loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); + } + break; + + case LOC_ENG_MSG_REPORT_POSITION: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; + if (loc_eng_data_p->location_cb != NULL) { + if (LOC_SESS_FAILURE == rpMsg->status) { + // in case we want to handle the failure case + loc_eng_data_p->location_cb(NULL, NULL); + } + // what's in the else if is... (line by line) + // 1. this is a good fix; or + // 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 == rpMsg->status || + (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && + !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && + (gps_conf.ACCURACY_THRES != 0) && + (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), + (void*)rpMsg->locationExt); + } + } + } + + break; + + case LOC_ENG_MSG_REPORT_SV: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; + if (loc_eng_data_p->sv_status_cb != NULL) { + loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), + (void*)rsMsg->svExt); + } + } + break; + + case LOC_ENG_MSG_REPORT_STATUS: + loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); + break; + + case LOC_ENG_MSG_REPORT_NMEA: + if (NULL != loc_eng_data_p->nmea_cb) { + loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + } + break; + + case LOC_ENG_MSG_REQUEST_BIT: + { + loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; + AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_BIT: + { + loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; + AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); + + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_REQUEST_ATL: + { + loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + ATLSubscriber subscriber(arqMsg->handle, + stateMachine, + loc_eng_data_p->client_handle); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_ATL: + { + loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; + ATLSubscriber s1(arlMsg->handle, + loc_eng_data_p->agnss_nif, + loc_eng_data_p->client_handle); + // attempt to unsubscribe from agnss_nif first + if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + ATLSubscriber s2(arlMsg->handle, + loc_eng_data_p->internet_nif, + loc_eng_data_p->client_handle); + // if unsuccessful, try internet_nif + loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); + } + } + break; + + case LOC_ENG_MSG_REQUEST_XTRA_DATA: + if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) + { + loc_eng_data_p->xtra_module_data.download_request_cb(); + } + break; + + case LOC_ENG_MSG_REQUEST_TIME: + break; + + case LOC_ENG_MSG_REQUEST_POSITION: + break; + + case LOC_ENG_MSG_DELETE_AIDING_DATA: + loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; + break; + + case LOC_ENG_MSG_ENABLE_DATA: + { + loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; + loc_eng_data_p->client_handle->enableData(unaMsg->enable); + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + } + break; + + case LOC_ENG_MSG_INJECT_XTRA_DATA: + { + loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; + loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_SUCCESS: + { + loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + + stateMachine->setBearer(aosMsg->bearerType); +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + stateMachine->setAPN(aosMsg->apn, aosMsg->length); + stateMachine->onRsrcEvent(RSRC_GRANTED); + } + break; + + case LOC_ENG_MSG_ATL_CLOSED: + { + loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_RELEASED); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_FAILED: + { + loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_DENIED); + } + break; + + case LOC_ENG_MSG_ENGINE_DOWN: + loc_eng_handle_engine_down(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_ENGINE_UP: + loc_eng_handle_engine_up(*loc_eng_data_p); + break; + + default: + LOC_LOGE("unsupported msgid = %d\n", msg->msgid); + break; + } + + if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | + (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | + (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) + { + loc_eng_data_p->agps_request_pending = false; + if (loc_eng_data_p->stop_request_pending) { + loc_eng_stop_handler(*loc_eng_data_p); + loc_eng_data_p->stop_request_pending = false; + } + } + loc_eng_data_p->stop_request_pending = false; + + if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && + loc_eng_data_p->aiding_data_for_deletion != 0) + { + loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); + loc_eng_data_p->aiding_data_for_deletion = 0; + } + + delete msg; + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_report_position_ulp + +DESCRIPTION + Report a ULP position + p_ulp_pos_absolute, ULP position in absolute coordinates + +DEPENDENCIES + None + +RETURN VALUE + 0: SUCCESS + others: error + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_report_position_ulp (void* handle, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data) +{ + ENTRY_LOG(); + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; + + INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, + return -1); + + if (ext_data_length > sizeof (extra_data)) + { + ext_data_length = sizeof (extra_data); + } + + memcpy(extra_data, + ext_data, + ext_data_length); + + loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, + NULL, LOC_SESS_SUCCESS); + + EXIT_LOG(%d, 0); + return 0; +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_eng_ulp_init + +DESCRIPTION + This function dynamically loads the libulp.so and calls + its init function to start up the ulp module + +DEPENDENCIES + None + +RETURN VALUE + 0: no error + -1: errors + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_ulp_init(void* owner) +{ + ENTRY_LOG(); + int ret_val; + void *handle; + const char *error; + get_ulp_interface* get_ulp_inf; + + if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { + LOC_LOGD ("%s, ULP is not supported\n", __func__); + ret_val = -1; + goto exit; + } + + handle = dlopen ("libulp.so", RTLD_NOW); + if (!handle) + { + LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); + ret_val = -1; + goto exit; + } + dlerror(); /* Clear any existing error */ + + get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); + ret_val = -1; + goto exit; + } + + locEngUlpInf = get_ulp_inf(); + + // Initialize the ULP interface + locEngUlpInf->init (owner, loc_eng_report_position_ulp); + + ret_val = 0; +exit: + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + boolean ret_val; + LOC_LOGD("loc_eng_send_extra_command: %s\n", command); + ret_val = TRUE; + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +/*=========================================================================== +FUNCTION loc_eng_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + int ret_val; + ret_val = 0; + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h new file mode 100755 index 00000000..73578ec8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -0,0 +1,204 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#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 MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) + +enum loc_mute_session_e_type { + LOC_MUTE_SESS_NONE = 0, + LOC_MUTE_SESS_WAIT, + LOC_MUTE_SESS_IN_SESSION +}; + +// Module data +typedef struct +{ + LocApiAdapter *client_handle; + loc_location_cb_ext location_cb; + gps_status_callback status_cb; + loc_sv_status_cb_ext sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + boolean intermediateFix; + AGpsStatusValue agps_status; + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; + loc_eng_xtra_data_s_type xtra_module_data; + loc_eng_ni_data_s_type loc_eng_ni_data; + + boolean navigating; + + // AGPS state machines + AgpsStateMachine* agnss_nif; + AgpsStateMachine* internet_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; + + void* context; + + loc_eng_msg_position_mode position_mode; + + // For muting session broadcast + loc_mute_session_e_type mute_session_state; + + // 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_eng_data_s_type; + + +int loc_eng_init(loc_eng_data_s_type &loc_eng_data, + LocCallbacks* callbacks, + LOC_API_ADAPTER_EVENT_MASK_T event); +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, + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); +const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, + const char* name); +#ifdef QCOM_FEATURE_ULP +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria); +#endif + +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, + AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); +#endif + +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); + + +void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, + int avaiable, const char* apn); + + +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length); + + +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); + +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + GpsXtraCallbacks* callbacks); + +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length); + +extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, + GpsNiCallbacks *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); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp new file mode 100755 index 00000000..07475680 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -0,0 +1,702 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +//====================================================================== +// 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; + + +//====================================================================== +// Subscriber: BITSubscriber / ATLSubscriber +//====================================================================== +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(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); +} + +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( + GPSONE_LOC_API_IF_RELEASE_SUCCESS); + break; + case RSRC_DENIED: + loc_eng_dmn_conn_loc_api_server_data_conn( + GPSONE_LOC_API_IF_FAILURE); + break; + case RSRC_GRANTED: + loc_eng_dmn_conn_loc_api_server_data_conn( + 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: + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + break; + case RSRC_DENIED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + case RSRC_GRANTED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + default: + notify = false; + } + } + + return notify; +} + + +//====================================================================== +// 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) +{ + 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); + // move the state to PENDING + nextState = mPendingState; + + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } + 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;; + 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(); + if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasingState; + } + } 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); + } + } + } + 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; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // 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;; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } + } + break; + + 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->hasSubscribers()) { + nextState = mPendingState; + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } else { + nextState = mReleasedState; + } + } + break; + + case RSRC_GRANTED: + case RSRC_DENIED: + 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; +} + + +//====================================================================== +// AgpsStateMachine +//====================================================================== + +AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), + AGpsType type) : + mServicer(servicer), mType(type), + mStatePtr(new AgpsReleasedState(this)), + mAPN(NULL), + mAPNLen(0) +{ + 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; + 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); + } + } 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); + } +} + +void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +{ + Subscriber* s = NULL; + Notification notification(Notification::BROADCAST_ALL); + linked_list_search(mSubscribers, (void**)&s, hasSubscriber, + (void*)¬ification, false); + + if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { + AGpsStatus nifRequest; + nifRequest.size = sizeof(nifRequest); + nifRequest.type = mType; + nifRequest.status = action; + +#ifdef QCOM_FEATURE_IPV6 + if (s == NULL) { + nifRequest.ipv4_addr = INADDR_NONE; + nifRequest.ipv6_addr[0] = 0; + } else { + s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + } +#else + if (s == NULL) { + nifRequest.ipaddr = INADDR_NONE; + } else { + nifRequest.ipaddr = s->ID; + } +#endif + + CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); + (*mServicer)(&nifRequest); + } +} + +void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) +{ + 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; +} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h new file mode 100755 index 00000000..1fd0f450 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -0,0 +1,274 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +// forward declaration +class AgpsStateMachine; +class Subscriber; + +// NIF resource events +typedef enum { + RSRC_SUBSCRIBE, + RSRC_UNSUBSCRIBE, + RSRC_GRANTED, + RSRC_RELEASED, + RSRC_DENIED, + RSRC_STATUS_MAX +} AgpsRsrcStatus; + +// 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; + + // 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 AgpsStateMachine { + // 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; + + // handle to whoever provides the service + void (* const mServicer)(AGpsStatus* status); + // NIF type: AGNSS or INTERNET. + const AGpsType mType; + // pointer to the current state. + AgpsState* mStatePtr; + // a linked list of subscribers. + void* mSubscribers; + // 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; +#ifdef QCOM_FEATURE_IPV6 + // bear + AGpsBearerType mBearer; +#endif + // ipv4 address for routing + +public: + AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); + virtual ~AgpsStateMachine(); + + // self explanatory methods below + void setAPN(const char* apn, unsigned int len); + inline const char* getAPN() const { return (const char*)mAPN; } +#ifdef QCOM_FEATURE_IPV6 + inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline AGpsBearerType getBearer() const { return mBearer; } +#endif + inline AGpsType getType() const { return (AGpsType)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; + + void onRsrcEvent(AgpsRsrcStatus event); + + // put the data together and send the FW + void sendRsrcRequest(AGpsStatusValue action) const; + + 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; +}; + +// 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 int ID; + const AgpsStateMachine* mStateMachine; + inline Subscriber(const int id, + const AgpsStateMachine* stateMachine) : + ID(id), mStateMachine(stateMachine) {} + inline virtual ~Subscriber() {} + + virtual void setIPAddresses(int &v4, char* v6) = 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 { + inline BITSubscriber(const AgpsStateMachine* stateMachine, + unsigned int ipv4, char* ipv6) : + Subscriber(ipv4, stateMachine) + { + if (NULL == ipv6) { + ipv6Addr[0] = NULL; + } else { + memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); + } + } + + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } + + virtual Subscriber* clone() + { + return new BITSubscriber(mStateMachine, ID, ipv6Addr); + } + + virtual bool equals(const Subscriber *s) const; + +private: + char ipv6Addr[16]; +}; + +// ATLSubscriber, created with requests from ATL +struct ATLSubscriber : public Subscriber { + const LocApiAdapter* mLocAdapter; + inline ATLSubscriber(const int id, + const AgpsStateMachine* stateMachine, + const LocApiAdapter* adapter) : + Subscriber(id, stateMachine), mLocAdapter(adapter) {} + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = INADDR_NONE; v6[0] = 0; } + + inline virtual Subscriber* clone() + { + return new ATLSubscriber(ID, mStateMachine, mLocAdapter); + } +}; + +#endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp new file mode 100755 index 00000000..f2f9a501 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -0,0 +1,180 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#include "loc_eng_dmn_conn_glue_msg.h" +#include "loc_eng_dmn_conn_handler.h" +#include "loc_eng_dmn_conn.h" + +static int loc_api_server_msgqid; +static int loc_api_resp_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 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); + loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_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) { + LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); + usleep(1000); + return 0; + } + + 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); + 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 status) { + struct ctrl_msgbuf cmsgbuf; + cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; + cmsgbuf.cmsg.cmsg_response.result = status; + LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); + 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; + } + return 0; + +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h new file mode 100755 index 00000000..414fd553 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_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" + +#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); + +#endif /* LOC_ENG_DATA_SERVER_H */ + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c new file mode 100755 index 00000000..9cd19228 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -0,0 +1,223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h new file mode 100755 index 00000000..8bc6f2a3 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c new file mode 100755 index 00000000..74769088 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -0,0 +1,206 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*=========================================================================== +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, 0666); + + if ((result == -1) && (errno != EEXIST)) { + LOC_LOGE("failed: %s\n", strerror(errno)); + return result; + } + + 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) 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h new file mode 100755 index 00000000..3136e411 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp new file mode 100755 index 00000000..fd15f001 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -0,0 +1,78 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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; + } + + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); + +#else + loc_eng_dmn_conn_loc_api_server_data_conn(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 + loc_eng_msg_release_bit *msg( + new loc_eng_msg_release_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); +#else + loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); +#endif + return 0; +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h new file mode 100755 index 00000000..833e971b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -0,0 +1,82 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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; +}; + +struct ctrl_msg_if_request { + unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ + unsigned long ipv4_addr; + unsigned char ipv6_addr[16]; +}; + +/* 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c new file mode 100755 index 00000000..478b686f --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -0,0 +1,398 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h new file mode 100755 index 00000000..07869f90 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp new file mode 100755 index 00000000..d813cd65 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -0,0 +1,292 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "hardware/gps.h" +#include "loc.h" +#include "loc_log.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + +/* GPS status names */ +static 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 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 loc_name_val_s_type loc_eng_msgs[] = +{ + NAME_VAL( LOC_ENG_MSG_QUIT ), + NAME_VAL( LOC_ENG_MSG_ENGINE_DOWN ), + NAME_VAL( LOC_ENG_MSG_ENGINE_UP ), + NAME_VAL( LOC_ENG_MSG_START_FIX ), + NAME_VAL( LOC_ENG_MSG_STOP_FIX ), + NAME_VAL( LOC_ENG_MSG_SET_POSITION_MODE ), + NAME_VAL( LOC_ENG_MSG_SET_TIME ), + NAME_VAL( LOC_ENG_MSG_INJECT_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_INJECT_LOCATION ), + NAME_VAL( LOC_ENG_MSG_DELETE_AIDING_DATA ), + NAME_VAL( LOC_ENG_MSG_SET_APN ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_URL ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_IPV4 ), + NAME_VAL( LOC_ENG_MSG_ENABLE_DATA ), + NAME_VAL( LOC_ENG_MSG_SUPL_VERSION ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PROPERTIES ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_MUTE_SESSION ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_SUCCESS ), + NAME_VAL( LOC_ENG_MSG_ATL_CLOSED ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_FAILED ), + NAME_VAL( LOC_ENG_MSG_REPORT_POSITION ), + NAME_VAL( LOC_ENG_MSG_REPORT_SV ), + NAME_VAL( LOC_ENG_MSG_REPORT_STATUS ), + NAME_VAL( LOC_ENG_MSG_REPORT_NMEA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_ATL ), + NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), + NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), + NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), + NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), + NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) +}; +static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); + +/* Find Android GPS status name */ +const char* loc_get_msg_name(int id) +{ + return loc_get_name_from_val(loc_eng_msgs, loc_eng_msgs_num, (long) id); +} + + + +static 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 ) +}; +static 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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 ) +#ifdef QCOM_FEATURE_DELEXT + ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +#endif +}; +static 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 loc_name_val_s_type loc_eng_agps_types[] = +{ +#ifdef QCOM_FEATURE_IPV6 + NAME_VAL( AGPS_TYPE_INVALID ), + NAME_VAL( AGPS_TYPE_ANY ), +#endif + NAME_VAL( AGPS_TYPE_SUPL ), + NAME_VAL( AGPS_TYPE_C2K ) +#ifdef QCOM_FEATURE_IPV6 + ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) +#endif +}; +static 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 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 ) +}; +static 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 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 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 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 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); +} + +#ifdef QCOM_FEATURE_IPV6 +static 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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); +} +#endif + +static 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h new file mode 100755 index 00000000..eff1593b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -0,0 +1,62 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include "loc_eng_msg_id.h" + +const char* loc_get_gps_status_name(GpsStatusValue gps_status); +const char* loc_get_msg_name(int id); +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); +#ifdef QCOM_FEATURE_IPV6 +const char* loc_get_agps_bear_name(AGpsBearerType bear); +#endif +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_ENG_LOG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp new file mode 100755 index 00000000..97c0457c --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -0,0 +1,133 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_eng_msg.h" +#include "loc_eng_dmn_conn_glue_msg.h" + +#ifdef _ANDROID_ + +#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" + +#else + +#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" + +#endif + +int loc_eng_msgget(int * p_req_msgq) +{ + * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); + return 0; +} + +int loc_eng_msgremove(int req_msgq) +{ + loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); + return 0; +} + +int loc_eng_msgsnd(int msgqid, void * msgp) +{ + int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) +{ + int result; + + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + 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; +} + +int loc_eng_msgrcv(int msgqid, void ** msgp) +{ + int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) +{ + int result; + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); + if (result != sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); + return -1; + } + + if (msgsz < pmsg->msgsz) { + LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); + return -1; + } + + if (pmsg->msgsz > sizeof(struct msgbuf)) { + /* there is msg body */ + msgp += sizeof(struct msgbuf); + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); + + if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { + LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, + (pmsg->msgid), (int) pmsg->msgsz); + return -1; + } + } + + return pmsg->msgsz; +} + +int loc_eng_msgflush(int msgqid) +{ + return loc_eng_dmn_conn_glue_msgflush(msgqid); +} + +int loc_eng_msgunblock(int msgqid) +{ + return loc_eng_dmn_conn_glue_pipeunblock(msgqid); +} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h new file mode 100755 index 00000000..41548f09 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -0,0 +1,584 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#include "loc.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct loc_eng_msg { + const void* owner; + const int msgid; + inline loc_eng_msg(void* instance, int id) : + owner(instance), msgid(id) + { + LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); + } + virtual ~loc_eng_msg() + { + LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); + } +}; + +struct loc_eng_msg_suple_version : public loc_eng_msg { + const int supl_version; + inline loc_eng_msg_suple_version(void* instance, int version) : + loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), + supl_version(version) + { + LOC_LOGV("SUPL Version: %d", version); + } +}; + +struct loc_eng_msg_sensor_control_config : public loc_eng_msg { + const int sensorsDisabled; + inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), + sensorsDisabled(disabled) + { + LOC_LOGV("Sensors Disabled: %d", disabled); + } +}; + +struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const float gyroBiasVarianceRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) + { + LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); + } +}; + +struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { + const int controlMode; + const int accelSamplesPerBatch; + const int accelBatchesPerSec; + const int gyroSamplesPerBatch; + const int gyroBatchesPerSec; + inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), + controlMode(controlMode), + accelSamplesPerBatch(accelSamplesPerBatch), + accelBatchesPerSec(accelBatchesPerSec), + gyroSamplesPerBatch(gyroSamplesPerBatch), + gyroBatchesPerSec(gyroBatchesPerSec) + { + LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + } +}; + + +struct loc_eng_msg_position_mode : public loc_eng_msg { + const LocPositionMode pMode; + const GpsPositionRecurrence pRecurrence; + const uint32_t minInterval; + const uint32_t preferredAccuracy; + const uint32_t preferredTime; + inline loc_eng_msg_position_mode() : + loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(LOC_POSITION_MODE_STANDALONE), + pRecurrence(0), minInterval(0), + preferredAccuracy(0), preferredTime(0) {} + inline loc_eng_msg_position_mode(void* instance, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(mode), pRecurrence(recurrence), minInterval(min_interval), + preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) + { + LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", + loc_get_position_mode_name(pMode), + loc_get_position_recurrence_name(pRecurrence), + minInterval, + preferredAccuracy, + preferredTime); + } +}; + +struct loc_eng_msg_set_time : public loc_eng_msg { + const GpsUtcTime time; + const int64_t timeReference; + const int uncertainty; + inline loc_eng_msg_set_time(void* instance, + GpsUtcTime t, + int64_t tf, + int unc) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), + time(t), timeReference(tf), uncertainty(unc) + { + LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", + time, timeReference, uncertainty); + } +}; + +struct loc_eng_msg_inject_location : public loc_eng_msg { + const double latitude; + const double longitude; + const float accuracy; + inline loc_eng_msg_inject_location(void* instance, double lat, + double longi, float accur) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), + latitude(lat), longitude(longi), accuracy(accur) + { + LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", + latitude, longitude, accuracy); + } +}; + +struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { + const GpsAidingData type; + inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : + loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) + { + LOC_LOGV("aiding data msak %d", type); + } +}; + +struct loc_eng_msg_report_position : public loc_eng_msg { + const GpsLocation location; + const void* locationExt; + const enum loc_sess_status status; + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + enum loc_sess_status st) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), + location(loc), locationExt(locExt), status(st) + { +#ifdef QCOM_FEATURE_ULP + 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: %s", + location.flags, location.position_source, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, location.rawDataSize, location.rawData, + loc_get_position_sess_status_name(status)); +#else + LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", + location.flags, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, loc_get_position_sess_status_name(status)); +#endif + } +}; + +struct loc_eng_msg_report_sv : public loc_eng_msg { + const GpsSvStatus svStatus; + const void* svExt; + inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) + { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", + svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); + for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + svStatus.sv_list[i].prn, + svStatus.sv_list[i].snr, + svStatus.sv_list[i].elevation, + svStatus.sv_list[i].azimuth); + } + } +}; + +struct loc_eng_msg_report_status : public loc_eng_msg { + const GpsStatusValue status; + inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) + { + LOC_LOGV("status: %s", loc_get_gps_status_name(status)); + } +}; + +struct loc_eng_msg_report_nmea : public loc_eng_msg { + char* const nmea; + const int length; + inline loc_eng_msg_report_nmea(void* instance, + const char* data, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), + nmea(new char[len]), length(len) + { + memcpy((void*)nmea, (void*)data, len); + LOC_LOGV("length: %d\n nmea: %p - %c%c%c", + length, nmea, nmea[3], nmea[4], nmea[5]); + } + inline ~loc_eng_msg_report_nmea() + { + delete[] nmea; + } +}; + +struct loc_eng_msg_request_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_request_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_request_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_release_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_release_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_release_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_request_atl : public loc_eng_msg { + const int handle; + const AGpsType type; + inline loc_eng_msg_request_atl(void* instance, int hndl, + AGpsType agps_type) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), + handle(hndl), type(agps_type) + { + LOC_LOGV("handle: %d\n agps type: %s", + handle, + loc_get_agps_type_name(type)); + } +}; + +struct loc_eng_msg_release_atl : public loc_eng_msg { + const int handle; + inline loc_eng_msg_release_atl(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) + { + LOC_LOGV("handle: %d", handle); + } +}; + +struct loc_eng_msg_request_ni : public loc_eng_msg { + const GpsNiNotification notify; + const void *passThroughData; + inline loc_eng_msg_request_ni(void* instance, + GpsNiNotification ¬if, const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), + notify(notif), passThroughData(data) + { + 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", + notify.notification_id, + loc_get_ni_type_name(notify.ni_type), + notify.notify_flags, + notify.timeout, + loc_get_ni_response_name(notify.default_response), + loc_get_ni_encoding_name(notify.requestor_id_encoding), + loc_get_ni_encoding_name(notify.text_encoding), + passThroughData); + } +}; + +struct loc_eng_msg_inform_ni_response : public loc_eng_msg { + const GpsUserResponseType response; + const void *passThroughData; + inline loc_eng_msg_inform_ni_response(void* instance, + GpsUserResponseType resp, + const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), + response(resp), passThroughData(data) + { + LOC_LOGV("response: %s\n passThroughData: %p", + loc_get_ni_response_name(response), + passThroughData); + } + inline ~loc_eng_msg_inform_ni_response() + { + // this is a bit weird since passThroughData is not + // allocated by this class. But there is no better way. + // passThroughData actually won't be NULL here. + // But better safer than sorry. + if (NULL != passThroughData) { + free((void*)passThroughData); + } + } +}; + +struct loc_eng_msg_set_apn : public loc_eng_msg { + char* const apn; + inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s", apn); + } + inline ~loc_eng_msg_set_apn() + { + delete[] apn; + } +}; + + + +struct loc_eng_msg_set_server_ipv4 : public loc_eng_msg { + const unsigned int nl_addr; + const int port; + const LocServerType serverType; + inline loc_eng_msg_set_server_ipv4(void* instance, + unsigned int ip, + int p, + LocServerType type) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), + nl_addr(ip), port(p), serverType(type) + { + LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); + } +}; + + +struct loc_eng_msg_set_server_url : public loc_eng_msg { + const int len; + char* const url; + inline loc_eng_msg_set_server_url(void* instance, + const char* urlString, + int url_len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), + len(url_len), url(new char[len+1]) + { + memcpy((void*)url, (void*)urlString, url_len); + url[len] = 0; + LOC_LOGV("url: %s", url); + } + inline ~loc_eng_msg_set_server_url() + { + delete[] url; + } +}; + +struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { + char* const data; + const int length; + inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), + data(new char[l]), length(l) + { + memcpy((void*)data, (void*)d, l); + LOC_LOGV("length: %d\n data: %p", length, data); + } + inline ~loc_eng_msg_inject_xtra_data() + { + delete[] data; + } +}; + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const AGpsStatusValue agpsType; + const int length; + char* const apn; + const AGpsBearerType bearerType; + inline loc_eng_msg_atl_open_success(void* instance, + AGpsStatusValue atype, + const char* name, + int len, + AGpsBearerType btype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + agpsType(atype), length(len), + apn(new char[len+1]), bearerType(btype) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", + loc_get_agps_type_name(agpsType), + apn, + loc_get_agps_bear_name(bearerType)); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#else +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const int length; + char* const apn; + inline loc_eng_msg_atl_open_success(void* instance, + const char* name, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + length(len), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n", + apn); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_open_failed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + inline loc_eng_msg_atl_open_failed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) + { + LOC_LOGV(""); + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_closed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_closed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_closed : public loc_eng_msg { + inline loc_eng_msg_atl_closed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) + { + LOC_LOGV(""); + } +}; +#endif + +struct loc_eng_msg_set_data_enable : public loc_eng_msg { + const int enable; + char* const apn; + const int length; + inline loc_eng_msg_set_data_enable(void* instance, + const char* name, + int len, + int yes) : + loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), + enable(yes), apn(new char[len+1]), length(len) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n enable: %d", apn, enable); + } + inline ~loc_eng_msg_set_data_enable() + { + delete[] apn; + } +}; + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); +int loc_eng_msgget(int * p_req_msgq); +int loc_eng_msgremove(int req_msgq); +int loc_eng_msgsnd(int msgqid, void * msgp); +int loc_eng_msgrcv(int msgqid, void ** msgp); +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); +int loc_eng_msgflush(int msgqid); +int loc_eng_msgunblock(int msgqid); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h new file mode 100755 index 00000000..f05f1f44 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ID_H +#define LOC_ENG_MSG_ID_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct msgbuf { + unsigned int msgsz; + void* msgid; +}; + +enum loc_eng_msg_ids_t { + /* 0x 0 - 0xEF is reserved for daemon internal */ + /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ + LOC_ENG_MSG_QUIT = 0x200, + + LOC_ENG_MSG_ENGINE_DOWN, + LOC_ENG_MSG_ENGINE_UP, + + LOC_ENG_MSG_START_FIX, + LOC_ENG_MSG_STOP_FIX, + LOC_ENG_MSG_SET_POSITION_MODE, + LOC_ENG_MSG_SET_TIME, + LOC_ENG_MSG_INJECT_XTRA_DATA, + LOC_ENG_MSG_INJECT_LOCATION, + LOC_ENG_MSG_DELETE_AIDING_DATA, + LOC_ENG_MSG_SET_APN, + LOC_ENG_MSG_SET_SERVER_URL, + LOC_ENG_MSG_SET_SERVER_IPV4, + LOC_ENG_MSG_ENABLE_DATA, + + LOC_ENG_MSG_SUPL_VERSION, + LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG, + LOC_ENG_MSG_SET_SENSOR_PROPERTIES, + LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG, + LOC_ENG_MSG_MUTE_SESSION, + + LOC_ENG_MSG_ATL_OPEN_SUCCESS, + LOC_ENG_MSG_ATL_CLOSED, + LOC_ENG_MSG_ATL_OPEN_FAILED, + + LOC_ENG_MSG_REPORT_POSITION, + LOC_ENG_MSG_REPORT_SV, + LOC_ENG_MSG_REPORT_STATUS, + LOC_ENG_MSG_REPORT_NMEA, + LOC_ENG_MSG_REQUEST_BIT, + LOC_ENG_MSG_RELEASE_BIT, + LOC_ENG_MSG_REQUEST_ATL, + LOC_ENG_MSG_RELEASE_ATL, + LOC_ENG_MSG_REQUEST_NI, + LOC_ENG_MSG_INFORM_NI_RESPONSE, + LOC_ENG_MSG_REQUEST_XTRA_DATA, + LOC_ENG_MSG_REQUEST_TIME, + LOC_ENG_MSG_REQUEST_POSITION +}; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_ID_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp new file mode 100755 index 00000000..c2d78af8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -0,0 +1,313 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ +static void* ni_thread_proc(void *args); + +/*=========================================================================== + +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; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + /* If busy, use default or deny */ + if (NULL != loc_eng_ni_data_p->rawRequest) + { + /* XXX Consider sending a NO RESPONSE reply or queue the request */ + LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); + } + } + else { + /* Save request */ + loc_eng_ni_data_p->rawRequest = (void*)passThrough; + + /* Fill in notification */ + ((GpsNiNotification*)notif)->notification_id = loc_eng_ni_data_p->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. + **/ + loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); + + int rc = 0; + rc = pthread_create(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); + if (rc) + { + LOC_LOGE("Loc NI thread is not created.\n"); + } + rc = pthread_detach(loc_eng_ni_data_p->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); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + +FUNCTION ni_thread_proc + +===========================================================================*/ +static void* ni_thread_proc(void *args) +{ + ENTRY_LOG(); + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; + 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(&loc_eng_ni_data_p->tLock); + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->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, loc_eng_ni_data_p->respTimeLeft ); + + while (!loc_eng_ni_data_p->respRecvd) + { + rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, + &loc_eng_ni_data_p->tLock, + &expire_time); + if (rc == ETIMEDOUT) + { + loc_eng_ni_data_p->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 ); + loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + + // adding this check to support modem restart, in which case, we need the thread + // to exit without calling sending data to loc_eng_msg_q. We made sure that + // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() + loc_eng_msg_inform_ni_response *msg = NULL; + + if (NULL != loc_eng_ni_data_p->rawRequest) { + loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; + msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + } + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + + loc_eng_ni_data_p->respTimeLeft = 0; + loc_eng_ni_data_p->reqID++; + + if (NULL != msg) { + loc_eng_msg_sender(loc_eng_data_p, 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->rawRequest) { + free(loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + // the goal is to wake up ni_thread_proc + // and let it exit. + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->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, GpsNiCallbacks *callbacks) +{ + ENTRY_LOG_CALLFLOW(); + + 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->respTimeLeft = 0; + loc_eng_ni_data_p->respRecvd = FALSE; + loc_eng_ni_data_p->rawRequest = NULL; + loc_eng_ni_data_p->reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->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; + + 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->reqID && + NULL != loc_eng_ni_data_p->rawRequest) + { + LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + loc_eng_ni_data_p->resp = user_response; + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + } + else { + LOC_LOGE("loc_eng_ni_respond: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", + loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); + } + + EXIT_LOG(%s, VOID_RET); +} diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h new file mode 100755 index 00000000..9b1c5f34 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +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; +} loc_eng_ni_data_s_type; + + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp new file mode 100755 index 00000000..ebc7c6fb --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -0,0 +1,90 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + + +/*=========================================================================== +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, + GpsXtraCallbacks* callbacks) +{ + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &loc_eng_data.xtra_module_data; + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +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: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length) +{ + loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, + data, length)); + loc_eng_msg_sender(&loc_eng_data, msg); + + return 0; +} diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h new file mode 100755 index 00000000..7e01e146 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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; + + // 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/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk new file mode 100755 index 00000000..b6c7a66e --- /dev/null +++ b/loc_api/loc_api_v02/Android.mk @@ -0,0 +1,43 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api_v02 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libloc_adapter \ + libgps.utils + +LOCAL_SRC_FILES += \ + LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +## Includes +LOCAL_C_INCLUDES := \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp new file mode 100755 index 00000000..e223983b --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -0,0 +1,2056 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "LocApiV02Adapter.h" +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" +#include "LocApiAdapter.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_adapter" +#include "loc_util_log.h" + + +/* Default session id ; TBD needs incrementing for each */ +#define LOC_API_V02_DEF_SESSION_ID (1) + +/* Default minimium interval in ms */ +#define LOC_API_V02_DEF_MIN_INTERVAL (1000) + +/* Default horizontal accuracy in meters*/ +#define LOC_API_V02_DEF_HORZ_ACCURACY (50) + +/* Default timeout in ms; TBD: needs implementing */ +#define LOC_API_V02_DEF_TIMEOUT (120000) + +/* UMTS CP Address key*/ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +/* GPS SV Id offset */ +#define GPS_SV_ID_OFFSET (1) + +/* GLONASS SV Id offset */ +#define GLONASS_SV_ID_OFFSET (65) + +/* SV ID range */ +#define SV_ID_RANGE (32) + + + +/* static event callbacks that call the LocApiV02Adapter callbacks*/ + +/* global event callback, call the eventCb function in loc api adapter v02 + instance */ +static void globalEventCb(locClientHandleType clientHandle, + uint32_t eventId, + const locClientEventIndUnionType eventPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, eventId, pClientCookie); + + // return if null is passed + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", + __func__, __LINE__, clientHandle, eventId); + return; + } + locApiV02AdapterInstance->eventCb(clientHandle, + eventId, + eventPayload); +} + +/* global response callback, it calls the sync request process + indication function to unblock the request that is waiting on this + response indication*/ +static void globalRespCb(locClientHandleType clientHandle, + uint32_t respId, + const locClientRespIndUnionType respPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + + LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, respId, pClientCookie); + + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", + __func__, __LINE__, clientHandle, respId); + return; + } + // process the sync call + // use pDeleteAssistDataInd as a dummy pointer + loc_sync_process_ind(clientHandle, respId, + (void *)respPayload.pDeleteAssistDataInd); +} + +/* global error callback, it will call the handle service down + function in the loc api adapter instance. */ +static void globalErrorCb (locClientHandleType clientHandle, + locClientErrorEnumType errorId, + void *pClientCookie) +{ + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, errorId, pClientCookie); + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", + __func__, __LINE__, clientHandle, errorId); + return; + } + locApiV02AdapterInstance->errorCb(clientHandle, + errorId); +} + +/* global structure containing the callbacks */ +locClientCallbacksType globalCallbacks = +{ + sizeof(locClientCallbacksType), + globalEventCb, + globalRespCb, + globalErrorCb +}; + +/* Constructor for LocApiV02Adapter */ +LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): + LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), + eventMask(convertMask(locEng.eventMask)), navigating(false), + fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, + LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, + LOC_API_V02_DEF_TIMEOUT ) +{ + // initialize loc_sync_req interface + loc_sync_req_init(); +} + +/* Destructor for LocApiV02Adapter */ +LocApiV02Adapter :: ~LocApiV02Adapter() +{ + deInitLocClient(); +} + +/* close Loc API V02 client */ +int LocApiV02Adapter :: deInitLocClient() +{ + return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; +} + +/* Initialize a loc api v02 client */ +enum loc_api_adapter_err LocApiV02Adapter :: reinit() +{ + locClientStatusEnumType status; + /* If the client is already open close it first */ + if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) + { + status = locClientClose(&clientHandle); + if( eLOC_CLIENT_SUCCESS != status) + { + LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, + __LINE__, status); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + } + + LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, + __LINE__, this); + /* initialize the loc api v02 interface, note that + the locClientOpen() function will block if the + service is unavailable for a fixed time out */ + + status = locClientOpen( + eventMask, &globalCallbacks, &clientHandle, (void *)this); + + if (eLOC_CLIENT_SUCCESS != status || + clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) + { + LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, + __LINE__, loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + + // return SUCCESS + return (LOC_API_ADAPTER_ERR_SUCCESS); +} + +/* start positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: startFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStartReqMsgT_v02 start_msg; + + qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; + qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; + + // clear all fields, validity masks + memset (&start_msg, 0, sizeof(start_msg)); + memset (&set_mode_msg, 0, sizeof(set_mode_msg)); + memset (&set_mode_ind, 0, sizeof(set_mode_ind)); + + LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + + // fill in the start request + switch(fixCriteria.mode) + { + case LOC_POSITION_MODE_MS_BASED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; + break; + + case LOC_POSITION_MODE_MS_ASSISTED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; + break; + + case LOC_POSITION_MODE_RESERVED_4: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; + break; + + default: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; + break; + } + + req_union.pSetOperationModeReq = &set_mode_msg; + + // send the mode first, before the start message. + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_OPERATION_MODE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_OPERATION_MODE_IND_V02, + &set_mode_ind); // NULL? + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) + { + LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " + "ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_mode_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error + } + + if(fixCriteria.min_interval > 0) + { + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; + } + + start_msg.horizontalAccuracyLevel_valid = 1; + + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } + + start_msg.fixRecurrence_valid = 1; + if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; + } + else + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; + } + + //dummy session id + // TBD: store session ID, check for session id in pos reports. + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; + + req_union.pStartReq = &start_msg; + + status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, + req_union ); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = true; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + // start_fix failed so MO fix is not in progress + navigating = false; + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; +} + +/* stop a positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: stopFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStopReqMsgT_v02 stop_msg; + + LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); + + memset(&stop_msg, 0, sizeof(stop_msg)); + + // dummy session id + stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pStopReq = &stop_msg; + + status = locClientSendReq(clientHandle, + QMI_LOC_STOP_REQ_V02, + req_union); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = false; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, + loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); +} + +/* set the positioning fix criteria */ +enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + + LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, + min_interval, mode, recurrence, preferred_accuracy); + + //store the fix criteria + fixCriteria.mode = mode; + + fixCriteria.recurrence = recurrence; + + if(min_interval == 0) + { + fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; + } + else + { + fixCriteria.min_interval = min_interval; + } + + fixCriteria.preferred_accuracy = preferred_accuracy; + + fixCriteria.preferred_time = preferred_time; + + if(true == navigating) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); + + return( startFix()); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject time into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; + qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; + + memset(&inject_time_msg, 0, sizeof(inject_time_msg)); + + inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; + + inject_time_msg.timeUtc = time; + + inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); + + inject_time_msg.timeUnc = uncertainty; + + req_union.pInjectUtcTimeReq = &inject_time_msg; + + LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, + uncertainty); + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_UTC_TIME_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_UTC_TIME_IND_V02, + &inject_time_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) + { + LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_time_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject position into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + injectPosition(double latitude, double longitude, float accuracy) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; + qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; + + memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); + + inject_pos_msg.latitude_valid = 1; + inject_pos_msg.latitude = latitude; + + inject_pos_msg.longitude_valid = 1; + inject_pos_msg.longitude = longitude; + + inject_pos_msg.horUncCircular_valid = 1; + + inject_pos_msg.horUncCircular = accuracy; //meters assumed + + inject_pos_msg.horConfidence_valid = 1; + + inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) + + /* Log */ + LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, + inject_pos_msg.latitude, inject_pos_msg.longitude, + inject_pos_msg.horUncCircular); + + req_union.pInjectPositionReq = &inject_pos_msg; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_POSITION_IND_V02, + &inject_pos_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_pos_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* delete assistance date */ +enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteAssistDataReqMsgT_v02 delete_req; + qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; + + memset(&delete_req, 0, sizeof(delete_req)); + memset(&delete_resp, 0, sizeof(delete_resp)); + + if( f == GPS_DELETE_ALL ) + { + delete_req.deleteAllFlag = true; + } + + else + { + /* to keep track of svInfoList for GPS and GLO*/ + uint32_t curr_sv_len = 0; + uint32_t curr_sv_idx = 0; + uint32_t sv_id = 0; + + if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) + { + /* do delete for all GPS SV's */ + + curr_sv_len += SV_ID_RANGE; + + sv_id = GPS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + // increment the current index + curr_sv_idx += SV_ID_RANGE; + + } + +#ifdef QCOM_FEATURE_DELEXT + if( f & GPS_DELETE_TIME_GPS ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; + } +#endif + if(f & GPS_DELETE_POSITION ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; + } + + if(f & GPS_DELETE_TIME ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; + } + + if(f & GPS_DELETE_IONO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; + } + + if(f & GPS_DELETE_UTC ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; + } + + if(f & GPS_DELETE_HEALTH ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; + } + + if(f & GPS_DELETE_SVDIR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; + } + if(f & GPS_DELETE_SADATA ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; + } + if(f & GPS_DELETE_RTI ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; + } + if(f & GPS_DELETE_CELLDB_INFO ) + { + delete_req.deleteCellDbDataMask_valid = 1; + delete_req.deleteCellDbDataMask = + ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; + + } +#ifdef QCOM_FEATURE_DELEXT + if(f & GPS_DELETE_ALMANAC_CORR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; + } + if(f & GPS_DELETE_FREQ_BIAS_EST ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; + } + if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) + { + /* do delete for all GLONASS SV's (65 - 96) + */ + curr_sv_len += SV_ID_RANGE; + + sv_id = GLONASS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + curr_sv_idx += SV_ID_RANGE; + } + + if(f & GPS_DELETE_SVDIR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; + } + + if(f & GPS_DELETE_SVSTEER_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; + } + + if(f & GPS_DELETE_ALMANAC_CORR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; + } + + if(f & GPS_DELETE_TIME_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; + } +#endif + } + + req_union.pDeleteAssistDataReq = &delete_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + &delete_resp); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != delete_resp.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(delete_resp.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* send NI user repsonse to the engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + + qmiLocNiUserRespReqMsgT_v02 ni_resp; + qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; + + memset(&ni_resp,0, sizeof(ni_resp)); + + memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); + + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; + break; + case GPS_NI_RESPONSE_DENY: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; + break; + case GPS_NI_RESPONSE_NORESP: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; + break; + default: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, + ni_resp.userResp); + + ni_resp.notificationType = request_pass_back->notificationType; + + // copy SUPL payload from request + if(request_pass_back->NiSuplInd_valid == 1) + { + ni_resp.NiSuplPayload_valid = 1; + memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), + sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); + + } + // should this be an "else if"?? we don't need to decide + + // copy UMTS-CP payload from request + if( request_pass_back->NiUmtsCpInd_valid == 1 ) + { + ni_resp.NiUmtsCpPayload_valid = 1; + memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), + sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); + } + + //copy Vx payload from the request + if( request_pass_back->NiVxInd_valid == 1) + { + ni_resp.NiVxPayload_valid = 1; + memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), + sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); + } + + // copy Vx service interaction payload from the request + if(request_pass_back->NiVxServiceInteractionInd_valid == 1) + { + ni_resp.NiVxServiceInteractionPayload_valid = 1; + memcpy(&(ni_resp.NiVxServiceInteractionPayload), + &(request_pass_back->NiVxServiceInteractionInd), + sizeof(qmiLocNiVxServiceInteractionStructT_v02)); + } + + req_union.pNiUserRespReq = &ni_resp; + + status = loc_sync_send_req ( + clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ni_resp_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Set UMTs SLP server URL */ +enum loc_api_adapter_err LocApiV02Adapter :: setServer( + const char* url, int len) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + + if(len <=0 || len > sizeof(set_server_req.urlAddr)) + { + LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", + __func__, __LINE__, len); + + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); + + set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; + + set_server_req.urlAddr_valid = 1; + + strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +enum loc_api_adapter_err LocApiV02Adapter :: + setServer(unsigned int ip, int port, LocServerType type) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + qmiLocServerTypeEnumT_v02 set_server_cmd; + + switch (type) { + case LOC_AGPS_MPC_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; + break; + case LOC_AGPS_CUSTOM_PDE_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; + break; + default: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; + break; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); + + set_server_req.serverType = set_server_cmd; + set_server_req.ipv4Addr_valid = 1; + set_server_req.ipv4Addr.addr = ip; + set_server_req.ipv4Addr.port = port; + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Inject XTRA data, this module breaks down the XTRA + file into "chunks" and injects them one at a time */ +enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( + char* data, int length) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + int total_parts; + uint8_t part; + uint16_t len_injected; + + locClientReqUnionType req_union; + qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; + qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; + + req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; + + LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); + + inject_xtra.formatType_valid = 1; + inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; + inject_xtra.totalSize = length; + + total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; + + inject_xtra.totalParts = total_parts; + + len_injected = 0; // O bytes injected + + // XTRA injection starts with part 1 + for (part = 1; part <= total_parts; part++) + { + inject_xtra.partNum = part; + + if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) + { + inject_xtra.partData_len = length - len_injected; + } + else + { + inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; + } + + // copy data into the message + memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); + + LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", + __func__, __LINE__, + inject_xtra.partNum, total_parts, inject_xtra.partData_len, + len_injected); + + status = loc_sync_send_req( clientHandle, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + &inject_xtra_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || + inject_xtra.partNum != inject_xtra_ind.partNum) + { + LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," + " part num = %d, ind.partNum = %d\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_xtra_ind.status), + inject_xtra.partNum, inject_xtra_ind.partNum); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + break; + } + + len_injected += inject_xtra.partData_len; + LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, + len_injected); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} +#ifdef QCOM_FEATURE_IPV6 +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s], bearer = %d \n", __func__, __LINE__, + handle, is_succ, apn, bear); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + switch(bear) + { + case AGPS_APN_BEARER_IPV4: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + break; + + case AGPS_APN_BEARER_IPV6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + break; + + case AGPS_APN_BEARER_IPV4V6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + break; + + default: + LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#else +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s] \n", __func__, __LINE__, + handle, is_succ, apn); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#endif +/* close atl connection */ +enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( + int handle, int is_succ) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", + __func__, __LINE__, handle, is_succ); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the SUPL version */ +enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; + + LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); + + + memset(&supl_config_req, 0, sizeof(supl_config_req)); + memset(&supl_config_ind, 0, sizeof(supl_config_ind)); + + supl_config_req.suplVersion_valid = 1; + // SUPL version from MSByte to LSByte: + // (reserved)(major version)(minor version)(serviceIndicator) + + supl_config_req.suplVersion = (version == 0x00020000)? + eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; + + req_union.pSetProtocolConfigParametersReq = &supl_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &supl_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(supl_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Configuration */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; + qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; + + LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); + + memset(&sensor_config_req, 0, sizeof(sensor_config_req)); + memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); + + sensor_config_req.sensorsUsage_valid = 1; + sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 + : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; + + req_union.pSetSensorControlConfigReq = &sensor_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + &sensor_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Properties */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; + qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; + + LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk); + + memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); + memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); + + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; + sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + + req_union.pSetSensorPropertiesReq = &sensor_prop_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + &sensor_prop_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_prop_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Performance Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; + qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; + + LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + __FUNCTION__, + __LINE__, + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + + memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); + memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); + + sensor_perf_config_req.performanceControlMode_valid = 1; + sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; + sensor_perf_config_req.accelSamplingSpec_valid = 1; + sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; + sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; + sensor_perf_config_req.gyroSamplingSpec_valid = 1; + sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; + sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + + req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + &sensor_perf_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Convert event mask from loc eng to loc_api_v02 format */ +locClientEventMaskType LocApiV02Adapter :: convertMask( + LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + locClientEventMaskType eventMask = 0; + LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); + + if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + + if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + + /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ + if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || + (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) + eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; + + if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; + + if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) + { + // TBD: This needs to be decoupled in the HAL + eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; + } + + if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) + { + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 | + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02); + } + + if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; + + return eventMask; +} + +/* Convert error from loc_api_v02 to loc eng format*/ +enum loc_api_adapter_err LocApiV02Adapter :: convertErr( + locClientStatusEnumType status) +{ + switch( status) + { + case LOC_API_ADAPTER_ERR_SUCCESS: + return LOC_API_ADAPTER_ERR_SUCCESS; + + case eLOC_CLIENT_FAILURE_GENERAL: + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + + case eLOC_CLIENT_FAILURE_UNSUPPORTED: + return LOC_API_ADAPTER_ERR_UNSUPPORTED; + + case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + + case eLOC_CLIENT_FAILURE_ENGINE_BUSY: + return LOC_API_ADAPTER_ERR_ENGINE_BUSY; + + case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: + return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; + + case eLOC_CLIENT_FAILURE_TIMEOUT: + return LOC_API_ADAPTER_ERR_TIMEOUT; + + case eLOC_CLIENT_FAILURE_INVALID_HANDLE: + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + + case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: + return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; + + default: + return LOC_API_ADAPTER_ERR_FAILURE; + } +} + +/* convert position report to loc eng format and send the converted + position to loc eng */ + +void LocApiV02Adapter :: reportPosition ( + const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) +{ + GpsLocation location; + + memset(&location, 0, sizeof (GpsLocation)); + location.size = sizeof(location); + // Process the position from final and intermediate reports + + if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || + (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) + ) + { + // Latitude & Longitude + if( (location_report_ptr->latitude_valid == 1 ) && + (location_report_ptr->longitude_valid == 1) && + (location_report_ptr->latitude != 0 || + location_report_ptr->longitude!= 0)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if(location_report_ptr->timestampUtc_valid == 1) + { + location.timestamp = location_report_ptr->timestampUtc; + } + + // Altitude + if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitudeWrtEllipsoid; + } + + // Speed + if((location_report_ptr->speedHorizontal_valid == 1) && + (location_report_ptr->speedVertical_valid ==1 ) ) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt( + (location_report_ptr->speedHorizontal * + location_report_ptr->speedHorizontal) + + (location_report_ptr->speedVertical * + location_report_ptr->speedVertical) ); + } + + // Heading + if(location_report_ptr->heading_valid == 1) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if( (location_report_ptr->horUncCircular_valid ) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->horUncCircular; + } + + LocApiAdapter::reportPosition( location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->sessionStatus + == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + NULL, + LOC_SESS_FAILURE); + + LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " + "fix id = %u\n", __func__, __LINE__, + location_report_ptr->sessionStatus, + location_report_ptr->fixId ); + } +} + +/* convert satellite report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportSv ( + const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const qmiLocSvInfoStructT_v02 *sv_info_ptr; + + LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, + gnss_report_ptr->svList_len); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + if(gnss_report_ptr->svList_valid == 1) + { + num_svs_max = gnss_report_ptr->svList_len; + if(num_svs_max > GPS_MAX_SVS) + { + num_svs_max = GPS_MAX_SVS; + } + SvStatus.num_svs = 0; + for(i = 0; i < num_svs_max; i++) + { + sv_info_ptr = &(gnss_report_ptr->svList[i]); + if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && + (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) + && (sv_info_ptr->gnssSvId != 0 )) + { + if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; + + // We only have the data field to report gps eph and alm mask + if(sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) + { + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) + { + SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) + { + SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + (65-1); + } + // Unsupported SV system + else + { + continue; + } + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) + { + SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) + { + SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) + { + SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; + } + + SvStatus.num_svs++; + } + } + + if (SvStatus.num_svs != 0) + { + LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +/* convert engine state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) +{ + GpsStatusValue status; + + LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, + engine_state_ptr->engineState); + + status = GPS_STATUS_NONE; + if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) + { + status = GPS_STATUS_ENGINE_ON; + } + else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) + { + status = GPS_STATUS_ENGINE_OFF; + } + LocApiAdapter::reportStatus(status); +} + +/* convert fix session state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) +{ + GpsStatusValue status; + LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, + fix_session_state_ptr->sessionState); + + status = GPS_STATUS_NONE; + if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (fix_session_state_ptr->sessionState + == eQMI_LOC_FIX_SESSION_FINISHED_V02) + { + status = GPS_STATUS_SESSION_END; + } + LocApiAdapter::reportStatus(status); +} + +/* convert NMEA report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportNmea ( + const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) +{ + + LocApiAdapter::reportNmea(nmea_report_ptr->nmea, + strlen(nmea_report_ptr->nmea)); + + LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, + nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], + nmea_report_ptr->nmea[5]); +} + +/* convert and report an ATL request to loc engine */ +void LocApiV02Adapter :: reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) +{ + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) + { + AGpsType agpsType; +#ifdef QCOM_FEATURE_IPV6 + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + break; + + default: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + } +#else + agpsType = AGPS_TYPE_SUPL; +#endif + LocApiAdapter::requestATL(connHandle, agpsType); + } + + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + LocApiAdapter::releaseATL(connHandle); + } +} + +/* conver the NI report to loc eng format and send t loc engine */ +void LocApiV02Adapter :: reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) +{ + GpsNiNotification notif; + + /* initialize the notification*/ + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + /* NI timeout gets overwritten in LocApiAdapter, + initializing to 0 here */ + notif.timeout = 0; + + notif.text_encoding = GPS_ENC_NONE ; + + notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + + notif.notify_flags = 0; + + notif.default_response = GPS_NI_RESPONSE_NORESP; + + /*Handle Vx request */ + if(ni_req_ptr->NiVxInd_valid == 1) + { + const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); + + notif.ni_type = GPS_NI_TYPE_VOICE; + + // Requestor ID, the requestor id recieved is NULL terminated + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char *)vx_req->requestorId, vx_req->requestorId_len ); + } + + /* Handle UMTS CP request*/ + else if(ni_req_ptr->NiUmtsCpInd_valid == 1) + { + const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = + &ni_req_ptr->NiUmtsCpInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + + /* notificationText should always be a NULL terminated string */ + hexcode(notif.text, sizeof notif.text, + (char *)umts_cp_req->notificationText, + umts_cp_req->notificationText_len); + + /* Store requestor ID */ + hexcode(notif.requestor_id, sizeof(notif.requestor_id), + (char *)umts_cp_req->requestorId.codedString, + umts_cp_req->requestorId.codedString_len); + + /* convert encodings */ + notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); + + notif.requestor_id_encoding = + convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); + + /* LCS address (using extras field) */ + if ( umts_cp_req->clientAddress_len != 0) + { + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + + // 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; + address_source = (char *)umts_cp_req->clientAddress; + // client Address is always NULL terminated + addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, + umts_cp_req->clientAddress_len); + + // The address is ASCII string + if (addr_len) + { + strlcat(notif.extras, lcs_addr, sizeof notif.extras); + } + } + + } + else if(ni_req_ptr->NiSuplInd_valid == 1) + { + const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = + &ni_req_ptr->NiSuplInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + + // Client name + if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) + { + hexcode(notif.text, sizeof(notif.text), + (char *)supl_req->clientName.formattedString, + supl_req->clientName.formattedString_len); + LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, + notif.text); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", + __func__, __LINE__); + } + + // Requestor ID + if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char*)supl_req->requestorId.formattedString, + supl_req->requestorId.formattedString_len ); + + LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, + notif.requestor_id); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", + __func__, __LINE__); + } + + // Encoding type + if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) + { + notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); + + notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); + } + else + { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + } //ni_req_ptr->NiSuplInd_valid == 1 + + else + { + LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); + return; + } + + // Set default_response & notify_flags + convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); + + if( NULL != ni_req_copy_ptr) + { + memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); + + LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); + } + else + { + LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); + } + +} + +/* convert Ni Encoding type from QMI_LOC to loc eng format */ +GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case eQMI_LOC_NI_SUPL_UTF8_V02: + enc = GPS_ENC_SUPL_UTF8; + break; + case eQMI_LOC_NI_SUPL_UCS2_V02: + enc = GPS_ENC_SUPL_UCS2; + break; + case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + break; + default: + break; + } + + return enc; +} + +/*convert NI notify verify type from QMI LOC to loc eng format*/ +bool LocApiV02Adapter :: convertNiNotifyVerifyType ( + GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv) +{ + switch (notif_priv) + { + case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: + notif->notify_flags = 0; + break; + + case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_ACCEPT; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_DENY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return false; + } + + return true; +} + +/* event callback registered with the loc_api v02 interface */ +void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, + uint32_t eventId, locClientEventIndUnionType eventPayload) +{ + LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, + eventId); + + switch(eventId) + { + //Position Report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + reportPosition(eventPayload.pPositionReportEvent); + break; + + // Satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + reportSv(eventPayload.pGnssSvInfoReportEvent); + break; + + // Status report + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + reportEngineState(eventPayload.pEngineState); + break; + + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + reportFixSessionState(eventPayload.pFixSessionState); + break; + + // NMEA + case QMI_LOC_EVENT_NMEA_IND_V02: + reportNmea(eventPayload.pNmeaReportEvent); + break; + + // XTRA request + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + LOC_LOGD("%s:%d]: XTRA download request\n", __func__, + __LINE__); + requestXtraData(); + break; + + // time request + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + LOC_LOGD("%s:%d]: Time request\n", __func__, + __LINE__); + requestTime(); + break; + + //position request + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + LOC_LOGD("%s:%d]: Position request\n", __func__, + __LINE__); + //requestPosition(); + break; + + // NI request + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); + break; + + // AGPS connection request + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + reportAtlRequest(eventPayload.pLocationServerConnReqEvent); + break; + } +} + +/* Call the service LocApiAdapter down event*/ +void LocApiV02Adapter :: errorCb(locClientHandleType handle, + locClientErrorEnumType errorId) +{ + if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) + { + LOC_LOGE("%s:%d]: Service unavailable error\n", + __func__, __LINE__); + + LocApiAdapter::handleEngineDownEvent(); + + /* immediately send the engine up event so that + the loc engine re-initializes the adapter and the + loc-api_v02 interface */ + + LocApiAdapter::handleEngineUpEvent(); + } +} + +/* return a Loc API adapter */ +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return(new LocApiV02Adapter(locEng)); +} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h new file mode 100755 index 00000000..487e98eb --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -0,0 +1,197 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V_0_2_ADAPTER_H +#define LOC_API_V_0_2_ADAPTER_H + +#include +#include "loc_api_v02_client.h" +#include +#include + +/* Fix criteria structure*/ +struct LocApiV02FixCriteria +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval ; + uint32_t preferred_accuracy ; + uint32_t preferred_time; + + /* Constructor for the structure */ + inline LocApiV02FixCriteria (LocPositionMode mode, + GpsPositionRecurrence recur, + uint32_t min_int, + uint32_t pref_acc, + uint32_t pref_time) : + mode(mode), recurrence(recur), min_interval(min_int), + preferred_accuracy(pref_acc), preferred_time(pref_time) {} +}; + +/* This class derives from the LocApiAdapter class. + The members of this class are responsible for converting + the Loc API V02 data structures into Loc Engine data structures. + This class also implements some of the virtual functions that + handle the requests from loc engine. */ +class LocApiV02Adapter : public LocApiAdapter { + + /* loc api v02 handle*/ + locClientHandleType clientHandle; + + /* events the client is registered for */ + locClientEventMaskType eventMask; + + /* current session state */ + bool navigating; + + /* current fix criteria, for Loc aPI V02 this is + stored when set_position_mode is called and + sent out with Loc aPI V02 start message when the + start_fix() is called by loc engine. */ + LocApiV02FixCriteria fixCriteria; + + /* Convert event mask from loc eng to loc_api_v02 format */ + locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + + /* Convert error from loc_api_v02 to loc eng format*/ + enum loc_api_adapter_err convertErr(locClientStatusEnumType status); + + /* convert Ni Encoding type from QMI_LOC to loc eng format */ + GpsNiEncodingType convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); + + /*convert NI notify verify type from QMI LOC to loc eng format*/ + bool convertNiNotifyVerifyType (GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv); + + /* close Loc API V02 client */ + int deInitLocClient(); + + /* convert position report to loc eng format and send the converted + position to loc eng */ + void reportPosition + (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); + + /* convert satellite report to loc eng format and send the converted + report to loc eng */ + void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); + + /* convert engine state report to loc eng format and send the converted + report to loc eng */ + void reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); + + /* convert fix session report to loc eng format and send the converted + report to loc eng */ + void reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); + + /* convert NMEA report to loc eng format and send the converted + report to loc eng */ + void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); + + /* convert and report an ATL request to loc engine */ + void reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 + *server_request_ptr); + + /* convert and report NI request to loc eng */ + void reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); + +public: + LocApiV02Adapter(LocEng &locEng); + ~LocApiV02Adapter(); + + /* event callback registered with the loc_api v02 interface */ + void eventCb(locClientHandleType client_handle, + uint32_t loc_event_id, + locClientEventIndUnionType loc_event_payload); + + /* error callback, this function handles the service unavailable + error */ + void errorCb(locClientHandleType handle, + locClientErrorEnumType errorId); + + virtual enum loc_api_adapter_err reinit(); + + virtual enum loc_api_adapter_err startFix(); + + virtual enum loc_api_adapter_err stopFix(); + + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); + + 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); + + 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); +#ifdef QCOM_FEATURE_IPV6 + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType); +#else + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsType agpsType); +#endif + virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage); + + virtual enum loc_api_adapter_err + setSensorProperties(float gyroBiasVarianceRandomWalk); + + virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec); +}; + +#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c new file mode 100755 index 00000000..b75f1630 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -0,0 +1,548 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" + +/* Logging */ +// Uncomment to log verbose logs +#define LOG_NDEBUG 1 + +// log debug logs +#define LOG_NDDEBUG 1 +#define LOG_TAG "LocSvc_api_v02" +#include "loc_util_log.h" + +#define LOC_SYNC_REQ_BUFFER_SIZE 8 + +pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool loc_sync_call_initialized = false; + +typedef struct { + pthread_mutex_t sync_req_lock; + + /* Client ID */ + locClientHandleType client_handle; + + /* waiting conditional variable */ + pthread_cond_t ind_arrived_cond; + + /* Callback waiting data block, protected by loc_cb_data_mutex */ + bool ind_is_selected; /* is cb selected? */ + bool ind_is_waiting; /* is waiting? */ + bool ind_has_arrived; /* callback has arrived */ + uint32_t req_id; /* sync request */ + void *recv_ind_payload_ptr; /* received payload */ + uint32_t recv_ind_id; /* received ind */ + +} loc_sync_req_data_s_type; + +typedef struct { + bool in_use; /* at least one sync call is active */ + bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; + loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; +} loc_sync_req_array_s_type; + +/*************************************************************************** + * DATA FOR ASYNCHRONOUS RPC PROCESSING + **************************************************************************/ +loc_sync_req_array_s_type loc_sync_array; + +/*=========================================================================== + +FUNCTION loc_sync_req_init + +DESCRIPTION + Initialize this module + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_req_init() +{ + LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + pthread_mutex_lock(&loc_sync_call_mutex); + if(true == loc_sync_call_initialized) + { + LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + loc_sync_array.in_use = false; + + memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); + + int i; + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + pthread_mutex_init(&slot->sync_req_lock, NULL); + pthread_cond_init(&slot->ind_arrived_cond, NULL); + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; /* req id */ + } + + loc_sync_call_initialized = true; + pthread_mutex_unlock(&loc_sync_call_mutex); +} + + +/*=========================================================================== + +FUNCTION loc_sync_process_ind + +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_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* ind id */ + void *ind_payload_ptr /* payload */ +) +{ + + LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", + __func__,__LINE__, client_handle, ind_id); + + pthread_mutex_lock(&loc_sync_call_mutex); + + if (!loc_sync_array.in_use) + { + LOC_LOGD("%s:%d]: loc_sync_array not in use \n", + __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + bool in_use = false, consumed = false; + int i; + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + in_use |= loc_sync_array.slot_in_use[i]; + + pthread_mutex_lock(&slot->sync_req_lock); + + if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) + && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) + { + // copy the payload to the slot waiting for this ind + size_t payload_size = 0; + + LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", + __func__, __LINE__, i, ind_id); + + if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && + NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) + { + LOC_LOGV("%s:%d]: copying ind payload size = %u \n", + __func__, __LINE__, payload_size); + + memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); + + consumed = true; + + } + /* Received a callback while waiting, wake up thread to check it */ + if (slot->ind_is_waiting) + { + slot->recv_ind_id = ind_id; + + pthread_cond_signal(&slot->ind_arrived_cond); + } + else + { + /* If callback arrives before wait, remember it */ + LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", + __func__, __LINE__, ind_id); + + slot->ind_has_arrived = true; + } + } + pthread_mutex_unlock(&slot->sync_req_lock); + } + + if (!in_use) { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_alloc_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_alloc_slot() +{ + int i, select_id = -1; /* no free buffer */ + + pthread_mutex_lock(&loc_sync_call_mutex); + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (!loc_sync_array.slot_in_use[i]) + { + select_id = i; + loc_sync_array.slot_in_use[i] = 1; + loc_sync_array.in_use = true; + break; + } + } + + pthread_mutex_unlock(&loc_sync_call_mutex); + LOC_LOGV("%s:%d]: returning slot %d\n", + __func__, __LINE__, select_id); + return select_id; +} + +/*=========================================================================== + +FUNCTION loc_free_slot + +DESCRIPTION + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_free_slot(int select_id) +{ + int i; + loc_sync_req_data_s_type *slot; + + pthread_mutex_lock(&loc_sync_call_mutex); + + LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); + + loc_sync_array.slot_in_use[select_id] = 0; + + slot = &loc_sync_array.slots[select_id]; + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; + + // check if all slots are now free + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (loc_sync_array.slot_in_use[i]) break; + } + + if (i >= LOC_SYNC_REQ_BUFFER_SIZE) + { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_sync_select_ind + +DESCRIPTION + Selects which indication to wait for. + + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -ENOMEM : out of buffer + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_select_ind( + locClientHandleType client_handle, /* Client handle */ + uint32_t ind_id, /* ind Id wait for */ + uint32_t req_id, /* req id */ + void * ind_payload_ptr /* ptr where payload should be copied to*/ +) +{ + int select_id = loc_alloc_slot(); + + LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", + __func__, __LINE__, client_handle, ind_id, req_id); + + if (select_id < 0) + { + LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", + __func__, __LINE__, loc_get_v02_event_name(req_id)); + return -ENOMEM; + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + pthread_mutex_lock(&slot->sync_req_lock); + + slot->client_handle = client_handle; + slot->ind_is_selected = true; + slot->ind_is_waiting = false; + slot->ind_has_arrived = false; + + slot->recv_ind_id = ind_id; + slot->req_id = req_id; + slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr + + pthread_mutex_unlock(&slot->sync_req_lock); + + return select_id; +} + + +/*=========================================================================== + +FUNCTION loc_sync_wait_for_ind + +DESCRIPTION + Waits for a selected indication. The wait expires in timeout_seconds seconds. + If the function is called before an existing wait has finished, it will + immediately return error. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 on SUCCESS, -ve value on failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_wait_for_ind( + int select_id, /* ID from loc_sync_select_ind() */ + int timeout_seconds, /* Timeout in this number of seconds */ + uint32_t ind_id +) +{ + if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) + { + LOC_LOGE("%s:%d]: invalid select_id: %d \n", + __func__, __LINE__, select_id); + + return (-EINVAL); + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + int ret_val = 0; /* the return value of this function: 0 = no error */ + int rc; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + pthread_mutex_lock(&slot->sync_req_lock); + + do + { + if (slot->ind_has_arrived) + { + ret_val = 0; /* success */ + break; + } + + if (slot->ind_is_waiting) + { + LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, + __LINE__, select_id); + ret_val = -EBUSY; // busy + break; + } + + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_sec += timeout_seconds; + + /* Take new wait request */ + slot->ind_is_waiting = true; + + /* Waiting */ + rc = pthread_cond_timedwait(&slot->ind_arrived_cond, + &slot->sync_req_lock, &expire_time); + + slot->ind_is_waiting = false; + + if(rc == ETIMEDOUT) + { + LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", + __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); + ret_val = -ETIMEDOUT; //time out + } + + } while (0); + + pthread_mutex_unlock(&slot->sync_req_lock); + loc_free_slot(select_id); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_sync_send_req + +DESCRIPTION + Synchronous req call (thread safe) + +DEPENDENCIES + N/A + +RETURN VALUE + Loc API 2.0 status + +SIDE EFFECTS + N/A + +===========================================================================*/ +locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; + int select_id; + int rc = 0; + + // Select the callback we are waiting for + select_id = loc_sync_select_ind(client_handle, ind_id, req_id, + ind_payload_ptr); + + if (select_id >= 0) + { + status = locClientSendReq (client_handle, req_id, req_payload); + LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", + __func__, __LINE__, select_id, status); + + if (status != eLOC_CLIENT_SUCCESS ) + { + loc_free_slot(select_id); + } + else + { + // Wait for the indication callback + if (( rc = loc_sync_wait_for_ind( select_id, + timeout_msec / 1000, + ind_id) ) < 0) + { + if ( rc == -ETIMEDOUT) + status = eLOC_CLIENT_FAILURE_TIMEOUT; + else + status = eLOC_CLIENT_FAILURE_INTERNAL; + + // Callback waiting failed + LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " + "select id %d, status %s", __func__, __LINE__, rc , + select_id, loc_get_v02_client_status_name(status)); + } + else + { + status = eLOC_CLIENT_SUCCESS; + LOC_LOGV("%s:%d]: success (select id %d)\n", + __func__, __LINE__, select_id); + } + } + } /* select id */ + + return status; +} + + diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h new file mode 100755 index 00000000..8c7f7f19 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SYNC_REQ_H +#define LOC_SYNC_REQ_H + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include +#include "loc_api_v02_client.h" + +#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second + +/* Init function */ +extern void loc_sync_req_init(); + + +/* Process Loc API indications to wake up blocked user threads */ +extern void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* respInd id */ + void *ind_payload_ptr /* payload */ +); + +/* Thread safe synchronous request, using Loc API status return code */ +extern locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c new file mode 100755 index 00000000..4d34adc4 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -0,0 +1,1867 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "qmi_client.h" +#include "qmi_idl_lib.h" +#include "qmi_cci_target_ext.h" + +#if defined( _ANDROID_) +#include "qmi_cci_target.h" +#include "qmi_cci_common.h" +#elif defined(LOC_UTIL_TARGET_OFF_TARGET) +#include +#include +#include +#endif //_ANDROID_ + +#include +#include +#include +#include +#include +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" + +#include "loc_util_log.h" + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (5000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) + +#else + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (1000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +//timeout in ms to wait for the service to come up +#define LOC_CLIENT_SERVICE_TIMEOUT (20000) + +/* Table to relate eventId, size and mask value used to enable the event*/ +typedef struct +{ + uint32_t eventId; + size_t eventSize; + locClientEventMaskType eventMask; +}locClientEventIndTableStructT; + + +static locClientEventIndTableStructT locClientEventIndTable[]= { + + // position report ind + { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, + + // satellite report ind + { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, + sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), + QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, + + // NMEA report ind + { QMI_LOC_EVENT_NMEA_IND_V02, + sizeof(qmiLocEventNmeaIndMsgT_v02), + QMI_LOC_EVENT_MASK_NMEA_V02 }, + + //NI event ind + { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, + sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, + + //Time Injection Request Ind + { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, + sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, + + //Predicted Orbits Injection Request + { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, + sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, + + //Position Injection Request Ind + { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, + sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , + + //Engine State Report Ind + { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, + sizeof(qmiLocEventEngineStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, + + //Fix Session State Report Ind + { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, + sizeof(qmiLocEventFixSessionStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, + + //Wifi Request Indication + { QMI_LOC_EVENT_WIFI_REQ_IND_V02, + sizeof(qmiLocEventWifiReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, + + //Sensor Streaming Ready Status Ind + { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, + sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, + + // Time Sync Request Indication + { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, + sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, + + //Set Spi Streaming Report Event + { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, + sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, + + //Location Server Connection Request event + { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, + sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } +}; + +/* table to relate the respInd Id with its size */ +typedef struct +{ + uint32_t respIndId; + size_t respIndSize; +}locClientRespIndTableStructT; + +static locClientRespIndTableStructT locClientRespIndTable[]= { + + // get service revision ind + { QMI_LOC_GET_SERVICE_REVISION_IND_V02, + sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, + + // Get Fix Criteria Resp Ind + { QMI_LOC_GET_FIX_CRITERIA_IND_V02, + sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, + + // NI User Resp In + { QMI_LOC_NI_USER_RESPONSE_IND_V02, + sizeof(qmiLocNiUserRespIndMsgT_v02)}, + + //Inject Predicted Orbits Data Resp Ind + { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, + + //Get Predicted Orbits Data Src Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, + + // Get Predicted Orbits Data Validity Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, + + // Inject UTC Time Resp Ind + { QMI_LOC_INJECT_UTC_TIME_IND_V02, + sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, + + //Inject Position Resp Ind + { QMI_LOC_INJECT_POSITION_IND_V02, + sizeof(qmiLocInjectPositionIndMsgT_v02)}, + + //Set Engine Lock Resp Ind + { QMI_LOC_SET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocSetEngineLockIndMsgT_v02)}, + + //Get Engine Lock Resp Ind + { QMI_LOC_GET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocGetEngineLockIndMsgT_v02)}, + + //Set SBAS Config Resp Ind + { QMI_LOC_SET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, + + //Get SBAS Config Resp Ind + { QMI_LOC_GET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, + + //Set NMEA Types Resp Ind + { QMI_LOC_SET_NMEA_TYPES_IND_V02, + sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, + + //Get NMEA Types Resp Ind + { QMI_LOC_GET_NMEA_TYPES_IND_V02, + sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, + + //Set Low Power Mode Resp Ind + { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, + + //Get Low Power Mode Resp Ind + { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, + + //Set Server Resp Ind + { QMI_LOC_SET_SERVER_IND_V02, + sizeof(qmiLocSetServerIndMsgT_v02)}, + + //Get Server Resp Ind + { QMI_LOC_GET_SERVER_IND_V02, + sizeof(qmiLocGetServerIndMsgT_v02)}, + + //Delete Assist Data Resp Ind + { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + + //Set XTRA-T Session Control Resp Ind + { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, + + //Get XTRA-T Session Control Resp Ind + { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, + + //Inject Wifi Position Resp Ind + { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, + sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, + + //Notify Wifi Status Resp Ind + { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, + + //Get Registered Events Resp Ind + { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, + sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, + + //Set Operation Mode Resp Ind + { QMI_LOC_SET_OPERATION_MODE_IND_V02, + sizeof(qmiLocSetOperationModeIndMsgT_v02)}, + + //Get Operation Mode Resp Ind + { QMI_LOC_GET_OPERATION_MODE_IND_V02, + sizeof(qmiLocGetOperationModeIndMsgT_v02)}, + + //Set SPI Status Resp Ind + { QMI_LOC_SET_SPI_STATUS_IND_V02, + sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, + + //Inject Sensor Data Resp Ind + { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, + + //Inject Time Sync Data Resp Ind + { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, + sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, + + //Set Cradle Mount config Resp Ind + { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, + + //Get Cradle Mount config Resp Ind + { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, + + //Set External Power config Resp Ind + { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, + + //Get External Power config Resp Ind + { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, + + //Location server connection status + { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, + + //Set Protocol Config Parameters + { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, + + //Get Protocol Config Parameters + { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, + + //Set Sensor Control Config + { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, + + //Get Sensor Control Config + { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, + + //Set Sensor Properties + { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, + + //Get Sensor Properties + { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, + + //Set Sensor Performance Control Config + { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, + + //Get Sensor Performance Control Config + { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, + //Inject SUPL certificate + { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, + + //Delete SUPL certificate + { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, + + // Set Position Engine Config + { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, + + // Get Position Engine Config + { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} + +}; + + +/** whether indication is an event or a response */ +typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; + + +/** @struct locClientInternalState + */ + +typedef struct +{ + // client cookie + void *pClientCookie; + //QCCI handle for this control point + qmi_client_type userHandle; + + // callbacks registered by the clients + locClientEventIndCbType eventCallback; + locClientRespIndCbType respCallback; + locClientErrorCbType errorCallback; + + // the event mask the client has registered for + locClientEventMaskType eventRegMask; + +}locClientCallbackDataType; + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** locClientGetSizeAndTypeByIndId + * @brief this function gets the size and the type (event, + * response)of the indication structure from its ID + * @param [in] indId ID of the indication + * @param [out] type event or response indication + * @param [out] size size of the indications + * + * @return true if the ID was found, false otherwise */ + +static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, + locClientIndEnumT *pIndType) +{ + // look in the event table + if(true == locClientGetSizeByEventIndId(indId, pIndSize)) + { + *pIndType = eventIndType; + + LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + //else look in response table + if(true == locClientGetSizeByRespIndId(indId, pIndSize)) + { + *pIndType = respIndType; + + LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + // Id not found + LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); + return false; +} + +/** isClientRegisteredForEvent +* @brief checks the mask to identify if the client has +* registered for the specified event Id +* @param [in] eventIndId +* @param [in] eventRegMask +* @return true if client regstered for event; else false */ + +static bool isClientRegisteredForEvent( + locClientEventMaskType eventRegMask, + uint32_t eventIndId) +{ + size_t idx = 0, eventIndTableSize = 0; + + // look in the event table + eventIndTableSize = + (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); + + for(idx=0; idxresp.result == QMI_RESULT_SUCCESS ) + { + status = eLOC_CLIENT_SUCCESS; + } + else + { + switch(pResponse->resp.error) + { + case QMI_ERR_MALFORMED_MSG_V01: + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + + case QMI_ERR_DEVICE_IN_USE_V01: + status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; + break; + + default: + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + } + LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", + __func__, __LINE__, pResponse->resp.result, + pResponse->resp.error, status); + return status; +} + +/** convertQmiErrorToLocError + @brief converts a qmi service error type to + locClientErrorEnumType + @param [in] error received QMI service. + @return locClientErrorEnumType corresponding to the error. +*/ + +static locClientErrorEnumType convertQmiErrorToLocError( + qmi_client_error_type error) +{ + locClientErrorEnumType locError ; + switch(error) + { + case QMI_SERVICE_ERR: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + + default: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + } + LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", + __func__, __LINE__, error, locError); + return locError; +} + +/** locClienHandlePosReportInd + * @brief Validates a position report ind + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if pos report is valid, false otherwise +*/ +static bool locClientHandlePosReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate position report + qmiLocEventPositionReportIndMsgT_v02 *posReport = + (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", + __func__, __LINE__, ind_buf_len, + posReport->latitude, posReport->longitude, + posReport->altitudeWrtEllipsoid); + + return true; +} +//----------------------------------------------------------------------------- + +/** locClientHandleSatReportInd + * @brief Validates a satellite report indication. Dk + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if sat report is valid, false otherwise +*/ +static bool locClientHandleSatReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate sat reports + unsigned int idx = 0; + qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = + (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" + " validity = %d \n ", __func__, __LINE__, + ind_buf_len, satReport->altitudeAssumed, + satReport->svList_len, satReport->svList_valid); + //Log SV report + for( idx = 0; idx svList_len; idx++ ) + { + LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " + "status = %d \n", __func__, __LINE__, + satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, + satReport->svList[idx].system, satReport->svList[idx].svStatus); + } + + return true; +} + + +/** locClientHandleNmeaReportInd + * @brief Validate a NMEA report indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if nmea report is valid, false otherwise +*/ + + +static bool locClientHandleNmeaReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate NMEA report + return true; +} + +/** locClientHandleGetServiceRevisionRespInd + * @brief Handles a Get Service Revision Rresponse indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if service revision is valid, false otherwise +*/ + +static bool locClientHandleGetServiceRevisionRespInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + LOC_LOGV("%s:%d] :\n", __func__, __LINE__); + return true; +} + +/** locClientHandleIndication + * @brief looks at each indication and calls the appropriate + * validation handler + * @param [in] indId + * @param [in] indBuffer + * @param [in] indSize + * @return true if indication was validated; else false */ + +static bool locClientHandleIndication( + uint32_t indId, + void* indBuffer, + size_t indSize + ) +{ + bool status = false; + switch(indId) + { + // handle the event indications + //------------------------------------------------------------------------- + + // handle position report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + { + status = locClientHandlePosReportInd(indId, indBuffer, indSize); + break; + } + // handle satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + { + status = locClientHandleSatReportInd(indId, indBuffer, indSize); + break; + } + + // handle NMEA report + case QMI_LOC_EVENT_NMEA_IND_V02: + { + status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); + break; + } + + // handle NI Notify Verify Request Ind + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + { + // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Time Inject request Ind + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + { + // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle XTRA data Inject request Ind + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + { + // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle position inject request Ind + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + { + // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle engine state Ind + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + { + // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle fix session state Ind + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + { + // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Wifi request Ind + case QMI_LOC_EVENT_WIFI_REQ_IND_V02: + { + // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle sensor streaming ready status Ind + case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: + { + // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle time sync Ind + case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: + { + // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle set streaming report ind + case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: + { + // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + { + //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + //------------------------------------------------------------------------- + + // handle the response indications + //------------------------------------------------------------------------- + + // Get service Revision response indication + case QMI_LOC_GET_SERVICE_REVISION_IND_V02: + { + status = locClientHandleGetServiceRevisionRespInd(indId, + indBuffer, indSize); + break; + } + // predicted orbits data response indication + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: + { + //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : + { + //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: + { + //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: + { + //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: + { + //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: + { + //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + // for indications that only have a "status" field + case QMI_LOC_NI_USER_RESPONSE_IND_V02: + case QMI_LOC_INJECT_UTC_TIME_IND_V02: + case QMI_LOC_INJECT_POSITION_IND_V02: + case QMI_LOC_SET_ENGINE_LOCK_IND_V02: + case QMI_LOC_SET_SBAS_CONFIG_IND_V02: + case QMI_LOC_SET_NMEA_TYPES_IND_V02: + case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: + case QMI_LOC_SET_SERVER_IND_V02: + case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: + case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: + case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: + case QMI_LOC_SET_OPERATION_MODE_IND_V02: + case QMI_LOC_SET_SPI_STATUS_IND_V02: + case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: + case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: + case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: + { + status = true; + break; + } + default: + LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, + (uint32_t)indId); + status = false; + break; + } + return status; +} + + +/** locClientErrorCb + * @brief handles the QCCI error events, this is called by the + * QCCI infrastructure when the service is no longer + * available. + * @param [in] user handle + * @param [in] error + * @param [in] *err_cb_data + */ + +static void locClientErrorCb +( + qmi_client_type user_handle, + qmi_client_error_type error, + void *err_cb_data +) +{ + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)err_cb_data; + + /* copy the errorCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and error callback. + */ + locClientErrorCbType localErrorCallback = + pCallbackData->errorCallback; + + LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", + __func__, __LINE__, error, err_cb_data); + + /* call the error callback + * To avoid calling the errorCallback after locClientClose + * is called, check pCallbackData->errorCallback again here + */ + + if( (NULL != pCallbackData) && + (NULL != localErrorCallback) && + (NULL != pCallbackData->errorCallback) ) + { + //invoke the error callback for the corresponding client + localErrorCallback( + (locClientHandleType)pCallbackData, + convertQmiErrorToLocError(error), + pCallbackData->pClientCookie); + } +} + + +/** locClientIndCb + * @brief handles the indications sent from the service, if a + * response indication was received then the it is sent + * to the response callback. If a event indication was + * received then it is sent to the event callback + * @param [in] user handle + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @param [in] ind_cb_data */ + +static void locClientIndCb +( + qmi_client_type user_handle, + unsigned int msg_id, + void *ind_buf, + unsigned int ind_buf_len, + void *ind_cb_data +) +{ + locClientIndEnumT indType; + size_t indSize = 0; + qmi_client_error_type rc ; + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)ind_cb_data; + + LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", + __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, + pCallbackData); + + // check callback data + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); + return; + } + + // check user handle + if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) + { + LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", + __func__, __LINE__, + user_handle, pCallbackData->userHandle); + return; + } + // Get the indication size and type ( eventInd or respInd) + if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) + { + void *indBuffer = NULL; + + // if the client did not register for this event then just drop it + if( (eventIndType == indType) && + ( (NULL == pCallbackData->eventCallback) || + (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) + { + LOC_LOGW("%s:%d]: client is not registered for event %d\n", + __func__, __LINE__, (uint32_t)msg_id); + return; + } + + // decode the indication + indBuffer = malloc(indSize); + + if(NULL == indBuffer) + { + LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); + return; + } + + // decode the indication + rc = qmi_client_message_decode( + user_handle, + QMI_IDL_INDICATION, + msg_id, + ind_buf, + ind_buf_len, + indBuffer, + indSize); + + if( rc == QMI_NO_ERR ) + { + //validate indication + if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + { + if(eventIndType == indType) + { + locClientEventIndUnionType eventIndUnion; + + /* copy the eventCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientEventIndCbType localEventCallback = + pCallbackData->eventCallback; + + // dummy event + eventIndUnion.pPositionReportEvent = + (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; + + /* call the event callback + * To avoid calling the eventCallback after locClientClose + * is called, check pCallbackData->eventCallback again here + */ + if((NULL != localEventCallback) && + (NULL != pCallbackData->eventCallback)) + { + localEventCallback( + (locClientHandleType)pCallbackData, + msg_id, + eventIndUnion, + pCallbackData->pClientCookie); + } + } + else if(respIndType == indType) + { + locClientRespIndUnionType respIndUnion; + + /* copy the respCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientRespIndCbType localRespCallback = + pCallbackData->respCallback; + + // dummy to suppress compiler warnings + respIndUnion.pDeleteAssistDataInd = + (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; + + /* call the response callback + * To avoid calling the respCallback after locClientClose + * is called, check pCallbackData->respCallback again here + */ + if((NULL != localRespCallback) && + (NULL != pCallbackData->respCallback)) + { + localRespCallback( + (locClientHandleType)pCallbackData, + msg_id, + respIndUnion, + pCallbackData->pClientCookie); + } + } + } + else // error handling indication + { + LOC_LOGE("%s:%d]: Error handling the indication %d\n", + __func__, __LINE__, (uint32_t)msg_id); + } + } + else + { + LOC_LOGE("%s:%d]: Error decoding indication %d\n", + __func__, __LINE__, rc); + } + if(indBuffer) + { + free (indBuffer); + } + } + else // Id not found + { + LOC_LOGE("%s:%d]: Error indication not found %d\n", + __func__, __LINE__,(uint32_t)msg_id); + } + return; +} + + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +static bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientReqUnionType reqUnion; + qmiLocRegEventsReqMsgT_v02 regEventsReq; + + memset(®EventsReq, 0, sizeof(regEventsReq)); + + regEventsReq.eventRegMask = eventRegMask; + reqUnion.pRegEventsReq = ®EventsReq; + + status = locClientSendReq(clientHandle, + QMI_LOC_REG_EVENTS_REQ_V02, + reqUnion); + + if(eLOC_CLIENT_SUCCESS != status ) + { + LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status) ); + return false; + } + + return true; +} + +/** validateRequest + @brief validates the input request + @param [in] reqId request ID + @param [in] reqPayload Union of pointers to message payload + @param [out] ppOutData Pointer to void *data if successful + @param [out] pOutLen Pointer to length of data if succesful. + @return false on failure, true on Success +*/ + +static bool validateRequest( + uint32_t reqId, + const locClientReqUnionType reqPayload, + void **ppOutData, + uint32_t *pOutLen ) + +{ + bool noPayloadFlag = false; + + LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); + switch(reqId) + { + case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); + break; + } + + case QMI_LOC_REG_EVENTS_REQ_V02: + { + *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); + break; + } + + case QMI_LOC_START_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopReqMsgT_v02); + break; + } + + case QMI_LOC_NI_USER_RESPONSE_REQ_V02: + { + *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_UTC_TIME_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); + break; + } + + case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_NMEA_TYPES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SERVER_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); + break; + } + + case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_OPERATION_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SPI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); + break; + } + + // ALL requests with no payload + case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: + case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: + case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: + case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: + case QMI_LOC_GET_NMEA_TYPES_REQ_V02: + case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: + case QMI_LOC_GET_SERVER_REQ_V02: + case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: + case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: + case QMI_LOC_GET_OPERATION_MODE_REQ_V02: + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + noPayloadFlag = true; + break; + } + + default: + LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, + reqId); + return false; + } + if(true == noPayloadFlag) + { + *ppOutData = NULL; + *pOutLen = 0; + } + else + { + //set dummy pointer for request union + *ppOutData = (void*) reqPayload.pInformClientRevisionReq; + } + LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, + reqId, *pOutLen); + return true; +} + +/** locClientQmiCtrlPointInit + @brief wait for the service to come up or timeout; when the + service comes up initialize the control point and set + internal handle and indication callback. + @param pQmiClient, +*/ + +static locClientStatusEnumType locClientQmiCtrlPointInit( + locClientCallbackDataType *pLocClientCbData) +{ + uint32_t num_services, num_entries = 10; + qmi_client_type clnt, notifier; + qmi_client_os_params os_params; + + // num instances of this service + qmi_service_info serviceInfo[5]; + + qmi_client_error_type rc = QMI_NO_ERR; + + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); + + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed\n", + __func__, __LINE__ ); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT); + + if(QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params)) + { + // timed out, return with error + LOC_LOGE("%s:%d]: timed out waiting for service\n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_TIMEOUT); + } + else + { + // get the service addressing information + rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, + &num_services); + LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned %d " + "num_services = %d\n", __func__, __LINE__, rc, + num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!!\n", __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + } + + //get service info to be used in qmi_client_init + rc = qmi_client_get_service_list( locClientServiceObject, serviceInfo, + &num_entries, &num_services); + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); + + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); + // initialize the client + rc = qmi_client_init(&serviceInfo[0], locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + return (eLOC_CLIENT_FAILURE_INTERNAL); + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + return(eLOC_CLIENT_SUCCESS); + +} +//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- + +/** locClientOpen + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ + +locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientCallbackDataType *pCallbackData = NULL; + + LOC_LOGV("%s:%d] \n", __func__, __LINE__); + + do + { + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + } + + // Allocate memory for the callback data + pCallbackData = + ( locClientCallbackDataType*)calloc( + 1, sizeof(locClientCallbackDataType)); + + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize the QMI control point; this function will block + * until a service is up or a timeout occurs. If the connection to + * the service succeeds the callback data will be filled in with + * a qmi_client value. + */ + + + EXIT_LOG_CALLFLOW(%s, "loc client open"); + status = locClientQmiCtrlPointInit(pCallbackData); + + LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + + if(status != eLOC_CLIENT_SUCCESS) + { + free(pCallbackData); + pCallbackData = NULL; + break; + } + + // set the handle to the callback data + *pLocClientHandle = (locClientHandleType)pCallbackData; + + if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) + { + LOC_LOGE("%s:%d]: Error sending registration mask\n", + __func__, __LINE__); + + // release the client + locClientClose(pLocClientHandle); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize rest of the client structure now that the connection + * to the service has been created successfully. + */ + + //fill in the event callback + pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; + + //fill in the response callback + pCallbackData->respCallback = pLocClientCallbacks->respIndCb; + + //fill in the error callback + pCallbackData->errorCallback = pLocClientCallbacks->errorCb; + + //set the client event registration mask + pCallbackData->eventRegMask = eventRegMask; + + // set the client cookie + pCallbackData->pClientCookie = (void *)pClientCookie; + + LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + + }while(0); + + if(eLOC_CLIENT_SUCCESS != status) + { + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + } + + return(status); +} + +/** locClientClose + @brief Disconnects a client from the location engine. + @param [in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) - On success. + - non-zero error code(see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientClose( + locClientHandleType* pLocClientHandle) +{ + qmi_client_error_type rc = QMI_NO_ERR; //No error + + if(NULL == pLocClientHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid pointer to handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + // convert handle to callback data + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)(*pLocClientHandle); + + LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", + *pLocClientHandle, pCallbackData->userHandle ); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, "loc client close"); + // release the handle + rc = qmi_client_release(pCallbackData->userHandle); + if(QMI_NO_ERR != rc ) + { + LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", + __func__, __LINE__, rc, pCallbackData->userHandle); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* clear the memory allocated to callback data to minimize the chances + * of a race condition occurring between close and the indication + * callback + */ + memset(pCallbackData, 0, sizeof(*pCallbackData)); + + // free the memory assigned in locClientOpen + free(pCallbackData); + pCallbackData= NULL; + + // set the handle to invalid value + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + + return eLOC_CLIENT_SUCCESS; +} + +/** locClientSendReq + @brief Sends a message to the location engine. If the locClientSendMsg() + function is successful, the client should expect an indication + (except start, stop, event reg and sensor injection messages), + through the registered callback in the locOpen() function. The + indication will contain the status of the request and if status is a + success, indication also contains the payload + associated with response. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] reqId message ID of the request + @param [in] reqPayload Payload of the request, can be NULL + if request has no payload + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS ) - On success. + - non-zero error code (see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload ) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGenRespMsgT_v02 resp; + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle ) + { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + // validate that the request is correct + if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) + { + + LOC_LOGE("%s:%d] error invalid request\n", __func__, + __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, + __LINE__, reqId, reqLen); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); + + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + reqId, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + return(status); +} + +/** locClientGetSizeByRespIndId + * @brief Get the size of the response indication structure, + * from a specified id + * @param [in] respIndId + * @param [out] pRespIndSize + * @return true if resp ID was found; else false +*/ + +bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) +{ + size_t idx = 0, respIndTableSize = 0; + respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); + for(idx=0; idx +#include "location_service_v02.h" //QMI LOC Service data types definitions +#include +#include + +/****************************************************************************** + * Constants and configuration + *****************************************************************************/ + +/** @addtogroup constants_macros +@{ */ + +/** Specific value of #locClientHandleType, indicating an invalid handle. */ +#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) + +/** @} */ /* end_addtogroup constants_macros */ + +/** @addtogroup data_types +@{ */ + +/** Location client handle used to represent a specific client. Negative values + are invalid handles. */ +typedef void* locClientHandleType; + +/** Data type for events and event masks. + @newpage */ +typedef uint64_t locClientEventMaskType; + +/** Location client status values. + @vertspace +*/ +typedef enum +{ + eLOC_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + eLOC_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + eLOC_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + eLOC_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 + /**< Failed because the service has not been initialized. */ + +}locClientStatusEnumType; + +/** Loc Client error values +*/ + +typedef enum +{ + eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 + /**< Service is no longer available, the client should + close the existing connection and reopen the connection + upon getting this error. + */ +}locClientErrorEnumType; + + +/** @} */ /* end_addtogroup data_types */ + +/** @addtogroup send_request +@{ */ + +/** @brief Request messages the client can send to the location engine. + + The following requests do not have any data associated, so they do not have a + payload structure defined: + + - GetServiceRevision + - GetFixCriteria + - GetPredictedOrbitsDataSource + - GetPredictedOrbitsDataValidity + - GetEngineLock + - GetSbasConfigReq + - GetRegisteredEvents + - GetNmeaTypes + - GetLowPowerMode + - GetXtraTSessionControl + - GetRegisteredEvents + - GetOperationMode + - GetCradleMountConfig + - GetExternalPowerConfig +*/ +typedef union +{ + const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; + /**< Notifies the service about the revision the client is using. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ + + const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; + /**< Changes the events the client is interested in receiving. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_REG_EVENTS_REQ_V02. */ + + const qmiLocStartReqMsgT_v02* pStartReq; + /**< Starts a positioning session. + + The client receives the following indications: position report, + satellite report, fix session report, and NMEA report (if applicable). + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_START_REQ_V02. */ + + const qmiLocStopReqMsgT_v02* pStopReq; + /**< Stops a positioning session. The client receives a fix session report + denoting that the fix session ended after this message was sent. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_STOP_REQ_V02. */ + + const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; + /**< Informs the service about the user response for a network-initiated call. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NI_USER_RESPONSE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ + + const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; + /**< Injects the predicted orbits data into the service. + + When all predicted orbits data parts have been injected, the client + receives the following indication containing a response: + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. + + The client injects successive data parts without waiting for this + indication as long as locClientSendReq() returns successfully. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ + + const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; + /**< Injects UTC time into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_UTC_TIME_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ + + const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; + /**< Injects a position into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_POSITION_REQ_V02. */ + + const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; + /**< Sets the location engine lock. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_ENGINE_LOCK_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ + + const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; + /**< Sets the SBAS configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SBAS_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ + + const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; + /**< Sets the NMEA types configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_NMEA_TYPES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ + + const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; + /**< Sets the Low Power mode configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ + + const qmiLocSetServerReqMsgT_v02* pSetServerReq; + /**< Sets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SERVER_REQ_V02. */ + + const qmiLocGetServerReqMsgT_v02* pGetServerReq; + /**< Gets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SERVER_REQ_V02. */ + + const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; + /**< Deletes the aiding data from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; + /**< Sets XTRA-T session control in the engine. If the request is accepted by + the service, the client receives the following indication containing a + response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ + + const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; + /**< Injects a WiFi position into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ + + const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; + /**< Notifies the engine about the WiFi status. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ + + const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; + /**< Sets the engine Operation mode. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_OPERATION_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ + + const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; + /**< Sends the stationary position status to the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SPI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SPI_STATUS_REQ_V02. */ + + const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; + /**< Injects sensor data into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ + + const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; + /**< Injects time synchronization information into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ + + const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; + /**< Sets the cradle mount state information in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + SET_CRADLE_MOUNT_CONFIG_REQ_V02. + + To send this request, set the reqId field in locClientSendReq() to + SET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; + /**< Sets external power configuration state in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ + + const qmiLocInformLocationServerConnStatusReqMsgT_v02* + pInformLocationServerConnStatusReq; + /**< Informs the engine about the connection status to the location server. + + This can be sent in response to a + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The + service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 + response indication for this request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ + + const qmiLocSetProtocolConfigParametersReqMsgT_v02* + pSetProtocolConfigParametersReq; + /**< Sets the protocol configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetProtocolConfigParametersReqMsgT_v02* + pGetProtocolConfigParametersReq; + /**< Retrieves protocol configuration parameters from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocSetSensorControlConfigReqMsgT_v02* + pSetSensorControlConfigReq; + /**< Sets the sensor control configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* + pSetSensorPerformanceControlConfigReq; + /**< Sets the sensor performance configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + @newpage */ + + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; + /**< Sets the sensor properties in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + @newpage */ + + const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; + /**< Injects a SUPL certificate into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; + /**< Deletes a SUPL certificate from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* + pSetPositionEngineConfigParametersReq; + /**< Sets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* + pGetPositionEngineConfigParametersReq; + /**< Gets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + +}locClientReqUnionType; + + +/** @brief Event indications that are sent by the service. +*/ +typedef union +{ + const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; + /**< Contains the position information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. If + periodic fix criteria is specified, this event is generated multiple + times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is + sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ + + const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; + /**< Contains the GNSS satellite information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. This event + is generated at 1 Hz if the location engine is tracking satellites to + make a location fix. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ + + const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; + /**< Contains an NMEA report sentence. The entire NMEA report consisting + of multiple sentences is sent at a 1Hz rate. + This event is generated after QMI_LOC_START_REQ_V02 is sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NMEA_IND_V02. */ + + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; + /**< Notifies a location client when the network triggers a positioning request + to the mobile. + + Upon getting this event, the location client displays the + network-initiated fix request in a dialog and prompts the user to accept + or deny the request. The client responds to this request with the message + QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ + + const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; + /**< Asks the client for time assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The eventIndId field in the event indication callback is + set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ + + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + pInjectPredictedOrbitsReqEvent; + /**< Asks the client for predicted orbits data assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ + + const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; + /**< Asks the client for position assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_POSITION_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ + + const qmiLocEventEngineStateIndMsgT_v02* pEngineState; + /**< Sent by the engine whenever it turns on or off. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ + + const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; + /**< Sent by the engine when a location session begins or ends. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ + + const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; + /**< Sent by the engine when it needs WiFi support. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ + + const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* + pSensorStreamingReadyStatusEvent; + /**< Notifies the client that the engine is ready to accept sensor data. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ + + const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; + /**< Sent by the engine when it needs to synchronize its time with the sensor + processor time. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ + + const qmiLocEventSetSpiStreamingReportIndMsgT_v02* + pSetSpiStreamingReportEvent; + /**< Asks the client to start/stop sending a Stationary Position Indicator + (SPI) stream. + + The eventIndId field in the event indication callback is set to + QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ + + const qmiLocEventLocationServerConnectionReqIndMsgT_v02* + pLocationServerConnReqEvent; + /**< Sent by the engine to ask the client to open or close a connection to + a location server. + + The client responds to this request by sending the + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. + @newpage */ + +}locClientEventIndUnionType; + + +/** @brief Response indications that are sent by the service. */ +typedef union +{ + const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; + /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ + + const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; + /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ + + const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; + /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NI_USER_RESPONSE_IND_V02. */ + + const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* + pInjectPredictedOrbitsDataInd; + /**< Sent after a predicted orbits data part has been successfully injected. + + The client waits for this indication before injecting the next part. + This indication is sent in response to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* + pGetPredictedOrbitsDataSourceInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* + pGetPredictedOrbitsDataValidityInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ + + const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; + /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_UTC_TIME_IND_V02. */ + + const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; + /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_POSITION_IND_V02. */ + + const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; + /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ + + const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; + /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ + + const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; + /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ + + const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; + /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ + + const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; + /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_NMEA_TYPES_IND_V02. */ + + const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; + /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NMEA_TYPES_IND_V02. */ + + const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; + /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; + /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocSetServerIndMsgT_v02* pSetServerInd; + /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SERVER_IND_V02. */ + + const qmiLocGetServerIndMsgT_v02* pGetServerInd; + /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVER_IND_V02. */ + + const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; + /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; + /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ + + const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; + /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ + + const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; + /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ + + const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; + /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_OPERATION_MODE_IND_V02. */ + + const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; + /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_OPERATION_MODE_IND_V02. */ + + const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; + /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SPI_STATUS_IND_V02. */ + + const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; + /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ + + const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; + /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ + + const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ + + const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocInformLocationServerConnStatusIndMsgT_v02* + pInformLocationServerConnStatusInd; + /**< Response to the request, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ + + const qmiLocSetProtocolConfigParametersIndMsgT_v02* + pSetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetProtocolConfigParametersIndMsgT_v02* + pGetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* + pSetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* + pGetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; + /**< Response to the request, + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; + /**< Response to the request, + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* + pSetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* + pGetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + +}locClientRespIndUnionType; + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup data_types +@{ */ + +/** Location event indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the asynchronous event indications. + + @vertspace + @param handle Location client for this event. Only the client who + registered for the corresponding event receives + this callback. + @param eventIndId ID of the event indication. + @param eventIndPayload Event indication payload. + @param pClientCookie Pointer to the cookie the client specified during + registration. +*/ +typedef void (*locClientEventIndCbType)( + locClientHandleType handle, + uint32_t eventIndId, + const locClientEventIndUnionType eventIndPayload, + void *pClientCookie +); + +/** Location response indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the response indications. + + @vertspace + @param handle Location client who sent the request for which this + response indication is generated. + @param respIndId ID of the response. It is the same value as the ID + of request sent to the engine. + @param respIndPayload Payload of the response indication. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @newpage +*/ +typedef void (*locClientRespIndCbType)( + locClientHandleType handle, + uint32_t respIndId, + const locClientRespIndUnionType respIndPayload, + void *pClientCookie +); + +/** Location error callback function type. This function will be + called to inform the client that the service is no longer + available. When the client receives this callback it must + close the existing connection and reopen the client connection. + + + @vertspace + @param handle Location client who sent the request for which this + error indication is generated. + @param errorId Error ID. + @param errorCbdata Payload associated with the error indication. + + @newpage +*/ +typedef void (*locClientErrorCbType)( + locClientHandleType handle, + locClientErrorEnumType errorId, + void* pClientCookie + ); + + +/** Callback functions to be registered during locClientOpen +*/ + +typedef struct +{ + uint32_t size; + /**< Size of the structure */ + locClientEventIndCbType eventIndCb; + /**< Event Indication callback */ + locClientRespIndCbType respIndCb; + /**< Response Indication callback */ + locClientErrorCbType errorCb; + /**< Error Indication callback */ +}locClientCallbacksType; + +/** @} */ /* end_addtogroup data_types */ + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** @addtogroup open_client +@{ */ +/*========================================================================== + locClientOpen */ +/** + @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location + client to the location engine. If the connection is successful, this function + returns a handle that the location client uses for future location operations. + + @datatype + #locClientStatusEnumType\n + #locClientEventMaskType\n + #locClientCallbacksType *\n + #locClientHandleType *\n + #void * + + @vertspace + @param[in] eventRegMask Mask of asynchronous events the client is + interested in receiving. + @param[in] pLocClientCallbacks Pointer to structure containing the + callbacks. + @param[out] pLocClientHandle Pointer to the handle to be used by the + client for any subsequent requests. + @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the + client along with the callbacks. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pLocClientCookie +); + +/** @} */ /* end_addtogroup open_client */ + +/** @addtogroup close_client +@{ */ +/*========================================================================== + locClientClose */ +/** + @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client + from the location engine and sets the handle to + LOC_CLIENT_INVALID_HANDLE_VALUE. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType + + @vertspace + @param[in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientClose ( + locClientHandleType* pLocClientHandle +); + +/** @} */ /* end_addtogroup close_client */ + +/** @addtogroup send_request +@{ */ +/*============================================================================= + locClientSendReq */ +/** + @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to + the location engine. If this function is successful, the client expects an + indication (except start, stop, event registration, and sensor injection + messages) through the registered callback in the locClientOpen() function. + + The indication contains the status of the request. If the status is a success, + the indication also contains the payload associated with response. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType\n + #locClientReqUnionType + + @vertspace + @param[in] handle Handle returned by the locClientOpen() function. + @param[in] reqId QMI_LOC service message ID of the request. + @param[in] pReqPayload Payload of the request. This can be NULL if the request + has no payload. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + + @structure + locClientReqUnionType + @newpage +*/ +extern locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload +); + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup get_size_event +@{ */ +/*============================================================================= + locClientGetSizeByEventIndId */ +/** + Gets the size of the event indication structure from a specified ID. + + @datatype + #locClientGetSizeByEventIndId + + @vertspace + @param[in] eventIndId Event indicator ID. + @param[out] pEventIndSize Pointer to the size of the structure. + + @return + true -- The event ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientEventIndUnionType + @newpage +*/ +extern bool locClientGetSizeByEventIndId( + uint32_t eventIndId, + size_t *pEventIndSize); + +/** @} */ /* end_addtogroup get_size_event */ + +/** @addtogroup get_size_response +@{ */ +/*============================================================================= + locClientGetSizeByRespIndId */ + +/** + Gets the size of the response indication structure from a specified ID. + + @datatype + #locClientGetSizeByRespIndId + + @vertspace + @param[in] respIndId Response indicator ID. + @param[out] pRespIndSize Pointer to the size of the structure. + + @return + true -- The response ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientRespIndUnionType + @newpage +*/ +extern bool locClientGetSizeByRespIndId( + uint32_t respIndId, + size_t *pRespIndSize); + +/*=============================================================================*/ + +/** @} */ /* end_addtogroup get_size_response */ + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c new file mode 100755 index 00000000..78792607 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -0,0 +1,243 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static loc_name_val_s_type loc_v02_event_name[] = +{ + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_START_REQ_V02), + NAME_VAL(QMI_LOC_START_RESP_V02), + NAME_VAL(QMI_LOC_STOP_REQ_V02), + NAME_VAL(QMI_LOC_STOP_RESP_V02), + NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), +}; +static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_event_name(uint32_t event) +{ + return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); +} + +static loc_name_val_s_type loc_v02_client_status_name[] = +{ + NAME_VAL(eLOC_CLIENT_SUCCESS), + NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), + NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), + NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), + NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), + NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), + NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), +}; +static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_client_status_name(locClientStatusEnumType status) +{ + return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); +} + + +static loc_name_val_s_type loc_v02_qmi_status_name[] = +{ + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, + eQMI_LOC_SUCCESS_V02, + eQMI_LOC_GENERAL_FAILURE_V02, + eQMI_LOC_UNSUPPORTED_V02, + eQMI_LOC_INVALID_PARAMETER_V02, + eQMI_LOC_ENGINE_BUSY_V02, + eQMI_LOC_PHONE_OFFLINE_V02, + eQMI_LOC_TIMEOUT_V02, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 +}; +static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) +{ + return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); +} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h new file mode 100755 index 00000000..c63972f9 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V02_LOG_H +#define LOC_API_V02_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_v02_event_name(uint32_t event); +const char* loc_get_v02_client_status_name(locClientStatusEnumType status); +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); + + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h new file mode 100755 index 00000000..f1b675e3 --- /dev/null +++ b/loc_api/loc_api_v02/loc_util_log.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_UTIL_LOG_H +#define LOC_UTIL_LOG_H + +#ifdef FEATURE_LOC_API_V02_QNX_MOD +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#endif //FEATURE_LOC_API_V02_QNX_MOD + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +#include + +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +// get around strl*: not found in glibc +// TBD:look for presence of eglibc other libraries +// with strlcpy supported. +#define strlcpy(X,Y,Z) strcpy(X,Y) +#define strlcat(X,Y,Z) strcat(X,Y) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#elif defined(_ANDROID_) + +#include + +#endif //LOC_UTIL_TARGET_OFF_TARGET + + +#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c new file mode 100755 index 00000000..37d93f6f --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -0,0 +1,2223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 7, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 8, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 9, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 11, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 11, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 4, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 18, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 26, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 0, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 2, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 3, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 13, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 15, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 17, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 19, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 13, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 17, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 20, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 22, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 23, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 24, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 25, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 27, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 27, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 28, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, + {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} +}; + +/*Service Object*/ +const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x02, + 0x02, + 16, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02 +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h new file mode 100755 index 00000000..2f288145 --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -0,0 +1,5914 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x04 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x02 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x005F; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of SUPL CERT. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. \n + - Type: Unsigned integer */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyrometer, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from + the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. + These requests are generated when the service wishes to establish a + connection with a location server. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: \n + + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. + Request a single position fix. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. + High accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. + Intermediate reports are turned off. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Type: Unsigned integer \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n + - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Type: Unsigned integer \n + - Units: Milliseconds \n + - Default: 1000 ms + */ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. + Fix request failed because the engine is locked. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Type: Unsigned integer \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n + - PDOP = square root of (HDOP^2 + VDOP^2) */ + + float HDOP; + /**< Horizontal dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + + float VDOP; + /**< Vertical dilution of precision.\n + - Type: Floating point. \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors are used. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- SENSOR_USED_ACCEL \n + - 0x00000002 -- SENSOR_USED_GYRO */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results are aided by sensors. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network + Source of the time is unknown */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed + Location reliability is high; strong cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This message is used to send the position report to the + control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \n + - 0x00000000 -- SESS_STATUS_SUCCESS \n + - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n + - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n + - 0x00000003 -- SESS_STATUS_TIMEOUT \n + - 0x00000004 -- SESS_STATUS_USER_END \n + - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n + - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n + - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). \n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Type: Floating point \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< Speed uncertainty.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH */ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. \n + - Type: Floating point */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \n + - 0x00000001 -- SATELLITE \n + - 0x00000002 -- CELLID \n + - 0x00000004 -- WIFI */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time \n */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Type: Floating point \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \n + - 0x00000000 -- TIME_SRC_INVALID \n + - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n + - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n + - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n + - 0x00000004 -- TIME_SRC_TOW_DECODE \n + - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n + - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n + - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n + - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. + GLONASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. + SV is being tracked. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \n + - 0x00000001 -- VALID_SYSTEM \n + - 0x00000002 -- VALID_GNSS_SVID \n + - 0x00000004 -- VALID_HEALTH_STATUS \n + - 0x00000008 -- VALID_PROCESS_STATUS \n + - 0x00000010 -- VALID_SVINFO_MASK \n + - 0x00000020 -- VALID_ELEVATION \n + - 0x00000040 -- VALID_AZIMUTH \n + - 0x00000080 -- VALID_SNR + + */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + uint16_t gnssSvId; + /**< GNSS SV ID. \n + + - Type: Unsigned integer \n + - Range: \n + -- For GPS: 1 to 32 \n + -- For SBAS: 33 to 64 \n + -- For GLONASS: 65 to 96 */ + + uint8_t healthStatus; + /**< Health status. \n + - Type: Unsigned integer \n + - Range: 0 = unhealthy; 1 = healthy */ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Type: Floating point \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Altitude assumed or calculated:\n + - 0x00 (FALSE) -- Valid altitude is calculated \n + - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough + satellites to determine precise altitude */ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send NMEA sentences to the control point. */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 201 */ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. + Notify and Verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. + MS-based preferred, but MS-assisted allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. + Encoding is GSM. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Type: Unsigned integer \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. \n + - Type: Unsigned integer */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Type: Unsigned integer \n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \n + - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n + - 0x00000002 -- NI_VX_MS_BASED_ONLY \n + - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n + - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \n + - 0x00000000 -- NI_VX_OCTET \n + - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n + - 0x00000002 -- NI_VX_ASCII \n + - 0x00000003 -- NI_VX_IA5 \n + - 0x00000004 -- NI_VX_UNICODE \n + - 0x00000005 -- NI_VX_SHIFT_JIS \n + - 0x00000006 -- NI_VX_KOREAN \n + - 0x00000007 -- NI_VX_LATIN_HEBREW \n + - 0x00000008 -- NI_VX_LATIN \n + - 0x00000009 -- NI_VX_GSM + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. + No position. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. + Encoding is GSM default. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity + SUPL unknown format. */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \n + - 0x00000000 -- FORMAT_LOGICAL_NAME \n + - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n + - 0x00000002 -- FORMAT_MSISDN \n + - 0x00000003 -- FORMAT_URL \n + - 0x00000004 -- FORMAT_SIP_URL \n + - 0x00000005 -- FORMAT_MIN \n + - 0x00000006 -- FORMAT_MDN \n + - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n + - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID */ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. \n + - Type: Unsigned integer */ + + uint16_t port; + /**< IPV4 port. \n + - Type: Unsigned integer */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. \n + - Type: Unsigned integer */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \n + - 0x00000001 -- SUPL_SERVER_INFO \n + - 0x00000002 -- SUPL_SESSION_ID \n + - 0x00000004 -- SUPL_HASH \n + - 0x00000008 -- SUPL_POS_METHOD \n + - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n + - 0x00000020 -- SUPL_REQUESTOR_ID \n + - 0x00000040 -- SUPL_CLIENT_NAME \n + - 0x00000080 -- SUPL_QOP \n + - 0x00000100 -- SUPL_USER_RESP_TIMER + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \n + - 0x00000001 -- AGPS_SETASSISTED \n + - 0x00000002 -- AGPS_SETBASED \n + - 0x00000003 -- AGPS_SETASSISTED_PREF \n + - 0x00000004 -- AGPS_SETBASED_PREF \n + - 0x00000005 -- AUTONOMOUS_GPS \n + - 0x00000006 -- AFLT \n + - 0x00000007 -- ECID \n + - 0x00000008 -- EOTD \n + - 0x00000009 -- OTDOA \n + - 0x0000000A -- NO_POSITION + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. + Initial location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \n + - 0x0001 -- INVOKE_ID_MASK \n + - 0x0002 -- DATA_CODING_SCHEME_MASK \n + - 0x0004 -- NOTIFICATION_TEXT_MASK \n + - 0x0008 -- CLIENT_ADDRESS_MASK \n + - 0x0010 -- LOCATION_TYPE_MASK \n + - 0x0020 -- REQUESTOR_ID_MASK \n + - 0x0040 -- CODEWORD_STRING_MASK \n + - 0x0080 -- SERVICE_TYPE_MASK \n + - 0x0100 -- USER_RESP_TIMER_MASK + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. \n + - Type: Unsigned integer */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \n + - 0x00000001 -- CURRENT_LOCATION \n + - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n + - 0x00000004 -- INITIAL_LOCATION + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. \n + - Type: Unsigned integer */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \n + - 0x00000001 -- ONGOING_NI_INCOMING_MO + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). \n + - Type: Unsigned integer */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). \n + - Type: Unsigned integer */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp.\n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. + Location engine is off. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. + Location fix session has ended. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. + Stop periodic fixes request. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \n + - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n + - 0x00000001 -- START_PERIODIC_KEEP_WARM \n + - 0x00000002 -- STOP_PERIODIC_FIXES + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \n + + samplesPerBatch must be a non-zero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in integral number of batches per + second (Hz). \n + + batchesPerSecond must be a non-zero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \n + - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n + - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor + data + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyrometer Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor + data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. \n + - Type: Unsigned integer */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream.\n + - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n + - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. + Bring up the WWAN type used for AGNSS connections. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. + Close a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. \n + Valid values: \n + - 0x00000000 -- WWAN_TYPE_INTERNET \n + - 0x00000001 -- WWAN_TYPE_AGNSS + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. + Request failed because it timed out. */ + eQMI_LOC_TIMEOUT_V02 = 6, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. \n + - Type: Unsigned integer */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n + - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. \n + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Mimimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. + User did not respond to notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \n + - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n + - 0x00000002 -- NOTIFY_VERIFY_DENY \n + - 0x00000003 -- NOTIFY_VERIFY_NORESP + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Type: Unsigned integer \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \n + - 0x00000000 -- PREDICTED_ORBITS_XTRA + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. \n + - Type: Unsigned integer */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Oribits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Type: Unsigned integer \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Type: Unsigned integer \n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. + Other sources. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. + Fully independent. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. + Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \n + - 0x00000000 -- ALT_SRC_UNKNOWN \n + - 0x00000001 -- ALT_SRC_GPS \n + - 0x00000002 -- ALT_SRC_CELL_ID \n + - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n + - 0x00000004 -- ALT_SRC_WIFI \n + - 0x00000005 -- ALT_SRC_TERRESTRIAL \n + - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n + - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n + - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n + - 0x00000009 -- ALT_SRC_OTHER + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \n + - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n + - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n + - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n + - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \n + - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n + - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the + injected horizontal position coordinates only. \n + - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the + position of the device regardless of horizontal position + (within the horizontal uncertainty region, if provided). + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. + Other sources. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0 to 99) \n + - 0 -- invalid value \n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99 \n + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters; positive = height, negative = depth */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0-99) \n + - 0 -- invalid value\n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99\n + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Type: Signed integer \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from where this position was obtained. + Valid values: \n + - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n + - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n + - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n + - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n + - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n + - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n + - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n + + If altitude is specified and altitude source is not specified, the engine + assumes that altitude was obtained using the specified Position source. + If altitude and altitude source both are specified then the engine assumes + that only latitude, longitude were obtained using the specified Position + Source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. + Lock all position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. + Server type is custom PDE. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. \n + - Type: Unsigned integer \n + - Range: \n + - For GPS: 1 to 32 \n + - For SBAS: 33 to 64 \n + - For GLONASS: 65 to 96 */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + Valid values: \n + - 0x01 (TRUE) -- All assistance data is to be deleted; + if this flag is set, all the other information + contained in the optional fields for this + message are ignored \n + - 0x00 (FALSE) -- The optional fields in the message are to be used + to determine which data is to be deleted */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assitance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + Valid values: \n + - 0x00000001 -- DELETE_GPS_SVDIR \n + - 0x00000002 -- DELETE_GPS_SVSTEER \n + - 0x00000004 -- DELETE_GPS_TIME\n + - 0x00000008 -- DELETE_GPS_ALM_CORR \n + - 0x00000010 -- DELETE_GLO_SVDIR \n + - 0x00000020 -- DELETE_GLO_SVSTEER \n + - 0x00000040 -- DELETE_GLO_TIME \n + - 0x00000080 -- DELETE_GLO_ALM_CORR \n + - 0x00000100 -- DELETE_SBAS_SVDIR \n + - 0x00000200 -- DELETE_SBAS_SVSTEER \n + - 0x00000400 -- DELETE_POSITION \n + - 0x00000800 -- DELETE_TIME \n + - 0x00001000 -- DELETE_IONO \n + - 0x00002000 -- DELETE_UTC \n + - 0x00004000 -- DELETE_HEALTH \n + - 0x00008000 -- DELETE_SADATA \n + - 0x00010000 -- DELETE_RTI \n + - 0x00020000 -- DELETE_SV_NO_EXIST \n + - 0x00040000 -- DELETE_FREQ_BIAS_EST + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CELLDB_POS \n + - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n + - 0x00000004 -- DELETE_CELLDB_OTA_POS \n + - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n + - 0x00000010 -- DELETE_CELLDB_TIMETAG \n + - 0x00000020 -- DELETE_CELLDB_CELLID \n + - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n + - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n + - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n + - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n + - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n + - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n + - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n + - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n + - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n + - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n + - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n + - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n + - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n + - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. \n + - Type: Unsigned integer */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. + WiFi fix failed, but the cause could not be determined. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. \n + - Type: Unsigned integer */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \n + - 0x00000000 -- ERROR_SUCCESS \n + - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n + - 0x00000002 -- ERROR_NO_AP_FOUND \n + - 0x00000003 -- ERROR_UNAUTHORIZED \n + - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n + - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n + - 0x00000006 -- ERROR_UNKNOWN + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Type: Signed integer \n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. \n + - Type: Unsigned integer */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. \n + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. + WiFi is not available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \n + - 0x00000001 -- WIFI_STATUS_AVAILABLE \n + - 0x00000002 -- WIFI_STATUS_UNAVAILABLE + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + + Valid bitmasks: \n + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. + Use cell ID. For 1x, this mode corresponds to + AFLT. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary:\n + - 0x00 (FALSE) -- Device is not stationary \n + - 0x01 (TRUE) -- Device is stationary */ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the sensor time of the first sample.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit time tag of the first (oldest) sample in this + message. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \n + - 0x01 -- SIGN REVERSAL + */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyrometer Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyrometer sensor samples. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< This field lets the client know how many 3-axis accelerometer samples + were accepted. */ + + /* Optional */ + /* Gyrometer Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< This field lets the client know how many 3-axis gyrometer samples were + accepted. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< The value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< The value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle + Unknown cradle mount state */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. + Unknown external power state. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. + PPP PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the Access Point Name (APN) profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 101 + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. + Location server request failed. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n APN profile information is present only when requestType + is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. + V2 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. + SUPL version 2.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< This field is sent only if the status is not a success. And if it is + not successful, this field will identify the parameters that were not + set successfully. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + + Inertial sensors are not to be used to aid heading and position + improvement. */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in heading and + position improvement. + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in the heading and + position improvement. + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/second^4 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPropertiesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/seconds^4 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors + Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal + number of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< This field is sent only if the status is not a success. + When sent, this field identifies which configuration failed. \n + Valid bitmasks: \n + - 0x0000000000000001 -- PERFORMANCE_MODE \n + - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n + - 0x0000000000000004 -- GYRO_SAMPLING_SPEC + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Id */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate + Type: Unsigned Integer + Units: Bytes + Range: 0-9 */ + + /* Mandatory */ + /* SUPL certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< The supl Certificate contents + Type: Array of bytes. + - Maximum certificate size : 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* Supl Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the inject SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Delete a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate Id */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate to be deleted + Type: Unsigned Integer \n + Units: Bytes \n + Range: 0-9 \n + If suplCertId is not specified then + "all" supl certificates will be deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Delete a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL certifcate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the delete SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the + injected position in direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data + in the persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position will be used in position engine.\n + Valid values: \n + - 0x01 (TRUE) -- Use the injected position in direct position + calculation. \n + - 0x00 (FALSE) -- Do not use the injected position in direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls if SV usage will be filtered in a position fix. + Valid values:\n + - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n + - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data should be stored in + the persistent memory. \n + Valid values:\n + - 0x01 (TRUE) -- Store assistance data in persistent memory. \n + - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies if the injected position is used for direct calculation + in the position engine.\n + Valid values: \n + - 0x01 (TRUE) -- The injected position is used in direct position + calculation. \n + - 0x00 (FALSE) -- The injected position is not used direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies if SV usage is filtered in a position fix. + Valid values: \n + - 0x01 (TRUE) -- SV usage is filtered in the fix. \n + - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies if assistance data is stored in the persistent memory. \n + Valid values: \n + 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n + 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h new file mode 100755 index 00000000..6321bb9c --- /dev/null +++ b/loc_api/ulp/inc/ulp.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define ULP_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +typedef int (ulp_report_position_cb) +( + void* owner, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data +); + +/** Represents the standard ulp module interface. */ +typedef struct { + /** set to sizeof(ulpInterface) */ + size_t size; + + /** + * Starts the ulp module. 0: success + */ + int (*init)( void* owner, ulp_report_position_cb* cb); + + /** Starts the ulp engine. 0: success */ + int (*start_fix)( void ); + + /** Stops the ulp engine. 0: success */ + int (*stop_fix)( void ); + + /** Closes the interface */ + int (*destroy)( void ); + +} ulpInterface; + +typedef const ulpInterface* (get_ulp_interface) (void); + + +#ifdef __cplusplus +} +#endif +#endif /* ULP_H */ + diff --git a/utils/Android.mk b/utils/Android.mk new file mode 100755 index 00000000..7ce454f8 --- /dev/null +++ b/utils/Android.mk @@ -0,0 +1,45 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +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 + +LOCAL_SRC_FILES += \ + loc_log.cpp \ + loc_cfg.cpp \ + msg_q.c \ + linked_list.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +## Includes +LOCAL_C_INCLUDES:= + +LOCAL_COPY_HEADERS_TO:= gps.utils/ +LOCAL_COPY_HEADERS:= \ + loc_log.h \ + loc_cfg.h \ + log_util.h \ + linked_list.h \ + msg_q.h + +LOCAL_MODULE := libgps.utils + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRELINK_MODULE := false + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) +include $(BUILD_SHARED_LIBRARY) +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE + diff --git a/utils/linked_list.c b/utils/linked_list.c new file mode 100755 index 00000000..16f2aa22 --- /dev/null +++ b/utils/linked_list.c @@ -0,0 +1,328 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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_LOGD("%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_LOGD("%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_LOGD("%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/utils/linked_list.h b/utils/linked_list.h new file mode 100755 index 00000000..cfc945a7 --- /dev/null +++ b/utils/linked_list.h @@ -0,0 +1,217 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/utils/loc_cfg.cpp b/utils/loc_cfg.cpp new file mode 100755 index 00000000..de960788 --- /dev/null +++ b/utils/loc_cfg.cpp @@ -0,0 +1,272 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +/*============================================================================= + * + * GLOBAL DATA DECLARATION + * + *============================================================================*/ + +/* Parameter data */ +loc_gps_cfg_s_type gps_conf; + +/* Parameter spec table */ + +loc_param_s_type loc_parameter_table[] = +{ + {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, 'n'}, + {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, 'n'}, + {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, 'n'}, + /* DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info + 4 - Debug, 5 - Verbose */ + {"DEBUG_LEVEL", &gps_conf.DEBUG_LEVEL, 'n'}, + {"SUPL_VER", &gps_conf.SUPL_VER, 'n'}, + {"CAPABILITIES", &gps_conf.CAPABILITIES, 'n'}, + {"TIMESTAMP", &gps_conf.TIMESTAMP, 'n'}, + {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, 'f'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, 'n'}, + {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, 'n'}, + {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, 'n'}, +}; + +int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); + +/*=========================================================================== +FUNCTION loc_default_parameters + +DESCRIPTION + Resets the parameters to default + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ + +static void loc_default_parameters() +{ + /* defaults */ + gps_conf.INTERMEDIATE_POS = 0; + gps_conf.ACCURACY_THRES = 0; + gps_conf.ENABLE_WIPER = 0; + gps_conf.DEBUG_LEVEL = 3; /* debug level */ + gps_conf.SUPL_VER = 0x10000; + gps_conf.CAPABILITIES = 0x7; + gps_conf.TIMESTAMP = 0; + + gps_conf.GYRO_BIAS_RANDOM_WALK = 0; + + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + gps_conf.SENSOR_USAGE = 0; /* Enabled */ + + /* Value MUST be set by OEMs in configuration for sensor-assisted + navigation to work. There is NO default value */ + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + + /* reset logging mechanism */ + loc_logger_init(gps_conf.DEBUG_LEVEL, 0); +} + +/*=========================================================================== +FUNCTION trim_space + +DESCRIPTION + Removes leading and trailing spaces of the string + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void trim_space(char *org_string) +{ + char *scan_ptr, *write_ptr; + char *first_nonspace = NULL, *last_nonspace = NULL; + + scan_ptr = write_ptr = org_string; + + while (*scan_ptr) + { + if ( !isspace(*scan_ptr) && first_nonspace == NULL) + { + first_nonspace = scan_ptr; + } + + if (first_nonspace != NULL) + { + *(write_ptr++) = *scan_ptr; + if ( !isspace(*scan_ptr)) + { + last_nonspace = write_ptr; + } + } + + scan_ptr++; + } + + if (last_nonspace) { *last_nonspace = '\0'; } +} + +/*=========================================================================== +FUNCTION loc_read_gps_conf + +DESCRIPTION + Reads the gps.conf file and sets global parameter data + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void loc_read_gps_conf(void) +{ + FILE *gps_conf_fp = NULL; + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + char *lasts; + char *param_name, *param_str_value; + int param_int_value = 0; + double param_double_value = 0; + int i; + + loc_default_parameters(); + + if((gps_conf_fp = fopen(GPS_CONF_FILE, "r")) != NULL) + { + LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE); + } + else + { + LOC_LOGW("%s: no %s file, using defaults", __FUNCTION__, GPS_CONF_FILE); + return; /* no parameter file */ + } + + while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) + { + /* Separate variable and value */ + param_name = strtok_r(input_buf, "=", &lasts); + if (param_name == NULL) continue; /* skip lines that do not contain "=" */ + param_str_value = strtok_r(NULL, "=", &lasts); + if (param_str_value == NULL) continue; /* skip lines that do not contain two operands */ + + /* Trim leading and trailing spaces */ + trim_space(param_name); + trim_space(param_str_value); + + // printf("*(%s) = (%s)\n", param_name, param_str_value); + + /* Parse numerical value */ + if (param_str_value[0] == '0' && tolower(param_str_value[1]) == 'x') + { + /* hex */ + param_int_value = (int) strtol(¶m_str_value[2], (char**) NULL, 16); + } + else { + param_double_value = (double) atof(param_str_value); /* float */ + param_int_value = atoi(param_str_value); /* dec */ + } + + if (strcmp("GYRO_BIAS_RANDOM_WALK", param_name) == 0) + { + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 1; + } + + for(i = 0; i < loc_param_num; i++) + { + if (strcmp(loc_parameter_table[i].param_name, param_name) == 0 && + loc_parameter_table[i].param_ptr) + { + switch (loc_parameter_table[i].param_type) + { + case 's': + if (strcmp(param_str_value, "NULL") == 0) + { + *((char*)loc_parameter_table[i].param_ptr) = '\0'; + } + else { + strlcpy((char*) loc_parameter_table[i].param_ptr, + param_str_value, + LOC_MAX_PARAM_STRING + 1); + } + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, param_name, (char*)loc_parameter_table[i].param_ptr); + break; + case 'n': + *((int *)loc_parameter_table[i].param_ptr) = param_int_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, param_name, param_int_value); + break; + case 'f': + *((double *)loc_parameter_table[i].param_ptr) = param_double_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, param_name, param_double_value); + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n or n", __FUNCTION__, param_name); + } + } + } + } + + fclose(gps_conf_fp); + + /* Initialize logging mechanism with parsed data */ + loc_logger_init(gps_conf.DEBUG_LEVEL, gps_conf.TIMESTAMP); +} diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h new file mode 100755 index 00000000..ffeb83c4 --- /dev/null +++ b/utils/loc_cfg.h @@ -0,0 +1,98 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_MAX_PARAM_NAME 36 +#define LOC_MAX_PARAM_STRING 80 +#define LOC_MAX_PARAM_LINE 80 + +// Don't want to overwrite the pre-def'ed value +#ifndef GPS_CONF_FILE +#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent +#endif + +/*============================================================================= + * + * MODULE TYPE DECLARATION + * + *============================================================================*/ +typedef struct +{ + char param_name[LOC_MAX_PARAM_NAME]; + void *param_ptr; + char param_type; /* 'n' for number; 's' for string */ +} loc_param_s_type; + +/* GPS.conf support */ +typedef struct loc_gps_cfg_s +{ + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long ENABLE_WIPER; + unsigned long DEBUG_LEVEL; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + unsigned long TIMESTAMP; + unsigned long GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + // char string_val[LOC_MAX_PARAM_STRING + 1]; /* An example string value */ +} loc_gps_cfg_s_type; + +/*============================================================================= + * + * MODULE EXTERNAL DATA + * + *============================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern loc_gps_cfg_s_type gps_conf; + +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +extern void loc_read_gps_conf(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_CFG_H */ diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp new file mode 100755 index 00000000..e4fb76c4 --- /dev/null +++ b/utils/loc_log.cpp @@ -0,0 +1,183 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +// 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"; + +/* Logging Mechanism */ +loc_logger_s_type loc_logger; + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) +{ + int 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(loc_name_val_s_type table[], int table_size, long value) +{ + int i; + for (i = 0; i < table_size; i++) + { + if (table[i].val == (long) value) + { + return table[i].name; + } + } + return UNKNOWN_STR; +} + +static 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 int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); + +/* 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"; +} + + +/*=========================================================================== + +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, unsigned long 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; + 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/utils/loc_log.h b/utils/loc_log.h new file mode 100755 index 00000000..8b071a48 --- /dev/null +++ b/utils/loc_log.h @@ -0,0 +1,66 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +typedef struct +{ + char name[128]; + 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)) + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); +const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); +const char* loc_get_msg_q_status(int status); + +extern const char* log_succ_fail_string(int is_succ); + +extern char *loc_get_time(char *time_string, unsigned long buf_size); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_LOG_H */ diff --git a/utils/log_util.h b/utils/log_util.h new file mode 100755 index 00000000..15d0b892 --- /dev/null +++ b/utils/log_util.h @@ -0,0 +1,151 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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__ + +#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[]; +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +extern void loc_logger_init(unsigned long debug, unsigned long timestamp); +extern char* get_timestamp(char* str, unsigned long buf_size); + + +#include + +#ifndef DEBUG_DMN_LOC_API + +/* LOGGING MACROS */ +#define LOC_LOGE(...) ALOGE("E/"__VA_ARGS__) + +#define LOC_LOGW(...) \ +if (loc_logger.DEBUG_LEVEL >= 2) { ALOGE("W/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGW("W/"__VA_ARGS__); } + +#define LOC_LOGI(...) \ +if (loc_logger.DEBUG_LEVEL >= 3) { ALOGE("I/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("W/"__VA_ARGS__); } + +#define LOC_LOGD(...) \ +if (loc_logger.DEBUG_LEVEL >= 4) { ALOGE("D/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("W/"__VA_ARGS__); } + +#define LOC_LOGV(...) \ +if (loc_logger.DEBUG_LEVEL >= 5) { ALOGE("V/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__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 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 ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") +#define EXIT_LOG(SPEC, VAL) 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/utils/msg_q.c b/utils/msg_q.c new file mode 100755 index 00000000..252921ef --- /dev/null +++ b/utils/msg_q.c @@ -0,0 +1,322 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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_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_LOGD("%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_LOGD("%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_LOGD("%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_LOGD("%s: Received message %p 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/utils/msg_q.h b/utils/msg_q.h new file mode 100755 index 00000000..4171540a --- /dev/null +++ b/utils/msg_q.h @@ -0,0 +1,189 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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: State of message queue to be initialized. + +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_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__ */ From a2fc84b21943cff412bf7faf42ec99571b9ce895 Mon Sep 17 00:00:00 2001 From: Anup Dasari Date: Tue, 10 Jul 2012 22:35:56 +0530 Subject: [PATCH 033/945] Add optional flag in make file Change-Id: I099cd597c77641bdf2a98732f87484ec6d70f9a9 --- loc_api/libloc_api/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index 1fd409f5..df2ff2d0 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -11,6 +11,8 @@ include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_TAGS := optional + LOCAL_STATIC_LIBRARIES:= \ libloc_api-rpc From 3c2630ef2aa770721337a7471fcd4f4ab759cbcb Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 12 Jul 2012 18:31:41 -0700 Subject: [PATCH 034/945] gps: initial merge to jb based from AU_LINUX_ANDROID_ICS.04.00.01.00.007 with qcom enhanced features flagged out Change-Id: I2bc03fe4447047fd7c9a7d000040dadb8bb34647 --- loc_api/Android.mk | 26 +- loc_api/libloc_api-rpc-50001/Android.mk | 3 + .../libloc_api-rpc-glue/Android.mk | 59 + .../rpc_inc/LocApiRpcAdapter.h | 102 + .../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 + .../src/LocApiRpcAdapter.cpp | 1225 ++++ .../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 | 621 ++ .../src/loc_api_sync_call.c | 510 ++ .../src/loc_apicb_appinit.c | 86 + .../libloc_api-rpc-stub/Android.mk | 35 + .../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 +++ loc_api/libloc_api-rpc/Android.mk | 11 +- loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 9 - .../gen-1240/loc_api_rpc_glue.c | 18 +- loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 9 - .../gen-3200/loc_api_rpc_glue.c | 18 +- loc_api/libloc_api-rpc/inc/debug.h | 6 +- loc_api/libloc_api/Android.mk | 12 +- loc_api/libloc_api/gps.c | 56 +- loc_api/libloc_api/loc_eng.cpp | 154 +- loc_api/libloc_api/loc_eng.h | 60 +- loc_api/libloc_api/loc_eng_ioctl.cpp | 84 +- loc_api/libloc_api/loc_eng_ioctl.h | 62 +- loc_api/libloc_api/loc_eng_ni.cpp | 102 +- loc_api/libloc_api/loc_eng_ni.h | 55 +- loc_api/libloc_api/loc_eng_xtra.cpp | 73 +- loc_api/libloc_api/loc_eng_xtra.h | 60 +- loc_api/libloc_api_50001/Android.mk | 131 + loc_api/libloc_api_50001/LocApiAdapter.cpp | 196 + loc_api/libloc_api_50001/LocApiAdapter.h | 205 + loc_api/libloc_api_50001/gps.c | 68 + loc_api/libloc_api_50001/loc.cpp | 870 +++ loc_api/libloc_api_50001/loc.h | 86 + loc_api/libloc_api_50001/loc_eng.cpp | 1838 +++++ loc_api/libloc_api_50001/loc_eng.h | 204 + loc_api/libloc_api_50001/loc_eng_agps.cpp | 702 ++ loc_api/libloc_api_50001/loc_eng_agps.h | 274 + loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 180 + loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 53 + .../loc_eng_dmn_conn_glue_msg.c | 223 + .../loc_eng_dmn_conn_glue_msg.h | 51 + .../loc_eng_dmn_conn_glue_pipe.c | 206 + .../loc_eng_dmn_conn_glue_pipe.h | 50 + .../loc_eng_dmn_conn_handler.cpp | 78 + .../loc_eng_dmn_conn_handler.h | 82 + .../loc_eng_dmn_conn_thread_helper.c | 398 ++ .../loc_eng_dmn_conn_thread_helper.h | 74 + loc_api/libloc_api_50001/loc_eng_log.cpp | 292 + loc_api/libloc_api_50001/loc_eng_log.h | 62 + loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 + loc_api/libloc_api_50001/loc_eng_msg.h | 584 ++ loc_api/libloc_api_50001/loc_eng_msg_id.h | 90 + loc_api/libloc_api_50001/loc_eng_ni.cpp | 313 + loc_api/libloc_api_50001/loc_eng_ni.h | 50 + loc_api/libloc_api_50001/loc_eng_xtra.cpp | 90 + loc_api/libloc_api_50001/loc_eng_xtra.h | 46 + loc_api/loc_api_v02/Android.mk | 43 + loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2056 ++++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 197 + loc_api/loc_api_v02/loc_api_sync_req.c | 548 ++ loc_api/loc_api_v02/loc_api_sync_req.h | 68 + loc_api/loc_api_v02/loc_api_v02_client.c | 1867 ++++++ loc_api/loc_api_v02/loc_api_v02_client.h | 1255 ++++ loc_api/loc_api_v02/loc_api_v02_log.c | 243 + loc_api/loc_api_v02/loc_api_v02_log.h | 50 + loc_api/loc_api_v02/loc_util_log.h | 81 + loc_api/loc_api_v02/location_service_v02.c | 2223 +++++++ loc_api/loc_api_v02/location_service_v02.h | 5914 +++++++++++++++++ loc_api/ulp/inc/ulp.h | 76 + utils/Android.mk | 45 + utils/linked_list.c | 328 + utils/linked_list.h | 217 + utils/loc_cfg.cpp | 272 + utils/loc_cfg.h | 98 + utils/loc_log.cpp | 183 + utils/loc_log.h | 66 + utils/log_util.h | 151 + utils/msg_q.c | 322 + utils/msg_q.h | 189 + 98 files changed, 33961 insertions(+), 422 deletions(-) create mode 100755 loc_api/libloc_api-rpc-50001/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr create mode 100755 loc_api/libloc_api_50001/Android.mk create mode 100755 loc_api/libloc_api_50001/LocApiAdapter.cpp create mode 100755 loc_api/libloc_api_50001/LocApiAdapter.h create mode 100755 loc_api/libloc_api_50001/gps.c create mode 100755 loc_api/libloc_api_50001/loc.cpp create mode 100755 loc_api/libloc_api_50001/loc.h create mode 100755 loc_api/libloc_api_50001/loc_eng.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng.h create mode 100755 loc_api/libloc_api_50001/loc_eng_agps.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_agps.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c create mode 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h create mode 100755 loc_api/libloc_api_50001/loc_eng_log.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_log.h create mode 100755 loc_api/libloc_api_50001/loc_eng_msg.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_msg.h create mode 100755 loc_api/libloc_api_50001/loc_eng_msg_id.h create mode 100755 loc_api/libloc_api_50001/loc_eng_ni.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_ni.h create mode 100755 loc_api/libloc_api_50001/loc_eng_xtra.cpp create mode 100755 loc_api/libloc_api_50001/loc_eng_xtra.h create mode 100755 loc_api/loc_api_v02/Android.mk create mode 100755 loc_api/loc_api_v02/LocApiV02Adapter.cpp create mode 100755 loc_api/loc_api_v02/LocApiV02Adapter.h create mode 100755 loc_api/loc_api_v02/loc_api_sync_req.c create mode 100755 loc_api/loc_api_v02/loc_api_sync_req.h create mode 100755 loc_api/loc_api_v02/loc_api_v02_client.c create mode 100755 loc_api/loc_api_v02/loc_api_v02_client.h create mode 100755 loc_api/loc_api_v02/loc_api_v02_log.c create mode 100755 loc_api/loc_api_v02/loc_api_v02_log.h create mode 100755 loc_api/loc_api_v02/loc_util_log.h create mode 100755 loc_api/loc_api_v02/location_service_v02.c create mode 100755 loc_api/loc_api_v02/location_service_v02.h create mode 100755 loc_api/ulp/inc/ulp.h create mode 100755 utils/Android.mk create mode 100755 utils/linked_list.c create mode 100755 utils/linked_list.h create mode 100755 utils/loc_cfg.cpp create mode 100755 utils/loc_cfg.h create mode 100755 utils/loc_log.cpp create mode 100755 utils/loc_log.h create mode 100755 utils/log_util.h create mode 100755 utils/msg_q.c create mode 100755 utils/msg_q.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 52942bfe..7e09d5f9 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -7,5 +7,27 @@ # 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -include $(call all-subdir-makefiles) -endif + +LOCAL_PATH := $(call my-dir) + +GPS_DIR_LIST := + +# add RPC dirs if RPC is available +ifneq ($(TARGET_NO_RPC),true) + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ + +else + +GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ + +endif #TARGET_NO_RPC + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ + +#call the subfolders +include $(addsuffix Android.mk, $(GPS_DIR_LIST)) + +endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk new file mode 100755 index 00000000..6c5d5339 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/Android.mk @@ -0,0 +1,3 @@ +ifeq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) +include $(call all-subdir-makefiles) +endif diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk new file mode 100755 index 00000000..1287c69e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -0,0 +1,59 @@ +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/LocApiRpcAdapter.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_adapter + +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)/loc_api/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/librpc \ + $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + 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 + +LOCAL_MODULE:= libloc_api-rpc-qc + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h new file mode 100755 index 00000000..7b1f59ba --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -0,0 +1,102 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ADAPTER_H +#define LOC_API_RPC_ADAPTER_H + +#include +#include +#include + + +class LocApiRpcAdapter : public LocApiAdapter { + // RPC communication establishment + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type eMask; + + static const rpc_loc_event_mask_type locBits[]; + static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + static enum loc_api_adapter_err convertErr(int rpcErr); + + 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); + int NIEventFillVerfiyType(GpsNiNotification ¬if, + rpc_loc_ni_notify_verify_e_type notif_priv); + GpsNiEncodingType convertNiEncodingType(int loc_encoding); + +public: + LocApiRpcAdapter(LocEng &locEng); + ~LocApiRpcAdapter(); + + 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 + reinit(); + virtual enum loc_api_adapter_err + startFix(); + virtual enum loc_api_adapter_err + stopFix(); + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + virtual enum loc_api_adapter_err + enableData(int enable); + 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); + virtual enum loc_api_adapter_err + setAPN(char* apn, int len); + 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 + 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); +}; + +#endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h new file mode 100755 index 00000000..8b20a3f5 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h new file mode 100755 index 00000000..9bfe5f0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h @@ -0,0 +1,226 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h new file mode 100755 index 00000000..c0bcda16 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h @@ -0,0 +1,59 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h new file mode 100755 index 00000000..16552a0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -0,0 +1,123 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "rpc_inc/loc_api_fixup.h" +#include "rpc_inc/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h new file mode 100755 index 00000000..266f8ec8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h new file mode 100755 index 00000000..8dbcb9ac --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp new file mode 100755 index 00000000..48b3a0fe --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -0,0 +1,1225 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include +#include +#include "LocApiRpcAdapter.h" +#include "loc_api_rpcgen_common_rpc.h" +#include "log_util.h" +#include "loc_log.h" +#include "loc_api_log.h" + +#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 = ((LocApiRpcAdapter*)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)); + ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, event); + EXIT_LOG(%p, VOID_RET); +} + + +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return new LocApiRpcAdapter(locEng); +} + +const rpc_loc_event_mask_type LocApiRpcAdapter::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 +}; + +LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : + LocApiAdapter(locEng), + client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), + eMask(convertMask(locEng.eventMask)) +{ + loc_api_glue_init(); +} + +LocApiRpcAdapter::~LocApiRpcAdapter() +{ + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + loc_close(client_handle); +} + +rpc_loc_event_mask_type +LocApiRpcAdapter::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; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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) +{ + locEngHandle.acquireWakelock(); + + // 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); + } + + locEngHandle.releaseWakeLock(); + 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 +LocApiRpcAdapter::reinit() +{ + enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); + + if (client_handle < 0) { + ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + return ret_val; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::startFix() { + LOC_LOGD("LocApiRpcAdapter::startFix() called"); + return convertErr( + loc_start_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::stopFix() { + LOC_LOGD("LocApiRpcAdapter::stopFix() called"); + return convertErr( + loc_stop_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::setPositionMode(LocPositionMode mode, + GpsPositionRecurrence recurrence, uint32_t min_interval, + uint32_t preferred_accuracy, uint32_t preferred_time) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + rpc_loc_operation_mode_e_type op_mode; + int ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) client_handle, min_interval, mode); + + switch (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: + 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 = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; + 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 = min_interval; + fix_criteria_ptr->preferred_operation_mode = op_mode; + + if (min_interval > 0) { + fix_criteria_ptr->min_interval = min_interval; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + }else if(min_interval == 0) + { + /*If the framework passes in 0 transalate it into the maximum frequency we can report positions + which is 1 Hz or once very second */ + fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + } + if (preferred_accuracy > 0) { + fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; + } + if (preferred_time > 0) { + fix_criteria_ptr->preferred_response_time = preferred_time; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; + } + + switch (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 +LocApiRpcAdapter::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)(android::elapsedRealtime() - 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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 + LocApiRpcAdapter::setAPN(char* apn, int len) +{ + 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, len+1); + + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::enableData(int enable) +{ + 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; + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_DATA_ENABLE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location = {0}; + + location.size = sizeof(location); + 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.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + // Altitude + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + // Speed + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + // Heading + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + LOC_LOGV("reportPosition: fire callback\n"); + LocApiAdapter::reportPosition(location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + 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 LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus = {0}; + 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(GpsSvStatus); + 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.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) + { + 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 (SvStatus.num_svs >= 0) + { + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) +{ + GpsStatusValue status = GPS_STATUS_NONE; + + 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) + { + status = GPS_STATUS_ENGINE_ON; + } + else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) + { + status = GPS_STATUS_ENGINE_OFF; + } + } else if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE) { + if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_BEGIN) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_END) + { + status = GPS_STATUS_SESSION_END; + } + } + + LocApiAdapter::reportStatus(status); +} + +void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + +#if (AMSS_VERSION==3200) + LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); +#else + LocApiAdapter::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 +LocApiRpcAdapter::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); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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 = LocApiAdapter::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)); + LocApiAdapter::requestNiNotify(notif, (const void*)copy); +} + +int LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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; + } +} diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c new file mode 100755 index 00000000..32e3cda8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c @@ -0,0 +1,52 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c new file mode 100755 index 00000000..6aa5254f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -0,0 +1,344 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c new file mode 100755 index 00000000..10b2d221 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -0,0 +1,621 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/* Logging Improvement */ +#include "log_util.h" + +/* Uncomment to force LOGD messages */ +// #define LOGD LOGI + +/*===================================================================== + 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 +) +{ + 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; + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == event_callback || + loc_glue_callback_table[i].user == userData) + { + LOC_LOGW("Client already opened service (callback=%p)...\n", + event_callback); + break; + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == NULL) + { + 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; + break; + } + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + LOC_LOGE("Too many clients opened at once...\n"); + return RPC_LOC_CLIENT_HANDLE_INVALID; + } + + 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"); + stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); + 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; + + ret_val = (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; + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c new file mode 100755 index 00000000..e2a5786f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -0,0 +1,510 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/*************************************************************************** + * 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; + + LOGV("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; + + LOGV("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) + { + LOGV("trylock EBUSY : %d", i); + continue; + } + + if (!slot->in_use && !slot->not_available) + { + select_id = i; + slot->in_use = 1; + slot->signal_sent = 0; + /* Return from here and leave the mutex locked. + * will unlock it in loc_unlock_slot() + */ + break; + } + /* LOGV("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 + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_unlock_slot(int select_id) +{ + loc_sync_data.slots[select_id].in_use = 0; + + pthread_mutex_unlock(&loc_sync_data.slots[select_id].lock); +} + +/*=========================================================================== + +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; /* 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 */ + LOGE("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) + { + LOGE("slot not available ioctl_type = %s", + loc_get_ioctl_type_name(ioctl_type)); + return rc; + } + + // Select the callback we are waiting for + loc_api_save_callback(select_id, handle, 0, ioctl_type); + + rc = loc_ioctl(handle, ioctl_type, ioctl_data_ptr); + + if (rc != RPC_LOC_API_SUCCESS) + { + LOGE("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 { + LOGV("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 + LOGE("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; + LOGE("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 { + LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", + select_id, ioctl_type, rc); + } + } /* wait callback */ + } /* loc_ioctl */ + + loc_unlock_slot(select_id); + + return rc; +} + + diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c new file mode 100755 index 00000000..b257fb81 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk new file mode 100755 index 00000000..abd15c8f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk @@ -0,0 +1,35 @@ +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_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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h new file mode 100755 index 00000000..47478e80 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h @@ -0,0 +1,156 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h new file mode 100755 index 00000000..507103ce --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h @@ -0,0 +1,1261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h new file mode 100755 index 00000000..f11bb654 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h @@ -0,0 +1,288 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h new file mode 100755 index 00000000..e109852c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c new file mode 100755 index 00000000..b0443487 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c @@ -0,0 +1,327 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c new file mode 100755 index 00000000..7f519281 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c @@ -0,0 +1,60 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c new file mode 100755 index 00000000..d2152ab4 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c @@ -0,0 +1,155 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c new file mode 100755 index 00000000..da066b42 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c @@ -0,0 +1,1775 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c new file mode 100755 index 00000000..e8a2aa78 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c @@ -0,0 +1,199 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c new file mode 100755 index 00000000..b4aeb5e7 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr new file mode 100755 index 00000000..3d6c759e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr @@ -0,0 +1,261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr new file mode 100755 index 00000000..36d0e6d2 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr @@ -0,0 +1,187 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr new file mode 100755 index 00000000..fcdaf57f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr @@ -0,0 +1,1021 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk index a0fec50f..f70cba50 100755 --- a/loc_api/libloc_api-rpc/Android.mk +++ b/loc_api/libloc_api-rpc/Android.mk @@ -1,13 +1,7 @@ -#Copyright (c) 2009, QUALCOMM USA, INC. -#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ifneq ($(BUILD_TINY_ANDROID),true) +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) + LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) @@ -63,3 +57,4 @@ LOCAL_MODULE:= libloc_api-rpc include $(BUILD_STATIC_LIBRARY) endif +endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr index 60f730c2..5d9cf6c8 100755 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr @@ -1,12 +1,3 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - CLIENTS:= loc_api SERVERS:= loc_api_cb COMMON:= loc_api_common diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c index 571bbda7..fbaca8b6 100755 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef ALOGD -#define ALOGD(...) {} +#undef LOGD +#define LOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00040001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - ALOGD("Warning: No callback handler.\n"); + LOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - ALOGD("proc: %x prog: %x vers: %x\n", + LOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // ALOGD("***** loc_apicbprog_freeresult\n"); + // LOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - ALOGD("Trying to create RPC client...\n"); + LOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - ALOGD("Loc API callback initialized.\n"); + LOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr index 60f730c2..5d9cf6c8 100755 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr @@ -1,12 +1,3 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - CLIENTS:= loc_api SERVERS:= loc_api_cb COMMON:= loc_api_common diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c index cb9350ed..8c171222 100755 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -67,8 +67,8 @@ when who what, where, why #include /* Comment this out to enable logging */ -#undef ALOGD -#define ALOGD(...) {} +#undef LOGD +#define LOGD(...) {} /*===================================================================== External declarations @@ -99,17 +99,17 @@ bool_t rpc_loc_event_cb_f_type_0x00010001_svc( /* Callback not registered, or unexpected ID (shouldn't happen) */ if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) { - ALOGD("Warning: No callback handler.\n"); + LOGD("Warning: No callback handler.\n"); ret->loc_event_cb_f_type_result = 0; return 1; /* simply return */ } - ALOGD("proc: %x prog: %x vers: %x\n", + LOGD("proc: %x prog: %x vers: %x\n", (int) req->rq_proc, (int) req->rq_prog, (int) req->rq_vers); - ALOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", (int) argp->loc_event, (int) argp->loc_handle, (int) ret); @@ -133,7 +133,7 @@ int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t res /* * Insert additional freeing code here, if needed */ - // ALOGD("***** loc_apicbprog_freeresult\n"); + // LOGD("***** loc_apicbprog_freeresult\n"); return 1; } @@ -160,9 +160,9 @@ int loc_api_glue_init(void) if (loc_api_clnt == NULL) { /* Print msg */ - ALOGD("Trying to create RPC client...\n"); + LOGD("Trying to create RPC client...\n"); loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - ALOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); if (loc_api_clnt == NULL) { @@ -174,7 +174,7 @@ int loc_api_glue_init(void) int rc = loc_apicb_app_init(); if (rc >= 0) { - ALOGD("Loc API callback initialized.\n"); + LOGD("Loc API callback initialized.\n"); } else { fprintf(stderr, "Loc API callback initialization failed.\n"); return 0; diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h index bef0ad39..a71b23a0 100755 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -25,7 +25,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define PRINT(x...) do { \ fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stdout, ##x); \ - ALOGD(x); \ + LOGD(x); \ } while(0) #ifdef DEBUG @@ -43,14 +43,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #define E(x...) do { \ fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stderr, ##x); \ - ALOGE(x); \ + LOGE(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); \ + LOGE(##msg); \ } \ } while(0) diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index df2ff2d0..f20280ee 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -1,11 +1,5 @@ -#Copyright (c) 2009, QUALCOMM USA, INC. -#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 QUALCOMM USA, Inc. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - +#Compile the old library version from Google push for Passion builds with old modem image +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -42,4 +36,4 @@ LOCAL_C_INCLUDES:= \ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw include $(BUILD_SHARED_LIBRARY) - +endif #BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION = 50001 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c index a28a608e..5f6d8095 100644 --- a/loc_api/libloc_api/gps.c +++ b/loc_api/libloc_api/gps.c @@ -1,29 +1,31 @@ -/****************************************************************************** - @file: gps.c - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 @@ -55,7 +57,7 @@ static struct hw_module_methods_t gps_module_methods = { .open = open_gps }; -struct hw_module_t HAL_MODULE_INFO_SYM = { +const struct hw_module_t HAL_MODULE_INFO_SYM = { .tag = HARDWARE_MODULE_TAG, .version_major = 1, .version_minor = 0, diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 48c94f31..68ac002c 100755 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.cpp - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 @@ -57,8 +53,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} #define DEBUG_MOCK_NI 0 @@ -150,7 +146,7 @@ const GpsInterface* gps_get_hardware_interface () property_get("gps.disable", propBuf, ""); if (propBuf[0] == '1') { - ALOGD("gps_get_interface returning NULL because gps.disable=1\n"); + LOGD("gps_get_interface returning NULL because gps.disable=1\n"); return NULL; } @@ -240,7 +236,7 @@ static int loc_eng_init(GpsCallbacks* callbacks) loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", loc_eng_process_deferred_action, NULL); - ALOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); return 0; } @@ -314,20 +310,20 @@ SIDE EFFECTS static int loc_eng_start() { int ret_val; - ALOGD ("loc_eng_start\n"); + LOGD ("loc_eng_start\n"); if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && loc_eng_data.agps_server_host[0] != 0 && loc_eng_data.agps_server_port != 0) { int result = set_agps_server(); - ALOGD ("set_agps_server returned = %d\n", result); + LOGD ("set_agps_server returned = %d\n", result); } ret_val = loc_start_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_eng_start returned error = %d\n", ret_val); + LOGD ("loc_eng_start returned error = %d\n", ret_val); } return 0; @@ -354,7 +350,7 @@ static int loc_eng_stop() { int ret_val; - ALOGD ("loc_eng_stop\n"); + LOGD ("loc_eng_stop\n"); pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); // work around problem with loc_eng_stop when AGPS requests are pending @@ -362,7 +358,7 @@ static int loc_eng_stop() if (loc_eng_data.agps_request_pending) { loc_eng_data.stop_request_pending = true; - ALOGD ("deferring stop until AGPS data call is finished\n"); + LOGD ("deferring stop until AGPS data call is finished\n"); pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); return 0; } @@ -371,7 +367,7 @@ static int loc_eng_stop() ret_val = loc_stop_fix (loc_eng_data.client_handle); if (ret_val != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_eng_stop returned error = %d\n", ret_val); + LOGD ("loc_eng_stop returned error = %d\n", ret_val); } return 0; @@ -382,7 +378,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - ALOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", (int32) loc_eng_data.client_handle, lock_type); ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; @@ -396,7 +392,7 @@ static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) if (ret_val != TRUE) { - ALOGD ("loc_eng_set_gps_lock mode failed\n"); + LOGD ("loc_eng_set_gps_lock mode failed\n"); } return 0; @@ -425,7 +421,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence rpc_loc_fix_criteria_s_type *fix_criteria_ptr; boolean ret_val; - ALOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", (int32) loc_eng_data.client_handle, min_interval, mode); loc_eng_data.position_mode = mode; @@ -478,7 +474,7 @@ static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence if (ret_val != TRUE) { - ALOGD ("loc_eng_set_position mode failed\n"); + LOGD ("loc_eng_set_position mode failed\n"); } return 0; @@ -506,7 +502,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce rpc_loc_assist_data_time_s_type *time_info_ptr; boolean ret_val; - ALOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; @@ -523,7 +519,7 @@ static int loc_eng_inject_time (GpsUtcTime time, int64_t timeReference, int unce if (ret_val != TRUE) { - ALOGD ("loc_eng_inject_time failed\n"); + LOGD ("loc_eng_inject_time failed\n"); } return 0; @@ -708,7 +704,7 @@ static int32 loc_event_cb( const rpc_loc_event_payload_u_type* loc_event_payload ) { - ALOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); if (client_handle == loc_eng_data.client_handle) { pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -723,7 +719,7 @@ static int32 loc_event_cb( } else { - ALOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); } return RPC_LOC_API_SUCCESS; @@ -749,7 +745,7 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat { GpsLocation location; - ALOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); memset (&location, 0, sizeof(location)); @@ -800,18 +796,18 @@ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *locat if (loc_eng_data.location_cb != NULL) { - ALOGV ("loc_eng_report_position: fire callback\n"); + LOGV ("loc_eng_report_position: fire callback\n"); loc_eng_data.location_cb (&location); } } else { - ALOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); } } else { - ALOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); } } @@ -837,7 +833,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) int num_svs_max, i; const rpc_loc_sv_info_s_type *sv_info_ptr; - ALOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", (uint32) gnss_report_ptr->valid_mask, gnss_report_ptr->sv_count); @@ -923,7 +919,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) } } - ALOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) { loc_eng_data.sv_status_cb(&SvStatus); @@ -950,7 +946,7 @@ static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_rep { GpsStatus status; - ALOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); memset (&status, 0, sizeof(status)); status.size = sizeof(status); @@ -1024,7 +1020,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) { - ALOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); // Signal DeferredActionThread to send the APN name pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); @@ -1068,14 +1064,14 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_agps_init(AGpsCallbacks* callbacks) { - ALOGV("loc_eng_agps_init\n"); + LOGV("loc_eng_agps_init\n"); loc_eng_data.agps_status_cb = callbacks->status_cb; } static int loc_eng_agps_data_conn_open(const char* apn) { int apn_len; - ALOGD("loc_eng_agps_data_conn_open: %s\n", apn); + LOGD("loc_eng_agps_data_conn_open: %s\n", apn); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); @@ -1085,7 +1081,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) if (apn_len >= sizeof(loc_eng_data.apn_name)) { - ALOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); apn_len = sizeof(loc_eng_data.apn_name) - 1; } @@ -1103,7 +1099,7 @@ static int loc_eng_agps_data_conn_open(const char* apn) static int loc_eng_agps_data_conn_closed() { - ALOGD("loc_eng_agps_data_conn_closed\n"); + LOGD("loc_eng_agps_data_conn_closed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ loc_eng_data.acquire_wakelock_cb(); @@ -1115,7 +1111,7 @@ static int loc_eng_agps_data_conn_closed() static int loc_eng_agps_data_conn_failed() { - ALOGD("loc_eng_agps_data_conn_failed\n"); + LOGD("loc_eng_agps_data_conn_failed\n"); pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); /* hold a wake lock while events are pending for deferred_action_thread */ @@ -1163,7 +1159,7 @@ static int set_agps_server() server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); - ALOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); + LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); #else char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); @@ -1174,7 +1170,7 @@ static int set_agps_server() (loc_eng_data.agps_server_port & (0x0000ffff))); server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; - ALOGD ("set_agps_server, addr = %s\n", buf); + LOGD ("set_agps_server, addr = %s\n", buf); #endif ret_val = loc_eng_ioctl (loc_eng_data.client_handle, @@ -1185,19 +1181,19 @@ static int set_agps_server() if (ret_val != TRUE) { - ALOGD ("set_agps_server failed\n"); + LOGD ("set_agps_server failed\n"); return -1; } else { - ALOGV ("set_agps_server successful\n"); + LOGV ("set_agps_server successful\n"); return 0; } } static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) { - ALOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); if (type != AGPS_TYPE_SUPL) return -1; @@ -1246,7 +1242,7 @@ static void loc_eng_delete_aiding_data_deferred_action (void) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - ALOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); + LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); } /*=========================================================================== @@ -1274,7 +1270,7 @@ static void loc_eng_process_atl_deferred_action (int flags) boolean ret_val; int agps_status = -1; - ALOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); @@ -1304,7 +1300,7 @@ static void loc_eng_process_atl_deferred_action (int flags) #endif // Delay this so that PDSM ATL module will behave properly sleep (1); - ALOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); } else // data_connection_failed { @@ -1320,7 +1316,7 @@ static void loc_eng_process_atl_deferred_action (int flags) LOC_IOCTL_DEFAULT_TIMEOUT, NULL); - ALOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); + LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); } /*=========================================================================== @@ -1368,7 +1364,7 @@ static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ) { - ALOGD ("loc_event_cb: xtra download requst"); + LOGD ("loc_event_cb: xtra download requst"); // Call Registered callback if (loc_eng_data.xtra_module_data.download_request_cb != NULL) @@ -1429,13 +1425,13 @@ static void loc_eng_process_deferred_action (void* arg) status.size = sizeof(status); status.type = AGPS_TYPE_SUPL; - ALOGD("loc_eng_process_deferred_action started\n"); + LOGD("loc_eng_process_deferred_action started\n"); // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); // disable the GPS lock - ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); while (1) @@ -1506,10 +1502,10 @@ static void loc_eng_process_deferred_action (void* arg) loc_eng_data.agps_request_pending = false; if (loc_eng_data.stop_request_pending) { - ALOGD ("handling deferred stop\n"); + LOGD ("handling deferred stop\n"); if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) { - ALOGD ("loc_stop_fix failed!\n"); + LOGD ("loc_stop_fix failed!\n"); } } pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); @@ -1521,10 +1517,10 @@ static void loc_eng_process_deferred_action (void* arg) } // reenable the GPS lock - ALOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); - ALOGD("loc_eng_process_deferred_action thread exiting\n"); + LOGD("loc_eng_process_deferred_action thread exiting\n"); loc_eng_data.release_wakelock_cb(); loc_eng_data.deferred_action_thread = 0; diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 39f3d91b..553a97e0 100755 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.h - @brief: - - DESCRIPTION - This file defines the global data structure used by this module. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index f59cc4eb..a43d8cca 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -1,36 +1,32 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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. + * + */ -/****************************************************************************** - @file: loc_eng.cpp - @brief: - - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ #define LOG_NDDEBUG 0 #include @@ -52,8 +48,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} // Function declarations static boolean loc_eng_ioctl_setup_cb( @@ -97,7 +93,7 @@ boolean loc_eng_ioctl( int rpc_ret_val; loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - ALOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); // Select the callback we are waiting for @@ -109,7 +105,7 @@ boolean loc_eng_ioctl( ioctl_type, ioctl_data_ptr); - ALOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); if (rpc_ret_val == RPC_LOC_API_SUCCESS) { @@ -164,7 +160,7 @@ static boolean loc_eng_ioctl_setup_cb( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (ioctl_cb_data_ptr->cb_is_selected == TRUE) { - ALOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); ret_val = FALSE; } else @@ -222,7 +218,7 @@ boolean loc_eng_ioctl_wait_cb( do { if (ioctl_cb_data_ptr->cb_is_selected == FALSE) { - ALOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); ret_val = FALSE; break; } @@ -240,7 +236,7 @@ boolean loc_eng_ioctl_wait_cb( // Special case where callback is issued before loc_ioctl ever returns if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) { - ALOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); ret_val = TRUE; break; } @@ -260,7 +256,7 @@ boolean loc_eng_ioctl_wait_cb( ret_val = FALSE; } - ALOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); } while (0); @@ -286,7 +282,7 @@ boolean loc_eng_ioctl_wait_cb( pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - ALOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); return ret_val; } @@ -321,13 +317,13 @@ boolean loc_eng_ioctl_process_cb ( pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); if (client_handle != ioctl_cb_data_ptr->client_handle) { - ALOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); ret_val = FALSE; } else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) { - ALOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); ret_val = FALSE; } @@ -339,7 +335,7 @@ boolean loc_eng_ioctl_process_cb ( ioctl_cb_data_ptr->cb_has_arrived = TRUE; - ALOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, (int32) ioctl_cb_data_ptr->cb_payload.status); diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h index 4090a4d8..eb0c201a 100755 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -1,37 +1,31 @@ -/****************************************************************************** - @file: loc_eng_ioctl.h - @brief: - - DESCRIPTION - This file defines the data structure used by any location client that - waits for the ioctl particular event to occur. Any one IOCTL can be pending - at any time. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_IOCTL_H #define LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index c7636831..3df0af14 100755 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -1,33 +1,33 @@ -/****************************************************************************** - @file: loc_eng_ni.cpp - @brief: module for network initiated interactions - - DESCRIPTION - LOC_API network initiated operation support - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - ----------------------------------------------------------------------------- -******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -07/30/09 dx Initial version - -$Id: -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_NIDEBUG 0 #include #include @@ -46,8 +46,8 @@ $Id: #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} /*============================================================================= * @@ -119,7 +119,7 @@ static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, const rpc_loc_ni_event_s_type *request_pass_back ) { - ALOGD("Sending NI response: %s\n", respond_from_enum(resp)); + LOGD("Sending NI response: %s\n", respond_from_enum(resp)); rpc_loc_ioctl_data_u_type data; rpc_loc_ioctl_callback_s_type callback_payload; @@ -267,12 +267,12 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ loc_ni_respond(response, ni_req); */ #endif - ALOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", ni_req->event); } else { /* Print notification */ - ALOGD("NI Notification: %s, event: %d", msg, ni_req->event); + LOGD("NI Notification: %s, event: %d", msg, ni_req->event); pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); @@ -366,9 +366,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->client_name.string_len /* length */ ); - ALOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); } else { - ALOGD("SUPL NI: client_name not present."); + LOGD("SUPL NI: client_name not present."); } // Requestor ID @@ -382,9 +382,9 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ #endif supl_req->requestor_id.string_len /* length */ ); - ALOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); } else { - ALOGD("SUPL NI: requestor_id not present."); + LOGD("SUPL NI: requestor_id not present."); } // Encoding type @@ -402,20 +402,20 @@ static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_typ break; default: - ALOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); return; } /* Log requestor ID and text for debugging */ - ALOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); - ALOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); - ALOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); /* For robustness, always sets a timeout to clear up the notification status, even though * the OEM layer in java does not do so. **/ loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); - ALOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); @@ -440,7 +440,7 @@ RETURN VALUE ===========================================================================*/ int loc_ni_process_user_response(GpsUserResponseType userResponse) { - ALOGD("NI response from UI: %d", userResponse); + LOGD("NI response from UI: %d", userResponse); rpc_loc_ni_user_resp_e_type resp; switch (userResponse) @@ -493,22 +493,22 @@ int loc_eng_ni_callback ( switch (ni_req->event) { case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - ALOGI("VX Notification"); + LOGI("VX Notification"); loc_ni_request_handler("VX Notify", ni_req); break; case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - ALOGI("UMTS CP Notification\n"); + LOGI("UMTS CP Notification\n"); loc_ni_request_handler("UMTS CP Notify", ni_req); break; case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - ALOGI("SUPL Notification\n"); + LOGI("SUPL Notification\n"); loc_ni_request_handler("SUPL Notify", ni_req); break; default: - ALOGE("Unknown NI event: %x\n", (int) ni_req->event); + LOGE("Unknown NI event: %x\n", (int) ni_req->event); break; } } @@ -522,7 +522,7 @@ FUNCTION loc_ni_thread_proc ===========================================================================*/ static void loc_ni_thread_proc(void *unused) { - ALOGI("Starting Loc NI thread...\n"); + LOGI("Starting Loc NI thread...\n"); while (1) { @@ -563,7 +563,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_ni_init(GpsNiCallbacks *callbacks) { - ALOGD("loc_eng_ni_init: entered."); + LOGD("loc_eng_ni_init: entered."); if (!loc_eng_ni_data_init) { @@ -600,10 +600,10 @@ void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) { if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) { - ALOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); loc_ni_process_user_response(user_response); } else { - ALOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", notif_id, user_response); } } diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index 88d285ae..193b9f85 100755 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -1,30 +1,31 @@ -/****************************************************************************** - @file: loc_eng_ni.cpp - @brief: module for network initiated interactions - - DESCRIPTION - LOC_API network initiated operation support - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- - Copyright (c) 2009 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - ----------------------------------------------------------------------------- -******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -07/30/09 dx Initial version - -$Id: -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index c713c270..1ec3bf07 100755 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -1,35 +1,32 @@ -/****************************************************************************** - @file: loc_eng.cpp - @brief: +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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. + * + */ - DESCRIPTION - This file defines the implemenation for GPS hardware abstraction layer. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ #define LOG_NDDEBUG 0 #include @@ -49,8 +46,8 @@ $Author: $ #include // comment this out to enable logging -// #undef ALOGD -// #define ALOGD(...) {} +// #undef LOGD +// #define LOGD(...) {} #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (400) @@ -120,7 +117,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - ALOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA; @@ -147,8 +144,8 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) 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; - ALOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); - ALOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); if (part < total_parts) { @@ -159,7 +156,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) if (rpc_ret_val != RPC_LOC_API_SUCCESS) { - ALOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); ret_val = EINVAL; // return error break; } @@ -176,7 +173,7 @@ static int qct_loc_eng_inject_xtra_data(char* data, int length) } len_injected += predicted_orbits_data_ptr->part_len; - ALOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); } return ret_val; diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h index b5c79451..82778ae5 100755 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -1,35 +1,31 @@ -/****************************************************************************** - @file: loc_eng.h - @brief: - - DESCRIPTION - This file defines the data structure used by this XTRA module. - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - -******************************************************************************/ - -/*===================================================================== -$Header: $ -$DateTime: $ -$Author: $ -======================================================================*/ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk new file mode 100755 index 00000000..0a5a0a10 --- /dev/null +++ b/loc_api/libloc_api_50001/Android.mk @@ -0,0 +1,131 @@ +ifneq ($(BUILD_TINY_ANDROID),true) +#Compile this library only for builds with the latest modem image + +BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion +BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 +ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) +FEATURE_GNSS_BIT_API := true +endif # is-board-platform-in-list + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_adapter + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc_eng_log.cpp \ + LocApiAdapter.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_COPY_HEADERS_TO:= libloc_eng/ +LOCAL_COPY_HEADERS:= \ + LocApiAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_msg_id.h \ + loc_eng_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_eng + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_adapter \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_agps.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + loc_eng_log.cpp + +ifeq ($(FEATURE_GNSS_BIT_API), true) +LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API +endif # FEATURE_GNSS_BIT_API + +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 + +## Check if RPC is not unsupported +ifneq ($(TARGET_NO_RPC),true) +LOCAL_SHARED_LIBRARIES += libloc_api-rpc-qc +else +LOCAL_SHARED_LIBRARIES += libloc_api_v02 +endif #TARGET_NO_RPC + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/ulp/inc + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) + +LOCAL_MODULE_TAGS := optional + +## Libs + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_eng \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc.cpp \ + gps.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ \ + +## Includes +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp new file mode 100755 index 00000000..e631642d --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -0,0 +1,196 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include "loc_eng_msg.h" +#include "loc_log.h" +#include "loc_eng_ni.h" + +static void* noProc(void* data) +{ + return NULL; +} + +LocEng::LocEng(void* caller, + LOC_API_ADAPTER_EVENT_MASK_T emask, + gps_acquire_wakelock acqwl, + gps_release_wakelock relwl, + loc_msg_sender msgSender, + loc_ext_parser posParser, + loc_ext_parser svParser) : + owner(caller), + eventMask(emask), acquireWakelock(acqwl), + releaseWakeLock(relwl), sendMsge(msgSender), + extPosInfo(NULL == posParser ? noProc : posParser), + extSvInfo(NULL == svParser ? noProc : svParser) +{ + LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); +} + +LocApiAdapter::LocApiAdapter(LocEng &locEng) : + locEngHandle(locEng) +{ + LOC_LOGD("LocApiAdapter created"); +} + +LocApiAdapter::~LocApiAdapter() +{ + LOC_LOGV("LocApiAdapter deleted"); +} + +int LocApiAdapter::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 LocApiAdapter::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; +} + +void LocApiAdapter::reportPosition(GpsLocation &location, + void* locationExt, + enum loc_sess_status status) +{ + loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, + location, + locationExt, + status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) +{ + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportStatus(GpsStatusValue status) +{ + loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportNmea(const char* nmea, int length) +{ + loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseATL(int connHandle) +{ + loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestXtraData() +{ + LOC_LOGD("XTRA download request"); + + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestTime() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestLocation() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineDownEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineUpEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h new file mode 100755 index 00000000..033a034c --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -0,0 +1,205 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define LOC_API_ADAPTER_H + +#include +#include +#include +#include + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< + +#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)); + 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/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp new file mode 100755 index 00000000..16bed3b1 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.cpp @@ -0,0 +1,870 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static gps_location_callback gps_loc_cb = NULL; +static gps_sv_status_callback gps_sv_cb = NULL; + +static void loc_cb(GpsLocation* location, void* locExt); +static void sv_cb(GpsSvStatus* sv_status, void* svExt); + +// 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); +#ifdef QCOM_FEATURE_ULP +static int loc_update_criteria(UlpLocationCriteria criteria); +#endif + +// 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 +#ifdef QCOM_FEATURE_ULP + ,loc_update_criteria +#endif +}; + +// Function declarations for sLocEngAGpsInterface +static void loc_agps_init(AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +static int loc_agps_closed(AGpsType agpsType); +static int loc_agps_open_failed(AGpsType agpsType); +#else +static int loc_agps_open(const char* apn); +static int loc_agps_closed(); +static int loc_agps_open_failed(); +#endif +static int loc_agps_set_server(AGpsType type, const char *hostname, int port); + +static const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server +}; + +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); + +const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + +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 +}; + +#ifdef QCOM_FEATURE_ULP +static bool loc_inject_raw_command(char* command, int length); + +static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = +{ + sizeof(InjectRawCmdInterface), + loc_inject_raw_command +}; +#endif + +static loc_eng_data_s_type loc_afw_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + ENTRY_LOG_CALLFLOW(); + const GpsInterface* ret_val; + + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + 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; + } + + EXIT_LOG(%p, ret_val); + return ret_val; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + 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) +{ + ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event = + 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; + LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ + callbacks->status_cb, /* status_cb */ + 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 */}; + gps_loc_cb = callbacks->location_cb; + gps_sv_cb = callbacks->sv_status_cb; + + int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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_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 = 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(); + 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; + } + int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, + recurrence, min_interval, + preferred_accuracy, preferred_time); + + 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 = 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 = 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_update_criteria(UlpLocationCriteria criteria) +{ + ENTRY_LOG(); + int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +static const void* loc_get_extension(const char* name) +{ + ENTRY_LOG(); + const void* ret_val = NULL; + + 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) + { + ret_val = &sLocEngAGpsRilInterface; + } +#ifdef QCOM_FEATURE_ULP + else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) + { + ret_val = &sLocEngInjectRawCmdInterface; + } +#endif + 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, 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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_open(const char* apn) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, apn); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_closed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_closed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_agps_open_failed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +int loc_agps_open_failed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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; + } + int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION 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(); + int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks); + + 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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(); + loc_eng_ni_init(loc_afw_data, callbacks); + 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static bool loc_inject_raw_command(char* command, int length) +{ + ENTRY_LOG(); + int ret_val = loc_eng_inject_raw_command(loc_afw_data, command, length); + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +#endif + + +static void loc_cb(GpsLocation* location, void* locExt) +{ + ENTRY_LOG(); + if (NULL != gps_loc_cb && NULL != location) { +#ifdef QCOM_FEATURE_ULP + CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); +#else + CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); +#endif + gps_loc_cb(location); + } + EXIT_LOG(%s, VOID_RET); +} + +static void 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); +} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h new file mode 100755 index 00000000..bf942373 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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_STANDALONE, + 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 +} LocPositionMode; + +typedef void (*loc_location_cb_ext) (GpsLocation* 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; +} LocCallbacks; + +enum loc_sess_status { + LOC_SESS_SUCCESS, + LOC_SESS_INTERMEDIATE, + LOC_SESS_FAILURE +}; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_H__ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp new file mode 100755 index 00000000..4d032dce --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -0,0 +1,1838 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 /* struct sockaddr_in */ +#include +#include +#include +#include +#include + +#include "LocApiAdapter.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ulp.h" + +#include "log_util.h" +#include "loc_eng_log.h" + +#define SUCCESS TRUE +#define FAILURE FALSE + + +static void loc_eng_deferred_action_thread(void* context); +static void* loc_eng_create_msg_q(); +static void loc_eng_free_msg(void* msg); + +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + +pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; +LocEngContext* LocEngContext::me = NULL; + +LocEngContext::LocEngContext(gps_create_thread threadCreator) : + deferred_q((const void*)loc_eng_create_msg_q()), + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), + counter(0) +{ + LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", + getpid(), gettid(), + deferred_action_thread); +} + +LocEngContext* LocEngContext::get(gps_create_thread threadCreator) +{ + pthread_mutex_lock(&lock); + // gonna need mutex protection here... + if (NULL == me) { + // gps.conf is not part of the context class. But we only want to parse the conf + // file once. This is the only good place to ensure that. + // In fact one day the conf file should go into context as well. + loc_read_gps_conf(); + + me = new LocEngContext(threadCreator); + } + me->counter++; + + pthread_mutex_unlock(&lock); + return me; +} + +void LocEngContext::drop() +{ + if (deferred_action_thread != pthread_self()) { + pthread_mutex_lock(&lock); + counter--; + if (counter == 0) { + loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); + msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); + + // I am not sure if this is going to be hazardous. The calling thread + // might be blocked for a while, if the q is loaded. I am wondering + // if we should just dump all the msgs in the q upon QUIT. + pthread_cond_wait(&cond, &lock); + + msg_q_destroy((void**)&deferred_q); + delete me; + me = NULL; + } + pthread_mutex_unlock(&lock); + } else { + LOC_LOGE("The HAL thread cannot free itself"); + } +} + +// 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 char extra_data[100]; + +#ifdef QCOM_FEATURE_ULP +// ULP integration +static const ulpInterface* locEngUlpInf = NULL; +static int loc_eng_ulp_init(void* handle) ; +#endif + +/********************************************************************* + * 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) + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); +} + +static void* loc_eng_create_msg_q() +{ + void* q = NULL; + if (eMSG_Q_SUCCESS != msg_q_init(&q)) { + LOC_LOGE("loc_eng_create_msg_q Q init failed."); + q = NULL; + } + return q; +} + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +/*=========================================================================== +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) +{ + ENTRY_LOG_CALLFLOW(); + + if (NULL == callbacks || 0 == event) { + LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); + EXIT_LOG(%d, 0); + return 0; + } + + STATE_CHECK((NULL == loc_eng_data.context), + "instance already initialized", return 0); + + memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + + // Create context (msg q + thread) (if not yet created) + // This will also parse gps.conf, if not done. + loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + + // 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; + + 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; + +#ifdef QCOM_FEATURE_ULP + loc_eng_ulp_init(&loc_eng_data); +#endif + + LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, + callbacks->location_ext_parser, callbacks->sv_ext_parser); + loc_eng_data.client_handle = getLocApiAdapter(locEngHandle); + + int ret_val =-1; + if (NULL == loc_eng_data.client_handle) { + // drop the context and declare failure + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + } else { + LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); + + // call reinit to send initialization messages + int tries = 30; + while (tries > 0 && + LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { + tries--; + LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); + sleep(1); + } + } + + 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_eng_data.client_handle->reinit(); + + if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { + LOC_LOGD("loc_eng_reinit reinit() successful"); + + loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, + gps_conf.SUPL_VER)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + supl_msg, loc_eng_free_msg); + + loc_eng_msg_sensor_control_config *sensor_control_config_msg( + new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_control_config_msg, loc_eng_free_msg); + + /* Make sure this is specified by the user in the gps.conf file */ + if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) + { + loc_eng_msg_sensor_properties *sensor_properties_msg( + new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_properties_msg, loc_eng_free_msg); + } + + loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( + new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, + gps_conf.SENSOR_CONTROL_MODE, + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_perf_control_conf_msg, loc_eng_free_msg); + } + + 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.context, return); + + // XTRA has no state, so we are fine with it. + + // we need to check and clear NI + + // 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; + } + + if (loc_eng_data.navigating) + { + 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. + + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + + // De-initialize ulp + if (locEngUlpInf != NULL) + { + locEngUlpInf->destroy (); + locEngUlpInf = NULL; + } + + if (loc_eng_data.client_handle != NULL) + { + LOC_LOGD("loc_eng_init: client opened. close it now."); + delete loc_eng_data.client_handle; + loc_eng_data.client_handle = NULL; + } + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + +#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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + if (NULL == locEngUlpInf || + locEngUlpInf->start_fix () == 1) { + ret_val = loc_eng_data.client_handle->startFix(); + } +#else + ret_val = loc_eng_data.client_handle->startFix(); +#endif + + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) + { + loc_eng_data.navigating = TRUE; + } + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_stop + +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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + // Stops the ULP + if (locEngUlpInf != NULL) + { + locEngUlpInf->stop_fix (); + } +#endif + + ret_val = loc_eng_data.client_handle->stopFix(); + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS && + loc_eng_data.fix_session_status != GPS_STATUS_SESSION_BEGIN) + { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); + } + + loc_eng_data.navigating = 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, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + loc_eng_msg_position_mode *msg( + new loc_eng_msg_position_mode(&loc_eng_data, mode, + recurrence, min_interval, + preferred_accuracy, preferred_time)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_set_time *msg( + new loc_eng_msg_set_time(&loc_eng_data, + time, + timeReference, + uncertainty)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_inject_location *msg( + new loc_eng_msg_inject_location(&loc_eng_data, + latitude, + longitude, + accuracy)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return); + + loc_eng_msg_delete_aiding_data *msg( + new loc_eng_msg_delete_aiding_data(&loc_eng_data, + f)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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(); + + static GpsStatusValue last_status = GPS_STATUS_NONE; + + GpsStatus gs = { sizeof(gs),status }; + + + if (loc_eng_data.status_cb) + { + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); + loc_eng_data.status_cb(&gs); + + // Restore session begin if needed + if (status == GPS_STATUS_ENGINE_ON && last_status == GPS_STATUS_SESSION_BEGIN) + { + GpsStatus gs_sess_begin = { sizeof(gs_sess_begin),GPS_STATUS_SESSION_BEGIN }; + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs_sess_begin.status)); + loc_eng_data.status_cb(&gs_sess_begin); + } + } + + last_status = status; + + EXIT_LOG(%s, VOID_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(%p, 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, AGpsCallbacks* callbacks) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return); + STATE_CHECK((NULL == loc_eng_data.agps_status_cb), + "agps instance already initialized", + return); + loc_eng_data.agps_status_cb = callbacks->status_cb; + + loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#ifdef QCOM_FEATURE_IPV6 + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_WWAN_ANY); +#else + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#endif + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + + loc_eng_agps_reinit(loc_eng_data); + EXIT_LOG(%p, VOID_RET); +} + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, + apn_len, bearerType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, + const char* apn) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, apn, + apn_len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== + +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; + + if (LOC_AGPS_SUPL_SERVER == type) { + char url[MAX_URL_LEN]; + unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + + if (sizeof(url) > len) { + loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, + url, len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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); + loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, + ip, + port, + type)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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; + + if (NULL != loc_eng_data.context) + { + ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); + } else { + LOC_LOGW("set_server called before init. 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); + } + } + + 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(); + INIT_CHECK(loc_eng_data.context, 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); + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, + apn_len, available)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + 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 + if (status != GPS_STATUS_NONE && + !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.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); + + if (loc_eng_data.agps_status_cb != NULL) { + loc_eng_data.agnss_nif->dropAllSubscribers(); + loc_eng_data.internet_nif->dropAllSubscribers(); + + loc_eng_agps_reinit(loc_eng_data); + } + + loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); + + // modem is back up. If we crashed in the middle of navigating, we restart. + if (loc_eng_data.navigating) { + loc_eng_data.client_handle->setPositionMode( + loc_eng_data.position_mode.pMode, + loc_eng_data.position_mode.pRecurrence, + loc_eng_data.position_mode.minInterval, + loc_eng_data.position_mode.preferredAccuracy, + loc_eng_data.position_mode.preferredTime); + // not mutex protected, assuming fw won't call start twice without a + // stop call in between. + loc_eng_start_handler(loc_eng_data); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_deferred_action_thread + +DESCRIPTION + Main routine for the thread to execute loc_eng commands. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_deferred_action_thread(void* arg) +{ + ENTRY_LOG(); + loc_eng_msg *msg; + static int cnt = 0; + LocEngContext* context = (LocEngContext*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + while (1) + { + LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); + + // we are only sending / receiving msg pointers + msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; + } + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; + + LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", + __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); + + // need to ensure the instance data is valid + STATE_CHECK(NULL != loc_eng_data_p->context, + "instance cleanup happened", + delete msg; return); + + switch(msg->msgid) { + case LOC_ENG_MSG_QUIT: + { + LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; + pthread_mutex_lock(&(context->lock)); + pthread_cond_signal(&(context->cond)); + pthread_mutex_unlock(&(context->lock)); + EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); + } + return; + + case LOC_ENG_MSG_REQUEST_NI: + { + loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; + loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_INFORM_NI_RESPONSE: + { + loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; + loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, + nrMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_START_FIX: + loc_eng_start_handler(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_STOP_FIX: + if (loc_eng_data_p->agps_request_pending) + { + loc_eng_data_p->stop_request_pending = true; + LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); + } else { + loc_eng_stop_handler(*loc_eng_data_p); + } + break; + + case LOC_ENG_MSG_SET_POSITION_MODE: + { + loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; + loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, + pmMsg->minInterval,pmMsg->preferredAccuracy, + pmMsg->preferredTime); + memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); + } + break; + + case LOC_ENG_MSG_SET_TIME: + { + loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; + loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, + tMsg->uncertainty); + } + break; + + case LOC_ENG_MSG_INJECT_LOCATION: + { + loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; + loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, + ilMsg->accuracy); + } + break; + + case LOC_ENG_MSG_SET_SERVER_IPV4: + { + loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; + loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, + ssiMsg->port, + ssiMsg->serverType); + } + break; + + case LOC_ENG_MSG_SET_SERVER_URL: + { + loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; + loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); + } + break; + + case LOC_ENG_MSG_SUPL_VERSION: + { + loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; + loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: + { + loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; + loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: + { + loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: + { + loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; + loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); + } + break; + + case LOC_ENG_MSG_REPORT_POSITION: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; + if (loc_eng_data_p->location_cb != NULL) { + if (LOC_SESS_FAILURE == rpMsg->status) { + // in case we want to handle the failure case + loc_eng_data_p->location_cb(NULL, NULL); + } + // what's in the else if is... (line by line) + // 1. this is a good fix; or + // 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 == rpMsg->status || + (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && + !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && + (gps_conf.ACCURACY_THRES != 0) && + (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), + (void*)rpMsg->locationExt); + } + } + } + + break; + + case LOC_ENG_MSG_REPORT_SV: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; + if (loc_eng_data_p->sv_status_cb != NULL) { + loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), + (void*)rsMsg->svExt); + } + } + break; + + case LOC_ENG_MSG_REPORT_STATUS: + loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); + break; + + case LOC_ENG_MSG_REPORT_NMEA: + if (NULL != loc_eng_data_p->nmea_cb) { + loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + } + break; + + case LOC_ENG_MSG_REQUEST_BIT: + { + loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; + AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_BIT: + { + loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; + AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); + + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_REQUEST_ATL: + { + loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + ATLSubscriber subscriber(arqMsg->handle, + stateMachine, + loc_eng_data_p->client_handle); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_ATL: + { + loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; + ATLSubscriber s1(arlMsg->handle, + loc_eng_data_p->agnss_nif, + loc_eng_data_p->client_handle); + // attempt to unsubscribe from agnss_nif first + if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + ATLSubscriber s2(arlMsg->handle, + loc_eng_data_p->internet_nif, + loc_eng_data_p->client_handle); + // if unsuccessful, try internet_nif + loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); + } + } + break; + + case LOC_ENG_MSG_REQUEST_XTRA_DATA: + if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) + { + loc_eng_data_p->xtra_module_data.download_request_cb(); + } + break; + + case LOC_ENG_MSG_REQUEST_TIME: + break; + + case LOC_ENG_MSG_REQUEST_POSITION: + break; + + case LOC_ENG_MSG_DELETE_AIDING_DATA: + loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; + break; + + case LOC_ENG_MSG_ENABLE_DATA: + { + loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; + loc_eng_data_p->client_handle->enableData(unaMsg->enable); + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + } + break; + + case LOC_ENG_MSG_INJECT_XTRA_DATA: + { + loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; + loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_SUCCESS: + { + loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + + stateMachine->setBearer(aosMsg->bearerType); +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + stateMachine->setAPN(aosMsg->apn, aosMsg->length); + stateMachine->onRsrcEvent(RSRC_GRANTED); + } + break; + + case LOC_ENG_MSG_ATL_CLOSED: + { + loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_RELEASED); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_FAILED: + { + loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_DENIED); + } + break; + + case LOC_ENG_MSG_ENGINE_DOWN: + loc_eng_handle_engine_down(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_ENGINE_UP: + loc_eng_handle_engine_up(*loc_eng_data_p); + break; + + default: + LOC_LOGE("unsupported msgid = %d\n", msg->msgid); + break; + } + + if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | + (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | + (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) + { + loc_eng_data_p->agps_request_pending = false; + if (loc_eng_data_p->stop_request_pending) { + loc_eng_stop_handler(*loc_eng_data_p); + loc_eng_data_p->stop_request_pending = false; + } + } + loc_eng_data_p->stop_request_pending = false; + + if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && + loc_eng_data_p->aiding_data_for_deletion != 0) + { + loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); + loc_eng_data_p->aiding_data_for_deletion = 0; + } + + delete msg; + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_report_position_ulp + +DESCRIPTION + Report a ULP position + p_ulp_pos_absolute, ULP position in absolute coordinates + +DEPENDENCIES + None + +RETURN VALUE + 0: SUCCESS + others: error + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_report_position_ulp (void* handle, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data) +{ + ENTRY_LOG(); + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; + + INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, + return -1); + + if (ext_data_length > sizeof (extra_data)) + { + ext_data_length = sizeof (extra_data); + } + + memcpy(extra_data, + ext_data, + ext_data_length); + + loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, + NULL, LOC_SESS_SUCCESS); + + EXIT_LOG(%d, 0); + return 0; +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_eng_ulp_init + +DESCRIPTION + This function dynamically loads the libulp.so and calls + its init function to start up the ulp module + +DEPENDENCIES + None + +RETURN VALUE + 0: no error + -1: errors + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_ulp_init(void* owner) +{ + ENTRY_LOG(); + int ret_val; + void *handle; + const char *error; + get_ulp_interface* get_ulp_inf; + + if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { + LOC_LOGD ("%s, ULP is not supported\n", __func__); + ret_val = -1; + goto exit; + } + + handle = dlopen ("libulp.so", RTLD_NOW); + if (!handle) + { + LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); + ret_val = -1; + goto exit; + } + dlerror(); /* Clear any existing error */ + + get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); + ret_val = -1; + goto exit; + } + + locEngUlpInf = get_ulp_inf(); + + // Initialize the ULP interface + locEngUlpInf->init (owner, loc_eng_report_position_ulp); + + ret_val = 0; +exit: + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + boolean ret_val; + LOC_LOGD("loc_eng_send_extra_command: %s\n", command); + ret_val = TRUE; + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +/*=========================================================================== +FUNCTION loc_eng_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + int ret_val; + ret_val = 0; + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h new file mode 100755 index 00000000..73578ec8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -0,0 +1,204 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#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 MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) + +enum loc_mute_session_e_type { + LOC_MUTE_SESS_NONE = 0, + LOC_MUTE_SESS_WAIT, + LOC_MUTE_SESS_IN_SESSION +}; + +// Module data +typedef struct +{ + LocApiAdapter *client_handle; + loc_location_cb_ext location_cb; + gps_status_callback status_cb; + loc_sv_status_cb_ext sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + boolean intermediateFix; + AGpsStatusValue agps_status; + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; + loc_eng_xtra_data_s_type xtra_module_data; + loc_eng_ni_data_s_type loc_eng_ni_data; + + boolean navigating; + + // AGPS state machines + AgpsStateMachine* agnss_nif; + AgpsStateMachine* internet_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; + + void* context; + + loc_eng_msg_position_mode position_mode; + + // For muting session broadcast + loc_mute_session_e_type mute_session_state; + + // 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_eng_data_s_type; + + +int loc_eng_init(loc_eng_data_s_type &loc_eng_data, + LocCallbacks* callbacks, + LOC_API_ADAPTER_EVENT_MASK_T event); +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, + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); +const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, + const char* name); +#ifdef QCOM_FEATURE_ULP +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria); +#endif + +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, + AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); +#endif + +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); + + +void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, + int avaiable, const char* apn); + + +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length); + + +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); + +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + GpsXtraCallbacks* callbacks); + +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length); + +extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, + GpsNiCallbacks *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); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp new file mode 100755 index 00000000..07475680 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -0,0 +1,702 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +//====================================================================== +// 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; + + +//====================================================================== +// Subscriber: BITSubscriber / ATLSubscriber +//====================================================================== +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(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); +} + +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( + GPSONE_LOC_API_IF_RELEASE_SUCCESS); + break; + case RSRC_DENIED: + loc_eng_dmn_conn_loc_api_server_data_conn( + GPSONE_LOC_API_IF_FAILURE); + break; + case RSRC_GRANTED: + loc_eng_dmn_conn_loc_api_server_data_conn( + 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: + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + break; + case RSRC_DENIED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + case RSRC_GRANTED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + default: + notify = false; + } + } + + return notify; +} + + +//====================================================================== +// 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) +{ + 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); + // move the state to PENDING + nextState = mPendingState; + + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } + 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;; + 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(); + if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasingState; + } + } 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); + } + } + } + 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; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // 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;; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } + } + break; + + 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->hasSubscribers()) { + nextState = mPendingState; + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } else { + nextState = mReleasedState; + } + } + break; + + case RSRC_GRANTED: + case RSRC_DENIED: + 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; +} + + +//====================================================================== +// AgpsStateMachine +//====================================================================== + +AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), + AGpsType type) : + mServicer(servicer), mType(type), + mStatePtr(new AgpsReleasedState(this)), + mAPN(NULL), + mAPNLen(0) +{ + 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; + 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); + } + } 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); + } +} + +void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +{ + Subscriber* s = NULL; + Notification notification(Notification::BROADCAST_ALL); + linked_list_search(mSubscribers, (void**)&s, hasSubscriber, + (void*)¬ification, false); + + if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { + AGpsStatus nifRequest; + nifRequest.size = sizeof(nifRequest); + nifRequest.type = mType; + nifRequest.status = action; + +#ifdef QCOM_FEATURE_IPV6 + if (s == NULL) { + nifRequest.ipv4_addr = INADDR_NONE; + nifRequest.ipv6_addr[0] = 0; + } else { + s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + } +#else + if (s == NULL) { + nifRequest.ipaddr = INADDR_NONE; + } else { + nifRequest.ipaddr = s->ID; + } +#endif + + CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); + (*mServicer)(&nifRequest); + } +} + +void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) +{ + 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; +} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h new file mode 100755 index 00000000..1fd0f450 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -0,0 +1,274 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +// forward declaration +class AgpsStateMachine; +class Subscriber; + +// NIF resource events +typedef enum { + RSRC_SUBSCRIBE, + RSRC_UNSUBSCRIBE, + RSRC_GRANTED, + RSRC_RELEASED, + RSRC_DENIED, + RSRC_STATUS_MAX +} AgpsRsrcStatus; + +// 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; + + // 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 AgpsStateMachine { + // 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; + + // handle to whoever provides the service + void (* const mServicer)(AGpsStatus* status); + // NIF type: AGNSS or INTERNET. + const AGpsType mType; + // pointer to the current state. + AgpsState* mStatePtr; + // a linked list of subscribers. + void* mSubscribers; + // 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; +#ifdef QCOM_FEATURE_IPV6 + // bear + AGpsBearerType mBearer; +#endif + // ipv4 address for routing + +public: + AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); + virtual ~AgpsStateMachine(); + + // self explanatory methods below + void setAPN(const char* apn, unsigned int len); + inline const char* getAPN() const { return (const char*)mAPN; } +#ifdef QCOM_FEATURE_IPV6 + inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline AGpsBearerType getBearer() const { return mBearer; } +#endif + inline AGpsType getType() const { return (AGpsType)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; + + void onRsrcEvent(AgpsRsrcStatus event); + + // put the data together and send the FW + void sendRsrcRequest(AGpsStatusValue action) const; + + 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; +}; + +// 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 int ID; + const AgpsStateMachine* mStateMachine; + inline Subscriber(const int id, + const AgpsStateMachine* stateMachine) : + ID(id), mStateMachine(stateMachine) {} + inline virtual ~Subscriber() {} + + virtual void setIPAddresses(int &v4, char* v6) = 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 { + inline BITSubscriber(const AgpsStateMachine* stateMachine, + unsigned int ipv4, char* ipv6) : + Subscriber(ipv4, stateMachine) + { + if (NULL == ipv6) { + ipv6Addr[0] = NULL; + } else { + memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); + } + } + + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } + + virtual Subscriber* clone() + { + return new BITSubscriber(mStateMachine, ID, ipv6Addr); + } + + virtual bool equals(const Subscriber *s) const; + +private: + char ipv6Addr[16]; +}; + +// ATLSubscriber, created with requests from ATL +struct ATLSubscriber : public Subscriber { + const LocApiAdapter* mLocAdapter; + inline ATLSubscriber(const int id, + const AgpsStateMachine* stateMachine, + const LocApiAdapter* adapter) : + Subscriber(id, stateMachine), mLocAdapter(adapter) {} + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = INADDR_NONE; v6[0] = 0; } + + inline virtual Subscriber* clone() + { + return new ATLSubscriber(ID, mStateMachine, mLocAdapter); + } +}; + +#endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp new file mode 100755 index 00000000..f2f9a501 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -0,0 +1,180 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#include "loc_eng_dmn_conn_glue_msg.h" +#include "loc_eng_dmn_conn_handler.h" +#include "loc_eng_dmn_conn.h" + +static int loc_api_server_msgqid; +static int loc_api_resp_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 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); + loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_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) { + LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); + usleep(1000); + return 0; + } + + 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); + 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 status) { + struct ctrl_msgbuf cmsgbuf; + cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; + cmsgbuf.cmsg.cmsg_response.result = status; + LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); + 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; + } + return 0; + +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h new file mode 100755 index 00000000..414fd553 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_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" + +#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); + +#endif /* LOC_ENG_DATA_SERVER_H */ + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c new file mode 100755 index 00000000..9cd19228 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -0,0 +1,223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h new file mode 100755 index 00000000..8bc6f2a3 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c new file mode 100755 index 00000000..74769088 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -0,0 +1,206 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*=========================================================================== +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, 0666); + + if ((result == -1) && (errno != EEXIST)) { + LOC_LOGE("failed: %s\n", strerror(errno)); + return result; + } + + 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) 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h new file mode 100755 index 00000000..3136e411 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp new file mode 100755 index 00000000..fd15f001 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -0,0 +1,78 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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; + } + + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); + +#else + loc_eng_dmn_conn_loc_api_server_data_conn(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 + loc_eng_msg_release_bit *msg( + new loc_eng_msg_release_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); +#else + loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); +#endif + return 0; +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h new file mode 100755 index 00000000..833e971b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -0,0 +1,82 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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; +}; + +struct ctrl_msg_if_request { + unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ + unsigned long ipv4_addr; + unsigned char ipv6_addr[16]; +}; + +/* 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c new file mode 100755 index 00000000..478b686f --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -0,0 +1,398 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h new file mode 100755 index 00000000..07869f90 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp new file mode 100755 index 00000000..d813cd65 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -0,0 +1,292 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "hardware/gps.h" +#include "loc.h" +#include "loc_log.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + +/* GPS status names */ +static 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 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 loc_name_val_s_type loc_eng_msgs[] = +{ + NAME_VAL( LOC_ENG_MSG_QUIT ), + NAME_VAL( LOC_ENG_MSG_ENGINE_DOWN ), + NAME_VAL( LOC_ENG_MSG_ENGINE_UP ), + NAME_VAL( LOC_ENG_MSG_START_FIX ), + NAME_VAL( LOC_ENG_MSG_STOP_FIX ), + NAME_VAL( LOC_ENG_MSG_SET_POSITION_MODE ), + NAME_VAL( LOC_ENG_MSG_SET_TIME ), + NAME_VAL( LOC_ENG_MSG_INJECT_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_INJECT_LOCATION ), + NAME_VAL( LOC_ENG_MSG_DELETE_AIDING_DATA ), + NAME_VAL( LOC_ENG_MSG_SET_APN ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_URL ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_IPV4 ), + NAME_VAL( LOC_ENG_MSG_ENABLE_DATA ), + NAME_VAL( LOC_ENG_MSG_SUPL_VERSION ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PROPERTIES ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_MUTE_SESSION ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_SUCCESS ), + NAME_VAL( LOC_ENG_MSG_ATL_CLOSED ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_FAILED ), + NAME_VAL( LOC_ENG_MSG_REPORT_POSITION ), + NAME_VAL( LOC_ENG_MSG_REPORT_SV ), + NAME_VAL( LOC_ENG_MSG_REPORT_STATUS ), + NAME_VAL( LOC_ENG_MSG_REPORT_NMEA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_ATL ), + NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), + NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), + NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), + NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), + NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) +}; +static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); + +/* Find Android GPS status name */ +const char* loc_get_msg_name(int id) +{ + return loc_get_name_from_val(loc_eng_msgs, loc_eng_msgs_num, (long) id); +} + + + +static 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 ) +}; +static 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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 ) +#ifdef QCOM_FEATURE_DELEXT + ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +#endif +}; +static 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 loc_name_val_s_type loc_eng_agps_types[] = +{ +#ifdef QCOM_FEATURE_IPV6 + NAME_VAL( AGPS_TYPE_INVALID ), + NAME_VAL( AGPS_TYPE_ANY ), +#endif + NAME_VAL( AGPS_TYPE_SUPL ), + NAME_VAL( AGPS_TYPE_C2K ) +#ifdef QCOM_FEATURE_IPV6 + ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) +#endif +}; +static 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 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 ) +}; +static 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 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 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 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 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); +} + +#ifdef QCOM_FEATURE_IPV6 +static 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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); +} +#endif + +static 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h new file mode 100755 index 00000000..eff1593b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -0,0 +1,62 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include "loc_eng_msg_id.h" + +const char* loc_get_gps_status_name(GpsStatusValue gps_status); +const char* loc_get_msg_name(int id); +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); +#ifdef QCOM_FEATURE_IPV6 +const char* loc_get_agps_bear_name(AGpsBearerType bear); +#endif +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_ENG_LOG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp new file mode 100755 index 00000000..97c0457c --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -0,0 +1,133 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_eng_msg.h" +#include "loc_eng_dmn_conn_glue_msg.h" + +#ifdef _ANDROID_ + +#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" + +#else + +#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" + +#endif + +int loc_eng_msgget(int * p_req_msgq) +{ + * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); + return 0; +} + +int loc_eng_msgremove(int req_msgq) +{ + loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); + return 0; +} + +int loc_eng_msgsnd(int msgqid, void * msgp) +{ + int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) +{ + int result; + + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + 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; +} + +int loc_eng_msgrcv(int msgqid, void ** msgp) +{ + int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) +{ + int result; + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); + if (result != sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); + return -1; + } + + if (msgsz < pmsg->msgsz) { + LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); + return -1; + } + + if (pmsg->msgsz > sizeof(struct msgbuf)) { + /* there is msg body */ + msgp += sizeof(struct msgbuf); + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); + + if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { + LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, + (pmsg->msgid), (int) pmsg->msgsz); + return -1; + } + } + + return pmsg->msgsz; +} + +int loc_eng_msgflush(int msgqid) +{ + return loc_eng_dmn_conn_glue_msgflush(msgqid); +} + +int loc_eng_msgunblock(int msgqid) +{ + return loc_eng_dmn_conn_glue_pipeunblock(msgqid); +} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h new file mode 100755 index 00000000..41548f09 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -0,0 +1,584 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#include "loc.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct loc_eng_msg { + const void* owner; + const int msgid; + inline loc_eng_msg(void* instance, int id) : + owner(instance), msgid(id) + { + LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); + } + virtual ~loc_eng_msg() + { + LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); + } +}; + +struct loc_eng_msg_suple_version : public loc_eng_msg { + const int supl_version; + inline loc_eng_msg_suple_version(void* instance, int version) : + loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), + supl_version(version) + { + LOC_LOGV("SUPL Version: %d", version); + } +}; + +struct loc_eng_msg_sensor_control_config : public loc_eng_msg { + const int sensorsDisabled; + inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), + sensorsDisabled(disabled) + { + LOC_LOGV("Sensors Disabled: %d", disabled); + } +}; + +struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const float gyroBiasVarianceRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) + { + LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); + } +}; + +struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { + const int controlMode; + const int accelSamplesPerBatch; + const int accelBatchesPerSec; + const int gyroSamplesPerBatch; + const int gyroBatchesPerSec; + inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), + controlMode(controlMode), + accelSamplesPerBatch(accelSamplesPerBatch), + accelBatchesPerSec(accelBatchesPerSec), + gyroSamplesPerBatch(gyroSamplesPerBatch), + gyroBatchesPerSec(gyroBatchesPerSec) + { + LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + } +}; + + +struct loc_eng_msg_position_mode : public loc_eng_msg { + const LocPositionMode pMode; + const GpsPositionRecurrence pRecurrence; + const uint32_t minInterval; + const uint32_t preferredAccuracy; + const uint32_t preferredTime; + inline loc_eng_msg_position_mode() : + loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(LOC_POSITION_MODE_STANDALONE), + pRecurrence(0), minInterval(0), + preferredAccuracy(0), preferredTime(0) {} + inline loc_eng_msg_position_mode(void* instance, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(mode), pRecurrence(recurrence), minInterval(min_interval), + preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) + { + LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", + loc_get_position_mode_name(pMode), + loc_get_position_recurrence_name(pRecurrence), + minInterval, + preferredAccuracy, + preferredTime); + } +}; + +struct loc_eng_msg_set_time : public loc_eng_msg { + const GpsUtcTime time; + const int64_t timeReference; + const int uncertainty; + inline loc_eng_msg_set_time(void* instance, + GpsUtcTime t, + int64_t tf, + int unc) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), + time(t), timeReference(tf), uncertainty(unc) + { + LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", + time, timeReference, uncertainty); + } +}; + +struct loc_eng_msg_inject_location : public loc_eng_msg { + const double latitude; + const double longitude; + const float accuracy; + inline loc_eng_msg_inject_location(void* instance, double lat, + double longi, float accur) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), + latitude(lat), longitude(longi), accuracy(accur) + { + LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", + latitude, longitude, accuracy); + } +}; + +struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { + const GpsAidingData type; + inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : + loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) + { + LOC_LOGV("aiding data msak %d", type); + } +}; + +struct loc_eng_msg_report_position : public loc_eng_msg { + const GpsLocation location; + const void* locationExt; + const enum loc_sess_status status; + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + enum loc_sess_status st) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), + location(loc), locationExt(locExt), status(st) + { +#ifdef QCOM_FEATURE_ULP + 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: %s", + location.flags, location.position_source, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, location.rawDataSize, location.rawData, + loc_get_position_sess_status_name(status)); +#else + LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", + location.flags, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, loc_get_position_sess_status_name(status)); +#endif + } +}; + +struct loc_eng_msg_report_sv : public loc_eng_msg { + const GpsSvStatus svStatus; + const void* svExt; + inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) + { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", + svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); + for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + svStatus.sv_list[i].prn, + svStatus.sv_list[i].snr, + svStatus.sv_list[i].elevation, + svStatus.sv_list[i].azimuth); + } + } +}; + +struct loc_eng_msg_report_status : public loc_eng_msg { + const GpsStatusValue status; + inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) + { + LOC_LOGV("status: %s", loc_get_gps_status_name(status)); + } +}; + +struct loc_eng_msg_report_nmea : public loc_eng_msg { + char* const nmea; + const int length; + inline loc_eng_msg_report_nmea(void* instance, + const char* data, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), + nmea(new char[len]), length(len) + { + memcpy((void*)nmea, (void*)data, len); + LOC_LOGV("length: %d\n nmea: %p - %c%c%c", + length, nmea, nmea[3], nmea[4], nmea[5]); + } + inline ~loc_eng_msg_report_nmea() + { + delete[] nmea; + } +}; + +struct loc_eng_msg_request_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_request_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_request_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_release_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_release_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_release_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_request_atl : public loc_eng_msg { + const int handle; + const AGpsType type; + inline loc_eng_msg_request_atl(void* instance, int hndl, + AGpsType agps_type) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), + handle(hndl), type(agps_type) + { + LOC_LOGV("handle: %d\n agps type: %s", + handle, + loc_get_agps_type_name(type)); + } +}; + +struct loc_eng_msg_release_atl : public loc_eng_msg { + const int handle; + inline loc_eng_msg_release_atl(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) + { + LOC_LOGV("handle: %d", handle); + } +}; + +struct loc_eng_msg_request_ni : public loc_eng_msg { + const GpsNiNotification notify; + const void *passThroughData; + inline loc_eng_msg_request_ni(void* instance, + GpsNiNotification ¬if, const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), + notify(notif), passThroughData(data) + { + 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", + notify.notification_id, + loc_get_ni_type_name(notify.ni_type), + notify.notify_flags, + notify.timeout, + loc_get_ni_response_name(notify.default_response), + loc_get_ni_encoding_name(notify.requestor_id_encoding), + loc_get_ni_encoding_name(notify.text_encoding), + passThroughData); + } +}; + +struct loc_eng_msg_inform_ni_response : public loc_eng_msg { + const GpsUserResponseType response; + const void *passThroughData; + inline loc_eng_msg_inform_ni_response(void* instance, + GpsUserResponseType resp, + const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), + response(resp), passThroughData(data) + { + LOC_LOGV("response: %s\n passThroughData: %p", + loc_get_ni_response_name(response), + passThroughData); + } + inline ~loc_eng_msg_inform_ni_response() + { + // this is a bit weird since passThroughData is not + // allocated by this class. But there is no better way. + // passThroughData actually won't be NULL here. + // But better safer than sorry. + if (NULL != passThroughData) { + free((void*)passThroughData); + } + } +}; + +struct loc_eng_msg_set_apn : public loc_eng_msg { + char* const apn; + inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s", apn); + } + inline ~loc_eng_msg_set_apn() + { + delete[] apn; + } +}; + + + +struct loc_eng_msg_set_server_ipv4 : public loc_eng_msg { + const unsigned int nl_addr; + const int port; + const LocServerType serverType; + inline loc_eng_msg_set_server_ipv4(void* instance, + unsigned int ip, + int p, + LocServerType type) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), + nl_addr(ip), port(p), serverType(type) + { + LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); + } +}; + + +struct loc_eng_msg_set_server_url : public loc_eng_msg { + const int len; + char* const url; + inline loc_eng_msg_set_server_url(void* instance, + const char* urlString, + int url_len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), + len(url_len), url(new char[len+1]) + { + memcpy((void*)url, (void*)urlString, url_len); + url[len] = 0; + LOC_LOGV("url: %s", url); + } + inline ~loc_eng_msg_set_server_url() + { + delete[] url; + } +}; + +struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { + char* const data; + const int length; + inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), + data(new char[l]), length(l) + { + memcpy((void*)data, (void*)d, l); + LOC_LOGV("length: %d\n data: %p", length, data); + } + inline ~loc_eng_msg_inject_xtra_data() + { + delete[] data; + } +}; + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const AGpsStatusValue agpsType; + const int length; + char* const apn; + const AGpsBearerType bearerType; + inline loc_eng_msg_atl_open_success(void* instance, + AGpsStatusValue atype, + const char* name, + int len, + AGpsBearerType btype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + agpsType(atype), length(len), + apn(new char[len+1]), bearerType(btype) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", + loc_get_agps_type_name(agpsType), + apn, + loc_get_agps_bear_name(bearerType)); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#else +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const int length; + char* const apn; + inline loc_eng_msg_atl_open_success(void* instance, + const char* name, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + length(len), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n", + apn); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_open_failed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + inline loc_eng_msg_atl_open_failed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) + { + LOC_LOGV(""); + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_closed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_closed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_closed : public loc_eng_msg { + inline loc_eng_msg_atl_closed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) + { + LOC_LOGV(""); + } +}; +#endif + +struct loc_eng_msg_set_data_enable : public loc_eng_msg { + const int enable; + char* const apn; + const int length; + inline loc_eng_msg_set_data_enable(void* instance, + const char* name, + int len, + int yes) : + loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), + enable(yes), apn(new char[len+1]), length(len) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n enable: %d", apn, enable); + } + inline ~loc_eng_msg_set_data_enable() + { + delete[] apn; + } +}; + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); +int loc_eng_msgget(int * p_req_msgq); +int loc_eng_msgremove(int req_msgq); +int loc_eng_msgsnd(int msgqid, void * msgp); +int loc_eng_msgrcv(int msgqid, void ** msgp); +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); +int loc_eng_msgflush(int msgqid); +int loc_eng_msgunblock(int msgqid); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h new file mode 100755 index 00000000..f05f1f44 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ID_H +#define LOC_ENG_MSG_ID_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct msgbuf { + unsigned int msgsz; + void* msgid; +}; + +enum loc_eng_msg_ids_t { + /* 0x 0 - 0xEF is reserved for daemon internal */ + /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ + LOC_ENG_MSG_QUIT = 0x200, + + LOC_ENG_MSG_ENGINE_DOWN, + LOC_ENG_MSG_ENGINE_UP, + + LOC_ENG_MSG_START_FIX, + LOC_ENG_MSG_STOP_FIX, + LOC_ENG_MSG_SET_POSITION_MODE, + LOC_ENG_MSG_SET_TIME, + LOC_ENG_MSG_INJECT_XTRA_DATA, + LOC_ENG_MSG_INJECT_LOCATION, + LOC_ENG_MSG_DELETE_AIDING_DATA, + LOC_ENG_MSG_SET_APN, + LOC_ENG_MSG_SET_SERVER_URL, + LOC_ENG_MSG_SET_SERVER_IPV4, + LOC_ENG_MSG_ENABLE_DATA, + + LOC_ENG_MSG_SUPL_VERSION, + LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG, + LOC_ENG_MSG_SET_SENSOR_PROPERTIES, + LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG, + LOC_ENG_MSG_MUTE_SESSION, + + LOC_ENG_MSG_ATL_OPEN_SUCCESS, + LOC_ENG_MSG_ATL_CLOSED, + LOC_ENG_MSG_ATL_OPEN_FAILED, + + LOC_ENG_MSG_REPORT_POSITION, + LOC_ENG_MSG_REPORT_SV, + LOC_ENG_MSG_REPORT_STATUS, + LOC_ENG_MSG_REPORT_NMEA, + LOC_ENG_MSG_REQUEST_BIT, + LOC_ENG_MSG_RELEASE_BIT, + LOC_ENG_MSG_REQUEST_ATL, + LOC_ENG_MSG_RELEASE_ATL, + LOC_ENG_MSG_REQUEST_NI, + LOC_ENG_MSG_INFORM_NI_RESPONSE, + LOC_ENG_MSG_REQUEST_XTRA_DATA, + LOC_ENG_MSG_REQUEST_TIME, + LOC_ENG_MSG_REQUEST_POSITION +}; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_ID_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp new file mode 100755 index 00000000..c2d78af8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -0,0 +1,313 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ +static void* ni_thread_proc(void *args); + +/*=========================================================================== + +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; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + /* If busy, use default or deny */ + if (NULL != loc_eng_ni_data_p->rawRequest) + { + /* XXX Consider sending a NO RESPONSE reply or queue the request */ + LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); + } + } + else { + /* Save request */ + loc_eng_ni_data_p->rawRequest = (void*)passThrough; + + /* Fill in notification */ + ((GpsNiNotification*)notif)->notification_id = loc_eng_ni_data_p->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. + **/ + loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); + + int rc = 0; + rc = pthread_create(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); + if (rc) + { + LOC_LOGE("Loc NI thread is not created.\n"); + } + rc = pthread_detach(loc_eng_ni_data_p->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); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + +FUNCTION ni_thread_proc + +===========================================================================*/ +static void* ni_thread_proc(void *args) +{ + ENTRY_LOG(); + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; + 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(&loc_eng_ni_data_p->tLock); + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->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, loc_eng_ni_data_p->respTimeLeft ); + + while (!loc_eng_ni_data_p->respRecvd) + { + rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, + &loc_eng_ni_data_p->tLock, + &expire_time); + if (rc == ETIMEDOUT) + { + loc_eng_ni_data_p->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 ); + loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + + // adding this check to support modem restart, in which case, we need the thread + // to exit without calling sending data to loc_eng_msg_q. We made sure that + // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() + loc_eng_msg_inform_ni_response *msg = NULL; + + if (NULL != loc_eng_ni_data_p->rawRequest) { + loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; + msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + } + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + + loc_eng_ni_data_p->respTimeLeft = 0; + loc_eng_ni_data_p->reqID++; + + if (NULL != msg) { + loc_eng_msg_sender(loc_eng_data_p, 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->rawRequest) { + free(loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + // the goal is to wake up ni_thread_proc + // and let it exit. + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->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, GpsNiCallbacks *callbacks) +{ + ENTRY_LOG_CALLFLOW(); + + 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->respTimeLeft = 0; + loc_eng_ni_data_p->respRecvd = FALSE; + loc_eng_ni_data_p->rawRequest = NULL; + loc_eng_ni_data_p->reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->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; + + 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->reqID && + NULL != loc_eng_ni_data_p->rawRequest) + { + LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + loc_eng_ni_data_p->resp = user_response; + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + } + else { + LOC_LOGE("loc_eng_ni_respond: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", + loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); + } + + EXIT_LOG(%s, VOID_RET); +} diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h new file mode 100755 index 00000000..9b1c5f34 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +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; +} loc_eng_ni_data_s_type; + + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp new file mode 100755 index 00000000..ebc7c6fb --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -0,0 +1,90 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + + +/*=========================================================================== +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, + GpsXtraCallbacks* callbacks) +{ + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &loc_eng_data.xtra_module_data; + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +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: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length) +{ + loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, + data, length)); + loc_eng_msg_sender(&loc_eng_data, msg); + + return 0; +} diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h new file mode 100755 index 00000000..7e01e146 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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; + + // 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/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk new file mode 100755 index 00000000..b6c7a66e --- /dev/null +++ b/loc_api/loc_api_v02/Android.mk @@ -0,0 +1,43 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api_v02 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libloc_adapter \ + libgps.utils + +LOCAL_SRC_FILES += \ + LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +## Includes +LOCAL_C_INCLUDES := \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp new file mode 100755 index 00000000..e223983b --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -0,0 +1,2056 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "LocApiV02Adapter.h" +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" +#include "LocApiAdapter.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_adapter" +#include "loc_util_log.h" + + +/* Default session id ; TBD needs incrementing for each */ +#define LOC_API_V02_DEF_SESSION_ID (1) + +/* Default minimium interval in ms */ +#define LOC_API_V02_DEF_MIN_INTERVAL (1000) + +/* Default horizontal accuracy in meters*/ +#define LOC_API_V02_DEF_HORZ_ACCURACY (50) + +/* Default timeout in ms; TBD: needs implementing */ +#define LOC_API_V02_DEF_TIMEOUT (120000) + +/* UMTS CP Address key*/ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +/* GPS SV Id offset */ +#define GPS_SV_ID_OFFSET (1) + +/* GLONASS SV Id offset */ +#define GLONASS_SV_ID_OFFSET (65) + +/* SV ID range */ +#define SV_ID_RANGE (32) + + + +/* static event callbacks that call the LocApiV02Adapter callbacks*/ + +/* global event callback, call the eventCb function in loc api adapter v02 + instance */ +static void globalEventCb(locClientHandleType clientHandle, + uint32_t eventId, + const locClientEventIndUnionType eventPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, eventId, pClientCookie); + + // return if null is passed + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", + __func__, __LINE__, clientHandle, eventId); + return; + } + locApiV02AdapterInstance->eventCb(clientHandle, + eventId, + eventPayload); +} + +/* global response callback, it calls the sync request process + indication function to unblock the request that is waiting on this + response indication*/ +static void globalRespCb(locClientHandleType clientHandle, + uint32_t respId, + const locClientRespIndUnionType respPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + + LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, respId, pClientCookie); + + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", + __func__, __LINE__, clientHandle, respId); + return; + } + // process the sync call + // use pDeleteAssistDataInd as a dummy pointer + loc_sync_process_ind(clientHandle, respId, + (void *)respPayload.pDeleteAssistDataInd); +} + +/* global error callback, it will call the handle service down + function in the loc api adapter instance. */ +static void globalErrorCb (locClientHandleType clientHandle, + locClientErrorEnumType errorId, + void *pClientCookie) +{ + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, errorId, pClientCookie); + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", + __func__, __LINE__, clientHandle, errorId); + return; + } + locApiV02AdapterInstance->errorCb(clientHandle, + errorId); +} + +/* global structure containing the callbacks */ +locClientCallbacksType globalCallbacks = +{ + sizeof(locClientCallbacksType), + globalEventCb, + globalRespCb, + globalErrorCb +}; + +/* Constructor for LocApiV02Adapter */ +LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): + LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), + eventMask(convertMask(locEng.eventMask)), navigating(false), + fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, + LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, + LOC_API_V02_DEF_TIMEOUT ) +{ + // initialize loc_sync_req interface + loc_sync_req_init(); +} + +/* Destructor for LocApiV02Adapter */ +LocApiV02Adapter :: ~LocApiV02Adapter() +{ + deInitLocClient(); +} + +/* close Loc API V02 client */ +int LocApiV02Adapter :: deInitLocClient() +{ + return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; +} + +/* Initialize a loc api v02 client */ +enum loc_api_adapter_err LocApiV02Adapter :: reinit() +{ + locClientStatusEnumType status; + /* If the client is already open close it first */ + if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) + { + status = locClientClose(&clientHandle); + if( eLOC_CLIENT_SUCCESS != status) + { + LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, + __LINE__, status); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + } + + LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, + __LINE__, this); + /* initialize the loc api v02 interface, note that + the locClientOpen() function will block if the + service is unavailable for a fixed time out */ + + status = locClientOpen( + eventMask, &globalCallbacks, &clientHandle, (void *)this); + + if (eLOC_CLIENT_SUCCESS != status || + clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) + { + LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, + __LINE__, loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + + // return SUCCESS + return (LOC_API_ADAPTER_ERR_SUCCESS); +} + +/* start positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: startFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStartReqMsgT_v02 start_msg; + + qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; + qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; + + // clear all fields, validity masks + memset (&start_msg, 0, sizeof(start_msg)); + memset (&set_mode_msg, 0, sizeof(set_mode_msg)); + memset (&set_mode_ind, 0, sizeof(set_mode_ind)); + + LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + + // fill in the start request + switch(fixCriteria.mode) + { + case LOC_POSITION_MODE_MS_BASED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; + break; + + case LOC_POSITION_MODE_MS_ASSISTED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; + break; + + case LOC_POSITION_MODE_RESERVED_4: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; + break; + + default: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; + break; + } + + req_union.pSetOperationModeReq = &set_mode_msg; + + // send the mode first, before the start message. + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_OPERATION_MODE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_OPERATION_MODE_IND_V02, + &set_mode_ind); // NULL? + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) + { + LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " + "ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_mode_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error + } + + if(fixCriteria.min_interval > 0) + { + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; + } + + start_msg.horizontalAccuracyLevel_valid = 1; + + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } + + start_msg.fixRecurrence_valid = 1; + if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; + } + else + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; + } + + //dummy session id + // TBD: store session ID, check for session id in pos reports. + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; + + req_union.pStartReq = &start_msg; + + status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, + req_union ); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = true; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + // start_fix failed so MO fix is not in progress + navigating = false; + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; +} + +/* stop a positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: stopFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStopReqMsgT_v02 stop_msg; + + LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); + + memset(&stop_msg, 0, sizeof(stop_msg)); + + // dummy session id + stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pStopReq = &stop_msg; + + status = locClientSendReq(clientHandle, + QMI_LOC_STOP_REQ_V02, + req_union); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = false; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, + loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); +} + +/* set the positioning fix criteria */ +enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + + LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, + min_interval, mode, recurrence, preferred_accuracy); + + //store the fix criteria + fixCriteria.mode = mode; + + fixCriteria.recurrence = recurrence; + + if(min_interval == 0) + { + fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; + } + else + { + fixCriteria.min_interval = min_interval; + } + + fixCriteria.preferred_accuracy = preferred_accuracy; + + fixCriteria.preferred_time = preferred_time; + + if(true == navigating) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); + + return( startFix()); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject time into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; + qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; + + memset(&inject_time_msg, 0, sizeof(inject_time_msg)); + + inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; + + inject_time_msg.timeUtc = time; + + inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); + + inject_time_msg.timeUnc = uncertainty; + + req_union.pInjectUtcTimeReq = &inject_time_msg; + + LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, + uncertainty); + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_UTC_TIME_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_UTC_TIME_IND_V02, + &inject_time_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) + { + LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_time_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject position into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + injectPosition(double latitude, double longitude, float accuracy) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; + qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; + + memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); + + inject_pos_msg.latitude_valid = 1; + inject_pos_msg.latitude = latitude; + + inject_pos_msg.longitude_valid = 1; + inject_pos_msg.longitude = longitude; + + inject_pos_msg.horUncCircular_valid = 1; + + inject_pos_msg.horUncCircular = accuracy; //meters assumed + + inject_pos_msg.horConfidence_valid = 1; + + inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) + + /* Log */ + LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, + inject_pos_msg.latitude, inject_pos_msg.longitude, + inject_pos_msg.horUncCircular); + + req_union.pInjectPositionReq = &inject_pos_msg; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_POSITION_IND_V02, + &inject_pos_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_pos_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* delete assistance date */ +enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteAssistDataReqMsgT_v02 delete_req; + qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; + + memset(&delete_req, 0, sizeof(delete_req)); + memset(&delete_resp, 0, sizeof(delete_resp)); + + if( f == GPS_DELETE_ALL ) + { + delete_req.deleteAllFlag = true; + } + + else + { + /* to keep track of svInfoList for GPS and GLO*/ + uint32_t curr_sv_len = 0; + uint32_t curr_sv_idx = 0; + uint32_t sv_id = 0; + + if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) + { + /* do delete for all GPS SV's */ + + curr_sv_len += SV_ID_RANGE; + + sv_id = GPS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + // increment the current index + curr_sv_idx += SV_ID_RANGE; + + } + +#ifdef QCOM_FEATURE_DELEXT + if( f & GPS_DELETE_TIME_GPS ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; + } +#endif + if(f & GPS_DELETE_POSITION ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; + } + + if(f & GPS_DELETE_TIME ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; + } + + if(f & GPS_DELETE_IONO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; + } + + if(f & GPS_DELETE_UTC ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; + } + + if(f & GPS_DELETE_HEALTH ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; + } + + if(f & GPS_DELETE_SVDIR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; + } + if(f & GPS_DELETE_SADATA ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; + } + if(f & GPS_DELETE_RTI ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; + } + if(f & GPS_DELETE_CELLDB_INFO ) + { + delete_req.deleteCellDbDataMask_valid = 1; + delete_req.deleteCellDbDataMask = + ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; + + } +#ifdef QCOM_FEATURE_DELEXT + if(f & GPS_DELETE_ALMANAC_CORR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; + } + if(f & GPS_DELETE_FREQ_BIAS_EST ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; + } + if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) + { + /* do delete for all GLONASS SV's (65 - 96) + */ + curr_sv_len += SV_ID_RANGE; + + sv_id = GLONASS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + curr_sv_idx += SV_ID_RANGE; + } + + if(f & GPS_DELETE_SVDIR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; + } + + if(f & GPS_DELETE_SVSTEER_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; + } + + if(f & GPS_DELETE_ALMANAC_CORR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; + } + + if(f & GPS_DELETE_TIME_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; + } +#endif + } + + req_union.pDeleteAssistDataReq = &delete_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + &delete_resp); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != delete_resp.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(delete_resp.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* send NI user repsonse to the engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + + qmiLocNiUserRespReqMsgT_v02 ni_resp; + qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; + + memset(&ni_resp,0, sizeof(ni_resp)); + + memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); + + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; + break; + case GPS_NI_RESPONSE_DENY: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; + break; + case GPS_NI_RESPONSE_NORESP: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; + break; + default: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, + ni_resp.userResp); + + ni_resp.notificationType = request_pass_back->notificationType; + + // copy SUPL payload from request + if(request_pass_back->NiSuplInd_valid == 1) + { + ni_resp.NiSuplPayload_valid = 1; + memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), + sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); + + } + // should this be an "else if"?? we don't need to decide + + // copy UMTS-CP payload from request + if( request_pass_back->NiUmtsCpInd_valid == 1 ) + { + ni_resp.NiUmtsCpPayload_valid = 1; + memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), + sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); + } + + //copy Vx payload from the request + if( request_pass_back->NiVxInd_valid == 1) + { + ni_resp.NiVxPayload_valid = 1; + memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), + sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); + } + + // copy Vx service interaction payload from the request + if(request_pass_back->NiVxServiceInteractionInd_valid == 1) + { + ni_resp.NiVxServiceInteractionPayload_valid = 1; + memcpy(&(ni_resp.NiVxServiceInteractionPayload), + &(request_pass_back->NiVxServiceInteractionInd), + sizeof(qmiLocNiVxServiceInteractionStructT_v02)); + } + + req_union.pNiUserRespReq = &ni_resp; + + status = loc_sync_send_req ( + clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ni_resp_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Set UMTs SLP server URL */ +enum loc_api_adapter_err LocApiV02Adapter :: setServer( + const char* url, int len) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + + if(len <=0 || len > sizeof(set_server_req.urlAddr)) + { + LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", + __func__, __LINE__, len); + + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); + + set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; + + set_server_req.urlAddr_valid = 1; + + strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +enum loc_api_adapter_err LocApiV02Adapter :: + setServer(unsigned int ip, int port, LocServerType type) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + qmiLocServerTypeEnumT_v02 set_server_cmd; + + switch (type) { + case LOC_AGPS_MPC_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; + break; + case LOC_AGPS_CUSTOM_PDE_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; + break; + default: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; + break; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); + + set_server_req.serverType = set_server_cmd; + set_server_req.ipv4Addr_valid = 1; + set_server_req.ipv4Addr.addr = ip; + set_server_req.ipv4Addr.port = port; + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Inject XTRA data, this module breaks down the XTRA + file into "chunks" and injects them one at a time */ +enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( + char* data, int length) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + int total_parts; + uint8_t part; + uint16_t len_injected; + + locClientReqUnionType req_union; + qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; + qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; + + req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; + + LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); + + inject_xtra.formatType_valid = 1; + inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; + inject_xtra.totalSize = length; + + total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; + + inject_xtra.totalParts = total_parts; + + len_injected = 0; // O bytes injected + + // XTRA injection starts with part 1 + for (part = 1; part <= total_parts; part++) + { + inject_xtra.partNum = part; + + if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) + { + inject_xtra.partData_len = length - len_injected; + } + else + { + inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; + } + + // copy data into the message + memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); + + LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", + __func__, __LINE__, + inject_xtra.partNum, total_parts, inject_xtra.partData_len, + len_injected); + + status = loc_sync_send_req( clientHandle, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + &inject_xtra_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || + inject_xtra.partNum != inject_xtra_ind.partNum) + { + LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," + " part num = %d, ind.partNum = %d\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_xtra_ind.status), + inject_xtra.partNum, inject_xtra_ind.partNum); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + break; + } + + len_injected += inject_xtra.partData_len; + LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, + len_injected); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} +#ifdef QCOM_FEATURE_IPV6 +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s], bearer = %d \n", __func__, __LINE__, + handle, is_succ, apn, bear); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + switch(bear) + { + case AGPS_APN_BEARER_IPV4: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + break; + + case AGPS_APN_BEARER_IPV6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + break; + + case AGPS_APN_BEARER_IPV4V6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + break; + + default: + LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#else +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s] \n", __func__, __LINE__, + handle, is_succ, apn); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#endif +/* close atl connection */ +enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( + int handle, int is_succ) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", + __func__, __LINE__, handle, is_succ); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the SUPL version */ +enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; + + LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); + + + memset(&supl_config_req, 0, sizeof(supl_config_req)); + memset(&supl_config_ind, 0, sizeof(supl_config_ind)); + + supl_config_req.suplVersion_valid = 1; + // SUPL version from MSByte to LSByte: + // (reserved)(major version)(minor version)(serviceIndicator) + + supl_config_req.suplVersion = (version == 0x00020000)? + eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; + + req_union.pSetProtocolConfigParametersReq = &supl_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &supl_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(supl_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Configuration */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; + qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; + + LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); + + memset(&sensor_config_req, 0, sizeof(sensor_config_req)); + memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); + + sensor_config_req.sensorsUsage_valid = 1; + sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 + : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; + + req_union.pSetSensorControlConfigReq = &sensor_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + &sensor_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Properties */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; + qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; + + LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk); + + memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); + memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); + + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; + sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + + req_union.pSetSensorPropertiesReq = &sensor_prop_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + &sensor_prop_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_prop_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Performance Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; + qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; + + LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + __FUNCTION__, + __LINE__, + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + + memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); + memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); + + sensor_perf_config_req.performanceControlMode_valid = 1; + sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; + sensor_perf_config_req.accelSamplingSpec_valid = 1; + sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; + sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; + sensor_perf_config_req.gyroSamplingSpec_valid = 1; + sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; + sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + + req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + &sensor_perf_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Convert event mask from loc eng to loc_api_v02 format */ +locClientEventMaskType LocApiV02Adapter :: convertMask( + LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + locClientEventMaskType eventMask = 0; + LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); + + if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + + if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + + /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ + if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || + (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) + eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; + + if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; + + if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) + { + // TBD: This needs to be decoupled in the HAL + eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; + } + + if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) + { + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 | + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02); + } + + if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; + + return eventMask; +} + +/* Convert error from loc_api_v02 to loc eng format*/ +enum loc_api_adapter_err LocApiV02Adapter :: convertErr( + locClientStatusEnumType status) +{ + switch( status) + { + case LOC_API_ADAPTER_ERR_SUCCESS: + return LOC_API_ADAPTER_ERR_SUCCESS; + + case eLOC_CLIENT_FAILURE_GENERAL: + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + + case eLOC_CLIENT_FAILURE_UNSUPPORTED: + return LOC_API_ADAPTER_ERR_UNSUPPORTED; + + case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + + case eLOC_CLIENT_FAILURE_ENGINE_BUSY: + return LOC_API_ADAPTER_ERR_ENGINE_BUSY; + + case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: + return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; + + case eLOC_CLIENT_FAILURE_TIMEOUT: + return LOC_API_ADAPTER_ERR_TIMEOUT; + + case eLOC_CLIENT_FAILURE_INVALID_HANDLE: + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + + case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: + return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; + + default: + return LOC_API_ADAPTER_ERR_FAILURE; + } +} + +/* convert position report to loc eng format and send the converted + position to loc eng */ + +void LocApiV02Adapter :: reportPosition ( + const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) +{ + GpsLocation location; + + memset(&location, 0, sizeof (GpsLocation)); + location.size = sizeof(location); + // Process the position from final and intermediate reports + + if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || + (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) + ) + { + // Latitude & Longitude + if( (location_report_ptr->latitude_valid == 1 ) && + (location_report_ptr->longitude_valid == 1) && + (location_report_ptr->latitude != 0 || + location_report_ptr->longitude!= 0)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if(location_report_ptr->timestampUtc_valid == 1) + { + location.timestamp = location_report_ptr->timestampUtc; + } + + // Altitude + if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitudeWrtEllipsoid; + } + + // Speed + if((location_report_ptr->speedHorizontal_valid == 1) && + (location_report_ptr->speedVertical_valid ==1 ) ) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt( + (location_report_ptr->speedHorizontal * + location_report_ptr->speedHorizontal) + + (location_report_ptr->speedVertical * + location_report_ptr->speedVertical) ); + } + + // Heading + if(location_report_ptr->heading_valid == 1) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if( (location_report_ptr->horUncCircular_valid ) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->horUncCircular; + } + + LocApiAdapter::reportPosition( location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->sessionStatus + == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + NULL, + LOC_SESS_FAILURE); + + LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " + "fix id = %u\n", __func__, __LINE__, + location_report_ptr->sessionStatus, + location_report_ptr->fixId ); + } +} + +/* convert satellite report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportSv ( + const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const qmiLocSvInfoStructT_v02 *sv_info_ptr; + + LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, + gnss_report_ptr->svList_len); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + if(gnss_report_ptr->svList_valid == 1) + { + num_svs_max = gnss_report_ptr->svList_len; + if(num_svs_max > GPS_MAX_SVS) + { + num_svs_max = GPS_MAX_SVS; + } + SvStatus.num_svs = 0; + for(i = 0; i < num_svs_max; i++) + { + sv_info_ptr = &(gnss_report_ptr->svList[i]); + if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && + (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) + && (sv_info_ptr->gnssSvId != 0 )) + { + if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; + + // We only have the data field to report gps eph and alm mask + if(sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) + { + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) + { + SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) + { + SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + (65-1); + } + // Unsupported SV system + else + { + continue; + } + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) + { + SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) + { + SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) + { + SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; + } + + SvStatus.num_svs++; + } + } + + if (SvStatus.num_svs != 0) + { + LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +/* convert engine state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) +{ + GpsStatusValue status; + + LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, + engine_state_ptr->engineState); + + status = GPS_STATUS_NONE; + if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) + { + status = GPS_STATUS_ENGINE_ON; + } + else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) + { + status = GPS_STATUS_ENGINE_OFF; + } + LocApiAdapter::reportStatus(status); +} + +/* convert fix session state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) +{ + GpsStatusValue status; + LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, + fix_session_state_ptr->sessionState); + + status = GPS_STATUS_NONE; + if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (fix_session_state_ptr->sessionState + == eQMI_LOC_FIX_SESSION_FINISHED_V02) + { + status = GPS_STATUS_SESSION_END; + } + LocApiAdapter::reportStatus(status); +} + +/* convert NMEA report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportNmea ( + const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) +{ + + LocApiAdapter::reportNmea(nmea_report_ptr->nmea, + strlen(nmea_report_ptr->nmea)); + + LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, + nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], + nmea_report_ptr->nmea[5]); +} + +/* convert and report an ATL request to loc engine */ +void LocApiV02Adapter :: reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) +{ + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) + { + AGpsType agpsType; +#ifdef QCOM_FEATURE_IPV6 + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + break; + + default: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + } +#else + agpsType = AGPS_TYPE_SUPL; +#endif + LocApiAdapter::requestATL(connHandle, agpsType); + } + + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + LocApiAdapter::releaseATL(connHandle); + } +} + +/* conver the NI report to loc eng format and send t loc engine */ +void LocApiV02Adapter :: reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) +{ + GpsNiNotification notif; + + /* initialize the notification*/ + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + /* NI timeout gets overwritten in LocApiAdapter, + initializing to 0 here */ + notif.timeout = 0; + + notif.text_encoding = GPS_ENC_NONE ; + + notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + + notif.notify_flags = 0; + + notif.default_response = GPS_NI_RESPONSE_NORESP; + + /*Handle Vx request */ + if(ni_req_ptr->NiVxInd_valid == 1) + { + const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); + + notif.ni_type = GPS_NI_TYPE_VOICE; + + // Requestor ID, the requestor id recieved is NULL terminated + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char *)vx_req->requestorId, vx_req->requestorId_len ); + } + + /* Handle UMTS CP request*/ + else if(ni_req_ptr->NiUmtsCpInd_valid == 1) + { + const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = + &ni_req_ptr->NiUmtsCpInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + + /* notificationText should always be a NULL terminated string */ + hexcode(notif.text, sizeof notif.text, + (char *)umts_cp_req->notificationText, + umts_cp_req->notificationText_len); + + /* Store requestor ID */ + hexcode(notif.requestor_id, sizeof(notif.requestor_id), + (char *)umts_cp_req->requestorId.codedString, + umts_cp_req->requestorId.codedString_len); + + /* convert encodings */ + notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); + + notif.requestor_id_encoding = + convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); + + /* LCS address (using extras field) */ + if ( umts_cp_req->clientAddress_len != 0) + { + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + + // 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; + address_source = (char *)umts_cp_req->clientAddress; + // client Address is always NULL terminated + addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, + umts_cp_req->clientAddress_len); + + // The address is ASCII string + if (addr_len) + { + strlcat(notif.extras, lcs_addr, sizeof notif.extras); + } + } + + } + else if(ni_req_ptr->NiSuplInd_valid == 1) + { + const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = + &ni_req_ptr->NiSuplInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + + // Client name + if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) + { + hexcode(notif.text, sizeof(notif.text), + (char *)supl_req->clientName.formattedString, + supl_req->clientName.formattedString_len); + LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, + notif.text); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", + __func__, __LINE__); + } + + // Requestor ID + if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char*)supl_req->requestorId.formattedString, + supl_req->requestorId.formattedString_len ); + + LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, + notif.requestor_id); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", + __func__, __LINE__); + } + + // Encoding type + if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) + { + notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); + + notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); + } + else + { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + } //ni_req_ptr->NiSuplInd_valid == 1 + + else + { + LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); + return; + } + + // Set default_response & notify_flags + convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); + + if( NULL != ni_req_copy_ptr) + { + memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); + + LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); + } + else + { + LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); + } + +} + +/* convert Ni Encoding type from QMI_LOC to loc eng format */ +GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case eQMI_LOC_NI_SUPL_UTF8_V02: + enc = GPS_ENC_SUPL_UTF8; + break; + case eQMI_LOC_NI_SUPL_UCS2_V02: + enc = GPS_ENC_SUPL_UCS2; + break; + case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + break; + default: + break; + } + + return enc; +} + +/*convert NI notify verify type from QMI LOC to loc eng format*/ +bool LocApiV02Adapter :: convertNiNotifyVerifyType ( + GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv) +{ + switch (notif_priv) + { + case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: + notif->notify_flags = 0; + break; + + case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_ACCEPT; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_DENY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return false; + } + + return true; +} + +/* event callback registered with the loc_api v02 interface */ +void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, + uint32_t eventId, locClientEventIndUnionType eventPayload) +{ + LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, + eventId); + + switch(eventId) + { + //Position Report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + reportPosition(eventPayload.pPositionReportEvent); + break; + + // Satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + reportSv(eventPayload.pGnssSvInfoReportEvent); + break; + + // Status report + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + reportEngineState(eventPayload.pEngineState); + break; + + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + reportFixSessionState(eventPayload.pFixSessionState); + break; + + // NMEA + case QMI_LOC_EVENT_NMEA_IND_V02: + reportNmea(eventPayload.pNmeaReportEvent); + break; + + // XTRA request + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + LOC_LOGD("%s:%d]: XTRA download request\n", __func__, + __LINE__); + requestXtraData(); + break; + + // time request + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + LOC_LOGD("%s:%d]: Time request\n", __func__, + __LINE__); + requestTime(); + break; + + //position request + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + LOC_LOGD("%s:%d]: Position request\n", __func__, + __LINE__); + //requestPosition(); + break; + + // NI request + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); + break; + + // AGPS connection request + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + reportAtlRequest(eventPayload.pLocationServerConnReqEvent); + break; + } +} + +/* Call the service LocApiAdapter down event*/ +void LocApiV02Adapter :: errorCb(locClientHandleType handle, + locClientErrorEnumType errorId) +{ + if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) + { + LOC_LOGE("%s:%d]: Service unavailable error\n", + __func__, __LINE__); + + LocApiAdapter::handleEngineDownEvent(); + + /* immediately send the engine up event so that + the loc engine re-initializes the adapter and the + loc-api_v02 interface */ + + LocApiAdapter::handleEngineUpEvent(); + } +} + +/* return a Loc API adapter */ +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return(new LocApiV02Adapter(locEng)); +} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h new file mode 100755 index 00000000..487e98eb --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -0,0 +1,197 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V_0_2_ADAPTER_H +#define LOC_API_V_0_2_ADAPTER_H + +#include +#include "loc_api_v02_client.h" +#include +#include + +/* Fix criteria structure*/ +struct LocApiV02FixCriteria +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval ; + uint32_t preferred_accuracy ; + uint32_t preferred_time; + + /* Constructor for the structure */ + inline LocApiV02FixCriteria (LocPositionMode mode, + GpsPositionRecurrence recur, + uint32_t min_int, + uint32_t pref_acc, + uint32_t pref_time) : + mode(mode), recurrence(recur), min_interval(min_int), + preferred_accuracy(pref_acc), preferred_time(pref_time) {} +}; + +/* This class derives from the LocApiAdapter class. + The members of this class are responsible for converting + the Loc API V02 data structures into Loc Engine data structures. + This class also implements some of the virtual functions that + handle the requests from loc engine. */ +class LocApiV02Adapter : public LocApiAdapter { + + /* loc api v02 handle*/ + locClientHandleType clientHandle; + + /* events the client is registered for */ + locClientEventMaskType eventMask; + + /* current session state */ + bool navigating; + + /* current fix criteria, for Loc aPI V02 this is + stored when set_position_mode is called and + sent out with Loc aPI V02 start message when the + start_fix() is called by loc engine. */ + LocApiV02FixCriteria fixCriteria; + + /* Convert event mask from loc eng to loc_api_v02 format */ + locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + + /* Convert error from loc_api_v02 to loc eng format*/ + enum loc_api_adapter_err convertErr(locClientStatusEnumType status); + + /* convert Ni Encoding type from QMI_LOC to loc eng format */ + GpsNiEncodingType convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); + + /*convert NI notify verify type from QMI LOC to loc eng format*/ + bool convertNiNotifyVerifyType (GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv); + + /* close Loc API V02 client */ + int deInitLocClient(); + + /* convert position report to loc eng format and send the converted + position to loc eng */ + void reportPosition + (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); + + /* convert satellite report to loc eng format and send the converted + report to loc eng */ + void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); + + /* convert engine state report to loc eng format and send the converted + report to loc eng */ + void reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); + + /* convert fix session report to loc eng format and send the converted + report to loc eng */ + void reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); + + /* convert NMEA report to loc eng format and send the converted + report to loc eng */ + void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); + + /* convert and report an ATL request to loc engine */ + void reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 + *server_request_ptr); + + /* convert and report NI request to loc eng */ + void reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); + +public: + LocApiV02Adapter(LocEng &locEng); + ~LocApiV02Adapter(); + + /* event callback registered with the loc_api v02 interface */ + void eventCb(locClientHandleType client_handle, + uint32_t loc_event_id, + locClientEventIndUnionType loc_event_payload); + + /* error callback, this function handles the service unavailable + error */ + void errorCb(locClientHandleType handle, + locClientErrorEnumType errorId); + + virtual enum loc_api_adapter_err reinit(); + + virtual enum loc_api_adapter_err startFix(); + + virtual enum loc_api_adapter_err stopFix(); + + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); + + 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); + + 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); +#ifdef QCOM_FEATURE_IPV6 + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType); +#else + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsType agpsType); +#endif + virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage); + + virtual enum loc_api_adapter_err + setSensorProperties(float gyroBiasVarianceRandomWalk); + + virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec); +}; + +#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c new file mode 100755 index 00000000..b75f1630 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -0,0 +1,548 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" + +/* Logging */ +// Uncomment to log verbose logs +#define LOG_NDEBUG 1 + +// log debug logs +#define LOG_NDDEBUG 1 +#define LOG_TAG "LocSvc_api_v02" +#include "loc_util_log.h" + +#define LOC_SYNC_REQ_BUFFER_SIZE 8 + +pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool loc_sync_call_initialized = false; + +typedef struct { + pthread_mutex_t sync_req_lock; + + /* Client ID */ + locClientHandleType client_handle; + + /* waiting conditional variable */ + pthread_cond_t ind_arrived_cond; + + /* Callback waiting data block, protected by loc_cb_data_mutex */ + bool ind_is_selected; /* is cb selected? */ + bool ind_is_waiting; /* is waiting? */ + bool ind_has_arrived; /* callback has arrived */ + uint32_t req_id; /* sync request */ + void *recv_ind_payload_ptr; /* received payload */ + uint32_t recv_ind_id; /* received ind */ + +} loc_sync_req_data_s_type; + +typedef struct { + bool in_use; /* at least one sync call is active */ + bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; + loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; +} loc_sync_req_array_s_type; + +/*************************************************************************** + * DATA FOR ASYNCHRONOUS RPC PROCESSING + **************************************************************************/ +loc_sync_req_array_s_type loc_sync_array; + +/*=========================================================================== + +FUNCTION loc_sync_req_init + +DESCRIPTION + Initialize this module + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_req_init() +{ + LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + pthread_mutex_lock(&loc_sync_call_mutex); + if(true == loc_sync_call_initialized) + { + LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + loc_sync_array.in_use = false; + + memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); + + int i; + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + pthread_mutex_init(&slot->sync_req_lock, NULL); + pthread_cond_init(&slot->ind_arrived_cond, NULL); + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; /* req id */ + } + + loc_sync_call_initialized = true; + pthread_mutex_unlock(&loc_sync_call_mutex); +} + + +/*=========================================================================== + +FUNCTION loc_sync_process_ind + +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_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* ind id */ + void *ind_payload_ptr /* payload */ +) +{ + + LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", + __func__,__LINE__, client_handle, ind_id); + + pthread_mutex_lock(&loc_sync_call_mutex); + + if (!loc_sync_array.in_use) + { + LOC_LOGD("%s:%d]: loc_sync_array not in use \n", + __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + bool in_use = false, consumed = false; + int i; + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + in_use |= loc_sync_array.slot_in_use[i]; + + pthread_mutex_lock(&slot->sync_req_lock); + + if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) + && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) + { + // copy the payload to the slot waiting for this ind + size_t payload_size = 0; + + LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", + __func__, __LINE__, i, ind_id); + + if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && + NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) + { + LOC_LOGV("%s:%d]: copying ind payload size = %u \n", + __func__, __LINE__, payload_size); + + memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); + + consumed = true; + + } + /* Received a callback while waiting, wake up thread to check it */ + if (slot->ind_is_waiting) + { + slot->recv_ind_id = ind_id; + + pthread_cond_signal(&slot->ind_arrived_cond); + } + else + { + /* If callback arrives before wait, remember it */ + LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", + __func__, __LINE__, ind_id); + + slot->ind_has_arrived = true; + } + } + pthread_mutex_unlock(&slot->sync_req_lock); + } + + if (!in_use) { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_alloc_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_alloc_slot() +{ + int i, select_id = -1; /* no free buffer */ + + pthread_mutex_lock(&loc_sync_call_mutex); + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (!loc_sync_array.slot_in_use[i]) + { + select_id = i; + loc_sync_array.slot_in_use[i] = 1; + loc_sync_array.in_use = true; + break; + } + } + + pthread_mutex_unlock(&loc_sync_call_mutex); + LOC_LOGV("%s:%d]: returning slot %d\n", + __func__, __LINE__, select_id); + return select_id; +} + +/*=========================================================================== + +FUNCTION loc_free_slot + +DESCRIPTION + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_free_slot(int select_id) +{ + int i; + loc_sync_req_data_s_type *slot; + + pthread_mutex_lock(&loc_sync_call_mutex); + + LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); + + loc_sync_array.slot_in_use[select_id] = 0; + + slot = &loc_sync_array.slots[select_id]; + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; + + // check if all slots are now free + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (loc_sync_array.slot_in_use[i]) break; + } + + if (i >= LOC_SYNC_REQ_BUFFER_SIZE) + { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_sync_select_ind + +DESCRIPTION + Selects which indication to wait for. + + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -ENOMEM : out of buffer + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_select_ind( + locClientHandleType client_handle, /* Client handle */ + uint32_t ind_id, /* ind Id wait for */ + uint32_t req_id, /* req id */ + void * ind_payload_ptr /* ptr where payload should be copied to*/ +) +{ + int select_id = loc_alloc_slot(); + + LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", + __func__, __LINE__, client_handle, ind_id, req_id); + + if (select_id < 0) + { + LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", + __func__, __LINE__, loc_get_v02_event_name(req_id)); + return -ENOMEM; + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + pthread_mutex_lock(&slot->sync_req_lock); + + slot->client_handle = client_handle; + slot->ind_is_selected = true; + slot->ind_is_waiting = false; + slot->ind_has_arrived = false; + + slot->recv_ind_id = ind_id; + slot->req_id = req_id; + slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr + + pthread_mutex_unlock(&slot->sync_req_lock); + + return select_id; +} + + +/*=========================================================================== + +FUNCTION loc_sync_wait_for_ind + +DESCRIPTION + Waits for a selected indication. The wait expires in timeout_seconds seconds. + If the function is called before an existing wait has finished, it will + immediately return error. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 on SUCCESS, -ve value on failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_wait_for_ind( + int select_id, /* ID from loc_sync_select_ind() */ + int timeout_seconds, /* Timeout in this number of seconds */ + uint32_t ind_id +) +{ + if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) + { + LOC_LOGE("%s:%d]: invalid select_id: %d \n", + __func__, __LINE__, select_id); + + return (-EINVAL); + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + int ret_val = 0; /* the return value of this function: 0 = no error */ + int rc; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + pthread_mutex_lock(&slot->sync_req_lock); + + do + { + if (slot->ind_has_arrived) + { + ret_val = 0; /* success */ + break; + } + + if (slot->ind_is_waiting) + { + LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, + __LINE__, select_id); + ret_val = -EBUSY; // busy + break; + } + + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_sec += timeout_seconds; + + /* Take new wait request */ + slot->ind_is_waiting = true; + + /* Waiting */ + rc = pthread_cond_timedwait(&slot->ind_arrived_cond, + &slot->sync_req_lock, &expire_time); + + slot->ind_is_waiting = false; + + if(rc == ETIMEDOUT) + { + LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", + __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); + ret_val = -ETIMEDOUT; //time out + } + + } while (0); + + pthread_mutex_unlock(&slot->sync_req_lock); + loc_free_slot(select_id); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_sync_send_req + +DESCRIPTION + Synchronous req call (thread safe) + +DEPENDENCIES + N/A + +RETURN VALUE + Loc API 2.0 status + +SIDE EFFECTS + N/A + +===========================================================================*/ +locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; + int select_id; + int rc = 0; + + // Select the callback we are waiting for + select_id = loc_sync_select_ind(client_handle, ind_id, req_id, + ind_payload_ptr); + + if (select_id >= 0) + { + status = locClientSendReq (client_handle, req_id, req_payload); + LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", + __func__, __LINE__, select_id, status); + + if (status != eLOC_CLIENT_SUCCESS ) + { + loc_free_slot(select_id); + } + else + { + // Wait for the indication callback + if (( rc = loc_sync_wait_for_ind( select_id, + timeout_msec / 1000, + ind_id) ) < 0) + { + if ( rc == -ETIMEDOUT) + status = eLOC_CLIENT_FAILURE_TIMEOUT; + else + status = eLOC_CLIENT_FAILURE_INTERNAL; + + // Callback waiting failed + LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " + "select id %d, status %s", __func__, __LINE__, rc , + select_id, loc_get_v02_client_status_name(status)); + } + else + { + status = eLOC_CLIENT_SUCCESS; + LOC_LOGV("%s:%d]: success (select id %d)\n", + __func__, __LINE__, select_id); + } + } + } /* select id */ + + return status; +} + + diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h new file mode 100755 index 00000000..8c7f7f19 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SYNC_REQ_H +#define LOC_SYNC_REQ_H + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include +#include "loc_api_v02_client.h" + +#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second + +/* Init function */ +extern void loc_sync_req_init(); + + +/* Process Loc API indications to wake up blocked user threads */ +extern void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* respInd id */ + void *ind_payload_ptr /* payload */ +); + +/* Thread safe synchronous request, using Loc API status return code */ +extern locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c new file mode 100755 index 00000000..4d34adc4 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -0,0 +1,1867 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "qmi_client.h" +#include "qmi_idl_lib.h" +#include "qmi_cci_target_ext.h" + +#if defined( _ANDROID_) +#include "qmi_cci_target.h" +#include "qmi_cci_common.h" +#elif defined(LOC_UTIL_TARGET_OFF_TARGET) +#include +#include +#include +#endif //_ANDROID_ + +#include +#include +#include +#include +#include +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" + +#include "loc_util_log.h" + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (5000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) + +#else + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (1000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +//timeout in ms to wait for the service to come up +#define LOC_CLIENT_SERVICE_TIMEOUT (20000) + +/* Table to relate eventId, size and mask value used to enable the event*/ +typedef struct +{ + uint32_t eventId; + size_t eventSize; + locClientEventMaskType eventMask; +}locClientEventIndTableStructT; + + +static locClientEventIndTableStructT locClientEventIndTable[]= { + + // position report ind + { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, + + // satellite report ind + { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, + sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), + QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, + + // NMEA report ind + { QMI_LOC_EVENT_NMEA_IND_V02, + sizeof(qmiLocEventNmeaIndMsgT_v02), + QMI_LOC_EVENT_MASK_NMEA_V02 }, + + //NI event ind + { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, + sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, + + //Time Injection Request Ind + { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, + sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, + + //Predicted Orbits Injection Request + { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, + sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, + + //Position Injection Request Ind + { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, + sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , + + //Engine State Report Ind + { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, + sizeof(qmiLocEventEngineStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, + + //Fix Session State Report Ind + { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, + sizeof(qmiLocEventFixSessionStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, + + //Wifi Request Indication + { QMI_LOC_EVENT_WIFI_REQ_IND_V02, + sizeof(qmiLocEventWifiReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, + + //Sensor Streaming Ready Status Ind + { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, + sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, + + // Time Sync Request Indication + { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, + sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, + + //Set Spi Streaming Report Event + { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, + sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, + + //Location Server Connection Request event + { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, + sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } +}; + +/* table to relate the respInd Id with its size */ +typedef struct +{ + uint32_t respIndId; + size_t respIndSize; +}locClientRespIndTableStructT; + +static locClientRespIndTableStructT locClientRespIndTable[]= { + + // get service revision ind + { QMI_LOC_GET_SERVICE_REVISION_IND_V02, + sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, + + // Get Fix Criteria Resp Ind + { QMI_LOC_GET_FIX_CRITERIA_IND_V02, + sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, + + // NI User Resp In + { QMI_LOC_NI_USER_RESPONSE_IND_V02, + sizeof(qmiLocNiUserRespIndMsgT_v02)}, + + //Inject Predicted Orbits Data Resp Ind + { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, + + //Get Predicted Orbits Data Src Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, + + // Get Predicted Orbits Data Validity Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, + + // Inject UTC Time Resp Ind + { QMI_LOC_INJECT_UTC_TIME_IND_V02, + sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, + + //Inject Position Resp Ind + { QMI_LOC_INJECT_POSITION_IND_V02, + sizeof(qmiLocInjectPositionIndMsgT_v02)}, + + //Set Engine Lock Resp Ind + { QMI_LOC_SET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocSetEngineLockIndMsgT_v02)}, + + //Get Engine Lock Resp Ind + { QMI_LOC_GET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocGetEngineLockIndMsgT_v02)}, + + //Set SBAS Config Resp Ind + { QMI_LOC_SET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, + + //Get SBAS Config Resp Ind + { QMI_LOC_GET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, + + //Set NMEA Types Resp Ind + { QMI_LOC_SET_NMEA_TYPES_IND_V02, + sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, + + //Get NMEA Types Resp Ind + { QMI_LOC_GET_NMEA_TYPES_IND_V02, + sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, + + //Set Low Power Mode Resp Ind + { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, + + //Get Low Power Mode Resp Ind + { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, + + //Set Server Resp Ind + { QMI_LOC_SET_SERVER_IND_V02, + sizeof(qmiLocSetServerIndMsgT_v02)}, + + //Get Server Resp Ind + { QMI_LOC_GET_SERVER_IND_V02, + sizeof(qmiLocGetServerIndMsgT_v02)}, + + //Delete Assist Data Resp Ind + { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + + //Set XTRA-T Session Control Resp Ind + { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, + + //Get XTRA-T Session Control Resp Ind + { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, + + //Inject Wifi Position Resp Ind + { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, + sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, + + //Notify Wifi Status Resp Ind + { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, + + //Get Registered Events Resp Ind + { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, + sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, + + //Set Operation Mode Resp Ind + { QMI_LOC_SET_OPERATION_MODE_IND_V02, + sizeof(qmiLocSetOperationModeIndMsgT_v02)}, + + //Get Operation Mode Resp Ind + { QMI_LOC_GET_OPERATION_MODE_IND_V02, + sizeof(qmiLocGetOperationModeIndMsgT_v02)}, + + //Set SPI Status Resp Ind + { QMI_LOC_SET_SPI_STATUS_IND_V02, + sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, + + //Inject Sensor Data Resp Ind + { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, + + //Inject Time Sync Data Resp Ind + { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, + sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, + + //Set Cradle Mount config Resp Ind + { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, + + //Get Cradle Mount config Resp Ind + { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, + + //Set External Power config Resp Ind + { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, + + //Get External Power config Resp Ind + { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, + + //Location server connection status + { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, + + //Set Protocol Config Parameters + { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, + + //Get Protocol Config Parameters + { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, + + //Set Sensor Control Config + { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, + + //Get Sensor Control Config + { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, + + //Set Sensor Properties + { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, + + //Get Sensor Properties + { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, + + //Set Sensor Performance Control Config + { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, + + //Get Sensor Performance Control Config + { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, + //Inject SUPL certificate + { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, + + //Delete SUPL certificate + { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, + + // Set Position Engine Config + { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, + + // Get Position Engine Config + { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} + +}; + + +/** whether indication is an event or a response */ +typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; + + +/** @struct locClientInternalState + */ + +typedef struct +{ + // client cookie + void *pClientCookie; + //QCCI handle for this control point + qmi_client_type userHandle; + + // callbacks registered by the clients + locClientEventIndCbType eventCallback; + locClientRespIndCbType respCallback; + locClientErrorCbType errorCallback; + + // the event mask the client has registered for + locClientEventMaskType eventRegMask; + +}locClientCallbackDataType; + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** locClientGetSizeAndTypeByIndId + * @brief this function gets the size and the type (event, + * response)of the indication structure from its ID + * @param [in] indId ID of the indication + * @param [out] type event or response indication + * @param [out] size size of the indications + * + * @return true if the ID was found, false otherwise */ + +static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, + locClientIndEnumT *pIndType) +{ + // look in the event table + if(true == locClientGetSizeByEventIndId(indId, pIndSize)) + { + *pIndType = eventIndType; + + LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + //else look in response table + if(true == locClientGetSizeByRespIndId(indId, pIndSize)) + { + *pIndType = respIndType; + + LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + // Id not found + LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); + return false; +} + +/** isClientRegisteredForEvent +* @brief checks the mask to identify if the client has +* registered for the specified event Id +* @param [in] eventIndId +* @param [in] eventRegMask +* @return true if client regstered for event; else false */ + +static bool isClientRegisteredForEvent( + locClientEventMaskType eventRegMask, + uint32_t eventIndId) +{ + size_t idx = 0, eventIndTableSize = 0; + + // look in the event table + eventIndTableSize = + (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); + + for(idx=0; idxresp.result == QMI_RESULT_SUCCESS ) + { + status = eLOC_CLIENT_SUCCESS; + } + else + { + switch(pResponse->resp.error) + { + case QMI_ERR_MALFORMED_MSG_V01: + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + + case QMI_ERR_DEVICE_IN_USE_V01: + status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; + break; + + default: + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + } + LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", + __func__, __LINE__, pResponse->resp.result, + pResponse->resp.error, status); + return status; +} + +/** convertQmiErrorToLocError + @brief converts a qmi service error type to + locClientErrorEnumType + @param [in] error received QMI service. + @return locClientErrorEnumType corresponding to the error. +*/ + +static locClientErrorEnumType convertQmiErrorToLocError( + qmi_client_error_type error) +{ + locClientErrorEnumType locError ; + switch(error) + { + case QMI_SERVICE_ERR: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + + default: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + } + LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", + __func__, __LINE__, error, locError); + return locError; +} + +/** locClienHandlePosReportInd + * @brief Validates a position report ind + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if pos report is valid, false otherwise +*/ +static bool locClientHandlePosReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate position report + qmiLocEventPositionReportIndMsgT_v02 *posReport = + (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", + __func__, __LINE__, ind_buf_len, + posReport->latitude, posReport->longitude, + posReport->altitudeWrtEllipsoid); + + return true; +} +//----------------------------------------------------------------------------- + +/** locClientHandleSatReportInd + * @brief Validates a satellite report indication. Dk + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if sat report is valid, false otherwise +*/ +static bool locClientHandleSatReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate sat reports + unsigned int idx = 0; + qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = + (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" + " validity = %d \n ", __func__, __LINE__, + ind_buf_len, satReport->altitudeAssumed, + satReport->svList_len, satReport->svList_valid); + //Log SV report + for( idx = 0; idx svList_len; idx++ ) + { + LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " + "status = %d \n", __func__, __LINE__, + satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, + satReport->svList[idx].system, satReport->svList[idx].svStatus); + } + + return true; +} + + +/** locClientHandleNmeaReportInd + * @brief Validate a NMEA report indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if nmea report is valid, false otherwise +*/ + + +static bool locClientHandleNmeaReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate NMEA report + return true; +} + +/** locClientHandleGetServiceRevisionRespInd + * @brief Handles a Get Service Revision Rresponse indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if service revision is valid, false otherwise +*/ + +static bool locClientHandleGetServiceRevisionRespInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + LOC_LOGV("%s:%d] :\n", __func__, __LINE__); + return true; +} + +/** locClientHandleIndication + * @brief looks at each indication and calls the appropriate + * validation handler + * @param [in] indId + * @param [in] indBuffer + * @param [in] indSize + * @return true if indication was validated; else false */ + +static bool locClientHandleIndication( + uint32_t indId, + void* indBuffer, + size_t indSize + ) +{ + bool status = false; + switch(indId) + { + // handle the event indications + //------------------------------------------------------------------------- + + // handle position report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + { + status = locClientHandlePosReportInd(indId, indBuffer, indSize); + break; + } + // handle satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + { + status = locClientHandleSatReportInd(indId, indBuffer, indSize); + break; + } + + // handle NMEA report + case QMI_LOC_EVENT_NMEA_IND_V02: + { + status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); + break; + } + + // handle NI Notify Verify Request Ind + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + { + // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Time Inject request Ind + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + { + // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle XTRA data Inject request Ind + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + { + // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle position inject request Ind + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + { + // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle engine state Ind + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + { + // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle fix session state Ind + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + { + // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Wifi request Ind + case QMI_LOC_EVENT_WIFI_REQ_IND_V02: + { + // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle sensor streaming ready status Ind + case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: + { + // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle time sync Ind + case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: + { + // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle set streaming report ind + case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: + { + // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + { + //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + //------------------------------------------------------------------------- + + // handle the response indications + //------------------------------------------------------------------------- + + // Get service Revision response indication + case QMI_LOC_GET_SERVICE_REVISION_IND_V02: + { + status = locClientHandleGetServiceRevisionRespInd(indId, + indBuffer, indSize); + break; + } + // predicted orbits data response indication + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: + { + //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : + { + //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: + { + //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: + { + //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: + { + //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: + { + //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + // for indications that only have a "status" field + case QMI_LOC_NI_USER_RESPONSE_IND_V02: + case QMI_LOC_INJECT_UTC_TIME_IND_V02: + case QMI_LOC_INJECT_POSITION_IND_V02: + case QMI_LOC_SET_ENGINE_LOCK_IND_V02: + case QMI_LOC_SET_SBAS_CONFIG_IND_V02: + case QMI_LOC_SET_NMEA_TYPES_IND_V02: + case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: + case QMI_LOC_SET_SERVER_IND_V02: + case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: + case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: + case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: + case QMI_LOC_SET_OPERATION_MODE_IND_V02: + case QMI_LOC_SET_SPI_STATUS_IND_V02: + case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: + case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: + case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: + { + status = true; + break; + } + default: + LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, + (uint32_t)indId); + status = false; + break; + } + return status; +} + + +/** locClientErrorCb + * @brief handles the QCCI error events, this is called by the + * QCCI infrastructure when the service is no longer + * available. + * @param [in] user handle + * @param [in] error + * @param [in] *err_cb_data + */ + +static void locClientErrorCb +( + qmi_client_type user_handle, + qmi_client_error_type error, + void *err_cb_data +) +{ + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)err_cb_data; + + /* copy the errorCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and error callback. + */ + locClientErrorCbType localErrorCallback = + pCallbackData->errorCallback; + + LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", + __func__, __LINE__, error, err_cb_data); + + /* call the error callback + * To avoid calling the errorCallback after locClientClose + * is called, check pCallbackData->errorCallback again here + */ + + if( (NULL != pCallbackData) && + (NULL != localErrorCallback) && + (NULL != pCallbackData->errorCallback) ) + { + //invoke the error callback for the corresponding client + localErrorCallback( + (locClientHandleType)pCallbackData, + convertQmiErrorToLocError(error), + pCallbackData->pClientCookie); + } +} + + +/** locClientIndCb + * @brief handles the indications sent from the service, if a + * response indication was received then the it is sent + * to the response callback. If a event indication was + * received then it is sent to the event callback + * @param [in] user handle + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @param [in] ind_cb_data */ + +static void locClientIndCb +( + qmi_client_type user_handle, + unsigned int msg_id, + void *ind_buf, + unsigned int ind_buf_len, + void *ind_cb_data +) +{ + locClientIndEnumT indType; + size_t indSize = 0; + qmi_client_error_type rc ; + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)ind_cb_data; + + LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", + __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, + pCallbackData); + + // check callback data + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); + return; + } + + // check user handle + if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) + { + LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", + __func__, __LINE__, + user_handle, pCallbackData->userHandle); + return; + } + // Get the indication size and type ( eventInd or respInd) + if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) + { + void *indBuffer = NULL; + + // if the client did not register for this event then just drop it + if( (eventIndType == indType) && + ( (NULL == pCallbackData->eventCallback) || + (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) + { + LOC_LOGW("%s:%d]: client is not registered for event %d\n", + __func__, __LINE__, (uint32_t)msg_id); + return; + } + + // decode the indication + indBuffer = malloc(indSize); + + if(NULL == indBuffer) + { + LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); + return; + } + + // decode the indication + rc = qmi_client_message_decode( + user_handle, + QMI_IDL_INDICATION, + msg_id, + ind_buf, + ind_buf_len, + indBuffer, + indSize); + + if( rc == QMI_NO_ERR ) + { + //validate indication + if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + { + if(eventIndType == indType) + { + locClientEventIndUnionType eventIndUnion; + + /* copy the eventCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientEventIndCbType localEventCallback = + pCallbackData->eventCallback; + + // dummy event + eventIndUnion.pPositionReportEvent = + (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; + + /* call the event callback + * To avoid calling the eventCallback after locClientClose + * is called, check pCallbackData->eventCallback again here + */ + if((NULL != localEventCallback) && + (NULL != pCallbackData->eventCallback)) + { + localEventCallback( + (locClientHandleType)pCallbackData, + msg_id, + eventIndUnion, + pCallbackData->pClientCookie); + } + } + else if(respIndType == indType) + { + locClientRespIndUnionType respIndUnion; + + /* copy the respCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientRespIndCbType localRespCallback = + pCallbackData->respCallback; + + // dummy to suppress compiler warnings + respIndUnion.pDeleteAssistDataInd = + (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; + + /* call the response callback + * To avoid calling the respCallback after locClientClose + * is called, check pCallbackData->respCallback again here + */ + if((NULL != localRespCallback) && + (NULL != pCallbackData->respCallback)) + { + localRespCallback( + (locClientHandleType)pCallbackData, + msg_id, + respIndUnion, + pCallbackData->pClientCookie); + } + } + } + else // error handling indication + { + LOC_LOGE("%s:%d]: Error handling the indication %d\n", + __func__, __LINE__, (uint32_t)msg_id); + } + } + else + { + LOC_LOGE("%s:%d]: Error decoding indication %d\n", + __func__, __LINE__, rc); + } + if(indBuffer) + { + free (indBuffer); + } + } + else // Id not found + { + LOC_LOGE("%s:%d]: Error indication not found %d\n", + __func__, __LINE__,(uint32_t)msg_id); + } + return; +} + + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +static bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientReqUnionType reqUnion; + qmiLocRegEventsReqMsgT_v02 regEventsReq; + + memset(®EventsReq, 0, sizeof(regEventsReq)); + + regEventsReq.eventRegMask = eventRegMask; + reqUnion.pRegEventsReq = ®EventsReq; + + status = locClientSendReq(clientHandle, + QMI_LOC_REG_EVENTS_REQ_V02, + reqUnion); + + if(eLOC_CLIENT_SUCCESS != status ) + { + LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status) ); + return false; + } + + return true; +} + +/** validateRequest + @brief validates the input request + @param [in] reqId request ID + @param [in] reqPayload Union of pointers to message payload + @param [out] ppOutData Pointer to void *data if successful + @param [out] pOutLen Pointer to length of data if succesful. + @return false on failure, true on Success +*/ + +static bool validateRequest( + uint32_t reqId, + const locClientReqUnionType reqPayload, + void **ppOutData, + uint32_t *pOutLen ) + +{ + bool noPayloadFlag = false; + + LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); + switch(reqId) + { + case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); + break; + } + + case QMI_LOC_REG_EVENTS_REQ_V02: + { + *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); + break; + } + + case QMI_LOC_START_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopReqMsgT_v02); + break; + } + + case QMI_LOC_NI_USER_RESPONSE_REQ_V02: + { + *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_UTC_TIME_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); + break; + } + + case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_NMEA_TYPES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SERVER_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); + break; + } + + case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_OPERATION_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SPI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); + break; + } + + // ALL requests with no payload + case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: + case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: + case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: + case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: + case QMI_LOC_GET_NMEA_TYPES_REQ_V02: + case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: + case QMI_LOC_GET_SERVER_REQ_V02: + case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: + case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: + case QMI_LOC_GET_OPERATION_MODE_REQ_V02: + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + noPayloadFlag = true; + break; + } + + default: + LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, + reqId); + return false; + } + if(true == noPayloadFlag) + { + *ppOutData = NULL; + *pOutLen = 0; + } + else + { + //set dummy pointer for request union + *ppOutData = (void*) reqPayload.pInformClientRevisionReq; + } + LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, + reqId, *pOutLen); + return true; +} + +/** locClientQmiCtrlPointInit + @brief wait for the service to come up or timeout; when the + service comes up initialize the control point and set + internal handle and indication callback. + @param pQmiClient, +*/ + +static locClientStatusEnumType locClientQmiCtrlPointInit( + locClientCallbackDataType *pLocClientCbData) +{ + uint32_t num_services, num_entries = 10; + qmi_client_type clnt, notifier; + qmi_client_os_params os_params; + + // num instances of this service + qmi_service_info serviceInfo[5]; + + qmi_client_error_type rc = QMI_NO_ERR; + + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); + + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed\n", + __func__, __LINE__ ); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT); + + if(QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params)) + { + // timed out, return with error + LOC_LOGE("%s:%d]: timed out waiting for service\n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_TIMEOUT); + } + else + { + // get the service addressing information + rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, + &num_services); + LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned %d " + "num_services = %d\n", __func__, __LINE__, rc, + num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!!\n", __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + } + + //get service info to be used in qmi_client_init + rc = qmi_client_get_service_list( locClientServiceObject, serviceInfo, + &num_entries, &num_services); + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); + + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); + // initialize the client + rc = qmi_client_init(&serviceInfo[0], locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + return (eLOC_CLIENT_FAILURE_INTERNAL); + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + return(eLOC_CLIENT_SUCCESS); + +} +//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- + +/** locClientOpen + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ + +locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientCallbackDataType *pCallbackData = NULL; + + LOC_LOGV("%s:%d] \n", __func__, __LINE__); + + do + { + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + } + + // Allocate memory for the callback data + pCallbackData = + ( locClientCallbackDataType*)calloc( + 1, sizeof(locClientCallbackDataType)); + + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize the QMI control point; this function will block + * until a service is up or a timeout occurs. If the connection to + * the service succeeds the callback data will be filled in with + * a qmi_client value. + */ + + + EXIT_LOG_CALLFLOW(%s, "loc client open"); + status = locClientQmiCtrlPointInit(pCallbackData); + + LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + + if(status != eLOC_CLIENT_SUCCESS) + { + free(pCallbackData); + pCallbackData = NULL; + break; + } + + // set the handle to the callback data + *pLocClientHandle = (locClientHandleType)pCallbackData; + + if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) + { + LOC_LOGE("%s:%d]: Error sending registration mask\n", + __func__, __LINE__); + + // release the client + locClientClose(pLocClientHandle); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize rest of the client structure now that the connection + * to the service has been created successfully. + */ + + //fill in the event callback + pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; + + //fill in the response callback + pCallbackData->respCallback = pLocClientCallbacks->respIndCb; + + //fill in the error callback + pCallbackData->errorCallback = pLocClientCallbacks->errorCb; + + //set the client event registration mask + pCallbackData->eventRegMask = eventRegMask; + + // set the client cookie + pCallbackData->pClientCookie = (void *)pClientCookie; + + LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + + }while(0); + + if(eLOC_CLIENT_SUCCESS != status) + { + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + } + + return(status); +} + +/** locClientClose + @brief Disconnects a client from the location engine. + @param [in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) - On success. + - non-zero error code(see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientClose( + locClientHandleType* pLocClientHandle) +{ + qmi_client_error_type rc = QMI_NO_ERR; //No error + + if(NULL == pLocClientHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid pointer to handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + // convert handle to callback data + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)(*pLocClientHandle); + + LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", + *pLocClientHandle, pCallbackData->userHandle ); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, "loc client close"); + // release the handle + rc = qmi_client_release(pCallbackData->userHandle); + if(QMI_NO_ERR != rc ) + { + LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", + __func__, __LINE__, rc, pCallbackData->userHandle); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* clear the memory allocated to callback data to minimize the chances + * of a race condition occurring between close and the indication + * callback + */ + memset(pCallbackData, 0, sizeof(*pCallbackData)); + + // free the memory assigned in locClientOpen + free(pCallbackData); + pCallbackData= NULL; + + // set the handle to invalid value + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + + return eLOC_CLIENT_SUCCESS; +} + +/** locClientSendReq + @brief Sends a message to the location engine. If the locClientSendMsg() + function is successful, the client should expect an indication + (except start, stop, event reg and sensor injection messages), + through the registered callback in the locOpen() function. The + indication will contain the status of the request and if status is a + success, indication also contains the payload + associated with response. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] reqId message ID of the request + @param [in] reqPayload Payload of the request, can be NULL + if request has no payload + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS ) - On success. + - non-zero error code (see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload ) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGenRespMsgT_v02 resp; + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle ) + { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + // validate that the request is correct + if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) + { + + LOC_LOGE("%s:%d] error invalid request\n", __func__, + __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, + __LINE__, reqId, reqLen); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); + + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + reqId, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + return(status); +} + +/** locClientGetSizeByRespIndId + * @brief Get the size of the response indication structure, + * from a specified id + * @param [in] respIndId + * @param [out] pRespIndSize + * @return true if resp ID was found; else false +*/ + +bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) +{ + size_t idx = 0, respIndTableSize = 0; + respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); + for(idx=0; idx +#include "location_service_v02.h" //QMI LOC Service data types definitions +#include +#include + +/****************************************************************************** + * Constants and configuration + *****************************************************************************/ + +/** @addtogroup constants_macros +@{ */ + +/** Specific value of #locClientHandleType, indicating an invalid handle. */ +#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) + +/** @} */ /* end_addtogroup constants_macros */ + +/** @addtogroup data_types +@{ */ + +/** Location client handle used to represent a specific client. Negative values + are invalid handles. */ +typedef void* locClientHandleType; + +/** Data type for events and event masks. + @newpage */ +typedef uint64_t locClientEventMaskType; + +/** Location client status values. + @vertspace +*/ +typedef enum +{ + eLOC_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + eLOC_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + eLOC_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + eLOC_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 + /**< Failed because the service has not been initialized. */ + +}locClientStatusEnumType; + +/** Loc Client error values +*/ + +typedef enum +{ + eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 + /**< Service is no longer available, the client should + close the existing connection and reopen the connection + upon getting this error. + */ +}locClientErrorEnumType; + + +/** @} */ /* end_addtogroup data_types */ + +/** @addtogroup send_request +@{ */ + +/** @brief Request messages the client can send to the location engine. + + The following requests do not have any data associated, so they do not have a + payload structure defined: + + - GetServiceRevision + - GetFixCriteria + - GetPredictedOrbitsDataSource + - GetPredictedOrbitsDataValidity + - GetEngineLock + - GetSbasConfigReq + - GetRegisteredEvents + - GetNmeaTypes + - GetLowPowerMode + - GetXtraTSessionControl + - GetRegisteredEvents + - GetOperationMode + - GetCradleMountConfig + - GetExternalPowerConfig +*/ +typedef union +{ + const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; + /**< Notifies the service about the revision the client is using. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ + + const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; + /**< Changes the events the client is interested in receiving. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_REG_EVENTS_REQ_V02. */ + + const qmiLocStartReqMsgT_v02* pStartReq; + /**< Starts a positioning session. + + The client receives the following indications: position report, + satellite report, fix session report, and NMEA report (if applicable). + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_START_REQ_V02. */ + + const qmiLocStopReqMsgT_v02* pStopReq; + /**< Stops a positioning session. The client receives a fix session report + denoting that the fix session ended after this message was sent. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_STOP_REQ_V02. */ + + const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; + /**< Informs the service about the user response for a network-initiated call. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NI_USER_RESPONSE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ + + const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; + /**< Injects the predicted orbits data into the service. + + When all predicted orbits data parts have been injected, the client + receives the following indication containing a response: + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. + + The client injects successive data parts without waiting for this + indication as long as locClientSendReq() returns successfully. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ + + const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; + /**< Injects UTC time into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_UTC_TIME_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ + + const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; + /**< Injects a position into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_POSITION_REQ_V02. */ + + const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; + /**< Sets the location engine lock. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_ENGINE_LOCK_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ + + const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; + /**< Sets the SBAS configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SBAS_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ + + const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; + /**< Sets the NMEA types configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_NMEA_TYPES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ + + const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; + /**< Sets the Low Power mode configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ + + const qmiLocSetServerReqMsgT_v02* pSetServerReq; + /**< Sets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SERVER_REQ_V02. */ + + const qmiLocGetServerReqMsgT_v02* pGetServerReq; + /**< Gets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SERVER_REQ_V02. */ + + const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; + /**< Deletes the aiding data from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; + /**< Sets XTRA-T session control in the engine. If the request is accepted by + the service, the client receives the following indication containing a + response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ + + const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; + /**< Injects a WiFi position into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ + + const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; + /**< Notifies the engine about the WiFi status. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ + + const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; + /**< Sets the engine Operation mode. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_OPERATION_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ + + const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; + /**< Sends the stationary position status to the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SPI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SPI_STATUS_REQ_V02. */ + + const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; + /**< Injects sensor data into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ + + const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; + /**< Injects time synchronization information into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ + + const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; + /**< Sets the cradle mount state information in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + SET_CRADLE_MOUNT_CONFIG_REQ_V02. + + To send this request, set the reqId field in locClientSendReq() to + SET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; + /**< Sets external power configuration state in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ + + const qmiLocInformLocationServerConnStatusReqMsgT_v02* + pInformLocationServerConnStatusReq; + /**< Informs the engine about the connection status to the location server. + + This can be sent in response to a + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The + service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 + response indication for this request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ + + const qmiLocSetProtocolConfigParametersReqMsgT_v02* + pSetProtocolConfigParametersReq; + /**< Sets the protocol configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetProtocolConfigParametersReqMsgT_v02* + pGetProtocolConfigParametersReq; + /**< Retrieves protocol configuration parameters from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocSetSensorControlConfigReqMsgT_v02* + pSetSensorControlConfigReq; + /**< Sets the sensor control configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* + pSetSensorPerformanceControlConfigReq; + /**< Sets the sensor performance configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + @newpage */ + + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; + /**< Sets the sensor properties in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + @newpage */ + + const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; + /**< Injects a SUPL certificate into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; + /**< Deletes a SUPL certificate from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* + pSetPositionEngineConfigParametersReq; + /**< Sets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* + pGetPositionEngineConfigParametersReq; + /**< Gets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + +}locClientReqUnionType; + + +/** @brief Event indications that are sent by the service. +*/ +typedef union +{ + const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; + /**< Contains the position information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. If + periodic fix criteria is specified, this event is generated multiple + times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is + sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ + + const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; + /**< Contains the GNSS satellite information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. This event + is generated at 1 Hz if the location engine is tracking satellites to + make a location fix. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ + + const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; + /**< Contains an NMEA report sentence. The entire NMEA report consisting + of multiple sentences is sent at a 1Hz rate. + This event is generated after QMI_LOC_START_REQ_V02 is sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NMEA_IND_V02. */ + + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; + /**< Notifies a location client when the network triggers a positioning request + to the mobile. + + Upon getting this event, the location client displays the + network-initiated fix request in a dialog and prompts the user to accept + or deny the request. The client responds to this request with the message + QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ + + const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; + /**< Asks the client for time assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The eventIndId field in the event indication callback is + set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ + + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + pInjectPredictedOrbitsReqEvent; + /**< Asks the client for predicted orbits data assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ + + const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; + /**< Asks the client for position assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_POSITION_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ + + const qmiLocEventEngineStateIndMsgT_v02* pEngineState; + /**< Sent by the engine whenever it turns on or off. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ + + const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; + /**< Sent by the engine when a location session begins or ends. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ + + const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; + /**< Sent by the engine when it needs WiFi support. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ + + const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* + pSensorStreamingReadyStatusEvent; + /**< Notifies the client that the engine is ready to accept sensor data. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ + + const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; + /**< Sent by the engine when it needs to synchronize its time with the sensor + processor time. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ + + const qmiLocEventSetSpiStreamingReportIndMsgT_v02* + pSetSpiStreamingReportEvent; + /**< Asks the client to start/stop sending a Stationary Position Indicator + (SPI) stream. + + The eventIndId field in the event indication callback is set to + QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ + + const qmiLocEventLocationServerConnectionReqIndMsgT_v02* + pLocationServerConnReqEvent; + /**< Sent by the engine to ask the client to open or close a connection to + a location server. + + The client responds to this request by sending the + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. + @newpage */ + +}locClientEventIndUnionType; + + +/** @brief Response indications that are sent by the service. */ +typedef union +{ + const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; + /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ + + const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; + /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ + + const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; + /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NI_USER_RESPONSE_IND_V02. */ + + const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* + pInjectPredictedOrbitsDataInd; + /**< Sent after a predicted orbits data part has been successfully injected. + + The client waits for this indication before injecting the next part. + This indication is sent in response to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* + pGetPredictedOrbitsDataSourceInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* + pGetPredictedOrbitsDataValidityInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ + + const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; + /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_UTC_TIME_IND_V02. */ + + const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; + /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_POSITION_IND_V02. */ + + const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; + /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ + + const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; + /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ + + const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; + /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ + + const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; + /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ + + const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; + /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_NMEA_TYPES_IND_V02. */ + + const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; + /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NMEA_TYPES_IND_V02. */ + + const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; + /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; + /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocSetServerIndMsgT_v02* pSetServerInd; + /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SERVER_IND_V02. */ + + const qmiLocGetServerIndMsgT_v02* pGetServerInd; + /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVER_IND_V02. */ + + const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; + /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; + /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ + + const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; + /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ + + const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; + /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ + + const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; + /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_OPERATION_MODE_IND_V02. */ + + const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; + /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_OPERATION_MODE_IND_V02. */ + + const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; + /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SPI_STATUS_IND_V02. */ + + const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; + /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ + + const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; + /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ + + const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ + + const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocInformLocationServerConnStatusIndMsgT_v02* + pInformLocationServerConnStatusInd; + /**< Response to the request, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ + + const qmiLocSetProtocolConfigParametersIndMsgT_v02* + pSetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetProtocolConfigParametersIndMsgT_v02* + pGetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* + pSetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* + pGetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; + /**< Response to the request, + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; + /**< Response to the request, + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* + pSetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* + pGetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + +}locClientRespIndUnionType; + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup data_types +@{ */ + +/** Location event indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the asynchronous event indications. + + @vertspace + @param handle Location client for this event. Only the client who + registered for the corresponding event receives + this callback. + @param eventIndId ID of the event indication. + @param eventIndPayload Event indication payload. + @param pClientCookie Pointer to the cookie the client specified during + registration. +*/ +typedef void (*locClientEventIndCbType)( + locClientHandleType handle, + uint32_t eventIndId, + const locClientEventIndUnionType eventIndPayload, + void *pClientCookie +); + +/** Location response indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the response indications. + + @vertspace + @param handle Location client who sent the request for which this + response indication is generated. + @param respIndId ID of the response. It is the same value as the ID + of request sent to the engine. + @param respIndPayload Payload of the response indication. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @newpage +*/ +typedef void (*locClientRespIndCbType)( + locClientHandleType handle, + uint32_t respIndId, + const locClientRespIndUnionType respIndPayload, + void *pClientCookie +); + +/** Location error callback function type. This function will be + called to inform the client that the service is no longer + available. When the client receives this callback it must + close the existing connection and reopen the client connection. + + + @vertspace + @param handle Location client who sent the request for which this + error indication is generated. + @param errorId Error ID. + @param errorCbdata Payload associated with the error indication. + + @newpage +*/ +typedef void (*locClientErrorCbType)( + locClientHandleType handle, + locClientErrorEnumType errorId, + void* pClientCookie + ); + + +/** Callback functions to be registered during locClientOpen +*/ + +typedef struct +{ + uint32_t size; + /**< Size of the structure */ + locClientEventIndCbType eventIndCb; + /**< Event Indication callback */ + locClientRespIndCbType respIndCb; + /**< Response Indication callback */ + locClientErrorCbType errorCb; + /**< Error Indication callback */ +}locClientCallbacksType; + +/** @} */ /* end_addtogroup data_types */ + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** @addtogroup open_client +@{ */ +/*========================================================================== + locClientOpen */ +/** + @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location + client to the location engine. If the connection is successful, this function + returns a handle that the location client uses for future location operations. + + @datatype + #locClientStatusEnumType\n + #locClientEventMaskType\n + #locClientCallbacksType *\n + #locClientHandleType *\n + #void * + + @vertspace + @param[in] eventRegMask Mask of asynchronous events the client is + interested in receiving. + @param[in] pLocClientCallbacks Pointer to structure containing the + callbacks. + @param[out] pLocClientHandle Pointer to the handle to be used by the + client for any subsequent requests. + @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the + client along with the callbacks. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pLocClientCookie +); + +/** @} */ /* end_addtogroup open_client */ + +/** @addtogroup close_client +@{ */ +/*========================================================================== + locClientClose */ +/** + @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client + from the location engine and sets the handle to + LOC_CLIENT_INVALID_HANDLE_VALUE. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType + + @vertspace + @param[in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientClose ( + locClientHandleType* pLocClientHandle +); + +/** @} */ /* end_addtogroup close_client */ + +/** @addtogroup send_request +@{ */ +/*============================================================================= + locClientSendReq */ +/** + @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to + the location engine. If this function is successful, the client expects an + indication (except start, stop, event registration, and sensor injection + messages) through the registered callback in the locClientOpen() function. + + The indication contains the status of the request. If the status is a success, + the indication also contains the payload associated with response. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType\n + #locClientReqUnionType + + @vertspace + @param[in] handle Handle returned by the locClientOpen() function. + @param[in] reqId QMI_LOC service message ID of the request. + @param[in] pReqPayload Payload of the request. This can be NULL if the request + has no payload. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + + @structure + locClientReqUnionType + @newpage +*/ +extern locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload +); + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup get_size_event +@{ */ +/*============================================================================= + locClientGetSizeByEventIndId */ +/** + Gets the size of the event indication structure from a specified ID. + + @datatype + #locClientGetSizeByEventIndId + + @vertspace + @param[in] eventIndId Event indicator ID. + @param[out] pEventIndSize Pointer to the size of the structure. + + @return + true -- The event ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientEventIndUnionType + @newpage +*/ +extern bool locClientGetSizeByEventIndId( + uint32_t eventIndId, + size_t *pEventIndSize); + +/** @} */ /* end_addtogroup get_size_event */ + +/** @addtogroup get_size_response +@{ */ +/*============================================================================= + locClientGetSizeByRespIndId */ + +/** + Gets the size of the response indication structure from a specified ID. + + @datatype + #locClientGetSizeByRespIndId + + @vertspace + @param[in] respIndId Response indicator ID. + @param[out] pRespIndSize Pointer to the size of the structure. + + @return + true -- The response ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientRespIndUnionType + @newpage +*/ +extern bool locClientGetSizeByRespIndId( + uint32_t respIndId, + size_t *pRespIndSize); + +/*=============================================================================*/ + +/** @} */ /* end_addtogroup get_size_response */ + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c new file mode 100755 index 00000000..78792607 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -0,0 +1,243 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static loc_name_val_s_type loc_v02_event_name[] = +{ + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_START_REQ_V02), + NAME_VAL(QMI_LOC_START_RESP_V02), + NAME_VAL(QMI_LOC_STOP_REQ_V02), + NAME_VAL(QMI_LOC_STOP_RESP_V02), + NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), +}; +static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_event_name(uint32_t event) +{ + return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); +} + +static loc_name_val_s_type loc_v02_client_status_name[] = +{ + NAME_VAL(eLOC_CLIENT_SUCCESS), + NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), + NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), + NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), + NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), + NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), + NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), +}; +static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_client_status_name(locClientStatusEnumType status) +{ + return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); +} + + +static loc_name_val_s_type loc_v02_qmi_status_name[] = +{ + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, + eQMI_LOC_SUCCESS_V02, + eQMI_LOC_GENERAL_FAILURE_V02, + eQMI_LOC_UNSUPPORTED_V02, + eQMI_LOC_INVALID_PARAMETER_V02, + eQMI_LOC_ENGINE_BUSY_V02, + eQMI_LOC_PHONE_OFFLINE_V02, + eQMI_LOC_TIMEOUT_V02, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 +}; +static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) +{ + return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); +} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h new file mode 100755 index 00000000..c63972f9 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V02_LOG_H +#define LOC_API_V02_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_v02_event_name(uint32_t event); +const char* loc_get_v02_client_status_name(locClientStatusEnumType status); +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); + + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h new file mode 100755 index 00000000..f1b675e3 --- /dev/null +++ b/loc_api/loc_api_v02/loc_util_log.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_UTIL_LOG_H +#define LOC_UTIL_LOG_H + +#ifdef FEATURE_LOC_API_V02_QNX_MOD +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#endif //FEATURE_LOC_API_V02_QNX_MOD + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +#include + +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +// get around strl*: not found in glibc +// TBD:look for presence of eglibc other libraries +// with strlcpy supported. +#define strlcpy(X,Y,Z) strcpy(X,Y) +#define strlcat(X,Y,Z) strcat(X,Y) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#elif defined(_ANDROID_) + +#include + +#endif //LOC_UTIL_TARGET_OFF_TARGET + + +#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c new file mode 100755 index 00000000..37d93f6f --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -0,0 +1,2223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 7, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 8, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 9, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 11, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 11, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 4, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 18, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 26, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 0, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 2, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 3, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 13, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 15, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 17, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 19, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 13, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 17, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 20, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 22, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 23, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 24, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 25, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 27, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 27, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 28, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, + {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} +}; + +/*Service Object*/ +const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x02, + 0x02, + 16, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02 +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h new file mode 100755 index 00000000..2f288145 --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -0,0 +1,5914 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x04 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x02 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x005F; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of SUPL CERT. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. \n + - Type: Unsigned integer */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyrometer, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from + the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. + These requests are generated when the service wishes to establish a + connection with a location server. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: \n + + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. + Request a single position fix. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. + High accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. + Intermediate reports are turned off. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Type: Unsigned integer \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n + - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Type: Unsigned integer \n + - Units: Milliseconds \n + - Default: 1000 ms + */ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. + Fix request failed because the engine is locked. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Type: Unsigned integer \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n + - PDOP = square root of (HDOP^2 + VDOP^2) */ + + float HDOP; + /**< Horizontal dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + + float VDOP; + /**< Vertical dilution of precision.\n + - Type: Floating point. \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors are used. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- SENSOR_USED_ACCEL \n + - 0x00000002 -- SENSOR_USED_GYRO */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results are aided by sensors. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network + Source of the time is unknown */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed + Location reliability is high; strong cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This message is used to send the position report to the + control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \n + - 0x00000000 -- SESS_STATUS_SUCCESS \n + - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n + - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n + - 0x00000003 -- SESS_STATUS_TIMEOUT \n + - 0x00000004 -- SESS_STATUS_USER_END \n + - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n + - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n + - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). \n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Type: Floating point \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< Speed uncertainty.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH */ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. \n + - Type: Floating point */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \n + - 0x00000001 -- SATELLITE \n + - 0x00000002 -- CELLID \n + - 0x00000004 -- WIFI */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time \n */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Type: Floating point \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \n + - 0x00000000 -- TIME_SRC_INVALID \n + - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n + - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n + - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n + - 0x00000004 -- TIME_SRC_TOW_DECODE \n + - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n + - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n + - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n + - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. + GLONASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. + SV is being tracked. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \n + - 0x00000001 -- VALID_SYSTEM \n + - 0x00000002 -- VALID_GNSS_SVID \n + - 0x00000004 -- VALID_HEALTH_STATUS \n + - 0x00000008 -- VALID_PROCESS_STATUS \n + - 0x00000010 -- VALID_SVINFO_MASK \n + - 0x00000020 -- VALID_ELEVATION \n + - 0x00000040 -- VALID_AZIMUTH \n + - 0x00000080 -- VALID_SNR + + */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + uint16_t gnssSvId; + /**< GNSS SV ID. \n + + - Type: Unsigned integer \n + - Range: \n + -- For GPS: 1 to 32 \n + -- For SBAS: 33 to 64 \n + -- For GLONASS: 65 to 96 */ + + uint8_t healthStatus; + /**< Health status. \n + - Type: Unsigned integer \n + - Range: 0 = unhealthy; 1 = healthy */ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Type: Floating point \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Altitude assumed or calculated:\n + - 0x00 (FALSE) -- Valid altitude is calculated \n + - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough + satellites to determine precise altitude */ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send NMEA sentences to the control point. */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 201 */ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. + Notify and Verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. + MS-based preferred, but MS-assisted allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. + Encoding is GSM. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Type: Unsigned integer \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. \n + - Type: Unsigned integer */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Type: Unsigned integer \n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \n + - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n + - 0x00000002 -- NI_VX_MS_BASED_ONLY \n + - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n + - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \n + - 0x00000000 -- NI_VX_OCTET \n + - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n + - 0x00000002 -- NI_VX_ASCII \n + - 0x00000003 -- NI_VX_IA5 \n + - 0x00000004 -- NI_VX_UNICODE \n + - 0x00000005 -- NI_VX_SHIFT_JIS \n + - 0x00000006 -- NI_VX_KOREAN \n + - 0x00000007 -- NI_VX_LATIN_HEBREW \n + - 0x00000008 -- NI_VX_LATIN \n + - 0x00000009 -- NI_VX_GSM + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. + No position. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. + Encoding is GSM default. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity + SUPL unknown format. */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \n + - 0x00000000 -- FORMAT_LOGICAL_NAME \n + - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n + - 0x00000002 -- FORMAT_MSISDN \n + - 0x00000003 -- FORMAT_URL \n + - 0x00000004 -- FORMAT_SIP_URL \n + - 0x00000005 -- FORMAT_MIN \n + - 0x00000006 -- FORMAT_MDN \n + - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n + - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID */ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. \n + - Type: Unsigned integer */ + + uint16_t port; + /**< IPV4 port. \n + - Type: Unsigned integer */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. \n + - Type: Unsigned integer */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \n + - 0x00000001 -- SUPL_SERVER_INFO \n + - 0x00000002 -- SUPL_SESSION_ID \n + - 0x00000004 -- SUPL_HASH \n + - 0x00000008 -- SUPL_POS_METHOD \n + - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n + - 0x00000020 -- SUPL_REQUESTOR_ID \n + - 0x00000040 -- SUPL_CLIENT_NAME \n + - 0x00000080 -- SUPL_QOP \n + - 0x00000100 -- SUPL_USER_RESP_TIMER + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \n + - 0x00000001 -- AGPS_SETASSISTED \n + - 0x00000002 -- AGPS_SETBASED \n + - 0x00000003 -- AGPS_SETASSISTED_PREF \n + - 0x00000004 -- AGPS_SETBASED_PREF \n + - 0x00000005 -- AUTONOMOUS_GPS \n + - 0x00000006 -- AFLT \n + - 0x00000007 -- ECID \n + - 0x00000008 -- EOTD \n + - 0x00000009 -- OTDOA \n + - 0x0000000A -- NO_POSITION + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. + Initial location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \n + - 0x0001 -- INVOKE_ID_MASK \n + - 0x0002 -- DATA_CODING_SCHEME_MASK \n + - 0x0004 -- NOTIFICATION_TEXT_MASK \n + - 0x0008 -- CLIENT_ADDRESS_MASK \n + - 0x0010 -- LOCATION_TYPE_MASK \n + - 0x0020 -- REQUESTOR_ID_MASK \n + - 0x0040 -- CODEWORD_STRING_MASK \n + - 0x0080 -- SERVICE_TYPE_MASK \n + - 0x0100 -- USER_RESP_TIMER_MASK + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. \n + - Type: Unsigned integer */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \n + - 0x00000001 -- CURRENT_LOCATION \n + - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n + - 0x00000004 -- INITIAL_LOCATION + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. \n + - Type: Unsigned integer */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \n + - 0x00000001 -- ONGOING_NI_INCOMING_MO + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). \n + - Type: Unsigned integer */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). \n + - Type: Unsigned integer */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp.\n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. + Location engine is off. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. + Location fix session has ended. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. + Stop periodic fixes request. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \n + - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n + - 0x00000001 -- START_PERIODIC_KEEP_WARM \n + - 0x00000002 -- STOP_PERIODIC_FIXES + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \n + + samplesPerBatch must be a non-zero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in integral number of batches per + second (Hz). \n + + batchesPerSecond must be a non-zero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \n + - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n + - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor + data + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyrometer Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor + data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. \n + - Type: Unsigned integer */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream.\n + - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n + - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. + Bring up the WWAN type used for AGNSS connections. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. + Close a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. \n + Valid values: \n + - 0x00000000 -- WWAN_TYPE_INTERNET \n + - 0x00000001 -- WWAN_TYPE_AGNSS + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. + Request failed because it timed out. */ + eQMI_LOC_TIMEOUT_V02 = 6, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. \n + - Type: Unsigned integer */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n + - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. \n + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Mimimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. + User did not respond to notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \n + - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n + - 0x00000002 -- NOTIFY_VERIFY_DENY \n + - 0x00000003 -- NOTIFY_VERIFY_NORESP + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Type: Unsigned integer \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \n + - 0x00000000 -- PREDICTED_ORBITS_XTRA + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. \n + - Type: Unsigned integer */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Oribits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Type: Unsigned integer \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Type: Unsigned integer \n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. + Other sources. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. + Fully independent. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. + Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \n + - 0x00000000 -- ALT_SRC_UNKNOWN \n + - 0x00000001 -- ALT_SRC_GPS \n + - 0x00000002 -- ALT_SRC_CELL_ID \n + - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n + - 0x00000004 -- ALT_SRC_WIFI \n + - 0x00000005 -- ALT_SRC_TERRESTRIAL \n + - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n + - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n + - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n + - 0x00000009 -- ALT_SRC_OTHER + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \n + - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n + - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n + - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n + - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \n + - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n + - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the + injected horizontal position coordinates only. \n + - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the + position of the device regardless of horizontal position + (within the horizontal uncertainty region, if provided). + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. + Other sources. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0 to 99) \n + - 0 -- invalid value \n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99 \n + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters; positive = height, negative = depth */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0-99) \n + - 0 -- invalid value\n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99\n + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Type: Signed integer \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from where this position was obtained. + Valid values: \n + - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n + - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n + - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n + - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n + - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n + - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n + - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n + + If altitude is specified and altitude source is not specified, the engine + assumes that altitude was obtained using the specified Position source. + If altitude and altitude source both are specified then the engine assumes + that only latitude, longitude were obtained using the specified Position + Source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. + Lock all position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. + Server type is custom PDE. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. \n + - Type: Unsigned integer \n + - Range: \n + - For GPS: 1 to 32 \n + - For SBAS: 33 to 64 \n + - For GLONASS: 65 to 96 */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + Valid values: \n + - 0x01 (TRUE) -- All assistance data is to be deleted; + if this flag is set, all the other information + contained in the optional fields for this + message are ignored \n + - 0x00 (FALSE) -- The optional fields in the message are to be used + to determine which data is to be deleted */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assitance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + Valid values: \n + - 0x00000001 -- DELETE_GPS_SVDIR \n + - 0x00000002 -- DELETE_GPS_SVSTEER \n + - 0x00000004 -- DELETE_GPS_TIME\n + - 0x00000008 -- DELETE_GPS_ALM_CORR \n + - 0x00000010 -- DELETE_GLO_SVDIR \n + - 0x00000020 -- DELETE_GLO_SVSTEER \n + - 0x00000040 -- DELETE_GLO_TIME \n + - 0x00000080 -- DELETE_GLO_ALM_CORR \n + - 0x00000100 -- DELETE_SBAS_SVDIR \n + - 0x00000200 -- DELETE_SBAS_SVSTEER \n + - 0x00000400 -- DELETE_POSITION \n + - 0x00000800 -- DELETE_TIME \n + - 0x00001000 -- DELETE_IONO \n + - 0x00002000 -- DELETE_UTC \n + - 0x00004000 -- DELETE_HEALTH \n + - 0x00008000 -- DELETE_SADATA \n + - 0x00010000 -- DELETE_RTI \n + - 0x00020000 -- DELETE_SV_NO_EXIST \n + - 0x00040000 -- DELETE_FREQ_BIAS_EST + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CELLDB_POS \n + - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n + - 0x00000004 -- DELETE_CELLDB_OTA_POS \n + - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n + - 0x00000010 -- DELETE_CELLDB_TIMETAG \n + - 0x00000020 -- DELETE_CELLDB_CELLID \n + - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n + - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n + - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n + - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n + - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n + - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n + - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n + - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n + - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n + - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n + - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n + - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n + - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n + - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. \n + - Type: Unsigned integer */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. + WiFi fix failed, but the cause could not be determined. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. \n + - Type: Unsigned integer */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \n + - 0x00000000 -- ERROR_SUCCESS \n + - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n + - 0x00000002 -- ERROR_NO_AP_FOUND \n + - 0x00000003 -- ERROR_UNAUTHORIZED \n + - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n + - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n + - 0x00000006 -- ERROR_UNKNOWN + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Type: Signed integer \n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. \n + - Type: Unsigned integer */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. \n + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. + WiFi is not available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \n + - 0x00000001 -- WIFI_STATUS_AVAILABLE \n + - 0x00000002 -- WIFI_STATUS_UNAVAILABLE + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + + Valid bitmasks: \n + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. + Use cell ID. For 1x, this mode corresponds to + AFLT. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary:\n + - 0x00 (FALSE) -- Device is not stationary \n + - 0x01 (TRUE) -- Device is stationary */ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the sensor time of the first sample.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit time tag of the first (oldest) sample in this + message. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \n + - 0x01 -- SIGN REVERSAL + */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyrometer Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyrometer sensor samples. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< This field lets the client know how many 3-axis accelerometer samples + were accepted. */ + + /* Optional */ + /* Gyrometer Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< This field lets the client know how many 3-axis gyrometer samples were + accepted. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< The value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< The value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle + Unknown cradle mount state */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. + Unknown external power state. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. + PPP PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the Access Point Name (APN) profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 101 + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. + Location server request failed. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n APN profile information is present only when requestType + is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. + V2 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. + SUPL version 2.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< This field is sent only if the status is not a success. And if it is + not successful, this field will identify the parameters that were not + set successfully. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + + Inertial sensors are not to be used to aid heading and position + improvement. */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in heading and + position improvement. + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in the heading and + position improvement. + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/second^4 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPropertiesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/seconds^4 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors + Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal + number of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< This field is sent only if the status is not a success. + When sent, this field identifies which configuration failed. \n + Valid bitmasks: \n + - 0x0000000000000001 -- PERFORMANCE_MODE \n + - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n + - 0x0000000000000004 -- GYRO_SAMPLING_SPEC + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Id */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate + Type: Unsigned Integer + Units: Bytes + Range: 0-9 */ + + /* Mandatory */ + /* SUPL certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< The supl Certificate contents + Type: Array of bytes. + - Maximum certificate size : 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* Supl Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the inject SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Delete a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate Id */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate to be deleted + Type: Unsigned Integer \n + Units: Bytes \n + Range: 0-9 \n + If suplCertId is not specified then + "all" supl certificates will be deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Delete a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL certifcate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the delete SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the + injected position in direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data + in the persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position will be used in position engine.\n + Valid values: \n + - 0x01 (TRUE) -- Use the injected position in direct position + calculation. \n + - 0x00 (FALSE) -- Do not use the injected position in direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls if SV usage will be filtered in a position fix. + Valid values:\n + - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n + - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data should be stored in + the persistent memory. \n + Valid values:\n + - 0x01 (TRUE) -- Store assistance data in persistent memory. \n + - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies if the injected position is used for direct calculation + in the position engine.\n + Valid values: \n + - 0x01 (TRUE) -- The injected position is used in direct position + calculation. \n + - 0x00 (FALSE) -- The injected position is not used direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies if SV usage is filtered in a position fix. + Valid values: \n + - 0x01 (TRUE) -- SV usage is filtered in the fix. \n + - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies if assistance data is stored in the persistent memory. \n + Valid values: \n + 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n + 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h new file mode 100755 index 00000000..6321bb9c --- /dev/null +++ b/loc_api/ulp/inc/ulp.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define ULP_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +typedef int (ulp_report_position_cb) +( + void* owner, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data +); + +/** Represents the standard ulp module interface. */ +typedef struct { + /** set to sizeof(ulpInterface) */ + size_t size; + + /** + * Starts the ulp module. 0: success + */ + int (*init)( void* owner, ulp_report_position_cb* cb); + + /** Starts the ulp engine. 0: success */ + int (*start_fix)( void ); + + /** Stops the ulp engine. 0: success */ + int (*stop_fix)( void ); + + /** Closes the interface */ + int (*destroy)( void ); + +} ulpInterface; + +typedef const ulpInterface* (get_ulp_interface) (void); + + +#ifdef __cplusplus +} +#endif +#endif /* ULP_H */ + diff --git a/utils/Android.mk b/utils/Android.mk new file mode 100755 index 00000000..7ce454f8 --- /dev/null +++ b/utils/Android.mk @@ -0,0 +1,45 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +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 + +LOCAL_SRC_FILES += \ + loc_log.cpp \ + loc_cfg.cpp \ + msg_q.c \ + linked_list.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +## Includes +LOCAL_C_INCLUDES:= + +LOCAL_COPY_HEADERS_TO:= gps.utils/ +LOCAL_COPY_HEADERS:= \ + loc_log.h \ + loc_cfg.h \ + log_util.h \ + linked_list.h \ + msg_q.h + +LOCAL_MODULE := libgps.utils + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRELINK_MODULE := false + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) +include $(BUILD_SHARED_LIBRARY) +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE + diff --git a/utils/linked_list.c b/utils/linked_list.c new file mode 100755 index 00000000..16f2aa22 --- /dev/null +++ b/utils/linked_list.c @@ -0,0 +1,328 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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_LOGD("%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_LOGD("%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_LOGD("%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/utils/linked_list.h b/utils/linked_list.h new file mode 100755 index 00000000..cfc945a7 --- /dev/null +++ b/utils/linked_list.h @@ -0,0 +1,217 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/utils/loc_cfg.cpp b/utils/loc_cfg.cpp new file mode 100755 index 00000000..de960788 --- /dev/null +++ b/utils/loc_cfg.cpp @@ -0,0 +1,272 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +/*============================================================================= + * + * GLOBAL DATA DECLARATION + * + *============================================================================*/ + +/* Parameter data */ +loc_gps_cfg_s_type gps_conf; + +/* Parameter spec table */ + +loc_param_s_type loc_parameter_table[] = +{ + {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, 'n'}, + {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, 'n'}, + {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, 'n'}, + /* DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info + 4 - Debug, 5 - Verbose */ + {"DEBUG_LEVEL", &gps_conf.DEBUG_LEVEL, 'n'}, + {"SUPL_VER", &gps_conf.SUPL_VER, 'n'}, + {"CAPABILITIES", &gps_conf.CAPABILITIES, 'n'}, + {"TIMESTAMP", &gps_conf.TIMESTAMP, 'n'}, + {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, 'f'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, 'n'}, + {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, 'n'}, + {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, 'n'}, +}; + +int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); + +/*=========================================================================== +FUNCTION loc_default_parameters + +DESCRIPTION + Resets the parameters to default + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ + +static void loc_default_parameters() +{ + /* defaults */ + gps_conf.INTERMEDIATE_POS = 0; + gps_conf.ACCURACY_THRES = 0; + gps_conf.ENABLE_WIPER = 0; + gps_conf.DEBUG_LEVEL = 3; /* debug level */ + gps_conf.SUPL_VER = 0x10000; + gps_conf.CAPABILITIES = 0x7; + gps_conf.TIMESTAMP = 0; + + gps_conf.GYRO_BIAS_RANDOM_WALK = 0; + + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + gps_conf.SENSOR_USAGE = 0; /* Enabled */ + + /* Value MUST be set by OEMs in configuration for sensor-assisted + navigation to work. There is NO default value */ + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + + /* reset logging mechanism */ + loc_logger_init(gps_conf.DEBUG_LEVEL, 0); +} + +/*=========================================================================== +FUNCTION trim_space + +DESCRIPTION + Removes leading and trailing spaces of the string + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void trim_space(char *org_string) +{ + char *scan_ptr, *write_ptr; + char *first_nonspace = NULL, *last_nonspace = NULL; + + scan_ptr = write_ptr = org_string; + + while (*scan_ptr) + { + if ( !isspace(*scan_ptr) && first_nonspace == NULL) + { + first_nonspace = scan_ptr; + } + + if (first_nonspace != NULL) + { + *(write_ptr++) = *scan_ptr; + if ( !isspace(*scan_ptr)) + { + last_nonspace = write_ptr; + } + } + + scan_ptr++; + } + + if (last_nonspace) { *last_nonspace = '\0'; } +} + +/*=========================================================================== +FUNCTION loc_read_gps_conf + +DESCRIPTION + Reads the gps.conf file and sets global parameter data + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void loc_read_gps_conf(void) +{ + FILE *gps_conf_fp = NULL; + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + char *lasts; + char *param_name, *param_str_value; + int param_int_value = 0; + double param_double_value = 0; + int i; + + loc_default_parameters(); + + if((gps_conf_fp = fopen(GPS_CONF_FILE, "r")) != NULL) + { + LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE); + } + else + { + LOC_LOGW("%s: no %s file, using defaults", __FUNCTION__, GPS_CONF_FILE); + return; /* no parameter file */ + } + + while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) + { + /* Separate variable and value */ + param_name = strtok_r(input_buf, "=", &lasts); + if (param_name == NULL) continue; /* skip lines that do not contain "=" */ + param_str_value = strtok_r(NULL, "=", &lasts); + if (param_str_value == NULL) continue; /* skip lines that do not contain two operands */ + + /* Trim leading and trailing spaces */ + trim_space(param_name); + trim_space(param_str_value); + + // printf("*(%s) = (%s)\n", param_name, param_str_value); + + /* Parse numerical value */ + if (param_str_value[0] == '0' && tolower(param_str_value[1]) == 'x') + { + /* hex */ + param_int_value = (int) strtol(¶m_str_value[2], (char**) NULL, 16); + } + else { + param_double_value = (double) atof(param_str_value); /* float */ + param_int_value = atoi(param_str_value); /* dec */ + } + + if (strcmp("GYRO_BIAS_RANDOM_WALK", param_name) == 0) + { + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 1; + } + + for(i = 0; i < loc_param_num; i++) + { + if (strcmp(loc_parameter_table[i].param_name, param_name) == 0 && + loc_parameter_table[i].param_ptr) + { + switch (loc_parameter_table[i].param_type) + { + case 's': + if (strcmp(param_str_value, "NULL") == 0) + { + *((char*)loc_parameter_table[i].param_ptr) = '\0'; + } + else { + strlcpy((char*) loc_parameter_table[i].param_ptr, + param_str_value, + LOC_MAX_PARAM_STRING + 1); + } + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, param_name, (char*)loc_parameter_table[i].param_ptr); + break; + case 'n': + *((int *)loc_parameter_table[i].param_ptr) = param_int_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, param_name, param_int_value); + break; + case 'f': + *((double *)loc_parameter_table[i].param_ptr) = param_double_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, param_name, param_double_value); + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n or n", __FUNCTION__, param_name); + } + } + } + } + + fclose(gps_conf_fp); + + /* Initialize logging mechanism with parsed data */ + loc_logger_init(gps_conf.DEBUG_LEVEL, gps_conf.TIMESTAMP); +} diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h new file mode 100755 index 00000000..ffeb83c4 --- /dev/null +++ b/utils/loc_cfg.h @@ -0,0 +1,98 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_MAX_PARAM_NAME 36 +#define LOC_MAX_PARAM_STRING 80 +#define LOC_MAX_PARAM_LINE 80 + +// Don't want to overwrite the pre-def'ed value +#ifndef GPS_CONF_FILE +#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent +#endif + +/*============================================================================= + * + * MODULE TYPE DECLARATION + * + *============================================================================*/ +typedef struct +{ + char param_name[LOC_MAX_PARAM_NAME]; + void *param_ptr; + char param_type; /* 'n' for number; 's' for string */ +} loc_param_s_type; + +/* GPS.conf support */ +typedef struct loc_gps_cfg_s +{ + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long ENABLE_WIPER; + unsigned long DEBUG_LEVEL; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + unsigned long TIMESTAMP; + unsigned long GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + // char string_val[LOC_MAX_PARAM_STRING + 1]; /* An example string value */ +} loc_gps_cfg_s_type; + +/*============================================================================= + * + * MODULE EXTERNAL DATA + * + *============================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern loc_gps_cfg_s_type gps_conf; + +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +extern void loc_read_gps_conf(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_CFG_H */ diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp new file mode 100755 index 00000000..e4fb76c4 --- /dev/null +++ b/utils/loc_log.cpp @@ -0,0 +1,183 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +// 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"; + +/* Logging Mechanism */ +loc_logger_s_type loc_logger; + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) +{ + int 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(loc_name_val_s_type table[], int table_size, long value) +{ + int i; + for (i = 0; i < table_size; i++) + { + if (table[i].val == (long) value) + { + return table[i].name; + } + } + return UNKNOWN_STR; +} + +static 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 int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); + +/* 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"; +} + + +/*=========================================================================== + +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, unsigned long 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; + 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/utils/loc_log.h b/utils/loc_log.h new file mode 100755 index 00000000..8b071a48 --- /dev/null +++ b/utils/loc_log.h @@ -0,0 +1,66 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +typedef struct +{ + char name[128]; + 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)) + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); +const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); +const char* loc_get_msg_q_status(int status); + +extern const char* log_succ_fail_string(int is_succ); + +extern char *loc_get_time(char *time_string, unsigned long buf_size); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_LOG_H */ diff --git a/utils/log_util.h b/utils/log_util.h new file mode 100755 index 00000000..15d0b892 --- /dev/null +++ b/utils/log_util.h @@ -0,0 +1,151 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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__ + +#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[]; +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +extern void loc_logger_init(unsigned long debug, unsigned long timestamp); +extern char* get_timestamp(char* str, unsigned long buf_size); + + +#include + +#ifndef DEBUG_DMN_LOC_API + +/* LOGGING MACROS */ +#define LOC_LOGE(...) ALOGE("E/"__VA_ARGS__) + +#define LOC_LOGW(...) \ +if (loc_logger.DEBUG_LEVEL >= 2) { ALOGE("W/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGW("W/"__VA_ARGS__); } + +#define LOC_LOGI(...) \ +if (loc_logger.DEBUG_LEVEL >= 3) { ALOGE("I/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("W/"__VA_ARGS__); } + +#define LOC_LOGD(...) \ +if (loc_logger.DEBUG_LEVEL >= 4) { ALOGE("D/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("W/"__VA_ARGS__); } + +#define LOC_LOGV(...) \ +if (loc_logger.DEBUG_LEVEL >= 5) { ALOGE("V/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__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 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 ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") +#define EXIT_LOG(SPEC, VAL) 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/utils/msg_q.c b/utils/msg_q.c new file mode 100755 index 00000000..252921ef --- /dev/null +++ b/utils/msg_q.c @@ -0,0 +1,322 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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_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_LOGD("%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_LOGD("%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_LOGD("%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_LOGD("%s: Received message %p 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/utils/msg_q.h b/utils/msg_q.h new file mode 100755 index 00000000..4171540a --- /dev/null +++ b/utils/msg_q.h @@ -0,0 +1,189 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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: State of message queue to be initialized. + +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_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__ */ From 3088fe911741c9bcdd50c02d299cb81a863e8a4c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 17 Jul 2012 16:41:00 -0700 Subject: [PATCH 035/945] gps: jb porting with qcom enhanced features based from AU_LINUX_ANDROID_ICS.04.00.04.00.205 Change-Id: I0af1da1438a136e98b59110641ce5c7714da220b --- loc_api/Android.mk | 19 +- loc_api/libloc_api-rpc-50001/Android.mk | 0 .../libloc_api-rpc-glue/Android.mk | 0 .../rpc_inc/LocApiRpcAdapter.h | 15 +- .../libloc_api-rpc-glue/rpc_inc/debug.h | 6 +- .../rpc_inc/loc_api_fixup.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_api_log.h | 0 .../rpc_inc/loc_api_rpc_glue.h | 0 .../rpc_inc/loc_api_sync_call.h | 0 .../rpc_inc/loc_apicb_appinit.h | 0 .../src/LocApiRpcAdapter.cpp | 120 +- .../libloc_api-rpc-glue/src/loc_api_fixup.c | 0 .../libloc_api-rpc-glue/src/loc_api_log.c | 0 .../src/loc_api_rpc_glue.c | 28 +- .../src/loc_api_sync_call.c | 22 +- .../src/loc_apicb_appinit.c | 0 .../libloc_api-rpc-stub/Android.mk | 0 .../inc/loc_api_rpcgen_cb_rpc.h | 0 .../inc/loc_api_rpcgen_common_rpc.h | 0 .../inc/loc_api_rpcgen_rpc.h | 0 .../inc/loc_apicb_appinit.h | 0 .../src/loc_api_rpcgen_cb_svc.c | 0 .../src/loc_api_rpcgen_cb_xdr.c | 0 .../src/loc_api_rpcgen_clnt.c | 0 .../src/loc_api_rpcgen_common_xdr.c | 0 .../src/loc_api_rpcgen_xdr.c | 0 .../src/loc_apicb_appinit.c | 0 .../libloc_api-rpc-stub/xdr/loc_api.xdr | 0 .../libloc_api-rpc-stub/xdr/loc_api_cb.xdr | 0 .../xdr/loc_api_common.xdr | 0 loc_api/libloc_api-rpc/Android.mk | 0 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 0 .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 0 .../gen-1240/loc_api_rpc_glue.c | 0 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 0 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 0 .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 0 .../gen-3200/loc_api_common.xdr | 0 .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 0 .../gen-3200/loc_api_rpc_glue.c | 0 .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 0 .../inc-1240/loc_apicb_appinit.h | 0 .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 0 .../inc-3200/loc_apicb_appinit.h | 0 loc_api/libloc_api-rpc/inc/debug.h | 0 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 0 .../libloc_api-rpc/src/loc_apicb_appinit.c | 0 loc_api/libloc_api/Android.mk | 0 loc_api/libloc_api/loc_eng.cpp | 0 loc_api/libloc_api/loc_eng.h | 0 loc_api/libloc_api/loc_eng_ioctl.cpp | 0 loc_api/libloc_api/loc_eng_ioctl.h | 0 loc_api/libloc_api/loc_eng_ni.cpp | 0 loc_api/libloc_api/loc_eng_ni.h | 0 loc_api/libloc_api/loc_eng_xtra.cpp | 0 loc_api/libloc_api/loc_eng_xtra.h | 0 loc_api/libloc_api_50001/Android.mk | 18 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 20 +- loc_api/libloc_api_50001/LocApiAdapter.h | 40 +- loc_api/libloc_api_50001/gps.c | 0 loc_api/libloc_api_50001/loc.cpp | 381 +- loc_api/libloc_api_50001/loc.h | 3 + loc_api/libloc_api_50001/loc_eng.cpp | 785 +-- loc_api/libloc_api_50001/loc_eng.h | 88 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 123 +- loc_api/libloc_api_50001/loc_eng_agps.h | 68 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 72 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 8 +- .../loc_eng_dmn_conn_glue_msg.c | 0 .../loc_eng_dmn_conn_glue_msg.h | 0 .../loc_eng_dmn_conn_glue_pipe.c | 0 .../loc_eng_dmn_conn_glue_pipe.h | 0 .../loc_eng_dmn_conn_handler.cpp | 148 +- .../loc_eng_dmn_conn_handler.h | 23 +- .../loc_eng_dmn_conn_thread_helper.c | 0 .../loc_eng_dmn_conn_thread_helper.h | 0 loc_api/libloc_api_50001/loc_eng_log.cpp | 36 +- loc_api/libloc_api_50001/loc_eng_log.h | 4 +- loc_api/libloc_api_50001/loc_eng_msg.cpp | 0 loc_api/libloc_api_50001/loc_eng_msg.h | 431 +- loc_api/libloc_api_50001/loc_eng_msg_id.h | 41 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 0 loc_api/libloc_api_50001/loc_eng_ni.h | 0 loc_api/libloc_api_50001/loc_eng_xtra.cpp | 0 loc_api/libloc_api_50001/loc_eng_xtra.h | 0 loc_api/loc_api_v02/Android.mk | 0 loc_api/loc_api_v02/LocApiV02Adapter.cpp | 362 +- loc_api/loc_api_v02/LocApiV02Adapter.h | 53 +- loc_api/loc_api_v02/loc_api_sync_req.c | 8 +- loc_api/loc_api_v02/loc_api_sync_req.h | 0 loc_api/loc_api_v02/loc_api_v02_client.c | 421 +- loc_api/loc_api_v02/loc_api_v02_client.h | 142 +- loc_api/loc_api_v02/loc_api_v02_log.c | 23 +- loc_api/loc_api_v02/loc_api_v02_log.h | 0 loc_api/loc_api_v02/loc_util_log.h | 40 +- loc_api/loc_api_v02/location_service_v02.c | 1017 +++- loc_api/loc_api_v02/location_service_v02.h | 4251 ++++++++++++----- loc_api/ulp/inc/ulp.h | 25 +- utils/Android.mk | 2 + utils/linked_list.c | 0 utils/linked_list.h | 0 utils/loc_cfg.cpp | 230 +- utils/loc_cfg.h | 42 +- utils/loc_log.cpp | 0 utils/loc_log.h | 0 utils/log_util.h | 0 utils/msg_q.c | 2 +- utils/msg_q.h | 0 108 files changed, 6524 insertions(+), 2593 deletions(-) mode change 100755 => 100644 loc_api/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc/debug.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h mode change 100755 => 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api/Android.mk mode change 100755 => 100644 loc_api/libloc_api/loc_eng.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ioctl.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ioctl.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ni.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ni.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_xtra.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_xtra.h mode change 100755 => 100644 loc_api/libloc_api_50001/Android.mk mode change 100755 => 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/LocApiAdapter.h mode change 100755 => 100644 loc_api/libloc_api_50001/gps.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_agps.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_agps.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_log.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_log.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg_id.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_ni.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_ni.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_xtra.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_xtra.h mode change 100755 => 100644 loc_api/loc_api_v02/Android.mk mode change 100755 => 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp mode change 100755 => 100644 loc_api/loc_api_v02/LocApiV02Adapter.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_sync_req.c mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_sync_req.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_client.c mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_client.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_log.c mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_log.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_util_log.h mode change 100755 => 100644 loc_api/loc_api_v02/location_service_v02.c mode change 100755 => 100644 loc_api/loc_api_v02/location_service_v02.h mode change 100755 => 100644 loc_api/ulp/inc/ulp.h mode change 100755 => 100644 utils/Android.mk mode change 100755 => 100644 utils/linked_list.c mode change 100755 => 100644 utils/linked_list.h mode change 100755 => 100644 utils/loc_cfg.cpp mode change 100755 => 100644 utils/loc_cfg.h mode change 100755 => 100644 utils/loc_log.cpp mode change 100755 => 100644 utils/loc_log.h mode change 100755 => 100644 utils/log_util.h mode change 100755 => 100644 utils/msg_q.c mode change 100755 => 100644 utils/msg_q.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk old mode 100755 new mode 100644 index 7e09d5f9..7e1e35f8 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,11 +1,3 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) @@ -19,12 +11,15 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ -else - -GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ - endif #TARGET_NO_RPC +#add QMI libraries for QMI targets +QMI_BOARD_PLATFORM_LIST := msm8960 + +ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) +GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ +endif #is-board-platform-in-list + GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ #call the subfolders diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h old mode 100755 new mode 100644 index 7b1f59ba..4898d7d9 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -38,6 +38,8 @@ class LocApiRpcAdapter : public LocApiAdapter { // RPC communication establishment rpc_loc_client_handle_type client_handle; rpc_loc_event_mask_type eMask; + int dataEnableLastSet; + char apnLastSet[MAX_APN_LEN]; static const rpc_loc_event_mask_type locBits[]; static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); @@ -71,10 +73,11 @@ public: virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + 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); + 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 @@ -83,8 +86,10 @@ public: 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); + 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 @@ -97,6 +102,8 @@ public: atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + + virtual void setInSession(bool inSession); }; #endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h old mode 100755 new mode 100644 index 8b20a3f5..3f00b654 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -37,7 +37,7 @@ #define PRINT(x...) do { \ fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stdout, ##x); \ - LOGD(x); \ + ALOGD(x); \ } while(0) #ifdef DEBUG @@ -55,14 +55,14 @@ #define E(x...) do { \ fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stderr, ##x); \ - LOGE(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); \ - LOGE(##msg); \ + ALOGE(##msg); \ } \ } while(0) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp old mode 100755 new mode 100644 index 48b3a0fe..843a8ae9 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -119,8 +119,10 @@ const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : LocApiAdapter(locEng), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - eMask(convertMask(locEng.eventMask)) + eMask(convertMask(locEng.eventMask)), + dataEnableLastSet(-1) { + memset(apnLastSet, 0, sizeof(apnLastSet)); loc_api_glue_init(); } @@ -298,9 +300,7 @@ LocApiRpcAdapter::stopFix() { } enum loc_api_adapter_err -LocApiRpcAdapter::setPositionMode(LocPositionMode mode, - GpsPositionRecurrence recurrence, uint32_t min_interval, - uint32_t preferred_accuracy, uint32_t preferred_time) +LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_fix_criteria_s_type *fix_criteria_ptr; @@ -308,10 +308,13 @@ LocApiRpcAdapter::setPositionMode(LocPositionMode mode, rpc_loc_operation_mode_e_type op_mode; int ret_val; - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) client_handle, min_interval, mode); + if (NULL != posMode) + fixCriteria = *posMode; - switch (mode) + 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; @@ -339,29 +342,22 @@ LocApiRpcAdapter::setPositionMode(LocPositionMode mode, fix_criteria_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; 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 = min_interval; + fix_criteria_ptr->min_interval = fixCriteria.min_interval; fix_criteria_ptr->preferred_operation_mode = op_mode; - if (min_interval > 0) { - fix_criteria_ptr->min_interval = min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - }else if(min_interval == 0) - { - /*If the framework passes in 0 transalate it into the maximum frequency we can report positions - which is 1 Hz or once very second */ - fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - } - if (preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + 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 (preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = preferred_time; + 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 (recurrence) { + switch (fixCriteria.recurrence) { case GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; @@ -484,20 +480,42 @@ LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, } enum loc_api_adapter_err - LocApiRpcAdapter::setAPN(char* apn, int len) +LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) { - 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, len+1); + 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); - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); + if (false == navigating) { + 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 LocApiRpcAdapter::setInSession(bool inSession) +{ + LocApiAdapter::setInSession(inSession); + if (false == navigating) { + enableData(dataEnableLastSet, true); + setAPN(apnLastSet, sizeof(apnLastSet)-1, true); + } } enum loc_api_adapter_err @@ -567,18 +585,26 @@ LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) } enum loc_api_adapter_err -LocApiRpcAdapter::enableData(int enable) +LocApiRpcAdapter::enableData(int enable, boolean force) { - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_SET_DATA_ENABLE, {0}}; + enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; + if (force || dataEnableLastSet != enable) { + dataEnableLastSet = enable; - ioctl_data.rpc_loc_ioctl_data_u_type_u.data_enable = enable; - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_DATA_ENABLE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); + if (false == navigating) { + 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 @@ -652,7 +678,9 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca location.flags |= GPS_LOCATION_HAS_ACCURACY; location.accuracy = location_report_ptr->hor_unc_circular; } - + //Mark the location source as from GNSS + location.flags |= LOCATION_HAS_SOURCE_INFO; + location.position_source = ULP_LOCATION_IS_FROM_GNSS; LOC_LOGV("reportPosition: fire callback\n"); LocApiAdapter::reportPosition(location, locEngHandle.extPosInfo((void*)location_report_ptr), diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c old mode 100755 new mode 100644 index 10b2d221..02eadf7f --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -62,8 +62,8 @@ /* Logging Improvement */ #include "log_util.h" -/* Uncomment to force LOGD messages */ -// #define LOGD LOGI +/* Uncomment to force ALOGD messages */ +// #define ALOGD ALOGI /*===================================================================== External declarations @@ -316,30 +316,23 @@ rpc_loc_client_handle_type loc_open ( rpc_loc_open_args args; args.event_reg_mask = event_reg_mask; - int i; + int i, j = LOC_API_CB_MAX_CLIENTS; for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) { - if (loc_glue_callback_table[i].cb_func == event_callback || - loc_glue_callback_table[i].user == userData) + 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) { - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].cb_func == NULL) - { - 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; - break; - } - } + i = j; } if (i == LOC_API_CB_MAX_CLIENTS) @@ -348,6 +341,10 @@ rpc_loc_client_handle_type loc_open ( 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); @@ -405,6 +402,7 @@ void loc_clear(rpc_loc_client_handle_type handle) { 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; } } diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c old mode 100755 new mode 100644 index e2a5786f..c488ff5d --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -195,7 +195,7 @@ void loc_api_callback_process_sync_call( { int i; - LOGV("loc_handle = 0x%lx, loc_event = 0x%lx", loc_handle, loc_event); + 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]; @@ -211,7 +211,7 @@ void loc_api_callback_process_sync_call( slot->loc_cb_received_event_mask = loc_event; - LOGV("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); + 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; @@ -252,7 +252,7 @@ static int loc_lock_a_slot() loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; if (pthread_mutex_trylock(&slot->lock) == EBUSY) { - LOGV("trylock EBUSY : %d", i); + ALOGV("trylock EBUSY : %d", i); continue; } @@ -266,7 +266,7 @@ static int loc_lock_a_slot() */ break; } - /* LOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */ + /* ALOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */ pthread_mutex_unlock(&slot->lock); } @@ -417,7 +417,7 @@ static int loc_api_wait_callback( if (rc == ETIMEDOUT) { ret_val = RPC_LOC_API_TIMEOUT; /* Timed out */ - LOGE("TIMEOUT: %d", select_id); + ALOGE("TIMEOUT: %d", select_id); } else { /* Obtained the first awaited callback */ @@ -462,7 +462,7 @@ int loc_api_sync_ioctl if (select_id < 0 || select_id >= loc_sync_data.num_of_slots) { - LOGE("slot not available ioctl_type = %s", + ALOGE("slot not available ioctl_type = %s", loc_get_ioctl_type_name(ioctl_type)); return rc; } @@ -474,17 +474,17 @@ int loc_api_sync_ioctl if (rc != RPC_LOC_API_SUCCESS) { - LOGE("loc_ioctl failed select_id = %d, ioctl_type %s, returned %s", + 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 { - LOGV("select_id = %d, ioctl_type %d, returned RPC_LOC_API_SUCCESS", + 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 - LOGE("callback wait failed select_id = %d, ioctl_type %s, returned %s", + 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 @@ -493,10 +493,10 @@ int loc_api_sync_ioctl if (callback_data.status != RPC_LOC_API_SUCCESS) { rc = callback_data.status; - LOGE("callback status failed select_id = %d, ioctl_type %s, returned %s", + 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 { - LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", + ALOGV("callback status success select_id = %d, ioctl_type %d, returned %d", select_id, ioctl_type, rc); } } /* wait callback */ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk old mode 100755 new mode 100644 index 0a5a0a10..4e5973d6 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -3,6 +3,7 @@ ifneq ($(BUILD_TINY_ANDROID),true) BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 +BIT_ENABLED_BOARD_PLATFORM_LIST += msm8960 ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) FEATURE_GNSS_BIT_API := true endif # is-board-platform-in-list @@ -57,8 +58,7 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ libloc_adapter \ - libgps.utils \ - libdl + libgps.utils LOCAL_SRC_FILES += \ loc_eng.cpp \ @@ -78,13 +78,17 @@ LOCAL_SRC_FILES += \ loc_eng_dmn_conn_glue_msg.c \ loc_eng_dmn_conn_glue_pipe.c +# if QMI is supported then link to loc_api_v02 +ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) +LOCAL_SHARED_LIBRARIES += libloc_api_v02 +else ## Check if RPC is not unsupported ifneq ($(TARGET_NO_RPC),true) LOCAL_SHARED_LIBRARIES += libloc_api-rpc-qc -else -LOCAL_SHARED_LIBRARIES += libloc_api_v02 endif #TARGET_NO_RPC +endif #is-board-platform-in-list + LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ @@ -109,7 +113,8 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ libloc_eng \ - libgps.utils + libgps.utils \ + libdl LOCAL_SRC_FILES += \ loc.cpp \ @@ -121,7 +126,8 @@ LOCAL_CFLAGS += \ ## Includes LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/ulp/inc LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp old mode 100755 new mode 100644 index e631642d..b7ebc6f5 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -44,11 +44,12 @@ LocEng::LocEng(void* caller, gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, + loc_msg_sender msgUlpSender, loc_ext_parser posParser, loc_ext_parser svParser) : owner(caller), eventMask(emask), acquireWakelock(acqwl), - releaseWakeLock(relwl), sendMsge(msgSender), + releaseWakeLock(relwl), sendMsge(msgSender), sendUlpMsg(msgUlpSender), extPosInfo(NULL == posParser ? noProc : posParser), extSvInfo(NULL == svParser ? noProc : svParser) { @@ -56,7 +57,7 @@ LocEng::LocEng(void* caller, } LocApiAdapter::LocApiAdapter(LocEng &locEng) : - locEngHandle(locEng) + locEngHandle(locEng), fixCriteria(), navigating(false) { LOC_LOGD("LocApiAdapter created"); } @@ -119,13 +120,24 @@ void LocApiAdapter::reportPosition(GpsLocation &location, location, locationExt, status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); + if (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } } void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) { loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); - locEngHandle.sendMsge(locEngHandle.owner, msg); + + //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 (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } } void LocApiAdapter::reportStatus(GpsStatusValue status) diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h old mode 100755 new mode 100644 index 033a034c..1c5e02b2 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -32,9 +32,13 @@ #include #include #include +#include #include +#include -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ +#define MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) enum loc_api_adapter_err { LOC_API_ADAPTER_ERR_SUCCESS = 0, @@ -85,6 +89,7 @@ struct LocEng { const gps_acquire_wakelock acquireWakelock; const gps_release_wakelock releaseWakeLock; const loc_msg_sender sendMsge; + const loc_msg_sender sendUlpMsg; const loc_ext_parser extPosInfo; const loc_ext_parser extSvInfo; @@ -93,6 +98,7 @@ struct LocEng { gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, + loc_msg_sender msgUlpSender, loc_ext_parser posParser, loc_ext_parser svParser); }; @@ -100,6 +106,8 @@ struct LocEng { class LocApiAdapter { protected: const LocEng locEngHandle; + LocPosMode fixCriteria; + bool navigating; LocApiAdapter(LocEng &locEng); @@ -157,22 +165,14 @@ public: inline virtual enum loc_api_adapter_err setXtraData(char* data, int length) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#ifdef QCOM_FEATURE_IPV6 inline virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#else - inline virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType) - {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#endif inline virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) + setPositionMode(const LocPosMode *posMode) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setServer(const char* url, int len) @@ -187,16 +187,32 @@ public: inline virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setLPPConfig(uint32_t profile) + {LOC_LOGW("%s: default implementation invoked", __func__); + return LOC_API_ADAPTER_ERR_SUCCESS; } inline virtual enum loc_api_adapter_err setSensorControlConfig(int sensorUsage) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err - setSensorProperties(float gyroBiasVarianceRandomWalk) + 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) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) + int gyroSamplesPerBatch, int gyroBatchesPerSec, int algorithmConfig) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setExtPowerConfig(int isBatteryCharging) + {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + + inline const LocPosMode& getPositionMode() const {return fixCriteria;} + + inline bool isInSession() { return navigating; } + inline virtual void setInSession(bool inSession) { navigating = inSession; } }; LocApiAdapter* getLocApiAdapter(LocEng &locEng); diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp old mode 100755 new mode 100644 index 16bed3b1..c0378fdf --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011 - 2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,7 +33,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +//Globals defns +static const ulpInterface * loc_eng_ulp_inf = NULL; +static const ulpInterface * loc_eng_get_ulp_inf(void); static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; @@ -52,9 +62,12 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static const void* loc_get_extension(const char* name); -#ifdef QCOM_FEATURE_ULP -static int loc_update_criteria(UlpLocationCriteria criteria); -#endif +//ULP/Hybrid provider Function definitions +static int loc_update_criteria(UlpLocationCriteria criteria); +static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks); +static int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report); +static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callback); +static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = @@ -68,24 +81,16 @@ static const GpsInterface sLocEngInterface = loc_inject_location, loc_delete_aiding_data, loc_set_position_mode, - loc_get_extension -#ifdef QCOM_FEATURE_ULP - ,loc_update_criteria -#endif + loc_get_extension, + loc_update_criteria }; // Function declarations for sLocEngAGpsInterface static void loc_agps_init(AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 static int loc_agps_open(AGpsType agpsType, const char* apn, AGpsBearerType bearerType); static int loc_agps_closed(AGpsType agpsType); static int loc_agps_open_failed(AGpsType agpsType); -#else -static int loc_agps_open(const char* apn); -static int loc_agps_closed(); -static int loc_agps_open_failed(); -#endif static int loc_agps_set_server(AGpsType type, const char *hostname, int port); static const AGpsInterface sLocEngAGpsInterface = @@ -136,7 +141,6 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = loc_agps_ril_update_network_availability }; -#ifdef QCOM_FEATURE_ULP static bool loc_inject_raw_command(char* command, int length); static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = @@ -144,9 +148,81 @@ static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = sizeof(InjectRawCmdInterface), loc_inject_raw_command }; -#endif +//ULP/Hybrid provider interfaces +static const UlpNetworkInterface sUlpNetworkInterface = +{ + sizeof(UlpNetworkInterface), + loc_ulp_network_init, + loc_ulp_send_network_position +}; +static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = +{ + sizeof(UlpPhoneContextInterface), + loc_ulp_phone_context_init, + loc_ulp_phone_context_settings_update +}; static loc_eng_data_s_type loc_afw_data; +static int gss_fd = 0; + +#define TARGET_NAME_OTHER 0 +#define TARGET_NAME_APQ8064_STANDALONE 1 +#define TARGET_NAME_APQ8064_FUSION3 2 + +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; +} + +#define LINE_LEN 100 +#define STR_LIQUID "Liquid" +#define STR_SURF "Surf" +#define STRLEN_LIQUID (sizeof(STR_LIQUID) - 1) +#define STRLEN_SURF (sizeof(STR_SURF) - 1) +#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') + +static int get_target_name(void) +{ + int target_name = TARGET_NAME_OTHER; + + char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; // "Liquid" or "Surf" + char id[] = "/sys/devices/system/soc/soc0/id"; //109 + char mdm[] = "/dev/mdm"; // No such file or directory + + char line[LINE_LEN]; + + read_a_line( hw_platform, line, LINE_LEN); + if(( !memcmp(line, STR_LIQUID, STRLEN_LIQUID) && IS_STR_END(line[STRLEN_LIQUID]) ) || + ( !memcmp(line, STR_SURF, STRLEN_SURF) && IS_STR_END(line[STRLEN_SURF]) ) + ) { + if (!read_a_line( mdm, line, LINE_LEN)) { + target_name = TARGET_NAME_APQ8064_FUSION3; + } else { + read_a_line( id, line, LINE_LEN); + if(!strncmp(line, "109", strlen("109"))) { + target_name = TARGET_NAME_APQ8064_STANDALONE; + } + } + } + return target_name; +} /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -189,8 +265,26 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { + loc_eng_read_config(); + //We load up libulp module at this point itself if ULP configured to be On + if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + } return &sLocEngInterface; } + +static void loc_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + + +void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); +} + /*=========================================================================== FUNCTION loc_init @@ -233,10 +327,28 @@ static int loc_init(GpsCallbacks* callbacks) gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; - int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); + if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) + { + 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)); + return NULL; + } + LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); + } - EXIT_LOG(%d, ret_val); - return ret_val; + int retVal = -1; + if (loc_eng_ulp_inf == NULL) + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, + NULL); + else + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, + loc_ulp_msg_sender); + int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); + LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1); + EXIT_LOG(%d, retVal); + return retVal; } /*=========================================================================== @@ -261,6 +373,15 @@ static void loc_cleanup() loc_eng_cleanup(loc_afw_data); gps_loc_cb = NULL; gps_sv_cb = NULL; + + /* + * if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) + * { + * close(gss_fd); + * LOC_LOGD("GSS shutdown.\n"); + * } + */ + EXIT_LOG(%s, VOID_RET); } @@ -349,9 +470,10 @@ static int loc_set_position_mode(GpsPositionMode mode, locMode = LOC_POSITION_MODE_STANDALONE; break; } - int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, - recurrence, min_interval, - preferred_accuracy, preferred_time); + + LocPosMode params(locMode, recurrence, min_interval, + preferred_accuracy, preferred_time, NULL, NULL); + int ret_val = loc_eng_set_position_mode(loc_afw_data, params); EXIT_LOG(%d, ret_val); return ret_val; @@ -437,7 +559,6 @@ static void loc_delete_aiding_data(GpsAidingData f) EXIT_LOG(%s, VOID_RET); } -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_update_criteria @@ -462,7 +583,6 @@ static int loc_update_criteria(UlpLocationCriteria criteria) EXIT_LOG(%d, ret_val); return ret_val; } -#endif /*=========================================================================== FUNCTION loc_get_extension @@ -502,19 +622,32 @@ static const void* loc_get_extension(const char* name) else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { - ret_val = &sLocEngAGpsRilInterface; + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if (strcmp(baseband, "csfb") == 0) + { + ret_val = &sLocEngAGpsRilInterface; + } } -#ifdef QCOM_FEATURE_ULP else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) { ret_val = &sLocEngInjectRawCmdInterface; } -#endif + else if(strcmp(name, ULP_PHONE_CONTEXT_INTERFACE) == 0) + { + ret_val = &sLocEngUlpPhoneContextInterface; + } + else if(strcmp(name, ULP_NETWORK_INTERFACE) == 0) + { + //Return a valid value for ULP Network Interface only if ULP + //turned on in gps.conf + if(gps_conf.CAPABILITIES & ULP_CAPABILITY) + ret_val = &sUlpNetworkInterface; + } else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); } - EXIT_LOG(%p, ret_val); return ret_val; } @@ -559,7 +692,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 static int loc_agps_open(AGpsType agpsType, const char* apn, AGpsBearerType bearerType) { @@ -569,16 +701,6 @@ static int loc_agps_open(AGpsType agpsType, EXIT_LOG(%d, ret_val); return ret_val; } -#else -static int loc_agps_open(const char* apn) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open(loc_afw_data, apn); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif /*=========================================================================== FUNCTION loc_agps_closed @@ -597,7 +719,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 static int loc_agps_closed(AGpsType agpsType) { ENTRY_LOG(); @@ -606,16 +727,6 @@ static int loc_agps_closed(AGpsType agpsType) EXIT_LOG(%d, ret_val); return ret_val; } -#else -static int loc_agps_closed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_closed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif /*=========================================================================== FUNCTION loc_agps_open_failed @@ -634,7 +745,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 int loc_agps_open_failed(AGpsType agpsType) { ENTRY_LOG(); @@ -643,16 +753,6 @@ int loc_agps_open_failed(AGpsType agpsType) EXIT_LOG(%d, ret_val); return ret_val; } -#else -int loc_agps_open_failed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open_failed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif /*=========================================================================== FUNCTION loc_agps_set_server @@ -818,7 +918,6 @@ static void loc_agps_ril_update_network_availability(int available, const char* EXIT_LOG(%s, VOID_RET); } -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_inject_raw_command @@ -842,18 +941,13 @@ static bool loc_inject_raw_command(char* command, int length) EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); return ret_val; } -#endif static void loc_cb(GpsLocation* location, void* locExt) { ENTRY_LOG(); if (NULL != gps_loc_cb && NULL != location) { -#ifdef QCOM_FEATURE_ULP CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); -#else - CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); -#endif gps_loc_cb(location); } EXIT_LOG(%s, VOID_RET); @@ -868,3 +962,156 @@ static void sv_cb(GpsSvStatus* sv_status, void* svExt) } EXIT_LOG(%s, VOID_RET); } +/*=========================================================================== +FUNCTION loc_eng_get_ulp_inf + +DESCRIPTION + This function checks if ULP is enabled, and loads the libulp2.so and + returns its interface + +DEPENDENCIES + None + +RETURN VALUE + interface pointer to libulp: no error + NULL: errors + +SIDE EFFECTS + N/A + +===========================================================================*/ +const ulpInterface * loc_eng_get_ulp_inf(void) +{ + ENTRY_LOG(); + void *handle; + const char *error; + get_ulp_interface* get_ulp_inf; + const ulpInterface* loc_eng_ulpInf = NULL; + + if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { + LOC_LOGD ("%s, ULP is not configured to be On in gps.conf\n", __func__); + goto exit; + } + dlerror(); /* Clear any existing error */ + + handle = dlopen ("libulp2.so", RTLD_NOW); + + if (!handle) + { + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlopen for libulp.so failed, error = %s\n", __func__, error); + } + goto exit; + } + dlerror(); /* Clear any existing error */ + get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); + goto exit; + } + + // Initialize the ULP interface + loc_eng_ulpInf = get_ulp_inf(); + +exit: + EXIT_LOG(%d, loc_eng_ulpInf == NULL); + return loc_eng_ulpInf; +} + +/*=========================================================================== +FUNCTION loc_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) +{ + ENTRY_LOG(); + int ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); + EXIT_LOG(%d, ret_val); + return ret_val; +} +/*=========================================================================== +FUNCTION loc_ulp_phone_context_settings_update + +DESCRIPTION + This is used to inform the ULP module of phone settings changes carried out + by the users +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ + +static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings) +{ + ENTRY_LOG(); + int ret_val = -1; + ret_val = loc_eng_ulp_phone_context_settings_update(loc_afw_data, settings); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) +{ + ENTRY_LOG(); + int ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_send_network_position + +DESCRIPTION + Ulp send data + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report) +{ + ENTRY_LOG(); + int ret_val = -1; + ret_val = loc_eng_ulp_send_network_position(loc_afw_data, position_report); + EXIT_LOG(%d, ret_val); + return ret_val; +} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h old mode 100755 new mode 100644 index bf942373..233b34c3 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -38,6 +38,8 @@ extern "C" { #include #include +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + typedef enum loc_server_type { LOC_AGPS_CDMA_PDE_SERVER, LOC_AGPS_CUSTOM_PDE_SERVER, @@ -78,6 +80,7 @@ enum loc_sess_status { LOC_SESS_FAILURE }; +void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp old mode 100755 new mode 100644 index 4d032dce..9958ca56 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-2012 Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -43,7 +43,6 @@ #include #include #include -#include #include "LocApiAdapter.h" @@ -59,8 +58,7 @@ #include #include #include - -#include "ulp.h" +#include #include "log_util.h" #include "loc_eng_log.h" @@ -68,31 +66,79 @@ #define SUCCESS TRUE #define FAILURE FALSE - static void loc_eng_deferred_action_thread(void* context); static void* loc_eng_create_msg_q(); static void loc_eng_free_msg(void* msg); -struct LocEngContext { - // Data variables used by deferred action thread - const void* deferred_q; - const pthread_t deferred_action_thread; - static LocEngContext* get(gps_create_thread threadCreator); - void drop(); - static pthread_mutex_t lock; - static pthread_cond_t cond; -private: - int counter; - static LocEngContext *me; - LocEngContext(gps_create_thread threadCreator); -}; - pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; LocEngContext* LocEngContext::me = NULL; +boolean gpsConfigAlreadyRead = false; + +loc_gps_cfg_s_type gps_conf; + +/* Parameter spec table */ +static loc_param_s_type loc_parameter_table[] = +{ + {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, + {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, + {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, NULL, 'n'}, + {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, + {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, + {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, &gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, + {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, + {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, NULL, 'n'}, + {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, + {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, +}; + +static void loc_default_parameters(void) +{ + /* defaults */ + gps_conf.INTERMEDIATE_POS = 0; + gps_conf.ACCURACY_THRES = 0; + gps_conf.ENABLE_WIPER = 0; + gps_conf.SUPL_VER = 0x10000; + gps_conf.CAPABILITIES = 0x7; + + gps_conf.GYRO_BIAS_RANDOM_WALK = 0; + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + gps_conf.SENSOR_USAGE = 0; /* Enabled */ + gps_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 */ + gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; + gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + + /* LTE Positioning Profile configuration is disable by default*/ + gps_conf.LPP_PROFILE = 0; +} LocEngContext::LocEngContext(gps_create_thread threadCreator) : deferred_q((const void*)loc_eng_create_msg_q()), + //TODO: should we conditionally create ulp msg q? + ulp_q((const void*)loc_eng_create_msg_q()), deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), counter(0) { @@ -106,11 +152,6 @@ LocEngContext* LocEngContext::get(gps_create_thread threadCreator) pthread_mutex_lock(&lock); // gonna need mutex protection here... if (NULL == me) { - // gps.conf is not part of the context class. But we only want to parse the conf - // file once. This is the only good place to ensure that. - // In fact one day the conf file should go into context as well. - loc_read_gps_conf(); - me = new LocEngContext(threadCreator); } me->counter++; @@ -134,6 +175,7 @@ void LocEngContext::drop() pthread_cond_wait(&cond, &lock); msg_q_destroy((void**)&deferred_q); + msg_q_destroy((void**)&ulp_q); delete me; me = NULL; } @@ -162,13 +204,6 @@ 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 char extra_data[100]; - -#ifdef QCOM_FEATURE_ULP -// ULP integration -static const ulpInterface* locEngUlpInf = NULL; -static int loc_eng_ulp_init(void* handle) ; -#endif - /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -221,14 +256,15 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event) + LOC_API_ADAPTER_EVENT_MASK_T event, + void (*loc_external_msg_sender) (void*, void*)) + { ENTRY_LOG_CALLFLOW(); - if (NULL == callbacks || 0 == event) { LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); EXIT_LOG(%d, 0); - return 0; + return NULL; } STATE_CHECK((NULL == loc_eng_data.context), @@ -258,12 +294,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, // loc_eng_data.fix_session_status -- GPS_STATUS_NONE; // loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE; -#ifdef QCOM_FEATURE_ULP - loc_eng_ulp_init(&loc_eng_data); -#endif - LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); loc_eng_data.client_handle = getLocApiAdapter(locEngHandle); @@ -302,16 +334,35 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, supl_msg, loc_eng_free_msg); + loc_eng_msg_lpp_config *lpp_msg(new loc_eng_msg_lpp_config(&loc_eng_data, + gps_conf.LPP_PROFILE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + lpp_msg, loc_eng_free_msg); + loc_eng_msg_sensor_control_config *sensor_control_config_msg( new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_control_config_msg, loc_eng_free_msg); - /* Make sure this is specified by the user in the gps.conf file */ - if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) + /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ + if( gps_conf.GYRO_BIAS_RANDOM_WALK_VALID || + gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { loc_eng_msg_sensor_properties *sensor_properties_msg( - new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); + new loc_eng_msg_sensor_properties(&loc_eng_data, + gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, + gps_conf.GYRO_BIAS_RANDOM_WALK, + gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_properties_msg, loc_eng_free_msg); } @@ -322,7 +373,8 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, + gps_conf.SENSOR_ALGORITHM_CONFIG_MASK)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_perf_control_conf_msg, loc_eng_free_msg); } @@ -355,7 +407,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) // 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; @@ -365,8 +417,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) delete loc_eng_data.internet_nif; loc_eng_data.internet_nif = NULL; } - - if (loc_eng_data.navigating) +#endif + if (loc_eng_data.client_handle->isInSession()) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); loc_eng_stop(loc_eng_data); @@ -380,8 +432,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) // De-initialize ulp if (locEngUlpInf != NULL) { - locEngUlpInf->destroy (); locEngUlpInf = NULL; + msg_q_destroy( &loc_eng_data.ulp_q); } if (loc_eng_data.client_handle != NULL) @@ -430,10 +482,18 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_START_FIX)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, + msg, loc_eng_free_msg); + }else + { + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } EXIT_LOG(%d, 0); return 0; } @@ -443,20 +503,13 @@ 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.navigating) { -#ifdef QCOM_FEATURE_ULP - if (NULL == locEngUlpInf || - locEngUlpInf->start_fix () == 1) { - ret_val = loc_eng_data.client_handle->startFix(); - } -#else + if (!loc_eng_data.client_handle->isInSession()) { ret_val = loc_eng_data.client_handle->startFix(); -#endif if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { - loc_eng_data.navigating = TRUE; + loc_eng_data.client_handle->setInSession(TRUE); } } @@ -465,7 +518,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) } /*=========================================================================== -FUNCTION loc_eng_stop +FUNCTION loc_eng_stop_wrapper DESCRIPTION Stops the tracking session @@ -485,9 +538,18 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_STOP_FIX)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, + msg, loc_eng_free_msg); + }else + { + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } EXIT_LOG(%d, 0); return 0; @@ -498,14 +560,7 @@ 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.navigating) { -#ifdef QCOM_FEATURE_ULP - // Stops the ULP - if (locEngUlpInf != NULL) - { - locEngUlpInf->stop_fix (); - } -#endif + if (loc_eng_data.client_handle->isInSession()) { ret_val = loc_eng_data.client_handle->stopFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS && @@ -514,7 +569,7 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } - loc_eng_data.navigating = FALSE; + loc_eng_data.client_handle->setInSession(FALSE); } EXIT_LOG(%d, ret_val); @@ -561,18 +616,12 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) + LocPosMode ¶ms) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, mode, - recurrence, min_interval, - preferred_accuracy, preferred_time)); + new loc_eng_msg_position_mode(&loc_eng_data, params)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); @@ -683,6 +732,7 @@ void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData } /*=========================================================================== + FUNCTION loc_inform_gps_state DESCRIPTION @@ -760,7 +810,7 @@ static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data) loc_eng_data.c2k_host_buf, loc_eng_data.c2k_port_buf); } - EXIT_LOG(%p, VOID_RET); + EXIT_LOG(%s, VOID_RET); } /*=========================================================================== FUNCTION loc_eng_agps_init @@ -788,20 +838,21 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac loc_eng_data.agps_status_cb = callbacks->status_cb; loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); -#ifdef QCOM_FEATURE_IPV6 + AGPS_TYPE_SUPL, + false); loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_WWAN_ANY); -#else - loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); -#endif + AGPS_TYPE_WWAN_ANY, + false); + loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_WIFI, + true); #ifdef FEATURE_GNSS_BIT_API { char baseband[PROPERTY_VALUE_MAX]; property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) + if ((strcmp(baseband,"svlte2a") == 0) || + (strcmp(baseband,"msm") == 0)) { loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); @@ -810,7 +861,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac #endif /* FEATURE_GNSS_BIT_API */ loc_eng_agps_reinit(loc_eng_data); - EXIT_LOG(%p, VOID_RET); + EXIT_LOG(%s, VOID_RET); } /*=========================================================================== @@ -830,7 +881,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, const char* apn, AGpsBearerType bearerType) { @@ -856,33 +906,6 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, - const char* apn) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, apn, - apn_len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== FUNCTION loc_eng_agps_closed @@ -901,7 +924,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) { ENTRY_LOG_CALLFLOW(); @@ -915,21 +937,6 @@ int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== FUNCTION loc_eng_agps_open_failed @@ -948,7 +955,6 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) { ENTRY_LOG_CALLFLOW(); @@ -962,21 +968,6 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsTyp EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== @@ -1205,9 +1196,10 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Session End is not reported during Android navigating state + boolean navigating = loc_eng_data.client_handle->isInSession(); if (status != GPS_STATUS_NONE && - !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && - !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.navigating)) + !(status == GPS_STATUS_SESSION_END && navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) { if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION) { @@ -1275,15 +1267,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.navigating) { - loc_eng_data.client_handle->setPositionMode( - loc_eng_data.position_mode.pMode, - loc_eng_data.position_mode.pRecurrence, - loc_eng_data.position_mode.minInterval, - loc_eng_data.position_mode.preferredAccuracy, - loc_eng_data.position_mode.preferredTime); - // not mutex protected, assuming fw won't call start twice without a - // stop call in between. + if (loc_eng_data.client_handle->isInSession()) { + // This sets the copy in adapter to modem + loc_eng_data.client_handle->setPositionMode(NULL); + loc_eng_data.client_handle->setInSession(false); loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); @@ -1380,10 +1367,7 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_SET_POSITION_MODE: { loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; - loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, - pmMsg->minInterval,pmMsg->preferredAccuracy, - pmMsg->preferredTime); - memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); + loc_eng_data_p->client_handle->setPositionMode(&(pmMsg->pMode)); } break; @@ -1426,6 +1410,13 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_LPP_CONFIG: + { + loc_eng_msg_lpp_config *svMsg = (loc_eng_msg_lpp_config*)msg; + loc_eng_data_p->client_handle->setLPPConfig(svMsg->lpp_config); + } + break; + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: { loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; @@ -1436,7 +1427,16 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: { loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; - loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk_valid, + spMsg->gyroBiasVarianceRandomWalk, + spMsg->accelRandomWalk_valid, + spMsg->accelRandomWalk, + spMsg->angleRandomWalk_valid, + spMsg->angleRandomWalk, + spMsg->rateRandomWalk_valid, + spMsg->rateRandomWalk, + spMsg->velocityRandomWalk_valid, + spMsg->velocityRandomWalk); } break; @@ -1444,18 +1444,27 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, spccMsg->algorithmConfig); + } + break; + + case LOC_ENG_MSG_EXT_POWER_CONFIG: + { + loc_eng_msg_ext_power_config *pwrMsg = (loc_eng_msg_ext_power_config*)msg; + loc_eng_data_p->client_handle->setExtPowerConfig(pwrMsg->isBatteryCharging); } break; case LOC_ENG_MSG_REPORT_POSITION: if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { + bool reported = false; loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; if (loc_eng_data_p->location_cb != NULL) { if (LOC_SESS_FAILURE == rpMsg->status) { // in case we want to handle the failure case loc_eng_data_p->location_cb(NULL, NULL); + reported = true; } // what's in the else if is... (line by line) // 1. this is a good fix; or @@ -1472,8 +1481,23 @@ static void loc_eng_deferred_action_thread(void* arg) (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), (void*)rpMsg->locationExt); + reported = true; } } + + // if we have reported this fix + if (reported && + // and if this is a singleshot + GPS_POSITION_RECURRENCE_SINGLE == + loc_eng_data_p->client_handle->getPositionMode().recurrence) { + if (LOC_SESS_INTERMEDIATE == rpMsg->status) { + // modem could be still working for a final fix, + // although we no longer need it. So stopFix(). + loc_eng_data_p->client_handle->stopFix(); + } + // turn off the session flag. + loc_eng_data_p->client_handle->setInSession(false); + } } break; @@ -1500,15 +1524,22 @@ static void loc_eng_deferred_action_thread(void* arg) gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); } break; case LOC_ENG_MSG_REQUEST_BIT: { + AgpsStateMachine* stateMachine; loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; - AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; + } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); + break; + } BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); stateMachine->subscribeRsrc((Subscriber*)&subscriber); @@ -1517,10 +1548,16 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_RELEASE_BIT: { + AgpsStateMachine* stateMachine; loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; - AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; + } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); + break; + } BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); @@ -1530,12 +1567,15 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_REQUEST_ATL: { loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? + boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || + backwardCompatibleMode) ? loc_eng_data_p->agnss_nif : loc_eng_data_p->internet_nif; ATLSubscriber subscriber(arqMsg->handle, stateMachine, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + backwardCompatibleMode); stateMachine->subscribeRsrc((Subscriber*)&subscriber); } @@ -1546,18 +1586,44 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; ATLSubscriber s1(arlMsg->handle, loc_eng_data_p->agnss_nif, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + false); // attempt to unsubscribe from agnss_nif first if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { ATLSubscriber s2(arlMsg->handle, loc_eng_data_p->internet_nif, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + false); // if unsuccessful, try internet_nif loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); } } break; + case LOC_ENG_MSG_REQUEST_WIFI: + { + loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; + if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM) { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } else { + LOC_LOGE("%s]%d ERROR: unknown sender ID", __func__, __LINE__); + break; + } + } + break; + + case LOC_ENG_MSG_RELEASE_WIFI: + { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + loc_eng_msg_release_wifi* wrlMsg = (loc_eng_msg_release_wifi*)msg; + WIFISubscriber subscriber(stateMachine, wrlMsg->ssid, wrlMsg->password, wrlMsg->senderId); + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + case LOC_ENG_MSG_REQUEST_XTRA_DATA: if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) { @@ -1593,15 +1659,22 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_OPEN_SUCCESS: { loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + AgpsStateMachine* stateMachine; + switch (aosMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } stateMachine->setBearer(aosMsg->bearerType); -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif stateMachine->setAPN(aosMsg->apn, aosMsg->length); stateMachine->onRsrcEvent(RSRC_GRANTED); } @@ -1610,13 +1683,20 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_CLOSED: { loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif + AgpsStateMachine* stateMachine; + switch (acsMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } stateMachine->onRsrcEvent(RSRC_RELEASED); } @@ -1625,13 +1705,20 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_OPEN_FAILED: { loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif + AgpsStateMachine* stateMachine; + switch (aofMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } stateMachine->onRsrcEvent(RSRC_DENIED); } @@ -1645,6 +1732,36 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_handle_engine_up(*loc_eng_data_p); break; + case LOC_ENG_MSG_REQUEST_NETWORK_POSIITON: + { + loc_eng_msg_request_network_position *nlprequestmsg = (loc_eng_msg_request_network_position*)msg; + //loc_eng_handle_request_network_position(nlprequestmsg ); + LOC_LOGD("Received n/w position request from ULP.Request type %d Periodicity: %d\n", + nlprequestmsg->networkPosRequest.request_type, + nlprequestmsg->networkPosRequest.interval_ms); + if(loc_eng_data_p->ulp_network_callback != NULL) + { + loc_eng_data_p->ulp_network_callback((UlpNetworkRequestPos*)&(nlprequestmsg->networkPosRequest)); + } + else + LOC_LOGE("Ulp Network call back not initialized"); + } + break; + + case LOC_ENG_MSG_REQUEST_PHONE_CONTEXT: + { + loc_eng_msg_request_phone_context *contextReqMsg = (loc_eng_msg_request_phone_context*)msg; + LOC_LOGD("Received phone context request from ULP.context_type 0x%x,request_type 0x%x ", + contextReqMsg->contextRequest.context_type,contextReqMsg->contextRequest.request_type) + if(loc_eng_data_p->ulp_phone_context_req_cb != NULL) + { + loc_eng_data_p->ulp_phone_context_req_cb((UlpPhoneContextRequest*)&(contextReqMsg->contextRequest)); + } + else + LOC_LOGE("Ulp Phone context request call back not initialized"); + } + break; + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; @@ -1675,52 +1792,6 @@ static void loc_eng_deferred_action_thread(void* arg) EXIT_LOG(%s, VOID_RET); } -/*=========================================================================== -FUNCTION loc_eng_report_position_ulp - -DESCRIPTION - Report a ULP position - p_ulp_pos_absolute, ULP position in absolute coordinates - -DEPENDENCIES - None - -RETURN VALUE - 0: SUCCESS - others: error - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_report_position_ulp (void* handle, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data) -{ - ENTRY_LOG(); - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; - - INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, - return -1); - - if (ext_data_length > sizeof (extra_data)) - { - ext_data_length = sizeof (extra_data); - } - - memcpy(extra_data, - ext_data, - ext_data_length); - - loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, - NULL, LOC_SESS_SUCCESS); - - EXIT_LOG(%d, 0); - return 0; -} - -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -1739,41 +1810,17 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_eng_ulp_init(void* owner) +int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf) { ENTRY_LOG(); - int ret_val; - void *handle; - const char *error; - get_ulp_interface* get_ulp_inf; + int ret_val=-1; - if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { - LOC_LOGD ("%s, ULP is not supported\n", __func__); - ret_val = -1; - goto exit; - } - - handle = dlopen ("libulp.so", RTLD_NOW); - if (!handle) + if(loc_eng_ulpInf != NULL) { - LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); - ret_val = -1; - goto exit; + // Initialize the ULP interface + ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); + loc_eng_data.ulp_initialized = TRUE; } - dlerror(); /* Clear any existing error */ - - get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); - ret_val = -1; - goto exit; - } - - locEngUlpInf = get_ulp_inf(); - - // Initialize the ULP interface - locEngUlpInf->init (owner, loc_eng_report_position_ulp); - ret_val = 0; exit: EXIT_LOG(%d, ret_val); @@ -1830,9 +1877,193 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); int ret_val; - ret_val = 0; + + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + LOC_LOGD("SJ:loc_eng_update_criteria: valid 0x%x action:%d, minTime:%ld, minDistance:%f, singleShot:%d, horizontalAccuracy:%d, powerRequirement:%d \n", + criteria.valid_mask, criteria.action, criteria.min_interval, criteria.min_distance, criteria.recurrence_type, criteria.preferred_horizontal_accuracy, + criteria.preferred_power_consumption ); + ulp_msg_update_criteria *msg( + new ulp_msg_update_criteria(&loc_eng_data,criteria)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_phone_context_settings_update + +DESCRIPTION + This is used to inform the ULP module of phone settings changes carried out + by the users +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ + +int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextSettings *settings) +{ + ENTRY_LOG(); + int ret_val = -1; + + LOC_LOGD("loc_eng_ulp_phone_context_settings: context_type - 0x%x is_agps_enabled - %d " + "is_battery_charging %d ,is_gps_enabled %d, is_network_position_available %d," + "is_wifi_setting_enabled %d, is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + settings->context_type ,settings->is_agps_enabled,settings->is_battery_charging, + settings->is_gps_enabled, settings->is_network_position_available, + settings->is_wifi_setting_enabled, settings->is_agps_enabled, + settings->is_enh_location_services_enabled ); + + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + ulp_msg_inject_phone_context_settings *msg + (new ulp_msg_inject_phone_context_settings(&loc_eng_data, *settings)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, msg, loc_eng_free_msg); + ret_val = 0; + } + + // Send battery information to modem for processing. + if(settings->context_type & ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE) + { + loc_eng_msg_ext_power_config *msg(new loc_eng_msg_ext_power_config(&loc_eng_data, settings->is_battery_charging)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); + } EXIT_LOG(%d, ret_val); return ret_val; } -#endif +/*=========================================================================== +FUNCTION loc_eng_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data,UlpPhoneContextCallbacks *callback) +{ + ENTRY_LOG(); + loc_eng_data.ulp_phone_context_req_cb = callback->ulp_request_phone_context_cb ; + int ret_val =0; + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, + UlpNetworkLocationCallbacks *callbacks) +{ + ENTRY_LOG_CALLFLOW(); + loc_eng_data.ulp_network_callback = callbacks->ulp_network_location_request_cb; + int ret_val =0; + EXIT_LOG(%d, ret_val); + return ret_val; +} + + +/*=========================================================================== +FUNCTION loc_eng_ulp_send_network_position + +DESCRIPTION + Ulp send data + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, + UlpNetworkPositionReport *position_report) +{ + ENTRY_LOG(); + int ret_val = 0; + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + ulp_msg_inject_network_position *msg + (new ulp_msg_inject_network_position(&loc_eng_data, *position_report)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} +/*=========================================================================== +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(gpsConfigAlreadyRead == false) + { + // Initialize our defaults before reading of configuration file overwrites them. + loc_default_parameters(); + // Ee 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, loc_parameter_table); + gpsConfigAlreadyRead = true; + } else { + LOC_LOGV("GPS Config file has already been read\n"); + } + + EXIT_LOG(%d, 0); + return 0; +} + diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h old mode 100755 new mode 100644 index 73578ec8..e1cf95cc --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-2012 Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -36,6 +36,7 @@ extern "C" { // 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; @@ -67,16 +68,27 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 -#define MAX_APN_LEN 100 -#define MAX_URL_LEN 256 -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) - enum loc_mute_session_e_type { LOC_MUTE_SESS_NONE = 0, LOC_MUTE_SESS_WAIT, LOC_MUTE_SESS_IN_SESSION }; +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const void* ulp_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + // Module data typedef struct { @@ -89,6 +101,8 @@ typedef struct gps_ni_notify_callback ni_notify_cb; gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; + ulp_network_location_request ulp_network_callback; + ulp_request_phone_context ulp_phone_context_req_cb; boolean intermediateFix; AGpsStatusValue agps_status; // used to defer stopping the GPS engine until AGPS data calls are done @@ -97,11 +111,10 @@ typedef struct loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; - boolean navigating; - // AGPS state machines AgpsStateMachine* agnss_nif; AgpsStateMachine* internet_nif; + AgpsStateMachine* wifi_nif; // GPS engine status GpsStatusValue engine_status; @@ -112,8 +125,6 @@ typedef struct void* context; - loc_eng_msg_position_mode position_mode; - // For muting session broadcast loc_mute_session_e_type mute_session_state; @@ -127,12 +138,47 @@ typedef struct int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; + bool ulp_initialized; } loc_eng_data_s_type; +#include "ulp.h" + +/* GPS.conf support */ +typedef struct loc_gps_cfg_s +{ + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long ENABLE_WIPER; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + uint8_t GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + unsigned long QUIPC_ENABLED; + unsigned long LPP_PROFILE; + unsigned long 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; +} loc_gps_cfg_s_type; + +extern loc_gps_cfg_s_type gps_conf; int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event); + LOC_API_ADAPTER_EVENT_MASK_T event, + void (*loc_external_msg_sender) (void*, void*)); +int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf); 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); @@ -145,29 +191,19 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, 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, - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); + LocPosMode ¶ms); const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, const char* name); -#ifdef QCOM_FEATURE_ULP int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, UlpLocationCriteria criteria); -#endif + void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, const char* apn, AGpsBearerType bearerType); int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); -#endif - int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, LocServerType type, const char *hostname, int port); @@ -196,7 +232,15 @@ 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); +int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, UlpNetworkLocationCallbacks *callbacks); +int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextSettings *settings); +int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextCallbacks *callback); +int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, + UlpNetworkPositionReport *position_report); +int loc_eng_read_config(void); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp old mode 100755 new mode 100644 index 07475680..e9524d57 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -87,7 +87,7 @@ const int Notification::BROADCAST_INACTIVE = 0x80000002; //====================================================================== -// Subscriber: BITSubscriber / ATLSubscriber +// Subscriber: BITSubscriber / ATLSubscriber / WIFISubscriber //====================================================================== bool Subscriber::forMe(Notification ¬ification) { @@ -120,14 +120,17 @@ bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) 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: @@ -150,20 +153,56 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_DENIED: + { + AGpsType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 mStateMachine->getBearer(), -#endif - mStateMachine->getType()); + type); + } break; case RSRC_GRANTED: + { + AGpsType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 mStateMachine->getBearer(), -#endif - mStateMachine->getType()); + 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; @@ -276,23 +315,25 @@ AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) Subscriber* subscriber = (Subscriber*) data; if (subscriber->waitForCloseComplete()) { subscriber->setInactive(); - if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasingState; - } } 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; + // 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); - } + // 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; @@ -381,13 +422,13 @@ AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) // now check if there is any subscribers left if (!mStateMachine->hasSubscribers()) { // no more subscribers, move to RELEASED state - nextState = mReleasingState; + nextState = mReleasedState; // tell connecivity service we can release NIF mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); } else if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; + // only inactive subscribers, move to RELEASING state + nextState = mReleasingState; // tell connecivity service we can release NIF mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); @@ -469,21 +510,14 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) // now check if there is any subscribers left if (!mStateMachine->hasSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { // no more subscribers, move to RELEASED state nextState = mReleasedState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); } } break; + case RSRC_DENIED: + // A race condition subscriber unsubscribes before AFW denies resource. case RSRC_RELEASED: { nextState = mAcquiredState; @@ -503,7 +537,6 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) break; case RSRC_GRANTED: - case RSRC_DENIED: default: LOC_LOGE("%s: unrecognized event %d", whoami(), event); // no state change. @@ -520,11 +553,13 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) //====================================================================== AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), - AGpsType type) : + AGpsType type, + bool enforceSingleSubscriber) : mServicer(servicer), mType(type), mStatePtr(new AgpsReleasedState(this)), mAPN(NULL), - mAPNLen(0) + mAPNLen(0), + mEnforceSingleSubscriber(enforceSingleSubscriber) { linked_list_init(&mSubscribers); @@ -643,7 +678,7 @@ void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const { Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ALL); + Notification notification(Notification::BROADCAST_ACTIVE); linked_list_search(mSubscribers, (void**)&s, hasSubscriber, (void*)¬ification, false); @@ -653,20 +688,15 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const nifRequest.type = mType; nifRequest.status = action; -#ifdef QCOM_FEATURE_IPV6 if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; nifRequest.ipv6_addr[0] = 0; + nifRequest.ssid[0] = '\0'; + nifRequest.password[0] = '\0'; } else { s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setWifiInfo(nifRequest.ssid, nifRequest.password); } -#else - if (s == NULL) { - nifRequest.ipaddr = INADDR_NONE; - } else { - nifRequest.ipaddr = s->ID; - } -#endif CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); (*mServicer)(&nifRequest); @@ -675,7 +705,12 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) { - mStatePtr = mStatePtr->onRsrcEvent(RSRC_SUBSCRIBE, (void*)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) diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h old mode 100755 new mode 100644 index 1fd0f450..a0873d04 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,6 +37,7 @@ #include #include #include +#include "loc_eng_msg.h" // forward declaration class AgpsStateMachine; @@ -149,23 +150,20 @@ class AgpsStateMachine { char* mAPN; // for convenience, we don't do strlen each time. unsigned int mAPNLen; -#ifdef QCOM_FEATURE_IPV6 // bear AGpsBearerType mBearer; -#endif // ipv4 address for routing + bool mEnforceSingleSubscriber; public: - AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); + AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType 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; } -#ifdef QCOM_FEATURE_IPV6 inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline AGpsBearerType getBearer() const { return mBearer; } -#endif inline AGpsType getType() const { return (AGpsType)mType; } // someone, a ATL client or BIT, is asking for NIF @@ -206,6 +204,7 @@ struct Subscriber { inline virtual ~Subscriber() {} virtual void setIPAddresses(int &v4, char* v6) = 0; + inline virtual void setWifiInfo(char* ssid, char* password) {} inline virtual bool equals(const Subscriber *s) const { return ID == s->ID; } @@ -256,10 +255,13 @@ private: // ATLSubscriber, created with requests from ATL struct ATLSubscriber : public Subscriber { const LocApiAdapter* mLocAdapter; + const bool mBackwardCompatibleMode; inline ATLSubscriber(const int id, const AgpsStateMachine* stateMachine, - const LocApiAdapter* adapter) : - Subscriber(id, stateMachine), mLocAdapter(adapter) {} + const LocApiAdapter* adapter, + const bool compatibleMode) : + Subscriber(id, stateMachine), mLocAdapter(adapter), + mBackwardCompatibleMode(compatibleMode){} virtual bool notifyRsrcStatus(Notification ¬ification); inline virtual void setIPAddresses(int &v4, char* v6) @@ -267,7 +269,55 @@ struct ATLSubscriber : public Subscriber { inline virtual Subscriber* clone() { - return new ATLSubscriber(ID, mStateMachine, mLocAdapter); + return new ATLSubscriber(ID, mStateMachine, mLocAdapter, + mBackwardCompatibleMode); + } +}; + +// 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(int &v4, char* v6) {} + + 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); } }; diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp old mode 100755 new mode 100644 index f2f9a501..2bb2d810 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,23 +33,54 @@ #include #include #include +#include +#include +#include #include "log_util.h" #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 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 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, gid = %d, result = %d, error = %s\n", 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); + 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); LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid); return 0; @@ -80,6 +111,7 @@ static int loc_api_server_proc(void *context) 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 0; @@ -114,6 +146,8 @@ 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); return 0; } @@ -165,16 +199,40 @@ int loc_eng_dmn_conn_loc_api_server_join(void) return 0; } -int loc_eng_dmn_conn_loc_api_server_data_conn(int status) { +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; - LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); - 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; + 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_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/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h old mode 100755 new mode 100644 index 414fd553..f6692487 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -35,11 +35,15 @@ #define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" #define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_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" #endif @@ -47,7 +51,7 @@ int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread 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 loc_eng_dmn_conn_loc_api_server_data_conn(int, int); #endif /* LOC_ENG_DATA_SERVER_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp old mode 100755 new mode 100644 index fd15f001..6077b721 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -47,15 +47,79 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, return 1; } - loc_eng_msg_request_bit *msg( - new loc_eng_msg_request_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + if (NULL != loc_api_handle) { + loc_if_req_type_e_type type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = LOC_ENG_IF_REQUEST_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"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } + } #else - loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_REQUEST_SUCCESS); + 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; } @@ -64,14 +128,76 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, { LOC_LOGD("%s:%d]\n", __func__, __LINE__); #ifndef DEBUG_DMN_LOC_API - loc_eng_msg_release_bit *msg( + loc_if_req_type_e_type type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = LOC_ENG_IF_REQUEST_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"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + loc_eng_msg_release_bit *msg( new loc_eng_msg_release_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, + type, pmsg->cmsg.cmsg_if_request.ipv4_addr, (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); loc_eng_msg_sender(loc_api_handle, msg); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } #else - loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); + 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h old mode 100755 new mode 100644 index 833e971b..7aa22bfb --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -32,6 +32,9 @@ #include #include +//for SSID_BUF_SIZE +#include + enum { /* 0x0 - 0xEF is reserved for daemon internal */ GPSONE_LOC_API_IF_REQUEST = 0xF0, @@ -55,10 +58,26 @@ 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_GPSONE_DAEMON, + IF_REQUEST_SENDER_ID_MODEM +} ctrl_if_req_sender_id_e_type; + struct ctrl_msg_if_request { - unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ + 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 */ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp old mode 100755 new mode 100644 index d813cd65..843f558f --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012 Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +31,6 @@ #define LOG_TAG "LocSvc_eng" #include "hardware/gps.h" -#include "loc.h" #include "loc_log.h" #include "loc_eng_log.h" #include "loc_eng_msg_id.h" @@ -88,10 +87,24 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_WIFI ), + NAME_VAL( LOC_ENG_MSG_RELEASE_WIFI ), NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) + NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ), + NAME_VAL( LOC_ENG_MSG_EXT_POWER_CONFIG ), + NAME_VAL( LOC_ENG_MSG_REQUEST_POSITION ), + NAME_VAL( LOC_ENG_MSG_REQUEST_PHONE_CONTEXT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_NETWORK_POSIITON ), + NAME_VAL( ULP_MSG_UPDATE_CRITERIA ), + NAME_VAL( ULP_MSG_START_FIX ), + NAME_VAL( ULP_MSG_STOP_FIX ), + NAME_VAL( ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS ), + NAME_VAL( ULP_MSG_INJECT_NETWORK_POSITION ), + NAME_VAL( ULP_MSG_REPORT_QUIPC_POSITION ), + NAME_VAL( ULP_MSG_REQUEST_COARSE_POSITION ), + NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); @@ -149,9 +162,8 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SVSTEER ), NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), - NAME_VAL( GPS_DELETE_CELLDB_INFO ) -#ifdef QCOM_FEATURE_DELEXT - ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_CELLDB_INFO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), NAME_VAL( GPS_DELETE_ALMANAC_GLO ), @@ -160,7 +172,6 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), NAME_VAL( GPS_DELETE_TIME_GPS ), NAME_VAL( GPS_DELETE_TIME_GLO ) -#endif }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); @@ -172,15 +183,11 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data) static loc_name_val_s_type loc_eng_agps_types[] = { -#ifdef QCOM_FEATURE_IPV6 NAME_VAL( AGPS_TYPE_INVALID ), NAME_VAL( AGPS_TYPE_ANY ), -#endif NAME_VAL( AGPS_TYPE_SUPL ), - NAME_VAL( AGPS_TYPE_C2K ) -#ifdef QCOM_FEATURE_IPV6 - ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) -#endif + NAME_VAL( AGPS_TYPE_C2K ), + NAME_VAL( AGPS_TYPE_WWAN_ANY ) }; static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type); @@ -233,7 +240,7 @@ 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); } -#ifdef QCOM_FEATURE_IPV6 + static loc_name_val_s_type loc_eng_agps_bears[] = { NAME_VAL( AGPS_APN_BEARER_INVALID ), @@ -247,7 +254,6 @@ 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); } -#endif static loc_name_val_s_type loc_eng_server_types[] = { diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h old mode 100755 new mode 100644 index eff1593b..e8a82793 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -37,7 +37,7 @@ extern "C" #include #include -#include "loc_eng_msg_id.h" +#include const char* loc_get_gps_status_name(GpsStatusValue gps_status); const char* loc_get_msg_name(int id); @@ -48,9 +48,7 @@ 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); -#ifdef QCOM_FEATURE_IPV6 const char* loc_get_agps_bear_name(AGpsBearerType bear); -#endif 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); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h old mode 100755 new mode 100644 index 41548f09..4a1cae63 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012 Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -35,14 +35,83 @@ #include #include "log_util.h" #include "loc.h" -#include "loc_eng_log.h" +#include #include "loc_eng_msg_id.h" - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + 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); + } + } + + LocPosMode() : + mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), + min_interval(MIN_POSSIBLE_FIX_INTERVAL), preferred_accuracy(50), preferred_time(120000) { + 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); + } + + inline void 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); + } +}; + +typedef enum { + LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, + LOC_ENG_IF_REQUEST_TYPE_WIFI, + LOC_ENG_IF_REQUEST_TYPE_ANY +} loc_if_req_type_e_type; + +typedef enum { + LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, + 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; + struct loc_eng_msg { const void* owner; const int msgid; @@ -50,10 +119,12 @@ struct loc_eng_msg { owner(instance), msgid(id) { LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); + LOC_LOGV("creating msg ox%x", msgid); } virtual ~loc_eng_msg() { LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); + LOC_LOGV("deleting msg ox%x", msgid); } }; @@ -67,6 +138,26 @@ struct loc_eng_msg_suple_version : public loc_eng_msg { } }; +struct loc_eng_msg_lpp_config : public loc_eng_msg { + const int lpp_config; + inline loc_eng_msg_lpp_config(void *instance, int profile) : + loc_eng_msg(instance, LOC_ENG_MSG_LPP_CONFIG), + lpp_config(profile) + { + LOC_LOGV("lpp profile: %d", profile); + } +}; + +struct loc_eng_msg_ext_power_config : public loc_eng_msg { + const int isBatteryCharging; + inline loc_eng_msg_ext_power_config(void* instance, int isBattCharging) : + loc_eng_msg(instance, LOC_ENG_MSG_EXT_POWER_CONFIG), + isBatteryCharging(isBattCharging) + { + LOC_LOGV("isBatteryCharging: %d", isBatteryCharging); + } +}; + struct loc_eng_msg_sensor_control_config : public loc_eng_msg { const int sensorsDisabled; inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : @@ -78,12 +169,51 @@ struct loc_eng_msg_sensor_control_config : public loc_eng_msg { }; struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const bool gyroBiasVarianceRandomWalk_valid; const float gyroBiasVarianceRandomWalk; - inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : + const bool accelRandomWalk_valid; + const float accelRandomWalk; + const bool angleRandomWalk_valid; + const float angleRandomWalk; + const bool rateRandomWalk_valid; + const float rateRandomWalk; + const bool velocityRandomWalk_valid; + const float velocityRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, 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) : loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), - gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) + gyroBiasVarianceRandomWalk_valid(gyroBiasRandomWalk_valid), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk), + accelRandomWalk_valid(accelRandomWalk_valid), + accelRandomWalk(accelRandomWalk), + angleRandomWalk_valid(angleRandomWalk_valid), + angleRandomWalk(angleRandomWalk), + rateRandomWalk_valid(rateRandomWalk_valid), + rateRandomWalk(rateRandomWalk), + velocityRandomWalk_valid(velocityRandomWalk_valid), + velocityRandomWalk(velocityRandomWalk) { - LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); + 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", + gyroBiasRandomWalk_valid, + accelRandomWalk_valid, + angleRandomWalk_valid, + rateRandomWalk_valid, + velocityRandomWalk_valid + ); + LOC_LOGV("Sensor properties, Gyro Random walk: %f Accel Random Walk: %f " + "Angle Random Walk: %f Rate Random Walk: %f " + "Velocity Random Walk: %f", + gyroBiasRandomWalk, + accelRandomWalk, + angleRandomWalk, + rateRandomWalk, + velocityRandomWalk + ); } }; @@ -93,55 +223,40 @@ struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { const int accelBatchesPerSec; const int gyroSamplesPerBatch; const int gyroBatchesPerSec; + const int algorithmConfig; inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) : + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int algorithmConfig) : loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), controlMode(controlMode), accelSamplesPerBatch(accelSamplesPerBatch), accelBatchesPerSec(accelBatchesPerSec), gyroSamplesPerBatch(gyroSamplesPerBatch), - gyroBatchesPerSec(gyroBatchesPerSec) + gyroBatchesPerSec(gyroBatchesPerSec), + algorithmConfig(algorithmConfig) { LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u), algorithmConfig(%u)\n", controlMode, accelSamplesPerBatch, accelBatchesPerSec, gyroSamplesPerBatch, - gyroBatchesPerSec + gyroBatchesPerSec, + algorithmConfig ); } }; struct loc_eng_msg_position_mode : public loc_eng_msg { - const LocPositionMode pMode; - const GpsPositionRecurrence pRecurrence; - const uint32_t minInterval; - const uint32_t preferredAccuracy; - const uint32_t preferredTime; - inline loc_eng_msg_position_mode() : - loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(LOC_POSITION_MODE_STANDALONE), - pRecurrence(0), minInterval(0), - preferredAccuracy(0), preferredTime(0) {} + const LocPosMode pMode; inline loc_eng_msg_position_mode(void* instance, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) : + LocPosMode &mode) : loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(mode), pRecurrence(recurrence), minInterval(min_interval), - preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) + pMode(mode) { - LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", - loc_get_position_mode_name(pMode), - loc_get_position_recurrence_name(pRecurrence), - minInterval, - preferredAccuracy, - preferredTime); + pMode.logv(); } }; @@ -193,18 +308,10 @@ struct loc_eng_msg_report_position : public loc_eng_msg { loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), location(loc), locationExt(locExt), status(st) { -#ifdef QCOM_FEATURE_ULP - 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: %s", + 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", location.flags, location.position_source, location.latitude, location.longitude, location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData, - loc_get_position_sess_status_name(status)); -#else - LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", - location.flags, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, loc_get_position_sess_status_name(status)); -#endif + location.timestamp, location.rawDataSize, location.rawData,status); } }; @@ -256,23 +363,23 @@ struct loc_eng_msg_report_nmea : public loc_eng_msg { }; struct loc_eng_msg_request_bit : public loc_eng_msg { - const unsigned int isSupl; + const loc_if_req_type_e_type ifType; const int ipv4Addr; char* const ipv6Addr; inline loc_eng_msg_request_bit(void* instance, - unsigned int is_supl, + loc_if_req_type_e_type type, int ipv4, char* ipv6) : loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), - isSupl(is_supl), ipv4Addr(ipv4), + ifType(type), ipv4Addr(ipv4), ipv6Addr(NULL == ipv6 ? NULL : new char[16]) { if (NULL != ipv6Addr) memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), (unsigned char)ipv4, NULL != ipv6Addr ? ipv6Addr : ""); } @@ -285,24 +392,61 @@ struct loc_eng_msg_request_bit : public loc_eng_msg { } }; +struct loc_eng_msg_request_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_request_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != ssid) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != password) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_request_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } +}; + struct loc_eng_msg_release_bit : public loc_eng_msg { - const unsigned int isSupl; + const loc_if_req_type_e_type ifType; const int ipv4Addr; char* const ipv6Addr; inline loc_eng_msg_release_bit(void* instance, - unsigned int is_supl, + loc_if_req_type_e_type type, int ipv4, char* ipv6) : loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), - isSupl(is_supl), ipv4Addr(ipv4), + ifType(type), ipv4Addr(ipv4), ipv6Addr(NULL == ipv6 ? NULL : new char[16]) { if (NULL != ipv6Addr) memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), (unsigned char)ipv4, NULL != ipv6Addr ? ipv6Addr : ""); } @@ -315,6 +459,44 @@ struct loc_eng_msg_release_bit : public loc_eng_msg { } }; +struct loc_eng_msg_release_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_release_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != s) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != p) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_release_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } +}; + + struct loc_eng_msg_request_atl : public loc_eng_msg { const int handle; const AGpsType type; @@ -452,7 +634,6 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { } }; -#ifdef QCOM_FEATURE_IPV6 struct loc_eng_msg_atl_open_success : public loc_eng_msg { const AGpsStatusValue agpsType; const int length; @@ -479,30 +660,7 @@ struct loc_eng_msg_atl_open_success : public loc_eng_msg { delete[] apn; } }; -#else -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const int length; - char* const apn; - inline loc_eng_msg_atl_open_success(void* instance, - const char* name, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - length(len), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n", - apn); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } -}; -#endif -#ifdef QCOM_FEATURE_IPV6 struct loc_eng_msg_atl_open_failed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_open_failed(void* instance, @@ -514,17 +672,7 @@ struct loc_eng_msg_atl_open_failed : public loc_eng_msg { loc_get_agps_type_name(agpsType)); } }; -#else -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - inline loc_eng_msg_atl_open_failed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) - { - LOC_LOGV(""); - } -}; -#endif -#ifdef QCOM_FEATURE_IPV6 struct loc_eng_msg_atl_closed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_closed(void* instance, @@ -536,15 +684,6 @@ struct loc_eng_msg_atl_closed : public loc_eng_msg { loc_get_agps_type_name(agpsType)); } }; -#else -struct loc_eng_msg_atl_closed : public loc_eng_msg { - inline loc_eng_msg_atl_closed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) - { - LOC_LOGV(""); - } -}; -#endif struct loc_eng_msg_set_data_enable : public loc_eng_msg { const int enable; @@ -567,6 +706,98 @@ struct loc_eng_msg_set_data_enable : public loc_eng_msg { } }; +struct loc_eng_msg_request_network_position : public loc_eng_msg { + const UlpNetworkRequestPos networkPosRequest; + inline loc_eng_msg_request_network_position (void* instance, UlpNetworkRequestPos networkPosReq) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NETWORK_POSIITON), + networkPosRequest(networkPosReq) + { + LOC_LOGV("network position request: desired pos source %d\n request type: %d\n interval ms: %d ", + networkPosReq.desired_position_source, + networkPosReq.request_type, + networkPosReq.interval_ms); + } +}; + +struct loc_eng_msg_request_phone_context : public loc_eng_msg { + const UlpPhoneContextRequest contextRequest; + inline loc_eng_msg_request_phone_context (void* instance, UlpPhoneContextRequest contextReq) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_PHONE_CONTEXT), + contextRequest(contextReq) + { + LOC_LOGV("phone context request: request type 0x%x context type: 0x%x ", + contextRequest.request_type, + contextRequest.context_type); + } +}; + +struct ulp_msg_update_criteria : public loc_eng_msg { + const UlpLocationCriteria locationCriteria; + inline ulp_msg_update_criteria (void* instance, UlpLocationCriteria criteria) : + loc_eng_msg(instance, ULP_MSG_UPDATE_CRITERIA), + locationCriteria(criteria) + { + LOC_LOGV("location criteria: aciton %d\n valid mask: %d\n provider source: %d\n accuracy %d\n recurrence type %d\n min interval %d\n power consumption %d\n intermediate pos %d ", + locationCriteria.action, + locationCriteria.valid_mask, + locationCriteria.provider_source, + locationCriteria.preferred_horizontal_accuracy, + locationCriteria.recurrence_type, + locationCriteria.min_interval, + locationCriteria.preferred_power_consumption, + locationCriteria.intermediate_pos_report_enabled); + } +}; + +struct ulp_msg_inject_phone_context_settings : public loc_eng_msg { + const UlpPhoneContextSettings phoneSetting; + inline ulp_msg_inject_phone_context_settings(void* instance, UlpPhoneContextSettings setting) : + loc_eng_msg(instance, ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS), + phoneSetting(setting) + { + LOC_LOGV("context type: %d\n gps enabled: %d\n network position available %d\n wifi setting enabled %d\n battery charging %d" + "is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + phoneSetting.context_type, + phoneSetting.is_gps_enabled, + phoneSetting.is_network_position_available, + phoneSetting.is_wifi_setting_enabled, + phoneSetting.is_battery_charging, + phoneSetting.is_agps_enabled, + phoneSetting.is_enh_location_services_enabled); + } +}; + +struct ulp_msg_inject_network_position : public loc_eng_msg { + const UlpNetworkPositionReport networkPosition; + inline ulp_msg_inject_network_position(void* instance, UlpNetworkPositionReport networkPos) : + loc_eng_msg(instance, ULP_MSG_INJECT_NETWORK_POSITION), + networkPosition(networkPos) + { + LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n accuracy %d", + networkPosition.valid_flag, + networkPosition.position.pos_source, + networkPosition.position.latitude, + networkPosition.position.longitude, + networkPosition.position.HEPE); + } +}; + +struct ulp_msg_report_quipc_position : public loc_eng_msg { + const GpsLocation location; + const int quipc_error_code; + inline ulp_msg_report_quipc_position(void* instance, GpsLocation &loc, + int quipc_err) : + loc_eng_msg(instance, ULP_MSG_REPORT_QUIPC_POSITION), + location(loc), quipc_error_code(quipc_err) + { + 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 Quipc error: %d", + location.flags, location.position_source, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, location.rawDataSize, location.rawData, + quipc_error_code); + } +}; + void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); int loc_eng_msgget(int * p_req_msgq); int loc_eng_msgremove(int req_msgq); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h old mode 100755 new mode 100644 index f05f1f44..ff5a6bd7 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011,2012 Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -76,11 +76,48 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_RELEASE_BIT, LOC_ENG_MSG_REQUEST_ATL, LOC_ENG_MSG_RELEASE_ATL, + LOC_ENG_MSG_REQUEST_WIFI, + LOC_ENG_MSG_RELEASE_WIFI, LOC_ENG_MSG_REQUEST_NI, LOC_ENG_MSG_INFORM_NI_RESPONSE, LOC_ENG_MSG_REQUEST_XTRA_DATA, LOC_ENG_MSG_REQUEST_TIME, - LOC_ENG_MSG_REQUEST_POSITION + LOC_ENG_MSG_REQUEST_POSITION, + LOC_ENG_MSG_EXT_POWER_CONFIG, + + // The following messages are added for ulp + LOC_ENG_MSG_REQUEST_PHONE_CONTEXT, + LOC_ENG_MSG_REQUEST_NETWORK_POSIITON, + + /* Following messages are for ulp, start at index 0x600 */ + + // Message is sent by GPS HAL layer to add/remove unique request criteria + ULP_MSG_UPDATE_CRITERIA = 0x600, + + // Message is sent by GPS HAL layer to request ULP to start producing position fixes + + ULP_MSG_START_FIX, + + // Message is sent by Android framework(GpsLocationProvider) + // to request ULP to stop producing position fixes + ULP_MSG_STOP_FIX, + + // Message is sent by Android framework(GpsLocationProvider) + // to inject phone context setting include initial phone context setting and subsequent changes + ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS, + + // Message is sent by network provider to INJECT the position in UlpNetworkPositionReport format + ULP_MSG_INJECT_NETWORK_POSITION, + + // Message is sent by QUIPC provider in order to report the position in GpsPosition format with QUIPC status + ULP_MSG_REPORT_QUIPC_POSITION, + + // Message is sent by QUIPC module in order to request some info from ULP + ULP_MSG_REQUEST_COARSE_POSITION, + + /* Message is sent by HAL to LOC API to configure LTE Positioning + Profile in modem */ + LOC_ENG_MSG_LPP_CONFIG }; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp old mode 100755 new mode 100644 index e223983b..92acfc75 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -26,6 +26,9 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_adapter" + #include #include #include @@ -40,9 +43,6 @@ #include "loc_api_v02_log.h" #include "loc_api_sync_req.h" #include "LocApiAdapter.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_adapter" #include "loc_util_log.h" @@ -161,10 +161,7 @@ locClientCallbacksType globalCallbacks = /* Constructor for LocApiV02Adapter */ LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), - eventMask(convertMask(locEng.eventMask)), navigating(false), - fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, - LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, - LOC_API_V02_DEF_TIMEOUT ) + eventMask(convertMask(locEng.eventMask)) { // initialize loc_sync_req interface loc_sync_req_init(); @@ -236,6 +233,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() memset (&set_mode_ind, 0, sizeof(set_mode_ind)); LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + fixCriteria.logv(); // fill in the start request switch(fixCriteria.mode) @@ -277,28 +275,27 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error } - if(fixCriteria.min_interval > 0) - { - start_msg.minInterval_valid = 1; - start_msg.minInterval = fixCriteria.min_interval; - } + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; - start_msg.horizontalAccuracyLevel_valid = 1; + if (fixCriteria.preferred_accuracy > 0) { + start_msg.horizontalAccuracyLevel_valid = 1; - if (fixCriteria.preferred_accuracy <= 100) - { - // fix needs high accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; - } - else if (fixCriteria.preferred_accuracy <= 1000) - { - //fix needs med accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; - } - else - { - //fix needs low accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } } start_msg.fixRecurrence_valid = 1; @@ -313,7 +310,25 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() //dummy session id // TBD: store session ID, check for session id in pos reports. - start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + if (fixCriteria.credentials[0] != 0) { + int size1 = sizeof(start_msg.applicationId.applicationName); + int size2 = sizeof(fixCriteria.credentials); + int len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationName, + fixCriteria.credentials, + len); + + size1 = sizeof(start_msg.applicationId.applicationProvider); + size2 = sizeof(fixCriteria.provider); + len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationProvider, + fixCriteria.provider, + len); + + start_msg.applicationId_valid = 1; + } req_union.pStartReq = &start_msg; @@ -322,13 +337,9 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() if( eLOC_CLIENT_SUCCESS == status) { - navigating = true; return LOC_API_ADAPTER_ERR_SUCCESS; } - // start_fix failed so MO fix is not in progress - navigating = false; - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; } @@ -355,7 +366,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: stopFix() if( eLOC_CLIENT_SUCCESS == status) { - navigating = false; return LOC_API_ADAPTER_ERR_SUCCESS; } @@ -366,42 +376,28 @@ enum loc_api_adapter_err LocApiV02Adapter :: stopFix() /* set the positioning fix criteria */ enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) + const LocPosMode *posMode) { + LOC_LOGV ("%s:%d]: posMode %p",__func__, __LINE__, posMode); - LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, - min_interval, mode, recurrence, preferred_accuracy); + if (NULL != posMode && + !fixCriteria.equals(*posMode)) { + //making a copy of the fix criteria + fixCriteria = *posMode; - //store the fix criteria - fixCriteria.mode = mode; + LOC_LOGD ("%s:%d]: new fix criteria", __func__, __LINE__); - fixCriteria.recurrence = recurrence; + if(true == navigating) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); - if(min_interval == 0) - { - fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; - } - else - { - fixCriteria.min_interval = min_interval; - } + return( startFix()); + } + } - fixCriteria.preferred_accuracy = preferred_accuracy; - - fixCriteria.preferred_time = preferred_time; - - if(true == navigating) - { - //fix is in progress, send a restart - LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " - "criteria\n", __func__, __LINE__); - - return( startFix()); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; + return LOC_API_ADAPTER_ERR_SUCCESS; } /* inject time into the position engine */ @@ -563,13 +559,12 @@ enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) } -#ifdef QCOM_FEATURE_DELEXT if( f & GPS_DELETE_TIME_GPS ) { delete_req.deleteGnssDataMask_valid = 1; delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; } -#endif + if(f & GPS_DELETE_POSITION ) { delete_req.deleteGnssDataMask_valid = 1; @@ -631,7 +626,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; } -#ifdef QCOM_FEATURE_DELEXT if(f & GPS_DELETE_ALMANAC_CORR ) { delete_req.deleteGnssDataMask_valid = 1; @@ -705,7 +699,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) delete_req.deleteGnssDataMask_valid = 1; delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; } -#endif } req_union.pDeleteAssistDataReq = &delete_req; @@ -1002,7 +995,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( return LOC_API_ADAPTER_ERR_SUCCESS; } -#ifdef QCOM_FEATURE_IPV6 + enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) @@ -1082,68 +1075,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( return LOC_API_ADAPTER_ERR_SUCCESS; } -#else -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s] \n", __func__, __LINE__, - handle, is_succ, apn); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} -#endif /* close atl connection */ enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( int handle, int is_succ) @@ -1239,6 +1171,67 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) return LOC_API_ADAPTER_ERR_SUCCESS; } +/* set the configuration for LTE positioning profile (LPP) */ +enum loc_api_adapter_err LocApiV02Adapter :: setLPPConfig(uint32_t profile) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 lpp_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 lpp_config_ind; + + LOC_LOGD("%s:%d]: lpp profile = %d\n", __func__, __LINE__, profile); + + memset(&lpp_config_req, 0, sizeof(lpp_config_req)); + memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); + + lpp_config_req.lppConfig_valid = 1; + // Default RRLP or User or Control plane configuration + switch(profile) + { + /* RRLP */ + case 0: + lpp_config_req.lppConfig = profile; + break; + + /* User plane */ + case 1: + lpp_config_req.lppConfig = QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02; + break; + + case 2: + lpp_config_req.lppConfig = QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02; + break; + + default: + LOC_LOGE("%s:%d]: Invalid LPP Profile Config Setting Provided in gps.conf = %d!", + __FUNCTION__, + __LINE__, + profile); + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + break; + } + + req_union.pSetProtocolConfigParametersReq = &lpp_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &lpp_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != lpp_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(lpp_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + return LOC_API_ADAPTER_ERR_SUCCESS; +} + /* set the Sensor Configuration */ enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) { @@ -1280,7 +1273,11 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsD } /* set the Sensor Properties */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) +enum loc_api_adapter_err LocApiV02Adapter :: 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) { locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; locClientReqUnionType req_union; @@ -1288,15 +1285,30 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasV qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; - LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", - __func__, __LINE__, gyroBiasVarianceRandomWalk); + LOC_LOGI("%s:%d]: sensors prop: gyroBiasRandomWalk = %f, accelRandomWalk = %f, " + "angleRandomWalk = %f, rateRandomWalk = %f, velocityRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk, accelBiasVarianceRandomWalk, + angleBiasVarianceRandomWalk, rateBiasVarianceRandomWalk, velocityBiasVarianceRandomWalk); memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); - sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; + /* Set the validity bit and value for each sensor property */ + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = gyroBiasVarianceRandomWalk_valid; sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + sensor_prop_req.accelerationRandomWalkSpectralDensity_valid = accelBiasVarianceRandomWalk_valid; + sensor_prop_req.accelerationRandomWalkSpectralDensity = accelBiasVarianceRandomWalk; + + sensor_prop_req.angleRandomWalkSpectralDensity_valid = angleBiasVarianceRandomWalk_valid; + sensor_prop_req.angleRandomWalkSpectralDensity = angleBiasVarianceRandomWalk; + + sensor_prop_req.rateRandomWalkSpectralDensity_valid = rateBiasVarianceRandomWalk_valid; + sensor_prop_req.rateRandomWalkSpectralDensity = rateBiasVarianceRandomWalk; + + sensor_prop_req.velocityRandomWalkSpectralDensity_valid = velocityBiasVarianceRandomWalk_valid; + sensor_prop_req.velocityRandomWalkSpectralDensity = velocityBiasVarianceRandomWalk; + req_union.pSetSensorPropertiesReq = &sensor_prop_req; result = loc_sync_send_req(clientHandle, @@ -1322,7 +1334,8 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasV /* set the Sensor Performance Config */ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int algorithmConfig) { locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; locClientReqUnionType req_union; @@ -1331,14 +1344,16 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u) " + "algorithmConfig(%u)\n", __FUNCTION__, __LINE__, controlMode, accelSamplesPerBatch, accelBatchesPerSec, gyroSamplesPerBatch, - gyroBatchesPerSec + gyroBatchesPerSec, + algorithmConfig ); memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); @@ -1352,6 +1367,8 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont sensor_perf_config_req.gyroSamplingSpec_valid = 1; sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + sensor_perf_config_req.algorithmConfig_valid = 1; + sensor_perf_config_req.algorithmConfig = algorithmConfig; req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; @@ -1375,6 +1392,65 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont return LOC_API_ADAPTER_ERR_SUCCESS; } +/* set the External Power Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setExtPowerConfig(int isBatteryCharging) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetExternalPowerConfigReqMsgT_v02 ext_pwr_req; + qmiLocGetExternalPowerConfigIndMsgT_v02 ext_pwr_ind; + + LOC_LOGI("%s:%d]: Ext Pwr Config (isBatteryCharging)(%u)", + __FUNCTION__, + __LINE__, + isBatteryCharging + ); + + memset(&ext_pwr_req, 0, sizeof(ext_pwr_req)); + memset(&ext_pwr_ind, 0, sizeof(ext_pwr_ind)); + + switch(isBatteryCharging) + { + /* Charging */ + case 1: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02; + break; + + /* Not charging */ + case 0: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02; + break; + + default: + LOC_LOGE("%s:%d]: Invalid ext power state = %d!", + __FUNCTION__, + __LINE__, + isBatteryCharging); + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + break; + } + + req_union.pSetExternalPowerConfigReq = &ext_pwr_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + &ext_pwr_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ext_pwr_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %d, ind..status = %d ", + __func__, __LINE__, result, ext_pwr_ind.status); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + /* Convert event mask from loc eng to loc_api_v02 format */ locClientEventMaskType LocApiV02Adapter :: convertMask( LOC_API_ADAPTER_EVENT_MASK_T mask) @@ -1461,7 +1537,7 @@ void LocApiV02Adapter :: reportPosition ( const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) { GpsLocation location; - + LOC_LOGD("Reporting postion from V2 Adapter\n"); memset(&location, 0, sizeof (GpsLocation)); location.size = sizeof(location); // Process the position from final and intermediate reports @@ -1518,7 +1594,9 @@ void LocApiV02Adapter :: reportPosition ( location.flags |= GPS_LOCATION_HAS_ACCURACY; location.accuracy = location_report_ptr->horUncCircular; } - + //Mark the location source as from GNSS + location.flags |= LOCATION_HAS_SOURCE_INFO; + location.position_source = ULP_LOCATION_IS_FROM_GNSS; LocApiAdapter::reportPosition( location, locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->sessionStatus @@ -1639,7 +1717,7 @@ void LocApiV02Adapter :: reportSv ( } } - if (SvStatus.num_svs != 0) + if (SvStatus.num_svs >= 0) { LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); LocApiAdapter::reportSv(SvStatus, @@ -1713,8 +1791,7 @@ void LocApiV02Adapter :: reportAtlRequest( // service ATL open request; copy the WWAN type if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) { - AGpsType agpsType; -#ifdef QCOM_FEATURE_IPV6 + AGpsType agpsType = AGPS_TYPE_WWAN_ANY; switch(server_request_ptr->wwanType) { case eQMI_LOC_WWAN_TYPE_INTERNET_V02: @@ -1729,9 +1806,6 @@ void LocApiV02Adapter :: reportAtlRequest( agpsType = AGPS_TYPE_WWAN_ANY; break; } -#else - agpsType = AGPS_TYPE_SUPL; -#endif LocApiAdapter::requestATL(connHandle, agpsType); } diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h old mode 100755 new mode 100644 index 487e98eb..04f931ee --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -34,25 +34,6 @@ #include #include -/* Fix criteria structure*/ -struct LocApiV02FixCriteria -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval ; - uint32_t preferred_accuracy ; - uint32_t preferred_time; - - /* Constructor for the structure */ - inline LocApiV02FixCriteria (LocPositionMode mode, - GpsPositionRecurrence recur, - uint32_t min_int, - uint32_t pref_acc, - uint32_t pref_time) : - mode(mode), recurrence(recur), min_interval(min_int), - preferred_accuracy(pref_acc), preferred_time(pref_time) {} -}; - /* This class derives from the LocApiAdapter class. The members of this class are responsible for converting the Loc API V02 data structures into Loc Engine data structures. @@ -66,15 +47,6 @@ class LocApiV02Adapter : public LocApiAdapter { /* events the client is registered for */ locClientEventMaskType eventMask; - /* current session state */ - bool navigating; - - /* current fix criteria, for Loc aPI V02 this is - stored when set_position_mode is called and - sent out with Loc aPI V02 start message when the - start_fix() is called by loc engine. */ - LocApiV02FixCriteria fixCriteria; - /* Convert event mask from loc eng to loc_api_v02 format */ locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); @@ -145,9 +117,7 @@ public: virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); + setPositionMode(const LocPosMode *mode); virtual enum loc_api_adapter_err setTime(GpsUtcTime time, int64_t timeReference, int uncertainty); @@ -168,30 +138,27 @@ public: setServer(unsigned int ip, int port, LocServerType type); virtual enum loc_api_adapter_err setXtraData(char* data, int length); -#ifdef QCOM_FEATURE_IPV6 virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); virtual enum loc_api_adapter_err setSensorControlConfig(int sensorUsage); virtual enum loc_api_adapter_err - setSensorProperties(float gyroBiasVarianceRandomWalk); + 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); + setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, int algorithmConfig); + virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging); }; #endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c old mode 100755 new mode 100644 index b75f1630..596a8d35 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -25,7 +25,6 @@ * 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 @@ -36,7 +35,6 @@ #include #include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" #include "loc_api_sync_req.h" /* Logging */ @@ -162,7 +160,7 @@ void loc_sync_process_ind( ) { - LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", + LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n", __func__,__LINE__, client_handle, ind_id); pthread_mutex_lock(&loc_sync_call_mutex); @@ -353,7 +351,7 @@ static int loc_sync_select_ind( { int select_id = loc_alloc_slot(); - LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", + LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n", __func__, __LINE__, client_handle, ind_id, req_id); if (select_id < 0) diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c old mode 100755 new mode 100644 index 4d34adc4..26ecfd26 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -26,6 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include "qmi_client.h" #include "qmi_idl_lib.h" #include "qmi_cci_target_ext.h" @@ -33,23 +34,15 @@ #if defined( _ANDROID_) #include "qmi_cci_target.h" #include "qmi_cci_common.h" -#elif defined(LOC_UTIL_TARGET_OFF_TARGET) -#include -#include -#include +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" #endif //_ANDROID_ #include #include -#include #include #include #include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_api_v02" - #include "loc_util_log.h" #ifdef LOC_UTIL_TARGET_OFF_TARGET @@ -71,7 +64,8 @@ #endif //LOC_UTIL_TARGET_OFF_TARGET //timeout in ms to wait for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT (20000) +#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) +#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) /* Table to relate eventId, size and mask value used to enable the event*/ typedef struct @@ -152,7 +146,22 @@ static locClientEventIndTableStructT locClientEventIndTable[]= { //Location Server Connection Request event { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 }, + + // NI Geofence Event + { QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, + sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02}, + + // Geofence General Alert Event + { QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, + sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02}, + + //Geofence Breach event + { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02} }; /* table to relate the respInd Id with its size */ @@ -345,8 +354,27 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { // Get Position Engine Config { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)}, + //Add a Circular Geofence + { QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, + sizeof(qmiLocAddCircularGeofenceIndMsgT_v02)}, + + //Delete a Geofence + { QMI_LOC_DELETE_GEOFENCE_IND_V02, + sizeof(qmiLocDeleteGeofenceIndMsgT_v02)} , + + //Query a Geofence + { QMI_LOC_QUERY_GEOFENCE_IND_V02, + sizeof(qmiLocQueryGeofenceIndMsgT_v02)}, + + //Edit a Geofence + { QMI_LOC_EDIT_GEOFENCE_IND_V02, + sizeof(qmiLocEditGeofenceIndMsgT_v02)}, + + //Get best available position + { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, + sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)} }; @@ -467,7 +495,7 @@ static locClientStatusEnumType convertQmiResponseToLocStatus( locClientStatusEnumType status = eLOC_CLIENT_FAILURE_INTERNAL; // if result == SUCCESS don't look at error code - if(pResponse->resp.result == QMI_RESULT_SUCCESS ) + if(pResponse->resp.result == QMI_RESULT_SUCCESS_V01 ) { status = eLOC_CLIENT_SUCCESS; } @@ -476,6 +504,7 @@ static locClientStatusEnumType convertQmiResponseToLocStatus( switch(pResponse->resp.error) { case QMI_ERR_MALFORMED_MSG_V01: + case QMI_ERR_INVALID_ARG_V01: status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; break; @@ -749,6 +778,27 @@ static bool locClientHandleIndication( break; } + case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: + { + //locClientHandleNiGeofenceNotificationInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: + { + //locClientHandleGeofenceGenAlertInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: + { + //locClientHandleGeofenceBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + //------------------------------------------------------------------------- // handle the response indications @@ -761,6 +811,13 @@ static bool locClientHandleIndication( indBuffer, indSize); break; } + + case QMI_LOC_GET_FIX_CRITERIA_IND_V02: + { + status = true; + break; + } + // predicted orbits data response indication case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: { @@ -847,6 +904,50 @@ static bool locClientHandleIndication( status = true; break; } + + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: + { + // locClientHandleAddCircularGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_DELETE_GEOFENCE_IND_V02: + { + // locClientHandleDeleteGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EDIT_GEOFENCE_IND_V02: + { + // locClientHandleEditGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_QUERY_GEOFENCE_IND_V02: + { + // locClientHandleQueryGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: + { + status = true; + break; + } + case QMI_LOC_GET_ENGINE_LOCK_IND_V02: + { + status = true; + break; + } + // for indications that only have a "status" field case QMI_LOC_NI_USER_RESPONSE_IND_V02: case QMI_LOC_INJECT_UTC_TIME_IND_V02: @@ -971,7 +1072,7 @@ static void locClientIndCb // check user handle if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) { - LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", + LOC_LOGE("%s:%d]: invalid user_handle got %p expected %p\n", __func__, __LINE__, user_handle, pCallbackData->userHandle); return; @@ -1315,6 +1416,12 @@ static bool validateRequest( break; } + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetSensorPropertiesReqMsgT_v02); + break; + } + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: { *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); @@ -1347,6 +1454,31 @@ static bool validateRequest( *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); break; } + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocAddCircularGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_QUERY_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocQueryGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_EDIT_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocEditGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); + break; + } // ALL requests with no payload case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: @@ -1364,7 +1496,6 @@ static bool validateRequest( case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: { noPayloadFlag = true; @@ -1401,121 +1532,176 @@ static bool validateRequest( static locClientStatusEnumType locClientQmiCtrlPointInit( locClientCallbackDataType *pLocClientCbData) { - uint32_t num_services, num_entries = 10; qmi_client_type clnt, notifier; - qmi_client_os_params os_params; + bool notifierInitFlag = false; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + // instances of this service + qmi_service_info *pServiceInfo = NULL; - // num instances of this service - qmi_service_info serviceInfo[5]; - - qmi_client_error_type rc = QMI_NO_ERR; - - // Get the service object for the qmiLoc Service - qmi_idl_service_object_type locClientServiceObject = - loc_get_service_object_v02(); - - // Verify that qmiLoc_get_service_object did not return NULL - if (NULL == locClientServiceObject) + do { - LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , - __func__, __LINE__ ); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } + uint32_t num_services = 0, num_entries = 0; + qmi_client_error_type rc = QMI_NO_ERR; + bool nosignal = false; + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed\n", - __func__, __LINE__ ); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT); - - if(QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params)) - { - // timed out, return with error - LOC_LOGE("%s:%d]: timed out waiting for service\n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_TIMEOUT); - } - else - { // get the service addressing information rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned %d " - "num_services = %d\n", __func__, __LINE__, rc, - num_services); + LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " + "num_services %d", __func__, __LINE__, rc, num_services); + + if (rc != QMI_NO_ERR) { + // bummer, service list is not up. + // We need to try again after a timed wait + qmi_client_os_params os_params; + int timeout = 0; + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); + + if (rc != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); + nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + + // get the service addressing information + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " + "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); + } + + if (0 == num_services || rc != QMI_NO_ERR) { + if (!nosignal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!! Error %d \n", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + } else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," + " final Err %d", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_TIMEOUT; + } + break; + } + + pServiceInfo = + (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + + if(NULL == pServiceInfo) + { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + //set the number of entries to get equal to the total number of + //services. + num_entries = num_services; + //populate the serviceInfo + rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, + &num_entries, &num_services); + + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); if(rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!!\n", __func__, __LINE__); + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; } - } + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); - //get service info to be used in qmi_client_init - rc = qmi_client_get_service_list( locClientServiceObject, serviceInfo, - &num_entries, &num_services); + // initialize the client + //sent the address of the first service found + // if IPC router is present, this will go to the service instance + // enumerated over IPC router, else it will go over the next transport where + // the service was enumerated. + rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); - if(rc != QMI_NO_ERR) + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + status = eLOC_CLIENT_SUCCESS; + + } while(0); + + /* release the notifier handle */ + if(true == notifierInitFlag) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - return(eLOC_CLIENT_FAILURE_INTERNAL); + qmi_client_release(notifier); } - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", - __func__, __LINE__, pLocClientCbData); - // initialize the client - rc = qmi_client_init(&serviceInfo[0], locClientServiceObject, - locClientIndCb, (void *) pLocClientCbData, - NULL, &clnt); - - if(rc != QMI_NO_ERR) + if(NULL != pServiceInfo) { - LOC_LOGE("%s:%d]: qmi_client_init error %d\n", - __func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); + free((void *)pServiceInfo); } - LOC_LOGV("%s:%d]: passing the pointer %p to" - "qmi_client_register_error_cb \n", - __func__, __LINE__, pLocClientCbData); - - // register error callback - rc = qmi_client_register_error_cb(clnt, - locClientErrorCb, (void *) pLocClientCbData); - - if( QMI_NO_ERR != rc) - { - LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", - __func__, __LINE__, rc); - return (eLOC_CLIENT_FAILURE_INTERNAL); - } - - // copy the clnt handle returned in qmi_client_init - memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - - return(eLOC_CLIENT_SUCCESS); - + return status; } //----------------------- END INTERNAL FUNCTIONS ---------------------------------------- @@ -1592,6 +1778,8 @@ locClientStatusEnumType locClientOpen ( { free(pCallbackData); pCallbackData = NULL; + LOC_LOGE ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); break; } @@ -1638,6 +1826,7 @@ locClientStatusEnumType locClientOpen ( if(eLOC_CLIENT_SUCCESS != status) { *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); } return(status); @@ -1684,7 +1873,7 @@ locClientStatusEnumType locClientClose( return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); } - LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", + LOC_LOGV("locClientClose releasing handle %p, user handle %p\n", *pLocClientHandle, pCallbackData->userHandle ); // NEXT call goes out to modem. We log the callflow before it @@ -1692,6 +1881,7 @@ locClientStatusEnumType locClientClose( // back from the modem, to avoid confusing log order. We trust // that the QMI framework is robust. EXIT_LOG_CALLFLOW(%s, "loc client close"); + // release the handle rc = qmi_client_release(pCallbackData->userHandle); if(QMI_NO_ERR != rc ) @@ -1713,7 +1903,6 @@ locClientStatusEnumType locClientClose( // set the handle to invalid value *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - return eLOC_CLIENT_SUCCESS; } @@ -1779,7 +1968,6 @@ locClientStatusEnumType locClientSendReq( // back from the modem, to avoid confusing log order. We trust // that the QMI framework is robust. EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); - rc = qmi_client_send_msg_sync( pCallbackData->userHandle, reqId, @@ -1801,6 +1989,17 @@ locClientStatusEnumType locClientSendReq( // map the QCCI response to Loc API v02 status status = convertQmiResponseToLocStatus(&resp); + // if the request is to change registered events, update the + // loc api copy of that + if(eLOC_CLIENT_SUCCESS == status && + QMI_LOC_REG_EVENTS_REQ_V02 == reqId) + { + if(NULL != reqPayload.pRegEventsReq ) + { + pCallbackData->eventRegMask = + (locClientEventMaskType)(reqPayload.pRegEventsReq->eventRegMask); + } + } return(status); } diff --git a/loc_api/loc_api_v02/loc_api_v02_client.h b/loc_api/loc_api_v02/loc_api_v02_client.h old mode 100755 new mode 100644 index 2807ad47..0ce7a2e8 --- a/loc_api/loc_api_v02/loc_api_v02_client.h +++ b/loc_api/loc_api_v02/loc_api_v02_client.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -112,9 +112,12 @@ typedef enum eLOC_CLIENT_FAILURE_INTERNAL = 11, /**< Failed because of an internal error in the service. */ - eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12, /**< Failed because the service has not been initialized. */ + eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 + /**< Failed because not rnough memory to do the operation.*/ + }locClientStatusEnumType; /** Loc Client error values @@ -154,6 +157,8 @@ typedef enum - GetOperationMode - GetCradleMountConfig - GetExternalPowerConfig + - GetSensorControlConfig + - GetSensorPerformanceControlConfiguration */ typedef union { @@ -451,6 +456,17 @@ typedef union QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. @newpage */ + const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; + /**< Retrieves the sensor properties from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. + @newpage */ + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; /**< Sets the sensor properties in the engine. @@ -508,6 +524,65 @@ typedef union QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. @newpage */ + const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; + /**< Adds a Circular Geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 + @newpage */ + + const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; + /**< Deletes a Geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_GEOFENCE_REQ_V02 + @newpage */ + + const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; + /**< Queries a Geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_QUERY_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_QUERY_GEOFENCE_REQ_V02 + + @newpage */ + + const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; + /**< Edits Geofence Parameters. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_EDIT_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_EDIT_GEOFENCE_REQ_V02 + + @newpage */ + + const qmiLocGetBestAvailablePositionReqMsgT_v02* + pGetBestAvailablePositionReq; + /**< Get the best available position from location engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 + + @newpage */ + }locClientReqUnionType; @@ -636,6 +711,31 @@ typedef union QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. @newpage */ + const qmiLocEventNiGeofenceNotificationIndMsgT_v02* + pNiGeofenceNotificationEvent; + /**< Sent by the engine to notify the client about changes to a + Network Initiated Geofence. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. + @newpage */ + + const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; + /**< Sent by the engine to notify the client about updates that may + affect a Geofence operation. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. + @newpage */ + + const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; + /**< Sent by the engine to notify the client about a Geofence Breach + Event. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. + @newpage */ + }locClientEventIndUnionType; @@ -951,7 +1051,43 @@ typedef union /**< Response to the request, QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 The respIndId field in the response indication callback is set to - QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; + /**< Response to the request, + QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 + @newpage */ + + const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; + /**< Response to the request, + QMI_LOC_DELETE_GEOFENCE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_GEOFENCE_IND_V02 + @newpage */ + + const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; + /**< Response to the request, + QMI_LOC_QUERY_GEOFENCE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_QUERY_GEOFENCE_IND_V02 + @newpage */ + + const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; + /**< Response to the request, + QMI_LOC_EDIT_GEOFENCE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_EDIT_GEOFENCE_IND_V02 + @newpage */ + + const qmiLocGetBestAvailablePositionIndMsgT_v02* + pGetBestAvailablePositionInd; + /**< Response to the request, + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 @newpage */ }locClientRespIndUnionType; diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c old mode 100755 new mode 100644 index 78792607..6f60ee58 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -191,6 +191,24 @@ static loc_name_val_s_type loc_v02_event_name[] = NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), }; static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); @@ -214,6 +232,7 @@ static loc_name_val_s_type loc_v02_client_status_name[] = NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY), }; static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); @@ -233,6 +252,8 @@ static loc_name_val_s_type loc_v02_qmi_status_name[] = eQMI_LOC_ENGINE_BUSY_V02, eQMI_LOC_PHONE_OFFLINE_V02, eQMI_LOC_TIMEOUT_V02, + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02, + eQMI_LOC_INSUFFICIENT_MEMORY_V02, QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 }; static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h old mode 100755 new mode 100644 index f1b675e3..4c18a229 --- a/loc_api/loc_api_v02/loc_util_log.h +++ b/loc_api/loc_api_v02/loc_util_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -24,13 +24,18 @@ * 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_UTIL_LOG_H #define LOC_UTIL_LOG_H -#ifdef FEATURE_LOC_API_V02_QNX_MOD +#if defined(_ANDROID_) +#include "loc_api_v02_log.h" +#include + +#else // no _ANDROID_ + +// common for QNX and Griffon + //error logs #define LOC_LOGE(...) printf(__VA_ARGS__) //warning logs @@ -45,22 +50,17 @@ #define MODEM_LOG_CALLFLOW(SPEC, VAL) #define EXIT_LOG_CALLFLOW(SPEC, VAL) -#endif //FEATURE_LOC_API_V02_QNX_MOD +#define loc_get_v02_event_name(X) #X +#define loc_get_v02_client_status_name(X) #X +#define loc_get_v02_qmi_status_name(X) #X + +//specific to OFF TARGET #ifdef LOC_UTIL_TARGET_OFF_TARGET #include - -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) +# include +# include // get around strl*: not found in glibc // TBD:look for presence of eglibc other libraries @@ -68,14 +68,8 @@ #define strlcpy(X,Y,Z) strcpy(X,Y) #define strlcat(X,Y,Z) strcat(X,Y) -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#elif defined(_ANDROID_) - -#include - #endif //LOC_UTIL_TARGET_OFF_TARGET +#endif //_ANDROID_ #endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c old mode 100755 new mode 100644 index 37d93f6f..ebd1a376 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -26,6 +26,15 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + + L O C A T I O N _ S E R V I C E _ V 0 2 . C + +GENERAL DESCRIPTION + This is the file which defines the loc service Data structures. + +*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + #include "stdint.h" #include "qmi_idl_lib_internal.h" #include "location_service_v02.h" @@ -33,6 +42,25 @@ /*Type Definitions*/ +static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), + QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), + QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), + QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { QMI_IDL_GENERIC_2_BYTE, QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), @@ -116,7 +144,7 @@ static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), @@ -131,7 +159,7 @@ static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), @@ -169,7 +197,7 @@ static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { }; static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), QMI_LOC_IPV6_ADDR_LENGTH_V02, @@ -185,11 +213,11 @@ static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 7, 0, + 8, 0, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 8, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + 9, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, @@ -202,12 +230,12 @@ static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 9, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + 10, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), QMI_LOC_NI_SUPL_HASH_LENGTH_V02, @@ -219,13 +247,13 @@ static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 5, 0, + 6, 0, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 5, 0, + 6, 0, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 6, 0, + 7, 0, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), @@ -236,7 +264,7 @@ static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), @@ -254,12 +282,12 @@ static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), @@ -269,10 +297,10 @@ static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 11, 0, + 12, 0, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 11, 0, + 12, 0, QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), @@ -285,7 +313,7 @@ static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 4, 0, + 5, 0, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), @@ -293,7 +321,7 @@ static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { }; static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, @@ -304,11 +332,11 @@ static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), QMI_LOC_MAX_NTP_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 14, 0, + 15, 0, QMI_IDL_FLAG_END_VALUE }; @@ -323,11 +351,11 @@ static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { }; static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 14, 0, + 15, 0, QMI_IDL_FLAG_END_VALUE }; @@ -347,7 +375,59 @@ static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 18, 0, + 19, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), + QMI_IDL_FLAG_END_VALUE }; @@ -414,7 +494,7 @@ static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { }; static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, @@ -453,11 +533,11 @@ static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 26, 0, + 28, 0, QMI_IDL_FLAG_END_VALUE }; @@ -465,13 +545,39 @@ static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), QMI_LOC_MAX_APN_NAME_LENGTH_V02, QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + /*Message Definitions*/ static const uint8_t qmiLocGenRespMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, @@ -512,10 +618,16 @@ static const uint8_t qmiLocStartReqMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), + 0, 0 }; static const uint8_t qmiLocStopReqMsgT_data_v02[] = { @@ -637,7 +749,7 @@ static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { 0x24, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 1, 0, + 2, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), 0x25, @@ -653,7 +765,7 @@ static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { 0x27, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 0, 0, + 1, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), 0x28, @@ -669,12 +781,19 @@ static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { 0x2A, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 2, 0, + 3, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), 0x2B, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + 0x2C, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) }; static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { @@ -684,16 +803,16 @@ static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 3, 0 + 4, 0 }; static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 }; @@ -707,25 +826,31 @@ static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 4, 0, + 5, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), 0x11, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 10, 0, + 11, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 12, 0, + 13, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), 0x13, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 13, 0 + 14, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), + 32, 0 }; static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { @@ -733,20 +858,20 @@ static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 15, 0 + 16, 0 }; static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 16, 0, + 17, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 17, 0 + 18, 0 }; static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { @@ -800,13 +925,13 @@ static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 19, 0 + 20, 0 }; static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { @@ -835,6 +960,38 @@ static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) }; +static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) +}; + +static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) +}; + +static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), + 21, 0 +}; + /* * qmiLocGetServiceRevisionReqMsgT is empty * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { @@ -846,9 +1003,27 @@ static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + 0x02, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), + QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), + QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, + QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), + QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 }; /* @@ -872,10 +1047,16 @@ static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), 0x12, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), + 0, 0 }; static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { @@ -891,25 +1072,31 @@ static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 4, 0, + 5, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), 0x11, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 10, 0, + 11, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 12, 0, + 13, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), 0x13, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 13, 0 + 14, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), + 32, 0 }; static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { @@ -969,13 +1156,13 @@ static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 16, 0, + 17, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 17, 0 + 18, 0 }; /* @@ -993,7 +1180,7 @@ static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 20, 0 + 22, 0 }; static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { @@ -1067,7 +1254,7 @@ static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { 0x1A, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 21, 0, + 23, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), 0x1B, @@ -1216,17 +1403,17 @@ static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 7, 0, + 8, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 8, 0, + 9, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 }; @@ -1261,17 +1448,17 @@ static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 7, 0, + 8, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 8, 0, + 9, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 }; @@ -1283,11 +1470,11 @@ static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 22, 0, + 24, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), 0x11, @@ -1345,21 +1532,21 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 23, 0, + 25, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 24, 0, + 26, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 25, 0, + 27, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), 0x13, @@ -1458,13 +1645,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 27, 0, + 29, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 27, 0 + 29, 0 }; static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { @@ -1593,7 +1780,7 @@ static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 28, 0 + 30, 0 }; static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { @@ -1613,10 +1800,15 @@ static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), 0x12, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) }; static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { @@ -1651,10 +1843,15 @@ static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), 0x12, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) }; static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { @@ -1688,33 +1885,78 @@ static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { }; static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), 0x10, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) }; static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + 0x01, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) }; -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - * }; - */ +static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) +}; static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), 0x10, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) }; static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { @@ -1727,13 +1969,18 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 18, 0, + 19, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 18, 0 + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) }; static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { @@ -1767,13 +2014,18 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 18, 0, + 19, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 18, 0 + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) }; static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { @@ -1862,8 +2114,335 @@ static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) }; +static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), + 31, 0, + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), + + 0x04, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) +}; + +static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) +}; + +static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), + 31, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) +}; + +static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) +}; + +static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) +}; + +static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), + 0x21, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), + 0x24, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), + 0x25, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), + 0x26, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), + 0x27, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), + 0x29, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), + 0x2C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), + 0x2D, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) +}; + /* Type Table */ static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, @@ -1884,6 +2463,7 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, @@ -1892,7 +2472,9 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, + {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02} }; /* Message Table */ @@ -1916,6 +2498,9 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, {0, 0}, {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, {0, 0}, @@ -1994,7 +2579,7 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {0, 0}, + {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, @@ -2007,7 +2592,17 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02} }; /* Predefine the Type Table Object */ @@ -2031,54 +2626,59 @@ static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1086}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 1425}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 25}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 28}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { @@ -2131,14 +2731,19 @@ static const qmi_idl_service_message_table_entry loc_service_response_messages_v {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7} }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1079}, {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, @@ -2149,65 +2754,75 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 22}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 32}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 35}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, + {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, + {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, + {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391} }; /*Service Object*/ -const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { +struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x05, 0x02, - 0x02, - 16, + 0x10, 2248, { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02 + &loc_qmi_idl_type_table_object_v02, + 0x0B, + NULL }; /* Service Object Accessor */ diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h old mode 100755 new mode 100644 index 2f288145..c3d67702 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -82,11 +82,11 @@ extern "C" { /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x04 +#define LOC_V02_IDL_MINOR_VERS 0x0B /** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x02 +#define LOC_V02_IDL_TOOL_VERS 0x05 /** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x005F; +#define LOC_V02_MAX_MESSAGE_ID 0x0067; /** @} */ @@ -96,6 +96,19 @@ extern "C" { @{ */ +/** Maximum string length for the Provider field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 + +/** Maximum string length for the Name field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 + +/** Maximum string length for the Version field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 + +/** Maximum length of the list containing the SVs that were used to generate + a position report. */ +#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 + /** Maximum number of satellites in the satellite report. */ #define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 @@ -133,6 +146,15 @@ extern "C" { engine. */ #define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 +/** Maximum GNSS Measurement Engine Firmware Version String length. */ +#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ +#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Full Version String length. */ +#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 + /** Maximum part length that can be injected. The client should also look at the maxPartSize field in the predicted orbits injection request indication and pick the minimum of the two. */ @@ -156,7 +178,7 @@ extern "C" { /** Maximum APN profiles supported. */ #define QMI_LOC_MAX_APN_PROFILES_V02 6 -/** Maximum length of SUPL CERT. */ +/** Maximum length of the SUPL certificate. */ #define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 /** @} @@ -188,45 +210,54 @@ typedef struct { /* Mandatory */ /* Revision */ uint32_t revision; - /**< Revision that the control point is using. \n - - Type: Unsigned integer */ + /**< Revision that the control point is using. */ }qmiLocInformClientRevisionReqMsgT_v02; /* Message */ /** @} */ typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyrometer, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from - the GPS engine. Time sync enables the GPS engine to synchronize + sensors (accelerometer, gyroscope, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. - These requests are generated when the service wishes to establish a - connection with a location server. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. */ +#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. */ /** @addtogroup loc_qmi_messages @{ */ @@ -238,23 +269,26 @@ typedef struct { /* Event Registration Mask */ qmiLocEventRegMaskT_v02 eventRegMask; /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: \n - - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - + Refer to the definition of the following bitmasks: + \vspace{0.05in} \begin{itemize1} + \item 0x00000001 -- POSITION_REPORT + \item 0x00000002 -- GNSS_SV_INFO + \item 0x00000004 -- NMEA + \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ + \item 0x00000010 -- INJECT_TIME_REQ + \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ + \item 0x00000040 -- INJECT_POSITION_REQ + \item 0x00000080 -- ENGINE_STATE + \item 0x00000100 -- FIX_SESSION_STATE + \item 0x00000200 -- WIFI_REQ + \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS + \item 0x00000800 -- TIME_SYNC_REQ + \item 0x00001000 -- SET_SPI_STREAMING_REPORT + \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + \item 0x00004000 -- NI_GEOFENCE_NOTIFICATION + \item 0x00008000 -- GEOFENCE_GEN_ALERT + \item 0x00010000 -- GEOFENCE_BREACH_NOTIFICATION + \end{itemize1} \vspace{0.05in} Multiple events can be registered by ORing the individual masks and sending them in this TLV. All unused bits in this mask must be set to 0. */ @@ -306,6 +340,31 @@ typedef enum { @} */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; + /**< Application provider. */ + + char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; + /**< Application name. */ + + uint8_t applicationVersion_valid; + /**< Specifies whether the application version string contains a valid value: + \begin{itemize1} + \item 0x00 (FALSE) -- Application version string is invalid + \item 0x01 (TRUE) -- Application version string is valid + \vspace{-0.18in} \end{itemize1} */ + + char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; + /**< Application version. */ +}qmiLocApplicationIdStructT_v02; /* Type */ +/** + @} + */ + /** @addtogroup loc_qmi_messages @{ */ @@ -319,7 +378,6 @@ typedef struct { /**< ID of the session as identified by the control point. The session ID is reported back in the position reports. The control point must specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Type: Unsigned integer \n - Range: 0 to 255 */ @@ -342,10 +400,13 @@ typedef struct { /**< Specifies the horizontal accuracy level required by the control point. If not specified, accuracy defaults to LOW. - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n - - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + Valid values: + \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} + \end{itemize1} */ /* Optional */ @@ -361,9 +422,14 @@ typedef struct { report is set to IN_PROGRESS in order for the control point to identify intermediate reports. - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + Valid values: + \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} + \end{itemize1} */ /* Optional */ @@ -372,10 +438,15 @@ typedef struct { uint32_t minInterval; /**< Minimum time interval, specified by the control point, that must elapse between position reports. \n - - Type: Unsigned integer \n - Units: Milliseconds \n - Default: 1000 ms */ + + /* Optional */ + /* ID of the Application that Sent this Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version. */ }qmiLocStartReqMsgT_v02; /* Message */ /** @} @@ -393,7 +464,6 @@ typedef struct { uint8_t sessionId; /**< ID of the session that was specified in the Start request (QMI_LOC_START_REQ).\n - - Type: Unsigned integer \n - Range: 0 to 255 */ }qmiLocStopReqMsgT_v02; /* Message */ /** @@ -404,6 +474,8 @@ typedef uint32_t qmiLocPosTechMaskT_v02; #define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ /** @addtogroup loc_qmi_enums @{ */ @@ -433,12 +505,10 @@ typedef struct { uint16_t gpsWeek; /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Type: Unsigned integer \n - Units: Weeks */ uint32_t gpsTimeOfWeekMs; /**< Amount of time into the current GPS week. \n - - Type: Unsigned integer \n - Units: Milliseconds */ }qmiLocGPSTimeStructT_v02; /* Type */ /** @@ -451,20 +521,23 @@ typedef struct { typedef struct { float PDOP; - /**< Position dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n - - PDOP = square root of (HDOP^2 + VDOP^2) */ + /**< Position dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \item PDOP = square root of (HDOP^2 + VDOP^2) + \vspace{-0.18in} \end{itemize1} */ float HDOP; - /**< Horizontal dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + /**< Horizontal dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ float VDOP; - /**< Vertical dilution of precision.\n - - Type: Floating point. \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + /**< Vertical dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ }qmiLocDOPStructT_v02; /* Type */ /** @} @@ -472,7 +545,7 @@ typedef struct { typedef uint32_t qmiLocSensorUsageMaskT_v02; #define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ typedef uint32_t qmiLocSensorAidedMaskT_v02; #define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ #define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ @@ -484,16 +557,19 @@ typedef uint32_t qmiLocSensorAidedMaskT_v02; typedef struct { qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors are used. + /**< Specifies which sensors were used in calculating the position in the + position report. - Valid bitmasks are specified by the following constants: \n - - 0x00000001 -- SENSOR_USED_ACCEL \n - - 0x00000002 -- SENSOR_USED_GYRO */ + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- SENSOR_USED_ACCEL + \item 0x00000002 -- SENSOR_USED_GYRO + \vspace{-0.18in} \end{itemize1} */ qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results are aided by sensors. + /**< Specifies which results were aided by sensors. - Valid bitmasks are specified by the following constants: \n + Valid bitmasks: \n - 0x00000001 -- AIDED_HEADING \n - 0x00000002 -- AIDED_SPEED \n - 0x00000004 -- AIDED_POSITION \n @@ -562,15 +638,17 @@ typedef struct { qmiLocSessionStatusEnumT_v02 sessionStatus; /**< Session status. - Valid values: \n - - 0x00000000 -- SESS_STATUS_SUCCESS \n - - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n - - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n - - 0x00000003 -- SESS_STATUS_TIMEOUT \n - - 0x00000004 -- SESS_STATUS_USER_END \n - - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n - - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n - - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + Valid values: + \begin{itemize1} + \item 0x00000000 -- SESS_STATUS_SUCCESS + \item 0x00000001 -- SESS_STATUS_IN_PROGRESS + \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE + \item 0x00000003 -- SESS_STATUS_TIMEOUT + \item 0x00000004 -- SESS_STATUS_USER_END + \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER + \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE + \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ @@ -578,37 +656,39 @@ typedef struct { uint8_t sessionId; /**< ID of the session that was specified in the Start request QMI_LOC_START_REQ. \n - - Type: Unsigned integer \n - Range: 0 to 255 */ /* Optional */ /* Latitude */ uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ double latitude; - /**< Latitude (specified in WGS84 datum). \n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Longitude */ uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Circular Horizontal Position Uncertainty */ uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -616,7 +696,6 @@ typedef struct { uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ float horUncEllipseSemiMinor; /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -624,7 +703,6 @@ typedef struct { uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ float horUncEllipseSemiMajor; /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -632,7 +710,6 @@ typedef struct { uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ float horUncEllipseOrientAzimuth; /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Type: Floating point \n - Units: Decimal degrees \n - Range: 0 to 180 */ @@ -641,7 +718,6 @@ typedef struct { uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ uint8_t horConfidence; /**< Horizontal uncertainty confidence.\n - - Type: Unsigned integer \n - Units: Percent \n - Range: 0 to 99 */ @@ -649,14 +725,15 @@ typedef struct { /* Horizontal Reliability */ uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH + /**< Specifies the reliability of the horizontal position. \n + Valid values: + \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -664,15 +741,13 @@ typedef struct { uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ float speedHorizontal; /**< Horizontal speed.\n - - Type: Floating point \n - Units: Meters/second */ /* Optional */ /* Speed Uncertainty */ uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ float speedUnc; - /**< Speed uncertainty.\n - - Type: Floating point \n + /**< 3-D Speed uncertainty.\n - Units: Meters/second */ /* Optional */ @@ -680,7 +755,6 @@ typedef struct { uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ float altitudeWrtEllipsoid; /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - Units: Meters \n - Range: -500 to 15883 */ @@ -689,7 +763,6 @@ typedef struct { uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ float altitudeWrtMeanSeaLevel; /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -697,7 +770,6 @@ typedef struct { uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ float vertUnc; /**< Vertical uncertainty.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -705,7 +777,6 @@ typedef struct { uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ uint8_t vertConfidence; /**< Vertical uncertainty confidence.\n - - Type: Unsigned integer \n - Units: Percent \n - Range: 0 to 99 */ @@ -713,21 +784,21 @@ typedef struct { /* Vertical Reliability */ uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH */ + /**< Specifies the reliability of the vertical position. \n + Valid values: + \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Vertical Speed */ uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ float speedVertical; /**< Vertical speed.\n - - Type: Floating point \n - Units: Meters/second */ /* Optional */ @@ -735,7 +806,6 @@ typedef struct { uint8_t heading_valid; /**< Must be set to true if heading is being passed */ float heading; /**< Heading.\n - - Type: Floating point \n - Units: Degrees \n - Range: 0 to 359.999 */ @@ -744,7 +814,6 @@ typedef struct { uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ float headingUnc; /**< Heading uncertainty.\n - - Type: Floating point \n - Units: Degrees \n - Range: 0 to 359.999 */ @@ -754,8 +823,7 @@ typedef struct { float magneticDeviation; /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. \n - - Type: Floating point */ + north is east of true north. */ /* Optional */ /* Technology Used */ @@ -765,8 +833,10 @@ typedef struct { Valid bitmasks: \n - 0x00000001 -- SATELLITE \n - - 0x00000002 -- CELLID \n - - 0x00000004 -- WIFI */ + - 0x00000002 -- CELLID \n + - 0x00000004 -- WIFI \n + - 0x00000008 -- SENSORS \n + - 0x00000010 -- REFERENCE_LOCATION */ /* Optional */ /* Dilution of Precision */ @@ -779,7 +849,6 @@ typedef struct { uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ uint64_t timestampUtc; /**< UTC timestamp. \n - - Type: Unsigned integer \n - Units: Milliseconds since Jan. 1, 1970 */ /* Optional */ @@ -789,11 +858,10 @@ typedef struct { /**< Leap second information. If leapSeconds is not available, timestampUtc is calculated based on a hard-coded value for leap seconds. \n - - Type: Unsigned integer \n - Units: Seconds */ /* Optional */ - /* GPS Time \n */ + /* GPS Time */ uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ qmiLocGPSTimeStructT_v02 gpsTime; /**< \n The number of weeks since Jan. 5, 1980, and @@ -804,7 +872,6 @@ typedef struct { uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ float timeUnc; /**< Time uncertainty. \n - - Type: Floating point \n - Units: Milliseconds */ /* Optional */ @@ -813,16 +880,18 @@ typedef struct { qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. - Valid values: \n - - 0x00000000 -- TIME_SRC_INVALID \n - - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n - - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n - - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n - - 0x00000004 -- TIME_SRC_TOW_DECODE \n - - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n - - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n - - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n - - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ + Valid values: + \begin{itemize1} + \item 0x00000000 -- TIME_SRC_INVALID + \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER + \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING + \item 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT + \item 0x00000004 -- TIME_SRC_TOW_DECODE + \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED + \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED + \item 0x00000007 -- TIME_SRC_NAV_SOLUTION + \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Sensor Data Usage */ @@ -837,6 +906,21 @@ typedef struct { uint32_t fixId; /**< Fix count for the session. Starts with 0 and increments by one for each successive position report for a particular session. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ }qmiLocEventPositionReportIndMsgT_v02; /* Message */ /** @} @@ -894,42 +978,46 @@ typedef struct { qmiLocSvInfoValidMaskT_v02 validMask; /**< Bitmask indicating which of the fields in this TLV are valid. - Valid bitmasks: \n - - 0x00000001 -- VALID_SYSTEM \n - - 0x00000002 -- VALID_GNSS_SVID \n - - 0x00000004 -- VALID_HEALTH_STATUS \n - - 0x00000008 -- VALID_PROCESS_STATUS \n - - 0x00000010 -- VALID_SVINFO_MASK \n - - 0x00000020 -- VALID_ELEVATION \n - - 0x00000040 -- VALID_AZIMUTH \n - - 0x00000080 -- VALID_SNR - - */ + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- VALID_SYSTEM + \item 0x00000002 -- VALID_GNSS_SVID + \item 0x00000004 -- VALID_HEALTH_STATUS + \item 0x00000008 -- VALID_PROCESS_STATUS + \item 0x00000010 -- VALID_SVINFO_MASK + \item 0x00000020 -- VALID_ELEVATION + \item 0x00000040 -- VALID_AZIMUTH + \item 0x00000080 -- VALID_SNR + \vspace{-0.18in} \end{itemize1} */ qmiLocSvSystemEnumT_v02 system; /**< Indicates to which constellation this SV belongs. - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - */ + Valid values: + \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} */ uint16_t gnssSvId; - /**< GNSS SV ID. \n + /**< GNSS SV ID. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For GLONASS: 1 to 32 + \item For SBAS: 120 to 151 + \end{itemize1} \end{itemize1} - - Type: Unsigned integer \n - - Range: \n - -- For GPS: 1 to 32 \n - -- For SBAS: 33 to 64 \n - -- For GLONASS: 65 to 96 */ + The GPS and GLONASS SVs can be disambiguated using the system field. */ uint8_t healthStatus; - /**< Health status. \n - - Type: Unsigned integer \n - - Range: 0 = unhealthy; 1 = healthy */ + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy + \vspace{-0.18in} \end{itemize1} */ qmiLocSvStatusEnumT_v02 svStatus; /**< SV processing status. \n @@ -948,19 +1036,16 @@ typedef struct { float elevation; /**< SV elevation angle.\n - - Type: Floating point \n - Units: Degrees \n - Range: 0 to 90 */ float azimuth; /**< SV azimuth angle.\n - - Type: Floating point \n - Units: Degrees \n - Range: 0 to 360 */ float snr; /**< SV signal-to-noise ratio. \n - - Type: Floating point \n - Units: dB-Hz */ }qmiLocSvInfoStructT_v02; /* Type */ /** @@ -976,10 +1061,12 @@ typedef struct { /* Mandatory */ /* Altitude Source */ uint8_t altitudeAssumed; - /**< Altitude assumed or calculated:\n - - 0x00 (FALSE) -- Valid altitude is calculated \n - - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough - satellites to determine precise altitude */ + /**< Whether altitude is assumed or calculated: + \begin{itemize1} + \item 0x00 (FALSE) -- Valid altitude is calculated + \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be + enough satellites to determine precise altitude + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Satellite Info */ @@ -1001,9 +1088,11 @@ typedef struct { /* Mandatory */ /* NMEA String */ char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 201 */ + /**< NMEA string. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 201 + \vspace{-0.18in} \end{itemize1} */ }qmiLocEventNmeaIndMsgT_v02; /* Message */ /** @} @@ -1076,43 +1165,44 @@ typedef struct { uint8_t posQos; /**< Position QoS timeout. \n - - Type: Unsigned integer \n - Units: Seconds \n - Range: 0 to 255 */ uint32_t numFixes; - /**< Number of fixes allowed. \n - - Type: Unsigned integer */ + /**< Number of fixes allowed. */ uint32_t timeBetweenFixes; /**< Time between fixes.\n - - Type: Unsigned integer \n - Units: Seconds */ qmiLocNiVxPosModeEnumT_v02 posMode; /**< Position mode. - Valid values: \n - - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n - - 0x00000002 -- NI_VX_MS_BASED_ONLY \n - - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n - - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + Valid values: + \begin{itemize1} + \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY + \item 0x00000002 -- NI_VX_MS_BASED_ONLY + \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED + \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + \vspace{-0.18in} \end{itemize1} */ qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; /**< VX encoding scheme. - Valid values: \n - - 0x00000000 -- NI_VX_OCTET \n - - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n - - 0x00000002 -- NI_VX_ASCII \n - - 0x00000003 -- NI_VX_IA5 \n - - 0x00000004 -- NI_VX_UNICODE \n - - 0x00000005 -- NI_VX_SHIFT_JIS \n - - 0x00000006 -- NI_VX_KOREAN \n - - 0x00000007 -- NI_VX_LATIN_HEBREW \n - - 0x00000008 -- NI_VX_LATIN \n - - 0x00000009 -- NI_VX_GSM + Valid values: + \begin{itemize1} + \item 0x00000000 -- NI_VX_OCTET + \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG + \item 0x00000002 -- NI_VX_ASCII + \item 0x00000003 -- NI_VX_IA5 + \item 0x00000004 -- NI_VX_UNICODE + \item 0x00000005 -- NI_VX_SHIFT_JIS + \item 0x00000006 -- NI_VX_KOREAN + \item 0x00000007 -- NI_VX_LATIN_HEBREW + \item 0x00000008 -- NI_VX_LATIN + \item 0x00000009 -- NI_VX_GSM + \vspace{-0.18in} \end{itemize1} */ uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ @@ -1124,7 +1214,6 @@ typedef struct { uint16_t userRespTimerInSeconds; /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - Units: Seconds */ }qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ /** @@ -1213,16 +1302,18 @@ typedef struct { qmiLocNiSuplFormatEnumType_v02 formatType; /**< Format of the formatted string. - Valid values: \n - - 0x00000000 -- FORMAT_LOGICAL_NAME \n - - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n - - 0x00000002 -- FORMAT_MSISDN \n - - 0x00000003 -- FORMAT_URL \n - - 0x00000004 -- FORMAT_SIP_URL \n - - 0x00000005 -- FORMAT_MIN \n - - 0x00000006 -- FORMAT_MDN \n - - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n - - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + Valid values: + \begin{itemize1} + \item 0x00000000 -- FORMAT_LOGICAL_NAME + \item 0x00000001 -- FORMAT_EMAIL_ADDRESS + \item 0x00000002 -- FORMAT_MSISDN + \item 0x00000003 -- FORMAT_URL + \item 0x00000004 -- FORMAT_SIP_URL + \item 0x00000005 -- FORMAT_MIN + \item 0x00000006 -- FORMAT_MDN + \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY + \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ @@ -1257,23 +1348,19 @@ typedef struct { uint8_t horizontalAccuracy; /**< Horizontal accuracy. \n - - Type: Unsigned integer \n - Units: Meters */ uint8_t verticalAccuracy; /**< Vertical accuracy. \n - - Type: Unsigned integer \n - Units: Meters */ uint16_t maxLocAge; /**< Maximum age of the location if the engine sends a previously computed position. \n - - Type: Unsigned integer \n - Units: Seconds */ uint8_t delay; /**< Delay the server is willing to tolerate for the fix. \n - - Type: Unsigned integer \n - Units: Seconds */ }qmiLocNiSuplQopStructT_v02; /* Type */ /** @@ -1290,12 +1377,10 @@ typedef uint8_t qmiLocServerAddrTypeMaskT_v02; typedef struct { uint32_t addr; - /**< IPV4 address. \n - - Type: Unsigned integer */ + /**< IPV4 address. */ uint16_t port; - /**< IPV4 port. \n - - Type: Unsigned integer */ + /**< IPV4 port. */ }qmiLocIpV4AddrStructType_v02; /* Type */ /** @} @@ -1312,8 +1397,7 @@ typedef struct { - Maximum length of the array: 8 */ uint32_t port; - /**< IPV6 port. \n - - Type: Unsigned integer */ + /**< IPV6 port. */ }qmiLocIpV6AddrStructType_v02; /* Type */ /** @} @@ -1340,9 +1424,11 @@ typedef struct { /**< IPV6 address and port. */ char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ }qmiLocNiSuplServerInfoStructT_v02; /* Type */ /** @@ -1393,16 +1479,18 @@ typedef struct { qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; /**< Indicates which of the following fields are present in this value. - Valid bitmasks: \n - - 0x00000001 -- SUPL_SERVER_INFO \n - - 0x00000002 -- SUPL_SESSION_ID \n - - 0x00000004 -- SUPL_HASH \n - - 0x00000008 -- SUPL_POS_METHOD \n - - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n - - 0x00000020 -- SUPL_REQUESTOR_ID \n - - 0x00000040 -- SUPL_CLIENT_NAME \n - - 0x00000080 -- SUPL_QOP \n - - 0x00000100 -- SUPL_USER_RESP_TIMER + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- SUPL_SERVER_INFO + \item 0x00000002 -- SUPL_SESSION_ID + \item 0x00000004 -- SUPL_HASH + \item 0x00000008 -- SUPL_POS_METHOD + \item 0x00000010 -- SUPL_DATA_CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ID + \item 0x00000040 -- SUPL_CLIENT_NAME + \item 0x00000080 -- SUPL_QOP + \item 0x00000100 -- SUPL_USER_RESP_TIMER + \vspace{-0.18in} \end{itemize1} */ qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; @@ -1422,43 +1510,47 @@ typedef struct { qmiLocNiSuplPosMethodEnumT_v02 posMethod; /**< GPS mode to be used for the fix. - Valid values: \n - - 0x00000001 -- AGPS_SETASSISTED \n - - 0x00000002 -- AGPS_SETBASED \n - - 0x00000003 -- AGPS_SETASSISTED_PREF \n - - 0x00000004 -- AGPS_SETBASED_PREF \n - - 0x00000005 -- AUTONOMOUS_GPS \n - - 0x00000006 -- AFLT \n - - 0x00000007 -- ECID \n - - 0x00000008 -- EOTD \n - - 0x00000009 -- OTDOA \n - - 0x0000000A -- NO_POSITION + Valid values: + \begin{itemize1} + \item 0x00000001 -- AGPS_SETASSISTED + \item 0x00000002 -- AGPS_SETBASED + \item 0x00000003 -- AGPS_SETASSISTED_PREF + \item 0x00000004 -- AGPS_SETBASED_PREF + \item 0x00000005 -- AUTONOMOUS_GPS + \item 0x00000006 -- AFLT + \item 0x00000007 -- ECID + \item 0x00000008 -- EOTD + \item 0x00000009 -- OTDOA + \item 0x0000000A -- NO_POSITION + \vspace{-0.18in} \end{itemize1} */ qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Data coding scheme applies to both the requestor ID and the client name. - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT + Valid values: + \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} */ qmiLocNiSuplFormattedStringStructT_v02 requestorId; @@ -1474,7 +1566,6 @@ typedef struct { uint16_t userResponseTimer; /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - Units: Seconds */ }qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ /** @@ -1504,26 +1595,28 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Identifies the coding scheme of the coded string. - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT + Valid values: + \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} */ @@ -1582,46 +1675,49 @@ typedef struct { qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; /**< Fields that are valid in this value. - Valid bitmasks: \n - - 0x0001 -- INVOKE_ID_MASK \n - - 0x0002 -- DATA_CODING_SCHEME_MASK \n - - 0x0004 -- NOTIFICATION_TEXT_MASK \n - - 0x0008 -- CLIENT_ADDRESS_MASK \n - - 0x0010 -- LOCATION_TYPE_MASK \n - - 0x0020 -- REQUESTOR_ID_MASK \n - - 0x0040 -- CODEWORD_STRING_MASK \n - - 0x0080 -- SERVICE_TYPE_MASK \n - - 0x0100 -- USER_RESP_TIMER_MASK + Valid bitmasks: + \begin{itemize1} + \item 0x0001 -- INVOKE_ID_MASK + \item 0x0002 -- DATA_CODING_SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_MASK + \item 0x0008 -- CLIENT_ADDRESS_MASK + \item 0x0010 -- LOCATION_TYPE_MASK + \item 0x0020 -- REQUESTOR_ID_MASK + \item 0x0040 -- CODEWORD_STRING_MASK + \item 0x0080 -- SERVICE_TYPE_MASK + \item 0x0100 -- USER_RESP_TIMER_MASK + \vspace{-0.18in} \end{itemize1} */ uint8_t invokeId; - /**< Supplementary Services invoke ID. \n - - Type: Unsigned integer */ + /**< Supplementary Services invoke ID. */ qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Type of data encoding scheme for the text. Applies to both the notification text and the client address. - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT + Valid values: + \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} */ uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ @@ -1640,10 +1736,12 @@ typedef struct { qmiLocNiLocationTypeEnumT_v02 locationType; /**< Location type. - Valid values: \n - - 0x00000001 -- CURRENT_LOCATION \n - - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n - - 0x00000004 -- INITIAL_LOCATION + Valid values: + \begin{itemize1} + \item 0x00000001 -- CURRENT_LOCATION + \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION + \item 0x00000004 -- INITIAL_LOCATION + \vspace{-0.18in} \end{itemize1} */ qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; @@ -1655,12 +1753,10 @@ typedef struct { qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ uint8_t lcsServiceTypeId; - /**< Service type ID. \n - - Type: Unsigned integer */ + /**< Service type ID. */ uint16_t userResponseTimer; /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - Units: Seconds */ }qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ /** @@ -1690,14 +1786,115 @@ typedef struct { qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - Valid values: \n - - 0x00000001 -- ONGOING_NI_INCOMING_MO + Valid values: + \begin{itemize1} + \item 0x00000001 -- ONGOING_NI_INCOMING_MO + \vspace{-0.18in} \end{itemize1} */ }qmiLocNiVxServiceInteractionStructT_v02; /* Type */ /** @} */ +typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID + and multiple location IDs in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of + multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed + as part of multiple location ID in the SUPL_POS_INIT message. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + triggered session. + The SUPL INIT message indicates a request for an area event + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; + /**< Specifies which type of network measurements are allowed to be sent as + part of the Location ID or Multiple Location IDs parameter in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid bitmasks: + \begin{itemize1} + \item 0x0001 -- SUPPORTED_NETWORK_WLAN + \item 0x0002 -- SUPPORTED_NETWORK_GSM + \item 0x0004 -- SUPPORTED_NETWORK_WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_CDMA + \item 0x0010 -- SUPPORTED_NETWORK_HRDP + \item 0x0020 -- SUPPORTED_NETWORK_UMB + \item 0x0040 -- SUPPORTED_NETWORK_LTE + \item 0x0080 -- SUPPORTED_NETWORK_WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; + /**< Specifies the type of session trigger requested in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid values: + \begin{itemize1} + \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT + \item 0x00000000 -- TRIGGER_TYPE_PERIODIC + \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT + \vspace{-0.18in} \end{itemize1} */ + + qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; + /**< Specifies which GNSS technologies are allowed as positioning + technologies. + + Valid bitmasks: \n + - 0x0001 -- GNSS_GPS \n + - 0x0002 -- GNSS_GLONASS \n + - 0x0004 -- GNSS_GALILEO \n + - 0x0008 -- GNSS_SBAS \n + - 0x0010 -- GNSS_QZSS \n + - 0x0020 -- GNSS_MODERN_GPS + */ +}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ +/** + @} + */ + /** @addtogroup loc_qmi_messages @{ */ @@ -1709,12 +1906,14 @@ typedef struct { qmiLocNiNotifyVerifyEnumT_v02 notificationType; /**< Type of notification/verification performed. - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE + Valid values: + \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIFY + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -1740,6 +1939,14 @@ typedef struct { uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; + /**< \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL + indication payload. */ }qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ /** @} @@ -1751,9 +1958,11 @@ typedef struct { typedef struct { char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 */ + /**< Assistance server URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ }qmiLocAssistanceServerUrlStructT_v02; /* Type */ /** @} @@ -1767,7 +1976,6 @@ typedef struct { uint32_t delayThreshold; /**< The time server is to be skipped if a one-way delay to the server exceeds this threshold. \n - - Type: Unsigned integer \n - Units: Milliseconds */ uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ @@ -1805,12 +2013,10 @@ typedef struct { typedef struct { uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). \n - - Type: Unsigned integer */ + /**< Maximum allowable predicted orbits file size (in bytes). */ uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). \n - - Type: Unsigned integer */ + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ }qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ /** @} @@ -1864,36 +2070,40 @@ typedef struct { /* Mandatory */ /* Latitude */ double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Mandatory */ /* Longitude */ double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Mandatory */ /* Circular Horizontal Uncertainty */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - Units: Meters */ /* Mandatory */ /* UTC Timestamp */ uint64_t timestampUtc; - /**< UTC timestamp.\n - - Type: Unsigned integer \n - - Units: Milliseconds since Jan. 1, 1970 */ + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ }qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ /** @} @@ -1970,7 +2180,6 @@ typedef struct { /**< ID of the session that was specified in the Start request. This may not be specified for a fix session corresponding to a network-initiated request. \n - - Type: Unsigned integer \n - Range: 0 to 255 */ }qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ /** @@ -2003,10 +2212,12 @@ typedef struct { qmiLocWifiRequestEnumT_v02 requestType; /**< Request type as specified in qmiWifiRequestEnumT. - Valid values: \n - - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n - - 0x00000001 -- START_PERIODIC_KEEP_WARM \n - - 0x00000002 -- STOP_PERIODIC_FIXES + Valid values: + \begin{itemize1} + \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES + \item 0x00000001 -- START_PERIODIC_KEEP_WARM + \item 0x00000002 -- STOP_PERIODIC_FIXES + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2014,7 +2225,6 @@ typedef struct { uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ uint16_t tbfInMs; /**< Time between fixes for a periodic request.\n - - Type: Unsigned integer \n - Units: Milliseconds */ }qmiLocEventWifiReqIndMsgT_v02; /* Message */ /** @@ -2056,10 +2266,13 @@ typedef struct { /**< Whether the GNSS location engine is ready to accept data from this sensor. - Valid values: \n - - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n - - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor - data + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor + data + \item 0x00 (FALSE) -- GNSS location engine is not ready to accept + sensor data + \vspace{-0.18in} \end{itemize1} */ qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; @@ -2088,10 +2301,10 @@ typedef struct { */ /* Optional */ - /* Gyrometer Accept Ready */ + /* Gyroscope Accept Ready */ uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor + /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor data. */ }qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ @@ -2112,8 +2325,7 @@ typedef struct { /**< This TLV is sent to registered control points. It is sent by the location engine when it needs to synchronize location engine and control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. \n - - Type: Unsigned integer */ + This TLV must be echoed back in the Time Sync Inject request. */ }qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ /** @} @@ -2129,9 +2341,11 @@ typedef struct { /* Mandatory */ /* Enable/Disable SPI Requests */ uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream.\n - - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n - - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ + /**< Whether the client is to start or stop sending an SPI status stream. + \begin{itemize1} + \item 0x01 (TRUE) -- Client is to start sending an SPI status stream + \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream + \vspace{-0.18in} \end{itemize1} */ }qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ /** @} @@ -2175,8 +2389,7 @@ typedef struct { /* Mandatory */ /* Connection Handle */ uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. \n - - Type: Unsigned integer */ + /**< Identifies a connection across Open and Close request events. */ /* Mandatory */ /* Request Type */ @@ -2192,15 +2405,290 @@ typedef struct { /* WWAN Type */ qmiLocWWANTypeEnumT_v02 wwanType; /**< Identifies the WWAN type for this request. \n - Valid values: \n - - 0x00000000 -- WWAN_TYPE_INTERNET \n - - 0x00000001 -- WWAN_TYPE_AGNSS + Valid values: + \begin{itemize1} + \item 0x00000000 -- WWAN_TYPE_INTERNET + \item 0x00000001 -- WWAN_TYPE_AGNSS + \vspace{-0.18in} \end{itemize1} */ }qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ /** @} */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. + An NI Geofence was edited. The control point can query the + Geofence to find the its current state. */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, + QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiGeofenceOperationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Informs the control point about + network-initiated Geofences. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Operation Type */ + qmiLocNiGeofenceOperationEnumT_v02 operationType; + /**< Operation for which this notification was generated. \n + Valid values: + \begin{itemize1} + \item 0x00000001 -- NI_GEOFENCE_ADDED + \item 0x00000002 -- NI_GEOFENCE_DELETED + \item 0x00000003 -- NI_GEOFENCE_EDITED + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can + be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage + information is available. + The engine has an invalid time. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, + QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceGenAlertEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + Geofence status. */ +typedef struct { + + /* Mandatory */ + /* Geofence General Alert */ + qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; + /**< Specifies the Geofence general alert type. \n + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE + \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE + \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS + \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. + Denotes that a client left the Geofence. */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, + QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceBreachTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Elliptical Horizontal Uncertainty Azimuth */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Horizontal Speed validity bit */ + uint8_t speedHorizontal_valid; + /**< Indicates whether the Horizontal speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Horizontal speed is valid + \item 0x00 (FALSE) -- Horizontal speed is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Horizontal Speed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Altitude validity bit */ + uint8_t altitudeWrtEllipsoid_valid; + /**< Indicates whether the altitude field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Altitude field is valid + \item 0x00 (FALSE) -- Altitude field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} + */ + + /* Altitude With Respect to Ellipsoid */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Vertical Uncertainty validity bit */ + uint8_t vertUnc_valid; + /**< Indicates whether the Vertical Uncertainty field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Uncertainty field is valid + \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Uncertainty */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Vertical Speed validity bit */ + uint8_t speedVertical_valid; + /**< Indicates whether the Vertical Speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Speed field is valid + \item 0x00 (FALSE) -- Vertical Speed field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Speed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* heading validity bit */ + uint8_t heading_valid; + /**< Indicates whether the Heading field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Heading field is valid + \item 0x00 (FALSE) -- Heading field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Heading */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ +}qmiLocGeofencePositionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of + a Geofence breach event. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< The type of breach that generated this event. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING + \item 0x00000001 -- GEOFENCE_BREACH_TYPE_LEAVING + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Geofence Position */ + uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ + qmiLocGeofencePositionStructT_v02 geofencePosition; + /**< \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ +}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ +/** + @} + */ + /** @addtogroup loc_qmi_enums @{ */ @@ -2208,12 +2696,15 @@ typedef enum { QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. - Request failed because it timed out. */ - eQMI_LOC_TIMEOUT_V02 = 6, + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ + eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested + Request failed because the engine could not allocate sufficent + memory for the request. */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocStatusEnumT_v02; /** @@ -2237,14 +2728,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Revision request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ @@ -2252,8 +2745,46 @@ typedef struct { uint32_t revision; /**< Revision of the service. This is the minor revision of the interface that the service implements. Minor revision updates of the service are always - backward compatible. \n - - Type: Unsigned integer */ + backward compatible. */ + + /* Optional */ + /* GNSS Measurement Engine Firmware Version String */ + uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ + char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS measurement engine software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in} \end{itemize1} + + \textbf{Note:} This string is only provided on platforms that have + a measurement engine that supports this version string. On all other + platforms, this optional TLV is not provided. */ + + /* Optional */ + /* GNSS Hosted Software Version String */ + uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ + char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS hosted software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in}\end{itemize1} + + \textbf{Note:} This string is only provided on hosted architectures + (measurement and position engine running on different processors) that + support this version string. On all other platforms, this optional TLV + is not provided. */ + + /* Optional */ + /* GNSS Software Version String */ + uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ + char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Aggregate version of the GNSS software. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ /** @} @@ -2276,14 +2807,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Fix Criteria request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2292,10 +2825,12 @@ typedef struct { qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; /**< Horizontal accuracy level. - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n - - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + Valid values: + \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2309,18 +2844,27 @@ typedef struct { are turned ON, the client receives position reports even if the accuracy criteria is not met. The status in the position report is set to IN_PROGRESS for intermediate reports. \n - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + Valid values: + \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} \end{itemize1} */ /* Optional */ - /* Mimimum Interval Between Fixes */ + /* Minimum Interval Between Fixes */ uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ uint32_t minInterval; /**< Time that must elapse before alerting the client. \n - - Type: Unsigned integer \n - Units: Milliseconds */ + + /* Optional */ + /* ID of the Application that Sent the Position Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version. */ }qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ /** @} @@ -2345,7 +2889,7 @@ typedef enum { @{ */ /** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ + failure is reported in a separate indication. */ typedef struct { /* Mandatory */ @@ -2353,10 +2897,12 @@ typedef struct { qmiLocNiUserRespEnumT_v02 userResp; /**< User accepted or denied. - Valid values: \n - - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n - - 0x00000002 -- NOTIFY_VERIFY_DENY \n - - 0x00000003 -- NOTIFY_VERIFY_NORESP + Valid values: + \begin{itemize1} + \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT + \item 0x00000002 -- NOTIFY_VERIFY_DENY + \item 0x00000003 -- NOTIFY_VERIFY_NORESP + \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ @@ -2364,12 +2910,14 @@ typedef struct { qmiLocNiNotifyVerifyEnumT_v02 notificationType; /**< Type of notification/verification performed. - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE + Valid values: + \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIF + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2394,7 +2942,13 @@ typedef struct { /* Network Initiated Service Interaction Request */ uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; + /**< \n Optional SUPL Version 2 Extension payload. */ }qmiLocNiUserRespReqMsgT_v02; /* Message */ /** @} @@ -2404,7 +2958,7 @@ typedef struct { @{ */ /** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ + failure is reported in a separate indication. */ typedef struct { /* Mandatory */ @@ -2412,14 +2966,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the NI User Response request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocNiUserRespIndMsgT_v02; /* Message */ /** @@ -2448,21 +3004,18 @@ typedef struct { /* Total Size */ uint32_t totalSize; /**< Total size of the predicted orbits data to be injected. \n - - Type: Unsigned integer \n - Units: Bytes */ /* Mandatory */ /* Total Parts */ uint16_t totalParts; /**< Total number of parts into which the predicted orbits data is - divided. \n - - Type: Unsigned integer */ + divided. */ /* Mandatory */ /* Part Number */ uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. \n - - Type: Unsigned integer */ + /**< Number of the current predicted orbits data part; starts at 1. */ /* Mandatory */ /* Data */ @@ -2479,8 +3032,10 @@ typedef struct { qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; /**< Predicted orbits data format. - Valid values: \n - - 0x00000000 -- PREDICTED_ORBITS_XTRA + Valid values: + \begin{itemize1} + \item 0x00000000 -- PREDICTED_ORBITS_XTRA + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ /** @@ -2498,14 +3053,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Data Injection request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2513,8 +3070,7 @@ typedef struct { uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ uint16_t partNum; /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. \n - - Type: Unsigned integer */ + is sent; starts at 1. */ }qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ /** @} @@ -2533,18 +3089,20 @@ typedef struct { typedef struct { /* Mandatory */ - /* Predicted Oribits Data Source Status */ + /* Predicted Orbits Data Source Status */ qmiLocStatusEnumT_v02 status; /**< Status of the query request for a predicted orbits data source. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2577,13 +3135,11 @@ typedef struct { uint64_t startTimeInUTC; /**< Predicted orbits data is valid starting from this time. \n - - Type: Unsigned integer \n - Units: Seconds (since Jan. 1, 1970) */ uint16_t durationHours; /**< Duration from the start time for which the data is valid.\n - - Type: Unsigned integer \n - Units: Hours */ }qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ @@ -2602,14 +3158,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the query request for predicted orbits data validity. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2631,17 +3189,13 @@ typedef struct { /* UTC Time */ uint64_t timeUtc; /**< UTC time since Jan. 1, 1970.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ + - Units: Milliseconds */ /* Mandatory */ /* Time Uncertainty */ uint32_t timeUnc; /**< Time uncertainty.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ + - Units: Milliseconds */ }qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ /** @} @@ -2658,14 +3212,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the UTC Time Injection request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ /** @@ -2736,40 +3292,48 @@ typedef struct { qmiLocAltSrcEnumT_v02 source; /**< Specifies the source of the altitude. - Valid values: \n - - 0x00000000 -- ALT_SRC_UNKNOWN \n - - 0x00000001 -- ALT_SRC_GPS \n - - 0x00000002 -- ALT_SRC_CELL_ID \n - - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n - - 0x00000004 -- ALT_SRC_WIFI \n - - 0x00000005 -- ALT_SRC_TERRESTRIAL \n - - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n - - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n - - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n - - 0x00000009 -- ALT_SRC_OTHER + Valid values: + \begin{itemize1} + \item 0x00000000 -- ALT_SRC_UNKNOWN + \item 0x00000001 -- ALT_SRC_GPS + \item 0x00000002 -- ALT_SRC_CELL_ID + \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID + \item 0x00000004 -- ALT_SRC_WIFI + \item 0x00000005 -- ALT_SRC_TERRESTRIAL + \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID + \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE + \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER + \item 0x00000009 -- ALT_SRC_OTHER + \vspace{-0.18in} \end{itemize1} */ qmiLocAltSrcLinkageEnumT_v02 linkage; /**< Specifies the dependency between the horizontal and altitude position components. - Valid values: \n - - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n - - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n - - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n - - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED + \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT + \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG + \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + \vspace{-0.18in} \end{itemize1} */ qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; /**< Specifies the region of uncertainty. - Valid values: \n - - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n - - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the - injected horizontal position coordinates only. \n - - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the - position of the device regardless of horizontal position - (within the horizontal uncertainty region, if provided). + Valid values: + \begin{itemize1} + \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED + \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid + at the injected horizontal position coordinates + only. + \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to + the position of the device regardless of + horizontal position (within the horizontal + uncertainty region, if provided). + \vspace{-0.18in} \end{itemize1} */ }qmiLocAltitudeSrcInfoStructT_v02; /* Type */ /** @@ -2781,12 +3345,12 @@ typedef struct { */ typedef enum { QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. Other sources. */ eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ @@ -2805,24 +3369,28 @@ typedef struct { /* Latitude */ uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Longitude */ uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ @@ -2830,19 +3398,19 @@ typedef struct { uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - Units: Meters */ /* Optional */ /* Horizontal Confidence */ uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0 to 99) \n - - 0 -- invalid value \n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99 \n + /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0 to 99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} This field must be specified together with horizontal uncertainty. If not specified, the default value will be 50. */ @@ -2852,28 +3420,32 @@ typedef struct { qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + Valid values: + \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Altitude With Respect to Ellipsoid */ uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - - Units: Meters; positive = height, negative = depth */ + /**< Altitude with respect to the WGS84 ellipsoid. + \begin{itemize1} + \item Units: Meters \begin{itemize1} + \item Positive = height + \item Negative = depth + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Altitude With Respect to Sea Level */ uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ float altitudeWrtMeanSeaLevel; /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ @@ -2882,19 +3454,19 @@ typedef struct { float vertUnc; /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid or altitudeWrtMeanSeaLevel is specified.\n - - Type: Floating point \n - Units: Meters */ /* Optional */ /* Vertical Confidence */ uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0-99) \n - - 0 -- invalid value\n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99\n + /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0-99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} This field must be specified together with the vertical uncertainty. If not specified, the default value will be 50. */ @@ -2904,12 +3476,14 @@ typedef struct { qmiLocReliabilityEnumT_v02 vertReliability; /**< Specifies the reliability of the vertical position. - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + Valid values: + \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -2923,7 +3497,6 @@ typedef struct { uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ uint64_t timestampUtc; /**< UTC timestamp. \n - - Type: Unsigned integer \n - Units: Milliseconds (since Jan. 1, 1970) */ /* Optional */ @@ -2931,28 +3504,28 @@ typedef struct { uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ int32_t timestampAge; /**< Position age, which is an estimate of how long ago this fix was made. \n - - Type: Signed integer \n - Units: Milliseconds */ /* Optional */ /* Position Source */ uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from where this position was obtained. - Valid values: \n - - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n - - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n - - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n - - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n - - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n - - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n - - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n - - If altitude is specified and altitude source is not specified, the engine - assumes that altitude was obtained using the specified Position source. - If altitude and altitude source both are specified then the engine assumes - that only latitude, longitude were obtained using the specified Position - Source. + /**< Source from which this position was obtained. \n + Valid values: + \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS + \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID + \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID + \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI + \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL + \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID + \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER + \end{itemize1} \vspace{0.05in} + If altitude is specified and the altitude source is not specified, the engine + assumes that the altitude was obtained using the specified position source. \n + If both altitude and altitude source are specified, the engine assumes + that only latitude and longitude were obtained using the specified position + source. */ }qmiLocInjectPositionReqMsgT_v02; /* Message */ /** @@ -2970,14 +3543,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the UTC Position Injection request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectPositionIndMsgT_v02; /* Message */ /** @@ -3034,14 +3609,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Engine Lock request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetEngineLockIndMsgT_v02; /* Message */ /** @@ -3065,14 +3642,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Engine Lock request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -3101,9 +3680,11 @@ typedef struct { /* Mandatory */ /* SBAS Config */ uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSbasConfigReqMsgT_v02; /* Message */ /** @} @@ -3120,14 +3701,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set SBAS Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSbasConfigIndMsgT_v02; /* Message */ /** @@ -3151,23 +3734,27 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get SBAS Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* SBAS Config */ uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetSbasConfigIndMsgT_v02; /* Message */ /** @} @@ -3179,6 +3766,8 @@ typedef uint32_t qmiLocNmeaSentenceMaskT_v02; #define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ #define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ #define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ +#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ /** @addtogroup loc_qmi_messages @{ */ @@ -3195,7 +3784,9 @@ typedef struct { - 0x00000002 -- NMEA_MASK_RMC \n - 0x00000004 -- NMEA_MASK_GSV \n - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ /** @@ -3213,14 +3804,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of Set NMEA Types request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ /** @@ -3244,14 +3837,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get NMEA Types request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -3266,7 +3861,9 @@ typedef struct { - 0x00000002 -- NMEA_MASK_RMC \n - 0x00000004 -- NMEA_MASK_GSV \n - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ /** @@ -3301,14 +3898,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Low Power Mode request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ /** @@ -3332,14 +3931,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get LPM request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -3404,9 +4005,11 @@ typedef struct { /* Uniform Resource Locator */ uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 + /**< URL address. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetServerReqMsgT_v02; /* Message */ /** @@ -3424,14 +4027,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Server request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetServerIndMsgT_v02; /* Message */ /** @@ -3485,14 +4090,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Server request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ @@ -3523,9 +4130,11 @@ typedef struct { /* Uniform Resource Locator */ uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetServerIndMsgT_v02; /* Message */ /** @@ -3533,25 +4142,25 @@ typedef struct { */ typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; #define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ #define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ @@ -3584,21 +4193,25 @@ typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; typedef struct { uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. \n - - Type: Unsigned integer \n - - Range: \n - - For GPS: 1 to 32 \n - - For SBAS: 33 to 64 \n - - For GLONASS: 65 to 96 */ + /**< SV ID of the satellite whose data is to be deleted. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ qmiLocSvSystemEnumT_v02 system; /**< Indicates to which constellation this SV belongs. - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + + Valid values: + \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} */ qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; @@ -3624,20 +4237,23 @@ typedef struct { /* Delete All */ uint8_t deleteAllFlag; /**< Whether all assistance data is to be deleted. - Valid values: \n - - 0x01 (TRUE) -- All assistance data is to be deleted; - if this flag is set, all the other information + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information contained in the optional fields for this - message are ignored \n - - 0x00 (FALSE) -- The optional fields in the message are to be used - to determine which data is to be deleted */ + message are ignored + \item 0x00 (FALSE) -- The optional fields in the message are to be + used to determine which data is to be deleted + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Delete SV Info */ uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assitance data is to be deleted. + /**< \n List of satellites for which the assistance data is to be deleted. */ /* Optional */ @@ -3645,63 +4261,72 @@ typedef struct { uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; /**< Mask for the GNSS data that is to be deleted. - Valid values: \n - - 0x00000001 -- DELETE_GPS_SVDIR \n - - 0x00000002 -- DELETE_GPS_SVSTEER \n - - 0x00000004 -- DELETE_GPS_TIME\n - - 0x00000008 -- DELETE_GPS_ALM_CORR \n - - 0x00000010 -- DELETE_GLO_SVDIR \n - - 0x00000020 -- DELETE_GLO_SVSTEER \n - - 0x00000040 -- DELETE_GLO_TIME \n - - 0x00000080 -- DELETE_GLO_ALM_CORR \n - - 0x00000100 -- DELETE_SBAS_SVDIR \n - - 0x00000200 -- DELETE_SBAS_SVSTEER \n - - 0x00000400 -- DELETE_POSITION \n - - 0x00000800 -- DELETE_TIME \n - - 0x00001000 -- DELETE_IONO \n - - 0x00002000 -- DELETE_UTC \n - - 0x00004000 -- DELETE_HEALTH \n - - 0x00008000 -- DELETE_SADATA \n - - 0x00010000 -- DELETE_RTI \n - - 0x00020000 -- DELETE_SV_NO_EXIST \n - - 0x00040000 -- DELETE_FREQ_BIAS_EST + + Valid values: + \begin{itemize1} + \item 0x00000001 -- DELETE_GPS_SVDIR + \item 0x00000002 -- DELETE_GPS_SVSTEER + \item 0x00000004 -- DELETE_GPS_TIME + \item 0x00000008 -- DELETE_GPS_ALM_CORR + \item 0x00000010 -- DELETE_GLO_SVDIR + \item 0x00000020 -- DELETE_GLO_SVSTEER + \item 0x00000040 -- DELETE_GLO_TIME + \item 0x00000080 -- DELETE_GLO_ALM_CORR + \item 0x00000100 -- DELETE_SBAS_SVDIR + \item 0x00000200 -- DELETE_SBAS_SVSTEER + \item 0x00000400 -- DELETE_POSITION + \item 0x00000800 -- DELETE_TIME + \item 0x00001000 -- DELETE_IONO + \item 0x00002000 -- DELETE_UTC + \item 0x00004000 -- DELETE_HEALTH + \item 0x00008000 -- DELETE_SADATA + \item 0x00010000 -- DELETE_RTI + \item 0x00020000 -- DELETE_SV_NO_EXIST + \item 0x00040000 -- DELETE_FREQ_BIAS_EST + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Delete Cell Database */ uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CELLDB_POS \n - - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n - - 0x00000004 -- DELETE_CELLDB_OTA_POS \n - - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n - - 0x00000010 -- DELETE_CELLDB_TIMETAG \n - - 0x00000020 -- DELETE_CELLDB_CELLID \n - - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n - - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n - - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n - - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + /**< Mask for the cell database assistance data that is to be deleted. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- DELETE_CELLDB_POS + \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_OTA_POS + \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_TIMETAG + \item 0x00000020 -- DELETE_CELLDB_CELLID + \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Delete Clock Info */ uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n - - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n - - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n - - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n - - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n - - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n - - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n - - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n - - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n - - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n - - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + /**< Mask for the clock information assistance data that is to be deleted. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST + \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST + \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER + \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME + \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER + \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST + \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST + \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER + \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER + \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY + \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + \vspace{-0.18in} \end{itemize1} */ }qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ /** @@ -3720,14 +4345,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Delete Assist Data request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ /** @@ -3762,14 +4389,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set XTRA-T Session Control request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ /** @@ -3794,14 +4423,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get XTRA-T Session Control request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -3824,8 +4455,7 @@ typedef struct { uint32_t wifiPositionTime; /**< Common counter (typically, the number of milliseconds since bootup). This field is only to be provided if the modem and host processors are - synchronized. \n - - Type: Unsigned integer */ + synchronized. */ }qmiLocWifiFixTimeStructT_v02; /* Type */ /** @} @@ -3869,12 +4499,10 @@ typedef struct { uint16_t hepe; /**< WiFi position HEPE.\n - - Type: Unsigned integer \n - Units: Meters */ uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. \n - - Type: Unsigned integer */ + /**< Number of Access Points (AP) used to generate a fix. */ qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; /**< WiFi position error code; set to 0 if the fix succeeds. This position @@ -3882,14 +4510,16 @@ typedef struct { the error code provided by the WiFi positioning system can be provided here. - Valid values: \n - - 0x00000000 -- ERROR_SUCCESS \n - - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n - - 0x00000002 -- ERROR_NO_AP_FOUND \n - - 0x00000003 -- ERROR_UNAUTHORIZED \n - - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n - - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n - - 0x00000006 -- ERROR_UNKNOWN + Valid values: + \begin{itemize1} + \item 0x00000000 -- ERROR_SUCCESS + \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE + \item 0x00000002 -- ERROR_NO_AP_FOUND + \item 0x00000003 -- ERROR_UNAUTHORIZED + \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE + \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED + \item 0x00000006 -- ERROR_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ }qmiLocWifiFixPosStructT_v02; /* Type */ /** @@ -3914,16 +4544,15 @@ typedef struct { int32_t rssi; /**< Receive signal strength indicator.\n - - Type: Signed integer \n - Units: dBm (offset with +100 dB) */ uint16_t channel; - /**< WiFi channel on which a beacon was received. \n - - Type: Unsigned integer */ + /**< WiFi channel on which a beacon was received. */ qmiLocWifiApQualifierMaskT_v02 apQualifier; /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. \n + All unused bits in this mask must be set to 0. + Valid values: \n - 0x01 -- BEING_USED \n - 0x02 -- HIDDEN_SSID \n @@ -3966,12 +4595,14 @@ typedef struct { qmiLocReliabilityEnumT_v02 horizontalReliability; /**< Specifies the reliability of the horizontal position. - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + Valid values: + \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ /** @@ -3989,14 +4620,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject WiFi Position request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ /** @@ -4028,9 +4661,11 @@ typedef struct { qmiLocWifiStatusEnumT_v02 wifiStatus; /**< WiFi status information. - Valid values: \n - - 0x00000001 -- WIFI_STATUS_AVAILABLE \n - - 0x00000002 -- WIFI_STATUS_UNAVAILABLE + Valid values: + \begin{itemize1} + \item 0x00000001 -- WIFI_STATUS_AVAILABLE + \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE + \vspace{-0.18in} \end{itemize1} */ }qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ /** @@ -4048,14 +4683,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Notify WiFi Status request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ /** @@ -4080,14 +4717,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Registered Events request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4096,21 +4735,23 @@ typedef struct { qmiLocEventRegMaskT_v02 eventRegMask; /**< Event registration mask. - Valid bitmasks: \n - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- POSITION_REPORT + \item 0x00000002 -- GNSS_SV_INFO + \item 0x00000004 -- NMEA + \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ + \item 0x00000010 -- INJECT_TIME_REQ + \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ + \item 0x00000040 -- INJECT_POSITION_REQ + \item 0x00000080 -- ENGINE_STATE + \item 0x00000100 -- FIX_SESSION_STATE + \item 0x00000200 -- WIFI_REQ + \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS + \item 0x00000800 -- TIME_SYNC_REQ + \item 0x00001000 -- SET_SPI_STREAMING_REPORT + \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ /** @@ -4148,12 +4789,14 @@ typedef struct { qmiLocOperationModeEnumT_v02 operationMode; /**< Preferred operation mode. - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID + Valid values: + \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetOperationModeReqMsgT_v02; /* Message */ /** @@ -4173,14 +4816,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Operation Mode request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetOperationModeIndMsgT_v02; /* Message */ /** @@ -4204,14 +4849,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Operation Mode request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4220,12 +4867,14 @@ typedef struct { qmiLocOperationModeEnumT_v02 operationMode; /**< Current operation mode. - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID + Valid values: + \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetOperationModeIndMsgT_v02; /* Message */ /** @@ -4242,16 +4891,17 @@ typedef struct { /* Mandatory */ /* Stationary Status */ uint8_t stationary; - /**< Whether the device is stationary:\n - - 0x00 (FALSE) -- Device is not stationary \n - - 0x01 (TRUE) -- Device is stationary */ + /**< Whether the device is stationary: + \begin{itemize1} + \item 0x00 (FALSE) -- Device is not stationary + \item 0x01 (TRUE) -- Device is stationary + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Confidence */ uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ uint8_t confidenceStationary; /**< Confidence in the Stationary state expressed as a percentage.\n - - Type: Unsigned integer \n - Range: 0 to 100 */ }qmiLocSetSpiStatusReqMsgT_v02; /* Message */ /** @@ -4268,15 +4918,18 @@ typedef struct { /* Mandatory */ /* Status of SPI Status Request */ qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + /**< Status of the SPI Status request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSpiStatusIndMsgT_v02; /* Message */ /** @@ -4286,6 +4939,8 @@ typedef struct { typedef uint8_t qmiLocSensorDataFlagMaskT_v02; #define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting the sensor data. */ +#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem + time stamp. */ /** @addtogroup loc_qmi_aggregates @{ */ @@ -4294,26 +4949,22 @@ typedef struct { uint16_t timeOffset; /**< Sample time offset. This time offset must be relative to the sensor time of the first sample.\n - - Type: Unsigned integer \n - Units: Milliseconds */ float xAxis; /**< Sensor x-axis sample. \n - - Type: Floating point \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds^2) ) */ float yAxis; /**< Sensor y-axis sample. \n - - Type: Floating point \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds^2) ) */ float zAxis; /**< Sensor z-axis sample. \n - - Type: Floating point \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds^2) ) */ }qmiLoc3AxisSensorSampleStructT_v02; /* Type */ /** @} @@ -4327,16 +4978,16 @@ typedef struct { uint32_t timeOfFirstSample; /**< Denotes a full 32-bit time tag of the first (oldest) sample in this message. \n - - Type: Unsigned integer \n - Units: Milliseconds */ qmiLocSensorDataFlagMaskT_v02 flags; /**< Flags to indicate any deviation from the default measurement assumptions. All unused bits in this field must be set to 0. - Valid bitmasks: \n - - 0x01 -- SIGN REVERSAL - */ + Valid bitmasks: \begin{itemize1} + \item 0x01 -- SIGN_REVERSAL + \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME + \vspace{-0.18in} \end{itemize1} */ uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; @@ -4360,8 +5011,7 @@ typedef struct { uint32_t opaqueIdentifier; /**< An opaque identifier that is sent in by the client that will be echoed in the indication so the client can relate the indication to the - request. \n - - Type: Unsigned integer */ + request. */ /* Optional */ /* 3-Axis Accelerometer Data */ @@ -4370,10 +5020,10 @@ typedef struct { /**< \n Accelerometer sensor samples. */ /* Optional */ - /* 3-Axis Gyrometer Data */ + /* 3-Axis Gyroscope Data */ uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyrometer sensor samples. */ + /**< \n Gyroscope sensor samples. */ }qmiLocInjectSensorDataReqMsgT_v02; /* Message */ /** @} @@ -4391,36 +5041,37 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject Sensor Data request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Opaque Identifier */ uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ uint32_t opaqueIdentifier; - /**< An opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. \n - - Type: Unsigned integer */ + /**< Opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. */ /* Optional */ /* Accelerometer Samples Accepted */ uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ uint8_t threeAxisAccelSamplesAccepted; - /**< This field lets the client know how many 3-axis accelerometer samples + /**< Lets the client know how many 3-axis accelerometer samples were accepted. */ /* Optional */ - /* Gyrometer Samples Accepted */ + /* Gyroscope Samples Accepted */ uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ uint8_t threeAxisGyroSamplesAccepted; - /**< This field lets the client know how many 3-axis gyrometer samples were + /**< Lets the client know how many 3-axis gyroscope samples were accepted. */ }qmiLocInjectSensorDataIndMsgT_v02; /* Message */ /** @@ -4437,29 +5088,26 @@ typedef struct { /* Reference Time Sync Counter */ uint32_t refCounter; /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. \n - - Type: Unsigned integer */ + GNSS location engine requested time sync injection. */ /* Mandatory */ /* Sensor Receive Time */ uint32_t sensorProcRxTime; - /**< The value of the sensor time when the control point received the + /**< Value of the sensor time when the control point received the Time Sync Inject request from the GNSS location engine. Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - Units: Milliseconds */ /* Mandatory */ /* Sensor Transmit Time */ uint32_t sensorProcTxTime; - /**< The value of the sensor time when the control point injects this message + /**< Value of the sensor time when the control point injects this message for use by the GNSS location engine. Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - Units: Milliseconds */ }qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ /** @@ -4477,14 +5125,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject Time Sync Data request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ /** @@ -4524,14 +5174,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Cradle Mount Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4540,10 +5192,12 @@ typedef struct { qmiLocCradleMountStateEnumT_v02 cradleMountState; /**< Cradle Mount state set by the control point. - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN + Valid values: + \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4551,7 +5205,6 @@ typedef struct { uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ uint8_t confidenceCradleMountState; /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - Range: 0 to 100 */ }qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ /** @@ -4570,17 +5223,18 @@ typedef struct { qmiLocCradleMountStateEnumT_v02 cradleMountState; /**< Cradle Mount state set by the control point. - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN */ + Valid values: + \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Cradle Mount Confidence */ uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ uint8_t confidenceCradleMountState; /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - Range: 0 to 100 */ }qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ /** @@ -4599,14 +5253,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Cradle Mount Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ /** @@ -4646,14 +5302,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get External Power Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4662,10 +5320,12 @@ typedef struct { qmiLocExternalPowerConfigEnumT_v02 externalPowerState; /**< Power state; injected by the control point. - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + Valid values: + \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ /** @@ -4684,10 +5344,12 @@ typedef struct { qmiLocExternalPowerConfigEnumT_v02 externalPowerState; /**< Power state; injected by the control point. - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + Valid values: + \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ /** @@ -4706,14 +5368,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set External Power Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ /** @@ -4752,9 +5416,11 @@ typedef struct { */ char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 101 + /**< APN name. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 101 + \vspace{-0.18in} \end{itemize1} */ }qmiLocApnProfilesStructT_v02; /* Type */ /** @@ -4788,8 +5454,7 @@ typedef struct { /* Connection Handle */ uint32_t connHandle; /**< Connection handle that the service specified in the - Location Server Connection request event. \n - - Type: Unsigned integer */ + Location Server Connection request event. */ /* Mandatory */ /* Request Type */ @@ -4838,14 +5503,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inform Location Server Connection Status request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ /** @@ -4880,6 +5547,9 @@ typedef enum { @} */ +typedef uint32_t qmiLocLppConfigMaskT_v02; +#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ +#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ /** @addtogroup loc_qmi_messages @{ */ @@ -4891,9 +5561,11 @@ typedef struct { /* SUPL Security */ uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* VX Version */ @@ -4901,9 +5573,11 @@ typedef struct { qmiLocVxVersionEnumT_v02 vxVersion; /**< VX version. - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY + Valid values: + \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4916,15 +5590,29 @@ typedef struct { - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ }qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @} */ typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ /** @addtogroup loc_qmi_messages @{ */ @@ -4937,14 +5625,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Configuration Parameters request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -4955,10 +5645,13 @@ typedef struct { not successful, this field will identify the parameters that were not set successfully. - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + Valid bitmasks: + \begin{itemize1} + \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY + \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION + \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @@ -4977,10 +5670,13 @@ typedef struct { qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + Valid bitmasks: + \begin{itemize1} + \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY + \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION + \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @@ -4999,23 +5695,27 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Configuration Parameters request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* SUPL Security */ uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* VX Version */ @@ -5023,9 +5723,11 @@ typedef struct { qmiLocVxVersionEnumT_v02 vxVersion; /**< VX version. - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY + Valid values: + \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5038,6 +5740,19 @@ typedef struct { - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ }qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -5075,15 +5790,17 @@ typedef struct { /**< Controls how sensors are used to aid heading and positioning performance. - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in heading and - position improvement. + Valid values: + \begin{itemize1} + \item 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in heading and + position improvement. + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ /** @@ -5101,14 +5818,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Sensor Control Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ /** @@ -5132,14 +5851,16 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Sensors Control Configuration request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5149,21 +5870,29 @@ typedef struct { /**< Controls how sensors are used to aid the heading and positioning performance. - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in the heading and - position improvement. + Valid values: + \begin{itemize1} + \item 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in the heading and + position improvement. + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ /** @} */ +typedef uint32_t qmiLocSensorPropertiesMaskT_v02; +#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ /** @addtogroup loc_qmi_messages @{ */ @@ -5174,14 +5903,62 @@ typedef struct { typedef struct { /* Optional */ - /* Gyro Bias Variance */ + /* Gyro Bias Random Walk Variance */ uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the sensors data sheet or a sensors conformance test. \n - - Units: radians^2/second^4 + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 */ }qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ @@ -5203,25 +5980,64 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Sensor Properties request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Set Sensor Properties */ + uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ + qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ /** @} */ -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPropertiesReqMsgT_v02; - */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Sensor Properties Config Parameters */ + qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; + /**< Mask denoting the sensor properties parameters to be retrieved. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ /** @addtogroup loc_qmi_messages @{ @@ -5234,25 +6050,76 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Sensors Properties request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} */ /* Optional */ - /* Gyro Bias Variance */ + /* Gyro Bias Random Walk Variance */ uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the sensors data sheet or a sensors conformance test. \n - - Units: radians^2/seconds^4 + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 */ }qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ @@ -5280,6 +6147,9 @@ typedef enum { @} */ +typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; +#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with + GNSS. They can still be used for aiding in heading improvements. */ /** @addtogroup loc_qmi_messages @{ */ @@ -5295,13 +6165,15 @@ typedef struct { This field is relevant only when sensors have been enabled using the sensors control configuration. - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time the GNSS - location engine turns on. + Valid values: + \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5316,7 +6188,7 @@ typedef struct { */ /* Optional */ - /* Gyrometer Sampling Specification */ + /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request @@ -5325,6 +6197,18 @@ typedef struct { However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Sets which sensor algorithms are to be used when processing sensor data. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ }qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ /** @} @@ -5334,6 +6218,7 @@ typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ /** @addtogroup loc_qmi_messages @{ */ @@ -5344,15 +6229,18 @@ typedef struct { /* Mandatory */ /* Set Sensor Perf Control Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + /**< Status of the Set Sensor Performance Control Configuration request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5360,11 +6248,15 @@ typedef struct { uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; /**< This field is sent only if the status is not a success. - When sent, this field identifies which configuration failed. \n - Valid bitmasks: \n - - 0x0000000000000001 -- PERFORMANCE_MODE \n - - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n - - 0x0000000000000004 -- GYRO_SAMPLING_SPEC + When sent, this field identifies which configuration failed. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- PERFORMANCE_MODE + \item 0x00000002 -- ACCEL_SAMPLING_SPEC + \item 0x00000004 -- GYRO_SAMPLING_SPEC + \item 0x00000008 -- ALGORITHM_CONFIG + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @@ -5387,15 +6279,18 @@ typedef struct { /* Mandatory */ /* Get Sensor Perf Control Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + /**< Status of the Get Sensor Performance Control Configuration request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5406,13 +6301,15 @@ typedef struct { This field is relevant only when sensors have been enabled using the sensor control configuration. - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time the GNSS - location engine turns on. + Valid values: + \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5427,7 +6324,7 @@ typedef struct { */ /* Optional */ - /* Gyrometer Sampling Specification */ + /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request @@ -5436,6 +6333,18 @@ typedef struct { However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Informs which sensor algorithms are currently set. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ }qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @} @@ -5444,24 +6353,23 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ typedef struct { /* Mandatory */ - /* SUPL Certificate Id */ + /* SUPL Certificate ID */ uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate - Type: Unsigned Integer - Units: Bytes - Range: 0-9 */ + /**< Certificate ID of the SUPL certificate. \n + - Units: Bytes \n + - Range: 0 to 9 */ /* Mandatory */ - /* SUPL certificate Data */ + /* SUPL Certificate Data */ uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< The supl Certificate contents - Type: Array of bytes. - - Maximum certificate size : 2000 bytes */ + /**< SUPL certificate contents. \n + - Type: Array of bytes. \n + - Maximum certificate size: 2000 bytes */ }qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ /** @} @@ -5470,22 +6378,24 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ typedef struct { /* Mandatory */ - /* Supl Certificate Injection Status */ + /* SUPL Certificate Injection Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the inject SUPL certificate request. \n + /**< Status of the Inject SUPL Certificate request. - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ /** @@ -5495,19 +6405,18 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Delete a SUPL certificate. */ +/** Request Message; Deletes a SUPL certificate. */ typedef struct { /* Optional */ - /* SUPL Certificate Id */ + /* SUPL Certificate ID */ uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate to be deleted - Type: Unsigned Integer \n - Units: Bytes \n - Range: 0-9 \n - If suplCertId is not specified then - "all" supl certificates will be deleted. */ + /**< Certificate ID of the SUPL certificate to be deleted. \n + - Units: Bytes \n + - Range: 0 to 9 \n + If suplCertId is not specified, + all SUPL certificates are deleted. */ }qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ /** @} @@ -5516,22 +6425,24 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Delete a SUPL certificate. */ +/** Indication Message; Deletes a SUPL certificate. */ typedef struct { /* Mandatory */ - /* SUPL certifcate Deletion Status */ + /* SUPL Certificate Deletion Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the delete SUPL certificate request. \n + /**< Status of the Delete SUPL Certificate request. - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ /** @@ -5539,12 +6450,12 @@ typedef struct { */ typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the - injected position in direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the + injected position in a direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data - in the persistent memory. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ /** @addtogroup loc_qmi_messages @{ */ @@ -5556,39 +6467,45 @@ typedef struct { /* Injected Position Control */ uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ uint8_t injectedPositionControl; - /**< Controls how the injected position will be used in position engine.\n - Valid values: \n - - 0x01 (TRUE) -- Use the injected position in direct position - calculation. \n - - 0x00 (FALSE) -- Do not use the injected position in direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. + /**< Controls how the injected position is used in the position engine. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- Use the injected position in a direct position + calculation + \item 0x00 (FALSE) -- Do not use the injected position in a direct + position calculation + \end{itemize1} + The default value is TRUE. */ /* Optional */ /* Filter SV Usage */ uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ uint8_t filterSvUsage; - /**< Controls if SV usage will be filtered in a position fix. - Valid values:\n - - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n - - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. + /**< Controls whether SV usage is filtered in a position fix. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- Filter the usage of SVs in the fix + \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix + \end{itemize1} + The default value is FALSE. */ /* Optional */ /* Store Assist Data */ uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ uint8_t storeAssistData; - /**< Controls whether assistance data should be stored in - the persistent memory. \n - Valid values:\n - - 0x01 (TRUE) -- Store assistance data in persistent memory. \n - - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. + /**< Controls whether assistance data is to be stored in + persistent memory. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- Store assistance data in persistent memory + \item 0x00 (FALSE) -- Do not store assistance data in persistent memory + \end{itemize1} + The default value is TRUE. */ }qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @@ -5607,27 +6524,31 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Configuration Parameters request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Failed Parameters */ uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. + /**< Identifies the parameters that were not set successfully. + This field is sent only if the status is other than SUCCESS. - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} */ }qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @@ -5645,10 +6566,13 @@ typedef struct { /* Config Parameters */ qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @@ -5667,59 +6591,880 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Configuration Parameters request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Injected Position Control */ uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ uint8_t injectedPositionControl; - /**< Specifies if the injected position is used for direct calculation - in the position engine.\n - Valid values: \n - - 0x01 (TRUE) -- The injected position is used in direct position - calculation. \n - - 0x00 (FALSE) -- The injected position is not used direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. + /**< Specifies whether the injected position is used for a direct calculation + in the position engine. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- The injected position is used in a direct + position calculation + \item 0x00 (FALSE) -- The injected position is not used in a direct + position calculation + \end{itemize1} + The default value is TRUE. */ /* Optional */ /* Filter SV Usage */ uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ uint8_t filterSvUsage; - /**< Specifies if SV usage is filtered in a position fix. - Valid values: \n - - 0x01 (TRUE) -- SV usage is filtered in the fix. \n - - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. + /**< Specifies whether SV usage is filtered in a position fix. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- SV usage is filtered in the fix + \item 0x00 (FALSE) -- SV usage is not filtered in the fix + \end{itemize1} + The default value is FALSE. */ /* Optional */ /* Store Assist Data */ uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ uint8_t storeAssistData; - /**< Specifies if assistance data is stored in the persistent memory. \n - Valid values: \n - 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n - 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. + /**< Specifies whether assistance data is stored in persistent memory. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- Assistance data is stored in persistent memory + \item 0x00 (FALSE) -- Assistance data is not stored in persistent + memory + \end{itemize1} + The default value is TRUE. */ }qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @} */ +typedef uint8_t qmiLocGeofenceBreachMaskT_v02; +#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported + when the Geofence is entered. */ +#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported + when the Geofence is exited. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a + lower rate. The gap between actual breach and + the time it is reported is higher. This + setting results in lower power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a + medium rate. This is the default setting. + The Geofence is monitored for a breach at a + high rate. The gap between actual breach and + the time it is reported is low. This results + in higher power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, + QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceResponsivenessEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with + low confidence. This setting results in lower + power usage. This setting can impact the "yield" because + incorrect breach events may be sent. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with + medium confidence. This is the default setting. + The Geofence engine indicates a breach with + high confidence. This setting results in higher + power usage. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, + QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceConfidenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double latitude; + /**< Latitude of the center of the Geofence. */ + + double longitude; + /**< Longitude of the center of the Geofence. */ + + uint32_t radius; + /**< Radius of the circular Geofence in meters. */ +}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. + Position outside a Geofence. */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, + QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofencePositionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add Circular Geofence + indication. */ + + /* Mandatory */ + /* Circular Geofence Arguments */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Mandatory */ + /* Breach Event Mask */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: + \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Mandatory */ + /* Include Position in Breach Event */ + uint8_t includePosition; + /**< Specifies whether the Geofence engine is to include the position + in a breach event. + + Valid values: + \begin{itemize1} + \item 0x01 (TRUE) -- Position will be reported with the breach event + \item 0x00 (FALSE) -- Position will not be reported with the breach + event + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW + \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED + \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Confidence */ + uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 confidence; + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and + is to be fine-tuned to optimize power savings. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW + \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED + \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Add Circular Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add Circular Geofence request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_MEMORY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Add Circular + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + The client must include this identifier in all transactions + pertaining to this Geofence. */ +}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be deleted. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete Geofence + indication. */ +}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Delete Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Geofence request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was deleted. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Delete + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. + The Geofence was initiated by the device. */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, + QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceOriginEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. + The Geofence monitoring is suspended. */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, + QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be queried. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Query Geofence + indication. */ +}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Query Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query Geofence request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was queried. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Query + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence Origin */ + uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ + qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; + /**< Originator of the Geofence. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK + \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Position with Respect to Geofence */ + uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ + qmiLocGeofencePositionEnumT_v02 posWrtGeofence; + /**< Indicates if the client is currently inside or outside + the Geofence. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_POSITION_INSIDE + \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Circular Geofence Parameters */ + uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ +}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence to be edited. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Edit Geofence + request. This parameter will always be present if the + status field is set to SUCCESS. + */ + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Breach Event Mask */ + uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: + \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; +#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ +#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Edit Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Edit Geofence request. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was edited. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is specified in the Edit Geofence request. */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ + qmiLocGeofenceConfigParamMaskT_v02 failedParams; + /**< Specified only when the status is not set to SUCCESS. If + the mask corresponding to a field is set, it indicates that + the Geofence parameter could not be edited. + + Valid values: + \begin{itemize1} + \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Best Available Position indication. */ +}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Best Available Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Best Available Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get Best + Available Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ + float horSpeed; + /**< Horizontal speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Horizontal Speed Uncertainty */ + uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ + float horSpeedUnc; + /**< Horizontal speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Vertical Speed */ + uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ + float vertSpeed; + /**< Vertical speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Vertical Speed Uncertainty */ + uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ + float vertSpeedUnc; + /**< Vertical speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading. \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty. \n + - Type: Floating point \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used Mask */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: + \begin{itemize1} + \item 0x00000000 -- TIME_SRC_INVALID + \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER + \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING + \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT + \item 0x00000004 -- TIME_SRC_TOW_DECODE + \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED + \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED + \item 0x00000007 -- TIME_SRC_NAV_SOLUTION + \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + /*Service Message Definition*/ /** @addtogroup loc_qmi_msg_ids @{ @@ -5884,6 +7629,24 @@ typedef struct { #define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F #define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F #define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 +#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 +#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 +#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 +#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 +#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 /** @} */ diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h old mode 100755 new mode 100644 index 6321bb9c..50d6c91b --- a/loc_api/ulp/inc/ulp.h +++ b/loc_api/ulp/inc/ulp.h @@ -36,14 +36,7 @@ extern "C" #endif #include - -typedef int (ulp_report_position_cb) -( - void* owner, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data -); +#include "loc_eng.h" /** Represents the standard ulp module interface. */ typedef struct { @@ -51,24 +44,14 @@ typedef struct { size_t size; /** - * Starts the ulp module. 0: success + * Starts the libulp module. 0: success */ - int (*init)( void* owner, ulp_report_position_cb* cb); + int (*init)(loc_eng_data_s_type &loc_eng_data); - /** Starts the ulp engine. 0: success */ - int (*start_fix)( void ); - - /** Stops the ulp engine. 0: success */ - int (*stop_fix)( void ); - - /** Closes the interface */ - int (*destroy)( void ); - -} ulpInterface; +}ulpInterface; typedef const ulpInterface* (get_ulp_interface) (void); - #ifdef __cplusplus } #endif diff --git a/utils/Android.mk b/utils/Android.mk old mode 100755 new mode 100644 index 7ce454f8..4bf04014 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -21,6 +21,8 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ +LOCAL_LDFLAGS += -Wl,--export-dynamic + ## Includes LOCAL_C_INCLUDES:= diff --git a/utils/linked_list.c b/utils/linked_list.c old mode 100755 new mode 100644 diff --git a/utils/linked_list.h b/utils/linked_list.h old mode 100755 new mode 100644 diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp old mode 100755 new mode 100644 index de960788..574c9581 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -47,28 +47,14 @@ *============================================================================*/ /* Parameter data */ -loc_gps_cfg_s_type gps_conf; +static uint8_t DEBUG_LEVEL = 3; +static uint8_t TIMESTAMP = 0; /* Parameter spec table */ - -loc_param_s_type loc_parameter_table[] = +static loc_param_s_type loc_parameter_table[] = { - {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, 'n'}, - {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, 'n'}, - {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, 'n'}, - /* DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info - 4 - Debug, 5 - Verbose */ - {"DEBUG_LEVEL", &gps_conf.DEBUG_LEVEL, 'n'}, - {"SUPL_VER", &gps_conf.SUPL_VER, 'n'}, - {"CAPABILITIES", &gps_conf.CAPABILITIES, 'n'}, - {"TIMESTAMP", &gps_conf.TIMESTAMP, 'n'}, - {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, 'f'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, 'n'}, - {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, 'n'}, - {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); @@ -92,29 +78,11 @@ SIDE EFFECTS static void loc_default_parameters() { /* defaults */ - gps_conf.INTERMEDIATE_POS = 0; - gps_conf.ACCURACY_THRES = 0; - gps_conf.ENABLE_WIPER = 0; - gps_conf.DEBUG_LEVEL = 3; /* debug level */ - gps_conf.SUPL_VER = 0x10000; - gps_conf.CAPABILITIES = 0x7; - gps_conf.TIMESTAMP = 0; - - gps_conf.GYRO_BIAS_RANDOM_WALK = 0; - - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - gps_conf.SENSOR_USAGE = 0; /* Enabled */ - - /* Value MUST be set by OEMs in configuration for sensor-assisted - navigation to work. There is NO default value */ - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + DEBUG_LEVEL = 3; /* debug level */ + TIMESTAMP = 0; /* reset logging mechanism */ - loc_logger_init(gps_conf.DEBUG_LEVEL, 0); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } /*=========================================================================== @@ -161,11 +129,26 @@ void trim_space(char *org_string) if (last_nonspace) { *last_nonspace = '\0'; } } +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_read_gps_conf +FUNCTION loc_set_config_entry DESCRIPTION - Reads the gps.conf file and sets global parameter data + 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 @@ -176,97 +159,152 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_gps_conf(void) +void loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +{ + if(NULL == config_entry || NULL == config_value) + { + LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); + return; + } + + 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; + } + 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; + } + 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; + } + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); + } + } +} + +/*=========================================================================== +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, loc_param_s_type* config_table, uint32_t table_length) { FILE *gps_conf_fp = NULL; char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ char *lasts; - char *param_name, *param_str_value; - int param_int_value = 0; - double param_double_value = 0; - int i; + loc_param_v_type config_value; + uint32_t i; loc_default_parameters(); - if((gps_conf_fp = fopen(GPS_CONF_FILE, "r")) != NULL) + if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) { LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE); } else { - LOC_LOGW("%s: no %s file, using defaults", __FUNCTION__, GPS_CONF_FILE); + LOC_LOGW("%s: no %s file found", __FUNCTION__, GPS_CONF_FILE); return; /* no parameter file */ } + /* Clear all validity bits */ + for(i = 0; NULL != config_table && i < table_length; i++) + { + if(NULL != config_table[i].param_set) + { + *(config_table[i].param_set) = 0; + } + } + while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) { + memset(&config_value, 0, sizeof(config_value)); + /* Separate variable and value */ - param_name = strtok_r(input_buf, "=", &lasts); - if (param_name == NULL) continue; /* skip lines that do not contain "=" */ - param_str_value = strtok_r(NULL, "=", &lasts); - if (param_str_value == NULL) continue; /* skip lines that do not contain two operands */ + config_value.param_name = strtok_r(input_buf, "=", &lasts); + if (config_value.param_name == NULL) continue; /* skip lines that do not contain "=" */ + config_value.param_str_value = strtok_r(NULL, "=", &lasts); + if (config_value.param_str_value == NULL) continue; /* skip lines that do not contain two operands */ /* Trim leading and trailing spaces */ - trim_space(param_name); - trim_space(param_str_value); - - // printf("*(%s) = (%s)\n", param_name, param_str_value); + trim_space(config_value.param_name); + trim_space(config_value.param_str_value); /* Parse numerical value */ - if (param_str_value[0] == '0' && tolower(param_str_value[1]) == 'x') + if (config_value.param_str_value[0] == '0' && tolower(config_value.param_str_value[1]) == 'x') { /* hex */ - param_int_value = (int) strtol(¶m_str_value[2], (char**) NULL, 16); + config_value.param_int_value = (int) strtol(&config_value.param_str_value[2], (char**) NULL, 16); } else { - param_double_value = (double) atof(param_str_value); /* float */ - param_int_value = atoi(param_str_value); /* dec */ + 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 */ } - if (strcmp("GYRO_BIAS_RANDOM_WALK", param_name) == 0) + for(i = 0; NULL != config_table && i < table_length; i++) { - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 1; + loc_set_config_entry(&config_table[i], &config_value); } for(i = 0; i < loc_param_num; i++) { - if (strcmp(loc_parameter_table[i].param_name, param_name) == 0 && - loc_parameter_table[i].param_ptr) - { - switch (loc_parameter_table[i].param_type) - { - case 's': - if (strcmp(param_str_value, "NULL") == 0) - { - *((char*)loc_parameter_table[i].param_ptr) = '\0'; - } - else { - strlcpy((char*) loc_parameter_table[i].param_ptr, - param_str_value, - LOC_MAX_PARAM_STRING + 1); - } - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, param_name, (char*)loc_parameter_table[i].param_ptr); - break; - case 'n': - *((int *)loc_parameter_table[i].param_ptr) = param_int_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, param_name, param_int_value); - break; - case 'f': - *((double *)loc_parameter_table[i].param_ptr) = param_double_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, param_name, param_double_value); - break; - default: - LOC_LOGE("%s: PARAM %s parameter type must be n or n", __FUNCTION__, param_name); - } - } + loc_set_config_entry(&loc_parameter_table[i], &config_value); } } fclose(gps_conf_fp); /* Initialize logging mechanism with parsed data */ - loc_logger_init(gps_conf.DEBUG_LEVEL, gps_conf.TIMESTAMP); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h old mode 100755 new mode 100644 index ffeb83c4..bc3b1c3a --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -30,7 +30,9 @@ #ifndef LOC_CFG_H #define LOC_CFG_H -#define LOC_MAX_PARAM_NAME 36 +#include + +#define LOC_MAX_PARAM_NAME 48 #define LOC_MAX_PARAM_STRING 80 #define LOC_MAX_PARAM_LINE 80 @@ -39,6 +41,12 @@ #define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent #endif +#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 @@ -48,30 +56,12 @@ typedef struct { char param_name[LOC_MAX_PARAM_NAME]; void *param_ptr; - char param_type; /* 'n' for number; 's' for string */ + 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; -/* GPS.conf support */ -typedef struct loc_gps_cfg_s -{ - unsigned long INTERMEDIATE_POS; - unsigned long ACCURACY_THRES; - unsigned long ENABLE_WIPER; - unsigned long DEBUG_LEVEL; - unsigned long SUPL_VER; - unsigned long CAPABILITIES; - unsigned long TIMESTAMP; - unsigned long GYRO_BIAS_RANDOM_WALK_VALID; - double GYRO_BIAS_RANDOM_WALK; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; - unsigned long SENSOR_CONTROL_MODE; - unsigned long SENSOR_USAGE; - // char string_val[LOC_MAX_PARAM_STRING + 1]; /* An example string value */ -} loc_gps_cfg_s_type; - /*============================================================================= * * MODULE EXTERNAL DATA @@ -82,14 +72,14 @@ typedef struct loc_gps_cfg_s extern "C" { #endif -extern loc_gps_cfg_s_type gps_conf; - /*============================================================================= * * MODULE EXPORTED FUNCTIONS * *============================================================================*/ -extern void loc_read_gps_conf(void); +extern void loc_read_conf(const char* conf_file_name, + loc_param_s_type* config_table, + uint32_t table_length); #ifdef __cplusplus } diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp old mode 100755 new mode 100644 diff --git a/utils/loc_log.h b/utils/loc_log.h old mode 100755 new mode 100644 diff --git a/utils/log_util.h b/utils/log_util.h old mode 100755 new mode 100644 diff --git a/utils/msg_q.c b/utils/msg_q.c old mode 100755 new mode 100644 index 252921ef..cc024e4c --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -249,7 +249,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Received message %p rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/utils/msg_q.h b/utils/msg_q.h old mode 100755 new mode 100644 From cd9e934abeb63f12f23f565a95b80c192abddddd Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Aug 2012 12:16:26 -0700 Subject: [PATCH 036/945] gps: merge ics tip into jb Merges the following change lists: Ibdd65ec497ad6996c5d55ca907a995ed63b797cf I75266b7102f8cd06db7b9bf038ee24c0dfbed822 I398704add524a807ddc088dfd28520dad7668784 Change-Id: I29275e65fc98568625eded942587c87b4ac8d1b9 --- loc_api/libloc_api_50001/LocApiAdapter.h | 4 +- loc_api/libloc_api_50001/loc_eng.cpp | 40 ++- loc_api/libloc_api_50001/loc_eng.h | 4 + loc_api/libloc_api_50001/loc_eng_msg.h | 38 ++- loc_api/libloc_api_50001/loc_eng_msg_id.h | 6 +- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 13 + loc_api/loc_api_v02/LocApiV02Adapter.h | 4 +- loc_api/loc_api_v02/location_service_v02.c | 137 +++++++-- loc_api/loc_api_v02/location_service_v02.h | 334 ++++++++++++++++++++- 9 files changed, 541 insertions(+), 39 deletions(-) diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 1c5e02b2..57d0eae0 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -203,7 +203,9 @@ public: {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, int algorithmConfig) + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9958ca56..821d9624 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -94,8 +94,13 @@ static loc_param_s_type loc_parameter_table[] = {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, NULL, 'n'}, + {"SENSOR_ALGORITHM_CONFIG_MASK", &gps_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, }; @@ -114,6 +119,10 @@ static void loc_default_parameters(void) gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ gps_conf.SENSOR_USAGE = 0; /* Enabled */ gps_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/ @@ -374,6 +383,10 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, gps_conf.SENSOR_ALGORITHM_CONFIG_MASK)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_perf_control_conf_msg, loc_eng_free_msg); @@ -1444,7 +1457,10 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, spccMsg->algorithmConfig); + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, + spccMsg->accelSamplesPerBatchHigh, spccMsg->accelBatchesPerSecHigh, + spccMsg->gyroSamplesPerBatchHigh, spccMsg->gyroBatchesPerSecHigh, + spccMsg->algorithmConfig); } break; @@ -1498,6 +1514,15 @@ static void loc_eng_deferred_action_thread(void* arg) // turn off the session flag. loc_eng_data_p->client_handle->setInSession(false); } + + // Free the allocated memory for rawData + GpsLocation* gp = (GpsLocation*)&(rpMsg->location); + if (gp != NULL && gp->rawData != NULL) + { + delete (char*)gp->rawData; + gp->rawData = NULL; + gp->rawDataSize = 0; + } } break; @@ -1852,6 +1877,19 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, LOC_LOGD("loc_eng_send_extra_command: %s\n", command); ret_val = TRUE; + if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + { + ulp_msg_inject_raw_command *msg( + new ulp_msg_inject_raw_command(&loc_eng_data,command, length)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); return ret_val; } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index e1cf95cc..a14f5bd1 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -157,6 +157,10 @@ typedef struct loc_gps_cfg_s unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; unsigned long SENSOR_GYRO_BATCHES_PER_SEC; unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; unsigned long SENSOR_CONTROL_MODE; unsigned long SENSOR_USAGE; unsigned long QUIPC_ENABLED; diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 4a1cae63..adc138fe 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -223,10 +223,16 @@ struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { const int accelBatchesPerSec; const int gyroSamplesPerBatch; const int gyroBatchesPerSec; + const int accelSamplesPerBatchHigh; + const int accelBatchesPerSecHigh; + const int gyroSamplesPerBatchHigh; + const int gyroBatchesPerSecHigh; const int algorithmConfig; inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) : loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), controlMode(controlMode), @@ -234,15 +240,25 @@ struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { accelBatchesPerSec(accelBatchesPerSec), gyroSamplesPerBatch(gyroSamplesPerBatch), gyroBatchesPerSec(gyroBatchesPerSec), + accelSamplesPerBatchHigh(accelSamplesPerBatchHigh), + accelBatchesPerSecHigh(accelBatchesPerSecHigh), + gyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), + gyroBatchesPerSecHigh(gyroBatchesPerSecHigh), algorithmConfig(algorithmConfig) { LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u), algorithmConfig(%u)\n", + "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", controlMode, accelSamplesPerBatch, accelBatchesPerSec, gyroSamplesPerBatch, gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, algorithmConfig ); } @@ -749,6 +765,26 @@ struct ulp_msg_update_criteria : public loc_eng_msg { } }; +struct ulp_msg_inject_raw_command : public loc_eng_msg { + const char* rawCommand; + const int rawCommandLength; + inline ulp_msg_inject_raw_command (void* instance, char* command, int length) : + loc_eng_msg(instance, ULP_MSG_INJECT_RAW_COMMAND), + rawCommand(new char[length]), + rawCommandLength(length) + { + memcpy((void*)rawCommand, (void*)command, length); + LOC_LOGV("inject raw command: command %s\n command length: %d\n ", + rawCommand, + rawCommandLength); + } + + inline ~ulp_msg_inject_raw_command() + { + delete[] rawCommand; + } +}; + struct ulp_msg_inject_phone_context_settings : public loc_eng_msg { const UlpPhoneContextSettings phoneSetting; inline ulp_msg_inject_phone_context_settings(void* instance, UlpPhoneContextSettings setting) : diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index ff5a6bd7..0c3f5755 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -117,7 +117,11 @@ enum loc_eng_msg_ids_t { /* Message is sent by HAL to LOC API to configure LTE Positioning Profile in modem */ - LOC_ENG_MSG_LPP_CONFIG + LOC_ENG_MSG_LPP_CONFIG, + + // Message is sent by Android framework (GpsLocationProvider) + // to inject the raw command + ULP_MSG_INJECT_RAW_COMMAND, }; #ifdef __cplusplus diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 92acfc75..f352af19 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1335,6 +1335,8 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(bool gyroBiasVa enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) { locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; @@ -1345,6 +1347,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont LOC_LOGD("%s:%d]: 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", __FUNCTION__, __LINE__, @@ -1353,6 +1356,10 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont accelBatchesPerSec, gyroSamplesPerBatch, gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, algorithmConfig ); @@ -1367,6 +1374,12 @@ enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int cont sensor_perf_config_req.gyroSamplingSpec_valid = 1; sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + sensor_perf_config_req.accelSamplingSpecHigh_valid = 1; + sensor_perf_config_req.accelSamplingSpecHigh.batchesPerSecond = accelBatchesPerSecHigh; + sensor_perf_config_req.accelSamplingSpecHigh.samplesPerBatch = accelSamplesPerBatchHigh; + sensor_perf_config_req.gyroSamplingSpecHigh_valid = 1; + sensor_perf_config_req.gyroSamplingSpecHigh.batchesPerSecond = gyroBatchesPerSecHigh; + sensor_perf_config_req.gyroSamplingSpecHigh.samplesPerBatch = gyroSamplesPerBatchHigh; sensor_perf_config_req.algorithmConfig_valid = 1; sensor_perf_config_req.algorithmConfig = algorithmConfig; diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h index 04f931ee..60c2a5ce 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -157,7 +157,9 @@ public: virtual enum loc_api_adapter_err setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, int algorithmConfig); + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig); virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging); }; diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c index ebd1a376..e1bf6f55 100644 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -578,6 +578,25 @@ static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocMotionDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), + + QMI_IDL_FLAG_END_VALUE +}; + /*Message Definitions*/ static const uint8_t qmiLocGenRespMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, @@ -1805,10 +1824,15 @@ static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) }; static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { @@ -1848,10 +1872,15 @@ static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) }; static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { @@ -1977,10 +2006,22 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), 19, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), + 19, 0 }; static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { @@ -2022,10 +2063,22 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), 19, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), + 19, 0 }; static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { @@ -2440,6 +2493,43 @@ static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) }; +static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), + 33, 0 +}; + +static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), + QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) +}; + /* Type Table */ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, @@ -2474,7 +2564,8 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02} + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02} }; /* Message Table */ @@ -2602,7 +2693,11 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02} + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02} }; /* Predefine the Type Table Object */ @@ -2662,13 +2757,13 @@ static const qmi_idl_service_message_table_entry loc_service_command_messages_v0 {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 25}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 32}, {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 28}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, @@ -2678,7 +2773,9 @@ static const qmi_idl_service_message_table_entry loc_service_command_messages_v0 {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7} + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { @@ -2736,7 +2833,9 @@ static const qmi_idl_service_message_table_entry loc_service_response_messages_v {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7} + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7} }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { @@ -2789,13 +2888,13 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 32}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 39}, {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 35}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, @@ -2807,7 +2906,9 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391} + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82} }; /*Service Object*/ @@ -2821,7 +2922,7 @@ struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, &loc_qmi_idl_type_table_object_v02, - 0x0B, + 0x0D, NULL }; diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h index c3d67702..d2da6915 100644 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -82,11 +82,11 @@ extern "C" { /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x0B +#define LOC_V02_IDL_MINOR_VERS 0x0D /** Major Version Number of the qmi_idl_compiler used to generate this file */ #define LOC_V02_IDL_TOOL_VERS 0x05 /** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x0067; +#define LOC_V02_MAX_MESSAGE_ID 0x0069; /** @} */ @@ -180,6 +180,10 @@ extern "C" { /** Maximum length of the SUPL certificate. */ #define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 + +/** Maximum length of the Network Initiated Geofence ID + list */ +#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 /** @} */ @@ -476,6 +480,8 @@ typedef uint32_t qmiLocPosTechMaskT_v02; #define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix. */ /** @addtogroup loc_qmi_enums @{ */ @@ -836,7 +842,8 @@ typedef struct { - 0x00000002 -- CELLID \n - 0x00000004 -- WIFI \n - 0x00000008 -- SENSORS \n - - 0x00000010 -- REFERENCE_LOCATION */ + - 0x00000010 -- REFERENCE_LOCATION \n + - 0x00000020 -- INJECTED_COARSE_POSITION */ /* Optional */ /* Dilution of Precision */ @@ -2671,7 +2678,7 @@ typedef struct { Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING - \item 0x00000001 -- GEOFENCE_BREACH_TYPE_LEAVING + \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING \vspace{-0.18in} \end{itemize1} */ @@ -4766,10 +4773,12 @@ typedef enum { eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. - Use cell ID. For 1x, this mode corresponds to - AFLT. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for GSM/UMTS network + Use WWAN measurements to calculate position. If this mode is + set then for 1x network AFLT will used and for LTE network + OTDOA will used. */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocOperationModeEnumT_v02; /** @@ -4796,6 +4805,7 @@ typedef struct { \item 0x00000003 -- OPER_MODE_MSA \item 0x00000004 -- OPER_MODE_STANDALONE \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN \vspace{-0.18in} \end{itemize1} */ }qmiLocSetOperationModeReqMsgT_v02; /* Message */ @@ -4874,6 +4884,7 @@ typedef struct { \item 0x00000003 -- OPER_MODE_MSA \item 0x00000004 -- OPER_MODE_STANDALONE \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN \vspace{-0.18in} \end{itemize1} */ }qmiLocGetOperationModeIndMsgT_v02; /* Message */ @@ -5550,6 +5561,9 @@ typedef enum { typedef uint32_t qmiLocLppConfigMaskT_v02; #define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ #define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ +typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in Control Plane */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in User Plane */ /** @addtogroup loc_qmi_messages @{ */ @@ -5603,6 +5617,20 @@ typedef struct { \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Configures the protocols that the location service can indicate it supports, + for Assisted Glonass. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP + \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP + \vspace{-0.18in} \end{itemize1} + */ }qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -5613,6 +5641,7 @@ typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the LPP configuration parameter. */ /** @addtogroup loc_qmi_messages @{ */ @@ -5651,6 +5680,7 @@ typedef struct { \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL \vspace{-0.18in} \end{itemize1} */ }qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ @@ -5676,6 +5706,7 @@ typedef struct { \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL \vspace{-0.18in} \end{itemize1} */ }qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ @@ -5753,6 +5784,19 @@ typedef struct { \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Assisted GLONASS Protocol Mask. + + Valid bitmasks: + \begin{itemize1} + \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP + \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP + \vspace{-0.18in} \end{itemize1} + */ }qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -6181,10 +6225,12 @@ typedef struct { uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal - number of samples per batch and the number of batches per second. + acceleration data to be used by the low data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. + The default specification is 10Hz sampling rate and 2Hz batching rate. */ /* Optional */ @@ -6192,10 +6238,12 @@ typedef struct { uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. + The default specification is 10Hz sampling rate and 2Hz batching rate. */ /* Optional */ @@ -6209,6 +6257,32 @@ typedef struct { \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + The default specification is 100Hz sampling rate and 4Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + The default specification is 100Hz sampling rate and 4Hz batching rate. + */ }qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ /** @} @@ -6219,6 +6293,8 @@ typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ #define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ /** @addtogroup loc_qmi_messages @{ */ @@ -6256,6 +6332,8 @@ typedef struct { \item 0x00000002 -- ACCEL_SAMPLING_SPEC \item 0x00000004 -- GYRO_SAMPLING_SPEC \item 0x00000008 -- ALGORITHM_CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ @@ -6317,10 +6395,12 @@ typedef struct { uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. + The default specification is 10Hz sampling rate and 2Hz batching rate. */ /* Optional */ @@ -6328,10 +6408,12 @@ typedef struct { uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. + The default specification is 10Hz sampling rate and 2Hz batching rate. */ /* Optional */ @@ -6345,6 +6427,32 @@ typedef struct { \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + The default specification is 100Hz sampling rate and 4Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + The default specification is 100Hz sampling rate and 4Hz batching rate. + */ }qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @} @@ -7409,6 +7517,7 @@ typedef struct { \item 0x00000004 -- WIFI \item 0x00000008 -- SENSORS \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7465,6 +7574,193 @@ typedef struct { @} */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is stationary + Device state is in motion */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, + QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in pedestrian mode, nothing else is known about the movement */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian walking mode */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian running mode + Device movement is in vehicular mode, nothing else is known about the movement */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, + QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocMotionStateEnumT_v02 motion_state; + /**< Current motion state of the user. States of user motion: \n + Options are: */ + + qmiLocMotionModeEnumT_v02 motion_mode; + /**< Modes of user motion.\n + Options are: */ + + float probability_of_state; + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.06in} + + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.06in} + + It is recommended that if a particular combination of motion_state and + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} + + If the motion_state is not known, the value in this field is not used. + */ + + uint16_t age; + /**< Age of the motion data in milliseconds at the time of injection. + */ + + uint16_t timeout; + /**< If the age of the motion data input exceeds the timeout value, it + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied indefinitely until the next input is + received. \vspace{0.06in} + + If the determination of motion data is an instantaneous observation, + and no notice is guaranteed to be given via QMI on a change in the + state of motion data, it is recommended that this field be set to 0. \vspace{0.06in} + + If the determination of motion data is continuously monitored + external to QMI, and an update is always applied to QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. + */ +}qmiLocMotionDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Motion Data */ + qmiLocMotionDataStructT_v02 motion_data; +}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Inject motion data request status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Motion Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + */ +}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve the list of network + initiated geofence ID's. */ +typedef struct { + + /* Mandatory */ + /* Transaction Id */ + uint32_t transactionId; + /**< Identifies the transaction, the same transaction Id + will be returned in the Get NI Geofence ID List indication. + - Type -- Unsigned Integer. */ +}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve the list of network + initiated geofence ID's. */ +typedef struct { + + /* Mandatory */ + /* Get NI Geofence ID List status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NI Geofence ID List request. + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction Id */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction Id which was specified in the Get NI + Geofence ID List request. + - Type -- Unsigned Integer. */ + + /* Optional */ + /* NI Geofence ID List */ + uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ + uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ + uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; + /**< List containing the NI Geofence Id's. + - Type: Array of unsigned 32 bit integers. \n + - Maximum NI Geofence ID List length : 16 */ +}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ +/** + @} + */ + /*Service Message Definition*/ /** @addtogroup loc_qmi_msg_ids @{ @@ -7647,6 +7943,12 @@ typedef struct { #define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 #define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 #define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 +#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 /** @} */ From 72e3b852ded1c9221e9b98001172eb6deb44164f Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 15 Aug 2012 15:06:22 -0700 Subject: [PATCH 037/945] loc_api_v02: Initialize the QMI notifier before looking for service Looking for a service results in opening and closing the IPC Router socket. This in turn involves IPC Router to trigger loading & unloading the modem. Sometimes this causes the race condition between modem unload and modem coming out of reset. CRs-fixed: 384906 Change-Id: I61767d3eeab5867f64f94c5d4cdee4272de2dc44 --- loc_api/loc_api_v02/loc_api_v02_client.c | 54 ++++++++++-------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 26ecfd26..12782b93 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1543,6 +1543,8 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( uint32_t num_services = 0, num_entries = 0; qmi_client_error_type rc = QMI_NO_ERR; bool nosignal = false; + qmi_client_os_params os_params; + int timeout = 0; // Get the service object for the qmiLoc Service qmi_idl_service_object_type locClientServiceObject = @@ -1557,46 +1559,34 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( break; } - // get the service addressing information - rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, - &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " - "num_services %d", __func__, __LINE__, rc, num_services); + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); if (rc != QMI_NO_ERR) { - // bummer, service list is not up. - // We need to try again after a timed wait - qmi_client_os_params os_params; - int timeout = 0; - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - notifierInitFlag = (NULL != notifier); + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + // get the service addressing information + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ if (rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + } - // get the service addressing information - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " - "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); - } + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " + "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); if (0 == num_services || rc != QMI_NO_ERR) { if (!nosignal) { From b1595d72cb42fead7ece9c6f74244f1485d5a827 Mon Sep 17 00:00:00 2001 From: Nagender Telkar Date: Mon, 13 Aug 2012 20:00:28 -0700 Subject: [PATCH 038/945] build: Include path to TARGET_OUT_HEADERS in LOCAL_C_INCLUDES Change-Id: I5cd48e37ef747a021329f8d166320ee88ef2fd3e --- loc_api/loc_api_v02/Android.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk index b6c7a66e..63b28663 100644 --- a/loc_api/loc_api_v02/Android.mk +++ b/loc_api/loc_api_v02/Android.mk @@ -30,10 +30,9 @@ LOCAL_CFLAGS += \ ## Includes LOCAL_C_INCLUDES := \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/qmi-framework/inc \ + $(TARGET_OUT_HEADERS)/qmi/inc \ $(TARGET_OUT_HEADERS)/gps.utils LOCAL_PRELINK_MODULE := false From 0a49d62c7ad2e256da072f469cc9497e9555d025 Mon Sep 17 00:00:00 2001 From: "woojin.shin" Date: Wed, 25 Jul 2012 21:52:18 +0900 Subject: [PATCH 039/945] gps: enable nmea callback Add code for calling NMEA callback for receiving NMEA. Change-Id: I04689cbc166e3db9d4479bf85636363a87176468 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 + 1 file changed, 1 insertion(+) mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng.cpp diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp old mode 100755 new mode 100644 index 4d032dce..137a7227 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1500,6 +1500,7 @@ static void loc_eng_deferred_action_thread(void* arg) gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); } break; From 7ce61c42e25569f0250dd44832784557fff5db56 Mon Sep 17 00:00:00 2001 From: Neethu Joseph Date: Mon, 25 Jun 2012 10:36:48 -0700 Subject: [PATCH 040/945] loc_api: Send position technology mask to ulp Sends the technology mask of the position report to ulp and blocks the injected wifi fix from getting reported as final Change-Id: I3a9b390d3d6d9be1a913731d6e8d8ee1d3ced686 --- loc_api/libloc_api_50001/LocApiAdapter.cpp | 6 ++++-- loc_api/libloc_api_50001/LocApiAdapter.h | 3 ++- loc_api/libloc_api_50001/loc.h | 9 +++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 10 +++++++++- loc_api/libloc_api_50001/loc_eng_msg.h | 17 ++++++++++++++--- loc_api/libloc_api_50001/loc_eng_msg_id.h | 6 ++++++ loc_api/loc_api_v02/LocApiV02Adapter.cpp | 8 +++++++- 7 files changed, 51 insertions(+), 8 deletions(-) mode change 100644 => 100755 loc_api/libloc_api_50001/LocApiAdapter.cpp mode change 100644 => 100755 loc_api/libloc_api_50001/LocApiAdapter.h mode change 100644 => 100755 loc_api/libloc_api_50001/loc.h mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng.cpp mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_msg.h mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_msg_id.h mode change 100644 => 100755 loc_api/loc_api_v02/LocApiV02Adapter.cpp diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp old mode 100644 new mode 100755 index b7ebc6f5..1bf7a8e0 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -114,12 +114,14 @@ int LocApiAdapter::decodeAddress(char *addr_string, int string_size, void LocApiAdapter::reportPosition(GpsLocation &location, void* locationExt, - enum loc_sess_status status) + enum loc_sess_status status, + LocPosTechMask loc_technology_mask ) { loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, location, locationExt, - status)); + status, + loc_technology_mask)); if (locEngHandle.sendUlpMsg) { locEngHandle.sendUlpMsg(locEngHandle.owner, msg); } else { diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h old mode 100644 new mode 100755 index 57d0eae0..59caaf62 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -122,7 +122,8 @@ public: void reportPosition(GpsLocation &location, void* locationExt, - enum loc_sess_status status); + enum loc_sess_status status, + LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); void reportSv(GpsSvStatus &svStatus, void* svExt); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h old mode 100644 new mode 100755 index 233b34c3..17f6ab70 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -80,6 +80,15 @@ enum loc_sess_status { 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) + void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp old mode 100644 new mode 100755 index 821d9624..562a30c2 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1484,13 +1484,21 @@ static void loc_eng_deferred_action_thread(void* arg) } // what's in the else if is... (line by line) // 1. this is a good fix; or + // 1.1 there is source info; or + // 1.1.1 this is from hybrid provider; + // 1.2 it is a Satellite fix; or + // 1.2.1 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 == rpMsg->status || + else if ((LOC_SESS_SUCCESS == rpMsg->status && + ((LOCATION_HAS_SOURCE_INFO == rpMsg->location.flags && + ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || + ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || + (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && (gps_conf.ACCURACY_THRES != 0) && diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h old mode 100644 new mode 100755 index adc138fe..d846a1f3 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -319,15 +319,26 @@ struct loc_eng_msg_report_position : public loc_eng_msg { const GpsLocation location; const void* locationExt; const enum loc_sess_status status; + const LocPosTechMask technology_mask; inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, enum loc_sess_status st) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExt(locExt), status(st) + location(loc), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) { - 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", + 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", location.flags, location.position_source, location.latitude, location.longitude, location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData,status); + location.timestamp, location.rawDataSize, location.rawData,status,technology_mask); + } + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + enum loc_sess_status st, LocPosTechMask technology) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), + location(loc), locationExt(locExt), status(st), technology_mask(technology) + { + 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", + location.flags, location.position_source, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, location.rawDataSize, location.rawData,status,technology_mask); } }; diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h old mode 100644 new mode 100755 index 0c3f5755..0761b89d --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -115,6 +115,12 @@ enum loc_eng_msg_ids_t { // Message is sent by QUIPC module in order to request some info from ULP ULP_MSG_REQUEST_COARSE_POSITION, + // Message is sent to ULP module to re-evaluate its subsystems + ULP_MSG_MONITOR, + + // Last ULP MSG + ULP_MSG_LAST = 0x700, + /* Message is sent by HAL to LOC API to configure LTE Positioning Profile in modem */ LOC_ENG_MSG_LPP_CONFIG, diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp old mode 100644 new mode 100755 index f352af19..68057bcd --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1550,6 +1550,7 @@ void LocApiV02Adapter :: reportPosition ( const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) { GpsLocation location; + LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; LOC_LOGD("Reporting postion from V2 Adapter\n"); memset(&location, 0, sizeof (GpsLocation)); location.size = sizeof(location); @@ -1607,6 +1608,10 @@ void LocApiV02Adapter :: reportPosition ( location.flags |= GPS_LOCATION_HAS_ACCURACY; location.accuracy = location_report_ptr->horUncCircular; } + + // Technology Mask + tech_Mask |= location_report_ptr->technologyMask; + //Mark the location source as from GNSS location.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_GNSS; @@ -1614,7 +1619,8 @@ void LocApiV02Adapter :: reportPosition ( locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + tech_Mask); } } else From 332389d67fe3aadbf53e68d50f508eff1c458ef3 Mon Sep 17 00:00:00 2001 From: Neethu Joseph Date: Wed, 29 Aug 2012 12:16:57 -0700 Subject: [PATCH 041/945] loc_api: Fix QUIPS position being dropped at GPS HAL Change-Id: I10606597f39b29fd4b3a8acfacd9a8c17aa9713f --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 562a30c2..f7161da8 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1495,7 +1495,7 @@ static void loc_eng_deferred_action_thread(void* arg) // 2.2.2 we care about inaccuracy; and // 2.2.3 the inaccuracy exceeds our tolerance else if ((LOC_SESS_SUCCESS == rpMsg->status && - ((LOCATION_HAS_SOURCE_INFO == rpMsg->location.flags && + (((LOCATION_HAS_SOURCE_INFO & rpMsg->location.flags) && ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || From b4f4652ce2fd32745382249a323b9f09db95bf7f Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 31 Aug 2012 15:48:18 -0700 Subject: [PATCH 042/945] gps: add support for msm8974 Change-Id: I4a4520bcfb118fea8dfc244efff4837003466d34 --- loc_api/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 7e1e35f8..20ff0727 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -15,6 +15,7 @@ endif #TARGET_NO_RPC #add QMI libraries for QMI targets QMI_BOARD_PLATFORM_LIST := msm8960 +QMI_BOARD_PLATFORM_LIST += msm8974 ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ From d3b220c611eef4c56f7a818338556f9c71846ace Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 7 Sep 2012 14:59:53 -0700 Subject: [PATCH 043/945] gps: fix SSR issue If service list check fails initially while the modem is not up yet, the rc is not updated after client gets signaled that the modem is now up. Change-Id: I5fe05ddad7764874eda45521e9394bfbee0eb85f CRs-fixed: 385158 --- loc_api/loc_api_v02/loc_api_v02_client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 12782b93..7294d33e 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1580,6 +1580,9 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( if (rc != QMI_NO_ERR) { QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + if (!nosignal) + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); } timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; From 02d13cc646ea79aa97af45b4bff0565906ce27af Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 27 Jun 2012 16:28:45 -0700 Subject: [PATCH 044/945] gps: control session state evt from HAL, not modem Suppress the registering for QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 event from modem, that is normally responsible for generating GPS_STATUS_SESSION_BEGIN and GPS_STATUS_SESSION_END, and instead initiate these events from hal from when we get GPS_STATUS_ENGINE_ON and GPS_STATUS_ENGINE_OFF Change-Id: I9d220bef7ee4f989a3982d888ed46279861f612d CRs-fixed: 370904 --- .../src/LocApiRpcAdapter.cpp | 17 ++++++----------- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 17 ++++++++++------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 843a8ae9..84d2bb88 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -797,29 +797,24 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) { - GpsStatusValue status = GPS_STATUS_NONE; 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) { - status = GPS_STATUS_ENGINE_ON; + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::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) { - status = GPS_STATUS_ENGINE_OFF; + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); } - } else if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE) { - if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_BEGIN) + else { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_END) - { - status = GPS_STATUS_SESSION_END; + LocApiAdapter::reportStatus(GPS_STATUS_NONE); } } - LocApiAdapter::reportStatus(status); } void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 68057bcd..196e6878 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1495,8 +1495,7 @@ locClientEventMaskType LocApiV02Adapter :: convertMask( if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 | - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02); + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); } if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) @@ -1749,21 +1748,25 @@ void LocApiV02Adapter :: reportSv ( void LocApiV02Adapter :: reportEngineState ( const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) { - GpsStatusValue status; LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, engine_state_ptr->engineState); - status = GPS_STATUS_NONE; if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) { - status = GPS_STATUS_ENGINE_ON; + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); } else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) { - status = GPS_STATUS_ENGINE_OFF; + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); } - LocApiAdapter::reportStatus(status); + else + { + LocApiAdapter::reportStatus(GPS_STATUS_NONE); + } + } /* convert fix session state report to loc eng format and send the converted From 0620ede4b35e753ba1cc9858baf6cd1d3faede4d Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Mon, 10 Sep 2012 19:38:51 -0700 Subject: [PATCH 045/945] Reduce default logging verbosity to error & warning logs only Change-Id: I3da98ccc8e1dfc1d0ef9f51bd96d22fc385ba529 --- etc/gps.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index cd3dadaf..322fe162 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -13,7 +13,7 @@ XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose -DEBUG_LEVEL = 3 +DEBUG_LEVEL = 2 # Intermediate position report, 1=enable, 0=disable INTERMEDIATE_POS=0 @@ -88,4 +88,4 @@ ENABLE_WIPER=1 # LTE Positioning Profile Settings #################################### # 0: Enable RRLP on LTE(Default) 1: Enable LPP_User_Plane on LTE -LPP_PROFILE = 0 \ No newline at end of file +LPP_PROFILE = 0 From 06ce79b8fa87383a5740edf04691e3e9bb275f7f Mon Sep 17 00:00:00 2001 From: Vineela Tummalapalli Date: Tue, 11 Sep 2012 12:51:22 +0530 Subject: [PATCH 046/945] GPS: fix the issue that GNSS position report are dropped in PPC based target Change-Id: I94fb2bd12ac8751cbd2366a4cc5fde4b52d17f64 CRs-Fixed: 395398 --- .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 843a8ae9..bd384717 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -624,6 +624,8 @@ LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { + LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; + GpsLocation location = {0}; location.size = sizeof(location); @@ -678,6 +680,10 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca location.flags |= GPS_LOCATION_HAS_ACCURACY; location.accuracy = location_report_ptr->hor_unc_circular; } + + // Technology Mask + + tech_Mask |= location_report_ptr->technology_mask; //Mark the location source as from GNSS location.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_GNSS; @@ -685,7 +691,8 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca LocApiAdapter::reportPosition(location, locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + tech_Mask); } } else From 4d0a38184823255fedec03d8844a097eaed21afe Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 14 Sep 2012 13:24:40 -0700 Subject: [PATCH 047/945] gps: launch GSS on bootup even if GPS is disabled Move the launching of GSS from loc_init to get_gps_interface, since loc_init is only called by AFW when GPS is enabled. CRs-fixed: 399637 Change-Id: I7cf8500f6a345f3bef71f717c595ea734da2bff2 --- loc_api/libloc_api_50001/loc.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index c0378fdf..baba3d7c 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -270,6 +270,17 @@ extern "C" const GpsInterface* get_gps_interface() if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { loc_eng_ulp_inf = loc_eng_get_ulp_inf(); } + + if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) + { + 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)); + } + LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); + } + return &sLocEngInterface; } @@ -327,17 +338,6 @@ static int loc_init(GpsCallbacks* callbacks) gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; - if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) - { - 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)); - return NULL; - } - LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); - } - int retVal = -1; if (loc_eng_ulp_inf == NULL) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, From ac8fa07a02d75e9550c11997c7234d6128067534 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Wed, 12 Sep 2012 11:20:16 -0700 Subject: [PATCH 048/945] gps: control session state evt from HAL, not modem Suppress the registering for QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 event from modem, that is normally responsible for generating GPS_STATUS_SESSION_BEGIN and GPS_STATUS_SESSION_END, and instead initiate these events from hal from when we get GPS_STATUS_ENGINE_ON and GPS_STATUS_ENGINE_OFF. Change-Id: I9d220bef7ee4f989a3982d888ed46279861f612d --- .../src/LocApiRpcAdapter.cpp | 17 ++++++----------- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 17 ++++++++++------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 48b3a0fe..53effc56 100755 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -769,29 +769,24 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) { - GpsStatusValue status = GPS_STATUS_NONE; 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) { - status = GPS_STATUS_ENGINE_ON; + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::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) { - status = GPS_STATUS_ENGINE_OFF; + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); } - } else if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE) { - if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_BEGIN) + else { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state == RPC_LOC_FIX_SESSION_STATE_END) - { - status = GPS_STATUS_SESSION_END; + LocApiAdapter::reportStatus(GPS_STATUS_NONE); } } - LocApiAdapter::reportStatus(status); } void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index e223983b..a60c4f79 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1406,8 +1406,7 @@ locClientEventMaskType LocApiV02Adapter :: convertMask( if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 | - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02); + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); } if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) @@ -1652,21 +1651,25 @@ void LocApiV02Adapter :: reportSv ( void LocApiV02Adapter :: reportEngineState ( const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) { - GpsStatusValue status; LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, engine_state_ptr->engineState); - status = GPS_STATUS_NONE; if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) { - status = GPS_STATUS_ENGINE_ON; + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); } else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) { - status = GPS_STATUS_ENGINE_OFF; + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); } - LocApiAdapter::reportStatus(status); + else + { + LocApiAdapter::reportStatus(GPS_STATUS_NONE); + } + } /* convert fix session state report to loc eng format and send the converted From 197fe088f73d03b66dcf4d02e1f454ff89f70fa7 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Tue, 11 Sep 2012 15:14:48 -0700 Subject: [PATCH 049/945] dynamically build and load adapter libs This is to support bringup efforts. This change will decouple the dependencies between GPS HAL and proprietary QMI headers, so that we can build HAL without any proprietary repos. Change-Id: I7b836d09f4ac6b1a1bdb38f8d6a2bfb90bb5bf01 Signed-off-by: Iliyan Malchev --- loc_api/Android.mk | 4 +++ .../src/LocApiRpcAdapter.cpp | 2 +- loc_api/libloc_api_50001/Android.mk | 10 ++----- loc_api/libloc_api_50001/LocApiAdapter.cpp | 30 +++++++++++++++++++ loc_api/libloc_api_50001/LocApiAdapter.h | 5 +++- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2 +- 7 files changed, 43 insertions(+), 12 deletions(-) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 7e09d5f9..bf5281ea 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -12,6 +12,8 @@ LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := +ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-frameworks && echo exists)) + # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) @@ -25,6 +27,8 @@ GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ endif #TARGET_NO_RPC +endif + GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ #call the subfolders diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 53effc56..ec98bed2 100755 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -98,7 +98,7 @@ static void loc_rpc_global_cb(void* user, CLIENT* clnt, enum rpc_reset_event eve } -LocApiAdapter* getLocApiAdapter(LocEng &locEng) +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) { return new LocApiRpcAdapter(locEng); } diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 0a5a0a10..f37ca311 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -18,7 +18,8 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - libgps.utils + libgps.utils \ + libdl LOCAL_SRC_FILES += \ loc_eng_log.cpp \ @@ -78,13 +79,6 @@ LOCAL_SRC_FILES += \ loc_eng_dmn_conn_glue_msg.c \ loc_eng_dmn_conn_glue_pipe.c -## Check if RPC is not unsupported -ifneq ($(TARGET_NO_RPC),true) -LOCAL_SHARED_LIBRARIES += libloc_api-rpc-qc -else -LOCAL_SHARED_LIBRARIES += libloc_api_v02 -endif #TARGET_NO_RPC - LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index e631642d..a6a1ed94 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -29,6 +29,7 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_adapter" +#include #include #include "loc_eng_msg.h" #include "loc_log.h" @@ -66,6 +67,35 @@ LocApiAdapter::~LocApiAdapter() LOC_LOGV("LocApiAdapter deleted"); } +LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) +{ + void* handle; + LocApiAdapter* adapter = NULL; + + handle = dlopen ("libloc_api_v02.so", RTLD_NOW); + + if (!handle) { + LOC_LOGI("%s: dlopen(libloc_api_v02.so) failed, trying to load libloc_api-rpc-qc.so", __FUNCTION__); + handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); + } + else + LOC_LOGE("%s: dlopen(libloc_api_v02.so) succeeded.", __FUNCTION__); + + if (!handle) { + LOC_LOGI("%s: dlopen(libloc_api-rpc-qc.so) failed, constructing LocApiAdapter", __FUNCTION__); + adapter = new LocApiAdapter(locEng); + } else { + getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); + if (!getHandle) { + LOC_LOGE("%s: dlsym(getLocApiAdapter) failed", __FUNCTION__); + return NULL; + } + adapter = (*getHandle)(locEng); + } + + return adapter; +} + int LocApiAdapter::hexcode(char *hexstring, int string_size, const char *data, int data_size) { diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 033a034c..5e8a1da8 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -107,6 +107,8 @@ public: //LocApiAdapter(int q, reportCb_t[LOC_API_ADAPTER_EVENT_MAX] callbackTable); virtual ~LocApiAdapter(); + static LocApiAdapter* getLocApiAdapter(LocEng &locEng); + static int hexcode(char *hexstring, int string_size, const char *data, int data_size); static int decodeAddress(char *addr_string, int string_size, @@ -199,7 +201,8 @@ public: {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} }; -LocApiAdapter* getLocApiAdapter(LocEng &locEng); +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng); +typedef LocApiAdapter* (getLocApiAdapter_t)(LocEng&); #endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 137a7227..747268da 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -265,7 +265,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); - loc_eng_data.client_handle = getLocApiAdapter(locEngHandle); + loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); int ret_val =-1; if (NULL == loc_eng_data.client_handle) { diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index a60c4f79..cfb2265d 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -2053,7 +2053,7 @@ void LocApiV02Adapter :: errorCb(locClientHandleType handle, } /* return a Loc API adapter */ -LocApiAdapter* getLocApiAdapter(LocEng &locEng) +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) { return(new LocApiV02Adapter(locEng)); } From ca3538229bd28a562717d2b8963d0a344c7d78e0 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Sun, 16 Sep 2012 15:00:23 -0700 Subject: [PATCH 050/945] gps: Fix typo in checking for qmi-framework b/7175603 This caused one of the gps related libraries to be not built in the full tree, causing GPS failure Change-Id: Iff51c1a588a22f0b46b075ebf27d2b6493b97e40 Signed-off-by: Iliyan Malchev --- CleanSpec.mk | 1 + loc_api/Android.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index b84e1b65..dd1849db 100755 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -47,3 +47,4 @@ # ************************************************ # 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/loc_api/Android.mk b/loc_api/Android.mk index bf5281ea..d2f53c58 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -12,7 +12,7 @@ LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := -ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-frameworks && echo exists)) +ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) From a3409617b658f1e732b154802d0a88dcee83912e Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 7 Aug 2012 10:29:30 -0700 Subject: [PATCH 051/945] gps: AP NMEA generation Generate NMEA sentences on the AP Change-Id: Ifc9e9263868ab4dec450bef35c53c441c881a072 --- .../src/LocApiRpcAdapter.cpp | 32 +- loc_api/libloc_api_50001/Android.mk | 3 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 8 +- loc_api/libloc_api_50001/LocApiAdapter.h | 7 +- loc_api/libloc_api_50001/loc_eng.cpp | 26 +- loc_api/libloc_api_50001/loc_eng.h | 15 +- loc_api/libloc_api_50001/loc_eng_msg.h | 45 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 703 ++++++++++++++++++ loc_api/libloc_api_50001/loc_eng_nmea.h | 42 ++ loc_api/loc_api_v02/LocApiV02Adapter.cpp | 32 +- 10 files changed, 896 insertions(+), 17 deletions(-) create mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.h diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 843a8ae9..5754a4c9 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -625,8 +625,10 @@ LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { GpsLocation 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 @@ -681,8 +683,22 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca //Mark the location source as from GNSS location.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_MAG_DEV; + locationExtended.magneticDeviation = 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; + } + LOC_LOGV("reportPosition: fire callback\n"); LocApiAdapter::reportPosition(location, + locationExtended, locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); @@ -691,6 +707,7 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca else { LocApiAdapter::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); @@ -705,6 +722,8 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus = {0}; + GpsLocationExtended locationExtended = {0}; + locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; const rpc_loc_sv_info_s_type *sv_info_ptr; @@ -788,9 +807,20 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) } } + 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) { LocApiAdapter::reportSv(SvStatus, + locationExtended, locEngHandle.extSvInfo((void*)gnss_report_ptr)); } } diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 4e5973d6..0bf889ef 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -65,7 +65,8 @@ LOCAL_SRC_FILES += \ loc_eng_agps.cpp \ loc_eng_xtra.cpp \ loc_eng_ni.cpp \ - loc_eng_log.cpp + loc_eng_log.cpp \ + loc_eng_nmea.cpp ifeq ($(FEATURE_GNSS_BIT_API), true) LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index 1bf7a8e0..6bd79bbe 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -113,12 +113,14 @@ int LocApiAdapter::decodeAddress(char *addr_string, int string_size, } void LocApiAdapter::reportPosition(GpsLocation &location, + GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask ) { loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, location, + locationExtended, locationExt, status, loc_technology_mask)); @@ -129,9 +131,9 @@ void LocApiAdapter::reportPosition(GpsLocation &location, } } -void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { - loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, 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 diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 59caaf62..80a675d8 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -121,10 +121,13 @@ public: const char *data, int data_size); void reportPosition(GpsLocation &location, + GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GpsSvStatus &svStatus, void* svExt); + void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); void reportAgpsStatus(AGpsStatus &agpsStatus); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f7161da8..5075311e 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-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 @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,7 @@ static loc_param_s_type loc_parameter_table[] = {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, NULL, 'n'}, + {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, &gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, @@ -111,6 +113,7 @@ static void loc_default_parameters(void) gps_conf.INTERMEDIATE_POS = 0; gps_conf.ACCURACY_THRES = 0; gps_conf.ENABLE_WIPER = 0; + gps_conf.NMEA_PROVIDER = 0; gps_conf.SUPL_VER = 0x10000; gps_conf.CAPABILITIES = 0x7; @@ -303,6 +306,16 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, // 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 + { + loc_eng_data.generateNmea = false; + } + LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); @@ -1523,6 +1536,11 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_data_p->client_handle->setInSession(false); } + if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) + { + loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended); + } + // Free the allocated memory for rawData GpsLocation* gp = (GpsLocation*)&(rpMsg->location); if (gp != NULL && gp->rawData != NULL) @@ -1543,6 +1561,12 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), (void*)rsMsg->svExt); } + + if (loc_eng_data_p->generateNmea) + { + loc_eng_nmea_generate_sv(loc_eng_data_p, rsMsg->svStatus, rsMsg->locationExtended); + } + } break; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index a14f5bd1..1b9dcf58 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-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 @@ -68,6 +68,11 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 +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, @@ -128,6 +133,13 @@ typedef struct // For muting session broadcast loc_mute_session_e_type mute_session_state; + // For nmea generation + boolean generateNmea; + uint32_t sv_used_mask; + float hdop; + float pdop; + float vdop; + // Address buffers, for addressing setting before init int supl_host_set; char supl_host_buf[101]; @@ -149,6 +161,7 @@ typedef struct loc_gps_cfg_s unsigned long INTERMEDIATE_POS; unsigned long ACCURACY_THRES; unsigned long ENABLE_WIPER; + uint8_t NMEA_PROVIDER; unsigned long SUPL_VER; unsigned long CAPABILITIES; uint8_t GYRO_BIAS_RANDOM_WALK_VALID; diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index d846a1f3..9dffc280 100755 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2012 Code Aurora Forum. All rights reserved. +/* 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 @@ -98,6 +98,35 @@ struct LocPosMode } }; +/** 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 +/** GpsLocation has valid magnetic deviation. */ +#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004 +/** GpsLocation has valid mode indicator. */ +#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008 + +/** 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; +} GpsLocationExtended; + typedef enum { LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, LOC_ENG_IF_REQUEST_TYPE_WIFI, @@ -317,23 +346,24 @@ struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { struct loc_eng_msg_report_position : public loc_eng_msg { const GpsLocation location; + const GpsLocationExtended locationExtended; const void* locationExt; const enum loc_sess_status status; const LocPosTechMask technology_mask; - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) + location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) { 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", location.flags, location.position_source, location.latitude, location.longitude, location.altitude, location.speed, location.bearing, location.accuracy, location.timestamp, location.rawDataSize, location.rawData,status,technology_mask); } - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st, LocPosTechMask technology) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExt(locExt), status(st), technology_mask(technology) + location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(technology) { 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", location.flags, location.position_source, location.latitude, location.longitude, @@ -344,9 +374,10 @@ struct loc_eng_msg_report_position : public loc_eng_msg { struct loc_eng_msg_report_sv : public loc_eng_msg { const GpsSvStatus svStatus; + const GpsLocationExtended locationExtended; const void* svExt; - inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) + inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, GpsLocationExtended &locExtended, void* ext) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), locationExtended(locExtended), svExt(ext) { LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp new file mode 100644 index 00000000..a0a3f202 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -0,0 +1,703 @@ +/* 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*=========================================================================== +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; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); + 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++; + } + + int checksumLength = snprintf(pNmea, maxSize,"*%02X\r\n", checksum); + return (length + checksumLength); +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_pos + +DESCRIPTION + Generate NMEA sentences generated based on position report + +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 GpsLocation &location, const GpsLocationExtended &locationExtended) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + + time_t utcTime(location.timestamp/1000); + tm * pTm = gmtime(&utcTime); + 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; + + // ------------------ + // ------$GPGSA------ + // ------------------ + + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + uint32_t mask = loc_eng_data_p->sv_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->sv_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); + + // ------------------ + // ------$GPVTG------ + // ------------------ + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + if (location.flags & GPS_LOCATION_HAS_BEARING) + { + float magTrack = location.bearing; + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) + { + float magTrack = location.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.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.flags & GPS_LOCATION_HAS_SPEED) + { + float speedKnots = location.speed * (3600.0/1852.0); + float speedKmPerHour = location.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.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->client_handle->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,A," , + utcHours, utcMinutes, utcSeconds); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.flags & GPS_LOCATION_HAS_LAT_LONG) + { + double latitude = location.latitude; + double longitude = location.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.flags & GPS_LOCATION_HAS_SPEED) + { + float speedKnots = location.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.flags & GPS_LOCATION_HAS_BEARING) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.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.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->client_handle->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," , + utcHours, utcMinutes, utcSeconds); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.flags & GPS_LOCATION_HAS_LAT_LONG) + { + double latitude = location.latitude; + double longitude = location.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.flags & GPS_LOCATION_HAS_LAT_LONG)) + gpsQuality = '0'; // 0 means no fix + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->client_handle->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.flags & GPS_LOCATION_HAS_ALTITUDE) && + (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", + location.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); + + // 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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + + // ------------------ + // ------$GPGSV------ + // ------------------ + + if (svStatus.num_svs <= 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 + { + int svCount = svStatus.num_svs; + int sentenceCount = svCount / 4; + if (svStatus.num_svs % 4) + sentenceCount++; + int sentenceNumber = 1; + int svNumber = 1; + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d", + sentenceCount, sentenceNumber, svCount); + + 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); i++, svNumber++) + { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svStatus.sv_list[svNumber-1].prn, + (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int + (int)(0.5 + svStatus.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.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + sentenceNumber++; + + } + } + + if (svStatus.used_in_fix_mask == 0) + { // No sv used, so there will be no position report, so send + // blank NMEA sentences + 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, "$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); + } + else + { // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; + + // 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/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h new file mode 100644 index 00000000..5da7d5dd --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -0,0 +1,42 @@ +/* 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 Code Aurora Forum, Inc. 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 + +#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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); +void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const GpsLocation &location, const GpsLocationExtended &locationExtended); + +#endif // LOC_ENG_NMEA_H diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 68057bcd..9345aedf 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -1554,6 +1554,9 @@ void LocApiV02Adapter :: reportPosition ( LOC_LOGD("Reporting postion from V2 Adapter\n"); memset(&location, 0, sizeof (GpsLocation)); location.size = sizeof(location); + GpsLocationExtended locationExtended; + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); // Process the position from final and intermediate reports if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || @@ -1615,7 +1618,29 @@ void LocApiV02Adapter :: reportPosition ( //Mark the location source as from GNSS location.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_GNSS; + + if (location_report_ptr->magneticDeviation_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; + locationExtended.magneticDeviation = location_report_ptr->magneticDeviation; + } + + if (location_report_ptr->DOP_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; + locationExtended.pdop = location_report_ptr->DOP.PDOP; + locationExtended.hdop = location_report_ptr->DOP.HDOP; + locationExtended.vdop = location_report_ptr->DOP.VDOP; + } + + if (location_report_ptr->altitudeWrtMeanSeaLevel_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; + locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; + } + LocApiAdapter::reportPosition( location, + locationExtended, locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? @@ -1626,6 +1651,7 @@ void LocApiV02Adapter :: reportPosition ( else { LocApiAdapter::reportPosition(location, + locationExtended, NULL, LOC_SESS_FAILURE); @@ -1642,6 +1668,7 @@ void LocApiV02Adapter :: reportSv ( const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) { GpsSvStatus SvStatus; + GpsLocationExtended locationExtended; int num_svs_max, i; const qmiLocSvInfoStructT_v02 *sv_info_ptr; @@ -1650,6 +1677,8 @@ void LocApiV02Adapter :: reportSv ( num_svs_max = 0; memset (&SvStatus, 0, sizeof (GpsSvStatus)); + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); if(gnss_report_ptr->svList_valid == 1) { num_svs_max = gnss_report_ptr->svList_len; @@ -1740,6 +1769,7 @@ void LocApiV02Adapter :: reportSv ( { LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); LocApiAdapter::reportSv(SvStatus, + locationExtended, locEngHandle.extSvInfo((void*)gnss_report_ptr)); } } From af0b025a0af13fc24faaba869c0be4012061a1de Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 20 Sep 2012 16:52:46 -0700 Subject: [PATCH 052/945] QMI LOC and Loc API update: Inject motion data and Get NI Geofence List; subsystem restart over QMUXD; CR 368109 SGLTE CID / OOS / NI SUPL INIT Change-Id: I3bd77e87de61c2c2565bbb151d661c717367c0ed --- loc_api/loc_api_v02/loc_api_v02_client.c | 173 +- loc_api/loc_api_v02/loc_api_v02_client.h | 612 +++--- loc_api/loc_api_v02/location_service_v02.c | 194 +- loc_api/loc_api_v02/location_service_v02.h | 2020 ++++++++++---------- 4 files changed, 1597 insertions(+), 1402 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 7294d33e..6e60b604 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -27,6 +27,12 @@ */ #include +#include +#include + +#include +#include + #include "qmi_client.h" #include "qmi_idl_lib.h" #include "qmi_cci_target_ext.h" @@ -38,10 +44,7 @@ #define LOG_TAG "LocSvc_api_v02" #endif //_ANDROID_ -#include -#include -#include -#include + #include "loc_api_v02_client.h" #include "loc_util_log.h" @@ -50,21 +53,16 @@ // timeout in ms before send_msg_sync should return #define LOC_CLIENT_ACK_TIMEOUT (5000) -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) - #else // timeout in ms before send_msg_sync should return #define LOC_CLIENT_ACK_TIMEOUT (1000) -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) - #endif //LOC_UTIL_TARGET_OFF_TARGET -//timeout in ms to wait for the service to come up +//timeout in ms that the service waits for qmi-fw notification #define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) +// total timeout for the service to come up #define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) /* Table to relate eventId, size and mask value used to enable the event*/ @@ -374,7 +372,27 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { //Get best available position { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, - sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)} + sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, + + //Inject motion data + { QMI_LOC_INJECT_MOTION_DATA_IND_V02, + sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, + + //Get NI Geofence list + { QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, + sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02)}, + + //Inject GSM Cell Info + { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, + sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, + + //Inject Network Initiated Message + { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, + sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, + + //WWAN Out of Service Notification + { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, + sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)} }; @@ -385,7 +403,9 @@ typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; /** @struct locClientInternalState */ -typedef struct +typedef struct locClientCbDataStructT locClientCallbackDataType; + +struct locClientCbDataStructT { // client cookie void *pClientCookie; @@ -400,7 +420,10 @@ typedef struct // the event mask the client has registered for locClientEventMaskType eventRegMask; -}locClientCallbackDataType; + //pointer to itself for checking consistency data + locClientCallbackDataType *pMe; +}; + /*=========================================================================== * @@ -466,10 +489,12 @@ static bool isClientRegisteredForEvent( { if(eventIndId == locClientEventIndTable[idx].eventId) { - LOC_LOGV("%s:%d]: eventId %d registered mask = %llu, " - "eventMask = %llu\n", __func__, __LINE__, - eventIndId, eventRegMask, - locClientEventIndTable[idx].eventMask); + LOC_LOGV("%s:%d]: eventId %d registered mask = 0x%04x%04x, " + "eventMask = 0x%04x%04x\n", __func__, __LINE__, + eventIndId,(uint32_t)(eventRegMask>>32), + (uint32_t)(eventRegMask & 0xFFFFFFFF), + (uint32_t)(locClientEventIndTable[idx].eventMask >> 32), + (uint32_t)(locClientEventIndTable[idx].eventMask & 0xFFFFFFFF)); return(( eventRegMask & locClientEventIndTable[idx].eventMask)? @@ -826,6 +851,22 @@ static bool locClientHandleIndication( break; } + // get predicted orbits source response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: + { + //locClientHandleGetPredictedOrbitsSourceInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // get predicted orbits validity response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: + { + //locClientHandleGetPredictedOrbitsDataValidityInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : { //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); @@ -948,6 +989,12 @@ static bool locClientHandleIndication( break; } + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: + { + status = true; + break; + } + // for indications that only have a "status" field case QMI_LOC_NI_USER_RESPONSE_IND_V02: case QMI_LOC_INJECT_UTC_TIME_IND_V02: @@ -971,6 +1018,10 @@ static bool locClientHandleIndication( case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_INJECT_MOTION_DATA_IND_V02: + case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: + case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: { status = true; break; @@ -1003,13 +1054,16 @@ static void locClientErrorCb { locClientCallbackDataType* pCallbackData = (locClientCallbackDataType *)err_cb_data; + locClientErrorCbType localErrorCallback = NULL; /* copy the errorCallback function pointer from the callback * data to local variable. This is to protect against the race * condition between open/close and error callback. */ - locClientErrorCbType localErrorCallback = - pCallbackData->errorCallback; + if(NULL != pCallbackData) + { + localErrorCallback = pCallbackData->errorCallback; + } LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", __func__, __LINE__, error, err_cb_data); @@ -1021,7 +1075,8 @@ static void locClientErrorCb if( (NULL != pCallbackData) && (NULL != localErrorCallback) && - (NULL != pCallbackData->errorCallback) ) + (NULL != pCallbackData->errorCallback) && + (pCallbackData == pCallbackData->pMe) ) { //invoke the error callback for the corresponding client localErrorCallback( @@ -1063,7 +1118,7 @@ static void locClientIndCb pCallbackData); // check callback data - if(NULL == pCallbackData) + if(NULL == pCallbackData ||(pCallbackData != pCallbackData->pMe)) { LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); return; @@ -1479,6 +1534,30 @@ static bool validateRequest( *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); break; } + case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); + break; + } + + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02); + break; + } + // ALL requests with no payload case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: @@ -1497,6 +1576,7 @@ static bool validateRequest( case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: { noPayloadFlag = true; break; @@ -1726,21 +1806,18 @@ locClientStatusEnumType locClientOpen ( locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; locClientCallbackDataType *pCallbackData = NULL; - LOC_LOGV("%s:%d] \n", __func__, __LINE__); + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + return eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + } do { - // check input parameters - if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) - || (NULL == pLocClientCallbacks->respIndCb) || - (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) - { - LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - } - // Allocate memory for the callback data pCallbackData = ( locClientCallbackDataType*)calloc( @@ -1775,7 +1852,8 @@ locClientStatusEnumType locClientOpen ( __func__, __LINE__, status); break; } - + // set the self pointer + pCallbackData->pMe = pCallbackData; // set the handle to the callback data *pLocClientHandle = (locClientHandleType)pCallbackData; @@ -1810,10 +1888,6 @@ locClientStatusEnumType locClientOpen ( // set the client cookie pCallbackData->pClientCookie = (void *)pClientCookie; - LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", - __func__, __LINE__, *pLocClientHandle, - pCallbackData->userHandle, status); - }while(0); if(eLOC_CLIENT_SUCCESS != status) @@ -1822,6 +1896,13 @@ locClientStatusEnumType locClientOpen ( LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); } + else + { + LOC_LOGD("%s:%d]: returning handle = %p, user_handle=%p, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + } + return(status); } @@ -1838,6 +1919,8 @@ locClientStatusEnumType locClientOpen ( locClientStatusEnumType locClientClose( locClientHandleType* pLocClientHandle) { + // convert handle to callback data + locClientCallbackDataType *pCallbackData; qmi_client_error_type rc = QMI_NO_ERR; //No error if(NULL == pLocClientHandle) @@ -1849,15 +1932,12 @@ locClientStatusEnumType locClientClose( return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); } - // convert handle to callback data - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)(*pLocClientHandle); - - LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); + pCallbackData = (locClientCallbackDataType *)(*pLocClientHandle); // check the input handle for sanity if(NULL == pCallbackData || - NULL == pCallbackData->userHandle) + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) { // invalid handle LOC_LOGE("%s:%d]: invalid handle \n", @@ -1934,7 +2014,8 @@ locClientStatusEnumType locClientSendReq( // check the input handle for sanity if(NULL == pCallbackData || - NULL == pCallbackData->userHandle ) + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) { // did not find the handle in the client List LOC_LOGE("%s:%d]: invalid handle \n", diff --git a/loc_api/loc_api_v02/loc_api_v02_client.h b/loc_api/loc_api_v02/loc_api_v02_client.h index 0ce7a2e8..a49f1275 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.h +++ b/loc_api/loc_api_v02/loc_api_v02_client.h @@ -32,6 +32,7 @@ #ifndef LOC_API_V02_CLIENT_H #define LOC_API_V02_CLIENT_H + #ifdef __cplusplus extern "C" { #endif @@ -42,37 +43,34 @@ extern "C" { * DATA DECLARATION * *============================================================================*/ - -#include -#include "location_service_v02.h" //QMI LOC Service data types definitions #include +#include + +#include "location_service_v02.h" //QMI LOC Service data types definitions + #include /****************************************************************************** * Constants and configuration *****************************************************************************/ -/** @addtogroup constants_macros -@{ */ - -/** Specific value of #locClientHandleType, indicating an invalid handle. */ +/** @ingroup constants_macros + Specific value of #locClientHandleType, indicating an invalid handle. */ #define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) -/** @} */ /* end_addtogroup constants_macros */ /** @addtogroup data_types @{ */ /** Location client handle used to represent a specific client. Negative values - are invalid handles. */ + are invalid handles. +*/ typedef void* locClientHandleType; -/** Data type for events and event masks. - @newpage */ +/** Data type for events and event masks. */ typedef uint64_t locClientEventMaskType; /** Location client status values. - @vertspace */ typedef enum { @@ -116,29 +114,22 @@ typedef enum /**< Failed because the service has not been initialized. */ eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 - /**< Failed because not rnough memory to do the operation.*/ + /**< Failed because there is not enough memory to do the operation. */ }locClientStatusEnumType; -/** Loc Client error values +/** Location client error values */ - typedef enum { eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 - /**< Service is no longer available, the client should - close the existing connection and reopen the connection - upon getting this error. - */ + /**< Service is no longer available. Upon getting this error, the client + must close the existing connection and reopen the connection. */ + }locClientErrorEnumType; -/** @} */ /* end_addtogroup data_types */ - -/** @addtogroup send_request -@{ */ - -/** @brief Request messages the client can send to the location engine. +/** Request messages the client can send to the location engine. The following requests do not have any data associated, so they do not have a payload structure defined: @@ -159,6 +150,7 @@ typedef enum - GetExternalPowerConfig - GetSensorControlConfig - GetSensorPerformanceControlConfiguration + - WWANOutOfServiceNotification */ typedef union { @@ -310,9 +302,11 @@ typedef union QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; - /**< Sets XTRA-T session control in the engine. If the request is accepted by - the service, the client receives the following indication containing a - response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + /**< Sets XTRA-T session control in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. To send this request, set the reqId field in locClientSendReq() to QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ @@ -407,7 +401,7 @@ typedef union response indication for this request. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. */ const qmiLocSetProtocolConfigParametersReqMsgT_v02* pSetProtocolConfigParametersReq; @@ -429,10 +423,9 @@ typedef union QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - @newpage */ + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - const qmiLocSetSensorControlConfigReqMsgT_v02* + const qmiLocSetSensorControlConfigReqMsgT_v02* pSetSensorControlConfigReq; /**< Sets the sensor control configuration parameters in the engine. @@ -441,8 +434,7 @@ typedef union QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. - @newpage */ + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. */ const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* pSetSensorPerformanceControlConfigReq; @@ -453,8 +445,7 @@ typedef union QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - @newpage */ + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. */ const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; /**< Retrieves the sensor properties from the engine. @@ -464,8 +455,7 @@ typedef union QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. - @newpage */ + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. */ const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; /**< Sets the sensor properties in the engine. @@ -475,8 +465,7 @@ typedef union QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. - @newpage */ + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. */ const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; /**< Injects a SUPL certificate into the engine. @@ -486,8 +475,7 @@ typedef union QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. - @newpage */ + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. */ const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; /**< Deletes a SUPL certificate from the engine. @@ -497,78 +485,69 @@ typedef union QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. - @newpage */ + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. */ const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* pSetPositionEngineConfigParametersReq; - /**< Sets Position Engine configuration. + /**< Sets position engine configuration. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* pGetPositionEngineConfigParametersReq; - /**< Gets Position Engine configuration. + /**< Gets position engine configuration. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; - /**< Adds a Circular Geofence. + /**< Adds a circular geofence. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 - @newpage */ + QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 */ const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; - /**< Deletes a Geofence. + /**< Deletes a geofence. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_DELETE_GEOFENCE_IND_V02. To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_GEOFENCE_REQ_V02 - @newpage */ + QMI_LOC_DELETE_GEOFENCE_REQ_V02 */ const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; - /**< Queries a Geofence. + /**< Queries a geofence. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_QUERY_GEOFENCE_IND_V02 To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_QUERY_GEOFENCE_REQ_V02 - - @newpage */ + QMI_LOC_QUERY_GEOFENCE_REQ_V02. */ const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; - /**< Edits Geofence Parameters. + /**< Edits geofence parameters. If the request is accepted by the service, the client receives the following indication containing a response: QMI_LOC_EDIT_GEOFENCE_IND_V02 To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_EDIT_GEOFENCE_REQ_V02 - - @newpage */ + QMI_LOC_EDIT_GEOFENCE_REQ_V02. */ const qmiLocGetBestAvailablePositionReqMsgT_v02* pGetBestAvailablePositionReq; @@ -579,14 +558,52 @@ typedef union QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ - @newpage */ + const qmiLocInjectMotionDataReqMsgT_v02* pInjectMotionDataReq; + /**< Inject motion data in the location engine + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_MOTION_DATA_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_MOTION_DATA_REQ_V02 */ + + const qmiLocGetNiGeofenceIdListReqMsgT_v02* pGetNiGeofenceIdListReq; + /**< Get the list of Network Initiated Geofences from the location engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 */ + + const qmiLocInjectGSMCellInfoReqMsgT_v02 *pInjectGSMCellInfoReq; + /**< Inject GSM Cell Information into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 */ + + const qmiLocInjectNetworkInitiatedMessageReqMsgT_v02 + *pInjectNetworkInitiatedMessageReq; + /**< Inject Network Initiated Message into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ + + const void *pWWANOutOfServiceNotificationReq; }locClientReqUnionType; -/** @brief Event indications that are sent by the service. +/** Event indications that are sent by the service. */ typedef union { @@ -612,21 +629,22 @@ typedef union QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; - /**< Contains an NMEA report sentence. The entire NMEA report consisting - of multiple sentences is sent at a 1Hz rate. - This event is generated after QMI_LOC_START_REQ_V02 is sent. + /**< Contains an NMEA report sentence. + + The entire NMEA report consisting of multiple sentences is sent at a + 1 Hz rate. This event is generated after QMI_LOC_START_REQ_V02 is sent. The eventIndId field in the event indication callback is set to QMI_LOC_EVENT_NMEA_IND_V02. */ const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; - /**< Notifies a location client when the network triggers a positioning request - to the mobile. + /**< Notifies a location client when the network triggers a positioning + request to the mobile. Upon getting this event, the location client displays the - network-initiated fix request in a dialog and prompts the user to accept - or deny the request. The client responds to this request with the message - QMI_LOC_NI_USER_RESPONSE_REQ_V02. + network-initiated fix request in a dialog and prompts the user to + accept or deny the request. The client responds to this request with + the message QMI_LOC_NI_USER_RESPONSE_REQ_V02. The eventIndId field in the event indication callback is set to QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ @@ -708,54 +726,51 @@ typedef union QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. - @newpage */ + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. */ const qmiLocEventNiGeofenceNotificationIndMsgT_v02* pNiGeofenceNotificationEvent; /**< Sent by the engine to notify the client about changes to a - Network Initiated Geofence. + network-initiated geofence. The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. - @newpage */ + QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. */ const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; /**< Sent by the engine to notify the client about updates that may - affect a Geofence operation. + affect a geofence operation. The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. - @newpage */ + QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. */ const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; - /**< Sent by the engine to notify the client about a Geofence Breach - Event. + /**< Sent by the engine to notify the client about a geofence breach + event. The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. - @newpage */ + QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ }locClientEventIndUnionType; -/** @brief Response indications that are sent by the service. */ +/** Response indications that are sent by the service. +*/ typedef union { const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; - /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. + /**< Response to the QMI_LOC_GET_SERVICE_REVISION_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; - /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. + /**< Response to the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; - /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. + /**< Response to the QMI_LOC_NI_USER_RESPONSE_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_NI_USER_RESPONSE_IND_V02. */ @@ -773,332 +788,351 @@ typedef union const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* pGetPredictedOrbitsDataSourceInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 + request. The respIndId field in the response indication callback is set to QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* pGetPredictedOrbitsDataValidityInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 + request. The respIndId field in the response indication callback is set to QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; - /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. + /**< Response to the QMI_LOC_INJECT_UTC_TIME_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_INJECT_UTC_TIME_IND_V02. */ const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; - /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. + /**< Response to the QMI_LOC_INJECT_POSITION_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_INJECT_POSITION_IND_V02. */ const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; - /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. + /**< Response to the QMI_LOC_SET_ENGINE_LOCK_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; - /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. + /**< Response to the QMI_LOC_GET_ENGINE_LOCK_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; - /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_SET_SBAS_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; - /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_GET_SBAS_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; - /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. + /**< Response to the QMI_LOC_SET_NMEA_TYPES_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_NMEA_TYPES_IND_V02. */ const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; - /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. + /**< Response to the QMI_LOC_GET_NMEA_TYPES_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_NMEA_TYPES_IND_V02. */ const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; - /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. + /**< Response to the QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; - /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. + /**< Response to the QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ const qmiLocSetServerIndMsgT_v02* pSetServerInd; - /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. + /**< Response to the QMI_LOC_SET_SERVER_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_SERVER_IND_V02. */ const qmiLocGetServerIndMsgT_v02* pGetServerInd; - /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. + /**< Response to the QMI_LOC_GET_SERVER_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_SERVER_IND_V02. */ const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; - /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. + /**< Response to the QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. + /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. + /**< Response to the QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; - /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. + /**< Response to the QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; - /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. + /**< Response to the QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; - /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. + /**< Response to the QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; - /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. + /**< Response to the QMI_LOC_SET_OPERATION_MODE_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_OPERATION_MODE_IND_V02. */ const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; - /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. + /**< Response to the QMI_LOC_GET_OPERATION_MODE_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_OPERATION_MODE_IND_V02. */ const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; - /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. + /**< Response to the QMI_LOC_SET_SPI_STATUS_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_SPI_STATUS_IND_V02. */ const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; - /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. + /**< Response to the QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; - /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. + /**< Response to the QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. + /**< Response to the QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ const qmiLocInformLocationServerConnStatusIndMsgT_v02* pInformLocationServerConnStatusInd; - /**< Response to the request, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. + /**< Response to the QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 + request. The respIndId field in the response indication callback is set to QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ const qmiLocSetProtocolConfigParametersIndMsgT_v02* pSetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + /**< Response to the QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ const qmiLocGetProtocolConfigParametersIndMsgT_v02* pGetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + /**< Response to the QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. The respIndId field in the response indication callback is set to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - @newpage */ + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ + */ const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. + /**< Response to the QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ + */ const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + /**< Response to the QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - @newpage */ + */ const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. + /**< Response to the QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 request. The respIndId field in the response indication callback is set to QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - @newpage */ + */ const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* pSetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + /**< Response to the + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* pGetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + /**< Response to the + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; - /**< Response to the request, - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 + /**< Response to the QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 request. + The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - @newpage */ + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. */ const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; - /**< Response to the request, - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + /**< Response to the QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 request. + The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - @newpage */ + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. */ const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* pSetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + /**< Response to the QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + The respIndId field in the response indication callback is set to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* pGetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ + /**< Response to the QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; - /**< Response to the request, - QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 + /**< Response to the QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 request. + The respIndId field in the response indication callback is set to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 - @newpage */ + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. */ const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; - /**< Response to the request, - QMI_LOC_DELETE_GEOFENCE_REQ_V02 + /**< Response to the QMI_LOC_DELETE_GEOFENCE_REQ_V02 request. + The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_GEOFENCE_IND_V02 - @newpage */ + QMI_LOC_DELETE_GEOFENCE_IND_V02. */ const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; - /**< Response to the request, - QMI_LOC_QUERY_GEOFENCE_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_QUERY_GEOFENCE_IND_V02 - @newpage */ + /**< Response to the QMI_LOC_QUERY_GEOFENCE_REQ_V02 request. - const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; - /**< Response to the request, - QMI_LOC_EDIT_GEOFENCE_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_EDIT_GEOFENCE_IND_V02 - @newpage */ + The respIndId field in the response indication callback is set to + QMI_LOC_QUERY_GEOFENCE_IND_V02. */ - const qmiLocGetBestAvailablePositionIndMsgT_v02* + const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; + /**< Response to the QMI_LOC_EDIT_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_EDIT_GEOFENCE_IND_V02. */ + + const qmiLocGetBestAvailablePositionIndMsgT_v02* pGetBestAvailablePositionInd; - /**< Response to the request, - QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 + /**< Response to the QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 request. + The respIndId field in the response indication callback is set to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 - @newpage */ + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ + + const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; + /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_MOTION_DATA_IND_V02. */ + + const qmiLocGetNiGeofenceIdListIndMsgT_v02* pGetNiGeofenceIdListInd; + /**< Response to the QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02. */ + + const qmiLocInjectGSMCellInfoIndMsgT_v02* pInjectGSMCellInfoInd; + /**< Response to the QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02. */ + + const qmiLocInjectNetworkInitiatedMessageIndMsgT_v02* + pInjectNetworkInitiatedMessageInd; + + /**< Response to the QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02. */ + + const qmiLocWWANOutOfServiceNotificationIndMsgT_v02* + pWWANOutOfServiceNotificationInd; + + /**< Response to the QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 + request. + The respIndId field in the response indication callback is set to + QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ }locClientRespIndUnionType; -/** @} */ /* end_addtogroup send_request */ +/** @} */ /* end_addtogroup data_types */ -/** @addtogroup data_types +/** @addtogroup callback_functions @{ */ - -/** Location event indication callback function type. The Location service can - generate two types of indications: +/** + Location event indication callback function type. The Location service can + generate two types of indications: - Asynchronous events indications, such as time injection request and satellite reports. The client specifies the asynchronous events it is interested in @@ -1109,7 +1143,10 @@ typedef union This callback handles the asynchronous event indications. - @vertspace + @datatypes + #locClientHandleType \n + #locClientEventIndUnionType + @param handle Location client for this event. Only the client who registered for the corresponding event receives this callback. @@ -1117,6 +1154,12 @@ typedef union @param eventIndPayload Event indication payload. @param pClientCookie Pointer to the cookie the client specified during registration. + + @return + None. + + @dependencies + None. @newpage */ typedef void (*locClientEventIndCbType)( locClientHandleType handle, @@ -1125,8 +1168,9 @@ typedef void (*locClientEventIndCbType)( void *pClientCookie ); -/** Location response indication callback function type. The Location service can - generate two types of indications: +/** + Location response indication callback function type. The Location service can + generate two types of indications: - Asynchronous events indications, such as time injection request and satellite reports. The client specifies the asynchronous events it is interested in @@ -1137,7 +1181,10 @@ typedef void (*locClientEventIndCbType)( This callback handles the response indications. - @vertspace + @datatypes + #locClientHandleType \n + #locClientRespIndUnionType + @param handle Location client who sent the request for which this response indication is generated. @param respIndId ID of the response. It is the same value as the ID @@ -1146,7 +1193,11 @@ typedef void (*locClientEventIndCbType)( @param pClientCookie Pointer to the cookie the client specified during registration. - @newpage + @return + None. + + @dependencies + None. @newpage */ typedef void (*locClientRespIndCbType)( locClientHandleType handle, @@ -1155,84 +1206,84 @@ typedef void (*locClientRespIndCbType)( void *pClientCookie ); -/** Location error callback function type. This function will be - called to inform the client that the service is no longer - available. When the client receives this callback it must - close the existing connection and reopen the client connection. +/** + Location error callback function type. This function is called to inform + the client that the service is no longer available. When the client + receives this callback, it must close the existing connection and reopen + the client connection. + @datatypes + #locClientHandleType \n + #locClientErrorEnumType - @vertspace @param handle Location client who sent the request for which this error indication is generated. @param errorId Error ID. - @param errorCbdata Payload associated with the error indication. + @param pClientCookie Payload associated with the error indication. - @newpage + @return + None. + + @dependencies + None. */ typedef void (*locClientErrorCbType)( locClientHandleType handle, locClientErrorEnumType errorId, void* pClientCookie ); +/** @} */ /* end_addtogroup callback_functions */ -/** Callback functions to be registered during locClientOpen +/** @ingroup data_types + Callback functions to be registered during locClientOpen(). */ - typedef struct { - uint32_t size; - /**< Size of the structure */ - locClientEventIndCbType eventIndCb; - /**< Event Indication callback */ - locClientRespIndCbType respIndCb; - /**< Response Indication callback */ - locClientErrorCbType errorCb; - /**< Error Indication callback */ + uint32_t size; /**< Size of the structure. */ + locClientEventIndCbType eventIndCb; /**< Event indication callback. */ + locClientRespIndCbType respIndCb; /**< Response indication callback. */ + locClientErrorCbType errorCb; /**< Error indication callback. + @newpagetable */ }locClientCallbacksType; -/** @} */ /* end_addtogroup data_types */ /*=========================================================================== * * FUNCTION DECLARATION * *==========================================================================*/ - -/** @addtogroup open_client +/** @addtogroup operation_functions @{ */ /*========================================================================== locClientOpen */ -/** - @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location - client to the location engine. If the connection is successful, this function - returns a handle that the location client uses for future location operations. +/** @xreflabel{hdr:locClientOpenFunction} + Connects a location client to the location engine. If the connection is + successful, this function returns a handle that the location client uses for + future location operations. - @datatype - #locClientStatusEnumType\n - #locClientEventMaskType\n - #locClientCallbacksType *\n - #locClientHandleType *\n - #void * + @datatypes + #locClientStatusEnumType \n + #locClientEventMaskType \n + #locClientCallbacksType \n + #locClientHandleType - @vertspace @param[in] eventRegMask Mask of asynchronous events the client is interested in receiving. @param[in] pLocClientCallbacks Pointer to structure containing the callbacks. @param[out] pLocClientHandle Pointer to the handle to be used by the client for any subsequent requests. - @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the + @param[in] pLocClientCookie Pointer to a cookie to be returned to the client along with the callbacks. @return One of the following error codes: - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + - Non-zero error code (see #locClientStatusEnumType) -- On failure. @dependencies - None. - @newpage + None. @newpage */ extern locClientStatusEnumType locClientOpen ( locClientEventMaskType eventRegMask, @@ -1241,22 +1292,17 @@ extern locClientStatusEnumType locClientOpen ( const void* pLocClientCookie ); -/** @} */ /* end_addtogroup open_client */ -/** @addtogroup close_client -@{ */ /*========================================================================== locClientClose */ -/** - @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client - from the location engine and sets the handle to +/** @xreflabel{hdr:locClientCloseFunction} + Disconnects a client from the location engine and sets the handle to LOC_CLIENT_INVALID_HANDLE_VALUE. - @datatype - #locClientStatusEnumType\n + @datatypes + #locClientStatusEnumType \n #locClientHandleType - @vertspace @param[in] pLocClientHandle Pointer to the handle returned by the locClientOpen() function. @@ -1266,38 +1312,32 @@ extern locClientStatusEnumType locClientOpen ( - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. @dependencies - None. - @newpage + None. @newpage */ extern locClientStatusEnumType locClientClose ( locClientHandleType* pLocClientHandle ); -/** @} */ /* end_addtogroup close_client */ - -/** @addtogroup send_request -@{ */ /*============================================================================= locClientSendReq */ -/** - @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to - the location engine. If this function is successful, the client expects an - indication (except start, stop, event registration, and sensor injection - messages) through the registered callback in the locClientOpen() function. +/** @xreflabel{hdr:locClientSendReqFunction} + Sends a message to the location engine. If this function is successful, the + client expects an indication (except start, stop, event registration, and + sensor injection messages) through the registered callback in the + locClientOpen() function. The indication contains the status of the request. If the status is a success, the indication also contains the payload associated with response. - @datatype - #locClientStatusEnumType\n - #locClientHandleType\n + @datatypes + #locClientStatusEnumType \n + #locClientHandleType \n #locClientReqUnionType - @vertspace @param[in] handle Handle returned by the locClientOpen() function. @param[in] reqId QMI_LOC service message ID of the request. - @param[in] pReqPayload Payload of the request. This can be NULL if the request - has no payload. + @param[in] reqPayload Payload of the request. This can be NULL if the + request has no payload. @return One of the following error codes: @@ -1305,11 +1345,7 @@ extern locClientStatusEnumType locClientClose ( - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. @dependencies - None. - - @structure - locClientReqUnionType - @newpage + None. @newpage */ extern locClientStatusEnumType locClientSendReq( locClientHandleType handle, @@ -1317,72 +1353,46 @@ extern locClientStatusEnumType locClientSendReq( locClientReqUnionType reqPayload ); -/** @} */ /* end_addtogroup send_request */ -/** @addtogroup get_size_event -@{ */ /*============================================================================= locClientGetSizeByEventIndId */ -/** - Gets the size of the event indication structure from a specified ID. +/** Gets the size of the event indication structure from a specified ID. - @datatype - #locClientGetSizeByEventIndId - - @vertspace @param[in] eventIndId Event indicator ID. @param[out] pEventIndSize Pointer to the size of the structure. @return - true -- The event ID was found.\n - false -- Otherwise. + TRUE -- The event ID was found. \n + FALSE -- Otherwise. @dependencies - None. - - @structure - locClientEventIndUnionType - @newpage + None. @newpage */ extern bool locClientGetSizeByEventIndId( uint32_t eventIndId, size_t *pEventIndSize); -/** @} */ /* end_addtogroup get_size_event */ -/** @addtogroup get_size_response -@{ */ /*============================================================================= locClientGetSizeByRespIndId */ +/** Gets the size of the response indication structure from a specified ID. -/** - Gets the size of the response indication structure from a specified ID. - - @datatype - #locClientGetSizeByRespIndId - - @vertspace @param[in] respIndId Response indicator ID. @param[out] pRespIndSize Pointer to the size of the structure. @return - true -- The response ID was found.\n - false -- Otherwise. + TRUE -- The response ID was found. \n + FALSE -- Otherwise. @dependencies None. - - @structure - locClientRespIndUnionType - @newpage */ extern bool locClientGetSizeByRespIndId( uint32_t respIndId, size_t *pRespIndSize); /*=============================================================================*/ - -/** @} */ /* end_addtogroup get_size_response */ +/** @} */ /* end_addtogroup operation_functions */ #ifdef __cplusplus } diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c index e1bf6f55..f1e1b6db 100644 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -33,7 +33,14 @@ GENERAL DESCRIPTION This is the file which defines the loc service Data structures. -*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.5 + It was generated on: Thu Sep 20 2012 + From IDL File: location_service_v02.idl */ #include "stdint.h" #include "qmi_idl_lib_internal.h" @@ -320,6 +327,19 @@ static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), @@ -336,7 +356,7 @@ static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), QMI_LOC_MAX_NTP_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 15, 0, + 16, 0, QMI_IDL_FLAG_END_VALUE }; @@ -355,7 +375,7 @@ static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 15, 0, + 16, 0, QMI_IDL_FLAG_END_VALUE }; @@ -375,7 +395,7 @@ static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 19, 0, + 20, 0, QMI_IDL_FLAG_END_VALUE }; @@ -537,7 +557,7 @@ static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 28, 0, + 29, 0, QMI_IDL_FLAG_END_VALUE }; @@ -565,19 +585,6 @@ static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; -static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), - - QMI_IDL_FLAG_END_VALUE -}; - static const uint8_t qmiLocMotionDataStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), @@ -597,6 +604,22 @@ static const uint8_t qmiLocMotionDataStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), + + QMI_IDL_FLAG_END_VALUE +}; + /*Message Definitions*/ static const uint8_t qmiLocGenRespMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, @@ -869,7 +892,7 @@ static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { 0x14, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), - 32, 0 + 15, 0 }; static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { @@ -877,20 +900,20 @@ static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 16, 0 + 17, 0 }; static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 17, 0, + 18, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 18, 0 + 19, 0 }; static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { @@ -944,13 +967,13 @@ static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 20, 0 + 21, 0 }; static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { @@ -1008,7 +1031,7 @@ static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 21, 0 + 22, 0 }; /* @@ -1115,7 +1138,7 @@ static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { 0x14, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), - 32, 0 + 15, 0 }; static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { @@ -1175,13 +1198,13 @@ static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 17, 0, + 18, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 18, 0 + 19, 0 }; /* @@ -1199,7 +1222,7 @@ static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 22, 0 + 23, 0 }; static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { @@ -1273,7 +1296,7 @@ static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { 0x1A, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 23, 0, + 24, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), 0x1B, @@ -1493,7 +1516,7 @@ static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 24, 0, + 25, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), 0x11, @@ -1551,13 +1574,13 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 25, 0, + 26, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 26, 0, + 27, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), 0x12, @@ -1565,7 +1588,7 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 27, 0, + 28, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), 0x13, @@ -1664,13 +1687,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 29, 0, + 30, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 29, 0 + 30, 0 }; static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { @@ -1799,7 +1822,7 @@ static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 30, 0 + 31, 0 }; static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { @@ -1998,13 +2021,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2015,13 +2038,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 19, 0 + 20, 0 }; static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { @@ -2055,13 +2078,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2072,13 +2095,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 19, 0, + 20, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 19, 0 + 20, 0 }; static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { @@ -2175,7 +2198,7 @@ static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { 0x02, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 31, 0, + 32, 0, 0x03, QMI_IDL_GENERIC_1_BYTE, @@ -2277,7 +2300,7 @@ static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 31, 0, + 32, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), 0x15, @@ -2530,6 +2553,53 @@ static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) }; +static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), + 34, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) +}; + +static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + /* Type Table */ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, @@ -2547,6 +2617,7 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, @@ -2564,8 +2635,8 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02} + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, + {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02} }; /* Message Table */ @@ -2697,7 +2768,13 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02} + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02} }; /* Predefine the Type Table Object */ @@ -2775,7 +2852,10 @@ static const qmi_idl_service_message_table_entry loc_service_command_messages_v0 {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7} + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { @@ -2835,7 +2915,10 @@ static const qmi_idl_service_message_table_entry loc_service_response_messages_v {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7} + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7} }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { @@ -2908,7 +2991,10 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82} + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 132), 0} }; /*Service Object*/ @@ -2922,7 +3008,7 @@ struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, &loc_qmi_idl_type_table_object_v02, - 0x0D, + 0x0F, NULL }; diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h index d2da6915..f5db0b99 100644 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -58,6 +58,13 @@ elements in the array will be accessed. */ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.5 + It was generated on: Thu Sep 20 2012 + From IDL File: location_service_v02.idl */ /** @defgroup loc_qmi_consts Constant values defined in the IDL */ /** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ @@ -82,11 +89,11 @@ extern "C" { /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x0D +#define LOC_V02_IDL_MINOR_VERS 0x0F /** Major Version Number of the qmi_idl_compiler used to generate this file */ #define LOC_V02_IDL_TOOL_VERS 0x05 /** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x0069; +#define LOC_V02_MAX_MESSAGE_ID 0x006C; /** @} */ @@ -181,9 +188,12 @@ extern "C" { /** Maximum length of the SUPL certificate. */ #define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 -/** Maximum length of the Network Initiated Geofence ID +/** Maximum length of the network-initiated Geofence ID list */ #define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 + +/** Maximum length of the injected network initiated message. */ +#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 /** @} */ @@ -214,7 +224,7 @@ typedef struct { /* Mandatory */ /* Revision */ uint32_t revision; - /**< Revision that the control point is using. */ + /**< Revision that the control point is using. */ }qmiLocInformClientRevisionReqMsgT_v02; /* Message */ /** @} @@ -295,7 +305,7 @@ typedef struct { \end{itemize1} \vspace{0.05in} Multiple events can be registered by ORing the individual masks and sending them in this TLV. All unused bits in this mask must be set to 0. - */ + */ }qmiLocRegEventsReqMsgT_v02; /* Message */ /** @} @@ -306,9 +316,8 @@ typedef struct { */ typedef enum { QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. - Request a single position fix. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocFixRecurrenceEnumT_v02; /** @@ -321,9 +330,8 @@ typedef enum { typedef enum { QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. - High accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAccuracyLevelEnumT_v02; /** @@ -335,9 +343,8 @@ typedef enum { */ typedef enum { QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. - Intermediate reports are turned off. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocIntermediateReportStateEnumT_v02; /** @@ -350,20 +357,20 @@ typedef enum { typedef struct { char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; - /**< Application provider. */ + /**< Application provider. */ char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; - /**< Application name. */ + /**< Application name. */ uint8_t applicationVersion_valid; - /**< Specifies whether the application version string contains a valid value: - \begin{itemize1} + /**< Specifies whether the application version string contains + a valid value: \begin{itemize1} \item 0x00 (FALSE) -- Application version string is invalid \item 0x01 (TRUE) -- Application version string is valid - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; - /**< Application version. */ + /**< Application version. */ }qmiLocApplicationIdStructT_v02; /* Type */ /** @} @@ -372,8 +379,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; The control point sends this message when it wants to - initiate a GPS session. */ +/** Request Message; Used by the control point to initiate a GPS session. */ typedef struct { /* Mandatory */ @@ -383,7 +389,7 @@ typedef struct { is reported back in the position reports. The control point must specify the same session ID in the QMI_LOC_STOP_REQ message. \n - Range: 0 to 255 - */ + */ /* Optional */ /* Recurrence Type */ @@ -395,7 +401,7 @@ typedef struct { Valid values: \n - 0x00000001 -- Request periodic fixes \n - 0x00000002 -- Request a single fix - */ + */ /* Optional */ /* Horizontal Accuracy */ @@ -404,14 +410,13 @@ typedef struct { /**< Specifies the horizontal accuracy level required by the control point. If not specified, accuracy defaults to LOW. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- LOW: Client requires low horizontal accuracy \item 0x00000002 -- MED: Client requires medium horizontal accuracy \item 0x00000003 -- HIGH: Client requires high horizontal accuracy \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Enable/Disable Intermediate Reports */ @@ -426,15 +431,14 @@ typedef struct { report is set to IN_PROGRESS in order for the control point to identify intermediate reports. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- ON: Client is interested in receiving intermediate reports \item 0x00000002 -- OFF: Client is not interested in receiving intermediate reports \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Minimum Interval Between Position Reports */ @@ -444,13 +448,13 @@ typedef struct { position reports. \n - Units: Milliseconds \n - Default: 1000 ms - */ + */ /* Optional */ /* ID of the Application that Sent this Request */ uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version. */ + /**< \n Application provider, name, and version.*/ }qmiLocStartReqMsgT_v02; /* Message */ /** @} @@ -459,8 +463,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; The control point sends this message when it wants to - stop a GPS session. */ +/** Request Message; Used by the control point to stop a GPS session. */ typedef struct { /* Mandatory */ @@ -468,7 +471,7 @@ typedef struct { uint8_t sessionId; /**< ID of the session that was specified in the Start request (QMI_LOC_START_REQ).\n - - Range: 0 to 255 */ + - Range: 0 to 255 */ }qmiLocStopReqMsgT_v02; /* Message */ /** @} @@ -495,9 +498,8 @@ typedef enum { eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. - Fix request failed because the engine is locked. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSessionStatusEnumT_v02; /** @@ -511,11 +513,11 @@ typedef struct { uint16_t gpsWeek; /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Units: Weeks */ + - Units: Weeks */ uint32_t gpsTimeOfWeekMs; /**< Amount of time into the current GPS week. \n - - Units: Milliseconds */ + - Units: Milliseconds */ }qmiLocGPSTimeStructT_v02; /* Type */ /** @} @@ -531,19 +533,19 @@ typedef struct { \begin{itemize1} \item Range: 1 (highest accuracy) to 50 (lowest accuracy) \item PDOP = square root of (HDOP^2 + VDOP^2) - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ float HDOP; /**< Horizontal dilution of precision. \begin{itemize1} \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ float VDOP; /**< Vertical dilution of precision. \begin{itemize1} \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocDOPStructT_v02; /* Type */ /** @} @@ -566,11 +568,10 @@ typedef struct { /**< Specifies which sensors were used in calculating the position in the position report. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SENSOR_USED_ACCEL \item 0x00000002 -- SENSOR_USED_GYRO - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; /**< Specifies which results were aided by sensors. @@ -579,7 +580,7 @@ typedef struct { - 0x00000001 -- AIDED_HEADING \n - 0x00000002 -- AIDED_SPEED \n - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ + - 0x00000008 -- AIDED_VELOCITY */ }qmiLocSensorUsageIndicatorStructT_v02; /* Type */ /** @} @@ -606,9 +607,8 @@ typedef enum { eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network - Source of the time is unknown */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocTimeSourceEnumT_v02; /** @@ -623,9 +623,8 @@ typedef enum { eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed - Location reliability is high; strong cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocReliabilityEnumT_v02; /** @@ -635,8 +634,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; This message is used to send the position report to the - control point. */ +/** Indication Message; Sends the position report to the control point. */ typedef struct { /* Mandatory */ @@ -644,8 +642,7 @@ typedef struct { qmiLocSessionStatusEnumT_v02 sessionStatus; /**< Session status. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SESS_STATUS_SUCCESS \item 0x00000001 -- SESS_STATUS_IN_PROGRESS \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE @@ -655,14 +652,14 @@ typedef struct { \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED \vspace{-0.18in} \end{itemize1} - */ + */ /* Mandatory */ /* Session ID */ uint8_t sessionId; /**< ID of the session that was specified in the Start request QMI_LOC_START_REQ. \n - - Range: 0 to 255 */ + - Range: 0 to 255 */ /* Optional */ /* Latitude */ @@ -675,7 +672,7 @@ typedef struct { \item Range: -90.0 to 90.0 \begin{itemize1} \item Positive values indicate northern latitude \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Longitude */ @@ -688,28 +685,28 @@ typedef struct { \item Range: -180.0 to 180.0 \begin{itemize1} \item Positive values indicate eastern longitude \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Circular Horizontal Position Uncertainty */ uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ float horUncEllipseSemiMinor; /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ float horUncEllipseSemiMajor; /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Elliptical Horizontal Uncertainty Azimuth */ @@ -717,7 +714,7 @@ typedef struct { float horUncEllipseOrientAzimuth; /**< Elliptical horizontal uncertainty azimuth of orientation.\n - Units: Decimal degrees \n - - Range: 0 to 180 */ + - Range: 0 to 180 */ /* Optional */ /* Horizontal Confidence */ @@ -725,36 +722,35 @@ typedef struct { uint8_t horConfidence; /**< Horizontal uncertainty confidence.\n - Units: Percent \n - - Range: 0 to 99 */ + - Range: 0 to 99 */ /* Optional */ /* Horizontal Reliability */ uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. \n - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- RELIABILITY_NOT_SET \item 0x00000001 -- RELIABILITY_VERY_LOW \item 0x00000002 -- RELIABILITY_LOW \item 0x00000003 -- RELIABILITY_MEDIUM \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Horizontal Speed */ uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ float speedHorizontal; /**< Horizontal speed.\n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Speed Uncertainty */ uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ float speedUnc; /**< 3-D Speed uncertainty.\n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Altitude With Respect to Ellipsoid */ @@ -762,21 +758,21 @@ typedef struct { float altitudeWrtEllipsoid; /**< Altitude with respect to the WGS84 ellipsoid.\n - Units: Meters \n - - Range: -500 to 15883 */ + - Range: -500 to 15883 */ /* Optional */ /* Altitude With Respect to Sea Level */ uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ float altitudeWrtMeanSeaLevel; /**< Altitude with respect to mean sea level.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Vertical Uncertainty */ uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ float vertUnc; /**< Vertical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Vertical Confidence */ @@ -784,28 +780,27 @@ typedef struct { uint8_t vertConfidence; /**< Vertical uncertainty confidence.\n - Units: Percent \n - - Range: 0 to 99 */ + - Range: 0 to 99 */ /* Optional */ /* Vertical Reliability */ uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ qmiLocReliabilityEnumT_v02 vertReliability; /**< Specifies the reliability of the vertical position. \n - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- RELIABILITY_NOT_SET \item 0x00000001 -- RELIABILITY_VERY_LOW \item 0x00000002 -- RELIABILITY_LOW \item 0x00000003 -- RELIABILITY_MEDIUM \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ /* Optional */ /* Vertical Speed */ uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ float speedVertical; /**< Vertical speed.\n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Heading */ @@ -813,7 +808,7 @@ typedef struct { float heading; /**< Heading.\n - Units: Degrees \n - - Range: 0 to 359.999 */ + - Range: 0 to 359.999 */ /* Optional */ /* Heading Uncertainty */ @@ -821,7 +816,7 @@ typedef struct { float headingUnc; /**< Heading uncertainty.\n - Units: Degrees \n - - Range: 0 to 359.999 */ + - Range: 0 to 359.999 */ /* Optional */ /* Magnetic Deviation */ @@ -829,7 +824,7 @@ typedef struct { float magneticDeviation; /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ + north is east of true north. */ /* Optional */ /* Technology Used */ @@ -837,26 +832,27 @@ typedef struct { qmiLocPosTechMaskT_v02 technologyMask; /**< Technology used in computing this fix. - Valid bitmasks: \n - - 0x00000001 -- SATELLITE \n - - 0x00000002 -- CELLID \n - - 0x00000004 -- WIFI \n - - 0x00000008 -- SENSORS \n - - 0x00000010 -- REFERENCE_LOCATION \n - - 0x00000020 -- INJECTED_COARSE_POSITION */ + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Dilution of Precision */ uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ + /**< \n Dilution of precision associated with this position. */ /* Optional */ /* UTC Timestamp */ uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ uint64_t timestampUtc; /**< UTC timestamp. \n - - Units: Milliseconds since Jan. 1, 1970 */ + - Units: Milliseconds since Jan. 1, 1970 */ /* Optional */ /* Leap Seconds */ @@ -865,21 +861,21 @@ typedef struct { /**< Leap second information. If leapSeconds is not available, timestampUtc is calculated based on a hard-coded value for leap seconds. \n - - Units: Seconds */ + - Units: Seconds */ /* Optional */ /* GPS Time */ uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ qmiLocGPSTimeStructT_v02 gpsTime; /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ + milliseconds into the current week. */ /* Optional */ /* Time Uncertainty */ uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ float timeUnc; /**< Time uncertainty. \n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Optional */ /* Time Source */ @@ -887,32 +883,31 @@ typedef struct { qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- TIME_SRC_INVALID \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING - \item 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT + \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT \item 0x00000004 -- TIME_SRC_TOW_DECODE \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \item 0x00000007 -- TIME_SRC_NAV_SOLUTION \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Sensor Data Usage */ uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; /**< \n Whether sensor data was used in computing the position in this - position report. */ + position report. */ /* Optional */ /* Fix Count for This Session */ uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ uint32_t fixId; /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ + for each successive position report for a particular session. */ /* Optional */ /* SVs Used to Calculate the Fix */ @@ -927,7 +922,7 @@ typedef struct { \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ }qmiLocEventPositionReportIndMsgT_v02; /* Message */ /** @} @@ -941,9 +936,8 @@ typedef enum { eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. - GLONASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSvSystemEnumT_v02; /** @@ -956,9 +950,8 @@ typedef enum { typedef enum { QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. - SV is being tracked. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSvStatusEnumT_v02; /** @@ -985,8 +978,7 @@ typedef struct { qmiLocSvInfoValidMaskT_v02 validMask; /**< Bitmask indicating which of the fields in this TLV are valid. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- VALID_SYSTEM \item 0x00000002 -- VALID_GNSS_SVID \item 0x00000004 -- VALID_HEALTH_STATUS @@ -995,19 +987,18 @@ typedef struct { \item 0x00000020 -- VALID_ELEVATION \item 0x00000040 -- VALID_AZIMUTH \item 0x00000080 -- VALID_SNR - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ qmiLocSvSystemEnumT_v02 system; /**< Indicates to which constellation this SV belongs. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ uint16_t gnssSvId; /**< GNSS SV ID. @@ -1018,13 +1009,13 @@ typedef struct { \item For SBAS: 120 to 151 \end{itemize1} \end{itemize1} - The GPS and GLONASS SVs can be disambiguated using the system field. */ + The GPS and GLONASS SVs can be disambiguated using the system field. */ uint8_t healthStatus; /**< Health status. \begin{itemize1} \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ qmiLocSvStatusEnumT_v02 svStatus; /**< SV processing status. \n @@ -1032,28 +1023,28 @@ typedef struct { - 0x00000001 -- SV_STATUS_IDLE \n - 0x00000002 -- SV_STATUS_SEARCH \n - 0x00000003 -- SV_STATUS_TRACK - */ + */ qmiLocSvInfoMaskT_v02 svInfoMask; /**< Whether almanac and ephemeris information is available. \n Valid bitmasks: \n - 0x01 -- SVINFO_HAS_EPHEMERIS \n - 0x02 -- SVINFO_HAS_ALMANAC - */ + */ float elevation; /**< SV elevation angle.\n - Units: Degrees \n - - Range: 0 to 90 */ + - Range: 0 to 90 */ float azimuth; /**< SV azimuth angle.\n - Units: Degrees \n - - Range: 0 to 360 */ + - Range: 0 to 360 */ float snr; /**< SV signal-to-noise ratio. \n - - Units: dB-Hz */ + - Units: dB-Hz */ }qmiLocSvInfoStructT_v02; /* Type */ /** @} @@ -1062,25 +1053,24 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used to send a satellite report to the control point. */ +/** Indication Message; Sends a satellite report to the control point. */ typedef struct { /* Mandatory */ /* Altitude Source */ uint8_t altitudeAssumed; - /**< Whether altitude is assumed or calculated: - \begin{itemize1} + /**< Whether altitude is assumed or calculated: \begin{itemize1} \item 0x00 (FALSE) -- Valid altitude is calculated \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough satellites to determine precise altitude - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ /* Optional */ /* Satellite Info */ uint8_t svList_valid; /**< Must be set to true if svList is being passed */ uint32_t svList_len; /**< Must be set to # of elements in svList */ qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ + /**< \n SV information list. */ }qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ /** @} @@ -1089,7 +1079,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used to send NMEA sentences to the control point. */ +/** Indication Message; Sends NMEA sentences to the control point */ typedef struct { /* Mandatory */ @@ -1099,7 +1089,7 @@ typedef struct { \begin{itemize1} \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 201 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ }qmiLocEventNmeaIndMsgT_v02; /* Message */ /** @} @@ -1113,9 +1103,8 @@ typedef enum { eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. - Notify and Verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiNotifyVerifyEnumT_v02; /** @@ -1129,9 +1118,8 @@ typedef enum { QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. - MS-based preferred, but MS-assisted allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiVxPosModeEnumT_v02; /** @@ -1151,9 +1139,8 @@ typedef enum { eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. - Encoding is GSM. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; /** @@ -1168,37 +1155,35 @@ typedef struct { uint8_t posQosIncl; /**< Whether quality of service is included:\n - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ + - 0x00 (FALSE) -- QoS is not included */ uint8_t posQos; /**< Position QoS timeout. \n - Units: Seconds \n - - Range: 0 to 255 */ + - Range: 0 to 255 */ uint32_t numFixes; - /**< Number of fixes allowed. */ + /**< Number of fixes allowed. */ uint32_t timeBetweenFixes; /**< Time between fixes.\n - - Units: Seconds */ + - Units: Seconds */ qmiLocNiVxPosModeEnumT_v02 posMode; /**< Position mode. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \item 0x00000002 -- NI_VX_MS_BASED_ONLY \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; /**< VX encoding scheme. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- NI_VX_OCTET \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \item 0x00000002 -- NI_VX_ASCII @@ -1210,18 +1195,18 @@ typedef struct { \item 0x00000008 -- NI_VX_LATIN \item 0x00000009 -- NI_VX_GSM \vspace{-0.18in} \end{itemize1} - */ + */ uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; /**< Requestor ID. \n - Type: Array of bytes \n - Maximum array length: 200 - */ + */ uint16_t userRespTimerInSeconds; /**< Time to wait for the user to respond. \n - - Units: Seconds */ + - Units: Seconds */ }qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ /** @} @@ -1240,9 +1225,8 @@ typedef enum { eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. - No position. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiSuplPosMethodEnumT_v02; /** @@ -1271,9 +1255,8 @@ typedef enum { eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. - Encoding is GSM default. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiDataCodingSchemeEnumT_v02; /** @@ -1292,9 +1275,8 @@ typedef enum { eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity - SUPL unknown format. */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiSuplFormatEnumType_v02; /** @@ -1309,8 +1291,7 @@ typedef struct { qmiLocNiSuplFormatEnumType_v02 formatType; /**< Format of the formatted string. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- FORMAT_LOGICAL_NAME \item 0x00000001 -- FORMAT_EMAIL_ADDRESS \item 0x00000002 -- FORMAT_MSISDN @@ -1321,14 +1302,14 @@ typedef struct { \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN \vspace{-0.18in} \end{itemize1} - */ + */ uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Formatted string. \n - Type: Byte array \n - Maximum string length: 64 - */ + */ }qmiLocNiSuplFormattedStringStructT_v02; /* Type */ /** @} @@ -1351,24 +1332,24 @@ typedef struct { - 0x01 -- QOP_HORZ_ACC_VALID \n - 0x02 -- QOP_VER_ACC_VALID \n - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID */ + - 0x08 -- QOP_DELAY_VALID*/ uint8_t horizontalAccuracy; /**< Horizontal accuracy. \n - - Units: Meters */ + - Units: Meters */ uint8_t verticalAccuracy; /**< Vertical accuracy. \n - - Units: Meters */ + - Units: Meters */ uint16_t maxLocAge; /**< Maximum age of the location if the engine sends a previously computed position. \n - - Units: Seconds */ + - Units: Seconds */ uint8_t delay; /**< Delay the server is willing to tolerate for the fix. \n - - Units: Seconds */ + - Units: Seconds */ }qmiLocNiSuplQopStructT_v02; /* Type */ /** @} @@ -1384,10 +1365,10 @@ typedef uint8_t qmiLocServerAddrTypeMaskT_v02; typedef struct { uint32_t addr; - /**< IPV4 address. */ + /**< IPV4 address. */ uint16_t port; - /**< IPV4 port. */ + /**< IPV4 port. */ }qmiLocIpV4AddrStructType_v02; /* Type */ /** @} @@ -1401,10 +1382,10 @@ typedef struct { uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; /**< IPV6 address. \n - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ + - Maximum length of the array: 8 */ uint32_t port; - /**< IPV6 port. */ + /**< IPV6 port. */ }qmiLocIpV6AddrStructType_v02; /* Type */ /** @} @@ -1422,13 +1403,13 @@ typedef struct { - 0x01 -- IPV4 \n - 0x02 -- IPV6 \n - 0x04 -- URL - */ + */ qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ + /**< IPV4 address and port. */ qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ + /**< IPV6 address and port. */ char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; /**< URL. @@ -1436,7 +1417,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocNiSuplServerInfoStructT_v02; /* Type */ /** @} @@ -1486,8 +1467,7 @@ typedef struct { qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; /**< Indicates which of the following fields are present in this value. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SUPL_SERVER_INFO \item 0x00000002 -- SUPL_SESSION_ID \item 0x00000004 -- SUPL_HASH @@ -1498,27 +1478,26 @@ typedef struct { \item 0x00000080 -- SUPL_QOP \item 0x00000100 -- SUPL_USER_RESP_TIMER \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ + /**< SUPL server information. */ uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; /**< SUPL session ID. \n - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ + - Maximum length of the array: 4 */ uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; /**< Hash for SUPL_INIT; used to validate that the message was not corrupted. \n - Type: Array of unsigned integers \n - - Length of the array: 8 */ + - Length of the array: 8 */ qmiLocNiSuplPosMethodEnumT_v02 posMethod; /**< GPS mode to be used for the fix. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- AGPS_SETASSISTED \item 0x00000002 -- AGPS_SETBASED \item 0x00000003 -- AGPS_SETASSISTED_PREF @@ -1530,14 +1509,13 @@ typedef struct { \item 0x00000009 -- OTDOA \item 0x0000000A -- NO_POSITION \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Data coding scheme applies to both the requestor ID and the client name. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN \item 0x0000000D -- NI_SS_ENGLISH \item 0x0000000E -- NI_SS_ITALIAN @@ -1558,22 +1536,22 @@ typedef struct { \item 0x0000001D -- NI_SUPL_UCS2 \item 0x0000001E -- NI_SUPL_GSM_DEFAULT \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiSuplFormattedStringStructT_v02 requestorId; /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ + the dataCodingScheme field. */ qmiLocNiSuplFormattedStringStructT_v02 clientName; /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ + the dataCodingScheme field. */ qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ + /**< SUPL QoP. */ uint16_t userResponseTimer; /**< Time to wait for the user to respond. \n - - Units: Seconds */ + - Units: Seconds*/ }qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ /** @} @@ -1585,9 +1563,8 @@ typedef struct { typedef enum { QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. - Initial location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiLocationTypeEnumT_v02; /** @@ -1602,8 +1579,7 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Identifies the coding scheme of the coded string. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN \item 0x0000000D -- NI_SS_ENGLISH \item 0x0000000E -- NI_SS_ITALIAN @@ -1625,13 +1601,13 @@ typedef struct { \item 0x0000001E -- NI_SUPL_GSM_DEFAULT \vspace{-0.18in} \end{itemize1} - */ + */ uint32_t codedString_len; /**< Must be set to # of elements in codedString */ uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; /**< Coded string. \n - Type: Array of bytes \n - - Maximum string length: 20 */ + - Maximum string length: 20 */ }qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ /** @} @@ -1682,8 +1658,7 @@ typedef struct { qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; /**< Fields that are valid in this value. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x0001 -- INVOKE_ID_MASK \item 0x0002 -- DATA_CODING_SCHEME_MASK \item 0x0004 -- NOTIFICATION_TEXT_MASK @@ -1694,17 +1669,16 @@ typedef struct { \item 0x0080 -- SERVICE_TYPE_MASK \item 0x0100 -- USER_RESP_TIMER_MASK \vspace{-0.18in} \end{itemize1} - */ + */ uint8_t invokeId; - /**< Supplementary Services invoke ID. */ + /**< Supplementary Services invoke ID. */ qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Type of data encoding scheme for the text. Applies to both the notification text and the client address. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN \item 0x0000000D -- NI_SS_ENGLISH \item 0x0000000E -- NI_SS_ITALIAN @@ -1725,46 +1699,45 @@ typedef struct { \item 0x0000001D -- NI_SUPL_UCS2 \item 0x0000001E -- NI_SUPL_GSM_DEFAULT \vspace{-0.18in} \end{itemize1} - */ + */ uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Notification text; the encoding method is specified in dataCodingScheme. \n - Type: Array of bytes \n - - Maximum array length: 64 */ + - Maximum array length: 64 */ uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; /**< Client address; the encoding method is specified in dataCodingScheme. \n - - Maximum array length: 20 */ + - Maximum array length: 20 */ qmiLocNiLocationTypeEnumT_v02 locationType; /**< Location type. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- CURRENT_LOCATION \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \item 0x00000004 -- INITIAL_LOCATION \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ uint8_t lcsServiceTypeId; - /**< Service type ID. */ + /**< Service type ID. */ uint16_t userResponseTimer; /**< Time to wait for the user to respond. \n - - Units: Seconds */ + - Units: Seconds */ }qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ /** @} @@ -1788,16 +1761,15 @@ typedef enum { typedef struct { qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ + /**< Ongoing NI session request; this information is currently not filled. */ qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- ONGOING_NI_INCOMING_MO \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocNiVxServiceInteractionStructT_v02; /* Type */ /** @} @@ -1832,10 +1804,9 @@ typedef enum { eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot triggered session. */ eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic - triggered session. - The SUPL INIT message indicates a request for an area event triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + triggered session. */ QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; /** @@ -1859,8 +1830,7 @@ typedef struct { part of the Location ID or Multiple Location IDs parameter in the SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x0001 -- SUPPORTED_NETWORK_WLAN \item 0x0002 -- SUPPORTED_NETWORK_GSM \item 0x0004 -- SUPPORTED_NETWORK_WCDMA @@ -1872,18 +1842,17 @@ typedef struct { \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; /**< Specifies the type of session trigger requested in the SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT \item 0x00000000 -- TRIGGER_TYPE_PERIODIC \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; /**< Specifies which GNSS technologies are allowed as positioning @@ -1896,7 +1865,7 @@ typedef struct { - 0x0008 -- GNSS_SBAS \n - 0x0010 -- GNSS_QZSS \n - 0x0020 -- GNSS_MODERN_GPS - */ + */ }qmiLocNiSuplVer2ExtStructT_v02; /* Type */ /** @} @@ -1913,39 +1882,38 @@ typedef struct { qmiLocNiNotifyVerifyEnumT_v02 notificationType; /**< Type of notification/verification performed. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- NO_NOTIFY_NO_VERIFY \item 0x00000002 -- NOTIFY_ONLY \item 0x00000003 -- ALLOW_NO_RESP \item 0x00000004 -- NOT_ALLOW_NO_RESP \item 0x00000005 -- PRIVACY_OVERRIDE \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Network Initiated Vx Request */ uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ + /**< \n Optional NI Vx request payload. */ /* Optional */ /* Network Initiated SUPL Request */ uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ + /**< \n Optional NI SUPL request payload. */ /* Optional */ /* Network Initiated UMTS Control Plane Request */ uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ + /**< \n Optional NI UMTS-CP request payload. */ /* Optional */ /* Network Initiated Service Interaction Request */ uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ + /**< \n Optional NI service interaction payload. */ /* Optional */ /* Network Initiated SUPL Version 2 Extension */ @@ -1953,7 +1921,7 @@ typedef struct { qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; /**< \n Optional NI SUPL Version 2 Extension payload. When present, this payload is to be used in conjunction with the SUPL - indication payload. */ + indication payload. */ }qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ /** @} @@ -1969,7 +1937,7 @@ typedef struct { \begin{itemize1} \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocAssistanceServerUrlStructT_v02; /* Type */ /** @} @@ -1983,7 +1951,7 @@ typedef struct { uint32_t delayThreshold; /**< The time server is to be skipped if a one-way delay to the server exceeds this threshold. \n - - Units: Milliseconds */ + - Units: Milliseconds */ uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; @@ -1991,7 +1959,7 @@ typedef struct { information, the list is ordered, the client is to use the first server specified in the list as the primary URL to fetch NTP time, the second one as secondary, and so on. \n - - Maximum server list items: 3 */ + - Maximum server list items: 3 */ }qmiLocTimeServerListStructT_v02; /* Type */ /** @} @@ -2008,7 +1976,7 @@ typedef struct { uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ qmiLocTimeServerListStructT_v02 timeServerInfo; /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ + location service for NTP time. */ }qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ /** @} @@ -2020,10 +1988,10 @@ typedef struct { typedef struct { uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). */ + /**< Maximum allowable predicted orbits file size (in bytes). */ uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). */ + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ }qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ /** @} @@ -2040,7 +2008,7 @@ typedef struct { must use the first server specified in the list as the primary URL from which to download predicted orbits data, the second one as secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ + - Maximum number of servers that can be specified: 3 */ }qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ /** @} @@ -2055,14 +2023,14 @@ typedef struct { /* Mandatory */ /* Allowed Sizes */ qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ + /**< \n Maximum part and file size allowed to be injected in the engine. */ /* Optional */ /* Server List */ uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ qmiLocPredictedOrbitsServerListStructT_v02 serverList; /**< \n List of servers that can be used by the client to download - predicted orbits data. */ + predicted orbits data. */ }qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ /** @} @@ -2084,7 +2052,7 @@ typedef struct { \item Range: -90.0 to 90.0 \begin{itemize1} \item Positive values indicate northern latitude \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Mandatory */ /* Longitude */ @@ -2096,13 +2064,13 @@ typedef struct { \item Range: -180.0 to 180.0 \begin{itemize1} \item Positive values indicate eastern longitude \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Mandatory */ /* Circular Horizontal Uncertainty */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ + - Units: Meters */ /* Mandatory */ /* UTC Timestamp */ @@ -2110,7 +2078,7 @@ typedef struct { /**< UTC timestamp. \begin{itemize1} \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ /** @} @@ -2121,9 +2089,8 @@ typedef struct { */ typedef enum { QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. - Location engine is off. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocEngineStateEnumT_v02; /** @@ -2144,7 +2111,7 @@ typedef struct { Valid values: \n - 0x00000001 -- ON \n - 0x00000002 -- OFF - */ + */ }qmiLocEventEngineStateIndMsgT_v02; /* Message */ /** @} @@ -2155,9 +2122,8 @@ typedef struct { */ typedef enum { QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. - Location fix session has ended. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocFixSessionStateEnumT_v02; /** @@ -2178,7 +2144,7 @@ typedef struct { Valid values: \n - 0x00000001 -- STARTED \n - 0x00000002 -- FINISHED - */ + */ /* Optional */ /* Session ID */ @@ -2187,7 +2153,7 @@ typedef struct { /**< ID of the session that was specified in the Start request. This may not be specified for a fix session corresponding to a network-initiated request. \n - - Range: 0 to 255 */ + - Range: 0 to 255 */ }qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ /** @} @@ -2199,9 +2165,8 @@ typedef struct { typedef enum { QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. - Stop periodic fixes request. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocWifiRequestEnumT_v02; /** @@ -2219,20 +2184,19 @@ typedef struct { qmiLocWifiRequestEnumT_v02 requestType; /**< Request type as specified in qmiWifiRequestEnumT. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \item 0x00000001 -- START_PERIODIC_KEEP_WARM \item 0x00000002 -- STOP_PERIODIC_FIXES \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Time Between Fixes */ uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ uint16_t tbfInMs; /**< Time between fixes for a periodic request.\n - - Units: Milliseconds */ + - Units: Milliseconds */ }qmiLocEventWifiReqIndMsgT_v02; /* Message */ /** @} @@ -2249,16 +2213,16 @@ typedef struct { samplingFrequency = samplesPerBatch * batchesPerSecond \n - samplesPerBatch must be a non-zero positive value. - */ + samplesPerBatch must be a nonzero positive value. + */ uint16_t batchesPerSecond; /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in integral number of batches per + per second. The rate is specified in an integral number of batches per second (Hz). \n - batchesPerSecond must be a non-zero positive value. - */ + batchesPerSecond must be a nonzero positive value. + */ }qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ /** @} @@ -2273,20 +2237,19 @@ typedef struct { /**< Whether the GNSS location engine is ready to accept data from this sensor. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \item 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor data \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; /**< Rate at which the GNSS engine would like the sensor to be sampled. \n The rate is specified in integral number of samples per second (Hz)\n and batches per second. - */ + */ }qmiLocSensorReadyStatusStructT_v02; /* Type */ /** @} @@ -2305,7 +2268,7 @@ typedef struct { qmiLocSensorReadyStatusStructT_v02 accelReady; /**< \n Whether the GNSS location engine is ready to accept accelerometer sensor data. - */ + */ /* Optional */ /* Gyroscope Accept Ready */ @@ -2313,7 +2276,7 @@ typedef struct { qmiLocSensorReadyStatusStructT_v02 gyroReady; /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor data. - */ + */ }qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ /** @} @@ -2332,7 +2295,7 @@ typedef struct { /**< This TLV is sent to registered control points. It is sent by the location engine when it needs to synchronize location engine and control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. */ + This TLV must be echoed back in the Time Sync Inject request. */ }qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ /** @} @@ -2352,7 +2315,7 @@ typedef struct { \begin{itemize1} \item 0x01 (TRUE) -- Client is to start sending an SPI status stream \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ }qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ /** @} @@ -2363,9 +2326,8 @@ typedef struct { */ typedef enum { QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. - Bring up the WWAN type used for AGNSS connections. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocWWANTypeEnumT_v02; /** @@ -2377,9 +2339,8 @@ typedef enum { */ typedef enum { QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. - Close a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocServerRequestEnumT_v02; /** @@ -2396,7 +2357,7 @@ typedef struct { /* Mandatory */ /* Connection Handle */ uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. */ + /**< Identifies a connection across Open and Close request events. */ /* Mandatory */ /* Request Type */ @@ -2406,18 +2367,18 @@ typedef struct { Valid values: \n - 0x00000001 -- OPEN \n - 0x00000002 -- CLOSE - */ + */ /* Mandatory */ /* WWAN Type */ qmiLocWWANTypeEnumT_v02 wwanType; /**< Identifies the WWAN type for this request. \n - Valid values: - \begin{itemize1} + + Valid values: \begin{itemize1} \item 0x00000000 -- WWAN_TYPE_INTERNET \item 0x00000001 -- WWAN_TYPE_AGNSS \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ /** @} @@ -2429,10 +2390,9 @@ typedef struct { typedef enum { QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ - eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. - An NI Geofence was edited. The control point can query the + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the Geofence to find the its current state. */ - eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiGeofenceOperationEnumT_v02; /** @@ -2450,19 +2410,19 @@ typedef struct { /* Geofence ID */ uint32_t geofenceId; /**< ID of the Geofence for which this - notification was generated. */ + notification was generated. */ /* Mandatory */ /* Operation Type */ qmiLocNiGeofenceOperationEnumT_v02 operationType; - /**< Operation for which this notification was generated. \n - Valid values: - \begin{itemize1} + /**< Operation for which this notification was generated. + + Valid values: \begin{itemize1} \item 0x00000001 -- NI_GEOFENCE_ADDED \item 0x00000002 -- NI_GEOFENCE_DELETED \item 0x00000003 -- NI_GEOFENCE_EDITED \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ /** @} @@ -2478,9 +2438,8 @@ typedef enum { eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can be used to monitor Geofences. */ eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage - information is available. - The engine has an invalid time. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, + information is available. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceGenAlertEnumT_v02; /** @@ -2497,15 +2456,15 @@ typedef struct { /* Mandatory */ /* Geofence General Alert */ qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. \n - Valid values: - \begin{itemize1} + /**< Specifies the Geofence general alert type. + + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ /** @} @@ -2516,9 +2475,8 @@ typedef struct { */ typedef enum { QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. - Denotes that a client left the Geofence. */ - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceBreachTypeEnumT_v02; /** @@ -2535,7 +2493,7 @@ typedef struct { /**< UTC timestamp. \begin{itemize1} \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Latitude */ double latitude; @@ -2546,7 +2504,7 @@ typedef struct { \item Range: -90.0 to 90.0 \begin{itemize1} \item Positive values indicate northern latitude \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Longitude */ double longitude; @@ -2557,23 +2515,23 @@ typedef struct { \item Range: -180.0 to 180.0 \begin{itemize1} \item Positive values indicate eastern longitude \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ float horUncEllipseSemiMinor; /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ float horUncEllipseSemiMajor; /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Elliptical Horizontal Uncertainty Azimuth */ float horUncEllipseOrientAzimuth; /**< Elliptical horizontal uncertainty azimuth of orientation.\n - Units: Decimal degrees \n - - Range: 0 to 180 */ + - Range: 0 to 180 */ /* Horizontal Speed validity bit */ uint8_t speedHorizontal_valid; @@ -2583,12 +2541,12 @@ typedef struct { \item 0x01 (TRUE) -- Horizontal speed is valid \item 0x00 (FALSE) -- Horizontal speed is invalid and is to be ignored - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Horizontal Speed */ float speedHorizontal; /**< Horizontal speed.\n - - Units: Meters/second */ + - Units: Meters/second */ /* Altitude validity bit */ uint8_t altitudeWrtEllipsoid_valid; @@ -2599,13 +2557,13 @@ typedef struct { \item 0x00 (FALSE) -- Altitude field is invalid and is to be ignored \vspace{-0.18in} \end{itemize1} - */ + */ /* Altitude With Respect to Ellipsoid */ float altitudeWrtEllipsoid; /**< Altitude with respect to the WGS84 ellipsoid.\n - Units: Meters \n - - Range: -500 to 15883 */ + - Range: -500 to 15883 */ /* Vertical Uncertainty validity bit */ uint8_t vertUnc_valid; @@ -2615,12 +2573,12 @@ typedef struct { \item 0x01 (TRUE) -- Vertical Uncertainty field is valid \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid and is to be ignored - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Vertical Uncertainty */ float vertUnc; /**< Vertical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Vertical Speed validity bit */ uint8_t speedVertical_valid; @@ -2630,12 +2588,12 @@ typedef struct { \item 0x01 (TRUE) -- Vertical Speed field is valid \item 0x00 (FALSE) -- Vertical Speed field is invalid and is to be ignored - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Vertical Speed */ float speedVertical; /**< Vertical speed.\n - - Units: Meters/second */ + - Units: Meters/second */ /* heading validity bit */ uint8_t heading_valid; @@ -2645,13 +2603,13 @@ typedef struct { \item 0x01 (TRUE) -- Heading field is valid \item 0x00 (FALSE) -- Heading field is invalid and is to be ignored - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Heading */ float heading; /**< Heading.\n - Units: Degrees \n - - Range: 0 to 359.999 */ + - Range: 0 to 359.999 */ }qmiLocGeofencePositionStructT_v02; /* Type */ /** @} @@ -2668,19 +2626,18 @@ typedef struct { /* Geofence ID */ uint32_t geofenceId; /**< ID of the Geofence for which this - notification was generated. */ + notification was generated. */ /* Mandatory */ /* Geofence Breach Type */ qmiLocGeofenceBreachTypeEnumT_v02 breachType; /**< The type of breach that generated this event. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Geofence Position */ @@ -2690,7 +2647,7 @@ typedef struct { This TLV is included if the client configures the Geofence to report position. The position is reported at the same confidence level that was specified in the - Add Circular Geofence request. */ + Add Circular Geofence request. */ }qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ /** @} @@ -2708,10 +2665,9 @@ typedef enum { eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested - Request failed because the engine could not allocate sufficent + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent memory for the request. */ - eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocStatusEnumT_v02; /** @@ -2735,8 +2691,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Revision request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -2745,14 +2700,14 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Mandatory */ /* Interface Definition Minor Revision */ uint32_t revision; /**< Revision of the service. This is the minor revision of the interface that the service implements. Minor revision updates of the service are always - backward compatible. */ + backward compatible. */ /* Optional */ /* GNSS Measurement Engine Firmware Version String */ @@ -2766,7 +2721,7 @@ typedef struct { \textbf{Note:} This string is only provided on platforms that have a measurement engine that supports this version string. On all other - platforms, this optional TLV is not provided. */ + platforms, this optional TLV is not provided. */ /* Optional */ /* GNSS Hosted Software Version String */ @@ -2781,7 +2736,7 @@ typedef struct { \textbf{Note:} This string is only provided on hosted architectures (measurement and position engine running on different processors) that support this version string. On all other platforms, this optional TLV - is not provided. */ + is not provided. */ /* Optional */ /* GNSS Software Version String */ @@ -2791,7 +2746,7 @@ typedef struct { \begin{itemize1} \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ /** @} @@ -2814,8 +2769,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Fix Criteria request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -2824,7 +2778,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Horizontal Accuracy */ @@ -2832,13 +2786,12 @@ typedef struct { qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; /**< Horizontal accuracy level. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- LOW: Client requires low horizontal accuracy \item 0x00000002 -- MED: Client requires medium horizontal accuracy \item 0x00000003 -- HIGH: Client requires high horizontal accuracy \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Enable/Disable Intermediate Fixes */ @@ -2850,28 +2803,28 @@ typedef struct { generated at \n 1 Hz and are ON by default. If intermediate reports are turned ON, the client receives position reports even if the accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. \n - Valid values: - \begin{itemize1} + set to IN_PROGRESS for intermediate reports. + + Valid values: \begin{itemize1} \item 0x00000001 -- ON: Client is interested in receiving intermediate reports \item 0x00000002 -- OFF: Client is not interested in receiving intermediate reports \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Minimum Interval Between Fixes */ uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ uint32_t minInterval; /**< Time that must elapse before alerting the client. \n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Optional */ /* ID of the Application that Sent the Position Request */ uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version. */ + /**< \n Application provider, name, and version.*/ }qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ /** @} @@ -2883,9 +2836,8 @@ typedef struct { typedef enum { QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. - User did not respond to notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiUserRespEnumT_v02; /** @@ -2904,58 +2856,56 @@ typedef struct { qmiLocNiUserRespEnumT_v02 userResp; /**< User accepted or denied. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT \item 0x00000002 -- NOTIFY_VERIFY_DENY \item 0x00000003 -- NOTIFY_VERIFY_NORESP \vspace{-0.18in} \end{itemize1} - */ + */ /* Mandatory */ /* Notification Type */ qmiLocNiNotifyVerifyEnumT_v02 notificationType; /**< Type of notification/verification performed. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- NO_NOTIFY_NO_VERIF \item 0x00000002 -- NOTIFY_ONLY \item 0x00000003 -- ALLOW_NO_RESP \item 0x00000004 -- NOT_ALLOW_NO_RESP \item 0x00000005 -- PRIVACY_OVERRIDE \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Network Initiated Vx Request */ uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ + /**< \n Optional NI VX request payload. */ /* Optional */ /* Network Initiated SUPL Request */ uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ + /**< \n Optional NI SUPL request payload. */ /* Optional */ /* Network Initiated UMTS Control Plane Request */ uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ + /**< \n Optional NI UMTS-CP request payload. */ /* Optional */ /* Network Initiated Service Interaction Request */ uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ + /**< \n Optional NI service interaction payload. */ /* Optional */ /* Network Initiated SUPL Version 2 Extension */ uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \n Optional SUPL Version 2 Extension payload. */ + /**< \n Optional SUPL Version 2 Extension payload. */ }qmiLocNiUserRespReqMsgT_v02; /* Message */ /** @} @@ -2973,8 +2923,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the NI User Response request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -2983,7 +2932,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocNiUserRespIndMsgT_v02; /* Message */ /** @} @@ -3011,18 +2960,18 @@ typedef struct { /* Total Size */ uint32_t totalSize; /**< Total size of the predicted orbits data to be injected. \n - - Units: Bytes */ + - Units: Bytes */ /* Mandatory */ /* Total Parts */ uint16_t totalParts; /**< Total number of parts into which the predicted orbits data is - divided. */ + divided. */ /* Mandatory */ /* Part Number */ uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. */ + /**< Number of the current predicted orbits data part; starts at 1. */ /* Mandatory */ /* Data */ @@ -3031,7 +2980,7 @@ typedef struct { /**< Predicted orbits data. \n - Type: Array of bytes \n - Maximum length of the array: 1024 - */ + */ /* Optional */ /* Format Type */ @@ -3039,11 +2988,10 @@ typedef struct { qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; /**< Predicted orbits data format. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- PREDICTED_ORBITS_XTRA \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ /** @} @@ -3060,8 +3008,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Data Injection request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3070,14 +3017,14 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Part Number */ uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ uint16_t partNum; /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. */ + is sent; starts at 1. */ }qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ /** @} @@ -3100,8 +3047,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the query request for a predicted orbits data source. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3110,20 +3056,20 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Allowed Sizes */ uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ + /**< \n Maximum part and file size allowed to be injected in the engine. */ /* Optional */ /* Server List */ uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ qmiLocPredictedOrbitsServerListStructT_v02 serverList; /**< \n List of servers that can be used by the client to download - predicted orbits data. */ + predicted orbits data. */ }qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ /** @} @@ -3143,12 +3089,12 @@ typedef struct { uint64_t startTimeInUTC; /**< Predicted orbits data is valid starting from this time. \n - Units: Seconds (since Jan. 1, 1970) - */ + */ uint16_t durationHours; /**< Duration from the start time for which the data is valid.\n - Units: Hours - */ + */ }qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ /** @} @@ -3165,8 +3111,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the query request for predicted orbits data validity. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3175,7 +3120,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Validity Info */ @@ -3196,13 +3141,13 @@ typedef struct { /* UTC Time */ uint64_t timeUtc; /**< UTC time since Jan. 1, 1970.\n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Mandatory */ /* Time Uncertainty */ uint32_t timeUnc; /**< Time uncertainty.\n - - Units: Milliseconds */ + - Units: Milliseconds */ }qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ /** @} @@ -3219,8 +3164,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the UTC Time Injection request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3229,7 +3173,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ /** @} @@ -3248,9 +3192,8 @@ typedef enum { eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. - Other sources. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAltSrcEnumT_v02; /** @@ -3264,9 +3207,8 @@ typedef enum { QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. - Fully independent. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAltSrcLinkageEnumT_v02; /** @@ -3280,11 +3222,10 @@ typedef enum { QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. - Altitude uncertainty applies to the position of the device + position coordinates only. */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device regardless of horizontal position (within the horizontal uncertainty region, if provided). */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAltSrcUncertaintyCoverageEnumT_v02; /** @@ -3299,8 +3240,7 @@ typedef struct { qmiLocAltSrcEnumT_v02 source; /**< Specifies the source of the altitude. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- ALT_SRC_UNKNOWN \item 0x00000001 -- ALT_SRC_GPS \item 0x00000002 -- ALT_SRC_CELL_ID @@ -3312,26 +3252,24 @@ typedef struct { \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \item 0x00000009 -- ALT_SRC_OTHER \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocAltSrcLinkageEnumT_v02 linkage; /**< Specifies the dependency between the horizontal and altitude position components. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; /**< Specifies the region of uncertainty. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the injected horizontal position coordinates @@ -3341,7 +3279,7 @@ typedef struct { horizontal position (within the horizontal uncertainty region, if provided). \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocAltitudeSrcInfoStructT_v02; /* Type */ /** @} @@ -3357,9 +3295,8 @@ typedef enum { eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. - Other sources. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocPositionSrcEnumT_v02; /** @@ -3384,7 +3321,7 @@ typedef struct { \item Positive values indicate northern latitude \item Negative values indicate southern latitude \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ + */ /* Optional */ /* Longitude */ @@ -3398,14 +3335,14 @@ typedef struct { \item Positive values indicate eastern longitude \item Negative values indicate western longitude \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ + */ /* Optional */ /* Circular Horizontal Uncertainty */ uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Horizontal Confidence */ @@ -3419,7 +3356,7 @@ typedef struct { \item If 100 is received, reinterpret to 99 \end{itemize1} This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ + If not specified, the default value will be 50. */ /* Optional */ /* Horizontal Reliability */ @@ -3427,15 +3364,14 @@ typedef struct { qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Altitude With Respect to Ellipsoid */ @@ -3446,14 +3382,14 @@ typedef struct { \item Units: Meters \begin{itemize1} \item Positive = height \item Negative = depth - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ /* Optional */ /* Altitude With Respect to Sea Level */ uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ float altitudeWrtMeanSeaLevel; /**< Altitude with respect to mean sea level.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Vertical Uncertainty */ @@ -3461,7 +3397,7 @@ typedef struct { float vertUnc; /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid or altitudeWrtMeanSeaLevel is specified.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Vertical Confidence */ @@ -3475,7 +3411,7 @@ typedef struct { \item If 100 is received, reinterpret to 99 \end{itemize1} This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ + If not specified, the default value will be 50. */ /* Optional */ /* Vertical Reliability */ @@ -3483,43 +3419,42 @@ typedef struct { qmiLocReliabilityEnumT_v02 vertReliability; /**< Specifies the reliability of the vertical position. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Altitude Source Info */ uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ + /**< \n Specifies information regarding the altitude source. */ /* Optional */ /* UTC Timestamp */ uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ uint64_t timestampUtc; /**< UTC timestamp. \n - - Units: Milliseconds (since Jan. 1, 1970) */ + - Units: Milliseconds (since Jan. 1, 1970) */ /* Optional */ /* Position Age */ uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ int32_t timestampAge; /**< Position age, which is an estimate of how long ago this fix was made. \n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Optional */ /* Position Source */ uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from which this position was obtained. \n - Valid values: - \begin{itemize1} + /**< Source from which this position was obtained. + + Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID @@ -3528,12 +3463,13 @@ typedef struct { \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \end{itemize1} \vspace{0.05in} + If altitude is specified and the altitude source is not specified, the engine assumes that the altitude was obtained using the specified position source. \n If both altitude and altitude source are specified, the engine assumes that only latitude and longitude were obtained using the specified position source. - */ + */ }qmiLocInjectPositionReqMsgT_v02; /* Message */ /** @} @@ -3550,8 +3486,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the UTC Position Injection request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3560,7 +3495,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectPositionIndMsgT_v02; /* Message */ /** @} @@ -3573,9 +3508,8 @@ typedef enum { QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. - Lock all position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocLockEnumT_v02; /** @@ -3599,7 +3533,7 @@ typedef struct { - 0x00000003 -- LOCK_MT \n - 0x00000004 -- LOCK_ALL - */ + */ }qmiLocSetEngineLockReqMsgT_v02; /* Message */ /** @} @@ -3616,8 +3550,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Engine Lock request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3626,7 +3559,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetEngineLockIndMsgT_v02; /* Message */ /** @} @@ -3649,8 +3582,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Engine Lock request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3659,7 +3591,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Lock Type */ @@ -3672,7 +3604,7 @@ typedef struct { - 0x00000002 -- LOCK_MI \n - 0x00000003 -- LOCK_MT \n - 0x00000004 -- LOCK_ALL - */ + */ }qmiLocGetEngineLockIndMsgT_v02; /* Message */ /** @} @@ -3691,7 +3623,7 @@ typedef struct { \begin{itemize1} \item 0x01 (TRUE) -- SBAS configuration is enabled \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ }qmiLocSetSbasConfigReqMsgT_v02; /* Message */ /** @} @@ -3708,8 +3640,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set SBAS Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3718,7 +3649,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSbasConfigIndMsgT_v02; /* Message */ /** @} @@ -3741,8 +3672,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get SBAS Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3751,7 +3681,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* SBAS Config */ @@ -3761,7 +3691,7 @@ typedef struct { \begin{itemize1} \item 0x01 (TRUE) -- SBAS configuration is enabled \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ }qmiLocGetSbasConfigIndMsgT_v02; /* Message */ /** @} @@ -3794,7 +3724,7 @@ typedef struct { - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - 0x00000040 -- NMEA_MASK_PSTIS - */ + */ }qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ /** @} @@ -3811,8 +3741,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of Set NMEA Types request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3821,7 +3750,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ /** @} @@ -3844,8 +3773,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get NMEA Types request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3854,7 +3782,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* NMEA Sentence Types */ @@ -3871,7 +3799,7 @@ typedef struct { - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - 0x00000040 -- NMEA_MASK_PSTIS - */ + */ }qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ /** @} @@ -3888,7 +3816,7 @@ typedef struct { uint8_t lowPowerMode; /**< Whether to enable Low Power mode:\n - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ + - 0x00 (FALSE) -- Disable LPM */ }qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ /** @} @@ -3905,8 +3833,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Low Power Mode request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3915,7 +3842,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ /** @} @@ -3938,8 +3865,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get LPM request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -3948,7 +3874,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Enable/Disable LPM */ @@ -3956,7 +3882,7 @@ typedef struct { uint8_t lowPowerMode; /**< Whether to enable Low Power mode:\n - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ + - 0x00 (FALSE) -- Disable LPM */ }qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ /** @} @@ -3969,9 +3895,8 @@ typedef enum { QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. - Server type is custom PDE. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocServerTypeEnumT_v02; /** @@ -3994,19 +3919,19 @@ typedef struct { - 0x00000002 -- CDMA_MPC \n - 0x00000003 -- UMTS_SLP \n - 0x00000004 -- CUSTOM_PDE - */ + */ /* Optional */ /* IPV4 Address */ uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ + /**< \n IPV4 address and port. */ /* Optional */ /* IPV6 Address */ uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ + /**< \n IPV6 address and port. */ /* Optional */ /* Uniform Resource Locator */ @@ -4017,7 +3942,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetServerReqMsgT_v02; /* Message */ /** @} @@ -4034,8 +3959,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Server request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4044,7 +3968,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetServerIndMsgT_v02; /* Message */ /** @} @@ -4066,7 +3990,7 @@ typedef struct { - 0x00000002 -- CDMA_MPC \n - 0x00000003 -- UMTS_SLP \n - 0x00000004 -- CUSTOM_PDE - */ + */ /* Optional */ /* Server Address Type */ @@ -4080,7 +4004,7 @@ typedef struct { - 0x01 -- IPV4 \n - 0x02 -- IPV6 \n - 0x04 -- URL - */ + */ }qmiLocGetServerReqMsgT_v02; /* Message */ /** @} @@ -4097,8 +4021,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Server request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4107,7 +4030,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Mandatory */ /* Server Type */ @@ -4119,19 +4042,19 @@ typedef struct { - 0x00000002 -- CDMA_MPC \n - 0x00000003 -- UMTS_SLP \n - 0x00000004 -- CUSTOM_PDE - */ + */ /* Optional */ /* IPV4 Address */ uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ + /**< \n IPV4 address and port. */ /* Optional */ /* IPV6 Address */ uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ + /**< \n IPV6 address and port. */ /* Optional */ /* Uniform Resource Locator */ @@ -4142,7 +4065,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetServerIndMsgT_v02; /* Message */ /** @} @@ -4206,20 +4129,19 @@ typedef struct { \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ qmiLocSvSystemEnumT_v02 system; /**< Indicates to which constellation this SV belongs. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS \vspace{-0.18in} \end{itemize1} - */ + */ qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; /**< Indicates if the ephemeris or almanac for a satellite @@ -4227,7 +4149,7 @@ typedef struct { Valid values: \n - 0x01 -- DELETE_EPHEMERIS \n - 0x02 -- DELETE_ALMANAC - */ + */ }qmiLocDeleteSvInfoStructT_v02; /* Type */ /** @} @@ -4245,15 +4167,14 @@ typedef struct { uint8_t deleteAllFlag; /**< Whether all assistance data is to be deleted. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- All assistance data is to be deleted; if this flag is set, all the other information contained in the optional fields for this message are ignored \item 0x00 (FALSE) -- The optional fields in the message are to be used to determine which data is to be deleted - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Delete SV Info */ @@ -4261,7 +4182,7 @@ typedef struct { uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; /**< \n List of satellites for which the assistance data is to be deleted. - */ + */ /* Optional */ /* Delete GNSS Data */ @@ -4269,8 +4190,7 @@ typedef struct { qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; /**< Mask for the GNSS data that is to be deleted. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- DELETE_GPS_SVDIR \item 0x00000002 -- DELETE_GPS_SVSTEER \item 0x00000004 -- DELETE_GPS_TIME @@ -4291,7 +4211,7 @@ typedef struct { \item 0x00020000 -- DELETE_SV_NO_EXIST \item 0x00040000 -- DELETE_FREQ_BIAS_EST \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Delete Cell Database */ @@ -4299,8 +4219,7 @@ typedef struct { qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; /**< Mask for the cell database assistance data that is to be deleted. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- DELETE_CELLDB_POS \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \item 0x00000004 -- DELETE_CELLDB_OTA_POS @@ -4312,7 +4231,7 @@ typedef struct { \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Delete Clock Info */ @@ -4320,8 +4239,7 @@ typedef struct { qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; /**< Mask for the clock information assistance data that is to be deleted. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER @@ -4334,7 +4252,7 @@ typedef struct { \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ /** @} @@ -4352,8 +4270,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Delete Assist Data request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4362,7 +4279,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ /** @} @@ -4379,7 +4296,7 @@ typedef struct { uint8_t xtraTSessionControl; /**< Whether to enable XTRA-T:\n - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ + - 0x00 (FALSE) -- Disable XTRA-T */ }qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ /** @} @@ -4396,8 +4313,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set XTRA-T Session Control request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4406,7 +4322,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ /** @} @@ -4430,8 +4346,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get XTRA-T Session Control request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4440,7 +4355,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Enable/Disable XTRA-T */ @@ -4448,7 +4363,7 @@ typedef struct { uint8_t xtraTSessionControl; /**< Whether to enable XTRA-T:\n - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ + - 0x00 (FALSE) -- Disable XTRA-T */ }qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ /** @} @@ -4462,7 +4377,7 @@ typedef struct { uint32_t wifiPositionTime; /**< Common counter (typically, the number of milliseconds since bootup). This field is only to be provided if the modem and host processors are - synchronized. */ + synchronized. */ }qmiLocWifiFixTimeStructT_v02; /* Type */ /** @} @@ -4480,9 +4395,8 @@ typedef enum { code. */ eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. - WiFi fix failed, but the cause could not be determined. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, + This may be because the APs found are not in the database. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocWifiFixErrorCodeEnumT_v02; /** @@ -4497,19 +4411,19 @@ typedef struct { double lat; /**< WiFi position latitude. \n - Type: Floating point \n - - Units: Degrees */ + - Units: Degrees */ double lon; /**< WiFi position longitude. \n - Type: Floating point \n - - Units: Degrees */ + - Units: Degrees */ uint16_t hepe; /**< WiFi position HEPE.\n - - Units: Meters */ + - Units: Meters */ uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. */ + /**< Number of Access Points (AP) used to generate a fix. */ qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; /**< WiFi position error code; set to 0 if the fix succeeds. This position @@ -4517,8 +4431,7 @@ typedef struct { the error code provided by the WiFi positioning system can be provided here. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- ERROR_SUCCESS \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \item 0x00000002 -- ERROR_NO_AP_FOUND @@ -4527,7 +4440,7 @@ typedef struct { \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \item 0x00000006 -- ERROR_UNKNOWN \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocWifiFixPosStructT_v02; /* Type */ /** @} @@ -4547,14 +4460,14 @@ typedef struct { /**< Associated MAC address of the AP. \n - Type: Array of unsigned integers \n - Address length: 6 - */ + */ int32_t rssi; /**< Receive signal strength indicator.\n - - Units: dBm (offset with +100 dB) */ + - Units: dBm (offset with +100 dB) */ uint16_t channel; - /**< WiFi channel on which a beacon was received. */ + /**< WiFi channel on which a beacon was received. */ qmiLocWifiApQualifierMaskT_v02 apQualifier; /**< A bitmask of Boolean qualifiers for APs. @@ -4565,7 +4478,7 @@ typedef struct { - 0x02 -- HIDDEN_SSID \n - 0x04 -- PRIVATE \n - 0x08 -- INFRASTRUCTURE_MODE - */ + */ }qmiLocWifiApInfoStructT_v02; /* Type */ /** @} @@ -4581,20 +4494,20 @@ typedef struct { /* WiFi Fix Time */ uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ + /**< \n Time of WiFi position fix. */ /* Optional */ /* WiFi Position */ uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ + /**< \n WiFi position fix. */ /* Optional */ /* WiFi Access Point Information */ uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ + /**< \n AP scan list. */ /* Optional */ /* Horizontal Reliability */ @@ -4602,15 +4515,14 @@ typedef struct { qmiLocReliabilityEnumT_v02 horizontalReliability; /**< Specifies the reliability of the horizontal position. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ /** @} @@ -4627,8 +4539,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject WiFi Position request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4637,7 +4548,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ /** @} @@ -4648,9 +4559,8 @@ typedef struct { */ typedef enum { QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. - WiFi is not available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocWifiStatusEnumT_v02; /** @@ -4668,12 +4578,11 @@ typedef struct { qmiLocWifiStatusEnumT_v02 wifiStatus; /**< WiFi status information. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- WIFI_STATUS_AVAILABLE \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ /** @} @@ -4690,8 +4599,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Notify WiFi Status request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4700,7 +4608,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ /** @} @@ -4724,8 +4632,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Registered Events request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4734,7 +4641,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Event Registration Mask */ @@ -4742,8 +4649,7 @@ typedef struct { qmiLocEventRegMaskT_v02 eventRegMask; /**< Event registration mask. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- POSITION_REPORT \item 0x00000002 -- GNSS_SV_INFO \item 0x00000004 -- NMEA @@ -4759,7 +4665,7 @@ typedef struct { \item 0x00001000 -- SET_SPI_STREAMING_REPORT \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ /** @} @@ -4774,11 +4680,10 @@ typedef enum { eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for GSM/UMTS network - Use WWAN measurements to calculate position. If this mode is - set then for 1x network AFLT will used and for LTE network - OTDOA will used. */ - eQMI_LOC_OPER_MODE_WWAN_V02 = 6, + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is + set, AFLT will be used for 1x networks and OTDOA will be used + for LTE networks. */ QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocOperationModeEnumT_v02; /** @@ -4797,9 +4702,9 @@ typedef struct { /* Operation Mode */ qmiLocOperationModeEnumT_v02 operationMode; /**< Preferred operation mode. + \label{operationMode} - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- OPER_MODE_DEFAULT \item 0x00000002 -- OPER_MODE_MSB \item 0x00000003 -- OPER_MODE_MSA @@ -4807,7 +4712,7 @@ typedef struct { \item 0x00000005 -- OPER_MODE_CELL_ID \item 0x00000006 -- OPER_MODE_WWAN \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetOperationModeReqMsgT_v02; /* Message */ /** @} @@ -4826,8 +4731,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Operation Mode request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4836,7 +4740,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetOperationModeIndMsgT_v02; /* Message */ /** @} @@ -4859,8 +4763,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Operation Mode request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4869,7 +4772,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Operation Mode */ @@ -4877,8 +4780,7 @@ typedef struct { qmiLocOperationModeEnumT_v02 operationMode; /**< Current operation mode. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- OPER_MODE_DEFAULT \item 0x00000002 -- OPER_MODE_MSB \item 0x00000003 -- OPER_MODE_MSA @@ -4886,7 +4788,7 @@ typedef struct { \item 0x00000005 -- OPER_MODE_CELL_ID \item 0x00000006 -- OPER_MODE_WWAN \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetOperationModeIndMsgT_v02; /* Message */ /** @} @@ -4906,14 +4808,14 @@ typedef struct { \begin{itemize1} \item 0x00 (FALSE) -- Device is not stationary \item 0x01 (TRUE) -- Device is stationary - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ /* Optional */ /* Confidence */ uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ uint8_t confidenceStationary; /**< Confidence in the Stationary state expressed as a percentage.\n - - Range: 0 to 100 */ + - Range: 0 to 100 */ }qmiLocSetSpiStatusReqMsgT_v02; /* Message */ /** @} @@ -4931,8 +4833,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the SPI Status request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -4941,7 +4842,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSpiStatusIndMsgT_v02; /* Message */ /** @} @@ -4960,22 +4861,22 @@ typedef struct { uint16_t timeOffset; /**< Sample time offset. This time offset must be relative to the sensor time of the first sample.\n - - Units: Milliseconds */ + - Units: Milliseconds */ float xAxis; /**< Sensor x-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds) ) */ float yAxis; /**< Sensor y-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds) ) */ float zAxis; /**< Sensor z-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds^2) ) */ + - Units Gyroscope: ( (rads)/(seconds) ) */ }qmiLoc3AxisSensorSampleStructT_v02; /* Type */ /** @} @@ -4989,21 +4890,21 @@ typedef struct { uint32_t timeOfFirstSample; /**< Denotes a full 32-bit time tag of the first (oldest) sample in this message. \n - - Units: Milliseconds */ + - Units: Milliseconds */ qmiLocSensorDataFlagMaskT_v02 flags; /**< Flags to indicate any deviation from the default measurement assumptions. All unused bits in this field must be set to 0. - Valid bitmasks: \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x01 -- SIGN_REVERSAL \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ + - Maximum length of the array: 50 */ }qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ /** @} @@ -5022,19 +4923,19 @@ typedef struct { uint32_t opaqueIdentifier; /**< An opaque identifier that is sent in by the client that will be echoed in the indication so the client can relate the indication to the - request. */ + request. */ /* Optional */ /* 3-Axis Accelerometer Data */ uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ + /**< \n Accelerometer sensor samples. */ /* Optional */ /* 3-Axis Gyroscope Data */ uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyroscope sensor samples. */ + /**< \n Gyroscope sensor samples. */ }qmiLocInjectSensorDataReqMsgT_v02; /* Message */ /** @} @@ -5052,8 +4953,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject Sensor Data request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5062,28 +4962,28 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Opaque Identifier */ uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ uint32_t opaqueIdentifier; /**< Opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. */ + so the client can relate the indication to the request. */ /* Optional */ /* Accelerometer Samples Accepted */ uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ uint8_t threeAxisAccelSamplesAccepted; /**< Lets the client know how many 3-axis accelerometer samples - were accepted. */ + were accepted. */ /* Optional */ /* Gyroscope Samples Accepted */ uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ uint8_t threeAxisGyroSamplesAccepted; /**< Lets the client know how many 3-axis gyroscope samples were - accepted. */ + accepted. */ }qmiLocInjectSensorDataIndMsgT_v02; /* Message */ /** @} @@ -5099,7 +4999,7 @@ typedef struct { /* Reference Time Sync Counter */ uint32_t refCounter; /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. */ + GNSS location engine requested time sync injection. */ /* Mandatory */ /* Sensor Receive Time */ @@ -5109,7 +5009,7 @@ typedef struct { Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Mandatory */ /* Sensor Transmit Time */ @@ -5119,7 +5019,7 @@ typedef struct { Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ + - Units: Milliseconds */ }qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ /** @} @@ -5136,8 +5036,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject Time Sync Data request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5146,7 +5045,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ /** @} @@ -5158,9 +5057,8 @@ typedef struct { typedef enum { QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle - Unknown cradle mount state */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocCradleMountStateEnumT_v02; /** @@ -5185,8 +5083,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Cradle Mount Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5195,7 +5092,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Cradle Mount State */ @@ -5203,20 +5100,19 @@ typedef struct { qmiLocCradleMountStateEnumT_v02 cradleMountState; /**< Cradle Mount state set by the control point. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \item 0x00000001 -- CRADLE_STATE_MOUNTED \item 0x00000002 -- CRADLE_STATE_UNKNOWN \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Cradle Mount Confidence */ uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ uint8_t confidenceCradleMountState; /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ + - Range: 0 to 100 */ }qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ /** @} @@ -5234,19 +5130,18 @@ typedef struct { qmiLocCradleMountStateEnumT_v02 cradleMountState; /**< Cradle Mount state set by the control point. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \item 0x00000001 -- CRADLE_STATE_MOUNTED \item 0x00000002 -- CRADLE_STATE_UNKNOWN - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Cradle Mount Confidence */ uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ uint8_t confidenceCradleMountState; /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ + - Range: 0 to 100 */ }qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ /** @} @@ -5264,8 +5159,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Cradle Mount Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5274,7 +5168,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ /** @} @@ -5286,9 +5180,8 @@ typedef struct { typedef enum { QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. - Unknown external power state. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocExternalPowerConfigEnumT_v02; /** @@ -5313,8 +5206,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get External Power Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5323,7 +5215,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* External Power State */ @@ -5331,13 +5223,12 @@ typedef struct { qmiLocExternalPowerConfigEnumT_v02 externalPowerState; /**< Power state; injected by the control point. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \item 0x00000001 -- EXTERNAL_POWER_CONNECTED \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ /** @} @@ -5355,13 +5246,12 @@ typedef struct { qmiLocExternalPowerConfigEnumT_v02 externalPowerState; /**< Power state; injected by the control point. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \item 0x00000001 -- EXTERNAL_POWER_CONNECTED \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ /** @} @@ -5379,8 +5269,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set External Power Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5389,7 +5278,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ /** @} @@ -5402,9 +5291,8 @@ typedef enum { QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. - PPP PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocServerPDNEnumT_v02; /** @@ -5417,14 +5305,14 @@ typedef enum { typedef struct { qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the Access Point Name (APN) profile. + /**< PDN type of the APN profile. Valid values: \n - 0x00000001 -- PDN_TYPE_IPV4 \n - 0x00000002 -- PDN_TYPE_IPV6 \n - 0x00000003 -- PDN_TYPE_IPV4V6 \n - 0x00000004 -- PDN_TYPE_PPP - */ + */ char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; /**< APN name. @@ -5432,7 +5320,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 101 \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocApnProfilesStructT_v02; /* Type */ /** @} @@ -5443,9 +5331,8 @@ typedef struct { */ typedef enum { QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. - Location server request failed. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocServerReqStatusEnumT_v02; /** @@ -5465,7 +5352,7 @@ typedef struct { /* Connection Handle */ uint32_t connHandle; /**< Connection handle that the service specified in the - Location Server Connection request event. */ + Location Server Connection request event. */ /* Mandatory */ /* Request Type */ @@ -5476,7 +5363,7 @@ typedef struct { Valid values: \n - 0x00000001 -- OPEN \n - 0x00000002 -- CLOSE - */ + */ /* Mandatory */ /* Connection Status */ @@ -5487,14 +5374,14 @@ typedef struct { - 0x00000001 -- STATUS_SUCCESS = 1 \n - 0x00000002 -- STATUS_FAILURE = 2 - */ + */ /* Optional */ /* APN Profile */ uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n APN profile information is present only when requestType - is OPEN and statusType is SUCCESS. */ + /**< \n Access Point Name (APN) profile information is present only when + requestType is OPEN and statusType is SUCCESS. */ }qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ /** @} @@ -5514,8 +5401,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inform Location Server Connection Status request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5524,7 +5410,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ /** @} @@ -5535,9 +5421,8 @@ typedef struct { */ typedef enum { QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. - V2 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocVxVersionEnumT_v02; /** @@ -5549,9 +5434,8 @@ typedef enum { */ typedef enum { QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. - SUPL version 2.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSuplVersionEnumT_v02; /** @@ -5562,8 +5446,8 @@ typedef uint32_t qmiLocLppConfigMaskT_v02; #define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ #define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in Control Plane */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in User Plane */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ /** @addtogroup loc_qmi_messages @{ */ @@ -5579,7 +5463,7 @@ typedef struct { \begin{itemize1} \item 0x01 (TRUE) -- SUPL security is enabled \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* VX Version */ @@ -5587,12 +5471,11 @@ typedef struct { qmiLocVxVersionEnumT_v02 vxVersion; /**< VX version. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- VX_VERSION_V1_ONLY \item 0x00000002 -- VX_VERSION_V2_ONLY \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* SUPL Version */ @@ -5603,7 +5486,7 @@ typedef struct { Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 - */ + */ /* Optional */ /* LPP Configuration */ @@ -5611,26 +5494,24 @@ typedef struct { qmiLocLppConfigMaskT_v02 lppConfig; /**< LTE Positioning Profile (LPP) configuration. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Assisted GLONASS Protocol Mask */ uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service can indicate it supports, - for Assisted Glonass. + /**< Configures the protocols that the location service supports + for assisted GLONASS. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -5654,8 +5535,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Configuration Parameters request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5664,25 +5544,23 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Failed Parameters */ uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< This field is sent only if the status is not a success. And if it is - not successful, this field will identify the parameters that were not - set successfully. + /**< Identifies parameters that were not set successfully. This field + is sent only if the status is not a success. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -5700,15 +5578,14 @@ typedef struct { qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -5726,8 +5603,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Configuration Parameters request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5736,7 +5612,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* SUPL Security */ @@ -5746,7 +5622,7 @@ typedef struct { \begin{itemize1} \item 0x01 (TRUE) -- SUPL security is enabled \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ /* Optional */ /* VX Version */ @@ -5754,12 +5630,11 @@ typedef struct { qmiLocVxVersionEnumT_v02 vxVersion; /**< VX version. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- VX_VERSION_V1_ONLY \item 0x00000002 -- VX_VERSION_V2_ONLY \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* SUPL Version */ @@ -5770,7 +5645,7 @@ typedef struct { Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 - */ + */ /* Optional */ /* LPP Configuration */ @@ -5778,25 +5653,23 @@ typedef struct { qmiLocLppConfigMaskT_v02 lppConfig; /**< LTE Positioning Profile (LPP) configuration. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Assisted GLONASS Protocol Mask */ uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Assisted GLONASS Protocol Mask. + /**< Assisted GLONASS Protocol mask. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -5811,10 +5684,9 @@ typedef enum { received. If sensor data are injected, the positioning engine attempts to improve the heading and positioning performance using sensors. This is the default. - - Inertial sensors are not to be used to aid heading and position + */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position improvement. */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSensorsControlConfigSensorUseEnumT_v02; /** @@ -5834,18 +5706,17 @@ typedef struct { /**< Controls how sensors are used to aid heading and positioning performance. - Valid values: - \begin{itemize1} - \item 0x00000000 -- SENSORS USE ENABLED: \n + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: Sensors data is to be requested whenever a position request is received. If sensors data is injected, the GNSS location engine attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS USE DISABLED: \n + \item 0x00000001 -- SENSORS_USE_DISABLED: Inertial sensors are not to be used to aid in heading and position improvement. \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ /** @} @@ -5862,8 +5733,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Sensor Control Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5872,7 +5742,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ /** @} @@ -5895,8 +5765,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Sensors Control Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -5905,7 +5774,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Sensors Usage */ @@ -5914,18 +5783,17 @@ typedef struct { /**< Controls how sensors are used to aid the heading and positioning performance. - Valid values: - \begin{itemize1} - \item 0x00000000 -- SENSORS USE ENABLED: \n + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: Sensors data is to be requested whenever a position request is received. If sensors data is injected, the GNSS location engine attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS USE DISABLED: \n + \item 0x00000001 -- SENSORS_USE_DISABLED: Inertial sensors are not to be used to aid in the heading and position improvement. \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ /** @} @@ -5956,7 +5824,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - */ + */ /* Optional */ /* Velocity Random Walk Spectral Density */ @@ -5968,7 +5836,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 - */ + */ /* Optional */ /* Acceleration Random Walk Spectral Density */ @@ -5980,7 +5848,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 - */ + */ /* Optional */ /* Angle Random Walk Spectral Density */ @@ -5992,7 +5860,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 - */ + */ /* Optional */ /* Rate Random Walk Spectral Density */ @@ -6004,7 +5872,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - */ + */ }qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ /** @} @@ -6024,8 +5892,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Sensor Properties request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6035,7 +5902,7 @@ typedef struct { \item 0x00000006 -- TIMEOUT \item 0x00000007 -- CONFIG_NOT_SUPPORTED \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Failed Set Sensor Properties */ @@ -6044,15 +5911,14 @@ typedef struct { /**< This field will be sent only if the status is not a success. Identifies the parameters that were not set successfully. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ /** @} @@ -6069,15 +5935,14 @@ typedef struct { qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; /**< Mask denoting the sensor properties parameters to be retrieved. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ /** @} @@ -6094,8 +5959,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Sensors Properties request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6105,7 +5969,7 @@ typedef struct { \item 0x00000006 -- TIMEOUT \item 0x00000007 -- CONFIG_NOT_SUPPORTED \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Gyro Bias Random Walk Variance */ @@ -6117,7 +5981,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - */ + */ /* Optional */ /* Velocity Random Walk Spectral Density */ @@ -6129,7 +5993,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 - */ + */ /* Optional */ /* Acceleration Random Walk Spectral Density */ @@ -6141,7 +6005,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 - */ + */ /* Optional */ /* Angle Random Walk Spectral Density */ @@ -6153,7 +6017,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 - */ + */ /* Optional */ /* Rate Random Walk Spectral Density */ @@ -6165,7 +6029,7 @@ typedef struct { sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - */ + */ }qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ /** @} @@ -6179,12 +6043,11 @@ typedef enum { eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. This mode can optimize power consumption and give a power-balanced positioning and heading enhancement using - inertial sensors - Sensors usage is to be forced ON. + inertial sensors */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. This mode can be requested by the control point when power consumption is not a restriction to the use of inertial sensors. */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSensorPerformanceControlModeEnumT_v02; /** @@ -6209,8 +6072,7 @@ typedef struct { This field is relevant only when sensors have been enabled using the sensors control configuration. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. @@ -6218,33 +6080,33 @@ typedef struct { The GNSS location engine must request use of sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Accelerometer Sampling Specification */ uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the low data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request acceleration data to be used by the low data rate + filter. The sensor data rate is specified in terms of the nominal number + of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 10Hz sampling rate and 2Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ /* Optional */ /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request gyro data to be used by the high data rate filter. + The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 10Hz sampling rate and 2Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ /* Optional */ /* Algorithm Configuration */ @@ -6252,11 +6114,10 @@ typedef struct { qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; /**< Sets which sensor algorithms are to be used when processing sensor data. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* High Data Rate Filter Accelerometer Sampling Specification */ @@ -6267,9 +6128,9 @@ typedef struct { data rate is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 100Hz sampling rate and 4Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ @@ -6280,9 +6141,9 @@ typedef struct { is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 100Hz sampling rate and 4Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ }qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ /** @} @@ -6307,8 +6168,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Sensor Performance Control Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6317,17 +6177,17 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Failed Configuration */ uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< This field is sent only if the status is not a success. - When sent, this field identifies which configuration failed. + /**< Identifies parameters that were not configured successfully. This field + is sent only if the status is not a success. - Valid bitmasks: - \begin{itemize1} + + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- PERFORMANCE_MODE \item 0x00000002 -- ACCEL_SAMPLING_SPEC \item 0x00000004 -- GYRO_SAMPLING_SPEC @@ -6335,7 +6195,7 @@ typedef struct { \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @} @@ -6359,8 +6219,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Sensor Performance Control Configuration request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6369,7 +6228,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Performance Control Mode */ @@ -6379,8 +6238,7 @@ typedef struct { This field is relevant only when sensors have been enabled using the sensor control configuration. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. @@ -6388,7 +6246,7 @@ typedef struct { The GNSS location engine must request use of the sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Accelerometer Sampling Specification */ @@ -6399,9 +6257,9 @@ typedef struct { data rate is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 10Hz sampling rate and 2Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2Hz batching rate. + */ /* Optional */ /* Gyroscope Sampling Specification */ @@ -6412,9 +6270,9 @@ typedef struct { rate is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 10Hz sampling rate and 2Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ /* Optional */ /* Algorithm Configuration */ @@ -6422,11 +6280,10 @@ typedef struct { qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; /**< Informs which sensor algorithms are currently set. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* High Data Rate Filter Accelerometer Sampling Specification */ @@ -6437,9 +6294,9 @@ typedef struct { data rate is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 100Hz sampling rate and 4Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ @@ -6450,9 +6307,9 @@ typedef struct { is specified in terms of the nominal number of samples per batch and the number of batches per second. However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - The default specification is 100Hz sampling rate and 4Hz batching rate. - */ + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ }qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @} @@ -6469,7 +6326,7 @@ typedef struct { uint8_t suplCertId; /**< Certificate ID of the SUPL certificate. \n - Units: Bytes \n - - Range: 0 to 9 */ + - Range: 0 to 9 */ /* Mandatory */ /* SUPL Certificate Data */ @@ -6477,7 +6334,7 @@ typedef struct { uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; /**< SUPL certificate contents. \n - Type: Array of bytes. \n - - Maximum certificate size: 2000 bytes */ + - Maximum certificate size: 2000 bytes */ }qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ /** @} @@ -6494,8 +6351,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject SUPL Certificate request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6504,7 +6360,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ /** @} @@ -6524,7 +6380,7 @@ typedef struct { - Units: Bytes \n - Range: 0 to 9 \n If suplCertId is not specified, - all SUPL certificates are deleted. */ + all SUPL certificates are deleted. */ }qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ /** @} @@ -6541,8 +6397,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Delete SUPL Certificate request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6551,7 +6406,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ /** @} @@ -6577,15 +6432,14 @@ typedef struct { uint8_t injectedPositionControl; /**< Controls how the injected position is used in the position engine. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Use the injected position in a direct position calculation \item 0x00 (FALSE) -- Do not use the injected position in a direct position calculation \end{itemize1} The default value is TRUE. - */ + */ /* Optional */ /* Filter SV Usage */ @@ -6593,13 +6447,12 @@ typedef struct { uint8_t filterSvUsage; /**< Controls whether SV usage is filtered in a position fix. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Filter the usage of SVs in the fix \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix \end{itemize1} The default value is FALSE. - */ + */ /* Optional */ /* Store Assist Data */ @@ -6608,13 +6461,12 @@ typedef struct { /**< Controls whether assistance data is to be stored in persistent memory. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Store assistance data in persistent memory \item 0x00 (FALSE) -- Do not store assistance data in persistent memory \end{itemize1} The default value is TRUE. - */ + */ }qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -6632,8 +6484,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Set Configuration Parameters request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6642,7 +6493,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Failed Parameters */ @@ -6651,13 +6502,12 @@ typedef struct { /**< Identifies the parameters that were not set successfully. This field is sent only if the status is other than SUCCESS. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- INJECTED_POSITION_CONTROL \item 0x00000002 -- FILTER_SV_USAGE \item 0x00000004 -- STORE_ASSIST_DATA \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -6675,13 +6525,12 @@ typedef struct { qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- INJECTED_POSITION_CONTROL \item 0x00000002 -- FILTER_SV_USAGE \item 0x00000004 -- STORE_ASSIST_DATA \vspace{-0.18in} \end{itemize1} - */ + */ }qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -6699,8 +6548,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Get Configuration Parameters request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6709,7 +6557,7 @@ typedef struct { \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Injected Position Control */ @@ -6718,15 +6566,14 @@ typedef struct { /**< Specifies whether the injected position is used for a direct calculation in the position engine. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- The injected position is used in a direct position calculation \item 0x00 (FALSE) -- The injected position is not used in a direct position calculation \end{itemize1} The default value is TRUE. - */ + */ /* Optional */ /* Filter SV Usage */ @@ -6734,13 +6581,12 @@ typedef struct { uint8_t filterSvUsage; /**< Specifies whether SV usage is filtered in a position fix. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- SV usage is filtered in the fix \item 0x00 (FALSE) -- SV usage is not filtered in the fix \end{itemize1} The default value is FALSE. - */ + */ /* Optional */ /* Store Assist Data */ @@ -6748,14 +6594,13 @@ typedef struct { uint8_t storeAssistData; /**< Specifies whether assistance data is stored in persistent memory. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Assistance data is stored in persistent memory \item 0x00 (FALSE) -- Assistance data is not stored in persistent memory \end{itemize1} The default value is TRUE. - */ + */ }qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -6776,12 +6621,11 @@ typedef enum { the time it is reported is higher. This setting results in lower power usage. */ eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a - medium rate. This is the default setting. - The Geofence is monitored for a breach at a + medium rate. This is the default setting. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a high rate. The gap between actual breach and the time it is reported is low. This results in higher power usage. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceResponsivenessEnumT_v02; /** @@ -6798,11 +6642,10 @@ typedef enum { power usage. This setting can impact the "yield" because incorrect breach events may be sent. */ eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with - medium confidence. This is the default setting. - The Geofence engine indicates a breach with + medium confidence. This is the default setting. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with high confidence. This setting results in higher power usage. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceConfidenceEnumT_v02; /** @@ -6815,13 +6658,13 @@ typedef enum { typedef struct { double latitude; - /**< Latitude of the center of the Geofence. */ + /**< Latitude of the center of the Geofence.*/ double longitude; - /**< Longitude of the center of the Geofence. */ + /**< Longitude of the center of the Geofence.*/ uint32_t radius; - /**< Radius of the circular Geofence in meters. */ + /**< Radius of the circular Geofence in meters. */ }qmiLocCircularGeofenceArgsStructT_v02; /* Type */ /** @} @@ -6832,9 +6675,8 @@ typedef struct { */ typedef enum { QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. - Position outside a Geofence. */ - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofencePositionEnumT_v02; /** @@ -6852,7 +6694,7 @@ typedef struct { uint32_t transactionId; /**< Identifies the transaction. The transaction ID is returned in the Add Circular Geofence - indication. */ + indication. */ /* Mandatory */ /* Circular Geofence Arguments */ @@ -6863,11 +6705,10 @@ typedef struct { qmiLocGeofenceBreachMaskT_v02 breachMask; /**< Specifies the breach events in which the client is interested. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ /* Include Position in Breach Event */ @@ -6875,12 +6716,11 @@ typedef struct { /**< Specifies whether the Geofence engine is to include the position in a breach event. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Position will be reported with the breach event \item 0x00 (FALSE) -- Position will not be reported with the breach event - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Responsiveness */ @@ -6891,12 +6731,11 @@ typedef struct { when it is reported. This parameter has power implications and is to be fine-tuned to optimize power savings. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Confidence */ @@ -6907,12 +6746,11 @@ typedef struct { This parameter has power implications and is to be fine-tuned to optimize power savings. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ /** @} @@ -6929,8 +6767,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Add Circular Geofence request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -6940,7 +6777,7 @@ typedef struct { \item 0x00000006 -- TIMEOUT \item 0x00000008 -- INSUFFICIENT_MEMORY \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Transaction ID */ @@ -6948,7 +6785,7 @@ typedef struct { uint32_t transactionId; /**< Transaction ID that was specified in the Add Circular Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ + if the status field is set to SUCCESS. */ /* Optional */ /* Geofence ID */ @@ -6956,7 +6793,7 @@ typedef struct { uint32_t geofenceId; /**< Geofence identifier allocated by the engine. The client must include this identifier in all transactions - pertaining to this Geofence. */ + pertaining to this Geofence. */ }qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ /** @} @@ -6971,14 +6808,14 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< Identifier for the Geofence that is to be deleted. */ + /**< Identifier for the Geofence that is to be deleted. */ /* Mandatory */ /* Transaction ID */ uint32_t transactionId; /**< Identifies the transaction. The transaction ID is returned in the Delete Geofence - indication. */ + indication. */ }qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ /** @} @@ -6995,8 +6832,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Delete Geofence request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -7004,13 +6840,13 @@ typedef struct { \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Geofence ID */ uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ uint32_t geofenceId; - /**< Identifier for the Geofence that was deleted. */ + /**< Identifier for the Geofence that was deleted. */ /* Optional */ /* Transaction ID */ @@ -7018,7 +6854,7 @@ typedef struct { uint32_t transactionId; /**< Transaction ID that was specified in the Delete Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ + if the status field is set to SUCCESS. */ }qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ /** @} @@ -7029,9 +6865,8 @@ typedef struct { */ typedef enum { QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. - The Geofence was initiated by the device. */ - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceOriginEnumT_v02; /** @@ -7043,9 +6878,8 @@ typedef enum { */ typedef enum { QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. - The Geofence monitoring is suspended. */ - eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceStateEnumT_v02; /** @@ -7061,14 +6895,14 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< Identifier for the Geofence that is to be queried. */ + /**< Identifier for the Geofence that is to be queried. */ /* Mandatory */ /* Transaction ID */ uint32_t transactionId; /**< Identifies the transaction. The transaction ID is returned with the Query Geofence - indication. */ + indication. */ }qmiLocQueryGeofenceReqMsgT_v02; /* Message */ /** @} @@ -7085,8 +6919,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Query Geofence request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -7094,13 +6927,13 @@ typedef struct { \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Geofence ID */ uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ uint32_t geofenceId; - /**< Identifier for the Geofence that was queried. */ + /**< Identifier for the Geofence that was queried. */ /* Optional */ /* Transaction ID */ @@ -7108,7 +6941,7 @@ typedef struct { uint32_t transactionId; /**< Transaction ID that was specified in the Query Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ + if the status field is set to SUCCESS. */ /* Optional */ /* Geofence Origin */ @@ -7116,12 +6949,11 @@ typedef struct { qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; /**< Originator of the Geofence. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE \vspace{-0.18in} \end{itemize1} - */ + */ /* Optional */ /* Position with Respect to Geofence */ @@ -7130,11 +6962,10 @@ typedef struct { /**< Indicates if the client is currently inside or outside the Geofence. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_POSITION_INSIDE \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Circular Geofence Parameters */ @@ -7147,11 +6978,10 @@ typedef struct { qmiLocGeofenceStateEnumT_v02 geofenceState; /**< Specifies whether the Geofence is to be actively monitored. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_STATE_ACTIVE \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocQueryGeofenceIndMsgT_v02; /* Message */ /** @} @@ -7166,7 +6996,7 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< Identifier for the Geofence to be edited. */ + /**< Identifier for the Geofence to be edited. */ /* Mandatory */ /* Transaction ID */ @@ -7174,7 +7004,7 @@ typedef struct { /**< Transaction ID that was specified in the Edit Geofence request. This parameter will always be present if the status field is set to SUCCESS. - */ + */ /* Optional */ /* Geofence State */ @@ -7182,11 +7012,10 @@ typedef struct { qmiLocGeofenceStateEnumT_v02 geofenceState; /**< Specifies whether the Geofence is to be actively monitored. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_STATE_ACTIVE \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Breach Event Mask */ @@ -7194,11 +7023,10 @@ typedef struct { qmiLocGeofenceBreachMaskT_v02 breachMask; /**< Specifies the breach events in which the client is interested. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocEditGeofenceReqMsgT_v02; /* Message */ /** @} @@ -7218,8 +7046,7 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Edit Geofence request. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -7227,20 +7054,20 @@ typedef struct { \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Geofence ID */ uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ uint32_t geofenceId; - /**< Identifier for the Geofence that was edited. */ + /**< Identifier for the Geofence that was edited. */ /* Optional */ /* Transaction ID */ uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ uint32_t transactionId; /**< Identifies the transaction. The transaction ID - is specified in the Edit Geofence request. */ + is specified in the Edit Geofence request. */ /* Optional */ /* Failed Parameters */ @@ -7250,11 +7077,10 @@ typedef struct { the mask corresponding to a field is set, it indicates that the Geofence parameter could not be edited. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocEditGeofenceIndMsgT_v02; /* Message */ /** @} @@ -7271,7 +7097,7 @@ typedef struct { /* Transaction ID */ uint32_t transactionId; /**< Identifies the transaction. The transaction ID - is returned in the Get Best Available Position indication. */ + is returned in the Get Best Available Position indication. */ }qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ /** @} @@ -7294,7 +7120,7 @@ typedef struct { - 0x00000001 -- GENERAL_FAILURE \n - 0x00000002 -- UNSUPPORTED \n - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ + - 0x00000006 -- TIMEOUT */ /* Optional */ /* Transaction ID */ @@ -7303,7 +7129,7 @@ typedef struct { /**< Transaction ID that was specified in the Get Best Available Position request. This parameter will always be present if the status field is set to - SUCCESS. */ + SUCCESS. */ /* Optional */ /* Latitude */ @@ -7316,7 +7142,7 @@ typedef struct { \item Range: -90.0 to 90.0 \begin{itemize1} \item Positive values indicate northern latitude \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Longitude */ @@ -7329,14 +7155,14 @@ typedef struct { \item Range: -180.0 to 180.0 \begin{itemize1} \item Positive values indicate eastern longitude \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Optional */ /* Circular Horizontal Position Uncertainty */ uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ float horUncCircular; /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Altitude With Respect to Ellipsoid */ @@ -7344,14 +7170,14 @@ typedef struct { float altitudeWrtEllipsoid; /**< Altitude with respect to the WGS84 ellipsoid.\n - Units: Meters \n - - Range: -500 to 15883 */ + - Range: -500 to 15883 */ /* Optional */ /* Vertical Uncertainty */ uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ float vertUnc; /**< Vertical uncertainty.\n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* UTC Timestamp */ @@ -7360,28 +7186,28 @@ typedef struct { /**< UTC timestamp. \begin{itemize1} \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Time Uncertainty */ uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ float timeUnc; /**< Time uncertainty. \n - - Units: Milliseconds */ + - Units: Milliseconds */ /* Optional */ /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ float horUncEllipseSemiMinor; /**< Semi-minor axis of horizontal elliptical uncertainty. \n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Horizontal Elliptical Uncertainty Semi-Major Axis */ uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ float horUncEllipseSemiMajor; /**< Semi-major axis of horizontal elliptical uncertainty. \n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Horizontal Elliptical Uncertainty Azimuth */ @@ -7389,7 +7215,7 @@ typedef struct { float horUncEllipseOrientAzimuth; /**< Elliptical horizontal uncertainty azimuth of orientation. \n - Units: Decimal degrees \n - - Range: 0 to 180 */ + - Range: 0 to 180 */ /* Optional */ /* Horizontal Circular Confidence */ @@ -7397,7 +7223,7 @@ typedef struct { uint8_t horCircularConfidence; /**< Horizontal circular uncertainty confidence. \n - Units: Percent \n - - Range: 0 to 99 */ + - Range: 0 to 99 */ /* Optional */ /* Horizontal Elliptical Confidence */ @@ -7405,7 +7231,7 @@ typedef struct { uint8_t horEllipticalConfidence; /**< Horizontal elliptical uncertainty confidence. \n - Units: Percent \n - - Range: 0 to 99 */ + - Range: 0 to 99 */ /* Optional */ /* Horizontal Reliability */ @@ -7413,35 +7239,34 @@ typedef struct { qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- RELIABILITY_NOT_SET \item 0x00000001 -- RELIABILITY_VERY_LOW \item 0x00000002 -- RELIABILITY_LOW \item 0x00000003 -- RELIABILITY_MEDIUM \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Horizontal Speed */ uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ float horSpeed; /**< Horizontal speed. \n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Horizontal Speed Uncertainty */ uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ float horSpeedUnc; /**< Horizontal speed uncertainty. \n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Altitude With Respect to Sea Level */ uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ float altitudeWrtMeanSeaLevel; /**< Altitude with respect to mean sea level. \n - - Units: Meters */ + - Units: Meters */ /* Optional */ /* Vertical Confidence */ @@ -7449,7 +7274,7 @@ typedef struct { uint8_t vertConfidence; /**< Vertical uncertainty confidence. \n - Units: Percent \n - - Range: 0 to 99 */ + - Range: 0 to 99 */ /* Optional */ /* Vertical Reliability */ @@ -7457,28 +7282,27 @@ typedef struct { qmiLocReliabilityEnumT_v02 vertReliability; /**< Specifies the reliability of the vertical position. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- RELIABILITY_NOT_SET \item 0x00000001 -- RELIABILITY_VERY_LOW \item 0x00000002 -- RELIABILITY_LOW \item 0x00000003 -- RELIABILITY_MEDIUM \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1}*/ /* Optional */ /* Vertical Speed */ uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ float vertSpeed; /**< Vertical speed. \n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Vertical Speed Uncertainty */ uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ float vertSpeedUnc; /**< Vertical speed uncertainty. \n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Heading */ @@ -7486,7 +7310,7 @@ typedef struct { float heading; /**< Heading. \n - Units: Degrees \n - - Range: 0 to 359.999 */ + - Range: 0 to 359.999 */ /* Optional */ /* Heading Uncertainty */ @@ -7494,7 +7318,7 @@ typedef struct { float headingUnc; /**< Heading uncertainty. \n - Type: Floating point \n - - Range: 0 to 359.999 */ + - Range: 0 to 359.999 */ /* Optional */ /* Magnetic Deviation */ @@ -7502,7 +7326,7 @@ typedef struct { float magneticDeviation; /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ + north is east of true north. */ /* Optional */ /* Technology Used Mask */ @@ -7510,15 +7334,14 @@ typedef struct { qmiLocPosTechMaskT_v02 technologyMask; /**< Technology used in computing this fix. - Valid bitmasks: - \begin{itemize1} + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SATELLITE \item 0x00000002 -- CELLID \item 0x00000004 -- WIFI \item 0x00000008 -- SENSORS \item 0x00000010 -- REFERENCE_LOCATION \item 0x00000020 -- INJECTED_COARSE_POSITION - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Dilution of Precision */ @@ -7536,8 +7359,7 @@ typedef struct { qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. - Valid values: - \begin{itemize1} + Valid values: \begin{itemize1} \item 0x00000000 -- TIME_SRC_INVALID \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING @@ -7547,7 +7369,7 @@ typedef struct { \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \item 0x00000007 -- TIME_SRC_NAV_SOLUTION \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Sensor Data Usage */ @@ -7561,14 +7383,13 @@ typedef struct { uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite used for calculating this position report. The following - information is associated with each SV ID: - \begin{itemize1} + information is associated with each SV ID: \begin{itemize1} \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ }qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ /** @} @@ -7579,10 +7400,9 @@ typedef struct { */ typedef enum { QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known */ - eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is stationary - Device state is in motion */ - eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocMotionStateEnumT_v02; /** @@ -7594,13 +7414,12 @@ typedef enum { */ typedef enum { QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known */ - eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in pedestrian mode, nothing else is known about the movement */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian walking mode */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian running mode - Device movement is in vehicular mode, nothing else is known about the movement */ - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocMotionModeEnumT_v02; /** @@ -7613,17 +7432,42 @@ typedef enum { typedef struct { qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. States of user motion: \n - Options are: */ + /**< Current motion state of the user. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.06in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute + rest by reducing probability_of_state. + */ qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion.\n - Options are: */ + /**< Modes of user motion. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement + is in Pedestrian mode; nothing else is known about the movement. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement + is in Pedestrian Walking mode. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement + is in Pedestrian Running mode. + \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is + in Vehicular mode; nothing else is known about the movement. + \vspace{0.06in} \end{itemize1} + + The motion_mode value is independent of the motion_state value. + */ float probability_of_state; /**< Probability that the device is actually undergoing the motion state specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.06in} + and motion_sub_mode. \vspace{0.06in} This value is a floating point number in the range of 0 to 100, in units of percent probability. Any value greater than 99.9999 is @@ -7635,33 +7479,33 @@ typedef struct { For example, if the mode of In-Motion + Pedestrian-Running can only be determined with 50 percent probability, and the simpler statement of In-Motion can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} + be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} If the motion_state is not known, the value in this field is not used. - */ + */ uint16_t age; /**< Age of the motion data in milliseconds at the time of injection. - */ + */ uint16_t timeout; - /**< If the age of the motion data input exceeds the timeout value, it + /**< If the age of the motion data input exceeds the timeout value, the data will no longer be used. The timeout value is in units of milliseconds. Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied indefinitely until the next input is + the motion data input is applied until the next input is received. \vspace{0.06in} - If the determination of motion data is an instantaneous observation, - and no notice is guaranteed to be given via QMI on a change in the - state of motion data, it is recommended that this field be set to 0. \vspace{0.06in} + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} If the determination of motion data is continuously monitored - external to QMI, and an update is always applied to QMI upon any + external to the QMI and an update is always applied to the QMI upon any change in state, a value of 65535 is used for this field. Note that in this case, if a certain mode is set and is not later unset (e.g., by sending in the request message with a user motion state of Unknown), the value is applied indefinitely. - */ + */ }qmiLocMotionDataStructT_v02; /* Type */ /** @} @@ -7676,6 +7520,7 @@ typedef struct { /* Mandatory */ /* Motion Data */ qmiLocMotionDataStructT_v02 motion_data; + /**< Current motion data of the client */ }qmiLocInjectMotionDataReqMsgT_v02; /* Message */ /** @} @@ -7688,17 +7533,19 @@ typedef struct { typedef struct { /* Mandatory */ - /* Inject motion data request status */ + /* Inject Motion Data Request Status */ qmiLocStatusEnumT_v02 status; /**< Status of the Inject Motion Data request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - */ + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ }qmiLocInjectMotionDataIndMsgT_v02; /* Message */ /** @} @@ -7708,15 +7555,14 @@ typedef struct { @{ */ /** Request Message; Used by the control point to retrieve the list of network - initiated geofence ID's. */ + initiated Geofence IDs. */ typedef struct { /* Mandatory */ - /* Transaction Id */ + /* Transaction ID */ uint32_t transactionId; - /**< Identifies the transaction, the same transaction Id - will be returned in the Get NI Geofence ID List indication. - - Type -- Unsigned Integer. */ + /**< Identifies the transaction. The same transaction ID + will be returned in the Get NI Geofence ID List indication. */ }qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ /** @} @@ -7726,7 +7572,7 @@ typedef struct { @{ */ /** Indication Message; Used by the control point to retrieve the list of network - initiated geofence ID's. */ + initiated Geofence IDs. */ typedef struct { /* Mandatory */ @@ -7738,29 +7584,192 @@ typedef struct { - 0x00000001 -- GENERAL_FAILURE \n - 0x00000002 -- UNSUPPORTED \n - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ + - 0x00000006 -- TIMEOUT */ /* Optional */ - /* Transaction Id */ + /* Transaction ID */ uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ uint32_t transactionId; - /**< Transaction Id which was specified in the Get NI - Geofence ID List request. - - Type -- Unsigned Integer. */ + /**< Transaction ID that was specified in the Get NI + Geofence ID List request. */ /* Optional */ /* NI Geofence ID List */ uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; - /**< List containing the NI Geofence Id's. - - Type: Array of unsigned 32 bit integers. \n - - Maximum NI Geofence ID List length : 16 */ + /**< List containing the NI Geofence IDs. + - Type: Array of unsigned 32-bit integers \n + - Maximum NI Geofence ID List length: 16 */ }qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ /** @} */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t MCC; + /**< GSM mobile country code. Refer to ITU-T E.212 specification */ + + uint32_t MNC; + /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ + + uint32_t LAC; + /**< GSM location area code.Refer to ITU-T E.212 specification */ + + uint32_t CID; + /**< GSM cell identification.Refer to ITU-T E.212 specification */ +}qmiLocGSMCellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* GSM Cell ID */ + qmiLocGSMCellIdStructT_v02 gsmCellId; + /**< Identifies the GSM Cell the device is currently camped on.*/ + + /* Mandatory */ + /* Roaming Status */ + uint8_t roamingStatus; + /**< Whether the device is roaming. + \begin{itemize1} + \item 0x01 (TRUE) -- The device is roaming. + \item 0x00 (FALSE) -- The device is not roaming. + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject GSM Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject GSM Cell Info request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ +}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Injected Network Initiated Message Type */ + qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; + /**< Type of the network initiated message being injected + Valid Values: + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ + + /* Mandatory */ + /* Injected Network Initiated Message */ + uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ + uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; + /**< Network initiated message body. + If the inject NI message type is TYPE_SUPL, the message contains + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ +}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Network Initiated Message Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Network Initiated Message request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + - 0x00000008 -- INSUFFICIENT_MEMORY \n */ +}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * typedef struct { + * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to notify the location engine that the device is + no longer camped. */ +typedef struct { + + /* Mandatory */ + /* Notify WWAN Out of Service Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WWAN out of service request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + */ +}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + /*Service Message Definition*/ /** @addtogroup loc_qmi_msg_ids @{ @@ -7949,6 +7958,15 @@ typedef struct { #define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 #define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 #define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 +#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C /** @} */ From 6f36c0ec740cc22d1bbd752dfec99935d169c8f3 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Fri, 21 Sep 2012 18:54:20 -0700 Subject: [PATCH 053/945] Silence more gps function tracing logs Change-Id: I33f672950f59ad739362263d212424f8f55ab88b --- utils/log_util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/log_util.h b/utils/log_util.h index 15d0b892..b3dae3c3 100755 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -135,6 +135,7 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } #define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) +#ifdef DEBUG_TRACE_CALLFLOW // Used for logging callflow from Android Framework #define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") // Used for logging callflow to Modem @@ -143,6 +144,12 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } #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) +#else +#define ENTRY_LOG_CALLFLOW() +#define EXIT_LOG_CALLFLOW(SPEC, VAL) +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) +#endif #ifdef __cplusplus } From a03322f3a73dd28d7486ffa516755d2c49773e8d Mon Sep 17 00:00:00 2001 From: Amol Mahesh Date: Mon, 24 Sep 2012 13:41:46 -0700 Subject: [PATCH 054/945] LOC_API: Add group permissions after creating the pipe. Add the group permissions to the pipe after creation so that it can be accessed by the group. Change-Id: Ib42639ee8a46a498c4e246bc448fe8267fd5fa7d --- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c old mode 100644 new mode 100755 index 74769088..e479b7ae --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -64,13 +64,21 @@ int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode) int result; LOC_LOGD("%s, mode = %d\n", pipe_name, mode); - result = mkfifo(pipe_name, 0666); + 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) { From 899ebaa3de7d2329f776dbfca19672b3a18a7013 Mon Sep 17 00:00:00 2001 From: Amol Mahesh Date: Mon, 24 Sep 2012 13:44:50 -0700 Subject: [PATCH 055/945] LOC_API: Modify LOC_API to support MSAPU client. Modify LOC_API to support MSAPU client which would also request for the access to wifi network. Change-Id: I74a5f83484953c52437855467b04c2a4c2ccfa27 --- loc_api/libloc_api_50001/loc_eng.cpp | 3 ++- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 12 ++++++++++ loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 2 ++ .../loc_eng_dmn_conn_handler.cpp | 24 +++++++++++++++++++ .../loc_eng_dmn_conn_handler.h | 1 + loc_api/libloc_api_50001/loc_eng_msg.h | 1 + 6 files changed, 42 insertions(+), 1 deletion(-) mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn.h mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5075311e..65b211ec 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1661,7 +1661,8 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || - wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM) { + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) { AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); stateMachine->subscribeRsrc((Subscriber*)&subscriber); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp old mode 100644 new mode 100755 index 2bb2d810..f01402a1 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -48,11 +48,13 @@ 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) { @@ -81,6 +83,7 @@ static int loc_api_server_proc_init(void *context) loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR); 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; @@ -148,6 +151,7 @@ static int loc_api_server_proc_post(void *context) 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; } @@ -221,6 +225,14 @@ int loc_eng_dmn_conn_loc_api_server_data_conn(int sender_id, int status) { } 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) { diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h old mode 100644 new mode 100755 index f6692487..cebbfc92 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -37,6 +37,7 @@ #define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" #define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" #define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" #else @@ -44,6 +45,7 @@ #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 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp old mode 100644 new mode 100755 index 6077b721..16d9be75 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -99,6 +99,18 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, loc_eng_msg_sender(loc_api_handle, msg); break; } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: { LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); @@ -179,6 +191,18 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, loc_eng_msg_sender(loc_api_handle, msg); break; } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: { LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h old mode 100644 new mode 100755 index 7aa22bfb..51efb592 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -67,6 +67,7 @@ typedef enum { 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; diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 9dffc280..9c5c03bd 100755 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -136,6 +136,7 @@ typedef enum { 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 From 56de3d4311610d086d89b2ff4a320d92fb34aeb2 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Wed, 26 Sep 2012 09:20:41 -0700 Subject: [PATCH 056/945] gps: report session begin/end on gps start/stop Since modem does not consistently send SESSON_END/ENGINE_OFF event, always report SESSION_END on stop gps and SESSION_BEGIN on start gps so that the icon is turned on/off correctly. Bug 7185242 Change-Id: Ib3954529056a653d7057aedb489be1ccee9eaf1d --- loc_api/libloc_api_50001/loc_eng.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 747268da..e36b80b8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -456,6 +456,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); loc_eng_data.navigating = TRUE; } } @@ -508,8 +509,7 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) #endif ret_val = loc_eng_data.client_handle->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS && - loc_eng_data.fix_session_status != GPS_STATUS_SESSION_BEGIN) + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) { loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } @@ -711,14 +711,6 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa { CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); - - // Restore session begin if needed - if (status == GPS_STATUS_ENGINE_ON && last_status == GPS_STATUS_SESSION_BEGIN) - { - GpsStatus gs_sess_begin = { sizeof(gs_sess_begin),GPS_STATUS_SESSION_BEGIN }; - CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs_sess_begin.status)); - loc_eng_data.status_cb(&gs_sess_begin); - } } last_status = status; From 205590ae1b89d30d7979e06720bb7bf202b0c742 Mon Sep 17 00:00:00 2001 From: Mekala Natarajan Date: Wed, 26 Sep 2012 16:07:40 -0700 Subject: [PATCH 057/945] disabled agps state machine delete in cleanup The current cleanup mismatches agps_init(), so that it the agps state machines will get deleted in the cleanup but never get recreated next time apgs_init() is called. Bug 7216641 Change-Id: Iddba9fd0d90c790e658f14c42c8a25d22b8749c0 --- loc_api/libloc_api_50001/loc_eng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 747268da..1bf309cb 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -355,7 +355,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) // 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; @@ -365,7 +365,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) delete loc_eng_data.internet_nif; loc_eng_data.internet_nif = NULL; } - +#endif if (loc_eng_data.navigating) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); From 0a28a39125e42b0b5c62825dbb532a72783617c2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 27 Sep 2012 10:07:13 -0700 Subject: [PATCH 058/945] QMI LOC bug fix on SGLTE OOS IND Change-Id: I4408beede3d05d6cfb1a9a5ead3a44a31b1263cf --- loc_api/loc_api_v02/location_service_v02.c | 5994 +++---- loc_api/loc_api_v02/location_service_v02.h | 15940 +++++++++---------- 2 files changed, 10967 insertions(+), 10967 deletions(-) mode change 100644 => 100755 loc_api/loc_api_v02/location_service_v02.c mode change 100644 => 100755 loc_api/loc_api_v02/location_service_v02.h diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c old mode 100644 new mode 100755 index f1e1b6db..47a63eea --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -26,3000 +26,3000 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - - L O C A T I O N _ S E R V I C E _ V 0 2 . C - -GENERAL DESCRIPTION - This is the file which defines the loc service Data structures. - - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 5.5 - It was generated on: Thu Sep 20 2012 - From IDL File: location_service_v02.idl */ - -#include "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), - QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), - QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), - QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 8, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 9, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 10, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 7, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 12, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 12, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 20, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 29, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocMotionDataStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), - 0x2C, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 4, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 14, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), - 15, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 17, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 19, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 21, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 21, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) -}; - -static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) -}; - -static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 22, 0 -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), - QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), - QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, - QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), - QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 14, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), - 15, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 19, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 23, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 24, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 25, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 26, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 27, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 28, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 30, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 30, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 31, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), - - 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 32, 0, - - 0x03, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), - - 0x04, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) -}; - -static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) -}; - -static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 32, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) -}; - -static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) -}; - -static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) -}; - -static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), - 0x12, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), - 0x16, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), - 0x1B, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), - 0x1C, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), - 0x21, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), - 0x24, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), - 0x25, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), - 0x26, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), - 0x27, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), - 0x29, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), - 0x2C, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), - 0x2D, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 33, 0 -}; - -static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), - QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) -}; - -static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 34, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) -}; - -static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), - ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) -}; - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, - {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, - {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, - {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1086}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 1425}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 32}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1079}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 22}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 39}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, - {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, - {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, - {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 132), 0} -}; - -/*Service Object*/ -struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x05, - 0x02, - 0x10, - 2248, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02, - 0x0F, - NULL -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} - +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + + L O C A T I O N _ S E R V I C E _ V 0 2 . C + +GENERAL DESCRIPTION + This is the file which defines the loc service Data structures. + + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.5 + It was generated on: Thu Sep 27 2012 + From IDL File: location_service_v02.idl */ + +#include "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), + QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), + QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), + QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 8, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 9, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 10, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 7, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 12, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 12, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 16, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 16, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 20, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 29, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocMotionDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + 0x2C, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 4, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 14, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), + 15, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 17, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 19, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 21, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 21, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) +}; + +static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) +}; + +static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), + 22, 0 +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), + QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), + QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, + QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), + QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 14, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), + 15, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 19, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 23, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 24, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 25, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 26, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 27, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 28, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 30, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 30, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 31, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), + 20, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), + 20, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), + 20, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), + 20, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), + 32, 0, + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), + + 0x04, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) +}; + +static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) +}; + +static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), + 32, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) +}; + +static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) +}; + +static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) +}; + +static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), + 0x21, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), + 0x24, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), + 0x25, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), + 0x26, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), + 0x27, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), + 0x29, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), + 0x2C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), + 0x2D, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), + 33, 0 +}; + +static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), + QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) +}; + +static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), + 34, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) +}; + +static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, + {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, + {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, + {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1086}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 1425}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 32}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1079}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 22}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 39}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, + {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, + {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, + {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 133), 7} +}; + +/*Service Object*/ +struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x05, + 0x02, + 0x10, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02, + 0x10, + NULL +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h old mode 100644 new mode 100755 index f5db0b99..b31efd04 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -25,7973 +25,7973 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LOC_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 5.5 - It was generated on: Thu Sep 20 2012 - From IDL File: location_service_v02.idl */ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x0F -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x05 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x006C; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum string length for the Provider field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 - -/** Maximum string length for the Name field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 - -/** Maximum string length for the Version field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 - -/** Maximum length of the list containing the SVs that were used to generate - a position report. */ -#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum GNSS Measurement Engine Firmware Version String length. */ -#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ -#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Full Version String length. */ -#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of the SUPL certificate. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 - -/** Maximum length of the network-initiated Geofence ID - list */ -#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 - -/** Maximum length of the injected network initiated message. */ -#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. */ -#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: - \vspace{0.05in} \begin{itemize1} - \item 0x00000001 -- POSITION_REPORT - \item 0x00000002 -- GNSS_SV_INFO - \item 0x00000004 -- NMEA - \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ - \item 0x00000010 -- INJECT_TIME_REQ - \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ - \item 0x00000040 -- INJECT_POSITION_REQ - \item 0x00000080 -- ENGINE_STATE - \item 0x00000100 -- FIX_SESSION_STATE - \item 0x00000200 -- WIFI_REQ - \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS - \item 0x00000800 -- TIME_SYNC_REQ - \item 0x00001000 -- SET_SPI_STREAMING_REPORT - \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - \item 0x00004000 -- NI_GEOFENCE_NOTIFICATION - \item 0x00008000 -- GEOFENCE_GEN_ALERT - \item 0x00010000 -- GEOFENCE_BREACH_NOTIFICATION - \end{itemize1} \vspace{0.05in} - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; - /**< Application provider. */ - - char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; - /**< Application name. */ - - uint8_t applicationVersion_valid; - /**< Specifies whether the application version string contains - a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid - \item 0x01 (TRUE) -- Application version string is valid - \vspace{-0.18in} \end{itemize1} */ - - char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; - /**< Application version. */ -}qmiLocApplicationIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Units: Milliseconds \n - - Default: 1000 ms - */ - - /* Optional */ - /* ID of the Application that Sent this Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to - generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \item PDOP = square root of (HDOP^2 + VDOP^2) - \vspace{-0.18in} \end{itemize1} */ - - float HDOP; - /**< Horizontal dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ - - float VDOP; - /**< Vertical dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors were used in calculating the position in the - position report. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SENSOR_USED_ACCEL - \item 0x00000002 -- SENSOR_USED_GYRO - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results were aided by sensors. - - Valid bitmasks: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the position report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SESS_STATUS_SUCCESS - \item 0x00000001 -- SESS_STATUS_IN_PROGRESS - \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE - \item 0x00000003 -- SESS_STATUS_TIMEOUT - \item 0x00000004 -- SESS_STATUS_USER_END - \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER - \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE - \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< 3-D Speed uncertainty.\n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- TIME_SRC_INVALID - \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER - \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING - \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT - \item 0x00000004 -- TIME_SRC_TOW_DECODE - \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED - \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED - \item 0x00000007 -- TIME_SRC_NAV_SOLUTION - \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- VALID_SYSTEM - \item 0x00000002 -- VALID_GNSS_SVID - \item 0x00000004 -- VALID_HEALTH_STATUS - \item 0x00000008 -- VALID_PROCESS_STATUS - \item 0x00000010 -- VALID_SVINFO_MASK - \item 0x00000020 -- VALID_ELEVATION - \item 0x00000040 -- VALID_AZIMUTH - \item 0x00000080 -- VALID_SNR - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} */ - - uint16_t gnssSvId; - /**< GNSS SV ID. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For GLONASS: 1 to 32 - \item For SBAS: 120 to 151 - \end{itemize1} \end{itemize1} - - The GPS and GLONASS SVs can be disambiguated using the system field. */ - - uint8_t healthStatus; - /**< Health status. - \begin{itemize1} - \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy - \vspace{-0.18in} \end{itemize1}*/ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Source */ - uint8_t altitudeAssumed; - /**< Whether altitude is assumed or calculated: \begin{itemize1} - \item 0x00 (FALSE) -- Valid altitude is calculated - \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be - enough satellites to determine precise altitude - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends NMEA sentences to the control point */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 201 - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY - \item 0x00000002 -- NI_VX_MS_BASED_ONLY - \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED - \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \begin{itemize1} - \item 0x00000000 -- NI_VX_OCTET - \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG - \item 0x00000002 -- NI_VX_ASCII - \item 0x00000003 -- NI_VX_IA5 - \item 0x00000004 -- NI_VX_UNICODE - \item 0x00000005 -- NI_VX_SHIFT_JIS - \item 0x00000006 -- NI_VX_KOREAN - \item 0x00000007 -- NI_VX_LATIN_HEBREW - \item 0x00000008 -- NI_VX_LATIN - \item 0x00000009 -- NI_VX_GSM - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \begin{itemize1} - \item 0x00000000 -- FORMAT_LOGICAL_NAME - \item 0x00000001 -- FORMAT_EMAIL_ADDRESS - \item 0x00000002 -- FORMAT_MSISDN - \item 0x00000003 -- FORMAT_URL - \item 0x00000004 -- FORMAT_SIP_URL - \item 0x00000005 -- FORMAT_MIN - \item 0x00000006 -- FORMAT_MDN - \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY - \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID*/ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. */ - - uint16_t port; - /**< IPV4 port. */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SUPL_SERVER_INFO - \item 0x00000002 -- SUPL_SESSION_ID - \item 0x00000004 -- SUPL_HASH - \item 0x00000008 -- SUPL_POS_METHOD - \item 0x00000010 -- SUPL_DATA_CODING_SCHEME - \item 0x00000020 -- SUPL_REQUESTOR_ID - \item 0x00000040 -- SUPL_CLIENT_NAME - \item 0x00000080 -- SUPL_QOP - \item 0x00000100 -- SUPL_USER_RESP_TIMER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \begin{itemize1} - \item 0x00000001 -- AGPS_SETASSISTED - \item 0x00000002 -- AGPS_SETBASED - \item 0x00000003 -- AGPS_SETASSISTED_PREF - \item 0x00000004 -- AGPS_SETBASED_PREF - \item 0x00000005 -- AUTONOMOUS_GPS - \item 0x00000006 -- AFLT - \item 0x00000007 -- ECID - \item 0x00000008 -- EOTD - \item 0x00000009 -- OTDOA - \item 0x0000000A -- NO_POSITION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds*/ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- INVOKE_ID_MASK - \item 0x0002 -- DATA_CODING_SCHEME_MASK - \item 0x0004 -- NOTIFICATION_TEXT_MASK - \item 0x0008 -- CLIENT_ADDRESS_MASK - \item 0x0010 -- LOCATION_TYPE_MASK - \item 0x0020 -- REQUESTOR_ID_MASK - \item 0x0040 -- CODEWORD_STRING_MASK - \item 0x0080 -- SERVICE_TYPE_MASK - \item 0x0100 -- USER_RESP_TIMER_MASK - \vspace{-0.18in} \end{itemize1} - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- CURRENT_LOCATION - \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION - \item 0x00000004 -- INITIAL_LOCATION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ONGOING_NI_INCOMING_MO - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID - and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of - multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed - as part of multiple location ID in the SUPL_POS_INIT message. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event - triggered session. */ - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; - /**< Specifies which type of network measurements are allowed to be sent as - part of the Location ID or Multiple Location IDs parameter in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- SUPPORTED_NETWORK_WLAN - \item 0x0002 -- SUPPORTED_NETWORK_GSM - \item 0x0004 -- SUPPORTED_NETWORK_WCDMA - \item 0x0008 -- SUPPORTED_NETWORK_CDMA - \item 0x0010 -- SUPPORTED_NETWORK_HRDP - \item 0x0020 -- SUPPORTED_NETWORK_UMB - \item 0x0040 -- SUPPORTED_NETWORK_LTE - \item 0x0080 -- SUPPORTED_NETWORK_WIMAX - \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC - \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; - /**< Specifies the type of session trigger requested in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid values: \begin{itemize1} - \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT - \item 0x00000000 -- TRIGGER_TYPE_PERIODIC - \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT - \vspace{-0.18in} \end{itemize1} */ - - qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; - /**< Specifies which GNSS technologies are allowed as positioning - technologies. - - Valid bitmasks: \n - - 0x0001 -- GNSS_GPS \n - - 0x0002 -- GNSS_GLONASS \n - - 0x0004 -- GNSS_GALILEO \n - - 0x0008 -- GNSS_SBAS \n - - 0x0010 -- GNSS_QZSS \n - - 0x0020 -- GNSS_MODERN_GPS - */ -}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIFY - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL - indication payload. */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \begin{itemize1} - \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES - \item 0x00000001 -- START_PERIODIC_KEEP_WARM - \item 0x00000002 -- STOP_PERIODIC_FIXES - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \n - - samplesPerBatch must be a nonzero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in an integral number of batches per - second (Hz). \n - - batchesPerSecond must be a nonzero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor - data - \item 0x00 (FALSE) -- GNSS location engine is not ready to accept - sensor data - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. - */ - - /* Optional */ - /* Gyroscope Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor - data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream. - \begin{itemize1} - \item 0x01 (TRUE) -- Client is to start sending an SPI status stream - \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. \n - - Valid values: \begin{itemize1} - \item 0x00000000 -- WWAN_TYPE_INTERNET - \item 0x00000001 -- WWAN_TYPE_AGNSS - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ - eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ - eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the - Geofence to find the its current state. */ - QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiGeofenceOperationEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Informs the control point about - network-initiated Geofences. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Operation Type */ - qmiLocNiGeofenceOperationEnumT_v02 operationType; - /**< Operation for which this notification was generated. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_GEOFENCE_ADDED - \item 0x00000002 -- NI_GEOFENCE_DELETED - \item 0x00000003 -- NI_GEOFENCE_EDITED - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes - cannot be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can - be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage - information is available. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ - QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceGenAlertEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of the - Geofence status. */ -typedef struct { - - /* Mandatory */ - /* Geofence General Alert */ - qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE - \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE - \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS - \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ - QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceBreachTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Elliptical Horizontal Uncertainty Azimuth */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Horizontal Speed validity bit */ - uint8_t speedHorizontal_valid; - /**< Indicates whether the Horizontal speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Horizontal speed is valid - \item 0x00 (FALSE) -- Horizontal speed is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Horizontal Speed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Altitude validity bit */ - uint8_t altitudeWrtEllipsoid_valid; - /**< Indicates whether the altitude field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Altitude field is valid - \item 0x00 (FALSE) -- Altitude field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} - */ - - /* Altitude With Respect to Ellipsoid */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Vertical Uncertainty validity bit */ - uint8_t vertUnc_valid; - /**< Indicates whether the Vertical Uncertainty field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Uncertainty field is valid - \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Uncertainty */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Vertical Speed validity bit */ - uint8_t speedVertical_valid; - /**< Indicates whether the Vertical Speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Speed field is valid - \item 0x00 (FALSE) -- Vertical Speed field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Speed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* heading validity bit */ - uint8_t heading_valid; - /**< Indicates whether the Heading field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Heading field is valid - \item 0x00 (FALSE) -- Heading field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Heading */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ -}qmiLocGeofencePositionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of - a Geofence breach event. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Geofence Breach Type */ - qmiLocGeofenceBreachTypeEnumT_v02 breachType; - /**< The type of breach that generated this event. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING - \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Geofence Position */ - uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ - qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< \n Position of the client when it breached the Geofence. - This TLV is included if the client configures the - Geofence to report position. The position is reported - at the same confidence level that was specified in the - Add Circular Geofence request. */ -}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ - eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ - eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent - memory for the request. */ - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. */ - - /* Optional */ - /* GNSS Measurement Engine Firmware Version String */ - uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ - char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS measurement engine software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in} \end{itemize1} - - \textbf{Note:} This string is only provided on platforms that have - a measurement engine that supports this version string. On all other - platforms, this optional TLV is not provided. */ - - /* Optional */ - /* GNSS Hosted Software Version String */ - uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ - char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS hosted software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in}\end{itemize1} - - \textbf{Note:} This string is only provided on hosted architectures - (measurement and position engine running on different processors) that - support this version string. On all other platforms, this optional TLV - is not provided. */ - - /* Optional */ - /* GNSS Software Version String */ - uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ - char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Aggregate version of the GNSS software. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Units: Milliseconds */ - - /* Optional */ - /* ID of the Application that Sent the Position Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT - \item 0x00000002 -- NOTIFY_VERIFY_DENY - \item 0x00000003 -- NOTIFY_VERIFY_NORESP - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIF - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \n Optional SUPL Version 2 Extension payload. */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \begin{itemize1} - \item 0x00000000 -- PREDICTED_ORBITS_XTRA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Units: Milliseconds */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ALT_SRC_UNKNOWN - \item 0x00000001 -- ALT_SRC_GPS - \item 0x00000002 -- ALT_SRC_CELL_ID - \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID - \item 0x00000004 -- ALT_SRC_WIFI - \item 0x00000005 -- ALT_SRC_TERRESTRIAL - \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID - \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE - \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER - \item 0x00000009 -- ALT_SRC_OTHER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED - \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT - \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG - \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \begin{itemize1} - \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED - \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid - at the injected horizontal position coordinates - only. - \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to - the position of the device regardless of - horizontal position (within the horizontal - uncertainty region, if provided). - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0 to 99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid. - \begin{itemize1} - \item Units: Meters \begin{itemize1} - \item Positive = height - \item Negative = depth - \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0-99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from which this position was obtained. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS - \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID - \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID - \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI - \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL - \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID - \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER - \end{itemize1} \vspace{0.05in} - - If altitude is specified and the altitude source is not specified, the engine - assumes that the altitude was obtained using the specified position source. \n - If both altitude and altitude source are specified, the engine assumes - that only latitude and longitude were obtained using the specified position - source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ -#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this - message are ignored - \item 0x00 (FALSE) -- The optional fields in the message are to be - used to determine which data is to be deleted - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assistance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_GPS_SVDIR - \item 0x00000002 -- DELETE_GPS_SVSTEER - \item 0x00000004 -- DELETE_GPS_TIME - \item 0x00000008 -- DELETE_GPS_ALM_CORR - \item 0x00000010 -- DELETE_GLO_SVDIR - \item 0x00000020 -- DELETE_GLO_SVSTEER - \item 0x00000040 -- DELETE_GLO_TIME - \item 0x00000080 -- DELETE_GLO_ALM_CORR - \item 0x00000100 -- DELETE_SBAS_SVDIR - \item 0x00000200 -- DELETE_SBAS_SVSTEER - \item 0x00000400 -- DELETE_POSITION - \item 0x00000800 -- DELETE_TIME - \item 0x00001000 -- DELETE_IONO - \item 0x00002000 -- DELETE_UTC - \item 0x00004000 -- DELETE_HEALTH - \item 0x00008000 -- DELETE_SADATA - \item 0x00010000 -- DELETE_RTI - \item 0x00020000 -- DELETE_SV_NO_EXIST - \item 0x00040000 -- DELETE_FREQ_BIAS_EST - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CELLDB_POS - \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS - \item 0x00000004 -- DELETE_CELLDB_OTA_POS - \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS - \item 0x00000010 -- DELETE_CELLDB_TIMETAG - \item 0x00000020 -- DELETE_CELLDB_CELLID - \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID - \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL - \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL - \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST - \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST - \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER - \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME - \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER - \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST - \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST - \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER - \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER - \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY - \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ERROR_SUCCESS - \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE - \item 0x00000002 -- ERROR_NO_AP_FOUND - \item 0x00000003 -- ERROR_UNAUTHORIZED - \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE - \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED - \item 0x00000006 -- ERROR_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. - - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \begin{itemize1} - \item 0x00000001 -- WIFI_STATUS_AVAILABLE - \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- POSITION_REPORT - \item 0x00000002 -- GNSS_SV_INFO - \item 0x00000004 -- NMEA - \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ - \item 0x00000010 -- INJECT_TIME_REQ - \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ - \item 0x00000040 -- INJECT_POSITION_REQ - \item 0x00000080 -- ENGINE_STATE - \item 0x00000100 -- FIX_SESSION_STATE - \item 0x00000200 -- WIFI_REQ - \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS - \item 0x00000800 -- TIME_SYNC_REQ - \item 0x00001000 -- SET_SPI_STREAMING_REPORT - \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ - eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is - set, AFLT will be used for 1x networks and OTDOA will be used - for LTE networks. */ - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - \label{operationMode} - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Whether the device is stationary: - \begin{itemize1} - \item 0x00 (FALSE) -- Device is not stationary - \item 0x01 (TRUE) -- Device is stationary - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. */ -#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem - time stamp. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the sensor time of the first sample.\n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit time tag of the first (oldest) sample in this - message. \n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \begin{itemize1} - \item 0x01 -- SIGN_REVERSAL - \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME - \vspace{-0.18in} \end{itemize1} */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyroscope Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyroscope sensor samples. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< Opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples - were accepted. */ - - /* Optional */ - /* Gyroscope Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were - accepted. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< Value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the APN profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 101 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n Access Point Name (APN) profile information is present only when - requestType is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocLppConfigMaskT_v02; -#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ -#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ -typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports - for assisted GLONASS. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP - \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the LPP configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not a success. - - Valid bitmasks: \begin{itemize1} - \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY - \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION - \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG - \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY - \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION - \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG - \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Assisted GLONASS Protocol mask. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP - \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position - improvement. */ - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in the heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPropertiesMaskT_v02; -#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Set Sensor Properties */ - uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ - qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Sensor Properties Config Parameters */ - qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; - /**< Mask denoting the sensor properties parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; -#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with - GNSS. They can still be used for aiding in heading improvements. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request acceleration data to be used by the low data rate - filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request gyro data to be used by the high data rate filter. - The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Sets which sensor algorithms are to be used when processing sensor data. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< Identifies parameters that were not configured successfully. This field - is sent only if the status is not a success. - - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- PERFORMANCE_MODE - \item 0x00000002 -- ACCEL_SAMPLING_SPEC - \item 0x00000004 -- GYRO_SAMPLING_SPEC - \item 0x00000008 -- ALGORITHM_CONFIG - \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH - \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Informs which sensor algorithms are currently set. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate ID */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate. \n - - Units: Bytes \n - - Range: 0 to 9 */ - - /* Mandatory */ - /* SUPL Certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< SUPL certificate contents. \n - - Type: Array of bytes. \n - - Maximum certificate size: 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate ID */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate to be deleted. \n - - Units: Bytes \n - - Range: 0 to 9 \n - If suplCertId is not specified, - all SUPL certificates are deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the - injected position in a direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data - in persistent memory. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position is used in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position - calculation - \item 0x00 (FALSE) -- Do not use the injected position in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Filter the usage of SVs in the fix - \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in - persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Store assistance data in persistent memory - \item 0x00 (FALSE) -- Do not store assistance data in persistent memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< Identifies the parameters that were not set successfully. - This field is sent only if the status is other than SUCCESS. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation - in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- The injected position is used in a direct - position calculation - \item 0x00 (FALSE) -- The injected position is not used in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- SV usage is filtered in the fix - \item 0x00 (FALSE) -- SV usage is not filtered in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies whether assistance data is stored in persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Assistance data is stored in persistent memory - \item 0x00 (FALSE) -- Assistance data is not stored in persistent - memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocGeofenceBreachMaskT_v02; -#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported - when the Geofence is entered. */ -#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported - when the Geofence is exited. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a - lower rate. The gap between actual breach and - the time it is reported is higher. This - setting results in lower power usage. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a - medium rate. This is the default setting. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a - high rate. The gap between actual breach and - the time it is reported is low. This results - in higher power usage. */ - QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceResponsivenessEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with - low confidence. This setting results in lower - power usage. This setting can impact the "yield" because - incorrect breach events may be sent. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with - medium confidence. This is the default setting. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with - high confidence. This setting results in higher - power usage. */ - QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceConfidenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double latitude; - /**< Latitude of the center of the Geofence.*/ - - double longitude; - /**< Longitude of the center of the Geofence.*/ - - uint32_t radius; - /**< Radius of the circular Geofence in meters. */ -}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ - QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofencePositionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Add Circular Geofence - indication. */ - - /* Mandatory */ - /* Circular Geofence Arguments */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Mandatory */ - /* Breach Event Mask */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ - - /* Mandatory */ - /* Include Position in Breach Event */ - uint8_t includePosition; - /**< Specifies whether the Geofence engine is to include the position - in a breach event. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Position will be reported with the breach event - \item 0x00 (FALSE) -- Position will not be reported with the breach - event - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Responsiveness */ - uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ - qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. - This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications - and is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW - \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED - \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Confidence */ - uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ - qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and - is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW - \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED - \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Add Circular Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Add Circular Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_MEMORY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Add Circular - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. - The client must include this identifier in all transactions - pertaining to this Geofence. */ -}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be deleted. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Delete Geofence - indication. */ -}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Delete Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was deleted. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Delete - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ -}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ - QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceOriginEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ - eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ - QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be queried. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned with the Query Geofence - indication. */ -}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Query Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Query Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was queried. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Query - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence Origin */ - uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ - qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; - /**< Originator of the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK - \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Position with Respect to Geofence */ - uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ - qmiLocGeofencePositionEnumT_v02 posWrtGeofence; - /**< Indicates if the client is currently inside or outside - the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_POSITION_INSIDE - \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Circular Geofence Parameters */ - uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ -}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence to be edited. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Edit Geofence - request. This parameter will always be present if the - status field is set to SUCCESS. - */ - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Breach Event Mask */ - uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; -#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ -#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Edit Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Edit Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was edited. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is specified in the Edit Geofence request. */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ - qmiLocGeofenceConfigParamMaskT_v02 failedParams; - /**< Specified only when the status is not set to SUCCESS. If - the mask corresponding to a field is set, it indicates that - the Geofence parameter could not be edited. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE - \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Get Best Available Position indication. */ -}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Best Available Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Best Available Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get Best - Available Position request. This parameter will - always be present if the status field is set to - SUCCESS. */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Major Axis */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation. \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Circular Confidence */ - uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ - uint8_t horCircularConfidence; - /**< Horizontal circular uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Elliptical Confidence */ - uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ - uint8_t horEllipticalConfidence; - /**< Horizontal elliptical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ - float horSpeed; - /**< Horizontal speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Horizontal Speed Uncertainty */ - uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ - float horSpeedUnc; - /**< Horizontal speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level. \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ - float vertSpeed; - /**< Vertical speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Vertical Speed Uncertainty */ - uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ - float vertSpeedUnc; - /**< Vertical speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading. \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty. \n - - Type: Floating point \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used Mask */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- TIME_SRC_INVALID - \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER - \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING - \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT - \item 0x00000004 -- TIME_SRC_TOW_DECODE - \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED - \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED - \item 0x00000007 -- TIME_SRC_NAV_SOLUTION - \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ - eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ - eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ - QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ - eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ - QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. \n - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.06in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute - rest by reducing probability_of_state. - */ - - qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion. \n - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. - \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.06in} \end{itemize1} - - The motion_mode value is independent of the motion_state value. - */ - - float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.06in} - - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.06in} - - It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} - - If the motion_state is not known, the value in this field is not used. - */ - - uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. - */ - - uint16_t timeout; - /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is - received. \vspace{0.06in} - - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the - state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} - - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. - */ -}qmiLocMotionDataStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Motion Data */ - qmiLocMotionDataStructT_v02 motion_data; - /**< Current motion data of the client */ -}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Inject Motion Data Request Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The same transaction ID - will be returned in the Get NI Geofence ID List indication. */ -}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Get NI Geofence ID List status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NI Geofence ID List request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI - Geofence ID List request. */ - - /* Optional */ - /* NI Geofence ID List */ - uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ - uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ - uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; - /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n - - Maximum NI Geofence ID List length: 16 */ -}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 specification */ - - uint32_t MNC; - /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ - - uint32_t LAC; - /**< GSM location area code.Refer to ITU-T E.212 specification */ - - uint32_t CID; - /**< GSM cell identification.Refer to ITU-T E.212 specification */ -}qmiLocGSMCellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used to inject GSM Cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* GSM Cell ID */ - qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< Identifies the GSM Cell the device is currently camped on.*/ - - /* Mandatory */ - /* Roaming Status */ - uint8_t roamingStatus; - /**< Whether the device is roaming. - \begin{itemize1} - \item 0x01 (TRUE) -- The device is roaming. - \item 0x00 (FALSE) -- The device is not roaming. - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to inject GSM Cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject GSM Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject GSM Cell Info request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ -}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used to inject a network initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Injected Network Initiated Message Type */ - qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; - /**< Type of the network initiated message being injected - Valid Values: - - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ - - /* Mandatory */ - /* Injected Network Initiated Message */ - uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ - uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network initiated message body. - If the inject NI message type is TYPE_SUPL, the message contains - a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ -}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to inject a network initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Network Initiated Message Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Network Initiated Message request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n - - 0x00000008 -- INSUFFICIENT_MEMORY \n */ -}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * typedef struct { - * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to notify the location engine that the device is - no longer camped. */ -typedef struct { - - /* Mandatory */ - /* Notify WWAN Out of Service Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WWAN out of service request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n - */ -}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 -#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 -#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 -#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 -#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 -#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 -#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 -#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif - +#ifndef LOC_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.5 + It was generated on: Thu Sep 27 2012 + From IDL File: location_service_v02.idl */ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x10 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x05 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x006C; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum string length for the Provider field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 + +/** Maximum string length for the Name field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 + +/** Maximum string length for the Version field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 + +/** Maximum length of the list containing the SVs that were used to generate + a position report. */ +#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum GNSS Measurement Engine Firmware Version String length. */ +#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ +#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Full Version String length. */ +#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of the SUPL certificate. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 + +/** Maximum length of the network-initiated Geofence ID + list */ +#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 + +/** Maximum length of the injected network initiated message. */ +#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. */ +#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: + \vspace{0.05in} \begin{itemize1} + \item 0x00000001 -- POSITION_REPORT + \item 0x00000002 -- GNSS_SV_INFO + \item 0x00000004 -- NMEA + \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ + \item 0x00000010 -- INJECT_TIME_REQ + \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ + \item 0x00000040 -- INJECT_POSITION_REQ + \item 0x00000080 -- ENGINE_STATE + \item 0x00000100 -- FIX_SESSION_STATE + \item 0x00000200 -- WIFI_REQ + \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS + \item 0x00000800 -- TIME_SYNC_REQ + \item 0x00001000 -- SET_SPI_STREAMING_REPORT + \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + \item 0x00004000 -- NI_GEOFENCE_NOTIFICATION + \item 0x00008000 -- GEOFENCE_GEN_ALERT + \item 0x00010000 -- GEOFENCE_BREACH_NOTIFICATION + \end{itemize1} \vspace{0.05in} + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; + /**< Application provider. */ + + char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; + /**< Application name. */ + + uint8_t applicationVersion_valid; + /**< Specifies whether the application version string contains + a valid value: \begin{itemize1} + \item 0x00 (FALSE) -- Application version string is invalid + \item 0x01 (TRUE) -- Application version string is valid + \vspace{-0.18in} \end{itemize1} */ + + char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; + /**< Application version. */ +}qmiLocApplicationIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Units: Milliseconds \n + - Default: 1000 ms + */ + + /* Optional */ + /* ID of the Application that Sent this Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \item PDOP = square root of (HDOP^2 + VDOP^2) + \vspace{-0.18in} \end{itemize1} */ + + float HDOP; + /**< Horizontal dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ + + float VDOP; + /**< Vertical dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors were used in calculating the position in the + position report. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SENSOR_USED_ACCEL + \item 0x00000002 -- SENSOR_USED_GYRO + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results were aided by sensors. + + Valid bitmasks: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the position report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SESS_STATUS_SUCCESS + \item 0x00000001 -- SESS_STATUS_IN_PROGRESS + \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE + \item 0x00000003 -- SESS_STATUS_TIMEOUT + \item 0x00000004 -- SESS_STATUS_USER_END + \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER + \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE + \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< 3-D Speed uncertainty.\n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \begin{itemize1} + \item 0x00000000 -- TIME_SRC_INVALID + \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER + \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING + \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT + \item 0x00000004 -- TIME_SRC_TOW_DECODE + \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED + \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED + \item 0x00000007 -- TIME_SRC_NAV_SOLUTION + \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- VALID_SYSTEM + \item 0x00000002 -- VALID_GNSS_SVID + \item 0x00000004 -- VALID_HEALTH_STATUS + \item 0x00000008 -- VALID_PROCESS_STATUS + \item 0x00000010 -- VALID_SVINFO_MASK + \item 0x00000020 -- VALID_ELEVATION + \item 0x00000040 -- VALID_AZIMUTH + \item 0x00000080 -- VALID_SNR + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} */ + + uint16_t gnssSvId; + /**< GNSS SV ID. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For GLONASS: 1 to 32 + \item For SBAS: 120 to 151 + \end{itemize1} \end{itemize1} + + The GPS and GLONASS SVs can be disambiguated using the system field. */ + + uint8_t healthStatus; + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy + \vspace{-0.18in} \end{itemize1}*/ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Valid altitude is calculated + \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be + enough satellites to determine precise altitude + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends NMEA sentences to the control point */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 201 + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY + \item 0x00000002 -- NI_VX_MS_BASED_ONLY + \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED + \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \begin{itemize1} + \item 0x00000000 -- NI_VX_OCTET + \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG + \item 0x00000002 -- NI_VX_ASCII + \item 0x00000003 -- NI_VX_IA5 + \item 0x00000004 -- NI_VX_UNICODE + \item 0x00000005 -- NI_VX_SHIFT_JIS + \item 0x00000006 -- NI_VX_KOREAN + \item 0x00000007 -- NI_VX_LATIN_HEBREW + \item 0x00000008 -- NI_VX_LATIN + \item 0x00000009 -- NI_VX_GSM + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \begin{itemize1} + \item 0x00000000 -- FORMAT_LOGICAL_NAME + \item 0x00000001 -- FORMAT_EMAIL_ADDRESS + \item 0x00000002 -- FORMAT_MSISDN + \item 0x00000003 -- FORMAT_URL + \item 0x00000004 -- FORMAT_SIP_URL + \item 0x00000005 -- FORMAT_MIN + \item 0x00000006 -- FORMAT_MDN + \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY + \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID*/ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. */ + + uint16_t port; + /**< IPV4 port. */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SUPL_SERVER_INFO + \item 0x00000002 -- SUPL_SESSION_ID + \item 0x00000004 -- SUPL_HASH + \item 0x00000008 -- SUPL_POS_METHOD + \item 0x00000010 -- SUPL_DATA_CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ID + \item 0x00000040 -- SUPL_CLIENT_NAME + \item 0x00000080 -- SUPL_QOP + \item 0x00000100 -- SUPL_USER_RESP_TIMER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \begin{itemize1} + \item 0x00000001 -- AGPS_SETASSISTED + \item 0x00000002 -- AGPS_SETBASED + \item 0x00000003 -- AGPS_SETASSISTED_PREF + \item 0x00000004 -- AGPS_SETBASED_PREF + \item 0x00000005 -- AUTONOMOUS_GPS + \item 0x00000006 -- AFLT + \item 0x00000007 -- ECID + \item 0x00000008 -- EOTD + \item 0x00000009 -- OTDOA + \item 0x0000000A -- NO_POSITION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds*/ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- INVOKE_ID_MASK + \item 0x0002 -- DATA_CODING_SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_MASK + \item 0x0008 -- CLIENT_ADDRESS_MASK + \item 0x0010 -- LOCATION_TYPE_MASK + \item 0x0020 -- REQUESTOR_ID_MASK + \item 0x0040 -- CODEWORD_STRING_MASK + \item 0x0080 -- SERVICE_TYPE_MASK + \item 0x0100 -- USER_RESP_TIMER_MASK + \vspace{-0.18in} \end{itemize1} + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- CURRENT_LOCATION + \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION + \item 0x00000004 -- INITIAL_LOCATION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ONGOING_NI_INCOMING_MO + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID + and multiple location IDs in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of + multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed + as part of multiple location ID in the SUPL_POS_INIT message. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + triggered session. */ + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; + /**< Specifies which type of network measurements are allowed to be sent as + part of the Location ID or Multiple Location IDs parameter in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- SUPPORTED_NETWORK_WLAN + \item 0x0002 -- SUPPORTED_NETWORK_GSM + \item 0x0004 -- SUPPORTED_NETWORK_WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_CDMA + \item 0x0010 -- SUPPORTED_NETWORK_HRDP + \item 0x0020 -- SUPPORTED_NETWORK_UMB + \item 0x0040 -- SUPPORTED_NETWORK_LTE + \item 0x0080 -- SUPPORTED_NETWORK_WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; + /**< Specifies the type of session trigger requested in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid values: \begin{itemize1} + \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT + \item 0x00000000 -- TRIGGER_TYPE_PERIODIC + \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT + \vspace{-0.18in} \end{itemize1} */ + + qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; + /**< Specifies which GNSS technologies are allowed as positioning + technologies. + + Valid bitmasks: \n + - 0x0001 -- GNSS_GPS \n + - 0x0002 -- GNSS_GLONASS \n + - 0x0004 -- GNSS_GALILEO \n + - 0x0008 -- GNSS_SBAS \n + - 0x0010 -- GNSS_QZSS \n + - 0x0020 -- GNSS_MODERN_GPS + */ +}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIFY + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; + /**< \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL + indication payload. */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \begin{itemize1} + \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES + \item 0x00000001 -- START_PERIODIC_KEEP_WARM + \item 0x00000002 -- STOP_PERIODIC_FIXES + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \n + + samplesPerBatch must be a nonzero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in an integral number of batches per + second (Hz). \n + + batchesPerSecond must be a nonzero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor + data + \item 0x00 (FALSE) -- GNSS location engine is not ready to accept + sensor data + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyroscope Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor + data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream. + \begin{itemize1} + \item 0x01 (TRUE) -- Client is to start sending an SPI status stream + \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. \n + + Valid values: \begin{itemize1} + \item 0x00000000 -- WWAN_TYPE_INTERNET + \item 0x00000001 -- WWAN_TYPE_AGNSS + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the + Geofence to find the its current state. */ + QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiGeofenceOperationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Informs the control point about + network-initiated Geofences. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Operation Type */ + qmiLocNiGeofenceOperationEnumT_v02 operationType; + /**< Operation for which this notification was generated. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_GEOFENCE_ADDED + \item 0x00000002 -- NI_GEOFENCE_DELETED + \item 0x00000003 -- NI_GEOFENCE_EDITED + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can + be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage + information is available. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ + QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceGenAlertEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + Geofence status. */ +typedef struct { + + /* Mandatory */ + /* Geofence General Alert */ + qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; + /**< Specifies the Geofence general alert type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE + \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE + \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS + \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ + QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceBreachTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Elliptical Horizontal Uncertainty Azimuth */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Horizontal Speed validity bit */ + uint8_t speedHorizontal_valid; + /**< Indicates whether the Horizontal speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Horizontal speed is valid + \item 0x00 (FALSE) -- Horizontal speed is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Horizontal Speed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Altitude validity bit */ + uint8_t altitudeWrtEllipsoid_valid; + /**< Indicates whether the altitude field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Altitude field is valid + \item 0x00 (FALSE) -- Altitude field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} + */ + + /* Altitude With Respect to Ellipsoid */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Vertical Uncertainty validity bit */ + uint8_t vertUnc_valid; + /**< Indicates whether the Vertical Uncertainty field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Uncertainty field is valid + \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Uncertainty */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Vertical Speed validity bit */ + uint8_t speedVertical_valid; + /**< Indicates whether the Vertical Speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Speed field is valid + \item 0x00 (FALSE) -- Vertical Speed field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Speed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* heading validity bit */ + uint8_t heading_valid; + /**< Indicates whether the Heading field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Heading field is valid + \item 0x00 (FALSE) -- Heading field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Heading */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ +}qmiLocGeofencePositionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of + a Geofence breach event. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< The type of breach that generated this event. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING + \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Geofence Position */ + uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ + qmiLocGeofencePositionStructT_v02 geofencePosition; + /**< \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ +}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ + eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent + memory for the request. */ + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. */ + + /* Optional */ + /* GNSS Measurement Engine Firmware Version String */ + uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ + char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS measurement engine software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in} \end{itemize1} + + \textbf{Note:} This string is only provided on platforms that have + a measurement engine that supports this version string. On all other + platforms, this optional TLV is not provided. */ + + /* Optional */ + /* GNSS Hosted Software Version String */ + uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ + char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS hosted software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in}\end{itemize1} + + \textbf{Note:} This string is only provided on hosted architectures + (measurement and position engine running on different processors) that + support this version string. On all other platforms, this optional TLV + is not provided. */ + + /* Optional */ + /* GNSS Software Version String */ + uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ + char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Aggregate version of the GNSS software. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Units: Milliseconds */ + + /* Optional */ + /* ID of the Application that Sent the Position Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT + \item 0x00000002 -- NOTIFY_VERIFY_DENY + \item 0x00000003 -- NOTIFY_VERIFY_NORESP + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIF + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; + /**< \n Optional SUPL Version 2 Extension payload. */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \begin{itemize1} + \item 0x00000000 -- PREDICTED_ORBITS_XTRA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Units: Milliseconds */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ALT_SRC_UNKNOWN + \item 0x00000001 -- ALT_SRC_GPS + \item 0x00000002 -- ALT_SRC_CELL_ID + \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID + \item 0x00000004 -- ALT_SRC_WIFI + \item 0x00000005 -- ALT_SRC_TERRESTRIAL + \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID + \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE + \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER + \item 0x00000009 -- ALT_SRC_OTHER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED + \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT + \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG + \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \begin{itemize1} + \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED + \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid + at the injected horizontal position coordinates + only. + \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to + the position of the device regardless of + horizontal position (within the horizontal + uncertainty region, if provided). + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0 to 99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid. + \begin{itemize1} + \item Units: Meters \begin{itemize1} + \item Positive = height + \item Negative = depth + \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0-99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from which this position was obtained. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS + \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID + \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID + \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI + \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL + \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID + \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER + \end{itemize1} \vspace{0.05in} + + If altitude is specified and the altitude source is not specified, the engine + assumes that the altitude was obtained using the specified position source. \n + If both altitude and altitude source are specified, the engine assumes + that only latitude and longitude were obtained using the specified position + source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ +#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this + message are ignored + \item 0x00 (FALSE) -- The optional fields in the message are to be + used to determine which data is to be deleted + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assistance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_GPS_SVDIR + \item 0x00000002 -- DELETE_GPS_SVSTEER + \item 0x00000004 -- DELETE_GPS_TIME + \item 0x00000008 -- DELETE_GPS_ALM_CORR + \item 0x00000010 -- DELETE_GLO_SVDIR + \item 0x00000020 -- DELETE_GLO_SVSTEER + \item 0x00000040 -- DELETE_GLO_TIME + \item 0x00000080 -- DELETE_GLO_ALM_CORR + \item 0x00000100 -- DELETE_SBAS_SVDIR + \item 0x00000200 -- DELETE_SBAS_SVSTEER + \item 0x00000400 -- DELETE_POSITION + \item 0x00000800 -- DELETE_TIME + \item 0x00001000 -- DELETE_IONO + \item 0x00002000 -- DELETE_UTC + \item 0x00004000 -- DELETE_HEALTH + \item 0x00008000 -- DELETE_SADATA + \item 0x00010000 -- DELETE_RTI + \item 0x00020000 -- DELETE_SV_NO_EXIST + \item 0x00040000 -- DELETE_FREQ_BIAS_EST + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CELLDB_POS + \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_OTA_POS + \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_TIMETAG + \item 0x00000020 -- DELETE_CELLDB_CELLID + \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST + \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST + \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER + \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME + \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER + \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST + \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST + \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER + \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER + \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY + \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ERROR_SUCCESS + \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE + \item 0x00000002 -- ERROR_NO_AP_FOUND + \item 0x00000003 -- ERROR_UNAUTHORIZED + \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE + \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED + \item 0x00000006 -- ERROR_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. + + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \begin{itemize1} + \item 0x00000001 -- WIFI_STATUS_AVAILABLE + \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- POSITION_REPORT + \item 0x00000002 -- GNSS_SV_INFO + \item 0x00000004 -- NMEA + \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ + \item 0x00000010 -- INJECT_TIME_REQ + \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ + \item 0x00000040 -- INJECT_POSITION_REQ + \item 0x00000080 -- ENGINE_STATE + \item 0x00000100 -- FIX_SESSION_STATE + \item 0x00000200 -- WIFI_REQ + \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS + \item 0x00000800 -- TIME_SYNC_REQ + \item 0x00001000 -- SET_SPI_STREAMING_REPORT + \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is + set, AFLT will be used for 1x networks and OTDOA will be used + for LTE networks. */ + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + \label{operationMode} + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary: + \begin{itemize1} + \item 0x00 (FALSE) -- Device is not stationary + \item 0x01 (TRUE) -- Device is stationary + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. */ +#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem + time stamp. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the sensor time of the first sample.\n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit time tag of the first (oldest) sample in this + message. \n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \begin{itemize1} + \item 0x01 -- SIGN_REVERSAL + \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME + \vspace{-0.18in} \end{itemize1} */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyroscope Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyroscope sensor samples. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< Opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< Lets the client know how many 3-axis accelerometer samples + were accepted. */ + + /* Optional */ + /* Gyroscope Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< Lets the client know how many 3-axis gyroscope samples were + accepted. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< Value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the APN profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 101 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n Access Point Name (APN) profile information is present only when + requestType is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocLppConfigMaskT_v02; +#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ +#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ +typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Configures the protocols that the location service supports + for assisted GLONASS. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP + \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the LPP configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< Identifies parameters that were not set successfully. This field + is sent only if the status is not a success. + + Valid bitmasks: \begin{itemize1} + \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY + \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION + \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY + \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION + \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG + \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Assisted GLONASS Protocol mask. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP + \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position + improvement. */ + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_DISABLED: + Inertial sensors are not to be used to aid in heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_DISABLED: + Inertial sensors are not to be used to aid in the heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPropertiesMaskT_v02; +#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Set Sensor Properties */ + uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ + qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Sensor Properties Config Parameters */ + qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; + /**< Mask denoting the sensor properties parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; +#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with + GNSS. They can still be used for aiding in heading improvements. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request acceleration data to be used by the low data rate + filter. The sensor data rate is specified in terms of the nominal number + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request gyro data to be used by the high data rate filter. + The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Sets which sensor algorithms are to be used when processing sensor data. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< Identifies parameters that were not configured successfully. This field + is sent only if the status is not a success. + + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- PERFORMANCE_MODE + \item 0x00000002 -- ACCEL_SAMPLING_SPEC + \item 0x00000004 -- GYRO_SAMPLING_SPEC + \item 0x00000008 -- ALGORITHM_CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Informs which sensor algorithms are currently set. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate ID */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate. \n + - Units: Bytes \n + - Range: 0 to 9 */ + + /* Mandatory */ + /* SUPL Certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< SUPL certificate contents. \n + - Type: Array of bytes. \n + - Maximum certificate size: 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate ID */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate to be deleted. \n + - Units: Bytes \n + - Range: 0 to 9 \n + If suplCertId is not specified, + all SUPL certificates are deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the + injected position in a direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position is used in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Use the injected position in a direct position + calculation + \item 0x00 (FALSE) -- Do not use the injected position in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Filter the usage of SVs in the fix + \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data is to be stored in + persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Store assistance data in persistent memory + \item 0x00 (FALSE) -- Do not store assistance data in persistent memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< Identifies the parameters that were not set successfully. + This field is sent only if the status is other than SUCCESS. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies whether the injected position is used for a direct calculation + in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- The injected position is used in a direct + position calculation + \item 0x00 (FALSE) -- The injected position is not used in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- SV usage is filtered in the fix + \item 0x00 (FALSE) -- SV usage is not filtered in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies whether assistance data is stored in persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Assistance data is stored in persistent memory + \item 0x00 (FALSE) -- Assistance data is not stored in persistent + memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocGeofenceBreachMaskT_v02; +#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported + when the Geofence is entered. */ +#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported + when the Geofence is exited. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a + lower rate. The gap between actual breach and + the time it is reported is higher. This + setting results in lower power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a + medium rate. This is the default setting. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a + high rate. The gap between actual breach and + the time it is reported is low. This results + in higher power usage. */ + QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceResponsivenessEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with + low confidence. This setting results in lower + power usage. This setting can impact the "yield" because + incorrect breach events may be sent. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with + medium confidence. This is the default setting. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with + high confidence. This setting results in higher + power usage. */ + QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceConfidenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double latitude; + /**< Latitude of the center of the Geofence.*/ + + double longitude; + /**< Longitude of the center of the Geofence.*/ + + uint32_t radius; + /**< Radius of the circular Geofence in meters. */ +}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ + QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofencePositionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add Circular Geofence + indication. */ + + /* Mandatory */ + /* Circular Geofence Arguments */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Mandatory */ + /* Breach Event Mask */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Mandatory */ + /* Include Position in Breach Event */ + uint8_t includePosition; + /**< Specifies whether the Geofence engine is to include the position + in a breach event. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Position will be reported with the breach event + \item 0x00 (FALSE) -- Position will not be reported with the breach + event + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW + \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED + \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Confidence */ + uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 confidence; + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and + is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW + \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED + \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Add Circular Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add Circular Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_MEMORY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Add Circular + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + The client must include this identifier in all transactions + pertaining to this Geofence. */ +}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be deleted. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete Geofence + indication. */ +}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Delete Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was deleted. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Delete + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ + QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceOriginEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ + QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be queried. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Query Geofence + indication. */ +}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Query Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was queried. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Query + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence Origin */ + uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ + qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; + /**< Originator of the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK + \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Position with Respect to Geofence */ + uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ + qmiLocGeofencePositionEnumT_v02 posWrtGeofence; + /**< Indicates if the client is currently inside or outside + the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_POSITION_INSIDE + \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Circular Geofence Parameters */ + uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ +}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence to be edited. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Edit Geofence + request. This parameter will always be present if the + status field is set to SUCCESS. + */ + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Breach Event Mask */ + uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; +#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ +#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Edit Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Edit Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was edited. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is specified in the Edit Geofence request. */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ + qmiLocGeofenceConfigParamMaskT_v02 failedParams; + /**< Specified only when the status is not set to SUCCESS. If + the mask corresponding to a field is set, it indicates that + the Geofence parameter could not be edited. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Best Available Position indication. */ +}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Best Available Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Best Available Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get Best + Available Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ + float horSpeed; + /**< Horizontal speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Horizontal Speed Uncertainty */ + uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ + float horSpeedUnc; + /**< Horizontal speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ + float vertSpeed; + /**< Vertical speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Vertical Speed Uncertainty */ + uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ + float vertSpeedUnc; + /**< Vertical speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading. \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty. \n + - Type: Floating point \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used Mask */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \begin{itemize1} + \item 0x00000000 -- TIME_SRC_INVALID + \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER + \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING + \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT + \item 0x00000004 -- TIME_SRC_TOW_DECODE + \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED + \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED + \item 0x00000007 -- TIME_SRC_NAV_SOLUTION + \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ + QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ + QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocMotionStateEnumT_v02 motion_state; + /**< Current motion state of the user. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.06in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute + rest by reducing probability_of_state. + */ + + qmiLocMotionModeEnumT_v02 motion_mode; + /**< Modes of user motion. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement + is in Pedestrian mode; nothing else is known about the movement. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement + is in Pedestrian Walking mode. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement + is in Pedestrian Running mode. + \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is + in Vehicular mode; nothing else is known about the movement. + \vspace{0.06in} \end{itemize1} + + The motion_mode value is independent of the motion_state value. + */ + + float probability_of_state; + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.06in} + + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.06in} + + It is recommended that if a particular combination of motion_state and + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} + + If the motion_state is not known, the value in this field is not used. + */ + + uint16_t age; + /**< Age of the motion data in milliseconds at the time of injection. + */ + + uint16_t timeout; + /**< If the age of the motion data input exceeds the timeout value, the data + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is + received. \vspace{0.06in} + + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} + + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. + */ +}qmiLocMotionDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Motion Data */ + qmiLocMotionDataStructT_v02 motion_data; + /**< Current motion data of the client */ +}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Inject Motion Data Request Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Motion Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The same transaction ID + will be returned in the Get NI Geofence ID List indication. */ +}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Get NI Geofence ID List status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NI Geofence ID List request. + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get NI + Geofence ID List request. */ + + /* Optional */ + /* NI Geofence ID List */ + uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ + uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ + uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; + /**< List containing the NI Geofence IDs. + - Type: Array of unsigned 32-bit integers \n + - Maximum NI Geofence ID List length: 16 */ +}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t MCC; + /**< GSM mobile country code. Refer to ITU-T E.212 specification */ + + uint32_t MNC; + /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ + + uint32_t LAC; + /**< GSM location area code.Refer to ITU-T E.212 specification */ + + uint32_t CID; + /**< GSM cell identification.Refer to ITU-T E.212 specification */ +}qmiLocGSMCellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* GSM Cell ID */ + qmiLocGSMCellIdStructT_v02 gsmCellId; + /**< Identifies the GSM Cell the device is currently camped on.*/ + + /* Mandatory */ + /* Roaming Status */ + uint8_t roamingStatus; + /**< Whether the device is roaming. + \begin{itemize1} + \item 0x01 (TRUE) -- The device is roaming. + \item 0x00 (FALSE) -- The device is not roaming. + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject GSM Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject GSM Cell Info request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ +}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Injected Network Initiated Message Type */ + qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; + /**< Type of the network initiated message being injected + Valid Values: + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ + + /* Mandatory */ + /* Injected Network Initiated Message */ + uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ + uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; + /**< Network initiated message body. + If the inject NI message type is TYPE_SUPL, the message contains + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ +}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Network Initiated Message Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Network Initiated Message request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + - 0x00000008 -- INSUFFICIENT_MEMORY \n */ +}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * typedef struct { + * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to notify the location engine that the device is + no longer camped. */ +typedef struct { + + /* Mandatory */ + /* Notify WWAN Out of Service Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WWAN out of service request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + */ +}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 +#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 +#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 +#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 +#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 +#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 +#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 +#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + From dc7abf9a3d621b7a744e0eaeb6d9819ffff869a5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 26 Sep 2012 09:20:41 -0700 Subject: [PATCH 059/945] gps: report session begin/end on gps start/stop Since modem does not consistently send SESSON_END/ENGINE_OFF event, always report SESSION_END on stop gps and SESSION_BEGIN on start gps so that the icon is turned on/off correctly. CRs-fixed: 401664 Change-Id: Ib3954529056a653d7057aedb489be1ccee9eaf1d --- loc_api/libloc_api_50001/loc_eng.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5075311e..947e0814 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -536,6 +536,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { loc_eng_data.client_handle->setInSession(TRUE); + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -589,8 +590,7 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.client_handle->isInSession()) { ret_val = loc_eng_data.client_handle->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS && - loc_eng_data.fix_session_status != GPS_STATUS_SESSION_BEGIN) + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) { loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } @@ -787,14 +787,6 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa { CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); - - // Restore session begin if needed - if (status == GPS_STATUS_ENGINE_ON && last_status == GPS_STATUS_SESSION_BEGIN) - { - GpsStatus gs_sess_begin = { sizeof(gs_sess_begin),GPS_STATUS_SESSION_BEGIN }; - CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs_sess_begin.status)); - loc_eng_data.status_cb(&gs_sess_begin); - } } last_status = status; From d12dd7f6ccd430fefe7f4b1df16f141c261b2cab Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Wed, 26 Sep 2012 09:20:41 -0700 Subject: [PATCH 060/945] gps: report session begin/end on gps start/stop Since modem does not consistently send SESSON_END/ENGINE_OFF event, always report SESSION_END on stop gps and SESSION_BEGIN on start gps so that the icon is turned on/off correctly. Bug 7185242 Change-Id: Ib3954529056a653d7057aedb489be1ccee9eaf1d From fb4152c14bbcd1da0f65c995bf1666edec0afa6d Mon Sep 17 00:00:00 2001 From: Mekala Natarajan Date: Wed, 26 Sep 2012 16:07:40 -0700 Subject: [PATCH 061/945] disabled agps state machine delete in cleanup The current cleanup mismatches agps_init(), so that it the agps state machines will get deleted in the cleanup but never get recreated next time apgs_init() is called. Bug 7216641 Change-Id: Iddba9fd0d90c790e658f14c42c8a25d22b8749c0 From 67754118cec93d8032fda2e66901e157373ae407 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 27 Sep 2012 22:28:12 -0700 Subject: [PATCH 062/945] ATL call crash fix AgpsStatus added with a couple string fields for wifi which are not NULL ended when they are not used. This get passed to AFW JNI, and allow UTF8 string with the open ended buffer with junks in it. It might cause exception depending on the content of the garbadge. CRs-Fixed: 405473 Change-Id: If762748a4c63fe1be59491b5d08dbadd479176b3 --- loc_api/libloc_api_50001/loc_eng_agps.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index a0873d04..933779bc 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -204,7 +204,8 @@ struct Subscriber { inline virtual ~Subscriber() {} virtual void setIPAddresses(int &v4, char* v6) = 0; - inline virtual void setWifiInfo(char* ssid, char* password) {} + 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; } From 5b98ce35cda35d965332e27fbd40a0b46669b7f1 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 28 Sep 2012 15:31:11 -0700 Subject: [PATCH 063/945] gps: add support for apq8064 v2 The id for apq8064 v2 is 153 vs apq8064 v1 id of 109, so the id can be either in order to conclude that the device is apq8064 so that GSS can be launched. Change-Id: I8126854f18ba30a1fe46992993185266e9d1db18 CRs-fixed: 405494 --- loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index baba3d7c..cca44807 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -216,7 +216,7 @@ static int get_target_name(void) target_name = TARGET_NAME_APQ8064_FUSION3; } else { read_a_line( id, line, LINE_LEN); - if(!strncmp(line, "109", strlen("109"))) { + if(!strncmp(line, "109", strlen("109")) || !strncmp(line, "153", strlen("153"))) { target_name = TARGET_NAME_APQ8064_STANDALONE; } } From 502865cbdf91517eb1a8fc1471ead21640a292fc Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 1 Oct 2012 11:57:20 -0700 Subject: [PATCH 064/945] BIT:Fixes a bug in the pipe ownership for BIT AGPS interface Changes to assign the correct permissions for 'gps" group for Rx path from HAL to BIT daemon Change-Id: I6c5dc4ff0a1379a95888f4d98e88f0174a7a2a79 CRs-Fixed: 400339, 387672 --- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index f01402a1..112d30f3 100755 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -72,7 +72,8 @@ static int loc_api_server_proc_init(void *context) result = chown (global_loc_api_q_path, -1, gps_group->gr_gid); if (result != 0) { - LOC_LOGE("chown for pipe failed, gid = %d, result = %d, error = %s\n", gps_group->gr_gid, result, strerror(errno)); + 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 @@ -81,6 +82,25 @@ static int loc_api_server_proc_init(void *context) } 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); From a389eae611ec3e7cfde8d45939cc7d9aca2eaf42 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 11 Sep 2012 15:14:48 -0700 Subject: [PATCH 065/945] dynamically build and load adapter libs this is to support bringup efforts. This change will decouple the dependencies between GPS HAL and proprietary QMI headers, so that we can build HAL without any proprietary repos. Change-Id: I7b836d09f4ac6b1a1bdb38f8d6a2bfb90bb5bf01 --- loc_api/Android.mk | 2 ++ loc_api/libloc_api_50001/Android.mk | 14 ++----------- loc_api/libloc_api_50001/LocApiAdapter.cpp | 23 ++++++++++++++++++++++ loc_api/libloc_api_50001/LocApiAdapter.h | 5 ++++- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 20ff0727..82aa08bb 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -13,9 +13,11 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC +ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) #add QMI libraries for QMI targets QMI_BOARD_PLATFORM_LIST := msm8960 QMI_BOARD_PLATFORM_LIST += msm8974 +endif ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 0bf889ef..d492120b 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -19,7 +19,8 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - libgps.utils + libgps.utils \ + libdl LOCAL_SRC_FILES += \ loc_eng_log.cpp \ @@ -79,17 +80,6 @@ LOCAL_SRC_FILES += \ loc_eng_dmn_conn_glue_msg.c \ loc_eng_dmn_conn_glue_pipe.c -# if QMI is supported then link to loc_api_v02 -ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) -LOCAL_SHARED_LIBRARIES += libloc_api_v02 -else -## Check if RPC is not unsupported -ifneq ($(TARGET_NO_RPC),true) -LOCAL_SHARED_LIBRARIES += libloc_api-rpc-qc -endif #TARGET_NO_RPC - -endif #is-board-platform-in-list - LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index 6bd79bbe..950c6438 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -29,6 +29,7 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_adapter" +#include #include #include "loc_eng_msg.h" #include "loc_log.h" @@ -67,6 +68,28 @@ LocApiAdapter::~LocApiAdapter() LOC_LOGV("LocApiAdapter deleted"); } +LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) +{ + void* handle; + LocApiAdapter* adapter = NULL; + + handle = dlopen ("libloc_api_v02.so", RTLD_NOW); + + if (!handle) { + handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); + } + + if (!handle) { + adapter = new LocApiAdapter(locEng); + } else { + getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); + + adapter = (*getHandle)(locEng); + } + + return adapter; +} + int LocApiAdapter::hexcode(char *hexstring, int string_size, const char *data, int data_size) { diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 80a675d8..ec53805e 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -115,6 +115,8 @@ public: //LocApiAdapter(int q, reportCb_t[LOC_API_ADAPTER_EVENT_MAX] callbackTable); virtual ~LocApiAdapter(); + static LocApiAdapter* getLocApiAdapter(LocEng &locEng); + static int hexcode(char *hexstring, int string_size, const char *data, int data_size); static int decodeAddress(char *addr_string, int string_size, @@ -221,7 +223,8 @@ public: inline virtual void setInSession(bool inSession) { navigating = inSession; } }; -LocApiAdapter* getLocApiAdapter(LocEng &locEng); +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng); +typedef LocApiAdapter* (getLocApiAdapter_t)(LocEng&); #endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index aa9298d5..89a77292 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -319,7 +319,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); - loc_eng_data.client_handle = getLocApiAdapter(locEngHandle); + loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); int ret_val =-1; if (NULL == loc_eng_data.client_handle) { From 0eaa3bab7e314dbdb4688d21cab282c84e5f572f Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Tue, 9 Oct 2012 20:50:06 -0700 Subject: [PATCH 066/945] BIT:Fixes a bug in HAL for AGPS operation for SGLTE Enhances HAL to launch the Daemon connection server for SGLTE targets too. CRs-Fixed: 409237 Change-Id: I70116eb1f96b8b4dbe39f57dfceb1ab02ef65e4d --- loc_api/libloc_api_50001/loc_eng.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 89a77292..da10c714 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -870,10 +870,14 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac char baseband[PROPERTY_VALUE_MAX]; property_get("ro.baseband", baseband, "msm"); if ((strcmp(baseband,"svlte2a") == 0) || + (strcmp(baseband,"sglte") == 0) || (strcmp(baseband,"msm") == 0)) { loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); + } else { + LOC_LOGD("%s:%d] loc_eng_dmn_conn_loc_api_server was not initialized.baseband = %s\n", + __func__, __LINE__, baseband); } } #endif /* FEATURE_GNSS_BIT_API */ From 2051ffae1f509a1b31e5a6bcf170cecf500376de Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 8 Oct 2012 15:41:32 -0700 Subject: [PATCH 067/945] Service modem's request for NTP time Previously, modem's request for NTP time was not supported. This change enables that request to be serviced through the HAL and current NTP time is injected into the modem CRs-Fixed: 406357 Change-Id: I471f98cf57a276902d7991da48cf7244fe798318 --- loc_api/libloc_api_50001/LocApiAdapter.cpp | 6 +++--- loc_api/libloc_api_50001/loc.cpp | 4 ++-- loc_api/libloc_api_50001/loc.h | 1 + loc_api/libloc_api_50001/loc_eng.cpp | 11 +++++++++-- loc_api/libloc_api_50001/loc_eng.h | 1 + 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index 950c6438..4bd2ec76 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -201,9 +201,9 @@ void LocApiAdapter::requestXtraData() void LocApiAdapter::requestTime() { - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); + LOC_LOGD("loc_event_cb: XTRA time download request"); + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + locEngHandle.sendMsge(locEngHandle.owner, msg); } void LocApiAdapter::requestLocation() diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index cca44807..f78d8070 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -334,7 +334,8 @@ static int loc_init(GpsCallbacks* callbacks) callbacks->release_wakelock_cb, /* release_wakelock_cb */ callbacks->create_thread_cb, /* create_thread_cb */ NULL, /* location_ext_parser */ - NULL /* sv_ext_parser */}; + NULL, /* sv_ext_parser */ + callbacks->request_utc_time_cb /* request_utc_time_cb */}; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; @@ -499,7 +500,6 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain { ENTRY_LOG(); int ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - EXIT_LOG(%d, ret_val); return ret_val; } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 17f6ab70..b823e476 100755 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -72,6 +72,7 @@ typedef struct { 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; } LocCallbacks; enum loc_sess_status { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 89a77292..a1fc6d57 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -298,7 +298,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.nmea_cb = callbacks->nmea_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.intermediateFix = gps_conf.INTERMEDIATE_POS; // initial states taken care of by the memset above @@ -683,7 +683,6 @@ int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, uncertainty)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); - EXIT_LOG(%d, 0); return 0; } @@ -1682,6 +1681,14 @@ static void loc_eng_deferred_action_thread(void* arg) break; case LOC_ENG_MSG_REQUEST_TIME: + if (loc_eng_data_p->request_utc_time_cb != NULL) + { + loc_eng_data_p->request_utc_time_cb(); + } + else + { + LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__); + } break; case LOC_ENG_MSG_REQUEST_POSITION: diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 1b9dcf58..646d1716 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -106,6 +106,7 @@ typedef struct gps_ni_notify_callback ni_notify_cb; gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; + gps_request_utc_time request_utc_time_cb; ulp_network_location_request ulp_network_callback; ulp_request_phone_context ulp_phone_context_req_cb; boolean intermediateFix; From d6c87927692d41305be7fd5f94c967911180c7d1 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 9 Oct 2012 15:03:19 -0700 Subject: [PATCH 068/945] Remove interpretation of LPP config parameter Instead of having a switch case that sets bits in the lppconfig mask, the mask is assigned whatever value was read from gps.conf. The advantage of this being that if in the future additional bits are added in lppconfig, there need not be a code change; only comments in gps.conf have to be updated to inform the correct value for those additional bits CRs-Fixed: 406969 Change-Id: I979151b44cd85e98b59b4586fdd49e20a7d7c82b --- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 25 +----------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 63eeb6c4..4c7b7124 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1185,31 +1185,8 @@ enum loc_api_adapter_err LocApiV02Adapter :: setLPPConfig(uint32_t profile) memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); lpp_config_req.lppConfig_valid = 1; - // Default RRLP or User or Control plane configuration - switch(profile) - { - /* RRLP */ - case 0: - lpp_config_req.lppConfig = profile; - break; - /* User plane */ - case 1: - lpp_config_req.lppConfig = QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02; - break; - - case 2: - lpp_config_req.lppConfig = QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02; - break; - - default: - LOC_LOGE("%s:%d]: Invalid LPP Profile Config Setting Provided in gps.conf = %d!", - __FUNCTION__, - __LINE__, - profile); - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - break; - } + lpp_config_req.lppConfig = profile; req_union.pSetProtocolConfigParametersReq = &lpp_config_req; From 0529b2b9bb54a1b7cd23741e5ef8101ee3d8bf52 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 17 Oct 2012 14:49:56 -0700 Subject: [PATCH 069/945] XTWiFi: disable coarse position injection when XTWiFi NLP is in use Disable coarse position injection from GPS HAL when XTWiFi Network Location Provider is in use. This is needed to avoid self learning loop inside modem. Change-Id: I0526317221d3490c41d0d8d901fbfa4d93e9a0b0 CRs-Fixed: 409409 --- loc_api/libloc_api_50001/loc.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) mode change 100644 => 100755 loc_api/libloc_api_50001/loc.cpp diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp old mode 100644 new mode 100755 index f78d8070..8ac78625 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -41,6 +41,8 @@ #include #include +#include + //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); @@ -523,9 +525,32 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { + static bool initialized = false; + static bool enable_cpi = true; ENTRY_LOG(); - int ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + if(!initialized) + { + char value[PROPERTY_VALUE_MAX]; + memset(value, 0, sizeof(value)); + (void)property_get("persist.gps.qc_nlp_in_use", value, "0"); + if(0 == strcmp(value, "1")) + { + enable_cpi = false; + LOC_LOGI("GPS HAL coarse position injection disabled"); + } + else + { + LOC_LOGI("GPS HAL coarse position injection enabled"); + } + initialized = true; + } + + int ret_val = 0; + if(enable_cpi) + { + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + } EXIT_LOG(%d, ret_val); return ret_val; } From 9365bf1ffd633b65bad7f95af90dcbb53e41652b Mon Sep 17 00:00:00 2001 From: "woojin.shin" Date: Thu, 18 Oct 2012 17:41:31 +0900 Subject: [PATCH 070/945] gps: fix for no gps signals after modem reset This fixes the problem that GPS doesn't work until reboot after modem reset. Bug: 7216911 Change-Id: Ibfee6a28850490548da2e0ccaefdabe9b826b5e9 Signed-off-by: Iliyan Malchev --- loc_api/loc_api_v02/loc_api_v02_client.c | 180 +++++++++++++++-------- 1 file changed, 118 insertions(+), 62 deletions(-) mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_client.c diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c old mode 100755 new mode 100644 index 4d34adc4..bb745112 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -71,7 +71,8 @@ #endif //LOC_UTIL_TARGET_OFF_TARGET //timeout in ms to wait for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT (20000) +#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) +#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (60000) /* Table to relate eventId, size and mask value used to enable the event*/ typedef struct @@ -1401,14 +1402,17 @@ static bool validateRequest( static locClientStatusEnumType locClientQmiCtrlPointInit( locClientCallbackDataType *pLocClientCbData) { - uint32_t num_services, num_entries = 10; qmi_client_type clnt, notifier; - qmi_client_os_params os_params; - - // num instances of this service - qmi_service_info serviceInfo[5]; + bool notifierInitFlag = false; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + // instances of this service + qmi_service_info *pServiceInfo = NULL; + do + { + uint32_t num_services = 0, num_entries = 0; qmi_client_error_type rc = QMI_NO_ERR; + bool nosignal = false; // Get the service object for the qmiLoc Service qmi_idl_service_object_type locClientServiceObject = @@ -1419,73 +1423,107 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( { LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , __func__, __LINE__ ); - return(eLOC_CLIENT_FAILURE_INTERNAL); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; } - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed\n", - __func__, __LINE__ ); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT); - - if(QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params)) - { - // timed out, return with error - LOC_LOGE("%s:%d]: timed out waiting for service\n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_TIMEOUT); - } - else - { // get the service addressing information rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned %d " - "num_services = %d\n", __func__, __LINE__, rc, - num_services); + LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " + "num_services %d", __func__, __LINE__, rc, num_services); + + if (rc != QMI_NO_ERR) { + // bummer, service list is not up. + // We need to try again after a timed wait + qmi_client_os_params os_params; + int timeout = 0; + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); + + if (rc != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); + nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + + // get the service addressing information + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " + "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); + } + + if (0 == num_services || rc != QMI_NO_ERR) { + if (!nosignal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!! Error %d \n", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + } else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," + " final Err %d", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_TIMEOUT; + } + break; + } + + pServiceInfo = + (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + + if(NULL == pServiceInfo) + { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + //set the number of entries to get equal to the total number of + //services. + num_entries = num_services; + //populate the serviceInfo + rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, + &num_entries, &num_services); + + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); if(rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!!\n", __func__, __LINE__); + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; } - } - - //get service info to be used in qmi_client_init - rc = qmi_client_get_service_list( locClientServiceObject, serviceInfo, - &num_entries, &num_services); - - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", __func__, __LINE__, pLocClientCbData); + // initialize the client - rc = qmi_client_init(&serviceInfo[0], locClientServiceObject, + //sent the address of the first service found + // if IPC router is present, this will go to the service instance + // enumerated over IPC router, else it will go over the next transport where + // the service was enumerated. + rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, locClientIndCb, (void *) pLocClientCbData, NULL, &clnt); @@ -1493,7 +1531,9 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( { LOC_LOGE("%s:%d]: qmi_client_init error %d\n", __func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; } LOC_LOGV("%s:%d]: passing the pointer %p to" @@ -1508,14 +1548,30 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( { LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", __func__, __LINE__, rc); - return (eLOC_CLIENT_FAILURE_INTERNAL); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; } // copy the clnt handle returned in qmi_client_init memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - return(eLOC_CLIENT_SUCCESS); + status = eLOC_CLIENT_SUCCESS; + } while(0); + + /* release the notifier handle */ + if(true == notifierInitFlag) + { + qmi_client_release(notifier); + } + + if(NULL != pServiceInfo) + { + free((void *)pServiceInfo); + } + + return status; } //----------------------- END INTERNAL FUNCTIONS ---------------------------------------- From c74962df0d30bdb176472a1775a794fd93b1cd7a Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Thu, 25 Oct 2012 08:28:01 -0700 Subject: [PATCH 071/945] chmod uga-x find -type f -perm +111 -name \*.[ch]\* -exec chmod uga-x {} \; Bug: 7428209 Change-Id: I991e3fb62a46f4b4cd727ef4b6a4472b4015ce33 Signed-off-by: Iliyan Malchev --- etc/gps.conf | 0 .../libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h | 0 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_api_log.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h | 0 .../libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h | 0 .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 0 .../libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c | 0 .../libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c | 0 .../libloc_api-rpc-glue/src/loc_api_rpc_glue.c | 0 .../libloc_api-rpc-glue/src/loc_api_sync_call.c | 0 .../libloc_api-rpc-glue/src/loc_apicb_appinit.c | 0 .../libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h | 0 .../libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h | 0 .../libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h | 0 .../libloc_api-rpc-stub/inc/loc_apicb_appinit.h | 0 .../libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c | 0 .../libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c | 0 .../libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c | 0 .../libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c | 0 .../libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c | 0 .../libloc_api-rpc-stub/src/loc_apicb_appinit.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c | 0 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c | 0 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 0 loc_api/libloc_api-rpc/inc-1240/loc_api.h | 0 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 0 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h | 0 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h | 0 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h | 0 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h | 0 loc_api/libloc_api-rpc/inc/debug.h | 0 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 0 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c | 0 loc_api/libloc_api/gps.c | 0 loc_api/libloc_api/loc_eng.cpp | 0 loc_api/libloc_api/loc_eng.h | 0 loc_api/libloc_api/loc_eng_ioctl.cpp | 0 loc_api/libloc_api/loc_eng_ioctl.h | 0 loc_api/libloc_api/loc_eng_ni.cpp | 0 loc_api/libloc_api/loc_eng_ni.h | 0 loc_api/libloc_api/loc_eng_xtra.cpp | 0 loc_api/libloc_api/loc_eng_xtra.h | 0 loc_api/libloc_api_50001/LocApiAdapter.cpp | 0 loc_api/libloc_api_50001/LocApiAdapter.h | 0 loc_api/libloc_api_50001/gps.c | 0 loc_api/libloc_api_50001/loc.cpp | 0 loc_api/libloc_api_50001/loc.h | 0 loc_api/libloc_api_50001/loc_eng.h | 0 loc_api/libloc_api_50001/loc_eng_agps.cpp | 0 loc_api/libloc_api_50001/loc_eng_agps.h | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c | 0 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h | 0 loc_api/libloc_api_50001/loc_eng_log.cpp | 0 loc_api/libloc_api_50001/loc_eng_log.h | 0 loc_api/libloc_api_50001/loc_eng_msg.cpp | 0 loc_api/libloc_api_50001/loc_eng_msg.h | 0 loc_api/libloc_api_50001/loc_eng_msg_id.h | 0 loc_api/libloc_api_50001/loc_eng_ni.cpp | 0 loc_api/libloc_api_50001/loc_eng_ni.h | 0 loc_api/libloc_api_50001/loc_eng_xtra.cpp | 0 loc_api/libloc_api_50001/loc_eng_xtra.h | 0 loc_api/loc_api_v02/LocApiV02Adapter.cpp | 0 loc_api/loc_api_v02/LocApiV02Adapter.h | 0 loc_api/loc_api_v02/loc_api_sync_req.c | 0 loc_api/loc_api_v02/loc_api_sync_req.h | 0 loc_api/loc_api_v02/loc_api_v02_client.h | 0 loc_api/loc_api_v02/loc_api_v02_log.c | 0 loc_api/loc_api_v02/loc_api_v02_log.h | 0 loc_api/loc_api_v02/loc_util_log.h | 0 loc_api/loc_api_v02/location_service_v02.c | 0 loc_api/loc_api_v02/location_service_v02.h | 0 loc_api/ulp/inc/ulp.h | 0 utils/linked_list.c | 0 utils/linked_list.h | 0 utils/loc_cfg.cpp | 0 utils/loc_cfg.h | 0 utils/loc_log.cpp | 0 utils/loc_log.h | 0 utils/log_util.h | 0 utils/msg_q.c | 0 utils/msg_q.h | 0 107 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 etc/gps.conf mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc/debug.h mode change 100755 => 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h mode change 100755 => 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c mode change 100755 => 100644 loc_api/libloc_api/gps.c mode change 100755 => 100644 loc_api/libloc_api/loc_eng.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ioctl.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ioctl.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ni.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_ni.h mode change 100755 => 100644 loc_api/libloc_api/loc_eng_xtra.cpp mode change 100755 => 100644 loc_api/libloc_api/loc_eng_xtra.h mode change 100755 => 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/LocApiAdapter.h mode change 100755 => 100644 loc_api/libloc_api_50001/gps.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_agps.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_agps.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_log.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_log.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_msg_id.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_ni.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_ni.h mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_xtra.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/loc_eng_xtra.h mode change 100755 => 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp mode change 100755 => 100644 loc_api/loc_api_v02/LocApiV02Adapter.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_sync_req.c mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_sync_req.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_client.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_log.c mode change 100755 => 100644 loc_api/loc_api_v02/loc_api_v02_log.h mode change 100755 => 100644 loc_api/loc_api_v02/loc_util_log.h mode change 100755 => 100644 loc_api/loc_api_v02/location_service_v02.c mode change 100755 => 100644 loc_api/loc_api_v02/location_service_v02.h mode change 100755 => 100644 loc_api/ulp/inc/ulp.h mode change 100755 => 100644 utils/linked_list.c mode change 100755 => 100644 utils/linked_list.h mode change 100755 => 100644 utils/loc_cfg.cpp mode change 100755 => 100644 utils/loc_cfg.h mode change 100755 => 100644 utils/loc_log.cpp mode change 100755 => 100644 utils/loc_log.h mode change 100755 => 100644 utils/log_util.h mode change 100755 => 100644 utils/msg_q.c mode change 100755 => 100644 utils/msg_q.h diff --git a/etc/gps.conf b/etc/gps.conf old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_v02_client.h b/loc_api/loc_api_v02/loc_api_v02_client.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c old mode 100755 new mode 100644 diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h old mode 100755 new mode 100644 diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h old mode 100755 new mode 100644 diff --git a/utils/linked_list.c b/utils/linked_list.c old mode 100755 new mode 100644 diff --git a/utils/linked_list.h b/utils/linked_list.h old mode 100755 new mode 100644 diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp old mode 100755 new mode 100644 diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h old mode 100755 new mode 100644 diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp old mode 100755 new mode 100644 diff --git a/utils/loc_log.h b/utils/loc_log.h old mode 100755 new mode 100644 diff --git a/utils/log_util.h b/utils/log_util.h old mode 100755 new mode 100644 diff --git a/utils/msg_q.c b/utils/msg_q.c old mode 100755 new mode 100644 diff --git a/utils/msg_q.h b/utils/msg_q.h old mode 100755 new mode 100644 From 5f45c04c890fbf9657e3a442f7094c25c59ee99f Mon Sep 17 00:00:00 2001 From: Nitin Singh Date: Thu, 1 Nov 2012 14:34:36 -0700 Subject: [PATCH 072/945] Loc api v02 support for QMI_LOC rev 2.17 changes to suuport pedometer and motion data control API Change-Id: I56c87adaa1f717c76bf1ff6eb2d195c92acbd38d --- loc_api/loc_api_v02/loc_api_v02_client.c | 46 +- loc_api/loc_api_v02/loc_api_v02_client.h | 28 + loc_api/loc_api_v02/loc_api_v02_log.c | 20 + loc_api/loc_api_v02/location_service_v02.c | 6178 +++---- loc_api/loc_api_v02/location_service_v02.h | 16478 ++++++++++--------- 5 files changed, 11780 insertions(+), 10970 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 6e60b604..592e3f59 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -159,7 +159,17 @@ static locClientEventIndTableStructT locClientEventIndTable[]= { //Geofence Breach event { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02} + QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02}, + + //Pedometer Control event + { QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, + sizeof(qmiLocEventPedometerControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 }, + + //Motion Data Control event + { QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, + sizeof(qmiLocEventMotionDataControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 } }; /* table to relate the respInd Id with its size */ @@ -384,7 +394,7 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { //Inject GSM Cell Info { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, - sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, + sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02)}, //Inject Network Initiated Message { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, @@ -392,7 +402,11 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { //WWAN Out of Service Notification { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, - sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)} + sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)}, + + //Pedomete Report + { QMI_LOC_PEDOMETER_REPORT_IND_V02, + sizeof(qmiLocPedometerReportIndMsgT_v02)} }; @@ -824,6 +838,20 @@ static bool locClientHandleIndication( break; } + case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : + { + //locClientHandlePedometerControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: + { + //locClientHandleMotionDataControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + //------------------------------------------------------------------------- // handle the response indications @@ -995,6 +1023,12 @@ static bool locClientHandleIndication( break; } + case QMI_LOC_PEDOMETER_REPORT_IND_V02: + { + status = true; + break; + } + // for indications that only have a "status" field case QMI_LOC_NI_USER_RESPONSE_IND_V02: case QMI_LOC_INJECT_UTC_TIME_IND_V02: @@ -1534,6 +1568,7 @@ static bool validateRequest( *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); break; } + case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: { *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); @@ -1558,6 +1593,11 @@ static bool validateRequest( break; } + case QMI_LOC_PEDOMETER_REPORT_REQ_V02: + { + *pOutLen = sizeof(qmiLocPedometerReportReqMsgT_v02); + break; + } // ALL requests with no payload case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: diff --git a/loc_api/loc_api_v02/loc_api_v02_client.h b/loc_api/loc_api_v02/loc_api_v02_client.h index a49f1275..97298782 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.h +++ b/loc_api/loc_api_v02/loc_api_v02_client.h @@ -600,6 +600,16 @@ typedef union QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ const void *pWWANOutOfServiceNotificationReq; + + const qmiLocPedometerReportReqMsgT_v02 *pPedometerReportReq; + /**< Send pedometer data to the location engine. If the request is + accepted by the service, the client receives the following + indication containing a response: + QMI_LOC_PEDOMETER_REPORT_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ + }locClientReqUnionType; @@ -750,6 +760,18 @@ typedef union The eventIndId field in the event indication callback is set to QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ + const qmiLocEventPedometerControlIndMsgT_v02* pPedometerControlEvent; + /**< Sent by the engine to recommend how pedometer data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02. @newpagetable */ + + const qmiLocEventMotionDataControlIndMsgT_v02* pMotionDataControlEvent; + /**< Sent by the engine to recommend how motion data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02. @newpagetable */ + }locClientEventIndUnionType; @@ -1124,6 +1146,12 @@ typedef union The respIndId field in the response indication callback is set to QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ + const qmiLocPedometerReportIndMsgT_v02* pPedometerReportInd; + + /**< Response to the QMI_LOC_PEDOMETER_REPORT_REQ_V02 request. + The respIndId field in the response indication callback is set to + QMI_LOC_PEDOMETER_REPORT_IND_V02. */ + }locClientRespIndUnionType; /** @} */ /* end_addtogroup data_types */ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c index 6f60ee58..7a4f4a66 100644 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -209,6 +209,26 @@ static loc_name_val_s_type loc_v02_event_name[] = NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02) }; static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c index 47a63eea..ae465714 100755 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -26,3000 +26,3184 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - - L O C A T I O N _ S E R V I C E _ V 0 2 . C - -GENERAL DESCRIPTION - This is the file which defines the loc service Data structures. - - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 5.5 - It was generated on: Thu Sep 27 2012 - From IDL File: location_service_v02.idl */ - -#include "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), - QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), - QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), - QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 8, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 9, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 10, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 7, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 12, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 12, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 20, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 29, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocMotionDataStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), - 0x2C, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 4, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 14, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), - 15, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 17, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 19, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 21, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 21, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) -}; - -static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) -}; - -static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 22, 0 -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), - QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), - QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, - QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), - QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 14, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), - 15, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 19, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 23, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 24, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 25, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 26, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 27, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 28, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 30, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 30, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 31, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), - - 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 32, 0, - - 0x03, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), - - 0x04, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) -}; - -static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) -}; - -static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 32, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) -}; - -static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) -}; - -static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) -}; - -static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), - 0x12, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), - 0x16, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), - 0x1B, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), - 0x1C, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), - 0x21, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), - 0x24, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), - 0x25, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), - 0x26, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), - 0x27, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), - 0x29, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), - 0x2C, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), - 0x2D, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 33, 0 -}; - -static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), - QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) -}; - -static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 34, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) -}; - -static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), - ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) -}; - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, - {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, - {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, - {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1086}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 1425}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 32}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1079}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 22}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 39}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, - {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, - {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, - {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 133), 7} -}; - -/*Service Object*/ -struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x05, - 0x02, - 0x10, - 2248, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02, - 0x10, - NULL -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} - +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.6 + It was generated on: Fri Oct 26 2012 + From IDL File: location_service_v02.idl */ + +#include "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), + QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), + QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), + QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 8, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 9, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 10, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 7, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 12, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 12, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 16, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 16, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 20, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 29, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocMotionDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), + 36, 0, + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + 0x2C, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 4, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 14, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), + 15, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), + 35, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 17, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 19, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), + 21, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), + 21, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) +}; + +static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) +}; + +static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), + 22, 0 +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), + QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), + QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, + QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), + QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 14, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), + 15, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), + 35, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 19, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 23, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 24, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 25, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 26, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 27, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 28, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 30, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 30, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), + 37, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), + 37, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 31, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), + 20, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), + 20, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 20, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), + 20, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), + 20, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), + 32, 0, + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), + + 0x04, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) +}; + +static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) +}; + +static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), + 32, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) +}; + +static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) +}; + +static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) +}; + +static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), + 0x21, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), + 0x24, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), + 0x25, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), + 0x26, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), + 0x27, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), + 0x29, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), + 0x2C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), + 0x2D, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), + 33, 0 +}; + +static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), + QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) +}; + +static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), + 34, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) +}; + +static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) +}; + +static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) +}; + +static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), + + 0x04, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) +}; + +static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, + {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, + {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, + {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, + {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, + {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, + {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, + {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 2063}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 53}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, TYPE16(0, 136), 46} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_PEDOMETER_REPORT_RESP_V02, TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1338}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 32}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 30}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 60}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, + {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, + {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, + {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 133), 7}, + {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, TYPE16(0, 134), 15}, + {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, TYPE16(0, 135), 4}, + {QMI_LOC_PEDOMETER_REPORT_IND_V02, TYPE16(0, 137), 7} +}; + +/*Service Object*/ +struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x05, + 0x02, + 0x10, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02, + 0x11, + NULL +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h index b31efd04..c44d6fa5 100755 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -25,7973 +25,8511 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LOC_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 5.5 - It was generated on: Thu Sep 27 2012 - From IDL File: location_service_v02.idl */ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x10 -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x05 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x006C; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum string length for the Provider field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 - -/** Maximum string length for the Name field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 - -/** Maximum string length for the Version field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 - -/** Maximum length of the list containing the SVs that were used to generate - a position report. */ -#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum GNSS Measurement Engine Firmware Version String length. */ -#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ -#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Full Version String length. */ -#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of the SUPL certificate. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 - -/** Maximum length of the network-initiated Geofence ID - list */ -#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 - -/** Maximum length of the injected network initiated message. */ -#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. */ -#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: - \vspace{0.05in} \begin{itemize1} - \item 0x00000001 -- POSITION_REPORT - \item 0x00000002 -- GNSS_SV_INFO - \item 0x00000004 -- NMEA - \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ - \item 0x00000010 -- INJECT_TIME_REQ - \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ - \item 0x00000040 -- INJECT_POSITION_REQ - \item 0x00000080 -- ENGINE_STATE - \item 0x00000100 -- FIX_SESSION_STATE - \item 0x00000200 -- WIFI_REQ - \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS - \item 0x00000800 -- TIME_SYNC_REQ - \item 0x00001000 -- SET_SPI_STREAMING_REPORT - \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - \item 0x00004000 -- NI_GEOFENCE_NOTIFICATION - \item 0x00008000 -- GEOFENCE_GEN_ALERT - \item 0x00010000 -- GEOFENCE_BREACH_NOTIFICATION - \end{itemize1} \vspace{0.05in} - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; - /**< Application provider. */ - - char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; - /**< Application name. */ - - uint8_t applicationVersion_valid; - /**< Specifies whether the application version string contains - a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid - \item 0x01 (TRUE) -- Application version string is valid - \vspace{-0.18in} \end{itemize1} */ - - char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; - /**< Application version. */ -}qmiLocApplicationIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Units: Milliseconds \n - - Default: 1000 ms - */ - - /* Optional */ - /* ID of the Application that Sent this Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to - generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \item PDOP = square root of (HDOP^2 + VDOP^2) - \vspace{-0.18in} \end{itemize1} */ - - float HDOP; - /**< Horizontal dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ - - float VDOP; - /**< Vertical dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors were used in calculating the position in the - position report. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SENSOR_USED_ACCEL - \item 0x00000002 -- SENSOR_USED_GYRO - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results were aided by sensors. - - Valid bitmasks: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the position report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SESS_STATUS_SUCCESS - \item 0x00000001 -- SESS_STATUS_IN_PROGRESS - \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE - \item 0x00000003 -- SESS_STATUS_TIMEOUT - \item 0x00000004 -- SESS_STATUS_USER_END - \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER - \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE - \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< 3-D Speed uncertainty.\n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- TIME_SRC_INVALID - \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER - \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING - \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT - \item 0x00000004 -- TIME_SRC_TOW_DECODE - \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED - \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED - \item 0x00000007 -- TIME_SRC_NAV_SOLUTION - \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- VALID_SYSTEM - \item 0x00000002 -- VALID_GNSS_SVID - \item 0x00000004 -- VALID_HEALTH_STATUS - \item 0x00000008 -- VALID_PROCESS_STATUS - \item 0x00000010 -- VALID_SVINFO_MASK - \item 0x00000020 -- VALID_ELEVATION - \item 0x00000040 -- VALID_AZIMUTH - \item 0x00000080 -- VALID_SNR - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} */ - - uint16_t gnssSvId; - /**< GNSS SV ID. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For GLONASS: 1 to 32 - \item For SBAS: 120 to 151 - \end{itemize1} \end{itemize1} - - The GPS and GLONASS SVs can be disambiguated using the system field. */ - - uint8_t healthStatus; - /**< Health status. - \begin{itemize1} - \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy - \vspace{-0.18in} \end{itemize1}*/ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Source */ - uint8_t altitudeAssumed; - /**< Whether altitude is assumed or calculated: \begin{itemize1} - \item 0x00 (FALSE) -- Valid altitude is calculated - \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be - enough satellites to determine precise altitude - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends NMEA sentences to the control point */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 201 - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY - \item 0x00000002 -- NI_VX_MS_BASED_ONLY - \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED - \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \begin{itemize1} - \item 0x00000000 -- NI_VX_OCTET - \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG - \item 0x00000002 -- NI_VX_ASCII - \item 0x00000003 -- NI_VX_IA5 - \item 0x00000004 -- NI_VX_UNICODE - \item 0x00000005 -- NI_VX_SHIFT_JIS - \item 0x00000006 -- NI_VX_KOREAN - \item 0x00000007 -- NI_VX_LATIN_HEBREW - \item 0x00000008 -- NI_VX_LATIN - \item 0x00000009 -- NI_VX_GSM - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \begin{itemize1} - \item 0x00000000 -- FORMAT_LOGICAL_NAME - \item 0x00000001 -- FORMAT_EMAIL_ADDRESS - \item 0x00000002 -- FORMAT_MSISDN - \item 0x00000003 -- FORMAT_URL - \item 0x00000004 -- FORMAT_SIP_URL - \item 0x00000005 -- FORMAT_MIN - \item 0x00000006 -- FORMAT_MDN - \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY - \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID*/ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. */ - - uint16_t port; - /**< IPV4 port. */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SUPL_SERVER_INFO - \item 0x00000002 -- SUPL_SESSION_ID - \item 0x00000004 -- SUPL_HASH - \item 0x00000008 -- SUPL_POS_METHOD - \item 0x00000010 -- SUPL_DATA_CODING_SCHEME - \item 0x00000020 -- SUPL_REQUESTOR_ID - \item 0x00000040 -- SUPL_CLIENT_NAME - \item 0x00000080 -- SUPL_QOP - \item 0x00000100 -- SUPL_USER_RESP_TIMER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \begin{itemize1} - \item 0x00000001 -- AGPS_SETASSISTED - \item 0x00000002 -- AGPS_SETBASED - \item 0x00000003 -- AGPS_SETASSISTED_PREF - \item 0x00000004 -- AGPS_SETBASED_PREF - \item 0x00000005 -- AUTONOMOUS_GPS - \item 0x00000006 -- AFLT - \item 0x00000007 -- ECID - \item 0x00000008 -- EOTD - \item 0x00000009 -- OTDOA - \item 0x0000000A -- NO_POSITION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds*/ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- INVOKE_ID_MASK - \item 0x0002 -- DATA_CODING_SCHEME_MASK - \item 0x0004 -- NOTIFICATION_TEXT_MASK - \item 0x0008 -- CLIENT_ADDRESS_MASK - \item 0x0010 -- LOCATION_TYPE_MASK - \item 0x0020 -- REQUESTOR_ID_MASK - \item 0x0040 -- CODEWORD_STRING_MASK - \item 0x0080 -- SERVICE_TYPE_MASK - \item 0x0100 -- USER_RESP_TIMER_MASK - \vspace{-0.18in} \end{itemize1} - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- CURRENT_LOCATION - \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION - \item 0x00000004 -- INITIAL_LOCATION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ONGOING_NI_INCOMING_MO - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID - and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of - multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed - as part of multiple location ID in the SUPL_POS_INIT message. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event - triggered session. */ - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; - /**< Specifies which type of network measurements are allowed to be sent as - part of the Location ID or Multiple Location IDs parameter in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- SUPPORTED_NETWORK_WLAN - \item 0x0002 -- SUPPORTED_NETWORK_GSM - \item 0x0004 -- SUPPORTED_NETWORK_WCDMA - \item 0x0008 -- SUPPORTED_NETWORK_CDMA - \item 0x0010 -- SUPPORTED_NETWORK_HRDP - \item 0x0020 -- SUPPORTED_NETWORK_UMB - \item 0x0040 -- SUPPORTED_NETWORK_LTE - \item 0x0080 -- SUPPORTED_NETWORK_WIMAX - \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC - \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; - /**< Specifies the type of session trigger requested in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid values: \begin{itemize1} - \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT - \item 0x00000000 -- TRIGGER_TYPE_PERIODIC - \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT - \vspace{-0.18in} \end{itemize1} */ - - qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; - /**< Specifies which GNSS technologies are allowed as positioning - technologies. - - Valid bitmasks: \n - - 0x0001 -- GNSS_GPS \n - - 0x0002 -- GNSS_GLONASS \n - - 0x0004 -- GNSS_GALILEO \n - - 0x0008 -- GNSS_SBAS \n - - 0x0010 -- GNSS_QZSS \n - - 0x0020 -- GNSS_MODERN_GPS - */ -}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIFY - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL - indication payload. */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \begin{itemize1} - \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES - \item 0x00000001 -- START_PERIODIC_KEEP_WARM - \item 0x00000002 -- STOP_PERIODIC_FIXES - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \n - - samplesPerBatch must be a nonzero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in an integral number of batches per - second (Hz). \n - - batchesPerSecond must be a nonzero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor - data - \item 0x00 (FALSE) -- GNSS location engine is not ready to accept - sensor data - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. - */ - - /* Optional */ - /* Gyroscope Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor - data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream. - \begin{itemize1} - \item 0x01 (TRUE) -- Client is to start sending an SPI status stream - \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. \n - - Valid values: \begin{itemize1} - \item 0x00000000 -- WWAN_TYPE_INTERNET - \item 0x00000001 -- WWAN_TYPE_AGNSS - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ - eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ - eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the - Geofence to find the its current state. */ - QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiGeofenceOperationEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Informs the control point about - network-initiated Geofences. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Operation Type */ - qmiLocNiGeofenceOperationEnumT_v02 operationType; - /**< Operation for which this notification was generated. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_GEOFENCE_ADDED - \item 0x00000002 -- NI_GEOFENCE_DELETED - \item 0x00000003 -- NI_GEOFENCE_EDITED - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes - cannot be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can - be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage - information is available. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ - QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceGenAlertEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of the - Geofence status. */ -typedef struct { - - /* Mandatory */ - /* Geofence General Alert */ - qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE - \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE - \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS - \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ - QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceBreachTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Elliptical Horizontal Uncertainty Azimuth */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Horizontal Speed validity bit */ - uint8_t speedHorizontal_valid; - /**< Indicates whether the Horizontal speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Horizontal speed is valid - \item 0x00 (FALSE) -- Horizontal speed is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Horizontal Speed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Altitude validity bit */ - uint8_t altitudeWrtEllipsoid_valid; - /**< Indicates whether the altitude field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Altitude field is valid - \item 0x00 (FALSE) -- Altitude field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} - */ - - /* Altitude With Respect to Ellipsoid */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Vertical Uncertainty validity bit */ - uint8_t vertUnc_valid; - /**< Indicates whether the Vertical Uncertainty field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Uncertainty field is valid - \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Uncertainty */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Vertical Speed validity bit */ - uint8_t speedVertical_valid; - /**< Indicates whether the Vertical Speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Speed field is valid - \item 0x00 (FALSE) -- Vertical Speed field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Speed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* heading validity bit */ - uint8_t heading_valid; - /**< Indicates whether the Heading field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Heading field is valid - \item 0x00 (FALSE) -- Heading field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Heading */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ -}qmiLocGeofencePositionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of - a Geofence breach event. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Geofence Breach Type */ - qmiLocGeofenceBreachTypeEnumT_v02 breachType; - /**< The type of breach that generated this event. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING - \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Geofence Position */ - uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ - qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< \n Position of the client when it breached the Geofence. - This TLV is included if the client configures the - Geofence to report position. The position is reported - at the same confidence level that was specified in the - Add Circular Geofence request. */ -}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ - eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ - eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent - memory for the request. */ - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. */ - - /* Optional */ - /* GNSS Measurement Engine Firmware Version String */ - uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ - char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS measurement engine software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in} \end{itemize1} - - \textbf{Note:} This string is only provided on platforms that have - a measurement engine that supports this version string. On all other - platforms, this optional TLV is not provided. */ - - /* Optional */ - /* GNSS Hosted Software Version String */ - uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ - char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS hosted software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in}\end{itemize1} - - \textbf{Note:} This string is only provided on hosted architectures - (measurement and position engine running on different processors) that - support this version string. On all other platforms, this optional TLV - is not provided. */ - - /* Optional */ - /* GNSS Software Version String */ - uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ - char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Aggregate version of the GNSS software. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Units: Milliseconds */ - - /* Optional */ - /* ID of the Application that Sent the Position Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT - \item 0x00000002 -- NOTIFY_VERIFY_DENY - \item 0x00000003 -- NOTIFY_VERIFY_NORESP - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIF - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \n Optional SUPL Version 2 Extension payload. */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \begin{itemize1} - \item 0x00000000 -- PREDICTED_ORBITS_XTRA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Units: Milliseconds */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ALT_SRC_UNKNOWN - \item 0x00000001 -- ALT_SRC_GPS - \item 0x00000002 -- ALT_SRC_CELL_ID - \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID - \item 0x00000004 -- ALT_SRC_WIFI - \item 0x00000005 -- ALT_SRC_TERRESTRIAL - \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID - \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE - \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER - \item 0x00000009 -- ALT_SRC_OTHER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED - \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT - \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG - \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \begin{itemize1} - \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED - \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid - at the injected horizontal position coordinates - only. - \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to - the position of the device regardless of - horizontal position (within the horizontal - uncertainty region, if provided). - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0 to 99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid. - \begin{itemize1} - \item Units: Meters \begin{itemize1} - \item Positive = height - \item Negative = depth - \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0-99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from which this position was obtained. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS - \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID - \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID - \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI - \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL - \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID - \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER - \end{itemize1} \vspace{0.05in} - - If altitude is specified and the altitude source is not specified, the engine - assumes that the altitude was obtained using the specified position source. \n - If both altitude and altitude source are specified, the engine assumes - that only latitude and longitude were obtained using the specified position - source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ -#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this - message are ignored - \item 0x00 (FALSE) -- The optional fields in the message are to be - used to determine which data is to be deleted - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assistance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_GPS_SVDIR - \item 0x00000002 -- DELETE_GPS_SVSTEER - \item 0x00000004 -- DELETE_GPS_TIME - \item 0x00000008 -- DELETE_GPS_ALM_CORR - \item 0x00000010 -- DELETE_GLO_SVDIR - \item 0x00000020 -- DELETE_GLO_SVSTEER - \item 0x00000040 -- DELETE_GLO_TIME - \item 0x00000080 -- DELETE_GLO_ALM_CORR - \item 0x00000100 -- DELETE_SBAS_SVDIR - \item 0x00000200 -- DELETE_SBAS_SVSTEER - \item 0x00000400 -- DELETE_POSITION - \item 0x00000800 -- DELETE_TIME - \item 0x00001000 -- DELETE_IONO - \item 0x00002000 -- DELETE_UTC - \item 0x00004000 -- DELETE_HEALTH - \item 0x00008000 -- DELETE_SADATA - \item 0x00010000 -- DELETE_RTI - \item 0x00020000 -- DELETE_SV_NO_EXIST - \item 0x00040000 -- DELETE_FREQ_BIAS_EST - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CELLDB_POS - \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS - \item 0x00000004 -- DELETE_CELLDB_OTA_POS - \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS - \item 0x00000010 -- DELETE_CELLDB_TIMETAG - \item 0x00000020 -- DELETE_CELLDB_CELLID - \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID - \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL - \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL - \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST - \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST - \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER - \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME - \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER - \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST - \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST - \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER - \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER - \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY - \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ERROR_SUCCESS - \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE - \item 0x00000002 -- ERROR_NO_AP_FOUND - \item 0x00000003 -- ERROR_UNAUTHORIZED - \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE - \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED - \item 0x00000006 -- ERROR_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. - - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \begin{itemize1} - \item 0x00000001 -- WIFI_STATUS_AVAILABLE - \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- POSITION_REPORT - \item 0x00000002 -- GNSS_SV_INFO - \item 0x00000004 -- NMEA - \item 0x00000008 -- NI_NOTIFY_VERIFY_REQ - \item 0x00000010 -- INJECT_TIME_REQ - \item 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ - \item 0x00000040 -- INJECT_POSITION_REQ - \item 0x00000080 -- ENGINE_STATE - \item 0x00000100 -- FIX_SESSION_STATE - \item 0x00000200 -- WIFI_REQ - \item 0x00000400 -- SENSOR_STREAMING_READY_STATUS - \item 0x00000800 -- TIME_SYNC_REQ - \item 0x00001000 -- SET_SPI_STREAMING_REPORT - \item 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ - eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is - set, AFLT will be used for 1x networks and OTDOA will be used - for LTE networks. */ - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - \label{operationMode} - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Whether the device is stationary: - \begin{itemize1} - \item 0x00 (FALSE) -- Device is not stationary - \item 0x01 (TRUE) -- Device is stationary - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. */ -#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem - time stamp. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the sensor time of the first sample.\n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit time tag of the first (oldest) sample in this - message. \n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \begin{itemize1} - \item 0x01 -- SIGN_REVERSAL - \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME - \vspace{-0.18in} \end{itemize1} */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyroscope Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyroscope sensor samples. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< Opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples - were accepted. */ - - /* Optional */ - /* Gyroscope Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were - accepted. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< Value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the APN profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 101 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n Access Point Name (APN) profile information is present only when - requestType is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocLppConfigMaskT_v02; -#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ -#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ -typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports - for assisted GLONASS. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP - \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the LPP configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not a success. - - Valid bitmasks: \begin{itemize1} - \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY - \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION - \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG - \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY - \item 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION - \item 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - \item 0x0000000000000008 -- CONFIG_PARAM_MASK_LPP_CONFIG - \item 0x0000000000000010 -- CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Assisted GLONASS Protocol mask. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP - \item 0x00000002 -- ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position - improvement. */ - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in the heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPropertiesMaskT_v02; -#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Set Sensor Properties */ - uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ - qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Sensor Properties Config Parameters */ - qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; - /**< Mask denoting the sensor properties parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; -#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with - GNSS. They can still be used for aiding in heading improvements. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request acceleration data to be used by the low data rate - filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request gyro data to be used by the high data rate filter. - The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Sets which sensor algorithms are to be used when processing sensor data. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< Identifies parameters that were not configured successfully. This field - is sent only if the status is not a success. - - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- PERFORMANCE_MODE - \item 0x00000002 -- ACCEL_SAMPLING_SPEC - \item 0x00000004 -- GYRO_SAMPLING_SPEC - \item 0x00000008 -- ALGORITHM_CONFIG - \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH - \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Informs which sensor algorithms are currently set. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate ID */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate. \n - - Units: Bytes \n - - Range: 0 to 9 */ - - /* Mandatory */ - /* SUPL Certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< SUPL certificate contents. \n - - Type: Array of bytes. \n - - Maximum certificate size: 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate ID */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate to be deleted. \n - - Units: Bytes \n - - Range: 0 to 9 \n - If suplCertId is not specified, - all SUPL certificates are deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the - injected position in a direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data - in persistent memory. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position is used in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position - calculation - \item 0x00 (FALSE) -- Do not use the injected position in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Filter the usage of SVs in the fix - \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in - persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Store assistance data in persistent memory - \item 0x00 (FALSE) -- Do not store assistance data in persistent memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< Identifies the parameters that were not set successfully. - This field is sent only if the status is other than SUCCESS. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation - in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- The injected position is used in a direct - position calculation - \item 0x00 (FALSE) -- The injected position is not used in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- SV usage is filtered in the fix - \item 0x00 (FALSE) -- SV usage is not filtered in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies whether assistance data is stored in persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Assistance data is stored in persistent memory - \item 0x00 (FALSE) -- Assistance data is not stored in persistent - memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocGeofenceBreachMaskT_v02; -#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported - when the Geofence is entered. */ -#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported - when the Geofence is exited. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a - lower rate. The gap between actual breach and - the time it is reported is higher. This - setting results in lower power usage. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a - medium rate. This is the default setting. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a - high rate. The gap between actual breach and - the time it is reported is low. This results - in higher power usage. */ - QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceResponsivenessEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with - low confidence. This setting results in lower - power usage. This setting can impact the "yield" because - incorrect breach events may be sent. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with - medium confidence. This is the default setting. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with - high confidence. This setting results in higher - power usage. */ - QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceConfidenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double latitude; - /**< Latitude of the center of the Geofence.*/ - - double longitude; - /**< Longitude of the center of the Geofence.*/ - - uint32_t radius; - /**< Radius of the circular Geofence in meters. */ -}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ - QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofencePositionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Add Circular Geofence - indication. */ - - /* Mandatory */ - /* Circular Geofence Arguments */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Mandatory */ - /* Breach Event Mask */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ - - /* Mandatory */ - /* Include Position in Breach Event */ - uint8_t includePosition; - /**< Specifies whether the Geofence engine is to include the position - in a breach event. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Position will be reported with the breach event - \item 0x00 (FALSE) -- Position will not be reported with the breach - event - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Responsiveness */ - uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ - qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. - This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications - and is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW - \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED - \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Confidence */ - uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ - qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and - is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW - \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED - \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Add Circular Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Add Circular Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_MEMORY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Add Circular - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. - The client must include this identifier in all transactions - pertaining to this Geofence. */ -}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be deleted. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Delete Geofence - indication. */ -}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Delete Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was deleted. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Delete - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ -}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ - QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceOriginEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ - eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ - QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be queried. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned with the Query Geofence - indication. */ -}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Query Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Query Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was queried. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Query - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence Origin */ - uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ - qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; - /**< Originator of the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK - \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Position with Respect to Geofence */ - uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ - qmiLocGeofencePositionEnumT_v02 posWrtGeofence; - /**< Indicates if the client is currently inside or outside - the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_POSITION_INSIDE - \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Circular Geofence Parameters */ - uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ -}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence to be edited. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Edit Geofence - request. This parameter will always be present if the - status field is set to SUCCESS. - */ - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Breach Event Mask */ - uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; -#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ -#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Edit Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Edit Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was edited. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is specified in the Edit Geofence request. */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ - qmiLocGeofenceConfigParamMaskT_v02 failedParams; - /**< Specified only when the status is not set to SUCCESS. If - the mask corresponding to a field is set, it indicates that - the Geofence parameter could not be edited. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE - \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Get Best Available Position indication. */ -}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Best Available Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Best Available Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get Best - Available Position request. This parameter will - always be present if the status field is set to - SUCCESS. */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Major Axis */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation. \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Circular Confidence */ - uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ - uint8_t horCircularConfidence; - /**< Horizontal circular uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Elliptical Confidence */ - uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ - uint8_t horEllipticalConfidence; - /**< Horizontal elliptical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ - float horSpeed; - /**< Horizontal speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Horizontal Speed Uncertainty */ - uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ - float horSpeedUnc; - /**< Horizontal speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level. \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ - float vertSpeed; - /**< Vertical speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Vertical Speed Uncertainty */ - uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ - float vertSpeedUnc; - /**< Vertical speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading. \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty. \n - - Type: Floating point \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used Mask */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- TIME_SRC_INVALID - \item 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER - \item 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING - \item 0x00000003 -- TIME_SRC_EXTERNAL_INPUT - \item 0x00000004 -- TIME_SRC_TOW_DECODE - \item 0x00000005 -- TIME_SRC_TOW_CONFIRMED - \item 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED - \item 0x00000007 -- TIME_SRC_NAV_SOLUTION - \item 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ - eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ - eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ - QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ - eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ - QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. \n - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.06in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute - rest by reducing probability_of_state. - */ - - qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion. \n - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. - \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.06in} \end{itemize1} - - The motion_mode value is independent of the motion_state value. - */ - - float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.06in} - - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.06in} - - It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} - - If the motion_state is not known, the value in this field is not used. - */ - - uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. - */ - - uint16_t timeout; - /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is - received. \vspace{0.06in} - - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the - state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} - - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. - */ -}qmiLocMotionDataStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Motion Data */ - qmiLocMotionDataStructT_v02 motion_data; - /**< Current motion data of the client */ -}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Inject Motion Data Request Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The same transaction ID - will be returned in the Get NI Geofence ID List indication. */ -}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Get NI Geofence ID List status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NI Geofence ID List request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI - Geofence ID List request. */ - - /* Optional */ - /* NI Geofence ID List */ - uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ - uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ - uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; - /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n - - Maximum NI Geofence ID List length: 16 */ -}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 specification */ - - uint32_t MNC; - /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ - - uint32_t LAC; - /**< GSM location area code.Refer to ITU-T E.212 specification */ - - uint32_t CID; - /**< GSM cell identification.Refer to ITU-T E.212 specification */ -}qmiLocGSMCellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used to inject GSM Cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* GSM Cell ID */ - qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< Identifies the GSM Cell the device is currently camped on.*/ - - /* Mandatory */ - /* Roaming Status */ - uint8_t roamingStatus; - /**< Whether the device is roaming. - \begin{itemize1} - \item 0x01 (TRUE) -- The device is roaming. - \item 0x00 (FALSE) -- The device is not roaming. - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to inject GSM Cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject GSM Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject GSM Cell Info request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ -}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used to inject a network initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Injected Network Initiated Message Type */ - qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; - /**< Type of the network initiated message being injected - Valid Values: - - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ - - /* Mandatory */ - /* Injected Network Initiated Message */ - uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ - uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network initiated message body. - If the inject NI message type is TYPE_SUPL, the message contains - a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ -}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to inject a network initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Network Initiated Message Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Network Initiated Message request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n - - 0x00000008 -- INSUFFICIENT_MEMORY \n */ -}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * typedef struct { - * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to notify the location engine that the device is - no longer camped. */ -typedef struct { - - /* Mandatory */ - /* Notify WWAN Out of Service Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WWAN out of service request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n - */ -}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 -#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 -#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 -#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 -#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 -#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 -#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 -#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif - + +#ifndef LOC_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ + +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 5.6 + It was generated on: Fri Oct 26 2012 + From IDL File: location_service_v02.idl */ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x11 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x05 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x006F; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum string length for the Provider field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 + +/** Maximum string length for the Name field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 + +/** Maximum string length for the Version field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 + +/** Maximum length of the list containing the SVs that were used to generate + a position report. */ +#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum GNSS Measurement Engine Firmware Version String length. */ +#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ +#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Full Version String length. */ +#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of the SUPL certificate. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 + +/** Maximum length of the network-initiated Geofence ID + list */ +#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 + +/** Maximum length of the injected network initiated message. */ +#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. */ +#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. */ +#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. */ +#define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; + /**< Application provider. */ + + char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; + /**< Application name. */ + + uint8_t applicationVersion_valid; + /**< Specifies whether the application version string contains + a valid value: \begin{itemize1} + \item 0x00 (FALSE) -- Application version string is invalid + \item 0x01 (TRUE) -- Application version string is valid + \vspace{-0.18in} \end{itemize1} */ + + char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; + /**< Application version. */ +}qmiLocApplicationIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Units: Milliseconds \n + - Default: 1000 ms + */ + + /* Optional */ + /* ID of the Application that Sent this Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \item PDOP = square root of (HDOP^2 + VDOP^2) + \vspace{-0.18in} \end{itemize1} */ + + float HDOP; + /**< Horizontal dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ + + float VDOP; + /**< Vertical dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors were used in calculating the position in the + position report. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SENSOR_USED_ACCEL + \item 0x00000002 -- SENSOR_USED_GYRO + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results were aided by sensors. + + Valid bitmasks: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ + eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state */ + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the position report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SESS_STATUS_SUCCESS + \item 0x00000001 -- SESS_STATUS_IN_PROGRESS + \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE + \item 0x00000003 -- SESS_STATUS_TIMEOUT + \item 0x00000004 -- SESS_STATUS_USER_END + \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER + \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE + \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< 3-D Speed uncertainty.\n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- VALID_SYSTEM + \item 0x00000002 -- VALID_GNSS_SVID + \item 0x00000004 -- VALID_HEALTH_STATUS + \item 0x00000008 -- VALID_PROCESS_STATUS + \item 0x00000010 -- VALID_SVINFO_MASK + \item 0x00000020 -- VALID_ELEVATION + \item 0x00000040 -- VALID_AZIMUTH + \item 0x00000080 -- VALID_SNR + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} */ + + uint16_t gnssSvId; + /**< GNSS SV ID. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For GLONASS: 1 to 32 + \item For SBAS: 120 to 151 + \end{itemize1} \end{itemize1} + + The GPS and GLONASS SVs can be disambiguated using the system field. */ + + uint8_t healthStatus; + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy + \vspace{-0.18in} \end{itemize1}*/ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Valid altitude is calculated + \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be + enough satellites to determine precise altitude + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends NMEA sentences to the control point */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 201 + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY + \item 0x00000002 -- NI_VX_MS_BASED_ONLY + \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED + \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \begin{itemize1} + \item 0x00000000 -- NI_VX_OCTET + \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG + \item 0x00000002 -- NI_VX_ASCII + \item 0x00000003 -- NI_VX_IA5 + \item 0x00000004 -- NI_VX_UNICODE + \item 0x00000005 -- NI_VX_SHIFT_JIS + \item 0x00000006 -- NI_VX_KOREAN + \item 0x00000007 -- NI_VX_LATIN_HEBREW + \item 0x00000008 -- NI_VX_LATIN + \item 0x00000009 -- NI_VX_GSM + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \begin{itemize1} + \item 0x00000000 -- FORMAT_LOGICAL_NAME + \item 0x00000001 -- FORMAT_EMAIL_ADDRESS + \item 0x00000002 -- FORMAT_MSISDN + \item 0x00000003 -- FORMAT_URL + \item 0x00000004 -- FORMAT_SIP_URL + \item 0x00000005 -- FORMAT_MIN + \item 0x00000006 -- FORMAT_MDN + \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY + \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID*/ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. */ + + uint16_t port; + /**< IPV4 port. */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SUPL_SERVER_INFO + \item 0x00000002 -- SUPL_SESSION_ID + \item 0x00000004 -- SUPL_HASH + \item 0x00000008 -- SUPL_POS_METHOD + \item 0x00000010 -- SUPL_DATA_CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ID + \item 0x00000040 -- SUPL_CLIENT_NAME + \item 0x00000080 -- SUPL_QOP + \item 0x00000100 -- SUPL_USER_RESP_TIMER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \begin{itemize1} + \item 0x00000001 -- AGPS_SETASSISTED + \item 0x00000002 -- AGPS_SETBASED + \item 0x00000003 -- AGPS_SETASSISTED_PREF + \item 0x00000004 -- AGPS_SETBASED_PREF + \item 0x00000005 -- AUTONOMOUS_GPS + \item 0x00000006 -- AFLT + \item 0x00000007 -- ECID + \item 0x00000008 -- EOTD + \item 0x00000009 -- OTDOA + \item 0x0000000A -- NO_POSITION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds*/ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- INVOKE_ID_MASK + \item 0x0002 -- DATA_CODING_SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_MASK + \item 0x0008 -- CLIENT_ADDRESS_MASK + \item 0x0010 -- LOCATION_TYPE_MASK + \item 0x0020 -- REQUESTOR_ID_MASK + \item 0x0040 -- CODEWORD_STRING_MASK + \item 0x0080 -- SERVICE_TYPE_MASK + \item 0x0100 -- USER_RESP_TIMER_MASK + \vspace{-0.18in} \end{itemize1} + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- CURRENT_LOCATION + \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION + \item 0x00000004 -- INITIAL_LOCATION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ONGOING_NI_INCOMING_MO + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID + and multiple location IDs in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of + multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed + as part of multiple location ID in the SUPL_POS_INIT message. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + triggered session. */ + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; + /**< Specifies which type of network measurements are allowed to be sent as + part of the Location ID or Multiple Location IDs parameter in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- SUPPORTED_NETWORK_WLAN + \item 0x0002 -- SUPPORTED_NETWORK_GSM + \item 0x0004 -- SUPPORTED_NETWORK_WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_CDMA + \item 0x0010 -- SUPPORTED_NETWORK_HRDP + \item 0x0020 -- SUPPORTED_NETWORK_UMB + \item 0x0040 -- SUPPORTED_NETWORK_LTE + \item 0x0080 -- SUPPORTED_NETWORK_WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; + /**< Specifies the type of session trigger requested in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid values: \begin{itemize1} + \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT + \item 0x00000000 -- TRIGGER_TYPE_PERIODIC + \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT + \vspace{-0.18in} \end{itemize1} */ + + qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; + /**< Specifies which GNSS technologies are allowed as positioning + technologies. + + Valid bitmasks: \n + - 0x0001 -- GNSS_GPS \n + - 0x0002 -- GNSS_GLONASS \n + - 0x0004 -- GNSS_GALILEO \n + - 0x0008 -- GNSS_SBAS \n + - 0x0010 -- GNSS_QZSS \n + - 0x0020 -- GNSS_MODERN_GPS + */ +}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< The ESLP URL + Maximum length: 255 bytes */ +}qmiLocEmergencyNotificationStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIFY + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; + /**< \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL + indication payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< This specifies that the corresponding NI notification is an + emergency notification. Emergency notification + can be given even without an ESLP address */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \begin{itemize1} + \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES + \item 0x00000001 -- START_PERIODIC_KEEP_WARM + \item 0x00000002 -- STOP_PERIODIC_FIXES + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \n + + samplesPerBatch must be a nonzero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in an integral number of batches per + second (Hz). \n + + batchesPerSecond must be a nonzero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor + data + \item 0x00 (FALSE) -- GNSS location engine is not ready to accept + sensor data + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyroscope Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor + data. + */ + + /* Optional */ + /* Accelerometer Temperature Accept Ready */ + uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + temperature data. + */ + + /* Optional */ + /* Gyroscope Temperature Accept Ready */ + uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; + /**< \n Whether the GNSS location engine is ready to accept gyroscope + temperature data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream. + \begin{itemize1} + \item 0x01 (TRUE) -- Client is to start sending an SPI status stream + \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. \n + + Valid values: \begin{itemize1} + \item 0x00000000 -- WWAN_TYPE_INTERNET + \item 0x00000001 -- WWAN_TYPE_AGNSS + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the + Geofence to find the its current state. */ + QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiGeofenceOperationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Informs the control point about + network-initiated Geofences. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Operation Type */ + qmiLocNiGeofenceOperationEnumT_v02 operationType; + /**< Operation for which this notification was generated. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_GEOFENCE_ADDED + \item 0x00000002 -- NI_GEOFENCE_DELETED + \item 0x00000003 -- NI_GEOFENCE_EDITED + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can + be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage + information is available. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ + QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceGenAlertEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + Geofence status. */ +typedef struct { + + /* Mandatory */ + /* Geofence General Alert */ + qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; + /**< Specifies the Geofence general alert type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE + \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE + \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS + \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ + QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceBreachTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Elliptical Horizontal Uncertainty Azimuth */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Horizontal Speed validity bit */ + uint8_t speedHorizontal_valid; + /**< Indicates whether the Horizontal speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Horizontal speed is valid + \item 0x00 (FALSE) -- Horizontal speed is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Horizontal Speed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Altitude validity bit */ + uint8_t altitudeWrtEllipsoid_valid; + /**< Indicates whether the altitude field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Altitude field is valid + \item 0x00 (FALSE) -- Altitude field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} + */ + + /* Altitude With Respect to Ellipsoid */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Vertical Uncertainty validity bit */ + uint8_t vertUnc_valid; + /**< Indicates whether the Vertical Uncertainty field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Uncertainty field is valid + \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Uncertainty */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Vertical Speed validity bit */ + uint8_t speedVertical_valid; + /**< Indicates whether the Vertical Speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Speed field is valid + \item 0x00 (FALSE) -- Vertical Speed field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Speed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* heading validity bit */ + uint8_t heading_valid; + /**< Indicates whether the Heading field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Heading field is valid + \item 0x00 (FALSE) -- Heading field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Heading */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ +}qmiLocGeofencePositionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of + a Geofence breach event. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< The type of breach that generated this event. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING + \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Geofence Position */ + uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ + qmiLocGeofencePositionStructT_v02 geofencePosition; + /**< \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ +}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how pedometer reports should be + sent to the location engine */ +typedef struct { + + /* Mandatory */ + /* Request Pedometer Data */ + uint8_t requestPedometerData; + /**< \n Whether GNSS location engine is requesting the client to + send pedometer data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + pedometer data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + pedometer data + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Reset Step Count */ + uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ + uint8_t resetStepCount; + /**< Whether location engine desires the step count to be reset. + \begin{itemize1} + \item 0x01 (TRUE) -- Pedometer step count should be reset. + \item 0x00 (FALSE) -- Pedometer step count should not be reset. + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Step Count Threshold */ + uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ + uint32_t stepCountThreshold; + /**< Specifies the number of steps to be sampled in a pedometer report + as recommended by the the location engine. If the threshold is set to 0 + then the location engine desires a pedometer report at every step event. + */ +}qmiLocEventPedometerControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how motion data reports should be + sent to the location engine */ +typedef struct { + + /* Mandatory */ + /* Request Motion Data */ + uint8_t requestMotionData; + /**< \n Whether GNSS location engine is requesting the client to + send motion data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + motion data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + motion data + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventMotionDataControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ + eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent + memory for the request. */ + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. */ + + /* Optional */ + /* GNSS Measurement Engine Firmware Version String */ + uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ + char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS measurement engine software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in} \end{itemize1} + + \textbf{Note:} This string is only provided on platforms that have + a measurement engine that supports this version string. On all other + platforms, this optional TLV is not provided. */ + + /* Optional */ + /* GNSS Hosted Software Version String */ + uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ + char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS hosted software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in}\end{itemize1} + + \textbf{Note:} This string is only provided on hosted architectures + (measurement and position engine running on different processors) that + support this version string. On all other platforms, this optional TLV + is not provided. */ + + /* Optional */ + /* GNSS Software Version String */ + uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ + char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Aggregate version of the GNSS software. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Units: Milliseconds */ + + /* Optional */ + /* ID of the Application that Sent the Position Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT + \item 0x00000002 -- NOTIFY_VERIFY_DENY + \item 0x00000003 -- NOTIFY_VERIFY_NORESP + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_VERIF + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_RESP + \item 0x00000005 -- PRIVACY_OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; + /**< \n Optional SUPL Version 2 Extension payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< SUPL Emergency notification payload. Emergency notification + can be given even without an ESLP address */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \begin{itemize1} + \item 0x00000000 -- PREDICTED_ORBITS_XTRA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Units: Milliseconds */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ALT_SRC_UNKNOWN + \item 0x00000001 -- ALT_SRC_GPS + \item 0x00000002 -- ALT_SRC_CELL_ID + \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID + \item 0x00000004 -- ALT_SRC_WIFI + \item 0x00000005 -- ALT_SRC_TERRESTRIAL + \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID + \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE + \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER + \item 0x00000009 -- ALT_SRC_OTHER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED + \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT + \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG + \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \begin{itemize1} + \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED + \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid + at the injected horizontal position coordinates + only. + \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to + the position of the device regardless of + horizontal position (within the horizontal + uncertainty region, if provided). + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0 to 99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid. + \begin{itemize1} + \item Units: Meters \begin{itemize1} + \item Positive = height + \item Negative = depth + \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0-99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from which this position was obtained. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS + \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID + \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID + \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI + \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL + \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID + \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER + \end{itemize1} \vspace{0.05in} + + If altitude is specified and the altitude source is not specified, the engine + assumes that the altitude was obtained using the specified position source. \n + If both altitude and altitude source are specified, the engine assumes + that only latitude and longitude were obtained using the specified position + source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ +#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this + message are ignored + \item 0x00 (FALSE) -- The optional fields in the message are to be + used to determine which data is to be deleted + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assistance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_GPS_SVDIR + \item 0x00000002 -- DELETE_GPS_SVSTEER + \item 0x00000004 -- DELETE_GPS_TIME + \item 0x00000008 -- DELETE_GPS_ALM_CORR + \item 0x00000010 -- DELETE_GLO_SVDIR + \item 0x00000020 -- DELETE_GLO_SVSTEER + \item 0x00000040 -- DELETE_GLO_TIME + \item 0x00000080 -- DELETE_GLO_ALM_CORR + \item 0x00000100 -- DELETE_SBAS_SVDIR + \item 0x00000200 -- DELETE_SBAS_SVSTEER + \item 0x00000400 -- DELETE_POSITION + \item 0x00000800 -- DELETE_TIME + \item 0x00001000 -- DELETE_IONO + \item 0x00002000 -- DELETE_UTC + \item 0x00004000 -- DELETE_HEALTH + \item 0x00008000 -- DELETE_SADATA + \item 0x00010000 -- DELETE_RTI + \item 0x00020000 -- DELETE_SV_NO_EXIST + \item 0x00040000 -- DELETE_FREQ_BIAS_EST + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CELLDB_POS + \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_OTA_POS + \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_TIMETAG + \item 0x00000020 -- DELETE_CELLDB_CELLID + \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST + \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST + \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER + \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME + \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER + \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST + \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST + \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER + \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER + \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY + \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ERROR_SUCCESS + \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE + \item 0x00000002 -- ERROR_NO_AP_FOUND + \item 0x00000003 -- ERROR_UNAUTHORIZED + \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE + \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED + \item 0x00000006 -- ERROR_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. + + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \begin{itemize1} + \item 0x00000001 -- WIFI_STATUS_AVAILABLE + \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + Valid bitmasks: \n + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is + set, AFLT will be used for 1x networks and OTDOA will be used + for LTE networks. */ + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + \label{operationMode} + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_STANDALONE + \item 0x00000005 -- OPER_MODE_CELL_ID + \item 0x00000006 -- OPER_MODE_WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary: + \begin{itemize1} + \item 0x00 (FALSE) -- Device is not stationary + \item 0x01 (TRUE) -- Device is stationary + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. Only applies to the accelerometer samples. */ +#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem + time stamp. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified */ + eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and + the location engine */ + QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorDataTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor data sample.\n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message.The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \begin{itemize1} + \item 0x01 -- SIGN_REVERSAL + \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME + \vspace{-0.18in} \end{itemize1} */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor sample.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + float temperature; + /**< Sensor temperature. \n + - Type: Floating point \n + - Units: Degree Celsius \n + - Range: -50 to +100.00 Degree Celsius */ +}qmiLocSensorTemperatureSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Denotes the time source of the sensor data. Location service will use + this field to identify the time reference used in the + sensor data timestamps. Values :\n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message. The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ + qmiLocSensorTemperatureSampleStructT_v02 temperatureData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor temperature samples. \n + - Maximum length of the array: 50 */ +}qmiLocSensorTemperatureSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyroscope Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyroscope sensor samples. */ + + /* Optional */ + /* 3-Axis Accelerometer Data Time Source */ + uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; + /**< Time source for the 3-axis accelerometer data. Location service will use + this field to identify the time reference used in the accelerometer data + timestamps. If not specified the location service will assume that the + time source for the accelereometer data is unknown. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* 3-Axis Gyroscope Data Time Source */ + uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; + /**< Time source for the 3-axis gyroscope data. Location service will use + this field to identify the time reference used in the gyroscope data + timestamps.If not specified the locations ervice will assume that the + time source for the gyroscope data is unknown. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* Accelerometer Temperature Data */ + uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; + /**< Accelerometer temperature samples. This data is optional and does not + have to be included in the message along with accelerometer data. */ + + /* Optional */ + /* Gyroscope Temperature Data */ + uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; + /**< Gyroscope temperature samples. This data is optional and does not + have to be included in the message along with gyroscope data. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< Opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< Lets the client know how many 3-axis accelerometer samples + were accepted. This field is present only if the accelerometer + samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< Lets the client know how many 3-axis gyroscope samples were + accepted. This field is present only if the gyroscope + samples were sent in the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ + uint8_t accelTemperatureSamplesAccepted; + /**< This field lets the client know how many accelerometer temperature + samples were accepted. This field is present only if the accelerometer + temperature samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Temperature Samples Accepted */ + uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ + uint8_t gyroTemperatureSamplesAccepted; + /**< This field lets the client know how many gyroscope temperature samples + were accepted. This field is present only if the gyroscope + temperature samples were sent in the request. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< Value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_MOUNTED + \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the APN profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 101 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n Access Point Name (APN) profile information is present only when + requestType is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocLppConfigMaskT_v02; +#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ +#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ +typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA1 Hash Algorithm for SUPL Version 2.0 or higher */ + eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ + QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplHashAlgoEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS Version 1.0 */ + eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS Version 1.1 */ + QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplTlsVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< use Control plane protocol during emergency while on WCDMA */ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< use SUPL 2.0 emergency services during emergency while on WCDMA */ + QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEmergencyProtocolEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Configures the protocols that the location service supports + for assisted GLONASS. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL Hash Algorithm that needs to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL TLS (Transport Layer Security) Version. This configuration is only + applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + Values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< Configures the protocol to be used during emergency. + Note: Currently only can select on WCDMA. FOR GSM and 1x UE + will always allow only Control plane NI trigger for positioning. + For LTE, UE Can allow either SUPL or Control plane NI trigger. + Values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted glonass configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL Hash algorithm configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< Identifies parameters that were not set successfully. This field + is sent only if the status is not a success. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ONLY + \item 0x00000002 -- VX_VERSION_V2_ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Assisted GLONASS Protocol mask. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL Hash Algorithm that needs to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL TLS (Transport Layer Security) Version. This configuration is only + applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + Values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< The protocol to be used during emergency. + Values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position + improvement. */ + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_DISABLED: + Inertial sensors are not to be used to aid in heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_DISABLED: + Inertial sensors are not to be used to aid in the heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPropertiesMaskT_v02; +#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Set Sensor Properties */ + uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ + qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Sensor Properties Config Parameters */ + qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; + /**< Mask denoting the sensor properties parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; +#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with + GNSS. They can still be used for aiding in heading improvements. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request acceleration data to be used by the low data rate + filter. The sensor data rate is specified in terms of the nominal number + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request gyro data to be used by the high data rate filter. + The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Sets which sensor algorithms are to be used when processing sensor data. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< Identifies parameters that were not configured successfully. This field + is sent only if the status is not a success. + + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- PERFORMANCE_MODE + \item 0x00000002 -- ACCEL_SAMPLING_SPEC + \item 0x00000004 -- GYRO_SAMPLING_SPEC + \item 0x00000008 -- ALGORITHM_CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Informs which sensor algorithms are currently set. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate ID */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate. \n + - Units: Bytes \n + - Range: 0 to 9 */ + + /* Mandatory */ + /* SUPL Certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< SUPL certificate contents. \n + - Type: Array of bytes. \n + - Maximum certificate size: 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate ID */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate to be deleted. \n + - Units: Bytes \n + - Range: 0 to 9 \n + If suplCertId is not specified, + all SUPL certificates are deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the + injected position in a direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position is used in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Use the injected position in a direct position + calculation + \item 0x00 (FALSE) -- Do not use the injected position in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Filter the usage of SVs in the fix + \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data is to be stored in + persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Store assistance data in persistent memory + \item 0x00 (FALSE) -- Do not store assistance data in persistent memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< Identifies the parameters that were not set successfully. + This field is sent only if the status is other than SUCCESS. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies whether the injected position is used for a direct calculation + in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- The injected position is used in a direct + position calculation + \item 0x00 (FALSE) -- The injected position is not used in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- SV usage is filtered in the fix + \item 0x00 (FALSE) -- SV usage is not filtered in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies whether assistance data is stored in persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Assistance data is stored in persistent memory + \item 0x00 (FALSE) -- Assistance data is not stored in persistent + memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocGeofenceBreachMaskT_v02; +#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported + when the Geofence is entered. */ +#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported + when the Geofence is exited. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a + lower rate. The gap between actual breach and + the time it is reported is higher. This + setting results in lower power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a + medium rate. This is the default setting. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a + high rate. The gap between actual breach and + the time it is reported is low. This results + in higher power usage. */ + QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceResponsivenessEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with + low confidence. This setting results in lower + power usage. This setting can impact the "yield" because + incorrect breach events may be sent. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with + medium confidence. This is the default setting. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with + high confidence. This setting results in higher + power usage. */ + QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceConfidenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double latitude; + /**< Latitude of the center of the Geofence.*/ + + double longitude; + /**< Longitude of the center of the Geofence.*/ + + uint32_t radius; + /**< Radius of the circular Geofence in meters. */ +}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ + QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofencePositionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add Circular Geofence + indication. */ + + /* Mandatory */ + /* Circular Geofence Arguments */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Mandatory */ + /* Breach Event Mask */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Mandatory */ + /* Include Position in Breach Event */ + uint8_t includePosition; + /**< Specifies whether the Geofence engine is to include the position + in a breach event. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Position will be reported with the breach event + \item 0x00 (FALSE) -- Position will not be reported with the breach + event + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW + \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED + \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Confidence */ + uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 confidence; + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and + is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW + \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED + \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Add Circular Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add Circular Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_MEMORY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Add Circular + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + The client must include this identifier in all transactions + pertaining to this Geofence. */ +}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be deleted. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete Geofence + indication. */ +}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Delete Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was deleted. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Delete + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ + QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceOriginEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ + QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be queried. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Query Geofence + indication. */ +}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Query Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was queried. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Query + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence Origin */ + uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ + qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; + /**< Originator of the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK + \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Position with Respect to Geofence */ + uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ + qmiLocGeofencePositionEnumT_v02 posWrtGeofence; + /**< Indicates if the client is currently inside or outside + the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_POSITION_INSIDE + \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Circular Geofence Parameters */ + uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ +}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence to be edited. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Edit Geofence + request. This parameter will always be present if the + status field is set to SUCCESS. + */ + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Breach Event Mask */ + uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; +#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ +#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Edit Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Edit Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was edited. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is specified in the Edit Geofence request. */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ + qmiLocGeofenceConfigParamMaskT_v02 failedParams; + /**< Specified only when the status is not set to SUCCESS. If + the mask corresponding to a field is set, it indicates that + the Geofence parameter could not be edited. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Best Available Position indication. */ +}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Best Available Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Best Available Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get Best + Available Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ + float horSpeed; + /**< Horizontal speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Horizontal Speed Uncertainty */ + uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ + float horSpeedUnc; + /**< Horizontal speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_SET + \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ + float vertSpeed; + /**< Vertical speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Vertical Speed Uncertainty */ + uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ + float vertSpeedUnc; + /**< Vertical speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading. \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty. \n + - Type: Floating point \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used Mask */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_LOCATION + \item 0x00000020 -- INJECTED_COARSE_POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state + */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ + QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ + QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocMotionStateEnumT_v02 motion_state; + /**< Current motion state of the user. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.06in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute + rest by reducing probability_of_state. + */ + + qmiLocMotionModeEnumT_v02 motion_mode; + /**< Modes of user motion. \n + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement + is in Pedestrian mode; nothing else is known about the movement. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement + is in Pedestrian Walking mode. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement + is in Pedestrian Running mode. + \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is + in Vehicular mode; nothing else is known about the movement. + \vspace{0.06in} \end{itemize1} + + The motion_mode value is independent of the motion_state value. + */ + + float probability_of_state; + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.06in} + + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.06in} + + It is recommended that if a particular combination of motion_state and + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} + + If the motion_state is not known, the value in this field is not used. + */ + + uint16_t age; + /**< Age of the motion data in milliseconds at the time of injection. + */ + + uint16_t timeout; + /**< If the age of the motion data input exceeds the timeout value, the data + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is + received. \vspace{0.06in} + + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} + + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. + */ +}qmiLocMotionDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Motion Data */ + qmiLocMotionDataStructT_v02 motion_data; + /**< Current motion data of the client */ +}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Inject Motion Data Request Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Motion Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The same transaction ID + will be returned in the Get NI Geofence ID List indication. */ +}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Get NI Geofence ID List status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NI Geofence ID List request. + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get NI + Geofence ID List request. */ + + /* Optional */ + /* NI Geofence ID List */ + uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ + uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ + uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; + /**< List containing the NI Geofence IDs. + - Type: Array of unsigned 32-bit integers \n + - Maximum NI Geofence ID List length: 16 */ +}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t MCC; + /**< GSM mobile country code. Refer to ITU-T E.212 specification */ + + uint32_t MNC; + /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ + + uint32_t LAC; + /**< GSM location area code.Refer to ITU-T E.212 specification */ + + uint32_t CID; + /**< GSM cell identification.Refer to ITU-T E.212 specification */ +}qmiLocGSMCellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* GSM Cell ID */ + qmiLocGSMCellIdStructT_v02 gsmCellId; + /**< Identifies the GSM Cell the device is currently camped on.*/ + + /* Mandatory */ + /* Roaming Status */ + uint8_t roamingStatus; + /**< Whether the device is roaming. + \begin{itemize1} + \item 0x01 (TRUE) -- The device is roaming. + \item 0x00 (FALSE) -- The device is not roaming. + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject GSM Cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject GSM Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject GSM Cell Info request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ +}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Injected Network Initiated Message Type */ + qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; + /**< Type of the network initiated message being injected + Valid Values: + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ + + /* Mandatory */ + /* Injected Network Initiated Message */ + uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ + uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; + /**< Network initiated message body. + If the inject NI message type is TYPE_SUPL, the message contains + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ +}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to inject a network initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Network Initiated Message Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Network Initiated Message request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + - 0x00000008 -- INSUFFICIENT_MEMORY \n */ +}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * typedef struct { + * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to notify the location engine that the device is + no longer camped. */ +typedef struct { + + /* Mandatory */ + /* Notify WWAN Out of Service Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WWAN out of service request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT \n + */ +}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Time Source */ + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Time source for the pedometer. Location service will use + this field to identify the time reference used in the + pedometer data timestamp. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine*/ + + /* Mandatory */ + /* Pedometer report timestamp */ + uint32_t timestamp; + /**< Timestamp of the last step event in this report, i.e timestamp + of the step event that caused this report to be generated. + The timestamp is in the time reference scale that is + used by the pedometer time source. \n + - Unit: Milliseconds */ + + /* Mandatory */ + /* Time Interval */ + uint32_t timeInterval; + /**< Time interval during which the step count was calculated. Subtracting + timeInterval from the timestamp field will yield the the time when + the step detection for the first step in this report started. + Unit : Milliseconds. */ + + /* Mandatory */ + /* Step Count */ + uint32_t stepCount; + /**< Number for steps counted during the time interval.*/ + + /* Optional */ + /* Step Confidence */ + uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ + uint8_t stepConfidence; + /**< Confidence associated with the step. This field is only applicable + for a single step report, i.e if the stepCount is one. + Range: 0 to 100. + Note: The report will be ignored if confidence is 0. */ + + /* Optional */ + /* Step Count Uncertainty */ + uint8_t stepCountUncertainty_valid; /**< Must be set to true if stepCountUncertainty is being passed */ + float stepCountUncertainty; + /**< Uncertainty (in steps) associated with the step count. */ + + /* Optional */ + /* Step Rate */ + uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ + float stepRate; + /**< Current estimate for the rate of steps per second. + Units: steps/second + Range: >= 0.0 + */ +}qmiLocPedometerReportReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Status of Pedometer report request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the pedometer report request + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocPedometerReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 +#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 +#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 +#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 +#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 +#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 +#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 +#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C +#define QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 0x006D +#define QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02 0x006E +#define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + From e4f800932f55a36e792ec3cbb6420556919c061e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 31 Oct 2012 16:56:19 -0700 Subject: [PATCH 073/945] Add NULL checks for callbacks As a security measure, callbacks are checked to make sure they are not NULL pointers. Change-Id: I391e1cc373e8098449303709d8d1b67d305fb633 CRs-Fixed: 404438 --- loc_api/libloc_api_50001/loc.cpp | 7 +++- loc_api/libloc_api_50001/loc_eng.cpp | 44 +++++++++++++++-------- loc_api/libloc_api_50001/loc_eng_ni.cpp | 4 ++- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 15 +++++--- 4 files changed, 49 insertions(+), 21 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 8ac78625..8100a718 100755 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -317,7 +317,13 @@ SIDE EFFECTS ===========================================================================*/ static int loc_init(GpsCallbacks* callbacks) { + int retVal = -1; ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE("loc_init failed. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | LOC_API_ADAPTER_BIT_SATELLITE_REPORT | @@ -341,7 +347,6 @@ static int loc_init(GpsCallbacks* callbacks) gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; - int retVal = -1; if (loc_eng_ulp_inf == NULL) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 300fb21f..1b55f288 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -272,11 +272,13 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, void (*loc_external_msg_sender) (void*, void*)) { + int ret_val =-1; + ENTRY_LOG_CALLFLOW(); if (NULL == callbacks || 0 == event) { LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); - EXIT_LOG(%d, 0); - return NULL; + EXIT_LOG(%d, ret_val); + return ret_val; } STATE_CHECK((NULL == loc_eng_data.context), @@ -321,7 +323,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, callbacks->location_ext_parser, callbacks->sv_ext_parser); loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); - int ret_val =-1; if (NULL == loc_eng_data.client_handle) { // drop the context and declare failure ((LocEngContext*)(loc_eng_data.context))->drop(); @@ -852,6 +853,11 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac 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; + } loc_eng_data.agps_status_cb = callbacks->status_cb; loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, @@ -1875,15 +1881,15 @@ int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc { ENTRY_LOG(); int ret_val=-1; - - if(loc_eng_ulpInf != NULL) + if((loc_eng_ulpInf != NULL) && (((ulpInterface *)loc_eng_ulpInf)->init != NULL)) { // Initialize the ULP interface ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); loc_eng_data.ulp_initialized = TRUE; + ret_val = 0; } - ret_val = 0; -exit: + else + LOC_LOGE("ulp not initialized. NULL parameter"); EXIT_LOG(%d, ret_val); return ret_val; } @@ -2037,9 +2043,14 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data,UlpPhoneContextCallbacks *callback) { + int ret_val = -1; ENTRY_LOG(); - loc_eng_data.ulp_phone_context_req_cb = callback->ulp_request_phone_context_cb ; - int ret_val =0; + if(callback != NULL) { + loc_eng_data.ulp_phone_context_req_cb = callback->ulp_request_phone_context_cb ; + ret_val = 0; + } + else + LOC_LOGE("loc_eng_ulp_phone_context_init: bad parameters cb %p", callback); EXIT_LOG(%d, ret_val); return ret_val; } @@ -2063,11 +2074,16 @@ SIDE EFFECTS int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, UlpNetworkLocationCallbacks *callbacks) { - ENTRY_LOG_CALLFLOW(); - loc_eng_data.ulp_network_callback = callbacks->ulp_network_location_request_cb; - int ret_val =0; - EXIT_LOG(%d, ret_val); - return ret_val; + int ret_val = -1; + ENTRY_LOG_CALLFLOW(); + if(callbacks != NULL) { + loc_eng_data.ulp_network_callback = callbacks->ulp_network_location_request_cb; + ret_val = 0; + } + else + LOC_LOGE("loc_eng_ulp_network_init: bad parameters cb %p", callbacks); + EXIT_LOG(%d, ret_val); + return ret_val; } diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index c2d78af8..06a52a57 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -249,7 +249,9 @@ void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiCallbacks *callback { ENTRY_LOG_CALLFLOW(); - if (NULL == callbacks->notify_cb) { + 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."); diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index ebc7c6fb..01b805e7 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -54,12 +54,17 @@ SIDE EFFECTS int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, GpsXtraCallbacks* callbacks) { - loc_eng_xtra_data_s_type *xtra_module_data_ptr; + int ret_val = -1; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; - xtra_module_data_ptr = &loc_eng_data.xtra_module_data; - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - - return 0; + 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; + ret_val = 0; + } + return ret_val; } /*=========================================================================== From 9fd717a6ae77ebdfa86c51ad156e8dda84c5042b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 24 Oct 2012 14:01:13 -0700 Subject: [PATCH 074/945] gps: do not lock mutex during loc_ioctl Locking the slot mutext during a loc_ioctl call can cause deadlock in some rare cases. Change-Id: I09aa2ad7c67c326fee90447db960895d7f1fb149 CRs-fixed: 412208 --- .../src/loc_api_sync_call.c | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c index c488ff5d..09ae49b5 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -259,8 +259,6 @@ static int loc_lock_a_slot() if (!slot->in_use && !slot->not_available) { select_id = i; - slot->in_use = 1; - slot->signal_sent = 0; /* Return from here and leave the mutex locked. * will unlock it in loc_unlock_slot() */ @@ -278,7 +276,7 @@ static int loc_lock_a_slot() FUNCTION loc_unlock_slot DESCRIPTION - Frees a buffer slot after the synchronous API call + Unlocks a buffer slot DEPENDENCIES N/A @@ -292,13 +290,58 @@ SIDE EFFECTS ===========================================================================*/ static void loc_unlock_slot(int select_id) { - loc_sync_data.slots[select_id].in_use = 0; - 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 @@ -399,7 +442,7 @@ static int loc_api_wait_callback( ) { int ret_val = RPC_LOC_API_SUCCESS; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ + int rc = 0; /* return code from pthread calls */ struct timespec expire_time; @@ -467,11 +510,20 @@ int loc_api_sync_ioctl 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", @@ -502,6 +554,7 @@ int loc_api_sync_ioctl } /* 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; From 63c5ac48c7d0b9245abd1a5e3ab45c3f331655d5 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 8 Nov 2012 11:41:43 -0800 Subject: [PATCH 075/945] Utility to identify target HW Earlier this identification was done in loc.cpp This change moves that to a separate utility. Also included is a change to not return a handle to the GPS interface if the target is found to be MPQ8064. CRs-Fixed: 418009 Change-Id: I98d5619d2e6e63711a9b56f0af2b3ddd27372871 --- loc_api/libloc_api_50001/loc.cpp | 81 +++++------------------ utils/Android.mk | 6 +- utils/loc_log.cpp | 30 ++++++++- utils/loc_log.h | 2 + utils/loc_target.cpp | 109 +++++++++++++++++++++++++++++++ utils/loc_target.h | 51 +++++++++++++++ 6 files changed, 210 insertions(+), 69 deletions(-) create mode 100644 utils/loc_target.cpp create mode 100644 utils/loc_target.h diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 8100a718..add8aab8 100755 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -32,10 +32,10 @@ #include #include +#include #include #include #include - #include #include #include @@ -167,65 +167,6 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = static loc_eng_data_s_type loc_afw_data; static int gss_fd = 0; -#define TARGET_NAME_OTHER 0 -#define TARGET_NAME_APQ8064_STANDALONE 1 -#define TARGET_NAME_APQ8064_FUSION3 2 - -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; -} - -#define LINE_LEN 100 -#define STR_LIQUID "Liquid" -#define STR_SURF "Surf" -#define STRLEN_LIQUID (sizeof(STR_LIQUID) - 1) -#define STRLEN_SURF (sizeof(STR_SURF) - 1) -#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') - -static int get_target_name(void) -{ - int target_name = TARGET_NAME_OTHER; - - char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; // "Liquid" or "Surf" - char id[] = "/sys/devices/system/soc/soc0/id"; //109 - char mdm[] = "/dev/mdm"; // No such file or directory - - char line[LINE_LEN]; - - read_a_line( hw_platform, line, LINE_LEN); - if(( !memcmp(line, STR_LIQUID, STRLEN_LIQUID) && IS_STR_END(line[STRLEN_LIQUID]) ) || - ( !memcmp(line, STR_SURF, STRLEN_SURF) && IS_STR_END(line[STRLEN_SURF]) ) - ) { - if (!read_a_line( mdm, line, LINE_LEN)) { - target_name = TARGET_NAME_APQ8064_FUSION3; - } else { - read_a_line( id, line, LINE_LEN); - if(!strncmp(line, "109", strlen("109")) || !strncmp(line, "153", strlen("153"))) { - target_name = TARGET_NAME_APQ8064_STANDALONE; - } - } - } - return target_name; -} - /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -267,22 +208,30 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { + targetEnumType target = TARGET_OTHER; loc_eng_read_config(); //We load up libulp module at this point itself if ULP configured to be On if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { loc_eng_ulp_inf = loc_eng_get_ulp_inf(); } - if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) - { + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + //APQ8064 + if(target == TARGET_APQ8064_STANDALONE) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); - if (gss_fd < 0) { + 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); } - LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); } - + //MPQ8064 + else if(target == TARGET_MPQ8064) { + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; + } return &sLocEngInterface; } @@ -383,7 +332,7 @@ static void loc_cleanup() gps_sv_cb = NULL; /* - * if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) + * if (get_target() == TARGET_NAME_APQ8064_STANDALONE) * { * close(gss_fd); * LOC_LOGD("GSS shutdown.\n"); diff --git a/utils/Android.mk b/utils/Android.mk index 4bf04014..7dc1799e 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -15,7 +15,8 @@ LOCAL_SRC_FILES += \ loc_log.cpp \ loc_cfg.cpp \ msg_q.c \ - linked_list.c + linked_list.c \ + loc_target.cpp LOCAL_CFLAGS += \ -fno-short-enums \ @@ -32,7 +33,8 @@ LOCAL_COPY_HEADERS:= \ loc_cfg.h \ log_util.h \ linked_list.h \ - msg_q.h + msg_q.h \ + loc_target.h LOCAL_MODULE := libgps.utils diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index e4fb76c4..1b4ecee0 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -34,7 +34,6 @@ #include #include "loc_log.h" #include "msg_q.h" - #include "log_util.h" // Logging Improvements @@ -100,6 +99,35 @@ const char* log_succ_fail_string(int is_succ) return is_succ? "successful" : "failed"; } +//Target names +loc_name_val_s_type target_name[] = +{ + NAME_VAL(TARGET_OTHER), + NAME_VAL(TARGET_APQ8064_STANDALONE), + NAME_VAL(TARGET_APQ8064_FUSION3), + NAME_VAL(TARGET_MPQ8064), + NAME_VAL(TARGET_MSM8930) +}; + +static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); + +/*=========================================================================== + +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(targetEnumType target) +{ + return loc_get_name_from_val(target_name, target_name_num, (long)target); +} /*=========================================================================== diff --git a/utils/loc_log.h b/utils/loc_log.h index 8b071a48..cb8e1d5b 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -36,6 +36,7 @@ extern "C" #endif #include +#include "loc_target.h" typedef struct { @@ -54,6 +55,7 @@ typedef struct const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); const char* loc_get_msg_q_status(int status); +const char* loc_get_target_name(targetEnumType target); extern const char* log_succ_fail_string(int is_succ); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp new file mode 100644 index 00000000..06b2a377 --- /dev/null +++ b/utils/loc_target.cpp @@ -0,0 +1,109 @@ +/* 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 Code Aurora Forum, Inc. 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_target.h" +#include "loc_log.h" +#include "log_util.h" + +#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 LINE_LEN 100 +#define STR_LIQUID "Liquid" +#define STR_SURF "Surf" +#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 + +static int gss_fd = 0; + +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; +} + +targetEnumType get_target(void) +{ + targetEnumType target = TARGET_OTHER; + + char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; + char id[] = "/sys/devices/system/soc/soc0/id"; + 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]; + + read_a_line(hw_platform, rd_hw_platform, LINE_LEN); + read_a_line( id, rd_id, LINE_LEN); + + 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)])) ) { + if (!read_a_line( mdm, rd_mdm, LINE_LEN)) + target = TARGET_APQ8064_FUSION3; + else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || + (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) + target = TARGET_APQ8064_STANDALONE; + } + else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) + target = TARGET_MPQ8064; + 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)])) ) + target = TARGET_MSM8930; + return target; +} diff --git a/utils/loc_target.h b/utils/loc_target.h new file mode 100644 index 00000000..1e633902 --- /dev/null +++ b/utils/loc_target.h @@ -0,0 +1,51 @@ +/* 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 Code Aurora Forum, Inc. 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 + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef enum { + TARGET_OTHER = 0, + TARGET_APQ8064_STANDALONE, + TARGET_APQ8064_FUSION3, + TARGET_MPQ8064, + TARGET_MSM8930 +}targetEnumType; + +targetEnumType get_target(void); + +#ifdef __cplusplus +} +#endif + +#endif /*LOC_TARGET_H*/ From 8e9cb2338608a56bf678a9c75bc7d7edd92807c3 Mon Sep 17 00:00:00 2001 From: Neethu Joseph Date: Thu, 15 Nov 2012 12:06:07 -0800 Subject: [PATCH 076/945] Loc_Api: Support A-GLONASS Position protocol Support to read A-GLONASS Prosition protocol from gps.conf Change-Id: If91d6754aaee73c1360728793f4cc2ef1f015fe7 CRs-fixed: 378515 --- loc_api/libloc_api_50001/LocApiAdapter.h | 3 ++ loc_api/libloc_api_50001/loc_eng.cpp | 16 ++++++++++ loc_api/libloc_api_50001/loc_eng.h | 1 + loc_api/libloc_api_50001/loc_eng_log.cpp | 3 +- loc_api/libloc_api_50001/loc_eng_msg.h | 10 ++++++ loc_api/libloc_api_50001/loc_eng_msg_id.h | 3 ++ loc_api/loc_api_v02/LocApiV02Adapter.cpp | 39 +++++++++++++++++++++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 1 + 8 files changed, 75 insertions(+), 1 deletion(-) mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng.h mode change 100644 => 100755 loc_api/libloc_api_50001/loc_eng_log.cpp mode change 100644 => 100755 loc_api/loc_api_v02/LocApiV02Adapter.h diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index ec53805e..a876b0aa 100755 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -216,6 +216,9 @@ public: inline virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol) + {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline const LocPosMode& getPositionMode() const {return fixCriteria;} diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1b55f288..da464af0 100755 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -105,6 +105,7 @@ static loc_param_s_type loc_parameter_table[] = {"SENSOR_ALGORITHM_CONFIG_MASK", &gps_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, }; static void loc_default_parameters(void) @@ -145,6 +146,9 @@ static void loc_default_parameters(void) /* 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; } LocEngContext::LocEngContext(gps_create_thread threadCreator) : @@ -367,6 +371,11 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_control_config_msg, loc_eng_free_msg); + loc_eng_msg_a_glonass_protocol *a_glonass_protocol_msg(new loc_eng_msg_a_glonass_protocol(&loc_eng_data, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + a_glonass_protocol_msg, loc_eng_free_msg); + /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ if( gps_conf.GYRO_BIAS_RANDOM_WALK_VALID || gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || @@ -1430,6 +1439,13 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_A_GLONASS_PROTOCOL: + { + loc_eng_msg_a_glonass_protocol *svMsg = (loc_eng_msg_a_glonass_protocol*)msg; + loc_eng_data_p->client_handle->setAGLONASSProtocol(svMsg->a_glonass_protocol); + } + break; + case LOC_ENG_MSG_SUPL_VERSION: { loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h old mode 100644 new mode 100755 index 646d1716..16ab1d7e --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -180,6 +180,7 @@ typedef struct loc_gps_cfg_s unsigned long QUIPC_ENABLED; unsigned long LPP_PROFILE; unsigned long SENSOR_ALGORITHM_CONFIG_MASK; + unsigned long A_GLONASS_POS_PROTOCOL_SELECT; uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID; double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY; uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID; diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp old mode 100644 new mode 100755 index 843f558f..e324ca72 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -104,7 +104,8 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( ULP_MSG_INJECT_NETWORK_POSITION ), NAME_VAL( ULP_MSG_REPORT_QUIPC_POSITION ), NAME_VAL( ULP_MSG_REQUEST_COARSE_POSITION ), - NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ) + NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), + NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 9c5c03bd..62bc3543 100755 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -158,6 +158,16 @@ struct loc_eng_msg { } }; +struct loc_eng_msg_a_glonass_protocol : public loc_eng_msg { + const unsigned long a_glonass_protocol; + inline loc_eng_msg_a_glonass_protocol(void* instance, unsigned long protocol) : + loc_eng_msg(instance, LOC_ENG_MSG_A_GLONASS_PROTOCOL), + a_glonass_protocol(protocol) + { + LOC_LOGV("A-GLONASS protocol: 0x%lx", protocol); + } +}; + struct loc_eng_msg_suple_version : public loc_eng_msg { const int supl_version; inline loc_eng_msg_suple_version(void* instance, int version) : diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index 0761b89d..17064699 100755 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -128,6 +128,9 @@ enum loc_eng_msg_ids_t { // Message is sent by Android framework (GpsLocationProvider) // to inject the raw command ULP_MSG_INJECT_RAW_COMMAND, + + /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ + LOC_ENG_MSG_A_GLONASS_PROTOCOL, }; #ifdef __cplusplus diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 4c7b7124..4203ffb8 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1441,6 +1441,45 @@ enum loc_api_adapter_err LocApiV02Adapter :: setExtPowerConfig(int isBatteryChar return LOC_API_ADAPTER_ERR_SUCCESS; } +/* set the Positioning Protocol on A-GLONASS system */ +enum loc_api_adapter_err LocApiV02Adapter :: setAGLONASSProtocol(unsigned long aGlonassProtocol) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind; + + memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req)); + memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind)); + + aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1; + aGlonassProtocol_req.assistedGlonassProtocolMask = aGlonassProtocol; + + req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req; + + LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%lx\n", __func__, __LINE__, + aGlonassProtocol_req.assistedGlonassProtocolMask); + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &aGlonassProtocol_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + return LOC_API_ADAPTER_ERR_SUCCESS; +} + + /* Convert event mask from loc eng to loc_api_v02 format */ locClientEventMaskType LocApiV02Adapter :: convertMask( LOC_API_ADAPTER_EVENT_MASK_T mask) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h old mode 100644 new mode 100755 index 60c2a5ce..e6441db9 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -161,6 +161,7 @@ public: int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig); virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging); + virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); }; #endif //LOC_API_V_0_2_ADAPTER_H From e065604f303d2e0a7cac3e97572a70d04cc21657 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 21 Sep 2012 16:56:18 -0700 Subject: [PATCH 077/945] OTDOA support (must have CR 370306 as dependency) CRs-Fixed: 402746 Change-Id: I505becab45f643b352e8ff3aeb242b15b623cb7b --- .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 1 + loc_api/libloc_api_50001/loc.h | 3 ++- loc_api/libloc_api_50001/loc_eng_log.cpp | 3 ++- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index a20820e8..5108780e 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -332,6 +332,7 @@ LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) 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; diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index b823e476..b1eee671 100755 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -54,7 +54,8 @@ typedef enum loc_position_mode_type { LOC_POSITION_MODE_RESERVED_1, LOC_POSITION_MODE_RESERVED_2, LOC_POSITION_MODE_RESERVED_3, - LOC_POSITION_MODE_RESERVED_4 + LOC_POSITION_MODE_RESERVED_4, + LOC_POSITION_MODE_RESERVED_5 } LocPositionMode; typedef void (*loc_location_cb_ext) (GpsLocation* location, void* locExt); diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 843f558f..53548228 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -124,7 +124,8 @@ static loc_name_val_s_type loc_eng_position_modes[] = 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_4 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_5 ) }; static int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type); diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 4c7b7124..046ef3b1 100755 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -250,6 +250,10 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; break; + case LOC_POSITION_MODE_RESERVED_5: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_WWAN_V02; + break; + default: set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; break; From b86c1f8a06455079b36ee76750045ecbcecd8972 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 30 Nov 2012 17:45:05 -0800 Subject: [PATCH 078/945] gps: enable features IPV6 and DELEXT This change requires android framework changes Change-Id: I6c019ed7f852f7de53966e51a28c447540bdfb0a --- loc_api/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 6354828b..9f3703fc 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -4,8 +4,8 @@ LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := -FEATURE_IPV6 := false -FEATURE_DELEXT := false +FEATURE_IPV6 := true +FEATURE_DELEXT := true FEATURE_ULP := false # add RPC dirs if RPC is available From 2a148d254689f4c29b8fb9d54990d6881840c664 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 10 Dec 2012 18:25:55 -0800 Subject: [PATCH 079/945] fix loc_api_v02 missing library The check for qmi framework now uses a define flag which exists on all but aosp builds. Change-Id: Id669f62ccb39b5b3c410e7769350cfba5bf38159 --- loc_api/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 9f3703fc..08e46129 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -17,7 +17,7 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC -ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) +ifeq ($(BOARD_USES_QCOM_HARDWARE), true) #add QMI libraries for QMI targets QMI_BOARD_PLATFORM_LIST := msm8960 QMI_BOARD_PLATFORM_LIST += msm8974 From a987332d2968c1f321b9465609dd998e092f76e7 Mon Sep 17 00:00:00 2001 From: Duy Truong Date: Thu, 10 Jan 2013 08:07:21 -0800 Subject: [PATCH 080/945] Update copyright to The Linux Foundation Change-Id: I727bdeb29904eebf15b7ef8eb0070d69107537a8 --- .../libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h | 4 ++-- .../libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h | 4 ++-- .../libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h | 4 ++-- .../libloc_api-rpc-glue/rpc_inc/loc_api_log.h | 4 ++-- .../libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h | 4 ++-- .../libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h | 4 ++-- .../libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h | 4 ++-- .../libloc_api-rpc-glue/src/loc_api_fixup.c | 4 ++-- .../libloc_api-rpc-glue/src/loc_api_log.c | 4 ++-- .../libloc_api-rpc-glue/src/loc_apicb_appinit.c | 4 ++-- .../libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h | 4 ++-- .../libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h | 4 ++-- .../libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h | 4 ++-- .../libloc_api-rpc-stub/inc/loc_apicb_appinit.h | 4 ++-- .../libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c | 4 ++-- .../libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c | 4 ++-- .../libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c | 4 ++-- .../libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c | 4 ++-- .../libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c | 4 ++-- .../libloc_api-rpc-stub/src/loc_apicb_appinit.c | 4 ++-- loc_api/libloc_api/gps.c | 4 ++-- loc_api/libloc_api/loc_eng.cpp | 4 ++-- loc_api/libloc_api/loc_eng.h | 4 ++-- loc_api/libloc_api/loc_eng_ioctl.cpp | 4 ++-- loc_api/libloc_api/loc_eng_ioctl.h | 4 ++-- loc_api/libloc_api/loc_eng_ni.cpp | 4 ++-- loc_api/libloc_api/loc_eng_ni.h | 4 ++-- loc_api/libloc_api/loc_eng_xtra.cpp | 4 ++-- loc_api/libloc_api/loc_eng_xtra.h | 4 ++-- loc_api/libloc_api_50001/gps.c | 4 ++-- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c | 4 ++-- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h | 4 ++-- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h | 4 ++-- loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c | 4 ++-- loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h | 4 ++-- loc_api/libloc_api_50001/loc_eng_msg.cpp | 4 ++-- loc_api/libloc_api_50001/loc_eng_ni.h | 4 ++-- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 2 +- loc_api/libloc_api_50001/loc_eng_xtra.h | 4 ++-- loc_api/loc_api_v02/loc_api_sync_req.h | 4 ++-- loc_api/loc_api_v02/loc_api_v02_log.h | 4 ++-- utils/linked_list.c | 4 ++-- utils/linked_list.h | 4 ++-- utils/log_util.h | 4 ++-- utils/msg_q.h | 4 ++-- 46 files changed, 90 insertions(+), 90 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h index 0ba77c4b..bdb28be4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h index 3f00b654..49a6d0be 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h index 9bfe5f0c..c483b4a1 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h index c0bcda16..f0374280 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h index 16552a0c..010e1478 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h index 266f8ec8..43208bda 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h index 8dbcb9ac..ba41d08b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c index 32e3cda8..837ef113 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c index 6aa5254f..256545ad 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c index b257fb81..db5b291a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h index 47478e80..87f2c377 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h index 507103ce..8107de2a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h index f11bb654..6138432e 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h index e109852c..875c4f08 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c index b0443487..2ef5852e 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c index 7f519281..ad171dc4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c index d2152ab4..3e39576b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c index da066b42..21be8f43 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c index e8a2aa78..a0fdcabe 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c index b4aeb5e7..b469eb0a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c index 5f6d8095..36bfcb63 100644 --- a/loc_api/libloc_api/gps.c +++ b/loc_api/libloc_api/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 68ac002c..98fef66f 100644 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 553a97e0..b8553316 100644 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index a43d8cca..dc7b2c11 100644 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h index eb0c201a..b8191256 100644 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 3df0af14..11d7abac 100644 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index 193b9f85..cfd2ab18 100644 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index 1ec3bf07..0c3e476a 100644 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h index 82778ae5..a72b1528 100644 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index c9e4999b..82bc7420 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c index 9cd19228..6b97a238 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h index 8bc6f2a3..d685c87e 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h index 3136e411..b2fa3a03 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c index 478b686f..67e31879 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h index 07869f90..89e598b5 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp index 97c0457c..a296dce3 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.cpp +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 9b1c5f34..9cbc57dc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index a0a3f202..d2507a52 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 5da7d5dd..29ca6c5e 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h index 7e01e146..614348de 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h index 8c7f7f19..4bd2b462 100644 --- a/loc_api/loc_api_v02/loc_api_sync_req.h +++ b/loc_api/loc_api_v02/loc_api_sync_req.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h index c63972f9..8d4670c3 100644 --- a/loc_api/loc_api_v02/loc_api_v02_log.h +++ b/loc_api/loc_api_v02/loc_api_v02_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/linked_list.c b/utils/linked_list.c index 16f2aa22..31ec52d2 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/linked_list.h b/utils/linked_list.h index cfc945a7..a85f09a3 100644 --- a/utils/linked_list.h +++ b/utils/linked_list.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/log_util.h b/utils/log_util.h index 15d0b892..9187e4f0 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/msg_q.h b/utils/msg_q.h index 4171540a..d3d5cc5d 100644 --- a/utils/msg_q.h +++ b/utils/msg_q.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * From 660f21b54057678a04749811727ac00db3ba4790 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 14 Dec 2012 19:55:45 -0800 Subject: [PATCH 081/945] loc api v02 update newer version to support dsds and RAT based cell info injections Change-Id: I490a928db7af37a266edbad1acba6e1f9f8aa186 --- loc_api/loc_api_v02/loc_api_v02_client.c | 32 +- loc_api/loc_api_v02/loc_api_v02_client.h | 8 + loc_api/loc_api_v02/loc_api_v02_log.c | 11 +- loc_api/loc_api_v02/location_service_v02.c | 773 ++++--- loc_api/loc_api_v02/location_service_v02.h | 2158 +++++++++++--------- 5 files changed, 1698 insertions(+), 1284 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index e15cc003..882c5276 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -406,7 +406,16 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { //Pedomete Report { QMI_LOC_PEDOMETER_REPORT_IND_V02, - sizeof(qmiLocPedometerReportIndMsgT_v02)} + sizeof(qmiLocPedometerReportIndMsgT_v02)}, + + { QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, + sizeof(qmiLocInjectSubscriberIDIndMsgT_v02)} }; @@ -1056,6 +1065,9 @@ static bool locClientHandleIndication( case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: + case QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: { status = true; break; @@ -1599,6 +1611,24 @@ static bool validateRequest( break; } + case QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: + { + *pOutLen = sizeof(qmiLocInjectSubscriberIDReqMsgT_v02); + break; + } + // ALL requests with no payload case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: diff --git a/loc_api/loc_api_v02/loc_api_v02_client.h b/loc_api/loc_api_v02/loc_api_v02_client.h index 52a506ef..61816155 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.h +++ b/loc_api/loc_api_v02/loc_api_v02_client.h @@ -610,6 +610,10 @@ typedef union To send this request, set the reqId field in locClientSendReq() to QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ + const qmiLocInjectWCDMACellInfoReqMsgT_v02 *pInjectWCDMACellInfoReq; + const qmiLocInjectTDSCDMACellInfoReqMsgT_v02 *pInjectTDSCDMACellInfoReq; + const qmiLocInjectSubscriberIDReqMsgT_v02 *pInjectSubscriberIDReq; + }locClientReqUnionType; @@ -1152,6 +1156,10 @@ typedef union The respIndId field in the response indication callback is set to QMI_LOC_PEDOMETER_REPORT_IND_V02. */ + const qmiLocInjectWCDMACellInfoIndMsgT_v02 *pInjectWCDMACellInfoInd; + const qmiLocInjectTDSCDMACellInfoIndMsgT_v02 *pInjectTDSCDMACellInfoInd; + const qmiLocInjectSubscriberIDIndMsgT_v02 *pInjectSubscriberIDInd; + }locClientRespIndUnionType; /** @} */ /* end_addtogroup data_types */ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c index 048be07b..769222b8 100644 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -228,7 +228,16 @@ static loc_name_val_s_type loc_v02_event_name[] = NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02) + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02) }; static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c index eb60618d..c7ebd6db 100644 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -26,12 +26,13 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 5.6 - It was generated on: Fri Oct 26 2012 +/* This file was generated with Tool version 6.0 + It requires encode/decode library version 5 or later + It was generated on: Thu Dec 13 2012 (Spin ) From IDL File: location_service_v02.idl */ #include "stdint.h" @@ -332,6 +333,14 @@ static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), @@ -348,7 +357,7 @@ static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), QMI_LOC_MAX_NTP_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 16, 0, + 17, 0, QMI_IDL_FLAG_END_VALUE }; @@ -367,7 +376,7 @@ static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 16, 0, + 17, 0, QMI_IDL_FLAG_END_VALUE }; @@ -387,7 +396,7 @@ static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 20, 0, + 21, 0, QMI_IDL_FLAG_END_VALUE }; @@ -549,7 +558,32 @@ static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 29, 0, + 30, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), + 32, 0, QMI_IDL_FLAG_END_VALUE }; @@ -612,36 +646,32 @@ static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; -static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, +static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, cid), QMI_IDL_FLAG_END_VALUE }; -static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), +static const uint8_t qmiLocTDSCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mcc), QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mnc), QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, cid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, lac), - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), - 36, 0, QMI_IDL_FLAG_END_VALUE }; @@ -923,7 +953,7 @@ static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), - 35, 0 + 16, 0 }; static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { @@ -931,20 +961,20 @@ static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 17, 0 + 18, 0 }; static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 18, 0, + 19, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 19, 0 + 20, 0 }; static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { @@ -998,25 +1028,25 @@ static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 21, 0, + 22, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 21, 0, + 22, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), - 21, 0, + 22, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), 0x13, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), - 21, 0 + 22, 0 }; static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { @@ -1074,15 +1104,37 @@ static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 22, 0 + 23, 0 }; -/* +static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) +}; + +static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) +}; + +/* * qmiLocGetServiceRevisionReqMsgT is empty * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1111,12 +1163,12 @@ static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 }; -/* +/* * qmiLocGetFixCriteriaReqMsgT is empty * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1187,7 +1239,7 @@ static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), - 35, 0 + 16, 0 }; static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { @@ -1232,12 +1284,12 @@ static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) }; -/* +/* * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1247,21 +1299,21 @@ static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 18, 0, + 19, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 19, 0 + 20, 0 }; -/* +/* * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1271,7 +1323,7 @@ static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 23, 0 + 24, 0 }; static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { @@ -1345,7 +1397,7 @@ static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { 0x1A, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 24, 0, + 25, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), 0x1B, @@ -1381,12 +1433,12 @@ static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) }; -/* +/* * qmiLocGetEngineLockReqMsgT is empty * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1410,12 +1462,12 @@ static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetSbasConfigReqMsgT is empty * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1439,12 +1491,12 @@ static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) }; -/* +/* * qmiLocGetNmeaTypesReqMsgT is empty * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1468,12 +1520,12 @@ static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) }; -/* +/* * qmiLocGetLowPowerModeReqMsgT is empty * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1565,7 +1617,7 @@ static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 25, 0, + 26, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), 0x11, @@ -1601,12 +1653,12 @@ static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) }; -/* +/* * qmiLocGetXtraTSessionControlReqMsgT is empty * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1623,13 +1675,13 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 26, 0, + 27, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 27, 0, + 28, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), 0x12, @@ -1637,7 +1689,7 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 28, 0, + 29, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), 0x13, @@ -1663,12 +1715,12 @@ static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) }; -/* +/* * qmiLocGetRegisteredEventsReqMsgT is empty * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1692,12 +1744,12 @@ static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) }; -/* +/* * qmiLocGetOperationModeReqMsgT is empty * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1736,13 +1788,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 30, 0, + 31, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 30, 0, + 31, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), 0x13, @@ -1758,13 +1810,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), - 37, 0, + 33, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), 0x16, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), - 37, 0 + 33, 0 }; static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { @@ -1818,12 +1870,12 @@ static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) }; -/* +/* * qmiLocGetCradleMountConfigReqMsgT is empty * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1857,12 +1909,12 @@ static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetExternalPowerConfigReqMsgT is empty * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1903,7 +1955,7 @@ static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 31, 0 + 34, 0 }; static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { @@ -2030,12 +2082,12 @@ static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetSensorControlConfigReqMsgT is empty * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2132,13 +2184,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2149,13 +2201,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 20, 0 + 21, 0 }; static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { @@ -2169,12 +2221,12 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) }; -/* +/* * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2189,13 +2241,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2206,13 +2258,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 20, 0, + 21, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 20, 0 + 21, 0 }; static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { @@ -2309,7 +2361,7 @@ static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { 0x02, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 32, 0, + 35, 0, 0x03, QMI_IDL_GENERIC_1_BYTE, @@ -2411,7 +2463,7 @@ static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 32, 0, + 35, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), 0x15, @@ -2631,7 +2683,7 @@ static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 33, 0 + 36, 0 }; static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { @@ -2668,11 +2720,16 @@ static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 34, 0, + 37, 0, - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + 0x02, QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus) + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) }; static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { @@ -2681,6 +2738,73 @@ static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) }; +static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), + 38, 0, + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) +}; + +static const uint8_t qmiLocInjectWCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), + 39, 0, + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSubscriberIDReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) +}; + +static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) +}; + static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2699,40 +2823,18 @@ static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) }; -/* +/* * qmiLocWWANOutOfServiceNotificationReqMsgT is empty * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) }; -static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) -}; - -static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) -}; - static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2790,6 +2892,7 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, @@ -2805,13 +2908,14 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, - {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02} + {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, + {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02} }; /* Message Table */ @@ -2838,6 +2942,8 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, + {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, + {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, {0, 0}, {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, {0, 0}, @@ -2946,12 +3052,16 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02}, {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, {0, 0}, {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, - {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02} }; @@ -2975,210 +3085,219 @@ static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { /*Arrays of service_message_table_entries for commands, responses and indications*/ static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 103}, - {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 22), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 24), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 26), 1345}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 28), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 30), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 32), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 34), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 36), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 38), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 40), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 42), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 44), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 46), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 48), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 50), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 52), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 54), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 56), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 58), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 60), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 62), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 64), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 66), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 68), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 70), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 72), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 74), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 76), 2063}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 78), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 82), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 80), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 86), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 84), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 88), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 90), 53}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 92), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 94), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 96), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 98), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 100), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 102), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 104), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 106), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 108), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 110), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 112), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, TYPE16(0, 114), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, TYPE16(0, 116), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, TYPE16(0, 118), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, TYPE16(0, 120), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, TYPE16(0, 122), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, TYPE16(0, 124), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, TYPE16(0, 126), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, TYPE16(0, 128), 23}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, TYPE16(0, 130), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, TYPE16(0, 132), 0}, - {QMI_LOC_PEDOMETER_REPORT_REQ_V02, TYPE16(0, 136), 46} + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 103}, + {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 26), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 28), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 30), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 34), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 36), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 38), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 42), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 46), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 50), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 54), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 58), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 60), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 64), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 66), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 68), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 70), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 74), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 76), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 2063}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 80), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 90), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 53}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 94), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 98), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 102), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 106), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 110), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 114), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 124), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 126), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 128), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 130), 30}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 138), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 140), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 142), 46}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 132), 36}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 134), 33}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 136), 22} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_QUERY_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_EDIT_GEOFENCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_PEDOMETER_REPORT_RESP_V02, TYPE16(0, 0), 7} + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_PEDOMETER_REPORT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 388}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1338}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 32}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 23), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 25), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 27), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 29), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 31), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 33), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 35), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 37), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 39), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 41), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 45), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 47), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 49), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 51), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 53), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 55), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 57), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 59), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 61), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 63), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 65), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 69), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 71), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 73), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 75), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 77), 30}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 79), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 81), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 87), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 85), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 89), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 91), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 93), 60}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 97), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 99), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 101), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 103), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 105), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 107), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 109), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 111), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 113), 19}, - {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, TYPE16(0, 19), 14}, - {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, TYPE16(0, 20), 7}, - {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, TYPE16(0, 115), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, TYPE16(0, 117), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, TYPE16(0, 119), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, TYPE16(0, 121), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, TYPE16(0, 123), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, TYPE16(0, 125), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, TYPE16(0, 127), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, TYPE16(0, 129), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, TYPE16(0, 131), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, TYPE16(0, 133), 7}, - {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, TYPE16(0, 134), 15}, - {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, TYPE16(0, 135), 4}, - {QMI_LOC_PEDOMETER_REPORT_IND_V02, TYPE16(0, 137), 7} + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 388}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, QMI_IDL_TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, QMI_IDL_TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, QMI_IDL_TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, QMI_IDL_TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, QMI_IDL_TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, QMI_IDL_TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 15), 32}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 25), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 27), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 29), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 31), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 33), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 35), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 43), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 47), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 51), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 55), 11}, + {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 7}, + {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 59), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 65), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 69), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 71), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 75), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 77), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 30}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 81), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 91), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 95), 60}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 103), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 107), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 111), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 115), 19}, + {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, + {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, + {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 78}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 125), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 127), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 129), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, + {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 22), 15}, + {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 23), 4}, + {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 135), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 137), 7} }; /*Service Object*/ @@ -3192,18 +3311,18 @@ struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, &loc_qmi_idl_type_table_object_v02, - 0x11, + 0x12, NULL }; /* Service Object Accessor */ qmi_idl_service_object_type loc_get_service_object_internal_v02 ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) { return NULL; - } + } return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; } diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h index 8dc63e72..57f7c746 100644 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -30,42 +30,43 @@ #define LOC_SERVICE_H /** @file location_service_v02.h - + @brief This is the public header file which defines the loc service Data structures. - This header file defines the types and structures that were defined in + This header file defines the types and structures that were defined in loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory always come before optionals in the structure), or nothing (null message) - + An optional element in a message is preceded by a uint8_t value that must be set to true if the element is going to be included. When decoding a received message, the uint8_t values will be set to true or false by the decode routine, and should be checked before accessing the values that they - correspond to. - + correspond to. + Variable sized arrays are defined as static sized arrays with an unsigned integer (32 bit) preceding it that must be set to the number of elements in the array that are valid. For Example: - + uint32_t test_opaque_len; uint8_t test_opaque[16]; - + If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 5.6 - It was generated on: Fri Oct 26 2012 +/* This file was generated with Tool version 6.0 + It requires encode/decode library version 5 or later + It was generated on: Thu Dec 13 2012 (Spin ) From IDL File: location_service_v02.idl */ /** @defgroup loc_qmi_consts Constant values defined in the IDL */ @@ -85,24 +86,24 @@ extern "C" { #endif -/** @addtogroup loc_qmi_version - @{ - */ +/** @addtogroup loc_qmi_version + @{ + */ /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x11 +#define LOC_V02_IDL_MINOR_VERS 0x12 /** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x05 +#define LOC_V02_IDL_TOOL_VERS 0x06 /** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x006F; -/** - @} +#define LOC_V02_MAX_MESSAGE_ID 0x0072; +/** + @} */ -/** @addtogroup loc_qmi_consts - @{ +/** @addtogroup loc_qmi_consts + @{ */ /** Maximum string length for the Provider field in the application ID. */ @@ -114,7 +115,7 @@ extern "C" { /** Maximum string length for the Version field in the application ID. */ #define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 -/** Maximum length of the list containing the SVs that were used to generate +/** Maximum length of the list containing the SVs that were used to generate a position report. */ #define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 @@ -191,10 +192,21 @@ extern "C" { #define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 /** Maximum length of the network-initiated Geofence ID - list */ + list. */ #define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 -/** Maximum length of the injected network initiated message. */ +/** Maximum value of WDMA frequency for injection of WCDMA cell + information */ +#define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 + +/** Maximum value of PSC for injection of WCDMA cell information */ +#define QMI_LOC_MAX_WCDMA_PSC_V02 511 + +/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell + information */ +#define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 + +/** Maximum length of the injected network-initiated message. */ #define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 /** @} @@ -203,8 +215,8 @@ extern "C" { /** @addtogroup loc_qmi_messages @{ */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further processing or rejected. */ typedef struct { @@ -219,7 +231,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Informs the service of the minor revision of the interface +/** Request Message; Informs the service of the minor revision of the interface definition that the control point implements. */ typedef struct { @@ -233,9 +245,9 @@ typedef struct { */ typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report event indications. These reports are sent at a 1 Hz rate. */ #define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for position and satellites in view. The report is at a 1 Hz rate. */ @@ -254,12 +266,12 @@ typedef uint64_t qmiLocEventRegMaskT_v02; #define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request event indications. */ #define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the + GPS engine indicating its readiness to accept data from the sensors (accelerometer, gyroscope, etc.). */ #define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests from the GPS engine. Time sync enables the GPS engine to synchronize its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position Indicator (SPI) streaming report indications. */ #define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to @@ -267,9 +279,9 @@ typedef uint64_t qmiLocEventRegMaskT_v02; #define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is + affect Geofence, e.g., if GPS is turned off or if the network is unavailable. */ #define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters @@ -283,65 +295,65 @@ typedef uint64_t qmiLocEventRegMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to register for events from the +/** Request Message; Used by the control point to register for events from the location subsystem. */ typedef struct { /* Mandatory */ /* Event Registration Mask */ qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. + position and satellites in view. The report is at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. + event indications. - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. + event indications. - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. + event indications. - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to establish a connection with a location server. - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. + or leaves the perimeter of a Geofence. - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. + this event out to control the injection of pedometer reports. - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data control requests from the location engine. Location engine sends - this event out to control the injection of motion data. - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. + this event out to control the injection of motion data. + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. */ }qmiLocRegEventsReqMsgT_v02; /* Message */ /** @@ -402,7 +414,7 @@ typedef struct { uint8_t applicationVersion_valid; /**< Specifies whether the application version string contains a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid + \item 0x00 (FALSE) -- Application version string is invalid \item 0x01 (TRUE) -- Application version string is valid \vspace{-0.18in} \end{itemize1} */ @@ -422,17 +434,17 @@ typedef struct { /* Mandatory */ /* Session ID */ uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 + - Range: 0 to 255 */ /* Optional */ /* Recurrence Type */ uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. + /**< Specifies the type of session in which the control point is interested. If this TLV is not specified, recurrence defaults to SINGLE. Valid values: \n @@ -445,7 +457,7 @@ typedef struct { uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. + If not specified, accuracy defaults to LOW. Valid values: \begin{itemize1} \item 0x00000001 -- LOW: Client requires low horizontal accuracy @@ -459,14 +471,14 @@ typedef struct { /* Enable/Disable Intermediate Reports */ uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. + intermediate reports. Valid values: \begin{itemize1} \item 0x00000001 -- ON: Client is interested in receiving intermediate @@ -484,7 +496,7 @@ typedef struct { /**< Minimum time interval, specified by the control point, that must elapse between position reports. \n - Units: Milliseconds \n - - Default: 1000 ms + - Default: 1000 ms */ /* Optional */ @@ -520,7 +532,7 @@ typedef uint32_t qmiLocPosTechMaskT_v02; #define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to generate the fix. */ /** @addtogroup loc_qmi_enums @{ @@ -604,10 +616,10 @@ typedef struct { qmiLocSensorUsageMaskT_v02 usageMask; /**< Specifies which sensors were used in calculating the position in the position report. - + Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SENSOR_USED_ACCEL - \item 0x00000002 -- SENSOR_USED_GYRO + \item 0x00000001 -- SENSOR_USED_ ACCEL + \item 0x00000002 -- SENSOR_USED_ GYRO \vspace{-0.18in} \end{itemize1} */ qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; @@ -635,7 +647,7 @@ typedef enum { eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data from multiple satellites. */ eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ @@ -646,7 +658,7 @@ typedef enum { eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). + eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). GNSS time is maintained irrespective of the GNSS receiver state */ QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocTimeSourceEnumT_v02; @@ -680,23 +692,23 @@ typedef struct { /* Session Status */ qmiLocSessionStatusEnumT_v02 sessionStatus; /**< Session status. - + Valid values: \begin{itemize1} - \item 0x00000000 -- SESS_STATUS_SUCCESS - \item 0x00000001 -- SESS_STATUS_IN_PROGRESS - \item 0x00000002 -- SESS_STATUS_GENERAL_FAILURE - \item 0x00000003 -- SESS_STATUS_TIMEOUT - \item 0x00000004 -- SESS_STATUS_USER_END - \item 0x00000005 -- SESS_STATUS_BAD_PARAMETER - \item 0x00000006 -- SESS_STATUS_PHONE_OFFLINE - \item 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + \item 0x00000000 -- SESS_STATUS_ SUCCESS + \item 0x00000001 -- SESS_STATUS_ IN_PROGRESS + \item 0x00000002 -- SESS_STATUS_ GENERAL_FAILURE + \item 0x00000003 -- SESS_STATUS_ TIMEOUT + \item 0x00000004 -- SESS_STATUS_ USER_END + \item 0x00000005 -- SESS_STATUS_ BAD_PARAMETER + \item 0x00000006 -- SESS_STATUS_ PHONE_OFFLINE + \item 0x00000007 -- SESS_STATUS_ ENGINE_LOCKED \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ /* Session ID */ uint8_t sessionId; - /**< ID of the session that was specified in the Start request + /**< ID of the session that was specified in the Start request QMI_LOC_START_REQ. \n - Range: 0 to 255 */ @@ -769,10 +781,10 @@ typedef struct { qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. \n Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000003 -- RELIABILITY_ MEDIUM \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ @@ -818,7 +830,7 @@ typedef struct { uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ uint8_t vertConfidence; /**< Vertical uncertainty confidence.\n - - Units: Percent \n + - Units: Percent \n - Range: 0 to 99 */ /* Optional */ @@ -827,10 +839,10 @@ typedef struct { qmiLocReliabilityEnumT_v02 vertReliability; /**< Specifies the reliability of the vertical position. \n Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000003 -- RELIABILITY_ MEDIUM \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1}*/ @@ -861,7 +873,7 @@ typedef struct { /* Magnetic Deviation */ uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown + /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic north is east of true north. */ @@ -875,9 +887,9 @@ typedef struct { \item 0x00000001 -- SATELLITE \item 0x00000002 -- CELLID \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_ LOCATION + \item 0x00000020 -- INJECTED_COARSE_ POSITION \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -899,7 +911,7 @@ typedef struct { uint8_t leapSeconds; /**< Leap second information. If leapSeconds is not available, timestampUtc is calculated based on a hard-coded value - for leap seconds. \n + for leap seconds. \n - Units: Seconds */ /* Optional */ @@ -921,25 +933,25 @@ typedef struct { uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). GNSS time is maintained irrespective of the GNSS receiver state */ /* Optional */ @@ -962,9 +974,9 @@ typedef struct { uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following + used for calculating this position report. The following information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} + \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 @@ -1028,9 +1040,9 @@ typedef struct { Valid bitmasks: \begin{itemize1} \item 0x00000001 -- VALID_SYSTEM \item 0x00000002 -- VALID_GNSS_SVID - \item 0x00000004 -- VALID_HEALTH_STATUS - \item 0x00000008 -- VALID_PROCESS_STATUS - \item 0x00000010 -- VALID_SVINFO_MASK + \item 0x00000004 -- VALID_HEALTH_ STATUS + \item 0x00000008 -- VALID_PROCESS_ STATUS + \item 0x00000010 -- VALID_SVINFO_ MASK \item 0x00000020 -- VALID_ELEVATION \item 0x00000040 -- VALID_AZIMUTH \item 0x00000080 -- VALID_SNR @@ -1040,11 +1052,11 @@ typedef struct { /**< Indicates to which constellation this SV belongs. Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS \vspace{-0.18in} \end{itemize1} */ uint16_t gnssSvId; @@ -1073,7 +1085,7 @@ typedef struct { */ qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n + /**< Whether almanac and ephemeris information is available. \n Valid bitmasks: \n - 0x01 -- SVINFO_HAS_EPHEMERIS \n - 0x02 -- SVINFO_HAS_ALMANAC @@ -1220,10 +1232,10 @@ typedef struct { /**< Position mode. Valid values: \begin{itemize1} - \item 0x00000001 -- NI_VX_MS_ASSISTED_ONLY - \item 0x00000002 -- NI_VX_MS_BASED_ONLY - \item 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED - \item 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + \item 0x00000001 -- NI_VX_MS_ ASSISTED_ONLY + \item 0x00000002 -- NI_VX_MS_BASED_ ONLY + \item 0x00000003 -- NI_VX_MS_ ASSISTED_PREFERRED_ MS_BASED_ALLOWED + \item 0x00000004 -- NI_VX_MS_ BASED_PREFERRED_ MS_ASSISTED_ALLOWED \vspace{-0.18in} \end{itemize1} */ @@ -1232,13 +1244,13 @@ typedef struct { Valid values: \begin{itemize1} \item 0x00000000 -- NI_VX_OCTET - \item 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG + \item 0x00000001 -- NI_VX_EXN_ PROTOCOL_MSG \item 0x00000002 -- NI_VX_ASCII \item 0x00000003 -- NI_VX_IA5 \item 0x00000004 -- NI_VX_UNICODE \item 0x00000005 -- NI_VX_SHIFT_JIS \item 0x00000006 -- NI_VX_KOREAN - \item 0x00000007 -- NI_VX_LATIN_HEBREW + \item 0x00000007 -- NI_VX_LATIN_ HEBREW \item 0x00000008 -- NI_VX_LATIN \item 0x00000009 -- NI_VX_GSM \vspace{-0.18in} \end{itemize1} @@ -1248,7 +1260,7 @@ typedef struct { uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; /**< Requestor ID. \n - Type: Array of bytes \n - - Maximum array length: 200 + - Maximum array length: 200 */ uint16_t userRespTimerInSeconds; @@ -1339,15 +1351,15 @@ typedef struct { /**< Format of the formatted string. Valid values: \begin{itemize1} - \item 0x00000000 -- FORMAT_LOGICAL_NAME - \item 0x00000001 -- FORMAT_EMAIL_ADDRESS + \item 0x00000000 -- FORMAT_LOGICAL_ NAME + \item 0x00000001 -- FORMAT_EMAIL_ ADDRESS \item 0x00000002 -- FORMAT_MSISDN \item 0x00000003 -- FORMAT_URL \item 0x00000004 -- FORMAT_SIP_URL \item 0x00000005 -- FORMAT_MIN \item 0x00000006 -- FORMAT_MDN - \item 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY - \item 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + \item 0x00000007 -- FORMAT_ IMSPUBLIC_IDENTITY + \item 0x7FFFFFFF -- FORMAT_OSS_ UNKNOWN \vspace{-0.18in} \end{itemize1} */ @@ -1355,7 +1367,7 @@ typedef struct { uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Formatted string. \n - Type: Byte array \n - - Maximum string length: 64 + - Maximum string length: 64 */ }qmiLocNiSuplFormattedStringStructT_v02; /* Type */ /** @@ -1373,7 +1385,7 @@ typedef uint8_t qmiLocSuplQopValidMaskT_v02; typedef struct { qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. + /**< Bit field indicating which fields are valid in this value. Valid bitmasks: \n - 0x01 -- QOP_HORZ_ACC_VALID \n @@ -1382,11 +1394,11 @@ typedef struct { - 0x08 -- QOP_DELAY_VALID*/ uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n + /**< Horizontal accuracy. \n - Units: Meters */ uint8_t verticalAccuracy; - /**< Vertical accuracy. \n + /**< Vertical accuracy. \n - Units: Meters */ uint16_t maxLocAge; @@ -1428,7 +1440,7 @@ typedef struct { uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; /**< IPV6 address. \n - - Type: Array of unsigned integers \n + - Type: Array of unsigned integers \n - Maximum length of the array: 8 */ uint32_t port; @@ -1462,7 +1474,7 @@ typedef struct { /**< URL. \begin{itemize1} \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 + \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} */ }qmiLocNiSuplServerInfoStructT_v02; /* Type */ @@ -1474,37 +1486,37 @@ typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; #define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information is present in an NI SUPL notify verify request event. This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present in an NI notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ #define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID is present in an NI notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID is present in an NI notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position is present in an NI notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer is present in an NI notify verify request event. - This mask is set in the valid_flags field of a + This mask is set in the valid_flags field of a notify verify structure. */ /** @addtogroup loc_qmi_aggregates @{ @@ -1512,18 +1524,18 @@ typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; typedef struct { qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. + /**< Indicates which of the following fields are present in this value. Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SUPL_SERVER_INFO \item 0x00000002 -- SUPL_SESSION_ID \item 0x00000004 -- SUPL_HASH \item 0x00000008 -- SUPL_POS_METHOD - \item 0x00000010 -- SUPL_DATA_CODING_SCHEME - \item 0x00000020 -- SUPL_REQUESTOR_ID - \item 0x00000040 -- SUPL_CLIENT_NAME + \item 0x00000010 -- SUPL_DATA_ CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ ID + \item 0x00000040 -- SUPL_CLIENT_ NAME \item 0x00000080 -- SUPL_QOP - \item 0x00000100 -- SUPL_USER_RESP_TIMER + \item 0x00000100 -- SUPL_USER_RESP_ TIMER \vspace{-0.18in} \end{itemize1} */ @@ -1531,24 +1543,24 @@ typedef struct { /**< SUPL server information. */ uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n - Maximum length of the array: 4 */ uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n + corrupted. \n - Type: Array of unsigned integers \n - Length of the array: 8 */ qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. + /**< GPS mode to be used for the fix. Valid values: \begin{itemize1} \item 0x00000001 -- AGPS_SETASSISTED \item 0x00000002 -- AGPS_SETBASED - \item 0x00000003 -- AGPS_SETASSISTED_PREF - \item 0x00000004 -- AGPS_SETBASED_PREF + \item 0x00000003 -- AGPS_ SETASSISTED_PREF + \item 0x00000004 -- AGPS_SETBASED_ PREF \item 0x00000005 -- AUTONOMOUS_GPS \item 0x00000006 -- AFLT \item 0x00000007 -- ECID @@ -1560,7 +1572,7 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Data coding scheme applies to both the requestor ID and the client - name. + name. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1578,19 +1590,19 @@ typedef struct { \item 0x00000018 -- NI_SS_TURKISH \item 0x00000019 -- NI_SS_HUNGARIAN \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC \item 0x0000001C -- NI_SUPL_UTF8 \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT \vspace{-0.18in} \end{itemize1} */ qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in + /**< Requestor ID. The encoding scheme for requestor_id is specified in the dataCodingScheme field. */ qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in + /**< Client name. The encoding scheme for client_name is specified in the dataCodingScheme field. */ qmiLocNiSuplQopStructT_v02 suplQop; @@ -1624,7 +1636,7 @@ typedef enum { typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. + /**< Identifies the coding scheme of the coded string. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1642,10 +1654,10 @@ typedef struct { \item 0x00000018 -- NI_SS_TURKISH \item 0x00000019 -- NI_SS_HUNGARIAN \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC \item 0x0000001C -- NI_SUPL_UTF8 \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT \vspace{-0.18in} \end{itemize1} */ @@ -1661,41 +1673,41 @@ typedef struct { */ typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer is present in an NI notify verify request event. - This mask is set in the valid flags field of a + This mask is set in the valid flags field of a notify verify structure. */ /** @addtogroup loc_qmi_aggregates @{ @@ -1703,18 +1715,18 @@ typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; typedef struct { qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. + /**< Fields that are valid in this value. Valid bitmasks: \begin{itemize1} \item 0x0001 -- INVOKE_ID_MASK - \item 0x0002 -- DATA_CODING_SCHEME_MASK - \item 0x0004 -- NOTIFICATION_TEXT_MASK - \item 0x0008 -- CLIENT_ADDRESS_MASK - \item 0x0010 -- LOCATION_TYPE_MASK + \item 0x0002 -- DATA_CODING_ SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_ MASK + \item 0x0008 -- CLIENT_ADDRESS_ MASK + \item 0x0010 -- LOCATION_TYPE_ MASK \item 0x0020 -- REQUESTOR_ID_MASK - \item 0x0040 -- CODEWORD_STRING_MASK + \item 0x0040 -- CODEWORD_STRING_ MASK \item 0x0080 -- SERVICE_TYPE_MASK - \item 0x0100 -- USER_RESP_TIMER_MASK + \item 0x0100 -- USER_RESP_TIMER_ MASK \vspace{-0.18in} \end{itemize1} */ @@ -1723,7 +1735,7 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. + Applies to both the notification text and the client address. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1741,10 +1753,10 @@ typedef struct { \item 0x00000018 -- NI_SS_TURKISH \item 0x00000019 -- NI_SS_HUNGARIAN \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_UNSPEC + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC \item 0x0000001C -- NI_SUPL_UTF8 \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_DEFAULT + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT \vspace{-0.18in} \end{itemize1} */ @@ -1752,27 +1764,27 @@ typedef struct { uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Notification text; the encoding method is specified in dataCodingScheme. \n - - Type: Array of bytes \n + - Type: Array of bytes \n - Maximum array length: 64 */ uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; /**< Client address; the encoding method is specified in - dataCodingScheme. \n + dataCodingScheme. \n - Maximum array length: 20 */ qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. + /**< Location type. Valid values: \begin{itemize1} - \item 0x00000001 -- CURRENT_LOCATION - \item 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION + \item 0x00000001 -- CURRENT_ LOCATION + \item 0x00000002 -- CURRENT_OR_ LAST_KNOWN_LOCATION \item 0x00000004 -- INITIAL_LOCATION \vspace{-0.18in} \end{itemize1} */ qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the + /**< Requestor ID; the encoding method is specified in the qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; @@ -1783,7 +1795,7 @@ typedef struct { /**< Service type ID. */ uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n + /**< Time to wait for the user to respond. \n - Units: Seconds */ }qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ /** @@ -1811,10 +1823,10 @@ typedef struct { /**< Ongoing NI session request; this information is currently not filled. */ qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. Valid values: \begin{itemize1} - \item 0x00000001 -- ONGOING_NI_INCOMING_MO + \item 0x00000001 -- ONGOING_NI_ INCOMING_MO \vspace{-0.18in} \end{itemize1} */ }qmiLocNiVxServiceInteractionStructT_v02; /* Type */ @@ -1825,34 +1837,34 @@ typedef struct { typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; #define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ #define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed as part of multiple location ID in the SUPL_POS_INIT message. */ /** @addtogroup loc_qmi_enums @{ */ typedef enum { QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event triggered session. */ QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; @@ -1878,16 +1890,16 @@ typedef struct { SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). Valid bitmasks: \begin{itemize1} - \item 0x0001 -- SUPPORTED_NETWORK_WLAN - \item 0x0002 -- SUPPORTED_NETWORK_GSM - \item 0x0004 -- SUPPORTED_NETWORK_WCDMA - \item 0x0008 -- SUPPORTED_NETWORK_CDMA - \item 0x0010 -- SUPPORTED_NETWORK_HRDP - \item 0x0020 -- SUPPORTED_NETWORK_UMB - \item 0x0040 -- SUPPORTED_NETWORK_LTE - \item 0x0080 -- SUPPORTED_NETWORK_WIMAX - \item 0x0100 -- SUPPORTED_NETWORK_HISTORIC - \item 0x0200 -- SUPPORTED_NETWORK_NONSVRV + \item 0x0001 -- SUPPORTED_NETWORK_ WLAN + \item 0x0002 -- SUPPORTED_NETWORK_ GSM + \item 0x0004 -- SUPPORTED_NETWORK_ WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_ CDMA + \item 0x0010 -- SUPPORTED_NETWORK_ HRDP + \item 0x0020 -- SUPPORTED_NETWORK_ UMB + \item 0x0040 -- SUPPORTED_NETWORK_ LTE + \item 0x0080 -- SUPPORTED_NETWORK_ WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_ HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_ NONSVRV \vspace{-0.18in} \end{itemize1} */ @@ -1896,9 +1908,9 @@ typedef struct { SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). Valid values: \begin{itemize1} - \item 0xFFFFFFFF -- TRIGGER_TYPE_SINGLE_SHOT - \item 0x00000000 -- TRIGGER_TYPE_PERIODIC - \item 0x00000001 -- TRIGGER_TYPE_AREA_EVENT + \item 0xFFFFFFFF -- TRIGGER_TYPE_ SINGLE_SHOT + \item 0x00000000 -- TRIGGER_TYPE_ PERIODIC + \item 0x00000001 -- TRIGGER_TYPE_ AREA_EVENT \vspace{-0.18in} \end{itemize1} */ qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; @@ -1924,7 +1936,7 @@ typedef struct { typedef struct { char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< The ESLP URL + /**< The ESLP URL Maximum length: 255 bytes */ }qmiLocEmergencyNotificationStructT_v02; /* Type */ /** @@ -1940,14 +1952,14 @@ typedef struct { /* Mandatory */ /* Notification Type */ qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. + /**< Type of notification/verification performed. Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIFY + \item 0x00000001 -- NO_NOTIFY_NO_ VERIFY \item 0x00000002 -- NOTIFY_ONLY \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE + \item 0x00000004 -- NOT_ALLOW_NO_ RESP + \item 0x00000005 -- PRIVACY_ OVERRIDE \vspace{-0.18in} \end{itemize1} */ @@ -1979,15 +1991,15 @@ typedef struct { /* Network Initiated SUPL Version 2 Extension */ uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL + /**< \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL indication payload. */ /* Optional */ /* SUPL Emergency Notification */ uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< This specifies that the corresponding NI notification is an + /**< This specifies that the corresponding NI notification is an emergency notification. Emergency notification can be given even without an ESLP address */ }qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ @@ -2018,14 +2030,14 @@ typedef struct { uint32_t delayThreshold; /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n + exceeds this threshold. \n - Units: Milliseconds */ uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, the second one as secondary, and so on. \n - Maximum server list items: 3 */ }qmiLocTimeServerListStructT_v02; /* Type */ @@ -2075,7 +2087,7 @@ typedef struct { /**< List of predicted orbits URLs. The list is ordered, so the client must use the first server specified in the list as the primary URL from which to download predicted orbits data, the second one as - secondary, and so on. \n + secondary, and so on. \n - Maximum number of servers that can be specified: 3 */ }qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ /** @@ -2174,7 +2186,7 @@ typedef struct { /* Mandatory */ /* Engine State */ qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. + /**< Location engine state. Valid values: \n - 0x00000001 -- ON \n @@ -2207,7 +2219,7 @@ typedef struct { /* Mandatory */ /* Session State */ qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. + /**< LOC fix session state. Valid values: \n - 0x00000001 -- STARTED \n @@ -2250,12 +2262,12 @@ typedef struct { /* Mandatory */ /* Request Type */ qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. + /**< Request type as specified in qmiWifiRequestEnumT. Valid values: \begin{itemize1} - \item 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES - \item 0x00000001 -- START_PERIODIC_KEEP_WARM - \item 0x00000002 -- STOP_PERIODIC_FIXES + \item 0x00000000 -- START_PERIODIC_ HI_FREQ_FIXES + \item 0x00000001 -- START_PERIODIC_ KEEP_WARM + \item 0x00000002 -- STOP_PERIODIC_ FIXES \vspace{-0.18in} \end{itemize1} */ @@ -2277,18 +2289,18 @@ typedef struct { uint16_t samplesPerBatch; /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \n - + receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n + samplesPerBatch must be a nonzero positive value. */ uint16_t batchesPerSecond; /**< Number of sensor-data batches the GNSS location engine is to receive per second. The rate is specified in an integral number of batches per - second (Hz). \n - + second (Hz). \vspace{-0.06in} \n + batchesPerSecond must be a nonzero positive value. */ }qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ @@ -2302,7 +2314,7 @@ typedef struct { typedef struct { uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this + /**< Whether the GNSS location engine is ready to accept data from this sensor. Valid values: \begin{itemize1} @@ -2326,7 +2338,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Notifies the control point if the GNSS location engine is +/** Indication Message; Notifies the control point if the GNSS location engine is ready to accept sensor data. */ typedef struct { @@ -2334,7 +2346,7 @@ typedef struct { /* Accelerometer Accept Ready */ uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer + /**< \n Whether the GNSS location engine is ready to accept accelerometer sensor data. */ @@ -2342,7 +2354,7 @@ typedef struct { /* Gyroscope Accept Ready */ uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor + /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor data. */ @@ -2350,7 +2362,7 @@ typedef struct { /* Accelerometer Temperature Accept Ready */ uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer + /**< \n Whether the GNSS location engine is ready to accept accelerometer temperature data. */ @@ -2369,16 +2381,16 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Notifies the control point to inject time synchronization +/** Indication Message; Notifies the control point to inject time synchronization data. */ typedef struct { /* Mandatory */ /* Opaque Time Sync Reference Counter */ uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. This TLV must be echoed back in the Time Sync Inject request. */ }qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ /** @@ -2434,7 +2446,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Requests the client to open or close a connection +/** Indication Message; Requests the client to open or close a connection to the assisted GPS location server. */ typedef struct { @@ -2456,11 +2468,11 @@ typedef struct { /* Mandatory */ /* WWAN Type */ qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. \n + /**< Identifies the WWAN type for this request. Valid values: \begin{itemize1} - \item 0x00000000 -- WWAN_TYPE_INTERNET - \item 0x00000001 -- WWAN_TYPE_AGNSS + \item 0x00000000 -- WWAN_TYPE_ INTERNET + \item 0x00000001 -- WWAN_TYPE_ AGNSS \vspace{-0.18in} \end{itemize1} */ }qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ @@ -2493,7 +2505,7 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< ID of the Geofence for which this + /**< ID of the Geofence for which this notification was generated. */ /* Mandatory */ @@ -2502,9 +2514,9 @@ typedef struct { /**< Operation for which this notification was generated. Valid values: \begin{itemize1} - \item 0x00000001 -- NI_GEOFENCE_ADDED - \item 0x00000002 -- NI_GEOFENCE_DELETED - \item 0x00000003 -- NI_GEOFENCE_EDITED + \item 0x00000001 -- NI_GEOFENCE_ ADDED + \item 0x00000002 -- NI_GEOFENCE_ DELETED + \item 0x00000003 -- NI_GEOFENCE_ EDITED \vspace{-0.18in} \end{itemize1} */ }qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ @@ -2517,7 +2529,7 @@ typedef struct { */ typedef enum { QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes cannot be used to monitor Geofences. */ eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can be used to monitor Geofences. */ @@ -2540,13 +2552,13 @@ typedef struct { /* Mandatory */ /* Geofence General Alert */ qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. + /**< Specifies the Geofence general alert type. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE - \item 0x00000002 -- GEOFENCE_GEN_ALERT_GNSS_AVAILABLE - \item 0x00000003 -- GEOFENCE_GEN_ALERT_OOS - \item 0x00000004 -- GEOFENCE_GEN_ALERT_TIME_INVALID + \item 0x00000001 -- GEOFENCE_GEN_ ALERT_GNSS_UNAVAILABLE + \item 0x00000002 -- GEOFENCE_GEN_ ALERT_GNSS_AVAILABLE + \item 0x00000003 -- GEOFENCE_GEN_ ALERT_OOS + \item 0x00000004 -- GEOFENCE_GEN_ ALERT_TIME_INVALID \vspace{-0.18in} \end{itemize1} */ }qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ @@ -2709,7 +2721,7 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< ID of the Geofence for which this + /**< ID of the Geofence for which this notification was generated. */ /* Mandatory */ @@ -2718,8 +2730,8 @@ typedef struct { /**< The type of breach that generated this event. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_BREACH_TYPE_ENTERING - \item 0x00000002 -- GEOFENCE_BREACH_TYPE_LEAVING + \item 0x00000001 -- GEOFENCE_ BREACH_TYPE_ENTERING + \item 0x00000002 -- GEOFENCE_ BREACH_TYPE_LEAVING \vspace{-0.18in} \end{itemize1} */ @@ -2747,10 +2759,10 @@ typedef struct { /* Mandatory */ /* Request Pedometer Data */ uint8_t requestPedometerData; - /**< \n Whether GNSS location engine is requesting the client to + /**< \n Whether GNSS location engine is requesting the client to send pedometer data. \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting + \item 0x01 (TRUE) -- GNSS location engine is requesting pedometer data \item 0x00 (FALSE) -- GNSS location engine is not requesting pedometer data @@ -2763,7 +2775,7 @@ typedef struct { uint8_t resetStepCount; /**< Whether location engine desires the step count to be reset. \begin{itemize1} - \item 0x01 (TRUE) -- Pedometer step count should be reset. + \item 0x01 (TRUE) -- Pedometer step count should be reset. \item 0x00 (FALSE) -- Pedometer step count should not be reset. \vspace{-0.18in} \end{itemize1} */ @@ -2772,7 +2784,7 @@ typedef struct { uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ uint32_t stepCountThreshold; /**< Specifies the number of steps to be sampled in a pedometer report - as recommended by the the location engine. If the threshold is set to 0 + as recommended by the the location engine. If the threshold is set to 0 then the location engine desires a pedometer report at every step event. */ }qmiLocEventPedometerControlIndMsgT_v02; /* Message */ @@ -2790,12 +2802,12 @@ typedef struct { /* Mandatory */ /* Request Motion Data */ uint8_t requestMotionData; - /**< \n Whether GNSS location engine is requesting the client to + /**< \n Whether GNSS location engine is requesting the client to send motion data. \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting + \item 0x01 (TRUE) -- GNSS location engine is requesting motion data - \item 0x00 (FALSE) -- GNSS location engine is not requesting + \item 0x00 (FALSE) -- GNSS location engine is not requesting motion data \vspace{-0.18in} \end{itemize1} */ @@ -2840,13 +2852,13 @@ typedef struct { /* Mandatory */ /* Get Revision Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. + /**< Status of the Get Revision request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -2857,7 +2869,7 @@ typedef struct { /* Interface Definition Minor Revision */ uint32_t revision; /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always + the service implements. Minor revision updates of the service are always backward compatible. */ /* Optional */ @@ -2869,7 +2881,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 128 \vspace{0.1in} \end{itemize1} - + \textbf{Note:} This string is only provided on platforms that have a measurement engine that supports this version string. On all other platforms, this optional TLV is not provided. */ @@ -2883,7 +2895,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 128 \vspace{0.1in}\end{itemize1} - + \textbf{Note:} This string is only provided on hosted architectures (measurement and position engine running on different processors) that support this version string. On all other platforms, this optional TLV @@ -2918,13 +2930,13 @@ typedef struct { /* Mandatory */ /* Get Fix Criteria Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. + /**< Status of the Get Fix Criteria request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -2949,10 +2961,10 @@ typedef struct { uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving + The client must explicitly set this field to OFF to stop receiving intermediate position reports. Intermediate position reports are generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the + are turned ON, the client receives position reports even if the accuracy criteria is not met. The status in the position report is set to IN_PROGRESS for intermediate reports. @@ -3005,26 +3017,26 @@ typedef struct { /* Mandatory */ /* User Response */ qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. + /**< User accepted or denied. Valid values: \begin{itemize1} - \item 0x00000001 -- NOTIFY_VERIFY_ACCEPT - \item 0x00000002 -- NOTIFY_VERIFY_DENY - \item 0x00000003 -- NOTIFY_VERIFY_NORESP + \item 0x00000001 -- NOTIFY_VERIFY_ ACCEPT + \item 0x00000002 -- NOTIFY_VERIFY_ DENY + \item 0x00000003 -- NOTIFY_VERIFY_ NORESP \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ /* Notification Type */ qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. + /**< Type of notification/verification performed. Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_VERIF + \item 0x00000001 -- NO_NOTIFY_NO_ VERIF \item 0x00000002 -- NOTIFY_ONLY \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_RESP - \item 0x00000005 -- PRIVACY_OVERRIDE + \item 0x00000004 -- NOT_ALLOW_NO_ RESP + \item 0x00000005 -- PRIVACY_ OVERRIDE \vspace{-0.18in} \end{itemize1} */ @@ -3079,13 +3091,13 @@ typedef struct { /* Mandatory */ /* NI User Response Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. + /**< Status of the NI User Response request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3136,18 +3148,18 @@ typedef struct { uint32_t partData_len; /**< Must be set to # of elements in partData */ char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 + - Type: Array of bytes \n + - Maximum length of the array: 1024 */ /* Optional */ /* Format Type */ uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. + /**< Predicted orbits data format. Valid values: \begin{itemize1} - \item 0x00000000 -- PREDICTED_ORBITS_XTRA + \item 0x00000000 -- PREDICTED_ ORBITS_XTRA \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ @@ -3170,7 +3182,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3203,13 +3215,13 @@ typedef struct { /* Mandatory */ /* Predicted Orbits Data Source Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. + /**< Status of the query request for a predicted orbits data source. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3246,12 +3258,12 @@ typedef struct { uint64_t startTimeInUTC; /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) + - Units: Seconds (since Jan. 1, 1970) */ uint16_t durationHours; /**< Duration from the start time for which the data is valid.\n - - Units: Hours + - Units: Hours */ }qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ /** @@ -3267,13 +3279,13 @@ typedef struct { /* Mandatory */ /* Predicted Orbits Data Validity Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. + /**< Status of the query request for predicted orbits data validity. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3320,13 +3332,13 @@ typedef struct { /* Mandatory */ /* UTC Time Injection Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. + /**< Status of the UTC Time Injection request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3382,7 +3394,7 @@ typedef enum { eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal position coordinates only. */ eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal + regardless of horizontal position (within the horizontal uncertainty region, if provided). */ QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAltSrcUncertaintyCoverageEnumT_v02; @@ -3396,43 +3408,43 @@ typedef enum { typedef struct { qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. + /**< Specifies the source of the altitude. Valid values: \begin{itemize1} - \item 0x00000000 -- ALT_SRC_UNKNOWN + \item 0x00000000 -- ALT_SRC_ UNKNOWN \item 0x00000001 -- ALT_SRC_GPS \item 0x00000002 -- ALT_SRC_CELL_ID - \item 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID + \item 0x00000003 -- ALT_SRC_ ENHANCED_CELL_ID \item 0x00000004 -- ALT_SRC_WIFI - \item 0x00000005 -- ALT_SRC_TERRESTRIAL - \item 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID - \item 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE - \item 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER + \item 0x00000005 -- ALT_SRC_ TERRESTRIAL + \item 0x00000006 -- ALT_SRC_ TERRESTRIAL_HYBRID + \item 0x00000007 -- ALT_SRC_ ALTITUDE_DATABASE + \item 0x00000008 -- ALT_SRC_ BAROMETRIC_ALTIMETER \item 0x00000009 -- ALT_SRC_OTHER \vspace{-0.18in} \end{itemize1} */ qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. + /**< Specifies the dependency between the horizontal and + altitude position components. Valid values: \begin{itemize1} - \item 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED - \item 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT - \item 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG - \item 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + \item 0x00000000 -- SRC_LINKAGE_ NOT_SPECIFIED + \item 0x00000001 -- SRC_LINKAGE_ FULLY_INTERDEPENDENT + \item 0x00000002 -- SRC_LINKAGE_ DEPENDS_ON_LAT_LONG + \item 0x00000003 -- SRC_LINKAGE_ FULLY_INDEPENDENT \vspace{-0.18in} \end{itemize1} */ qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. + /**< Specifies the region of uncertainty. Valid values: \begin{itemize1} - \item 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED - \item 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid + \item 0x00000000 -- UNCERTAINTY_ NOT_SPECIFIED + \item 0x00000001 -- UNCERTAINTY_ POINT: Altitude uncertainty is valid at the injected horizontal position coordinates only. - \item 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to + \item 0x00000002 -- UNCERTAINTY_ FULL: Altitude uncertainty applies to the position of the device regardless of horizontal position (within the horizontal uncertainty region, if provided). @@ -3523,11 +3535,11 @@ typedef struct { /**< Specifies the reliability of the horizontal position. Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ @@ -3575,14 +3587,14 @@ typedef struct { /* Vertical Reliability */ uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. + /**< Specifies the reliability of the vertical position. Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ @@ -3613,20 +3625,20 @@ typedef struct { /**< Source from which this position was obtained. Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS - \item 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID - \item 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID - \item 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI - \item 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL - \item 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID - \item 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER + \item 0x00000000 -- eQMI_LOC_ POSITION_SRC_GNSS + \item 0x00000001 -- eQMI_LOC_ POSITION_SRC_CELLID + \item 0x00000002 -- eQMI_LOC_ POSITION_SRC_ENH_CELLID + \item 0x00000003 -- eQMI_LOC_ POSITION_SRC_WIFI + \item 0x00000004 -- eQMI_LOC_ POSITION_SRC_TERRESTRIAL + \item 0x00000005 -- eQMI_LOC_ POSITION_SRC_GNSS_ TERRESTRIAL_HYBRID + \item 0x00000006 -- eQMI_LOC_ POSITION_SRC_OTHER \end{itemize1} \vspace{0.05in} - If altitude is specified and the altitude source is not specified, the engine + If altitude is specified and the altitude source is not specified, the engine assumes that the altitude was obtained using the specified position source. \n If both altitude and altitude source are specified, the engine assumes that only latitude and longitude were obtained using the specified position - source. + source. */ }qmiLocInjectPositionReqMsgT_v02; /* Message */ /** @@ -3648,7 +3660,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3683,14 +3695,14 @@ typedef struct { /* Mandatory */ /* Lock Type */ qmiLocLockEnumT_v02 lockType; - /**< Type of lock. + /**< Type of lock. Valid values: \n - 0x00000001 -- LOCK_NONE \n - 0x00000002 -- LOCK_MI \n - 0x00000003 -- LOCK_MT \n - 0x00000004 -- LOCK_ALL - + */ }qmiLocSetEngineLockReqMsgT_v02; /* Message */ /** @@ -3712,7 +3724,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3738,13 +3750,13 @@ typedef struct { /* Mandatory */ /* Get Engine Lock Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. + /**< Status of the Get Engine Lock request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3755,7 +3767,7 @@ typedef struct { /* Lock Type */ uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ qmiLocLockEnumT_v02 lockType; - /**< Type of lock. + /**< Type of lock. Valid values: \n - 0x00000001 -- LOCK_NONE \n @@ -3777,7 +3789,7 @@ typedef struct { /* Mandatory */ /* SBAS Config */ uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. + /**< Whether SBAS configuration is enabled. \begin{itemize1} \item 0x01 (TRUE) -- SBAS configuration is enabled \item 0x00 (FALSE) -- SBAS configuration is disabled @@ -3796,13 +3808,13 @@ typedef struct { /* Mandatory */ /* Set SBAS Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. + /**< Status of the Set SBAS Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3828,13 +3840,13 @@ typedef struct { /* Mandatory */ /* Get SBAS Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. + /**< Status of the Get SBAS Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3881,7 +3893,7 @@ typedef struct { - 0x00000008 -- NMEA_MASK_GSA \n - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ /** @@ -3897,13 +3909,13 @@ typedef struct { /* Mandatory */ /* Set NMEA Types Status */ qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. + /**< Status of Set NMEA Types request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3929,13 +3941,13 @@ typedef struct { /* Mandatory */ /* Get NMEA Types Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. + /**< Status of the Get NMEA Types request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -3946,7 +3958,7 @@ typedef struct { /* NMEA Sentence Types */ uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. + /**< NMEA types to enable. Valid bitmasks: \n - 0x0000ffff -- NMEA_MASK_ALL \n @@ -3956,7 +3968,7 @@ typedef struct { - 0x00000008 -- NMEA_MASK_GSA \n - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ /** @@ -3989,13 +4001,13 @@ typedef struct { /* Mandatory */ /* Set LPM Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. + /**< Status of the Set Low Power Mode request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4021,13 +4033,13 @@ typedef struct { /* Mandatory */ /* Get LPM Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. + /**< Status of the Get LPM request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4070,7 +4082,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. + /**< Type of server. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4121,7 +4133,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4141,7 +4153,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. + /**< Type of server, as defined in qmiLocServerTypeEnumT. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4156,7 +4168,7 @@ typedef struct { qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; /**< Type of address the client wants. If unspecified, the indication will contain all the types of addresses - it has for the specified server type. + it has for the specified server type. Valid bitmasks: \n - 0x01 -- IPV4 \n @@ -4177,13 +4189,13 @@ typedef struct { /* Mandatory */ /* Get Server Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. + /**< Status of the Get Server request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4193,7 +4205,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. + /**< Type of server, as defined in qmiLocServerTypeEnumT. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4220,7 +4232,7 @@ typedef struct { char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; /**< URL. \begin{itemize1} - \item Type: NULL-terminated string + \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} */ @@ -4283,7 +4295,7 @@ typedef struct { uint16_t gnssSvId; /**< SV ID of the satellite whose data is to be deleted. \begin{itemize1} - \item Range: \begin{itemize1} + \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 @@ -4293,11 +4305,11 @@ typedef struct { /**< Indicates to which constellation this SV belongs. Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS \vspace{-0.18in} \end{itemize1} */ @@ -4306,7 +4318,7 @@ typedef struct { is to be deleted. \n Valid values: \n - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC + - 0x02 -- DELETE_ALMANAC */ }qmiLocDeleteSvInfoStructT_v02; /* Type */ /** @@ -4316,7 +4328,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; This command is used to delete the location engine +/** Request Message; This command is used to delete the location engine assistance data */ typedef struct { @@ -4326,9 +4338,9 @@ typedef struct { /**< Whether all assistance data is to be deleted. Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this message are ignored \item 0x00 (FALSE) -- The optional fields in the message are to be used to determine which data is to be deleted @@ -4339,26 +4351,26 @@ typedef struct { uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assistance data is to be deleted. + /**< \n List of satellites for which the assistance data is to be deleted. */ /* Optional */ /* Delete GNSS Data */ uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. + /**< Mask for the GNSS data that is to be deleted. Valid values: \begin{itemize1} \item 0x00000001 -- DELETE_GPS_SVDIR - \item 0x00000002 -- DELETE_GPS_SVSTEER + \item 0x00000002 -- DELETE_GPS_ SVSTEER \item 0x00000004 -- DELETE_GPS_TIME - \item 0x00000008 -- DELETE_GPS_ALM_CORR - \item 0x00000010 -- DELETE_GLO_SVDIR - \item 0x00000020 -- DELETE_GLO_SVSTEER + \item 0x00000008 -- DELETE_GPS_ALM_ CORR + \item 0x00000010 -- DELETE_GLO_ SVDIR + \item 0x00000020 -- DELETE_GLO_ SVSTEER \item 0x00000040 -- DELETE_GLO_TIME - \item 0x00000080 -- DELETE_GLO_ALM_CORR - \item 0x00000100 -- DELETE_SBAS_SVDIR - \item 0x00000200 -- DELETE_SBAS_SVSTEER + \item 0x00000080 -- DELETE_GLO_ALM_ CORR + \item 0x00000100 -- DELETE_SBAS_ SVDIR + \item 0x00000200 -- DELETE_SBAS_ SVSTEER \item 0x00000400 -- DELETE_POSITION \item 0x00000800 -- DELETE_TIME \item 0x00001000 -- DELETE_IONO @@ -4366,8 +4378,8 @@ typedef struct { \item 0x00004000 -- DELETE_HEALTH \item 0x00008000 -- DELETE_SADATA \item 0x00010000 -- DELETE_RTI - \item 0x00020000 -- DELETE_SV_NO_EXIST - \item 0x00040000 -- DELETE_FREQ_BIAS_EST + \item 0x00020000 -- DELETE_SV_NO_ EXIST + \item 0x00040000 -- DELETE_FREQ_ BIAS_EST \vspace{-0.18in} \end{itemize1} */ @@ -4378,16 +4390,16 @@ typedef struct { /**< Mask for the cell database assistance data that is to be deleted. Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CELLDB_POS - \item 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS - \item 0x00000004 -- DELETE_CELLDB_OTA_POS - \item 0x00000008 -- DELETE_CELLDB_EXT_REF_POS - \item 0x00000010 -- DELETE_CELLDB_TIMETAG - \item 0x00000020 -- DELETE_CELLDB_CELLID - \item 0x00000040 -- DELETE_CELLDB_CACHED_CELLID - \item 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL - \item 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL - \item 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + \item 0x00000001 -- DELETE_CELLDB_ POS + \item 0x00000002 -- DELETE_CELLDB_ LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_ OTA_POS + \item 0x00000008 -- DELETE_CELLDB_ EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_ TIMETAG + \item 0x00000020 -- DELETE_CELLDB_ CELLID + \item 0x00000040 -- DELETE_CELLDB_ CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_ LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_ CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_ NEIGHBOR_INFO \vspace{-0.18in} \end{itemize1} */ @@ -4398,17 +4410,17 @@ typedef struct { /**< Mask for the clock information assistance data that is to be deleted. Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST - \item 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST - \item 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER - \item 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME - \item 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER - \item 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST - \item 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST - \item 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER - \item 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER - \item 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY - \item 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + \item 0x00000001 -- DELETE_CLOCK_ INFO_TIME_EST + \item 0x00000002 -- DELETE_CLOCK_ INFO_FREQ_EST + \item 0x00000004 -- DELETE_CLOCK_ INFO_WEEK_NUMBER + \item 0x00000008 -- DELETE_CLOCK_ INFO_RTC_TIME + \item 0x00000010 -- DELETE_CLOCK_ INFO_TIME_TRANSFER + \item 0x00000020 -- DELETE_CLOCK_ INFO_GPSTIME_EST + \item 0x00000040 -- DELETE_CLOCK_ INFO_GLOTIME_EST + \item 0x00000080 -- DELETE_CLOCK_ INFO_GLODAY_NUMBER + \item 0x00000100 -- DELETE_CLOCK_ INFO_GLO4YEAR_NUMBER + \item 0x00000200 -- DELETE_CLOCK_ INFO_GLO_RF_GRP_DELAY + \item 0x00000400 -- DELETE_CLOCK_ INFO_DISABLE_TT \vspace{-0.18in} \end{itemize1} */ }qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ @@ -4419,20 +4431,20 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; This command is used to delete the location engine +/** Indication Message; This command is used to delete the location engine assistance data */ typedef struct { /* Mandatory */ /* Delete Assist Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. + /**< Status of the Delete Assist Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4469,13 +4481,13 @@ typedef struct { /* Mandatory */ /* Set XTRA-T Session Control Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. + /**< Status of the Set XTRA-T Session Control request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4502,13 +4514,13 @@ typedef struct { /* Mandatory */ /* Get XTRA-T Session Control Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. + /**< Status of the Get XTRA-T Session Control request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4533,8 +4545,8 @@ typedef struct { typedef struct { uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are synchronized. */ }qmiLocWifiFixTimeStructT_v02; /* Type */ /** @@ -4573,7 +4585,7 @@ typedef struct { double lon; /**< WiFi position longitude. \n - - Type: Floating point \n + - Type: Floating point \n - Units: Degrees */ uint16_t hepe; @@ -4584,18 +4596,18 @@ typedef struct { /**< Number of Access Points (AP) used to generate a fix. */ qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position + /**< WiFi position error code; set to 0 if the fix succeeds. This position is only used by a module if the value is 0. If there was a failure, the error code provided by the WiFi positioning system can be provided - here. + here. Valid values: \begin{itemize1} \item 0x00000000 -- ERROR_SUCCESS - \item 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE - \item 0x00000002 -- ERROR_NO_AP_FOUND - \item 0x00000003 -- ERROR_UNAUTHORIZED - \item 0x00000004 -- ERROR_SERVER_UNAVAILABLE - \item 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED + \item 0x00000001 -- ERROR_WIFI_NOT_ AVAILABLE + \item 0x00000002 -- ERROR_NO_AP_ FOUND + \item 0x00000003 -- ERROR_ UNAUTHORIZED + \item 0x00000004 -- ERROR_SERVER_ UNAVAILABLE + \item 0x00000005 -- ERROR_LOCATION_ CANNOT_BE_DETERMINED \item 0x00000006 -- ERROR_UNKNOWN \vspace{-0.18in} \end{itemize1} */ @@ -4615,7 +4627,7 @@ typedef uint8_t qmiLocWifiApQualifierMaskT_v02; typedef struct { uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n + /**< Associated MAC address of the AP. \n - Type: Array of unsigned integers \n - Address length: 6 */ @@ -4628,7 +4640,7 @@ typedef struct { /**< WiFi channel on which a beacon was received. */ qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. + /**< A bitmask of Boolean qualifiers for APs. All unused bits in this mask must be set to 0. Valid values: \n @@ -4671,14 +4683,14 @@ typedef struct { /* Horizontal Reliability */ uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. + /**< Specifies the reliability of the horizontal position. Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ @@ -4695,13 +4707,13 @@ typedef struct { /* Mandatory */ /* Inject WiFi Position Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. + /**< Status of the Inject WiFi Position request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4734,11 +4746,11 @@ typedef struct { /* Mandatory */ /* Availablility of WiFi */ qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. + /**< WiFi status information. Valid values: \begin{itemize1} - \item 0x00000001 -- WIFI_STATUS_AVAILABLE - \item 0x00000002 -- WIFI_STATUS_UNAVAILABLE + \item 0x00000001 -- WIFI_STATUS_ AVAILABLE + \item 0x00000002 -- WIFI_STATUS_ UNAVAILABLE \vspace{-0.18in} \end{itemize1} */ }qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ @@ -4755,13 +4767,13 @@ typedef struct { /* Mandatory */ /* Status of Notify WiFi Status Request */ qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. + /**< Status of the Notify WiFi Status request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4788,13 +4800,13 @@ typedef struct { /* Mandatory */ /* Get Registered Events Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. + /**< Status of the Get Registered Events request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4805,55 +4817,55 @@ typedef struct { /* Event Registration Mask */ uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. + /**< Event registration mask. Valid bitmasks: \n - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. + position and satellites in view. The report is at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. + event indications. - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. + event indications. - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. + event indications. - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to establish a connection with a location server. - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. + or leaves the perimeter of a Geofence. - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. + this event out to control the injection of pedometer reports. - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data control requests from the location engine. Location engine sends - this event out to control the injection of motion data. + this event out to control the injection of motion data. */ }qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ /** @@ -4890,16 +4902,16 @@ typedef struct { /* Mandatory */ /* Operation Mode */ qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. + /**< Preferred operation mode. \label{operationMode} Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000001 -- OPER_MODE_ DEFAULT \item 0x00000002 -- OPER_MODE_MSB \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN + \item 0x00000004 -- OPER_MODE_ STANDALONE + \item 0x00000005 -- OPER_MODE_ CELL_ID + \item 0x00000006 -- OPER_MODE_ WWAN \vspace{-0.18in} \end{itemize1} */ }qmiLocSetOperationModeReqMsgT_v02; /* Message */ @@ -4918,13 +4930,13 @@ typedef struct { /* Mandatory */ /* Set Operation Mode Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - + /**< Status of the Set Operation Mode request. + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4950,13 +4962,13 @@ typedef struct { /* Mandatory */ /* Get Operation Mode Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. + /**< Status of the Get Operation Mode request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -4967,15 +4979,15 @@ typedef struct { /* Operation Mode */ uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. + /**< Current operation mode. Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_DEFAULT + \item 0x00000001 -- OPER_MODE_ DEFAULT \item 0x00000002 -- OPER_MODE_MSB \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_STANDALONE - \item 0x00000005 -- OPER_MODE_CELL_ID - \item 0x00000006 -- OPER_MODE_WWAN + \item 0x00000004 -- OPER_MODE_ STANDALONE + \item 0x00000005 -- OPER_MODE_ CELL_ID + \item 0x00000006 -- OPER_MODE_ WWAN \vspace{-0.18in} \end{itemize1} */ }qmiLocGetOperationModeIndMsgT_v02; /* Message */ @@ -5003,7 +5015,7 @@ typedef struct { /* Confidence */ uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n + /**< Confidence in the Stationary state expressed as a percentage.\n - Range: 0 to 100 */ }qmiLocSetSpiStatusReqMsgT_v02; /* Message */ /** @@ -5026,7 +5038,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5048,7 +5060,7 @@ typedef uint8_t qmiLocSensorDataFlagMaskT_v02; typedef enum { QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified */ - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and + eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and the location engine */ QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSensorDataTimeSourceEnumT_v02; @@ -5062,8 +5074,8 @@ typedef enum { typedef struct { uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor data sample.\n + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor data sample.\n - Units: Milliseconds */ float xAxis; @@ -5072,12 +5084,12 @@ typedef struct { - Units Gyroscope: ( (rads)/(seconds) ) */ float yAxis; - /**< Sensor y-axis sample. \n + /**< Sensor y-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - Units Gyroscope: ( (rads)/(seconds) ) */ float zAxis; - /**< Sensor z-axis sample. \n + /**< Sensor z-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - Units Gyroscope: ( (rads)/(seconds) ) */ }qmiLoc3AxisSensorSampleStructT_v02; /* Type */ @@ -5091,18 +5103,18 @@ typedef struct { typedef struct { uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message.The timestamp is in the time reference scale that is - used by the sensor time source.\n + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message.The timestamp is in the time reference scale that is + used by the sensor time source.\n - Units: Milliseconds */ qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. Valid bitmasks: \begin{itemize1} \item 0x01 -- SIGN_REVERSAL - \item 0X02 -- SENSOR_TIME_IS_MODEM_TIME + \item 0X02 -- SENSOR_TIME_IS_ MODEM_TIME \vspace{-0.18in} \end{itemize1} */ uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ @@ -5120,9 +5132,9 @@ typedef struct { typedef struct { uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor sample.\n - - Type: Unsigned integer \n + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor sample.\n + - Type: Unsigned integer \n - Units: Milliseconds */ float temperature; @@ -5142,17 +5154,17 @@ typedef struct { qmiLocSensorDataTimeSourceEnumT_v02 timeSource; /**< Denotes the time source of the sensor data. Location service will use - this field to identify the time reference used in the + this field to identify the time reference used in the sensor data timestamps. Values :\n - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine */ uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message. The timestamp is in the time reference scale that is - used by the sensor time source.\n + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message. The timestamp is in the time reference scale that is + used by the sensor time source.\n - Type: Unsigned integer \n - Units: Milliseconds */ @@ -5177,7 +5189,7 @@ typedef struct { uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ uint32_t opaqueIdentifier; /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the + in the indication so the client can relate the indication to the request. */ /* Optional */ @@ -5198,10 +5210,10 @@ typedef struct { qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; /**< Time source for the 3-axis accelerometer data. Location service will use this field to identify the time reference used in the accelerometer data - timestamps. If not specified the location service will assume that the + timestamps. If not specified the location service will assume that the time source for the accelereometer data is unknown. Values: \n - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and the location engine */ @@ -5210,11 +5222,11 @@ typedef struct { uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; /**< Time source for the 3-axis gyroscope data. Location service will use - this field to identify the time reference used in the gyroscope data - timestamps.If not specified the locations ervice will assume that the + this field to identify the time reference used in the gyroscope data + timestamps.If not specified the locations ervice will assume that the time source for the gyroscope data is unknown. Values: \n - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and the location engine */ @@ -5246,13 +5258,13 @@ typedef struct { /* Mandatory */ /* Inject Sensor Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. + /**< Status of the Inject Sensor Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5270,7 +5282,7 @@ typedef struct { /* Accelerometer Samples Accepted */ uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples + /**< Lets the client know how many 3-axis accelerometer samples were accepted. This field is present only if the accelerometer samples were sent in the request. */ @@ -5278,7 +5290,7 @@ typedef struct { /* Gyroscope Samples Accepted */ uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were + /**< Lets the client know how many 3-axis gyroscope samples were accepted. This field is present only if the gyroscope samples were sent in the request. */ @@ -5286,7 +5298,7 @@ typedef struct { /* Accelerometer Samples Accepted */ uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ uint8_t accelTemperatureSamplesAccepted; - /**< This field lets the client know how many accelerometer temperature + /**< This field lets the client know how many accelerometer temperature samples were accepted. This field is present only if the accelerometer temperature samples were sent in the request. */ @@ -5294,7 +5306,7 @@ typedef struct { /* Gyroscope Temperature Samples Accepted */ uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ uint8_t gyroTemperatureSamplesAccepted; - /**< This field lets the client know how many gyroscope temperature samples + /**< This field lets the client know how many gyroscope temperature samples were accepted. This field is present only if the gyroscope temperature samples were sent in the request. */ }qmiLocInjectSensorDataIndMsgT_v02; /* Message */ @@ -5319,7 +5331,7 @@ typedef struct { uint32_t sensorProcRxTime; /**< Value of the sensor time when the control point received the Time Sync Inject request from the GNSS location engine. - + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - Units: Milliseconds */ @@ -5327,8 +5339,8 @@ typedef struct { /* Mandatory */ /* Sensor Transmit Time */ uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n @@ -5347,13 +5359,13 @@ typedef struct { /* Mandatory */ /* Inject Time Sync Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. + /**< Status of the Inject Time Sync Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5387,20 +5399,20 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the current +/** Indication Message; Used by the control point to get the current cradle mount configuration. */ typedef struct { /* Mandatory */ /* Get Cradle Mount Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. + /**< Status of the Get Cradle Mount Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5414,9 +5426,9 @@ typedef struct { /**< Cradle Mount state set by the control point. Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_ MOUNTED + \item 0x00000002 -- CRADLE_STATE_ UNKNOWN \vspace{-0.18in} \end{itemize1} */ @@ -5434,7 +5446,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to set the current +/** Request Message; Used by the control point to set the current cradle mount configuration. */ typedef struct { @@ -5444,9 +5456,9 @@ typedef struct { /**< Cradle Mount state set by the control point. Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_MOUNTED - \item 0x00000002 -- CRADLE_STATE_UNKNOWN + \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_ MOUNTED + \item 0x00000002 -- CRADLE_STATE_ UNKNOWN \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -5463,7 +5475,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to set the current +/** Indication Message; Used by the control point to set the current cradle mount configuration. */ typedef struct { @@ -5476,7 +5488,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5510,20 +5522,20 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the current +/** Indication Message; Used by the control point to get the current external power configuration. */ typedef struct { /* Mandatory */ /* Get Ext Power Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. + /**< Status of the Get External Power Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5537,9 +5549,9 @@ typedef struct { /**< Power state; injected by the control point. Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN \vspace{-0.18in} \end{itemize1} */ }qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ @@ -5550,7 +5562,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to set the current +/** Request Message; Used by the control point to set the current external power configuration. */ typedef struct { @@ -5560,9 +5572,9 @@ typedef struct { /**< Power state; injected by the control point. Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_POWER_UNKNOWN + \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN \vspace{-0.18in} \end{itemize1} */ }qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ @@ -5573,20 +5585,20 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to set the current +/** Indication Message; Used by the control point to set the current external power configuration. */ typedef struct { /* Mandatory */ /* Set Ext Power Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. + /**< Status of the Set External Power Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5655,9 +5667,9 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ typedef struct { @@ -5703,9 +5715,9 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ typedef struct { @@ -5718,7 +5730,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5762,7 +5774,7 @@ typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set in the LPP configuration for this to take effect. */ /** @addtogroup loc_qmi_enums @{ @@ -5806,7 +5818,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to configure parameters stored +/** Request Message; Used by the control point to configure parameters stored in the nonvolatile memory. */ typedef struct { @@ -5827,8 +5839,8 @@ typedef struct { /**< VX version. Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY + \item 0x00000001 -- VX_VERSION_ V1_ONLY + \item 0x00000002 -- VX_VERSION_ V2_ONLY \vspace{-0.18in} \end{itemize1} */ @@ -5838,7 +5850,7 @@ typedef struct { qmiLocSuplVersionEnumT_v02 suplVersion; /**< SUPL version. - Valid values: \n + Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ @@ -5850,8 +5862,8 @@ typedef struct { /**< LTE Positioning Profile (LPP) configuration. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} */ @@ -5859,15 +5871,15 @@ typedef struct { /* Assisted GLONASS Protocol Mask */ uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports + /**< Configures the protocols that the location service supports for assisted GLONASS. Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. */ /* Optional */ @@ -5875,8 +5887,8 @@ typedef struct { uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ /* Optional */ @@ -5886,8 +5898,8 @@ typedef struct { /**< SUPL TLS (Transport Layer Security) Version. This configuration is only applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 */ /* Optional */ @@ -5895,12 +5907,12 @@ typedef struct { uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; /**< Configures the protocol to be used during emergency. - Note: Currently only can select on WCDMA. FOR GSM and 1x UE + Note: Currently only can select on WCDMA. FOR GSM and 1x UE will always allow only Control plane NI trigger for positioning. - For LTE, UE Can allow either SUPL or Control plane NI trigger. + For LTE, UE Can allow either SUPL or Control plane NI trigger. Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA */ }qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @@ -5919,7 +5931,7 @@ typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to configure parameters stored +/** Indication Message; Used by the control point to configure parameters stored in the nonvolatile memory. */ typedef struct { @@ -5932,7 +5944,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -5944,17 +5956,17 @@ typedef struct { uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not a success. + is sent only if the status is not a success. Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. */ }qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @@ -5964,7 +5976,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the configuration +/** Request Message; Used by the control point to get the configuration parameters stored in the nonvolatile memory. */ typedef struct { @@ -5974,14 +5986,14 @@ typedef struct { /**< Mask denoting the configuration parameters to be retrieved. Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. */ }qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @@ -5991,7 +6003,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the configuration +/** Indication Message; Used by the control point to get the configuration parameters stored in the nonvolatile memory. */ typedef struct { @@ -6004,7 +6016,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6028,8 +6040,8 @@ typedef struct { /**< VX version. Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ONLY - \item 0x00000002 -- VX_VERSION_V2_ONLY + \item 0x00000001 -- VX_VERSION_V1_ ONLY + \item 0x00000002 -- VX_VERSION_V2_ ONLY \vspace{-0.18in} \end{itemize1} */ @@ -6039,7 +6051,7 @@ typedef struct { qmiLocSuplVersionEnumT_v02 suplVersion; /**< SUPL version. - Valid values: \n + Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ @@ -6051,8 +6063,8 @@ typedef struct { /**< LTE Positioning Profile (LPP) configuration. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ENABLE_CONTROL_PLANE + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE \vspace{-0.18in} \end{itemize1} */ @@ -6063,11 +6075,11 @@ typedef struct { /**< Assisted GLONASS Protocol mask. Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. */ /* Optional */ @@ -6075,8 +6087,8 @@ typedef struct { uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ /* Optional */ @@ -6086,8 +6098,8 @@ typedef struct { /**< SUPL TLS (Transport Layer Security) Version. This configuration is only applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 */ /* Optional */ @@ -6096,8 +6108,8 @@ typedef struct { qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; /**< The protocol to be used during emergency. Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA */ }qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @@ -6132,17 +6144,17 @@ typedef struct { /* Sensors Usage */ uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning + /**< Controls how sensors are used to aid heading and positioning performance. Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: + \item 0x00000000 -- SENSORS_USE_ ENABLED: Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in heading and + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in heading and position improvement. \vspace{-0.18in} \end{itemize1} */ @@ -6166,7 +6178,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6198,7 +6210,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6209,17 +6221,17 @@ typedef struct { /* Sensors Usage */ uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning + /**< Controls how sensors are used to aid the heading and positioning performance. Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ENABLED: + \item 0x00000000 -- SENSORS_USE_ ENABLED: Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_DISABLED: - Inertial sensors are not to be used to aid in the heading and + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in the heading and position improvement. \vspace{-0.18in} \end{itemize1} */ @@ -6237,7 +6249,7 @@ typedef uint32_t qmiLocSensorPropertiesMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Sets the properties specific to the type of sensor used. +/** Request Message; Sets the properties specific to the type of sensor used. The control point must set sensor properties before they can be used to aid in heading and positioning performance improvement. */ @@ -6250,9 +6262,9 @@ typedef struct { /**< Specifies the gyro bias random walk variance parameter as a positive floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - + */ /* Optional */ @@ -6262,9 +6274,9 @@ typedef struct { /**< Specifies the velocity random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 - + */ /* Optional */ @@ -6274,9 +6286,9 @@ typedef struct { /**< Specifies the acceleration random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 - + */ /* Optional */ @@ -6286,9 +6298,9 @@ typedef struct { /**< Specifies the angle random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 - + */ /* Optional */ @@ -6298,9 +6310,9 @@ typedef struct { /**< Specifies the rate random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - + */ }qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ /** @@ -6310,7 +6322,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Sets the properties specific to the type of sensor used. +/** Indication Message; Sets the properties specific to the type of sensor used. The control point must set sensor properties before they can be used to aid in heading and positioning performance improvement. */ @@ -6325,11 +6337,11 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \item 0x00000007 -- CONFIG_NOT_ SUPPORTED \vspace{-0.18in} \end{itemize1} */ @@ -6337,15 +6349,15 @@ typedef struct { /* Failed Set Sensor Properties */ uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field will be sent only if the status is not a success. + /**< This field will be sent only if the status is not a success. Identifies the parameters that were not set successfully. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ @@ -6365,11 +6377,11 @@ typedef struct { /**< Mask denoting the sensor properties parameters to be retrieved. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000004 -- ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000008 -- ANGLE_RANDOM_WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_WALK_SPECTRAL_DENSITY + \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY \vspace{-0.18in} \end{itemize1} */ }qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ @@ -6392,11 +6404,11 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_SUPPORTED + \item 0x00000007 -- CONFIG_NOT_ SUPPORTED \vspace{-0.18in} \end{itemize1} */ @@ -6407,9 +6419,9 @@ typedef struct { /**< Specifies the gyro bias random walk variance parameter as a positive floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - + */ /* Optional */ @@ -6419,7 +6431,7 @@ typedef struct { /**< Specifies the velocity random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 */ @@ -6431,7 +6443,7 @@ typedef struct { /**< Specifies the acceleration random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 */ @@ -6443,7 +6455,7 @@ typedef struct { /**< Specifies the angle random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 */ @@ -6455,9 +6467,9 @@ typedef struct { /**< Specifies the rate random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - + */ }qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ /** @@ -6489,7 +6501,7 @@ typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Provides fine-grained control of sensor based positioning +/** Request Message; Provides fine-grained control of sensor based positioning performance */ typedef struct { @@ -6500,13 +6512,13 @@ typedef struct { /**< Controls when sensors data is requested during GNSS fix processing. This field is relevant only when sensors have been enabled using the sensors control configuration. - + Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data + The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time + The GNSS location engine must request use of sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} */ @@ -6518,10 +6530,10 @@ typedef struct { /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location engine is to request acceleration data to be used by the low data rate filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ @@ -6531,10 +6543,10 @@ typedef struct { /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location engine is to request gyro data to be used by the high data rate filter. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ @@ -6544,7 +6556,7 @@ typedef struct { /**< Sets which sensor algorithms are to be used when processing sensor data. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} */ @@ -6552,26 +6564,26 @@ typedef struct { /* High Data Rate Filter Accelerometer Sampling Specification */ uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ }qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ /** @@ -6588,7 +6600,7 @@ typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Provides fine-grained control of sensor based positioning +/** Indication Message; Provides fine-grained control of sensor based positioning performance */ typedef struct { @@ -6601,7 +6613,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6617,12 +6629,12 @@ typedef struct { Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- PERFORMANCE_MODE - \item 0x00000002 -- ACCEL_SAMPLING_SPEC - \item 0x00000004 -- GYRO_SAMPLING_SPEC - \item 0x00000008 -- ALGORITHM_CONFIG - \item 0x00000010 -- ACCEL_SAMPLING_SPEC_HIGH - \item 0x00000020 -- GYRO_SAMPLING_SPEC_HIGH + \item 0x00000001 -- PERFORMANCE_ MODE + \item 0x00000002 -- ACCEL_SAMPLING_ SPEC + \item 0x00000004 -- GYRO_SAMPLING_ SPEC + \item 0x00000008 -- ALGORITHM_ CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_ SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_ SPEC_HIGH \vspace{-0.18in} \end{itemize1} */ }qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ @@ -6639,7 +6651,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Retrieves the current sensor performance control +/** Indication Message; Retrieves the current sensor performance control configuration. */ typedef struct { @@ -6652,7 +6664,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6669,10 +6681,10 @@ typedef struct { Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data + The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time + The GNSS location engine must request use of the sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} */ @@ -6681,26 +6693,26 @@ typedef struct { /* Accelerometer Sampling Specification */ uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. + Default: 10 Hz sampling rate and 2Hz batching rate. */ /* Optional */ /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ @@ -6710,7 +6722,7 @@ typedef struct { /**< Informs which sensor algorithms are currently set. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_POSITIONING_FILTER + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER \vspace{-0.18in} \end{itemize1} */ @@ -6718,26 +6730,26 @@ typedef struct { /* High Data Rate Filter Accelerometer Sampling Specification */ uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ }qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @@ -6762,7 +6774,7 @@ typedef struct { uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; /**< SUPL certificate contents. \n - - Type: Array of bytes. \n + - Type: Array of bytes. \n - Maximum certificate size: 2000 bytes */ }qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ /** @@ -6779,12 +6791,12 @@ typedef struct { /* SUPL Certificate Injection Status */ qmiLocStatusEnumT_v02 status; /**< Status of the Inject SUPL Certificate request. - + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6808,7 +6820,7 @@ typedef struct { /**< Certificate ID of the SUPL certificate to be deleted. \n - Units: Bytes \n - Range: 0 to 9 \n - If suplCertId is not specified, + If suplCertId is not specified, all SUPL certificates are deleted. */ }qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ /** @@ -6830,7 +6842,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6842,16 +6854,16 @@ typedef struct { */ typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the injected position in a direct position calculation. */ #define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data in persistent memory. */ /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to configure position engine +/** Request Message; Used by the control point to configure position engine functionality. */ typedef struct { @@ -6862,7 +6874,7 @@ typedef struct { /**< Controls how the injected position is used in the position engine. Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position + \item 0x01 (TRUE) -- Use the injected position in a direct position calculation \item 0x00 (FALSE) -- Do not use the injected position in a direct position calculation @@ -6887,7 +6899,7 @@ typedef struct { /* Store Assist Data */ uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in + /**< Controls whether assistance data is to be stored in persistent memory. Valid values: \begin{itemize1} @@ -6904,7 +6916,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to configure position engine +/** Indication Message; Used by the control point to configure position engine functionality. */ typedef struct { @@ -6917,7 +6929,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6932,9 +6944,9 @@ typedef struct { This field is sent only if the status is other than SUCCESS. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000001 -- INJECTED_ POSITION_CONTROL \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA + \item 0x00000004 -- STORE_ASSIST_ DATA \vspace{-0.18in} \end{itemize1} */ }qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ @@ -6945,7 +6957,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the position engine +/** Request Message; Used by the control point to get the position engine configuration parameters. */ typedef struct { @@ -6955,9 +6967,9 @@ typedef struct { /**< Mask denoting the configuration parameters to be retrieved. Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_POSITION_CONTROL + \item 0x00000001 -- INJECTED_ POSITION_CONTROL \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_DATA + \item 0x00000004 -- STORE_ASSIST_ DATA \vspace{-0.18in} \end{itemize1} */ }qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ @@ -6968,7 +6980,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the position engine +/** Indication Message; Used by the control point to get the position engine configuration parameters. */ typedef struct { @@ -6981,7 +6993,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -6992,7 +7004,7 @@ typedef struct { /* Injected Position Control */ uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation + /**< Specifies whether the injected position is used for a direct calculation in the position engine. Valid values: \begin{itemize1} @@ -7008,7 +7020,7 @@ typedef struct { /* Filter SV Usage */ uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. + /**< Specifies whether SV usage is filtered in a position fix. Valid values: \begin{itemize1} \item 0x01 (TRUE) -- SV usage is filtered in the fix @@ -7068,7 +7080,7 @@ typedef enum { QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with low confidence. This setting results in lower - power usage. This setting can impact the "yield" because + power usage. This setting can impact the "yield" because incorrect breach events may be sent. */ eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with medium confidence. This is the default setting. */ @@ -7135,15 +7147,15 @@ typedef struct { /**< Specifies the breach events in which the client is interested. Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK \vspace{-0.18in} \end{itemize1} */ /* Mandatory */ /* Include Position in Breach Event */ uint8_t includePosition; /**< Specifies whether the Geofence engine is to include the position - in a breach event. + in a breach event. Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Position will be reported with the breach event @@ -7155,30 +7167,30 @@ typedef struct { /* Responsiveness */ uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. + /**< Specifies the rate of detection for a Geofence breach. This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications + when it is reported. This parameter has power implications and is to be fine-tuned to optimize power savings. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_RESPONSIVENESS_LOW - \item 0x00000002 -- GEOFENCE_RESPONSIVENESS_MED - \item 0x00000003 -- GEOFENCE_RESPONSIVENESS_HIGH + \item 0x00000001 -- GEOFENCE_ RESPONSIVENESS_LOW + \item 0x00000002 -- GEOFENCE_ RESPONSIVENESS_MED + \item 0x00000003 -- GEOFENCE_ RESPONSIVENESS_HIGH \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Confidence */ uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and is to be fine-tuned to optimize power savings. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_CONFIDENCE_LOW - \item 0x00000002 -- GEOFENCE_CONFIDENCE_MED - \item 0x00000003 -- GEOFENCE_CONFIDENCE_HIGH + \item 0x00000001 -- GEOFENCE_ CONFIDENCE_LOW + \item 0x00000002 -- GEOFENCE_ CONFIDENCE_MED + \item 0x00000003 -- GEOFENCE_ CONFIDENCE_HIGH \vspace{-0.18in} \end{itemize1} */ }qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ /** @@ -7200,11 +7212,11 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_MEMORY + \item 0x00000008 -- INSUFFICIENT_ MEMORY \vspace{-0.18in} \end{itemize1} */ @@ -7220,7 +7232,7 @@ typedef struct { /* Geofence ID */ uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. + /**< Geofence identifier allocated by the engine. The client must include this identifier in all transactions pertaining to this Geofence. */ }qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ @@ -7265,7 +7277,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -7352,7 +7364,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -7379,8 +7391,8 @@ typedef struct { /**< Originator of the Geofence. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ORIGIN_NETWORK - \item 0x00000002 -- GEOFENCE_ORIGIN_DEVICE + \item 0x00000001 -- GEOFENCE_ ORIGIN_NETWORK + \item 0x00000002 -- GEOFENCE_ ORIGIN_DEVICE \vspace{-0.18in} \end{itemize1} */ @@ -7389,11 +7401,11 @@ typedef struct { uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ qmiLocGeofencePositionEnumT_v02 posWrtGeofence; /**< Indicates if the client is currently inside or outside - the Geofence. + the Geofence. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_POSITION_INSIDE - \item 0x00000002 -- GEOFENCE_POSITION_OUTSIDE + \item 0x00000001 -- GEOFENCE_ POSITION_INSIDE + \item 0x00000002 -- GEOFENCE_ POSITION_OUTSIDE \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7408,8 +7420,8 @@ typedef struct { /**< Specifies whether the Geofence is to be actively monitored. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND \vspace{-0.18in} \end{itemize1} */ }qmiLocQueryGeofenceIndMsgT_v02; /* Message */ /** @@ -7442,8 +7454,8 @@ typedef struct { /**< Specifies whether the Geofence is to be actively monitored. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_SUSPEND + \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7453,8 +7465,8 @@ typedef struct { /**< Specifies the breach events in which the client is interested. Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_LEAVING_MASK + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK \vspace{-0.18in} \end{itemize1} */ }qmiLocEditGeofenceReqMsgT_v02; /* Message */ /** @@ -7479,7 +7491,7 @@ typedef struct { \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000005 -- PHONE_OFFLINE \item 0x00000006 -- TIMEOUT @@ -7507,8 +7519,8 @@ typedef struct { the Geofence parameter could not be edited. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_PARAM_MASK_GEOFENCE_STATE - \item 0x00000002 -- GEOFENCE_PARAM_MASK_BREACH_MASK + \item 0x00000001 -- GEOFENCE_PARAM_ MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_ MASK_BREACH_MASK \vspace{-0.18in} \end{itemize1} */ }qmiLocEditGeofenceIndMsgT_v02; /* Message */ /** @@ -7518,7 +7530,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the best available +/** Request Message; Used by the control point to get the best available position estimate from the location engine. */ typedef struct { @@ -7535,7 +7547,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the best available +/** Indication Message; Used by the control point to get the best available position estimate from the location engine. */ typedef struct { @@ -7667,13 +7679,13 @@ typedef struct { uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. - + Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH + \item 0x00000003 -- RELIABILITY_ MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7702,7 +7714,7 @@ typedef struct { uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ uint8_t vertConfidence; /**< Vertical uncertainty confidence. \n - - Units: Percent \n + - Units: Percent \n - Range: 0 to 99 */ /* Optional */ @@ -7712,10 +7724,10 @@ typedef struct { /**< Specifies the reliability of the vertical position. Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_SET - \item 0x00000001 -- RELIABILITY_VERY_LOW + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_MEDIUM + \item 0x00000003 -- RELIABILITY_ MEDIUM \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1}*/ @@ -7753,7 +7765,7 @@ typedef struct { /* Magnetic Deviation */ uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown + /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic north is east of true north. */ @@ -7767,9 +7779,9 @@ typedef struct { \item 0x00000001 -- SATELLITE \item 0x00000002 -- CELLID \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_LOCATION - \item 0x00000020 -- INJECTED_COARSE_POSITION + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_ LOCATION + \item 0x00000020 -- INJECTED_COARSE_ POSITION \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7788,26 +7800,26 @@ typedef struct { qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). - GNSS time is maintained irrespective of the GNSS receiver state + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state */ /* Optional */ @@ -7821,12 +7833,12 @@ typedef struct { uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following + used for calculating this position report. The following information is associated with each SV ID: \begin{itemize1} \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 + \item For GLONASS: 65 to 96 \item For QZSS: 193 to 197 \vspace{-0.18in} \end{itemize1} \end{itemize1} */ }qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ @@ -7871,79 +7883,79 @@ typedef enum { typedef struct { qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. \n + /**< Current motion state of the user. Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.06in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute + \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.1in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute rest by reducing probability_of_state. */ qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion. \n + /**< Modes of user motion. Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. + is in Pedestrian mode; nothing else is known about the movement. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. + is in Pedestrian Walking mode. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. + is in Pedestrian Running mode. \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.06in} \end{itemize1} - + in Vehicular mode; nothing else is known about the movement. + \vspace{0.1in} \end{itemize1} + The motion_mode value is independent of the motion_state value. */ float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.06in} + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.1in} - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.06in} + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.1in} It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.06in} + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} If the motion_state is not known, the value in this field is not used. */ uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. + /**< Age of the motion data in milliseconds at the time of injection. */ uint16_t timeout; /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is - received. \vspace{0.06in} + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is + received. \n - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the - state of the motion data, it is recommended that this field be set to 0. \vspace{0.06in} + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. */ }qmiLocMotionDataStructT_v02; /* Type */ /** @@ -7959,7 +7971,6 @@ typedef struct { /* Mandatory */ /* Motion Data */ qmiLocMotionDataStructT_v02 motion_data; - /**< Current motion data of the client */ }qmiLocInjectMotionDataReqMsgT_v02; /* Message */ /** @} @@ -7974,7 +7985,7 @@ typedef struct { /* Mandatory */ /* Inject Motion Data Request Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. + /**< Status of the Inject Motion Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -8015,7 +8026,7 @@ typedef struct { typedef struct { /* Mandatory */ - /* Get NI Geofence ID List status */ + /* Get NI Geofence ID List Status */ qmiLocStatusEnumT_v02 status; /**< Status of the Get NI Geofence ID List request. Valid values: \n @@ -8029,7 +8040,7 @@ typedef struct { /* Transaction ID */ uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI + /**< Transaction ID that was specified in the Get NI Geofence ID List request. */ /* Optional */ @@ -8038,7 +8049,7 @@ typedef struct { uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n + - Type: Array of unsigned 32-bit integers \n - Maximum NI Geofence ID List length: 16 */ }qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ /** @@ -8051,16 +8062,16 @@ typedef struct { typedef struct { uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 specification */ + /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ uint32_t MNC; - /**< GSM mobile network code. Refer to ITU-T E.212 specification*/ + /**< GSM mobile network code. Refer to \hyperref[R2]{[R2]}. */ uint32_t LAC; - /**< GSM location area code.Refer to ITU-T E.212 specification */ + /**< GSM location area code. Refer to \hyperref[R2]{[R2]}. */ uint32_t CID; - /**< GSM cell identification.Refer to ITU-T E.212 specification */ + /**< GSM cell identification. Refer to \hyperref[R2]{[R2]}. */ }qmiLocGSMCellIdStructT_v02; /* Type */ /** @} @@ -8069,23 +8080,30 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used to inject GSM Cell information into the location +/** Request Message; Injects GSM cell information into the location engine. */ typedef struct { /* Mandatory */ /* GSM Cell ID */ qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< Identifies the GSM Cell the device is currently camped on.*/ + /**< \n Identifies the GSM cell on which the device is currently camped. */ /* Mandatory */ /* Roaming Status */ uint8_t roamingStatus; /**< Whether the device is roaming. \begin{itemize1} - \item 0x01 (TRUE) -- The device is roaming. - \item 0x00 (FALSE) -- The device is not roaming. + \item 0x01 (TRUE) -- Device is roaming + \item 0x00 (FALSE) -- Device is not roaming \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Timing Advance */ + uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ + uint32_t timingAdvance; + /**< The round trip delay between the MS and the BS, in unit of 3.69 microseconds. + Refer to 3GPP TS 05.10 and TS 45.010 */ }qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ /** @} @@ -8094,7 +8112,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used to inject GSM Cell information into the location +/** Indication Message; Injects GSM cell information into the location engine. */ typedef struct { @@ -8103,24 +8121,242 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject GSM Cell Info request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ }qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ /** @} */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network */ + eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network. */ + QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocRoamingStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + + uint32_t mnc; + /**< WCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t cid; + /**< WCDMA Cell Identity. Refer to \hyperref[R2]{[R2]}. */ +}qmiLocWCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* WCDMA Cell ID */ + qmiLocWCDMACellIdStructT_v02 wcdmaCellId; + /**< \n Identifies the WCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Whether the device is roaming. + Valid values: \begin{itemize1} + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + its home network + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped + on a roaming network. + \vspace{0.1in} \end{itemize1} */ + + /* Optional */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ + + /* Optional */ + uint8_t psc_valid; /**< Must be set to true if psc is being passed */ + uint32_t psc; + /**< PrimaryScramblingCode of the serving cell. Valid range is 0 to 511. Refer to TS 25.331 */ +}qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject WCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WCDMA Cell Info request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + + uint32_t mnc; + /**< TDSCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t cid; + /**< TDSCDMA Cell Identity. Refer to TS 25.331. */ + + uint32_t lac; + /**< TDSCDMA location area code. Refer to \hyperref[R2]{[R2]}. */ +}qmiLocTDSCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* TDSCDMA Cell ID */ + qmiLocTDSCDMACellIdStructT_v02 tdscdmaCellId; + /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Whether the device is roaming. + Valid values: \begin{itemize1} + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + its home network + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped + on a roaming network. + \vspace{0.1in} \end{itemize1} */ + + /* Optional */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ +}qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject TDSCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject TDSCDMA Cell Info request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Optional */ + /* Preferred IMSI */ + uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ + uint64_t preferredIMSI; + /**< \n The IMSI number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ + + /* Optional */ + /* Preferred MSISDN */ + uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ + uint64_t preferredMSISDN; + /**< \n The MSISDN number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ +}qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Subscriber ID Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Subscriber ID request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ +/** + @} + */ + /** @addtogroup loc_qmi_enums @{ */ typedef enum { QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL netwrok initiated message is being injected. */ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL network-initiated message is being injected. */ QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; /** @@ -8130,24 +8366,25 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used to inject a network initiated message into the location +/** Request Message; Injects a network-initiated message into the location engine. */ typedef struct { /* Mandatory */ /* Injected Network Initiated Message Type */ qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; - /**< Type of the network initiated message being injected - Valid Values: - - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL netwrok initiated message is being injected. */ + /**< Type of the network-initiated message being injected. + + Valid values: + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL network-initiated message is being injected. */ /* Mandatory */ /* Injected Network Initiated Message */ uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network initiated message body. + /**< Network-initiated message body. If the inject NI message type is TYPE_SUPL, the message contains - a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C specification. */ + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ }qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ /** @} @@ -8156,7 +8393,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used to inject a network initiated message into the location +/** Indication Message; Injects a network-initiated message into the location engine. */ typedef struct { @@ -8165,14 +8402,15 @@ typedef struct { qmiLocStatusEnumT_v02 status; /**< Status of the Inject Network Initiated Message request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n - - 0x00000008 -- INSUFFICIENT_MEMORY \n */ + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_ MEMORY + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ /** @} @@ -8187,22 +8425,23 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used to notify the location engine that the device is - no longer camped. */ +/** Indication Message; Notifies the location engine that the device is out of + service. */ typedef struct { /* Mandatory */ /* Notify WWAN Out of Service Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WWAN out of service request. + /**< Status of the Notify WWAN Out of Service request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT \n + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ }qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ /** @@ -8220,18 +8459,18 @@ typedef struct { /* Time Source */ qmiLocSensorDataTimeSourceEnumT_v02 timeSource; /**< Time source for the pedometer. Location service will use - this field to identify the time reference used in the + this field to identify the time reference used in the pedometer data timestamp. Values: \n - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and the location engine*/ /* Mandatory */ /* Pedometer report timestamp */ uint32_t timestamp; /**< Timestamp of the last step event in this report, i.e timestamp - of the step event that caused this report to be generated. - The timestamp is in the time reference scale that is + of the step event that caused this report to be generated. + The timestamp is in the time reference scale that is used by the pedometer time source. \n - Unit: Milliseconds */ @@ -8240,7 +8479,7 @@ typedef struct { uint32_t timeInterval; /**< Time interval during which the step count was calculated. Subtracting timeInterval from the timestamp field will yield the the time when - the step detection for the first step in this report started. + the step detection for the first step in this report started. Unit : Milliseconds. */ /* Mandatory */ @@ -8505,26 +8744,35 @@ typedef struct { #define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F #define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F #define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02 0x0070 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02 0x0071 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02 0x0072 /** @} */ /* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor +/** @addtogroup wms_qmi_accessor @{ */ /** This function is used internally by the autogenerated code. Clients should use the macro loc_get_service_object_v02( ) that takes in no arguments. */ qmi_idl_service_object_type loc_get_service_object_internal_v02 ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ + +/** This macro should be used to get the service object */ #define loc_get_service_object_v02( ) \ loc_get_service_object_internal_v02( \ LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ LOC_V02_IDL_TOOL_VERS ) -/** - @} +/** + @} */ From b7b14cb1c6f6c70329a06cee5dac12d37b09c3ec Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 21 Jan 2013 18:00:45 -0800 Subject: [PATCH 082/945] gps: fix nmea altitude for rpc Change-Id: Ifcbde28717178b76bde03d02d3f9ffa8dae114fd --- .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp old mode 100644 new mode 100755 index af87ab99..d27c67ee --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -694,8 +694,8 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca #endif if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL) { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; - locationExtended.magneticDeviation = location_report_ptr->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 ) From b52741ec450459a2cae074e8f558babe03b39741 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 22 Jan 2013 14:11:18 -0800 Subject: [PATCH 083/945] default fix accuracy too high the default fix accuracy is set to 1000m, too high. Now set to eQMI_LOC_ACCURACY_HIGH_V02 Change-Id: I5bdcd1d2da0a68ca55a5b9eb1f9de9ac12238e9a --- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index ac886f94..5578291c 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -282,7 +282,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: startFix() start_msg.minInterval_valid = 1; start_msg.minInterval = fixCriteria.min_interval; - if (fixCriteria.preferred_accuracy > 0) { + if (fixCriteria.preferred_accuracy >= 0) { start_msg.horizontalAccuracyLevel_valid = 1; if (fixCriteria.preferred_accuracy <= 100) From e03abb4da80c05a4c4f4b9e680ab43996daff8cb Mon Sep 17 00:00:00 2001 From: Amol Mahesh Date: Thu, 24 Jan 2013 14:32:42 -0800 Subject: [PATCH 084/945] LOC: Enable loc_eng_dmn_conn_loc_api_server for all targets Enable loc_eng_dmn_conn_loc_api_server for all targets irrespective of the ro.baseband property. Change-Id: Ieb9e505f27d0fc7abf4a94bac64dee60cccc4302 --- loc_api/libloc_api_50001/Android.mk | 11 ----------- loc_api/libloc_api_50001/loc_eng.cpp | 29 +++------------------------- 2 files changed, 3 insertions(+), 37 deletions(-) mode change 100644 => 100755 loc_api/libloc_api_50001/Android.mk diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk old mode 100644 new mode 100755 index 97f0488d..3ea5e918 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -1,13 +1,6 @@ ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image -BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion -BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 -BIT_ENABLED_BOARD_PLATFORM_LIST += msm8960 -ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) -FEATURE_GNSS_BIT_API := true -endif # is-board-platform-in-list - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -81,10 +74,6 @@ LOCAL_SRC_FILES += \ loc_eng_log.cpp \ loc_eng_nmea.cpp -ifeq ($(FEATURE_GNSS_BIT_API), true) -LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API -endif # FEATURE_GNSS_BIT_API - LOCAL_SRC_FILES += \ loc_eng_dmn_conn.cpp \ loc_eng_dmn_conn_handler.cpp \ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f2cbb699..5c37cbb6 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -491,17 +491,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.client_handle = NULL; } -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) - { - loc_eng_dmn_conn_loc_api_server_unblock(); - loc_eng_dmn_conn_loc_api_server_join(); - } - } -#endif /* FEATURE_GNSS_BIT_API */ + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); #endif @@ -899,22 +890,8 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac true); #endif -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0) || - (strcmp(baseband,"sglte") == 0) || - (strcmp(baseband,"msm") == 0)) - { - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); - } else { - LOC_LOGD("%s:%d] loc_eng_dmn_conn_loc_api_server was not initialized.baseband = %s\n", - __func__, __LINE__, baseband); - } - } -#endif /* FEATURE_GNSS_BIT_API */ loc_eng_agps_reinit(loc_eng_data); EXIT_LOG(%s, VOID_RET); From 9f8bcc3b142e28ca7d3c04e556dbb39435ddef1d Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 24 Dec 2012 14:43:42 -0800 Subject: [PATCH 085/945] Ulp: Adds interfacing b/w FusedLocationProv & ULP engine Changes for providing the plumbing from UlpService down to the native UlpEngine. Change-Id: I67e48fad47675d9fa9a3026763daa0f248369f60 CRs-Fixed: 443444 --- loc_api/Android.mk | 2 +- .../libloc_api-rpc-glue/Android.mk | 4 - .../src/LocApiRpcAdapter.cpp | 36 +- loc_api/libloc_api/loc_eng.cpp | 10 +- loc_api/libloc_api_50001/Android.mk | 11 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 14 +- loc_api/libloc_api_50001/LocApiAdapter.h | 6 +- loc_api/libloc_api_50001/loc.cpp | 204 ++++++--- loc_api/libloc_api_50001/loc.h | 5 +- loc_api/libloc_api_50001/loc_eng.cpp | 48 +- loc_api/libloc_api_50001/loc_eng.h | 19 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_msg.h | 58 +-- loc_api/libloc_api_50001/loc_eng_msg_id.h | 5 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 48 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 2 +- loc_api/libloc_api_50001/loc_ulp.h | 418 ++++++++++++++++++ loc_api/loc_api_v02/Android.mk | 4 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 34 +- 19 files changed, 677 insertions(+), 255 deletions(-) create mode 100644 loc_api/libloc_api_50001/loc_ulp.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 08e46129..ec271e24 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,7 +6,7 @@ GPS_DIR_LIST := FEATURE_IPV6 := true FEATURE_DELEXT := true -FEATURE_ULP := false +FEATURE_ULP := true # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index b12ceae6..ea23dadc 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -24,10 +24,6 @@ ifeq ($(FEATURE_IPV6), true) LOCAL_CFLAGS += -DFEATURE_IPV6 endif #FEATURE_IPV6 -ifeq ($(FEATURE_ULP), true) -LOCAL_CFLAGS += -DFEATURE_ULP -endif #FEATURE_ULP - LOCAL_SHARED_LIBRARIES:= \ librpc \ libutils \ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index af87ab99..bcd82ff2 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -627,7 +627,7 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca { LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; - GpsLocation location = {0}; + UlpLocation location = {0}; GpsLocationExtended locationExtended = {0}; location.size = sizeof(location); @@ -644,54 +644,52 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca (location_report_ptr->latitude != 0 || location_report_ptr->longitude != 0)) { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; + 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.timestamp = location_report_ptr->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.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->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_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; + location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); } // Heading if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->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.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->hor_unc_circular; + location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; + location.gpsLocation.accuracy = location_report_ptr->hor_unc_circular; } - // Technology Mask + // Technology Mask tech_Mask |= location_report_ptr->technology_mask; -#ifdef FEATURE_ULP //Mark the location source as from GNSS - location.flags |= LOCATION_HAS_SOURCE_INFO; + location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_GNSS; -#endif if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL) { locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; @@ -710,7 +708,7 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), - tech_Mask); + tech_Mask); } } else diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 98fef66f..944326b0 100644 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -78,8 +78,8 @@ static int loc_eng_agps_data_conn_failed(); static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); -static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, +static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, const rpc_loc_event_payload_u_type* loc_event_payload); static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); @@ -743,7 +743,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) { - GpsLocation location; + UlpLocation location; LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); @@ -831,7 +831,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus; int num_svs_max, i; - const rpc_loc_sv_info_s_type *sv_info_ptr; + const rpc_loc_sv_info_s_type *sv_info_ptr; LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", (uint32) gnss_report_ptr->valid_mask, @@ -1273,7 +1273,7 @@ static void loc_eng_process_atl_deferred_action (int flags) LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - + if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 3ea5e918..c91405d3 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -31,10 +31,6 @@ ifeq ($(FEATURE_DELEXT), true) LOCAL_CFLAGS += -DFEATURE_DELEXT endif #FEATURE_DELEXT -ifeq ($(FEATURE_ULP), true) -LOCAL_CFLAGS += -DFEATURE_ULP -endif #FEATURE_ULP - LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils @@ -48,7 +44,8 @@ LOCAL_COPY_HEADERS:= \ loc_eng_agps.h \ loc_eng_msg.h \ loc_eng_msg_id.h \ - loc_eng_log.h + loc_eng_log.h \ + loc_ulp.h LOCAL_PRELINK_MODULE := false @@ -89,10 +86,6 @@ ifeq ($(FEATURE_IPV6), true) LOCAL_CFLAGS += -DFEATURE_IPV6 endif #FEATURE_IPV6 -ifeq ($(FEATURE_ULP), true) -LOCAL_CFLAGS += -DFEATURE_ULP -endif #FEATURE_ULP - LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ hardware/qcom/gps/loc_api/ulp/inc diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index aac34df7..8e5b1ee1 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -45,17 +45,13 @@ LocEng::LocEng(void* caller, gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, -#ifdef FEATURE_ULP loc_msg_sender msgUlpSender, -#endif loc_ext_parser posParser, loc_ext_parser svParser) : owner(caller), eventMask(emask), acquireWakelock(acqwl), releaseWakeLock(relwl), sendMsge(msgSender), -#ifdef FEATURE_ULP sendUlpMsg(msgUlpSender), -#endif extPosInfo(NULL == posParser ? noProc : posParser), extSvInfo(NULL == svParser ? noProc : svParser) { @@ -140,7 +136,7 @@ int LocApiAdapter::decodeAddress(char *addr_string, int string_size, return idxOutput; } -void LocApiAdapter::reportPosition(GpsLocation &location, +void LocApiAdapter::reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, @@ -152,22 +148,17 @@ void LocApiAdapter::reportPosition(GpsLocation &location, locationExt, status, loc_technology_mask)); -#ifdef FEATURE_ULP if (locEngHandle.sendUlpMsg) { locEngHandle.sendUlpMsg(locEngHandle.owner, msg); } else { locEngHandle.sendMsge(locEngHandle.owner, msg); } -#else - locEngHandle.sendMsge(locEngHandle.owner, msg); -#endif } void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, svExt)); -#ifdef FEATURE_ULP //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 (locEngHandle.sendUlpMsg) { @@ -175,9 +166,6 @@ void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locatio } else { locEngHandle.sendMsge(locEngHandle.owner, msg); } -#else - locEngHandle.sendMsge(locEngHandle.owner, msg); -#endif } void LocApiAdapter::reportStatus(GpsStatusValue status) diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index a94617ed..65fac91a 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -89,9 +89,7 @@ struct LocEng { const gps_acquire_wakelock acquireWakelock; const gps_release_wakelock releaseWakeLock; const loc_msg_sender sendMsge; -#ifdef FEATURE_ULP const loc_msg_sender sendUlpMsg; -#endif const loc_ext_parser extPosInfo; const loc_ext_parser extSvInfo; @@ -100,9 +98,7 @@ struct LocEng { gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, -#ifdef FEATURE_ULP loc_msg_sender msgUlpSender, -#endif loc_ext_parser posParser, loc_ext_parser svParser); }; @@ -126,7 +122,7 @@ public: static int decodeAddress(char *addr_string, int string_size, const char *data, int data_size); - void reportPosition(GpsLocation &location, + void reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 11103a38..6592cc5a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -31,6 +31,7 @@ #define LOG_TAG "LocSvc_afw" #include +#include #include #include #include @@ -43,15 +44,13 @@ #include -#ifdef FEATURE_ULP //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); -#endif static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; -static void loc_cb(GpsLocation* location, void* locExt); +static void loc_cb(UlpLocation* location, void* locExt); static void sv_cb(GpsSvStatus* sv_status, void* svExt); // Function declarations for sLocEngInterface @@ -65,16 +64,19 @@ 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); -#ifdef FEATURE_ULP //ULP/Hybrid provider Function definitions -static int loc_update_criteria(UlpLocationCriteria criteria); static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks); static int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report); static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callback); static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings); -#endif +static int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria); +static const void* loc_get_extension(const char* name); +static ulp_location_callback ulp_loc_cb = NULL; +static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks); +static int loc_ulp_engine_start(); +static int loc_ulp_engine_stop(); + // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = @@ -89,9 +91,6 @@ static const GpsInterface sLocEngInterface = loc_delete_aiding_data, loc_set_position_mode, loc_get_extension -#ifdef FEATURE_ULP - ,loc_update_criteria -#endif }; // Function declarations for sLocEngAGpsInterface @@ -156,7 +155,16 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = loc_agps_ril_update_network_availability }; -#ifdef FEATURE_ULP +static const UlpEngineInterface sLocEngUlpEngInterface = +{ + sizeof(UlpEngineInterface), + loc_ulp_engine_init, + loc_ulp_engine_update_criteria, + loc_ulp_engine_start, + loc_ulp_engine_stop +}; + + static bool loc_inject_raw_command(char* command, int length); static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = @@ -178,7 +186,7 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = loc_ulp_phone_context_init, loc_ulp_phone_context_settings_update }; -#endif + static loc_eng_data_s_type loc_afw_data; static int gss_fd = 0; @@ -283,12 +291,12 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { loc_eng_read_config(); -#ifdef FEATURE_ULP + //We load up libulp module at this point itself if ULP configured to be On if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { loc_eng_ulp_inf = loc_eng_get_ulp_inf(); } -#endif + if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); @@ -307,13 +315,11 @@ static void loc_free_msg(void* msg) delete (loc_eng_msg*)msg; } -#ifdef FEATURE_ULP void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) { LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); } -#endif /*=========================================================================== FUNCTION loc_init @@ -364,7 +370,6 @@ static int loc_init(GpsCallbacks* callbacks) gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; -#ifdef FEATURE_ULP if (loc_eng_ulp_inf == NULL) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); @@ -373,11 +378,9 @@ static int loc_init(GpsCallbacks* callbacks) loc_ulp_msg_sender); int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); + //Initialize the cached min_interval + loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1); -#else - retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, - NULL); -#endif EXIT_LOG(%d, retVal); return retVal; @@ -461,8 +464,26 @@ SIDE EFFECTS static int loc_stop() { ENTRY_LOG(); - int ret_val = loc_eng_stop(loc_afw_data); - + int ret_val = -1; + if (loc_afw_data.ulp_initialized) { + //ULP initialized so we need to simulate REMOVE_CRITERIA for + //last client to libulp and we dont need to send loc_eng_stop + UlpLocationCriteria native_criteria; + native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | + ULP_CRITERIA_HAS_MIN_INTERVAL); + native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; + native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot + //For a GPS client horizontal_accuracy & power_consumption are irrelevant + native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; + native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; + native_criteria.action = ULP_REMOVE_CRITERIA; + native_criteria.min_interval = loc_afw_data.min_interval_cached; + loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; + ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); + } else { + ret_val = loc_eng_stop(loc_afw_data); + } EXIT_LOG(%d, ret_val); return ret_val; } @@ -490,22 +511,40 @@ static int loc_set_position_mode(GpsPositionMode mode, uint32_t preferred_time) { ENTRY_LOG(); - 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; - } + int ret_val = -1; + if (!loc_afw_data.ulp_initialized) { + 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; + } - LocPosMode params(locMode, recurrence, min_interval, - preferred_accuracy, preferred_time, NULL, NULL); - int ret_val = loc_eng_set_position_mode(loc_afw_data, params); + LocPosMode params(locMode, recurrence, min_interval, + preferred_accuracy, preferred_time, NULL, NULL); + ret_val = loc_eng_set_position_mode(loc_afw_data, params); + } else { + //ULP initialized so suppress set_position_mode updates to loc_eng + UlpLocationCriteria native_criteria; + native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | + ULP_CRITERIA_HAS_MIN_INTERVAL); + native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; + native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot + //For a GPS client horizontal_accuracy & power_consumption are irrelevant + native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; + native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; + native_criteria.action = ULP_ADD_CRITERIA; + native_criteria.min_interval = min_interval; + loc_afw_data.min_interval_cached = min_interval; //cache a copy + ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); + } EXIT_LOG(%d, ret_val); return ret_val; @@ -613,7 +652,6 @@ static void loc_delete_aiding_data(GpsAidingData f) EXIT_LOG(%s, VOID_RET); } -#ifdef FEATURE_ULP /*=========================================================================== FUNCTION loc_update_criteria @@ -630,7 +668,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_update_criteria(UlpLocationCriteria criteria) +int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria) { ENTRY_LOG(); int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); @@ -638,7 +676,6 @@ static int loc_update_criteria(UlpLocationCriteria criteria) EXIT_LOG(%d, ret_val); return ret_val; } -#endif /*=========================================================================== FUNCTION loc_get_extension @@ -656,11 +693,12 @@ SIDE EFFECTS N/A ===========================================================================*/ -static const void* loc_get_extension(const char* name) +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; @@ -685,7 +723,10 @@ static const void* loc_get_extension(const char* name) ret_val = &sLocEngAGpsRilInterface; } } -#ifdef FEATURE_ULP + else if (strcmp(name, ULP_ENGINE_INTERFACE) == 0) + { + ret_val = &sLocEngUlpEngInterface; + } else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) { ret_val = &sLocEngInjectRawCmdInterface; @@ -701,7 +742,7 @@ static const void* loc_get_extension(const char* name) if(gps_conf.CAPABILITIES & ULP_CAPABILITY) ret_val = &sUlpNetworkInterface; } -#endif + else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); @@ -1009,7 +1050,6 @@ static void loc_agps_ril_update_network_availability(int available, const char* EXIT_LOG(%s, VOID_RET); } -#ifdef FEATURE_ULP /*=========================================================================== FUNCTION loc_inject_raw_command @@ -1033,18 +1073,21 @@ static bool loc_inject_raw_command(char* command, int length) EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); return ret_val; } -#endif -static void loc_cb(GpsLocation* location, void* locExt) +static void loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); - if (NULL != gps_loc_cb && NULL != location) { -#ifdef FEATURE_ULP + if (NULL != location) { CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); -#else - CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); -#endif - gps_loc_cb(location); + if (ULP_LOCATION_IS_FROM_GNSS == location->position_source ) { + if (NULL != gps_loc_cb) { + gps_loc_cb(&location->gpsLocation); + } + } else { + if (NULL != ulp_loc_cb) { + ulp_loc_cb(location); + } + } } EXIT_LOG(%s, VOID_RET); } @@ -1059,7 +1102,6 @@ static void sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } -#ifdef FEATURE_ULP /*=========================================================================== FUNCTION loc_eng_get_ulp_inf @@ -1213,4 +1255,54 @@ int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report) EXIT_LOG(%d, ret_val); return ret_val; } -#endif + +/*=========================================================================== +FUNCTION loc_ulp_engine_init + +DESCRIPTION + Initialize the ULP Engine interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks) +{ + int retVal = -1; + ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE("loc_ulp_engine_init failed. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } + ulp_loc_cb = callbacks->location_cb; + retVal = 0; + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_ulp_engine_start() +{ + ENTRY_LOG(); + int ret_val = loc_eng_start(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +static int loc_ulp_engine_stop() +{ + ENTRY_LOG(); + int ret_val = loc_eng_stop(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + + diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 93ff73b6..bdf05d57 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -37,6 +37,7 @@ extern "C" { #include #include #include +#include #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ @@ -58,7 +59,7 @@ typedef enum loc_position_mode_type { LOC_POSITION_MODE_RESERVED_5 } LocPositionMode; -typedef void (*loc_location_cb_ext) (GpsLocation* location, void* locExt); +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); @@ -91,9 +92,7 @@ typedef uint32_t LocPosTechMask; #define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010) #define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020) -#ifdef FEATURE_ULP void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); -#endif #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5c37cbb6..caa01ec2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -153,10 +153,10 @@ static void loc_default_parameters(void) LocEngContext::LocEngContext(gps_create_thread threadCreator) : deferred_q((const void*)loc_eng_create_msg_q()), -#ifdef FEATURE_ULP + //TODO: should we conditionally create ulp msg q? ulp_q((const void*)loc_eng_create_msg_q()), -#endif + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), counter(0) { @@ -193,9 +193,9 @@ void LocEngContext::drop() pthread_cond_wait(&cond, &lock); msg_q_destroy((void**)&deferred_q); -#ifdef FEATURE_ULP + msg_q_destroy((void**)&ulp_q); -#endif + delete me; me = NULL; } @@ -326,15 +326,9 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } -#ifdef FEATURE_ULP LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); -#else - LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, - callbacks->location_ext_parser, callbacks->sv_ext_parser); -#endif loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); if (NULL == loc_eng_data.client_handle) { @@ -475,14 +469,12 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) ((LocEngContext*)(loc_eng_data.context))->drop(); loc_eng_data.context = NULL; -#ifdef FEATURE_ULP // De-initialize ulp if (locEngUlpInf != NULL) { locEngUlpInf = NULL; msg_q_destroy( &loc_eng_data.ulp_q); } -#endif if (loc_eng_data.client_handle != NULL) { @@ -521,7 +513,6 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); -#ifdef FEATURE_ULP if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) { //Pass the start messgage to ULP if present & activated @@ -530,7 +521,6 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) msg, loc_eng_free_msg); } else -#endif { loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, @@ -581,7 +571,6 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); -#ifdef FEATURE_ULP if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) { //Pass the start messgage to ULP if present & activated @@ -590,7 +579,6 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) msg, loc_eng_free_msg); } else -#endif { loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, @@ -1584,17 +1572,15 @@ static void loc_eng_deferred_action_thread(void* arg) // 2.2.2 we care about inaccuracy; and // 2.2.3 the inaccuracy exceeds our tolerance else if ((LOC_SESS_SUCCESS == rpMsg->status && ( -#ifdef FEATURE_ULP - ((LOCATION_HAS_SOURCE_INFO & rpMsg->location.flags) && + ((LOCATION_HAS_SOURCE_INFO & rpMsg->location.gpsLocation.flags) && ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || -#endif ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && - !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && + !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && (gps_conf.ACCURACY_THRES != 0) && - (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { - loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), + (rpMsg->location.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((UlpLocation*)&(rpMsg->location), (void*)rpMsg->locationExt); reported = true; } @@ -1614,28 +1600,19 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_data_p->client_handle->setInSession(false); } -#ifdef FEATURE_ULP if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) { loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended); } -#else - if (loc_eng_data_p->generateNmea && (LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask)) - { - loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended); - } -#endif -#ifdef FEATURE_ULP // Free the allocated memory for rawData - GpsLocation* gp = (GpsLocation*)&(rpMsg->location); + UlpLocation* gp = (UlpLocation*)&(rpMsg->location); if (gp != NULL && gp->rawData != NULL) { delete (char*)gp->rawData; gp->rawData = NULL; gp->rawDataSize = 0; } -#endif } break; @@ -1908,7 +1885,6 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_handle_engine_up(*loc_eng_data_p); break; -#ifdef FEATURE_ULP case LOC_ENG_MSG_REQUEST_NETWORK_POSIITON: { loc_eng_msg_request_network_position *nlprequestmsg = (loc_eng_msg_request_network_position*)msg; @@ -1938,7 +1914,7 @@ static void loc_eng_deferred_action_thread(void* arg) LOC_LOGE("Ulp Phone context request call back not initialized"); } break; -#endif + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; @@ -1968,7 +1944,7 @@ static void loc_eng_deferred_action_thread(void* arg) EXIT_LOG(%s, VOID_RET); } -#ifdef FEATURE_ULP + /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -2232,7 +2208,7 @@ int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, EXIT_LOG(%d, ret_val); return ret_val; } -#endif + /*=========================================================================== FUNCTION loc_eng_read_config diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index c67435a0..36da419c 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -82,9 +82,7 @@ enum loc_mute_session_e_type { struct LocEngContext { // Data variables used by deferred action thread const void* deferred_q; -#ifdef FEATURE_ULP const void* ulp_q; -#endif const pthread_t deferred_action_thread; static LocEngContext* get(gps_create_thread threadCreator); void drop(); @@ -109,10 +107,8 @@ typedef struct gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; gps_request_utc_time request_utc_time_cb; -#ifdef FEATURE_ULP ulp_network_location_request ulp_network_callback; ulp_request_phone_context ulp_phone_context_req_cb; -#endif boolean intermediateFix; AGpsStatusValue agps_status; // used to defer stopping the GPS engine until AGPS data calls are done @@ -123,10 +119,8 @@ typedef struct // AGPS state machines AgpsStateMachine* agnss_nif; -#ifdef FEATURE_IPV6 AgpsStateMachine* internet_nif; AgpsStateMachine* wifi_nif; -#endif // GPS engine status GpsStatusValue engine_status; @@ -157,14 +151,11 @@ typedef struct int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; -#ifdef FEATURE_ULP bool ulp_initialized; -#endif + uint32_t min_interval_cached; } loc_eng_data_s_type; -#ifdef FEATURE_ULP #include "ulp.h" -#endif /* GPS.conf support */ typedef struct loc_gps_cfg_s @@ -207,9 +198,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LOC_API_ADAPTER_EVENT_MASK_T event, void (*loc_external_msg_sender) (void*, void*)); -#ifdef FEATURE_ULP int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf); -#endif 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); @@ -225,10 +214,8 @@ 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); -#ifdef FEATURE_ULP int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, UlpLocationCriteria criteria); -#endif void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbacks); @@ -271,7 +258,6 @@ 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); -#ifdef FEATURE_ULP int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, UlpNetworkLocationCallbacks *callbacks); int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, @@ -280,7 +266,6 @@ int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data, UlpPhoneContextCallbacks *callback); int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, UlpNetworkPositionReport *position_report); -#endif int loc_eng_read_config(void); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index cb8de3f8..895db1db 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -95,7 +95,6 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ), NAME_VAL( LOC_ENG_MSG_EXT_POWER_CONFIG ), NAME_VAL( LOC_ENG_MSG_REQUEST_POSITION ), -#ifdef FEATURE_ULP NAME_VAL( LOC_ENG_MSG_REQUEST_PHONE_CONTEXT ), NAME_VAL( LOC_ENG_MSG_REQUEST_NETWORK_POSIITON ), NAME_VAL( ULP_MSG_UPDATE_CRITERIA ), @@ -105,8 +104,9 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( ULP_MSG_INJECT_NETWORK_POSITION ), NAME_VAL( ULP_MSG_REPORT_QUIPC_POSITION ), NAME_VAL( ULP_MSG_REQUEST_COARSE_POSITION ), -#endif + NAME_VAL( ULP_MSG_MONITOR ), NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), + NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index ae146a76..bd86defb 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -31,6 +31,7 @@ #include +#include #include #include #include "log_util.h" @@ -108,9 +109,9 @@ typedef uint16_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 /** GpsLocationExtended has valid altitude mean sea level. */ #define GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL 0x0002 -/** GpsLocation has valid magnetic deviation. */ +/** UlpLocation has valid magnetic deviation. */ #define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004 -/** GpsLocation has valid mode indicator. */ +/** UlpLocation has valid mode indicator. */ #define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008 /** Represents gps location extended. */ @@ -157,8 +158,7 @@ struct loc_eng_msg { } virtual ~loc_eng_msg() { - LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); - LOC_LOGV("deleting msg ox%x", msgid); + LOC_LOGV("deleting msg %s (0x%x)", loc_get_msg_name(msgid), msgid); } }; @@ -360,44 +360,36 @@ struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { }; struct loc_eng_msg_report_position : public loc_eng_msg { - const GpsLocation location; + const UlpLocation location; const GpsLocationExtended locationExtended; const void* locationExt; const enum loc_sess_status status; const LocPosTechMask technology_mask; - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, GpsLocationExtended &locExtended, void* locExt, + inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) { -#ifdef FEATURE_ULP 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", - location.flags, location.position_source, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData,status,technology_mask); -#else - LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %d\n Technology mask: %u", - location.flags, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, status,technology_mask); -#endif + 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,technology_mask); } - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, GpsLocationExtended &locExtended, void* locExt, + inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st, LocPosTechMask technology) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(technology) { -#ifdef FEATURE_ULP 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", - location.flags, location.position_source, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData,status,technology_mask); -#else - LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %d\n Technology mask: %u", - location.flags, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, status,technology_mask); -#endif + 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,technology_mask); } }; @@ -835,7 +827,6 @@ struct loc_eng_msg_set_data_enable : public loc_eng_msg { } }; -#ifdef FEATURE_ULP struct loc_eng_msg_request_network_position : public loc_eng_msg { const UlpNetworkRequestPos networkPosRequest; inline loc_eng_msg_request_network_position (void* instance, UlpNetworkRequestPos networkPosReq) : @@ -933,21 +924,20 @@ struct ulp_msg_inject_network_position : public loc_eng_msg { }; struct ulp_msg_report_quipc_position : public loc_eng_msg { - const GpsLocation location; + const UlpLocation location; const int quipc_error_code; - inline ulp_msg_report_quipc_position(void* instance, GpsLocation &loc, + inline ulp_msg_report_quipc_position(void* instance, UlpLocation &loc, int quipc_err) : loc_eng_msg(instance, ULP_MSG_REPORT_QUIPC_POSITION), location(loc), quipc_error_code(quipc_err) { 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 Quipc error: %d", - location.flags, location.position_source, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData, + 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, quipc_error_code); } }; -#endif void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); int loc_eng_msgget(int * p_req_msgq); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index 6649761b..bcdf2969 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -85,7 +85,6 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_REQUEST_POSITION, LOC_ENG_MSG_EXT_POWER_CONFIG, -#ifdef FEATURE_ULP // The following messages are added for ulp LOC_ENG_MSG_REQUEST_PHONE_CONTEXT, LOC_ENG_MSG_REQUEST_NETWORK_POSIITON, @@ -121,16 +120,14 @@ enum loc_eng_msg_ids_t { // Last ULP MSG ULP_MSG_LAST = 0x700, -#endif + /* Message is sent by HAL to LOC API to configure LTE Positioning Profile in modem */ LOC_ENG_MSG_LPP_CONFIG, -#ifdef FEATURE_ULP // Message is sent by Android framework (GpsLocationProvider) // to inject the raw command ULP_MSG_INJECT_RAW_COMMAND, -#endif /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ LOC_ENG_MSG_A_GLONASS_PROTOCOL, diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index d2507a52..e30380c9 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -110,7 +110,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, - const GpsLocation &location, const GpsLocationExtended &locationExtended) + const UlpLocation &location, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -119,7 +119,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int lengthRemaining = sizeof(sentence); int length = 0; - time_t utcTime(location.timestamp/1000); + time_t utcTime(location.gpsLocation.timestamp/1000); tm * pTm = gmtime(&utcTime); int utcYear = pTm->tm_year % 100; // 2 digit year int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero @@ -207,19 +207,19 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - if (location.flags & GPS_LOCATION_HAS_BEARING) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) { - float magTrack = location.bearing; + float magTrack = location.gpsLocation.bearing; if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) { - float magTrack = location.bearing - locationExtended.magneticDeviation; + 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.bearing, magTrack); + length = snprintf(pMarker, lengthRemaining, "$GPVTG,%.1lf,T,%.1lf,M,", location.gpsLocation.bearing, magTrack); } else { @@ -234,10 +234,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.flags & GPS_LOCATION_HAS_SPEED) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) { - float speedKnots = location.speed * (3600.0/1852.0); - float speedKmPerHour = location.speed * 3.6; + 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); } @@ -254,7 +254,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (!(location.flags & GPS_LOCATION_HAS_LAT_LONG)) + 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->client_handle->getPositionMode().mode) length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous @@ -282,10 +282,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.flags & GPS_LOCATION_HAS_LAT_LONG) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) { - double latitude = location.latitude; - double longitude = location.longitude; + double latitude = location.gpsLocation.latitude; + double longitude = location.gpsLocation.longitude; char latHemisphere; char lonHemisphere; double latMinutes; @@ -331,9 +331,9 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.flags & GPS_LOCATION_HAS_SPEED) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) { - float speedKnots = location.speed * (3600.0/1852.0); + float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); } else @@ -349,9 +349,9 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.flags & GPS_LOCATION_HAS_BEARING) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) { - length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.bearing); + length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing); } else { @@ -407,7 +407,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (!(location.flags & GPS_LOCATION_HAS_LAT_LONG)) + 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->client_handle->getPositionMode().mode) length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous @@ -435,10 +435,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.flags & GPS_LOCATION_HAS_LAT_LONG) + if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) { - double latitude = location.latitude; - double longitude = location.longitude; + double latitude = location.gpsLocation.latitude; + double longitude = location.gpsLocation.longitude; char latHemisphere; char lonHemisphere; double latMinutes; @@ -485,7 +485,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, lengthRemaining -= length; char gpsQuality; - if (!(location.flags & GPS_LOCATION_HAS_LAT_LONG)) + 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->client_handle->getPositionMode().mode) gpsQuality = '1'; // 1 means GPS fix @@ -534,11 +534,11 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if ((location.flags & GPS_LOCATION_HAS_ALTITUDE) && + 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.altitude - locationExtended.altitudeMeanSeaLevel); + location.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); } else { diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 29ca6c5e..69305937 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -37,6 +37,6 @@ 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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); -void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const GpsLocation &location, const GpsLocationExtended &locationExtended); +void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended); #endif // LOC_ENG_NMEA_H diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h new file mode 100644 index 00000000..75636993 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -0,0 +1,418 @@ +/* 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. + * + */ + +#ifndef __LOC_ULP_H__ +#define __LOC_ULP_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +#define ULP_ENGINE_INTERFACE "ulp-engine-interface" +#define ULP_NETWORK_INTERFACE "ulp-network-interface" +#define ULP_RAW_CMD_INTERFACE "ulp-raw-cmd" +#define ULP_PHONE_CONTEXT_INTERFACE "ulp-phone-context" + +/** 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 + +/* Hybrid support, the Android Framework will query to see if this capability is set before using the ulp functionalities in HAL */ +#define ULP_CAPABILITY 0x0000020 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + +/** Represents recurrence of location */ +typedef enum{ + ULP_LOC_RECURRENCE_PERIODIC = 0, + ULP_LOC_RECURRENCE_SINGLE, +}UlpRecurrenceCriteria; + +/** Represents horizontal accuracy options */ +typedef enum { + ULP_HORZ_ACCURACY_DONT_CARE = 0, + ULP_HORZ_ACCURACY_LOW, + ULP_HORZ_ACCURACY_MED, + ULP_HORZ_ACCURACY_HIGH, +}UlpHorzAccuracyCriteria; + +/** Represents accuracy options (for speed, altitude, and + * bearing) */ +typedef enum { + ULP_ACCURACY_DONT_CARE = 0, + ULP_ACCURACY_LOW, + ULP_ACCURACY_HIGH, +}UlpAccuracyCriteria; + +/** Represents power consumption options */ +typedef enum { + ULP_POWER_REQ_DONT_CARE = 0, + ULP_POWER_REQ_LOW, + ULP_POWER_REQ_HIGH, +}UlpPowerCriteria; + +/** Represents data usage options */ +typedef enum { + ULP_DATA_REQ_DONT_CARE = 0, + ULP_DATA_ALLOW, + ULP_DATA_DENY, +}UlpDataUsageCriteria; + +/** Enable the reporting of altitude in location reports */ +#define ULP_ENABLE_ALTITUDE_REPORT 0x01 +/** Enable the reporting of speed in location reports */ +#define ULP_ENABLE_SPEED_REPORT 0x02 +/** Enable the reporting of bearing in location reports */ +#define ULP_ENABLE_BEARING_REPORT 0x04 + +#define ULP_CRITERIA_HAS_ACTION 0x00000001 +#define ULP_CRITERIA_HAS_PROVIDER_SOURCE 0x00000002 +#define ULP_CRITERIA_HAS_RECURRENCE_TYPE 0x00000004 +#define ULP_CRITERIA_HAS_PREFERRED_RESPONSE_TIME 0x00000010 +#define ULP_CRITERIA_HAS_MIN_INTERVAL 0x00000020 +#define ULP_CRITERIA_HAS_MIN_DISTANCE 0x00000040 +#define ULP_CRITERIA_HAS_MIN_DIST_SAMPLE_INTERVAL 0x00000080 +#define ULP_CRITERIA_HAS_DESIRED_OUTPUT_PARAMETER 0x00000100 +#define ULP_CRITERIA_HAS_PREFERRED_HORIZONTAL_ACCURACY 0x00000200 +#define ULP_CRITERIA_HAS_PREFERRED_POWER_CONSUMPTION 0x00000400 +#define ULP_CRITERIA_HAS_PREFERRED_ALTITUDE_ACCURACY 0x00000800 +#define ULP_CRITERIA_HAS_PREFERRED_BEARING_ACCURACY 0x00001000 +#define ULP_CRITERIA_HAS_PREFERRED_DATA_USAGE 0x00002000 +#define ULP_CRITERIA_HAS_INTERMEDIATE_POS_REPORT_ENABLED 0x00004000 + +#define ULP_PROVIDER_SOURCE_GNSS 0x00000001 +#define ULP_PROVIDER_SOURCE_HYBRID 0x00000002 + +#define ULP_ADD_CRITERIA 1 +#define ULP_REMOVE_CRITERIA 2 + +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; + +/** Callback with location information. + */ +typedef void (* ulp_location_callback)(UlpLocation* location); + +/** ULP Engine callback structure. */ +typedef struct { + /** set to sizeof(UlpCallbacks) */ + size_t size; + ulp_location_callback location_cb; +} UlpEngineCallbacks; + +typedef struct { + + uint32_t valid_mask; + /* delete or add. This is a mandatory field */ + int action; + /*via gps or hybrid provider*/ + int provider_source; + /** PERIODIC or SINGLE */ + UlpRecurrenceCriteria recurrence_type; + /** obtain position within the specified response time */ + uint32_t preferred_response_time; + /** Send updates after the specified interval */ + uint32_t min_interval; + /** Send updates after device moved a specified distance */ + float min_distance; + uint32_t min_dist_sample_interval; + /** Fields specfied in the mask should be reported in the + * position report (altitude, bearing and speed) */ + uint32_t desired_output_parameter; + /** Desired accuracy for latitude, longitude */ + UlpHorzAccuracyCriteria preferred_horizontal_accuracy; + /** Desired power consumption level */ + UlpPowerCriteria preferred_power_consumption; + /** Desired accuracy for altitude */ + UlpAccuracyCriteria preferred_altitude_accuracy; + /** Desired accuracy for bearing */ + UlpAccuracyCriteria preferred_bearing_accuracy; + UlpDataUsageCriteria preferred_data_usage; + bool intermediate_pos_report_enabled; +} UlpLocationCriteria; + +/** Represents the Ulp Egine interface. */ +typedef struct { + /** set to sizeof(UlpEngineInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implemenation of this interface. + */ + int (*init)( UlpEngineCallbacks* callbacks ); + + /* set criterias of location requests */ + int (*update_criteria) (UlpLocationCriteria criteria ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); +} UlpEngineInterface; + + +/** Extended interface for raw GPS command support. */ +typedef struct { + /** set to sizeof(ExtraCmdInterface) */ + size_t size; + /** Injects Android extra cmd into the ulp. Clarify if they are blocking calls */ + bool (*inject_raw_cmd)(char* bundle, int bundle_length ); + +} InjectRawCmdInterface; + +/** ULP Network Interface */ +/** Request for network position status */ +#define ULP_NETWORK_POS_STATUS_REQUEST (0x01) +/** Request for periodic network positions */ +#define ULP_NETWORK_POS_START_PERIODIC_REQUEST (0x02) +/** Request last known location */ +#define ULP_NETWORK_POS_GET_LAST_KNOWN_LOCATION_REQUEST (0x03) +/** Cancel request */ +#define ULP_NETWORK_POS_STOP_REQUEST (0x04) + +/** Position was obtained using Wifi Network */ +#define ULP_NETWORK_POSITION_SRC_WIFI (0x01) +/** Position was obtained using Cell Network */ +#define ULP_NETWORK_POSITION_SRC_CELL (0x02) +/** Position was obtained using an Unknown Network */ +#define ULP_NETWORK_POSITION_SRC_UNKNOWN (0x00) + +/** Represents the ULP network request */ +typedef struct { + /** type of request */ + uint16_t request_type; + /** Desired time between network positions/measurements in ms. + * Shall be set to 0 if only one position is requested */ + int interval_ms; + /** network position source to be used */ + uint16_t desired_position_source; +}UlpNetworkRequestPos; + +/** Callback with network position request. */ +typedef void (*ulp_network_location_request)(UlpNetworkRequestPos *req); + +/** ULP Network callback structure. */ +typedef struct { + ulp_network_location_request ulp_network_location_request_cb; +} UlpNetworkLocationCallbacks; + +/** represent a network position */ +typedef struct { + /** source of the position (Wifi, Cell) */ + uint16_t pos_source; + /** latitude in degrees */ + double latitude; + /** longitude in degrees */ + double longitude; + /** Horzizontal error estimate in meters */ + uint16_t HEPE; +} UlpNetworkPosition; + +/** Represents access point information */ +typedef struct { + /** Mac adderess */ + char mac_addr[6]; + /** signal strength in dbM */ + int32_t rssi; + /** Beacon channel for access point */ + uint16_t channel; + + /** Bit 0 = AP is used by WiFi positioning system + * Bit 1 = AP doesn't broadcast SSID Bit 2 = AP has encrption + * turned on Bit 3 = AP is in infrastructure mode and not in + * ad-hoc/unknown mode */ + uint8_t ap_qualifier; +} UlpNetworkAccessPointInfo; + +/** Represents Wifi information */ +typedef struct { + /** Number of APs in the calculated position (-1 means + * unknown) */ + uint8_t num_aps_in_pos; + /** Information of the scanned ap's used in the position estimation*/ + UlpNetworkAccessPointInfo *ap_info; +} UlpNetworkWifiInfo; + + +/** Represent network landscape information */ +typedef struct { + /** network type Cell/Wifi */ + uint8_t network_type; + /** network information */ + union { + UlpNetworkWifiInfo wifi_info; + uint32_t cell_info; + } u; +} UlpNetworkLandscape; + +/** network report valid flags */ +/** fix time is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_FIX_TIME (0x01) +/** position is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_POSITION (0x02) +/** landscape is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_LANDSCAPE (0x04) + +/** Represents the network position report */ +typedef struct +{ + /** validity flags */ + uint16_t valid_flag; + /** time fo network fix */ + GpsUtcTime fix_time; + /** network position */ + UlpNetworkPosition position; + /** network landscape */ + UlpNetworkLandscape landscape_info; +}UlpNetworkPositionReport; + +/** represents ULP network interface extension */ +typedef struct +{ + /** set to sizeof(UlpNetworkInterface) */ + size_t size; + /** initialize network interface */ + int ( *init)(UlpNetworkLocationCallbacks *callback); + /** send network position */ + int ( *ulp_send_network_position)(UlpNetworkPositionReport *position_report); +}UlpNetworkInterface; + +/** Information for the ULP Phone context interface */ + +/** the Location settings context supports only ON_CHANGE + * request type */ +#define ULP_PHONE_CONTEXT_GPS_SETTING (0x01) +#define ULP_PHONE_CONTEXT_NETWORK_POSITION_SETTING (0x02) +#define ULP_PHONE_CONTEXT_WIFI_SETTING (0x04) +/** The battery charging state context supports only + * ON_CHANGE request type */ +#define ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE (0x08) +#define ULP_PHONE_CONTEXT_AGPS_SETTING (0x010) +#define ULP_PHONE_CONTEXT_ENH_LOCATION_SERVICES_SETTING (0x020) + +/** return phone context only once */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_SINGLE (0x01) +/** return phone context periodcially */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_PERIODIC (0x02) +/** return phone context when it changes */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_ON_CHANGE (0x03) + + +/** Represents ULP phone context request */ +typedef struct { + /** context type requested */ + uint16_t context_type; + /** request type */ + uint16_t request_type; + /** interval in ms if request type is periodic */ + int interval_ms; +}UlpPhoneContextRequest; + +/** Callback for phone context request. */ +typedef void (*ulp_request_phone_context)(UlpPhoneContextRequest *req); + +/** ULP Phone Context callback structure. */ +typedef struct { + ulp_request_phone_context ulp_request_phone_context_cb; +}UlpPhoneContextCallbacks; + +/** Represents the phone context settings */ +typedef struct { + /** Phone context information type */ + uint16_t context_type; + + /** network information */ + /** gps setting */ + bool is_gps_enabled; + /** is network positioning enabled */ + bool is_network_position_available; + /** is wifi turned on */ + bool is_wifi_setting_enabled; + /** is battery being currently charged */ + bool is_battery_charging; + /* is agps enabled for single shot */ + bool is_agps_enabled; + /* is Enhanced Location Services enabled by user*/ + bool is_enh_location_services_enabled; +} UlpPhoneContextSettings; + +/** Represent the phone contxt interface */ +typedef struct +{ + /** set to sizeof(UlpPhoneContextInterface) */ + size_t size; + /** Initialize, register callback */ + int (*init)(UlpPhoneContextCallbacks *callback); + /** send the phone context settings */ + int (*ulp_phone_context_settings_update) (UlpPhoneContextSettings *settings ); +}UlpPhoneContextInterface; + + +//int loc_update_criteria(UlpLocationCriteria criteria); +//const void* loc_get_extension(const char* name); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_ULP_H__ diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk index 68dd9f0f..8617f3cb 100644 --- a/loc_api/loc_api_v02/Android.mk +++ b/loc_api/loc_api_v02/Android.mk @@ -36,10 +36,6 @@ ifeq ($(FEATURE_DELEXT), true) LOCAL_CFLAGS += -DFEATURE_DELEXT endif #FEATURE_DELEXT -ifeq ($(FEATURE_ULP), true) -LOCAL_CFLAGS += -DFEATURE_ULP -endif #FEATURE_ULP - ## Includes LOCAL_C_INCLUDES := \ $(TARGET_OUT_HEADERS)/libloc_eng \ diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index ac886f94..9efd820a 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -1590,10 +1590,10 @@ enum loc_api_adapter_err LocApiV02Adapter :: convertErr( void LocApiV02Adapter :: reportPosition ( const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) { - GpsLocation location; + UlpLocation location; LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; LOC_LOGD("Reporting postion from V2 Adapter\n"); - memset(&location, 0, sizeof (GpsLocation)); + memset(&location, 0, sizeof (UlpLocation)); location.size = sizeof(location); GpsLocationExtended locationExtended; memset(&locationExtended, 0, sizeof (GpsLocationExtended)); @@ -1610,29 +1610,29 @@ void LocApiV02Adapter :: reportPosition ( (location_report_ptr->latitude != 0 || location_report_ptr->longitude!= 0)) { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; + 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->timestampUtc_valid == 1) { - location.timestamp = location_report_ptr->timestampUtc; + location.gpsLocation.timestamp = location_report_ptr->timestampUtc; } // Altitude if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitudeWrtEllipsoid; + location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.gpsLocation.altitude = location_report_ptr->altitudeWrtEllipsoid; } // Speed if((location_report_ptr->speedHorizontal_valid == 1) && (location_report_ptr->speedVertical_valid ==1 ) ) { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt( + location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; + location.gpsLocation.speed = sqrt( (location_report_ptr->speedHorizontal * location_report_ptr->speedHorizontal) + (location_report_ptr->speedVertical * @@ -1642,25 +1642,23 @@ void LocApiV02Adapter :: reportPosition ( // Heading if(location_report_ptr->heading_valid == 1) { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; + location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; + location.gpsLocation.bearing = location_report_ptr->heading; } // Uncertainty (circular) if( (location_report_ptr->horUncCircular_valid ) ) { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->horUncCircular; + location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; + location.gpsLocation.accuracy = location_report_ptr->horUncCircular; } // Technology Mask tech_Mask |= location_report_ptr->technologyMask; -#ifdef FEATURE_ULP //Mark the location source as from GNSS - location.flags |= LOCATION_HAS_SOURCE_INFO; + location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_GNSS; -#endif if (location_report_ptr->magneticDeviation_valid) { locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; From e91c4284bffb407ae4e84dfa2535986c885dc307 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 4 Feb 2013 13:27:38 -0800 Subject: [PATCH 086/945] Change debug log tags for V/I/D CRs-fixed: 442759 Change-Id: I9ddf1605d6b7837a44328e5e0ae38c855d93c12f --- utils/log_util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/log_util.h b/utils/log_util.h index 9187e4f0..56dca624 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -86,15 +86,15 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGW("W/"__VA_ARGS__); } #define LOC_LOGI(...) \ if (loc_logger.DEBUG_LEVEL >= 3) { ALOGE("I/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("I/"__VA_ARGS__); } #define LOC_LOGD(...) \ if (loc_logger.DEBUG_LEVEL >= 4) { ALOGE("D/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("D/"__VA_ARGS__); } #define LOC_LOGV(...) \ if (loc_logger.DEBUG_LEVEL >= 5) { ALOGE("V/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("V/"__VA_ARGS__); } #else /* DEBUG_DMN_LOC_API */ From 0d257cc5d371b6619978326badbd29acea999725 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Wed, 6 Feb 2013 22:34:45 -0800 Subject: [PATCH 087/945] remove loc_api from hardware/qcom/gps Change-Id: I2a1e928dc38de45c7421e2ef7a406ca969eafc97 Signed-off-by: Iliyan Malchev --- CleanSpec.mk | 6 + loc_api/Android.mk | 37 - loc_api/NOTICE | 13 - loc_api/libloc_api-rpc-50001/Android.mk | 3 - .../libloc_api-rpc-glue/Android.mk | 59 - .../rpc_inc/LocApiRpcAdapter.h | 102 - .../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 - .../src/LocApiRpcAdapter.cpp | 1220 ---- .../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 | 621 -- .../src/loc_api_sync_call.c | 510 -- .../src/loc_apicb_appinit.c | 86 - .../libloc_api-rpc-stub/Android.mk | 35 - .../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 --- loc_api/libloc_api-rpc/Android.mk | 60 - loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 - .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 - .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 - .../gen-1240/loc_api_common.xdr | 906 --- .../gen-1240/loc_api_common_xdr.c | 1650 ----- .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 - .../gen-1240/loc_api_rpc_glue.c | 339 - loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 - loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 - .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 - .../gen-3200/loc_api_common.xdr | 803 --- .../gen-3200/loc_api_common_xdr.c | 1441 ---- .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 - .../gen-3200/loc_api_rpc_glue.c | 339 - loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 - loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 - loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ---- .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 - .../inc-1240/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 - loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 --- .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 - .../inc-3200/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc/debug.h | 57 - loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 - .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 - loc_api/libloc_api/Android.mk | 39 - loc_api/libloc_api/gps.c | 68 - loc_api/libloc_api/loc_eng.cpp | 1533 ----- loc_api/libloc_api/loc_eng.h | 115 - loc_api/libloc_api/loc_eng_ioctl.cpp | 354 - loc_api/libloc_api/loc_eng_ioctl.h | 69 - loc_api/libloc_api/loc_eng_ni.cpp | 609 -- loc_api/libloc_api/loc_eng_ni.h | 56 - loc_api/libloc_api/loc_eng_xtra.cpp | 180 - loc_api/libloc_api/loc_eng_xtra.h | 45 - loc_api/libloc_api_50001/Android.mk | 125 - loc_api/libloc_api_50001/LocApiAdapter.cpp | 226 - loc_api/libloc_api_50001/LocApiAdapter.h | 208 - loc_api/libloc_api_50001/gps.c | 68 - loc_api/libloc_api_50001/loc.cpp | 870 --- loc_api/libloc_api_50001/loc.h | 86 - loc_api/libloc_api_50001/loc_eng.cpp | 1831 ----- loc_api/libloc_api_50001/loc_eng.h | 204 - loc_api/libloc_api_50001/loc_eng_agps.cpp | 702 -- loc_api/libloc_api_50001/loc_eng_agps.h | 274 - loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 180 - loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 53 - .../loc_eng_dmn_conn_glue_msg.c | 223 - .../loc_eng_dmn_conn_glue_msg.h | 51 - .../loc_eng_dmn_conn_glue_pipe.c | 206 - .../loc_eng_dmn_conn_glue_pipe.h | 50 - .../loc_eng_dmn_conn_handler.cpp | 78 - .../loc_eng_dmn_conn_handler.h | 82 - .../loc_eng_dmn_conn_thread_helper.c | 398 -- .../loc_eng_dmn_conn_thread_helper.h | 74 - loc_api/libloc_api_50001/loc_eng_log.cpp | 292 - loc_api/libloc_api_50001/loc_eng_log.h | 62 - loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 - loc_api/libloc_api_50001/loc_eng_msg.h | 584 -- loc_api/libloc_api_50001/loc_eng_msg_id.h | 90 - loc_api/libloc_api_50001/loc_eng_ni.cpp | 313 - loc_api/libloc_api_50001/loc_eng_ni.h | 50 - loc_api/libloc_api_50001/loc_eng_xtra.cpp | 90 - loc_api/libloc_api_50001/loc_eng_xtra.h | 46 - loc_api/loc_api_v02/Android.mk | 43 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2059 ------ loc_api/loc_api_v02/LocApiV02Adapter.h | 197 - loc_api/loc_api_v02/loc_api_sync_req.c | 548 -- loc_api/loc_api_v02/loc_api_sync_req.h | 68 - loc_api/loc_api_v02/loc_api_v02_client.c | 1923 ------ loc_api/loc_api_v02/loc_api_v02_client.h | 1255 ---- loc_api/loc_api_v02/loc_api_v02_log.c | 243 - loc_api/loc_api_v02/loc_api_v02_log.h | 50 - loc_api/loc_api_v02/loc_util_log.h | 81 - loc_api/loc_api_v02/location_service_v02.c | 2223 ------- loc_api/loc_api_v02/location_service_v02.h | 5914 ----------------- loc_api/ulp/inc/ulp.h | 76 - 120 files changed, 6 insertions(+), 45182 deletions(-) delete mode 100755 loc_api/Android.mk delete mode 100755 loc_api/NOTICE delete mode 100755 loc_api/libloc_api-rpc-50001/Android.mk delete mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c delete mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c delete mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr delete mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr delete mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr delete mode 100755 loc_api/libloc_api-rpc/Android.mk delete mode 100755 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr delete mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr delete mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c delete mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c delete mode 100755 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr delete mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr delete mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c delete mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc/debug.h delete mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c delete mode 100755 loc_api/libloc_api/Android.mk delete mode 100644 loc_api/libloc_api/gps.c delete mode 100644 loc_api/libloc_api/loc_eng.cpp delete mode 100644 loc_api/libloc_api/loc_eng.h delete mode 100644 loc_api/libloc_api/loc_eng_ioctl.cpp delete mode 100644 loc_api/libloc_api/loc_eng_ioctl.h delete mode 100644 loc_api/libloc_api/loc_eng_ni.cpp delete mode 100644 loc_api/libloc_api/loc_eng_ni.h delete mode 100644 loc_api/libloc_api/loc_eng_xtra.cpp delete mode 100644 loc_api/libloc_api/loc_eng_xtra.h delete mode 100755 loc_api/libloc_api_50001/Android.mk delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.h delete mode 100644 loc_api/libloc_api_50001/gps.c delete mode 100644 loc_api/libloc_api_50001/loc.cpp delete mode 100644 loc_api/libloc_api_50001/loc.h delete mode 100644 loc_api/libloc_api_50001/loc_eng.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_agps.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_agps.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_log.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_log.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg_id.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_ni.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_ni.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.h delete mode 100755 loc_api/loc_api_v02/Android.mk delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.h delete mode 100644 loc_api/loc_api_v02/loc_util_log.h delete mode 100644 loc_api/loc_api_v02/location_service_v02.c delete mode 100644 loc_api/loc_api_v02/location_service_v02.h delete mode 100644 loc_api/ulp/inc/ulp.h diff --git a/CleanSpec.mk b/CleanSpec.mk index dd1849db..140d0d77 100755 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -48,3 +48,9 @@ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) + +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc* \ + $(PRODUCT_OUT)/symbols/system/lib/libloc* \ + $(PRODUCT_OUT)/system/lib/libloc* \ + $(PRODUCT_OUT)/obj/lib/libloc* \ + $(PRODUCT_OUT)/obj/include/libloc_eng) diff --git a/loc_api/Android.mk b/loc_api/Android.mk deleted file mode 100755 index d2f53c58..00000000 --- a/loc_api/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) - -LOCAL_PATH := $(call my-dir) - -GPS_DIR_LIST := - -ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) - -# add RPC dirs if RPC is available -ifneq ($(TARGET_NO_RPC),true) - -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ - -else - -GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ - -endif #TARGET_NO_RPC - -endif - -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ - -#call the subfolders -include $(addsuffix Android.mk, $(GPS_DIR_LIST)) - -endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/loc_api/NOTICE b/loc_api/NOTICE deleted file mode 100755 index 85b5740d..00000000 --- a/loc_api/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk deleted file mode 100755 index 6c5d5339..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk deleted file mode 100755 index 1287c69e..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ /dev/null @@ -1,59 +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/LocApiRpcAdapter.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_adapter - -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)/loc_api/rpcgen/inc \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ - $(TARGET_OUT_HEADERS)/librpc \ - $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - 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 - -LOCAL_MODULE:= libloc_api-rpc-qc - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h deleted file mode 100644 index 7b1f59ba..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ADAPTER_H -#define LOC_API_RPC_ADAPTER_H - -#include -#include -#include - - -class LocApiRpcAdapter : public LocApiAdapter { - // RPC communication establishment - rpc_loc_client_handle_type client_handle; - rpc_loc_event_mask_type eMask; - - static const rpc_loc_event_mask_type locBits[]; - static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - static enum loc_api_adapter_err convertErr(int rpcErr); - - 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); - int NIEventFillVerfiyType(GpsNiNotification ¬if, - rpc_loc_ni_notify_verify_e_type notif_priv); - GpsNiEncodingType convertNiEncodingType(int loc_encoding); - -public: - LocApiRpcAdapter(LocEng &locEng); - ~LocApiRpcAdapter(); - - 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 - reinit(); - virtual enum loc_api_adapter_err - startFix(); - virtual enum loc_api_adapter_err - stopFix(); - virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); - virtual enum loc_api_adapter_err - enableData(int enable); - 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); - virtual enum loc_api_adapter_err - setAPN(char* apn, int len); - 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 - 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); -}; - -#endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h deleted file mode 100644 index 8b20a3f5..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h deleted file mode 100644 index 9bfe5f0c..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h deleted file mode 100644 index c0bcda16..00000000 --- a/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 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h deleted file mode 100644 index 16552a0c..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "rpc_inc/loc_api_fixup.h" -#include "rpc_inc/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h deleted file mode 100644 index 266f8ec8..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h deleted file mode 100644 index 8dbcb9ac..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp deleted file mode 100644 index ec98bed2..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ /dev/null @@ -1,1220 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" - -#include -#include -#include -#include "LocApiRpcAdapter.h" -#include "loc_api_rpcgen_common_rpc.h" -#include "log_util.h" -#include "loc_log.h" -#include "loc_api_log.h" - -#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 = ((LocApiRpcAdapter*)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)); - ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, event); - EXIT_LOG(%p, VOID_RET); -} - - -extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return new LocApiRpcAdapter(locEng); -} - -const rpc_loc_event_mask_type LocApiRpcAdapter::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 -}; - -LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : - LocApiAdapter(locEng), - client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - eMask(convertMask(locEng.eventMask)) -{ - loc_api_glue_init(); -} - -LocApiRpcAdapter::~LocApiRpcAdapter() -{ - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - - loc_close(client_handle); -} - -rpc_loc_event_mask_type -LocApiRpcAdapter::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; -} - -enum loc_api_adapter_err -LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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) -{ - locEngHandle.acquireWakelock(); - - // 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); - } - - locEngHandle.releaseWakeLock(); - 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 -LocApiRpcAdapter::reinit() -{ - enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - - client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); - - if (client_handle < 0) { - ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } - - return ret_val; -} - -enum loc_api_adapter_err -LocApiRpcAdapter::startFix() { - LOC_LOGD("LocApiRpcAdapter::startFix() called"); - return convertErr( - loc_start_fix(client_handle) - ); -} - -enum loc_api_adapter_err -LocApiRpcAdapter::stopFix() { - LOC_LOGD("LocApiRpcAdapter::stopFix() called"); - return convertErr( - loc_stop_fix(client_handle) - ); -} - -enum loc_api_adapter_err -LocApiRpcAdapter::setPositionMode(LocPositionMode mode, - GpsPositionRecurrence recurrence, uint32_t min_interval, - uint32_t preferred_accuracy, uint32_t preferred_time) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr; - rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA; - rpc_loc_operation_mode_e_type op_mode; - int ret_val; - - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) client_handle, min_interval, mode); - - switch (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: - 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 = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; - 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 = min_interval; - fix_criteria_ptr->preferred_operation_mode = op_mode; - - if (min_interval > 0) { - fix_criteria_ptr->min_interval = min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - }else if(min_interval == 0) - { - /*If the framework passes in 0 transalate it into the maximum frequency we can report positions - which is 1 Hz or once very second */ - fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - } - if (preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = preferred_accuracy; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; - } - if (preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = preferred_time; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; - } - - switch (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 -LocApiRpcAdapter::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)(android::elapsedRealtime() - 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 -LocApiRpcAdapter::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 -LocApiRpcAdapter::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 - LocApiRpcAdapter::setAPN(char* apn, int len) -{ - 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, len+1); - - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -enum loc_api_adapter_err -LocApiRpcAdapter::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 -LocApiRpcAdapter::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 -LocApiRpcAdapter::enableData(int enable) -{ - 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; - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_DATA_ENABLE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -enum loc_api_adapter_err -LocApiRpcAdapter::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 LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) -{ - GpsLocation location = {0}; - - location.size = sizeof(location); - 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.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; - - // Time stamp (UTC) - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) - { - location.timestamp = location_report_ptr->timestamp_utc; - } - - // Altitude - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) - { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitude_wrt_ellipsoid; - } - - // Speed - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) - { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); - } - - // Heading - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) - { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) ) - { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->hor_unc_circular; - } - - LOC_LOGV("reportPosition: fire callback\n"); - LocApiAdapter::reportPosition(location, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); - } - } - else - { - LocApiAdapter::reportPosition(location, - 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 LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) -{ - GpsSvStatus SvStatus = {0}; - 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(GpsSvStatus); - 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.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) - { - 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 (SvStatus.num_svs >= 0) - { - LocApiAdapter::reportSv(SvStatus, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); - } -} - -void LocApiRpcAdapter::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) - { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::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) - { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); - } - } - -} - -void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) -{ - -#if (AMSS_VERSION==3200) - LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); -#else - LocApiAdapter::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 -LocApiRpcAdapter::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); -} - -enum loc_api_adapter_err -LocApiRpcAdapter::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 -LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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 = LocApiAdapter::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)); - LocApiAdapter::requestNiNotify(notif, (const void*)copy); -} - -int LocApiRpcAdapter::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 -LocApiRpcAdapter::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 LocApiRpcAdapter::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; - } -} diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c deleted file mode 100644 index 32e3cda8..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c deleted file mode 100644 index 6aa5254f..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c deleted file mode 100644 index 10b2d221..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ /dev/null @@ -1,621 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include - -/* Logging Improvement */ -#include "log_util.h" - -/* Uncomment to force LOGD messages */ -// #define LOGD LOGI - -/*===================================================================== - 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 -) -{ - 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; - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].cb_func == event_callback || - loc_glue_callback_table[i].user == userData) - { - LOC_LOGW("Client already opened service (callback=%p)...\n", - event_callback); - break; - } - } - - if (i == LOC_API_CB_MAX_CLIENTS) - { - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].cb_func == NULL) - { - 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; - break; - } - } - } - - if (i == LOC_API_CB_MAX_CLIENTS) - { - LOC_LOGE("Too many clients opened at once...\n"); - return RPC_LOC_CLIENT_HANDLE_INVALID; - } - - 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"); - stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); - 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; - - ret_val = (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; - 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c deleted file mode 100644 index e2a5786f..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ /dev/null @@ -1,510 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include - -/*************************************************************************** - * 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; - - LOGV("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; - - LOGV("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) - { - LOGV("trylock EBUSY : %d", i); - continue; - } - - if (!slot->in_use && !slot->not_available) - { - select_id = i; - slot->in_use = 1; - slot->signal_sent = 0; - /* Return from here and leave the mutex locked. - * will unlock it in loc_unlock_slot() - */ - break; - } - /* LOGV("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 - Frees a buffer slot after the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_unlock_slot(int select_id) -{ - loc_sync_data.slots[select_id].in_use = 0; - - pthread_mutex_unlock(&loc_sync_data.slots[select_id].lock); -} - -/*=========================================================================== - -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; /* 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 */ - LOGE("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) - { - LOGE("slot not available ioctl_type = %s", - loc_get_ioctl_type_name(ioctl_type)); - return rc; - } - - // Select the callback we are waiting for - loc_api_save_callback(select_id, handle, 0, ioctl_type); - - rc = loc_ioctl(handle, ioctl_type, ioctl_data_ptr); - - if (rc != RPC_LOC_API_SUCCESS) - { - LOGE("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 { - LOGV("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 - LOGE("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; - LOGE("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 { - LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", - select_id, ioctl_type, rc); - } - } /* wait callback */ - } /* loc_ioctl */ - - loc_unlock_slot(select_id); - - return rc; -} - - diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c deleted file mode 100644 index b257fb81..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk deleted file mode 100755 index abd15c8f..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk +++ /dev/null @@ -1,35 +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_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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h deleted file mode 100644 index 47478e80..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h deleted file mode 100644 index 507103ce..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h deleted file mode 100644 index f11bb654..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h deleted file mode 100644 index e109852c..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c deleted file mode 100644 index b0443487..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c deleted file mode 100644 index 7f519281..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c deleted file mode 100644 index d2152ab4..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c deleted file mode 100644 index da066b42..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c deleted file mode 100644 index e8a2aa78..00000000 --- a/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, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c deleted file mode 100644 index b4aeb5e7..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr deleted file mode 100755 index 3d6c759e..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr +++ /dev/null @@ -1,261 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr deleted file mode 100755 index 36d0e6d2..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr deleted file mode 100755 index fcdaf57f..00000000 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr +++ /dev/null @@ -1,1021 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk deleted file mode 100755 index f70cba50..00000000 --- a/loc_api/libloc_api-rpc/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) -RPC_INC:=inc-$(AMSS_VERSION) - -generated_files:= \ - gen-$(AMSS_VERSION)/loc_api_clnt.c \ - gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ - gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ - src/loc_apicb_appinit.c - -LOCAL_SRC_FILES:= $(generated_files) - -# removed from library build since the client should implement this code. -# src/loc_api_cb_server.c - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h -LOCAL_CFLAGS+=-DDEBUG -# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE - -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= librpc -LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc - - - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_cb.h \ - $(RPC_INC)/loc_api_common.h \ - $(RPC_INC)/loc_api.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - inc/debug.h \ - inc/loc_api_rpc_glue.h - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/$(RPC_INC) \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/librpc - -LOCAL_MODULE:= libloc_api-rpc - -include $(BUILD_STATIC_LIBRARY) - -endif -endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr deleted file mode 100755 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr deleted file mode 100755 index a9d60aa4..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr +++ /dev/null @@ -1,172 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - - - version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 -RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00040002; - - -} = 0x3000008c; - -const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr deleted file mode 100755 index 1bd4e151..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr +++ /dev/null @@ -1,85 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - -} = 0x3100008c; - -const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c deleted file mode 100644 index 52a0d15b..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c deleted file mode 100644 index dca1e8d5..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr deleted file mode 100755 index 4e01607d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr +++ /dev/null @@ -1,906 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040024; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; -const RPC_LOC_OPEN_VERSION = 0x00040001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; -const RPC_LOC_API_NULL_VERSION = 0x00040001; -const RPC_LOC_STOP_FIX_VERSION = 0x00040001; -const RPC_LOC_IOCTL_VERSION = 0x00040001; -const RPC_LOC_START_FIX_VERSION = 0x00040001; -const RPC_LOC_CLOSE_VERSION = 0x00040001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0004; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef bool rpc_boolean; - -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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[1200]; /* EVAL:[1200]*/ -}; - -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_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]; /* EVAL:[256]*/ -}; - -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; - 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - - typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - 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_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_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_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 -}; - -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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c deleted file mode 100644 index 7c860bf3..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, 1200)) - 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_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; - 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_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; - 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_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_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; - 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_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_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_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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c deleted file mode 100644 index fbaca8b6..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00040001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr deleted file mode 100755 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr deleted file mode 100755 index 981266b3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr +++ /dev/null @@ -1,164 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3000008c; - -const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr deleted file mode 100755 index 3f53504b..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr +++ /dev/null @@ -1,90 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3100008c; - -const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c deleted file mode 100644 index b1aa1998..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c deleted file mode 100644 index 79814d42..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr deleted file mode 100755 index 7ef6357c..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr +++ /dev/null @@ -1,803 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_OPEN_VERSION = 0x00010001; -const RPC_LOC_CLOSE_VERSION = 0x00010001; -const RPC_LOC_START_FIX_VERSION = 0x00010001; -const RPC_LOC_STOP_FIX_VERSION = 0x00010001; -const RPC_LOC_IOCTL_VERSION = 0x00010001; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; -const RPC_LOC_API_API_MAJOR_NUM = 0x0001; -typedef bool rpc_boolean; -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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; -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - 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 -}; - -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; - 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_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; -}; - -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; - 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_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; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - unsigned char 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; -}; - -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; - 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; - 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; -}; - -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; - 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_MAX = 268435456 -}; - -typedef string 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 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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -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_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_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_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_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; -}; - -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 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - string apn_name<>; -}; - -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; -}; - -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_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; - 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: - 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; - 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: - 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_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -const RPC_LOC_API_NULL_VERSION = 0x00010001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c deleted file mode 100644 index 7b37b9c3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, RPC_LOC_API_MAX_SV_COUNT, - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) - 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_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; - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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; - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_u_char (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; - - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) - 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; - - 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_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; - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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_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; - 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_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_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; - 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_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; - 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_string (xdrs, &objp->apn_name, ~0)) - 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_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_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; - 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: - 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; - 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: - 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c deleted file mode 100644 index 8c171222..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00010001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h deleted file mode 100644 index e02648cc..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api.h +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(); -extern bool_t rpc_loc_api_null_0x00040001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00040001(); -extern bool_t rpc_loc_open_0x00040001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(); -extern bool_t rpc_loc_close_0x00040001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00040001(); -extern bool_t rpc_loc_start_fix_0x00040001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); -extern bool_t rpc_loc_stop_fix_0x00040001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00040001(); -extern bool_t rpc_loc_ioctl_0x00040001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); -extern int loc_apiprog_0x00040001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00040002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00040002(); -extern bool_t rpc_loc_api_null_0x00040002_svc(); -extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h deleted file mode 100644 index 67ac0846..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00040001_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_0x00040001(); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); -extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h deleted file mode 100644 index 6ff3baf1..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040024 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 -#define RPC_LOC_OPEN_VERSION 0x00040001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 -#define RPC_LOC_API_NULL_VERSION 0x00040001 -#define RPC_LOC_STOP_FIX_VERSION 0x00040001 -#define RPC_LOC_IOCTL_VERSION 0x00040001 -#define RPC_LOC_START_FIX_VERSION 0x00040001 -#define RPC_LOC_CLOSE_VERSION 0x00040001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0004 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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[1200]; -}; -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_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_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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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_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_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_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; - -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; - -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_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_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_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_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h deleted file mode 100644 index 8998aca4..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(); -extern bool_t rpc_loc_api_null_0x00010001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00010001(); -extern bool_t rpc_loc_open_0x00010001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(); -extern bool_t rpc_loc_close_0x00010001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00010001(); -extern bool_t rpc_loc_start_fix_0x00010001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); -extern bool_t rpc_loc_stop_fix_0x00010001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00010001(); -extern bool_t rpc_loc_ioctl_0x00010001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); -extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h deleted file mode 100644 index 4f2f8f91..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00010001_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_0x00010001(); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); -extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h deleted file mode 100644 index 04be079f..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_OPEN_VERSION 0x00010001 -#define RPC_LOC_CLOSE_VERSION 0x00010001 -#define RPC_LOC_START_FIX_VERSION 0x00010001 -#define RPC_LOC_STOP_FIX_VERSION 0x00010001 -#define RPC_LOC_IOCTL_VERSION 0x00010001 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 -#define RPC_LOC_API_API_MAJOR_NUM 0x0001 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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; - struct { - u_int nmea_sentences_len; - char *nmea_sentences_val; - } nmea_sentences; -}; -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_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; - -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_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_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; - struct { - u_int addr_len; - char *addr_val; - } addr; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; - struct { - u_int requestor_id_string_len; - char *requestor_id_string_val; - } requestor_id_string; - 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; - struct { - u_int client_name_string_len; - char *client_name_string_val; - } client_name_string; - 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; - u_char 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; - struct { - u_int ext_client_address_len; - char *ext_client_address_val; - } ext_client_address; -}; -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; - struct { - u_int lcs_codeword_string_len; - char *lcs_codeword_string_val; - } lcs_codeword_string; - 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; - struct { - u_int notification_text_len; - char *notification_text_val; - } notification_text; - 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; - -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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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; - -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_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_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_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_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; -}; -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; - -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; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; - -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_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_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_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_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; -#define RPC_LOC_API_NULL_VERSION 0x00010001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h deleted file mode 100644 index a71b23a0..00000000 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h deleted file mode 100644 index ef972bd6..00000000 --- a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - @file: loc_api_rpc_glue.h - @brief: Loc API Android glue code header - - DESCRIPTION - Loc API Android glue code header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/17/09 dx Initial version - -$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ -======================================================================*/ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#include "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "loc_api_fixup.h" - -#ifdef __cplusplus -extern "C" -{ -#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 - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - 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 */ -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback -); - -extern int32 loc_close -( - 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 -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c deleted file mode 100644 index 7fcfd6cb..00000000 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "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; - } - xprt_unregister(svrPort); - svc_destroy(svrPort); - //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - svrPort = NULL; -} diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk deleted file mode 100755 index f20280ee..00000000 --- a/loc_api/libloc_api/Android.mk +++ /dev/null @@ -1,39 +0,0 @@ -#Compile the old library version from Google push for Passion builds with old modem image -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) - -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES:= \ - libloc_api-rpc - -LOCAL_SHARED_LIBRARIES := \ - librpc \ - libutils \ - libcutils - -LOCAL_SRC_FILES += \ - loc_eng.cpp \ - loc_eng_ioctl.cpp \ - loc_eng_xtra.cpp \ - loc_eng_ni.cpp \ - gps.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -DAMSS_VERSION=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/libloc_api-rpc \ - $(TARGET_OUT_HEADERS)/libloc_api-rpc/inc \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ - $(TARGET_OUT_HEADERS)/librpc - - -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw - -include $(BUILD_SHARED_LIBRARY) -endif #BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION = 50001 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c deleted file mode 100644 index 5f6d8095..00000000 --- a/loc_api/libloc_api/gps.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -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 = malloc(sizeof(struct gps_device_t)); - 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 -}; - -const struct hw_module_t HAL_MODULE_INFO_SYM = { - .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, - .id = GPS_HARDWARE_MODULE_ID, - .name = "loc_api GPS Module", - .author = "Qualcomm USA, Inc.", - .methods = &gps_module_methods, -}; diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp deleted file mode 100644 index 68ac002c..00000000 --- a/loc_api/libloc_api/loc_eng.cpp +++ /dev/null @@ -1,1533 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include -#include -#include -#include - -#include -#include "loc_api_rpc_glue.h" -#include "loc_apicb_appinit.h" - -#include -#include -#include - -#include -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -#define DEBUG_MOCK_NI 0 - -// Function declarations for sLocEngInterface -static int loc_eng_init(GpsCallbacks* callbacks); -static int loc_eng_start(); -static int loc_eng_stop(); -static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); -static void loc_eng_cleanup(); -static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); -static int loc_eng_inject_location(double latitude, double longitude, float accuracy); -static void loc_eng_delete_aiding_data (GpsAidingData f); -static const void* loc_eng_get_extension(const char* name); - -// Function declarations for sLocEngAGpsInterface -static void loc_eng_agps_init(AGpsCallbacks* callbacks); -static int loc_eng_agps_data_conn_open(const char* apn); -static int loc_eng_agps_data_conn_closed(); -static int loc_eng_agps_data_conn_failed(); -static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); - - -static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload); -static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); -static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); -static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_report_ptr); -static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); -static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); - -static void loc_eng_process_deferred_action (void* arg); -static void loc_eng_process_atl_deferred_action (int flags); -static void loc_eng_delete_aiding_data_deferred_action (void); - -static int set_agps_server(); - -// Defines the GpsInterface in gps.h -static const GpsInterface sLocEngInterface = -{ - sizeof(GpsInterface), - loc_eng_init, - loc_eng_start, - loc_eng_stop, - loc_eng_cleanup, - loc_eng_inject_time, - loc_eng_inject_location, - loc_eng_delete_aiding_data, - loc_eng_set_position_mode, - loc_eng_get_extension, -}; - -static const AGpsInterface sLocEngAGpsInterface = -{ - sizeof(AGpsInterface), - loc_eng_agps_init, - loc_eng_agps_data_conn_open, - loc_eng_agps_data_conn_closed, - loc_eng_agps_data_conn_failed, - loc_eng_agps_set_server, -}; - -// Global data structure for location engine -loc_eng_data_s_type loc_eng_data; - -/*=========================================================================== -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 - -===========================================================================*/ -const GpsInterface* gps_get_hardware_interface () -{ - char propBuf[PROPERTY_VALUE_MAX]; - - // check to see if GPS should be disabled - property_get("gps.disable", propBuf, ""); - if (propBuf[0] == '1') - { - LOGD("gps_get_interface returning NULL because gps.disable=1\n"); - return NULL; - } - - return &sLocEngInterface; -} - -/*=========================================================================== -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 - -===========================================================================*/ - -// fully shutting down the GPS is temporarily disabled to avoid intermittent BP crash -#define DISABLE_CLEANUP 1 - -static int loc_eng_init(GpsCallbacks* callbacks) -{ -#if DISABLE_CLEANUP - if (loc_eng_data.deferred_action_thread) { - // already initialized - return 0; - } -#endif - // Start the LOC api RPC service - loc_api_glue_init (); - - callbacks->set_capabilities_cb(GPS_CAPABILITY_SCHEDULING | GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); - - memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); - - // LOC ENG module data initialization - 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; - loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; - - rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | - RPC_LOC_EVENT_SATELLITE_REPORT | - RPC_LOC_EVENT_LOCATION_SERVER_REQUEST | - RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST | - RPC_LOC_EVENT_IOCTL_REPORT | - RPC_LOC_EVENT_STATUS_REPORT | - RPC_LOC_EVENT_NMEA_POSITION_REPORT | - RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; - - loc_eng_data.client_handle = loc_open (event, loc_event_cb); - - pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); - pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); - pthread_mutex_init (&(loc_eng_data.deferred_stop_mutex), NULL); - - loc_eng_data.loc_event = 0; - loc_eng_data.deferred_action_flags = 0; - memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); - - loc_eng_data.aiding_data_for_deletion = 0; - loc_eng_data.engine_status = GPS_STATUS_NONE; - - // XTRA module data initialization - loc_eng_data.xtra_module_data.download_request_cb = NULL; - - // IOCTL module data initialization - loc_eng_data.ioctl_data.cb_is_selected = FALSE; - loc_eng_data.ioctl_data.cb_is_waiting = FALSE; - loc_eng_data.ioctl_data.client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; - memset (&(loc_eng_data.ioctl_data.cb_payload), - 0, - sizeof (rpc_loc_ioctl_callback_s_type)); - - pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); - pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); - - loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", - loc_eng_process_deferred_action, NULL); - - LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_cleanup - -DESCRIPTION - Cleans location engine. The location client handle will be released. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_cleanup() -{ -#if DISABLE_CLEANUP - return; -#else - if (loc_eng_data.deferred_action_thread) - { - /* Terminate deferred action working thread */ - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_QUIT; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - - void* ignoredValue; - pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); - loc_eng_data.deferred_action_thread = NULL; - } - - // clean up - (void) loc_close (loc_eng_data.client_handle); - - pthread_mutex_destroy (&loc_eng_data.deferred_action_mutex); - pthread_cond_destroy (&loc_eng_data.deferred_action_cond); - - pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); - pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); - -// Do not call this as it can result in the ARM9 crashing if it sends events while we are disabled -// loc_apicb_app_deinit(); -#endif -} - - -/*=========================================================================== -FUNCTION loc_eng_start - -DESCRIPTION - Starts the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_start() -{ - int ret_val; - LOGD ("loc_eng_start\n"); - - if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && - loc_eng_data.agps_server_host[0] != 0 && - loc_eng_data.agps_server_port != 0) { - int result = set_agps_server(); - LOGD ("set_agps_server returned = %d\n", result); - } - - ret_val = loc_start_fix (loc_eng_data.client_handle); - - if (ret_val != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_eng_start returned error = %d\n", ret_val); - } - - return 0; -} - - -/*=========================================================================== -FUNCTION loc_eng_stop - -DESCRIPTION - Stops the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_stop() -{ - int ret_val; - - LOGD ("loc_eng_stop\n"); - - pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); - // work around problem with loc_eng_stop when AGPS requests are pending - // we defer stopping the engine until the AGPS request is done - if (loc_eng_data.agps_request_pending) - { - loc_eng_data.stop_request_pending = true; - LOGD ("deferring stop until AGPS data call is finished\n"); - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - return 0; - } - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - - ret_val = loc_stop_fix (loc_eng_data.client_handle); - if (ret_val != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_eng_stop returned error = %d\n", ret_val); - } - - return 0; -} - -static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - boolean ret_val; - - LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", - (int32) loc_eng_data.client_handle, lock_type); - - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; - 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*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_set_gps_lock mode failed\n"); - } - - return 0; -} - -/*=========================================================================== -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 - -===========================================================================*/ -static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr; - boolean ret_val; - - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) loc_eng_data.client_handle, min_interval, mode); - - loc_eng_data.position_mode = mode; - ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; - - fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); - fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | - RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; - - switch (mode) { - case GPS_POSITION_MODE_MS_BASED: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; - break; - case GPS_POSITION_MODE_MS_ASSISTED: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; - break; - case GPS_POSITION_MODE_STANDALONE: - default: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; - break; - } - if (min_interval > 0) { - fix_criteria_ptr->min_interval = min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - } - if (preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = preferred_accuracy; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; - } - if (preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = preferred_time; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; - } - - switch (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; - } - - ret_val = loc_eng_ioctl(loc_eng_data.client_handle, - RPC_LOC_IOCTL_SET_FIX_CRITERIA, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_set_position mode failed\n"); - } - - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_inject_time - -DESCRIPTION - This is used by Java native function to do time injection. - -DEPENDENCIES - None - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_inject_time (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; - boolean ret_val; - - LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); - - ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; - - 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)(android::elapsedRealtime() - timeReference); - time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_UTC_TIME, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_inject_time failed\n"); - } - - return 0; -} - -static int loc_eng_inject_location (double latitude, double longitude, float accuracy) -{ - /* not yet implemented */ - 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 - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_delete_aiding_data (GpsAidingData f) -{ - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - - // Currently, LOC API only support deletion of all aiding data, - if (f) - loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; - - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) - { - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - - // In case gps engine is ON, the assistance data will be deleted when the engine is OFF - } - - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); -} - -/*=========================================================================== -FUNCTION loc_eng_get_extension - -DESCRIPTION - Get the gps extension to support XTRA. - -DEPENDENCIES - N/A - -RETURN VALUE - The GPS extension interface. - -SIDE EFFECTS - N/A - -===========================================================================*/ -static const void* loc_eng_get_extension(const char* name) -{ - if (strcmp(name, GPS_XTRA_INTERFACE) == 0) - { - return &sLocEngXTRAInterface; - } - else if (strcmp(name, AGPS_INTERFACE) == 0) - { - return &sLocEngAGpsInterface; - } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) - { - return &sLocEngNiInterface; - } - - return NULL; -} - -#if DEBUG_MOCK_NI == 1 -/*=========================================================================== -FUNCTION mock_ni - -DESCRIPTION - DEBUG tool: simulate an NI request - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void* mock_ni(void* arg) -{ - static int busy = 0; - - if (busy) return NULL; - - busy = 1; - - sleep(5); - - rpc_loc_client_handle_type client_handle; - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type payload; - rpc_loc_ni_event_s_type *ni_req; - rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; - - client_handle = (rpc_loc_client_handle_type) arg; - - loc_event = RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; - payload.disc = loc_event; - - ni_req = &payload.rpc_loc_event_payload_u_type_u.ni_request; - ni_req->event = RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ; - supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; - - // Encodings for Spirent Communications - char client_name[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, - 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; - char requestor_id[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, - 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; - - supl_req->flags = RPC_LOC_NI_CLIENT_NAME_PRESENT | - RPC_LOC_NI_REQUESTOR_ID_PRESENT | - RPC_LOC_NI_ENCODING_TYPE_PRESENT; - - supl_req->datacoding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; - - supl_req->client_name.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; // no coding - supl_req->client_name.client_name_string.client_name_string_len = strlen(client_name); - supl_req->client_name.client_name_string.client_name_string_val = client_name; - supl_req->client_name.string_len = strlen(client_name); - - supl_req->requestor_id.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; - supl_req->requestor_id.requestor_id_string.requestor_id_string_len = strlen(requestor_id); - supl_req->requestor_id.requestor_id_string.requestor_id_string_val = requestor_id; - supl_req->requestor_id.string_len = strlen(requestor_id); - - supl_req->notification_priv_type = RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP; - supl_req->user_response_timer = 10; - - loc_event_cb(client_handle, loc_event, &payload); - - busy = 0; - - return NULL; -} -#endif // DEBUG_MOCK_NI - -/*=========================================================================== -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( - rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload - ) -{ - LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); - if (client_handle == loc_eng_data.client_handle) - { - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - loc_eng_data.loc_event = loc_event; - memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_EVENT; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - } - else - { - LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); - } - - return RPC_LOC_API_SUCCESS; -} - -/*=========================================================================== -FUNCTION loc_eng_report_position - -DESCRIPTION - Reports position information to the Java layer. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) -{ - GpsLocation location; - - LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", - (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); - - memset (&location, 0, sizeof(location)); - location.size = sizeof(location); - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) - { - // Not a position report, return - if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS) - { - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) - { - location.timestamp = location_report_ptr->timestamp_utc; - } - - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE)) - { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) - { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitude_wrt_ellipsoid; - } - - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) - { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) - { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) - { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->hor_unc_circular; - } - - if (loc_eng_data.location_cb != NULL) - { - LOGV ("loc_eng_report_position: fire callback\n"); - loc_eng_data.location_cb (&location); - } - } - else - { - LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); - } - } - else - { - LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); - } -} - -/*=========================================================================== -FUNCTION loc_eng_report_sv - -DESCRIPTION - Reports GPS satellite information to the Java layer. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - int num_svs_max, i; - const rpc_loc_sv_info_s_type *sv_info_ptr; - - LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", - (uint32) gnss_report_ptr->valid_mask, - gnss_report_ptr->sv_count); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - 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 (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(GpsSvStatus); - 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.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) - { - 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++; - } - } - - LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); - if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) - { - loc_eng_data.sv_status_cb(&SvStatus); - } -} - -/*=========================================================================== -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 (const rpc_loc_status_event_s_type *status_report_ptr) -{ - GpsStatus status; - - LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); - - memset (&status, 0, sizeof(status)); - status.size = sizeof(status); - status.status = GPS_STATUS_NONE; - 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) - { - // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON - status.status = GPS_STATUS_SESSION_BEGIN; - loc_eng_data.status_cb(&status); - } - else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) - { - // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF - status.status = GPS_STATUS_ENGINE_OFF; - loc_eng_data.status_cb(&status); - } - } - - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - loc_eng_data.engine_status = status.status; - - // Wake up the thread for aiding data deletion. - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) - { - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - // In case gps engine is ON, the assistance data will be deleted when the engine is OFF - } - - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); -} - -static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) -{ - if (loc_eng_data.nmea_cb != NULL) - { - struct timeval tv; - - gettimeofday(&tv, (struct timezone *) NULL); - long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - -#if (AMSS_VERSION==3200) - loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); -#else - loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences, nmea_report_ptr->length); -#endif - } -} - -/*=========================================================================== -FUNCTION loc_eng_process_conn_request - -DESCRIPTION - Requests data connection to be brought up/tore down with the location server. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) -{ - LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); - - // Signal DeferredActionThread to send the APN name - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - - // This implemenation is based on the fact that modem now at any time has only one data connection for AGPS at any given time - if (server_request_ptr->event == RPC_LOC_SERVER_REQUEST_OPEN) - { - loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; - loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; - loc_eng_data.agps_request_pending = true; - } - else - { - loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; - loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; - loc_eng_data.agps_request_pending = false; - } - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_STATUS; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); -} - -/*=========================================================================== -FUNCTION loc_eng_agps_init - -DESCRIPTION - - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_agps_init(AGpsCallbacks* callbacks) -{ - LOGV("loc_eng_agps_init\n"); - loc_eng_data.agps_status_cb = callbacks->status_cb; -} - -static int loc_eng_agps_data_conn_open(const char* apn) -{ - int apn_len; - LOGD("loc_eng_agps_data_conn_open: %s\n", apn); - - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - - if (apn != NULL) - { - apn_len = strlen (apn); - - if (apn_len >= sizeof(loc_eng_data.apn_name)) - { - LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); - apn_len = sizeof(loc_eng_data.apn_name) - 1; - } - - memcpy (loc_eng_data.apn_name, apn, apn_len); - loc_eng_data.apn_name[apn_len] = '\0'; - } - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_SUCCESS; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int loc_eng_agps_data_conn_closed() -{ - LOGD("loc_eng_agps_data_conn_closed\n"); - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_CLOSED; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int loc_eng_agps_data_conn_failed() -{ - LOGD("loc_eng_agps_data_conn_failed\n"); - - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_FAILED; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int set_agps_server() -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_server_info_s_type *server_info_ptr; - boolean ret_val; - uint16 port_temp; - unsigned char *b_ptr; - - if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) - return -1; - - if (loc_eng_data.agps_server_address == 0) { - struct hostent* he = gethostbyname(loc_eng_data.agps_server_host); - if (he) - loc_eng_data.agps_server_address = *(uint32_t *)he->h_addr_list[0]; - } - if (loc_eng_data.agps_server_address == 0) - return -1; - - b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); - - - server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); - ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; - server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; - server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; - -#if (AMSS_VERSION==3200) - char url[24]; - memset(url, 0, sizeof(url)); - snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", - (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), - (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), - (loc_eng_data.agps_server_port & (0x0000ffff))); - - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); - LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); -#else - char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; - int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); - memset(buf, 0, buf_len); - snprintf(buf, buf_len - 1, "%d.%d.%d.%d:%d", - (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), - (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), - (loc_eng_data.agps_server_port & (0x0000ffff))); - - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; - LOGD ("set_agps_server, addr = %s\n", buf); -#endif - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("set_agps_server failed\n"); - return -1; - } - else - { - LOGV ("set_agps_server successful\n"); - return 0; - } -} - -static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) -{ - LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); - - if (type != AGPS_TYPE_SUPL) - return -1; - - strncpy(loc_eng_data.agps_server_host, hostname, sizeof(loc_eng_data.agps_server_host) - 1); - loc_eng_data.agps_server_port = port; - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_delete_aiding_data_deferred_action - -DESCRIPTION - This is used to remove the aiding data when GPS engine is off. - -DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with - LOC API specification. - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_delete_aiding_data_deferred_action (void) -{ - // Currently, we only support deletion of all aiding data, - // since the Android defined aiding data mask matches with modem, - // so just pass them down without any translation - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_assist_data_delete_s_type *assist_data_ptr; - boolean ret_val; - - ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; - assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); - assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; - loc_eng_data.aiding_data_for_deletion = 0; - - memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_DELETE_ASSIST_DATA , - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL); - - LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); -} - -/*=========================================================================== -FUNCTION loc_eng_process_atl_deferred_action - -DESCRIPTION - This is used to inform the location engine of the processing status for - data connection open/close request. - -DEPENDENCIES - None - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_atl_deferred_action (int flags) -{ - rpc_loc_server_open_status_s_type *conn_open_status_ptr; - rpc_loc_server_close_status_s_type *conn_close_status_ptr; - rpc_loc_ioctl_data_u_type ioctl_data; - boolean ret_val; - int agps_status = -1; - - LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); - - memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - - if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) - { - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; - conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); - conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; - conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; - } - else - { - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; - conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; - conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; - if (flags & DEFERRED_ACTION_AGPS_DATA_SUCCESS) - { - conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; - // Both buffer are of the same maximum size, and the source is null terminated - // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); -#if (AMSS_VERSION==3200) - conn_open_status_ptr->apn_name = loc_eng_data.apn_name; -#else - memset(conn_open_status_ptr->apn_name, 0, sizeof(conn_open_status_ptr->apn_name)); - strncpy(conn_open_status_ptr->apn_name, loc_eng_data.apn_name, - sizeof(conn_open_status_ptr->apn_name) - 1); -#endif - // Delay this so that PDSM ATL module will behave properly - sleep (1); - LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); - } - else // data_connection_failed - { - conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; - } - // Delay this so that PDSM ATL module will behave properly - sleep (1); - } - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - ioctl_data.disc, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL); - - LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); -} - -/*=========================================================================== -FUNCTION loc_eng_process_loc_event - -DESCRIPTION - This is used to process events received from the location engine. - -DEPENDENCIES - None - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, - rpc_loc_event_payload_u_type* loc_event_payload) -{ - if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) - { - loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); - } - - if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) - { - loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); - } - - if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) - { - loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); - } - - if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) - { - loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); - } - - // Android XTRA interface 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) - { - LOGD ("loc_event_cb: xtra download requst"); - - // Call Registered callback - if (loc_eng_data.xtra_module_data.download_request_cb != NULL) - { - loc_eng_data.xtra_module_data.download_request_cb (); - } - } - } - - if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) - { - // Process the received RPC_LOC_EVENT_IOCTL_REPORT - (void) loc_eng_ioctl_process_cb (loc_eng_data.client_handle, - &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); - } - - if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) - { - loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); - } - - loc_eng_ni_callback(loc_event, loc_event_payload); - -#if DEBUG_MOCK_NI == 1 - // DEBUG only - if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && - loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. - payload.rpc_loc_status_event_payload_u_type_u.engine_state - == RPC_LOC_ENGINE_STATE_OFF) - { - // Mock an NI request - pthread_t th; - pthread_create (&th, NULL, mock_ni, (void*) client_handle); - } -#endif /* DEBUG_MOCK_NI == 1 */ -} - -/*=========================================================================== -FUNCTION loc_eng_process_deferred_action - -DESCRIPTION - Main routine for the thread to execute certain commands - that are not safe to be done from within an RPC callback. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_deferred_action (void* arg) -{ - AGpsStatus status; - status.size = sizeof(status); - status.type = AGPS_TYPE_SUPL; - - LOGD("loc_eng_process_deferred_action started\n"); - - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); - - // disable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); - loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); - - while (1) - { - GpsAidingData aiding_data_for_deletion; - GpsStatusValue engine_status; - - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type loc_event_payload; - - // Wait until we are signalled to do a deferred action, or exit - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - - // If we have an event we should process it immediately, - // otherwise wait until we are signalled - if (loc_eng_data.deferred_action_flags == 0) { - // do not hold a wake lock while waiting for an event... - loc_eng_data.release_wakelock_cb(); - pthread_cond_wait(&loc_eng_data.deferred_action_cond, - &loc_eng_data.deferred_action_mutex); - // but after we are signalled reacquire the wake lock - // until we are done processing the event. - loc_eng_data.acquire_wakelock_cb(); - } - - if (loc_eng_data.deferred_action_flags & DEFERRED_ACTION_QUIT) - { - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - break; - } - - // copy anything we need before releasing the mutex - loc_event = loc_eng_data.loc_event; - if (loc_event != 0) { - memcpy(&loc_event_payload, &loc_eng_data.loc_event_payload, sizeof(loc_event_payload)); - loc_eng_data.loc_event = 0; - } - - int flags = loc_eng_data.deferred_action_flags; - loc_eng_data.deferred_action_flags = 0; - engine_status = loc_eng_data.agps_status; - aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; - status.status = loc_eng_data.agps_status; - loc_eng_data.agps_status = 0; - - // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - - if (loc_event != 0) { - loc_eng_process_loc_event(loc_event, &loc_event_payload); - } - - // send_delete_aiding_data must be done when GPS engine is off - if ((engine_status != GPS_STATUS_SESSION_BEGIN) && (aiding_data_for_deletion != 0)) - { - loc_eng_delete_aiding_data_deferred_action (); - } - - if (flags & (DEFERRED_ACTION_AGPS_DATA_SUCCESS | - DEFERRED_ACTION_AGPS_DATA_CLOSED | - DEFERRED_ACTION_AGPS_DATA_FAILED)) - { - loc_eng_process_atl_deferred_action(flags); - - pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); - // work around problem with loc_eng_stop when AGPS requests are pending - // we defer stopping the engine until the AGPS request is done - loc_eng_data.agps_request_pending = false; - if (loc_eng_data.stop_request_pending) - { - LOGD ("handling deferred stop\n"); - if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_stop_fix failed!\n"); - } - } - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - } - - if (status.status != 0 && loc_eng_data.agps_status_cb) { - loc_eng_data.agps_status_cb(&status); - } - } - - // reenable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); - loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); - - LOGD("loc_eng_process_deferred_action thread exiting\n"); - loc_eng_data.release_wakelock_cb(); - - loc_eng_data.deferred_action_thread = 0; -} - -// for gps.c -extern "C" const GpsInterface* get_gps_interface() -{ - return &sLocEngInterface; -} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h deleted file mode 100644 index 553a97e0..00000000 --- a/loc_api/libloc_api/loc_eng.h +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -// 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 - -#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds - -enum { - DEFERRED_ACTION_EVENT = 0x01, - DEFERRED_ACTION_DELETE_AIDING = 0x02, - DEFERRED_ACTION_AGPS_STATUS = 0x04, - DEFERRED_ACTION_AGPS_DATA_SUCCESS = 0x08, - DEFERRED_ACTION_AGPS_DATA_CLOSED = 0x10, - DEFERRED_ACTION_AGPS_DATA_FAILED = 0x20, - DEFERRED_ACTION_QUIT = 0x40, -}; - -// Module data -typedef struct -{ - rpc_loc_client_handle_type client_handle; - - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - agps_status_callback agps_status_cb; - gps_nmea_callback nmea_cb; - gps_ni_notify_callback ni_notify_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - int agps_status; - - // used to defer stopping the GPS engine until AGPS data calls are done - boolean agps_request_pending; - boolean stop_request_pending; - pthread_mutex_t deferred_stop_mutex; - - loc_eng_xtra_data_s_type xtra_module_data; - - loc_eng_ioctl_data_s_type ioctl_data; - - // data from loc_event_cb - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type loc_event_payload; - - // TBD: - char agps_server_host[256]; - int agps_server_port; - uint32 agps_server_address; - char apn_name[100]; - int position_mode; - rpc_loc_server_connection_handle conn_handle; - - // GPS engine status - GpsStatusValue engine_status; - - // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off - GpsAidingData aiding_data_for_deletion; - - // Data variables used by deferred action thread - pthread_t deferred_action_thread; - // Mutex used by deferred action thread - pthread_mutex_t deferred_action_mutex; - // Condition variable used by deferred action thread - pthread_cond_t deferred_action_cond; - - // flags for pending events for deferred action thread - int deferred_action_flags; -} loc_eng_data_s_type; - -extern loc_eng_data_s_type loc_eng_data; - -#endif // LOC_ENG_H diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp deleted file mode 100644 index a43d8cca..00000000 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include -#include -#include - -#include -#include - -#include - -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -// Function declarations -static boolean loc_eng_ioctl_setup_cb( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type -); - -static boolean loc_eng_ioctl_wait_cb( - int timeout_msec, // Timeout in this number of msec - rpc_loc_ioctl_callback_s_type *cb_data_ptr // Output parameter for IOCTL calls -); - -/*=========================================================================== - -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 - -===========================================================================*/ -boolean 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 - ) -{ - boolean ret_val; - int rpc_ret_val; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - // Select the callback we are waiting for - ret_val = loc_eng_ioctl_setup_cb (handle, ioctl_type); - - if (ret_val == TRUE) - { - rpc_ret_val = loc_ioctl (handle, - ioctl_type, - ioctl_data_ptr); - - LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); - - if (rpc_ret_val == RPC_LOC_API_SUCCESS) - { - // Wait for the callback of loc_ioctl - ret_val = loc_eng_ioctl_wait_cb (timeout_msec, cb_data_ptr); - } - else - { - ret_val = FALSE; - } - } - - // Reset the state when we are done - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - ioctl_cb_data_ptr->cb_is_selected = FALSE; - ioctl_cb_data_ptr->cb_is_waiting = FALSE; - ioctl_cb_data_ptr->cb_has_arrived = FALSE; - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - return ret_val; -} - - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_setup_cb - -DESCRIPTION - Selects which callback is going to be waited for - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -static boolean loc_eng_ioctl_setup_cb( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type - ) -{ - boolean ret_val; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - if (ioctl_cb_data_ptr->cb_is_selected == TRUE) - { - LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); - ret_val = FALSE; - } - else - { - ioctl_cb_data_ptr->cb_is_selected = TRUE; - ioctl_cb_data_ptr->cb_is_waiting = FALSE; - ioctl_cb_data_ptr->cb_has_arrived = FALSE; - ioctl_cb_data_ptr->client_handle = handle; - ioctl_cb_data_ptr->ioctl_type = ioctl_type; - memset (&(ioctl_cb_data_ptr->cb_payload), 0, sizeof (rpc_loc_ioctl_callback_s_type)); - ret_val = TRUE; - } - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_wait_cb - -DESCRIPTION - Waits for a selected callback. The wait expires in timeout_msec. - - If the function is called before an existing wait has finished, it will - immediately return EBUSY. - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -boolean loc_eng_ioctl_wait_cb( - int timeout_msec, // Timeout in this number of msec - rpc_loc_ioctl_callback_s_type *cb_data_ptr - ) -{ - boolean ret_val = FALSE; // the return value of this function - int rc; // return code from pthread calls - - struct timeval present_time; - struct timespec expire_time; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - - do { - if (ioctl_cb_data_ptr->cb_is_selected == FALSE) - { - LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); - ret_val = FALSE; - break; - } - - // Calculate absolute expire time - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_sec += timeout_msec / 1000; - if ((present_time.tv_usec + timeout_msec) >= 1000) - { - expire_time.tv_sec += 1; - } - expire_time.tv_nsec = (present_time.tv_usec + timeout_msec) % 1000 * 1000; - - // Special case where callback is issued before loc_ioctl ever returns - if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) - { - LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); - ret_val = TRUE; - break; - } - - ioctl_cb_data_ptr->cb_is_waiting = TRUE; - // Wait for the callback until timeout expires - rc = pthread_cond_timedwait(&ioctl_cb_data_ptr->cb_arrived_cond, - &ioctl_cb_data_ptr->cb_data_mutex, - &expire_time); - - if (rc == 0) - { - ret_val = TRUE; - } - else - { - ret_val = FALSE; - } - - LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); - - } while (0); - - // Process the ioctl callback data when IOCTL is successful - if (ret_val == TRUE) - { - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - if (ioctl_cb_data_ptr->cb_payload.status == RPC_LOC_API_SUCCESS) - { - ret_val = TRUE; - if (cb_data_ptr != NULL) - { - memcpy (cb_data_ptr, - &(ioctl_cb_data_ptr->cb_payload), - sizeof (rpc_loc_ioctl_callback_s_type)); - } - } - else - { - ret_val = FALSE; - } - } - - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_process_cb - -DESCRIPTION - This function process the IOCTL callback, parameter specifies the client - that receives the IOCTL callback. - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -boolean loc_eng_ioctl_process_cb ( - rpc_loc_client_handle_type client_handle, - const rpc_loc_ioctl_callback_s_type *cb_data_ptr - ) -{ - boolean ret_val = FALSE; // the return value of this function - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - if (client_handle != ioctl_cb_data_ptr->client_handle) - { - LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", - (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); - ret_val = FALSE; - } - else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) - { - LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", - cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); - ret_val = FALSE; - } - else // both matches - { - memcpy (&(ioctl_cb_data_ptr->cb_payload), - cb_data_ptr, - sizeof (rpc_loc_ioctl_callback_s_type)); - - ioctl_cb_data_ptr->cb_has_arrived = TRUE; - - LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", - (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, - (int32) ioctl_cb_data_ptr->cb_payload.status); - - ret_val = TRUE; - } - - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - // Signal the waiting thread that callback has arrived - if (ret_val == TRUE) - { - pthread_cond_signal (&ioctl_cb_data_ptr->cb_arrived_cond); - } - - return ret_val; -} diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h deleted file mode 100644 index eb0c201a..00000000 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_IOCTL_H -#define LOC_ENG_IOCTL_H - -// Module data -typedef struct loc_eng_ioctl_data_s_type -{ - // We are waiting for an ioctl callback - boolean cb_is_selected; - // The thread has been put in a wait state for an ioctl callback - boolean cb_is_waiting; - // Loc client handle that is waiting for the callback - rpc_loc_client_handle_type client_handle; - // IOCTL type that the loc client is waiting for - rpc_loc_ioctl_e_type ioctl_type; - // The IOCLT report has arrived for the waiting client - boolean cb_has_arrived; - // The payload for the RPC_LOC_EVENT_IOCTL_REPORT - rpc_loc_ioctl_callback_s_type cb_payload; - // Mutex to access this data structure - pthread_mutex_t cb_data_mutex; - // LOC ioctl callback arrived mutex - pthread_cond_t cb_arrived_cond; -} loc_eng_ioctl_data_s_type; - - -extern boolean 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 -); - -extern boolean loc_eng_ioctl_process_cb -( - rpc_loc_client_handle_type client_handle, - const rpc_loc_ioctl_callback_s_type *cb_data_ptr -); -#endif // LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp deleted file mode 100644 index 3df0af14..00000000 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ /dev/null @@ -1,609 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include -#include -#include - -#include -#include -#include -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -/*============================================================================= - * - * DATA DECLARATION - * - *============================================================================*/ - -const GpsNiInterface sLocEngNiInterface = -{ - sizeof(GpsNiInterface), - loc_eng_ni_init, - loc_eng_ni_respond, -}; - -boolean loc_eng_ni_data_init = FALSE; -loc_eng_ni_data_s_type loc_eng_ni_data; - -extern loc_eng_data_s_type loc_eng_data; - -/*============================================================================= - * - * FUNCTION DECLARATIONS - * - *============================================================================*/ - -/*=========================================================================== - -FUNCTION respond_from_enum - -DESCRIPTION - Returns the name of the response - -RETURN VALUE - response name string - -===========================================================================*/ -static const char* respond_from_enum(rpc_loc_ni_user_resp_e_type resp) -{ - switch (resp) - { - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT: - return "accept"; - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY: - return "deny"; - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP: - return "no response"; - default: - return NULL; - } -} - -/*=========================================================================== - -FUNCTION loc_ni_respond - -DESCRIPTION - Displays the NI request and awaits user input. If a previous request is - in session, the new one is handled using sys.ni_default_response (if exists); - otherwise, it is denied. - -DEPENDENCY - Do not lock the data by mutex loc_ni_lock - -RETURN VALUE - none - -===========================================================================*/ -static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, - const rpc_loc_ni_event_s_type *request_pass_back -) -{ - LOGD("Sending NI response: %s\n", respond_from_enum(resp)); - - 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, - request_pass_back, sizeof (rpc_loc_ni_event_s_type)); - data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = resp; - - loc_eng_ioctl( - loc_eng_data.client_handle, - RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, - &data, - LOC_IOCTL_DEFAULT_TIMEOUT, - &callback_payload - ); -} - -/*=========================================================================== - -FUNCTION loc_ni_fill_notif_verify_type - -DESCRIPTION - Fills need_notify, need_verify, etc. - -RETURN VALUE - none - -===========================================================================*/ -static boolean loc_ni_fill_notif_verify_type(GpsNiNotification *notif, - rpc_loc_ni_notify_verify_e_type notif_priv) -{ - notif->notify_flags = 0; - notif->default_response = GPS_NI_RESPONSE_NORESP; - - switch (notif_priv) - { - case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: - notif->notify_flags = 0; - break; - - case RPC_LOC_NI_USER_NOTIFY_ONLY: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - 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; - break; - - 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; - break; - - case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return FALSE; - } - - return TRUE; -} - -/*=========================================================================== - -FUNCTION hexcode - -DESCRIPTION - Converts a binary array into a Hex string. E.g., 1F 00 3F --> "1F003F" - -RETURN VALUE - bytes encoded - -===========================================================================*/ -static 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; -} - -static GpsNiEncodingType convert_encoding_type(int loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case RPC_LOC_NI_SUPL_UTF8: - enc = GPS_ENC_SUPL_UTF8; - break; - case RPC_LOC_NI_SUPL_UCS2: - enc = GPS_ENC_SUPL_UCS2; - break; - case RPC_LOC_NI_SUPL_GSM_DEFAULT: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - default: - break; - } - - return enc; -} - -/*=========================================================================== - -FUNCTION loc_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 - -===========================================================================*/ -static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) -{ - GpsNiNotification notif; - notif.size = sizeof(notif); - strlcpy(notif.text, "[text]", sizeof notif.text); // defaults - strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); - - /* If busy, use default or deny */ - if (loc_eng_ni_data.notif_in_progress) - { -#if 0 - /* Cannot be here because the current thread is in RPC client */ - /* XXX Consider adding an event queue to process overlapped NI requests */ - loc_ni_user_resp_e_type response = - sys.ni_default_resp == 1 /* accept */ ? - LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT : - LOC_NI_LCS_NOTIFY_VERIFY_DENY; - - loc_ni_respond(response, ni_req); */ -#endif - LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", - ni_req->event); - } - else { - /* Print notification */ - LOGD("NI Notification: %s, event: %d", msg, ni_req->event); - - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - - /* Save request */ - memcpy(&loc_eng_ni_data.loc_ni_request, ni_req, sizeof loc_eng_ni_data.loc_ni_request); - - /* Set up NI response waiting */ - loc_eng_ni_data.notif_in_progress = TRUE; - loc_eng_ni_data.current_notif_id = abs(rand()); - - /* Fill in notification */ - notif.notification_id = loc_eng_ni_data.current_notif_id; - - const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req; - const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; - const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req; - - switch (ni_req->event) - { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - vx_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; - notif.ni_type = GPS_NI_TYPE_VOICE; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // vx_req->user_resp_timer_val; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // 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 = convert_encoding_type(vx_req->encoding_scheme); - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, vx_req->notification_priv_type); - - break; - - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - umts_cp_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // umts_cp_req->user_response_timer; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // Stores notification text - hexcode(notif.text, sizeof notif.text, -#if (AMSS_VERSION==3200) - umts_cp_req->notification_text.notification_text_val, -#else - umts_cp_req->notification_text, -#endif - umts_cp_req->notification_length); - - // Stores requestor ID - hexcode(notif.requestor_id, sizeof notif.requestor_id, -#if (AMSS_VERSION==3200) - umts_cp_req->requestor_id.requestor_id_string.requestor_id_string_val, -#else - umts_cp_req->requestor_id.requestor_id_string, -#endif - umts_cp_req->requestor_id.string_len); - - notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); - notif.requestor_id_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, umts_cp_req->notification_priv_type); - - break; - - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // supl_req->user_response_timer; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // Client name - if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) - { - hexcode(notif.text, sizeof notif.text, -#if (AMSS_VERSION==3200) - supl_req->client_name.client_name_string.client_name_string_val, /* buffer */ -#else - supl_req->client_name.client_name_string, /* buffer */ -#endif - supl_req->client_name.string_len /* length */ - ); - LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); - } else { - LOGD("SUPL NI: client_name not present."); - } - - // Requestor ID - if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, -#if (AMSS_VERSION==3200) - supl_req->requestor_id.requestor_id_string.requestor_id_string_val, /* buffer */ -#else - supl_req->requestor_id.requestor_id_string, /* buffer */ -#endif - supl_req->requestor_id.string_len /* length */ - ); - LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); - } else { - LOGD("SUPL NI: requestor_id not present."); - } - - // Encoding type - if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) - { - notif.text_encoding = convert_encoding_type(supl_req->datacoding_scheme); - notif.requestor_id_encoding = convert_encoding_type(supl_req->datacoding_scheme); - } else { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); - - break; - - default: - LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); - return; - } - - /* Log requestor ID and text for debugging */ - LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); - LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); - LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); - - /* For robustness, always sets a timeout to clear up the notification status, even though - * the OEM layer in java does not do so. - **/ - loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); - LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); - - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - - /* Notify callback */ - if (loc_eng_data.ni_notify_cb != NULL) - { - loc_eng_data.ni_notify_cb(¬if); - } - } -} - -/*=========================================================================== - -FUNCTION loc_ni_process_user_response - -DESCRIPTION - Handles user input from the UI - -RETURN VALUE - error code (0 for successful, -1 for error) - -===========================================================================*/ -int loc_ni_process_user_response(GpsUserResponseType userResponse) -{ - LOGD("NI response from UI: %d", userResponse); - - rpc_loc_ni_user_resp_e_type resp; - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; - break; - case GPS_NI_RESPONSE_DENY: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; - break; - case GPS_NI_RESPONSE_NORESP: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; - break; - default: - return -1; - } - - loc_ni_respond(resp, &loc_eng_ni_data.loc_ni_request); - - /* Make the NI respond */ - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - loc_eng_ni_data.notif_in_progress = FALSE; - loc_eng_ni_data.response_time_left = 0; - loc_eng_ni_data.current_notif_id = -1; - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - - return 0; -} - -/*=========================================================================== - -FUNCTION loc_eng_ni_callback - -DESCRIPTION - Loc API callback handler - -RETURN VALUE - error code (0 for success) - -===========================================================================*/ -int loc_eng_ni_callback ( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -) -{ - int rc = 0; - const rpc_loc_ni_event_s_type *ni_req = &loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request; - if (loc_event == RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) - { - switch (ni_req->event) - { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - LOGI("VX Notification"); - loc_ni_request_handler("VX Notify", ni_req); - break; - - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - LOGI("UMTS CP Notification\n"); - loc_ni_request_handler("UMTS CP Notify", ni_req); - break; - - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - LOGI("SUPL Notification\n"); - loc_ni_request_handler("SUPL Notify", ni_req); - break; - - default: - LOGE("Unknown NI event: %x\n", (int) ni_req->event); - break; - } - } - return rc; -} - -/*=========================================================================== - -FUNCTION loc_ni_thread_proc - -===========================================================================*/ -static void loc_ni_thread_proc(void *unused) -{ - LOGI("Starting Loc NI thread...\n"); - - while (1) - { - /* wakes up every second to check timed out requests */ - sleep(1); - - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - - if (loc_eng_ni_data.notif_in_progress && loc_eng_ni_data.response_time_left > 0) - { - loc_eng_ni_data.response_time_left--; - if (loc_eng_ni_data.response_time_left <= 0) - { - loc_ni_respond(RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP, &loc_eng_ni_data.loc_ni_request); - loc_eng_ni_data.notif_in_progress = FALSE; - } - } - - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - } /* while (1) */ -} - -/*=========================================================================== -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(GpsNiCallbacks *callbacks) -{ - LOGD("loc_eng_ni_init: entered."); - - if (!loc_eng_ni_data_init) - { - pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); - callbacks->create_thread_cb("loc_api_ni", loc_ni_thread_proc, NULL); - loc_eng_ni_data_init = TRUE; - } - - loc_eng_ni_data.notif_in_progress = FALSE; - loc_eng_ni_data.current_notif_id = -1; - loc_eng_ni_data.response_time_left = 0; - - srand(time(NULL)); - loc_eng_data.ni_notify_cb = callbacks->notify_cb; -} - -/*=========================================================================== -FUNCTION loc_eng_ni_respond - -DESCRIPTION - This function sends an NI respond to the modem processor - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) -{ - if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) - { - LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); - loc_ni_process_user_response(user_response); - } else { - LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", - notif_id, user_response); - } -} diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h deleted file mode 100644 index 193b9f85..00000000 --- a/loc_api/libloc_api/loc_eng_ni.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ - -extern const GpsNiInterface sLocEngNiInterface; - -typedef struct { - pthread_mutex_t loc_ni_lock; - int response_time_left; /* examine time for NI response */ - boolean notif_in_progress; /* NI notification/verification in progress */ - rpc_loc_ni_event_s_type loc_ni_request; - int current_notif_id; /* ID to check against response */ -} loc_eng_ni_data_s_type; - -// Functions for sLocEngNiInterface -extern void loc_eng_ni_init(GpsNiCallbacks *callbacks); -extern void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response); - -extern int loc_eng_ni_callback ( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -); - -#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp deleted file mode 100644 index 1ec3bf07..00000000 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include -#include -#include - -#include -#include - -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) -#define XTRA_BLOCK_SIZE (400) - -static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks); -static int qct_loc_eng_inject_xtra_data(char* data, int length); - -const GpsXtraInterface sLocEngXTRAInterface = -{ - sizeof(GpsXtraInterface), - qct_loc_eng_xtra_init, - qct_loc_eng_inject_xtra_data, -}; - -/*=========================================================================== -FUNCTION qct_loc_eng_xtra_init - -DESCRIPTION - Initialize XTRA module. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks) -{ - rpc_loc_event_mask_type event; - loc_eng_xtra_data_s_type *xtra_module_data_ptr; - - xtra_module_data_ptr = &(loc_eng_data.xtra_module_data); - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - - return 0; -} - -/*=========================================================================== -FUNCTION qct_loc_eng_inject_xtra_data - -DESCRIPTION - Injects XTRA file into the engine. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - >0: failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int qct_loc_eng_inject_xtra_data(char* data, int length) -{ - int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; - boolean ret_val = 0; - int total_parts; - uint8 part; - uint16 part_len; - uint16 len_injected; - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - - LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); - - ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_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 / XTRA_BLOCK_SIZE); - if ((total_parts % XTRA_BLOCK_SIZE) != 0) - { - total_parts += 1; - } - predicted_orbits_data_ptr->total_parts = total_parts; - - len_injected = 0; // O bytes injected - // 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; - - LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); - LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); - - if (part < total_parts) - { - // No callback in this case - rpc_ret_val = loc_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, - &ioctl_data); - - if (rpc_ret_val != RPC_LOC_API_SUCCESS) - { - LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); - ret_val = EINVAL; // return error - break; - } - } - else // part == total_parts - { - // Last part injection, will need to wait for callback - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, - &ioctl_data, - LOC_XTRA_INJECT_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - break; // done with injection - } - - len_injected += predicted_orbits_data_ptr->part_len; - LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); - } - - return ret_val; -} diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h deleted file mode 100644 index 82778ae5..00000000 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -extern const GpsXtraInterface sLocEngXTRAInterface; - -// Module data -typedef struct -{ - // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; - gps_xtra_download_request download_request_cb; - -} loc_eng_xtra_data_s_type; - -#endif // LOC_ENG_XTRA_H diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk deleted file mode 100755 index f37ca311..00000000 --- a/loc_api/libloc_api_50001/Android.mk +++ /dev/null @@ -1,125 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion -BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 -ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) -FEATURE_GNSS_BIT_API := true -endif # is-board-platform-in-list - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_adapter - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libgps.utils \ - libdl - -LOCAL_SRC_FILES += \ - loc_eng_log.cpp \ - LocApiAdapter.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_COPY_HEADERS_TO:= libloc_eng/ -LOCAL_COPY_HEADERS:= \ - LocApiAdapter.h \ - loc.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_msg_id.h \ - loc_eng_log.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_eng - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libloc_adapter \ - libgps.utils \ - libdl - -LOCAL_SRC_FILES += \ - loc_eng.cpp \ - loc_eng_agps.cpp \ - loc_eng_xtra.cpp \ - loc_eng_ni.cpp \ - loc_eng_log.cpp - -ifeq ($(FEATURE_GNSS_BIT_API), true) -LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API -endif # FEATURE_GNSS_BIT_API - -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 \ - hardware/qcom/gps/loc_api/ulp/inc - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) - -LOCAL_MODULE_TAGS := optional - -## Libs - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libloc_eng \ - libgps.utils - -LOCAL_SRC_FILES += \ - loc.cpp \ - gps.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -## Includes -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp deleted file mode 100644 index a6a1ed94..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" - -#include -#include -#include "loc_eng_msg.h" -#include "loc_log.h" -#include "loc_eng_ni.h" - -static void* noProc(void* data) -{ - return NULL; -} - -LocEng::LocEng(void* caller, - LOC_API_ADAPTER_EVENT_MASK_T emask, - gps_acquire_wakelock acqwl, - gps_release_wakelock relwl, - loc_msg_sender msgSender, - loc_ext_parser posParser, - loc_ext_parser svParser) : - owner(caller), - eventMask(emask), acquireWakelock(acqwl), - releaseWakeLock(relwl), sendMsge(msgSender), - extPosInfo(NULL == posParser ? noProc : posParser), - extSvInfo(NULL == svParser ? noProc : svParser) -{ - LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); -} - -LocApiAdapter::LocApiAdapter(LocEng &locEng) : - locEngHandle(locEng) -{ - LOC_LOGD("LocApiAdapter created"); -} - -LocApiAdapter::~LocApiAdapter() -{ - LOC_LOGV("LocApiAdapter deleted"); -} - -LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) -{ - void* handle; - LocApiAdapter* adapter = NULL; - - handle = dlopen ("libloc_api_v02.so", RTLD_NOW); - - if (!handle) { - LOC_LOGI("%s: dlopen(libloc_api_v02.so) failed, trying to load libloc_api-rpc-qc.so", __FUNCTION__); - handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); - } - else - LOC_LOGE("%s: dlopen(libloc_api_v02.so) succeeded.", __FUNCTION__); - - if (!handle) { - LOC_LOGI("%s: dlopen(libloc_api-rpc-qc.so) failed, constructing LocApiAdapter", __FUNCTION__); - adapter = new LocApiAdapter(locEng); - } else { - getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); - if (!getHandle) { - LOC_LOGE("%s: dlsym(getLocApiAdapter) failed", __FUNCTION__); - return NULL; - } - adapter = (*getHandle)(locEng); - } - - return adapter; -} - -int LocApiAdapter::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 LocApiAdapter::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; -} - -void LocApiAdapter::reportPosition(GpsLocation &location, - void* locationExt, - enum loc_sess_status status) -{ - loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, - location, - locationExt, - status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) -{ - loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportStatus(GpsStatusValue status) -{ - loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportNmea(const char* nmea, int length) -{ - loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) -{ - loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::releaseATL(int connHandle) -{ - loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestXtraData() -{ - LOC_LOGD("XTRA download request"); - - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestTime() -{ - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestLocation() -{ - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) -{ - notif.size = sizeof(notif); - notif.timeout = LOC_NI_NO_RESPONSE_TIME; - - loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineDownEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineUpEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h deleted file mode 100644 index 5e8a1da8..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ /dev/null @@ -1,208 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H -#define LOC_API_ADAPTER_H - -#include -#include -#include -#include - -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ - -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_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, - 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_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< - -#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)); - 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/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp deleted file mode 100644 index 16bed3b1..00000000 --- a/loc_api/libloc_api_50001/loc.cpp +++ /dev/null @@ -1,870 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -static gps_location_callback gps_loc_cb = NULL; -static gps_sv_status_callback gps_sv_cb = NULL; - -static void loc_cb(GpsLocation* location, void* locExt); -static void sv_cb(GpsSvStatus* sv_status, void* svExt); - -// 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); -#ifdef QCOM_FEATURE_ULP -static int loc_update_criteria(UlpLocationCriteria criteria); -#endif - -// 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 -#ifdef QCOM_FEATURE_ULP - ,loc_update_criteria -#endif -}; - -// Function declarations for sLocEngAGpsInterface -static void loc_agps_init(AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 -static int loc_agps_open(AGpsType agpsType, - const char* apn, AGpsBearerType bearerType); -static int loc_agps_closed(AGpsType agpsType); -static int loc_agps_open_failed(AGpsType agpsType); -#else -static int loc_agps_open(const char* apn); -static int loc_agps_closed(); -static int loc_agps_open_failed(); -#endif -static int loc_agps_set_server(AGpsType type, const char *hostname, int port); - -static const AGpsInterface sLocEngAGpsInterface = -{ - sizeof(AGpsInterface), - loc_agps_init, - loc_agps_open, - loc_agps_closed, - loc_agps_open_failed, - loc_agps_set_server -}; - -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); - -const GpsNiInterface sLocEngNiInterface = -{ - sizeof(GpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - -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 -}; - -#ifdef QCOM_FEATURE_ULP -static bool loc_inject_raw_command(char* command, int length); - -static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = -{ - sizeof(InjectRawCmdInterface), - loc_inject_raw_command -}; -#endif - -static loc_eng_data_s_type loc_afw_data; - -/*=========================================================================== -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 - -===========================================================================*/ -const GpsInterface* gps_get_hardware_interface () -{ - ENTRY_LOG_CALLFLOW(); - const GpsInterface* ret_val; - - char propBuf[PROPERTY_VALUE_MAX]; - - // check to see if GPS should be disabled - 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; - } - - EXIT_LOG(%p, ret_val); - return ret_val; -} - -// for gps.c -extern "C" const GpsInterface* get_gps_interface() -{ - 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) -{ - ENTRY_LOG(); - LOC_API_ADAPTER_EVENT_MASK_T event = - 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; - LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ - callbacks->status_cb, /* status_cb */ - 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 */}; - gps_loc_cb = callbacks->location_cb; - gps_sv_cb = callbacks->sv_status_cb; - - int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -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_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 = 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(); - 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; - } - int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, - recurrence, min_interval, - preferred_accuracy, preferred_time); - - 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 = 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 = 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); -} - -#ifdef QCOM_FEATURE_ULP -/*=========================================================================== -FUNCTION loc_update_criteria - -DESCRIPTION - This is used to inform the ULP module of new unique criteria that are passed - in by the applications -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_update_criteria(UlpLocationCriteria criteria) -{ - ENTRY_LOG(); - int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -static const void* loc_get_extension(const char* name) -{ - ENTRY_LOG(); - const void* ret_val = NULL; - - 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) - { - ret_val = &sLocEngAGpsRilInterface; - } -#ifdef QCOM_FEATURE_ULP - else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) - { - ret_val = &sLocEngInjectRawCmdInterface; - } -#endif - 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, 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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -static int loc_agps_open(AGpsType agpsType, - const char* apn, AGpsBearerType bearerType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -static int loc_agps_open(const char* apn) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open(loc_afw_data, apn); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -static int loc_agps_closed(AGpsType agpsType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -static int loc_agps_closed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_closed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -int loc_agps_open_failed(AGpsType agpsType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -int loc_agps_open_failed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open_failed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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; - } - int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION 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(); - int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks); - - 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -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(); - loc_eng_ni_init(loc_afw_data, callbacks); - 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); -} - -#ifdef QCOM_FEATURE_ULP -/*=========================================================================== -FUNCTION loc_inject_raw_command - -DESCRIPTION - This is used to send special test modem commands from the applications - down into the HAL -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static bool loc_inject_raw_command(char* command, int length) -{ - ENTRY_LOG(); - int ret_val = loc_eng_inject_raw_command(loc_afw_data, command, length); - EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); - return ret_val; -} -#endif - - -static void loc_cb(GpsLocation* location, void* locExt) -{ - ENTRY_LOG(); - if (NULL != gps_loc_cb && NULL != location) { -#ifdef QCOM_FEATURE_ULP - CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); -#else - CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); -#endif - gps_loc_cb(location); - } - EXIT_LOG(%s, VOID_RET); -} - -static void 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); -} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h deleted file mode 100644 index bf942373..00000000 --- a/loc_api/libloc_api_50001/loc.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -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_STANDALONE, - 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 -} LocPositionMode; - -typedef void (*loc_location_cb_ext) (GpsLocation* 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; -} LocCallbacks; - -enum loc_sess_status { - LOC_SESS_SUCCESS, - LOC_SESS_INTERMEDIATE, - LOC_SESS_FAILURE -}; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif //__LOC_H__ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp deleted file mode 100644 index 3fe9a77e..00000000 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ /dev/null @@ -1,1831 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 /* struct sockaddr_in */ -#include -#include -#include -#include -#include - -#include "LocApiAdapter.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "ulp.h" - -#include "log_util.h" -#include "loc_eng_log.h" - -#define SUCCESS TRUE -#define FAILURE FALSE - - -static void loc_eng_deferred_action_thread(void* context); -static void* loc_eng_create_msg_q(); -static void loc_eng_free_msg(void* msg); - -struct LocEngContext { - // Data variables used by deferred action thread - const void* deferred_q; - const pthread_t deferred_action_thread; - static LocEngContext* get(gps_create_thread threadCreator); - void drop(); - static pthread_mutex_t lock; - static pthread_cond_t cond; -private: - int counter; - static LocEngContext *me; - LocEngContext(gps_create_thread threadCreator); -}; - -pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; -LocEngContext* LocEngContext::me = NULL; - -LocEngContext::LocEngContext(gps_create_thread threadCreator) : - deferred_q((const void*)loc_eng_create_msg_q()), - deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), - counter(0) -{ - LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", - getpid(), gettid(), - deferred_action_thread); -} - -LocEngContext* LocEngContext::get(gps_create_thread threadCreator) -{ - pthread_mutex_lock(&lock); - // gonna need mutex protection here... - if (NULL == me) { - // gps.conf is not part of the context class. But we only want to parse the conf - // file once. This is the only good place to ensure that. - // In fact one day the conf file should go into context as well. - loc_read_gps_conf(); - - me = new LocEngContext(threadCreator); - } - me->counter++; - - pthread_mutex_unlock(&lock); - return me; -} - -void LocEngContext::drop() -{ - if (deferred_action_thread != pthread_self()) { - pthread_mutex_lock(&lock); - counter--; - if (counter == 0) { - loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); - msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); - - // I am not sure if this is going to be hazardous. The calling thread - // might be blocked for a while, if the q is loaded. I am wondering - // if we should just dump all the msgs in the q upon QUIT. - pthread_cond_wait(&cond, &lock); - - msg_q_destroy((void**)&deferred_q); - delete me; - me = NULL; - } - pthread_mutex_unlock(&lock); - } else { - LOC_LOGE("The HAL thread cannot free itself"); - } -} - -// 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 char extra_data[100]; - -#ifdef QCOM_FEATURE_ULP -// ULP integration -static const ulpInterface* locEngUlpInf = NULL; -static int loc_eng_ulp_init(void* handle) ; -#endif - -/********************************************************************* - * 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) - -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) -{ - LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; - msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); -} - -static void* loc_eng_create_msg_q() -{ - void* q = NULL; - if (eMSG_Q_SUCCESS != msg_q_init(&q)) { - LOC_LOGE("loc_eng_create_msg_q Q init failed."); - q = NULL; - } - return q; -} - -static void loc_eng_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - -/*=========================================================================== -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) -{ - ENTRY_LOG_CALLFLOW(); - - if (NULL == callbacks || 0 == event) { - LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); - EXIT_LOG(%d, 0); - return 0; - } - - STATE_CHECK((NULL == loc_eng_data.context), - "instance already initialized", return 0); - - memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - - // Create context (msg q + thread) (if not yet created) - // This will also parse gps.conf, if not done. - loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } - - // 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; - loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; - - 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; - -#ifdef QCOM_FEATURE_ULP - loc_eng_ulp_init(&loc_eng_data); -#endif - - LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, - callbacks->location_ext_parser, callbacks->sv_ext_parser); - loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); - - int ret_val =-1; - if (NULL == loc_eng_data.client_handle) { - // drop the context and declare failure - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - } else { - LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); - - // call reinit to send initialization messages - int tries = 30; - while (tries > 0 && - LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { - tries--; - LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); - sleep(1); - } - } - - 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_eng_data.client_handle->reinit(); - - if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { - LOC_LOGD("loc_eng_reinit reinit() successful"); - - loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, - gps_conf.SUPL_VER)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - supl_msg, loc_eng_free_msg); - - loc_eng_msg_sensor_control_config *sensor_control_config_msg( - new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_control_config_msg, loc_eng_free_msg); - - /* Make sure this is specified by the user in the gps.conf file */ - if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) - { - loc_eng_msg_sensor_properties *sensor_properties_msg( - new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_properties_msg, loc_eng_free_msg); - } - - loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( - new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, - gps_conf.SENSOR_CONTROL_MODE, - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_perf_control_conf_msg, loc_eng_free_msg); - } - - 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.context, 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.navigating) - { - 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. - - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - - // De-initialize ulp - if (locEngUlpInf != NULL) - { - locEngUlpInf->destroy (); - locEngUlpInf = NULL; - } - - if (loc_eng_data.client_handle != NULL) - { - LOC_LOGD("loc_eng_init: client opened. close it now."); - delete loc_eng_data.client_handle; - loc_eng_data.client_handle = NULL; - } - -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) - { - loc_eng_dmn_conn_loc_api_server_unblock(); - loc_eng_dmn_conn_loc_api_server_join(); - } - } -#endif /* FEATURE_GNSS_BIT_API */ - -#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.context, return -1); - - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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.navigating) { -#ifdef QCOM_FEATURE_ULP - if (NULL == locEngUlpInf || - locEngUlpInf->start_fix () == 1) { - ret_val = loc_eng_data.client_handle->startFix(); - } -#else - ret_val = loc_eng_data.client_handle->startFix(); -#endif - - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || - ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); - loc_eng_data.navigating = TRUE; - } - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_stop - -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.context, return -1); - - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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.navigating) { -#ifdef QCOM_FEATURE_ULP - // Stops the ULP - if (locEngUlpInf != NULL) - { - locEngUlpInf->stop_fix (); - } -#endif - - ret_val = loc_eng_data.client_handle->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); - } - - loc_eng_data.navigating = 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, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); - loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, mode, - recurrence, min_interval, - preferred_accuracy, preferred_time)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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.context, return -1); - loc_eng_msg_set_time *msg( - new loc_eng_msg_set_time(&loc_eng_data, - time, - timeReference, - uncertainty)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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.context, return -1); - loc_eng_msg_inject_location *msg( - new loc_eng_msg_inject_location(&loc_eng_data, - latitude, - longitude, - accuracy)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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.context, return); - - loc_eng_msg_delete_aiding_data *msg( - new loc_eng_msg_delete_aiding_data(&loc_eng_data, - f)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - 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(); - - static GpsStatusValue last_status = GPS_STATUS_NONE; - - GpsStatus gs = { sizeof(gs),status }; - - - if (loc_eng_data.status_cb) - { - CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); - loc_eng_data.status_cb(&gs); - } - - last_status = status; - - EXIT_LOG(%s, VOID_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(%p, 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, AGpsCallbacks* callbacks) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); - STATE_CHECK((NULL == loc_eng_data.agps_status_cb), - "agps instance already initialized", - return); - loc_eng_data.agps_status_cb = callbacks->status_cb; - - loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); -#ifdef QCOM_FEATURE_IPV6 - loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_WWAN_ANY); -#else - loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); -#endif - -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) - { - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, - NULL, NULL, &loc_eng_data); - } - } -#endif /* FEATURE_GNSS_BIT_API */ - - loc_eng_agps_reinit(loc_eng_data); - EXIT_LOG(%p, VOID_RET); -} - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, - const char* apn, AGpsBearerType bearerType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, - apn_len, bearerType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, - const char* apn) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, apn, - apn_len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#else -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#else -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif - -/*=========================================================================== - -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; - - if (LOC_AGPS_SUPL_SERVER == type) { - char url[MAX_URL_LEN]; - unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); - - if (sizeof(url) > len) { - loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, - url, len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - } - } 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); - loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, - ip, - port, - type)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - } - } 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; - - if (NULL != loc_eng_data.context) - { - ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); - } else { - LOC_LOGW("set_server called before init. 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); - } - } - - 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(); - INIT_CHECK(loc_eng_data.context, 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); - loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, - apn_len, available)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - } - 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 - if (status != GPS_STATUS_NONE && - !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && - !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.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); - - if (loc_eng_data.agps_status_cb != NULL) { - loc_eng_data.agnss_nif->dropAllSubscribers(); - loc_eng_data.internet_nif->dropAllSubscribers(); - - loc_eng_agps_reinit(loc_eng_data); - } - - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); - - // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.navigating) { - loc_eng_data.client_handle->setPositionMode( - loc_eng_data.position_mode.pMode, - loc_eng_data.position_mode.pRecurrence, - loc_eng_data.position_mode.minInterval, - loc_eng_data.position_mode.preferredAccuracy, - loc_eng_data.position_mode.preferredTime); - // not mutex protected, assuming fw won't call start twice without a - // stop call in between. - loc_eng_start_handler(loc_eng_data); - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_deferred_action_thread - -DESCRIPTION - Main routine for the thread to execute loc_eng commands. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_deferred_action_thread(void* arg) -{ - ENTRY_LOG(); - loc_eng_msg *msg; - static int cnt = 0; - LocEngContext* context = (LocEngContext*)arg; - - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); - - while (1) - { - LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); - - // we are only sending / receiving msg pointers - msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; - } - - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; - - LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", - __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); - - // need to ensure the instance data is valid - STATE_CHECK(NULL != loc_eng_data_p->context, - "instance cleanup happened", - delete msg; return); - - switch(msg->msgid) { - case LOC_ENG_MSG_QUIT: - { - LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; - pthread_mutex_lock(&(context->lock)); - pthread_cond_signal(&(context->cond)); - pthread_mutex_unlock(&(context->lock)); - EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); - } - return; - - case LOC_ENG_MSG_REQUEST_NI: - { - loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; - loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_INFORM_NI_RESPONSE: - { - loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; - loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, - nrMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_START_FIX: - loc_eng_start_handler(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_STOP_FIX: - if (loc_eng_data_p->agps_request_pending) - { - loc_eng_data_p->stop_request_pending = true; - LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); - } else { - loc_eng_stop_handler(*loc_eng_data_p); - } - break; - - case LOC_ENG_MSG_SET_POSITION_MODE: - { - loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; - loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, - pmMsg->minInterval,pmMsg->preferredAccuracy, - pmMsg->preferredTime); - memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); - } - break; - - case LOC_ENG_MSG_SET_TIME: - { - loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; - loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, - tMsg->uncertainty); - } - break; - - case LOC_ENG_MSG_INJECT_LOCATION: - { - loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; - loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, - ilMsg->accuracy); - } - break; - - case LOC_ENG_MSG_SET_SERVER_IPV4: - { - loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; - loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, - ssiMsg->port, - ssiMsg->serverType); - } - break; - - case LOC_ENG_MSG_SET_SERVER_URL: - { - loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; - loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); - } - break; - - case LOC_ENG_MSG_SUPL_VERSION: - { - loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; - loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: - { - loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; - loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: - { - loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; - loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: - { - loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; - loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); - } - break; - - case LOC_ENG_MSG_REPORT_POSITION: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; - if (loc_eng_data_p->location_cb != NULL) { - if (LOC_SESS_FAILURE == rpMsg->status) { - // in case we want to handle the failure case - loc_eng_data_p->location_cb(NULL, NULL); - } - // what's in the else if is... (line by line) - // 1. this is a good fix; or - // 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 == rpMsg->status || - (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && - !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && - (gps_conf.ACCURACY_THRES != 0) && - (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { - loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), - (void*)rpMsg->locationExt); - } - } - } - - break; - - case LOC_ENG_MSG_REPORT_SV: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; - if (loc_eng_data_p->sv_status_cb != NULL) { - loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), - (void*)rsMsg->svExt); - } - } - break; - - case LOC_ENG_MSG_REPORT_STATUS: - loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); - break; - - case LOC_ENG_MSG_REPORT_NMEA: - if (NULL != loc_eng_data_p->nmea_cb) { - loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); - loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); - } - break; - - case LOC_ENG_MSG_REQUEST_BIT: - { - loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; - AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_BIT: - { - loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; - AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); - - stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_REQUEST_ATL: - { - loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - ATLSubscriber subscriber(arqMsg->handle, - stateMachine, - loc_eng_data_p->client_handle); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_ATL: - { - loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; - ATLSubscriber s1(arlMsg->handle, - loc_eng_data_p->agnss_nif, - loc_eng_data_p->client_handle); - // attempt to unsubscribe from agnss_nif first - if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { - ATLSubscriber s2(arlMsg->handle, - loc_eng_data_p->internet_nif, - loc_eng_data_p->client_handle); - // if unsuccessful, try internet_nif - loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); - } - } - break; - - case LOC_ENG_MSG_REQUEST_XTRA_DATA: - if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) - { - loc_eng_data_p->xtra_module_data.download_request_cb(); - } - break; - - case LOC_ENG_MSG_REQUEST_TIME: - break; - - case LOC_ENG_MSG_REQUEST_POSITION: - break; - - case LOC_ENG_MSG_DELETE_AIDING_DATA: - loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; - break; - - case LOC_ENG_MSG_ENABLE_DATA: - { - loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; - loc_eng_data_p->client_handle->enableData(unaMsg->enable); - loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); - } - break; - - case LOC_ENG_MSG_INJECT_XTRA_DATA: - { - loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; - loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_SUCCESS: - { - loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - - stateMachine->setBearer(aosMsg->bearerType); -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif - stateMachine->setAPN(aosMsg->apn, aosMsg->length); - stateMachine->onRsrcEvent(RSRC_GRANTED); - } - break; - - case LOC_ENG_MSG_ATL_CLOSED: - { - loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif - - stateMachine->onRsrcEvent(RSRC_RELEASED); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_FAILED: - { - loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; -#else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif - - stateMachine->onRsrcEvent(RSRC_DENIED); - } - break; - - case LOC_ENG_MSG_ENGINE_DOWN: - loc_eng_handle_engine_down(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_ENGINE_UP: - loc_eng_handle_engine_up(*loc_eng_data_p); - break; - - default: - LOC_LOGE("unsupported msgid = %d\n", msg->msgid); - break; - } - - if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | - (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | - (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) - { - loc_eng_data_p->agps_request_pending = false; - if (loc_eng_data_p->stop_request_pending) { - loc_eng_stop_handler(*loc_eng_data_p); - loc_eng_data_p->stop_request_pending = false; - } - } - loc_eng_data_p->stop_request_pending = false; - - if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && - loc_eng_data_p->aiding_data_for_deletion != 0) - { - loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); - loc_eng_data_p->aiding_data_for_deletion = 0; - } - - delete msg; - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_report_position_ulp - -DESCRIPTION - Report a ULP position - p_ulp_pos_absolute, ULP position in absolute coordinates - -DEPENDENCIES - None - -RETURN VALUE - 0: SUCCESS - others: error - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_report_position_ulp (void* handle, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data) -{ - ENTRY_LOG(); - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; - - INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, - return -1); - - if (ext_data_length > sizeof (extra_data)) - { - ext_data_length = sizeof (extra_data); - } - - memcpy(extra_data, - ext_data, - ext_data_length); - - loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, - NULL, LOC_SESS_SUCCESS); - - EXIT_LOG(%d, 0); - return 0; -} - -#ifdef QCOM_FEATURE_ULP -/*=========================================================================== -FUNCTION loc_eng_ulp_init - -DESCRIPTION - This function dynamically loads the libulp.so and calls - its init function to start up the ulp module - -DEPENDENCIES - None - -RETURN VALUE - 0: no error - -1: errors - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_ulp_init(void* owner) -{ - ENTRY_LOG(); - int ret_val; - void *handle; - const char *error; - get_ulp_interface* get_ulp_inf; - - if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { - LOC_LOGD ("%s, ULP is not supported\n", __func__); - ret_val = -1; - goto exit; - } - - handle = dlopen ("libulp.so", RTLD_NOW); - if (!handle) - { - LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); - ret_val = -1; - goto exit; - } - dlerror(); /* Clear any existing error */ - - get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); - ret_val = -1; - goto exit; - } - - locEngUlpInf = get_ulp_inf(); - - // Initialize the ULP interface - locEngUlpInf->init (owner, loc_eng_report_position_ulp); - - ret_val = 0; -exit: - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_inject_raw_command - -DESCRIPTION - This is used to send special test modem commands from the applications - down into the HAL -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, - char* command, int length) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); - boolean ret_val; - LOC_LOGD("loc_eng_send_extra_command: %s\n", command); - ret_val = TRUE; - - EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); - return ret_val; -} -/*=========================================================================== -FUNCTION loc_eng_update_criteria - -DESCRIPTION - This is used to inform the ULP module of new unique criteria that are passed - in by the applications -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, - UlpLocationCriteria criteria) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); - int ret_val; - ret_val = 0; - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h deleted file mode 100644 index 73578ec8..00000000 --- a/loc_api/libloc_api_50001/loc_eng.h +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#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 MAX_APN_LEN 100 -#define MAX_URL_LEN 256 -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) - -enum loc_mute_session_e_type { - LOC_MUTE_SESS_NONE = 0, - LOC_MUTE_SESS_WAIT, - LOC_MUTE_SESS_IN_SESSION -}; - -// Module data -typedef struct -{ - LocApiAdapter *client_handle; - loc_location_cb_ext location_cb; - gps_status_callback status_cb; - loc_sv_status_cb_ext sv_status_cb; - agps_status_callback agps_status_cb; - gps_nmea_callback nmea_cb; - gps_ni_notify_callback ni_notify_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - boolean intermediateFix; - AGpsStatusValue agps_status; - // used to defer stopping the GPS engine until AGPS data calls are done - boolean agps_request_pending; - boolean stop_request_pending; - loc_eng_xtra_data_s_type xtra_module_data; - loc_eng_ni_data_s_type loc_eng_ni_data; - - boolean navigating; - - // AGPS state machines - AgpsStateMachine* agnss_nif; - AgpsStateMachine* internet_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; - - void* context; - - loc_eng_msg_position_mode position_mode; - - // For muting session broadcast - loc_mute_session_e_type mute_session_state; - - // 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_eng_data_s_type; - - -int loc_eng_init(loc_eng_data_s_type &loc_eng_data, - LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event); -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, - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); -const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, - const char* name); -#ifdef QCOM_FEATURE_ULP -int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, - UlpLocationCriteria criteria); -#endif - -void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, - AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, - const char* apn, AGpsBearerType bearerType); -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); -#endif - -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); - - -void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, - int avaiable, const char* apn); - - -bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, - char* command, int length); - - -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); - -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, - GpsXtraCallbacks* callbacks); - -int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, - char* data, int length); - -extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, - GpsNiCallbacks *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); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif // LOC_ENG_H diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp deleted file mode 100644 index 07475680..00000000 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ /dev/null @@ -1,702 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -//====================================================================== -// 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; - - -//====================================================================== -// Subscriber: BITSubscriber / ATLSubscriber -//====================================================================== -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(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); -} - -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( - GPSONE_LOC_API_IF_RELEASE_SUCCESS); - break; - case RSRC_DENIED: - loc_eng_dmn_conn_loc_api_server_data_conn( - GPSONE_LOC_API_IF_FAILURE); - break; - case RSRC_GRANTED: - loc_eng_dmn_conn_loc_api_server_data_conn( - 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: - ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); - break; - case RSRC_DENIED: - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, - (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 - mStateMachine->getBearer(), -#endif - mStateMachine->getType()); - break; - case RSRC_GRANTED: - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, - (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 - mStateMachine->getBearer(), -#endif - mStateMachine->getType()); - break; - default: - notify = false; - } - } - - return notify; -} - - -//====================================================================== -// 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) -{ - 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); - // move the state to PENDING - nextState = mPendingState; - - // request from connecivity service for NIF - mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); - } - 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;; - 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(); - if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasingState; - } - } 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); - } - } - } - 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; - 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 = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; - - // 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;; - 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 = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } - } - break; - - 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->hasSubscribers()) { - nextState = mPendingState; - // request from connecivity service for NIF - mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); - } else { - nextState = mReleasedState; - } - } - break; - - case RSRC_GRANTED: - case RSRC_DENIED: - 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; -} - - -//====================================================================== -// AgpsStateMachine -//====================================================================== - -AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), - AGpsType type) : - mServicer(servicer), mType(type), - mStatePtr(new AgpsReleasedState(this)), - mAPN(NULL), - mAPNLen(0) -{ - 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; - 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); - } - } 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); - } -} - -void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const -{ - Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ALL); - linked_list_search(mSubscribers, (void**)&s, hasSubscriber, - (void*)¬ification, false); - - if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { - AGpsStatus nifRequest; - nifRequest.size = sizeof(nifRequest); - nifRequest.type = mType; - nifRequest.status = action; - -#ifdef QCOM_FEATURE_IPV6 - if (s == NULL) { - nifRequest.ipv4_addr = INADDR_NONE; - nifRequest.ipv6_addr[0] = 0; - } else { - s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); - } -#else - if (s == NULL) { - nifRequest.ipaddr = INADDR_NONE; - } else { - nifRequest.ipaddr = s->ID; - } -#endif - - CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); - (*mServicer)(&nifRequest); - } -} - -void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) -{ - 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; -} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h deleted file mode 100644 index 1fd0f450..00000000 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ /dev/null @@ -1,274 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -// forward declaration -class AgpsStateMachine; -class Subscriber; - -// NIF resource events -typedef enum { - RSRC_SUBSCRIBE, - RSRC_UNSUBSCRIBE, - RSRC_GRANTED, - RSRC_RELEASED, - RSRC_DENIED, - RSRC_STATUS_MAX -} AgpsRsrcStatus; - -// 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; - - // 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 AgpsStateMachine { - // 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; - - // handle to whoever provides the service - void (* const mServicer)(AGpsStatus* status); - // NIF type: AGNSS or INTERNET. - const AGpsType mType; - // pointer to the current state. - AgpsState* mStatePtr; - // a linked list of subscribers. - void* mSubscribers; - // 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; -#ifdef QCOM_FEATURE_IPV6 - // bear - AGpsBearerType mBearer; -#endif - // ipv4 address for routing - -public: - AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); - virtual ~AgpsStateMachine(); - - // self explanatory methods below - void setAPN(const char* apn, unsigned int len); - inline const char* getAPN() const { return (const char*)mAPN; } -#ifdef QCOM_FEATURE_IPV6 - inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } - inline AGpsBearerType getBearer() const { return mBearer; } -#endif - inline AGpsType getType() const { return (AGpsType)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; - - void onRsrcEvent(AgpsRsrcStatus event); - - // put the data together and send the FW - void sendRsrcRequest(AGpsStatusValue action) const; - - 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; -}; - -// 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 int ID; - const AgpsStateMachine* mStateMachine; - inline Subscriber(const int id, - const AgpsStateMachine* stateMachine) : - ID(id), mStateMachine(stateMachine) {} - inline virtual ~Subscriber() {} - - virtual void setIPAddresses(int &v4, char* v6) = 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 { - inline BITSubscriber(const AgpsStateMachine* stateMachine, - unsigned int ipv4, char* ipv6) : - Subscriber(ipv4, stateMachine) - { - if (NULL == ipv6) { - ipv6Addr[0] = NULL; - } else { - memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); - } - } - - virtual bool notifyRsrcStatus(Notification ¬ification); - - inline virtual void setIPAddresses(int &v4, char* v6) - { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } - - virtual Subscriber* clone() - { - return new BITSubscriber(mStateMachine, ID, ipv6Addr); - } - - virtual bool equals(const Subscriber *s) const; - -private: - char ipv6Addr[16]; -}; - -// ATLSubscriber, created with requests from ATL -struct ATLSubscriber : public Subscriber { - const LocApiAdapter* mLocAdapter; - inline ATLSubscriber(const int id, - const AgpsStateMachine* stateMachine, - const LocApiAdapter* adapter) : - Subscriber(id, stateMachine), mLocAdapter(adapter) {} - virtual bool notifyRsrcStatus(Notification ¬ification); - - inline virtual void setIPAddresses(int &v4, char* v6) - { v4 = INADDR_NONE; v6[0] = 0; } - - inline virtual Subscriber* clone() - { - return new ATLSubscriber(ID, mStateMachine, mLocAdapter); - } -}; - -#endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp deleted file mode 100644 index f2f9a501..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" - -#include "loc_eng_dmn_conn_glue_msg.h" -#include "loc_eng_dmn_conn_handler.h" -#include "loc_eng_dmn_conn.h" - -static int loc_api_server_msgqid; -static int loc_api_resp_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 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); - loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_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) { - LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); - usleep(1000); - return 0; - } - - 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); - 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 status) { - struct ctrl_msgbuf cmsgbuf; - cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; - cmsgbuf.cmsg.cmsg_response.result = status; - LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); - 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; - } - return 0; - -} - diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h deleted file mode 100644 index 414fd553..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/gpsone_d/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_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" - -#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); - -#endif /* LOC_ENG_DATA_SERVER_H */ - diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c deleted file mode 100644 index 9cd19228..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ /dev/null @@ -1,223 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" - -#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h deleted file mode 100644 index 8bc6f2a3..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c deleted file mode 100644 index 74769088..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" - -/*=========================================================================== -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, 0666); - - if ((result == -1) && (errno != EEXIST)) { - LOC_LOGE("failed: %s\n", strerror(errno)); - return result; - } - - 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) 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h deleted file mode 100644 index 3136e411..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp deleted file mode 100644 index fd15f001..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" -#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; - } - - loc_eng_msg_request_bit *msg( - new loc_eng_msg_request_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); - -#else - loc_eng_dmn_conn_loc_api_server_data_conn(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 - loc_eng_msg_release_bit *msg( - new loc_eng_msg_release_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); -#else - loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); -#endif - return 0; -} - diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h deleted file mode 100644 index 833e971b..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -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; -}; - -struct ctrl_msg_if_request { - unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ - unsigned long ipv4_addr; - unsigned char ipv6_addr[16]; -}; - -/* 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c deleted file mode 100644 index 478b686f..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ /dev/null @@ -1,398 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" -#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h deleted file mode 100644 index 07869f90..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp deleted file mode 100644 index d813cd65..00000000 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "hardware/gps.h" -#include "loc.h" -#include "loc_log.h" -#include "loc_eng_log.h" -#include "loc_eng_msg_id.h" - -/* GPS status names */ -static 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 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 loc_name_val_s_type loc_eng_msgs[] = -{ - NAME_VAL( LOC_ENG_MSG_QUIT ), - NAME_VAL( LOC_ENG_MSG_ENGINE_DOWN ), - NAME_VAL( LOC_ENG_MSG_ENGINE_UP ), - NAME_VAL( LOC_ENG_MSG_START_FIX ), - NAME_VAL( LOC_ENG_MSG_STOP_FIX ), - NAME_VAL( LOC_ENG_MSG_SET_POSITION_MODE ), - NAME_VAL( LOC_ENG_MSG_SET_TIME ), - NAME_VAL( LOC_ENG_MSG_INJECT_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_INJECT_LOCATION ), - NAME_VAL( LOC_ENG_MSG_DELETE_AIDING_DATA ), - NAME_VAL( LOC_ENG_MSG_SET_APN ), - NAME_VAL( LOC_ENG_MSG_SET_SERVER_URL ), - NAME_VAL( LOC_ENG_MSG_SET_SERVER_IPV4 ), - NAME_VAL( LOC_ENG_MSG_ENABLE_DATA ), - NAME_VAL( LOC_ENG_MSG_SUPL_VERSION ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PROPERTIES ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG ), - NAME_VAL( LOC_ENG_MSG_MUTE_SESSION ), - NAME_VAL( LOC_ENG_MSG_ATL_OPEN_SUCCESS ), - NAME_VAL( LOC_ENG_MSG_ATL_CLOSED ), - NAME_VAL( LOC_ENG_MSG_ATL_OPEN_FAILED ), - NAME_VAL( LOC_ENG_MSG_REPORT_POSITION ), - NAME_VAL( LOC_ENG_MSG_REPORT_SV ), - NAME_VAL( LOC_ENG_MSG_REPORT_STATUS ), - NAME_VAL( LOC_ENG_MSG_REPORT_NMEA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_ATL ), - NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), - NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), - NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), - NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), - NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), - NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) -}; -static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); - -/* Find Android GPS status name */ -const char* loc_get_msg_name(int id) -{ - return loc_get_name_from_val(loc_eng_msgs, loc_eng_msgs_num, (long) id); -} - - - -static 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 ) -}; -static 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 loc_name_val_s_type loc_eng_position_recurrences[] = -{ - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) -}; -static 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 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 ) -#ifdef QCOM_FEATURE_DELEXT - ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) -#endif -}; -static 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 loc_name_val_s_type loc_eng_agps_types[] = -{ -#ifdef QCOM_FEATURE_IPV6 - NAME_VAL( AGPS_TYPE_INVALID ), - NAME_VAL( AGPS_TYPE_ANY ), -#endif - NAME_VAL( AGPS_TYPE_SUPL ), - NAME_VAL( AGPS_TYPE_C2K ) -#ifdef QCOM_FEATURE_IPV6 - ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) -#endif -}; -static 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 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 ) -}; -static 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 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 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 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 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); -} - -#ifdef QCOM_FEATURE_IPV6 -static 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_IPV4 ), - NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) -}; -static 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); -} -#endif - -static 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h deleted file mode 100644 index eff1593b..00000000 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 -#include -#include "loc_eng_msg_id.h" - -const char* loc_get_gps_status_name(GpsStatusValue gps_status); -const char* loc_get_msg_name(int id); -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); -#ifdef QCOM_FEATURE_IPV6 -const char* loc_get_agps_bear_name(AGpsBearerType bear); -#endif -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_ENG_LOG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp deleted file mode 100644 index 97c0457c..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_eng_msg.h" -#include "loc_eng_dmn_conn_glue_msg.h" - -#ifdef _ANDROID_ - -#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" - -#else - -#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" - -#endif - -int loc_eng_msgget(int * p_req_msgq) -{ - * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); - return 0; -} - -int loc_eng_msgremove(int req_msgq) -{ - loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); - return 0; -} - -int loc_eng_msgsnd(int msgqid, void * msgp) -{ - int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) -{ - int result; - - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - 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; -} - -int loc_eng_msgrcv(int msgqid, void ** msgp) -{ - int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) -{ - int result; - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); - if (result != sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); - return -1; - } - - if (msgsz < pmsg->msgsz) { - LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); - return -1; - } - - if (pmsg->msgsz > sizeof(struct msgbuf)) { - /* there is msg body */ - msgp += sizeof(struct msgbuf); - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); - - if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { - LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, - (pmsg->msgid), (int) pmsg->msgsz); - return -1; - } - } - - return pmsg->msgsz; -} - -int loc_eng_msgflush(int msgqid) -{ - return loc_eng_dmn_conn_glue_msgflush(msgqid); -} - -int loc_eng_msgunblock(int msgqid) -{ - return loc_eng_dmn_conn_glue_pipeunblock(msgqid); -} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h deleted file mode 100644 index 41548f09..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ /dev/null @@ -1,584 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" -#include "loc.h" -#include "loc_eng_log.h" -#include "loc_eng_msg_id.h" - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct loc_eng_msg { - const void* owner; - const int msgid; - inline loc_eng_msg(void* instance, int id) : - owner(instance), msgid(id) - { - LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); - } - virtual ~loc_eng_msg() - { - LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); - } -}; - -struct loc_eng_msg_suple_version : public loc_eng_msg { - const int supl_version; - inline loc_eng_msg_suple_version(void* instance, int version) : - loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), - supl_version(version) - { - LOC_LOGV("SUPL Version: %d", version); - } -}; - -struct loc_eng_msg_sensor_control_config : public loc_eng_msg { - const int sensorsDisabled; - inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), - sensorsDisabled(disabled) - { - LOC_LOGV("Sensors Disabled: %d", disabled); - } -}; - -struct loc_eng_msg_sensor_properties : public loc_eng_msg { - const float gyroBiasVarianceRandomWalk; - inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), - gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) - { - LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); - } -}; - -struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { - const int controlMode; - const int accelSamplesPerBatch; - const int accelBatchesPerSec; - const int gyroSamplesPerBatch; - const int gyroBatchesPerSec; - inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), - controlMode(controlMode), - accelSamplesPerBatch(accelSamplesPerBatch), - accelBatchesPerSec(accelBatchesPerSec), - gyroSamplesPerBatch(gyroSamplesPerBatch), - gyroBatchesPerSec(gyroBatchesPerSec) - { - LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec - ); - } -}; - - -struct loc_eng_msg_position_mode : public loc_eng_msg { - const LocPositionMode pMode; - const GpsPositionRecurrence pRecurrence; - const uint32_t minInterval; - const uint32_t preferredAccuracy; - const uint32_t preferredTime; - inline loc_eng_msg_position_mode() : - loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(LOC_POSITION_MODE_STANDALONE), - pRecurrence(0), minInterval(0), - preferredAccuracy(0), preferredTime(0) {} - inline loc_eng_msg_position_mode(void* instance, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(mode), pRecurrence(recurrence), minInterval(min_interval), - preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) - { - LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", - loc_get_position_mode_name(pMode), - loc_get_position_recurrence_name(pRecurrence), - minInterval, - preferredAccuracy, - preferredTime); - } -}; - -struct loc_eng_msg_set_time : public loc_eng_msg { - const GpsUtcTime time; - const int64_t timeReference; - const int uncertainty; - inline loc_eng_msg_set_time(void* instance, - GpsUtcTime t, - int64_t tf, - int unc) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), - time(t), timeReference(tf), uncertainty(unc) - { - LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", - time, timeReference, uncertainty); - } -}; - -struct loc_eng_msg_inject_location : public loc_eng_msg { - const double latitude; - const double longitude; - const float accuracy; - inline loc_eng_msg_inject_location(void* instance, double lat, - double longi, float accur) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), - latitude(lat), longitude(longi), accuracy(accur) - { - LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", - latitude, longitude, accuracy); - } -}; - -struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { - const GpsAidingData type; - inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : - loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) - { - LOC_LOGV("aiding data msak %d", type); - } -}; - -struct loc_eng_msg_report_position : public loc_eng_msg { - const GpsLocation location; - const void* locationExt; - const enum loc_sess_status status; - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, - enum loc_sess_status st) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExt(locExt), status(st) - { -#ifdef QCOM_FEATURE_ULP - 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: %s", - location.flags, location.position_source, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData, - loc_get_position_sess_status_name(status)); -#else - LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", - location.flags, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, loc_get_position_sess_status_name(status)); -#endif - } -}; - -struct loc_eng_msg_report_sv : public loc_eng_msg { - const GpsSvStatus svStatus; - const void* svExt; - inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) - { - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", - svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); - for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f\n ", - i, - svStatus.sv_list[i].prn, - svStatus.sv_list[i].snr, - svStatus.sv_list[i].elevation, - svStatus.sv_list[i].azimuth); - } - } -}; - -struct loc_eng_msg_report_status : public loc_eng_msg { - const GpsStatusValue status; - inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) - { - LOC_LOGV("status: %s", loc_get_gps_status_name(status)); - } -}; - -struct loc_eng_msg_report_nmea : public loc_eng_msg { - char* const nmea; - const int length; - inline loc_eng_msg_report_nmea(void* instance, - const char* data, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), - nmea(new char[len]), length(len) - { - memcpy((void*)nmea, (void*)data, len); - LOC_LOGV("length: %d\n nmea: %p - %c%c%c", - length, nmea, nmea[3], nmea[4], nmea[5]); - } - inline ~loc_eng_msg_report_nmea() - { - delete[] nmea; - } -}; - -struct loc_eng_msg_request_bit : public loc_eng_msg { - const unsigned int isSupl; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_request_bit(void* instance, - unsigned int is_supl, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), - isSupl(is_supl), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_request_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_release_bit : public loc_eng_msg { - const unsigned int isSupl; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_release_bit(void* instance, - unsigned int is_supl, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), - isSupl(is_supl), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_release_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_request_atl : public loc_eng_msg { - const int handle; - const AGpsType type; - inline loc_eng_msg_request_atl(void* instance, int hndl, - AGpsType agps_type) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), - handle(hndl), type(agps_type) - { - LOC_LOGV("handle: %d\n agps type: %s", - handle, - loc_get_agps_type_name(type)); - } -}; - -struct loc_eng_msg_release_atl : public loc_eng_msg { - const int handle; - inline loc_eng_msg_release_atl(void* instance, int hndl) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) - { - LOC_LOGV("handle: %d", handle); - } -}; - -struct loc_eng_msg_request_ni : public loc_eng_msg { - const GpsNiNotification notify; - const void *passThroughData; - inline loc_eng_msg_request_ni(void* instance, - GpsNiNotification ¬if, const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), - notify(notif), passThroughData(data) - { - 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", - notify.notification_id, - loc_get_ni_type_name(notify.ni_type), - notify.notify_flags, - notify.timeout, - loc_get_ni_response_name(notify.default_response), - loc_get_ni_encoding_name(notify.requestor_id_encoding), - loc_get_ni_encoding_name(notify.text_encoding), - passThroughData); - } -}; - -struct loc_eng_msg_inform_ni_response : public loc_eng_msg { - const GpsUserResponseType response; - const void *passThroughData; - inline loc_eng_msg_inform_ni_response(void* instance, - GpsUserResponseType resp, - const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), - response(resp), passThroughData(data) - { - LOC_LOGV("response: %s\n passThroughData: %p", - loc_get_ni_response_name(response), - passThroughData); - } - inline ~loc_eng_msg_inform_ni_response() - { - // this is a bit weird since passThroughData is not - // allocated by this class. But there is no better way. - // passThroughData actually won't be NULL here. - // But better safer than sorry. - if (NULL != passThroughData) { - free((void*)passThroughData); - } - } -}; - -struct loc_eng_msg_set_apn : public loc_eng_msg { - char* const apn; - inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s", apn); - } - inline ~loc_eng_msg_set_apn() - { - delete[] apn; - } -}; - - - -struct loc_eng_msg_set_server_ipv4 : public loc_eng_msg { - const unsigned int nl_addr; - const int port; - const LocServerType serverType; - inline loc_eng_msg_set_server_ipv4(void* instance, - unsigned int ip, - int p, - LocServerType type) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), - nl_addr(ip), port(p), serverType(type) - { - LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); - } -}; - - -struct loc_eng_msg_set_server_url : public loc_eng_msg { - const int len; - char* const url; - inline loc_eng_msg_set_server_url(void* instance, - const char* urlString, - int url_len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), - len(url_len), url(new char[len+1]) - { - memcpy((void*)url, (void*)urlString, url_len); - url[len] = 0; - LOC_LOGV("url: %s", url); - } - inline ~loc_eng_msg_set_server_url() - { - delete[] url; - } -}; - -struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { - char* const data; - const int length; - inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), - data(new char[l]), length(l) - { - memcpy((void*)data, (void*)d, l); - LOC_LOGV("length: %d\n data: %p", length, data); - } - inline ~loc_eng_msg_inject_xtra_data() - { - delete[] data; - } -}; - -#ifdef QCOM_FEATURE_IPV6 -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const AGpsStatusValue agpsType; - const int length; - char* const apn; - const AGpsBearerType bearerType; - inline loc_eng_msg_atl_open_success(void* instance, - AGpsStatusValue atype, - const char* name, - int len, - AGpsBearerType btype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - agpsType(atype), length(len), - apn(new char[len+1]), bearerType(btype) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", - loc_get_agps_type_name(agpsType), - apn, - loc_get_agps_bear_name(bearerType)); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } -}; -#else -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const int length; - char* const apn; - inline loc_eng_msg_atl_open_success(void* instance, - const char* name, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - length(len), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n", - apn); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } -}; -#endif - -#ifdef QCOM_FEATURE_IPV6 -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - const AGpsStatusValue agpsType; - inline loc_eng_msg_atl_open_failed(void* instance, - AGpsStatusValue atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), - agpsType(atype) - { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); - } -}; -#else -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - inline loc_eng_msg_atl_open_failed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) - { - LOC_LOGV(""); - } -}; -#endif - -#ifdef QCOM_FEATURE_IPV6 -struct loc_eng_msg_atl_closed : public loc_eng_msg { - const AGpsStatusValue agpsType; - inline loc_eng_msg_atl_closed(void* instance, - AGpsStatusValue atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), - agpsType(atype) - { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); - } -}; -#else -struct loc_eng_msg_atl_closed : public loc_eng_msg { - inline loc_eng_msg_atl_closed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) - { - LOC_LOGV(""); - } -}; -#endif - -struct loc_eng_msg_set_data_enable : public loc_eng_msg { - const int enable; - char* const apn; - const int length; - inline loc_eng_msg_set_data_enable(void* instance, - const char* name, - int len, - int yes) : - loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), - enable(yes), apn(new char[len+1]), length(len) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n enable: %d", apn, enable); - } - inline ~loc_eng_msg_set_data_enable() - { - delete[] apn; - } -}; - -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); -int loc_eng_msgget(int * p_req_msgq); -int loc_eng_msgremove(int req_msgq); -int loc_eng_msgsnd(int msgqid, void * msgp); -int loc_eng_msgrcv(int msgqid, void ** msgp); -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); -int loc_eng_msgflush(int msgqid); -int loc_eng_msgunblock(int msgqid); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_MSG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h deleted file mode 100644 index f05f1f44..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ID_H -#define LOC_ENG_MSG_ID_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct msgbuf { - unsigned int msgsz; - void* msgid; -}; - -enum loc_eng_msg_ids_t { - /* 0x 0 - 0xEF is reserved for daemon internal */ - /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ - LOC_ENG_MSG_QUIT = 0x200, - - LOC_ENG_MSG_ENGINE_DOWN, - LOC_ENG_MSG_ENGINE_UP, - - LOC_ENG_MSG_START_FIX, - LOC_ENG_MSG_STOP_FIX, - LOC_ENG_MSG_SET_POSITION_MODE, - LOC_ENG_MSG_SET_TIME, - LOC_ENG_MSG_INJECT_XTRA_DATA, - LOC_ENG_MSG_INJECT_LOCATION, - LOC_ENG_MSG_DELETE_AIDING_DATA, - LOC_ENG_MSG_SET_APN, - LOC_ENG_MSG_SET_SERVER_URL, - LOC_ENG_MSG_SET_SERVER_IPV4, - LOC_ENG_MSG_ENABLE_DATA, - - LOC_ENG_MSG_SUPL_VERSION, - LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG, - LOC_ENG_MSG_SET_SENSOR_PROPERTIES, - LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG, - LOC_ENG_MSG_MUTE_SESSION, - - LOC_ENG_MSG_ATL_OPEN_SUCCESS, - LOC_ENG_MSG_ATL_CLOSED, - LOC_ENG_MSG_ATL_OPEN_FAILED, - - LOC_ENG_MSG_REPORT_POSITION, - LOC_ENG_MSG_REPORT_SV, - LOC_ENG_MSG_REPORT_STATUS, - LOC_ENG_MSG_REPORT_NMEA, - LOC_ENG_MSG_REQUEST_BIT, - LOC_ENG_MSG_RELEASE_BIT, - LOC_ENG_MSG_REQUEST_ATL, - LOC_ENG_MSG_RELEASE_ATL, - LOC_ENG_MSG_REQUEST_NI, - LOC_ENG_MSG_INFORM_NI_RESPONSE, - LOC_ENG_MSG_REQUEST_XTRA_DATA, - LOC_ENG_MSG_REQUEST_TIME, - LOC_ENG_MSG_REQUEST_POSITION -}; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_MSG_ID_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp deleted file mode 100644 index c2d78af8..00000000 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" - -/*============================================================================= - * - * DATA DECLARATION - * - *============================================================================*/ - -/*============================================================================= - * - * FUNCTION DECLARATIONS - * - *============================================================================*/ -static void* ni_thread_proc(void *args); - -/*=========================================================================== - -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; - - if (NULL == loc_eng_data.ni_notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); - return; - } - - /* If busy, use default or deny */ - if (NULL != loc_eng_ni_data_p->rawRequest) - { - /* XXX Consider sending a NO RESPONSE reply or queue the request */ - LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", - notif->ni_type); - if (NULL != passThrough) { - free((void*)passThrough); - } - } - else { - /* Save request */ - loc_eng_ni_data_p->rawRequest = (void*)passThrough; - - /* Fill in notification */ - ((GpsNiNotification*)notif)->notification_id = loc_eng_ni_data_p->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. - **/ - loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); - - int rc = 0; - rc = pthread_create(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); - if (rc) - { - LOC_LOGE("Loc NI thread is not created.\n"); - } - rc = pthread_detach(loc_eng_ni_data_p->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); - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - -FUNCTION ni_thread_proc - -===========================================================================*/ -static void* ni_thread_proc(void *args) -{ - ENTRY_LOG(); - - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; - 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(&loc_eng_ni_data_p->tLock); - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->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, loc_eng_ni_data_p->respTimeLeft ); - - while (!loc_eng_ni_data_p->respRecvd) - { - rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, - &loc_eng_ni_data_p->tLock, - &expire_time); - if (rc == ETIMEDOUT) - { - loc_eng_ni_data_p->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 ); - loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ - - // adding this check to support modem restart, in which case, we need the thread - // to exit without calling sending data to loc_eng_msg_q. We made sure that - // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() - loc_eng_msg_inform_ni_response *msg = NULL; - - if (NULL != loc_eng_ni_data_p->rawRequest) { - loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; - msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); - loc_eng_ni_data_p->rawRequest = NULL; - } - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); - - loc_eng_ni_data_p->respTimeLeft = 0; - loc_eng_ni_data_p->reqID++; - - if (NULL != msg) { - loc_eng_msg_sender(loc_eng_data_p, 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->rawRequest) { - free(loc_eng_ni_data_p->rawRequest); - loc_eng_ni_data_p->rawRequest = NULL; - - pthread_mutex_lock(&loc_eng_ni_data_p->tLock); - // the goal is to wake up ni_thread_proc - // and let it exit. - loc_eng_ni_data_p->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->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, GpsNiCallbacks *callbacks) -{ - ENTRY_LOG_CALLFLOW(); - - 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->respTimeLeft = 0; - loc_eng_ni_data_p->respRecvd = FALSE; - loc_eng_ni_data_p->rawRequest = NULL; - loc_eng_ni_data_p->reqID = 0; - pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); - pthread_mutex_init(&loc_eng_ni_data_p->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; - - 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->reqID && - NULL != loc_eng_ni_data_p->rawRequest) - { - LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); - pthread_mutex_lock(&loc_eng_ni_data_p->tLock); - loc_eng_ni_data_p->resp = user_response; - loc_eng_ni_data_p->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); - } - else { - LOC_LOGE("loc_eng_ni_respond: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", - loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); - } - - EXIT_LOG(%s, VOID_RET); -} diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h deleted file mode 100644 index 9b1c5f34..00000000 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -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; -} loc_eng_ni_data_s_type; - - -#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp deleted file mode 100644 index ebc7c6fb..00000000 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" - - -/*=========================================================================== -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, - GpsXtraCallbacks* callbacks) -{ - loc_eng_xtra_data_s_type *xtra_module_data_ptr; - - xtra_module_data_ptr = &loc_eng_data.xtra_module_data; - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - - return 0; -} - -/*=========================================================================== -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: success - >0: failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, - char* data, int length) -{ - loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, - data, length)); - loc_eng_msg_sender(&loc_eng_data, msg); - - return 0; -} diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h deleted file mode 100644 index 7e01e146..00000000 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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; - - // 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/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk deleted file mode 100755 index b6c7a66e..00000000 --- a/loc_api/loc_api_v02/Android.mk +++ /dev/null @@ -1,43 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_api_v02 - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libqmi_cci \ - libqmi_csi \ - libqmi_common_so \ - libloc_adapter \ - libgps.utils - -LOCAL_SRC_FILES += \ - LocApiV02Adapter.cpp \ - loc_api_v02_log.c \ - loc_api_v02_client.c \ - loc_api_sync_req.c \ - location_service_v02.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -## Includes -LOCAL_C_INCLUDES := \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp deleted file mode 100644 index cfb2265d..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ /dev/null @@ -1,2059 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "LocApiV02Adapter.h" -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" -#include "LocApiAdapter.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_adapter" -#include "loc_util_log.h" - - -/* Default session id ; TBD needs incrementing for each */ -#define LOC_API_V02_DEF_SESSION_ID (1) - -/* Default minimium interval in ms */ -#define LOC_API_V02_DEF_MIN_INTERVAL (1000) - -/* Default horizontal accuracy in meters*/ -#define LOC_API_V02_DEF_HORZ_ACCURACY (50) - -/* Default timeout in ms; TBD: needs implementing */ -#define LOC_API_V02_DEF_TIMEOUT (120000) - -/* UMTS CP Address key*/ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -/* GPS SV Id offset */ -#define GPS_SV_ID_OFFSET (1) - -/* GLONASS SV Id offset */ -#define GLONASS_SV_ID_OFFSET (65) - -/* SV ID range */ -#define SV_ID_RANGE (32) - - - -/* static event callbacks that call the LocApiV02Adapter callbacks*/ - -/* global event callback, call the eventCb function in loc api adapter v02 - instance */ -static void globalEventCb(locClientHandleType clientHandle, - uint32_t eventId, - const locClientEventIndUnionType eventPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, eventId, pClientCookie); - - // return if null is passed - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", - __func__, __LINE__, clientHandle, eventId); - return; - } - locApiV02AdapterInstance->eventCb(clientHandle, - eventId, - eventPayload); -} - -/* global response callback, it calls the sync request process - indication function to unblock the request that is waiting on this - response indication*/ -static void globalRespCb(locClientHandleType clientHandle, - uint32_t respId, - const locClientRespIndUnionType respPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - - LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, respId, pClientCookie); - - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", - __func__, __LINE__, clientHandle, respId); - return; - } - // process the sync call - // use pDeleteAssistDataInd as a dummy pointer - loc_sync_process_ind(clientHandle, respId, - (void *)respPayload.pDeleteAssistDataInd); -} - -/* global error callback, it will call the handle service down - function in the loc api adapter instance. */ -static void globalErrorCb (locClientHandleType clientHandle, - locClientErrorEnumType errorId, - void *pClientCookie) -{ - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, errorId, pClientCookie); - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", - __func__, __LINE__, clientHandle, errorId); - return; - } - locApiV02AdapterInstance->errorCb(clientHandle, - errorId); -} - -/* global structure containing the callbacks */ -locClientCallbacksType globalCallbacks = -{ - sizeof(locClientCallbacksType), - globalEventCb, - globalRespCb, - globalErrorCb -}; - -/* Constructor for LocApiV02Adapter */ -LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): - LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), - eventMask(convertMask(locEng.eventMask)), navigating(false), - fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, - LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, - LOC_API_V02_DEF_TIMEOUT ) -{ - // initialize loc_sync_req interface - loc_sync_req_init(); -} - -/* Destructor for LocApiV02Adapter */ -LocApiV02Adapter :: ~LocApiV02Adapter() -{ - deInitLocClient(); -} - -/* close Loc API V02 client */ -int LocApiV02Adapter :: deInitLocClient() -{ - return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; -} - -/* Initialize a loc api v02 client */ -enum loc_api_adapter_err LocApiV02Adapter :: reinit() -{ - locClientStatusEnumType status; - /* If the client is already open close it first */ - if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) - { - status = locClientClose(&clientHandle); - if( eLOC_CLIENT_SUCCESS != status) - { - LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, - __LINE__, status); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - } - - LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, - __LINE__, this); - /* initialize the loc api v02 interface, note that - the locClientOpen() function will block if the - service is unavailable for a fixed time out */ - - status = locClientOpen( - eventMask, &globalCallbacks, &clientHandle, (void *)this); - - if (eLOC_CLIENT_SUCCESS != status || - clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) - { - LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, - __LINE__, loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - - // return SUCCESS - return (LOC_API_ADAPTER_ERR_SUCCESS); -} - -/* start positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: startFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStartReqMsgT_v02 start_msg; - - qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; - qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; - - // clear all fields, validity masks - memset (&start_msg, 0, sizeof(start_msg)); - memset (&set_mode_msg, 0, sizeof(set_mode_msg)); - memset (&set_mode_ind, 0, sizeof(set_mode_ind)); - - LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); - - // fill in the start request - switch(fixCriteria.mode) - { - case LOC_POSITION_MODE_MS_BASED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; - break; - - case LOC_POSITION_MODE_MS_ASSISTED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; - break; - - case LOC_POSITION_MODE_RESERVED_4: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; - break; - - default: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; - break; - } - - req_union.pSetOperationModeReq = &set_mode_msg; - - // send the mode first, before the start message. - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_OPERATION_MODE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_OPERATION_MODE_IND_V02, - &set_mode_ind); // NULL? - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) - { - LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " - "ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_mode_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error - } - - if(fixCriteria.min_interval > 0) - { - start_msg.minInterval_valid = 1; - start_msg.minInterval = fixCriteria.min_interval; - } - - start_msg.horizontalAccuracyLevel_valid = 1; - - if (fixCriteria.preferred_accuracy <= 100) - { - // fix needs high accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; - } - else if (fixCriteria.preferred_accuracy <= 1000) - { - //fix needs med accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; - } - else - { - //fix needs low accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; - } - - start_msg.fixRecurrence_valid = 1; - if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; - } - else - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; - } - - //dummy session id - // TBD: store session ID, check for session id in pos reports. - start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; - - req_union.pStartReq = &start_msg; - - status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, - req_union ); - - if( eLOC_CLIENT_SUCCESS == status) - { - navigating = true; - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - // start_fix failed so MO fix is not in progress - navigating = false; - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; -} - -/* stop a positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: stopFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStopReqMsgT_v02 stop_msg; - - LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); - - memset(&stop_msg, 0, sizeof(stop_msg)); - - // dummy session id - stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - req_union.pStopReq = &stop_msg; - - status = locClientSendReq(clientHandle, - QMI_LOC_STOP_REQ_V02, - req_union); - - if( eLOC_CLIENT_SUCCESS == status) - { - navigating = false; - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, - loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); -} - -/* set the positioning fix criteria */ -enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) -{ - - LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, - min_interval, mode, recurrence, preferred_accuracy); - - //store the fix criteria - fixCriteria.mode = mode; - - fixCriteria.recurrence = recurrence; - - if(min_interval == 0) - { - fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; - } - else - { - fixCriteria.min_interval = min_interval; - } - - fixCriteria.preferred_accuracy = preferred_accuracy; - - fixCriteria.preferred_time = preferred_time; - - if(true == navigating) - { - //fix is in progress, send a restart - LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " - "criteria\n", __func__, __LINE__); - - return( startFix()); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject time into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; - qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; - - memset(&inject_time_msg, 0, sizeof(inject_time_msg)); - - inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; - - inject_time_msg.timeUtc = time; - - inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); - - inject_time_msg.timeUnc = uncertainty; - - req_union.pInjectUtcTimeReq = &inject_time_msg; - - LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, - uncertainty); - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_UTC_TIME_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_UTC_TIME_IND_V02, - &inject_time_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) - { - LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_time_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject position into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - injectPosition(double latitude, double longitude, float accuracy) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; - qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; - - memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); - - inject_pos_msg.latitude_valid = 1; - inject_pos_msg.latitude = latitude; - - inject_pos_msg.longitude_valid = 1; - inject_pos_msg.longitude = longitude; - - inject_pos_msg.horUncCircular_valid = 1; - - inject_pos_msg.horUncCircular = accuracy; //meters assumed - - inject_pos_msg.horConfidence_valid = 1; - - inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) - - /* Log */ - LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, - inject_pos_msg.latitude, inject_pos_msg.longitude, - inject_pos_msg.horUncCircular); - - req_union.pInjectPositionReq = &inject_pos_msg; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_POSITION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_POSITION_IND_V02, - &inject_pos_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_pos_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* delete assistance date */ -enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocDeleteAssistDataReqMsgT_v02 delete_req; - qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; - - memset(&delete_req, 0, sizeof(delete_req)); - memset(&delete_resp, 0, sizeof(delete_resp)); - - if( f == GPS_DELETE_ALL ) - { - delete_req.deleteAllFlag = true; - } - - else - { - /* to keep track of svInfoList for GPS and GLO*/ - uint32_t curr_sv_len = 0; - uint32_t curr_sv_idx = 0; - uint32_t sv_id = 0; - - if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) - { - /* do delete for all GPS SV's */ - - curr_sv_len += SV_ID_RANGE; - - sv_id = GPS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - // increment the current index - curr_sv_idx += SV_ID_RANGE; - - } - -#ifdef QCOM_FEATURE_DELEXT - if( f & GPS_DELETE_TIME_GPS ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; - } -#endif - if(f & GPS_DELETE_POSITION ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; - } - - if(f & GPS_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; - } - - if(f & GPS_DELETE_IONO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; - } - - if(f & GPS_DELETE_UTC ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; - } - - if(f & GPS_DELETE_HEALTH ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; - } - - if(f & GPS_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; - } - if(f & GPS_DELETE_SADATA ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; - } - if(f & GPS_DELETE_RTI ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; - } - if(f & GPS_DELETE_CELLDB_INFO ) - { - delete_req.deleteCellDbDataMask_valid = 1; - delete_req.deleteCellDbDataMask = - ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; - - } -#ifdef QCOM_FEATURE_DELEXT - if(f & GPS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; - } - if(f & GPS_DELETE_FREQ_BIAS_EST ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; - } - if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) - { - /* do delete for all GLONASS SV's (65 - 96) - */ - curr_sv_len += SV_ID_RANGE; - - sv_id = GLONASS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - curr_sv_idx += SV_ID_RANGE; - } - - if(f & GPS_DELETE_SVDIR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; - } - - if(f & GPS_DELETE_SVSTEER_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; - } - - if(f & GPS_DELETE_ALMANAC_CORR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; - } - - if(f & GPS_DELETE_TIME_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; - } -#endif - } - - req_union.pDeleteAssistDataReq = &delete_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - &delete_resp); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != delete_resp.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(delete_resp.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* send NI user repsonse to the engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - - qmiLocNiUserRespReqMsgT_v02 ni_resp; - qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; - - memset(&ni_resp,0, sizeof(ni_resp)); - - memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); - - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; - break; - case GPS_NI_RESPONSE_DENY: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; - break; - case GPS_NI_RESPONSE_NORESP: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; - break; - default: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, - ni_resp.userResp); - - ni_resp.notificationType = request_pass_back->notificationType; - - // copy SUPL payload from request - if(request_pass_back->NiSuplInd_valid == 1) - { - ni_resp.NiSuplPayload_valid = 1; - memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), - sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); - - } - // should this be an "else if"?? we don't need to decide - - // copy UMTS-CP payload from request - if( request_pass_back->NiUmtsCpInd_valid == 1 ) - { - ni_resp.NiUmtsCpPayload_valid = 1; - memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), - sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); - } - - //copy Vx payload from the request - if( request_pass_back->NiVxInd_valid == 1) - { - ni_resp.NiVxPayload_valid = 1; - memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), - sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); - } - - // copy Vx service interaction payload from the request - if(request_pass_back->NiVxServiceInteractionInd_valid == 1) - { - ni_resp.NiVxServiceInteractionPayload_valid = 1; - memcpy(&(ni_resp.NiVxServiceInteractionPayload), - &(request_pass_back->NiVxServiceInteractionInd), - sizeof(qmiLocNiVxServiceInteractionStructT_v02)); - } - - req_union.pNiUserRespReq = &ni_resp; - - status = loc_sync_send_req ( - clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(ni_resp_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Set UMTs SLP server URL */ -enum loc_api_adapter_err LocApiV02Adapter :: setServer( - const char* url, int len) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - - if(len <=0 || len > sizeof(set_server_req.urlAddr)) - { - LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", - __func__, __LINE__, len); - - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); - - set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; - - set_server_req.urlAddr_valid = 1; - - strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err LocApiV02Adapter :: - setServer(unsigned int ip, int port, LocServerType type) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - qmiLocServerTypeEnumT_v02 set_server_cmd; - - switch (type) { - case LOC_AGPS_MPC_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; - break; - case LOC_AGPS_CUSTOM_PDE_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; - break; - default: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; - break; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); - - set_server_req.serverType = set_server_cmd; - set_server_req.ipv4Addr_valid = 1; - set_server_req.ipv4Addr.addr = ip; - set_server_req.ipv4Addr.port = port; - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Inject XTRA data, this module breaks down the XTRA - file into "chunks" and injects them one at a time */ -enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( - char* data, int length) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - int total_parts; - uint8_t part; - uint16_t len_injected; - - locClientReqUnionType req_union; - qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; - qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; - - req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; - - LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); - - inject_xtra.formatType_valid = 1; - inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; - inject_xtra.totalSize = length; - - total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; - - inject_xtra.totalParts = total_parts; - - len_injected = 0; // O bytes injected - - // XTRA injection starts with part 1 - for (part = 1; part <= total_parts; part++) - { - inject_xtra.partNum = part; - - if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) - { - inject_xtra.partData_len = length - len_injected; - } - else - { - inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; - } - - // copy data into the message - memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); - - LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", - __func__, __LINE__, - inject_xtra.partNum, total_parts, inject_xtra.partData_len, - len_injected); - - status = loc_sync_send_req( clientHandle, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - &inject_xtra_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || - inject_xtra.partNum != inject_xtra_ind.partNum) - { - LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," - " part num = %d, ind.partNum = %d\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_xtra_ind.status), - inject_xtra.partNum, inject_xtra_ind.partNum); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - break; - } - - len_injected += inject_xtra.partData_len; - LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, - len_injected); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} -#ifdef QCOM_FEATURE_IPV6 -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s], bearer = %d \n", __func__, __LINE__, - handle, is_succ, apn, bear); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - switch(bear) - { - case AGPS_APN_BEARER_IPV4: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - break; - - case AGPS_APN_BEARER_IPV6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; - break; - - case AGPS_APN_BEARER_IPV4V6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; - break; - - default: - LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} -#else -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s] \n", __func__, __LINE__, - handle, is_succ, apn); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} -#endif -/* close atl connection */ -enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( - int handle, int is_succ) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", - __func__, __LINE__, handle, is_succ); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the SUPL version */ -enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; - - LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); - - - memset(&supl_config_req, 0, sizeof(supl_config_req)); - memset(&supl_config_ind, 0, sizeof(supl_config_ind)); - - supl_config_req.suplVersion_valid = 1; - // SUPL version from MSByte to LSByte: - // (reserved)(major version)(minor version)(serviceIndicator) - - supl_config_req.suplVersion = (version == 0x00020000)? - eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; - - req_union.pSetProtocolConfigParametersReq = &supl_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &supl_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(supl_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Configuration */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; - qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; - - LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); - - memset(&sensor_config_req, 0, sizeof(sensor_config_req)); - memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); - - sensor_config_req.sensorsUsage_valid = 1; - sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 - : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; - - req_union.pSetSensorControlConfigReq = &sensor_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - &sensor_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Properties */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; - qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; - - LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", - __func__, __LINE__, gyroBiasVarianceRandomWalk); - - memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); - memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); - - sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; - sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; - - req_union.pSetSensorPropertiesReq = &sensor_prop_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - &sensor_prop_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_prop_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Performance Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; - qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; - - LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", - __FUNCTION__, - __LINE__, - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec - ); - - memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); - memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); - - sensor_perf_config_req.performanceControlMode_valid = 1; - sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; - sensor_perf_config_req.accelSamplingSpec_valid = 1; - sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; - sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; - sensor_perf_config_req.gyroSamplingSpec_valid = 1; - sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; - sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; - - req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - &sensor_perf_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Convert event mask from loc eng to loc_api_v02 format */ -locClientEventMaskType LocApiV02Adapter :: convertMask( - LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - locClientEventMaskType eventMask = 0; - LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); - - if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; - - if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; - - /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ - if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || - (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) - eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; - - if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; - - if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) - { - // TBD: This needs to be decoupled in the HAL - eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; - } - - if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) - { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); - } - - if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; - - return eventMask; -} - -/* Convert error from loc_api_v02 to loc eng format*/ -enum loc_api_adapter_err LocApiV02Adapter :: convertErr( - locClientStatusEnumType status) -{ - switch( status) - { - case LOC_API_ADAPTER_ERR_SUCCESS: - return LOC_API_ADAPTER_ERR_SUCCESS; - - case eLOC_CLIENT_FAILURE_GENERAL: - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - - case eLOC_CLIENT_FAILURE_UNSUPPORTED: - return LOC_API_ADAPTER_ERR_UNSUPPORTED; - - case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - - case eLOC_CLIENT_FAILURE_ENGINE_BUSY: - return LOC_API_ADAPTER_ERR_ENGINE_BUSY; - - case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: - return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; - - case eLOC_CLIENT_FAILURE_TIMEOUT: - return LOC_API_ADAPTER_ERR_TIMEOUT; - - case eLOC_CLIENT_FAILURE_INVALID_HANDLE: - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - - case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: - return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; - - default: - return LOC_API_ADAPTER_ERR_FAILURE; - } -} - -/* convert position report to loc eng format and send the converted - position to loc eng */ - -void LocApiV02Adapter :: reportPosition ( - const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) -{ - GpsLocation location; - - memset(&location, 0, sizeof (GpsLocation)); - location.size = sizeof(location); - // Process the position from final and intermediate reports - - if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || - (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) - ) - { - // Latitude & Longitude - if( (location_report_ptr->latitude_valid == 1 ) && - (location_report_ptr->longitude_valid == 1) && - (location_report_ptr->latitude != 0 || - location_report_ptr->longitude!= 0)) - { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; - - // Time stamp (UTC) - if(location_report_ptr->timestampUtc_valid == 1) - { - location.timestamp = location_report_ptr->timestampUtc; - } - - // Altitude - if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) - { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitudeWrtEllipsoid; - } - - // Speed - if((location_report_ptr->speedHorizontal_valid == 1) && - (location_report_ptr->speedVertical_valid ==1 ) ) - { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt( - (location_report_ptr->speedHorizontal * - location_report_ptr->speedHorizontal) + - (location_report_ptr->speedVertical * - location_report_ptr->speedVertical) ); - } - - // Heading - if(location_report_ptr->heading_valid == 1) - { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if( (location_report_ptr->horUncCircular_valid ) ) - { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->horUncCircular; - } - - LocApiAdapter::reportPosition( location, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->sessionStatus - == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); - } - } - else - { - LocApiAdapter::reportPosition(location, - NULL, - LOC_SESS_FAILURE); - - LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " - "fix id = %u\n", __func__, __LINE__, - location_report_ptr->sessionStatus, - location_report_ptr->fixId ); - } -} - -/* convert satellite report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportSv ( - const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - int num_svs_max, i; - const qmiLocSvInfoStructT_v02 *sv_info_ptr; - - LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, - gnss_report_ptr->svList_len); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - if(gnss_report_ptr->svList_valid == 1) - { - num_svs_max = gnss_report_ptr->svList_len; - if(num_svs_max > GPS_MAX_SVS) - { - num_svs_max = GPS_MAX_SVS; - } - SvStatus.num_svs = 0; - for(i = 0; i < num_svs_max; i++) - { - sv_info_ptr = &(gnss_report_ptr->svList[i]); - if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && - (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) - && (sv_info_ptr->gnssSvId != 0 )) - { - if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); - SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; - - // We only have the data field to report gps eph and alm mask - if(sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) - { - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) - { - SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) - { - SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - } - - if((sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) - && - (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) - { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + (65-1); - } - // Unsupported SV system - else - { - continue; - } - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) - { - SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) - { - SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) - { - SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; - } - - SvStatus.num_svs++; - } - } - - if (SvStatus.num_svs != 0) - { - LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); - LocApiAdapter::reportSv(SvStatus, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); - } -} - -/* convert engine state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) -{ - - LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, - engine_state_ptr->engineState); - - if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); - } - else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); - } - -} - -/* convert fix session state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) -{ - GpsStatusValue status; - LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, - fix_session_state_ptr->sessionState); - - status = GPS_STATUS_NONE; - if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) - { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (fix_session_state_ptr->sessionState - == eQMI_LOC_FIX_SESSION_FINISHED_V02) - { - status = GPS_STATUS_SESSION_END; - } - LocApiAdapter::reportStatus(status); -} - -/* convert NMEA report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportNmea ( - const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) -{ - - LocApiAdapter::reportNmea(nmea_report_ptr->nmea, - strlen(nmea_report_ptr->nmea)); - - LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, - nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], - nmea_report_ptr->nmea[5]); -} - -/* convert and report an ATL request to loc engine */ -void LocApiV02Adapter :: reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) -{ - uint32_t connHandle = server_request_ptr->connHandle; - // service ATL open request; copy the WWAN type - if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) - { - AGpsType agpsType; -#ifdef QCOM_FEATURE_IPV6 - switch(server_request_ptr->wwanType) - { - case eQMI_LOC_WWAN_TYPE_INTERNET_V02: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - - case eQMI_LOC_WWAN_TYPE_AGNSS_V02: - agpsType = AGPS_TYPE_SUPL; - break; - - default: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - } -#else - agpsType = AGPS_TYPE_SUPL; -#endif - LocApiAdapter::requestATL(connHandle, agpsType); - } - - // service the ATL close request - else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) - { - LocApiAdapter::releaseATL(connHandle); - } -} - -/* conver the NI report to loc eng format and send t loc engine */ -void LocApiV02Adapter :: reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) -{ - GpsNiNotification notif; - - /* initialize the notification*/ - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - /* NI timeout gets overwritten in LocApiAdapter, - initializing to 0 here */ - notif.timeout = 0; - - notif.text_encoding = GPS_ENC_NONE ; - - notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - - notif.notify_flags = 0; - - notif.default_response = GPS_NI_RESPONSE_NORESP; - - /*Handle Vx request */ - if(ni_req_ptr->NiVxInd_valid == 1) - { - const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); - - notif.ni_type = GPS_NI_TYPE_VOICE; - - // Requestor ID, the requestor id recieved is NULL terminated - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char *)vx_req->requestorId, vx_req->requestorId_len ); - } - - /* Handle UMTS CP request*/ - else if(ni_req_ptr->NiUmtsCpInd_valid == 1) - { - const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = - &ni_req_ptr->NiUmtsCpInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - - /* notificationText should always be a NULL terminated string */ - hexcode(notif.text, sizeof notif.text, - (char *)umts_cp_req->notificationText, - umts_cp_req->notificationText_len); - - /* Store requestor ID */ - hexcode(notif.requestor_id, sizeof(notif.requestor_id), - (char *)umts_cp_req->requestorId.codedString, - umts_cp_req->requestorId.codedString_len); - - /* convert encodings */ - notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); - - notif.requestor_id_encoding = - convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); - - /* LCS address (using extras field) */ - if ( umts_cp_req->clientAddress_len != 0) - { - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - - // 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; - address_source = (char *)umts_cp_req->clientAddress; - // client Address is always NULL terminated - addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, - umts_cp_req->clientAddress_len); - - // The address is ASCII string - if (addr_len) - { - strlcat(notif.extras, lcs_addr, sizeof notif.extras); - } - } - - } - else if(ni_req_ptr->NiSuplInd_valid == 1) - { - const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = - &ni_req_ptr->NiSuplInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - - // Client name - if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) - { - hexcode(notif.text, sizeof(notif.text), - (char *)supl_req->clientName.formattedString, - supl_req->clientName.formattedString_len); - LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, - notif.text); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", - __func__, __LINE__); - } - - // Requestor ID - if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char*)supl_req->requestorId.formattedString, - supl_req->requestorId.formattedString_len ); - - LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, - notif.requestor_id); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", - __func__, __LINE__); - } - - // Encoding type - if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) - { - notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); - - notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); - } - else - { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - } //ni_req_ptr->NiSuplInd_valid == 1 - - else - { - LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); - return; - } - - // Set default_response & notify_flags - convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); - - if( NULL != ni_req_copy_ptr) - { - memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); - - LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); - } - else - { - LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); - } - -} - -/* convert Ni Encoding type from QMI_LOC to loc eng format */ -GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case eQMI_LOC_NI_SUPL_UTF8_V02: - enc = GPS_ENC_SUPL_UTF8; - break; - case eQMI_LOC_NI_SUPL_UCS2_V02: - enc = GPS_ENC_SUPL_UCS2; - break; - case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - break; - default: - break; - } - - return enc; -} - -/*convert NI notify verify type from QMI LOC to loc eng format*/ -bool LocApiV02Adapter :: convertNiNotifyVerifyType ( - GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv) -{ - switch (notif_priv) - { - case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: - notif->notify_flags = 0; - break; - - case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_ACCEPT; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_DENY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return false; - } - - return true; -} - -/* event callback registered with the loc_api v02 interface */ -void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, - uint32_t eventId, locClientEventIndUnionType eventPayload) -{ - LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, - eventId); - - switch(eventId) - { - //Position Report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - reportPosition(eventPayload.pPositionReportEvent); - break; - - // Satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - reportSv(eventPayload.pGnssSvInfoReportEvent); - break; - - // Status report - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - reportEngineState(eventPayload.pEngineState); - break; - - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - reportFixSessionState(eventPayload.pFixSessionState); - break; - - // NMEA - case QMI_LOC_EVENT_NMEA_IND_V02: - reportNmea(eventPayload.pNmeaReportEvent); - break; - - // XTRA request - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - LOC_LOGD("%s:%d]: XTRA download request\n", __func__, - __LINE__); - requestXtraData(); - break; - - // time request - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - LOC_LOGD("%s:%d]: Time request\n", __func__, - __LINE__); - requestTime(); - break; - - //position request - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - LOC_LOGD("%s:%d]: Position request\n", __func__, - __LINE__); - //requestPosition(); - break; - - // NI request - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); - break; - - // AGPS connection request - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - reportAtlRequest(eventPayload.pLocationServerConnReqEvent); - break; - } -} - -/* Call the service LocApiAdapter down event*/ -void LocApiV02Adapter :: errorCb(locClientHandleType handle, - locClientErrorEnumType errorId) -{ - if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) - { - LOC_LOGE("%s:%d]: Service unavailable error\n", - __func__, __LINE__); - - LocApiAdapter::handleEngineDownEvent(); - - /* immediately send the engine up event so that - the loc engine re-initializes the adapter and the - loc-api_v02 interface */ - - LocApiAdapter::handleEngineUpEvent(); - } -} - -/* return a Loc API adapter */ -extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return(new LocApiV02Adapter(locEng)); -} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h deleted file mode 100644 index 487e98eb..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V_0_2_ADAPTER_H -#define LOC_API_V_0_2_ADAPTER_H - -#include -#include "loc_api_v02_client.h" -#include -#include - -/* Fix criteria structure*/ -struct LocApiV02FixCriteria -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval ; - uint32_t preferred_accuracy ; - uint32_t preferred_time; - - /* Constructor for the structure */ - inline LocApiV02FixCriteria (LocPositionMode mode, - GpsPositionRecurrence recur, - uint32_t min_int, - uint32_t pref_acc, - uint32_t pref_time) : - mode(mode), recurrence(recur), min_interval(min_int), - preferred_accuracy(pref_acc), preferred_time(pref_time) {} -}; - -/* This class derives from the LocApiAdapter class. - The members of this class are responsible for converting - the Loc API V02 data structures into Loc Engine data structures. - This class also implements some of the virtual functions that - handle the requests from loc engine. */ -class LocApiV02Adapter : public LocApiAdapter { - - /* loc api v02 handle*/ - locClientHandleType clientHandle; - - /* events the client is registered for */ - locClientEventMaskType eventMask; - - /* current session state */ - bool navigating; - - /* current fix criteria, for Loc aPI V02 this is - stored when set_position_mode is called and - sent out with Loc aPI V02 start message when the - start_fix() is called by loc engine. */ - LocApiV02FixCriteria fixCriteria; - - /* Convert event mask from loc eng to loc_api_v02 format */ - locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - - /* Convert error from loc_api_v02 to loc eng format*/ - enum loc_api_adapter_err convertErr(locClientStatusEnumType status); - - /* convert Ni Encoding type from QMI_LOC to loc eng format */ - GpsNiEncodingType convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); - - /*convert NI notify verify type from QMI LOC to loc eng format*/ - bool convertNiNotifyVerifyType (GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv); - - /* close Loc API V02 client */ - int deInitLocClient(); - - /* convert position report to loc eng format and send the converted - position to loc eng */ - void reportPosition - (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); - - /* convert satellite report to loc eng format and send the converted - report to loc eng */ - void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); - - /* convert engine state report to loc eng format and send the converted - report to loc eng */ - void reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); - - /* convert fix session report to loc eng format and send the converted - report to loc eng */ - void reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); - - /* convert NMEA report to loc eng format and send the converted - report to loc eng */ - void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); - - /* convert and report an ATL request to loc engine */ - void reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 - *server_request_ptr); - - /* convert and report NI request to loc eng */ - void reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); - -public: - LocApiV02Adapter(LocEng &locEng); - ~LocApiV02Adapter(); - - /* event callback registered with the loc_api v02 interface */ - void eventCb(locClientHandleType client_handle, - uint32_t loc_event_id, - locClientEventIndUnionType loc_event_payload); - - /* error callback, this function handles the service unavailable - error */ - void errorCb(locClientHandleType handle, - locClientErrorEnumType errorId); - - virtual enum loc_api_adapter_err reinit(); - - virtual enum loc_api_adapter_err startFix(); - - virtual enum loc_api_adapter_err stopFix(); - - virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); - - 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); - - 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); -#ifdef QCOM_FEATURE_IPV6 - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif - virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); - - virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); - - virtual enum loc_api_adapter_err - setSensorProperties(float gyroBiasVarianceRandomWalk); - - virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, - int accelBatchesPerSec, - int gyroSamplesPerBatch, - int gyroBatchesPerSec); -}; - -#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c deleted file mode 100644 index b75f1630..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ /dev/null @@ -1,548 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" - -/* Logging */ -// Uncomment to log verbose logs -#define LOG_NDEBUG 1 - -// log debug logs -#define LOG_NDDEBUG 1 -#define LOG_TAG "LocSvc_api_v02" -#include "loc_util_log.h" - -#define LOC_SYNC_REQ_BUFFER_SIZE 8 - -pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; - -static bool loc_sync_call_initialized = false; - -typedef struct { - pthread_mutex_t sync_req_lock; - - /* Client ID */ - locClientHandleType client_handle; - - /* waiting conditional variable */ - pthread_cond_t ind_arrived_cond; - - /* Callback waiting data block, protected by loc_cb_data_mutex */ - bool ind_is_selected; /* is cb selected? */ - bool ind_is_waiting; /* is waiting? */ - bool ind_has_arrived; /* callback has arrived */ - uint32_t req_id; /* sync request */ - void *recv_ind_payload_ptr; /* received payload */ - uint32_t recv_ind_id; /* received ind */ - -} loc_sync_req_data_s_type; - -typedef struct { - bool in_use; /* at least one sync call is active */ - bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; - loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; -} loc_sync_req_array_s_type; - -/*************************************************************************** - * DATA FOR ASYNCHRONOUS RPC PROCESSING - **************************************************************************/ -loc_sync_req_array_s_type loc_sync_array; - -/*=========================================================================== - -FUNCTION loc_sync_req_init - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_sync_req_init() -{ - LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); - pthread_mutex_lock(&loc_sync_call_mutex); - if(true == loc_sync_call_initialized) - { - LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - loc_sync_array.in_use = false; - - memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); - - int i; - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - pthread_mutex_init(&slot->sync_req_lock, NULL); - pthread_cond_init(&slot->ind_arrived_cond, NULL); - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; /* req id */ - } - - loc_sync_call_initialized = true; - pthread_mutex_unlock(&loc_sync_call_mutex); -} - - -/*=========================================================================== - -FUNCTION loc_sync_process_ind - -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_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* ind id */ - void *ind_payload_ptr /* payload */ -) -{ - - LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", - __func__,__LINE__, client_handle, ind_id); - - pthread_mutex_lock(&loc_sync_call_mutex); - - if (!loc_sync_array.in_use) - { - LOC_LOGD("%s:%d]: loc_sync_array not in use \n", - __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - bool in_use = false, consumed = false; - int i; - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - in_use |= loc_sync_array.slot_in_use[i]; - - pthread_mutex_lock(&slot->sync_req_lock); - - if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) - && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) - { - // copy the payload to the slot waiting for this ind - size_t payload_size = 0; - - LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", - __func__, __LINE__, i, ind_id); - - if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && - NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) - { - LOC_LOGV("%s:%d]: copying ind payload size = %u \n", - __func__, __LINE__, payload_size); - - memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); - - consumed = true; - - } - /* Received a callback while waiting, wake up thread to check it */ - if (slot->ind_is_waiting) - { - slot->recv_ind_id = ind_id; - - pthread_cond_signal(&slot->ind_arrived_cond); - } - else - { - /* If callback arrives before wait, remember it */ - LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", - __func__, __LINE__, ind_id); - - slot->ind_has_arrived = true; - } - } - pthread_mutex_unlock(&slot->sync_req_lock); - } - - if (!in_use) { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_alloc_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_alloc_slot() -{ - int i, select_id = -1; /* no free buffer */ - - pthread_mutex_lock(&loc_sync_call_mutex); - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (!loc_sync_array.slot_in_use[i]) - { - select_id = i; - loc_sync_array.slot_in_use[i] = 1; - loc_sync_array.in_use = true; - break; - } - } - - pthread_mutex_unlock(&loc_sync_call_mutex); - LOC_LOGV("%s:%d]: returning slot %d\n", - __func__, __LINE__, select_id); - return select_id; -} - -/*=========================================================================== - -FUNCTION loc_free_slot - -DESCRIPTION - Frees a buffer slot after the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_free_slot(int select_id) -{ - int i; - loc_sync_req_data_s_type *slot; - - pthread_mutex_lock(&loc_sync_call_mutex); - - LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); - - loc_sync_array.slot_in_use[select_id] = 0; - - slot = &loc_sync_array.slots[select_id]; - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; - - // check if all slots are now free - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (loc_sync_array.slot_in_use[i]) break; - } - - if (i >= LOC_SYNC_REQ_BUFFER_SIZE) - { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_sync_select_ind - -DESCRIPTION - Selects which indication to wait for. - - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -ENOMEM : out of buffer - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_select_ind( - locClientHandleType client_handle, /* Client handle */ - uint32_t ind_id, /* ind Id wait for */ - uint32_t req_id, /* req id */ - void * ind_payload_ptr /* ptr where payload should be copied to*/ -) -{ - int select_id = loc_alloc_slot(); - - LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", - __func__, __LINE__, client_handle, ind_id, req_id); - - if (select_id < 0) - { - LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", - __func__, __LINE__, loc_get_v02_event_name(req_id)); - return -ENOMEM; - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - pthread_mutex_lock(&slot->sync_req_lock); - - slot->client_handle = client_handle; - slot->ind_is_selected = true; - slot->ind_is_waiting = false; - slot->ind_has_arrived = false; - - slot->recv_ind_id = ind_id; - slot->req_id = req_id; - slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr - - pthread_mutex_unlock(&slot->sync_req_lock); - - return select_id; -} - - -/*=========================================================================== - -FUNCTION loc_sync_wait_for_ind - -DESCRIPTION - Waits for a selected indication. The wait expires in timeout_seconds seconds. - If the function is called before an existing wait has finished, it will - immediately return error. - -DEPENDENCIES - N/A - -RETURN VALUE - 0 on SUCCESS, -ve value on failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_wait_for_ind( - int select_id, /* ID from loc_sync_select_ind() */ - int timeout_seconds, /* Timeout in this number of seconds */ - uint32_t ind_id -) -{ - if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) - { - LOC_LOGE("%s:%d]: invalid select_id: %d \n", - __func__, __LINE__, select_id); - - return (-EINVAL); - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - int ret_val = 0; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ - - struct timeval present_time; - struct timespec expire_time; - - pthread_mutex_lock(&slot->sync_req_lock); - - do - { - if (slot->ind_has_arrived) - { - ret_val = 0; /* success */ - break; - } - - if (slot->ind_is_waiting) - { - LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, - __LINE__, select_id); - ret_val = -EBUSY; // busy - break; - } - - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_nsec = present_time.tv_usec * 1000; - expire_time.tv_sec += timeout_seconds; - - /* Take new wait request */ - slot->ind_is_waiting = true; - - /* Waiting */ - rc = pthread_cond_timedwait(&slot->ind_arrived_cond, - &slot->sync_req_lock, &expire_time); - - slot->ind_is_waiting = false; - - if(rc == ETIMEDOUT) - { - LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", - __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); - ret_val = -ETIMEDOUT; //time out - } - - } while (0); - - pthread_mutex_unlock(&slot->sync_req_lock); - loc_free_slot(select_id); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_sync_send_req - -DESCRIPTION - Synchronous req call (thread safe) - -DEPENDENCIES - N/A - -RETURN VALUE - Loc API 2.0 status - -SIDE EFFECTS - N/A - -===========================================================================*/ -locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; - int select_id; - int rc = 0; - - // Select the callback we are waiting for - select_id = loc_sync_select_ind(client_handle, ind_id, req_id, - ind_payload_ptr); - - if (select_id >= 0) - { - status = locClientSendReq (client_handle, req_id, req_payload); - LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", - __func__, __LINE__, select_id, status); - - if (status != eLOC_CLIENT_SUCCESS ) - { - loc_free_slot(select_id); - } - else - { - // Wait for the indication callback - if (( rc = loc_sync_wait_for_ind( select_id, - timeout_msec / 1000, - ind_id) ) < 0) - { - if ( rc == -ETIMEDOUT) - status = eLOC_CLIENT_FAILURE_TIMEOUT; - else - status = eLOC_CLIENT_FAILURE_INTERNAL; - - // Callback waiting failed - LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " - "select id %d, status %s", __func__, __LINE__, rc , - select_id, loc_get_v02_client_status_name(status)); - } - else - { - status = eLOC_CLIENT_SUCCESS; - LOC_LOGV("%s:%d]: success (select id %d)\n", - __func__, __LINE__, select_id); - } - } - } /* select id */ - - return status; -} - - diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h deleted file mode 100644 index 8c7f7f19..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SYNC_REQ_H -#define LOC_SYNC_REQ_H - -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#include -#include "loc_api_v02_client.h" - -#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second - -/* Init function */ -extern void loc_sync_req_init(); - - -/* Process Loc API indications to wake up blocked user threads */ -extern void loc_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* respInd id */ - void *ind_payload_ptr /* payload */ -); - -/* Thread safe synchronous request, using Loc API status return code */ -extern locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c deleted file mode 100644 index bb745112..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ /dev/null @@ -1,1923 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "qmi_client.h" -#include "qmi_idl_lib.h" -#include "qmi_cci_target_ext.h" - -#if defined( _ANDROID_) -#include "qmi_cci_target.h" -#include "qmi_cci_common.h" -#elif defined(LOC_UTIL_TARGET_OFF_TARGET) -#include -#include -#include -#endif //_ANDROID_ - -#include -#include -#include -#include -#include -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_api_v02" - -#include "loc_util_log.h" - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (5000) - -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) - -#else - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (1000) - -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -//timeout in ms to wait for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) -#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (60000) - -/* Table to relate eventId, size and mask value used to enable the event*/ -typedef struct -{ - uint32_t eventId; - size_t eventSize; - locClientEventMaskType eventMask; -}locClientEventIndTableStructT; - - -static locClientEventIndTableStructT locClientEventIndTable[]= { - - // position report ind - { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, - sizeof(qmiLocEventPositionReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, - - // satellite report ind - { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, - sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), - QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, - - // NMEA report ind - { QMI_LOC_EVENT_NMEA_IND_V02, - sizeof(qmiLocEventNmeaIndMsgT_v02), - QMI_LOC_EVENT_MASK_NMEA_V02 }, - - //NI event ind - { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, - sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, - - //Time Injection Request Ind - { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, - sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, - - //Predicted Orbits Injection Request - { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, - sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, - - //Position Injection Request Ind - { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, - sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , - - //Engine State Report Ind - { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, - sizeof(qmiLocEventEngineStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, - - //Fix Session State Report Ind - { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, - sizeof(qmiLocEventFixSessionStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, - - //Wifi Request Indication - { QMI_LOC_EVENT_WIFI_REQ_IND_V02, - sizeof(qmiLocEventWifiReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, - - //Sensor Streaming Ready Status Ind - { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, - sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, - - // Time Sync Request Indication - { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, - sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, - - //Set Spi Streaming Report Event - { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, - sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, - - //Location Server Connection Request event - { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, - sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } -}; - -/* table to relate the respInd Id with its size */ -typedef struct -{ - uint32_t respIndId; - size_t respIndSize; -}locClientRespIndTableStructT; - -static locClientRespIndTableStructT locClientRespIndTable[]= { - - // get service revision ind - { QMI_LOC_GET_SERVICE_REVISION_IND_V02, - sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, - - // Get Fix Criteria Resp Ind - { QMI_LOC_GET_FIX_CRITERIA_IND_V02, - sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, - - // NI User Resp In - { QMI_LOC_NI_USER_RESPONSE_IND_V02, - sizeof(qmiLocNiUserRespIndMsgT_v02)}, - - //Inject Predicted Orbits Data Resp Ind - { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, - - //Get Predicted Orbits Data Src Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, - - // Get Predicted Orbits Data Validity Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, - - // Inject UTC Time Resp Ind - { QMI_LOC_INJECT_UTC_TIME_IND_V02, - sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, - - //Inject Position Resp Ind - { QMI_LOC_INJECT_POSITION_IND_V02, - sizeof(qmiLocInjectPositionIndMsgT_v02)}, - - //Set Engine Lock Resp Ind - { QMI_LOC_SET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocSetEngineLockIndMsgT_v02)}, - - //Get Engine Lock Resp Ind - { QMI_LOC_GET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocGetEngineLockIndMsgT_v02)}, - - //Set SBAS Config Resp Ind - { QMI_LOC_SET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, - - //Get SBAS Config Resp Ind - { QMI_LOC_GET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, - - //Set NMEA Types Resp Ind - { QMI_LOC_SET_NMEA_TYPES_IND_V02, - sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, - - //Get NMEA Types Resp Ind - { QMI_LOC_GET_NMEA_TYPES_IND_V02, - sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, - - //Set Low Power Mode Resp Ind - { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, - - //Get Low Power Mode Resp Ind - { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, - - //Set Server Resp Ind - { QMI_LOC_SET_SERVER_IND_V02, - sizeof(qmiLocSetServerIndMsgT_v02)}, - - //Get Server Resp Ind - { QMI_LOC_GET_SERVER_IND_V02, - sizeof(qmiLocGetServerIndMsgT_v02)}, - - //Delete Assist Data Resp Ind - { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, - - //Set XTRA-T Session Control Resp Ind - { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, - - //Get XTRA-T Session Control Resp Ind - { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, - - //Inject Wifi Position Resp Ind - { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, - sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, - - //Notify Wifi Status Resp Ind - { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, - sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, - - //Get Registered Events Resp Ind - { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, - sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, - - //Set Operation Mode Resp Ind - { QMI_LOC_SET_OPERATION_MODE_IND_V02, - sizeof(qmiLocSetOperationModeIndMsgT_v02)}, - - //Get Operation Mode Resp Ind - { QMI_LOC_GET_OPERATION_MODE_IND_V02, - sizeof(qmiLocGetOperationModeIndMsgT_v02)}, - - //Set SPI Status Resp Ind - { QMI_LOC_SET_SPI_STATUS_IND_V02, - sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, - - //Inject Sensor Data Resp Ind - { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, - sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, - - //Inject Time Sync Data Resp Ind - { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, - sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, - - //Set Cradle Mount config Resp Ind - { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, - - //Get Cradle Mount config Resp Ind - { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, - - //Set External Power config Resp Ind - { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, - - //Get External Power config Resp Ind - { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, - - //Location server connection status - { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, - - //Set Protocol Config Parameters - { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, - - //Get Protocol Config Parameters - { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, - - //Set Sensor Control Config - { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, - - //Get Sensor Control Config - { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, - - //Set Sensor Properties - { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, - - //Get Sensor Properties - { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, - - //Set Sensor Performance Control Config - { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, - - //Get Sensor Performance Control Config - { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, - //Inject SUPL certificate - { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, - - //Delete SUPL certificate - { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, - - // Set Position Engine Config - { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, - - // Get Position Engine Config - { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} - -}; - - -/** whether indication is an event or a response */ -typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; - - -/** @struct locClientInternalState - */ - -typedef struct -{ - // client cookie - void *pClientCookie; - //QCCI handle for this control point - qmi_client_type userHandle; - - // callbacks registered by the clients - locClientEventIndCbType eventCallback; - locClientRespIndCbType respCallback; - locClientErrorCbType errorCallback; - - // the event mask the client has registered for - locClientEventMaskType eventRegMask; - -}locClientCallbackDataType; - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** locClientGetSizeAndTypeByIndId - * @brief this function gets the size and the type (event, - * response)of the indication structure from its ID - * @param [in] indId ID of the indication - * @param [out] type event or response indication - * @param [out] size size of the indications - * - * @return true if the ID was found, false otherwise */ - -static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, - locClientIndEnumT *pIndType) -{ - // look in the event table - if(true == locClientGetSizeByEventIndId(indId, pIndSize)) - { - *pIndType = eventIndType; - - LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - //else look in response table - if(true == locClientGetSizeByRespIndId(indId, pIndSize)) - { - *pIndType = respIndType; - - LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - // Id not found - LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); - return false; -} - -/** isClientRegisteredForEvent -* @brief checks the mask to identify if the client has -* registered for the specified event Id -* @param [in] eventIndId -* @param [in] eventRegMask -* @return true if client regstered for event; else false */ - -static bool isClientRegisteredForEvent( - locClientEventMaskType eventRegMask, - uint32_t eventIndId) -{ - size_t idx = 0, eventIndTableSize = 0; - - // look in the event table - eventIndTableSize = - (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); - - for(idx=0; idxresp.result == QMI_RESULT_SUCCESS ) - { - status = eLOC_CLIENT_SUCCESS; - } - else - { - switch(pResponse->resp.error) - { - case QMI_ERR_MALFORMED_MSG_V01: - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - - case QMI_ERR_DEVICE_IN_USE_V01: - status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; - break; - - default: - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - } - LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", - __func__, __LINE__, pResponse->resp.result, - pResponse->resp.error, status); - return status; -} - -/** convertQmiErrorToLocError - @brief converts a qmi service error type to - locClientErrorEnumType - @param [in] error received QMI service. - @return locClientErrorEnumType corresponding to the error. -*/ - -static locClientErrorEnumType convertQmiErrorToLocError( - qmi_client_error_type error) -{ - locClientErrorEnumType locError ; - switch(error) - { - case QMI_SERVICE_ERR: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - - default: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - } - LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", - __func__, __LINE__, error, locError); - return locError; -} - -/** locClienHandlePosReportInd - * @brief Validates a position report ind - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if pos report is valid, false otherwise -*/ -static bool locClientHandlePosReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate position report - qmiLocEventPositionReportIndMsgT_v02 *posReport = - (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", - __func__, __LINE__, ind_buf_len, - posReport->latitude, posReport->longitude, - posReport->altitudeWrtEllipsoid); - - return true; -} -//----------------------------------------------------------------------------- - -/** locClientHandleSatReportInd - * @brief Validates a satellite report indication. Dk - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if sat report is valid, false otherwise -*/ -static bool locClientHandleSatReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate sat reports - unsigned int idx = 0; - qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = - (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" - " validity = %d \n ", __func__, __LINE__, - ind_buf_len, satReport->altitudeAssumed, - satReport->svList_len, satReport->svList_valid); - //Log SV report - for( idx = 0; idx svList_len; idx++ ) - { - LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " - "status = %d \n", __func__, __LINE__, - satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, - satReport->svList[idx].system, satReport->svList[idx].svStatus); - } - - return true; -} - - -/** locClientHandleNmeaReportInd - * @brief Validate a NMEA report indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if nmea report is valid, false otherwise -*/ - - -static bool locClientHandleNmeaReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate NMEA report - return true; -} - -/** locClientHandleGetServiceRevisionRespInd - * @brief Handles a Get Service Revision Rresponse indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if service revision is valid, false otherwise -*/ - -static bool locClientHandleGetServiceRevisionRespInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - LOC_LOGV("%s:%d] :\n", __func__, __LINE__); - return true; -} - -/** locClientHandleIndication - * @brief looks at each indication and calls the appropriate - * validation handler - * @param [in] indId - * @param [in] indBuffer - * @param [in] indSize - * @return true if indication was validated; else false */ - -static bool locClientHandleIndication( - uint32_t indId, - void* indBuffer, - size_t indSize - ) -{ - bool status = false; - switch(indId) - { - // handle the event indications - //------------------------------------------------------------------------- - - // handle position report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - { - status = locClientHandlePosReportInd(indId, indBuffer, indSize); - break; - } - // handle satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - { - status = locClientHandleSatReportInd(indId, indBuffer, indSize); - break; - } - - // handle NMEA report - case QMI_LOC_EVENT_NMEA_IND_V02: - { - status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); - break; - } - - // handle NI Notify Verify Request Ind - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - { - // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Time Inject request Ind - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - { - // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle XTRA data Inject request Ind - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - { - // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle position inject request Ind - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - { - // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle engine state Ind - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - { - // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle fix session state Ind - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - { - // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Wifi request Ind - case QMI_LOC_EVENT_WIFI_REQ_IND_V02: - { - // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle sensor streaming ready status Ind - case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: - { - // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle time sync Ind - case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: - { - // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle set streaming report ind - case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: - { - // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - { - //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - //------------------------------------------------------------------------- - - // handle the response indications - //------------------------------------------------------------------------- - - // Get service Revision response indication - case QMI_LOC_GET_SERVICE_REVISION_IND_V02: - { - status = locClientHandleGetServiceRevisionRespInd(indId, - indBuffer, indSize); - break; - } - // predicted orbits data response indication - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: - { - //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : - { - //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: - { - //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: - { - //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: - { - //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: - { - //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - // for indications that only have a "status" field - case QMI_LOC_NI_USER_RESPONSE_IND_V02: - case QMI_LOC_INJECT_UTC_TIME_IND_V02: - case QMI_LOC_INJECT_POSITION_IND_V02: - case QMI_LOC_SET_ENGINE_LOCK_IND_V02: - case QMI_LOC_SET_SBAS_CONFIG_IND_V02: - case QMI_LOC_SET_NMEA_TYPES_IND_V02: - case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: - case QMI_LOC_SET_SERVER_IND_V02: - case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: - case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: - case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: - case QMI_LOC_SET_OPERATION_MODE_IND_V02: - case QMI_LOC_SET_SPI_STATUS_IND_V02: - case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: - { - status = true; - break; - } - default: - LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, - (uint32_t)indId); - status = false; - break; - } - return status; -} - - -/** locClientErrorCb - * @brief handles the QCCI error events, this is called by the - * QCCI infrastructure when the service is no longer - * available. - * @param [in] user handle - * @param [in] error - * @param [in] *err_cb_data - */ - -static void locClientErrorCb -( - qmi_client_type user_handle, - qmi_client_error_type error, - void *err_cb_data -) -{ - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)err_cb_data; - - /* copy the errorCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and error callback. - */ - locClientErrorCbType localErrorCallback = - pCallbackData->errorCallback; - - LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", - __func__, __LINE__, error, err_cb_data); - - /* call the error callback - * To avoid calling the errorCallback after locClientClose - * is called, check pCallbackData->errorCallback again here - */ - - if( (NULL != pCallbackData) && - (NULL != localErrorCallback) && - (NULL != pCallbackData->errorCallback) ) - { - //invoke the error callback for the corresponding client - localErrorCallback( - (locClientHandleType)pCallbackData, - convertQmiErrorToLocError(error), - pCallbackData->pClientCookie); - } -} - - -/** locClientIndCb - * @brief handles the indications sent from the service, if a - * response indication was received then the it is sent - * to the response callback. If a event indication was - * received then it is sent to the event callback - * @param [in] user handle - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @param [in] ind_cb_data */ - -static void locClientIndCb -( - qmi_client_type user_handle, - unsigned int msg_id, - void *ind_buf, - unsigned int ind_buf_len, - void *ind_cb_data -) -{ - locClientIndEnumT indType; - size_t indSize = 0; - qmi_client_error_type rc ; - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)ind_cb_data; - - LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", - __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, - pCallbackData); - - // check callback data - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); - return; - } - - // check user handle - if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) - { - LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", - __func__, __LINE__, - user_handle, pCallbackData->userHandle); - return; - } - // Get the indication size and type ( eventInd or respInd) - if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) - { - void *indBuffer = NULL; - - // if the client did not register for this event then just drop it - if( (eventIndType == indType) && - ( (NULL == pCallbackData->eventCallback) || - (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) - { - LOC_LOGW("%s:%d]: client is not registered for event %d\n", - __func__, __LINE__, (uint32_t)msg_id); - return; - } - - // decode the indication - indBuffer = malloc(indSize); - - if(NULL == indBuffer) - { - LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); - return; - } - - // decode the indication - rc = qmi_client_message_decode( - user_handle, - QMI_IDL_INDICATION, - msg_id, - ind_buf, - ind_buf_len, - indBuffer, - indSize); - - if( rc == QMI_NO_ERR ) - { - //validate indication - if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) - { - if(eventIndType == indType) - { - locClientEventIndUnionType eventIndUnion; - - /* copy the eventCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientEventIndCbType localEventCallback = - pCallbackData->eventCallback; - - // dummy event - eventIndUnion.pPositionReportEvent = - (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; - - /* call the event callback - * To avoid calling the eventCallback after locClientClose - * is called, check pCallbackData->eventCallback again here - */ - if((NULL != localEventCallback) && - (NULL != pCallbackData->eventCallback)) - { - localEventCallback( - (locClientHandleType)pCallbackData, - msg_id, - eventIndUnion, - pCallbackData->pClientCookie); - } - } - else if(respIndType == indType) - { - locClientRespIndUnionType respIndUnion; - - /* copy the respCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientRespIndCbType localRespCallback = - pCallbackData->respCallback; - - // dummy to suppress compiler warnings - respIndUnion.pDeleteAssistDataInd = - (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; - - /* call the response callback - * To avoid calling the respCallback after locClientClose - * is called, check pCallbackData->respCallback again here - */ - if((NULL != localRespCallback) && - (NULL != pCallbackData->respCallback)) - { - localRespCallback( - (locClientHandleType)pCallbackData, - msg_id, - respIndUnion, - pCallbackData->pClientCookie); - } - } - } - else // error handling indication - { - LOC_LOGE("%s:%d]: Error handling the indication %d\n", - __func__, __LINE__, (uint32_t)msg_id); - } - } - else - { - LOC_LOGE("%s:%d]: Error decoding indication %d\n", - __func__, __LINE__, rc); - } - if(indBuffer) - { - free (indBuffer); - } - } - else // Id not found - { - LOC_LOGE("%s:%d]: Error indication not found %d\n", - __func__, __LINE__,(uint32_t)msg_id); - } - return; -} - - -/** locClientRegisterEventMask - * @brief registers the event mask with loc service - * @param [in] clientHandle - * @param [in] eventRegMask - * @return true if indication was validated; else false */ - -static bool locClientRegisterEventMask( - locClientHandleType clientHandle, - locClientEventMaskType eventRegMask) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientReqUnionType reqUnion; - qmiLocRegEventsReqMsgT_v02 regEventsReq; - - memset(®EventsReq, 0, sizeof(regEventsReq)); - - regEventsReq.eventRegMask = eventRegMask; - reqUnion.pRegEventsReq = ®EventsReq; - - status = locClientSendReq(clientHandle, - QMI_LOC_REG_EVENTS_REQ_V02, - reqUnion); - - if(eLOC_CLIENT_SUCCESS != status ) - { - LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status) ); - return false; - } - - return true; -} - -/** validateRequest - @brief validates the input request - @param [in] reqId request ID - @param [in] reqPayload Union of pointers to message payload - @param [out] ppOutData Pointer to void *data if successful - @param [out] pOutLen Pointer to length of data if succesful. - @return false on failure, true on Success -*/ - -static bool validateRequest( - uint32_t reqId, - const locClientReqUnionType reqPayload, - void **ppOutData, - uint32_t *pOutLen ) - -{ - bool noPayloadFlag = false; - - LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); - switch(reqId) - { - case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); - break; - } - - case QMI_LOC_REG_EVENTS_REQ_V02: - { - *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); - break; - } - - case QMI_LOC_START_REQ_V02: - { - *pOutLen = sizeof(qmiLocStartReqMsgT_v02); - break; - } - - case QMI_LOC_STOP_REQ_V02: - { - *pOutLen = sizeof(qmiLocStopReqMsgT_v02); - break; - } - - case QMI_LOC_NI_USER_RESPONSE_REQ_V02: - { - *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_UTC_TIME_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); - break; - } - - case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_NMEA_TYPES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SERVER_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); - break; - } - - case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); - break; - } - - case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_OPERATION_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SPI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); - break; - } - - // ALL requests with no payload - case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: - case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: - case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: - case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: - case QMI_LOC_GET_NMEA_TYPES_REQ_V02: - case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: - case QMI_LOC_GET_SERVER_REQ_V02: - case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: - case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: - case QMI_LOC_GET_OPERATION_MODE_REQ_V02: - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - noPayloadFlag = true; - break; - } - - default: - LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, - reqId); - return false; - } - if(true == noPayloadFlag) - { - *ppOutData = NULL; - *pOutLen = 0; - } - else - { - //set dummy pointer for request union - *ppOutData = (void*) reqPayload.pInformClientRevisionReq; - } - LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, - reqId, *pOutLen); - return true; -} - -/** locClientQmiCtrlPointInit - @brief wait for the service to come up or timeout; when the - service comes up initialize the control point and set - internal handle and indication callback. - @param pQmiClient, -*/ - -static locClientStatusEnumType locClientQmiCtrlPointInit( - locClientCallbackDataType *pLocClientCbData) -{ - qmi_client_type clnt, notifier; - bool notifierInitFlag = false; - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - // instances of this service - qmi_service_info *pServiceInfo = NULL; - - do - { - uint32_t num_services = 0, num_entries = 0; - qmi_client_error_type rc = QMI_NO_ERR; - bool nosignal = false; - - // Get the service object for the qmiLoc Service - qmi_idl_service_object_type locClientServiceObject = - loc_get_service_object_v02(); - - // Verify that qmiLoc_get_service_object did not return NULL - if (NULL == locClientServiceObject) - { - LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , - __func__, __LINE__ ); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // get the service addressing information - rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, - &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " - "num_services %d", __func__, __LINE__, rc, num_services); - - if (rc != QMI_NO_ERR) { - // bummer, service list is not up. - // We need to try again after a timed wait - qmi_client_os_params os_params; - int timeout = 0; - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - notifierInitFlag = (NULL != notifier); - - if (rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); - nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - - // get the service addressing information - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " - "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); - } - - if (0 == num_services || rc != QMI_NO_ERR) { - if (!nosignal) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!! Error %d \n", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - } else { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," - " final Err %d", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_TIMEOUT; - } - break; - } - - pServiceInfo = - (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); - - if(NULL == pServiceInfo) - { - LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", - __func__, __LINE__); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - //set the number of entries to get equal to the total number of - //services. - num_entries = num_services; - //populate the serviceInfo - rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, - &num_entries, &num_services); - - - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", - __func__, __LINE__, pLocClientCbData); - - // initialize the client - //sent the address of the first service found - // if IPC router is present, this will go to the service instance - // enumerated over IPC router, else it will go over the next transport where - // the service was enumerated. - rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, - locClientIndCb, (void *) pLocClientCbData, - NULL, &clnt); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_init error %d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to" - "qmi_client_register_error_cb \n", - __func__, __LINE__, pLocClientCbData); - - // register error callback - rc = qmi_client_register_error_cb(clnt, - locClientErrorCb, (void *) pLocClientCbData); - - if( QMI_NO_ERR != rc) - { - LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // copy the clnt handle returned in qmi_client_init - memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - - status = eLOC_CLIENT_SUCCESS; - - } while(0); - - /* release the notifier handle */ - if(true == notifierInitFlag) - { - qmi_client_release(notifier); - } - - if(NULL != pServiceInfo) - { - free((void *)pServiceInfo); - } - - return status; -} -//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- - -/** locClientOpen - @brief Connects a location client to the location engine. If the connection - is successful, returns a handle that the location client uses for - future location operations. - - @param [in] eventRegMask Mask of asynchronous events the client is - interested in receiving - @param [in] eventIndCb Function to be invoked to handle an event. - @param [in] respIndCb Function to be invoked to handle a response - indication. - @param [out] locClientHandle Handle to be used by the client - for any subsequent requests. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - non-zero error code(see locClientStatusEnumType)-- On failure. -*/ - -locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pClientCookie) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientCallbackDataType *pCallbackData = NULL; - - LOC_LOGV("%s:%d] \n", __func__, __LINE__); - - do - { - // check input parameters - if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) - || (NULL == pLocClientCallbacks->respIndCb) || - (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) - { - LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - } - - // Allocate memory for the callback data - pCallbackData = - ( locClientCallbackDataType*)calloc( - 1, sizeof(locClientCallbackDataType)); - - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize the QMI control point; this function will block - * until a service is up or a timeout occurs. If the connection to - * the service succeeds the callback data will be filled in with - * a qmi_client value. - */ - - - EXIT_LOG_CALLFLOW(%s, "loc client open"); - status = locClientQmiCtrlPointInit(pCallbackData); - - LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - - if(status != eLOC_CLIENT_SUCCESS) - { - free(pCallbackData); - pCallbackData = NULL; - break; - } - - // set the handle to the callback data - *pLocClientHandle = (locClientHandleType)pCallbackData; - - if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) - { - LOC_LOGE("%s:%d]: Error sending registration mask\n", - __func__, __LINE__); - - // release the client - locClientClose(pLocClientHandle); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize rest of the client structure now that the connection - * to the service has been created successfully. - */ - - //fill in the event callback - pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; - - //fill in the response callback - pCallbackData->respCallback = pLocClientCallbacks->respIndCb; - - //fill in the error callback - pCallbackData->errorCallback = pLocClientCallbacks->errorCb; - - //set the client event registration mask - pCallbackData->eventRegMask = eventRegMask; - - // set the client cookie - pCallbackData->pClientCookie = (void *)pClientCookie; - - LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", - __func__, __LINE__, *pLocClientHandle, - pCallbackData->userHandle, status); - - }while(0); - - if(eLOC_CLIENT_SUCCESS != status) - { - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - } - - return(status); -} - -/** locClientClose - @brief Disconnects a client from the location engine. - @param [in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) - On success. - - non-zero error code(see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientClose( - locClientHandleType* pLocClientHandle) -{ - qmi_client_error_type rc = QMI_NO_ERR; //No error - - if(NULL == pLocClientHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid pointer to handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - // convert handle to callback data - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)(*pLocClientHandle); - - LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", - *pLocClientHandle, pCallbackData->userHandle ); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, "loc client close"); - // release the handle - rc = qmi_client_release(pCallbackData->userHandle); - if(QMI_NO_ERR != rc ) - { - LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", - __func__, __LINE__, rc, pCallbackData->userHandle); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* clear the memory allocated to callback data to minimize the chances - * of a race condition occurring between close and the indication - * callback - */ - memset(pCallbackData, 0, sizeof(*pCallbackData)); - - // free the memory assigned in locClientOpen - free(pCallbackData); - pCallbackData= NULL; - - // set the handle to invalid value - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - - return eLOC_CLIENT_SUCCESS; -} - -/** locClientSendReq - @brief Sends a message to the location engine. If the locClientSendMsg() - function is successful, the client should expect an indication - (except start, stop, event reg and sensor injection messages), - through the registered callback in the locOpen() function. The - indication will contain the status of the request and if status is a - success, indication also contains the payload - associated with response. - @param [in] handle Handle returned by the locClientOpen() - function. - @param [in] reqId message ID of the request - @param [in] reqPayload Payload of the request, can be NULL - if request has no payload - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS ) - On success. - - non-zero error code (see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload ) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - qmi_client_error_type rc = QMI_NO_ERR; //No error - qmiLocGenRespMsgT_v02 resp; - uint32_t reqLen = 0; - void *pReqData = NULL; - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)handle; - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle ) - { - // did not find the handle in the client List - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - // validate that the request is correct - if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) - { - - LOC_LOGE("%s:%d] error invalid request\n", __func__, - __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, - __LINE__, reqId, reqLen); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); - - rc = qmi_client_send_msg_sync( - pCallbackData->userHandle, - reqId, - pReqData, - reqLen, - &resp, - sizeof(resp), - LOC_CLIENT_ACK_TIMEOUT); - - LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, - __LINE__, rc); - - if (rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - // map the QCCI response to Loc API v02 status - status = convertQmiResponseToLocStatus(&resp); - - return(status); -} - -/** locClientGetSizeByRespIndId - * @brief Get the size of the response indication structure, - * from a specified id - * @param [in] respIndId - * @param [out] pRespIndSize - * @return true if resp ID was found; else false -*/ - -bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) -{ - size_t idx = 0, respIndTableSize = 0; - respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); - for(idx=0; idx -#include "location_service_v02.h" //QMI LOC Service data types definitions -#include -#include - -/****************************************************************************** - * Constants and configuration - *****************************************************************************/ - -/** @addtogroup constants_macros -@{ */ - -/** Specific value of #locClientHandleType, indicating an invalid handle. */ -#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) - -/** @} */ /* end_addtogroup constants_macros */ - -/** @addtogroup data_types -@{ */ - -/** Location client handle used to represent a specific client. Negative values - are invalid handles. */ -typedef void* locClientHandleType; - -/** Data type for events and event masks. - @newpage */ -typedef uint64_t locClientEventMaskType; - -/** Location client status values. - @vertspace -*/ -typedef enum -{ - eLOC_CLIENT_SUCCESS = 0, - /**< Request was successful. */ - - eLOC_CLIENT_FAILURE_GENERAL = 1, - /**< Failed because of a general failure. */ - - eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, - /**< Failed because the service does not support the command. */ - - eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, - /**< Failed because the request contained invalid parameters. */ - - eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, - /**< Failed because the engine is busy. */ - - eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, - /**< Failed because the phone is offline. */ - - eLOC_CLIENT_FAILURE_TIMEOUT = 6, - /**< Failed because of a timeout. */ - - eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, - /**< Failed because the service is not present. */ - - eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, - /**< Failed because the service version is unsupported. */ - - eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, - /**< Failed because the service does not support client version. */ - - eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, - /**< Failed because an invalid handle was specified. */ - - eLOC_CLIENT_FAILURE_INTERNAL = 11, - /**< Failed because of an internal error in the service. */ - - eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 - /**< Failed because the service has not been initialized. */ - -}locClientStatusEnumType; - -/** Loc Client error values -*/ - -typedef enum -{ - eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 - /**< Service is no longer available, the client should - close the existing connection and reopen the connection - upon getting this error. - */ -}locClientErrorEnumType; - - -/** @} */ /* end_addtogroup data_types */ - -/** @addtogroup send_request -@{ */ - -/** @brief Request messages the client can send to the location engine. - - The following requests do not have any data associated, so they do not have a - payload structure defined: - - - GetServiceRevision - - GetFixCriteria - - GetPredictedOrbitsDataSource - - GetPredictedOrbitsDataValidity - - GetEngineLock - - GetSbasConfigReq - - GetRegisteredEvents - - GetNmeaTypes - - GetLowPowerMode - - GetXtraTSessionControl - - GetRegisteredEvents - - GetOperationMode - - GetCradleMountConfig - - GetExternalPowerConfig -*/ -typedef union -{ - const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; - /**< Notifies the service about the revision the client is using. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ - - const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; - /**< Changes the events the client is interested in receiving. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_REG_EVENTS_REQ_V02. */ - - const qmiLocStartReqMsgT_v02* pStartReq; - /**< Starts a positioning session. - - The client receives the following indications: position report, - satellite report, fix session report, and NMEA report (if applicable). - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_START_REQ_V02. */ - - const qmiLocStopReqMsgT_v02* pStopReq; - /**< Stops a positioning session. The client receives a fix session report - denoting that the fix session ended after this message was sent. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_STOP_REQ_V02. */ - - const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; - /**< Informs the service about the user response for a network-initiated call. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NI_USER_RESPONSE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ - - const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; - /**< Injects the predicted orbits data into the service. - - When all predicted orbits data parts have been injected, the client - receives the following indication containing a response: - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. - - The client injects successive data parts without waiting for this - indication as long as locClientSendReq() returns successfully. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ - - const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; - /**< Injects UTC time into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_UTC_TIME_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ - - const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; - /**< Injects a position into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_POSITION_REQ_V02. */ - - const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; - /**< Sets the location engine lock. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_ENGINE_LOCK_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ - - const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; - /**< Sets the SBAS configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SBAS_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ - - const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; - /**< Sets the NMEA types configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_NMEA_TYPES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ - - const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; - /**< Sets the Low Power mode configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ - - const qmiLocSetServerReqMsgT_v02* pSetServerReq; - /**< Sets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SERVER_REQ_V02. */ - - const qmiLocGetServerReqMsgT_v02* pGetServerReq; - /**< Gets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SERVER_REQ_V02. */ - - const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; - /**< Deletes the aiding data from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ - - const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; - /**< Sets XTRA-T session control in the engine. If the request is accepted by - the service, the client receives the following indication containing a - response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ - - const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; - /**< Injects a WiFi position into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ - - const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; - /**< Notifies the engine about the WiFi status. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ - - const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; - /**< Sets the engine Operation mode. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_OPERATION_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ - - const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; - /**< Sends the stationary position status to the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SPI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SPI_STATUS_REQ_V02. */ - - const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; - /**< Injects sensor data into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ - - const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; - /**< Injects time synchronization information into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ - - const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; - /**< Sets the cradle mount state information in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - SET_CRADLE_MOUNT_CONFIG_REQ_V02. - - To send this request, set the reqId field in locClientSendReq() to - SET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; - /**< Sets external power configuration state in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ - - const qmiLocInformLocationServerConnStatusReqMsgT_v02* - pInformLocationServerConnStatusReq; - /**< Informs the engine about the connection status to the location server. - - This can be sent in response to a - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The - service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 - response indication for this request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ - - const qmiLocSetProtocolConfigParametersReqMsgT_v02* - pSetProtocolConfigParametersReq; - /**< Sets the protocol configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetProtocolConfigParametersReqMsgT_v02* - pGetProtocolConfigParametersReq; - /**< Retrieves protocol configuration parameters from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - - const qmiLocSetSensorControlConfigReqMsgT_v02* - pSetSensorControlConfigReq; - /**< Sets the sensor control configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. - @newpage */ - - const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* - pSetSensorPerformanceControlConfigReq; - /**< Sets the sensor performance configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - @newpage */ - - const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; - /**< Sets the sensor properties in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. - @newpage */ - - const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; - /**< Injects a SUPL certificate into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. - @newpage */ - - const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; - /**< Deletes a SUPL certificate from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. - @newpage */ - - const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* - pSetPositionEngineConfigParametersReq; - /**< Sets Position Engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - - const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* - pGetPositionEngineConfigParametersReq; - /**< Gets Position Engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - -}locClientReqUnionType; - - -/** @brief Event indications that are sent by the service. -*/ -typedef union -{ - const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; - /**< Contains the position information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. If - periodic fix criteria is specified, this event is generated multiple - times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is - sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ - - const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; - /**< Contains the GNSS satellite information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. This event - is generated at 1 Hz if the location engine is tracking satellites to - make a location fix. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ - - const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; - /**< Contains an NMEA report sentence. The entire NMEA report consisting - of multiple sentences is sent at a 1Hz rate. - This event is generated after QMI_LOC_START_REQ_V02 is sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NMEA_IND_V02. */ - - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; - /**< Notifies a location client when the network triggers a positioning request - to the mobile. - - Upon getting this event, the location client displays the - network-initiated fix request in a dialog and prompts the user to accept - or deny the request. The client responds to this request with the message - QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ - - const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; - /**< Asks the client for time assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The eventIndId field in the event indication callback is - set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ - - const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* - pInjectPredictedOrbitsReqEvent; - /**< Asks the client for predicted orbits data assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ - - const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; - /**< Asks the client for position assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_POSITION_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ - - const qmiLocEventEngineStateIndMsgT_v02* pEngineState; - /**< Sent by the engine whenever it turns on or off. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ - - const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; - /**< Sent by the engine when a location session begins or ends. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ - - const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; - /**< Sent by the engine when it needs WiFi support. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ - - const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* - pSensorStreamingReadyStatusEvent; - /**< Notifies the client that the engine is ready to accept sensor data. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ - - const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; - /**< Sent by the engine when it needs to synchronize its time with the sensor - processor time. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ - - const qmiLocEventSetSpiStreamingReportIndMsgT_v02* - pSetSpiStreamingReportEvent; - /**< Asks the client to start/stop sending a Stationary Position Indicator - (SPI) stream. - - The eventIndId field in the event indication callback is set to - QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ - - const qmiLocEventLocationServerConnectionReqIndMsgT_v02* - pLocationServerConnReqEvent; - /**< Sent by the engine to ask the client to open or close a connection to - a location server. - - The client responds to this request by sending the - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. - @newpage */ - -}locClientEventIndUnionType; - - -/** @brief Response indications that are sent by the service. */ -typedef union -{ - const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; - /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ - - const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; - /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ - - const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; - /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_NI_USER_RESPONSE_IND_V02. */ - - const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* - pInjectPredictedOrbitsDataInd; - /**< Sent after a predicted orbits data part has been successfully injected. - - The client waits for this indication before injecting the next part. - This indication is sent in response to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* - pGetPredictedOrbitsDataSourceInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* - pGetPredictedOrbitsDataValidityInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ - - const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; - /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_UTC_TIME_IND_V02. */ - - const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; - /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_POSITION_IND_V02. */ - - const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; - /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ - - const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; - /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ - - const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; - /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ - - const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; - /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ - - const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; - /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_NMEA_TYPES_IND_V02. */ - - const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; - /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NMEA_TYPES_IND_V02. */ - - const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; - /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; - /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocSetServerIndMsgT_v02* pSetServerInd; - /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SERVER_IND_V02. */ - - const qmiLocGetServerIndMsgT_v02* pGetServerInd; - /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVER_IND_V02. */ - - const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; - /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ - - const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; - /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ - - const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; - /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ - - const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; - /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ - - const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; - /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_OPERATION_MODE_IND_V02. */ - - const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; - /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_OPERATION_MODE_IND_V02. */ - - const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; - /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SPI_STATUS_IND_V02. */ - - const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; - /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ - - const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; - /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ - - const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ - - const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocInformLocationServerConnStatusIndMsgT_v02* - pInformLocationServerConnStatusInd; - /**< Response to the request, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ - - const qmiLocSetProtocolConfigParametersIndMsgT_v02* - pSetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetProtocolConfigParametersIndMsgT_v02* - pGetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - @newpage */ - - const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ - - const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ - - const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - @newpage */ - - const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - @newpage */ - - const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* - pSetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ - - const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* - pGetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ - - const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; - /**< Response to the request, - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - @newpage */ - - const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; - /**< Response to the request, - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - @newpage */ - - const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* - pSetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ - - const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* - pGetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ - -}locClientRespIndUnionType; - -/** @} */ /* end_addtogroup send_request */ - -/** @addtogroup data_types -@{ */ - -/** Location event indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the asynchronous event indications. - - @vertspace - @param handle Location client for this event. Only the client who - registered for the corresponding event receives - this callback. - @param eventIndId ID of the event indication. - @param eventIndPayload Event indication payload. - @param pClientCookie Pointer to the cookie the client specified during - registration. -*/ -typedef void (*locClientEventIndCbType)( - locClientHandleType handle, - uint32_t eventIndId, - const locClientEventIndUnionType eventIndPayload, - void *pClientCookie -); - -/** Location response indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the response indications. - - @vertspace - @param handle Location client who sent the request for which this - response indication is generated. - @param respIndId ID of the response. It is the same value as the ID - of request sent to the engine. - @param respIndPayload Payload of the response indication. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @newpage -*/ -typedef void (*locClientRespIndCbType)( - locClientHandleType handle, - uint32_t respIndId, - const locClientRespIndUnionType respIndPayload, - void *pClientCookie -); - -/** Location error callback function type. This function will be - called to inform the client that the service is no longer - available. When the client receives this callback it must - close the existing connection and reopen the client connection. - - - @vertspace - @param handle Location client who sent the request for which this - error indication is generated. - @param errorId Error ID. - @param errorCbdata Payload associated with the error indication. - - @newpage -*/ -typedef void (*locClientErrorCbType)( - locClientHandleType handle, - locClientErrorEnumType errorId, - void* pClientCookie - ); - - -/** Callback functions to be registered during locClientOpen -*/ - -typedef struct -{ - uint32_t size; - /**< Size of the structure */ - locClientEventIndCbType eventIndCb; - /**< Event Indication callback */ - locClientRespIndCbType respIndCb; - /**< Response Indication callback */ - locClientErrorCbType errorCb; - /**< Error Indication callback */ -}locClientCallbacksType; - -/** @} */ /* end_addtogroup data_types */ - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** @addtogroup open_client -@{ */ -/*========================================================================== - locClientOpen */ -/** - @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location - client to the location engine. If the connection is successful, this function - returns a handle that the location client uses for future location operations. - - @datatype - #locClientStatusEnumType\n - #locClientEventMaskType\n - #locClientCallbacksType *\n - #locClientHandleType *\n - #void * - - @vertspace - @param[in] eventRegMask Mask of asynchronous events the client is - interested in receiving. - @param[in] pLocClientCallbacks Pointer to structure containing the - callbacks. - @param[out] pLocClientHandle Pointer to the handle to be used by the - client for any subsequent requests. - @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the - client along with the callbacks. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - @newpage -*/ -extern locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pLocClientCookie -); - -/** @} */ /* end_addtogroup open_client */ - -/** @addtogroup close_client -@{ */ -/*========================================================================== - locClientClose */ -/** - @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client - from the location engine and sets the handle to - LOC_CLIENT_INVALID_HANDLE_VALUE. - - @datatype - #locClientStatusEnumType\n - #locClientHandleType - - @vertspace - @param[in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - @newpage -*/ -extern locClientStatusEnumType locClientClose ( - locClientHandleType* pLocClientHandle -); - -/** @} */ /* end_addtogroup close_client */ - -/** @addtogroup send_request -@{ */ -/*============================================================================= - locClientSendReq */ -/** - @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to - the location engine. If this function is successful, the client expects an - indication (except start, stop, event registration, and sensor injection - messages) through the registered callback in the locClientOpen() function. - - The indication contains the status of the request. If the status is a success, - the indication also contains the payload associated with response. - - @datatype - #locClientStatusEnumType\n - #locClientHandleType\n - #locClientReqUnionType - - @vertspace - @param[in] handle Handle returned by the locClientOpen() function. - @param[in] reqId QMI_LOC service message ID of the request. - @param[in] pReqPayload Payload of the request. This can be NULL if the request - has no payload. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - - @structure - locClientReqUnionType - @newpage -*/ -extern locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload -); - -/** @} */ /* end_addtogroup send_request */ - -/** @addtogroup get_size_event -@{ */ -/*============================================================================= - locClientGetSizeByEventIndId */ -/** - Gets the size of the event indication structure from a specified ID. - - @datatype - #locClientGetSizeByEventIndId - - @vertspace - @param[in] eventIndId Event indicator ID. - @param[out] pEventIndSize Pointer to the size of the structure. - - @return - true -- The event ID was found.\n - false -- Otherwise. - - @dependencies - None. - - @structure - locClientEventIndUnionType - @newpage -*/ -extern bool locClientGetSizeByEventIndId( - uint32_t eventIndId, - size_t *pEventIndSize); - -/** @} */ /* end_addtogroup get_size_event */ - -/** @addtogroup get_size_response -@{ */ -/*============================================================================= - locClientGetSizeByRespIndId */ - -/** - Gets the size of the response indication structure from a specified ID. - - @datatype - #locClientGetSizeByRespIndId - - @vertspace - @param[in] respIndId Response indicator ID. - @param[out] pRespIndSize Pointer to the size of the structure. - - @return - true -- The response ID was found.\n - false -- Otherwise. - - @dependencies - None. - - @structure - locClientRespIndUnionType - @newpage -*/ -extern bool locClientGetSizeByRespIndId( - uint32_t respIndId, - size_t *pRespIndSize); - -/*=============================================================================*/ - -/** @} */ /* end_addtogroup get_size_response */ - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c deleted file mode 100644 index 78792607..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ /dev/null @@ -1,243 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -static loc_name_val_s_type loc_v02_event_name[] = -{ - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_START_REQ_V02), - NAME_VAL(QMI_LOC_START_RESP_V02), - NAME_VAL(QMI_LOC_STOP_REQ_V02), - NAME_VAL(QMI_LOC_STOP_RESP_V02), - NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), -}; -static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_event_name(uint32_t event) -{ - return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); -} - -static loc_name_val_s_type loc_v02_client_status_name[] = -{ - NAME_VAL(eLOC_CLIENT_SUCCESS), - NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), - NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), - NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), - NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), - NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), - NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), -}; -static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_client_status_name(locClientStatusEnumType status) -{ - return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); -} - - -static loc_name_val_s_type loc_v02_qmi_status_name[] = -{ - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, - eQMI_LOC_SUCCESS_V02, - eQMI_LOC_GENERAL_FAILURE_V02, - eQMI_LOC_UNSUPPORTED_V02, - eQMI_LOC_INVALID_PARAMETER_V02, - eQMI_LOC_ENGINE_BUSY_V02, - eQMI_LOC_PHONE_OFFLINE_V02, - eQMI_LOC_TIMEOUT_V02, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 -}; -static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) -{ - return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); -} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h deleted file mode 100644 index c63972f9..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V02_LOG_H -#define LOC_API_V02_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include - -const char* loc_get_v02_event_name(uint32_t event); -const char* loc_get_v02_client_status_name(locClientStatusEnumType status); -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); - - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h deleted file mode 100644 index f1b675e3..00000000 --- a/loc_api/loc_api_v02/loc_util_log.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_UTIL_LOG_H -#define LOC_UTIL_LOG_H - -#ifdef FEATURE_LOC_API_V02_QNX_MOD -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#endif //FEATURE_LOC_API_V02_QNX_MOD - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -#include - -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -// get around strl*: not found in glibc -// TBD:look for presence of eglibc other libraries -// with strlcpy supported. -#define strlcpy(X,Y,Z) strcpy(X,Y) -#define strlcat(X,Y,Z) strcat(X,Y) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#elif defined(_ANDROID_) - -#include - -#endif //LOC_UTIL_TARGET_OFF_TARGET - - -#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c deleted file mode 100644 index 37d93f6f..00000000 --- a/loc_api/loc_api_v02/location_service_v02.c +++ /dev/null @@ -1,2223 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 7, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 8, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 9, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 11, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 11, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 4, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 14, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 14, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 18, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 26, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 0, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 2, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 3, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 4, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 10, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 12, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 13, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 15, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 16, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 17, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 19, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 19, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 4, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 10, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 12, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 13, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 16, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 17, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 20, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 7, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 7, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 22, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 23, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 24, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 25, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 27, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 27, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 28, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 18, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 18, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, - {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} -}; - -/*Service Object*/ -const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x02, - 0x02, - 16, - 2248, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02 -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} - diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h deleted file mode 100644 index 2f288145..00000000 --- a/loc_api/loc_api_v02/location_service_v02.h +++ /dev/null @@ -1,5914 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x04 -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x02 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x005F; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of SUPL CERT. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. \n - - Type: Unsigned integer */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyrometer, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from - the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. - These requests are generated when the service wishes to establish a - connection with a location server. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: \n - - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. - Request a single position fix. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. - High accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. - Intermediate reports are turned off. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; The control point sends this message when it wants to - initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Type: Unsigned integer \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n - - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Type: Unsigned integer \n - - Units: Milliseconds \n - - Default: 1000 ms - */ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; The control point sends this message when it wants to - stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Type: Unsigned integer \n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. - Fix request failed because the engine is locked. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Type: Unsigned integer \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n - - PDOP = square root of (HDOP^2 + VDOP^2) */ - - float HDOP; - /**< Horizontal dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ - - float VDOP; - /**< Vertical dilution of precision.\n - - Type: Floating point. \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors are used. - - Valid bitmasks are specified by the following constants: \n - - 0x00000001 -- SENSOR_USED_ACCEL \n - - 0x00000002 -- SENSOR_USED_GYRO */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results are aided by sensors. - - Valid bitmasks are specified by the following constants: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network - Source of the time is unknown */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed - Location reliability is high; strong cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This message is used to send the position report to the - control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \n - - 0x00000000 -- SESS_STATUS_SUCCESS \n - - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n - - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n - - 0x00000003 -- SESS_STATUS_TIMEOUT \n - - 0x00000004 -- SESS_STATUS_USER_END \n - - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n - - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n - - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Type: Unsigned integer \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). \n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Type: Floating point \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Type: Unsigned integer \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< Speed uncertainty.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Type: Unsigned integer \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH */ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. \n - - Type: Floating point */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \n - - 0x00000001 -- SATELLITE \n - - 0x00000002 -- CELLID \n - - 0x00000004 -- WIFI */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Type: Unsigned integer \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Type: Unsigned integer \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time \n */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Type: Floating point \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \n - - 0x00000000 -- TIME_SRC_INVALID \n - - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n - - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n - - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n - - 0x00000004 -- TIME_SRC_TOW_DECODE \n - - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n - - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n - - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n - - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. - GLONASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. - SV is being tracked. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \n - - 0x00000001 -- VALID_SYSTEM \n - - 0x00000002 -- VALID_GNSS_SVID \n - - 0x00000004 -- VALID_HEALTH_STATUS \n - - 0x00000008 -- VALID_PROCESS_STATUS \n - - 0x00000010 -- VALID_SVINFO_MASK \n - - 0x00000020 -- VALID_ELEVATION \n - - 0x00000040 -- VALID_AZIMUTH \n - - 0x00000080 -- VALID_SNR - - */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - */ - - uint16_t gnssSvId; - /**< GNSS SV ID. \n - - - Type: Unsigned integer \n - - Range: \n - -- For GPS: 1 to 32 \n - -- For SBAS: 33 to 64 \n - -- For GLONASS: 65 to 96 */ - - uint8_t healthStatus; - /**< Health status. \n - - Type: Unsigned integer \n - - Range: 0 = unhealthy; 1 = healthy */ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Type: Floating point \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to send a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Source */ - uint8_t altitudeAssumed; - /**< Altitude assumed or calculated:\n - - 0x00 (FALSE) -- Valid altitude is calculated \n - - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough - satellites to determine precise altitude */ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to send NMEA sentences to the control point. */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 201 */ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. - Notify and Verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. - MS-based preferred, but MS-assisted allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. - Encoding is GSM. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Type: Unsigned integer \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. \n - - Type: Unsigned integer */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Type: Unsigned integer \n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \n - - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n - - 0x00000002 -- NI_VX_MS_BASED_ONLY \n - - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n - - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \n - - 0x00000000 -- NI_VX_OCTET \n - - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n - - 0x00000002 -- NI_VX_ASCII \n - - 0x00000003 -- NI_VX_IA5 \n - - 0x00000004 -- NI_VX_UNICODE \n - - 0x00000005 -- NI_VX_SHIFT_JIS \n - - 0x00000006 -- NI_VX_KOREAN \n - - 0x00000007 -- NI_VX_LATIN_HEBREW \n - - 0x00000008 -- NI_VX_LATIN \n - - 0x00000009 -- NI_VX_GSM - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. - No position. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. - Encoding is GSM default. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity - SUPL unknown format. */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \n - - 0x00000000 -- FORMAT_LOGICAL_NAME \n - - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n - - 0x00000002 -- FORMAT_MSISDN \n - - 0x00000003 -- FORMAT_URL \n - - 0x00000004 -- FORMAT_SIP_URL \n - - 0x00000005 -- FORMAT_MIN \n - - 0x00000006 -- FORMAT_MDN \n - - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n - - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID */ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Type: Unsigned integer \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Type: Unsigned integer \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Type: Unsigned integer \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. \n - - Type: Unsigned integer */ - - uint16_t port; - /**< IPV4 port. \n - - Type: Unsigned integer */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. \n - - Type: Unsigned integer */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \n - - 0x00000001 -- SUPL_SERVER_INFO \n - - 0x00000002 -- SUPL_SESSION_ID \n - - 0x00000004 -- SUPL_HASH \n - - 0x00000008 -- SUPL_POS_METHOD \n - - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n - - 0x00000020 -- SUPL_REQUESTOR_ID \n - - 0x00000040 -- SUPL_CLIENT_NAME \n - - 0x00000080 -- SUPL_QOP \n - - 0x00000100 -- SUPL_USER_RESP_TIMER - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \n - - 0x00000001 -- AGPS_SETASSISTED \n - - 0x00000002 -- AGPS_SETBASED \n - - 0x00000003 -- AGPS_SETASSISTED_PREF \n - - 0x00000004 -- AGPS_SETBASED_PREF \n - - 0x00000005 -- AUTONOMOUS_GPS \n - - 0x00000006 -- AFLT \n - - 0x00000007 -- ECID \n - - 0x00000008 -- EOTD \n - - 0x00000009 -- OTDOA \n - - 0x0000000A -- NO_POSITION - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. - Initial location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \n - - 0x0001 -- INVOKE_ID_MASK \n - - 0x0002 -- DATA_CODING_SCHEME_MASK \n - - 0x0004 -- NOTIFICATION_TEXT_MASK \n - - 0x0008 -- CLIENT_ADDRESS_MASK \n - - 0x0010 -- LOCATION_TYPE_MASK \n - - 0x0020 -- REQUESTOR_ID_MASK \n - - 0x0040 -- CODEWORD_STRING_MASK \n - - 0x0080 -- SERVICE_TYPE_MASK \n - - 0x0100 -- USER_RESP_TIMER_MASK - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. \n - - Type: Unsigned integer */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \n - - 0x00000001 -- CURRENT_LOCATION \n - - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n - - 0x00000004 -- INITIAL_LOCATION - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. \n - - Type: Unsigned integer */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \n - - 0x00000001 -- ONGOING_NI_INCOMING_MO - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). \n - - Type: Unsigned integer */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). \n - - Type: Unsigned integer */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp.\n - - Type: Unsigned integer \n - - Units: Milliseconds since Jan. 1, 1970 */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. - Location engine is off. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. - Location fix session has ended. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Type: Unsigned integer \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. - Stop periodic fixes request. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \n - - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n - - 0x00000001 -- START_PERIODIC_KEEP_WARM \n - - 0x00000002 -- STOP_PERIODIC_FIXES - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \n - - samplesPerBatch must be a non-zero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in integral number of batches per - second (Hz). \n - - batchesPerSecond must be a non-zero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \n - - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n - - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor - data - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. - */ - - /* Optional */ - /* Gyrometer Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor - data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. \n - - Type: Unsigned integer */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream.\n - - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n - - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. - Bring up the WWAN type used for AGNSS connections. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. - Close a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. \n - Valid values: \n - - 0x00000000 -- WWAN_TYPE_INTERNET \n - - 0x00000001 -- WWAN_TYPE_AGNSS - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. - Request failed because it timed out. */ - eQMI_LOC_TIMEOUT_V02 = 6, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. \n - - Type: Unsigned integer */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n - - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. \n - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports - */ - - /* Optional */ - /* Mimimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. - User did not respond to notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \n - - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n - - 0x00000002 -- NOTIFY_VERIFY_DENY \n - - 0x00000003 -- NOTIFY_VERIFY_NORESP - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Type: Unsigned integer \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \n - - 0x00000000 -- PREDICTED_ORBITS_XTRA - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. \n - - Type: Unsigned integer */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Oribits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Type: Unsigned integer \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Type: Unsigned integer \n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. - Other sources. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. - Fully independent. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. - Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \n - - 0x00000000 -- ALT_SRC_UNKNOWN \n - - 0x00000001 -- ALT_SRC_GPS \n - - 0x00000002 -- ALT_SRC_CELL_ID \n - - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n - - 0x00000004 -- ALT_SRC_WIFI \n - - 0x00000005 -- ALT_SRC_TERRESTRIAL \n - - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n - - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n - - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n - - 0x00000009 -- ALT_SRC_OTHER - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \n - - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n - - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n - - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n - - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \n - - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n - - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the - injected horizontal position coordinates only. \n - - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the - position of the device regardless of horizontal position - (within the horizontal uncertainty region, if provided). - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. - Other sources. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0 to 99) \n - - 0 -- invalid value \n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99 \n - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - - Units: Meters; positive = height, negative = depth */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0-99) \n - - 0 -- invalid value\n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99\n - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Type: Unsigned integer \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Type: Signed integer \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from where this position was obtained. - Valid values: \n - - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n - - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n - - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n - - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n - - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n - - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n - - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n - - If altitude is specified and altitude source is not specified, the engine - assumes that altitude was obtained using the specified Position source. - If altitude and altitude source both are specified then the engine assumes - that only latitude, longitude were obtained using the specified Position - Source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. - Lock all position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. - Server type is custom PDE. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. \n - - Type: Unsigned integer \n - - Range: \n - - For GPS: 1 to 32 \n - - For SBAS: 33 to 64 \n - - For GLONASS: 65 to 96 */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. - Valid values: \n - - 0x01 (TRUE) -- All assistance data is to be deleted; - if this flag is set, all the other information - contained in the optional fields for this - message are ignored \n - - 0x00 (FALSE) -- The optional fields in the message are to be used - to determine which data is to be deleted */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assitance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - Valid values: \n - - 0x00000001 -- DELETE_GPS_SVDIR \n - - 0x00000002 -- DELETE_GPS_SVSTEER \n - - 0x00000004 -- DELETE_GPS_TIME\n - - 0x00000008 -- DELETE_GPS_ALM_CORR \n - - 0x00000010 -- DELETE_GLO_SVDIR \n - - 0x00000020 -- DELETE_GLO_SVSTEER \n - - 0x00000040 -- DELETE_GLO_TIME \n - - 0x00000080 -- DELETE_GLO_ALM_CORR \n - - 0x00000100 -- DELETE_SBAS_SVDIR \n - - 0x00000200 -- DELETE_SBAS_SVSTEER \n - - 0x00000400 -- DELETE_POSITION \n - - 0x00000800 -- DELETE_TIME \n - - 0x00001000 -- DELETE_IONO \n - - 0x00002000 -- DELETE_UTC \n - - 0x00004000 -- DELETE_HEALTH \n - - 0x00008000 -- DELETE_SADATA \n - - 0x00010000 -- DELETE_RTI \n - - 0x00020000 -- DELETE_SV_NO_EXIST \n - - 0x00040000 -- DELETE_FREQ_BIAS_EST - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CELLDB_POS \n - - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n - - 0x00000004 -- DELETE_CELLDB_OTA_POS \n - - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n - - 0x00000010 -- DELETE_CELLDB_TIMETAG \n - - 0x00000020 -- DELETE_CELLDB_CELLID \n - - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n - - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n - - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n - - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n - - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n - - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n - - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n - - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n - - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n - - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n - - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n - - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n - - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n - - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. \n - - Type: Unsigned integer */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. - WiFi fix failed, but the cause could not be determined. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Type: Unsigned integer \n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. \n - - Type: Unsigned integer */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \n - - 0x00000000 -- ERROR_SUCCESS \n - - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n - - 0x00000002 -- ERROR_NO_AP_FOUND \n - - 0x00000003 -- ERROR_UNAUTHORIZED \n - - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n - - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n - - 0x00000006 -- ERROR_UNKNOWN - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Type: Signed integer \n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. \n - - Type: Unsigned integer */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. \n - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. - WiFi is not available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \n - - 0x00000001 -- WIFI_STATUS_AVAILABLE \n - - 0x00000002 -- WIFI_STATUS_UNAVAILABLE - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - - Valid bitmasks: \n - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. - Use cell ID. For 1x, this mode corresponds to - AFLT. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Whether the device is stationary:\n - - 0x00 (FALSE) -- Device is not stationary \n - - 0x01 (TRUE) -- Device is stationary */ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the sensor time of the first sample.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit time tag of the first (oldest) sample in this - message. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \n - - 0x01 -- SIGN REVERSAL - */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. \n - - Type: Unsigned integer */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyrometer Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyrometer sensor samples. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. \n - - Type: Unsigned integer */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< This field lets the client know how many 3-axis accelerometer samples - were accepted. */ - - /* Optional */ - /* Gyrometer Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< This field lets the client know how many 3-axis gyrometer samples were - accepted. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< The value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< The value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle - Unknown cradle mount state */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. - Unknown external power state. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. - PPP PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the Access Point Name (APN) profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 101 - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. - Location server request failed. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n APN profile information is present only when requestType - is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. - V2 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. - SUPL version 2.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< This field is sent only if the status is not a success. And if it is - not successful, this field will identify the parameters that were not - set successfully. - - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - - Inertial sensors are not to be used to aid heading and position - improvement. */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in heading and - position improvement. - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in the heading and - position improvement. - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: radians^2/second^4 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPropertiesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Gyro Bias Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: radians^2/seconds^4 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors - Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time the GNSS - location engine turns on. - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal - number of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ - - /* Optional */ - /* Gyrometer Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< This field is sent only if the status is not a success. - When sent, this field identifies which configuration failed. \n - Valid bitmasks: \n - - 0x0000000000000001 -- PERFORMANCE_MODE \n - - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n - - 0x0000000000000004 -- GYRO_SAMPLING_SPEC - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time the GNSS - location engine turns on. - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ - - /* Optional */ - /* Gyrometer Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Id */ - uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate - Type: Unsigned Integer - Units: Bytes - Range: 0-9 */ - - /* Mandatory */ - /* SUPL certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< The supl Certificate contents - Type: Array of bytes. - - Maximum certificate size : 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* Supl Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the inject SUPL certificate request. \n - - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Delete a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate Id */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate to be deleted - Type: Unsigned Integer \n - Units: Bytes \n - Range: 0-9 \n - If suplCertId is not specified then - "all" supl certificates will be deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Delete a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL certifcate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the delete SUPL certificate request. \n - - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the - injected position in direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data - in the persistent memory. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position will be used in position engine.\n - Valid values: \n - - 0x01 (TRUE) -- Use the injected position in direct position - calculation. \n - - 0x00 (FALSE) -- Do not use the injected position in direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls if SV usage will be filtered in a position fix. - Valid values:\n - - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n - - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data should be stored in - the persistent memory. \n - Valid values:\n - - 0x01 (TRUE) -- Store assistance data in persistent memory. \n - - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. - */ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies if the injected position is used for direct calculation - in the position engine.\n - Valid values: \n - - 0x01 (TRUE) -- The injected position is used in direct position - calculation. \n - - 0x00 (FALSE) -- The injected position is not used direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies if SV usage is filtered in a position fix. - Valid values: \n - - 0x01 (TRUE) -- SV usage is filtered in the fix. \n - - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies if assistance data is stored in the persistent memory. \n - Valid values: \n - 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n - 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. - */ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h deleted file mode 100644 index 6321bb9c..00000000 --- a/loc_api/ulp/inc/ulp.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H -#define ULP_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -typedef int (ulp_report_position_cb) -( - void* owner, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data -); - -/** Represents the standard ulp module interface. */ -typedef struct { - /** set to sizeof(ulpInterface) */ - size_t size; - - /** - * Starts the ulp module. 0: success - */ - int (*init)( void* owner, ulp_report_position_cb* cb); - - /** Starts the ulp engine. 0: success */ - int (*start_fix)( void ); - - /** Stops the ulp engine. 0: success */ - int (*stop_fix)( void ); - - /** Closes the interface */ - int (*destroy)( void ); - -} ulpInterface; - -typedef const ulpInterface* (get_ulp_interface) (void); - - -#ifdef __cplusplus -} -#endif -#endif /* ULP_H */ - From 356036e9f623193463d5de352f52b4592fcc01aa Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sat, 19 Jan 2013 18:58:05 -0800 Subject: [PATCH 088/945] copy back supl es data to sm SUPL ES added additional optional fields in the NI indiation. We need to copy back these info as then came when we send back the notification to modem. This change is to add that. CRs-Fixed: 443946 Change-Id: Ib4a99441a03b2cb41b66d4c97253acbf118e4f05 --- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index a3eb23f5..adde61d4 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -804,6 +804,24 @@ enum loc_api_adapter_err LocApiV02Adapter :: sizeof(qmiLocNiVxServiceInteractionStructT_v02)); } + // copy Network Initiated SUPL Version 2 Extension + if (request_pass_back->NiSuplVer2ExtInd_valid == 1) + { + ni_resp.NiSuplVer2ExtPayload_valid = 1; + memcpy(&(ni_resp.NiSuplVer2ExtPayload), + &(request_pass_back->NiSuplVer2ExtInd), + sizeof(qmiLocNiSuplVer2ExtStructT_v02)); + } + + // copy SUPL Emergency Notification + if(request_pass_back->suplEmergencyNotification_valid) + { + ni_resp.suplEmergencyNotification_valid = 1; + memcpy(&(ni_resp.suplEmergencyNotification), + &(request_pass_back->suplEmergencyNotification), + sizeof(qmiLocEmergencyNotificationStructT_v02)); + } + req_union.pNiUserRespReq = &ni_resp; status = loc_sync_send_req ( From 842b4c3e686cb90cc9b3a446009391293b9419ca Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 28 Feb 2013 16:34:07 -0800 Subject: [PATCH 089/945] Change data type of HEPE to float This is to accomodate values of accuracy that exceed 65535 CRs-fixed: 449184 Change-Id: Icc89c4bbb6975027083fd906bdc2d0ca40060431 --- loc_api/libloc_api_50001/loc_eng_msg.h | 2 +- loc_api/libloc_api_50001/loc_ulp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index bd86defb..37eeec9e 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -914,7 +914,7 @@ struct ulp_msg_inject_network_position : public loc_eng_msg { loc_eng_msg(instance, ULP_MSG_INJECT_NETWORK_POSITION), networkPosition(networkPos) { - LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n accuracy %d", + LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n accuracy %f", networkPosition.valid_flag, networkPosition.position.pos_source, networkPosition.position.latitude, diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h index 75636993..790267c8 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -264,7 +264,7 @@ typedef struct { /** longitude in degrees */ double longitude; /** Horzizontal error estimate in meters */ - uint16_t HEPE; + float HEPE; } UlpNetworkPosition; /** Represents access point information */ From 5049a4779793ac7c8eeed87114805fd63bf16ac9 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 8 Nov 2012 11:41:43 -0800 Subject: [PATCH 090/945] Utility to identify target HW Earlier this identification was done in loc.cpp This change moves that to a separate utility. Also included is a change to not return a handle to the GPS interface if the target is found to be MPQ8064. This change is a re-cherry-pick from change id - I98d5619d2e6e63711a9b56f0af2b3ddd27372871 Change-Id: I058d206c37245b44f1cf74d6065e7ce46f50baf7 CRs-Fixed: 418009 --- loc_api/libloc_api_50001/loc.cpp | 81 +++++------------------ utils/Android.mk | 6 +- utils/loc_log.cpp | 30 ++++++++- utils/loc_log.h | 2 + utils/loc_target.cpp | 109 +++++++++++++++++++++++++++++++ utils/loc_target.h | 51 +++++++++++++++ 6 files changed, 210 insertions(+), 69 deletions(-) create mode 100644 utils/loc_target.cpp create mode 100644 utils/loc_target.h diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 6592cc5a..fc6a2168 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -33,10 +33,10 @@ #include #include #include +#include #include #include #include - #include #include #include @@ -190,65 +190,6 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = static loc_eng_data_s_type loc_afw_data; static int gss_fd = 0; -#define TARGET_NAME_OTHER 0 -#define TARGET_NAME_APQ8064_STANDALONE 1 -#define TARGET_NAME_APQ8064_FUSION3 2 - -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; -} - -#define LINE_LEN 100 -#define STR_LIQUID "Liquid" -#define STR_SURF "Surf" -#define STRLEN_LIQUID (sizeof(STR_LIQUID) - 1) -#define STRLEN_SURF (sizeof(STR_SURF) - 1) -#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') - -static int get_target_name(void) -{ - int target_name = TARGET_NAME_OTHER; - - char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; // "Liquid" or "Surf" - char id[] = "/sys/devices/system/soc/soc0/id"; //109 - char mdm[] = "/dev/mdm"; // No such file or directory - - char line[LINE_LEN]; - - read_a_line( hw_platform, line, LINE_LEN); - if(( !memcmp(line, STR_LIQUID, STRLEN_LIQUID) && IS_STR_END(line[STRLEN_LIQUID]) ) || - ( !memcmp(line, STR_SURF, STRLEN_SURF) && IS_STR_END(line[STRLEN_SURF]) ) - ) { - if (!read_a_line( mdm, line, LINE_LEN)) { - target_name = TARGET_NAME_APQ8064_FUSION3; - } else { - read_a_line( id, line, LINE_LEN); - if(!strncmp(line, "109", strlen("109")) || !strncmp(line, "153", strlen("153"))) { - target_name = TARGET_NAME_APQ8064_STANDALONE; - } - } - } - return target_name; -} - /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -290,6 +231,7 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { + targetEnumType target = TARGET_OTHER; loc_eng_read_config(); //We load up libulp module at this point itself if ULP configured to be On @@ -297,16 +239,23 @@ extern "C" const GpsInterface* get_gps_interface() loc_eng_ulp_inf = loc_eng_get_ulp_inf(); } - if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) - { + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + //APQ8064 + if(target == TARGET_APQ8064_STANDALONE) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); - if (gss_fd < 0) { + 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); } - LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); } - + //MPQ8064 + else if(target == TARGET_MPQ8064) { + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; + } return &sLocEngInterface; } @@ -410,7 +359,7 @@ static void loc_cleanup() gps_sv_cb = NULL; /* - * if (get_target_name() == TARGET_NAME_APQ8064_STANDALONE) + * if (get_target() == TARGET_NAME_APQ8064_STANDALONE) * { * close(gss_fd); * LOC_LOGD("GSS shutdown.\n"); diff --git a/utils/Android.mk b/utils/Android.mk index 4bf04014..7dc1799e 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -15,7 +15,8 @@ LOCAL_SRC_FILES += \ loc_log.cpp \ loc_cfg.cpp \ msg_q.c \ - linked_list.c + linked_list.c \ + loc_target.cpp LOCAL_CFLAGS += \ -fno-short-enums \ @@ -32,7 +33,8 @@ LOCAL_COPY_HEADERS:= \ loc_cfg.h \ log_util.h \ linked_list.h \ - msg_q.h + msg_q.h \ + loc_target.h LOCAL_MODULE := libgps.utils diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 8b064ec2..f39667ca 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -34,7 +34,6 @@ #include #include "loc_log.h" #include "msg_q.h" - #include "log_util.h" // Logging Improvements @@ -100,6 +99,35 @@ const char* log_succ_fail_string(int is_succ) return is_succ? "successful" : "failed"; } +//Target names +loc_name_val_s_type target_name[] = +{ + NAME_VAL(TARGET_OTHER), + NAME_VAL(TARGET_APQ8064_STANDALONE), + NAME_VAL(TARGET_APQ8064_FUSION3), + NAME_VAL(TARGET_MPQ8064), + NAME_VAL(TARGET_MSM8930) +}; + +static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); + +/*=========================================================================== + +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(targetEnumType target) +{ + return loc_get_name_from_val(target_name, target_name_num, (long)target); +} /*=========================================================================== diff --git a/utils/loc_log.h b/utils/loc_log.h index 63236de2..abe29b77 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -36,6 +36,7 @@ extern "C" #endif #include +#include "loc_target.h" typedef struct { @@ -54,6 +55,7 @@ typedef struct const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); const char* loc_get_msg_q_status(int status); +const char* loc_get_target_name(targetEnumType target); extern const char* log_succ_fail_string(int is_succ); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp new file mode 100644 index 00000000..10b508ce --- /dev/null +++ b/utils/loc_target.cpp @@ -0,0 +1,109 @@ +/* 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "loc_target.h" +#include "loc_log.h" +#include "log_util.h" + +#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 LINE_LEN 100 +#define STR_LIQUID "Liquid" +#define STR_SURF "Surf" +#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 + +static int gss_fd = 0; + +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; +} + +targetEnumType get_target(void) +{ + targetEnumType target = TARGET_OTHER; + + char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; + char id[] = "/sys/devices/system/soc/soc0/id"; + 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]; + + read_a_line(hw_platform, rd_hw_platform, LINE_LEN); + read_a_line( id, rd_id, LINE_LEN); + + 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)])) ) { + if (!read_a_line( mdm, rd_mdm, LINE_LEN)) + target = TARGET_APQ8064_FUSION3; + else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || + (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) + target = TARGET_APQ8064_STANDALONE; + } + else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) + target = TARGET_MPQ8064; + 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)])) ) + target = TARGET_MSM8930; + return target; +} diff --git a/utils/loc_target.h b/utils/loc_target.h new file mode 100644 index 00000000..489aaddf --- /dev/null +++ b/utils/loc_target.h @@ -0,0 +1,51 @@ +/* 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_TARGET_H +#define LOC_TARGET_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef enum { + TARGET_OTHER = 0, + TARGET_APQ8064_STANDALONE, + TARGET_APQ8064_FUSION3, + TARGET_MPQ8064, + TARGET_MSM8930 +}targetEnumType; + +targetEnumType get_target(void); + +#ifdef __cplusplus +} +#endif + +#endif /*LOC_TARGET_H*/ From d2873a0bafad8099d16c69711b626b79c89354bb Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 24 Jan 2013 17:41:46 -0800 Subject: [PATCH 091/945] Split gps configuration file (change 1/2) gps.conf now split into izat.conf: proprietary items sap.conf : sensor assisted positioning items gps.conf : items used in open source (gps.conf moved to open source) CRs-fixed: 461129 Change-Id: I819230ee3bb13aad0b91f7d33bfb9e57b6d1abe1 --- etc/gps.conf | 66 ++++-------- loc_api/libloc_api_50001/loc_eng.cpp | 146 ++++++++++++++------------- loc_api/libloc_api_50001/loc_eng.h | 65 ++++++------ utils/loc_cfg.cpp | 36 +------ utils/loc_cfg.h | 7 +- 5 files changed, 139 insertions(+), 181 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 322fe162..b38526a2 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,3 +1,12 @@ +XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin + +# Error Estimate +# _SET = 1 +# _CLEAR = 0 +ERR_ESTIMATE=0 + #Test NTP_SERVER=time.gpsonextra.net #Asia @@ -7,13 +16,9 @@ NTP_SERVER=time.gpsonextra.net #North America # NTP_SERVER=north-america.pool.ntp.org -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin - # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose -DEBUG_LEVEL = 2 +DEBUG_LEVEL = 3 # Intermediate position report, 1=enable, 0=disable INTERMEDIATE_POS=0 @@ -21,15 +26,11 @@ INTERMEDIATE_POS=0 # supl version 1.0 SUPL_VER=0x10000 -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - # GPS Capabilities bit mask # SCHEDULING = 1 # MSB = 2 # MSA = 4 +# ON_DEMAND_TIME = 0x10 # ULP = 0x20 # default = MSA | MSB | SCHEDULING | ULP CAPABILITIES=0x27 @@ -50,42 +51,17 @@ CAPABILITIES=0x27 # C2K_HOST=c2k.pde.com or IP # C2K_PORT=1234 -################################ -# Sensor Settings -################################ - -# Needs to be set explicitly based on sensor -# There is no default value. -#GYRO_BIAS_RANDOM_WALK= - -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 Control Mode (0=AUTO, 1=FORCE_ON) -SENSOR_CONTROL_MODE=0 - -# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) -SENSOR_USAGE=0 - -# Choose GSIFF sensor provider (1=DSPS, 2=Android NDK) -SENSOR_PROVIDER=1 - -################################ -# Indoor Positioning Settings -################################ -# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only -QUIPC_ENABLED = 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 = 0 ################################ # EXTRA SETTINGS ################################ -# Enable or Disable Wiper (1=Enable, 0=Disable) -ENABLE_WIPER=1 - -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) 1: Enable LPP_User_Plane on LTE -LPP_PROFILE = 0 +# NMEA provider (1=Modem Processor, 0=Application Processor) +NMEA_PROVIDER=0 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index caa01ec2..09e9c4c3 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -67,6 +67,14 @@ #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 + static void loc_eng_deferred_action_thread(void* context); static void* loc_eng_create_msg_q(); static void loc_eng_free_msg(void* msg); @@ -74,9 +82,10 @@ static void loc_eng_free_msg(void* msg); pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; LocEngContext* LocEngContext::me = NULL; -boolean gpsConfigAlreadyRead = false; +boolean configAlreadyRead = false; loc_gps_cfg_s_type gps_conf; +loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ static loc_param_s_type loc_parameter_table[] = @@ -87,22 +96,22 @@ static loc_param_s_type loc_parameter_table[] = {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, - {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, &gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, - {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, - {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, - {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, NULL, 'n'}, - {"SENSOR_ALGORITHM_CONFIG_MASK", &gps_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, + {"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'}, {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, @@ -118,31 +127,31 @@ static void loc_default_parameters(void) gps_conf.SUPL_VER = 0x10000; gps_conf.CAPABILITIES = 0x7; - gps_conf.GYRO_BIAS_RANDOM_WALK = 0; - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; - gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - gps_conf.SENSOR_USAGE = 0; /* Enabled */ - gps_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/ + 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 */ - gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; - gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + 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; - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; - gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 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; /* LTE Positioning Profile configuration is disable by default*/ gps_conf.LPP_PROFILE = 0; @@ -371,7 +380,7 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) lpp_msg, loc_eng_free_msg); loc_eng_msg_sensor_control_config *sensor_control_config_msg( - new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); + new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_control_config_msg, loc_eng_free_msg); @@ -381,40 +390,40 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) a_glonass_protocol_msg, loc_eng_free_msg); /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ - if( gps_conf.GYRO_BIAS_RANDOM_WALK_VALID || - gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) + 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 ) { loc_eng_msg_sensor_properties *sensor_properties_msg( new loc_eng_msg_sensor_properties(&loc_eng_data, - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, - gps_conf.GYRO_BIAS_RANDOM_WALK, - gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); + 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)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_properties_msg, loc_eng_free_msg); } loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, - gps_conf.SENSOR_CONTROL_MODE, - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - gps_conf.SENSOR_ALGORITHM_CONFIG_MASK)); + 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)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_perf_control_conf_msg, loc_eng_free_msg); } @@ -2228,14 +2237,15 @@ SIDE EFFECTS int loc_eng_read_config(void) { ENTRY_LOG_CALLFLOW(); - if(gpsConfigAlreadyRead == false) + if(configAlreadyRead == false) { // Initialize our defaults before reading of configuration file overwrites them. loc_default_parameters(); - // Ee only want to parse the conf file once. This is a good place to ensure that. + // 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, loc_parameter_table); - gpsConfigAlreadyRead = true; + UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table); + configAlreadyRead = true; } else { LOC_LOGV("GPS Config file has already been read\n"); } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 36da419c..e5cb7146 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -160,39 +160,44 @@ typedef struct /* GPS.conf support */ typedef struct loc_gps_cfg_s { - unsigned long INTERMEDIATE_POS; - unsigned long ACCURACY_THRES; - unsigned long ENABLE_WIPER; - uint8_t NMEA_PROVIDER; - unsigned long SUPL_VER; - unsigned long CAPABILITIES; - uint8_t GYRO_BIAS_RANDOM_WALK_VALID; - double GYRO_BIAS_RANDOM_WALK; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_CONTROL_MODE; - unsigned long SENSOR_USAGE; - unsigned long QUIPC_ENABLED; - unsigned long LPP_PROFILE; - unsigned long SENSOR_ALGORITHM_CONFIG_MASK; - unsigned long A_GLONASS_POS_PROTOCOL_SELECT; - 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; + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long ENABLE_WIPER; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + unsigned long QUIPC_ENABLED; + unsigned long LPP_PROFILE; + uint8_t NMEA_PROVIDER; + unsigned long A_GLONASS_POS_PROTOCOL_SELECT; } loc_gps_cfg_s_type; +typedef struct +{ + uint8_t GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + unsigned long 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; +} loc_sap_cfg_s_type; + extern loc_gps_cfg_s_type gps_conf; +extern loc_sap_cfg_s_type sap_conf; int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 1dd4ef22..e4a47722 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -56,35 +56,8 @@ static loc_param_s_type loc_parameter_table[] = {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; - int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); -/*=========================================================================== -FUNCTION loc_default_parameters - -DESCRIPTION - Resets the parameters to default - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ - -static void loc_default_parameters() -{ - /* defaults */ - DEBUG_LEVEL = 3; /* debug level */ - TIMESTAMP = 0; - - /* reset logging mechanism */ - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); -} - /*=========================================================================== FUNCTION trim_space @@ -246,15 +219,14 @@ void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, u loc_param_v_type config_value; uint32_t i; - loc_default_parameters(); - if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) { - LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE); + LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); } else { - LOC_LOGW("%s: no %s file found", __FUNCTION__, GPS_CONF_FILE); + LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); return; /* no parameter file */ } diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index d9a96f2e..df833389 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -36,11 +36,6 @@ #define LOC_MAX_PARAM_STRING 80 #define LOC_MAX_PARAM_LINE 80 -// Don't want to overwrite the pre-def'ed value -#ifndef GPS_CONF_FILE -#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent -#endif - #define UTIL_READ_CONF_DEFAULT(filename) \ loc_read_conf((filename), NULL, 0); From 50dd50cbb479aaef62cf359a1e4aeb0efc5ca2f2 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 7 Mar 2013 12:34:57 -0800 Subject: [PATCH 092/945] Read debug level from gps.conf In order to control the logging levels of location Hal irrespective of the process calling it, a call to read debug level from gps.conf is added CRs-fixed: 461436 Change-Id: Id54083df36e3ee266c79c7b5178993dd5f3bdb78 --- loc_api/loc_api_v02/loc_api_sync_req.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c index fafdbe9a..6a086667 100644 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -33,7 +33,7 @@ #include #include #include - +#include #include "loc_api_v02_client.h" #include "loc_api_sync_req.h" @@ -47,7 +47,7 @@ #include "loc_util_log.h" #define LOC_SYNC_REQ_BUFFER_SIZE 8 - +#define GPS_CONF_FILE "/etc/gps.conf" pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; static bool loc_sync_call_initialized = false; @@ -102,6 +102,7 @@ SIDE EFFECTS void loc_sync_req_init() { LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE); pthread_mutex_lock(&loc_sync_call_mutex); if(true == loc_sync_call_initialized) { From fc5de6cc54e6b62059663b929bbbc32559757539 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 20 Mar 2013 17:03:19 -0700 Subject: [PATCH 093/945] Add support for msm8226 Needed for gps binaries to build for msm8226 Change-Id: I3228dcee00de4ad61c542eeadeec6d44089c53d9 --- loc_api/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index ec271e24..796ea169 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -21,6 +21,7 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE), true) #add QMI libraries for QMI targets QMI_BOARD_PLATFORM_LIST := msm8960 QMI_BOARD_PLATFORM_LIST += msm8974 +QMI_BOARD_PLATFORM_LIST += msm8226 endif ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) From a739e07644999a9a198c624fd6e3b1f51c651e40 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 25 Mar 2013 12:49:54 -0700 Subject: [PATCH 094/945] Include gps.conf Android make file in build The Android.mk for gps.conf was ineffective since it was commented out. This change corrects that. Change-Id: If07df6a2a1694b442a741382206261b5087a0105 --- etc/Android.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/Android.mk b/etc/Android.mk index 26a39dbd..96dc5d78 100755 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,11 +1,11 @@ -#LOCAL_PATH := $(call my-dir) -#include $(CLEAR_VARS) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) -#LOCAL_MODULE := gps.conf -#LOCAL_MODULE_TAGS := optional -#LOCAL_MODULE_CLASS := ETC -#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ -#LOCAL_SRC_FILES := gps.conf -#include $(BUILD_PREBUILT) +LOCAL_MODULE := gps.conf +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ +LOCAL_SRC_FILES := gps.conf +include $(BUILD_PREBUILT) From 34ee09551764b045fdc02df754157473125edf60 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 25 Mar 2013 17:09:10 -0700 Subject: [PATCH 095/945] Revert "remove loc_api from hardware/qcom/gps" This reverts commit 0d257cc5d371b6619978326badbd29acea999725. Change-Id: I80c00022b5ab562ade9a9c8ca5abd0087d897c9e --- CleanSpec.mk | 6 - loc_api/Android.mk | 37 + loc_api/NOTICE | 13 + loc_api/libloc_api-rpc-50001/Android.mk | 3 + .../libloc_api-rpc-glue/Android.mk | 59 + .../rpc_inc/LocApiRpcAdapter.h | 102 + .../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 + .../src/LocApiRpcAdapter.cpp | 1220 ++++ .../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 | 621 ++ .../src/loc_api_sync_call.c | 510 ++ .../src/loc_apicb_appinit.c | 86 + .../libloc_api-rpc-stub/Android.mk | 35 + .../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 +++ loc_api/libloc_api-rpc/Android.mk | 60 + loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 + loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 + .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 + .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 + .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 + .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 + .../gen-1240/loc_api_common.xdr | 906 +++ .../gen-1240/loc_api_common_xdr.c | 1650 +++++ .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 + .../gen-1240/loc_api_rpc_glue.c | 339 + loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 + loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 + loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 + .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 + .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 + .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 + .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 + .../gen-3200/loc_api_common.xdr | 803 +++ .../gen-3200/loc_api_common_xdr.c | 1441 ++++ .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 + .../gen-3200/loc_api_rpc_glue.c | 339 + loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 + loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 + loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 + .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ++++ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 + .../inc-1240/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 + loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 + .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 +++ .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 + .../inc-3200/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/inc/debug.h | 57 + loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 + .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 + loc_api/libloc_api/Android.mk | 39 + loc_api/libloc_api/gps.c | 68 + loc_api/libloc_api/loc_eng.cpp | 1533 +++++ loc_api/libloc_api/loc_eng.h | 115 + loc_api/libloc_api/loc_eng_ioctl.cpp | 354 + loc_api/libloc_api/loc_eng_ioctl.h | 69 + loc_api/libloc_api/loc_eng_ni.cpp | 609 ++ loc_api/libloc_api/loc_eng_ni.h | 56 + loc_api/libloc_api/loc_eng_xtra.cpp | 180 + loc_api/libloc_api/loc_eng_xtra.h | 45 + loc_api/libloc_api_50001/Android.mk | 125 + loc_api/libloc_api_50001/LocApiAdapter.cpp | 226 + loc_api/libloc_api_50001/LocApiAdapter.h | 208 + loc_api/libloc_api_50001/gps.c | 68 + loc_api/libloc_api_50001/loc.cpp | 870 +++ loc_api/libloc_api_50001/loc.h | 86 + loc_api/libloc_api_50001/loc_eng.cpp | 1831 +++++ loc_api/libloc_api_50001/loc_eng.h | 204 + loc_api/libloc_api_50001/loc_eng_agps.cpp | 702 ++ loc_api/libloc_api_50001/loc_eng_agps.h | 274 + loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 180 + loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 53 + .../loc_eng_dmn_conn_glue_msg.c | 223 + .../loc_eng_dmn_conn_glue_msg.h | 51 + .../loc_eng_dmn_conn_glue_pipe.c | 206 + .../loc_eng_dmn_conn_glue_pipe.h | 50 + .../loc_eng_dmn_conn_handler.cpp | 78 + .../loc_eng_dmn_conn_handler.h | 82 + .../loc_eng_dmn_conn_thread_helper.c | 398 ++ .../loc_eng_dmn_conn_thread_helper.h | 74 + loc_api/libloc_api_50001/loc_eng_log.cpp | 292 + loc_api/libloc_api_50001/loc_eng_log.h | 62 + loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 + loc_api/libloc_api_50001/loc_eng_msg.h | 584 ++ loc_api/libloc_api_50001/loc_eng_msg_id.h | 90 + loc_api/libloc_api_50001/loc_eng_ni.cpp | 313 + loc_api/libloc_api_50001/loc_eng_ni.h | 50 + loc_api/libloc_api_50001/loc_eng_xtra.cpp | 90 + loc_api/libloc_api_50001/loc_eng_xtra.h | 46 + loc_api/loc_api_v02/Android.mk | 43 + loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2059 ++++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 197 + loc_api/loc_api_v02/loc_api_sync_req.c | 548 ++ loc_api/loc_api_v02/loc_api_sync_req.h | 68 + loc_api/loc_api_v02/loc_api_v02_client.c | 1923 ++++++ loc_api/loc_api_v02/loc_api_v02_client.h | 1255 ++++ loc_api/loc_api_v02/loc_api_v02_log.c | 243 + loc_api/loc_api_v02/loc_api_v02_log.h | 50 + loc_api/loc_api_v02/loc_util_log.h | 81 + loc_api/loc_api_v02/location_service_v02.c | 2223 +++++++ loc_api/loc_api_v02/location_service_v02.h | 5914 +++++++++++++++++ loc_api/ulp/inc/ulp.h | 76 + 120 files changed, 45182 insertions(+), 6 deletions(-) create mode 100755 loc_api/Android.mk create mode 100755 loc_api/NOTICE create mode 100755 loc_api/libloc_api-rpc-50001/Android.mk create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr create mode 100755 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr create mode 100755 loc_api/libloc_api-rpc/Android.mk create mode 100755 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr create mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c create mode 100755 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c create mode 100755 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr create mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr create mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c create mode 100755 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc/inc/debug.h create mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h create mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c create mode 100755 loc_api/libloc_api/Android.mk create mode 100644 loc_api/libloc_api/gps.c create mode 100644 loc_api/libloc_api/loc_eng.cpp create mode 100644 loc_api/libloc_api/loc_eng.h create mode 100644 loc_api/libloc_api/loc_eng_ioctl.cpp create mode 100644 loc_api/libloc_api/loc_eng_ioctl.h create mode 100644 loc_api/libloc_api/loc_eng_ni.cpp create mode 100644 loc_api/libloc_api/loc_eng_ni.h create mode 100644 loc_api/libloc_api/loc_eng_xtra.cpp create mode 100644 loc_api/libloc_api/loc_eng_xtra.h create mode 100755 loc_api/libloc_api_50001/Android.mk create mode 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp create mode 100644 loc_api/libloc_api_50001/LocApiAdapter.h create mode 100644 loc_api/libloc_api_50001/gps.c create mode 100644 loc_api/libloc_api_50001/loc.cpp create mode 100644 loc_api/libloc_api_50001/loc.h create mode 100644 loc_api/libloc_api_50001/loc_eng.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng.h create mode 100644 loc_api/libloc_api_50001/loc_eng_agps.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_agps.h create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.h create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c create mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h create mode 100644 loc_api/libloc_api_50001/loc_eng_log.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_log.h create mode 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_msg.h create mode 100644 loc_api/libloc_api_50001/loc_eng_msg_id.h create mode 100644 loc_api/libloc_api_50001/loc_eng_ni.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_ni.h create mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.h create mode 100755 loc_api/loc_api_v02/Android.mk create mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp create mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h create mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c create mode 100644 loc_api/loc_api_v02/loc_api_sync_req.h create mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c create mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h create mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c create mode 100644 loc_api/loc_api_v02/loc_api_v02_log.h create mode 100644 loc_api/loc_api_v02/loc_util_log.h create mode 100644 loc_api/loc_api_v02/location_service_v02.c create mode 100644 loc_api/loc_api_v02/location_service_v02.h create mode 100644 loc_api/ulp/inc/ulp.h diff --git a/CleanSpec.mk b/CleanSpec.mk index 140d0d77..dd1849db 100755 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -48,9 +48,3 @@ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) - -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc* \ - $(PRODUCT_OUT)/symbols/system/lib/libloc* \ - $(PRODUCT_OUT)/system/lib/libloc* \ - $(PRODUCT_OUT)/obj/lib/libloc* \ - $(PRODUCT_OUT)/obj/include/libloc_eng) diff --git a/loc_api/Android.mk b/loc_api/Android.mk new file mode 100755 index 00000000..d2f53c58 --- /dev/null +++ b/loc_api/Android.mk @@ -0,0 +1,37 @@ +# Copyright (c) 2009, QUALCOMM USA, INC. +# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) + +LOCAL_PATH := $(call my-dir) + +GPS_DIR_LIST := + +ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) + +# add RPC dirs if RPC is available +ifneq ($(TARGET_NO_RPC),true) + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ + +else + +GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ + +endif #TARGET_NO_RPC + +endif + +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ + +#call the subfolders +include $(addsuffix Android.mk, $(GPS_DIR_LIST)) + +endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/loc_api/NOTICE b/loc_api/NOTICE new file mode 100755 index 00000000..85b5740d --- /dev/null +++ b/loc_api/NOTICE @@ -0,0 +1,13 @@ +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk new file mode 100755 index 00000000..6c5d5339 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/Android.mk @@ -0,0 +1,3 @@ +ifeq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) +include $(call all-subdir-makefiles) +endif diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk new file mode 100755 index 00000000..1287c69e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -0,0 +1,59 @@ +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/LocApiRpcAdapter.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_adapter + +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)/loc_api/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ + $(TARGET_OUT_HEADERS)/librpc \ + $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + 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 + +LOCAL_MODULE:= libloc_api-rpc-qc + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h new file mode 100644 index 00000000..7b1f59ba --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -0,0 +1,102 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ADAPTER_H +#define LOC_API_RPC_ADAPTER_H + +#include +#include +#include + + +class LocApiRpcAdapter : public LocApiAdapter { + // RPC communication establishment + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type eMask; + + static const rpc_loc_event_mask_type locBits[]; + static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + static enum loc_api_adapter_err convertErr(int rpcErr); + + 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); + int NIEventFillVerfiyType(GpsNiNotification ¬if, + rpc_loc_ni_notify_verify_e_type notif_priv); + GpsNiEncodingType convertNiEncodingType(int loc_encoding); + +public: + LocApiRpcAdapter(LocEng &locEng); + ~LocApiRpcAdapter(); + + 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 + reinit(); + virtual enum loc_api_adapter_err + startFix(); + virtual enum loc_api_adapter_err + stopFix(); + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + virtual enum loc_api_adapter_err + enableData(int enable); + 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); + virtual enum loc_api_adapter_err + setAPN(char* apn, int len); + 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 + 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); +}; + +#endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h new file mode 100644 index 00000000..8b20a3f5 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h new file mode 100644 index 00000000..9bfe5f0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h @@ -0,0 +1,226 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h new file mode 100644 index 00000000..c0bcda16 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h @@ -0,0 +1,59 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h new file mode 100644 index 00000000..16552a0c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -0,0 +1,123 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "rpc_inc/loc_api_fixup.h" +#include "rpc_inc/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h new file mode 100644 index 00000000..266f8ec8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h new file mode 100644 index 00000000..8dbcb9ac --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp new file mode 100644 index 00000000..ec98bed2 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -0,0 +1,1220 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include +#include +#include "LocApiRpcAdapter.h" +#include "loc_api_rpcgen_common_rpc.h" +#include "log_util.h" +#include "loc_log.h" +#include "loc_api_log.h" + +#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 = ((LocApiRpcAdapter*)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)); + ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, event); + EXIT_LOG(%p, VOID_RET); +} + + +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return new LocApiRpcAdapter(locEng); +} + +const rpc_loc_event_mask_type LocApiRpcAdapter::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 +}; + +LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : + LocApiAdapter(locEng), + client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), + eMask(convertMask(locEng.eventMask)) +{ + loc_api_glue_init(); +} + +LocApiRpcAdapter::~LocApiRpcAdapter() +{ + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + loc_close(client_handle); +} + +rpc_loc_event_mask_type +LocApiRpcAdapter::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; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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) +{ + locEngHandle.acquireWakelock(); + + // 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); + } + + locEngHandle.releaseWakeLock(); + 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 +LocApiRpcAdapter::reinit() +{ + enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); + + if (client_handle < 0) { + ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + return ret_val; +} + +enum loc_api_adapter_err +LocApiRpcAdapter::startFix() { + LOC_LOGD("LocApiRpcAdapter::startFix() called"); + return convertErr( + loc_start_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::stopFix() { + LOC_LOGD("LocApiRpcAdapter::stopFix() called"); + return convertErr( + loc_stop_fix(client_handle) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::setPositionMode(LocPositionMode mode, + GpsPositionRecurrence recurrence, uint32_t min_interval, + uint32_t preferred_accuracy, uint32_t preferred_time) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + rpc_loc_operation_mode_e_type op_mode; + int ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) client_handle, min_interval, mode); + + switch (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: + 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 = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; + 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 = min_interval; + fix_criteria_ptr->preferred_operation_mode = op_mode; + + if (min_interval > 0) { + fix_criteria_ptr->min_interval = min_interval; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + }else if(min_interval == 0) + { + /*If the framework passes in 0 transalate it into the maximum frequency we can report positions + which is 1 Hz or once very second */ + fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + } + if (preferred_accuracy > 0) { + fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; + } + if (preferred_time > 0) { + fix_criteria_ptr->preferred_response_time = preferred_time; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; + } + + switch (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 +LocApiRpcAdapter::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)(android::elapsedRealtime() - 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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 + LocApiRpcAdapter::setAPN(char* apn, int len) +{ + 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, len+1); + + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 +LocApiRpcAdapter::enableData(int enable) +{ + 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; + return convertErr( + loc_eng_ioctl (client_handle, + RPC_LOC_IOCTL_SET_DATA_ENABLE, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL) + ); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location = {0}; + + location.size = sizeof(location); + 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.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + // Altitude + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + // Speed + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + // Heading + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + LOC_LOGV("reportPosition: fire callback\n"); + LocApiAdapter::reportPosition(location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + 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 LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus = {0}; + 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(GpsSvStatus); + 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.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) + { + 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 (SvStatus.num_svs >= 0) + { + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +void LocApiRpcAdapter::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) + { + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::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) + { + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); + } + else + { + LocApiAdapter::reportStatus(GPS_STATUS_NONE); + } + } + +} + +void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + +#if (AMSS_VERSION==3200) + LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); +#else + LocApiAdapter::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 +LocApiRpcAdapter::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); +} + +enum loc_api_adapter_err +LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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 LocApiRpcAdapter::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 = LocApiAdapter::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)); + LocApiAdapter::requestNiNotify(notif, (const void*)copy); +} + +int LocApiRpcAdapter::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 +LocApiRpcAdapter::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 LocApiRpcAdapter::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; + } +} diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c new file mode 100644 index 00000000..32e3cda8 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c @@ -0,0 +1,52 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c new file mode 100644 index 00000000..6aa5254f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -0,0 +1,344 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c new file mode 100644 index 00000000..10b2d221 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -0,0 +1,621 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/* Logging Improvement */ +#include "log_util.h" + +/* Uncomment to force LOGD messages */ +// #define LOGD LOGI + +/*===================================================================== + 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 +) +{ + 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; + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == event_callback || + loc_glue_callback_table[i].user == userData) + { + LOC_LOGW("Client already opened service (callback=%p)...\n", + event_callback); + break; + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) + { + if (loc_glue_callback_table[i].cb_func == NULL) + { + 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; + break; + } + } + } + + if (i == LOC_API_CB_MAX_CLIENTS) + { + LOC_LOGE("Too many clients opened at once...\n"); + return RPC_LOC_CLIENT_HANDLE_INVALID; + } + + 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"); + stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); + 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; + + ret_val = (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; + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c new file mode 100644 index 00000000..e2a5786f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -0,0 +1,510 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include + +/*************************************************************************** + * 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; + + LOGV("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; + + LOGV("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) + { + LOGV("trylock EBUSY : %d", i); + continue; + } + + if (!slot->in_use && !slot->not_available) + { + select_id = i; + slot->in_use = 1; + slot->signal_sent = 0; + /* Return from here and leave the mutex locked. + * will unlock it in loc_unlock_slot() + */ + break; + } + /* LOGV("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 + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_unlock_slot(int select_id) +{ + loc_sync_data.slots[select_id].in_use = 0; + + pthread_mutex_unlock(&loc_sync_data.slots[select_id].lock); +} + +/*=========================================================================== + +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; /* 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 */ + LOGE("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) + { + LOGE("slot not available ioctl_type = %s", + loc_get_ioctl_type_name(ioctl_type)); + return rc; + } + + // Select the callback we are waiting for + loc_api_save_callback(select_id, handle, 0, ioctl_type); + + rc = loc_ioctl(handle, ioctl_type, ioctl_data_ptr); + + if (rc != RPC_LOC_API_SUCCESS) + { + LOGE("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 { + LOGV("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 + LOGE("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; + LOGE("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 { + LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", + select_id, ioctl_type, rc); + } + } /* wait callback */ + } /* loc_ioctl */ + + loc_unlock_slot(select_id); + + return rc; +} + + diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c new file mode 100644 index 00000000..b257fb81 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk new file mode 100755 index 00000000..abd15c8f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk @@ -0,0 +1,35 @@ +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_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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h new file mode 100644 index 00000000..47478e80 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h @@ -0,0 +1,156 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h new file mode 100644 index 00000000..507103ce --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h @@ -0,0 +1,1261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h new file mode 100644 index 00000000..f11bb654 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h @@ -0,0 +1,288 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h new file mode 100644 index 00000000..e109852c --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c new file mode 100644 index 00000000..b0443487 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c @@ -0,0 +1,327 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c new file mode 100644 index 00000000..7f519281 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c @@ -0,0 +1,60 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c new file mode 100644 index 00000000..d2152ab4 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c @@ -0,0 +1,155 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c new file mode 100644 index 00000000..da066b42 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c @@ -0,0 +1,1775 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c new file mode 100644 index 00000000..e8a2aa78 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c @@ -0,0 +1,199 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c new file mode 100644 index 00000000..b4aeb5e7 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr new file mode 100755 index 00000000..3d6c759e --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr @@ -0,0 +1,261 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr new file mode 100755 index 00000000..36d0e6d2 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr @@ -0,0 +1,187 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr new file mode 100755 index 00000000..fcdaf57f --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr @@ -0,0 +1,1021 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk new file mode 100755 index 00000000..f70cba50 --- /dev/null +++ b/loc_api/libloc_api-rpc/Android.mk @@ -0,0 +1,60 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) +RPC_INC:=inc-$(AMSS_VERSION) + +generated_files:= \ + gen-$(AMSS_VERSION)/loc_api_clnt.c \ + gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ + gen-$(AMSS_VERSION)/loc_api_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_fixup.c \ + gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ + src/loc_apicb_appinit.c + +LOCAL_SRC_FILES:= $(generated_files) + +# removed from library build since the client should implement this code. +# src/loc_api_cb_server.c + +LOCAL_CFLAGS:=-fno-short-enums +LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h +LOCAL_CFLAGS+=-DDEBUG +# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE + +LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL + +LOCAL_SHARED_LIBRARIES:= librpc +LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc + + + +LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc +LOCAL_COPY_HEADERS:= \ + $(RPC_INC)/loc_api_cb.h \ + $(RPC_INC)/loc_api_common.h \ + $(RPC_INC)/loc_api.h \ + $(RPC_INC)/loc_api_fixup.h \ + $(RPC_INC)/loc_apicb_appinit.h \ + inc/debug.h \ + inc/loc_api_rpc_glue.h + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/inc \ + $(LOCAL_PATH)/$(RPC_INC) \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_MODULE:= libloc_api-rpc + +include $(BUILD_STATIC_LIBRARY) + +endif +endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr new file mode 100755 index 00000000..5d9cf6c8 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr @@ -0,0 +1,29 @@ +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:= inc-$(AMSS_VERSION) + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr new file mode 100755 index 00000000..a9d60aa4 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr @@ -0,0 +1,172 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + + + version LOC_APIVERS_0002 { + +/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 +RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ +*/ + + void + rpc_loc_api_null( void ) = 0; + + } = 0x00040002; + + +} = 0x3000008c; + +const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr new file mode 100755 index 00000000..1bd4e151 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr @@ -0,0 +1,85 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + +} = 0x3100008c; + +const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c new file mode 100644 index 00000000..52a0d15b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c new file mode 100644 index 00000000..dca1e8d5 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c @@ -0,0 +1,91 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "loc_api.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr new file mode 100755 index 00000000..4e01607d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr @@ -0,0 +1,906 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + +const LOC_API_TOOLVERS = 0x00040024; +const LOC_API_FEATURES = 0x00000001; + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; +const RPC_LOC_OPEN_VERSION = 0x00040001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; +const RPC_LOC_API_NULL_VERSION = 0x00040001; +const RPC_LOC_STOP_FIX_VERSION = 0x00040001; +const RPC_LOC_IOCTL_VERSION = 0x00040001; +const RPC_LOC_START_FIX_VERSION = 0x00040001; +const RPC_LOC_CLOSE_VERSION = 0x00040001; +const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; +const RPC_LOC_API_API_MAJOR_NUM = 0x0004; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; + +typedef bool rpc_boolean; + +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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[1200]; /* EVAL:[1200]*/ +}; + +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_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]; /* EVAL:[256]*/ +}; + +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; + 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ + + typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + 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_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_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_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 +}; + +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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c new file mode 100644 index 00000000..7c860bf3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c @@ -0,0 +1,1650 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, 1200)) + 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_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; + 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_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; + 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_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_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; + 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_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_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_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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c new file mode 100644 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c new file mode 100644 index 00000000..fbaca8b6 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Include RPC headers */ +#include "loc_api_rpc_glue.h" + +/* Callback init */ +#include "loc_apicb_appinit.h" + +/* Logging */ +#define LOG_TAG "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00040001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c new file mode 100644 index 00000000..835f6b18 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c @@ -0,0 +1,171 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr new file mode 100755 index 00000000..5d9cf6c8 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr @@ -0,0 +1,29 @@ +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:= inc-$(AMSS_VERSION) + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr new file mode 100755 index 00000000..981266b3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr @@ -0,0 +1,164 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3000008c; + +const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr new file mode 100755 index 00000000..3f53504b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr @@ -0,0 +1,90 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3100008c; + +const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c new file mode 100644 index 00000000..b1aa1998 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c new file mode 100644 index 00000000..79814d42 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c @@ -0,0 +1,82 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "loc_api.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr new file mode 100755 index 00000000..7ef6357c --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr @@ -0,0 +1,803 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_OPEN_VERSION = 0x00010001; +const RPC_LOC_CLOSE_VERSION = 0x00010001; +const RPC_LOC_START_FIX_VERSION = 0x00010001; +const RPC_LOC_STOP_FIX_VERSION = 0x00010001; +const RPC_LOC_IOCTL_VERSION = 0x00010001; +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; +const RPC_LOC_API_API_MAJOR_NUM = 0x0001; +typedef bool rpc_boolean; +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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; +}; + +struct rpc_loc_nmea_report_s_type { + rpc_uint16 length; + opaque nmea_sentences; +}; + +enum rpc_loc_status_event_e_type { + RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, + 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 +}; + +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; + 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_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; +}; + +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; + 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_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; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_qop_s_type { + unsigned char bit_mask; + unsigned char horacc; + unsigned char veracc; + unsigned char 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; +}; + +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; + 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; + 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; +}; + +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; + 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_MAX = 268435456 +}; + +typedef string 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 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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + default: + void; +}; + +struct rpc_loc_server_request_s_type { + rpc_loc_server_request_e_type event; + rpc_loc_server_request_u_type payload; +}; + +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_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_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_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_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; +}; + +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 +}; + +struct rpc_loc_server_open_status_s_type { + rpc_loc_server_connection_handle conn_handle; + rpc_loc_server_open_status_e_type open_status; + string apn_name<>; +}; + +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; +}; + +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_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; + 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: + 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; + 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: + 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_RESERVED: + rpc_loc_reserved_payload_s_type reserved; + default: + void; +}; + +const RPC_LOC_API_NULL_VERSION = 0x00010001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c new file mode 100644 index 00000000..7b37b9c3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c @@ -0,0 +1,1441 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, RPC_LOC_API_MAX_SV_COUNT, + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) + 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_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; + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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; + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_u_char (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; + + if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) + 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; + + 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_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; + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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_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; + 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_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_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; + 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_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; + 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) + return FALSE; + if (!xdr_string (xdrs, &objp->apn_name, ~0)) + 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_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_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; + 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: + 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; + 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: + 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c new file mode 100644 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c new file mode 100644 index 00000000..8c171222 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Include RPC headers */ +#include "loc_api_rpc_glue.h" + +/* Callback init */ +#include "loc_apicb_appinit.h" + +/* Logging */ +#define LOG_TAG "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00010001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c new file mode 100644 index 00000000..835f6b18 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c @@ -0,0 +1,171 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h new file mode 100644 index 00000000..e02648cc --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api.h @@ -0,0 +1,210 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(); +extern bool_t rpc_loc_api_null_0x00040001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00040001(); +extern bool_t rpc_loc_open_0x00040001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(); +extern bool_t rpc_loc_close_0x00040001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00040001(); +extern bool_t rpc_loc_start_fix_0x00040001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); +extern bool_t rpc_loc_stop_fix_0x00040001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00040001(); +extern bool_t rpc_loc_ioctl_0x00040001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); +extern int loc_apiprog_0x00040001_freeresult (); +#endif /* K&R C */ +#define LOC_APIVERS_0002 0x00040002 + +#if defined(__STDC__) || defined(__cplusplus) +extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); +extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +extern enum clnt_stat rpc_loc_api_null_0x00040002(); +extern bool_t rpc_loc_api_null_0x00040002_svc(); +extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h new file mode 100644 index 00000000..67ac0846 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_CB_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00040001_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_0x00040001(); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); +extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h new file mode 100644 index 00000000..6ff3baf1 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h @@ -0,0 +1,1154 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_COMMON_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOC_API_TOOLVERS 0x00040024 +#define LOC_API_FEATURES 0x00000001 +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 +#define RPC_LOC_OPEN_VERSION 0x00040001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 +#define RPC_LOC_API_NULL_VERSION 0x00040001 +#define RPC_LOC_STOP_FIX_VERSION 0x00040001 +#define RPC_LOC_IOCTL_VERSION 0x00040001 +#define RPC_LOC_START_FIX_VERSION 0x00040001 +#define RPC_LOC_CLOSE_VERSION 0x00040001 +#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 +#define RPC_LOC_API_API_MAJOR_NUM 0x0004 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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[1200]; +}; +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_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_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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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_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_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_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; + +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; + +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_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_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_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_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h new file mode 100644 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h new file mode 100644 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h new file mode 100644 index 00000000..8998aca4 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api.h @@ -0,0 +1,198 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(); +extern bool_t rpc_loc_api_null_0x00010001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00010001(); +extern bool_t rpc_loc_open_0x00010001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(); +extern bool_t rpc_loc_close_0x00010001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00010001(); +extern bool_t rpc_loc_start_fix_0x00010001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); +extern bool_t rpc_loc_stop_fix_0x00010001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00010001(); +extern bool_t rpc_loc_ioctl_0x00010001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); +extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h new file mode 100644 index 00000000..4f2f8f91 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_CB_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00010001_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_0x00010001(); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); +extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h new file mode 100644 index 00000000..04be079f --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h @@ -0,0 +1,1031 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_COMMON_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_OPEN_VERSION 0x00010001 +#define RPC_LOC_CLOSE_VERSION 0x00010001 +#define RPC_LOC_START_FIX_VERSION 0x00010001 +#define RPC_LOC_STOP_FIX_VERSION 0x00010001 +#define RPC_LOC_IOCTL_VERSION 0x00010001 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 +#define RPC_LOC_API_API_MAJOR_NUM 0x0001 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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; + struct { + u_int nmea_sentences_len; + char *nmea_sentences_val; + } nmea_sentences; +}; +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_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; + +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_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_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; + struct { + u_int addr_len; + char *addr_val; + } addr; +}; +typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; + struct { + u_int requestor_id_string_len; + char *requestor_id_string_val; + } requestor_id_string; + 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; + struct { + u_int client_name_string_len; + char *client_name_string_val; + } client_name_string; + 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; + u_char 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; + struct { + u_int ext_client_address_len; + char *ext_client_address_val; + } ext_client_address; +}; +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; + struct { + u_int lcs_codeword_string_len; + char *lcs_codeword_string_val; + } lcs_codeword_string; + 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; + struct { + u_int notification_text_len; + char *notification_text_val; + } notification_text; + 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; + +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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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; + +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_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_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_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_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; +}; +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; + +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; +}; +typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; + +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_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_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_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_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; +#define RPC_LOC_API_NULL_VERSION 0x00010001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h new file mode 100644 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h new file mode 100644 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h new file mode 100644 index 00000000..a71b23a0 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -0,0 +1,57 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" +#include + +#define PRINT(x...) do { \ + fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ + fprintf(stdout, ##x); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h new file mode 100644 index 00000000..ef972bd6 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_api_rpc_glue.h + @brief: Loc API Android glue code header + + DESCRIPTION + Loc API Android glue code header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/17/09 dx Initial version + +$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ +======================================================================*/ + +#ifndef LOC_API_RPC_GLUE_H +#define LOC_API_RPC_GLUE_H + +/* Include RPC headers */ +#include "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "loc_api_fixup.h" + +#ifdef __cplusplus +extern "C" +{ +#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 + +extern int loc_api_glue_init(void); +extern int loc_api_null(void); + +typedef int32 (loc_event_cb_f_type)( + 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 */ +); + +extern rpc_loc_client_handle_type loc_open( + rpc_loc_event_mask_type event_reg_mask, + loc_event_cb_f_type *event_callback +); + +extern int32 loc_close +( + 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 +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c new file mode 100644 index 00000000..7fcfd6cb --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c @@ -0,0 +1,61 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "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; + } + xprt_unregister(svrPort); + svc_destroy(svrPort); + //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); + svrPort = NULL; +} diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk new file mode 100755 index 00000000..f20280ee --- /dev/null +++ b/loc_api/libloc_api/Android.mk @@ -0,0 +1,39 @@ +#Compile the old library version from Google push for Passion builds with old modem image +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) + +LOCAL_MODULE_TAGS := optional + +LOCAL_STATIC_LIBRARIES:= \ + libloc_api-rpc + +LOCAL_SHARED_LIBRARIES := \ + librpc \ + libutils \ + libcutils + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_ioctl.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + gps.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -DAMSS_VERSION=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc \ + $(TARGET_OUT_HEADERS)/libloc_api-rpc/inc \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ + $(TARGET_OUT_HEADERS)/librpc + + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw + +include $(BUILD_SHARED_LIBRARY) +endif #BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION = 50001 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c new file mode 100644 index 00000000..5f6d8095 --- /dev/null +++ b/loc_api/libloc_api/gps.c @@ -0,0 +1,68 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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 = malloc(sizeof(struct gps_device_t)); + 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 +}; + +const struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = GPS_HARDWARE_MODULE_ID, + .name = "loc_api GPS Module", + .author = "Qualcomm USA, Inc.", + .methods = &gps_module_methods, +}; diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp new file mode 100644 index 00000000..68ac002c --- /dev/null +++ b/loc_api/libloc_api/loc_eng.cpp @@ -0,0 +1,1533 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include +#include +#include + +#include +#include "loc_api_rpc_glue.h" +#include "loc_apicb_appinit.h" + +#include +#include +#include + +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define DEBUG_MOCK_NI 0 + +// Function declarations for sLocEngInterface +static int loc_eng_init(GpsCallbacks* callbacks); +static int loc_eng_start(); +static int loc_eng_stop(); +static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); +static void loc_eng_cleanup(); +static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); +static int loc_eng_inject_location(double latitude, double longitude, float accuracy); +static void loc_eng_delete_aiding_data (GpsAidingData f); +static const void* loc_eng_get_extension(const char* name); + +// Function declarations for sLocEngAGpsInterface +static void loc_eng_agps_init(AGpsCallbacks* callbacks); +static int loc_eng_agps_data_conn_open(const char* apn); +static int loc_eng_agps_data_conn_closed(); +static int loc_eng_agps_data_conn_failed(); +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); + + +static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload); +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); +static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_report_ptr); +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); + +static void loc_eng_process_deferred_action (void* arg); +static void loc_eng_process_atl_deferred_action (int flags); +static void loc_eng_delete_aiding_data_deferred_action (void); + +static int set_agps_server(); + +// Defines the GpsInterface in gps.h +static const GpsInterface sLocEngInterface = +{ + sizeof(GpsInterface), + loc_eng_init, + loc_eng_start, + loc_eng_stop, + loc_eng_cleanup, + loc_eng_inject_time, + loc_eng_inject_location, + loc_eng_delete_aiding_data, + loc_eng_set_position_mode, + loc_eng_get_extension, +}; + +static const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_eng_agps_init, + loc_eng_agps_data_conn_open, + loc_eng_agps_data_conn_closed, + loc_eng_agps_data_conn_failed, + loc_eng_agps_set_server, +}; + +// Global data structure for location engine +loc_eng_data_s_type loc_eng_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + property_get("gps.disable", propBuf, ""); + if (propBuf[0] == '1') + { + LOGD("gps_get_interface returning NULL because gps.disable=1\n"); + return NULL; + } + + return &sLocEngInterface; +} + +/*=========================================================================== +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 + +===========================================================================*/ + +// fully shutting down the GPS is temporarily disabled to avoid intermittent BP crash +#define DISABLE_CLEANUP 1 + +static int loc_eng_init(GpsCallbacks* callbacks) +{ +#if DISABLE_CLEANUP + if (loc_eng_data.deferred_action_thread) { + // already initialized + return 0; + } +#endif + // Start the LOC api RPC service + loc_api_glue_init (); + + callbacks->set_capabilities_cb(GPS_CAPABILITY_SCHEDULING | GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + + memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); + + // LOC ENG module data initialization + 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; + + rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | + RPC_LOC_EVENT_SATELLITE_REPORT | + RPC_LOC_EVENT_LOCATION_SERVER_REQUEST | + RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST | + RPC_LOC_EVENT_IOCTL_REPORT | + RPC_LOC_EVENT_STATUS_REPORT | + RPC_LOC_EVENT_NMEA_POSITION_REPORT | + RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + + loc_eng_data.client_handle = loc_open (event, loc_event_cb); + + pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); + pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); + pthread_mutex_init (&(loc_eng_data.deferred_stop_mutex), NULL); + + loc_eng_data.loc_event = 0; + loc_eng_data.deferred_action_flags = 0; + memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); + + loc_eng_data.aiding_data_for_deletion = 0; + loc_eng_data.engine_status = GPS_STATUS_NONE; + + // XTRA module data initialization + loc_eng_data.xtra_module_data.download_request_cb = NULL; + + // IOCTL module data initialization + loc_eng_data.ioctl_data.cb_is_selected = FALSE; + loc_eng_data.ioctl_data.cb_is_waiting = FALSE; + loc_eng_data.ioctl_data.client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; + memset (&(loc_eng_data.ioctl_data.cb_payload), + 0, + sizeof (rpc_loc_ioctl_callback_s_type)); + + pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); + pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); + + loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", + loc_eng_process_deferred_action, NULL); + + LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_cleanup + +DESCRIPTION + Cleans location engine. The location client handle will be released. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_cleanup() +{ +#if DISABLE_CLEANUP + return; +#else + if (loc_eng_data.deferred_action_thread) + { + /* Terminate deferred action working thread */ + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_QUIT; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); + + void* ignoredValue; + pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); + loc_eng_data.deferred_action_thread = NULL; + } + + // clean up + (void) loc_close (loc_eng_data.client_handle); + + pthread_mutex_destroy (&loc_eng_data.deferred_action_mutex); + pthread_cond_destroy (&loc_eng_data.deferred_action_cond); + + pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); + pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); + +// Do not call this as it can result in the ARM9 crashing if it sends events while we are disabled +// loc_apicb_app_deinit(); +#endif +} + + +/*=========================================================================== +FUNCTION loc_eng_start + +DESCRIPTION + Starts the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_start() +{ + int ret_val; + LOGD ("loc_eng_start\n"); + + if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && + loc_eng_data.agps_server_host[0] != 0 && + loc_eng_data.agps_server_port != 0) { + int result = set_agps_server(); + LOGD ("set_agps_server returned = %d\n", result); + } + + ret_val = loc_start_fix (loc_eng_data.client_handle); + + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_start returned error = %d\n", ret_val); + } + + return 0; +} + + +/*=========================================================================== +FUNCTION loc_eng_stop + +DESCRIPTION + Stops the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_stop() +{ + int ret_val; + + LOGD ("loc_eng_stop\n"); + + pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); + // work around problem with loc_eng_stop when AGPS requests are pending + // we defer stopping the engine until the AGPS request is done + if (loc_eng_data.agps_request_pending) + { + loc_eng_data.stop_request_pending = true; + LOGD ("deferring stop until AGPS data call is finished\n"); + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); + return 0; + } + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); + + ret_val = loc_stop_fix (loc_eng_data.client_handle); + if (ret_val != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_eng_stop returned error = %d\n", ret_val); + } + + return 0; +} + +static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + + LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", + (int32) loc_eng_data.client_handle, lock_type); + + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; + 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*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_gps_lock mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +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 + +===========================================================================*/ +static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + boolean ret_val; + + LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", + (int32) loc_eng_data.client_handle, min_interval, mode); + + loc_eng_data.position_mode = mode; + ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; + + fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); + fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | + RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; + + switch (mode) { + case GPS_POSITION_MODE_MS_BASED: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; + break; + case GPS_POSITION_MODE_MS_ASSISTED: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; + break; + case GPS_POSITION_MODE_STANDALONE: + default: + fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; + break; + } + if (min_interval > 0) { + fix_criteria_ptr->min_interval = min_interval; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; + } + if (preferred_accuracy > 0) { + fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; + } + if (preferred_time > 0) { + fix_criteria_ptr->preferred_response_time = preferred_time; + fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; + } + + switch (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; + } + + ret_val = loc_eng_ioctl(loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_FIX_CRITERIA, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_set_position mode failed\n"); + } + + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_time + +DESCRIPTION + This is used by Java native function to do time injection. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_inject_time (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; + boolean ret_val; + + LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; + + 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)(android::elapsedRealtime() - timeReference); + time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_UTC_TIME, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("loc_eng_inject_time failed\n"); + } + + return 0; +} + +static int loc_eng_inject_location (double latitude, double longitude, float accuracy) +{ + /* not yet implemented */ + 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 + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data (GpsAidingData f) +{ + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + // Currently, LOC API only support deletion of all aiding data, + if (f) + loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; + + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); +} + +/*=========================================================================== +FUNCTION loc_eng_get_extension + +DESCRIPTION + Get the gps extension to support XTRA. + +DEPENDENCIES + N/A + +RETURN VALUE + The GPS extension interface. + +SIDE EFFECTS + N/A + +===========================================================================*/ +static const void* loc_eng_get_extension(const char* name) +{ + if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + { + return &sLocEngXTRAInterface; + } + else if (strcmp(name, AGPS_INTERFACE) == 0) + { + return &sLocEngAGpsInterface; + } + else if (strcmp(name, GPS_NI_INTERFACE) == 0) + { + return &sLocEngNiInterface; + } + + return NULL; +} + +#if DEBUG_MOCK_NI == 1 +/*=========================================================================== +FUNCTION mock_ni + +DESCRIPTION + DEBUG tool: simulate an NI request + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void* mock_ni(void* arg) +{ + static int busy = 0; + + if (busy) return NULL; + + busy = 1; + + sleep(5); + + rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type payload; + rpc_loc_ni_event_s_type *ni_req; + rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + + client_handle = (rpc_loc_client_handle_type) arg; + + loc_event = RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; + payload.disc = loc_event; + + ni_req = &payload.rpc_loc_event_payload_u_type_u.ni_request; + ni_req->event = RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ; + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + + // Encodings for Spirent Communications + char client_name[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + char requestor_id[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, + 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; + + supl_req->flags = RPC_LOC_NI_CLIENT_NAME_PRESENT | + RPC_LOC_NI_REQUESTOR_ID_PRESENT | + RPC_LOC_NI_ENCODING_TYPE_PRESENT; + + supl_req->datacoding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + + supl_req->client_name.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; // no coding + supl_req->client_name.client_name_string.client_name_string_len = strlen(client_name); + supl_req->client_name.client_name_string.client_name_string_val = client_name; + supl_req->client_name.string_len = strlen(client_name); + + supl_req->requestor_id.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; + supl_req->requestor_id.requestor_id_string.requestor_id_string_len = strlen(requestor_id); + supl_req->requestor_id.requestor_id_string.requestor_id_string_val = requestor_id; + supl_req->requestor_id.string_len = strlen(requestor_id); + + supl_req->notification_priv_type = RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP; + supl_req->user_response_timer = 10; + + loc_event_cb(client_handle, loc_event, &payload); + + busy = 0; + + return NULL; +} +#endif // DEBUG_MOCK_NI + +/*=========================================================================== +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( + rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, + const rpc_loc_event_payload_u_type* loc_event_payload + ) +{ + LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); + if (client_handle == loc_eng_data.client_handle) + { + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + loc_eng_data.loc_event = loc_event; + memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); + + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_EVENT; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); + } + else + { + LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); + } + + return RPC_LOC_API_SUCCESS; +} + +/*=========================================================================== +FUNCTION loc_eng_report_position + +DESCRIPTION + Reports position information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) +{ + GpsLocation location; + + LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", + (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); + + memset (&location, 0, sizeof(location)); + location.size = sizeof(location); + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) + { + // Not a position report, return + if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS) + { + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) + { + location.timestamp = location_report_ptr->timestamp_utc; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitude_wrt_ellipsoid; + } + + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->hor_unc_circular; + } + + if (loc_eng_data.location_cb != NULL) + { + LOGV ("loc_eng_report_position: fire callback\n"); + loc_eng_data.location_cb (&location); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); + } + } + else + { + LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); + } +} + +/*=========================================================================== +FUNCTION loc_eng_report_sv + +DESCRIPTION + Reports GPS satellite information to the Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const rpc_loc_sv_info_s_type *sv_info_ptr; + + LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", + (uint32) gnss_report_ptr->valid_mask, + gnss_report_ptr->sv_count); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + 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 (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(GpsSvStatus); + 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.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) + { + 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++; + } + } + + LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); + if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) + { + loc_eng_data.sv_status_cb(&SvStatus); + } +} + +/*=========================================================================== +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 (const rpc_loc_status_event_s_type *status_report_ptr) +{ + GpsStatus status; + + LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); + + memset (&status, 0, sizeof(status)); + status.size = sizeof(status); + status.status = GPS_STATUS_NONE; + 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) + { + // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON + status.status = GPS_STATUS_SESSION_BEGIN; + loc_eng_data.status_cb(&status); + } + else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) + { + // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF + status.status = GPS_STATUS_ENGINE_OFF; + loc_eng_data.status_cb(&status); + } + } + + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + loc_eng_data.engine_status = status.status; + + // Wake up the thread for aiding data deletion. + if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && + (loc_eng_data.aiding_data_for_deletion != 0)) + { + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + // In case gps engine is ON, the assistance data will be deleted when the engine is OFF + } + + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); +} + +static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) +{ + if (loc_eng_data.nmea_cb != NULL) + { + struct timeval tv; + + gettimeofday(&tv, (struct timezone *) NULL); + long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + +#if (AMSS_VERSION==3200) + loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); +#else + loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences, nmea_report_ptr->length); +#endif + } +} + +/*=========================================================================== +FUNCTION loc_eng_process_conn_request + +DESCRIPTION + Requests data connection to be brought up/tore down with the location server. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) +{ + LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); + + // Signal DeferredActionThread to send the APN name + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + + // This implemenation is based on the fact that modem now at any time has only one data connection for AGPS at any given time + if (server_request_ptr->event == RPC_LOC_SERVER_REQUEST_OPEN) + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; + loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; + loc_eng_data.agps_request_pending = true; + } + else + { + loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; + loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; + loc_eng_data.agps_request_pending = false; + } + + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_STATUS; + pthread_cond_signal(&loc_eng_data.deferred_action_cond); + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); +} + +/*=========================================================================== +FUNCTION loc_eng_agps_init + +DESCRIPTION + + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_agps_init(AGpsCallbacks* callbacks) +{ + LOGV("loc_eng_agps_init\n"); + loc_eng_data.agps_status_cb = callbacks->status_cb; +} + +static int loc_eng_agps_data_conn_open(const char* apn) +{ + int apn_len; + LOGD("loc_eng_agps_data_conn_open: %s\n", apn); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + + if (apn != NULL) + { + apn_len = strlen (apn); + + if (apn_len >= sizeof(loc_eng_data.apn_name)) + { + LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); + apn_len = sizeof(loc_eng_data.apn_name) - 1; + } + + memcpy (loc_eng_data.apn_name, apn, apn_len); + loc_eng_data.apn_name[apn_len] = '\0'; + } + + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_SUCCESS; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_closed() +{ + LOGD("loc_eng_agps_data_conn_closed\n"); + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_CLOSED; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int loc_eng_agps_data_conn_failed() +{ + LOGD("loc_eng_agps_data_conn_failed\n"); + + pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); + /* hold a wake lock while events are pending for deferred_action_thread */ + loc_eng_data.acquire_wakelock_cb(); + loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_FAILED; + pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + return 0; +} + +static int set_agps_server() +{ + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_server_info_s_type *server_info_ptr; + boolean ret_val; + uint16 port_temp; + unsigned char *b_ptr; + + if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) + return -1; + + if (loc_eng_data.agps_server_address == 0) { + struct hostent* he = gethostbyname(loc_eng_data.agps_server_host); + if (he) + loc_eng_data.agps_server_address = *(uint32_t *)he->h_addr_list[0]; + } + if (loc_eng_data.agps_server_address == 0) + return -1; + + b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); + + + server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); + ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; + server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; + server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; + +#if (AMSS_VERSION==3200) + char url[24]; + memset(url, 0, sizeof(url)); + snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); + LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); +#else + char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; + int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); + memset(buf, 0, buf_len); + snprintf(buf, buf_len - 1, "%d.%d.%d.%d:%d", + (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), + (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), + (loc_eng_data.agps_server_port & (0x0000ffff))); + + server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; + LOGD ("set_agps_server, addr = %s\n", buf); +#endif + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + + if (ret_val != TRUE) + { + LOGD ("set_agps_server failed\n"); + return -1; + } + else + { + LOGV ("set_agps_server successful\n"); + return 0; + } +} + +static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) +{ + LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); + + if (type != AGPS_TYPE_SUPL) + return -1; + + strncpy(loc_eng_data.agps_server_host, hostname, sizeof(loc_eng_data.agps_server_host) - 1); + loc_eng_data.agps_server_port = port; + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_delete_aiding_data_deferred_action + +DESCRIPTION + This is used to remove the aiding data when GPS engine is off. + +DEPENDENCIES + Assumes the aiding data type specified in GpsAidingData matches with + LOC API specification. + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_delete_aiding_data_deferred_action (void) +{ + // Currently, we only support deletion of all aiding data, + // since the Android defined aiding data mask matches with modem, + // so just pass them down without any translation + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_assist_data_delete_s_type *assist_data_ptr; + boolean ret_val; + + ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; + assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); + assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; + loc_eng_data.aiding_data_for_deletion = 0; + + memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_DELETE_ASSIST_DATA , + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_atl_deferred_action + +DESCRIPTION + This is used to inform the location engine of the processing status for + data connection open/close request. + +DEPENDENCIES + None + +RETURN VALUE + RPC_LOC_API_SUCCESS + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_atl_deferred_action (int flags) +{ + rpc_loc_server_open_status_s_type *conn_open_status_ptr; + rpc_loc_server_close_status_s_type *conn_close_status_ptr; + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + int agps_status = -1; + + LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); + + memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); + + if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; + conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); + conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; + conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; + } + else + { + ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; + conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; + conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; + if (flags & DEFERRED_ACTION_AGPS_DATA_SUCCESS) + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; + // Both buffer are of the same maximum size, and the source is null terminated + // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); +#if (AMSS_VERSION==3200) + conn_open_status_ptr->apn_name = loc_eng_data.apn_name; +#else + memset(conn_open_status_ptr->apn_name, 0, sizeof(conn_open_status_ptr->apn_name)); + strncpy(conn_open_status_ptr->apn_name, loc_eng_data.apn_name, + sizeof(conn_open_status_ptr->apn_name) - 1); +#endif + // Delay this so that PDSM ATL module will behave properly + sleep (1); + LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); + } + else // data_connection_failed + { + conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; + } + // Delay this so that PDSM ATL module will behave properly + sleep (1); + } + + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + ioctl_data.disc, + &ioctl_data, + LOC_IOCTL_DEFAULT_TIMEOUT, + NULL); + + LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); +} + +/*=========================================================================== +FUNCTION loc_eng_process_loc_event + +DESCRIPTION + This is used to process events received from the location engine. + +DEPENDENCIES + None + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, + rpc_loc_event_payload_u_type* loc_event_payload) +{ + if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) + { + loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); + } + + if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) + { + loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); + } + + if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) + { + loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); + } + + if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) + { + loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); + } + + // Android XTRA interface 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) + { + LOGD ("loc_event_cb: xtra download requst"); + + // Call Registered callback + if (loc_eng_data.xtra_module_data.download_request_cb != NULL) + { + loc_eng_data.xtra_module_data.download_request_cb (); + } + } + } + + if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) + { + // Process the received RPC_LOC_EVENT_IOCTL_REPORT + (void) loc_eng_ioctl_process_cb (loc_eng_data.client_handle, + &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); + } + + if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) + { + loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); + } + + loc_eng_ni_callback(loc_event, loc_event_payload); + +#if DEBUG_MOCK_NI == 1 + // DEBUG only + if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && + loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. + payload.rpc_loc_status_event_payload_u_type_u.engine_state + == RPC_LOC_ENGINE_STATE_OFF) + { + // Mock an NI request + pthread_t th; + pthread_create (&th, NULL, mock_ni, (void*) client_handle); + } +#endif /* DEBUG_MOCK_NI == 1 */ +} + +/*=========================================================================== +FUNCTION loc_eng_process_deferred_action + +DESCRIPTION + Main routine for the thread to execute certain commands + that are not safe to be done from within an RPC callback. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_process_deferred_action (void* arg) +{ + AGpsStatus status; + status.size = sizeof(status); + status.type = AGPS_TYPE_SUPL; + + LOGD("loc_eng_process_deferred_action started\n"); + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + // disable the GPS lock + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); + loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); + + while (1) + { + GpsAidingData aiding_data_for_deletion; + GpsStatusValue engine_status; + + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + + // Wait until we are signalled to do a deferred action, or exit + pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); + + // If we have an event we should process it immediately, + // otherwise wait until we are signalled + if (loc_eng_data.deferred_action_flags == 0) { + // do not hold a wake lock while waiting for an event... + loc_eng_data.release_wakelock_cb(); + pthread_cond_wait(&loc_eng_data.deferred_action_cond, + &loc_eng_data.deferred_action_mutex); + // but after we are signalled reacquire the wake lock + // until we are done processing the event. + loc_eng_data.acquire_wakelock_cb(); + } + + if (loc_eng_data.deferred_action_flags & DEFERRED_ACTION_QUIT) + { + pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); + break; + } + + // copy anything we need before releasing the mutex + loc_event = loc_eng_data.loc_event; + if (loc_event != 0) { + memcpy(&loc_event_payload, &loc_eng_data.loc_event_payload, sizeof(loc_event_payload)); + loc_eng_data.loc_event = 0; + } + + int flags = loc_eng_data.deferred_action_flags; + loc_eng_data.deferred_action_flags = 0; + engine_status = loc_eng_data.agps_status; + aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; + status.status = loc_eng_data.agps_status; + loc_eng_data.agps_status = 0; + + // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 + pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); + + if (loc_event != 0) { + loc_eng_process_loc_event(loc_event, &loc_event_payload); + } + + // send_delete_aiding_data must be done when GPS engine is off + if ((engine_status != GPS_STATUS_SESSION_BEGIN) && (aiding_data_for_deletion != 0)) + { + loc_eng_delete_aiding_data_deferred_action (); + } + + if (flags & (DEFERRED_ACTION_AGPS_DATA_SUCCESS | + DEFERRED_ACTION_AGPS_DATA_CLOSED | + DEFERRED_ACTION_AGPS_DATA_FAILED)) + { + loc_eng_process_atl_deferred_action(flags); + + pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); + // work around problem with loc_eng_stop when AGPS requests are pending + // we defer stopping the engine until the AGPS request is done + loc_eng_data.agps_request_pending = false; + if (loc_eng_data.stop_request_pending) + { + LOGD ("handling deferred stop\n"); + if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) + { + LOGD ("loc_stop_fix failed!\n"); + } + } + pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); + } + + if (status.status != 0 && loc_eng_data.agps_status_cb) { + loc_eng_data.agps_status_cb(&status); + } + } + + // reenable the GPS lock + LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); + loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); + + LOGD("loc_eng_process_deferred_action thread exiting\n"); + loc_eng_data.release_wakelock_cb(); + + loc_eng_data.deferred_action_thread = 0; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + return &sLocEngInterface; +} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h new file mode 100644 index 00000000..553a97e0 --- /dev/null +++ b/loc_api/libloc_api/loc_eng.h @@ -0,0 +1,115 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +// 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 + +#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds + +enum { + DEFERRED_ACTION_EVENT = 0x01, + DEFERRED_ACTION_DELETE_AIDING = 0x02, + DEFERRED_ACTION_AGPS_STATUS = 0x04, + DEFERRED_ACTION_AGPS_DATA_SUCCESS = 0x08, + DEFERRED_ACTION_AGPS_DATA_CLOSED = 0x10, + DEFERRED_ACTION_AGPS_DATA_FAILED = 0x20, + DEFERRED_ACTION_QUIT = 0x40, +}; + +// Module data +typedef struct +{ + rpc_loc_client_handle_type client_handle; + + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + int agps_status; + + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; + pthread_mutex_t deferred_stop_mutex; + + loc_eng_xtra_data_s_type xtra_module_data; + + loc_eng_ioctl_data_s_type ioctl_data; + + // data from loc_event_cb + rpc_loc_event_mask_type loc_event; + rpc_loc_event_payload_u_type loc_event_payload; + + // TBD: + char agps_server_host[256]; + int agps_server_port; + uint32 agps_server_address; + char apn_name[100]; + int position_mode; + rpc_loc_server_connection_handle conn_handle; + + // GPS engine status + GpsStatusValue engine_status; + + // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off + GpsAidingData aiding_data_for_deletion; + + // Data variables used by deferred action thread + pthread_t deferred_action_thread; + // Mutex used by deferred action thread + pthread_mutex_t deferred_action_mutex; + // Condition variable used by deferred action thread + pthread_cond_t deferred_action_cond; + + // flags for pending events for deferred action thread + int deferred_action_flags; +} loc_eng_data_s_type; + +extern loc_eng_data_s_type loc_eng_data; + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp new file mode 100644 index 00000000..a43d8cca --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -0,0 +1,354 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include +#include + +#include +#include + +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +// Function declarations +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type +); + +static boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr // Output parameter for IOCTL calls +); + +/*=========================================================================== + +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 + +===========================================================================*/ +boolean 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 + ) +{ + boolean ret_val; + int rpc_ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + // Select the callback we are waiting for + ret_val = loc_eng_ioctl_setup_cb (handle, ioctl_type); + + if (ret_val == TRUE) + { + rpc_ret_val = loc_ioctl (handle, + ioctl_type, + ioctl_data_ptr); + + LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); + + if (rpc_ret_val == RPC_LOC_API_SUCCESS) + { + // Wait for the callback of loc_ioctl + ret_val = loc_eng_ioctl_wait_cb (timeout_msec, cb_data_ptr); + } + else + { + ret_val = FALSE; + } + } + + // Reset the state when we are done + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + ioctl_cb_data_ptr->cb_is_selected = FALSE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_setup_cb + +DESCRIPTION + Selects which callback is going to be waited for + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +static boolean loc_eng_ioctl_setup_cb( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type + ) +{ + boolean ret_val; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (ioctl_cb_data_ptr->cb_is_selected == TRUE) + { + LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); + ret_val = FALSE; + } + else + { + ioctl_cb_data_ptr->cb_is_selected = TRUE; + ioctl_cb_data_ptr->cb_is_waiting = FALSE; + ioctl_cb_data_ptr->cb_has_arrived = FALSE; + ioctl_cb_data_ptr->client_handle = handle; + ioctl_cb_data_ptr->ioctl_type = ioctl_type; + memset (&(ioctl_cb_data_ptr->cb_payload), 0, sizeof (rpc_loc_ioctl_callback_s_type)); + ret_val = TRUE; + } + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_wait_cb + +DESCRIPTION + Waits for a selected callback. The wait expires in timeout_msec. + + If the function is called before an existing wait has finished, it will + immediately return EBUSY. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_wait_cb( + int timeout_msec, // Timeout in this number of msec + rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + int rc; // return code from pthread calls + + struct timeval present_time; + struct timespec expire_time; + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + + do { + if (ioctl_cb_data_ptr->cb_is_selected == FALSE) + { + LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); + ret_val = FALSE; + break; + } + + // Calculate absolute expire time + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_sec += timeout_msec / 1000; + if ((present_time.tv_usec + timeout_msec) >= 1000) + { + expire_time.tv_sec += 1; + } + expire_time.tv_nsec = (present_time.tv_usec + timeout_msec) % 1000 * 1000; + + // Special case where callback is issued before loc_ioctl ever returns + if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) + { + LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); + ret_val = TRUE; + break; + } + + ioctl_cb_data_ptr->cb_is_waiting = TRUE; + // Wait for the callback until timeout expires + rc = pthread_cond_timedwait(&ioctl_cb_data_ptr->cb_arrived_cond, + &ioctl_cb_data_ptr->cb_data_mutex, + &expire_time); + + if (rc == 0) + { + ret_val = TRUE; + } + else + { + ret_val = FALSE; + } + + LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); + + } while (0); + + // Process the ioctl callback data when IOCTL is successful + if (ret_val == TRUE) + { + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + if (ioctl_cb_data_ptr->cb_payload.status == RPC_LOC_API_SUCCESS) + { + ret_val = TRUE; + if (cb_data_ptr != NULL) + { + memcpy (cb_data_ptr, + &(ioctl_cb_data_ptr->cb_payload), + sizeof (rpc_loc_ioctl_callback_s_type)); + } + } + else + { + ret_val = FALSE; + } + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_eng_ioctl_process_cb + +DESCRIPTION + This function process the IOCTL callback, parameter specifies the client + that receives the IOCTL callback. + +DEPENDENCIES + N/A + +RETURN VALUE + TRUE if successful + FALSE if failed + +SIDE EFFECTS + N/A + +===========================================================================*/ +boolean loc_eng_ioctl_process_cb ( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr + ) +{ + boolean ret_val = FALSE; // the return value of this function + loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; + ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); + + pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); + if (client_handle != ioctl_cb_data_ptr->client_handle) + { + LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", + (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); + ret_val = FALSE; + } + else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) + { + LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", + cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); + ret_val = FALSE; + } + else // both matches + { + memcpy (&(ioctl_cb_data_ptr->cb_payload), + cb_data_ptr, + sizeof (rpc_loc_ioctl_callback_s_type)); + + ioctl_cb_data_ptr->cb_has_arrived = TRUE; + + LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", + (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, + (int32) ioctl_cb_data_ptr->cb_payload.status); + + ret_val = TRUE; + } + + pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); + + // Signal the waiting thread that callback has arrived + if (ret_val == TRUE) + { + pthread_cond_signal (&ioctl_cb_data_ptr->cb_arrived_cond); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h new file mode 100644 index 00000000..eb0c201a --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_IOCTL_H +#define LOC_ENG_IOCTL_H + +// Module data +typedef struct loc_eng_ioctl_data_s_type +{ + // We are waiting for an ioctl callback + boolean cb_is_selected; + // The thread has been put in a wait state for an ioctl callback + boolean cb_is_waiting; + // Loc client handle that is waiting for the callback + rpc_loc_client_handle_type client_handle; + // IOCTL type that the loc client is waiting for + rpc_loc_ioctl_e_type ioctl_type; + // The IOCLT report has arrived for the waiting client + boolean cb_has_arrived; + // The payload for the RPC_LOC_EVENT_IOCTL_REPORT + rpc_loc_ioctl_callback_s_type cb_payload; + // Mutex to access this data structure + pthread_mutex_t cb_data_mutex; + // LOC ioctl callback arrived mutex + pthread_cond_t cb_arrived_cond; +} loc_eng_ioctl_data_s_type; + + +extern boolean 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 +); + +extern boolean loc_eng_ioctl_process_cb +( + rpc_loc_client_handle_type client_handle, + const rpc_loc_ioctl_callback_s_type *cb_data_ptr +); +#endif // LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp new file mode 100644 index 00000000..3df0af14 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -0,0 +1,609 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include +#include + +#include +#include +#include +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_eng_ni_init, + loc_eng_ni_respond, +}; + +boolean loc_eng_ni_data_init = FALSE; +loc_eng_ni_data_s_type loc_eng_ni_data; + +extern loc_eng_data_s_type loc_eng_data; + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ + +/*=========================================================================== + +FUNCTION respond_from_enum + +DESCRIPTION + Returns the name of the response + +RETURN VALUE + response name string + +===========================================================================*/ +static const char* respond_from_enum(rpc_loc_ni_user_resp_e_type resp) +{ + switch (resp) + { + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT: + return "accept"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY: + return "deny"; + case RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP: + return "no response"; + default: + return NULL; + } +} + +/*=========================================================================== + +FUNCTION loc_ni_respond + +DESCRIPTION + Displays the NI request and awaits user input. If a previous request is + in session, the new one is handled using sys.ni_default_response (if exists); + otherwise, it is denied. + +DEPENDENCY + Do not lock the data by mutex loc_ni_lock + +RETURN VALUE + none + +===========================================================================*/ +static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, + const rpc_loc_ni_event_s_type *request_pass_back +) +{ + LOGD("Sending NI response: %s\n", respond_from_enum(resp)); + + 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, + request_pass_back, sizeof (rpc_loc_ni_event_s_type)); + data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = resp; + + loc_eng_ioctl( + loc_eng_data.client_handle, + RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, + &data, + LOC_IOCTL_DEFAULT_TIMEOUT, + &callback_payload + ); +} + +/*=========================================================================== + +FUNCTION loc_ni_fill_notif_verify_type + +DESCRIPTION + Fills need_notify, need_verify, etc. + +RETURN VALUE + none + +===========================================================================*/ +static boolean loc_ni_fill_notif_verify_type(GpsNiNotification *notif, + rpc_loc_ni_notify_verify_e_type notif_priv) +{ + notif->notify_flags = 0; + notif->default_response = GPS_NI_RESPONSE_NORESP; + + switch (notif_priv) + { + case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: + notif->notify_flags = 0; + break; + + case RPC_LOC_NI_USER_NOTIFY_ONLY: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + 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; + break; + + 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; + break; + + case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return FALSE; + } + + return TRUE; +} + +/*=========================================================================== + +FUNCTION hexcode + +DESCRIPTION + Converts a binary array into a Hex string. E.g., 1F 00 3F --> "1F003F" + +RETURN VALUE + bytes encoded + +===========================================================================*/ +static 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; +} + +static GpsNiEncodingType convert_encoding_type(int loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case RPC_LOC_NI_SUPL_UTF8: + enc = GPS_ENC_SUPL_UTF8; + break; + case RPC_LOC_NI_SUPL_UCS2: + enc = GPS_ENC_SUPL_UCS2; + break; + case RPC_LOC_NI_SUPL_GSM_DEFAULT: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + default: + break; + } + + return enc; +} + +/*=========================================================================== + +FUNCTION loc_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 + +===========================================================================*/ +static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) +{ + GpsNiNotification notif; + notif.size = sizeof(notif); + strlcpy(notif.text, "[text]", sizeof notif.text); // defaults + strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); + + /* If busy, use default or deny */ + if (loc_eng_ni_data.notif_in_progress) + { +#if 0 + /* Cannot be here because the current thread is in RPC client */ + /* XXX Consider adding an event queue to process overlapped NI requests */ + loc_ni_user_resp_e_type response = + sys.ni_default_resp == 1 /* accept */ ? + LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT : + LOC_NI_LCS_NOTIFY_VERIFY_DENY; + + loc_ni_respond(response, ni_req); */ +#endif + LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", + ni_req->event); + } + else { + /* Print notification */ + LOGD("NI Notification: %s, event: %d", msg, ni_req->event); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + /* Save request */ + memcpy(&loc_eng_ni_data.loc_ni_request, ni_req, sizeof loc_eng_ni_data.loc_ni_request); + + /* Set up NI response waiting */ + loc_eng_ni_data.notif_in_progress = TRUE; + loc_eng_ni_data.current_notif_id = abs(rand()); + + /* Fill in notification */ + notif.notification_id = loc_eng_ni_data.current_notif_id; + + const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req; + const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; + const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req; + + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + vx_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; + notif.ni_type = GPS_NI_TYPE_VOICE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // vx_req->user_resp_timer_val; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // 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 = convert_encoding_type(vx_req->encoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, vx_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + umts_cp_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // umts_cp_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Stores notification text + hexcode(notif.text, sizeof notif.text, +#if (AMSS_VERSION==3200) + umts_cp_req->notification_text.notification_text_val, +#else + umts_cp_req->notification_text, +#endif + umts_cp_req->notification_length); + + // Stores requestor ID + hexcode(notif.requestor_id, sizeof notif.requestor_id, +#if (AMSS_VERSION==3200) + umts_cp_req->requestor_id.requestor_id_string.requestor_id_string_val, +#else + umts_cp_req->requestor_id.requestor_id_string, +#endif + umts_cp_req->requestor_id.string_len); + + notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, umts_cp_req->notification_priv_type); + + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + notif.timeout = LOC_NI_NO_RESPONSE_TIME; // supl_req->user_response_timer; + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + // Client name + if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) + { + hexcode(notif.text, sizeof notif.text, +#if (AMSS_VERSION==3200) + supl_req->client_name.client_name_string.client_name_string_val, /* buffer */ +#else + supl_req->client_name.client_name_string, /* buffer */ +#endif + supl_req->client_name.string_len /* length */ + ); + LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); + } else { + LOGD("SUPL NI: client_name not present."); + } + + // Requestor ID + if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, +#if (AMSS_VERSION==3200) + supl_req->requestor_id.requestor_id_string.requestor_id_string_val, /* buffer */ +#else + supl_req->requestor_id.requestor_id_string, /* buffer */ +#endif + supl_req->requestor_id.string_len /* length */ + ); + LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); + } else { + LOGD("SUPL NI: requestor_id not present."); + } + + // Encoding type + if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) + { + notif.text_encoding = convert_encoding_type(supl_req->datacoding_scheme); + notif.requestor_id_encoding = convert_encoding_type(supl_req->datacoding_scheme); + } else { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + // Set default_response & notify_flags + loc_ni_fill_notif_verify_type(¬if, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); + + break; + + default: + LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); + return; + } + + /* Log requestor ID and text for debugging */ + LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); + LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); + LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); + + /* For robustness, always sets a timeout to clear up the notification status, even though + * the OEM layer in java does not do so. + **/ + loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); + LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + /* Notify callback */ + if (loc_eng_data.ni_notify_cb != NULL) + { + loc_eng_data.ni_notify_cb(¬if); + } + } +} + +/*=========================================================================== + +FUNCTION loc_ni_process_user_response + +DESCRIPTION + Handles user input from the UI + +RETURN VALUE + error code (0 for successful, -1 for error) + +===========================================================================*/ +int loc_ni_process_user_response(GpsUserResponseType userResponse) +{ + LOGD("NI response from UI: %d", userResponse); + + rpc_loc_ni_user_resp_e_type resp; + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; + break; + case GPS_NI_RESPONSE_DENY: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; + break; + case GPS_NI_RESPONSE_NORESP: + resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; + break; + default: + return -1; + } + + loc_ni_respond(resp, &loc_eng_ni_data.loc_ni_request); + + /* Make the NI respond */ + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.response_time_left = 0; + loc_eng_ni_data.current_notif_id = -1; + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + + return 0; +} + +/*=========================================================================== + +FUNCTION loc_eng_ni_callback + +DESCRIPTION + Loc API callback handler + +RETURN VALUE + error code (0 for success) + +===========================================================================*/ +int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +) +{ + int rc = 0; + const rpc_loc_ni_event_s_type *ni_req = &loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request; + if (loc_event == RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) + { + switch (ni_req->event) + { + case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: + LOGI("VX Notification"); + loc_ni_request_handler("VX Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: + LOGI("UMTS CP Notification\n"); + loc_ni_request_handler("UMTS CP Notify", ni_req); + break; + + case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: + LOGI("SUPL Notification\n"); + loc_ni_request_handler("SUPL Notify", ni_req); + break; + + default: + LOGE("Unknown NI event: %x\n", (int) ni_req->event); + break; + } + } + return rc; +} + +/*=========================================================================== + +FUNCTION loc_ni_thread_proc + +===========================================================================*/ +static void loc_ni_thread_proc(void *unused) +{ + LOGI("Starting Loc NI thread...\n"); + + while (1) + { + /* wakes up every second to check timed out requests */ + sleep(1); + + pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); + + if (loc_eng_ni_data.notif_in_progress && loc_eng_ni_data.response_time_left > 0) + { + loc_eng_ni_data.response_time_left--; + if (loc_eng_ni_data.response_time_left <= 0) + { + loc_ni_respond(RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP, &loc_eng_ni_data.loc_ni_request); + loc_eng_ni_data.notif_in_progress = FALSE; + } + } + + pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); + } /* while (1) */ +} + +/*=========================================================================== +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(GpsNiCallbacks *callbacks) +{ + LOGD("loc_eng_ni_init: entered."); + + if (!loc_eng_ni_data_init) + { + pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); + callbacks->create_thread_cb("loc_api_ni", loc_ni_thread_proc, NULL); + loc_eng_ni_data_init = TRUE; + } + + loc_eng_ni_data.notif_in_progress = FALSE; + loc_eng_ni_data.current_notif_id = -1; + loc_eng_ni_data.response_time_left = 0; + + srand(time(NULL)); + loc_eng_data.ni_notify_cb = callbacks->notify_cb; +} + +/*=========================================================================== +FUNCTION loc_eng_ni_respond + +DESCRIPTION + This function sends an NI respond to the modem processor + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) +{ + if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) + { + LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + loc_ni_process_user_response(user_response); + } else { + LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", + notif_id, user_response); + } +} diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h new file mode 100644 index 00000000..193b9f85 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ + +extern const GpsNiInterface sLocEngNiInterface; + +typedef struct { + pthread_mutex_t loc_ni_lock; + int response_time_left; /* examine time for NI response */ + boolean notif_in_progress; /* NI notification/verification in progress */ + rpc_loc_ni_event_s_type loc_ni_request; + int current_notif_id; /* ID to check against response */ +} loc_eng_ni_data_s_type; + +// Functions for sLocEngNiInterface +extern void loc_eng_ni_init(GpsNiCallbacks *callbacks); +extern void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response); + +extern int loc_eng_ni_callback ( + rpc_loc_event_mask_type loc_event, /* event mask */ + const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ +); + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp new file mode 100644 index 00000000..1ec3bf07 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -0,0 +1,180 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include +#include + +#include +#include + +#include + +#define LOG_TAG "lib_locapi" +#include + +// comment this out to enable logging +// #undef LOGD +// #define LOGD(...) {} + +#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) +#define XTRA_BLOCK_SIZE (400) + +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks); +static int qct_loc_eng_inject_xtra_data(char* data, int length); + +const GpsXtraInterface sLocEngXTRAInterface = +{ + sizeof(GpsXtraInterface), + qct_loc_eng_xtra_init, + qct_loc_eng_inject_xtra_data, +}; + +/*=========================================================================== +FUNCTION qct_loc_eng_xtra_init + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks) +{ + rpc_loc_event_mask_type event; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &(loc_eng_data.xtra_module_data); + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +FUNCTION qct_loc_eng_inject_xtra_data + +DESCRIPTION + Injects XTRA file into the engine. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int qct_loc_eng_inject_xtra_data(char* data, int length) +{ + int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; + boolean ret_val = 0; + int total_parts; + uint8 part; + uint16 part_len; + uint16 len_injected; + rpc_loc_ioctl_data_u_type ioctl_data; + rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; + + LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); + + ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_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 / XTRA_BLOCK_SIZE); + if ((total_parts % XTRA_BLOCK_SIZE) != 0) + { + total_parts += 1; + } + predicted_orbits_data_ptr->total_parts = total_parts; + + len_injected = 0; // O bytes injected + // 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; + + LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); + LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); + + if (part < total_parts) + { + // No callback in this case + rpc_ret_val = loc_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data); + + if (rpc_ret_val != RPC_LOC_API_SUCCESS) + { + LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); + ret_val = EINVAL; // return error + break; + } + } + else // part == total_parts + { + // Last part injection, will need to wait for callback + ret_val = loc_eng_ioctl (loc_eng_data.client_handle, + RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, + &ioctl_data, + LOC_XTRA_INJECT_DEFAULT_TIMEOUT, + NULL /* No output information is expected*/); + break; // done with injection + } + + len_injected += predicted_orbits_data_ptr->part_len; + LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); + } + + return ret_val; +} diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h new file mode 100644 index 00000000..82778ae5 --- /dev/null +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +extern const GpsXtraInterface sLocEngXTRAInterface; + +// Module data +typedef struct +{ + // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; + gps_xtra_download_request download_request_cb; + +} loc_eng_xtra_data_s_type; + +#endif // LOC_ENG_XTRA_H diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk new file mode 100755 index 00000000..f37ca311 --- /dev/null +++ b/loc_api/libloc_api_50001/Android.mk @@ -0,0 +1,125 @@ +ifneq ($(BUILD_TINY_ANDROID),true) +#Compile this library only for builds with the latest modem image + +BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion +BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 +ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) +FEATURE_GNSS_BIT_API := true +endif # is-board-platform-in-list + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_adapter + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + loc_eng_log.cpp \ + LocApiAdapter.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_COPY_HEADERS_TO:= libloc_eng/ +LOCAL_COPY_HEADERS:= \ + LocApiAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_msg_id.h \ + loc_eng_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_eng + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_adapter \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_agps.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + loc_eng_log.cpp + +ifeq ($(FEATURE_GNSS_BIT_API), true) +LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API +endif # FEATURE_GNSS_BIT_API + +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 \ + hardware/qcom/gps/loc_api/ulp/inc + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) + +LOCAL_MODULE_TAGS := optional + +## Libs + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libloc_eng \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc.cpp \ + gps.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ \ + +## Includes +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp new file mode 100644 index 00000000..a6a1ed94 --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -0,0 +1,226 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_adapter" + +#include +#include +#include "loc_eng_msg.h" +#include "loc_log.h" +#include "loc_eng_ni.h" + +static void* noProc(void* data) +{ + return NULL; +} + +LocEng::LocEng(void* caller, + LOC_API_ADAPTER_EVENT_MASK_T emask, + gps_acquire_wakelock acqwl, + gps_release_wakelock relwl, + loc_msg_sender msgSender, + loc_ext_parser posParser, + loc_ext_parser svParser) : + owner(caller), + eventMask(emask), acquireWakelock(acqwl), + releaseWakeLock(relwl), sendMsge(msgSender), + extPosInfo(NULL == posParser ? noProc : posParser), + extSvInfo(NULL == svParser ? noProc : svParser) +{ + LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); +} + +LocApiAdapter::LocApiAdapter(LocEng &locEng) : + locEngHandle(locEng) +{ + LOC_LOGD("LocApiAdapter created"); +} + +LocApiAdapter::~LocApiAdapter() +{ + LOC_LOGV("LocApiAdapter deleted"); +} + +LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) +{ + void* handle; + LocApiAdapter* adapter = NULL; + + handle = dlopen ("libloc_api_v02.so", RTLD_NOW); + + if (!handle) { + LOC_LOGI("%s: dlopen(libloc_api_v02.so) failed, trying to load libloc_api-rpc-qc.so", __FUNCTION__); + handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); + } + else + LOC_LOGE("%s: dlopen(libloc_api_v02.so) succeeded.", __FUNCTION__); + + if (!handle) { + LOC_LOGI("%s: dlopen(libloc_api-rpc-qc.so) failed, constructing LocApiAdapter", __FUNCTION__); + adapter = new LocApiAdapter(locEng); + } else { + getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); + if (!getHandle) { + LOC_LOGE("%s: dlsym(getLocApiAdapter) failed", __FUNCTION__); + return NULL; + } + adapter = (*getHandle)(locEng); + } + + return adapter; +} + +int LocApiAdapter::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 LocApiAdapter::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; +} + +void LocApiAdapter::reportPosition(GpsLocation &location, + void* locationExt, + enum loc_sess_status status) +{ + loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, + location, + locationExt, + status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) +{ + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportStatus(GpsStatusValue status) +{ + loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportNmea(const char* nmea, int length) +{ + loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseATL(int connHandle) +{ + loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestXtraData() +{ + LOC_LOGD("XTRA download request"); + + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestTime() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestLocation() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineDownEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineUpEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h new file mode 100644 index 00000000..5e8a1da8 --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -0,0 +1,208 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define LOC_API_ADAPTER_H + +#include +#include +#include +#include + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< + +#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)); + 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/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp new file mode 100644 index 00000000..16bed3b1 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.cpp @@ -0,0 +1,870 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static gps_location_callback gps_loc_cb = NULL; +static gps_sv_status_callback gps_sv_cb = NULL; + +static void loc_cb(GpsLocation* location, void* locExt); +static void sv_cb(GpsSvStatus* sv_status, void* svExt); + +// 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); +#ifdef QCOM_FEATURE_ULP +static int loc_update_criteria(UlpLocationCriteria criteria); +#endif + +// 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 +#ifdef QCOM_FEATURE_ULP + ,loc_update_criteria +#endif +}; + +// Function declarations for sLocEngAGpsInterface +static void loc_agps_init(AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +static int loc_agps_closed(AGpsType agpsType); +static int loc_agps_open_failed(AGpsType agpsType); +#else +static int loc_agps_open(const char* apn); +static int loc_agps_closed(); +static int loc_agps_open_failed(); +#endif +static int loc_agps_set_server(AGpsType type, const char *hostname, int port); + +static const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server +}; + +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); + +const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + +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 +}; + +#ifdef QCOM_FEATURE_ULP +static bool loc_inject_raw_command(char* command, int length); + +static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = +{ + sizeof(InjectRawCmdInterface), + loc_inject_raw_command +}; +#endif + +static loc_eng_data_s_type loc_afw_data; + +/*=========================================================================== +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 + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + ENTRY_LOG_CALLFLOW(); + const GpsInterface* ret_val; + + char propBuf[PROPERTY_VALUE_MAX]; + + // check to see if GPS should be disabled + 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; + } + + EXIT_LOG(%p, ret_val); + return ret_val; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + 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) +{ + ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event = + 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; + LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ + callbacks->status_cb, /* status_cb */ + 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 */}; + gps_loc_cb = callbacks->location_cb; + gps_sv_cb = callbacks->sv_status_cb; + + int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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_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 = 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(); + 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; + } + int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, + recurrence, min_interval, + preferred_accuracy, preferred_time); + + 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 = 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 = 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_update_criteria(UlpLocationCriteria criteria) +{ + ENTRY_LOG(); + int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +static const void* loc_get_extension(const char* name) +{ + ENTRY_LOG(); + const void* ret_val = NULL; + + 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) + { + ret_val = &sLocEngAGpsRilInterface; + } +#ifdef QCOM_FEATURE_ULP + else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) + { + ret_val = &sLocEngInjectRawCmdInterface; + } +#endif + 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, 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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_open(AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_open(const char* apn) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open(loc_afw_data, apn); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +static int loc_agps_closed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +static int loc_agps_closed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_closed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_agps_open_failed(AGpsType agpsType) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#else +int loc_agps_open_failed() +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_open_failed(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif + +/*=========================================================================== +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; + } + int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION 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(); + int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks); + + 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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(); + loc_eng_ni_init(loc_afw_data, callbacks); + 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); +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static bool loc_inject_raw_command(char* command, int length) +{ + ENTRY_LOG(); + int ret_val = loc_eng_inject_raw_command(loc_afw_data, command, length); + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +#endif + + +static void loc_cb(GpsLocation* location, void* locExt) +{ + ENTRY_LOG(); + if (NULL != gps_loc_cb && NULL != location) { +#ifdef QCOM_FEATURE_ULP + CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); +#else + CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); +#endif + gps_loc_cb(location); + } + EXIT_LOG(%s, VOID_RET); +} + +static void 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); +} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h new file mode 100644 index 00000000..bf942373 --- /dev/null +++ b/loc_api/libloc_api_50001/loc.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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_STANDALONE, + 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 +} LocPositionMode; + +typedef void (*loc_location_cb_ext) (GpsLocation* 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; +} LocCallbacks; + +enum loc_sess_status { + LOC_SESS_SUCCESS, + LOC_SESS_INTERMEDIATE, + LOC_SESS_FAILURE +}; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_H__ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp new file mode 100644 index 00000000..3fe9a77e --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -0,0 +1,1831 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 /* struct sockaddr_in */ +#include +#include +#include +#include +#include + +#include "LocApiAdapter.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ulp.h" + +#include "log_util.h" +#include "loc_eng_log.h" + +#define SUCCESS TRUE +#define FAILURE FALSE + + +static void loc_eng_deferred_action_thread(void* context); +static void* loc_eng_create_msg_q(); +static void loc_eng_free_msg(void* msg); + +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + +pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; +LocEngContext* LocEngContext::me = NULL; + +LocEngContext::LocEngContext(gps_create_thread threadCreator) : + deferred_q((const void*)loc_eng_create_msg_q()), + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), + counter(0) +{ + LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", + getpid(), gettid(), + deferred_action_thread); +} + +LocEngContext* LocEngContext::get(gps_create_thread threadCreator) +{ + pthread_mutex_lock(&lock); + // gonna need mutex protection here... + if (NULL == me) { + // gps.conf is not part of the context class. But we only want to parse the conf + // file once. This is the only good place to ensure that. + // In fact one day the conf file should go into context as well. + loc_read_gps_conf(); + + me = new LocEngContext(threadCreator); + } + me->counter++; + + pthread_mutex_unlock(&lock); + return me; +} + +void LocEngContext::drop() +{ + if (deferred_action_thread != pthread_self()) { + pthread_mutex_lock(&lock); + counter--; + if (counter == 0) { + loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); + msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); + + // I am not sure if this is going to be hazardous. The calling thread + // might be blocked for a while, if the q is loaded. I am wondering + // if we should just dump all the msgs in the q upon QUIT. + pthread_cond_wait(&cond, &lock); + + msg_q_destroy((void**)&deferred_q); + delete me; + me = NULL; + } + pthread_mutex_unlock(&lock); + } else { + LOC_LOGE("The HAL thread cannot free itself"); + } +} + +// 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 char extra_data[100]; + +#ifdef QCOM_FEATURE_ULP +// ULP integration +static const ulpInterface* locEngUlpInf = NULL; +static int loc_eng_ulp_init(void* handle) ; +#endif + +/********************************************************************* + * 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) + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); +} + +static void* loc_eng_create_msg_q() +{ + void* q = NULL; + if (eMSG_Q_SUCCESS != msg_q_init(&q)) { + LOC_LOGE("loc_eng_create_msg_q Q init failed."); + q = NULL; + } + return q; +} + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +/*=========================================================================== +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) +{ + ENTRY_LOG_CALLFLOW(); + + if (NULL == callbacks || 0 == event) { + LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); + EXIT_LOG(%d, 0); + return 0; + } + + STATE_CHECK((NULL == loc_eng_data.context), + "instance already initialized", return 0); + + memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + + // Create context (msg q + thread) (if not yet created) + // This will also parse gps.conf, if not done. + loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + + // 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; + + 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; + +#ifdef QCOM_FEATURE_ULP + loc_eng_ulp_init(&loc_eng_data); +#endif + + LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, + callbacks->location_ext_parser, callbacks->sv_ext_parser); + loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); + + int ret_val =-1; + if (NULL == loc_eng_data.client_handle) { + // drop the context and declare failure + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + } else { + LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); + + // call reinit to send initialization messages + int tries = 30; + while (tries > 0 && + LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { + tries--; + LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); + sleep(1); + } + } + + 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_eng_data.client_handle->reinit(); + + if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { + LOC_LOGD("loc_eng_reinit reinit() successful"); + + loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, + gps_conf.SUPL_VER)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + supl_msg, loc_eng_free_msg); + + loc_eng_msg_sensor_control_config *sensor_control_config_msg( + new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_control_config_msg, loc_eng_free_msg); + + /* Make sure this is specified by the user in the gps.conf file */ + if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) + { + loc_eng_msg_sensor_properties *sensor_properties_msg( + new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_properties_msg, loc_eng_free_msg); + } + + loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( + new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, + gps_conf.SENSOR_CONTROL_MODE, + gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_perf_control_conf_msg, loc_eng_free_msg); + } + + 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.context, 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.navigating) + { + 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. + + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + + // De-initialize ulp + if (locEngUlpInf != NULL) + { + locEngUlpInf->destroy (); + locEngUlpInf = NULL; + } + + if (loc_eng_data.client_handle != NULL) + { + LOC_LOGD("loc_eng_init: client opened. close it now."); + delete loc_eng_data.client_handle; + loc_eng_data.client_handle = NULL; + } + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + +#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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + if (NULL == locEngUlpInf || + locEngUlpInf->start_fix () == 1) { + ret_val = loc_eng_data.client_handle->startFix(); + } +#else + ret_val = loc_eng_data.client_handle->startFix(); +#endif + + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) + { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); + loc_eng_data.navigating = TRUE; + } + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_stop + +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.context, return -1); + + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.navigating) { +#ifdef QCOM_FEATURE_ULP + // Stops the ULP + if (locEngUlpInf != NULL) + { + locEngUlpInf->stop_fix (); + } +#endif + + ret_val = loc_eng_data.client_handle->stopFix(); + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) + { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); + } + + loc_eng_data.navigating = 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, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + loc_eng_msg_position_mode *msg( + new loc_eng_msg_position_mode(&loc_eng_data, mode, + recurrence, min_interval, + preferred_accuracy, preferred_time)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_set_time *msg( + new loc_eng_msg_set_time(&loc_eng_data, + time, + timeReference, + uncertainty)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return -1); + loc_eng_msg_inject_location *msg( + new loc_eng_msg_inject_location(&loc_eng_data, + latitude, + longitude, + accuracy)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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.context, return); + + loc_eng_msg_delete_aiding_data *msg( + new loc_eng_msg_delete_aiding_data(&loc_eng_data, + f)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + 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(); + + static GpsStatusValue last_status = GPS_STATUS_NONE; + + GpsStatus gs = { sizeof(gs),status }; + + + if (loc_eng_data.status_cb) + { + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); + loc_eng_data.status_cb(&gs); + } + + last_status = status; + + EXIT_LOG(%s, VOID_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(%p, 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, AGpsCallbacks* callbacks) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return); + STATE_CHECK((NULL == loc_eng_data.agps_status_cb), + "agps instance already initialized", + return); + loc_eng_data.agps_status_cb = callbacks->status_cb; + + loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#ifdef QCOM_FEATURE_IPV6 + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_WWAN_ANY); +#else + loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL); +#endif + +#ifdef FEATURE_GNSS_BIT_API + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if ((strcmp(baseband,"svlte2a") == 0)) + { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + } +#endif /* FEATURE_GNSS_BIT_API */ + + loc_eng_agps_reinit(loc_eng_data); + EXIT_LOG(%p, VOID_RET); +} + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, + apn_len, bearerType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, + const char* apn) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, apn, + apn_len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== +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 + +===========================================================================*/ +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#else +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + return -1); + + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + + EXIT_LOG(%d, 0); + return 0; +} +#endif + +/*=========================================================================== + +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; + + if (LOC_AGPS_SUPL_SERVER == type) { + char url[MAX_URL_LEN]; + unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + + if (sizeof(url) > len) { + loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, + url, len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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); + loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, + ip, + port, + type)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + } 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; + + if (NULL != loc_eng_data.context) + { + ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); + } else { + LOC_LOGW("set_server called before init. 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); + } + } + + 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(); + INIT_CHECK(loc_eng_data.context, 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); + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, + apn_len, available)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } + 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 + if (status != GPS_STATUS_NONE && + !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.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); + + if (loc_eng_data.agps_status_cb != NULL) { + loc_eng_data.agnss_nif->dropAllSubscribers(); + loc_eng_data.internet_nif->dropAllSubscribers(); + + loc_eng_agps_reinit(loc_eng_data); + } + + loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); + + // modem is back up. If we crashed in the middle of navigating, we restart. + if (loc_eng_data.navigating) { + loc_eng_data.client_handle->setPositionMode( + loc_eng_data.position_mode.pMode, + loc_eng_data.position_mode.pRecurrence, + loc_eng_data.position_mode.minInterval, + loc_eng_data.position_mode.preferredAccuracy, + loc_eng_data.position_mode.preferredTime); + // not mutex protected, assuming fw won't call start twice without a + // stop call in between. + loc_eng_start_handler(loc_eng_data); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_deferred_action_thread + +DESCRIPTION + Main routine for the thread to execute loc_eng commands. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_deferred_action_thread(void* arg) +{ + ENTRY_LOG(); + loc_eng_msg *msg; + static int cnt = 0; + LocEngContext* context = (LocEngContext*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + while (1) + { + LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); + + // we are only sending / receiving msg pointers + msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; + } + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; + + LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", + __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); + + // need to ensure the instance data is valid + STATE_CHECK(NULL != loc_eng_data_p->context, + "instance cleanup happened", + delete msg; return); + + switch(msg->msgid) { + case LOC_ENG_MSG_QUIT: + { + LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; + pthread_mutex_lock(&(context->lock)); + pthread_cond_signal(&(context->cond)); + pthread_mutex_unlock(&(context->lock)); + EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); + } + return; + + case LOC_ENG_MSG_REQUEST_NI: + { + loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; + loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_INFORM_NI_RESPONSE: + { + loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; + loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, + nrMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_START_FIX: + loc_eng_start_handler(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_STOP_FIX: + if (loc_eng_data_p->agps_request_pending) + { + loc_eng_data_p->stop_request_pending = true; + LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); + } else { + loc_eng_stop_handler(*loc_eng_data_p); + } + break; + + case LOC_ENG_MSG_SET_POSITION_MODE: + { + loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; + loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, + pmMsg->minInterval,pmMsg->preferredAccuracy, + pmMsg->preferredTime); + memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); + } + break; + + case LOC_ENG_MSG_SET_TIME: + { + loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; + loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, + tMsg->uncertainty); + } + break; + + case LOC_ENG_MSG_INJECT_LOCATION: + { + loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; + loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, + ilMsg->accuracy); + } + break; + + case LOC_ENG_MSG_SET_SERVER_IPV4: + { + loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; + loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, + ssiMsg->port, + ssiMsg->serverType); + } + break; + + case LOC_ENG_MSG_SET_SERVER_URL: + { + loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; + loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); + } + break; + + case LOC_ENG_MSG_SUPL_VERSION: + { + loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; + loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: + { + loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; + loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: + { + loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: + { + loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; + loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); + } + break; + + case LOC_ENG_MSG_REPORT_POSITION: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; + if (loc_eng_data_p->location_cb != NULL) { + if (LOC_SESS_FAILURE == rpMsg->status) { + // in case we want to handle the failure case + loc_eng_data_p->location_cb(NULL, NULL); + } + // what's in the else if is... (line by line) + // 1. this is a good fix; or + // 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 == rpMsg->status || + (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && + !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && + (gps_conf.ACCURACY_THRES != 0) && + (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), + (void*)rpMsg->locationExt); + } + } + } + + break; + + case LOC_ENG_MSG_REPORT_SV: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; + if (loc_eng_data_p->sv_status_cb != NULL) { + loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), + (void*)rsMsg->svExt); + } + } + break; + + case LOC_ENG_MSG_REPORT_STATUS: + loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); + break; + + case LOC_ENG_MSG_REPORT_NMEA: + if (NULL != loc_eng_data_p->nmea_cb) { + loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); + } + break; + + case LOC_ENG_MSG_REQUEST_BIT: + { + loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; + AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_BIT: + { + loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; + AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); + + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_REQUEST_ATL: + { + loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + ATLSubscriber subscriber(arqMsg->handle, + stateMachine, + loc_eng_data_p->client_handle); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_ATL: + { + loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; + ATLSubscriber s1(arlMsg->handle, + loc_eng_data_p->agnss_nif, + loc_eng_data_p->client_handle); + // attempt to unsubscribe from agnss_nif first + if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + ATLSubscriber s2(arlMsg->handle, + loc_eng_data_p->internet_nif, + loc_eng_data_p->client_handle); + // if unsuccessful, try internet_nif + loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); + } + } + break; + + case LOC_ENG_MSG_REQUEST_XTRA_DATA: + if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) + { + loc_eng_data_p->xtra_module_data.download_request_cb(); + } + break; + + case LOC_ENG_MSG_REQUEST_TIME: + break; + + case LOC_ENG_MSG_REQUEST_POSITION: + break; + + case LOC_ENG_MSG_DELETE_AIDING_DATA: + loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; + break; + + case LOC_ENG_MSG_ENABLE_DATA: + { + loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; + loc_eng_data_p->client_handle->enableData(unaMsg->enable); + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + } + break; + + case LOC_ENG_MSG_INJECT_XTRA_DATA: + { + loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; + loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_SUCCESS: + { + loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + + stateMachine->setBearer(aosMsg->bearerType); +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + stateMachine->setAPN(aosMsg->apn, aosMsg->length); + stateMachine->onRsrcEvent(RSRC_GRANTED); + } + break; + + case LOC_ENG_MSG_ATL_CLOSED: + { + loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_RELEASED); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_FAILED: + { + loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; +#ifdef QCOM_FEATURE_IPV6 + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; +#else + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif + + stateMachine->onRsrcEvent(RSRC_DENIED); + } + break; + + case LOC_ENG_MSG_ENGINE_DOWN: + loc_eng_handle_engine_down(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_ENGINE_UP: + loc_eng_handle_engine_up(*loc_eng_data_p); + break; + + default: + LOC_LOGE("unsupported msgid = %d\n", msg->msgid); + break; + } + + if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | + (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | + (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) + { + loc_eng_data_p->agps_request_pending = false; + if (loc_eng_data_p->stop_request_pending) { + loc_eng_stop_handler(*loc_eng_data_p); + loc_eng_data_p->stop_request_pending = false; + } + } + loc_eng_data_p->stop_request_pending = false; + + if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && + loc_eng_data_p->aiding_data_for_deletion != 0) + { + loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); + loc_eng_data_p->aiding_data_for_deletion = 0; + } + + delete msg; + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_report_position_ulp + +DESCRIPTION + Report a ULP position + p_ulp_pos_absolute, ULP position in absolute coordinates + +DEPENDENCIES + None + +RETURN VALUE + 0: SUCCESS + others: error + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_report_position_ulp (void* handle, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data) +{ + ENTRY_LOG(); + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; + + INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, + return -1); + + if (ext_data_length > sizeof (extra_data)) + { + ext_data_length = sizeof (extra_data); + } + + memcpy(extra_data, + ext_data, + ext_data_length); + + loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, + NULL, LOC_SESS_SUCCESS); + + EXIT_LOG(%d, 0); + return 0; +} + +#ifdef QCOM_FEATURE_ULP +/*=========================================================================== +FUNCTION loc_eng_ulp_init + +DESCRIPTION + This function dynamically loads the libulp.so and calls + its init function to start up the ulp module + +DEPENDENCIES + None + +RETURN VALUE + 0: no error + -1: errors + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_ulp_init(void* owner) +{ + ENTRY_LOG(); + int ret_val; + void *handle; + const char *error; + get_ulp_interface* get_ulp_inf; + + if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { + LOC_LOGD ("%s, ULP is not supported\n", __func__); + ret_val = -1; + goto exit; + } + + handle = dlopen ("libulp.so", RTLD_NOW); + if (!handle) + { + LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); + ret_val = -1; + goto exit; + } + dlerror(); /* Clear any existing error */ + + get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); + ret_val = -1; + goto exit; + } + + locEngUlpInf = get_ulp_inf(); + + // Initialize the ULP interface + locEngUlpInf->init (owner, loc_eng_report_position_ulp); + + ret_val = 0; +exit: + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_raw_command + +DESCRIPTION + This is used to send special test modem commands from the applications + down into the HAL +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + boolean ret_val; + LOC_LOGD("loc_eng_send_extra_command: %s\n", command); + ret_val = TRUE; + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} +/*=========================================================================== +FUNCTION loc_eng_update_criteria + +DESCRIPTION + This is used to inform the ULP module of new unique criteria that are passed + in by the applications +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.context, return -1); + int ret_val; + ret_val = 0; + + EXIT_LOG(%d, ret_val); + return ret_val; +} +#endif diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h new file mode 100644 index 00000000..73578ec8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -0,0 +1,204 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#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 MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) + +enum loc_mute_session_e_type { + LOC_MUTE_SESS_NONE = 0, + LOC_MUTE_SESS_WAIT, + LOC_MUTE_SESS_IN_SESSION +}; + +// Module data +typedef struct +{ + LocApiAdapter *client_handle; + loc_location_cb_ext location_cb; + gps_status_callback status_cb; + loc_sv_status_cb_ext sv_status_cb; + agps_status_callback agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + boolean intermediateFix; + AGpsStatusValue agps_status; + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; + loc_eng_xtra_data_s_type xtra_module_data; + loc_eng_ni_data_s_type loc_eng_ni_data; + + boolean navigating; + + // AGPS state machines + AgpsStateMachine* agnss_nif; + AgpsStateMachine* internet_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; + + void* context; + + loc_eng_msg_position_mode position_mode; + + // For muting session broadcast + loc_mute_session_e_type mute_session_state; + + // 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_eng_data_s_type; + + +int loc_eng_init(loc_eng_data_s_type &loc_eng_data, + LocCallbacks* callbacks, + LOC_API_ADAPTER_EVENT_MASK_T event); +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, + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); +const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, + const char* name); +#ifdef QCOM_FEATURE_ULP +int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, + UlpLocationCriteria criteria); +#endif + +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, + AGpsCallbacks* callbacks); +#ifdef QCOM_FEATURE_IPV6 +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + const char* apn, AGpsBearerType bearerType); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); +#else +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); +#endif + +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); + + +void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, + int avaiable, const char* apn); + + +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length); + + +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); + +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + GpsXtraCallbacks* callbacks); + +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length); + +extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, + GpsNiCallbacks *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); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // LOC_ENG_H diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp new file mode 100644 index 00000000..07475680 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -0,0 +1,702 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +//====================================================================== +// 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; + + +//====================================================================== +// Subscriber: BITSubscriber / ATLSubscriber +//====================================================================== +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(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); +} + +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( + GPSONE_LOC_API_IF_RELEASE_SUCCESS); + break; + case RSRC_DENIED: + loc_eng_dmn_conn_loc_api_server_data_conn( + GPSONE_LOC_API_IF_FAILURE); + break; + case RSRC_GRANTED: + loc_eng_dmn_conn_loc_api_server_data_conn( + 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: + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + break; + case RSRC_DENIED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + case RSRC_GRANTED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + (char*)mStateMachine->getAPN(), +#ifdef QCOM_FEATURE_IPV6 + mStateMachine->getBearer(), +#endif + mStateMachine->getType()); + break; + default: + notify = false; + } + } + + return notify; +} + + +//====================================================================== +// 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) +{ + 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); + // move the state to PENDING + nextState = mPendingState; + + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } + 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;; + 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(); + if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasingState; + } + } 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); + } + } + } + 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; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // 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;; + 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 = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } + } + break; + + 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->hasSubscribers()) { + nextState = mPendingState; + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } else { + nextState = mReleasedState; + } + } + break; + + case RSRC_GRANTED: + case RSRC_DENIED: + 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; +} + + +//====================================================================== +// AgpsStateMachine +//====================================================================== + +AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), + AGpsType type) : + mServicer(servicer), mType(type), + mStatePtr(new AgpsReleasedState(this)), + mAPN(NULL), + mAPNLen(0) +{ + 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; + 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); + } + } 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); + } +} + +void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +{ + Subscriber* s = NULL; + Notification notification(Notification::BROADCAST_ALL); + linked_list_search(mSubscribers, (void**)&s, hasSubscriber, + (void*)¬ification, false); + + if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { + AGpsStatus nifRequest; + nifRequest.size = sizeof(nifRequest); + nifRequest.type = mType; + nifRequest.status = action; + +#ifdef QCOM_FEATURE_IPV6 + if (s == NULL) { + nifRequest.ipv4_addr = INADDR_NONE; + nifRequest.ipv6_addr[0] = 0; + } else { + s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + } +#else + if (s == NULL) { + nifRequest.ipaddr = INADDR_NONE; + } else { + nifRequest.ipaddr = s->ID; + } +#endif + + CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); + (*mServicer)(&nifRequest); + } +} + +void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) +{ + 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; +} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h new file mode 100644 index 00000000..1fd0f450 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -0,0 +1,274 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +// forward declaration +class AgpsStateMachine; +class Subscriber; + +// NIF resource events +typedef enum { + RSRC_SUBSCRIBE, + RSRC_UNSUBSCRIBE, + RSRC_GRANTED, + RSRC_RELEASED, + RSRC_DENIED, + RSRC_STATUS_MAX +} AgpsRsrcStatus; + +// 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; + + // 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 AgpsStateMachine { + // 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; + + // handle to whoever provides the service + void (* const mServicer)(AGpsStatus* status); + // NIF type: AGNSS or INTERNET. + const AGpsType mType; + // pointer to the current state. + AgpsState* mStatePtr; + // a linked list of subscribers. + void* mSubscribers; + // 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; +#ifdef QCOM_FEATURE_IPV6 + // bear + AGpsBearerType mBearer; +#endif + // ipv4 address for routing + +public: + AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); + virtual ~AgpsStateMachine(); + + // self explanatory methods below + void setAPN(const char* apn, unsigned int len); + inline const char* getAPN() const { return (const char*)mAPN; } +#ifdef QCOM_FEATURE_IPV6 + inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline AGpsBearerType getBearer() const { return mBearer; } +#endif + inline AGpsType getType() const { return (AGpsType)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; + + void onRsrcEvent(AgpsRsrcStatus event); + + // put the data together and send the FW + void sendRsrcRequest(AGpsStatusValue action) const; + + 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; +}; + +// 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 int ID; + const AgpsStateMachine* mStateMachine; + inline Subscriber(const int id, + const AgpsStateMachine* stateMachine) : + ID(id), mStateMachine(stateMachine) {} + inline virtual ~Subscriber() {} + + virtual void setIPAddresses(int &v4, char* v6) = 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 { + inline BITSubscriber(const AgpsStateMachine* stateMachine, + unsigned int ipv4, char* ipv6) : + Subscriber(ipv4, stateMachine) + { + if (NULL == ipv6) { + ipv6Addr[0] = NULL; + } else { + memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); + } + } + + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } + + virtual Subscriber* clone() + { + return new BITSubscriber(mStateMachine, ID, ipv6Addr); + } + + virtual bool equals(const Subscriber *s) const; + +private: + char ipv6Addr[16]; +}; + +// ATLSubscriber, created with requests from ATL +struct ATLSubscriber : public Subscriber { + const LocApiAdapter* mLocAdapter; + inline ATLSubscriber(const int id, + const AgpsStateMachine* stateMachine, + const LocApiAdapter* adapter) : + Subscriber(id, stateMachine), mLocAdapter(adapter) {} + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(int &v4, char* v6) + { v4 = INADDR_NONE; v6[0] = 0; } + + inline virtual Subscriber* clone() + { + return new ATLSubscriber(ID, mStateMachine, mLocAdapter); + } +}; + +#endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp new file mode 100644 index 00000000..f2f9a501 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -0,0 +1,180 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#include "loc_eng_dmn_conn_glue_msg.h" +#include "loc_eng_dmn_conn_handler.h" +#include "loc_eng_dmn_conn.h" + +static int loc_api_server_msgqid; +static int loc_api_resp_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 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); + loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_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) { + LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); + usleep(1000); + return 0; + } + + 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); + 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 status) { + struct ctrl_msgbuf cmsgbuf; + cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; + cmsgbuf.cmsg.cmsg_response.result = status; + LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); + 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; + } + return 0; + +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h new file mode 100644 index 00000000..414fd553 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_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" + +#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); + +#endif /* LOC_ENG_DATA_SERVER_H */ + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c new file mode 100644 index 00000000..9cd19228 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -0,0 +1,223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h new file mode 100644 index 00000000..8bc6f2a3 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c new file mode 100644 index 00000000..74769088 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -0,0 +1,206 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*=========================================================================== +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, 0666); + + if ((result == -1) && (errno != EEXIST)) { + LOC_LOGE("failed: %s\n", strerror(errno)); + return result; + } + + 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) 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h new file mode 100644 index 00000000..3136e411 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp new file mode 100644 index 00000000..fd15f001 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -0,0 +1,78 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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; + } + + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); + +#else + loc_eng_dmn_conn_loc_api_server_data_conn(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 + loc_eng_msg_release_bit *msg( + new loc_eng_msg_release_bit(loc_api_handle, + pmsg->cmsg.cmsg_if_request.is_supl, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); +#else + loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); +#endif + return 0; +} + diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h new file mode 100644 index 00000000..833e971b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -0,0 +1,82 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +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; +}; + +struct ctrl_msg_if_request { + unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ + unsigned long ipv4_addr; + unsigned char ipv6_addr[16]; +}; + +/* 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c new file mode 100644 index 00000000..478b686f --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -0,0 +1,398 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h new file mode 100644 index 00000000..07869f90 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp new file mode 100644 index 00000000..d813cd65 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -0,0 +1,292 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "hardware/gps.h" +#include "loc.h" +#include "loc_log.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + +/* GPS status names */ +static 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 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 loc_name_val_s_type loc_eng_msgs[] = +{ + NAME_VAL( LOC_ENG_MSG_QUIT ), + NAME_VAL( LOC_ENG_MSG_ENGINE_DOWN ), + NAME_VAL( LOC_ENG_MSG_ENGINE_UP ), + NAME_VAL( LOC_ENG_MSG_START_FIX ), + NAME_VAL( LOC_ENG_MSG_STOP_FIX ), + NAME_VAL( LOC_ENG_MSG_SET_POSITION_MODE ), + NAME_VAL( LOC_ENG_MSG_SET_TIME ), + NAME_VAL( LOC_ENG_MSG_INJECT_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_INJECT_LOCATION ), + NAME_VAL( LOC_ENG_MSG_DELETE_AIDING_DATA ), + NAME_VAL( LOC_ENG_MSG_SET_APN ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_URL ), + NAME_VAL( LOC_ENG_MSG_SET_SERVER_IPV4 ), + NAME_VAL( LOC_ENG_MSG_ENABLE_DATA ), + NAME_VAL( LOC_ENG_MSG_SUPL_VERSION ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PROPERTIES ), + NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG ), + NAME_VAL( LOC_ENG_MSG_MUTE_SESSION ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_SUCCESS ), + NAME_VAL( LOC_ENG_MSG_ATL_CLOSED ), + NAME_VAL( LOC_ENG_MSG_ATL_OPEN_FAILED ), + NAME_VAL( LOC_ENG_MSG_REPORT_POSITION ), + NAME_VAL( LOC_ENG_MSG_REPORT_SV ), + NAME_VAL( LOC_ENG_MSG_REPORT_STATUS ), + NAME_VAL( LOC_ENG_MSG_REPORT_NMEA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_ATL ), + NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), + NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), + NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), + NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), + NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), + NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) +}; +static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); + +/* Find Android GPS status name */ +const char* loc_get_msg_name(int id) +{ + return loc_get_name_from_val(loc_eng_msgs, loc_eng_msgs_num, (long) id); +} + + + +static 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 ) +}; +static 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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 ) +#ifdef QCOM_FEATURE_DELEXT + ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +#endif +}; +static 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 loc_name_val_s_type loc_eng_agps_types[] = +{ +#ifdef QCOM_FEATURE_IPV6 + NAME_VAL( AGPS_TYPE_INVALID ), + NAME_VAL( AGPS_TYPE_ANY ), +#endif + NAME_VAL( AGPS_TYPE_SUPL ), + NAME_VAL( AGPS_TYPE_C2K ) +#ifdef QCOM_FEATURE_IPV6 + ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) +#endif +}; +static 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 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 ) +}; +static 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 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 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 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 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); +} + +#ifdef QCOM_FEATURE_IPV6 +static 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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); +} +#endif + +static 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h new file mode 100644 index 00000000..eff1593b --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -0,0 +1,62 @@ +/* Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 +#include +#include "loc_eng_msg_id.h" + +const char* loc_get_gps_status_name(GpsStatusValue gps_status); +const char* loc_get_msg_name(int id); +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); +#ifdef QCOM_FEATURE_IPV6 +const char* loc_get_agps_bear_name(AGpsBearerType bear); +#endif +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_ENG_LOG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp new file mode 100644 index 00000000..97c0457c --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -0,0 +1,133 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_eng_msg.h" +#include "loc_eng_dmn_conn_glue_msg.h" + +#ifdef _ANDROID_ + +#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" + +#else + +#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" + +#endif + +int loc_eng_msgget(int * p_req_msgq) +{ + * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); + return 0; +} + +int loc_eng_msgremove(int req_msgq) +{ + loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); + return 0; +} + +int loc_eng_msgsnd(int msgqid, void * msgp) +{ + int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) +{ + int result; + + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + 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; +} + +int loc_eng_msgrcv(int msgqid, void ** msgp) +{ + int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) +{ + int result; + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); + if (result != sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); + return -1; + } + + if (msgsz < pmsg->msgsz) { + LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); + return -1; + } + + if (pmsg->msgsz > sizeof(struct msgbuf)) { + /* there is msg body */ + msgp += sizeof(struct msgbuf); + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); + + if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { + LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, + (pmsg->msgid), (int) pmsg->msgsz); + return -1; + } + } + + return pmsg->msgsz; +} + +int loc_eng_msgflush(int msgqid) +{ + return loc_eng_dmn_conn_glue_msgflush(msgqid); +} + +int loc_eng_msgunblock(int msgqid) +{ + return loc_eng_dmn_conn_glue_pipeunblock(msgqid); +} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h new file mode 100644 index 00000000..41548f09 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -0,0 +1,584 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" +#include "loc.h" +#include "loc_eng_log.h" +#include "loc_eng_msg_id.h" + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct loc_eng_msg { + const void* owner; + const int msgid; + inline loc_eng_msg(void* instance, int id) : + owner(instance), msgid(id) + { + LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); + } + virtual ~loc_eng_msg() + { + LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); + } +}; + +struct loc_eng_msg_suple_version : public loc_eng_msg { + const int supl_version; + inline loc_eng_msg_suple_version(void* instance, int version) : + loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), + supl_version(version) + { + LOC_LOGV("SUPL Version: %d", version); + } +}; + +struct loc_eng_msg_sensor_control_config : public loc_eng_msg { + const int sensorsDisabled; + inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), + sensorsDisabled(disabled) + { + LOC_LOGV("Sensors Disabled: %d", disabled); + } +}; + +struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const float gyroBiasVarianceRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) + { + LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); + } +}; + +struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { + const int controlMode; + const int accelSamplesPerBatch; + const int accelBatchesPerSec; + const int gyroSamplesPerBatch; + const int gyroBatchesPerSec; + inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), + controlMode(controlMode), + accelSamplesPerBatch(accelSamplesPerBatch), + accelBatchesPerSec(accelBatchesPerSec), + gyroSamplesPerBatch(gyroSamplesPerBatch), + gyroBatchesPerSec(gyroBatchesPerSec) + { + LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + } +}; + + +struct loc_eng_msg_position_mode : public loc_eng_msg { + const LocPositionMode pMode; + const GpsPositionRecurrence pRecurrence; + const uint32_t minInterval; + const uint32_t preferredAccuracy; + const uint32_t preferredTime; + inline loc_eng_msg_position_mode() : + loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(LOC_POSITION_MODE_STANDALONE), + pRecurrence(0), minInterval(0), + preferredAccuracy(0), preferredTime(0) {} + inline loc_eng_msg_position_mode(void* instance, + LocPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), + pMode(mode), pRecurrence(recurrence), minInterval(min_interval), + preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) + { + LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", + loc_get_position_mode_name(pMode), + loc_get_position_recurrence_name(pRecurrence), + minInterval, + preferredAccuracy, + preferredTime); + } +}; + +struct loc_eng_msg_set_time : public loc_eng_msg { + const GpsUtcTime time; + const int64_t timeReference; + const int uncertainty; + inline loc_eng_msg_set_time(void* instance, + GpsUtcTime t, + int64_t tf, + int unc) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), + time(t), timeReference(tf), uncertainty(unc) + { + LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", + time, timeReference, uncertainty); + } +}; + +struct loc_eng_msg_inject_location : public loc_eng_msg { + const double latitude; + const double longitude; + const float accuracy; + inline loc_eng_msg_inject_location(void* instance, double lat, + double longi, float accur) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), + latitude(lat), longitude(longi), accuracy(accur) + { + LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", + latitude, longitude, accuracy); + } +}; + +struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { + const GpsAidingData type; + inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : + loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) + { + LOC_LOGV("aiding data msak %d", type); + } +}; + +struct loc_eng_msg_report_position : public loc_eng_msg { + const GpsLocation location; + const void* locationExt; + const enum loc_sess_status status; + inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + enum loc_sess_status st) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), + location(loc), locationExt(locExt), status(st) + { +#ifdef QCOM_FEATURE_ULP + 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: %s", + location.flags, location.position_source, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, location.rawDataSize, location.rawData, + loc_get_position_sess_status_name(status)); +#else + LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", + location.flags, location.latitude, location.longitude, + location.altitude, location.speed, location.bearing, location.accuracy, + location.timestamp, loc_get_position_sess_status_name(status)); +#endif + } +}; + +struct loc_eng_msg_report_sv : public loc_eng_msg { + const GpsSvStatus svStatus; + const void* svExt; + inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) + { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", + svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); + for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + svStatus.sv_list[i].prn, + svStatus.sv_list[i].snr, + svStatus.sv_list[i].elevation, + svStatus.sv_list[i].azimuth); + } + } +}; + +struct loc_eng_msg_report_status : public loc_eng_msg { + const GpsStatusValue status; + inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) + { + LOC_LOGV("status: %s", loc_get_gps_status_name(status)); + } +}; + +struct loc_eng_msg_report_nmea : public loc_eng_msg { + char* const nmea; + const int length; + inline loc_eng_msg_report_nmea(void* instance, + const char* data, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), + nmea(new char[len]), length(len) + { + memcpy((void*)nmea, (void*)data, len); + LOC_LOGV("length: %d\n nmea: %p - %c%c%c", + length, nmea, nmea[3], nmea[4], nmea[5]); + } + inline ~loc_eng_msg_report_nmea() + { + delete[] nmea; + } +}; + +struct loc_eng_msg_request_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_request_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_request_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_release_bit : public loc_eng_msg { + const unsigned int isSupl; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_release_bit(void* instance, + unsigned int is_supl, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), + isSupl(is_supl), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, + (unsigned char)ipv4>>24, + (unsigned char)ipv4>>16, + (unsigned char)ipv4>>8, + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_release_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } +}; + +struct loc_eng_msg_request_atl : public loc_eng_msg { + const int handle; + const AGpsType type; + inline loc_eng_msg_request_atl(void* instance, int hndl, + AGpsType agps_type) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), + handle(hndl), type(agps_type) + { + LOC_LOGV("handle: %d\n agps type: %s", + handle, + loc_get_agps_type_name(type)); + } +}; + +struct loc_eng_msg_release_atl : public loc_eng_msg { + const int handle; + inline loc_eng_msg_release_atl(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) + { + LOC_LOGV("handle: %d", handle); + } +}; + +struct loc_eng_msg_request_ni : public loc_eng_msg { + const GpsNiNotification notify; + const void *passThroughData; + inline loc_eng_msg_request_ni(void* instance, + GpsNiNotification ¬if, const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), + notify(notif), passThroughData(data) + { + 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", + notify.notification_id, + loc_get_ni_type_name(notify.ni_type), + notify.notify_flags, + notify.timeout, + loc_get_ni_response_name(notify.default_response), + loc_get_ni_encoding_name(notify.requestor_id_encoding), + loc_get_ni_encoding_name(notify.text_encoding), + passThroughData); + } +}; + +struct loc_eng_msg_inform_ni_response : public loc_eng_msg { + const GpsUserResponseType response; + const void *passThroughData; + inline loc_eng_msg_inform_ni_response(void* instance, + GpsUserResponseType resp, + const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), + response(resp), passThroughData(data) + { + LOC_LOGV("response: %s\n passThroughData: %p", + loc_get_ni_response_name(response), + passThroughData); + } + inline ~loc_eng_msg_inform_ni_response() + { + // this is a bit weird since passThroughData is not + // allocated by this class. But there is no better way. + // passThroughData actually won't be NULL here. + // But better safer than sorry. + if (NULL != passThroughData) { + free((void*)passThroughData); + } + } +}; + +struct loc_eng_msg_set_apn : public loc_eng_msg { + char* const apn; + inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s", apn); + } + inline ~loc_eng_msg_set_apn() + { + delete[] apn; + } +}; + + + +struct loc_eng_msg_set_server_ipv4 : public loc_eng_msg { + const unsigned int nl_addr; + const int port; + const LocServerType serverType; + inline loc_eng_msg_set_server_ipv4(void* instance, + unsigned int ip, + int p, + LocServerType type) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), + nl_addr(ip), port(p), serverType(type) + { + LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); + } +}; + + +struct loc_eng_msg_set_server_url : public loc_eng_msg { + const int len; + char* const url; + inline loc_eng_msg_set_server_url(void* instance, + const char* urlString, + int url_len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), + len(url_len), url(new char[len+1]) + { + memcpy((void*)url, (void*)urlString, url_len); + url[len] = 0; + LOC_LOGV("url: %s", url); + } + inline ~loc_eng_msg_set_server_url() + { + delete[] url; + } +}; + +struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { + char* const data; + const int length; + inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), + data(new char[l]), length(l) + { + memcpy((void*)data, (void*)d, l); + LOC_LOGV("length: %d\n data: %p", length, data); + } + inline ~loc_eng_msg_inject_xtra_data() + { + delete[] data; + } +}; + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const AGpsStatusValue agpsType; + const int length; + char* const apn; + const AGpsBearerType bearerType; + inline loc_eng_msg_atl_open_success(void* instance, + AGpsStatusValue atype, + const char* name, + int len, + AGpsBearerType btype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + agpsType(atype), length(len), + apn(new char[len+1]), bearerType(btype) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", + loc_get_agps_type_name(agpsType), + apn, + loc_get_agps_bear_name(bearerType)); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#else +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const int length; + char* const apn; + inline loc_eng_msg_atl_open_success(void* instance, + const char* name, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + length(len), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n", + apn); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_open_failed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + inline loc_eng_msg_atl_open_failed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) + { + LOC_LOGV(""); + } +}; +#endif + +#ifdef QCOM_FEATURE_IPV6 +struct loc_eng_msg_atl_closed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_closed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; +#else +struct loc_eng_msg_atl_closed : public loc_eng_msg { + inline loc_eng_msg_atl_closed(void* instance) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) + { + LOC_LOGV(""); + } +}; +#endif + +struct loc_eng_msg_set_data_enable : public loc_eng_msg { + const int enable; + char* const apn; + const int length; + inline loc_eng_msg_set_data_enable(void* instance, + const char* name, + int len, + int yes) : + loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), + enable(yes), apn(new char[len+1]), length(len) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n enable: %d", apn, enable); + } + inline ~loc_eng_msg_set_data_enable() + { + delete[] apn; + } +}; + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); +int loc_eng_msgget(int * p_req_msgq); +int loc_eng_msgremove(int req_msgq); +int loc_eng_msgsnd(int msgqid, void * msgp); +int loc_eng_msgrcv(int msgqid, void ** msgp); +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); +int loc_eng_msgflush(int msgqid); +int loc_eng_msgunblock(int msgqid); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h new file mode 100644 index 00000000..f05f1f44 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_ID_H +#define LOC_ENG_MSG_ID_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct msgbuf { + unsigned int msgsz; + void* msgid; +}; + +enum loc_eng_msg_ids_t { + /* 0x 0 - 0xEF is reserved for daemon internal */ + /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ + LOC_ENG_MSG_QUIT = 0x200, + + LOC_ENG_MSG_ENGINE_DOWN, + LOC_ENG_MSG_ENGINE_UP, + + LOC_ENG_MSG_START_FIX, + LOC_ENG_MSG_STOP_FIX, + LOC_ENG_MSG_SET_POSITION_MODE, + LOC_ENG_MSG_SET_TIME, + LOC_ENG_MSG_INJECT_XTRA_DATA, + LOC_ENG_MSG_INJECT_LOCATION, + LOC_ENG_MSG_DELETE_AIDING_DATA, + LOC_ENG_MSG_SET_APN, + LOC_ENG_MSG_SET_SERVER_URL, + LOC_ENG_MSG_SET_SERVER_IPV4, + LOC_ENG_MSG_ENABLE_DATA, + + LOC_ENG_MSG_SUPL_VERSION, + LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG, + LOC_ENG_MSG_SET_SENSOR_PROPERTIES, + LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG, + LOC_ENG_MSG_MUTE_SESSION, + + LOC_ENG_MSG_ATL_OPEN_SUCCESS, + LOC_ENG_MSG_ATL_CLOSED, + LOC_ENG_MSG_ATL_OPEN_FAILED, + + LOC_ENG_MSG_REPORT_POSITION, + LOC_ENG_MSG_REPORT_SV, + LOC_ENG_MSG_REPORT_STATUS, + LOC_ENG_MSG_REPORT_NMEA, + LOC_ENG_MSG_REQUEST_BIT, + LOC_ENG_MSG_RELEASE_BIT, + LOC_ENG_MSG_REQUEST_ATL, + LOC_ENG_MSG_RELEASE_ATL, + LOC_ENG_MSG_REQUEST_NI, + LOC_ENG_MSG_INFORM_NI_RESPONSE, + LOC_ENG_MSG_REQUEST_XTRA_DATA, + LOC_ENG_MSG_REQUEST_TIME, + LOC_ENG_MSG_REQUEST_POSITION +}; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_MSG_ID_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp new file mode 100644 index 00000000..c2d78af8 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -0,0 +1,313 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ +static void* ni_thread_proc(void *args); + +/*=========================================================================== + +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; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + /* If busy, use default or deny */ + if (NULL != loc_eng_ni_data_p->rawRequest) + { + /* XXX Consider sending a NO RESPONSE reply or queue the request */ + LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); + } + } + else { + /* Save request */ + loc_eng_ni_data_p->rawRequest = (void*)passThrough; + + /* Fill in notification */ + ((GpsNiNotification*)notif)->notification_id = loc_eng_ni_data_p->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. + **/ + loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); + + int rc = 0; + rc = pthread_create(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); + if (rc) + { + LOC_LOGE("Loc NI thread is not created.\n"); + } + rc = pthread_detach(loc_eng_ni_data_p->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); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + +FUNCTION ni_thread_proc + +===========================================================================*/ +static void* ni_thread_proc(void *args) +{ + ENTRY_LOG(); + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; + 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(&loc_eng_ni_data_p->tLock); + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->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, loc_eng_ni_data_p->respTimeLeft ); + + while (!loc_eng_ni_data_p->respRecvd) + { + rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, + &loc_eng_ni_data_p->tLock, + &expire_time); + if (rc == ETIMEDOUT) + { + loc_eng_ni_data_p->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 ); + loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + + // adding this check to support modem restart, in which case, we need the thread + // to exit without calling sending data to loc_eng_msg_q. We made sure that + // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() + loc_eng_msg_inform_ni_response *msg = NULL; + + if (NULL != loc_eng_ni_data_p->rawRequest) { + loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; + msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + } + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + + loc_eng_ni_data_p->respTimeLeft = 0; + loc_eng_ni_data_p->reqID++; + + if (NULL != msg) { + loc_eng_msg_sender(loc_eng_data_p, 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->rawRequest) { + free(loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; + + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + // the goal is to wake up ni_thread_proc + // and let it exit. + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->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, GpsNiCallbacks *callbacks) +{ + ENTRY_LOG_CALLFLOW(); + + 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->respTimeLeft = 0; + loc_eng_ni_data_p->respRecvd = FALSE; + loc_eng_ni_data_p->rawRequest = NULL; + loc_eng_ni_data_p->reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->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; + + 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->reqID && + NULL != loc_eng_ni_data_p->rawRequest) + { + LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + loc_eng_ni_data_p->resp = user_response; + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + } + else { + LOC_LOGE("loc_eng_ni_respond: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", + loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); + } + + EXIT_LOG(%s, VOID_RET); +} diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h new file mode 100644 index 00000000..9b1c5f34 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +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; +} loc_eng_ni_data_s_type; + + +#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp new file mode 100644 index 00000000..ebc7c6fb --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -0,0 +1,90 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "log_util.h" + + +/*=========================================================================== +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, + GpsXtraCallbacks* callbacks) +{ + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + + xtra_module_data_ptr = &loc_eng_data.xtra_module_data; + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + + return 0; +} + +/*=========================================================================== +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: success + >0: failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length) +{ + loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, + data, length)); + loc_eng_msg_sender(&loc_eng_data, msg); + + return 0; +} diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h new file mode 100644 index 00000000..7e01e146 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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; + + // 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/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk new file mode 100755 index 00000000..b6c7a66e --- /dev/null +++ b/loc_api/loc_api_v02/Android.mk @@ -0,0 +1,43 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api_v02 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libloc_adapter \ + libgps.utils + +LOCAL_SRC_FILES += \ + LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +## Includes +LOCAL_C_INCLUDES := \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ + $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp new file mode 100644 index 00000000..cfb2265d --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -0,0 +1,2059 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "LocApiV02Adapter.h" +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" +#include "LocApiAdapter.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_adapter" +#include "loc_util_log.h" + + +/* Default session id ; TBD needs incrementing for each */ +#define LOC_API_V02_DEF_SESSION_ID (1) + +/* Default minimium interval in ms */ +#define LOC_API_V02_DEF_MIN_INTERVAL (1000) + +/* Default horizontal accuracy in meters*/ +#define LOC_API_V02_DEF_HORZ_ACCURACY (50) + +/* Default timeout in ms; TBD: needs implementing */ +#define LOC_API_V02_DEF_TIMEOUT (120000) + +/* UMTS CP Address key*/ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +/* GPS SV Id offset */ +#define GPS_SV_ID_OFFSET (1) + +/* GLONASS SV Id offset */ +#define GLONASS_SV_ID_OFFSET (65) + +/* SV ID range */ +#define SV_ID_RANGE (32) + + + +/* static event callbacks that call the LocApiV02Adapter callbacks*/ + +/* global event callback, call the eventCb function in loc api adapter v02 + instance */ +static void globalEventCb(locClientHandleType clientHandle, + uint32_t eventId, + const locClientEventIndUnionType eventPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, eventId, pClientCookie); + + // return if null is passed + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", + __func__, __LINE__, clientHandle, eventId); + return; + } + locApiV02AdapterInstance->eventCb(clientHandle, + eventId, + eventPayload); +} + +/* global response callback, it calls the sync request process + indication function to unblock the request that is waiting on this + response indication*/ +static void globalRespCb(locClientHandleType clientHandle, + uint32_t respId, + const locClientRespIndUnionType respPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + + LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, respId, pClientCookie); + + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", + __func__, __LINE__, clientHandle, respId); + return; + } + // process the sync call + // use pDeleteAssistDataInd as a dummy pointer + loc_sync_process_ind(clientHandle, respId, + (void *)respPayload.pDeleteAssistDataInd); +} + +/* global error callback, it will call the handle service down + function in the loc api adapter instance. */ +static void globalErrorCb (locClientHandleType clientHandle, + locClientErrorEnumType errorId, + void *pClientCookie) +{ + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, errorId, pClientCookie); + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", + __func__, __LINE__, clientHandle, errorId); + return; + } + locApiV02AdapterInstance->errorCb(clientHandle, + errorId); +} + +/* global structure containing the callbacks */ +locClientCallbacksType globalCallbacks = +{ + sizeof(locClientCallbacksType), + globalEventCb, + globalRespCb, + globalErrorCb +}; + +/* Constructor for LocApiV02Adapter */ +LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): + LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), + eventMask(convertMask(locEng.eventMask)), navigating(false), + fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, + LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, + LOC_API_V02_DEF_TIMEOUT ) +{ + // initialize loc_sync_req interface + loc_sync_req_init(); +} + +/* Destructor for LocApiV02Adapter */ +LocApiV02Adapter :: ~LocApiV02Adapter() +{ + deInitLocClient(); +} + +/* close Loc API V02 client */ +int LocApiV02Adapter :: deInitLocClient() +{ + return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; +} + +/* Initialize a loc api v02 client */ +enum loc_api_adapter_err LocApiV02Adapter :: reinit() +{ + locClientStatusEnumType status; + /* If the client is already open close it first */ + if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) + { + status = locClientClose(&clientHandle); + if( eLOC_CLIENT_SUCCESS != status) + { + LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, + __LINE__, status); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + } + + LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, + __LINE__, this); + /* initialize the loc api v02 interface, note that + the locClientOpen() function will block if the + service is unavailable for a fixed time out */ + + status = locClientOpen( + eventMask, &globalCallbacks, &clientHandle, (void *)this); + + if (eLOC_CLIENT_SUCCESS != status || + clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) + { + LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, + __LINE__, loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + + // return SUCCESS + return (LOC_API_ADAPTER_ERR_SUCCESS); +} + +/* start positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: startFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStartReqMsgT_v02 start_msg; + + qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; + qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; + + // clear all fields, validity masks + memset (&start_msg, 0, sizeof(start_msg)); + memset (&set_mode_msg, 0, sizeof(set_mode_msg)); + memset (&set_mode_ind, 0, sizeof(set_mode_ind)); + + LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + + // fill in the start request + switch(fixCriteria.mode) + { + case LOC_POSITION_MODE_MS_BASED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; + break; + + case LOC_POSITION_MODE_MS_ASSISTED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; + break; + + case LOC_POSITION_MODE_RESERVED_4: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; + break; + + default: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; + break; + } + + req_union.pSetOperationModeReq = &set_mode_msg; + + // send the mode first, before the start message. + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_OPERATION_MODE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_OPERATION_MODE_IND_V02, + &set_mode_ind); // NULL? + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) + { + LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " + "ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_mode_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error + } + + if(fixCriteria.min_interval > 0) + { + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; + } + + start_msg.horizontalAccuracyLevel_valid = 1; + + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } + + start_msg.fixRecurrence_valid = 1; + if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; + } + else + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; + } + + //dummy session id + // TBD: store session ID, check for session id in pos reports. + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; + + req_union.pStartReq = &start_msg; + + status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, + req_union ); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = true; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + // start_fix failed so MO fix is not in progress + navigating = false; + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; +} + +/* stop a positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: stopFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStopReqMsgT_v02 stop_msg; + + LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); + + memset(&stop_msg, 0, sizeof(stop_msg)); + + // dummy session id + stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pStopReq = &stop_msg; + + status = locClientSendReq(clientHandle, + QMI_LOC_STOP_REQ_V02, + req_union); + + if( eLOC_CLIENT_SUCCESS == status) + { + navigating = false; + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, + loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); +} + +/* set the positioning fix criteria */ +enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( + LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + + LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, + min_interval, mode, recurrence, preferred_accuracy); + + //store the fix criteria + fixCriteria.mode = mode; + + fixCriteria.recurrence = recurrence; + + if(min_interval == 0) + { + fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; + } + else + { + fixCriteria.min_interval = min_interval; + } + + fixCriteria.preferred_accuracy = preferred_accuracy; + + fixCriteria.preferred_time = preferred_time; + + if(true == navigating) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); + + return( startFix()); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject time into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; + qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; + + memset(&inject_time_msg, 0, sizeof(inject_time_msg)); + + inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; + + inject_time_msg.timeUtc = time; + + inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); + + inject_time_msg.timeUnc = uncertainty; + + req_union.pInjectUtcTimeReq = &inject_time_msg; + + LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, + uncertainty); + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_UTC_TIME_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_UTC_TIME_IND_V02, + &inject_time_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) + { + LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_time_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject position into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + injectPosition(double latitude, double longitude, float accuracy) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; + qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; + + memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); + + inject_pos_msg.latitude_valid = 1; + inject_pos_msg.latitude = latitude; + + inject_pos_msg.longitude_valid = 1; + inject_pos_msg.longitude = longitude; + + inject_pos_msg.horUncCircular_valid = 1; + + inject_pos_msg.horUncCircular = accuracy; //meters assumed + + inject_pos_msg.horConfidence_valid = 1; + + inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) + + /* Log */ + LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, + inject_pos_msg.latitude, inject_pos_msg.longitude, + inject_pos_msg.horUncCircular); + + req_union.pInjectPositionReq = &inject_pos_msg; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_POSITION_IND_V02, + &inject_pos_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_pos_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* delete assistance date */ +enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteAssistDataReqMsgT_v02 delete_req; + qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; + + memset(&delete_req, 0, sizeof(delete_req)); + memset(&delete_resp, 0, sizeof(delete_resp)); + + if( f == GPS_DELETE_ALL ) + { + delete_req.deleteAllFlag = true; + } + + else + { + /* to keep track of svInfoList for GPS and GLO*/ + uint32_t curr_sv_len = 0; + uint32_t curr_sv_idx = 0; + uint32_t sv_id = 0; + + if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) + { + /* do delete for all GPS SV's */ + + curr_sv_len += SV_ID_RANGE; + + sv_id = GPS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + // increment the current index + curr_sv_idx += SV_ID_RANGE; + + } + +#ifdef QCOM_FEATURE_DELEXT + if( f & GPS_DELETE_TIME_GPS ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; + } +#endif + if(f & GPS_DELETE_POSITION ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; + } + + if(f & GPS_DELETE_TIME ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; + } + + if(f & GPS_DELETE_IONO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; + } + + if(f & GPS_DELETE_UTC ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; + } + + if(f & GPS_DELETE_HEALTH ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; + } + + if(f & GPS_DELETE_SVDIR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; + } + if(f & GPS_DELETE_SADATA ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; + } + if(f & GPS_DELETE_RTI ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; + } + if(f & GPS_DELETE_CELLDB_INFO ) + { + delete_req.deleteCellDbDataMask_valid = 1; + delete_req.deleteCellDbDataMask = + ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; + + } +#ifdef QCOM_FEATURE_DELEXT + if(f & GPS_DELETE_ALMANAC_CORR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; + } + if(f & GPS_DELETE_FREQ_BIAS_EST ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; + } + if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) + { + /* do delete for all GLONASS SV's (65 - 96) + */ + curr_sv_len += SV_ID_RANGE; + + sv_id = GLONASS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + curr_sv_idx += SV_ID_RANGE; + } + + if(f & GPS_DELETE_SVDIR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; + } + + if(f & GPS_DELETE_SVSTEER_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; + } + + if(f & GPS_DELETE_ALMANAC_CORR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; + } + + if(f & GPS_DELETE_TIME_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; + } +#endif + } + + req_union.pDeleteAssistDataReq = &delete_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + &delete_resp); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != delete_resp.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(delete_resp.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* send NI user repsonse to the engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + + qmiLocNiUserRespReqMsgT_v02 ni_resp; + qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; + + memset(&ni_resp,0, sizeof(ni_resp)); + + memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); + + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; + break; + case GPS_NI_RESPONSE_DENY: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; + break; + case GPS_NI_RESPONSE_NORESP: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; + break; + default: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, + ni_resp.userResp); + + ni_resp.notificationType = request_pass_back->notificationType; + + // copy SUPL payload from request + if(request_pass_back->NiSuplInd_valid == 1) + { + ni_resp.NiSuplPayload_valid = 1; + memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), + sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); + + } + // should this be an "else if"?? we don't need to decide + + // copy UMTS-CP payload from request + if( request_pass_back->NiUmtsCpInd_valid == 1 ) + { + ni_resp.NiUmtsCpPayload_valid = 1; + memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), + sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); + } + + //copy Vx payload from the request + if( request_pass_back->NiVxInd_valid == 1) + { + ni_resp.NiVxPayload_valid = 1; + memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), + sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); + } + + // copy Vx service interaction payload from the request + if(request_pass_back->NiVxServiceInteractionInd_valid == 1) + { + ni_resp.NiVxServiceInteractionPayload_valid = 1; + memcpy(&(ni_resp.NiVxServiceInteractionPayload), + &(request_pass_back->NiVxServiceInteractionInd), + sizeof(qmiLocNiVxServiceInteractionStructT_v02)); + } + + req_union.pNiUserRespReq = &ni_resp; + + status = loc_sync_send_req ( + clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ni_resp_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Set UMTs SLP server URL */ +enum loc_api_adapter_err LocApiV02Adapter :: setServer( + const char* url, int len) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + + if(len <=0 || len > sizeof(set_server_req.urlAddr)) + { + LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", + __func__, __LINE__, len); + + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); + + set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; + + set_server_req.urlAddr_valid = 1; + + strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +enum loc_api_adapter_err LocApiV02Adapter :: + setServer(unsigned int ip, int port, LocServerType type) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + qmiLocServerTypeEnumT_v02 set_server_cmd; + + switch (type) { + case LOC_AGPS_MPC_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; + break; + case LOC_AGPS_CUSTOM_PDE_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; + break; + default: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; + break; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); + + set_server_req.serverType = set_server_cmd; + set_server_req.ipv4Addr_valid = 1; + set_server_req.ipv4Addr.addr = ip; + set_server_req.ipv4Addr.port = port; + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Inject XTRA data, this module breaks down the XTRA + file into "chunks" and injects them one at a time */ +enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( + char* data, int length) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + int total_parts; + uint8_t part; + uint16_t len_injected; + + locClientReqUnionType req_union; + qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; + qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; + + req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; + + LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); + + inject_xtra.formatType_valid = 1; + inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; + inject_xtra.totalSize = length; + + total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; + + inject_xtra.totalParts = total_parts; + + len_injected = 0; // O bytes injected + + // XTRA injection starts with part 1 + for (part = 1; part <= total_parts; part++) + { + inject_xtra.partNum = part; + + if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) + { + inject_xtra.partData_len = length - len_injected; + } + else + { + inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; + } + + // copy data into the message + memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); + + LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", + __func__, __LINE__, + inject_xtra.partNum, total_parts, inject_xtra.partData_len, + len_injected); + + status = loc_sync_send_req( clientHandle, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + &inject_xtra_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || + inject_xtra.partNum != inject_xtra_ind.partNum) + { + LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," + " part num = %d, ind.partNum = %d\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_xtra_ind.status), + inject_xtra.partNum, inject_xtra_ind.partNum); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + break; + } + + len_injected += inject_xtra.partData_len; + LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, + len_injected); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} +#ifdef QCOM_FEATURE_IPV6 +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s], bearer = %d \n", __func__, __LINE__, + handle, is_succ, apn, bear); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + switch(bear) + { + case AGPS_APN_BEARER_IPV4: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + break; + + case AGPS_APN_BEARER_IPV6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + break; + + case AGPS_APN_BEARER_IPV4V6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + break; + + default: + LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#else +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s] \n", __func__, __LINE__, + handle, is_succ, apn); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} +#endif +/* close atl connection */ +enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( + int handle, int is_succ) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", + __func__, __LINE__, handle, is_succ); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the SUPL version */ +enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; + + LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); + + + memset(&supl_config_req, 0, sizeof(supl_config_req)); + memset(&supl_config_ind, 0, sizeof(supl_config_ind)); + + supl_config_req.suplVersion_valid = 1; + // SUPL version from MSByte to LSByte: + // (reserved)(major version)(minor version)(serviceIndicator) + + supl_config_req.suplVersion = (version == 0x00020000)? + eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; + + req_union.pSetProtocolConfigParametersReq = &supl_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &supl_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(supl_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Configuration */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; + qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; + + LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); + + memset(&sensor_config_req, 0, sizeof(sensor_config_req)); + memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); + + sensor_config_req.sensorsUsage_valid = 1; + sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 + : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; + + req_union.pSetSensorControlConfigReq = &sensor_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + &sensor_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Properties */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; + qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; + + LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk); + + memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); + memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); + + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; + sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + + req_union.pSetSensorPropertiesReq = &sensor_prop_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + &sensor_prop_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_prop_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Performance Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; + qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; + + LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + __FUNCTION__, + __LINE__, + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec + ); + + memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); + memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); + + sensor_perf_config_req.performanceControlMode_valid = 1; + sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; + sensor_perf_config_req.accelSamplingSpec_valid = 1; + sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; + sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; + sensor_perf_config_req.gyroSamplingSpec_valid = 1; + sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; + sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + + req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + &sensor_perf_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Convert event mask from loc eng to loc_api_v02 format */ +locClientEventMaskType LocApiV02Adapter :: convertMask( + LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + locClientEventMaskType eventMask = 0; + LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); + + if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + + if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + + /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ + if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || + (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) + eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; + + if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; + + if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) + { + // TBD: This needs to be decoupled in the HAL + eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; + } + + if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) + { + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); + } + + if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; + + return eventMask; +} + +/* Convert error from loc_api_v02 to loc eng format*/ +enum loc_api_adapter_err LocApiV02Adapter :: convertErr( + locClientStatusEnumType status) +{ + switch( status) + { + case LOC_API_ADAPTER_ERR_SUCCESS: + return LOC_API_ADAPTER_ERR_SUCCESS; + + case eLOC_CLIENT_FAILURE_GENERAL: + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + + case eLOC_CLIENT_FAILURE_UNSUPPORTED: + return LOC_API_ADAPTER_ERR_UNSUPPORTED; + + case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + + case eLOC_CLIENT_FAILURE_ENGINE_BUSY: + return LOC_API_ADAPTER_ERR_ENGINE_BUSY; + + case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: + return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; + + case eLOC_CLIENT_FAILURE_TIMEOUT: + return LOC_API_ADAPTER_ERR_TIMEOUT; + + case eLOC_CLIENT_FAILURE_INVALID_HANDLE: + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + + case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: + return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; + + default: + return LOC_API_ADAPTER_ERR_FAILURE; + } +} + +/* convert position report to loc eng format and send the converted + position to loc eng */ + +void LocApiV02Adapter :: reportPosition ( + const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) +{ + GpsLocation location; + + memset(&location, 0, sizeof (GpsLocation)); + location.size = sizeof(location); + // Process the position from final and intermediate reports + + if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || + (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) + ) + { + // Latitude & Longitude + if( (location_report_ptr->latitude_valid == 1 ) && + (location_report_ptr->longitude_valid == 1) && + (location_report_ptr->latitude != 0 || + location_report_ptr->longitude!= 0)) + { + location.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.latitude = location_report_ptr->latitude; + location.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if(location_report_ptr->timestampUtc_valid == 1) + { + location.timestamp = location_report_ptr->timestampUtc; + } + + // Altitude + if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) + { + location.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.altitude = location_report_ptr->altitudeWrtEllipsoid; + } + + // Speed + if((location_report_ptr->speedHorizontal_valid == 1) && + (location_report_ptr->speedVertical_valid ==1 ) ) + { + location.flags |= GPS_LOCATION_HAS_SPEED; + location.speed = sqrt( + (location_report_ptr->speedHorizontal * + location_report_ptr->speedHorizontal) + + (location_report_ptr->speedVertical * + location_report_ptr->speedVertical) ); + } + + // Heading + if(location_report_ptr->heading_valid == 1) + { + location.flags |= GPS_LOCATION_HAS_BEARING; + location.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if( (location_report_ptr->horUncCircular_valid ) ) + { + location.flags |= GPS_LOCATION_HAS_ACCURACY; + location.accuracy = location_report_ptr->horUncCircular; + } + + LocApiAdapter::reportPosition( location, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->sessionStatus + == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + } + } + else + { + LocApiAdapter::reportPosition(location, + NULL, + LOC_SESS_FAILURE); + + LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " + "fix id = %u\n", __func__, __LINE__, + location_report_ptr->sessionStatus, + location_report_ptr->fixId ); + } +} + +/* convert satellite report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportSv ( + const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + int num_svs_max, i; + const qmiLocSvInfoStructT_v02 *sv_info_ptr; + + LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, + gnss_report_ptr->svList_len); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + if(gnss_report_ptr->svList_valid == 1) + { + num_svs_max = gnss_report_ptr->svList_len; + if(num_svs_max > GPS_MAX_SVS) + { + num_svs_max = GPS_MAX_SVS; + } + SvStatus.num_svs = 0; + for(i = 0; i < num_svs_max; i++) + { + sv_info_ptr = &(gnss_report_ptr->svList[i]); + if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && + (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) + && (sv_info_ptr->gnssSvId != 0 )) + { + if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; + + // We only have the data field to report gps eph and alm mask + if(sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) + { + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) + { + SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) + { + SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + (65-1); + } + // Unsupported SV system + else + { + continue; + } + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) + { + SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) + { + SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) + { + SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; + } + + SvStatus.num_svs++; + } + } + + if (SvStatus.num_svs != 0) + { + LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); + LocApiAdapter::reportSv(SvStatus, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +/* convert engine state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) +{ + + LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, + engine_state_ptr->engineState); + + if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) + { + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); + } + else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) + { + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); + } + else + { + LocApiAdapter::reportStatus(GPS_STATUS_NONE); + } + +} + +/* convert fix session state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) +{ + GpsStatusValue status; + LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, + fix_session_state_ptr->sessionState); + + status = GPS_STATUS_NONE; + if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (fix_session_state_ptr->sessionState + == eQMI_LOC_FIX_SESSION_FINISHED_V02) + { + status = GPS_STATUS_SESSION_END; + } + LocApiAdapter::reportStatus(status); +} + +/* convert NMEA report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportNmea ( + const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) +{ + + LocApiAdapter::reportNmea(nmea_report_ptr->nmea, + strlen(nmea_report_ptr->nmea)); + + LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, + nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], + nmea_report_ptr->nmea[5]); +} + +/* convert and report an ATL request to loc engine */ +void LocApiV02Adapter :: reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) +{ + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) + { + AGpsType agpsType; +#ifdef QCOM_FEATURE_IPV6 + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + break; + + default: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + } +#else + agpsType = AGPS_TYPE_SUPL; +#endif + LocApiAdapter::requestATL(connHandle, agpsType); + } + + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + LocApiAdapter::releaseATL(connHandle); + } +} + +/* conver the NI report to loc eng format and send t loc engine */ +void LocApiV02Adapter :: reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) +{ + GpsNiNotification notif; + + /* initialize the notification*/ + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + /* NI timeout gets overwritten in LocApiAdapter, + initializing to 0 here */ + notif.timeout = 0; + + notif.text_encoding = GPS_ENC_NONE ; + + notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + + notif.notify_flags = 0; + + notif.default_response = GPS_NI_RESPONSE_NORESP; + + /*Handle Vx request */ + if(ni_req_ptr->NiVxInd_valid == 1) + { + const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); + + notif.ni_type = GPS_NI_TYPE_VOICE; + + // Requestor ID, the requestor id recieved is NULL terminated + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char *)vx_req->requestorId, vx_req->requestorId_len ); + } + + /* Handle UMTS CP request*/ + else if(ni_req_ptr->NiUmtsCpInd_valid == 1) + { + const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = + &ni_req_ptr->NiUmtsCpInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + + /* notificationText should always be a NULL terminated string */ + hexcode(notif.text, sizeof notif.text, + (char *)umts_cp_req->notificationText, + umts_cp_req->notificationText_len); + + /* Store requestor ID */ + hexcode(notif.requestor_id, sizeof(notif.requestor_id), + (char *)umts_cp_req->requestorId.codedString, + umts_cp_req->requestorId.codedString_len); + + /* convert encodings */ + notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); + + notif.requestor_id_encoding = + convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); + + /* LCS address (using extras field) */ + if ( umts_cp_req->clientAddress_len != 0) + { + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + + // 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; + address_source = (char *)umts_cp_req->clientAddress; + // client Address is always NULL terminated + addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, + umts_cp_req->clientAddress_len); + + // The address is ASCII string + if (addr_len) + { + strlcat(notif.extras, lcs_addr, sizeof notif.extras); + } + } + + } + else if(ni_req_ptr->NiSuplInd_valid == 1) + { + const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = + &ni_req_ptr->NiSuplInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + + // Client name + if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) + { + hexcode(notif.text, sizeof(notif.text), + (char *)supl_req->clientName.formattedString, + supl_req->clientName.formattedString_len); + LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, + notif.text); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", + __func__, __LINE__); + } + + // Requestor ID + if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char*)supl_req->requestorId.formattedString, + supl_req->requestorId.formattedString_len ); + + LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, + notif.requestor_id); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", + __func__, __LINE__); + } + + // Encoding type + if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) + { + notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); + + notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); + } + else + { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + } //ni_req_ptr->NiSuplInd_valid == 1 + + else + { + LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); + return; + } + + // Set default_response & notify_flags + convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); + + if( NULL != ni_req_copy_ptr) + { + memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); + + LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); + } + else + { + LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); + } + +} + +/* convert Ni Encoding type from QMI_LOC to loc eng format */ +GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case eQMI_LOC_NI_SUPL_UTF8_V02: + enc = GPS_ENC_SUPL_UTF8; + break; + case eQMI_LOC_NI_SUPL_UCS2_V02: + enc = GPS_ENC_SUPL_UCS2; + break; + case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + break; + default: + break; + } + + return enc; +} + +/*convert NI notify verify type from QMI LOC to loc eng format*/ +bool LocApiV02Adapter :: convertNiNotifyVerifyType ( + GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv) +{ + switch (notif_priv) + { + case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: + notif->notify_flags = 0; + break; + + case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_ACCEPT; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_DENY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return false; + } + + return true; +} + +/* event callback registered with the loc_api v02 interface */ +void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, + uint32_t eventId, locClientEventIndUnionType eventPayload) +{ + LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, + eventId); + + switch(eventId) + { + //Position Report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + reportPosition(eventPayload.pPositionReportEvent); + break; + + // Satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + reportSv(eventPayload.pGnssSvInfoReportEvent); + break; + + // Status report + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + reportEngineState(eventPayload.pEngineState); + break; + + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + reportFixSessionState(eventPayload.pFixSessionState); + break; + + // NMEA + case QMI_LOC_EVENT_NMEA_IND_V02: + reportNmea(eventPayload.pNmeaReportEvent); + break; + + // XTRA request + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + LOC_LOGD("%s:%d]: XTRA download request\n", __func__, + __LINE__); + requestXtraData(); + break; + + // time request + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + LOC_LOGD("%s:%d]: Time request\n", __func__, + __LINE__); + requestTime(); + break; + + //position request + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + LOC_LOGD("%s:%d]: Position request\n", __func__, + __LINE__); + //requestPosition(); + break; + + // NI request + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); + break; + + // AGPS connection request + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + reportAtlRequest(eventPayload.pLocationServerConnReqEvent); + break; + } +} + +/* Call the service LocApiAdapter down event*/ +void LocApiV02Adapter :: errorCb(locClientHandleType handle, + locClientErrorEnumType errorId) +{ + if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) + { + LOC_LOGE("%s:%d]: Service unavailable error\n", + __func__, __LINE__); + + LocApiAdapter::handleEngineDownEvent(); + + /* immediately send the engine up event so that + the loc engine re-initializes the adapter and the + loc-api_v02 interface */ + + LocApiAdapter::handleEngineUpEvent(); + } +} + +/* return a Loc API adapter */ +extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return(new LocApiV02Adapter(locEng)); +} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h new file mode 100644 index 00000000..487e98eb --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -0,0 +1,197 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V_0_2_ADAPTER_H +#define LOC_API_V_0_2_ADAPTER_H + +#include +#include "loc_api_v02_client.h" +#include +#include + +/* Fix criteria structure*/ +struct LocApiV02FixCriteria +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval ; + uint32_t preferred_accuracy ; + uint32_t preferred_time; + + /* Constructor for the structure */ + inline LocApiV02FixCriteria (LocPositionMode mode, + GpsPositionRecurrence recur, + uint32_t min_int, + uint32_t pref_acc, + uint32_t pref_time) : + mode(mode), recurrence(recur), min_interval(min_int), + preferred_accuracy(pref_acc), preferred_time(pref_time) {} +}; + +/* This class derives from the LocApiAdapter class. + The members of this class are responsible for converting + the Loc API V02 data structures into Loc Engine data structures. + This class also implements some of the virtual functions that + handle the requests from loc engine. */ +class LocApiV02Adapter : public LocApiAdapter { + + /* loc api v02 handle*/ + locClientHandleType clientHandle; + + /* events the client is registered for */ + locClientEventMaskType eventMask; + + /* current session state */ + bool navigating; + + /* current fix criteria, for Loc aPI V02 this is + stored when set_position_mode is called and + sent out with Loc aPI V02 start message when the + start_fix() is called by loc engine. */ + LocApiV02FixCriteria fixCriteria; + + /* Convert event mask from loc eng to loc_api_v02 format */ + locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + + /* Convert error from loc_api_v02 to loc eng format*/ + enum loc_api_adapter_err convertErr(locClientStatusEnumType status); + + /* convert Ni Encoding type from QMI_LOC to loc eng format */ + GpsNiEncodingType convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); + + /*convert NI notify verify type from QMI LOC to loc eng format*/ + bool convertNiNotifyVerifyType (GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv); + + /* close Loc API V02 client */ + int deInitLocClient(); + + /* convert position report to loc eng format and send the converted + position to loc eng */ + void reportPosition + (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); + + /* convert satellite report to loc eng format and send the converted + report to loc eng */ + void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); + + /* convert engine state report to loc eng format and send the converted + report to loc eng */ + void reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); + + /* convert fix session report to loc eng format and send the converted + report to loc eng */ + void reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); + + /* convert NMEA report to loc eng format and send the converted + report to loc eng */ + void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); + + /* convert and report an ATL request to loc engine */ + void reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 + *server_request_ptr); + + /* convert and report NI request to loc eng */ + void reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); + +public: + LocApiV02Adapter(LocEng &locEng); + ~LocApiV02Adapter(); + + /* event callback registered with the loc_api v02 interface */ + void eventCb(locClientHandleType client_handle, + uint32_t loc_event_id, + locClientEventIndUnionType loc_event_payload); + + /* error callback, this function handles the service unavailable + error */ + void errorCb(locClientHandleType handle, + locClientErrorEnumType errorId); + + virtual enum loc_api_adapter_err reinit(); + + virtual enum loc_api_adapter_err startFix(); + + virtual enum loc_api_adapter_err stopFix(); + + virtual enum loc_api_adapter_err + setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); + + 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); + + 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); +#ifdef QCOM_FEATURE_IPV6 + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType); +#else + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsType agpsType); +#endif + virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage); + + virtual enum loc_api_adapter_err + setSensorProperties(float gyroBiasVarianceRandomWalk); + + virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec); +}; + +#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c new file mode 100644 index 00000000..b75f1630 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -0,0 +1,548 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" + +/* Logging */ +// Uncomment to log verbose logs +#define LOG_NDEBUG 1 + +// log debug logs +#define LOG_NDDEBUG 1 +#define LOG_TAG "LocSvc_api_v02" +#include "loc_util_log.h" + +#define LOC_SYNC_REQ_BUFFER_SIZE 8 + +pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool loc_sync_call_initialized = false; + +typedef struct { + pthread_mutex_t sync_req_lock; + + /* Client ID */ + locClientHandleType client_handle; + + /* waiting conditional variable */ + pthread_cond_t ind_arrived_cond; + + /* Callback waiting data block, protected by loc_cb_data_mutex */ + bool ind_is_selected; /* is cb selected? */ + bool ind_is_waiting; /* is waiting? */ + bool ind_has_arrived; /* callback has arrived */ + uint32_t req_id; /* sync request */ + void *recv_ind_payload_ptr; /* received payload */ + uint32_t recv_ind_id; /* received ind */ + +} loc_sync_req_data_s_type; + +typedef struct { + bool in_use; /* at least one sync call is active */ + bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; + loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; +} loc_sync_req_array_s_type; + +/*************************************************************************** + * DATA FOR ASYNCHRONOUS RPC PROCESSING + **************************************************************************/ +loc_sync_req_array_s_type loc_sync_array; + +/*=========================================================================== + +FUNCTION loc_sync_req_init + +DESCRIPTION + Initialize this module + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_req_init() +{ + LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + pthread_mutex_lock(&loc_sync_call_mutex); + if(true == loc_sync_call_initialized) + { + LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + loc_sync_array.in_use = false; + + memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); + + int i; + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + pthread_mutex_init(&slot->sync_req_lock, NULL); + pthread_cond_init(&slot->ind_arrived_cond, NULL); + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; /* req id */ + } + + loc_sync_call_initialized = true; + pthread_mutex_unlock(&loc_sync_call_mutex); +} + + +/*=========================================================================== + +FUNCTION loc_sync_process_ind + +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_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* ind id */ + void *ind_payload_ptr /* payload */ +) +{ + + LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", + __func__,__LINE__, client_handle, ind_id); + + pthread_mutex_lock(&loc_sync_call_mutex); + + if (!loc_sync_array.in_use) + { + LOC_LOGD("%s:%d]: loc_sync_array not in use \n", + __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + bool in_use = false, consumed = false; + int i; + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + in_use |= loc_sync_array.slot_in_use[i]; + + pthread_mutex_lock(&slot->sync_req_lock); + + if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) + && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) + { + // copy the payload to the slot waiting for this ind + size_t payload_size = 0; + + LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", + __func__, __LINE__, i, ind_id); + + if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && + NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) + { + LOC_LOGV("%s:%d]: copying ind payload size = %u \n", + __func__, __LINE__, payload_size); + + memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); + + consumed = true; + + } + /* Received a callback while waiting, wake up thread to check it */ + if (slot->ind_is_waiting) + { + slot->recv_ind_id = ind_id; + + pthread_cond_signal(&slot->ind_arrived_cond); + } + else + { + /* If callback arrives before wait, remember it */ + LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", + __func__, __LINE__, ind_id); + + slot->ind_has_arrived = true; + } + } + pthread_mutex_unlock(&slot->sync_req_lock); + } + + if (!in_use) { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_alloc_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_alloc_slot() +{ + int i, select_id = -1; /* no free buffer */ + + pthread_mutex_lock(&loc_sync_call_mutex); + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (!loc_sync_array.slot_in_use[i]) + { + select_id = i; + loc_sync_array.slot_in_use[i] = 1; + loc_sync_array.in_use = true; + break; + } + } + + pthread_mutex_unlock(&loc_sync_call_mutex); + LOC_LOGV("%s:%d]: returning slot %d\n", + __func__, __LINE__, select_id); + return select_id; +} + +/*=========================================================================== + +FUNCTION loc_free_slot + +DESCRIPTION + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_free_slot(int select_id) +{ + int i; + loc_sync_req_data_s_type *slot; + + pthread_mutex_lock(&loc_sync_call_mutex); + + LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); + + loc_sync_array.slot_in_use[select_id] = 0; + + slot = &loc_sync_array.slots[select_id]; + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; + + // check if all slots are now free + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (loc_sync_array.slot_in_use[i]) break; + } + + if (i >= LOC_SYNC_REQ_BUFFER_SIZE) + { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_sync_select_ind + +DESCRIPTION + Selects which indication to wait for. + + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -ENOMEM : out of buffer + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_select_ind( + locClientHandleType client_handle, /* Client handle */ + uint32_t ind_id, /* ind Id wait for */ + uint32_t req_id, /* req id */ + void * ind_payload_ptr /* ptr where payload should be copied to*/ +) +{ + int select_id = loc_alloc_slot(); + + LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", + __func__, __LINE__, client_handle, ind_id, req_id); + + if (select_id < 0) + { + LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", + __func__, __LINE__, loc_get_v02_event_name(req_id)); + return -ENOMEM; + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + pthread_mutex_lock(&slot->sync_req_lock); + + slot->client_handle = client_handle; + slot->ind_is_selected = true; + slot->ind_is_waiting = false; + slot->ind_has_arrived = false; + + slot->recv_ind_id = ind_id; + slot->req_id = req_id; + slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr + + pthread_mutex_unlock(&slot->sync_req_lock); + + return select_id; +} + + +/*=========================================================================== + +FUNCTION loc_sync_wait_for_ind + +DESCRIPTION + Waits for a selected indication. The wait expires in timeout_seconds seconds. + If the function is called before an existing wait has finished, it will + immediately return error. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 on SUCCESS, -ve value on failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_wait_for_ind( + int select_id, /* ID from loc_sync_select_ind() */ + int timeout_seconds, /* Timeout in this number of seconds */ + uint32_t ind_id +) +{ + if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) + { + LOC_LOGE("%s:%d]: invalid select_id: %d \n", + __func__, __LINE__, select_id); + + return (-EINVAL); + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + int ret_val = 0; /* the return value of this function: 0 = no error */ + int rc; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + pthread_mutex_lock(&slot->sync_req_lock); + + do + { + if (slot->ind_has_arrived) + { + ret_val = 0; /* success */ + break; + } + + if (slot->ind_is_waiting) + { + LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, + __LINE__, select_id); + ret_val = -EBUSY; // busy + break; + } + + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_sec += timeout_seconds; + + /* Take new wait request */ + slot->ind_is_waiting = true; + + /* Waiting */ + rc = pthread_cond_timedwait(&slot->ind_arrived_cond, + &slot->sync_req_lock, &expire_time); + + slot->ind_is_waiting = false; + + if(rc == ETIMEDOUT) + { + LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", + __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); + ret_val = -ETIMEDOUT; //time out + } + + } while (0); + + pthread_mutex_unlock(&slot->sync_req_lock); + loc_free_slot(select_id); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_sync_send_req + +DESCRIPTION + Synchronous req call (thread safe) + +DEPENDENCIES + N/A + +RETURN VALUE + Loc API 2.0 status + +SIDE EFFECTS + N/A + +===========================================================================*/ +locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; + int select_id; + int rc = 0; + + // Select the callback we are waiting for + select_id = loc_sync_select_ind(client_handle, ind_id, req_id, + ind_payload_ptr); + + if (select_id >= 0) + { + status = locClientSendReq (client_handle, req_id, req_payload); + LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", + __func__, __LINE__, select_id, status); + + if (status != eLOC_CLIENT_SUCCESS ) + { + loc_free_slot(select_id); + } + else + { + // Wait for the indication callback + if (( rc = loc_sync_wait_for_ind( select_id, + timeout_msec / 1000, + ind_id) ) < 0) + { + if ( rc == -ETIMEDOUT) + status = eLOC_CLIENT_FAILURE_TIMEOUT; + else + status = eLOC_CLIENT_FAILURE_INTERNAL; + + // Callback waiting failed + LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " + "select id %d, status %s", __func__, __LINE__, rc , + select_id, loc_get_v02_client_status_name(status)); + } + else + { + status = eLOC_CLIENT_SUCCESS; + LOC_LOGV("%s:%d]: success (select id %d)\n", + __func__, __LINE__, select_id); + } + } + } /* select id */ + + return status; +} + + diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h new file mode 100644 index 00000000..8c7f7f19 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SYNC_REQ_H +#define LOC_SYNC_REQ_H + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include +#include "loc_api_v02_client.h" + +#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second + +/* Init function */ +extern void loc_sync_req_init(); + + +/* Process Loc API indications to wake up blocked user threads */ +extern void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* respInd id */ + void *ind_payload_ptr /* payload */ +); + +/* Thread safe synchronous request, using Loc API status return code */ +extern locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c new file mode 100644 index 00000000..bb745112 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -0,0 +1,1923 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "qmi_client.h" +#include "qmi_idl_lib.h" +#include "qmi_cci_target_ext.h" + +#if defined( _ANDROID_) +#include "qmi_cci_target.h" +#include "qmi_cci_common.h" +#elif defined(LOC_UTIL_TARGET_OFF_TARGET) +#include +#include +#include +#endif //_ANDROID_ + +#include +#include +#include +#include +#include +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" + +#include "loc_util_log.h" + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (5000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) + +#else + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (1000) + +// timeout in ms before a sync request should return +#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +//timeout in ms to wait for the service to come up +#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) +#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (60000) + +/* Table to relate eventId, size and mask value used to enable the event*/ +typedef struct +{ + uint32_t eventId; + size_t eventSize; + locClientEventMaskType eventMask; +}locClientEventIndTableStructT; + + +static locClientEventIndTableStructT locClientEventIndTable[]= { + + // position report ind + { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, + + // satellite report ind + { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, + sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), + QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, + + // NMEA report ind + { QMI_LOC_EVENT_NMEA_IND_V02, + sizeof(qmiLocEventNmeaIndMsgT_v02), + QMI_LOC_EVENT_MASK_NMEA_V02 }, + + //NI event ind + { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, + sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, + + //Time Injection Request Ind + { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, + sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, + + //Predicted Orbits Injection Request + { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, + sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, + + //Position Injection Request Ind + { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, + sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , + + //Engine State Report Ind + { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, + sizeof(qmiLocEventEngineStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, + + //Fix Session State Report Ind + { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, + sizeof(qmiLocEventFixSessionStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, + + //Wifi Request Indication + { QMI_LOC_EVENT_WIFI_REQ_IND_V02, + sizeof(qmiLocEventWifiReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, + + //Sensor Streaming Ready Status Ind + { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, + sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, + + // Time Sync Request Indication + { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, + sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, + + //Set Spi Streaming Report Event + { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, + sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, + + //Location Server Connection Request event + { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, + sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } +}; + +/* table to relate the respInd Id with its size */ +typedef struct +{ + uint32_t respIndId; + size_t respIndSize; +}locClientRespIndTableStructT; + +static locClientRespIndTableStructT locClientRespIndTable[]= { + + // get service revision ind + { QMI_LOC_GET_SERVICE_REVISION_IND_V02, + sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, + + // Get Fix Criteria Resp Ind + { QMI_LOC_GET_FIX_CRITERIA_IND_V02, + sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, + + // NI User Resp In + { QMI_LOC_NI_USER_RESPONSE_IND_V02, + sizeof(qmiLocNiUserRespIndMsgT_v02)}, + + //Inject Predicted Orbits Data Resp Ind + { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, + + //Get Predicted Orbits Data Src Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, + + // Get Predicted Orbits Data Validity Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, + + // Inject UTC Time Resp Ind + { QMI_LOC_INJECT_UTC_TIME_IND_V02, + sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, + + //Inject Position Resp Ind + { QMI_LOC_INJECT_POSITION_IND_V02, + sizeof(qmiLocInjectPositionIndMsgT_v02)}, + + //Set Engine Lock Resp Ind + { QMI_LOC_SET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocSetEngineLockIndMsgT_v02)}, + + //Get Engine Lock Resp Ind + { QMI_LOC_GET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocGetEngineLockIndMsgT_v02)}, + + //Set SBAS Config Resp Ind + { QMI_LOC_SET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, + + //Get SBAS Config Resp Ind + { QMI_LOC_GET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, + + //Set NMEA Types Resp Ind + { QMI_LOC_SET_NMEA_TYPES_IND_V02, + sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, + + //Get NMEA Types Resp Ind + { QMI_LOC_GET_NMEA_TYPES_IND_V02, + sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, + + //Set Low Power Mode Resp Ind + { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, + + //Get Low Power Mode Resp Ind + { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, + + //Set Server Resp Ind + { QMI_LOC_SET_SERVER_IND_V02, + sizeof(qmiLocSetServerIndMsgT_v02)}, + + //Get Server Resp Ind + { QMI_LOC_GET_SERVER_IND_V02, + sizeof(qmiLocGetServerIndMsgT_v02)}, + + //Delete Assist Data Resp Ind + { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + + //Set XTRA-T Session Control Resp Ind + { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, + + //Get XTRA-T Session Control Resp Ind + { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, + + //Inject Wifi Position Resp Ind + { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, + sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, + + //Notify Wifi Status Resp Ind + { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, + + //Get Registered Events Resp Ind + { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, + sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, + + //Set Operation Mode Resp Ind + { QMI_LOC_SET_OPERATION_MODE_IND_V02, + sizeof(qmiLocSetOperationModeIndMsgT_v02)}, + + //Get Operation Mode Resp Ind + { QMI_LOC_GET_OPERATION_MODE_IND_V02, + sizeof(qmiLocGetOperationModeIndMsgT_v02)}, + + //Set SPI Status Resp Ind + { QMI_LOC_SET_SPI_STATUS_IND_V02, + sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, + + //Inject Sensor Data Resp Ind + { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, + + //Inject Time Sync Data Resp Ind + { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, + sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, + + //Set Cradle Mount config Resp Ind + { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, + + //Get Cradle Mount config Resp Ind + { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, + + //Set External Power config Resp Ind + { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, + + //Get External Power config Resp Ind + { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, + + //Location server connection status + { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, + + //Set Protocol Config Parameters + { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, + + //Get Protocol Config Parameters + { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, + + //Set Sensor Control Config + { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, + + //Get Sensor Control Config + { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, + + //Set Sensor Properties + { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, + + //Get Sensor Properties + { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, + + //Set Sensor Performance Control Config + { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, + + //Get Sensor Performance Control Config + { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, + //Inject SUPL certificate + { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, + + //Delete SUPL certificate + { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, + + // Set Position Engine Config + { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, + + // Get Position Engine Config + { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} + +}; + + +/** whether indication is an event or a response */ +typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; + + +/** @struct locClientInternalState + */ + +typedef struct +{ + // client cookie + void *pClientCookie; + //QCCI handle for this control point + qmi_client_type userHandle; + + // callbacks registered by the clients + locClientEventIndCbType eventCallback; + locClientRespIndCbType respCallback; + locClientErrorCbType errorCallback; + + // the event mask the client has registered for + locClientEventMaskType eventRegMask; + +}locClientCallbackDataType; + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** locClientGetSizeAndTypeByIndId + * @brief this function gets the size and the type (event, + * response)of the indication structure from its ID + * @param [in] indId ID of the indication + * @param [out] type event or response indication + * @param [out] size size of the indications + * + * @return true if the ID was found, false otherwise */ + +static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, + locClientIndEnumT *pIndType) +{ + // look in the event table + if(true == locClientGetSizeByEventIndId(indId, pIndSize)) + { + *pIndType = eventIndType; + + LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + //else look in response table + if(true == locClientGetSizeByRespIndId(indId, pIndSize)) + { + *pIndType = respIndType; + + LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + // Id not found + LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); + return false; +} + +/** isClientRegisteredForEvent +* @brief checks the mask to identify if the client has +* registered for the specified event Id +* @param [in] eventIndId +* @param [in] eventRegMask +* @return true if client regstered for event; else false */ + +static bool isClientRegisteredForEvent( + locClientEventMaskType eventRegMask, + uint32_t eventIndId) +{ + size_t idx = 0, eventIndTableSize = 0; + + // look in the event table + eventIndTableSize = + (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); + + for(idx=0; idxresp.result == QMI_RESULT_SUCCESS ) + { + status = eLOC_CLIENT_SUCCESS; + } + else + { + switch(pResponse->resp.error) + { + case QMI_ERR_MALFORMED_MSG_V01: + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + + case QMI_ERR_DEVICE_IN_USE_V01: + status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; + break; + + default: + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + } + LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", + __func__, __LINE__, pResponse->resp.result, + pResponse->resp.error, status); + return status; +} + +/** convertQmiErrorToLocError + @brief converts a qmi service error type to + locClientErrorEnumType + @param [in] error received QMI service. + @return locClientErrorEnumType corresponding to the error. +*/ + +static locClientErrorEnumType convertQmiErrorToLocError( + qmi_client_error_type error) +{ + locClientErrorEnumType locError ; + switch(error) + { + case QMI_SERVICE_ERR: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + + default: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + } + LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", + __func__, __LINE__, error, locError); + return locError; +} + +/** locClienHandlePosReportInd + * @brief Validates a position report ind + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if pos report is valid, false otherwise +*/ +static bool locClientHandlePosReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate position report + qmiLocEventPositionReportIndMsgT_v02 *posReport = + (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", + __func__, __LINE__, ind_buf_len, + posReport->latitude, posReport->longitude, + posReport->altitudeWrtEllipsoid); + + return true; +} +//----------------------------------------------------------------------------- + +/** locClientHandleSatReportInd + * @brief Validates a satellite report indication. Dk + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if sat report is valid, false otherwise +*/ +static bool locClientHandleSatReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate sat reports + unsigned int idx = 0; + qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = + (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" + " validity = %d \n ", __func__, __LINE__, + ind_buf_len, satReport->altitudeAssumed, + satReport->svList_len, satReport->svList_valid); + //Log SV report + for( idx = 0; idx svList_len; idx++ ) + { + LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " + "status = %d \n", __func__, __LINE__, + satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, + satReport->svList[idx].system, satReport->svList[idx].svStatus); + } + + return true; +} + + +/** locClientHandleNmeaReportInd + * @brief Validate a NMEA report indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if nmea report is valid, false otherwise +*/ + + +static bool locClientHandleNmeaReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate NMEA report + return true; +} + +/** locClientHandleGetServiceRevisionRespInd + * @brief Handles a Get Service Revision Rresponse indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if service revision is valid, false otherwise +*/ + +static bool locClientHandleGetServiceRevisionRespInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + LOC_LOGV("%s:%d] :\n", __func__, __LINE__); + return true; +} + +/** locClientHandleIndication + * @brief looks at each indication and calls the appropriate + * validation handler + * @param [in] indId + * @param [in] indBuffer + * @param [in] indSize + * @return true if indication was validated; else false */ + +static bool locClientHandleIndication( + uint32_t indId, + void* indBuffer, + size_t indSize + ) +{ + bool status = false; + switch(indId) + { + // handle the event indications + //------------------------------------------------------------------------- + + // handle position report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + { + status = locClientHandlePosReportInd(indId, indBuffer, indSize); + break; + } + // handle satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + { + status = locClientHandleSatReportInd(indId, indBuffer, indSize); + break; + } + + // handle NMEA report + case QMI_LOC_EVENT_NMEA_IND_V02: + { + status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); + break; + } + + // handle NI Notify Verify Request Ind + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + { + // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Time Inject request Ind + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + { + // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle XTRA data Inject request Ind + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + { + // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle position inject request Ind + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + { + // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle engine state Ind + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + { + // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle fix session state Ind + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + { + // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Wifi request Ind + case QMI_LOC_EVENT_WIFI_REQ_IND_V02: + { + // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle sensor streaming ready status Ind + case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: + { + // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle time sync Ind + case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: + { + // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle set streaming report ind + case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: + { + // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + { + //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + //------------------------------------------------------------------------- + + // handle the response indications + //------------------------------------------------------------------------- + + // Get service Revision response indication + case QMI_LOC_GET_SERVICE_REVISION_IND_V02: + { + status = locClientHandleGetServiceRevisionRespInd(indId, + indBuffer, indSize); + break; + } + // predicted orbits data response indication + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: + { + //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : + { + //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: + { + //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: + { + //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: + { + //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: + { + //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + // for indications that only have a "status" field + case QMI_LOC_NI_USER_RESPONSE_IND_V02: + case QMI_LOC_INJECT_UTC_TIME_IND_V02: + case QMI_LOC_INJECT_POSITION_IND_V02: + case QMI_LOC_SET_ENGINE_LOCK_IND_V02: + case QMI_LOC_SET_SBAS_CONFIG_IND_V02: + case QMI_LOC_SET_NMEA_TYPES_IND_V02: + case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: + case QMI_LOC_SET_SERVER_IND_V02: + case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: + case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: + case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: + case QMI_LOC_SET_OPERATION_MODE_IND_V02: + case QMI_LOC_SET_SPI_STATUS_IND_V02: + case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: + case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: + case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: + { + status = true; + break; + } + default: + LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, + (uint32_t)indId); + status = false; + break; + } + return status; +} + + +/** locClientErrorCb + * @brief handles the QCCI error events, this is called by the + * QCCI infrastructure when the service is no longer + * available. + * @param [in] user handle + * @param [in] error + * @param [in] *err_cb_data + */ + +static void locClientErrorCb +( + qmi_client_type user_handle, + qmi_client_error_type error, + void *err_cb_data +) +{ + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)err_cb_data; + + /* copy the errorCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and error callback. + */ + locClientErrorCbType localErrorCallback = + pCallbackData->errorCallback; + + LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", + __func__, __LINE__, error, err_cb_data); + + /* call the error callback + * To avoid calling the errorCallback after locClientClose + * is called, check pCallbackData->errorCallback again here + */ + + if( (NULL != pCallbackData) && + (NULL != localErrorCallback) && + (NULL != pCallbackData->errorCallback) ) + { + //invoke the error callback for the corresponding client + localErrorCallback( + (locClientHandleType)pCallbackData, + convertQmiErrorToLocError(error), + pCallbackData->pClientCookie); + } +} + + +/** locClientIndCb + * @brief handles the indications sent from the service, if a + * response indication was received then the it is sent + * to the response callback. If a event indication was + * received then it is sent to the event callback + * @param [in] user handle + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @param [in] ind_cb_data */ + +static void locClientIndCb +( + qmi_client_type user_handle, + unsigned int msg_id, + void *ind_buf, + unsigned int ind_buf_len, + void *ind_cb_data +) +{ + locClientIndEnumT indType; + size_t indSize = 0; + qmi_client_error_type rc ; + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)ind_cb_data; + + LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", + __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, + pCallbackData); + + // check callback data + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); + return; + } + + // check user handle + if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) + { + LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", + __func__, __LINE__, + user_handle, pCallbackData->userHandle); + return; + } + // Get the indication size and type ( eventInd or respInd) + if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) + { + void *indBuffer = NULL; + + // if the client did not register for this event then just drop it + if( (eventIndType == indType) && + ( (NULL == pCallbackData->eventCallback) || + (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) + { + LOC_LOGW("%s:%d]: client is not registered for event %d\n", + __func__, __LINE__, (uint32_t)msg_id); + return; + } + + // decode the indication + indBuffer = malloc(indSize); + + if(NULL == indBuffer) + { + LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); + return; + } + + // decode the indication + rc = qmi_client_message_decode( + user_handle, + QMI_IDL_INDICATION, + msg_id, + ind_buf, + ind_buf_len, + indBuffer, + indSize); + + if( rc == QMI_NO_ERR ) + { + //validate indication + if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + { + if(eventIndType == indType) + { + locClientEventIndUnionType eventIndUnion; + + /* copy the eventCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientEventIndCbType localEventCallback = + pCallbackData->eventCallback; + + // dummy event + eventIndUnion.pPositionReportEvent = + (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; + + /* call the event callback + * To avoid calling the eventCallback after locClientClose + * is called, check pCallbackData->eventCallback again here + */ + if((NULL != localEventCallback) && + (NULL != pCallbackData->eventCallback)) + { + localEventCallback( + (locClientHandleType)pCallbackData, + msg_id, + eventIndUnion, + pCallbackData->pClientCookie); + } + } + else if(respIndType == indType) + { + locClientRespIndUnionType respIndUnion; + + /* copy the respCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientRespIndCbType localRespCallback = + pCallbackData->respCallback; + + // dummy to suppress compiler warnings + respIndUnion.pDeleteAssistDataInd = + (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; + + /* call the response callback + * To avoid calling the respCallback after locClientClose + * is called, check pCallbackData->respCallback again here + */ + if((NULL != localRespCallback) && + (NULL != pCallbackData->respCallback)) + { + localRespCallback( + (locClientHandleType)pCallbackData, + msg_id, + respIndUnion, + pCallbackData->pClientCookie); + } + } + } + else // error handling indication + { + LOC_LOGE("%s:%d]: Error handling the indication %d\n", + __func__, __LINE__, (uint32_t)msg_id); + } + } + else + { + LOC_LOGE("%s:%d]: Error decoding indication %d\n", + __func__, __LINE__, rc); + } + if(indBuffer) + { + free (indBuffer); + } + } + else // Id not found + { + LOC_LOGE("%s:%d]: Error indication not found %d\n", + __func__, __LINE__,(uint32_t)msg_id); + } + return; +} + + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +static bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientReqUnionType reqUnion; + qmiLocRegEventsReqMsgT_v02 regEventsReq; + + memset(®EventsReq, 0, sizeof(regEventsReq)); + + regEventsReq.eventRegMask = eventRegMask; + reqUnion.pRegEventsReq = ®EventsReq; + + status = locClientSendReq(clientHandle, + QMI_LOC_REG_EVENTS_REQ_V02, + reqUnion); + + if(eLOC_CLIENT_SUCCESS != status ) + { + LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status) ); + return false; + } + + return true; +} + +/** validateRequest + @brief validates the input request + @param [in] reqId request ID + @param [in] reqPayload Union of pointers to message payload + @param [out] ppOutData Pointer to void *data if successful + @param [out] pOutLen Pointer to length of data if succesful. + @return false on failure, true on Success +*/ + +static bool validateRequest( + uint32_t reqId, + const locClientReqUnionType reqPayload, + void **ppOutData, + uint32_t *pOutLen ) + +{ + bool noPayloadFlag = false; + + LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); + switch(reqId) + { + case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); + break; + } + + case QMI_LOC_REG_EVENTS_REQ_V02: + { + *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); + break; + } + + case QMI_LOC_START_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopReqMsgT_v02); + break; + } + + case QMI_LOC_NI_USER_RESPONSE_REQ_V02: + { + *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_UTC_TIME_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); + break; + } + + case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_NMEA_TYPES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SERVER_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); + break; + } + + case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_OPERATION_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SPI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); + break; + } + + // ALL requests with no payload + case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: + case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: + case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: + case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: + case QMI_LOC_GET_NMEA_TYPES_REQ_V02: + case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: + case QMI_LOC_GET_SERVER_REQ_V02: + case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: + case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: + case QMI_LOC_GET_OPERATION_MODE_REQ_V02: + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + noPayloadFlag = true; + break; + } + + default: + LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, + reqId); + return false; + } + if(true == noPayloadFlag) + { + *ppOutData = NULL; + *pOutLen = 0; + } + else + { + //set dummy pointer for request union + *ppOutData = (void*) reqPayload.pInformClientRevisionReq; + } + LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, + reqId, *pOutLen); + return true; +} + +/** locClientQmiCtrlPointInit + @brief wait for the service to come up or timeout; when the + service comes up initialize the control point and set + internal handle and indication callback. + @param pQmiClient, +*/ + +static locClientStatusEnumType locClientQmiCtrlPointInit( + locClientCallbackDataType *pLocClientCbData) +{ + qmi_client_type clnt, notifier; + bool notifierInitFlag = false; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + // instances of this service + qmi_service_info *pServiceInfo = NULL; + + do + { + uint32_t num_services = 0, num_entries = 0; + qmi_client_error_type rc = QMI_NO_ERR; + bool nosignal = false; + + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); + + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // get the service addressing information + rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, + &num_services); + LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " + "num_services %d", __func__, __LINE__, rc, num_services); + + if (rc != QMI_NO_ERR) { + // bummer, service list is not up. + // We need to try again after a timed wait + qmi_client_os_params os_params; + int timeout = 0; + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); + + if (rc != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); + nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + + // get the service addressing information + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " + "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); + } + + if (0 == num_services || rc != QMI_NO_ERR) { + if (!nosignal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!! Error %d \n", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + } else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," + " final Err %d", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_TIMEOUT; + } + break; + } + + pServiceInfo = + (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + + if(NULL == pServiceInfo) + { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + //set the number of entries to get equal to the total number of + //services. + num_entries = num_services; + //populate the serviceInfo + rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, + &num_entries, &num_services); + + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); + + // initialize the client + //sent the address of the first service found + // if IPC router is present, this will go to the service instance + // enumerated over IPC router, else it will go over the next transport where + // the service was enumerated. + rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + status = eLOC_CLIENT_SUCCESS; + + } while(0); + + /* release the notifier handle */ + if(true == notifierInitFlag) + { + qmi_client_release(notifier); + } + + if(NULL != pServiceInfo) + { + free((void *)pServiceInfo); + } + + return status; +} +//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- + +/** locClientOpen + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ + +locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientCallbackDataType *pCallbackData = NULL; + + LOC_LOGV("%s:%d] \n", __func__, __LINE__); + + do + { + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + } + + // Allocate memory for the callback data + pCallbackData = + ( locClientCallbackDataType*)calloc( + 1, sizeof(locClientCallbackDataType)); + + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize the QMI control point; this function will block + * until a service is up or a timeout occurs. If the connection to + * the service succeeds the callback data will be filled in with + * a qmi_client value. + */ + + + EXIT_LOG_CALLFLOW(%s, "loc client open"); + status = locClientQmiCtrlPointInit(pCallbackData); + + LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + + if(status != eLOC_CLIENT_SUCCESS) + { + free(pCallbackData); + pCallbackData = NULL; + break; + } + + // set the handle to the callback data + *pLocClientHandle = (locClientHandleType)pCallbackData; + + if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) + { + LOC_LOGE("%s:%d]: Error sending registration mask\n", + __func__, __LINE__); + + // release the client + locClientClose(pLocClientHandle); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize rest of the client structure now that the connection + * to the service has been created successfully. + */ + + //fill in the event callback + pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; + + //fill in the response callback + pCallbackData->respCallback = pLocClientCallbacks->respIndCb; + + //fill in the error callback + pCallbackData->errorCallback = pLocClientCallbacks->errorCb; + + //set the client event registration mask + pCallbackData->eventRegMask = eventRegMask; + + // set the client cookie + pCallbackData->pClientCookie = (void *)pClientCookie; + + LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + + }while(0); + + if(eLOC_CLIENT_SUCCESS != status) + { + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + } + + return(status); +} + +/** locClientClose + @brief Disconnects a client from the location engine. + @param [in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) - On success. + - non-zero error code(see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientClose( + locClientHandleType* pLocClientHandle) +{ + qmi_client_error_type rc = QMI_NO_ERR; //No error + + if(NULL == pLocClientHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid pointer to handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + // convert handle to callback data + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)(*pLocClientHandle); + + LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", + *pLocClientHandle, pCallbackData->userHandle ); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, "loc client close"); + // release the handle + rc = qmi_client_release(pCallbackData->userHandle); + if(QMI_NO_ERR != rc ) + { + LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", + __func__, __LINE__, rc, pCallbackData->userHandle); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* clear the memory allocated to callback data to minimize the chances + * of a race condition occurring between close and the indication + * callback + */ + memset(pCallbackData, 0, sizeof(*pCallbackData)); + + // free the memory assigned in locClientOpen + free(pCallbackData); + pCallbackData= NULL; + + // set the handle to invalid value + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + + return eLOC_CLIENT_SUCCESS; +} + +/** locClientSendReq + @brief Sends a message to the location engine. If the locClientSendMsg() + function is successful, the client should expect an indication + (except start, stop, event reg and sensor injection messages), + through the registered callback in the locOpen() function. The + indication will contain the status of the request and if status is a + success, indication also contains the payload + associated with response. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] reqId message ID of the request + @param [in] reqPayload Payload of the request, can be NULL + if request has no payload + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS ) - On success. + - non-zero error code (see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload ) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGenRespMsgT_v02 resp; + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle ) + { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + // validate that the request is correct + if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) + { + + LOC_LOGE("%s:%d] error invalid request\n", __func__, + __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, + __LINE__, reqId, reqLen); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); + + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + reqId, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + return(status); +} + +/** locClientGetSizeByRespIndId + * @brief Get the size of the response indication structure, + * from a specified id + * @param [in] respIndId + * @param [out] pRespIndSize + * @return true if resp ID was found; else false +*/ + +bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) +{ + size_t idx = 0, respIndTableSize = 0; + respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); + for(idx=0; idx +#include "location_service_v02.h" //QMI LOC Service data types definitions +#include +#include + +/****************************************************************************** + * Constants and configuration + *****************************************************************************/ + +/** @addtogroup constants_macros +@{ */ + +/** Specific value of #locClientHandleType, indicating an invalid handle. */ +#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) + +/** @} */ /* end_addtogroup constants_macros */ + +/** @addtogroup data_types +@{ */ + +/** Location client handle used to represent a specific client. Negative values + are invalid handles. */ +typedef void* locClientHandleType; + +/** Data type for events and event masks. + @newpage */ +typedef uint64_t locClientEventMaskType; + +/** Location client status values. + @vertspace +*/ +typedef enum +{ + eLOC_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + eLOC_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + eLOC_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + eLOC_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 + /**< Failed because the service has not been initialized. */ + +}locClientStatusEnumType; + +/** Loc Client error values +*/ + +typedef enum +{ + eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 + /**< Service is no longer available, the client should + close the existing connection and reopen the connection + upon getting this error. + */ +}locClientErrorEnumType; + + +/** @} */ /* end_addtogroup data_types */ + +/** @addtogroup send_request +@{ */ + +/** @brief Request messages the client can send to the location engine. + + The following requests do not have any data associated, so they do not have a + payload structure defined: + + - GetServiceRevision + - GetFixCriteria + - GetPredictedOrbitsDataSource + - GetPredictedOrbitsDataValidity + - GetEngineLock + - GetSbasConfigReq + - GetRegisteredEvents + - GetNmeaTypes + - GetLowPowerMode + - GetXtraTSessionControl + - GetRegisteredEvents + - GetOperationMode + - GetCradleMountConfig + - GetExternalPowerConfig +*/ +typedef union +{ + const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; + /**< Notifies the service about the revision the client is using. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ + + const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; + /**< Changes the events the client is interested in receiving. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_REG_EVENTS_REQ_V02. */ + + const qmiLocStartReqMsgT_v02* pStartReq; + /**< Starts a positioning session. + + The client receives the following indications: position report, + satellite report, fix session report, and NMEA report (if applicable). + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_START_REQ_V02. */ + + const qmiLocStopReqMsgT_v02* pStopReq; + /**< Stops a positioning session. The client receives a fix session report + denoting that the fix session ended after this message was sent. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_STOP_REQ_V02. */ + + const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; + /**< Informs the service about the user response for a network-initiated call. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NI_USER_RESPONSE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ + + const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; + /**< Injects the predicted orbits data into the service. + + When all predicted orbits data parts have been injected, the client + receives the following indication containing a response: + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. + + The client injects successive data parts without waiting for this + indication as long as locClientSendReq() returns successfully. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ + + const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; + /**< Injects UTC time into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_UTC_TIME_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ + + const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; + /**< Injects a position into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_POSITION_REQ_V02. */ + + const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; + /**< Sets the location engine lock. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_ENGINE_LOCK_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ + + const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; + /**< Sets the SBAS configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SBAS_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ + + const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; + /**< Sets the NMEA types configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_NMEA_TYPES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ + + const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; + /**< Sets the Low Power mode configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ + + const qmiLocSetServerReqMsgT_v02* pSetServerReq; + /**< Sets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SERVER_REQ_V02. */ + + const qmiLocGetServerReqMsgT_v02* pGetServerReq; + /**< Gets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SERVER_REQ_V02. */ + + const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; + /**< Deletes the aiding data from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; + /**< Sets XTRA-T session control in the engine. If the request is accepted by + the service, the client receives the following indication containing a + response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ + + const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; + /**< Injects a WiFi position into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ + + const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; + /**< Notifies the engine about the WiFi status. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ + + const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; + /**< Sets the engine Operation mode. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_OPERATION_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ + + const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; + /**< Sends the stationary position status to the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SPI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SPI_STATUS_REQ_V02. */ + + const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; + /**< Injects sensor data into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ + + const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; + /**< Injects time synchronization information into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ + + const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; + /**< Sets the cradle mount state information in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + SET_CRADLE_MOUNT_CONFIG_REQ_V02. + + To send this request, set the reqId field in locClientSendReq() to + SET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; + /**< Sets external power configuration state in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ + + const qmiLocInformLocationServerConnStatusReqMsgT_v02* + pInformLocationServerConnStatusReq; + /**< Informs the engine about the connection status to the location server. + + This can be sent in response to a + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The + service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 + response indication for this request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ + + const qmiLocSetProtocolConfigParametersReqMsgT_v02* + pSetProtocolConfigParametersReq; + /**< Sets the protocol configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetProtocolConfigParametersReqMsgT_v02* + pGetProtocolConfigParametersReq; + /**< Retrieves protocol configuration parameters from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocSetSensorControlConfigReqMsgT_v02* + pSetSensorControlConfigReq; + /**< Sets the sensor control configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* + pSetSensorPerformanceControlConfigReq; + /**< Sets the sensor performance configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + @newpage */ + + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; + /**< Sets the sensor properties in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + @newpage */ + + const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; + /**< Injects a SUPL certificate into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; + /**< Deletes a SUPL certificate from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* + pSetPositionEngineConfigParametersReq; + /**< Sets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* + pGetPositionEngineConfigParametersReq; + /**< Gets Position Engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. + @newpage */ + +}locClientReqUnionType; + + +/** @brief Event indications that are sent by the service. +*/ +typedef union +{ + const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; + /**< Contains the position information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. If + periodic fix criteria is specified, this event is generated multiple + times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is + sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ + + const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; + /**< Contains the GNSS satellite information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. This event + is generated at 1 Hz if the location engine is tracking satellites to + make a location fix. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ + + const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; + /**< Contains an NMEA report sentence. The entire NMEA report consisting + of multiple sentences is sent at a 1Hz rate. + This event is generated after QMI_LOC_START_REQ_V02 is sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NMEA_IND_V02. */ + + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; + /**< Notifies a location client when the network triggers a positioning request + to the mobile. + + Upon getting this event, the location client displays the + network-initiated fix request in a dialog and prompts the user to accept + or deny the request. The client responds to this request with the message + QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ + + const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; + /**< Asks the client for time assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The eventIndId field in the event indication callback is + set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ + + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + pInjectPredictedOrbitsReqEvent; + /**< Asks the client for predicted orbits data assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ + + const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; + /**< Asks the client for position assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_POSITION_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ + + const qmiLocEventEngineStateIndMsgT_v02* pEngineState; + /**< Sent by the engine whenever it turns on or off. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ + + const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; + /**< Sent by the engine when a location session begins or ends. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ + + const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; + /**< Sent by the engine when it needs WiFi support. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ + + const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* + pSensorStreamingReadyStatusEvent; + /**< Notifies the client that the engine is ready to accept sensor data. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ + + const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; + /**< Sent by the engine when it needs to synchronize its time with the sensor + processor time. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ + + const qmiLocEventSetSpiStreamingReportIndMsgT_v02* + pSetSpiStreamingReportEvent; + /**< Asks the client to start/stop sending a Stationary Position Indicator + (SPI) stream. + + The eventIndId field in the event indication callback is set to + QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ + + const qmiLocEventLocationServerConnectionReqIndMsgT_v02* + pLocationServerConnReqEvent; + /**< Sent by the engine to ask the client to open or close a connection to + a location server. + + The client responds to this request by sending the + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. + @newpage */ + +}locClientEventIndUnionType; + + +/** @brief Response indications that are sent by the service. */ +typedef union +{ + const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; + /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ + + const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; + /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ + + const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; + /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NI_USER_RESPONSE_IND_V02. */ + + const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* + pInjectPredictedOrbitsDataInd; + /**< Sent after a predicted orbits data part has been successfully injected. + + The client waits for this indication before injecting the next part. + This indication is sent in response to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* + pGetPredictedOrbitsDataSourceInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* + pGetPredictedOrbitsDataValidityInd; + /**< Response to the request, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ + + const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; + /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_UTC_TIME_IND_V02. */ + + const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; + /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_POSITION_IND_V02. */ + + const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; + /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ + + const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; + /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ + + const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; + /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ + + const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; + /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ + + const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; + /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_NMEA_TYPES_IND_V02. */ + + const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; + /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NMEA_TYPES_IND_V02. */ + + const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; + /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; + /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocSetServerIndMsgT_v02* pSetServerInd; + /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SERVER_IND_V02. */ + + const qmiLocGetServerIndMsgT_v02* pGetServerInd; + /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVER_IND_V02. */ + + const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; + /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; + /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; + /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ + + const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; + /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ + + const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; + /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ + + const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; + /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_OPERATION_MODE_IND_V02. */ + + const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; + /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_OPERATION_MODE_IND_V02. */ + + const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; + /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SPI_STATUS_IND_V02. */ + + const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; + /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ + + const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; + /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ + + const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ + + const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; + /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; + /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocInformLocationServerConnStatusIndMsgT_v02* + pInformLocationServerConnStatusInd; + /**< Response to the request, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ + + const qmiLocSetProtocolConfigParametersIndMsgT_v02* + pSetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetProtocolConfigParametersIndMsgT_v02* + pGetProtocolConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. + @newpage */ + + const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + @newpage */ + + const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* + pSetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* + pGetSensorPerformanceControlConfigInd; + /**< Response to the request, + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + @newpage */ + + const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; + /**< Response to the request, + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; + /**< Response to the request, + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + @newpage */ + + const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* + pSetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + + const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* + pGetPositionEngineConfigParametersInd; + /**< Response to the request, + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + The respIndId field in the response indication callback is set to + QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + @newpage */ + +}locClientRespIndUnionType; + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup data_types +@{ */ + +/** Location event indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the asynchronous event indications. + + @vertspace + @param handle Location client for this event. Only the client who + registered for the corresponding event receives + this callback. + @param eventIndId ID of the event indication. + @param eventIndPayload Event indication payload. + @param pClientCookie Pointer to the cookie the client specified during + registration. +*/ +typedef void (*locClientEventIndCbType)( + locClientHandleType handle, + uint32_t eventIndId, + const locClientEventIndUnionType eventIndPayload, + void *pClientCookie +); + +/** Location response indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the response indications. + + @vertspace + @param handle Location client who sent the request for which this + response indication is generated. + @param respIndId ID of the response. It is the same value as the ID + of request sent to the engine. + @param respIndPayload Payload of the response indication. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @newpage +*/ +typedef void (*locClientRespIndCbType)( + locClientHandleType handle, + uint32_t respIndId, + const locClientRespIndUnionType respIndPayload, + void *pClientCookie +); + +/** Location error callback function type. This function will be + called to inform the client that the service is no longer + available. When the client receives this callback it must + close the existing connection and reopen the client connection. + + + @vertspace + @param handle Location client who sent the request for which this + error indication is generated. + @param errorId Error ID. + @param errorCbdata Payload associated with the error indication. + + @newpage +*/ +typedef void (*locClientErrorCbType)( + locClientHandleType handle, + locClientErrorEnumType errorId, + void* pClientCookie + ); + + +/** Callback functions to be registered during locClientOpen +*/ + +typedef struct +{ + uint32_t size; + /**< Size of the structure */ + locClientEventIndCbType eventIndCb; + /**< Event Indication callback */ + locClientRespIndCbType respIndCb; + /**< Response Indication callback */ + locClientErrorCbType errorCb; + /**< Error Indication callback */ +}locClientCallbacksType; + +/** @} */ /* end_addtogroup data_types */ + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** @addtogroup open_client +@{ */ +/*========================================================================== + locClientOpen */ +/** + @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location + client to the location engine. If the connection is successful, this function + returns a handle that the location client uses for future location operations. + + @datatype + #locClientStatusEnumType\n + #locClientEventMaskType\n + #locClientCallbacksType *\n + #locClientHandleType *\n + #void * + + @vertspace + @param[in] eventRegMask Mask of asynchronous events the client is + interested in receiving. + @param[in] pLocClientCallbacks Pointer to structure containing the + callbacks. + @param[out] pLocClientHandle Pointer to the handle to be used by the + client for any subsequent requests. + @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the + client along with the callbacks. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pLocClientCookie +); + +/** @} */ /* end_addtogroup open_client */ + +/** @addtogroup close_client +@{ */ +/*========================================================================== + locClientClose */ +/** + @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client + from the location engine and sets the handle to + LOC_CLIENT_INVALID_HANDLE_VALUE. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType + + @vertspace + @param[in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + @newpage +*/ +extern locClientStatusEnumType locClientClose ( + locClientHandleType* pLocClientHandle +); + +/** @} */ /* end_addtogroup close_client */ + +/** @addtogroup send_request +@{ */ +/*============================================================================= + locClientSendReq */ +/** + @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to + the location engine. If this function is successful, the client expects an + indication (except start, stop, event registration, and sensor injection + messages) through the registered callback in the locClientOpen() function. + + The indication contains the status of the request. If the status is a success, + the indication also contains the payload associated with response. + + @datatype + #locClientStatusEnumType\n + #locClientHandleType\n + #locClientReqUnionType + + @vertspace + @param[in] handle Handle returned by the locClientOpen() function. + @param[in] reqId QMI_LOC service message ID of the request. + @param[in] pReqPayload Payload of the request. This can be NULL if the request + has no payload. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. + + @structure + locClientReqUnionType + @newpage +*/ +extern locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload +); + +/** @} */ /* end_addtogroup send_request */ + +/** @addtogroup get_size_event +@{ */ +/*============================================================================= + locClientGetSizeByEventIndId */ +/** + Gets the size of the event indication structure from a specified ID. + + @datatype + #locClientGetSizeByEventIndId + + @vertspace + @param[in] eventIndId Event indicator ID. + @param[out] pEventIndSize Pointer to the size of the structure. + + @return + true -- The event ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientEventIndUnionType + @newpage +*/ +extern bool locClientGetSizeByEventIndId( + uint32_t eventIndId, + size_t *pEventIndSize); + +/** @} */ /* end_addtogroup get_size_event */ + +/** @addtogroup get_size_response +@{ */ +/*============================================================================= + locClientGetSizeByRespIndId */ + +/** + Gets the size of the response indication structure from a specified ID. + + @datatype + #locClientGetSizeByRespIndId + + @vertspace + @param[in] respIndId Response indicator ID. + @param[out] pRespIndSize Pointer to the size of the structure. + + @return + true -- The response ID was found.\n + false -- Otherwise. + + @dependencies + None. + + @structure + locClientRespIndUnionType + @newpage +*/ +extern bool locClientGetSizeByRespIndId( + uint32_t respIndId, + size_t *pRespIndSize); + +/*=============================================================================*/ + +/** @} */ /* end_addtogroup get_size_response */ + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c new file mode 100644 index 00000000..78792607 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -0,0 +1,243 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 + +static loc_name_val_s_type loc_v02_event_name[] = +{ + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_START_REQ_V02), + NAME_VAL(QMI_LOC_START_RESP_V02), + NAME_VAL(QMI_LOC_STOP_REQ_V02), + NAME_VAL(QMI_LOC_STOP_RESP_V02), + NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), +}; +static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_event_name(uint32_t event) +{ + return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); +} + +static loc_name_val_s_type loc_v02_client_status_name[] = +{ + NAME_VAL(eLOC_CLIENT_SUCCESS), + NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), + NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), + NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), + NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), + NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), + NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), +}; +static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_client_status_name(locClientStatusEnumType status) +{ + return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); +} + + +static loc_name_val_s_type loc_v02_qmi_status_name[] = +{ + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, + eQMI_LOC_SUCCESS_V02, + eQMI_LOC_GENERAL_FAILURE_V02, + eQMI_LOC_UNSUPPORTED_V02, + eQMI_LOC_INVALID_PARAMETER_V02, + eQMI_LOC_ENGINE_BUSY_V02, + eQMI_LOC_PHONE_OFFLINE_V02, + eQMI_LOC_TIMEOUT_V02, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 +}; +static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) +{ + return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); +} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h new file mode 100644 index 00000000..c63972f9 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V02_LOG_H +#define LOC_API_V02_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_v02_event_name(uint32_t event); +const char* loc_get_v02_client_status_name(locClientStatusEnumType status); +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); + + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h new file mode 100644 index 00000000..f1b675e3 --- /dev/null +++ b/loc_api/loc_api_v02/loc_util_log.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_UTIL_LOG_H +#define LOC_UTIL_LOG_H + +#ifdef FEATURE_LOC_API_V02_QNX_MOD +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#endif //FEATURE_LOC_API_V02_QNX_MOD + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +#include + +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +// get around strl*: not found in glibc +// TBD:look for presence of eglibc other libraries +// with strlcpy supported. +#define strlcpy(X,Y,Z) strcpy(X,Y) +#define strlcat(X,Y,Z) strcat(X,Y) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#elif defined(_ANDROID_) + +#include + +#endif //LOC_UTIL_TARGET_OFF_TARGET + + +#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c new file mode 100644 index 00000000..37d93f6f --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -0,0 +1,2223 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 7, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 8, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 9, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 11, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 11, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 4, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 14, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 18, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 26, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 0, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 2, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 3, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 13, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 15, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 17, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 19, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 4, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 10, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 12, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 13, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 16, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 17, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 20, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 7, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 22, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 23, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 24, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 25, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 27, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 27, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 28, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 18, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 18, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, + {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, + {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, + {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} +}; + +/*Service Object*/ +const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x02, + 0x02, + 16, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02 +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h new file mode 100644 index 00000000..2f288145 --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -0,0 +1,5914 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x04 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x02 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x005F; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of SUPL CERT. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. \n + - Type: Unsigned integer */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyrometer, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from + the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. + These requests are generated when the service wishes to establish a + connection with a location server. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: \n + + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. + Request a single position fix. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. + High accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. + Intermediate reports are turned off. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Type: Unsigned integer \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n + - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Type: Unsigned integer \n + - Units: Milliseconds \n + - Default: 1000 ms + */ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; The control point sends this message when it wants to + stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. + Fix request failed because the engine is locked. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Type: Unsigned integer \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n + - PDOP = square root of (HDOP^2 + VDOP^2) */ + + float HDOP; + /**< Horizontal dilution of precision.\n + - Type: Floating point \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + + float VDOP; + /**< Vertical dilution of precision.\n + - Type: Floating point. \n + - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors are used. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- SENSOR_USED_ACCEL \n + - 0x00000002 -- SENSOR_USED_GYRO */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results are aided by sensors. + + Valid bitmasks are specified by the following constants: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network + Source of the time is unknown */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed + Location reliability is high; strong cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This message is used to send the position report to the + control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \n + - 0x00000000 -- SESS_STATUS_SUCCESS \n + - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n + - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n + - 0x00000003 -- SESS_STATUS_TIMEOUT \n + - 0x00000004 -- SESS_STATUS_USER_END \n + - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n + - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n + - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). \n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Type: Floating point \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< Speed uncertainty.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Type: Unsigned integer \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- RELIABILITY_NOT_SET \n + - 0x00000001 -- RELIABILITY_VERY_LOW \n + - 0x00000002 -- RELIABILITY_LOW \n + - 0x00000003 -- RELIABILITY_MEDIUM \n + - 0x00000004 -- RELIABILITY_HIGH */ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Type: Floating point \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. \n + - Type: Floating point */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \n + - 0x00000001 -- SATELLITE \n + - 0x00000002 -- CELLID \n + - 0x00000004 -- WIFI */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time \n */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Type: Floating point \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \n + - 0x00000000 -- TIME_SRC_INVALID \n + - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n + - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n + - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n + - 0x00000004 -- TIME_SRC_TOW_DECODE \n + - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n + - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n + - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n + - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. + GLONASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. + SV is being tracked. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \n + - 0x00000001 -- VALID_SYSTEM \n + - 0x00000002 -- VALID_GNSS_SVID \n + - 0x00000004 -- VALID_HEALTH_STATUS \n + - 0x00000008 -- VALID_PROCESS_STATUS \n + - 0x00000010 -- VALID_SVINFO_MASK \n + - 0x00000020 -- VALID_ELEVATION \n + - 0x00000040 -- VALID_AZIMUTH \n + - 0x00000080 -- VALID_SNR + + */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + uint16_t gnssSvId; + /**< GNSS SV ID. \n + + - Type: Unsigned integer \n + - Range: \n + -- For GPS: 1 to 32 \n + -- For SBAS: 33 to 64 \n + -- For GLONASS: 65 to 96 */ + + uint8_t healthStatus; + /**< Health status. \n + - Type: Unsigned integer \n + - Range: 0 = unhealthy; 1 = healthy */ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Type: Floating point \n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Type: Floating point \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Altitude assumed or calculated:\n + - 0x00 (FALSE) -- Valid altitude is calculated \n + - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough + satellites to determine precise altitude */ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to send NMEA sentences to the control point. */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 201 */ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. + Notify and Verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. + MS-based preferred, but MS-assisted allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. + Encoding is GSM. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Type: Unsigned integer \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. \n + - Type: Unsigned integer */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Type: Unsigned integer \n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \n + - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n + - 0x00000002 -- NI_VX_MS_BASED_ONLY \n + - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n + - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \n + - 0x00000000 -- NI_VX_OCTET \n + - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n + - 0x00000002 -- NI_VX_ASCII \n + - 0x00000003 -- NI_VX_IA5 \n + - 0x00000004 -- NI_VX_UNICODE \n + - 0x00000005 -- NI_VX_SHIFT_JIS \n + - 0x00000006 -- NI_VX_KOREAN \n + - 0x00000007 -- NI_VX_LATIN_HEBREW \n + - 0x00000008 -- NI_VX_LATIN \n + - 0x00000009 -- NI_VX_GSM + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. + No position. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. + Encoding is GSM default. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity + SUPL unknown format. */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \n + - 0x00000000 -- FORMAT_LOGICAL_NAME \n + - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n + - 0x00000002 -- FORMAT_MSISDN \n + - 0x00000003 -- FORMAT_URL \n + - 0x00000004 -- FORMAT_SIP_URL \n + - 0x00000005 -- FORMAT_MIN \n + - 0x00000006 -- FORMAT_MDN \n + - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n + - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID */ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Type: Unsigned integer \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Type: Unsigned integer \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. \n + - Type: Unsigned integer */ + + uint16_t port; + /**< IPV4 port. \n + - Type: Unsigned integer */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. \n + - Type: Unsigned integer */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \n + - 0x00000001 -- SUPL_SERVER_INFO \n + - 0x00000002 -- SUPL_SESSION_ID \n + - 0x00000004 -- SUPL_HASH \n + - 0x00000008 -- SUPL_POS_METHOD \n + - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n + - 0x00000020 -- SUPL_REQUESTOR_ID \n + - 0x00000040 -- SUPL_CLIENT_NAME \n + - 0x00000080 -- SUPL_QOP \n + - 0x00000100 -- SUPL_USER_RESP_TIMER + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \n + - 0x00000001 -- AGPS_SETASSISTED \n + - 0x00000002 -- AGPS_SETBASED \n + - 0x00000003 -- AGPS_SETASSISTED_PREF \n + - 0x00000004 -- AGPS_SETBASED_PREF \n + - 0x00000005 -- AUTONOMOUS_GPS \n + - 0x00000006 -- AFLT \n + - 0x00000007 -- ECID \n + - 0x00000008 -- EOTD \n + - 0x00000009 -- OTDOA \n + - 0x0000000A -- NO_POSITION + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. + Initial location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \n + - 0x0001 -- INVOKE_ID_MASK \n + - 0x0002 -- DATA_CODING_SCHEME_MASK \n + - 0x0004 -- NOTIFICATION_TEXT_MASK \n + - 0x0008 -- CLIENT_ADDRESS_MASK \n + - 0x0010 -- LOCATION_TYPE_MASK \n + - 0x0020 -- REQUESTOR_ID_MASK \n + - 0x0040 -- CODEWORD_STRING_MASK \n + - 0x0080 -- SERVICE_TYPE_MASK \n + - 0x0100 -- USER_RESP_TIMER_MASK + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. \n + - Type: Unsigned integer */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \n + - 0x0000000C -- NI_SS_GERMAN \n + - 0x0000000D -- NI_SS_ENGLISH \n + - 0x0000000E -- NI_SS_ITALIAN \n + - 0x0000000F -- NI_SS_FRENCH \n + - 0x00000010 -- NI_SS_SPANISH \n + - 0x00000011 -- NI_SS_DUTCH \n + - 0x00000012 -- NI_SS_SWEDISH \n + - 0x00000013 -- NI_SS_DANISH \n + - 0x00000014 -- NI_SS_PORTUGUESE \n + - 0x00000015 -- NI_SS_FINNISH \n + - 0x00000016 -- NI_SS_NORWEGIAN \n + - 0x00000017 -- NI_SS_GREEK \n + - 0x00000018 -- NI_SS_TURKISH \n + - 0x00000019 -- NI_SS_HUNGARIAN \n + - 0x0000001A -- NI_SS_POLISH \n + - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n + - 0x0000001C -- NI_SUPL_UTF8 \n + - 0x0000001D -- NI_SUPL_UCS2 \n + - 0x0000001E -- NI_SUPL_GSM_DEFAULT + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \n + - 0x00000001 -- CURRENT_LOCATION \n + - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n + - 0x00000004 -- INITIAL_LOCATION + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. \n + - Type: Unsigned integer */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Type: Unsigned integer \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \n + - 0x00000001 -- ONGOING_NI_INCOMING_MO + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). \n + - Type: Unsigned integer */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). \n + - Type: Unsigned integer */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp.\n + - Type: Unsigned integer \n + - Units: Milliseconds since Jan. 1, 1970 */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. + Location engine is off. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. + Location fix session has ended. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Type: Unsigned integer \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. + Stop periodic fixes request. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \n + - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n + - 0x00000001 -- START_PERIODIC_KEEP_WARM \n + - 0x00000002 -- STOP_PERIODIC_FIXES + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \n + + samplesPerBatch must be a non-zero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in integral number of batches per + second (Hz). \n + + batchesPerSecond must be a non-zero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \n + - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n + - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor + data + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyrometer Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor + data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. \n + - Type: Unsigned integer */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream.\n + - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n + - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. + Bring up the WWAN type used for AGNSS connections. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. + Close a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. \n + Valid values: \n + - 0x00000000 -- WWAN_TYPE_INTERNET \n + - 0x00000001 -- WWAN_TYPE_AGNSS + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. + Request failed because it timed out. */ + eQMI_LOC_TIMEOUT_V02 = 6, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. \n + - Type: Unsigned integer */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \n + - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n + - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n + - 0x00000003 -- HIGH: Client requires high horizontal accuracy. + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. \n + Valid values: \n + - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n + - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports + */ + + /* Optional */ + /* Mimimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. + User did not respond to notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \n + - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n + - 0x00000002 -- NOTIFY_VERIFY_DENY \n + - 0x00000003 -- NOTIFY_VERIFY_NORESP + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n + - 0x00000002 -- NOTIFY_ONLY \n + - 0x00000003 -- ALLOW_NO_RESP \n + - 0x00000004 -- NOT_ALLOW_NO_RESP \n + - 0x00000005 -- PRIVACY_OVERRIDE + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Type: Unsigned integer \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \n + - 0x00000000 -- PREDICTED_ORBITS_XTRA + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. \n + - Type: Unsigned integer */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Oribits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Type: Unsigned integer \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Type: Unsigned integer \n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Type: Unsigned integer \n + - Units: Milliseconds + */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. + Other sources. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. + Fully independent. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. + Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \n + - 0x00000000 -- ALT_SRC_UNKNOWN \n + - 0x00000001 -- ALT_SRC_GPS \n + - 0x00000002 -- ALT_SRC_CELL_ID \n + - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n + - 0x00000004 -- ALT_SRC_WIFI \n + - 0x00000005 -- ALT_SRC_TERRESTRIAL \n + - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n + - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n + - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n + - 0x00000009 -- ALT_SRC_OTHER + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \n + - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n + - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n + - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n + - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \n + - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n + - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the + injected horizontal position coordinates only. \n + - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the + position of the device regardless of horizontal position + (within the horizontal uncertainty region, if provided). + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. + Other sources. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -90.0 to 90.0 \n + - Positive values indicate northern latitude \n + - Negative values indicate southern latitude + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum).\n + - Type: Floating point \n + - Units: Degrees \n + - Range: -180.0 to 180.0 \n + - Positive values indicate eastern longitude \n + - Negative values indicate western longitude + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0 to 99) \n + - 0 -- invalid value \n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99 \n + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Type: Floating point \n + - Units: Meters; positive = height, negative = depth */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Type: Floating point \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109.\n + - Type: Unsigned integer \n + - Units: Percent (0-99) \n + - 0 -- invalid value\n + - 100 to 256 -- not used \n + - If 100 is received, reinterpret to 99\n + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Type: Unsigned integer \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Type: Signed integer \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from where this position was obtained. + Valid values: \n + - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n + - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n + - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n + - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n + - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n + - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n + - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n + + If altitude is specified and altitude source is not specified, the engine + assumes that altitude was obtained using the specified Position source. + If altitude and altitude source both are specified then the engine assumes + that only latitude, longitude were obtained using the specified Position + Source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. + Lock all position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. \n + - 0x01 (TRUE) -- SBAS configuration is enabled \n + - 0x00 (FALSE) -- SBAS configuration is disabled */ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. + Server type is custom PDE. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 256 + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. \n + - Type: Unsigned integer \n + - Range: \n + - For GPS: 1 to 32 \n + - For SBAS: 33 to 64 \n + - For GLONASS: 65 to 96 */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + Valid values: \n + - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n + - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n + - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n + - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n + - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + Valid values: \n + - 0x01 (TRUE) -- All assistance data is to be deleted; + if this flag is set, all the other information + contained in the optional fields for this + message are ignored \n + - 0x00 (FALSE) -- The optional fields in the message are to be used + to determine which data is to be deleted */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assitance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + Valid values: \n + - 0x00000001 -- DELETE_GPS_SVDIR \n + - 0x00000002 -- DELETE_GPS_SVSTEER \n + - 0x00000004 -- DELETE_GPS_TIME\n + - 0x00000008 -- DELETE_GPS_ALM_CORR \n + - 0x00000010 -- DELETE_GLO_SVDIR \n + - 0x00000020 -- DELETE_GLO_SVSTEER \n + - 0x00000040 -- DELETE_GLO_TIME \n + - 0x00000080 -- DELETE_GLO_ALM_CORR \n + - 0x00000100 -- DELETE_SBAS_SVDIR \n + - 0x00000200 -- DELETE_SBAS_SVSTEER \n + - 0x00000400 -- DELETE_POSITION \n + - 0x00000800 -- DELETE_TIME \n + - 0x00001000 -- DELETE_IONO \n + - 0x00002000 -- DELETE_UTC \n + - 0x00004000 -- DELETE_HEALTH \n + - 0x00008000 -- DELETE_SADATA \n + - 0x00010000 -- DELETE_RTI \n + - 0x00020000 -- DELETE_SV_NO_EXIST \n + - 0x00040000 -- DELETE_FREQ_BIAS_EST + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CELLDB_POS \n + - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n + - 0x00000004 -- DELETE_CELLDB_OTA_POS \n + - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n + - 0x00000010 -- DELETE_CELLDB_TIMETAG \n + - 0x00000020 -- DELETE_CELLDB_CELLID \n + - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n + - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n + - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n + - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. \n + Valid values: \n + - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n + - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n + - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n + - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n + - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n + - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n + - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n + - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n + - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n + - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n + - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. \n + - Type: Unsigned integer */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. + WiFi fix failed, but the cause could not be determined. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Type: Unsigned integer \n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. \n + - Type: Unsigned integer */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \n + - 0x00000000 -- ERROR_SUCCESS \n + - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n + - 0x00000002 -- ERROR_NO_AP_FOUND \n + - 0x00000003 -- ERROR_UNAUTHORIZED \n + - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n + - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n + - 0x00000006 -- ERROR_UNKNOWN + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Type: Signed integer \n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. \n + - Type: Unsigned integer */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. \n + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n + - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n + - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n + - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n + - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. + WiFi is not available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \n + - 0x00000001 -- WIFI_STATUS_AVAILABLE \n + - 0x00000002 -- WIFI_STATUS_UNAVAILABLE + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + + Valid bitmasks: \n + - 0x00000001 -- POSITION_REPORT \n + - 0x00000002 -- GNSS_SV_INFO \n + - 0x00000004 -- NMEA \n + - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n + - 0x00000010 -- INJECT_TIME_REQ \n + - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n + - 0x00000040 -- INJECT_POSITION_REQ \n + - 0x00000080 -- ENGINE_STATE \n + - 0x00000100 -- FIX_SESSION_STATE \n + - 0x00000200 -- WIFI_REQ \n + - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n + - 0x00000800 -- TIME_SYNC_REQ \n + - 0x00001000 -- SET_SPI_STREAMING_REPORT \n + - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. + Use cell ID. For 1x, this mode corresponds to + AFLT. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \n + - 0x00000001 -- OPER_MODE_DEFAULT \n + - 0x00000002 -- OPER_MODE_MSB \n + - 0x00000003 -- OPER_MODE_MSA \n + - 0x00000004 -- OPER_MODE_STANDALONE \n + - 0x00000005 -- OPER_MODE_CELL_ID + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary:\n + - 0x00 (FALSE) -- Device is not stationary \n + - 0x01 (TRUE) -- Device is stationary */ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the sensor time of the first sample.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Type: Floating point \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyrometer: ( (rads)/(seconds^2) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit time tag of the first (oldest) sample in this + message. \n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \n + - 0x01 -- SIGN REVERSAL + */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyrometer Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyrometer sensor samples. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. \n + - Type: Unsigned integer */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< This field lets the client know how many 3-axis accelerometer samples + were accepted. */ + + /* Optional */ + /* Gyrometer Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< This field lets the client know how many 3-axis gyrometer samples were + accepted. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< The value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< The value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle + Unknown cradle mount state */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n + - 0x00000001 -- CRADLE_STATE_MOUNTED \n + - 0x00000002 -- CRADLE_STATE_UNKNOWN */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Type: Unsigned integer \n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. + Unknown external power state. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n + - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n + - 0x00000002 -- EXTERNAL_POWER_UNKNOWN + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. + PPP PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the Access Point Name (APN) profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. \n + - Type: NULL-terminated string \n + - Maximum string length (including NULL terminator): 101 + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. + Location server request failed. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. \n + - Type: Unsigned integer */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n APN profile information is present only when requestType + is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. + V2 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. + SUPL version 2.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< This field is sent only if the status is not a success. And if it is + not successful, this field will identify the parameters that were not + set successfully. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n + - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n + - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. \n + - 0x01 (TRUE) -- SUPL security is enabled \n + - 0x00 (FALSE) -- SUPL security is disabled */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - 0x00000001 -- VX_VERSION_V1_ONLY \n + - 0x00000002 -- VX_VERSION_V2_ONLY + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + + Inertial sensors are not to be used to aid heading and position + improvement. */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in heading and + position improvement. + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values:\n + - 0x00000000 -- SENSORS USE ENABLED: \n + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. \n + - 0x00000001 -- SENSORS USE DISABLED: \n + Inertial sensors are not to be used to aid in the heading and + position improvement. + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/second^4 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPropertiesReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPropertiesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Gyro Bias Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk parameter as a positive + floating-point value. This value does not have any internal defaults. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: radians^2/seconds^4 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors + Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal + number of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< This field is sent only if the status is not a success. + When sent, this field identifies which configuration failed. \n + Valid bitmasks: \n + - 0x0000000000000001 -- PERFORMANCE_MODE \n + - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n + - 0x0000000000000004 -- GYRO_SAMPLING_SPEC + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. \n + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \n + - 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data injection + based on internal criteria. This is the default. \n + - 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time the GNSS + location engine turns on. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ + + /* Optional */ + /* Gyrometer Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data. The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Id */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate + Type: Unsigned Integer + Units: Bytes + Range: 0-9 */ + + /* Mandatory */ + /* SUPL certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< The supl Certificate contents + Type: Array of bytes. + - Maximum certificate size : 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* Supl Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the inject SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Delete a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate Id */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate Id of the Supl Certificate to be deleted + Type: Unsigned Integer \n + Units: Bytes \n + Range: 0-9 \n + If suplCertId is not specified then + "all" supl certificates will be deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Delete a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL certifcate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the delete SUPL certificate request. \n + + Valid Values: + - 0x00000000 -- SUCCESS\n + - 0x00000001 -- GENERAL_FAILURE\n + - 0x00000002 -- UNSUPPORTED\n + - 0x00000003 -- INVALID_PARAMETER\n + - 0x00000004 -- ENGINE_BUSY\n + - 0x00000005 -- PHONE_OFFLINE\n + - 0x00000006 -- LOC_TIMEOUT\n + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the + injected position in direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data + in the persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position will be used in position engine.\n + Valid values: \n + - 0x01 (TRUE) -- Use the injected position in direct position + calculation. \n + - 0x00 (FALSE) -- Do not use the injected position in direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls if SV usage will be filtered in a position fix. + Valid values:\n + - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n + - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data should be stored in + the persistent memory. \n + Valid values:\n + - 0x01 (TRUE) -- Store assistance data in persistent memory. \n + - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + Valid bitmasks: \n + - 0x00000001 -- INJECTED_POSITION_CONTROL \n + - 0x00000002 -- FILTER_SV_USAGE \n + - 0x00000004 -- STORE_ASSIST_DATA + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000003 -- INVALID_PARAMETER \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000005 -- PHONE_OFFLINE \n + - 0x00000006 -- LOC_TIMEOUT + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies if the injected position is used for direct calculation + in the position engine.\n + Valid values: \n + - 0x01 (TRUE) -- The injected position is used in direct position + calculation. \n + - 0x00 (FALSE) -- The injected position is not used direct position + calculation. \n + The default value is TRUE, the injected position is used in direct + position calculation by default. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies if SV usage is filtered in a position fix. + Valid values: \n + - 0x01 (TRUE) -- SV usage is filtered in the fix. \n + - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n + The default value is FALSE, the SV usage is not filtered in the + fix by default. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies if assistance data is stored in the persistent memory. \n + Valid values: \n + 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n + 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n + The default value is TRUE, the assistance data is stored in + persistent memory by default. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h new file mode 100644 index 00000000..6321bb9c --- /dev/null +++ b/loc_api/ulp/inc/ulp.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_H +#define ULP_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +typedef int (ulp_report_position_cb) +( + void* owner, + const GpsLocation* location_report_ptr, + unsigned int ext_data_length, + unsigned char* ext_data +); + +/** Represents the standard ulp module interface. */ +typedef struct { + /** set to sizeof(ulpInterface) */ + size_t size; + + /** + * Starts the ulp module. 0: success + */ + int (*init)( void* owner, ulp_report_position_cb* cb); + + /** Starts the ulp engine. 0: success */ + int (*start_fix)( void ); + + /** Stops the ulp engine. 0: success */ + int (*stop_fix)( void ); + + /** Closes the interface */ + int (*destroy)( void ); + +} ulpInterface; + +typedef const ulpInterface* (get_ulp_interface) (void); + + +#ifdef __cplusplus +} +#endif +#endif /* ULP_H */ + From 52f4c8ca93985643a6aac0ba0dbdc3eac532ba49 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 21 Mar 2013 17:30:22 -0700 Subject: [PATCH 096/945] add LOCAL_MODULE_OWNER := qcom to gps modules Port back of an earlier patch applied to the GPS HAL that was moved out of aosp (change id of the patch was Icc302c91da4104679d2548e4527d0aee430f3761 Change-Id: I133f92e316872c60830df5553f31d34ecd9d7a84 --- loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk | 1 + loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk | 1 + loc_api/libloc_api-rpc/Android.mk | 1 + loc_api/libloc_api/Android.mk | 1 + loc_api/libloc_api_50001/Android.mk | 1 + loc_api/loc_api_v02/Android.mk | 1 + 6 files changed, 6 insertions(+) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index 1287c69e..c7a245b8 100755 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -53,6 +53,7 @@ LOCAL_COPY_HEADERS:= \ $(RPC_INC)/loc_apicb_appinit.h LOCAL_MODULE:= libloc_api-rpc-qc +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk index abd15c8f..c0987e6d 100755 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk @@ -7,6 +7,7 @@ LOC_RPCGEN_APIS_PATH := $(TARGET_OUT_INTERMEDIATES)/loc_api/libloc_api_rpcgen_in 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 \ diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk index f70cba50..06e46948 100755 --- a/loc_api/libloc_api-rpc/Android.mk +++ b/loc_api/libloc_api-rpc/Android.mk @@ -53,6 +53,7 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/librpc LOCAL_MODULE:= libloc_api-rpc +LOCAL_MODULE_OWNER := qcom include $(BUILD_STATIC_LIBRARY) diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk index f20280ee..2922a4ab 100755 --- a/loc_api/libloc_api/Android.mk +++ b/loc_api/libloc_api/Android.mk @@ -4,6 +4,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index f37ca311..4d657aea 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -12,6 +12,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_adapter +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk index b6c7a66e..a8db2765 100755 --- a/loc_api/loc_api_v02/Android.mk +++ b/loc_api/loc_api_v02/Android.mk @@ -5,6 +5,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_api_v02 +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional From ade0338d23f65f84b098307df0b853b7837ded76 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 25 Mar 2013 16:58:31 -0700 Subject: [PATCH 097/945] moved most of the GPS HAL back to aosp This part of the HAL compiles without the need for additional dependency Change-Id: I36873579ef1b20c2441603729d2de83da6775319 --- loc_api/Android.mk | 4 - loc_api/loc_api_v02/Android.mk | 44 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2059 ------- loc_api/loc_api_v02/LocApiV02Adapter.h | 197 - loc_api/loc_api_v02/loc_api_sync_req.c | 548 -- loc_api/loc_api_v02/loc_api_sync_req.h | 68 - loc_api/loc_api_v02/loc_api_v02_client.c | 1923 ------- loc_api/loc_api_v02/loc_api_v02_client.h | 1255 ----- loc_api/loc_api_v02/loc_api_v02_log.c | 243 - loc_api/loc_api_v02/loc_api_v02_log.h | 50 - loc_api/loc_api_v02/loc_util_log.h | 81 - loc_api/loc_api_v02/location_service_v02.c | 2223 -------- loc_api/loc_api_v02/location_service_v02.h | 5914 -------------------- 13 files changed, 14609 deletions(-) delete mode 100755 loc_api/loc_api_v02/Android.mk delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.h delete mode 100644 loc_api/loc_api_v02/loc_util_log.h delete mode 100644 loc_api/loc_api_v02/location_service_v02.c delete mode 100644 loc_api/loc_api_v02/location_service_v02.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index d2f53c58..e9c8d1e6 100755 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -21,10 +21,6 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ -else - -GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ - endif #TARGET_NO_RPC endif diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk deleted file mode 100755 index a8db2765..00000000 --- a/loc_api/loc_api_v02/Android.mk +++ /dev/null @@ -1,44 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_api_v02 -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libqmi_cci \ - libqmi_csi \ - libqmi_common_so \ - libloc_adapter \ - libgps.utils - -LOCAL_SRC_FILES += \ - LocApiV02Adapter.cpp \ - loc_api_v02_log.c \ - loc_api_v02_client.c \ - loc_api_sync_req.c \ - location_service_v02.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -## Includes -LOCAL_C_INCLUDES := \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/qcci/inc \ - $(TOP)/vendor/qcom/proprietary/qmi-framework/common/inc \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp deleted file mode 100644 index cfb2265d..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ /dev/null @@ -1,2059 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "LocApiV02Adapter.h" -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" -#include "LocApiAdapter.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_adapter" -#include "loc_util_log.h" - - -/* Default session id ; TBD needs incrementing for each */ -#define LOC_API_V02_DEF_SESSION_ID (1) - -/* Default minimium interval in ms */ -#define LOC_API_V02_DEF_MIN_INTERVAL (1000) - -/* Default horizontal accuracy in meters*/ -#define LOC_API_V02_DEF_HORZ_ACCURACY (50) - -/* Default timeout in ms; TBD: needs implementing */ -#define LOC_API_V02_DEF_TIMEOUT (120000) - -/* UMTS CP Address key*/ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -/* GPS SV Id offset */ -#define GPS_SV_ID_OFFSET (1) - -/* GLONASS SV Id offset */ -#define GLONASS_SV_ID_OFFSET (65) - -/* SV ID range */ -#define SV_ID_RANGE (32) - - - -/* static event callbacks that call the LocApiV02Adapter callbacks*/ - -/* global event callback, call the eventCb function in loc api adapter v02 - instance */ -static void globalEventCb(locClientHandleType clientHandle, - uint32_t eventId, - const locClientEventIndUnionType eventPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, eventId, pClientCookie); - - // return if null is passed - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", - __func__, __LINE__, clientHandle, eventId); - return; - } - locApiV02AdapterInstance->eventCb(clientHandle, - eventId, - eventPayload); -} - -/* global response callback, it calls the sync request process - indication function to unblock the request that is waiting on this - response indication*/ -static void globalRespCb(locClientHandleType clientHandle, - uint32_t respId, - const locClientRespIndUnionType respPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - - LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, respId, pClientCookie); - - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", - __func__, __LINE__, clientHandle, respId); - return; - } - // process the sync call - // use pDeleteAssistDataInd as a dummy pointer - loc_sync_process_ind(clientHandle, respId, - (void *)respPayload.pDeleteAssistDataInd); -} - -/* global error callback, it will call the handle service down - function in the loc api adapter instance. */ -static void globalErrorCb (locClientHandleType clientHandle, - locClientErrorEnumType errorId, - void *pClientCookie) -{ - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, errorId, pClientCookie); - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", - __func__, __LINE__, clientHandle, errorId); - return; - } - locApiV02AdapterInstance->errorCb(clientHandle, - errorId); -} - -/* global structure containing the callbacks */ -locClientCallbacksType globalCallbacks = -{ - sizeof(locClientCallbacksType), - globalEventCb, - globalRespCb, - globalErrorCb -}; - -/* Constructor for LocApiV02Adapter */ -LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): - LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), - eventMask(convertMask(locEng.eventMask)), navigating(false), - fixCriteria (LOC_POSITION_MODE_MS_BASED, GPS_POSITION_RECURRENCE_PERIODIC, - LOC_API_V02_DEF_MIN_INTERVAL, LOC_API_V02_DEF_HORZ_ACCURACY, - LOC_API_V02_DEF_TIMEOUT ) -{ - // initialize loc_sync_req interface - loc_sync_req_init(); -} - -/* Destructor for LocApiV02Adapter */ -LocApiV02Adapter :: ~LocApiV02Adapter() -{ - deInitLocClient(); -} - -/* close Loc API V02 client */ -int LocApiV02Adapter :: deInitLocClient() -{ - return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; -} - -/* Initialize a loc api v02 client */ -enum loc_api_adapter_err LocApiV02Adapter :: reinit() -{ - locClientStatusEnumType status; - /* If the client is already open close it first */ - if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) - { - status = locClientClose(&clientHandle); - if( eLOC_CLIENT_SUCCESS != status) - { - LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, - __LINE__, status); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - } - - LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, - __LINE__, this); - /* initialize the loc api v02 interface, note that - the locClientOpen() function will block if the - service is unavailable for a fixed time out */ - - status = locClientOpen( - eventMask, &globalCallbacks, &clientHandle, (void *)this); - - if (eLOC_CLIENT_SUCCESS != status || - clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) - { - LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, - __LINE__, loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - - // return SUCCESS - return (LOC_API_ADAPTER_ERR_SUCCESS); -} - -/* start positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: startFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStartReqMsgT_v02 start_msg; - - qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; - qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; - - // clear all fields, validity masks - memset (&start_msg, 0, sizeof(start_msg)); - memset (&set_mode_msg, 0, sizeof(set_mode_msg)); - memset (&set_mode_ind, 0, sizeof(set_mode_ind)); - - LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); - - // fill in the start request - switch(fixCriteria.mode) - { - case LOC_POSITION_MODE_MS_BASED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; - break; - - case LOC_POSITION_MODE_MS_ASSISTED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; - break; - - case LOC_POSITION_MODE_RESERVED_4: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; - break; - - default: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; - break; - } - - req_union.pSetOperationModeReq = &set_mode_msg; - - // send the mode first, before the start message. - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_OPERATION_MODE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_OPERATION_MODE_IND_V02, - &set_mode_ind); // NULL? - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) - { - LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " - "ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_mode_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error - } - - if(fixCriteria.min_interval > 0) - { - start_msg.minInterval_valid = 1; - start_msg.minInterval = fixCriteria.min_interval; - } - - start_msg.horizontalAccuracyLevel_valid = 1; - - if (fixCriteria.preferred_accuracy <= 100) - { - // fix needs high accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; - } - else if (fixCriteria.preferred_accuracy <= 1000) - { - //fix needs med accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; - } - else - { - //fix needs low accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; - } - - start_msg.fixRecurrence_valid = 1; - if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; - } - else - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; - } - - //dummy session id - // TBD: store session ID, check for session id in pos reports. - start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;; - - req_union.pStartReq = &start_msg; - - status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, - req_union ); - - if( eLOC_CLIENT_SUCCESS == status) - { - navigating = true; - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - // start_fix failed so MO fix is not in progress - navigating = false; - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; -} - -/* stop a positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: stopFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStopReqMsgT_v02 stop_msg; - - LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); - - memset(&stop_msg, 0, sizeof(stop_msg)); - - // dummy session id - stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - req_union.pStopReq = &stop_msg; - - status = locClientSendReq(clientHandle, - QMI_LOC_STOP_REQ_V02, - req_union); - - if( eLOC_CLIENT_SUCCESS == status) - { - navigating = false; - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, - loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); -} - -/* set the positioning fix criteria */ -enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) -{ - - LOC_LOGV ("%s:%d]: interval = %d, mode = %d, recurrence = %d, preferred_accuracy = %d\n",__func__, __LINE__, - min_interval, mode, recurrence, preferred_accuracy); - - //store the fix criteria - fixCriteria.mode = mode; - - fixCriteria.recurrence = recurrence; - - if(min_interval == 0) - { - fixCriteria.min_interval = MIN_POSSIBLE_FIX_INTERVAL; - } - else - { - fixCriteria.min_interval = min_interval; - } - - fixCriteria.preferred_accuracy = preferred_accuracy; - - fixCriteria.preferred_time = preferred_time; - - if(true == navigating) - { - //fix is in progress, send a restart - LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " - "criteria\n", __func__, __LINE__); - - return( startFix()); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject time into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; - qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; - - memset(&inject_time_msg, 0, sizeof(inject_time_msg)); - - inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; - - inject_time_msg.timeUtc = time; - - inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); - - inject_time_msg.timeUnc = uncertainty; - - req_union.pInjectUtcTimeReq = &inject_time_msg; - - LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, - uncertainty); - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_UTC_TIME_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_UTC_TIME_IND_V02, - &inject_time_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) - { - LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_time_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject position into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - injectPosition(double latitude, double longitude, float accuracy) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; - qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; - - memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); - - inject_pos_msg.latitude_valid = 1; - inject_pos_msg.latitude = latitude; - - inject_pos_msg.longitude_valid = 1; - inject_pos_msg.longitude = longitude; - - inject_pos_msg.horUncCircular_valid = 1; - - inject_pos_msg.horUncCircular = accuracy; //meters assumed - - inject_pos_msg.horConfidence_valid = 1; - - inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) - - /* Log */ - LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, - inject_pos_msg.latitude, inject_pos_msg.longitude, - inject_pos_msg.horUncCircular); - - req_union.pInjectPositionReq = &inject_pos_msg; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_POSITION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_POSITION_IND_V02, - &inject_pos_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_pos_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* delete assistance date */ -enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocDeleteAssistDataReqMsgT_v02 delete_req; - qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; - - memset(&delete_req, 0, sizeof(delete_req)); - memset(&delete_resp, 0, sizeof(delete_resp)); - - if( f == GPS_DELETE_ALL ) - { - delete_req.deleteAllFlag = true; - } - - else - { - /* to keep track of svInfoList for GPS and GLO*/ - uint32_t curr_sv_len = 0; - uint32_t curr_sv_idx = 0; - uint32_t sv_id = 0; - - if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) - { - /* do delete for all GPS SV's */ - - curr_sv_len += SV_ID_RANGE; - - sv_id = GPS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - // increment the current index - curr_sv_idx += SV_ID_RANGE; - - } - -#ifdef QCOM_FEATURE_DELEXT - if( f & GPS_DELETE_TIME_GPS ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; - } -#endif - if(f & GPS_DELETE_POSITION ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; - } - - if(f & GPS_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; - } - - if(f & GPS_DELETE_IONO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; - } - - if(f & GPS_DELETE_UTC ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; - } - - if(f & GPS_DELETE_HEALTH ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; - } - - if(f & GPS_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; - } - if(f & GPS_DELETE_SADATA ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; - } - if(f & GPS_DELETE_RTI ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; - } - if(f & GPS_DELETE_CELLDB_INFO ) - { - delete_req.deleteCellDbDataMask_valid = 1; - delete_req.deleteCellDbDataMask = - ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; - - } -#ifdef QCOM_FEATURE_DELEXT - if(f & GPS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; - } - if(f & GPS_DELETE_FREQ_BIAS_EST ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; - } - if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) - { - /* do delete for all GLONASS SV's (65 - 96) - */ - curr_sv_len += SV_ID_RANGE; - - sv_id = GLONASS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - curr_sv_idx += SV_ID_RANGE; - } - - if(f & GPS_DELETE_SVDIR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; - } - - if(f & GPS_DELETE_SVSTEER_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; - } - - if(f & GPS_DELETE_ALMANAC_CORR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; - } - - if(f & GPS_DELETE_TIME_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; - } -#endif - } - - req_union.pDeleteAssistDataReq = &delete_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - &delete_resp); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != delete_resp.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(delete_resp.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* send NI user repsonse to the engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - - qmiLocNiUserRespReqMsgT_v02 ni_resp; - qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; - - memset(&ni_resp,0, sizeof(ni_resp)); - - memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); - - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; - break; - case GPS_NI_RESPONSE_DENY: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; - break; - case GPS_NI_RESPONSE_NORESP: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; - break; - default: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, - ni_resp.userResp); - - ni_resp.notificationType = request_pass_back->notificationType; - - // copy SUPL payload from request - if(request_pass_back->NiSuplInd_valid == 1) - { - ni_resp.NiSuplPayload_valid = 1; - memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), - sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); - - } - // should this be an "else if"?? we don't need to decide - - // copy UMTS-CP payload from request - if( request_pass_back->NiUmtsCpInd_valid == 1 ) - { - ni_resp.NiUmtsCpPayload_valid = 1; - memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), - sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); - } - - //copy Vx payload from the request - if( request_pass_back->NiVxInd_valid == 1) - { - ni_resp.NiVxPayload_valid = 1; - memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), - sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); - } - - // copy Vx service interaction payload from the request - if(request_pass_back->NiVxServiceInteractionInd_valid == 1) - { - ni_resp.NiVxServiceInteractionPayload_valid = 1; - memcpy(&(ni_resp.NiVxServiceInteractionPayload), - &(request_pass_back->NiVxServiceInteractionInd), - sizeof(qmiLocNiVxServiceInteractionStructT_v02)); - } - - req_union.pNiUserRespReq = &ni_resp; - - status = loc_sync_send_req ( - clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(ni_resp_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Set UMTs SLP server URL */ -enum loc_api_adapter_err LocApiV02Adapter :: setServer( - const char* url, int len) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - - if(len <=0 || len > sizeof(set_server_req.urlAddr)) - { - LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", - __func__, __LINE__, len); - - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); - - set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; - - set_server_req.urlAddr_valid = 1; - - strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err LocApiV02Adapter :: - setServer(unsigned int ip, int port, LocServerType type) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - qmiLocServerTypeEnumT_v02 set_server_cmd; - - switch (type) { - case LOC_AGPS_MPC_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; - break; - case LOC_AGPS_CUSTOM_PDE_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; - break; - default: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; - break; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); - - set_server_req.serverType = set_server_cmd; - set_server_req.ipv4Addr_valid = 1; - set_server_req.ipv4Addr.addr = ip; - set_server_req.ipv4Addr.port = port; - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Inject XTRA data, this module breaks down the XTRA - file into "chunks" and injects them one at a time */ -enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( - char* data, int length) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - int total_parts; - uint8_t part; - uint16_t len_injected; - - locClientReqUnionType req_union; - qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; - qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; - - req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; - - LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); - - inject_xtra.formatType_valid = 1; - inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; - inject_xtra.totalSize = length; - - total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; - - inject_xtra.totalParts = total_parts; - - len_injected = 0; // O bytes injected - - // XTRA injection starts with part 1 - for (part = 1; part <= total_parts; part++) - { - inject_xtra.partNum = part; - - if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) - { - inject_xtra.partData_len = length - len_injected; - } - else - { - inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; - } - - // copy data into the message - memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); - - LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", - __func__, __LINE__, - inject_xtra.partNum, total_parts, inject_xtra.partData_len, - len_injected); - - status = loc_sync_send_req( clientHandle, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - &inject_xtra_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || - inject_xtra.partNum != inject_xtra_ind.partNum) - { - LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," - " part num = %d, ind.partNum = %d\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_xtra_ind.status), - inject_xtra.partNum, inject_xtra_ind.partNum); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - break; - } - - len_injected += inject_xtra.partData_len; - LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, - len_injected); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} -#ifdef QCOM_FEATURE_IPV6 -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s], bearer = %d \n", __func__, __LINE__, - handle, is_succ, apn, bear); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - switch(bear) - { - case AGPS_APN_BEARER_IPV4: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - break; - - case AGPS_APN_BEARER_IPV6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; - break; - - case AGPS_APN_BEARER_IPV4V6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; - break; - - default: - LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} -#else -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s] \n", __func__, __LINE__, - handle, is_succ, apn); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} -#endif -/* close atl connection */ -enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( - int handle, int is_succ) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", - __func__, __LINE__, handle, is_succ); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the SUPL version */ -enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; - - LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); - - - memset(&supl_config_req, 0, sizeof(supl_config_req)); - memset(&supl_config_ind, 0, sizeof(supl_config_ind)); - - supl_config_req.suplVersion_valid = 1; - // SUPL version from MSByte to LSByte: - // (reserved)(major version)(minor version)(serviceIndicator) - - supl_config_req.suplVersion = (version == 0x00020000)? - eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; - - req_union.pSetProtocolConfigParametersReq = &supl_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &supl_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(supl_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Configuration */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; - qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; - - LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); - - memset(&sensor_config_req, 0, sizeof(sensor_config_req)); - memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); - - sensor_config_req.sensorsUsage_valid = 1; - sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 - : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; - - req_union.pSetSensorControlConfigReq = &sensor_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - &sensor_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Properties */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorProperties(float gyroBiasVarianceRandomWalk) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; - qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; - - LOC_LOGI("%s:%d]: sensors prop gyroBiasRandomWalk = %f\n", - __func__, __LINE__, gyroBiasVarianceRandomWalk); - - memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); - memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); - - sensor_prop_req.gyroBiasVarianceRandomWalk_valid = 1; - sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; - - req_union.pSetSensorPropertiesReq = &sensor_prop_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - &sensor_prop_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_prop_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Performance Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; - qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; - - LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", - __FUNCTION__, - __LINE__, - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec - ); - - memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); - memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); - - sensor_perf_config_req.performanceControlMode_valid = 1; - sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; - sensor_perf_config_req.accelSamplingSpec_valid = 1; - sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; - sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; - sensor_perf_config_req.gyroSamplingSpec_valid = 1; - sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; - sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; - - req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - &sensor_perf_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Convert event mask from loc eng to loc_api_v02 format */ -locClientEventMaskType LocApiV02Adapter :: convertMask( - LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - locClientEventMaskType eventMask = 0; - LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); - - if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; - - if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; - - /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ - if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || - (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) - eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; - - if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; - - if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) - { - // TBD: This needs to be decoupled in the HAL - eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; - } - - if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) - { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); - } - - if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; - - return eventMask; -} - -/* Convert error from loc_api_v02 to loc eng format*/ -enum loc_api_adapter_err LocApiV02Adapter :: convertErr( - locClientStatusEnumType status) -{ - switch( status) - { - case LOC_API_ADAPTER_ERR_SUCCESS: - return LOC_API_ADAPTER_ERR_SUCCESS; - - case eLOC_CLIENT_FAILURE_GENERAL: - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - - case eLOC_CLIENT_FAILURE_UNSUPPORTED: - return LOC_API_ADAPTER_ERR_UNSUPPORTED; - - case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - - case eLOC_CLIENT_FAILURE_ENGINE_BUSY: - return LOC_API_ADAPTER_ERR_ENGINE_BUSY; - - case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: - return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; - - case eLOC_CLIENT_FAILURE_TIMEOUT: - return LOC_API_ADAPTER_ERR_TIMEOUT; - - case eLOC_CLIENT_FAILURE_INVALID_HANDLE: - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - - case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: - return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; - - default: - return LOC_API_ADAPTER_ERR_FAILURE; - } -} - -/* convert position report to loc eng format and send the converted - position to loc eng */ - -void LocApiV02Adapter :: reportPosition ( - const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) -{ - GpsLocation location; - - memset(&location, 0, sizeof (GpsLocation)); - location.size = sizeof(location); - // Process the position from final and intermediate reports - - if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || - (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) - ) - { - // Latitude & Longitude - if( (location_report_ptr->latitude_valid == 1 ) && - (location_report_ptr->longitude_valid == 1) && - (location_report_ptr->latitude != 0 || - location_report_ptr->longitude!= 0)) - { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; - - // Time stamp (UTC) - if(location_report_ptr->timestampUtc_valid == 1) - { - location.timestamp = location_report_ptr->timestampUtc; - } - - // Altitude - if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) - { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitudeWrtEllipsoid; - } - - // Speed - if((location_report_ptr->speedHorizontal_valid == 1) && - (location_report_ptr->speedVertical_valid ==1 ) ) - { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt( - (location_report_ptr->speedHorizontal * - location_report_ptr->speedHorizontal) + - (location_report_ptr->speedVertical * - location_report_ptr->speedVertical) ); - } - - // Heading - if(location_report_ptr->heading_valid == 1) - { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if( (location_report_ptr->horUncCircular_valid ) ) - { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->horUncCircular; - } - - LocApiAdapter::reportPosition( location, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->sessionStatus - == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); - } - } - else - { - LocApiAdapter::reportPosition(location, - NULL, - LOC_SESS_FAILURE); - - LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " - "fix id = %u\n", __func__, __LINE__, - location_report_ptr->sessionStatus, - location_report_ptr->fixId ); - } -} - -/* convert satellite report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportSv ( - const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - int num_svs_max, i; - const qmiLocSvInfoStructT_v02 *sv_info_ptr; - - LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, - gnss_report_ptr->svList_len); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - if(gnss_report_ptr->svList_valid == 1) - { - num_svs_max = gnss_report_ptr->svList_len; - if(num_svs_max > GPS_MAX_SVS) - { - num_svs_max = GPS_MAX_SVS; - } - SvStatus.num_svs = 0; - for(i = 0; i < num_svs_max; i++) - { - sv_info_ptr = &(gnss_report_ptr->svList[i]); - if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && - (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) - && (sv_info_ptr->gnssSvId != 0 )) - { - if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); - SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; - - // We only have the data field to report gps eph and alm mask - if(sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) - { - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) - { - SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) - { - SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - } - - if((sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) - && - (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) - { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + (65-1); - } - // Unsupported SV system - else - { - continue; - } - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) - { - SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) - { - SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) - { - SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; - } - - SvStatus.num_svs++; - } - } - - if (SvStatus.num_svs != 0) - { - LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); - LocApiAdapter::reportSv(SvStatus, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); - } -} - -/* convert engine state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) -{ - - LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, - engine_state_ptr->engineState); - - if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); - } - else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); - } - -} - -/* convert fix session state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) -{ - GpsStatusValue status; - LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, - fix_session_state_ptr->sessionState); - - status = GPS_STATUS_NONE; - if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) - { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (fix_session_state_ptr->sessionState - == eQMI_LOC_FIX_SESSION_FINISHED_V02) - { - status = GPS_STATUS_SESSION_END; - } - LocApiAdapter::reportStatus(status); -} - -/* convert NMEA report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportNmea ( - const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) -{ - - LocApiAdapter::reportNmea(nmea_report_ptr->nmea, - strlen(nmea_report_ptr->nmea)); - - LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, - nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], - nmea_report_ptr->nmea[5]); -} - -/* convert and report an ATL request to loc engine */ -void LocApiV02Adapter :: reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) -{ - uint32_t connHandle = server_request_ptr->connHandle; - // service ATL open request; copy the WWAN type - if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) - { - AGpsType agpsType; -#ifdef QCOM_FEATURE_IPV6 - switch(server_request_ptr->wwanType) - { - case eQMI_LOC_WWAN_TYPE_INTERNET_V02: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - - case eQMI_LOC_WWAN_TYPE_AGNSS_V02: - agpsType = AGPS_TYPE_SUPL; - break; - - default: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - } -#else - agpsType = AGPS_TYPE_SUPL; -#endif - LocApiAdapter::requestATL(connHandle, agpsType); - } - - // service the ATL close request - else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) - { - LocApiAdapter::releaseATL(connHandle); - } -} - -/* conver the NI report to loc eng format and send t loc engine */ -void LocApiV02Adapter :: reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) -{ - GpsNiNotification notif; - - /* initialize the notification*/ - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - /* NI timeout gets overwritten in LocApiAdapter, - initializing to 0 here */ - notif.timeout = 0; - - notif.text_encoding = GPS_ENC_NONE ; - - notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - - notif.notify_flags = 0; - - notif.default_response = GPS_NI_RESPONSE_NORESP; - - /*Handle Vx request */ - if(ni_req_ptr->NiVxInd_valid == 1) - { - const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); - - notif.ni_type = GPS_NI_TYPE_VOICE; - - // Requestor ID, the requestor id recieved is NULL terminated - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char *)vx_req->requestorId, vx_req->requestorId_len ); - } - - /* Handle UMTS CP request*/ - else if(ni_req_ptr->NiUmtsCpInd_valid == 1) - { - const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = - &ni_req_ptr->NiUmtsCpInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - - /* notificationText should always be a NULL terminated string */ - hexcode(notif.text, sizeof notif.text, - (char *)umts_cp_req->notificationText, - umts_cp_req->notificationText_len); - - /* Store requestor ID */ - hexcode(notif.requestor_id, sizeof(notif.requestor_id), - (char *)umts_cp_req->requestorId.codedString, - umts_cp_req->requestorId.codedString_len); - - /* convert encodings */ - notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); - - notif.requestor_id_encoding = - convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); - - /* LCS address (using extras field) */ - if ( umts_cp_req->clientAddress_len != 0) - { - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - - // 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; - address_source = (char *)umts_cp_req->clientAddress; - // client Address is always NULL terminated - addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, - umts_cp_req->clientAddress_len); - - // The address is ASCII string - if (addr_len) - { - strlcat(notif.extras, lcs_addr, sizeof notif.extras); - } - } - - } - else if(ni_req_ptr->NiSuplInd_valid == 1) - { - const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = - &ni_req_ptr->NiSuplInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - - // Client name - if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) - { - hexcode(notif.text, sizeof(notif.text), - (char *)supl_req->clientName.formattedString, - supl_req->clientName.formattedString_len); - LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, - notif.text); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", - __func__, __LINE__); - } - - // Requestor ID - if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char*)supl_req->requestorId.formattedString, - supl_req->requestorId.formattedString_len ); - - LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, - notif.requestor_id); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", - __func__, __LINE__); - } - - // Encoding type - if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) - { - notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); - - notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); - } - else - { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - } //ni_req_ptr->NiSuplInd_valid == 1 - - else - { - LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); - return; - } - - // Set default_response & notify_flags - convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); - - if( NULL != ni_req_copy_ptr) - { - memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); - - LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); - } - else - { - LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); - } - -} - -/* convert Ni Encoding type from QMI_LOC to loc eng format */ -GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case eQMI_LOC_NI_SUPL_UTF8_V02: - enc = GPS_ENC_SUPL_UTF8; - break; - case eQMI_LOC_NI_SUPL_UCS2_V02: - enc = GPS_ENC_SUPL_UCS2; - break; - case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - break; - default: - break; - } - - return enc; -} - -/*convert NI notify verify type from QMI LOC to loc eng format*/ -bool LocApiV02Adapter :: convertNiNotifyVerifyType ( - GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv) -{ - switch (notif_priv) - { - case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: - notif->notify_flags = 0; - break; - - case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_ACCEPT; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_DENY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return false; - } - - return true; -} - -/* event callback registered with the loc_api v02 interface */ -void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, - uint32_t eventId, locClientEventIndUnionType eventPayload) -{ - LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, - eventId); - - switch(eventId) - { - //Position Report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - reportPosition(eventPayload.pPositionReportEvent); - break; - - // Satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - reportSv(eventPayload.pGnssSvInfoReportEvent); - break; - - // Status report - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - reportEngineState(eventPayload.pEngineState); - break; - - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - reportFixSessionState(eventPayload.pFixSessionState); - break; - - // NMEA - case QMI_LOC_EVENT_NMEA_IND_V02: - reportNmea(eventPayload.pNmeaReportEvent); - break; - - // XTRA request - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - LOC_LOGD("%s:%d]: XTRA download request\n", __func__, - __LINE__); - requestXtraData(); - break; - - // time request - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - LOC_LOGD("%s:%d]: Time request\n", __func__, - __LINE__); - requestTime(); - break; - - //position request - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - LOC_LOGD("%s:%d]: Position request\n", __func__, - __LINE__); - //requestPosition(); - break; - - // NI request - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); - break; - - // AGPS connection request - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - reportAtlRequest(eventPayload.pLocationServerConnReqEvent); - break; - } -} - -/* Call the service LocApiAdapter down event*/ -void LocApiV02Adapter :: errorCb(locClientHandleType handle, - locClientErrorEnumType errorId) -{ - if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) - { - LOC_LOGE("%s:%d]: Service unavailable error\n", - __func__, __LINE__); - - LocApiAdapter::handleEngineDownEvent(); - - /* immediately send the engine up event so that - the loc engine re-initializes the adapter and the - loc-api_v02 interface */ - - LocApiAdapter::handleEngineUpEvent(); - } -} - -/* return a Loc API adapter */ -extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return(new LocApiV02Adapter(locEng)); -} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h deleted file mode 100644 index 487e98eb..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V_0_2_ADAPTER_H -#define LOC_API_V_0_2_ADAPTER_H - -#include -#include "loc_api_v02_client.h" -#include -#include - -/* Fix criteria structure*/ -struct LocApiV02FixCriteria -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval ; - uint32_t preferred_accuracy ; - uint32_t preferred_time; - - /* Constructor for the structure */ - inline LocApiV02FixCriteria (LocPositionMode mode, - GpsPositionRecurrence recur, - uint32_t min_int, - uint32_t pref_acc, - uint32_t pref_time) : - mode(mode), recurrence(recur), min_interval(min_int), - preferred_accuracy(pref_acc), preferred_time(pref_time) {} -}; - -/* This class derives from the LocApiAdapter class. - The members of this class are responsible for converting - the Loc API V02 data structures into Loc Engine data structures. - This class also implements some of the virtual functions that - handle the requests from loc engine. */ -class LocApiV02Adapter : public LocApiAdapter { - - /* loc api v02 handle*/ - locClientHandleType clientHandle; - - /* events the client is registered for */ - locClientEventMaskType eventMask; - - /* current session state */ - bool navigating; - - /* current fix criteria, for Loc aPI V02 this is - stored when set_position_mode is called and - sent out with Loc aPI V02 start message when the - start_fix() is called by loc engine. */ - LocApiV02FixCriteria fixCriteria; - - /* Convert event mask from loc eng to loc_api_v02 format */ - locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - - /* Convert error from loc_api_v02 to loc eng format*/ - enum loc_api_adapter_err convertErr(locClientStatusEnumType status); - - /* convert Ni Encoding type from QMI_LOC to loc eng format */ - GpsNiEncodingType convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); - - /*convert NI notify verify type from QMI LOC to loc eng format*/ - bool convertNiNotifyVerifyType (GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv); - - /* close Loc API V02 client */ - int deInitLocClient(); - - /* convert position report to loc eng format and send the converted - position to loc eng */ - void reportPosition - (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); - - /* convert satellite report to loc eng format and send the converted - report to loc eng */ - void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); - - /* convert engine state report to loc eng format and send the converted - report to loc eng */ - void reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); - - /* convert fix session report to loc eng format and send the converted - report to loc eng */ - void reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); - - /* convert NMEA report to loc eng format and send the converted - report to loc eng */ - void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); - - /* convert and report an ATL request to loc engine */ - void reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 - *server_request_ptr); - - /* convert and report NI request to loc eng */ - void reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); - -public: - LocApiV02Adapter(LocEng &locEng); - ~LocApiV02Adapter(); - - /* event callback registered with the loc_api v02 interface */ - void eventCb(locClientHandleType client_handle, - uint32_t loc_event_id, - locClientEventIndUnionType loc_event_payload); - - /* error callback, this function handles the service unavailable - error */ - void errorCb(locClientHandleType handle, - locClientErrorEnumType errorId); - - virtual enum loc_api_adapter_err reinit(); - - virtual enum loc_api_adapter_err startFix(); - - virtual enum loc_api_adapter_err stopFix(); - - virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); - - 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); - - 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); -#ifdef QCOM_FEATURE_IPV6 - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif - virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); - - virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); - - virtual enum loc_api_adapter_err - setSensorProperties(float gyroBiasVarianceRandomWalk); - - virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, - int accelBatchesPerSec, - int gyroSamplesPerBatch, - int gyroBatchesPerSec); -}; - -#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c deleted file mode 100644 index b75f1630..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ /dev/null @@ -1,548 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" - -/* Logging */ -// Uncomment to log verbose logs -#define LOG_NDEBUG 1 - -// log debug logs -#define LOG_NDDEBUG 1 -#define LOG_TAG "LocSvc_api_v02" -#include "loc_util_log.h" - -#define LOC_SYNC_REQ_BUFFER_SIZE 8 - -pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; - -static bool loc_sync_call_initialized = false; - -typedef struct { - pthread_mutex_t sync_req_lock; - - /* Client ID */ - locClientHandleType client_handle; - - /* waiting conditional variable */ - pthread_cond_t ind_arrived_cond; - - /* Callback waiting data block, protected by loc_cb_data_mutex */ - bool ind_is_selected; /* is cb selected? */ - bool ind_is_waiting; /* is waiting? */ - bool ind_has_arrived; /* callback has arrived */ - uint32_t req_id; /* sync request */ - void *recv_ind_payload_ptr; /* received payload */ - uint32_t recv_ind_id; /* received ind */ - -} loc_sync_req_data_s_type; - -typedef struct { - bool in_use; /* at least one sync call is active */ - bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; - loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; -} loc_sync_req_array_s_type; - -/*************************************************************************** - * DATA FOR ASYNCHRONOUS RPC PROCESSING - **************************************************************************/ -loc_sync_req_array_s_type loc_sync_array; - -/*=========================================================================== - -FUNCTION loc_sync_req_init - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_sync_req_init() -{ - LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); - pthread_mutex_lock(&loc_sync_call_mutex); - if(true == loc_sync_call_initialized) - { - LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - loc_sync_array.in_use = false; - - memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); - - int i; - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - pthread_mutex_init(&slot->sync_req_lock, NULL); - pthread_cond_init(&slot->ind_arrived_cond, NULL); - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; /* req id */ - } - - loc_sync_call_initialized = true; - pthread_mutex_unlock(&loc_sync_call_mutex); -} - - -/*=========================================================================== - -FUNCTION loc_sync_process_ind - -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_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* ind id */ - void *ind_payload_ptr /* payload */ -) -{ - - LOC_LOGV("%s:%d]: received indication, handle = %d ind_id = %d \n", - __func__,__LINE__, client_handle, ind_id); - - pthread_mutex_lock(&loc_sync_call_mutex); - - if (!loc_sync_array.in_use) - { - LOC_LOGD("%s:%d]: loc_sync_array not in use \n", - __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - bool in_use = false, consumed = false; - int i; - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - in_use |= loc_sync_array.slot_in_use[i]; - - pthread_mutex_lock(&slot->sync_req_lock); - - if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) - && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) - { - // copy the payload to the slot waiting for this ind - size_t payload_size = 0; - - LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", - __func__, __LINE__, i, ind_id); - - if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && - NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) - { - LOC_LOGV("%s:%d]: copying ind payload size = %u \n", - __func__, __LINE__, payload_size); - - memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); - - consumed = true; - - } - /* Received a callback while waiting, wake up thread to check it */ - if (slot->ind_is_waiting) - { - slot->recv_ind_id = ind_id; - - pthread_cond_signal(&slot->ind_arrived_cond); - } - else - { - /* If callback arrives before wait, remember it */ - LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", - __func__, __LINE__, ind_id); - - slot->ind_has_arrived = true; - } - } - pthread_mutex_unlock(&slot->sync_req_lock); - } - - if (!in_use) { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_alloc_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_alloc_slot() -{ - int i, select_id = -1; /* no free buffer */ - - pthread_mutex_lock(&loc_sync_call_mutex); - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (!loc_sync_array.slot_in_use[i]) - { - select_id = i; - loc_sync_array.slot_in_use[i] = 1; - loc_sync_array.in_use = true; - break; - } - } - - pthread_mutex_unlock(&loc_sync_call_mutex); - LOC_LOGV("%s:%d]: returning slot %d\n", - __func__, __LINE__, select_id); - return select_id; -} - -/*=========================================================================== - -FUNCTION loc_free_slot - -DESCRIPTION - Frees a buffer slot after the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_free_slot(int select_id) -{ - int i; - loc_sync_req_data_s_type *slot; - - pthread_mutex_lock(&loc_sync_call_mutex); - - LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); - - loc_sync_array.slot_in_use[select_id] = 0; - - slot = &loc_sync_array.slots[select_id]; - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; - - // check if all slots are now free - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (loc_sync_array.slot_in_use[i]) break; - } - - if (i >= LOC_SYNC_REQ_BUFFER_SIZE) - { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_sync_select_ind - -DESCRIPTION - Selects which indication to wait for. - - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -ENOMEM : out of buffer - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_select_ind( - locClientHandleType client_handle, /* Client handle */ - uint32_t ind_id, /* ind Id wait for */ - uint32_t req_id, /* req id */ - void * ind_payload_ptr /* ptr where payload should be copied to*/ -) -{ - int select_id = loc_alloc_slot(); - - LOC_LOGV("%s:%d]: client handle %d, ind_id %u, req_id %u \n", - __func__, __LINE__, client_handle, ind_id, req_id); - - if (select_id < 0) - { - LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", - __func__, __LINE__, loc_get_v02_event_name(req_id)); - return -ENOMEM; - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - pthread_mutex_lock(&slot->sync_req_lock); - - slot->client_handle = client_handle; - slot->ind_is_selected = true; - slot->ind_is_waiting = false; - slot->ind_has_arrived = false; - - slot->recv_ind_id = ind_id; - slot->req_id = req_id; - slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr - - pthread_mutex_unlock(&slot->sync_req_lock); - - return select_id; -} - - -/*=========================================================================== - -FUNCTION loc_sync_wait_for_ind - -DESCRIPTION - Waits for a selected indication. The wait expires in timeout_seconds seconds. - If the function is called before an existing wait has finished, it will - immediately return error. - -DEPENDENCIES - N/A - -RETURN VALUE - 0 on SUCCESS, -ve value on failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_wait_for_ind( - int select_id, /* ID from loc_sync_select_ind() */ - int timeout_seconds, /* Timeout in this number of seconds */ - uint32_t ind_id -) -{ - if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) - { - LOC_LOGE("%s:%d]: invalid select_id: %d \n", - __func__, __LINE__, select_id); - - return (-EINVAL); - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - int ret_val = 0; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ - - struct timeval present_time; - struct timespec expire_time; - - pthread_mutex_lock(&slot->sync_req_lock); - - do - { - if (slot->ind_has_arrived) - { - ret_val = 0; /* success */ - break; - } - - if (slot->ind_is_waiting) - { - LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, - __LINE__, select_id); - ret_val = -EBUSY; // busy - break; - } - - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_nsec = present_time.tv_usec * 1000; - expire_time.tv_sec += timeout_seconds; - - /* Take new wait request */ - slot->ind_is_waiting = true; - - /* Waiting */ - rc = pthread_cond_timedwait(&slot->ind_arrived_cond, - &slot->sync_req_lock, &expire_time); - - slot->ind_is_waiting = false; - - if(rc == ETIMEDOUT) - { - LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", - __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); - ret_val = -ETIMEDOUT; //time out - } - - } while (0); - - pthread_mutex_unlock(&slot->sync_req_lock); - loc_free_slot(select_id); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_sync_send_req - -DESCRIPTION - Synchronous req call (thread safe) - -DEPENDENCIES - N/A - -RETURN VALUE - Loc API 2.0 status - -SIDE EFFECTS - N/A - -===========================================================================*/ -locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; - int select_id; - int rc = 0; - - // Select the callback we are waiting for - select_id = loc_sync_select_ind(client_handle, ind_id, req_id, - ind_payload_ptr); - - if (select_id >= 0) - { - status = locClientSendReq (client_handle, req_id, req_payload); - LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", - __func__, __LINE__, select_id, status); - - if (status != eLOC_CLIENT_SUCCESS ) - { - loc_free_slot(select_id); - } - else - { - // Wait for the indication callback - if (( rc = loc_sync_wait_for_ind( select_id, - timeout_msec / 1000, - ind_id) ) < 0) - { - if ( rc == -ETIMEDOUT) - status = eLOC_CLIENT_FAILURE_TIMEOUT; - else - status = eLOC_CLIENT_FAILURE_INTERNAL; - - // Callback waiting failed - LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " - "select id %d, status %s", __func__, __LINE__, rc , - select_id, loc_get_v02_client_status_name(status)); - } - else - { - status = eLOC_CLIENT_SUCCESS; - LOC_LOGV("%s:%d]: success (select id %d)\n", - __func__, __LINE__, select_id); - } - } - } /* select id */ - - return status; -} - - diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h deleted file mode 100644 index 8c7f7f19..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SYNC_REQ_H -#define LOC_SYNC_REQ_H - -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#include -#include "loc_api_v02_client.h" - -#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second - -/* Init function */ -extern void loc_sync_req_init(); - - -/* Process Loc API indications to wake up blocked user threads */ -extern void loc_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* respInd id */ - void *ind_payload_ptr /* payload */ -); - -/* Thread safe synchronous request, using Loc API status return code */ -extern locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c deleted file mode 100644 index bb745112..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ /dev/null @@ -1,1923 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "qmi_client.h" -#include "qmi_idl_lib.h" -#include "qmi_cci_target_ext.h" - -#if defined( _ANDROID_) -#include "qmi_cci_target.h" -#include "qmi_cci_common.h" -#elif defined(LOC_UTIL_TARGET_OFF_TARGET) -#include -#include -#include -#endif //_ANDROID_ - -#include -#include -#include -#include -#include -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_api_v02" - -#include "loc_util_log.h" - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (5000) - -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (5000) - -#else - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (1000) - -// timeout in ms before a sync request should return -#define LOC_CLIENT_SYNC_REQ_TIMEOUT (1000) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -//timeout in ms to wait for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) -#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (60000) - -/* Table to relate eventId, size and mask value used to enable the event*/ -typedef struct -{ - uint32_t eventId; - size_t eventSize; - locClientEventMaskType eventMask; -}locClientEventIndTableStructT; - - -static locClientEventIndTableStructT locClientEventIndTable[]= { - - // position report ind - { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, - sizeof(qmiLocEventPositionReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, - - // satellite report ind - { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, - sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), - QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, - - // NMEA report ind - { QMI_LOC_EVENT_NMEA_IND_V02, - sizeof(qmiLocEventNmeaIndMsgT_v02), - QMI_LOC_EVENT_MASK_NMEA_V02 }, - - //NI event ind - { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, - sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, - - //Time Injection Request Ind - { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, - sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, - - //Predicted Orbits Injection Request - { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, - sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, - - //Position Injection Request Ind - { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, - sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , - - //Engine State Report Ind - { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, - sizeof(qmiLocEventEngineStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, - - //Fix Session State Report Ind - { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, - sizeof(qmiLocEventFixSessionStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, - - //Wifi Request Indication - { QMI_LOC_EVENT_WIFI_REQ_IND_V02, - sizeof(qmiLocEventWifiReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, - - //Sensor Streaming Ready Status Ind - { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, - sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, - - // Time Sync Request Indication - { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, - sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, - - //Set Spi Streaming Report Event - { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, - sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, - - //Location Server Connection Request event - { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, - sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 } -}; - -/* table to relate the respInd Id with its size */ -typedef struct -{ - uint32_t respIndId; - size_t respIndSize; -}locClientRespIndTableStructT; - -static locClientRespIndTableStructT locClientRespIndTable[]= { - - // get service revision ind - { QMI_LOC_GET_SERVICE_REVISION_IND_V02, - sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, - - // Get Fix Criteria Resp Ind - { QMI_LOC_GET_FIX_CRITERIA_IND_V02, - sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, - - // NI User Resp In - { QMI_LOC_NI_USER_RESPONSE_IND_V02, - sizeof(qmiLocNiUserRespIndMsgT_v02)}, - - //Inject Predicted Orbits Data Resp Ind - { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, - - //Get Predicted Orbits Data Src Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, - - // Get Predicted Orbits Data Validity Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, - - // Inject UTC Time Resp Ind - { QMI_LOC_INJECT_UTC_TIME_IND_V02, - sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, - - //Inject Position Resp Ind - { QMI_LOC_INJECT_POSITION_IND_V02, - sizeof(qmiLocInjectPositionIndMsgT_v02)}, - - //Set Engine Lock Resp Ind - { QMI_LOC_SET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocSetEngineLockIndMsgT_v02)}, - - //Get Engine Lock Resp Ind - { QMI_LOC_GET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocGetEngineLockIndMsgT_v02)}, - - //Set SBAS Config Resp Ind - { QMI_LOC_SET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, - - //Get SBAS Config Resp Ind - { QMI_LOC_GET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, - - //Set NMEA Types Resp Ind - { QMI_LOC_SET_NMEA_TYPES_IND_V02, - sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, - - //Get NMEA Types Resp Ind - { QMI_LOC_GET_NMEA_TYPES_IND_V02, - sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, - - //Set Low Power Mode Resp Ind - { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, - - //Get Low Power Mode Resp Ind - { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, - - //Set Server Resp Ind - { QMI_LOC_SET_SERVER_IND_V02, - sizeof(qmiLocSetServerIndMsgT_v02)}, - - //Get Server Resp Ind - { QMI_LOC_GET_SERVER_IND_V02, - sizeof(qmiLocGetServerIndMsgT_v02)}, - - //Delete Assist Data Resp Ind - { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, - - //Set XTRA-T Session Control Resp Ind - { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, - - //Get XTRA-T Session Control Resp Ind - { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, - - //Inject Wifi Position Resp Ind - { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, - sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, - - //Notify Wifi Status Resp Ind - { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, - sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, - - //Get Registered Events Resp Ind - { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, - sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, - - //Set Operation Mode Resp Ind - { QMI_LOC_SET_OPERATION_MODE_IND_V02, - sizeof(qmiLocSetOperationModeIndMsgT_v02)}, - - //Get Operation Mode Resp Ind - { QMI_LOC_GET_OPERATION_MODE_IND_V02, - sizeof(qmiLocGetOperationModeIndMsgT_v02)}, - - //Set SPI Status Resp Ind - { QMI_LOC_SET_SPI_STATUS_IND_V02, - sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, - - //Inject Sensor Data Resp Ind - { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, - sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, - - //Inject Time Sync Data Resp Ind - { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, - sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, - - //Set Cradle Mount config Resp Ind - { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, - - //Get Cradle Mount config Resp Ind - { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, - - //Set External Power config Resp Ind - { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, - - //Get External Power config Resp Ind - { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, - - //Location server connection status - { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, - - //Set Protocol Config Parameters - { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, - - //Get Protocol Config Parameters - { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, - - //Set Sensor Control Config - { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, - - //Get Sensor Control Config - { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, - - //Set Sensor Properties - { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, - - //Get Sensor Properties - { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, - - //Set Sensor Performance Control Config - { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, - - //Get Sensor Performance Control Config - { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, - //Inject SUPL certificate - { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, - - //Delete SUPL certificate - { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, - - // Set Position Engine Config - { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, - - // Get Position Engine Config - { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)} - -}; - - -/** whether indication is an event or a response */ -typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; - - -/** @struct locClientInternalState - */ - -typedef struct -{ - // client cookie - void *pClientCookie; - //QCCI handle for this control point - qmi_client_type userHandle; - - // callbacks registered by the clients - locClientEventIndCbType eventCallback; - locClientRespIndCbType respCallback; - locClientErrorCbType errorCallback; - - // the event mask the client has registered for - locClientEventMaskType eventRegMask; - -}locClientCallbackDataType; - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** locClientGetSizeAndTypeByIndId - * @brief this function gets the size and the type (event, - * response)of the indication structure from its ID - * @param [in] indId ID of the indication - * @param [out] type event or response indication - * @param [out] size size of the indications - * - * @return true if the ID was found, false otherwise */ - -static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, - locClientIndEnumT *pIndType) -{ - // look in the event table - if(true == locClientGetSizeByEventIndId(indId, pIndSize)) - { - *pIndType = eventIndType; - - LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - //else look in response table - if(true == locClientGetSizeByRespIndId(indId, pIndSize)) - { - *pIndType = respIndType; - - LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - // Id not found - LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); - return false; -} - -/** isClientRegisteredForEvent -* @brief checks the mask to identify if the client has -* registered for the specified event Id -* @param [in] eventIndId -* @param [in] eventRegMask -* @return true if client regstered for event; else false */ - -static bool isClientRegisteredForEvent( - locClientEventMaskType eventRegMask, - uint32_t eventIndId) -{ - size_t idx = 0, eventIndTableSize = 0; - - // look in the event table - eventIndTableSize = - (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); - - for(idx=0; idxresp.result == QMI_RESULT_SUCCESS ) - { - status = eLOC_CLIENT_SUCCESS; - } - else - { - switch(pResponse->resp.error) - { - case QMI_ERR_MALFORMED_MSG_V01: - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - - case QMI_ERR_DEVICE_IN_USE_V01: - status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; - break; - - default: - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - } - LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", - __func__, __LINE__, pResponse->resp.result, - pResponse->resp.error, status); - return status; -} - -/** convertQmiErrorToLocError - @brief converts a qmi service error type to - locClientErrorEnumType - @param [in] error received QMI service. - @return locClientErrorEnumType corresponding to the error. -*/ - -static locClientErrorEnumType convertQmiErrorToLocError( - qmi_client_error_type error) -{ - locClientErrorEnumType locError ; - switch(error) - { - case QMI_SERVICE_ERR: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - - default: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - } - LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", - __func__, __LINE__, error, locError); - return locError; -} - -/** locClienHandlePosReportInd - * @brief Validates a position report ind - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if pos report is valid, false otherwise -*/ -static bool locClientHandlePosReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate position report - qmiLocEventPositionReportIndMsgT_v02 *posReport = - (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", - __func__, __LINE__, ind_buf_len, - posReport->latitude, posReport->longitude, - posReport->altitudeWrtEllipsoid); - - return true; -} -//----------------------------------------------------------------------------- - -/** locClientHandleSatReportInd - * @brief Validates a satellite report indication. Dk - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if sat report is valid, false otherwise -*/ -static bool locClientHandleSatReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate sat reports - unsigned int idx = 0; - qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = - (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" - " validity = %d \n ", __func__, __LINE__, - ind_buf_len, satReport->altitudeAssumed, - satReport->svList_len, satReport->svList_valid); - //Log SV report - for( idx = 0; idx svList_len; idx++ ) - { - LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " - "status = %d \n", __func__, __LINE__, - satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, - satReport->svList[idx].system, satReport->svList[idx].svStatus); - } - - return true; -} - - -/** locClientHandleNmeaReportInd - * @brief Validate a NMEA report indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if nmea report is valid, false otherwise -*/ - - -static bool locClientHandleNmeaReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate NMEA report - return true; -} - -/** locClientHandleGetServiceRevisionRespInd - * @brief Handles a Get Service Revision Rresponse indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if service revision is valid, false otherwise -*/ - -static bool locClientHandleGetServiceRevisionRespInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - LOC_LOGV("%s:%d] :\n", __func__, __LINE__); - return true; -} - -/** locClientHandleIndication - * @brief looks at each indication and calls the appropriate - * validation handler - * @param [in] indId - * @param [in] indBuffer - * @param [in] indSize - * @return true if indication was validated; else false */ - -static bool locClientHandleIndication( - uint32_t indId, - void* indBuffer, - size_t indSize - ) -{ - bool status = false; - switch(indId) - { - // handle the event indications - //------------------------------------------------------------------------- - - // handle position report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - { - status = locClientHandlePosReportInd(indId, indBuffer, indSize); - break; - } - // handle satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - { - status = locClientHandleSatReportInd(indId, indBuffer, indSize); - break; - } - - // handle NMEA report - case QMI_LOC_EVENT_NMEA_IND_V02: - { - status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); - break; - } - - // handle NI Notify Verify Request Ind - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - { - // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Time Inject request Ind - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - { - // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle XTRA data Inject request Ind - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - { - // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle position inject request Ind - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - { - // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle engine state Ind - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - { - // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle fix session state Ind - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - { - // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Wifi request Ind - case QMI_LOC_EVENT_WIFI_REQ_IND_V02: - { - // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle sensor streaming ready status Ind - case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: - { - // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle time sync Ind - case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: - { - // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle set streaming report ind - case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: - { - // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - { - //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - //------------------------------------------------------------------------- - - // handle the response indications - //------------------------------------------------------------------------- - - // Get service Revision response indication - case QMI_LOC_GET_SERVICE_REVISION_IND_V02: - { - status = locClientHandleGetServiceRevisionRespInd(indId, - indBuffer, indSize); - break; - } - // predicted orbits data response indication - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: - { - //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : - { - //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: - { - //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: - { - //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: - { - //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: - { - //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - // for indications that only have a "status" field - case QMI_LOC_NI_USER_RESPONSE_IND_V02: - case QMI_LOC_INJECT_UTC_TIME_IND_V02: - case QMI_LOC_INJECT_POSITION_IND_V02: - case QMI_LOC_SET_ENGINE_LOCK_IND_V02: - case QMI_LOC_SET_SBAS_CONFIG_IND_V02: - case QMI_LOC_SET_NMEA_TYPES_IND_V02: - case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: - case QMI_LOC_SET_SERVER_IND_V02: - case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: - case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: - case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: - case QMI_LOC_SET_OPERATION_MODE_IND_V02: - case QMI_LOC_SET_SPI_STATUS_IND_V02: - case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: - { - status = true; - break; - } - default: - LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, - (uint32_t)indId); - status = false; - break; - } - return status; -} - - -/** locClientErrorCb - * @brief handles the QCCI error events, this is called by the - * QCCI infrastructure when the service is no longer - * available. - * @param [in] user handle - * @param [in] error - * @param [in] *err_cb_data - */ - -static void locClientErrorCb -( - qmi_client_type user_handle, - qmi_client_error_type error, - void *err_cb_data -) -{ - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)err_cb_data; - - /* copy the errorCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and error callback. - */ - locClientErrorCbType localErrorCallback = - pCallbackData->errorCallback; - - LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", - __func__, __LINE__, error, err_cb_data); - - /* call the error callback - * To avoid calling the errorCallback after locClientClose - * is called, check pCallbackData->errorCallback again here - */ - - if( (NULL != pCallbackData) && - (NULL != localErrorCallback) && - (NULL != pCallbackData->errorCallback) ) - { - //invoke the error callback for the corresponding client - localErrorCallback( - (locClientHandleType)pCallbackData, - convertQmiErrorToLocError(error), - pCallbackData->pClientCookie); - } -} - - -/** locClientIndCb - * @brief handles the indications sent from the service, if a - * response indication was received then the it is sent - * to the response callback. If a event indication was - * received then it is sent to the event callback - * @param [in] user handle - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @param [in] ind_cb_data */ - -static void locClientIndCb -( - qmi_client_type user_handle, - unsigned int msg_id, - void *ind_buf, - unsigned int ind_buf_len, - void *ind_cb_data -) -{ - locClientIndEnumT indType; - size_t indSize = 0; - qmi_client_error_type rc ; - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)ind_cb_data; - - LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", - __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, - pCallbackData); - - // check callback data - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); - return; - } - - // check user handle - if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) - { - LOC_LOGE("%s:%d]: invalid user_handle got 0x%x expected 0x%x\n", - __func__, __LINE__, - user_handle, pCallbackData->userHandle); - return; - } - // Get the indication size and type ( eventInd or respInd) - if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) - { - void *indBuffer = NULL; - - // if the client did not register for this event then just drop it - if( (eventIndType == indType) && - ( (NULL == pCallbackData->eventCallback) || - (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) - { - LOC_LOGW("%s:%d]: client is not registered for event %d\n", - __func__, __LINE__, (uint32_t)msg_id); - return; - } - - // decode the indication - indBuffer = malloc(indSize); - - if(NULL == indBuffer) - { - LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); - return; - } - - // decode the indication - rc = qmi_client_message_decode( - user_handle, - QMI_IDL_INDICATION, - msg_id, - ind_buf, - ind_buf_len, - indBuffer, - indSize); - - if( rc == QMI_NO_ERR ) - { - //validate indication - if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) - { - if(eventIndType == indType) - { - locClientEventIndUnionType eventIndUnion; - - /* copy the eventCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientEventIndCbType localEventCallback = - pCallbackData->eventCallback; - - // dummy event - eventIndUnion.pPositionReportEvent = - (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; - - /* call the event callback - * To avoid calling the eventCallback after locClientClose - * is called, check pCallbackData->eventCallback again here - */ - if((NULL != localEventCallback) && - (NULL != pCallbackData->eventCallback)) - { - localEventCallback( - (locClientHandleType)pCallbackData, - msg_id, - eventIndUnion, - pCallbackData->pClientCookie); - } - } - else if(respIndType == indType) - { - locClientRespIndUnionType respIndUnion; - - /* copy the respCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientRespIndCbType localRespCallback = - pCallbackData->respCallback; - - // dummy to suppress compiler warnings - respIndUnion.pDeleteAssistDataInd = - (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; - - /* call the response callback - * To avoid calling the respCallback after locClientClose - * is called, check pCallbackData->respCallback again here - */ - if((NULL != localRespCallback) && - (NULL != pCallbackData->respCallback)) - { - localRespCallback( - (locClientHandleType)pCallbackData, - msg_id, - respIndUnion, - pCallbackData->pClientCookie); - } - } - } - else // error handling indication - { - LOC_LOGE("%s:%d]: Error handling the indication %d\n", - __func__, __LINE__, (uint32_t)msg_id); - } - } - else - { - LOC_LOGE("%s:%d]: Error decoding indication %d\n", - __func__, __LINE__, rc); - } - if(indBuffer) - { - free (indBuffer); - } - } - else // Id not found - { - LOC_LOGE("%s:%d]: Error indication not found %d\n", - __func__, __LINE__,(uint32_t)msg_id); - } - return; -} - - -/** locClientRegisterEventMask - * @brief registers the event mask with loc service - * @param [in] clientHandle - * @param [in] eventRegMask - * @return true if indication was validated; else false */ - -static bool locClientRegisterEventMask( - locClientHandleType clientHandle, - locClientEventMaskType eventRegMask) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientReqUnionType reqUnion; - qmiLocRegEventsReqMsgT_v02 regEventsReq; - - memset(®EventsReq, 0, sizeof(regEventsReq)); - - regEventsReq.eventRegMask = eventRegMask; - reqUnion.pRegEventsReq = ®EventsReq; - - status = locClientSendReq(clientHandle, - QMI_LOC_REG_EVENTS_REQ_V02, - reqUnion); - - if(eLOC_CLIENT_SUCCESS != status ) - { - LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status) ); - return false; - } - - return true; -} - -/** validateRequest - @brief validates the input request - @param [in] reqId request ID - @param [in] reqPayload Union of pointers to message payload - @param [out] ppOutData Pointer to void *data if successful - @param [out] pOutLen Pointer to length of data if succesful. - @return false on failure, true on Success -*/ - -static bool validateRequest( - uint32_t reqId, - const locClientReqUnionType reqPayload, - void **ppOutData, - uint32_t *pOutLen ) - -{ - bool noPayloadFlag = false; - - LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); - switch(reqId) - { - case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); - break; - } - - case QMI_LOC_REG_EVENTS_REQ_V02: - { - *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); - break; - } - - case QMI_LOC_START_REQ_V02: - { - *pOutLen = sizeof(qmiLocStartReqMsgT_v02); - break; - } - - case QMI_LOC_STOP_REQ_V02: - { - *pOutLen = sizeof(qmiLocStopReqMsgT_v02); - break; - } - - case QMI_LOC_NI_USER_RESPONSE_REQ_V02: - { - *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_UTC_TIME_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); - break; - } - - case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_NMEA_TYPES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SERVER_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); - break; - } - - case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); - break; - } - - case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_OPERATION_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SPI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); - break; - } - - // ALL requests with no payload - case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: - case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: - case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: - case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: - case QMI_LOC_GET_NMEA_TYPES_REQ_V02: - case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: - case QMI_LOC_GET_SERVER_REQ_V02: - case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: - case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: - case QMI_LOC_GET_OPERATION_MODE_REQ_V02: - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - noPayloadFlag = true; - break; - } - - default: - LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, - reqId); - return false; - } - if(true == noPayloadFlag) - { - *ppOutData = NULL; - *pOutLen = 0; - } - else - { - //set dummy pointer for request union - *ppOutData = (void*) reqPayload.pInformClientRevisionReq; - } - LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, - reqId, *pOutLen); - return true; -} - -/** locClientQmiCtrlPointInit - @brief wait for the service to come up or timeout; when the - service comes up initialize the control point and set - internal handle and indication callback. - @param pQmiClient, -*/ - -static locClientStatusEnumType locClientQmiCtrlPointInit( - locClientCallbackDataType *pLocClientCbData) -{ - qmi_client_type clnt, notifier; - bool notifierInitFlag = false; - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - // instances of this service - qmi_service_info *pServiceInfo = NULL; - - do - { - uint32_t num_services = 0, num_entries = 0; - qmi_client_error_type rc = QMI_NO_ERR; - bool nosignal = false; - - // Get the service object for the qmiLoc Service - qmi_idl_service_object_type locClientServiceObject = - loc_get_service_object_v02(); - - // Verify that qmiLoc_get_service_object did not return NULL - if (NULL == locClientServiceObject) - { - LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , - __func__, __LINE__ ); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // get the service addressing information - rc = qmi_client_get_service_list( locClientServiceObject, NULL, NULL, - &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() first try rc %d, " - "num_services %d", __func__, __LINE__, rc, num_services); - - if (rc != QMI_NO_ERR) { - // bummer, service list is not up. - // We need to try again after a timed wait - qmi_client_os_params os_params; - int timeout = 0; - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - notifierInitFlag = (NULL != notifier); - - if (rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); - nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - - // get the service addressing information - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " - "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); - } - - if (0 == num_services || rc != QMI_NO_ERR) { - if (!nosignal) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!! Error %d \n", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - } else { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," - " final Err %d", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_TIMEOUT; - } - break; - } - - pServiceInfo = - (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); - - if(NULL == pServiceInfo) - { - LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", - __func__, __LINE__); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - //set the number of entries to get equal to the total number of - //services. - num_entries = num_services; - //populate the serviceInfo - rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, - &num_entries, &num_services); - - - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", - __func__, __LINE__, pLocClientCbData); - - // initialize the client - //sent the address of the first service found - // if IPC router is present, this will go to the service instance - // enumerated over IPC router, else it will go over the next transport where - // the service was enumerated. - rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, - locClientIndCb, (void *) pLocClientCbData, - NULL, &clnt); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_init error %d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to" - "qmi_client_register_error_cb \n", - __func__, __LINE__, pLocClientCbData); - - // register error callback - rc = qmi_client_register_error_cb(clnt, - locClientErrorCb, (void *) pLocClientCbData); - - if( QMI_NO_ERR != rc) - { - LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // copy the clnt handle returned in qmi_client_init - memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - - status = eLOC_CLIENT_SUCCESS; - - } while(0); - - /* release the notifier handle */ - if(true == notifierInitFlag) - { - qmi_client_release(notifier); - } - - if(NULL != pServiceInfo) - { - free((void *)pServiceInfo); - } - - return status; -} -//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- - -/** locClientOpen - @brief Connects a location client to the location engine. If the connection - is successful, returns a handle that the location client uses for - future location operations. - - @param [in] eventRegMask Mask of asynchronous events the client is - interested in receiving - @param [in] eventIndCb Function to be invoked to handle an event. - @param [in] respIndCb Function to be invoked to handle a response - indication. - @param [out] locClientHandle Handle to be used by the client - for any subsequent requests. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - non-zero error code(see locClientStatusEnumType)-- On failure. -*/ - -locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pClientCookie) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientCallbackDataType *pCallbackData = NULL; - - LOC_LOGV("%s:%d] \n", __func__, __LINE__); - - do - { - // check input parameters - if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) - || (NULL == pLocClientCallbacks->respIndCb) || - (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) - { - LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - } - - // Allocate memory for the callback data - pCallbackData = - ( locClientCallbackDataType*)calloc( - 1, sizeof(locClientCallbackDataType)); - - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize the QMI control point; this function will block - * until a service is up or a timeout occurs. If the connection to - * the service succeeds the callback data will be filled in with - * a qmi_client value. - */ - - - EXIT_LOG_CALLFLOW(%s, "loc client open"); - status = locClientQmiCtrlPointInit(pCallbackData); - - LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - - if(status != eLOC_CLIENT_SUCCESS) - { - free(pCallbackData); - pCallbackData = NULL; - break; - } - - // set the handle to the callback data - *pLocClientHandle = (locClientHandleType)pCallbackData; - - if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) - { - LOC_LOGE("%s:%d]: Error sending registration mask\n", - __func__, __LINE__); - - // release the client - locClientClose(pLocClientHandle); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize rest of the client structure now that the connection - * to the service has been created successfully. - */ - - //fill in the event callback - pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; - - //fill in the response callback - pCallbackData->respCallback = pLocClientCallbacks->respIndCb; - - //fill in the error callback - pCallbackData->errorCallback = pLocClientCallbacks->errorCb; - - //set the client event registration mask - pCallbackData->eventRegMask = eventRegMask; - - // set the client cookie - pCallbackData->pClientCookie = (void *)pClientCookie; - - LOC_LOGD("%s:%d]: returning handle = 0x%x, user_handle=0x%x, status = %d\n", - __func__, __LINE__, *pLocClientHandle, - pCallbackData->userHandle, status); - - }while(0); - - if(eLOC_CLIENT_SUCCESS != status) - { - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - } - - return(status); -} - -/** locClientClose - @brief Disconnects a client from the location engine. - @param [in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) - On success. - - non-zero error code(see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientClose( - locClientHandleType* pLocClientHandle) -{ - qmi_client_error_type rc = QMI_NO_ERR; //No error - - if(NULL == pLocClientHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid pointer to handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - // convert handle to callback data - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)(*pLocClientHandle); - - LOC_LOGV("%s:%d]:\n", __func__, __LINE__ ); - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - LOC_LOGV("locClientClose releasing handle 0x%x, user handle 0x%x\n", - *pLocClientHandle, pCallbackData->userHandle ); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, "loc client close"); - // release the handle - rc = qmi_client_release(pCallbackData->userHandle); - if(QMI_NO_ERR != rc ) - { - LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", - __func__, __LINE__, rc, pCallbackData->userHandle); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* clear the memory allocated to callback data to minimize the chances - * of a race condition occurring between close and the indication - * callback - */ - memset(pCallbackData, 0, sizeof(*pCallbackData)); - - // free the memory assigned in locClientOpen - free(pCallbackData); - pCallbackData= NULL; - - // set the handle to invalid value - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - - return eLOC_CLIENT_SUCCESS; -} - -/** locClientSendReq - @brief Sends a message to the location engine. If the locClientSendMsg() - function is successful, the client should expect an indication - (except start, stop, event reg and sensor injection messages), - through the registered callback in the locOpen() function. The - indication will contain the status of the request and if status is a - success, indication also contains the payload - associated with response. - @param [in] handle Handle returned by the locClientOpen() - function. - @param [in] reqId message ID of the request - @param [in] reqPayload Payload of the request, can be NULL - if request has no payload - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS ) - On success. - - non-zero error code (see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload ) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - qmi_client_error_type rc = QMI_NO_ERR; //No error - qmiLocGenRespMsgT_v02 resp; - uint32_t reqLen = 0; - void *pReqData = NULL; - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)handle; - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle ) - { - // did not find the handle in the client List - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - // validate that the request is correct - if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) - { - - LOC_LOGE("%s:%d] error invalid request\n", __func__, - __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, - __LINE__, reqId, reqLen); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); - - rc = qmi_client_send_msg_sync( - pCallbackData->userHandle, - reqId, - pReqData, - reqLen, - &resp, - sizeof(resp), - LOC_CLIENT_ACK_TIMEOUT); - - LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, - __LINE__, rc); - - if (rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - // map the QCCI response to Loc API v02 status - status = convertQmiResponseToLocStatus(&resp); - - return(status); -} - -/** locClientGetSizeByRespIndId - * @brief Get the size of the response indication structure, - * from a specified id - * @param [in] respIndId - * @param [out] pRespIndSize - * @return true if resp ID was found; else false -*/ - -bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) -{ - size_t idx = 0, respIndTableSize = 0; - respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); - for(idx=0; idx -#include "location_service_v02.h" //QMI LOC Service data types definitions -#include -#include - -/****************************************************************************** - * Constants and configuration - *****************************************************************************/ - -/** @addtogroup constants_macros -@{ */ - -/** Specific value of #locClientHandleType, indicating an invalid handle. */ -#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) - -/** @} */ /* end_addtogroup constants_macros */ - -/** @addtogroup data_types -@{ */ - -/** Location client handle used to represent a specific client. Negative values - are invalid handles. */ -typedef void* locClientHandleType; - -/** Data type for events and event masks. - @newpage */ -typedef uint64_t locClientEventMaskType; - -/** Location client status values. - @vertspace -*/ -typedef enum -{ - eLOC_CLIENT_SUCCESS = 0, - /**< Request was successful. */ - - eLOC_CLIENT_FAILURE_GENERAL = 1, - /**< Failed because of a general failure. */ - - eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, - /**< Failed because the service does not support the command. */ - - eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, - /**< Failed because the request contained invalid parameters. */ - - eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, - /**< Failed because the engine is busy. */ - - eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, - /**< Failed because the phone is offline. */ - - eLOC_CLIENT_FAILURE_TIMEOUT = 6, - /**< Failed because of a timeout. */ - - eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, - /**< Failed because the service is not present. */ - - eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, - /**< Failed because the service version is unsupported. */ - - eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, - /**< Failed because the service does not support client version. */ - - eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, - /**< Failed because an invalid handle was specified. */ - - eLOC_CLIENT_FAILURE_INTERNAL = 11, - /**< Failed because of an internal error in the service. */ - - eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12 - /**< Failed because the service has not been initialized. */ - -}locClientStatusEnumType; - -/** Loc Client error values -*/ - -typedef enum -{ - eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 - /**< Service is no longer available, the client should - close the existing connection and reopen the connection - upon getting this error. - */ -}locClientErrorEnumType; - - -/** @} */ /* end_addtogroup data_types */ - -/** @addtogroup send_request -@{ */ - -/** @brief Request messages the client can send to the location engine. - - The following requests do not have any data associated, so they do not have a - payload structure defined: - - - GetServiceRevision - - GetFixCriteria - - GetPredictedOrbitsDataSource - - GetPredictedOrbitsDataValidity - - GetEngineLock - - GetSbasConfigReq - - GetRegisteredEvents - - GetNmeaTypes - - GetLowPowerMode - - GetXtraTSessionControl - - GetRegisteredEvents - - GetOperationMode - - GetCradleMountConfig - - GetExternalPowerConfig -*/ -typedef union -{ - const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; - /**< Notifies the service about the revision the client is using. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ - - const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; - /**< Changes the events the client is interested in receiving. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_REG_EVENTS_REQ_V02. */ - - const qmiLocStartReqMsgT_v02* pStartReq; - /**< Starts a positioning session. - - The client receives the following indications: position report, - satellite report, fix session report, and NMEA report (if applicable). - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_START_REQ_V02. */ - - const qmiLocStopReqMsgT_v02* pStopReq; - /**< Stops a positioning session. The client receives a fix session report - denoting that the fix session ended after this message was sent. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_STOP_REQ_V02. */ - - const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; - /**< Informs the service about the user response for a network-initiated call. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NI_USER_RESPONSE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ - - const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; - /**< Injects the predicted orbits data into the service. - - When all predicted orbits data parts have been injected, the client - receives the following indication containing a response: - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. - - The client injects successive data parts without waiting for this - indication as long as locClientSendReq() returns successfully. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ - - const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; - /**< Injects UTC time into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_UTC_TIME_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ - - const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; - /**< Injects a position into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_POSITION_REQ_V02. */ - - const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; - /**< Sets the location engine lock. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_ENGINE_LOCK_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ - - const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; - /**< Sets the SBAS configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SBAS_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ - - const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; - /**< Sets the NMEA types configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_NMEA_TYPES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ - - const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; - /**< Sets the Low Power mode configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ - - const qmiLocSetServerReqMsgT_v02* pSetServerReq; - /**< Sets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SERVER_REQ_V02. */ - - const qmiLocGetServerReqMsgT_v02* pGetServerReq; - /**< Gets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SERVER_REQ_V02. */ - - const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; - /**< Deletes the aiding data from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ - - const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; - /**< Sets XTRA-T session control in the engine. If the request is accepted by - the service, the client receives the following indication containing a - response: QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ - - const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; - /**< Injects a WiFi position into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ - - const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; - /**< Notifies the engine about the WiFi status. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ - - const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; - /**< Sets the engine Operation mode. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_OPERATION_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ - - const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; - /**< Sends the stationary position status to the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SPI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SPI_STATUS_REQ_V02. */ - - const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; - /**< Injects sensor data into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ - - const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; - /**< Injects time synchronization information into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ - - const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; - /**< Sets the cradle mount state information in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - SET_CRADLE_MOUNT_CONFIG_REQ_V02. - - To send this request, set the reqId field in locClientSendReq() to - SET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; - /**< Sets external power configuration state in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ - - const qmiLocInformLocationServerConnStatusReqMsgT_v02* - pInformLocationServerConnStatusReq; - /**< Informs the engine about the connection status to the location server. - - This can be sent in response to a - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The - service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 - response indication for this request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02.*/ - - const qmiLocSetProtocolConfigParametersReqMsgT_v02* - pSetProtocolConfigParametersReq; - /**< Sets the protocol configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetProtocolConfigParametersReqMsgT_v02* - pGetProtocolConfigParametersReq; - /**< Retrieves protocol configuration parameters from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - - const qmiLocSetSensorControlConfigReqMsgT_v02* - pSetSensorControlConfigReq; - /**< Sets the sensor control configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. - @newpage */ - - const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* - pSetSensorPerformanceControlConfigReq; - /**< Sets the sensor performance configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - @newpage */ - - const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; - /**< Sets the sensor properties in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. - @newpage */ - - const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; - /**< Injects a SUPL certificate into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. - @newpage */ - - const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; - /**< Deletes a SUPL certificate from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. - @newpage */ - - const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* - pSetPositionEngineConfigParametersReq; - /**< Sets Position Engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - - const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* - pGetPositionEngineConfigParametersReq; - /**< Gets Position Engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. - @newpage */ - -}locClientReqUnionType; - - -/** @brief Event indications that are sent by the service. -*/ -typedef union -{ - const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; - /**< Contains the position information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. If - periodic fix criteria is specified, this event is generated multiple - times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is - sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ - - const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; - /**< Contains the GNSS satellite information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. This event - is generated at 1 Hz if the location engine is tracking satellites to - make a location fix. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ - - const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; - /**< Contains an NMEA report sentence. The entire NMEA report consisting - of multiple sentences is sent at a 1Hz rate. - This event is generated after QMI_LOC_START_REQ_V02 is sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NMEA_IND_V02. */ - - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; - /**< Notifies a location client when the network triggers a positioning request - to the mobile. - - Upon getting this event, the location client displays the - network-initiated fix request in a dialog and prompts the user to accept - or deny the request. The client responds to this request with the message - QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ - - const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; - /**< Asks the client for time assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The eventIndId field in the event indication callback is - set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ - - const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* - pInjectPredictedOrbitsReqEvent; - /**< Asks the client for predicted orbits data assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ - - const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; - /**< Asks the client for position assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_POSITION_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ - - const qmiLocEventEngineStateIndMsgT_v02* pEngineState; - /**< Sent by the engine whenever it turns on or off. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ - - const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; - /**< Sent by the engine when a location session begins or ends. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ - - const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; - /**< Sent by the engine when it needs WiFi support. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ - - const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* - pSensorStreamingReadyStatusEvent; - /**< Notifies the client that the engine is ready to accept sensor data. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ - - const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; - /**< Sent by the engine when it needs to synchronize its time with the sensor - processor time. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ - - const qmiLocEventSetSpiStreamingReportIndMsgT_v02* - pSetSpiStreamingReportEvent; - /**< Asks the client to start/stop sending a Stationary Position Indicator - (SPI) stream. - - The eventIndId field in the event indication callback is set to - QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ - - const qmiLocEventLocationServerConnectionReqIndMsgT_v02* - pLocationServerConnReqEvent; - /**< Sent by the engine to ask the client to open or close a connection to - a location server. - - The client responds to this request by sending the - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. - @newpage */ - -}locClientEventIndUnionType; - - -/** @brief Response indications that are sent by the service. */ -typedef union -{ - const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; - /**< Response to the request, QMI_LOC_GET_SERVICE_REVISION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ - - const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; - /**< Response to the request, QMI_LOC_GET_FIX_CRITERIA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ - - const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; - /**< Response to the request, QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_NI_USER_RESPONSE_IND_V02. */ - - const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* - pInjectPredictedOrbitsDataInd; - /**< Sent after a predicted orbits data part has been successfully injected. - - The client waits for this indication before injecting the next part. - This indication is sent in response to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* - pGetPredictedOrbitsDataSourceInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* - pGetPredictedOrbitsDataValidityInd; - /**< Response to the request, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ - - const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; - /**< Response to the request, QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_UTC_TIME_IND_V02. */ - - const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; - /**< Response to the request, QMI_LOC_INJECT_POSITION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_POSITION_IND_V02. */ - - const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; - /**< Response to the request, QMI_LOC_SET_ENGINE_LOCK_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ - - const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; - /**< Response to the request, QMI_LOC_GET_ENGINE_LOCK_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ - - const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; - /**< Response to the request, QMI_LOC_SET_SBAS_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ - - const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; - /**< Response to the request, QMI_LOC_GET_SBAS_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ - - const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; - /**< Response to the request, QMI_LOC_SET_NMEA_TYPES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_NMEA_TYPES_IND_V02. */ - - const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; - /**< Response to the request, QMI_LOC_GET_NMEA_TYPES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NMEA_TYPES_IND_V02. */ - - const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; - /**< Response to the request, QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; - /**< Response to the request, QMI_LOC_GET_LOW_POWER_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocSetServerIndMsgT_v02* pSetServerInd; - /**< Response to the request, QMI_LOC_SET_SERVER_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SERVER_IND_V02. */ - - const qmiLocGetServerIndMsgT_v02* pGetServerInd; - /**< Response to the request, QMI_LOC_GET_SERVER_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVER_IND_V02. */ - - const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; - /**< Response to the request, QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ - - const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; - /**< Response to the request, QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; - /**< Response to the request, QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ - - const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; - /**< Response to the request, QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ - - const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; - /**< Response to the request, QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ - - const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; - /**< Response to the request, QMI_LOC_SET_OPERATION_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_OPERATION_MODE_IND_V02. */ - - const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; - /**< Response to the request, QMI_LOC_GET_OPERATION_MODE_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_OPERATION_MODE_IND_V02. */ - - const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; - /**< Response to the request, QMI_LOC_SET_SPI_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SPI_STATUS_IND_V02. */ - - const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; - /**< Response to the request, QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ - - const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; - /**< Response to the request, QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ - - const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ - - const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; - /**< Response to the request, QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; - /**< Response to the request, QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocInformLocationServerConnStatusIndMsgT_v02* - pInformLocationServerConnStatusInd; - /**< Response to the request, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ - - const qmiLocSetProtocolConfigParametersIndMsgT_v02* - pSetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetProtocolConfigParametersIndMsgT_v02* - pGetProtocolConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - @newpage */ - - const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ - - const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. - @newpage */ - - const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - @newpage */ - - const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - @newpage */ - - const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* - pSetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ - - const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* - pGetSensorPerformanceControlConfigInd; - /**< Response to the request, - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - @newpage */ - - const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; - /**< Response to the request, - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - @newpage */ - - const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; - /**< Response to the request, - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - @newpage */ - - const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* - pSetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ - - const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* - pGetPositionEngineConfigParametersInd; - /**< Response to the request, - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - The respIndId field in the response indication callback is set to - QMI_LOC_ET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - @newpage */ - -}locClientRespIndUnionType; - -/** @} */ /* end_addtogroup send_request */ - -/** @addtogroup data_types -@{ */ - -/** Location event indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the asynchronous event indications. - - @vertspace - @param handle Location client for this event. Only the client who - registered for the corresponding event receives - this callback. - @param eventIndId ID of the event indication. - @param eventIndPayload Event indication payload. - @param pClientCookie Pointer to the cookie the client specified during - registration. -*/ -typedef void (*locClientEventIndCbType)( - locClientHandleType handle, - uint32_t eventIndId, - const locClientEventIndUnionType eventIndPayload, - void *pClientCookie -); - -/** Location response indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the response indications. - - @vertspace - @param handle Location client who sent the request for which this - response indication is generated. - @param respIndId ID of the response. It is the same value as the ID - of request sent to the engine. - @param respIndPayload Payload of the response indication. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @newpage -*/ -typedef void (*locClientRespIndCbType)( - locClientHandleType handle, - uint32_t respIndId, - const locClientRespIndUnionType respIndPayload, - void *pClientCookie -); - -/** Location error callback function type. This function will be - called to inform the client that the service is no longer - available. When the client receives this callback it must - close the existing connection and reopen the client connection. - - - @vertspace - @param handle Location client who sent the request for which this - error indication is generated. - @param errorId Error ID. - @param errorCbdata Payload associated with the error indication. - - @newpage -*/ -typedef void (*locClientErrorCbType)( - locClientHandleType handle, - locClientErrorEnumType errorId, - void* pClientCookie - ); - - -/** Callback functions to be registered during locClientOpen -*/ - -typedef struct -{ - uint32_t size; - /**< Size of the structure */ - locClientEventIndCbType eventIndCb; - /**< Event Indication callback */ - locClientRespIndCbType respIndCb; - /**< Response Indication callback */ - locClientErrorCbType errorCb; - /**< Error Indication callback */ -}locClientCallbacksType; - -/** @} */ /* end_addtogroup data_types */ - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** @addtogroup open_client -@{ */ -/*========================================================================== - locClientOpen */ -/** - @latexonly\label{hdr:locClientOpenFunction}@endlatexonly Connects a location - client to the location engine. If the connection is successful, this function - returns a handle that the location client uses for future location operations. - - @datatype - #locClientStatusEnumType\n - #locClientEventMaskType\n - #locClientCallbacksType *\n - #locClientHandleType *\n - #void * - - @vertspace - @param[in] eventRegMask Mask of asynchronous events the client is - interested in receiving. - @param[in] pLocClientCallbacks Pointer to structure containing the - callbacks. - @param[out] pLocClientHandle Pointer to the handle to be used by the - client for any subsequent requests. - @param[in] pLocClientCookie Pointer to a "cookie" to be returned to the - client along with the callbacks. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - @newpage -*/ -extern locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pLocClientCookie -); - -/** @} */ /* end_addtogroup open_client */ - -/** @addtogroup close_client -@{ */ -/*========================================================================== - locClientClose */ -/** - @latexonly\label{hdr:locClientCloseFunction}@endlatexonly Disconnects a client - from the location engine and sets the handle to - LOC_CLIENT_INVALID_HANDLE_VALUE. - - @datatype - #locClientStatusEnumType\n - #locClientHandleType - - @vertspace - @param[in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - @newpage -*/ -extern locClientStatusEnumType locClientClose ( - locClientHandleType* pLocClientHandle -); - -/** @} */ /* end_addtogroup close_client */ - -/** @addtogroup send_request -@{ */ -/*============================================================================= - locClientSendReq */ -/** - @latexonly\label{hdr:locClientSendReqFunction}@endlatexonly Sends a message to - the location engine. If this function is successful, the client expects an - indication (except start, stop, event registration, and sensor injection - messages) through the registered callback in the locClientOpen() function. - - The indication contains the status of the request. If the status is a success, - the indication also contains the payload associated with response. - - @datatype - #locClientStatusEnumType\n - #locClientHandleType\n - #locClientReqUnionType - - @vertspace - @param[in] handle Handle returned by the locClientOpen() function. - @param[in] reqId QMI_LOC service message ID of the request. - @param[in] pReqPayload Payload of the request. This can be NULL if the request - has no payload. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. - - @structure - locClientReqUnionType - @newpage -*/ -extern locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload -); - -/** @} */ /* end_addtogroup send_request */ - -/** @addtogroup get_size_event -@{ */ -/*============================================================================= - locClientGetSizeByEventIndId */ -/** - Gets the size of the event indication structure from a specified ID. - - @datatype - #locClientGetSizeByEventIndId - - @vertspace - @param[in] eventIndId Event indicator ID. - @param[out] pEventIndSize Pointer to the size of the structure. - - @return - true -- The event ID was found.\n - false -- Otherwise. - - @dependencies - None. - - @structure - locClientEventIndUnionType - @newpage -*/ -extern bool locClientGetSizeByEventIndId( - uint32_t eventIndId, - size_t *pEventIndSize); - -/** @} */ /* end_addtogroup get_size_event */ - -/** @addtogroup get_size_response -@{ */ -/*============================================================================= - locClientGetSizeByRespIndId */ - -/** - Gets the size of the response indication structure from a specified ID. - - @datatype - #locClientGetSizeByRespIndId - - @vertspace - @param[in] respIndId Response indicator ID. - @param[out] pRespIndSize Pointer to the size of the structure. - - @return - true -- The response ID was found.\n - false -- Otherwise. - - @dependencies - None. - - @structure - locClientRespIndUnionType - @newpage -*/ -extern bool locClientGetSizeByRespIndId( - uint32_t respIndId, - size_t *pRespIndSize); - -/*=============================================================================*/ - -/** @} */ /* end_addtogroup get_size_response */ - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c deleted file mode 100644 index 78792607..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ /dev/null @@ -1,243 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 - -static loc_name_val_s_type loc_v02_event_name[] = -{ - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_START_REQ_V02), - NAME_VAL(QMI_LOC_START_RESP_V02), - NAME_VAL(QMI_LOC_STOP_REQ_V02), - NAME_VAL(QMI_LOC_STOP_RESP_V02), - NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), -}; -static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_event_name(uint32_t event) -{ - return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); -} - -static loc_name_val_s_type loc_v02_client_status_name[] = -{ - NAME_VAL(eLOC_CLIENT_SUCCESS), - NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), - NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), - NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), - NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), - NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), - NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), -}; -static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_client_status_name(locClientStatusEnumType status) -{ - return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); -} - - -static loc_name_val_s_type loc_v02_qmi_status_name[] = -{ - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, - eQMI_LOC_SUCCESS_V02, - eQMI_LOC_GENERAL_FAILURE_V02, - eQMI_LOC_UNSUPPORTED_V02, - eQMI_LOC_INVALID_PARAMETER_V02, - eQMI_LOC_ENGINE_BUSY_V02, - eQMI_LOC_PHONE_OFFLINE_V02, - eQMI_LOC_TIMEOUT_V02, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 -}; -static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) -{ - return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); -} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h deleted file mode 100644 index c63972f9..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_V02_LOG_H -#define LOC_API_V02_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include - -const char* loc_get_v02_event_name(uint32_t event); -const char* loc_get_v02_client_status_name(locClientStatusEnumType status); -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); - - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h deleted file mode 100644 index f1b675e3..00000000 --- a/loc_api/loc_api_v02/loc_util_log.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_UTIL_LOG_H -#define LOC_UTIL_LOG_H - -#ifdef FEATURE_LOC_API_V02_QNX_MOD -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#endif //FEATURE_LOC_API_V02_QNX_MOD - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -#include - -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -// get around strl*: not found in glibc -// TBD:look for presence of eglibc other libraries -// with strlcpy supported. -#define strlcpy(X,Y,Z) strcpy(X,Y) -#define strlcat(X,Y,Z) strcat(X,Y) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#elif defined(_ANDROID_) - -#include - -#endif //LOC_UTIL_TARGET_OFF_TARGET - - -#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c deleted file mode 100644 index 37d93f6f..00000000 --- a/loc_api/loc_api_v02/location_service_v02.c +++ /dev/null @@ -1,2223 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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 "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 7, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 8, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 9, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 11, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 11, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 4, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 14, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 14, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 18, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 26, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 0, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 2, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 3, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 4, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 10, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 12, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 13, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 15, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 16, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 17, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 19, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 19, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision) -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 4, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 10, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 12, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 13, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 16, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 17, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 20, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 7, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 7, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 22, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 23, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 24, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 25, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 27, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 27, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 28, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 18, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 18, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, TYPE16(0, 3), 32}, - {QMI_LOC_STOP_REQ_V02, TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, TYPE16(0, 19), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, TYPE16(0, 21), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, TYPE16(0, 23), 1075}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, TYPE16(0, 25), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, TYPE16(0, 27), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, TYPE16(0, 29), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, TYPE16(0, 31), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, TYPE16(0, 33), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, TYPE16(0, 35), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, TYPE16(0, 37), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, TYPE16(0, 39), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, TYPE16(0, 41), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, TYPE16(0, 43), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, TYPE16(0, 45), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 47), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, TYPE16(0, 49), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, TYPE16(0, 51), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, TYPE16(0, 53), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, TYPE16(0, 55), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 57), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, TYPE16(0, 59), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, TYPE16(0, 61), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, TYPE16(0, 63), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, TYPE16(0, 65), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, TYPE16(0, 67), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, TYPE16(0, 69), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, TYPE16(0, 71), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, TYPE16(0, 73), 1425}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, TYPE16(0, 75), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 79), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, TYPE16(0, 77), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 83), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, TYPE16(0, 81), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, TYPE16(0, 85), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 87), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 89), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 91), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, TYPE16(0, 93), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, TYPE16(0, 97), 0}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 99), 21}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, TYPE16(0, 101), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 103), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, TYPE16(0, 105), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 107), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, TYPE16(0, 109), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, TYPE16(0, 5), 224}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, TYPE16(0, 8), 1068}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, TYPE16(0, 15), 16}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, TYPE16(0, 20), 14}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, TYPE16(0, 22), 28}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, TYPE16(0, 24), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, TYPE16(0, 26), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, TYPE16(0, 28), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, TYPE16(0, 30), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, TYPE16(0, 32), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, TYPE16(0, 34), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, TYPE16(0, 36), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, TYPE16(0, 38), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, TYPE16(0, 40), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, TYPE16(0, 42), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, TYPE16(0, 44), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, TYPE16(0, 46), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, TYPE16(0, 48), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, TYPE16(0, 50), 11}, - {QMI_LOC_SET_SERVER_IND_V02, TYPE16(0, 52), 7}, - {QMI_LOC_GET_SERVER_IND_V02, TYPE16(0, 54), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, TYPE16(0, 56), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 58), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, TYPE16(0, 60), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, TYPE16(0, 62), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, TYPE16(0, 64), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, TYPE16(0, 66), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, TYPE16(0, 68), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, TYPE16(0, 70), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, TYPE16(0, 72), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, TYPE16(0, 74), 22}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, TYPE16(0, 76), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 80), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, TYPE16(0, 78), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 84), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, TYPE16(0, 82), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, TYPE16(0, 86), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 88), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 90), 25}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 92), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, TYPE16(0, 94), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 96), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, TYPE16(0, 98), 14}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 100), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, TYPE16(0, 102), 28}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 104), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, TYPE16(0, 106), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 108), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, TYPE16(0, 110), 19} -}; - -/*Service Object*/ -const struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x02, - 0x02, - 16, - 2248, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02 -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} - diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h deleted file mode 100644 index 2f288145..00000000 --- a/loc_api/loc_api_v02/location_service_v02.h +++ /dev/null @@ -1,5914 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x04 -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x02 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x005F; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of SUPL CERT. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. \n - - Type: Unsigned integer */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008) /**< The control point must enable this mask to receive NI notify verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyrometer, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800) /**< The control point must enable this mask to receive time-sync requests from - the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000) /**< The control point must enable this mask to receive location server requests. - These requests are generated when the service wishes to establish a - connection with a location server. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: \n - - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER_CONNECTION_REQ - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. - Request a single position fix. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. - High accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. - Intermediate reports are turned off. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; The control point sends this message when it wants to - initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Type: Unsigned integer \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy.\n - - 0x00000002 -- MED: Client requires medium horizontal accuracy.\n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Type: Unsigned integer \n - - Units: Milliseconds \n - - Default: 1000 ms - */ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; The control point sends this message when it wants to - stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Type: Unsigned integer \n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. - Fix request failed because the engine is locked. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Type: Unsigned integer \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy)\n - - PDOP = square root of (HDOP^2 + VDOP^2) */ - - float HDOP; - /**< Horizontal dilution of precision.\n - - Type: Floating point \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ - - float VDOP; - /**< Vertical dilution of precision.\n - - Type: Floating point. \n - - Range: 1 (highest accuracy) to 50 (lowest accuracy) */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyrometer was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors are used. - - Valid bitmasks are specified by the following constants: \n - - 0x00000001 -- SENSOR_USED_ACCEL \n - - 0x00000002 -- SENSOR_USED_GYRO */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results are aided by sensors. - - Valid bitmasks are specified by the following constants: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network - Source of the time is unknown */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed - Location reliability is high; strong cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This message is used to send the position report to the - control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \n - - 0x00000000 -- SESS_STATUS_SUCCESS \n - - 0x00000001 -- SESS_STATUS_IN_PROGRESS \n - - 0x00000002 -- SESS_STATUS_GENERAL_FAILURE \n - - 0x00000003 -- SESS_STATUS_TIMEOUT \n - - 0x00000004 -- SESS_STATUS_USER_END \n - - 0x00000005 -- SESS_STATUS_BAD_PARAMETER \n - - 0x00000006 -- SESS_STATUS_PHONE_OFFLINE \n - - 0x00000007 -- SESS_STATUS_ENGINE_LOCKED - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Type: Unsigned integer \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). \n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Type: Floating point \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Type: Unsigned integer \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< Speed uncertainty.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Type: Unsigned integer \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \n - - 0x00000000 -- RELIABILITY_NOT_SET \n - - 0x00000001 -- RELIABILITY_VERY_LOW \n - - 0x00000002 -- RELIABILITY_LOW \n - - 0x00000003 -- RELIABILITY_MEDIUM \n - - 0x00000004 -- RELIABILITY_HIGH */ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Type: Floating point \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. \n - - Type: Floating point */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \n - - 0x00000001 -- SATELLITE \n - - 0x00000002 -- CELLID \n - - 0x00000004 -- WIFI */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Type: Unsigned integer \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Type: Unsigned integer \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time \n */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Type: Floating point \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - - Valid values: \n - - 0x00000000 -- TIME_SRC_INVALID \n - - 0x00000001 -- TIME_SRC_NETWORK_TIME_TRANSFER \n - - 0x00000002 -- TIME_SRC_NETWORK_TIME_TAGGING \n - - 0x00000003 -- TIME_SRC_EXTERNAL_ INPUT \n - - 0x00000004 -- TIME_SRC_TOW_DECODE \n - - 0x00000005 -- TIME_SRC_TOW_CONFIRMED \n - - 0x00000006 -- TIME_SRC_TOW_AND_WEEK_CONFIRMED \n - - 0x00000007 -- TIME_SRC_NAV_SOLUTION \n - - 0x00000008 -- TIME_SRC_SOLVE_FOR_TIME */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. - GLONASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. - SV is being tracked. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \n - - 0x00000001 -- VALID_SYSTEM \n - - 0x00000002 -- VALID_GNSS_SVID \n - - 0x00000004 -- VALID_HEALTH_STATUS \n - - 0x00000008 -- VALID_PROCESS_STATUS \n - - 0x00000010 -- VALID_SVINFO_MASK \n - - 0x00000020 -- VALID_ELEVATION \n - - 0x00000040 -- VALID_AZIMUTH \n - - 0x00000080 -- VALID_SNR - - */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - */ - - uint16_t gnssSvId; - /**< GNSS SV ID. \n - - - Type: Unsigned integer \n - - Range: \n - -- For GPS: 1 to 32 \n - -- For SBAS: 33 to 64 \n - -- For GLONASS: 65 to 96 */ - - uint8_t healthStatus; - /**< Health status. \n - - Type: Unsigned integer \n - - Range: 0 = unhealthy; 1 = healthy */ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Type: Floating point \n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Type: Floating point \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to send a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Source */ - uint8_t altitudeAssumed; - /**< Altitude assumed or calculated:\n - - 0x00 (FALSE) -- Valid altitude is calculated \n - - 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough - satellites to determine precise altitude */ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used to send NMEA sentences to the control point. */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 201 */ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. - Notify and Verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. - MS-based preferred, but MS-assisted allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. - Encoding is GSM. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Type: Unsigned integer \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. \n - - Type: Unsigned integer */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Type: Unsigned integer \n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \n - - 0x00000001 -- NI_VX_MS_ASSISTED_ONLY \n - - 0x00000002 -- NI_VX_MS_BASED_ONLY \n - - 0x00000003 -- NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED \n - - 0x00000004 -- NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \n - - 0x00000000 -- NI_VX_OCTET \n - - 0x00000001 -- NI_VX_EXN_PROTOCOL_MSG \n - - 0x00000002 -- NI_VX_ASCII \n - - 0x00000003 -- NI_VX_IA5 \n - - 0x00000004 -- NI_VX_UNICODE \n - - 0x00000005 -- NI_VX_SHIFT_JIS \n - - 0x00000006 -- NI_VX_KOREAN \n - - 0x00000007 -- NI_VX_LATIN_HEBREW \n - - 0x00000008 -- NI_VX_LATIN \n - - 0x00000009 -- NI_VX_GSM - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. - No position. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. - Encoding is GSM default. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity - SUPL unknown format. */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \n - - 0x00000000 -- FORMAT_LOGICAL_NAME \n - - 0x00000001 -- FORMAT_EMAIL_ADDRESS \n - - 0x00000002 -- FORMAT_MSISDN \n - - 0x00000003 -- FORMAT_URL \n - - 0x00000004 -- FORMAT_SIP_URL \n - - 0x00000005 -- FORMAT_MIN \n - - 0x00000006 -- FORMAT_MDN \n - - 0x00000007 -- FORMAT_IMSPUBLIC_IDENTITY \n - - 0x7FFFFFFF -- FORMAT_OSS_UNKNOWN - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID */ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Type: Unsigned integer \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Type: Unsigned integer \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Type: Unsigned integer \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. \n - - Type: Unsigned integer */ - - uint16_t port; - /**< IPV4 port. \n - - Type: Unsigned integer */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. \n - - Type: Unsigned integer */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \n - - 0x00000001 -- SUPL_SERVER_INFO \n - - 0x00000002 -- SUPL_SESSION_ID \n - - 0x00000004 -- SUPL_HASH \n - - 0x00000008 -- SUPL_POS_METHOD \n - - 0x00000010 -- SUPL_DATA_CODING_SCHEME \n - - 0x00000020 -- SUPL_REQUESTOR_ID \n - - 0x00000040 -- SUPL_CLIENT_NAME \n - - 0x00000080 -- SUPL_QOP \n - - 0x00000100 -- SUPL_USER_RESP_TIMER - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \n - - 0x00000001 -- AGPS_SETASSISTED \n - - 0x00000002 -- AGPS_SETBASED \n - - 0x00000003 -- AGPS_SETASSISTED_PREF \n - - 0x00000004 -- AGPS_SETBASED_PREF \n - - 0x00000005 -- AUTONOMOUS_GPS \n - - 0x00000006 -- AFLT \n - - 0x00000007 -- ECID \n - - 0x00000008 -- EOTD \n - - 0x00000009 -- OTDOA \n - - 0x0000000A -- NO_POSITION - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. - Initial location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \n - - 0x0001 -- INVOKE_ID_MASK \n - - 0x0002 -- DATA_CODING_SCHEME_MASK \n - - 0x0004 -- NOTIFICATION_TEXT_MASK \n - - 0x0008 -- CLIENT_ADDRESS_MASK \n - - 0x0010 -- LOCATION_TYPE_MASK \n - - 0x0020 -- REQUESTOR_ID_MASK \n - - 0x0040 -- CODEWORD_STRING_MASK \n - - 0x0080 -- SERVICE_TYPE_MASK \n - - 0x0100 -- USER_RESP_TIMER_MASK - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. \n - - Type: Unsigned integer */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \n - - 0x0000000C -- NI_SS_GERMAN \n - - 0x0000000D -- NI_SS_ENGLISH \n - - 0x0000000E -- NI_SS_ITALIAN \n - - 0x0000000F -- NI_SS_FRENCH \n - - 0x00000010 -- NI_SS_SPANISH \n - - 0x00000011 -- NI_SS_DUTCH \n - - 0x00000012 -- NI_SS_SWEDISH \n - - 0x00000013 -- NI_SS_DANISH \n - - 0x00000014 -- NI_SS_PORTUGUESE \n - - 0x00000015 -- NI_SS_FINNISH \n - - 0x00000016 -- NI_SS_NORWEGIAN \n - - 0x00000017 -- NI_SS_GREEK \n - - 0x00000018 -- NI_SS_TURKISH \n - - 0x00000019 -- NI_SS_HUNGARIAN \n - - 0x0000001A -- NI_SS_POLISH \n - - 0x0000001B -- NI_SS_LANGUAGE_UNSPEC \n - - 0x0000001C -- NI_SUPL_UTF8 \n - - 0x0000001D -- NI_SUPL_UCS2 \n - - 0x0000001E -- NI_SUPL_GSM_DEFAULT - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \n - - 0x00000001 -- CURRENT_LOCATION \n - - 0x00000002 -- CURRENT_OR_LAST_KNOWN_LOCATION \n - - 0x00000004 -- INITIAL_LOCATION - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. \n - - Type: Unsigned integer */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Type: Unsigned integer \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \n - - 0x00000001 -- ONGOING_NI_INCOMING_MO - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). \n - - Type: Unsigned integer */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). \n - - Type: Unsigned integer */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp.\n - - Type: Unsigned integer \n - - Units: Milliseconds since Jan. 1, 1970 */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. - Location engine is off. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. - Location fix session has ended. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Type: Unsigned integer \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. - Stop periodic fixes request. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \n - - 0x00000000 -- START_PERIODIC_HI_FREQ_FIXES \n - - 0x00000001 -- START_PERIODIC_KEEP_WARM \n - - 0x00000002 -- STOP_PERIODIC_FIXES - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \n - - samplesPerBatch must be a non-zero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in integral number of batches per - second (Hz). \n - - batchesPerSecond must be a non-zero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \n - - 0x01 (TRUE) -- GNSS location engine is ready to accept sensor data \n - - 0x00 (FALSE) -- GNSS location engine is not ready to accept sensor - data - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. - */ - - /* Optional */ - /* Gyrometer Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyrometer sensor - data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. \n - - Type: Unsigned integer */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream.\n - - 0x01 (TRUE) -- Client is to start sending an SPI status stream\n - - 0x00 (FALSE) -- Client is to stop sending an SPI status stream */ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. - Bring up the WWAN type used for AGNSS connections. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. - Close a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. \n - Valid values: \n - - 0x00000000 -- WWAN_TYPE_INTERNET \n - - 0x00000001 -- WWAN_TYPE_AGNSS - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is unsupported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. - Request failed because it timed out. */ - eQMI_LOC_TIMEOUT_V02 = 6, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. \n - - Type: Unsigned integer */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \n - - 0x00000001 -- LOW: Client requires low horizontal accuracy. \n - - 0x00000002 -- MED: Client requires medium horizontal accuracy. \n - - 0x00000003 -- HIGH: Client requires high horizontal accuracy. - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. \n - Valid values: \n - - 0x00000001 -- ON: Client is interested in receiving intermediate reports \n - - 0x00000002 -- OFF: Client is not interested in receiving intermediate reports - */ - - /* Optional */ - /* Mimimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. - User did not respond to notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \n - - 0x00000001 -- NOTIFY_VERIFY_ACCEPT \n - - 0x00000002 -- NOTIFY_VERIFY_DENY \n - - 0x00000003 -- NOTIFY_VERIFY_NORESP - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \n - - 0x00000001 -- NO_NOTIFY_NO_VERIFY \n - - 0x00000002 -- NOTIFY_ONLY \n - - 0x00000003 -- ALLOW_NO_RESP \n - - 0x00000004 -- NOT_ALLOW_NO_RESP \n - - 0x00000005 -- PRIVACY_OVERRIDE - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Type: Unsigned integer \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \n - - 0x00000000 -- PREDICTED_ORBITS_XTRA - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. \n - - Type: Unsigned integer */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Oribits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Type: Unsigned integer \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Type: Unsigned integer \n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Type: Unsigned integer \n - - Units: Milliseconds - */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. - Other sources. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. - Fully independent. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. - Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \n - - 0x00000000 -- ALT_SRC_UNKNOWN \n - - 0x00000001 -- ALT_SRC_GPS \n - - 0x00000002 -- ALT_SRC_CELL_ID \n - - 0x00000003 -- ALT_SRC_ENHANCED_CELL_ID \n - - 0x00000004 -- ALT_SRC_WIFI \n - - 0x00000005 -- ALT_SRC_TERRESTRIAL \n - - 0x00000006 -- ALT_SRC_TERRESTRIAL_HYBRID \n - - 0x00000007 -- ALT_SRC_ALTITUDE_DATABASE \n - - 0x00000008 -- ALT_SRC_BAROMETRIC_ALTIMETER \n - - 0x00000009 -- ALT_SRC_OTHER - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \n - - 0x00000000 -- SRC_LINKAGE_NOT_SPECIFIED \n - - 0x00000001 -- SRC_LINKAGE_FULLY_INTERDEPENDENT \n - - 0x00000002 -- SRC_LINKAGE_DEPENDS_ON_LAT_LONG \n - - 0x00000003 -- SRC_LINKAGE_FULLY_INDEPENDENT - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \n - - 0x00000000 -- UNCERTAINTY_NOT_SPECIFIED \n - - 0x00000001 -- UNCERTAINTY_POINT: Altitude uncertainty is valid at the - injected horizontal position coordinates only. \n - - 0x00000002 -- UNCERTAINTY_FULL: Altitude uncertainty applies to the - position of the device regardless of horizontal position - (within the horizontal uncertainty region, if provided). - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position Source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position Source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position Source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position Source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position Source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position Source is GNSS Terrestrial Hybrid. - Other sources. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -90.0 to 90.0 \n - - Positive values indicate northern latitude \n - - Negative values indicate southern latitude - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum).\n - - Type: Floating point \n - - Units: Degrees \n - - Range: -180.0 to 180.0 \n - - Positive values indicate eastern longitude \n - - Negative values indicate western longitude - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0 to 99) \n - - 0 -- invalid value \n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99 \n - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Type: Floating point \n - - Units: Meters; positive = height, negative = depth */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Type: Floating point \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109.\n - - Type: Unsigned integer \n - - Units: Percent (0-99) \n - - 0 -- invalid value\n - - 100 to 256 -- not used \n - - If 100 is received, reinterpret to 99\n - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Type: Unsigned integer \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Type: Signed integer \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from where this position was obtained. - Valid values: \n - - 0x00000000 -- eQMI_LOC_POSITION_SRC_GNSS \n - - 0x00000001 -- eQMI_LOC_POSITION_SRC_CELLID \n - - 0x00000002 -- eQMI_LOC_POSITION_SRC_ENH_CELLID \n - - 0x00000003 -- eQMI_LOC_POSITION_SRC_WIFI \n - - 0x00000004 -- eQMI_LOC_POSITION_SRC_TERRESTRIAL \n - - 0x00000005 -- eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID \n - - 0x00000006 -- eQMI_LOC_POSITION_SRC_OTHER \n - - If altitude is specified and altitude source is not specified, the engine - assumes that altitude was obtained using the specified Position source. - If altitude and altitude source both are specified then the engine assumes - that only latitude, longitude were obtained using the specified Position - Source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. - Lock all position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. \n - - 0x01 (TRUE) -- SBAS configuration is enabled \n - - 0x00 (FALSE) -- SBAS configuration is disabled */ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. - Server type is custom PDE. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 256 - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. \n - - Type: Unsigned integer \n - - Range: \n - - For GPS: 1 to 32 \n - - For SBAS: 33 to 64 \n - - For GLONASS: 65 to 96 */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - Valid values: \n - - 0x00000001 -- eQMI_LOC_SV_SYSTEM_GPS \n - - 0x00000002 -- eQMI_LOC_SV_SYSTEM_GALILEO \n - - 0x00000003 -- eQMI_LOC_SV_SYSTEM_SBAS \n - - 0x00000004 -- eQMI_LOC_SV_SYSTEM_COMPASS \n - - 0x00000005 -- eQMI_LOC_SV_SYSTEM_GLONASS - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. - Valid values: \n - - 0x01 (TRUE) -- All assistance data is to be deleted; - if this flag is set, all the other information - contained in the optional fields for this - message are ignored \n - - 0x00 (FALSE) -- The optional fields in the message are to be used - to determine which data is to be deleted */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assitance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - Valid values: \n - - 0x00000001 -- DELETE_GPS_SVDIR \n - - 0x00000002 -- DELETE_GPS_SVSTEER \n - - 0x00000004 -- DELETE_GPS_TIME\n - - 0x00000008 -- DELETE_GPS_ALM_CORR \n - - 0x00000010 -- DELETE_GLO_SVDIR \n - - 0x00000020 -- DELETE_GLO_SVSTEER \n - - 0x00000040 -- DELETE_GLO_TIME \n - - 0x00000080 -- DELETE_GLO_ALM_CORR \n - - 0x00000100 -- DELETE_SBAS_SVDIR \n - - 0x00000200 -- DELETE_SBAS_SVSTEER \n - - 0x00000400 -- DELETE_POSITION \n - - 0x00000800 -- DELETE_TIME \n - - 0x00001000 -- DELETE_IONO \n - - 0x00002000 -- DELETE_UTC \n - - 0x00004000 -- DELETE_HEALTH \n - - 0x00008000 -- DELETE_SADATA \n - - 0x00010000 -- DELETE_RTI \n - - 0x00020000 -- DELETE_SV_NO_EXIST \n - - 0x00040000 -- DELETE_FREQ_BIAS_EST - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CELLDB_POS \n - - 0x00000002 -- DELETE_CELLDB_LATEST_GPS_POS \n - - 0x00000004 -- DELETE_CELLDB_OTA_POS \n - - 0x00000008 -- DELETE_CELLDB_EXT_REF_POS \n - - 0x00000010 -- DELETE_CELLDB_TIMETAG \n - - 0x00000020 -- DELETE_CELLDB_CELLID \n - - 0x00000040 -- DELETE_CELLDB_CACHED_CELLID \n - - 0x00000080 -- DELETE_CELLDB_LAST_SRV_CELL \n - - 0x00000100 -- DELETE_CELLDB_CUR_SRV_CELL \n - - 0x00000200 -- DELETE_CELLDB_NEIGHBOR_INFO - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. \n - Valid values: \n - - 0x00000001 -- DELETE_CLOCK_INFO_TIME_EST \n - - 0x00000002 -- DELETE_CLOCK_INFO_FREQ_EST \n - - 0x00000004 -- DELETE_CLOCK_INFO_WEEK_NUMBER \n - - 0x00000008 -- DELETE_CLOCK_INFO_RTC_TIME \n - - 0x00000010 -- DELETE_CLOCK_INFO_TIME_TRANSFER \n - - 0x00000020 -- DELETE_CLOCK_INFO_GPSTIME_EST \n - - 0x00000040 -- DELETE_CLOCK_INFO_GLOTIME_EST \n - - 0x00000080 -- DELETE_CLOCK_INFO_GLODAY_NUMBER \n - - 0x00000100 -- DELETE_CLOCK_INFO_GLO4YEAR_NUMBER \n - - 0x00000200 -- DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY \n - - 0x00000400 -- DELETE_CLOCK_INFO_DISABLE_TT - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. \n - - Type: Unsigned integer */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. - WiFi fix failed, but the cause could not be determined. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Type: Unsigned integer \n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. \n - - Type: Unsigned integer */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \n - - 0x00000000 -- ERROR_SUCCESS \n - - 0x00000001 -- ERROR_WIFI_NOT_AVAILABLE \n - - 0x00000002 -- ERROR_NO_AP_FOUND \n - - 0x00000003 -- ERROR_UNAUTHORIZED \n - - 0x00000004 -- ERROR_SERVER_UNAVAILABLE \n - - 0x00000005 -- ERROR_LOCATION_CANNOT_BE_DETERMINED \n - - 0x00000006 -- ERROR_UNKNOWN - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Type: Signed integer \n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. \n - - Type: Unsigned integer */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. \n - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \n - - 0x00000000 -- eQMI_LOC_RELIABILITY_NOT_SET \n - - 0x00000001 -- eQMI_LOC_RELIABILITY_VERY_LOW \n - - 0x00000002 -- eQMI_LOC_RELIABILITY_LOW \n - - 0x00000003 -- eQMI_LOC_RELIABILITY_MEDIUM \n - - 0x00000004 -- eQMI_LOC_RELIABILITY_HIGH - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. - WiFi is not available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \n - - 0x00000001 -- WIFI_STATUS_AVAILABLE \n - - 0x00000002 -- WIFI_STATUS_UNAVAILABLE - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - - Valid bitmasks: \n - - 0x00000001 -- POSITION_REPORT \n - - 0x00000002 -- GNSS_SV_INFO \n - - 0x00000004 -- NMEA \n - - 0x00000008 -- NI_NOTIFY_VERIFY_REQ \n - - 0x00000010 -- INJECT_TIME_REQ \n - - 0x00000020 -- INJECT_PREDICTED_ORBITS_REQ \n - - 0x00000040 -- INJECT_POSITION_REQ \n - - 0x00000080 -- ENGINE_STATE \n - - 0x00000100 -- FIX_SESSION_STATE \n - - 0x00000200 -- WIFI_REQ \n - - 0x00000400 -- SENSOR_STREAMING_READY_STATUS \n - - 0x00000800 -- TIME_SYNC_REQ \n - - 0x00001000 -- SET_SPI_STREAMING_REPORT \n - - 0x00002000 -- LOCATION_SERVER__CONNECTION_REQ - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. - Use cell ID. For 1x, this mode corresponds to - AFLT. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \n - - 0x00000001 -- OPER_MODE_DEFAULT \n - - 0x00000002 -- OPER_MODE_MSB \n - - 0x00000003 -- OPER_MODE_MSA \n - - 0x00000004 -- OPER_MODE_STANDALONE \n - - 0x00000005 -- OPER_MODE_CELL_ID - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Whether the device is stationary:\n - - 0x00 (FALSE) -- Device is not stationary \n - - 0x01 (TRUE) -- Device is stationary */ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the sensor time of the first sample.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Type: Floating point \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyrometer: ( (rads)/(seconds^2) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit time tag of the first (oldest) sample in this - message. \n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \n - - 0x01 -- SIGN REVERSAL - */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. \n - - Type: Unsigned integer */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyrometer Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyrometer sensor samples. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. \n - - Type: Unsigned integer */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< This field lets the client know how many 3-axis accelerometer samples - were accepted. */ - - /* Optional */ - /* Gyrometer Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< This field lets the client know how many 3-axis gyrometer samples were - accepted. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< The value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< The value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle - Unknown cradle mount state */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \n - - 0x00000000 -- CRADLE_STATE_NOT_MOUNTED \n - - 0x00000001 -- CRADLE_STATE_MOUNTED \n - - 0x00000002 -- CRADLE_STATE_UNKNOWN */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Type: Unsigned integer \n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. - Unknown external power state. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \n - - 0x00000000 -- EXTERNAL_POWER_NOT_CONNECTED \n - - 0x00000001 -- EXTERNAL_POWER_CONNECTED \n - - 0x00000002 -- EXTERNAL_POWER_UNKNOWN - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. - PPP PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the Access Point Name (APN) profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. \n - - Type: NULL-terminated string \n - - Maximum string length (including NULL terminator): 101 - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. - Location server request failed. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. \n - - Type: Unsigned integer */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n APN profile information is present only when requestType - is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. - V2 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. - SUPL version 2.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000001) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000002) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x00000004) /**< Mask for the SUPL version configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< This field is sent only if the status is not a success. And if it is - not successful, this field will identify the parameters that were not - set successfully. - - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \n - - 0x0000000000000001 -- CONFIG_PARAM_MASK_SUPL_SECURITY \n - - 0x0000000000000002 -- CONFIG_PARAM_MASK_VX_VERSION \n - - 0x0000000000000004 -- CONFIG_PARAM_MASK_SUPL_VERSION - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. \n - - 0x01 (TRUE) -- SUPL security is enabled \n - - 0x00 (FALSE) -- SUPL security is disabled */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \n - - 0x00000001 -- VX_VERSION_V1_ONLY \n - - 0x00000002 -- VX_VERSION_V2_ONLY - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - - Inertial sensors are not to be used to aid heading and position - improvement. */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in heading and - position improvement. - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values:\n - - 0x00000000 -- SENSORS USE ENABLED: \n - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. \n - - 0x00000001 -- SENSORS USE DISABLED: \n - Inertial sensors are not to be used to aid in the heading and - position improvement. - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: radians^2/second^4 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPropertiesReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPropertiesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Gyro Bias Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk parameter as a positive - floating-point value. This value does not have any internal defaults. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: radians^2/seconds^4 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors - Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time the GNSS - location engine turns on. - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal - number of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ - - /* Optional */ - /* Gyrometer Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< This field is sent only if the status is not a success. - When sent, this field identifies which configuration failed. \n - Valid bitmasks: \n - - 0x0000000000000001 -- PERFORMANCE_MODE \n - - 0x0000000000000002 -- ACCEL_SAMPLING_SPEC \n - - 0x0000000000000004 -- GYRO_SAMPLING_SPEC - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. \n - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \n - - 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data injection - based on internal criteria. This is the default. \n - - 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time the GNSS - location engine turns on. - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ - - /* Optional */ - /* Gyrometer Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Inject a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Id */ - uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate - Type: Unsigned Integer - Units: Bytes - Range: 0-9 */ - - /* Mandatory */ - /* SUPL certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< The supl Certificate contents - Type: Array of bytes. - - Maximum certificate size : 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Inject a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* Supl Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the inject SUPL certificate request. \n - - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Delete a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate Id */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate Id of the Supl Certificate to be deleted - Type: Unsigned Integer \n - Units: Bytes \n - Range: 0-9 \n - If suplCertId is not specified then - "all" supl certificates will be deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Delete a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL certifcate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the delete SUPL certificate request. \n - - Valid Values: - - 0x00000000 -- SUCCESS\n - - 0x00000001 -- GENERAL_FAILURE\n - - 0x00000002 -- UNSUPPORTED\n - - 0x00000003 -- INVALID_PARAMETER\n - - 0x00000004 -- ENGINE_BUSY\n - - 0x00000005 -- PHONE_OFFLINE\n - - 0x00000006 -- LOC_TIMEOUT\n - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< This field denotes if the position engine uses the - injected position in direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< This field denotes if the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< This field denotes if the position engine stores assistance data - in the persistent memory. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position will be used in position engine.\n - Valid values: \n - - 0x01 (TRUE) -- Use the injected position in direct position - calculation. \n - - 0x00 (FALSE) -- Do not use the injected position in direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls if SV usage will be filtered in a position fix. - Valid values:\n - - 0x01 (TRUE) -- Filter the usage of SV's in the fix. \n - - 0x00 (FALSE) -- Do not filter the usage of SV's in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data should be stored in - the persistent memory. \n - Valid values:\n - - 0x01 (TRUE) -- Store assistance data in persistent memory. \n - - 0x00 (FALSE) -- Do not store assistance data in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. - */ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: \n - - 0x00000001 -- INJECTED_POSITION_CONTROL \n - - 0x00000002 -- FILTER_SV_USAGE \n - - 0x00000004 -- STORE_ASSIST_DATA - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000003 -- INVALID_PARAMETER \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000005 -- PHONE_OFFLINE \n - - 0x00000006 -- LOC_TIMEOUT - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies if the injected position is used for direct calculation - in the position engine.\n - Valid values: \n - - 0x01 (TRUE) -- The injected position is used in direct position - calculation. \n - - 0x00 (FALSE) -- The injected position is not used direct position - calculation. \n - The default value is TRUE, the injected position is used in direct - position calculation by default. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies if SV usage is filtered in a position fix. - Valid values: \n - - 0x01 (TRUE) -- SV usage is filtered in the fix. \n - - 0x00 (FALSE) -- SV usage is not filtered in the fix. \n - The default value is FALSE, the SV usage is not filtered in the - fix by default. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies if assistance data is stored in the persistent memory. \n - Valid values: \n - 0x01 (TRUE) -- Assistance data is stored in persistent memory. \n - 0x00 (FALSE) -- Assistance data is not stored in persistent memory. \n - The default value is TRUE, the assistance data is stored in - persistent memory by default. - */ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif - From c65fed03538cb5e4a5b62d3ca114ff3cc5e87e60 Mon Sep 17 00:00:00 2001 From: Mekala Natarajan Date: Thu, 21 Mar 2013 18:29:18 -0700 Subject: [PATCH 098/945] gps: Runtime detection between apq v/s mdm gps support Change-Id: Icfb6edcb8a885bbaa55091b851fb2620d65045f8 Signed-off-by: Ed Tam --- loc_api/libloc_api_50001/loc.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 16bed3b1..2173dbfd 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; @@ -147,6 +149,7 @@ static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = #endif static loc_eng_data_s_type loc_afw_data; +static int gss_fd = 0; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -189,6 +192,18 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if (strcmp(baseband,"apq") == 0) + { + 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)); + } + LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); + } + return &sLocEngInterface; } /*=========================================================================== From a50977f5e213684d5048197b9419aae8af520d1a Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Sat, 30 Mar 2013 22:50:57 -0700 Subject: [PATCH 099/945] Correction in checksum calculation for NMEA The number of bytes to be written for the checksum exceeded the buffer length. This change corrects makes the correction. Change-Id: If90c6f5b2006a013a096a767334deac1555553f1 CRs-fixed: 468553 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index e30380c9..9f087ca5 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -89,7 +89,7 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) length++; } - int checksumLength = snprintf(pNmea, maxSize,"*%02X\r\n", checksum); + int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); return (length + checksumLength); } From b2490777c1c8fe89e2353a69d754d0b74ce81a55 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 5 Apr 2013 11:10:55 -0700 Subject: [PATCH 100/945] removed exe bit of the file access mod find . -type f -executable -exec chmod -x {} \; Change-Id: Ib6e09bc4bf1d8e4cde63c1df0b15877bf42525b8 --- CleanSpec.mk | 0 etc/Android.mk | 0 .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 0 loc_api/libloc_api_50001/Android.mk | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 CleanSpec.mk mode change 100755 => 100644 etc/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp mode change 100755 => 100644 loc_api/libloc_api_50001/Android.mk diff --git a/CleanSpec.mk b/CleanSpec.mk old mode 100755 new mode 100644 diff --git a/etc/Android.mk b/etc/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk old mode 100755 new mode 100644 From 8dd8689be20398a79804f8b5c6713bdf50e2128b Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Tue, 9 Apr 2013 14:33:42 -0700 Subject: [PATCH 101/945] gps.conf: Removed the option to configure ulp on/off Since the switch for ulp in gps.conf did not truly turn QCA implementation for Fused Location Provider on/off this change removes this redundant parameter from gps.conf Change-Id: I677c42a00e6b0d156c2e4c3b65da13a55eb97279 CRs-Fixed: 461273 --- etc/gps.conf | 5 ++--- loc_api/libloc_api_50001/loc.cpp | 15 +++------------ loc_api/libloc_api_50001/loc_eng.cpp | 12 ++++++------ loc_api/libloc_api_50001/loc_ulp.h | 3 --- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index b38526a2..f3396d20 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -31,9 +31,8 @@ SUPL_VER=0x10000 # MSB = 2 # MSA = 4 # ON_DEMAND_TIME = 0x10 -# ULP = 0x20 -# default = MSA | MSB | SCHEDULING | ULP -CAPABILITIES=0x27 +# default = MSA | MSB | SCHEDULING +CAPABILITIES=0x7 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index fc6a2168..c878d642 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -234,10 +234,8 @@ extern "C" const GpsInterface* get_gps_interface() targetEnumType target = TARGET_OTHER; loc_eng_read_config(); - //We load up libulp module at this point itself if ULP configured to be On - if(gps_conf.CAPABILITIES & ULP_CAPABILITY) { - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - } + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); target = get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); @@ -686,10 +684,7 @@ const void* loc_get_extension(const char* name) } else if(strcmp(name, ULP_NETWORK_INTERFACE) == 0) { - //Return a valid value for ULP Network Interface only if ULP - //turned on in gps.conf - if(gps_conf.CAPABILITIES & ULP_CAPABILITY) - ret_val = &sUlpNetworkInterface; + ret_val = &sUlpNetworkInterface; } else @@ -1077,10 +1072,6 @@ const ulpInterface * loc_eng_get_ulp_inf(void) get_ulp_interface* get_ulp_inf; const ulpInterface* loc_eng_ulpInf = NULL; - if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { - LOC_LOGD ("%s, ULP is not configured to be On in gps.conf\n", __func__); - goto exit; - } dlerror(); /* Clear any existing error */ handle = dlopen ("libulp2.so", RTLD_NOW); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 09e9c4c3..28cbb6e8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -522,7 +522,7 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { //Pass the start messgage to ULP if present & activated loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_START_FIX)); @@ -580,7 +580,7 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { //Pass the start messgage to ULP if present & activated loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_STOP_FIX)); @@ -2014,7 +2014,7 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, LOC_LOGD("loc_eng_send_extra_command: %s\n", command); ret_val = TRUE; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_raw_command *msg( new ulp_msg_inject_raw_command(&loc_eng_data,command, length)); @@ -2053,7 +2053,7 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, INIT_CHECK(loc_eng_data.context, return -1); int ret_val; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { LOC_LOGD("SJ:loc_eng_update_criteria: valid 0x%x action:%d, minTime:%ld, minDistance:%f, singleShot:%d, horizontalAccuracy:%d, powerRequirement:%d \n", criteria.valid_mask, criteria.action, criteria.min_interval, criteria.min_distance, criteria.recurrence_type, criteria.preferred_horizontal_accuracy, @@ -2102,7 +2102,7 @@ int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, settings->is_wifi_setting_enabled, settings->is_agps_enabled, settings->is_enh_location_services_enabled ); - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_phone_context_settings *msg (new ulp_msg_inject_phone_context_settings(&loc_eng_data, *settings)); @@ -2203,7 +2203,7 @@ int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, { ENTRY_LOG(); int ret_val = 0; - if((loc_eng_data.ulp_initialized == true) && (gps_conf.CAPABILITIES & ULP_CAPABILITY)) + if(loc_eng_data.ulp_initialized == true) { ulp_msg_inject_network_position *msg (new ulp_msg_inject_network_position(&loc_eng_data, *position_report)); diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h index 75636993..deb8586d 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -63,9 +63,6 @@ extern "C" { /** Position source is GNSS only */ #define ULP_LOCATION_IS_FROM_GNSS 0x0002 -/* Hybrid support, the Android Framework will query to see if this capability is set before using the ulp functionalities in HAL */ -#define ULP_CAPABILITY 0x0000020 - #define ULP_MIN_INTERVAL_INVALID 0xffffffff /** Represents recurrence of location */ From 23d1e163c382baf6f395af46b34d309db0cb5c29 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 Mar 2013 18:23:48 -0700 Subject: [PATCH 102/945] gps: geofence hal integration Change-Id: Ia5b9c4d12c85d7d7c06b2b6037a568a43f0e8b2c --- loc_api/libloc_api_50001/Android.mk | 4 ++- loc_api/libloc_api_50001/loc.cpp | 42 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 4d657aea..a5a5533d 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -104,7 +104,9 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ libloc_eng \ - libgps.utils + libgps.utils \ + libgeofence \ + libdl LOCAL_SRC_FILES += \ loc.cpp \ diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 2173dbfd..154b42e6 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -31,6 +31,7 @@ #define LOG_TAG "LocSvc_afw" #include +#include #include #include #include @@ -42,6 +43,8 @@ static gps_sv_status_callback gps_sv_cb = NULL; static void loc_cb(GpsLocation* location, void* locExt); static void sv_cb(GpsSvStatus* sv_status, void* svExt); +static const GpsGeofencingInterface* get_geofence_interface(void); + // Function declarations for sLocEngInterface static int loc_init(GpsCallbacks* callbacks); static int loc_start(); @@ -479,6 +482,40 @@ static int loc_update_criteria(UlpLocationCriteria criteria) } #endif +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 ulpInterface failed, error = %s\n", __func__, error); + goto exit; + } + + geofence_interface = get_gps_geofence_interface(); + +exit: + EXIT_LOG(%d, geofence_interface == NULL); + return geofence_interface; +} + /*=========================================================================== FUNCTION loc_get_extension @@ -519,6 +556,11 @@ static const void* loc_get_extension(const char* name) { ret_val = &sLocEngAGpsRilInterface; } + + else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + { + ret_val = get_geofence_interface(); + } #ifdef QCOM_FEATURE_ULP else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) { From ce5efcc57fe0e7ad6650f17ace2cf391fde72399 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 9 Apr 2013 21:59:18 -0700 Subject: [PATCH 103/945] Add liblog Bug: 8580410 Change-Id: Ife86cba2312cf83f263b07bfe8f3b655ec7d1a70 --- loc_api/libloc_api_50001/Android.mk | 3 +++ utils/Android.mk | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 4d657aea..6bf33c85 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -19,6 +19,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ + liblog \ libgps.utils \ libdl @@ -58,6 +59,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ + liblog \ libloc_adapter \ libgps.utils \ libdl @@ -103,6 +105,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ + liblog \ libloc_eng \ libgps.utils diff --git a/utils/Android.mk b/utils/Android.mk index 7ce454f8..ff2810b0 100755 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -9,7 +9,8 @@ include $(CLEAR_VARS) ## Libs LOCAL_SHARED_LIBRARIES := \ libutils \ - libcutils + libcutils \ + liblog LOCAL_SRC_FILES += \ loc_log.cpp \ @@ -42,4 +43,3 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE - From 388477e2e7ebd55295c075a720056c4bbcd8e1c7 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 12 Apr 2013 17:22:54 -0700 Subject: [PATCH 104/945] gps: Add A-GLONASS Position protocol in gps.conf OEMs rely on gps.conf to config gps features. We want to have default config in the conf file however to both serve as recommendeded setting and as setting template. This added A-GLONASS protocol is already supported by the current implementation. Now we are adding the default config to the conf file." Change-Id: Ib9f66d01963c87ac5b3d70a68e1d4dd085771d47 CRs-fixed: 454855 --- etc/gps.conf | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 etc/gps.conf diff --git a/etc/gps.conf b/etc/gps.conf old mode 100644 new mode 100755 index f3396d20..3b298b24 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -64,3 +64,11 @@ LPP_PROFILE = 0 ################################ # NMEA provider (1=Modem Processor, 0=Application Processor) NMEA_PROVIDER=0 + +################################################## +# Select Positioning Protocol on A-GLONASS system +################################################## +# 0x1: RRC CPlane +# 0x2: RRLP UPlane +# 0x4: LLP Uplane +A_GLONASS_POS_PROTOCOL_SELECT = 0 From c0a3657a4ee2899dd12a43d5a31e611937f62ae6 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 15 Apr 2013 10:52:06 -0700 Subject: [PATCH 105/945] Set On Demand Time as default in gps.conf The capabilities mask in gps.conf was updated to set On Demand Time injection by default Change-Id: I1532072040aa258d441e23649c6e038bc8e56923 --- etc/gps.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 3b298b24..84283154 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -27,12 +27,12 @@ INTERMEDIATE_POS=0 SUPL_VER=0x10000 # GPS Capabilities bit mask -# SCHEDULING = 1 -# MSB = 2 -# MSA = 4 +# SCHEDULING = 0x01 +# MSB = 0x02 +# MSA = 0x04 # ON_DEMAND_TIME = 0x10 -# default = MSA | MSB | SCHEDULING -CAPABILITIES=0x7 +# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING +CAPABILITIES=0x17 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions From 0263b6f6559cf8a3e3bf283c9f759b526ae863b1 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 18 Apr 2013 17:27:39 -0700 Subject: [PATCH 106/945] msm8610 bringup changes allow gps components to build for msm8610 Change-Id: I6a718187305a2aa71b50eb6139353fea54f4ac1c --- loc_api/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 796ea169..dd7a8f31 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -22,6 +22,7 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE), true) QMI_BOARD_PLATFORM_LIST := msm8960 QMI_BOARD_PLATFORM_LIST += msm8974 QMI_BOARD_PLATFORM_LIST += msm8226 +QMI_BOARD_PLATFORM_LIST += msm8610 endif ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) From fc56628d06b795c43f804f6fa930ea0ecdaa6895 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 7 Mar 2013 15:24:28 -0800 Subject: [PATCH 107/945] Send data disable to modem during init This is to avoid data being enabled when data roaming is turned off. Change-Id: If2c2f89669d872bfd4e8579f682d0c61904fe7c8 CRs-fixed: 460376 --- loc_api/libloc_api_50001/loc_eng.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 28cbb6e8..47813530 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -426,6 +426,13 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) sap_conf.SENSOR_ALGORITHM_CONFIG_MASK)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_perf_control_conf_msg, loc_eng_free_msg); + + //Send data disable to modem. This will be set to enable when + //an UPDATE_NETWORK_STATE event is received from Android + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, + 0, 0)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } EXIT_LOG(%d, ret_val); @@ -1797,7 +1804,8 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; loc_eng_data_p->client_handle->enableData(unaMsg->enable); - loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + if(unaMsg->apn != NULL) + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); } break; From bd64ccd87459b22cbb5342ab8db00602a096f354 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Fri, 12 Apr 2013 12:16:24 +0530 Subject: [PATCH 108/945] MSB is not falling back to standlone. No support for SUPl,starting MSB it wouldn.t request a PD. Disabled the MSA and MSB for this PL. This fix is needed because this PL doesnot have a modem. Change-Id: I8fa1145db07f681c0f6e733da253f06f01f7edd6 CRs-Fixed: 471589 --- loc_api/libloc_api_50001/loc.cpp | 5 ++--- utils/loc_log.cpp | 3 ++- utils/loc_target.cpp | 7 ++++++- utils/loc_target.h | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index c878d642..caa43d54 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -164,7 +164,6 @@ static const UlpEngineInterface sLocEngUlpEngInterface = loc_ulp_engine_stop }; - static bool loc_inject_raw_command(char* command, int length); static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = @@ -239,8 +238,8 @@ extern "C" const GpsInterface* get_gps_interface() target = get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - //APQ8064 - if(target == TARGET_APQ8064_STANDALONE) { + //APQ8064 and APQ8030 + if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); if (gss_fd < 0) diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index f39667ca..ecdfc8f5 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -106,7 +106,8 @@ loc_name_val_s_type target_name[] = NAME_VAL(TARGET_APQ8064_STANDALONE), NAME_VAL(TARGET_APQ8064_FUSION3), NAME_VAL(TARGET_MPQ8064), - NAME_VAL(TARGET_MSM8930) + NAME_VAL(TARGET_MSM8930), + NAME_VAL(TARGET_APQ8030_STANDALONE) }; static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 10b508ce..fb284b50 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -44,10 +44,12 @@ #define MPQ8064_ID_1 "130" #define MSM8930_ID_1 "142" #define MSM8930_ID_2 "116" +#define APQ8030_ID_1 "157" #define LINE_LEN 100 #define STR_LIQUID "Liquid" #define STR_SURF "Surf" +#define STR_MTP "MTP" #define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 @@ -93,12 +95,15 @@ targetEnumType get_target(void) read_a_line( id, rd_id, LINE_LEN); 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_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)) target = TARGET_APQ8064_FUSION3; else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) target = TARGET_APQ8064_STANDALONE; + else if((!memcmp(rd_id, APQ8030_ID_1, LENGTH(APQ8030_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8030_ID_1)]))) + target = TARGET_APQ8030_STANDALONE; } else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) target = TARGET_MPQ8064; diff --git a/utils/loc_target.h b/utils/loc_target.h index 489aaddf..32c64b56 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -39,7 +39,8 @@ typedef enum { TARGET_APQ8064_STANDALONE, TARGET_APQ8064_FUSION3, TARGET_MPQ8064, - TARGET_MSM8930 + TARGET_MSM8930, + TARGET_APQ8030_STANDALONE }targetEnumType; targetEnumType get_target(void); From 0a760c9f3b7c8b88b201565f8c6ac7dfff7f5d22 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 2 Apr 2013 11:32:43 -0700 Subject: [PATCH 109/945] GPS HAL: expose altitude and speed uncertainty Expose altitude and speed uncertainty from GPS fix via extended info. Change-Id: I0a478aa25d4b0a98793c946ba5fb883520a4ce58 --- .../libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp | 12 ++++++++++++ loc_api/libloc_api_50001/loc_eng_msg.h | 8 ++++++++ loc_api/loc_api_v02/LocApiV02Adapter.cpp | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index b0bfe760..9c2749bd 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -702,6 +702,18 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca 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"); LocApiAdapter::reportPosition(location, locationExtended, diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index bd86defb..c64ad09d 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -113,6 +113,10 @@ typedef uint16_t GpsLocationExtendedFlags; #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 /** Represents gps location extended. */ typedef struct { @@ -130,6 +134,10 @@ typedef struct { float vdop; /** Contains Magnetic Deviation. */ float magneticDeviation; + /** vertical uncertainty in meters */ + float vert_unc; + /** speed uncertainty in m/s */ + float speed_unc; } GpsLocationExtended; typedef enum { diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index adde61d4..d7276e95 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1697,6 +1697,18 @@ void LocApiV02Adapter :: reportPosition ( locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; } + if (location_report_ptr->vertUnc_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; + locationExtended.vert_unc = location_report_ptr->vertUnc; + } + + if (location_report_ptr->speedUnc_valid ) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; + locationExtended.speed_unc = location_report_ptr->speedUnc; + } + LocApiAdapter::reportPosition( location, locationExtended, locEngHandle.extPosInfo((void*)location_report_ptr), From 22538a7f38c73dd4b574e25b4e6a32acfdcf9675 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 30 Apr 2013 12:54:30 -0700 Subject: [PATCH 110/945] Cache data availability before gps is enabled This is so that data disable is not sent to the modem by default if data is enabled Change-Id: I383443fc0321380c22382ba7d7f85dacf948853a CRs-fixed: 460376 --- loc_api/libloc_api_50001/loc_eng.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 47813530..8fa87a0b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -83,6 +83,7 @@ pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; LocEngContext* LocEngContext::me = NULL; boolean configAlreadyRead = false; +unsigned int agpsStatus = 0; loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; @@ -430,7 +431,7 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) //Send data disable to modem. This will be set to enable when //an UPDATE_NETWORK_STATE event is received from Android loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, - 0, 0)); + 0, (agpsStatus ? 1:0))); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); } @@ -1242,6 +1243,14 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d 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.context, return); if (apn != NULL) { From 38474f1f1d7e6bbc5c16bb975406d4853d63351e Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 12 Apr 2013 17:27:15 -0700 Subject: [PATCH 111/945] gps: use single recurrence for MSA requests To allow ulp to select MSA for single shot location requests, change the recurrence type for MSA requests to SINGLE. CRs-fixed: 479303 Change-Id: I97043233e0590b25bc63f3709b2bbb3dfd22cbd0 --- loc_api/libloc_api_50001/loc.cpp | 11 +++++++++-- loc_api/libloc_api_50001/loc_eng.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index caa43d54..0987601a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -419,7 +419,8 @@ static int loc_stop() ULP_CRITERIA_HAS_MIN_INTERVAL); native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now - native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot + native_criteria.recurrence_type = loc_afw_data.recurrence_type_cached; + loc_afw_data.recurrence_type_cached = ULP_LOC_RECURRENCE_PERIODIC; //For a GPS client horizontal_accuracy & power_consumption are irrelevant native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; @@ -482,13 +483,19 @@ static int loc_set_position_mode(GpsPositionMode mode, ULP_CRITERIA_HAS_MIN_INTERVAL); native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now - native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; //We let LMS handle SingleShot + + if (LOC_POSITION_MODE_MS_ASSISTED == mode) + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_SINGLE; + else + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; + //For a GPS client horizontal_accuracy & power_consumption are irrelevant native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; native_criteria.action = ULP_ADD_CRITERIA; native_criteria.min_interval = min_interval; loc_afw_data.min_interval_cached = min_interval; //cache a copy + loc_afw_data.recurrence_type_cached = native_criteria.recurrence_type; //cache a copy ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index e5cb7146..d61cb12b 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -153,6 +153,7 @@ typedef struct int mpc_port_buf; bool ulp_initialized; uint32_t min_interval_cached; + UlpRecurrenceCriteria recurrence_type_cached; } loc_eng_data_s_type; #include "ulp.h" From 9e74deb6894e148d1021bbafc562b4f95cd6c200 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Fri, 26 Apr 2013 17:42:35 -0700 Subject: [PATCH 112/945] Ulp: Fixes an initialization bug for ULP call-backs Changes that caches ULP call backs if ULP initialization precedes AFW initialization. CRs-Fixed: 477557 Change-Id: Ic2f9de538c5b63958b0bbba5790bf00b52474dc4 --- loc_api/libloc_api_50001/loc.cpp | 31 +++++++++++++++++++++++++++++-- loc_api/libloc_api_50001/loc.h | 5 +++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index caa43d54..c35692e8 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -187,6 +187,7 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = }; static loc_eng_data_s_type loc_afw_data; +static UlpCallbacks ulp_cb_data; static int gss_fd = 0; /*=========================================================================== @@ -323,6 +324,17 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, loc_ulp_msg_sender); + if (ulp_cb_data.phone_context_cb) { + //ULP initilization already occurred so redo intializations here + //to restore callback table + loc_eng_ulp_phone_context_init(loc_afw_data, ulp_cb_data.phone_context_cb); + } + + if (ulp_cb_data.network_location_cb) { + loc_eng_ulp_network_init(loc_afw_data, ulp_cb_data.network_location_cb); + } + + int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); //Initialize the cached min_interval loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; @@ -1116,7 +1128,13 @@ SIDE EFFECTS static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) { ENTRY_LOG(); - int ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); + int ret_val = -1; + if (loc_afw_data.context) { + ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); + } else + { + ulp_cb_data.phone_context_cb = callbacks; + } EXIT_LOG(%d, ret_val); return ret_val; } @@ -1165,7 +1183,14 @@ SIDE EFFECTS static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) { ENTRY_LOG(); - int ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); + int ret_val = -1; + if (loc_afw_data.context) { + ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); + } else + { + ulp_cb_data.network_location_cb = callbacks; + } + EXIT_LOG(%d, ret_val); return ret_val; } @@ -1220,6 +1245,8 @@ static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks) EXIT_LOG(%d, retVal); return retVal; } + //Intilize the ulp call back cache at this point + memset(&ulp_cb_data, 0, sizeof(UlpCallbacks)); ulp_loc_cb = callbacks->location_cb; retVal = 0; EXIT_LOG(%d, retVal); diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index bdf05d57..51273ddf 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -77,6 +77,11 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; +typedef struct { + UlpNetworkLocationCallbacks* network_location_cb; + UlpPhoneContextCallbacks* phone_context_cb; +} UlpCallbacks; + enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, From deda0b3b41fe0bb7dd5dbfba1be87399d4da24bc Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 7 May 2013 17:14:05 -0700 Subject: [PATCH 113/945] Detect APQ8074 HW Detect APQ8074 Hardware so as to run in APQ mode. Choose target as TARGET_APQ8064_STANDALONE When hardware_platform=apq and SOC id is 126 GPS HAL needs to know so as to disable AGPS feature. Change-Id: Iabd95de6b401ff5fc72cfd32de6cea5250c19eb4 --- utils/loc_target.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index fb284b50..7b57c12c 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -45,11 +45,13 @@ #define MSM8930_ID_1 "142" #define MSM8930_ID_2 "116" #define APQ8030_ID_1 "157" +#define APQ8074_ID_1 "126" #define LINE_LEN 100 #define STR_LIQUID "Liquid" #define STR_SURF "Surf" #define STR_MTP "MTP" +#define STR_APQ "apq" #define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 @@ -105,6 +107,9 @@ targetEnumType get_target(void) else if((!memcmp(rd_id, APQ8030_ID_1, LENGTH(APQ8030_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8030_ID_1)]))) target = TARGET_APQ8030_STANDALONE; } + else if( (!memcmp(rd_hw_platform, STR_APQ, LENGTH(STR_APQ)) && IS_STR_END(rd_hw_platform[LENGTH(STR_APQ)])) && + (!memcmp(rd_id, APQ8074_ID_1, LENGTH(APQ8074_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8074_ID_1)])) ) + target = TARGET_APQ8064_STANDALONE; else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) target = TARGET_MPQ8064; else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || From 2fe7829e6d896ea2e3f509a02eecc78a2a173d81 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 20 May 2013 18:32:35 -0700 Subject: [PATCH 114/945] Detect APQ8074 HW, fixed Previously the SOC ID was incorrect. Corrected now. Change-Id: I49925d3bbffdac8db87524b3483054e93770d75d --- utils/loc_target.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 7b57c12c..92eaa45f 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -45,7 +45,7 @@ #define MSM8930_ID_1 "142" #define MSM8930_ID_2 "116" #define APQ8030_ID_1 "157" -#define APQ8074_ID_1 "126" +#define APQ8074_ID_1 "184" #define LINE_LEN 100 #define STR_LIQUID "Liquid" @@ -107,8 +107,7 @@ targetEnumType get_target(void) else if((!memcmp(rd_id, APQ8030_ID_1, LENGTH(APQ8030_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8030_ID_1)]))) target = TARGET_APQ8030_STANDALONE; } - else if( (!memcmp(rd_hw_platform, STR_APQ, LENGTH(STR_APQ)) && IS_STR_END(rd_hw_platform[LENGTH(STR_APQ)])) && - (!memcmp(rd_id, APQ8074_ID_1, LENGTH(APQ8074_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8074_ID_1)])) ) + else if (!memcmp(rd_id, APQ8074_ID_1, LENGTH(APQ8074_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8074_ID_1)])) target = TARGET_APQ8064_STANDALONE; else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) target = TARGET_MPQ8064; From a021ad35def2b459ab096d89a12dd337230a2284 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 1 May 2013 18:05:29 -0700 Subject: [PATCH 115/945] Update LOC API source and header files Updated LOC API source and header files since the new version had updated masks that were required for loc eng Change-Id: Ia0d57770a737ef6d05e881ac0512eb174e7c9fd1 --- loc_api/libloc_api_50001/loc.h | 3 +- loc_api/libloc_api_50001/loc_eng.cpp | 3 +- loc_api/loc_api_v02/loc_api_v02_client.c | 2 + loc_api/loc_api_v02/loc_api_v02_log.c | 6 +- loc_api/loc_api_v02/location_service_v02.c | 708 ++++---- loc_api/loc_api_v02/location_service_v02.h | 1785 ++++++++++---------- 6 files changed, 1306 insertions(+), 1201 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 51273ddf..e52ece47 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -96,7 +96,8 @@ typedef uint32_t LocPosTechMask; #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) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8fa87a0b..00ef79b8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1600,7 +1600,8 @@ static void loc_eng_deferred_action_thread(void* arg) ((LOCATION_HAS_SOURCE_INFO & rpMsg->location.gpsLocation.flags) && ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || - (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || + (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask) || + (LOC_POS_TECH_MASK_HYBRID & rpMsg->technology_mask)))) || (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && (gps_conf.ACCURACY_THRES != 0) && diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 882c5276..13befd02 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1647,6 +1647,8 @@ static bool validateRequest( case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: + case QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02: + case QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02: { noPayloadFlag = true; break; diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c index 769222b8..dc8092c2 100644 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -237,7 +237,11 @@ static loc_name_val_s_type loc_v02_event_name[] = NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02) + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02), }; static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c index c7ebd6db..e883c369 100644 --- a/loc_api/loc_api_v02/location_service_v02.c +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -26,13 +26,13 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 6.0 +/* This file was generated with Tool version 6.1 It requires encode/decode library version 5 or later - It was generated on: Thu Dec 13 2012 (Spin ) + It was generated on: Fri Mar 29 2013 (Spin 1) From IDL File: location_service_v02.idl */ #include "stdint.h" @@ -333,14 +333,6 @@ static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; -static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), @@ -357,7 +349,7 @@ static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), QMI_LOC_MAX_NTP_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 17, 0, + 16, 0, QMI_IDL_FLAG_END_VALUE }; @@ -376,7 +368,7 @@ static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 17, 0, + 16, 0, QMI_IDL_FLAG_END_VALUE }; @@ -396,7 +388,7 @@ static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 21, 0, + 20, 0, QMI_IDL_FLAG_END_VALUE }; @@ -558,32 +550,7 @@ static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 30, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), - 32, 0, + 29, 0, QMI_IDL_FLAG_END_VALUE }; @@ -646,6 +613,39 @@ static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), + 36, 0, + QMI_IDL_FLAG_END_VALUE +}; + static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), @@ -885,12 +885,17 @@ static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), 0x2C, QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed_valid)), + 0x2D, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) }; static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { @@ -953,7 +958,7 @@ static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), - 16, 0 + 35, 0 }; static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { @@ -961,20 +966,20 @@ static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 18, 0 + 17, 0 }; static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 19, 0, + 18, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 20, 0 + 19, 0 }; static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { @@ -1028,25 +1033,25 @@ static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 22, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 22, 0, + 21, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), - 22, 0, + 21, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), 0x13, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), - 22, 0 + 21, 0 }; static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { @@ -1104,37 +1109,15 @@ static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 23, 0 + 22, 0 }; -static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) -}; - -static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) -}; - -/* +/* * qmiLocGetServiceRevisionReqMsgT is empty * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1163,12 +1146,12 @@ static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 }; -/* +/* * qmiLocGetFixCriteriaReqMsgT is empty * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1239,7 +1222,7 @@ static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), - 16, 0 + 35, 0 }; static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { @@ -1284,12 +1267,12 @@ static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) }; -/* +/* * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1299,21 +1282,21 @@ static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 19, 0, + 18, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 20, 0 + 19, 0 }; -/* +/* * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1323,7 +1306,7 @@ static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 24, 0 + 23, 0 }; static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { @@ -1397,7 +1380,7 @@ static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { 0x1A, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 25, 0, + 24, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), 0x1B, @@ -1433,12 +1416,12 @@ static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) }; -/* +/* * qmiLocGetEngineLockReqMsgT is empty * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1462,12 +1445,12 @@ static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetSbasConfigReqMsgT is empty * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1491,12 +1474,12 @@ static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) }; -/* +/* * qmiLocGetNmeaTypesReqMsgT is empty * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1520,12 +1503,12 @@ static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) }; -/* +/* * qmiLocGetLowPowerModeReqMsgT is empty * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1617,7 +1600,7 @@ static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 26, 0, + 25, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), 0x11, @@ -1653,12 +1636,12 @@ static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) }; -/* +/* * qmiLocGetXtraTSessionControlReqMsgT is empty * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1675,13 +1658,13 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 27, 0, + 26, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 28, 0, + 27, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), 0x12, @@ -1689,7 +1672,7 @@ static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 29, 0, + 28, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), 0x13, @@ -1715,12 +1698,12 @@ static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) }; -/* +/* * qmiLocGetRegisteredEventsReqMsgT is empty * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1744,12 +1727,12 @@ static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) }; -/* +/* * qmiLocGetOperationModeReqMsgT is empty * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1788,13 +1771,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 31, 0, + 30, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 31, 0, + 30, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), 0x13, @@ -1810,13 +1793,13 @@ static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { 0x15, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), - 33, 0, + 37, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), 0x16, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), - 33, 0 + 37, 0 }; static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { @@ -1870,12 +1853,12 @@ static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) }; -/* +/* * qmiLocGetCradleMountConfigReqMsgT is empty * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1909,12 +1892,12 @@ static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetExternalPowerConfigReqMsgT is empty * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -1955,7 +1938,7 @@ static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 34, 0 + 31, 0 }; static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { @@ -2082,12 +2065,12 @@ static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) }; -/* +/* * qmiLocGetSensorControlConfigReqMsgT is empty * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2184,13 +2167,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2201,13 +2184,13 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 21, 0 + 20, 0 }; static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { @@ -2221,12 +2204,12 @@ static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) }; -/* +/* * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { * }; */ - + static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2241,13 +2224,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), 0x13, @@ -2258,13 +2241,13 @@ static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 21, 0, + 20, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 21, 0 + 20, 0 }; static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { @@ -2309,10 +2292,15 @@ static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), 0x12, QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) }; static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { @@ -2347,10 +2335,15 @@ static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), 0x12, QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) }; static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { @@ -2361,7 +2354,7 @@ static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { 0x02, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 35, 0, + 32, 0, 0x03, QMI_IDL_GENERIC_1_BYTE, @@ -2463,7 +2456,7 @@ static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 35, 0, + 32, 0, QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), 0x15, @@ -2683,7 +2676,7 @@ static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 36, 0 + 33, 0 }; static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { @@ -2720,7 +2713,7 @@ static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 37, 0, + 34, 0, 0x02, QMI_IDL_GENERIC_1_BYTE, @@ -2738,6 +2731,97 @@ static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) }; +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) +}; + +static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) +}; + +static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), + + 0x04, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) +}; + +static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) +}; + static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, @@ -2805,75 +2889,6 @@ static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) }; -static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), - ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) -}; - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) -}; - -static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), - - 0x04, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) -}; - -static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) -}; - /* Type Table */ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, @@ -2892,7 +2907,6 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, @@ -2908,12 +2922,13 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, + {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02} }; @@ -2942,8 +2957,6 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, - {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, - {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, {0, 0}, {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, {0, 0}, @@ -3052,18 +3065,20 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, + {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, + {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, + {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02}, {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, - {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, - {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02} + {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02} }; /* Predefine the Type Table Object */ @@ -3085,73 +3100,77 @@ static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { /*Arrays of service_message_table_entries for commands, responses and indications*/ static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02, QMI_IDL_TYPE16(1, 0), 0}, + {QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02, QMI_IDL_TYPE16(1, 2), 5}, {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 103}, {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 26), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 28), 1345}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 30), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 34), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 36), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 38), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 42), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 46), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 50), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 54), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 58), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 60), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 64), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 66), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 68), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 70), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 74), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 76), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 2063}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 80), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 90), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 53}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 94), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 98), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 102), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 106), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 110), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 114), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 124), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 126), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 128), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 130), 30}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 138), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 140), 0}, - {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 142), 46}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 132), 36}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 134), 33}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 136), 22} + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 22), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 26), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 28), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 30), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 34), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 36), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 38), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 42), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 46), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 50), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 54), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 58), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 60), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 64), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 66), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 68), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 70), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 74), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 76), 2063}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 80), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 88), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 90), 53}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 94), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 98), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 102), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 106), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 110), 16}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 114), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 122), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 124), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 126), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 128), 30}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 130), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 132), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 136), 46}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 138), 36}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 140), 33}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 142), 22} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02, QMI_IDL_TYPE16(1, 1), 8204}, + {QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02, QMI_IDL_TYPE16(1, 3), 115}, {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, @@ -3219,7 +3238,7 @@ static const qmi_idl_service_message_table_entry loc_service_response_messages_v }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 388}, + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 392}, {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, @@ -3233,71 +3252,71 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 25), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 27), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 29), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 31), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 33), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 35), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 43), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 47), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 51), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 55), 11}, - {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 7}, - {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 59), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 65), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 69), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 71), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 75), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 77), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 30}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 81), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 91), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 95), 60}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 103), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 107), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 111), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 115), 19}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 23), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 25), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 27), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 29), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 31), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 33), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 35), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 43), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 47), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 51), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 11}, + {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 55), 7}, + {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 59), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 65), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 69), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 71), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 75), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 77), 30}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 81), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 91), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 60}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 95), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 103), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 107), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 111), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 23}, {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 125), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 127), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 129), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, - {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 22), 15}, - {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 23), 4}, - {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 135), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 137), 7} + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 115), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 123), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 125), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 127), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 129), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, + {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 134), 15}, + {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 135), 4}, + {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 137), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 143), 7} }; /*Service Object*/ @@ -3305,24 +3324,23 @@ struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { 0x05, 0x02, 0x10, - 2248, + 8204, { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, &loc_qmi_idl_type_table_object_v02, - 0x12, + 0x14, NULL }; /* Service Object Accessor */ qmi_idl_service_object_type loc_get_service_object_internal_v02 ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) { return NULL; - } + } return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; } - diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h index 57f7c746..e6665c0d 100644 --- a/loc_api/loc_api_v02/location_service_v02.h +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -30,43 +30,43 @@ #define LOC_SERVICE_H /** @file location_service_v02.h - + @brief This is the public header file which defines the loc service Data structures. - This header file defines the types and structures that were defined in + This header file defines the types and structures that were defined in loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory always come before optionals in the structure), or nothing (null message) - + An optional element in a message is preceded by a uint8_t value that must be set to true if the element is going to be included. When decoding a received message, the uint8_t values will be set to true or false by the decode routine, and should be checked before accessing the values that they - correspond to. - + correspond to. + Variable sized arrays are defined as static sized arrays with an unsigned integer (32 bit) preceding it that must be set to the number of elements in the array that are valid. For Example: - + uint32_t test_opaque_len; uint8_t test_opaque[16]; - + If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. */ -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 6.0 +/* This file was generated with Tool version 6.1 It requires encode/decode library version 5 or later - It was generated on: Thu Dec 13 2012 (Spin ) + It was generated on: Fri Mar 29 2013 (Spin 1) From IDL File: location_service_v02.idl */ /** @defgroup loc_qmi_consts Constant values defined in the IDL */ @@ -86,24 +86,24 @@ extern "C" { #endif -/** @addtogroup loc_qmi_version - @{ - */ +/** @addtogroup loc_qmi_version + @{ + */ /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x12 +#define LOC_V02_IDL_MINOR_VERS 0x14 /** Major Version Number of the qmi_idl_compiler used to generate this file */ #define LOC_V02_IDL_TOOL_VERS 0x06 /** Maximum Defined Message ID */ #define LOC_V02_MAX_MESSAGE_ID 0x0072; -/** - @} +/** + @} */ -/** @addtogroup loc_qmi_consts - @{ +/** @addtogroup loc_qmi_consts + @{ */ /** Maximum string length for the Provider field in the application ID. */ @@ -115,7 +115,7 @@ extern "C" { /** Maximum string length for the Version field in the application ID. */ #define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 -/** Maximum length of the list containing the SVs that were used to generate +/** Maximum length of the list containing the SVs that were used to generate a position report. */ #define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 @@ -195,15 +195,15 @@ extern "C" { list. */ #define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 -/** Maximum value of WDMA frequency for injection of WCDMA cell - information */ +/** Maximum value of WDMA frequency for injection of WCDMA cell + information. */ #define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 -/** Maximum value of PSC for injection of WCDMA cell information */ +/** Maximum value of PSC for injection of WCDMA cell information. */ #define QMI_LOC_MAX_WCDMA_PSC_V02 511 -/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell - information */ +/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell + information. */ #define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 /** Maximum length of the injected network-initiated message. */ @@ -215,8 +215,8 @@ extern "C" { /** @addtogroup loc_qmi_messages @{ */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further processing or rejected. */ typedef struct { @@ -231,7 +231,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Informs the service of the minor revision of the interface +/** Request Message; Informs the service of the minor revision of the interface definition that the control point implements. */ typedef struct { @@ -245,13 +245,13 @@ typedef struct { */ typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report event indications. These reports are sent at a 1 Hz rate. */ #define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI Notify/Verify request event indications. */ #define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request event indications. */ @@ -266,12 +266,12 @@ typedef uint64_t qmiLocEventRegMaskT_v02; #define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request event indications. */ #define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the + GPS engine indicating its readiness to accept data from the sensors (accelerometer, gyroscope, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time sync requests from the GPS engine. Time sync enables the GPS engine to synchronize its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position Indicator (SPI) streaming report indications. */ #define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to @@ -279,81 +279,81 @@ typedef uint64_t qmiLocEventRegMaskT_v02; #define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is + affect Geofence, e.g., if GPS is turned off or if the network is unavailable. */ #define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters or leaves the perimeter of a Geofence. */ -#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. */ +#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. */ #define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. */ + control requests from the location engine. The location engine sends + this event to control the injection of motion data. */ /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to register for events from the +/** Request Message; Used by the control point to register for events from the location subsystem. */ typedef struct { /* Mandatory */ /* Event Registration Mask */ qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. + /**< Specifies the events that the control point is interested in receiving. + Valid bitmasks: + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request + event indications. - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. + event indications. - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. + event indications. - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. + event indications. - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to establish a connection with a location server. - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. + control requests from the location engine. The location engine sends + this event to control the injection of motion data. + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. */ }qmiLocRegEventsReqMsgT_v02; /* Message */ /** @@ -414,7 +414,7 @@ typedef struct { uint8_t applicationVersion_valid; /**< Specifies whether the application version string contains a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid + \item 0x00 (FALSE) -- Application version string is invalid \item 0x01 (TRUE) -- Application version string is valid \vspace{-0.18in} \end{itemize1} */ @@ -434,17 +434,17 @@ typedef struct { /* Mandatory */ /* Session ID */ uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 + - Range: 0 to 255 */ /* Optional */ /* Recurrence Type */ uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. + /**< Specifies the type of session in which the control point is interested. If this TLV is not specified, recurrence defaults to SINGLE. Valid values: \n @@ -457,7 +457,7 @@ typedef struct { uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. + If not specified, accuracy defaults to LOW. Valid values: \begin{itemize1} \item 0x00000001 -- LOW: Client requires low horizontal accuracy @@ -471,14 +471,14 @@ typedef struct { /* Enable/Disable Intermediate Reports */ uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. + intermediate reports. Valid values: \begin{itemize1} \item 0x00000001 -- ON: Client is interested in receiving intermediate @@ -496,7 +496,7 @@ typedef struct { /**< Minimum time interval, specified by the control point, that must elapse between position reports. \n - Units: Milliseconds \n - - Default: 1000 ms + - Default: 1000 ms */ /* Optional */ @@ -532,7 +532,10 @@ typedef uint32_t qmiLocPosTechMaskT_v02; #define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ #define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_AFLT_V02 ((qmiLocPosTechMaskT_v02)0x00000040) /**< AFLT was used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_HYBRID_V02 ((qmiLocPosTechMaskT_v02)0x00000080) /**< GNSS and network-provided measurements were used to generate the fix. */ /** @addtogroup loc_qmi_enums @{ @@ -616,7 +619,7 @@ typedef struct { qmiLocSensorUsageMaskT_v02 usageMask; /**< Specifies which sensors were used in calculating the position in the position report. - + Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SENSOR_USED_ ACCEL \item 0x00000002 -- SENSOR_USED_ GYRO @@ -647,7 +650,7 @@ typedef enum { eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data from multiple satellites. */ eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ @@ -658,7 +661,7 @@ typedef enum { eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). + eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from the system clock (better known as the slow clock); GNSS time is maintained irrespective of the GNSS receiver state */ QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocTimeSourceEnumT_v02; @@ -692,7 +695,7 @@ typedef struct { /* Session Status */ qmiLocSessionStatusEnumT_v02 sessionStatus; /**< Session status. - + Valid values: \begin{itemize1} \item 0x00000000 -- SESS_STATUS_ SUCCESS \item 0x00000001 -- SESS_STATUS_ IN_PROGRESS @@ -708,7 +711,7 @@ typedef struct { /* Mandatory */ /* Session ID */ uint8_t sessionId; - /**< ID of the session that was specified in the Start request + /**< ID of the session that was specified in the Start request QMI_LOC_START_REQ. \n - Range: 0 to 255 */ @@ -873,7 +876,7 @@ typedef struct { /* Magnetic Deviation */ uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown + /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic north is east of true north. */ @@ -882,21 +885,24 @@ typedef struct { uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ qmiLocPosTechMaskT_v02 technologyMask; /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_ LOCATION - \item 0x00000020 -- INJECTED_COARSE_ POSITION - \vspace{-0.18in} \end{itemize1} */ + Valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- WiFi access points were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix. + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to + generate the fix. + - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix. + - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to + generate the fix. + */ /* Optional */ /* Dilution of Precision */ uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ + /**< \vspace{0.06in} \n Dilution of precision associated with this position. */ /* Optional */ /* UTC Timestamp */ @@ -911,14 +917,14 @@ typedef struct { uint8_t leapSeconds; /**< Leap second information. If leapSeconds is not available, timestampUtc is calculated based on a hard-coded value - for leap seconds. \n + for leap seconds. \n - Units: Seconds */ /* Optional */ /* GPS Time */ uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and + /**< \vspace{0.06in} \n The number of weeks since Jan. 5, 1980, and milliseconds into the current week. */ /* Optional */ @@ -933,32 +939,32 @@ typedef struct { uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from the system clock (better known as the slow clock); GNSS time is maintained irrespective of the GNSS receiver state */ /* Optional */ /* Sensor Data Usage */ uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this + /**< \vspace{0.06in} \n Indicates whether sensor data was used in computing the position in this position report. */ /* Optional */ @@ -974,14 +980,24 @@ typedef struct { uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following + used for calculating this position report. The following information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} + \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 \item For QZSS: 193 to 197 \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Altitude Assumed */ + uint8_t altitudeAssumed_valid; /**< Must be set to true if altitudeAssumed is being passed */ + uint8_t altitudeAssumed; + /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Altitude is calculated + \item 0x01 (TRUE) -- Altitude is assumed; there may not be enough + satellites to determine the precise altitude + \vspace{-0.18in} \end{itemize1}*/ }qmiLocEventPositionReportIndMsgT_v02; /* Message */ /** @} @@ -1085,7 +1101,7 @@ typedef struct { */ qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n + /**< Indicates whether almanac and ephemeris information is available. \n Valid bitmasks: \n - 0x01 -- SVINFO_HAS_EPHEMERIS \n - 0x02 -- SVINFO_HAS_ALMANAC @@ -1116,9 +1132,9 @@ typedef struct { typedef struct { /* Mandatory */ - /* Altitude Source */ + /* Altitude Assumed */ uint8_t altitudeAssumed; - /**< Whether altitude is assumed or calculated: \begin{itemize1} + /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} \item 0x00 (FALSE) -- Valid altitude is calculated \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be enough satellites to determine precise altitude @@ -1129,7 +1145,7 @@ typedef struct { uint8_t svList_valid; /**< Must be set to true if svList is being passed */ uint32_t svList_len; /**< Must be set to # of elements in svList */ qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ + /**< \vspace{0.06in} \n SV information list. */ }qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ /** @} @@ -1212,7 +1228,7 @@ typedef enum { typedef struct { uint8_t posQosIncl; - /**< Whether quality of service is included:\n + /**< Indicates whether quality of service is included:\n - 0x01 (TRUE) -- QoS is included \n - 0x00 (FALSE) -- QoS is not included */ @@ -1260,7 +1276,7 @@ typedef struct { uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; /**< Requestor ID. \n - Type: Array of bytes \n - - Maximum array length: 200 + - Maximum array length: 200 */ uint16_t userRespTimerInSeconds; @@ -1367,7 +1383,7 @@ typedef struct { uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Formatted string. \n - Type: Byte array \n - - Maximum string length: 64 + - Maximum string length: 64 */ }qmiLocNiSuplFormattedStringStructT_v02; /* Type */ /** @@ -1385,7 +1401,7 @@ typedef uint8_t qmiLocSuplQopValidMaskT_v02; typedef struct { qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. + /**< Bit field indicating which fields are valid in this value. Valid bitmasks: \n - 0x01 -- QOP_HORZ_ACC_VALID \n @@ -1394,11 +1410,11 @@ typedef struct { - 0x08 -- QOP_DELAY_VALID*/ uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n + /**< Horizontal accuracy. \n - Units: Meters */ uint8_t verticalAccuracy; - /**< Vertical accuracy. \n + /**< Vertical accuracy. \n - Units: Meters */ uint16_t maxLocAge; @@ -1440,7 +1456,7 @@ typedef struct { uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; /**< IPV6 address. \n - - Type: Array of unsigned integers \n + - Type: Array of unsigned integers \n - Maximum length of the array: 8 */ uint32_t port; @@ -1474,7 +1490,7 @@ typedef struct { /**< URL. \begin{itemize1} \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 + \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} */ }qmiLocNiSuplServerInfoStructT_v02; /* Type */ @@ -1484,47 +1500,47 @@ typedef struct { typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; #define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ + is present in an NI SUPL Notify/Verify request event. This mask is set in + the valid_flags field of a Notify/Verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ #define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ + in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ /** @addtogroup loc_qmi_aggregates @{ */ typedef struct { qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. + /**< Indicates which of the following fields are present in this value. Valid bitmasks: \begin{itemize1} \item 0x00000001 -- SUPL_SERVER_INFO @@ -1543,18 +1559,18 @@ typedef struct { /**< SUPL server information. */ uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n - Maximum length of the array: 4 */ uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n + corrupted. \n - Type: Array of unsigned integers \n - Length of the array: 8 */ qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. + /**< GPS mode to be used for the fix. Valid values: \begin{itemize1} \item 0x00000001 -- AGPS_SETASSISTED @@ -1572,7 +1588,7 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Data coding scheme applies to both the requestor ID and the client - name. + name. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1598,11 +1614,11 @@ typedef struct { */ qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in + /**< Requestor ID. The encoding scheme for requestor_id is specified in the dataCodingScheme field. */ qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in + /**< Client name. The encoding scheme for client_name is specified in the dataCodingScheme field. */ qmiLocNiSuplQopStructT_v02 suplQop; @@ -1636,7 +1652,7 @@ typedef enum { typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. + /**< Identifies the coding scheme of the coded string. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1673,49 +1689,49 @@ typedef struct { */ typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ /** @addtogroup loc_qmi_aggregates @{ */ typedef struct { qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. + /**< Fields that are valid in this value. Valid bitmasks: \begin{itemize1} \item 0x0001 -- INVOKE_ID_MASK @@ -1735,7 +1751,7 @@ typedef struct { qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. + Applies to both the notification text and the client address. Valid values: \begin{itemize1} \item 0x0000000C -- NI_SS_GERMAN @@ -1764,17 +1780,17 @@ typedef struct { uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; /**< Notification text; the encoding method is specified in dataCodingScheme. \n - - Type: Array of bytes \n + - Type: Array of bytes \n - Maximum array length: 64 */ uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; /**< Client address; the encoding method is specified in - dataCodingScheme. \n + dataCodingScheme. \n - Maximum array length: 20 */ qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. + /**< Location type. Valid values: \begin{itemize1} \item 0x00000001 -- CURRENT_ LOCATION @@ -1784,7 +1800,7 @@ typedef struct { */ qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the + /**< Requestor ID; the encoding method is specified in the qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; @@ -1795,7 +1811,7 @@ typedef struct { /**< Service type ID. */ uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n + /**< Time to wait for the user to respond. \n - Units: Seconds */ }qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ /** @@ -1823,7 +1839,7 @@ typedef struct { /**< Ongoing NI session request; this information is currently not filled. */ qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. Valid values: \begin{itemize1} \item 0x00000001 -- ONGOING_NI_ INCOMING_MO @@ -1837,34 +1853,34 @@ typedef struct { typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; #define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ #define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed as part of multiple location ID in the SUPL_POS_INIT message. */ /** @addtogroup loc_qmi_enums @{ */ typedef enum { QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event triggered session. */ QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; @@ -1905,7 +1921,7 @@ typedef struct { qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; /**< Specifies the type of session trigger requested in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + SUPL_POS_INIT message (refer to \hyperref[S4]{[S4]}). Valid values: \begin{itemize1} \item 0xFFFFFFFF -- TRIGGER_TYPE_ SINGLE_SHOT @@ -1936,7 +1952,7 @@ typedef struct { typedef struct { char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< The ESLP URL + /**< ESLP URL. \n Maximum length: 255 bytes */ }qmiLocEmergencyNotificationStructT_v02; /* Type */ /** @@ -1946,13 +1962,13 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ +/** Indication Message; Indicates an NI Notify/Verify request to the control point. */ typedef struct { /* Mandatory */ /* Notification Type */ qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. + /**< Type of notification/verification performed. Valid values: \begin{itemize1} \item 0x00000001 -- NO_NOTIFY_NO_ VERIFY @@ -1967,41 +1983,42 @@ typedef struct { /* Network Initiated Vx Request */ uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ + /**< \vspace{0.06in} \n Optional NI Vx request payload. */ /* Optional */ /* Network Initiated SUPL Request */ uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ + /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ /* Optional */ /* Network Initiated UMTS Control Plane Request */ uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ + /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ /* Optional */ /* Network Initiated Service Interaction Request */ uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ + /**< \vspace{0.06in} \n Optional NI service interaction payload. */ /* Optional */ /* Network Initiated SUPL Version 2 Extension */ uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL + /**< \vspace{0.06in} \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL indication payload. */ /* Optional */ /* SUPL Emergency Notification */ uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< This specifies that the corresponding NI notification is an + /**< \vspace{0.06in} \n This specifies that the corresponding NI notification is an emergency notification. Emergency notification - can be given even without an ESLP address */ + can be given even without an Emergency SUPL Location Platform (ESLP) + address. */ }qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ /** @} @@ -2030,14 +2047,14 @@ typedef struct { uint32_t delayThreshold; /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n + exceeds this threshold. \n - Units: Milliseconds */ uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, the second one as secondary, and so on. \n - Maximum server list items: 3 */ }qmiLocTimeServerListStructT_v02; /* Type */ @@ -2055,7 +2072,7 @@ typedef struct { /* Time Server Info */ uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the + /**< \vspace{0.06in} \n Contains information about the time servers recommended by the location service for NTP time. */ }qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ /** @@ -2087,7 +2104,7 @@ typedef struct { /**< List of predicted orbits URLs. The list is ordered, so the client must use the first server specified in the list as the primary URL from which to download predicted orbits data, the second one as - secondary, and so on. \n + secondary, and so on. \n - Maximum number of servers that can be specified: 3 */ }qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ /** @@ -2103,13 +2120,13 @@ typedef struct { /* Mandatory */ /* Allowed Sizes */ qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ + /**< \vspace{0.06in} \n Maximum part and file size allowed to be injected in the engine. */ /* Optional */ /* Server List */ uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download + /**< \vspace{0.06in} \n List of servers that can be used by the client to download predicted orbits data. */ }qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ /** @@ -2186,7 +2203,7 @@ typedef struct { /* Mandatory */ /* Engine State */ qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. + /**< Location engine state. Valid values: \n - 0x00000001 -- ON \n @@ -2219,7 +2236,7 @@ typedef struct { /* Mandatory */ /* Session State */ qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. + /**< LOC fix session state. Valid values: \n - 0x00000001 -- STARTED \n @@ -2262,7 +2279,7 @@ typedef struct { /* Mandatory */ /* Request Type */ qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. + /**< Request type as specified in qmiWifiRequestEnumT. Valid values: \begin{itemize1} \item 0x00000000 -- START_PERIODIC_ HI_FREQ_FIXES @@ -2290,9 +2307,9 @@ typedef struct { uint16_t samplesPerBatch; /**< Specifies the number of samples per batch the GNSS location engine is to receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n - + samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n - + samplesPerBatch must be a nonzero positive value. */ @@ -2300,7 +2317,7 @@ typedef struct { /**< Number of sensor-data batches the GNSS location engine is to receive per second. The rate is specified in an integral number of batches per second (Hz). \vspace{-0.06in} \n - + batchesPerSecond must be a nonzero positive value. */ }qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ @@ -2314,7 +2331,7 @@ typedef struct { typedef struct { uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this + /**< Indicates whether the GNSS location engine is ready to accept data from this sensor. Valid values: \begin{itemize1} @@ -2338,7 +2355,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Notifies the control point if the GNSS location engine is +/** Indication Message; Notifies the control point if the GNSS location engine is ready to accept sensor data. */ typedef struct { @@ -2346,32 +2363,32 @@ typedef struct { /* Accelerometer Accept Ready */ uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept accelerometer sensor data. */ /* Optional */ /* Gyroscope Accept Ready */ uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor - data. + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept gyroscope sensor data. */ /* Optional */ /* Accelerometer Temperature Accept Ready */ uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - temperature data. + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept accelerometer temperature data. */ /* Optional */ /* Gyroscope Temperature Accept Ready */ uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope - temperature data. + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept gyroscope temperature data. */ }qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ /** @@ -2381,16 +2398,16 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Notifies the control point to inject time synchronization +/** Indication Message; Notifies the control point to inject time synchronization data. */ typedef struct { /* Mandatory */ /* Opaque Time Sync Reference Counter */ uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. This TLV must be echoed back in the Time Sync Inject request. */ }qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ /** @@ -2407,7 +2424,7 @@ typedef struct { /* Mandatory */ /* Enable/Disable SPI Requests */ uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream. + /**< Indicates whether the client is to start or stop sending an SPI status stream. \begin{itemize1} \item 0x01 (TRUE) -- Client is to start sending an SPI status stream \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream @@ -2424,6 +2441,7 @@ typedef enum { QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ + eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 = 2, /**< Bring up the WWAN type used for AGNSS Emergency connections. */ QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocWWANTypeEnumT_v02; /** @@ -2446,7 +2464,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Requests the client to open or close a connection +/** Indication Message; Requests the client to open or close a connection to the assisted GPS location server. */ typedef struct { @@ -2469,12 +2487,11 @@ typedef struct { /* WWAN Type */ qmiLocWWANTypeEnumT_v02 wwanType; /**< Identifies the WWAN type for this request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- WWAN_TYPE_ INTERNET - \item 0x00000001 -- WWAN_TYPE_ AGNSS - \vspace{-0.18in} \end{itemize1} - */ + Valid values: \n + - eQMI_LOC_WWAN_TYPE_INTERNET (0) -- Bring up the WWAN type used for an Internet connection. + - eQMI_LOC_WWAN_TYPE_AGNSS (1) -- Bring up the WWAN type used for AGNSS connections. + - eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY (2) -- Bring up the WWAN type used for AGNSS Emergency connections. + */ }qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ /** @} @@ -2505,7 +2522,7 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< ID of the Geofence for which this + /**< ID of the Geofence for which this notification was generated. */ /* Mandatory */ @@ -2529,7 +2546,7 @@ typedef struct { */ typedef enum { QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes cannot be used to monitor Geofences. */ eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can be used to monitor Geofences. */ @@ -2552,7 +2569,7 @@ typedef struct { /* Mandatory */ /* Geofence General Alert */ qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. + /**< Specifies the Geofence general alert type. Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_GEN_ ALERT_GNSS_UNAVAILABLE @@ -2721,7 +2738,7 @@ typedef struct { /* Mandatory */ /* Geofence ID */ uint32_t geofenceId; - /**< ID of the Geofence for which this + /**< ID of the Geofence for which this notification was generated. */ /* Mandatory */ @@ -2739,7 +2756,7 @@ typedef struct { /* Geofence Position */ uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< \n Position of the client when it breached the Geofence. + /**< \vspace{0.06in} \n Position of the client when it breached the Geofence. This TLV is included if the client configures the Geofence to report position. The position is reported at the same confidence level that was specified in the @@ -2752,17 +2769,17 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Recommends how pedometer reports should be - sent to the location engine */ +/** Indication Message; Recommends how pedometer reports are to be + sent to the location engine. */ typedef struct { /* Mandatory */ /* Request Pedometer Data */ uint8_t requestPedometerData; - /**< \n Whether GNSS location engine is requesting the client to + /**< Indicates whether the GNSS location engine is requesting the client to send pedometer data. \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting + \item 0x01 (TRUE) -- GNSS location engine is requesting pedometer data \item 0x00 (FALSE) -- GNSS location engine is not requesting pedometer data @@ -2773,19 +2790,19 @@ typedef struct { /* Reset Step Count */ uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ uint8_t resetStepCount; - /**< Whether location engine desires the step count to be reset. + /**< Indicates whether the location engine is to reset the step count. \begin{itemize1} - \item 0x01 (TRUE) -- Pedometer step count should be reset. - \item 0x00 (FALSE) -- Pedometer step count should not be reset. + \item 0x01 (TRUE) -- Pedometer step count is to be reset. + \item 0x00 (FALSE) -- Pedometer step count is not to be reset. \vspace{-0.18in} \end{itemize1} */ /* Optional */ /* Step Count Threshold */ uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ uint32_t stepCountThreshold; - /**< Specifies the number of steps to be sampled in a pedometer report - as recommended by the the location engine. If the threshold is set to 0 - then the location engine desires a pedometer report at every step event. + /**< Specifies the number of steps to be sampled in a pedometer report, + as recommended by the the location engine. If the threshold is set to 0, + the location engine wants a pedometer report at every step event. */ }qmiLocEventPedometerControlIndMsgT_v02; /* Message */ /** @@ -2795,19 +2812,19 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Recommends how motion data reports should be - sent to the location engine */ +/** Indication Message; Recommends how motion data reports are to be + sent to the location engine. */ typedef struct { /* Mandatory */ /* Request Motion Data */ uint8_t requestMotionData; - /**< \n Whether GNSS location engine is requesting the client to - send motion data. + /**< Indicates whether the GNSS location engine is requesting + the client to send motion data. \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting + \item 0x01 (TRUE) -- GNSS location engine is requesting motion data - \item 0x00 (FALSE) -- GNSS location engine is not requesting + \item 0x00 (FALSE) -- GNSS location engine is not requesting motion data \vspace{-0.18in} \end{itemize1} */ @@ -2852,7 +2869,7 @@ typedef struct { /* Mandatory */ /* Get Revision Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. + /**< Status of the Get Revision request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -2869,7 +2886,7 @@ typedef struct { /* Interface Definition Minor Revision */ uint32_t revision; /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always + the service implements. Minor revision updates of the service are always backward compatible. */ /* Optional */ @@ -2881,7 +2898,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 128 \vspace{0.1in} \end{itemize1} - + \textbf{Note:} This string is only provided on platforms that have a measurement engine that supports this version string. On all other platforms, this optional TLV is not provided. */ @@ -2895,7 +2912,7 @@ typedef struct { \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 128 \vspace{0.1in}\end{itemize1} - + \textbf{Note:} This string is only provided on hosted architectures (measurement and position engine running on different processors) that support this version string. On all other platforms, this optional TLV @@ -2930,7 +2947,7 @@ typedef struct { /* Mandatory */ /* Get Fix Criteria Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. + /**< Status of the Get Fix Criteria request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -2961,10 +2978,10 @@ typedef struct { uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving + The client must explicitly set this field to OFF to stop receiving intermediate position reports. Intermediate position reports are generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the + are turned ON, the client receives position reports even if the accuracy criteria is not met. The status in the position report is set to IN_PROGRESS for intermediate reports. @@ -2987,7 +3004,7 @@ typedef struct { /* ID of the Application that Sent the Position Request */ uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ + /**< \vspace{0.06in} \n Application provider, name, and version.*/ }qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ /** @} @@ -2998,9 +3015,9 @@ typedef struct { */ typedef enum { QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted the Notify/Verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied the Notify/Verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to the Notify/Verify request. */ QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocNiUserRespEnumT_v02; /** @@ -3017,7 +3034,7 @@ typedef struct { /* Mandatory */ /* User Response */ qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. + /**< User accepted or denied. Valid values: \begin{itemize1} \item 0x00000001 -- NOTIFY_VERIFY_ ACCEPT @@ -3029,7 +3046,7 @@ typedef struct { /* Mandatory */ /* Notification Type */ qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. + /**< Type of notification/verification performed. Valid values: \begin{itemize1} \item 0x00000001 -- NO_NOTIFY_NO_ VERIF @@ -3044,37 +3061,37 @@ typedef struct { /* Network Initiated Vx Request */ uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ + /**< \vspace{0.06in} \n Optional NI VX request payload. */ /* Optional */ /* Network Initiated SUPL Request */ uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ + /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ /* Optional */ /* Network Initiated UMTS Control Plane Request */ uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ + /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ /* Optional */ /* Network Initiated Service Interaction Request */ uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ + /**< \vspace{0.06in} \n Optional NI service interaction payload. */ /* Optional */ /* Network Initiated SUPL Version 2 Extension */ uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \n Optional SUPL Version 2 Extension payload. */ + /**< \vspace{0.06in} \n Optional SUPL Version 2 Extension payload. */ /* Optional */ /* SUPL Emergency Notification */ uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< SUPL Emergency notification payload. Emergency notification + /**< \vspace{0.06in} \n SUPL emergency notification payload. Emergency notification can be given even without an ESLP address */ }qmiLocNiUserRespReqMsgT_v02; /* Message */ /** @@ -3091,7 +3108,7 @@ typedef struct { /* Mandatory */ /* NI User Response Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. + /**< Status of the NI User Response request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3148,15 +3165,15 @@ typedef struct { uint32_t partData_len; /**< Must be set to # of elements in partData */ char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 + - Type: Array of bytes \n + - Maximum length of the array: 1024 */ /* Optional */ /* Format Type */ uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. + /**< Predicted orbits data format. Valid values: \begin{itemize1} \item 0x00000000 -- PREDICTED_ ORBITS_XTRA @@ -3215,7 +3232,7 @@ typedef struct { /* Mandatory */ /* Predicted Orbits Data Source Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. + /**< Status of the query request for a predicted orbits data source. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3258,12 +3275,12 @@ typedef struct { uint64_t startTimeInUTC; /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) + - Units: Seconds (since Jan. 1, 1970) */ uint16_t durationHours; /**< Duration from the start time for which the data is valid.\n - - Units: Hours + - Units: Hours */ }qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ /** @@ -3279,7 +3296,7 @@ typedef struct { /* Mandatory */ /* Predicted Orbits Data Validity Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. + /**< Status of the query request for predicted orbits data validity. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3332,7 +3349,7 @@ typedef struct { /* Mandatory */ /* UTC Time Injection Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. + /**< Status of the UTC Time Injection request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3394,7 +3411,7 @@ typedef enum { eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal position coordinates only. */ eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal + regardless of horizontal position (within the horizontal uncertainty region, if provided). */ QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocAltSrcUncertaintyCoverageEnumT_v02; @@ -3408,7 +3425,7 @@ typedef enum { typedef struct { qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. + /**< Specifies the source of the altitude. Valid values: \begin{itemize1} \item 0x00000000 -- ALT_SRC_ UNKNOWN @@ -3425,8 +3442,8 @@ typedef struct { */ qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. + /**< Specifies the dependency between the horizontal and + altitude position components. Valid values: \begin{itemize1} \item 0x00000000 -- SRC_LINKAGE_ NOT_SPECIFIED @@ -3437,7 +3454,7 @@ typedef struct { */ qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. + /**< Specifies the region of uncertainty. Valid values: \begin{itemize1} \item 0x00000000 -- UNCERTAINTY_ NOT_SPECIFIED @@ -3587,7 +3604,7 @@ typedef struct { /* Vertical Reliability */ uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. + /**< Specifies the reliability of the vertical position. Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET @@ -3602,7 +3619,7 @@ typedef struct { /* Altitude Source Info */ uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ + /**< \vspace{0.06in} \n Specifies information regarding the altitude source. */ /* Optional */ /* UTC Timestamp */ @@ -3634,11 +3651,11 @@ typedef struct { \item 0x00000006 -- eQMI_LOC_ POSITION_SRC_OTHER \end{itemize1} \vspace{0.05in} - If altitude is specified and the altitude source is not specified, the engine + If altitude is specified and the altitude source is not specified, the engine assumes that the altitude was obtained using the specified position source. \n If both altitude and altitude source are specified, the engine assumes that only latitude and longitude were obtained using the specified position - source. + source. */ }qmiLocInjectPositionReqMsgT_v02; /* Message */ /** @@ -3695,14 +3712,14 @@ typedef struct { /* Mandatory */ /* Lock Type */ qmiLocLockEnumT_v02 lockType; - /**< Type of lock. + /**< Type of lock. Valid values: \n - 0x00000001 -- LOCK_NONE \n - 0x00000002 -- LOCK_MI \n - 0x00000003 -- LOCK_MT \n - 0x00000004 -- LOCK_ALL - + */ }qmiLocSetEngineLockReqMsgT_v02; /* Message */ /** @@ -3750,7 +3767,7 @@ typedef struct { /* Mandatory */ /* Get Engine Lock Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. + /**< Status of the Get Engine Lock request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3767,7 +3784,7 @@ typedef struct { /* Lock Type */ uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ qmiLocLockEnumT_v02 lockType; - /**< Type of lock. + /**< Type of lock. Valid values: \n - 0x00000001 -- LOCK_NONE \n @@ -3789,7 +3806,7 @@ typedef struct { /* Mandatory */ /* SBAS Config */ uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. + /**< Indicates whether SBAS configuration is enabled. \begin{itemize1} \item 0x01 (TRUE) -- SBAS configuration is enabled \item 0x00 (FALSE) -- SBAS configuration is disabled @@ -3808,7 +3825,7 @@ typedef struct { /* Mandatory */ /* Set SBAS Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. + /**< Status of the Set SBAS Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3840,7 +3857,7 @@ typedef struct { /* Mandatory */ /* Get SBAS Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. + /**< Status of the Get SBAS Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3857,7 +3874,7 @@ typedef struct { /* SBAS Config */ uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. + /**< Indicates whether SBAS configuration is enabled. \begin{itemize1} \item 0x01 (TRUE) -- SBAS configuration is enabled \item 0x00 (FALSE) -- SBAS configuration is disabled @@ -3893,7 +3910,7 @@ typedef struct { - 0x00000008 -- NMEA_MASK_GSA \n - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ /** @@ -3909,7 +3926,7 @@ typedef struct { /* Mandatory */ /* Set NMEA Types Status */ qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. + /**< Status of Set NMEA Types request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3941,7 +3958,7 @@ typedef struct { /* Mandatory */ /* Get NMEA Types Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. + /**< Status of the Get NMEA Types request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -3958,7 +3975,7 @@ typedef struct { /* NMEA Sentence Types */ uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. + /**< NMEA types to enable. Valid bitmasks: \n - 0x0000ffff -- NMEA_MASK_ALL \n @@ -3968,7 +3985,7 @@ typedef struct { - 0x00000008 -- NMEA_MASK_GSA \n - 0x00000010 -- NMEA_MASK_VTG \n - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS + - 0x00000040 -- NMEA_MASK_PSTIS */ }qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ /** @@ -3984,7 +4001,7 @@ typedef struct { /* Mandatory */ /* Enable Low Power Mode */ uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n + /**< Indicates whether to enable Low Power mode:\n - 0x01 (TRUE) -- Enable LPM \n - 0x00 (FALSE) -- Disable LPM */ }qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ @@ -4001,7 +4018,7 @@ typedef struct { /* Mandatory */ /* Set LPM Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. + /**< Status of the Set Low Power Mode request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4033,7 +4050,7 @@ typedef struct { /* Mandatory */ /* Get LPM Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. + /**< Status of the Get LPM request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4050,7 +4067,7 @@ typedef struct { /* Enable/Disable LPM */ uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n + /**< Indicates whether to enable Low Power mode:\n - 0x01 (TRUE) -- Enable LPM \n - 0x00 (FALSE) -- Disable LPM */ }qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ @@ -4082,7 +4099,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. + /**< Type of server. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4095,13 +4112,13 @@ typedef struct { /* IPV4 Address */ uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ + /**< \vspace{0.06in} \n IPV4 address and port. */ /* Optional */ /* IPV6 Address */ uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ + /**< \vspace{0.06in} \n IPV6 address and port. */ /* Optional */ /* Uniform Resource Locator */ @@ -4153,7 +4170,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. + /**< Type of server, as defined in qmiLocServerTypeEnumT. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4168,7 +4185,7 @@ typedef struct { qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; /**< Type of address the client wants. If unspecified, the indication will contain all the types of addresses - it has for the specified server type. + it has for the specified server type. Valid bitmasks: \n - 0x01 -- IPV4 \n @@ -4189,7 +4206,7 @@ typedef struct { /* Mandatory */ /* Get Server Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. + /**< Status of the Get Server request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4205,7 +4222,7 @@ typedef struct { /* Mandatory */ /* Server Type */ qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. + /**< Type of server, as defined in qmiLocServerTypeEnumT. Valid values: \n - 0x00000001 -- CDMA_PDE \n @@ -4218,13 +4235,13 @@ typedef struct { /* IPV4 Address */ uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ + /**< \vspace{0.06in} \n IPV4 address and port. */ /* Optional */ /* IPV6 Address */ uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ + /**< \vspace{0.06in} \n IPV6 address and port. */ /* Optional */ /* Uniform Resource Locator */ @@ -4232,7 +4249,7 @@ typedef struct { char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; /**< URL. \begin{itemize1} - \item Type: NULL-terminated string + \item Type: NULL-terminated string \item Maximum string length (including NULL terminator): 256 \vspace{-0.18in} \end{itemize1} */ @@ -4295,7 +4312,7 @@ typedef struct { uint16_t gnssSvId; /**< SV ID of the satellite whose data is to be deleted. \begin{itemize1} - \item Range: \begin{itemize1} + \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 @@ -4318,7 +4335,7 @@ typedef struct { is to be deleted. \n Valid values: \n - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC + - 0x02 -- DELETE_ALMANAC */ }qmiLocDeleteSvInfoStructT_v02; /* Type */ /** @@ -4328,19 +4345,19 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; This command is used to delete the location engine +/** Request Message; This command is used to delete the location engine assistance data */ typedef struct { /* Mandatory */ /* Delete All */ uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. + /**< Indicates whether all assistance data is to be deleted. Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this message are ignored \item 0x00 (FALSE) -- The optional fields in the message are to be used to determine which data is to be deleted @@ -4351,14 +4368,14 @@ typedef struct { uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assistance data is to be deleted. + /**< \vspace{0.06in} \n List of satellites for which the assistance data is to be deleted. */ /* Optional */ /* Delete GNSS Data */ uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. + /**< Mask for the GNSS data that is to be deleted. Valid values: \begin{itemize1} \item 0x00000001 -- DELETE_GPS_SVDIR @@ -4431,14 +4448,14 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; This command is used to delete the location engine +/** Indication Message; This command is used to delete the location engine assistance data */ typedef struct { /* Mandatory */ /* Delete Assist Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. + /**< Status of the Delete Assist Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4464,7 +4481,7 @@ typedef struct { /* Mandatory */ /* Enable XTRA-T */ uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n + /**< Indicates whether to enable XTRA-T:\n - 0x01 (TRUE) -- Enable XTRA-T \n - 0x00 (FALSE) -- Disable XTRA-T */ }qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ @@ -4481,7 +4498,7 @@ typedef struct { /* Mandatory */ /* Set XTRA-T Session Control Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. + /**< Status of the Set XTRA-T Session Control request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4514,7 +4531,7 @@ typedef struct { /* Mandatory */ /* Get XTRA-T Session Control Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. + /**< Status of the Get XTRA-T Session Control request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4531,7 +4548,7 @@ typedef struct { /* Enable/Disable XTRA-T */ uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n + /**< Indicates whether to enable XTRA-T:\n - 0x01 (TRUE) -- Enable XTRA-T \n - 0x00 (FALSE) -- Disable XTRA-T */ }qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ @@ -4545,8 +4562,8 @@ typedef struct { typedef struct { uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are synchronized. */ }qmiLocWifiFixTimeStructT_v02; /* Type */ /** @@ -4585,7 +4602,7 @@ typedef struct { double lon; /**< WiFi position longitude. \n - - Type: Floating point \n + - Type: Floating point \n - Units: Degrees */ uint16_t hepe; @@ -4596,10 +4613,10 @@ typedef struct { /**< Number of Access Points (AP) used to generate a fix. */ qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position + /**< WiFi position error code; set to 0 if the fix succeeds. This position is only used by a module if the value is 0. If there was a failure, the error code provided by the WiFi positioning system can be provided - here. + here. Valid values: \begin{itemize1} \item 0x00000000 -- ERROR_SUCCESS @@ -4627,7 +4644,7 @@ typedef uint8_t qmiLocWifiApQualifierMaskT_v02; typedef struct { uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n + /**< Associated MAC address of the AP. \n - Type: Array of unsigned integers \n - Address length: 6 */ @@ -4640,7 +4657,7 @@ typedef struct { /**< WiFi channel on which a beacon was received. */ qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. + /**< A bitmask of Boolean qualifiers for APs. All unused bits in this mask must be set to 0. Valid values: \n @@ -4664,26 +4681,26 @@ typedef struct { /* WiFi Fix Time */ uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ + /**< \vspace{0.06in} \n Time of WiFi position fix. */ /* Optional */ /* WiFi Position */ uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ + /**< \vspace{0.06in} \n WiFi position fix. */ /* Optional */ /* WiFi Access Point Information */ uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ + /**< \vspace{0.06in} \n AP scan list. */ /* Optional */ /* Horizontal Reliability */ uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. + /**< Specifies the reliability of the horizontal position. Valid values: \begin{itemize1} \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET @@ -4707,7 +4724,7 @@ typedef struct { /* Mandatory */ /* Inject WiFi Position Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. + /**< Status of the Inject WiFi Position request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4746,7 +4763,7 @@ typedef struct { /* Mandatory */ /* Availablility of WiFi */ qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. + /**< WiFi status information. Valid values: \begin{itemize1} \item 0x00000001 -- WIFI_STATUS_ AVAILABLE @@ -4767,7 +4784,7 @@ typedef struct { /* Mandatory */ /* Status of Notify WiFi Status Request */ qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. + /**< Status of the Notify WiFi Status request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4800,7 +4817,7 @@ typedef struct { /* Mandatory */ /* Get Registered Events Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. + /**< Status of the Get Registered Events request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4817,55 +4834,55 @@ typedef struct { /* Event Registration Mask */ uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. + /**< Event registration mask. Valid bitmasks: \n - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request + event indications. - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. + event indications. - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. + event indications. - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. + event indications. - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. + event indications. - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. + event indications. - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server requests. These requests are generated when the service wishes to establish a connection with a location server. - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. + control requests from the location engine. The location engine sends + this event to control the injection of motion data. */ }qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ /** @@ -4902,7 +4919,7 @@ typedef struct { /* Mandatory */ /* Operation Mode */ qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. + /**< Preferred operation mode. \label{operationMode} Valid values: \begin{itemize1} @@ -4930,8 +4947,8 @@ typedef struct { /* Mandatory */ /* Set Operation Mode Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - + /**< Status of the Set Operation Mode request. + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE @@ -4962,7 +4979,7 @@ typedef struct { /* Mandatory */ /* Get Operation Mode Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. + /**< Status of the Get Operation Mode request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -4979,7 +4996,7 @@ typedef struct { /* Operation Mode */ uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. + /**< Current operation mode. Valid values: \begin{itemize1} \item 0x00000001 -- OPER_MODE_ DEFAULT @@ -5005,7 +5022,7 @@ typedef struct { /* Mandatory */ /* Stationary Status */ uint8_t stationary; - /**< Whether the device is stationary: + /**< Indicates whether the device is stationary: \begin{itemize1} \item 0x00 (FALSE) -- Device is not stationary \item 0x01 (TRUE) -- Device is stationary @@ -5015,7 +5032,7 @@ typedef struct { /* Confidence */ uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n + /**< Confidence in the Stationary state expressed as a percentage.\n - Range: 0 to 100 */ }qmiLocSetSpiStatusReqMsgT_v02; /* Message */ /** @@ -5059,9 +5076,9 @@ typedef uint8_t qmiLocSensorDataFlagMaskT_v02; */ typedef enum { QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified */ - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and - the location engine */ + eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified. */ + eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and + the location engine. */ QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSensorDataTimeSourceEnumT_v02; /** @@ -5074,8 +5091,8 @@ typedef enum { typedef struct { uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor data sample.\n + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor data sample.\n - Units: Milliseconds */ float xAxis; @@ -5084,12 +5101,12 @@ typedef struct { - Units Gyroscope: ( (rads)/(seconds) ) */ float yAxis; - /**< Sensor y-axis sample. \n + /**< Sensor y-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - Units Gyroscope: ( (rads)/(seconds) ) */ float zAxis; - /**< Sensor z-axis sample. \n + /**< Sensor z-axis sample. \n - Units Accelerometer: ( (meters)/(seconds^2) ) \n - Units Gyroscope: ( (rads)/(seconds) ) */ }qmiLoc3AxisSensorSampleStructT_v02; /* Type */ @@ -5103,14 +5120,14 @@ typedef struct { typedef struct { uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message.The timestamp is in the time reference scale that is - used by the sensor time source.\n + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message.The timestamp is in the time reference scale that is + used by the sensor time source.\n - Units: Milliseconds */ qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. Valid bitmasks: \begin{itemize1} \item 0x01 -- SIGN_REVERSAL @@ -5132,16 +5149,15 @@ typedef struct { typedef struct { uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor sample.\n - - Type: Unsigned integer \n + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor sample.\n - Units: Milliseconds */ float temperature; /**< Sensor temperature. \n - Type: Floating point \n - - Units: Degree Celsius \n - - Range: -50 to +100.00 Degree Celsius */ + - Units: Degrees Celsius \n + - Range: -50 to +100.00 */ }qmiLocSensorTemperatureSampleStructT_v02; /* Type */ /** @} @@ -5154,18 +5170,17 @@ typedef struct { qmiLocSensorDataTimeSourceEnumT_v02 timeSource; /**< Denotes the time source of the sensor data. Location service will use - this field to identify the time reference used in the + this field to identify the time reference used in the sensor data timestamps. Values :\n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine. */ uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message. The timestamp is in the time reference scale that is - used by the sensor time source.\n - - Type: Unsigned integer \n + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message. The timestamp is in the time reference scale that is + used by the sensor time source.\n - Units: Milliseconds */ uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ @@ -5189,59 +5204,61 @@ typedef struct { uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ uint32_t opaqueIdentifier; /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the + in the indication so the client can relate the indication to the request. */ /* Optional */ /* 3-Axis Accelerometer Data */ uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ + /**< \vspace{0.06in} \n Accelerometer sensor samples. */ /* Optional */ /* 3-Axis Gyroscope Data */ uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyroscope sensor samples. */ + /**< \vspace{0.06in} \n Gyroscope sensor samples. */ /* Optional */ /* 3-Axis Accelerometer Data Time Source */ uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; - /**< Time source for the 3-axis accelerometer data. Location service will use + /**< Time source for the 3-axis accelerometer data. The location service uses this field to identify the time reference used in the accelerometer data - timestamps. If not specified the location service will assume that the - time source for the accelereometer data is unknown. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine + timestamps. If not specified, the location service assumes that the + time source for the accelereometer data is unknown. \n + Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine. */ /* Optional */ /* 3-Axis Gyroscope Data Time Source */ uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; - /**< Time source for the 3-axis gyroscope data. Location service will use - this field to identify the time reference used in the gyroscope data - timestamps.If not specified the locations ervice will assume that the - time source for the gyroscope data is unknown. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine + /**< Time source for the 3-axis gyroscope data. The location service uses + this field to identify the time reference used in the gyroscope data + timestamps. If not specified, the location service assumes that the + time source for the gyroscope data is unknown. \n + Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine. */ /* Optional */ /* Accelerometer Temperature Data */ uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; - /**< Accelerometer temperature samples. This data is optional and does not + /**< \vspace{0.06in} \nAccelerometer temperature samples. This data is optional and does not have to be included in the message along with accelerometer data. */ /* Optional */ /* Gyroscope Temperature Data */ uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; - /**< Gyroscope temperature samples. This data is optional and does not + /**< \vspace{0.06in} \n Gyroscope temperature samples. This data is optional and does not have to be included in the message along with gyroscope data. */ }qmiLocInjectSensorDataReqMsgT_v02; /* Message */ /** @@ -5258,7 +5275,7 @@ typedef struct { /* Mandatory */ /* Inject Sensor Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. + /**< Status of the Inject Sensor Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -5282,7 +5299,7 @@ typedef struct { /* Accelerometer Samples Accepted */ uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples + /**< Lets the client know how many 3-axis accelerometer samples were accepted. This field is present only if the accelerometer samples were sent in the request. */ @@ -5290,15 +5307,15 @@ typedef struct { /* Gyroscope Samples Accepted */ uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were + /**< Lets the client know how many 3-axis gyroscope samples were accepted. This field is present only if the gyroscope samples were sent in the request. */ /* Optional */ - /* Accelerometer Samples Accepted */ + /* Accelerometer Temperature Samples Accepted */ uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ uint8_t accelTemperatureSamplesAccepted; - /**< This field lets the client know how many accelerometer temperature + /**< Lets the client know how many accelerometer temperature samples were accepted. This field is present only if the accelerometer temperature samples were sent in the request. */ @@ -5306,7 +5323,7 @@ typedef struct { /* Gyroscope Temperature Samples Accepted */ uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ uint8_t gyroTemperatureSamplesAccepted; - /**< This field lets the client know how many gyroscope temperature samples + /**< Lets the client know how many gyroscope temperature samples were accepted. This field is present only if the gyroscope temperature samples were sent in the request. */ }qmiLocInjectSensorDataIndMsgT_v02; /* Message */ @@ -5331,7 +5348,7 @@ typedef struct { uint32_t sensorProcRxTime; /**< Value of the sensor time when the control point received the Time Sync Inject request from the GNSS location engine. - + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n - Units: Milliseconds */ @@ -5339,8 +5356,8 @@ typedef struct { /* Mandatory */ /* Sensor Transmit Time */ uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 millisecond, never stopping until the process is rebooted.\n @@ -5359,7 +5376,7 @@ typedef struct { /* Mandatory */ /* Inject Time Sync Data Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. + /**< Status of the Inject Time Sync Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -5399,14 +5416,14 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the current +/** Indication Message; Used by the control point to get the current cradle mount configuration. */ typedef struct { /* Mandatory */ /* Get Cradle Mount Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. + /**< Status of the Get Cradle Mount Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -5446,7 +5463,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to set the current +/** Request Message; Used by the control point to set the current cradle mount configuration. */ typedef struct { @@ -5475,7 +5492,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to set the current +/** Indication Message; Used by the control point to set the current cradle mount configuration. */ typedef struct { @@ -5522,14 +5539,14 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the current +/** Indication Message; Used by the control point to get the current external power configuration. */ typedef struct { /* Mandatory */ /* Get Ext Power Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. + /**< Status of the Get External Power Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -5562,7 +5579,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to set the current +/** Request Message; Used by the control point to set the current external power configuration. */ typedef struct { @@ -5585,14 +5602,14 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to set the current +/** Indication Message; Used by the control point to set the current external power configuration. */ typedef struct { /* Mandatory */ /* Set Ext Power Config Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. + /**< Status of the Set External Power Configuration request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -5667,10 +5684,10 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ typedef struct { /* Mandatory */ @@ -5705,7 +5722,7 @@ typedef struct { /* APN Profile */ uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n Access Point Name (APN) profile information is present only when + /**< \vspace{0.06in} \n Access Point Name (APN) profile information is present only when requestType is OPEN and statusType is SUCCESS. */ }qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ /** @@ -5715,10 +5732,10 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ typedef struct { /* Mandatory */ @@ -5774,15 +5791,15 @@ typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ #define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set in the LPP configuration for this to take effect. */ /** @addtogroup loc_qmi_enums @{ */ typedef enum { QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA1 Hash Algorithm for SUPL Version 2.0 or higher */ - eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ + eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA-1 hash algorithm for SUPL version 2.0 or later. */ + eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 hash algorithm for SUPL version 2.0 or later. */ QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSuplHashAlgoEnumT_v02; /** @@ -5794,8 +5811,8 @@ typedef enum { */ typedef enum { QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS Version 1.0 */ - eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS Version 1.1 */ + eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS version 1.0. */ + eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS version 1.1. */ QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocSuplTlsVersionEnumT_v02; /** @@ -5807,8 +5824,8 @@ typedef enum { */ typedef enum { QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< use Control plane protocol during emergency while on WCDMA */ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< use SUPL 2.0 emergency services during emergency while on WCDMA */ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< Use Control Plane protocol during an emergency while on WCDMA. */ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< Use SUPL 2.0 emergency services during an emergency while on WCDMA. */ QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocEmergencyProtocolEnumT_v02; /** @@ -5818,7 +5835,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to configure parameters stored +/** Request Message; Used by the control point to configure parameters stored in the nonvolatile memory. */ typedef struct { @@ -5850,7 +5867,7 @@ typedef struct { qmiLocSuplVersionEnumT_v02 suplVersion; /**< SUPL version. - Valid values: \n + Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ @@ -5871,48 +5888,48 @@ typedef struct { /* Assisted GLONASS Protocol Mask */ uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports + /**< Configures the protocols that the location service supports for assisted GLONASS. Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set + in the LPP configuration for this to take effect. */ /* Optional */ /* SUPL Hash Algorithm */ uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + /**< SUPL hash algorithm to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later. + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later. */ /* Optional */ /* SUPL TLS Version */ uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL TLS (Transport Layer Security) Version. This configuration is only - applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + /**< SUPL Transport Layer Security (TLS) version. This configuration is only + applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0. + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1. */ /* Optional */ /* Emergency Protocol */ uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< Configures the protocol to be used during emergency. - Note: Currently only can select on WCDMA. FOR GSM and 1x UE - will always allow only Control plane NI trigger for positioning. - For LTE, UE Can allow either SUPL or Control plane NI trigger. + /**< Configures the protocol to be used during emergency. \n + \textbf{Note:} Currently, this can only be selected on WCDMA. For GSM + and 1x, the UE only allows a control plane NI trigger for positioning. + For LTE, the UE allows either a SUPL or a control plane NI trigger. \n Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane protocol during an emergency while on WCDMA. + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA. */ }qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @@ -5924,14 +5941,14 @@ typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted glonass configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL Hash algorithm configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted GLONASS configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL hash algorithm configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter. */ #define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter. */ /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to configure parameters stored +/** Indication Message; Used by the control point to configure parameters stored in the nonvolatile memory. */ typedef struct { @@ -5956,17 +5973,17 @@ typedef struct { uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not a success. + is sent only if the status is not SUCCESS. Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. */ }qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @@ -5976,7 +5993,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the configuration +/** Request Message; Used by the control point to get the configuration parameters stored in the nonvolatile memory. */ typedef struct { @@ -5986,14 +6003,14 @@ typedef struct { /**< Mask denoting the configuration parameters to be retrieved. Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. */ }qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ /** @@ -6003,7 +6020,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the configuration +/** Indication Message; Used by the control point to get the configuration parameters stored in the nonvolatile memory. */ typedef struct { @@ -6051,7 +6068,7 @@ typedef struct { qmiLocSuplVersionEnumT_v02 suplVersion; /**< SUPL version. - Valid values: \n + Valid values: \n - 0x00000001 -- SUPL_VERSION_1_0 \n - 0x00000002 -- SUPL_VERSION_2_0 */ @@ -6075,41 +6092,41 @@ typedef struct { /**< Assisted GLONASS Protocol mask. Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set + in the LPP configuration for this to take effect. */ /* Optional */ /* SUPL Hash Algorithm */ uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + /**< SUPL hash algorithm to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later. + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later. */ /* Optional */ /* SUPL TLS Version */ uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL TLS (Transport Layer Security) Version. This configuration is only - applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + /**< SUPL TLS version. This configuration is only + applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0. + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1. */ /* Optional */ /* Emergency Protocol */ uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< The protocol to be used during emergency. + /**< Protocol to be used during emergency. Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane protocol during an emergency while on WCDMA. + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA. */ }qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ /** @@ -6144,17 +6161,17 @@ typedef struct { /* Sensors Usage */ uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning + /**< Controls how sensors are used to aid heading and positioning performance. Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: + \item 0x00000000 -- SENSORS_USE_ ENABLED: Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in heading and + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in heading and position improvement. \vspace{-0.18in} \end{itemize1} */ @@ -6221,17 +6238,17 @@ typedef struct { /* Sensors Usage */ uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning + /**< Controls how sensors are used to aid the heading and positioning performance. Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: + \item 0x00000000 -- SENSORS_USE_ ENABLED: Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in the heading and + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in the heading and position improvement. \vspace{-0.18in} \end{itemize1} */ @@ -6249,7 +6266,7 @@ typedef uint32_t qmiLocSensorPropertiesMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Sets the properties specific to the type of sensor used. +/** Request Message; Sets the properties specific to the type of sensor used. The control point must set sensor properties before they can be used to aid in heading and positioning performance improvement. */ @@ -6262,9 +6279,9 @@ typedef struct { /**< Specifies the gyro bias random walk variance parameter as a positive floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - + */ /* Optional */ @@ -6274,9 +6291,9 @@ typedef struct { /**< Specifies the velocity random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 - + */ /* Optional */ @@ -6286,9 +6303,9 @@ typedef struct { /**< Specifies the acceleration random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 - + */ /* Optional */ @@ -6298,9 +6315,9 @@ typedef struct { /**< Specifies the angle random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 - + */ /* Optional */ @@ -6310,9 +6327,9 @@ typedef struct { /**< Specifies the rate random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - + */ }qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ /** @@ -6322,7 +6339,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Sets the properties specific to the type of sensor used. +/** Indication Message; Sets the properties specific to the type of sensor used. The control point must set sensor properties before they can be used to aid in heading and positioning performance improvement. */ @@ -6349,7 +6366,7 @@ typedef struct { /* Failed Set Sensor Properties */ uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field will be sent only if the status is not a success. + /**< This field is sent only if the status is not SUCCESS. Identifies the parameters that were not set successfully. Valid bitmasks: \begin{itemize1} @@ -6419,9 +6436,9 @@ typedef struct { /**< Specifies the gyro bias random walk variance parameter as a positive floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians^2/seconds^4 - + */ /* Optional */ @@ -6431,7 +6448,7 @@ typedef struct { /**< Specifies the velocity random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^2/Hertz^0.5 */ @@ -6443,7 +6460,7 @@ typedef struct { /**< Specifies the acceleration random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Meters/seconds^3/Hertz^0.5 */ @@ -6455,7 +6472,7 @@ typedef struct { /**< Specifies the angle random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds/Hertz^0.5 */ @@ -6467,9 +6484,9 @@ typedef struct { /**< Specifies the rate random walk spectral density parameter as a positive floating-point value. This value does not have any internal defaults. The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n + sensors data sheet or a sensors conformance test. \n - Units: Radians/seconds^2/Hertz^0.5 - + */ }qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ /** @@ -6501,8 +6518,8 @@ typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance. */ typedef struct { /* Optional */ @@ -6512,13 +6529,13 @@ typedef struct { /**< Controls when sensors data is requested during GNSS fix processing. This field is relevant only when sensors have been enabled using the sensors control configuration. - + Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data + The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time + The GNSS location engine must request use of sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} */ @@ -6527,26 +6544,26 @@ typedef struct { /* Accelerometer Sampling Specification */ uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request acceleration data to be used by the low data rate filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request gyro data to be used by the high data rate filter. The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ @@ -6564,26 +6581,26 @@ typedef struct { /* High Data Rate Filter Accelerometer Sampling Specification */ uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ }qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ /** @@ -6600,8 +6617,8 @@ typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance. */ typedef struct { /* Mandatory */ @@ -6651,7 +6668,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Retrieves the current sensor performance control +/** Indication Message; Retrieves the current sensor performance control configuration. */ typedef struct { @@ -6681,10 +6698,10 @@ typedef struct { Valid values: \begin{itemize1} \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data + The GNSS location engine can decide when to request sensor data injection based on internal criteria. This is the default. \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time + The GNSS location engine must request use of the sensors every time the GNSS location engine turns on. \vspace{-0.18in} \end{itemize1} */ @@ -6693,26 +6710,26 @@ typedef struct { /* Accelerometer Sampling Specification */ uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. + Default: 10 Hz sampling rate and 2Hz batching rate. */ /* Optional */ /* Gyroscope Sampling Specification */ uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. + Default: 10 Hz sampling rate and 2 Hz batching rate. */ /* Optional */ @@ -6730,26 +6747,26 @@ typedef struct { /* High Data Rate Filter Accelerometer Sampling Specification */ uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ /* Optional */ /* High Data Rate Filter Gyroscope Sampling Specification */ uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. */ }qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ /** @@ -6774,7 +6791,7 @@ typedef struct { uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; /**< SUPL certificate contents. \n - - Type: Array of bytes. \n + - Type: Array of bytes. \n - Maximum certificate size: 2000 bytes */ }qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ /** @@ -6791,7 +6808,7 @@ typedef struct { /* SUPL Certificate Injection Status */ qmiLocStatusEnumT_v02 status; /**< Status of the Inject SUPL Certificate request. - + Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE @@ -6820,7 +6837,7 @@ typedef struct { /**< Certificate ID of the SUPL certificate to be deleted. \n - Units: Bytes \n - Range: 0 to 9 \n - If suplCertId is not specified, + If suplCertId is not specified, all SUPL certificates are deleted. */ }qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ /** @@ -6854,16 +6871,18 @@ typedef struct { */ typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the injected position in a direct position calculation. */ #define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data - in persistent memory. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000008) /**< Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. */ /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to configure position engine +/** Request Message; Used by the control point to configure position engine functionality. */ typedef struct { @@ -6874,7 +6893,7 @@ typedef struct { /**< Controls how the injected position is used in the position engine. Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position + \item 0x01 (TRUE) -- Use the injected position in a direct position calculation \item 0x00 (FALSE) -- Do not use the injected position in a direct position calculation @@ -6899,7 +6918,7 @@ typedef struct { /* Store Assist Data */ uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in + /**< Controls whether assistance data is to be stored in persistent memory. Valid values: \begin{itemize1} @@ -6908,6 +6927,26 @@ typedef struct { \end{itemize1} The default value is TRUE. */ + + /* Optional */ + /* Enable Faster TTFF */ + uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ + uint8_t enableFasterTTFF; + /**< Allows the receiver to stay on after a position session in order to + collect information that will help reduce the Time To First Fix (TTFF) + when the next position request is made. The receiver will stay + on only if the engine determines that it needs to collect some + information. The receiver will stay on for the duration needed to + collect the information. + If enabled, the clients may see a delay in receiving the Engine Off + event after the position session ends. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF + \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced + TTFF + \end{itemize1} + The default value is TRUE.*/ }qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -6916,7 +6955,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to configure position engine +/** Indication Message; Used by the control point to configure position engine functionality. */ typedef struct { @@ -6941,14 +6980,18 @@ typedef struct { uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; /**< Identifies the parameters that were not set successfully. - This field is sent only if the status is other than SUCCESS. + This field is sent only if the status is other than SUCCESS. - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_ POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_ DATA - \vspace{-0.18in} \end{itemize1} - */ + Valid bitmasks:\n + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the + injected position in a direct position calculation. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the + SV usage in the fix. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data + in persistent memory. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. + */ }qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -6957,7 +7000,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the position engine +/** Request Message; Used by the control point to get the position engine configuration parameters. */ typedef struct { @@ -6966,12 +7009,16 @@ typedef struct { qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; /**< Mask denoting the configuration parameters to be retrieved. - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_ POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_ DATA - \vspace{-0.18in} \end{itemize1} - */ + Valid bitmasks: + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the + injected position in a direct position calculation. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the + SV usage in the fix. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data + in persistent memory. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. + */ }qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ /** @} @@ -6980,7 +7027,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the position engine +/** Indication Message; Used by the control point to get the position engine configuration parameters. */ typedef struct { @@ -7004,7 +7051,7 @@ typedef struct { /* Injected Position Control */ uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation + /**< Specifies whether the injected position is used for a direct calculation in the position engine. Valid values: \begin{itemize1} @@ -7020,7 +7067,7 @@ typedef struct { /* Filter SV Usage */ uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. + /**< Specifies whether SV usage is filtered in a position fix. Valid values: \begin{itemize1} \item 0x01 (TRUE) -- SV usage is filtered in the fix @@ -7042,6 +7089,26 @@ typedef struct { \end{itemize1} The default value is TRUE. */ + + /* Optional */ + /* Enable Faster TTFF */ + uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ + uint8_t enableFasterTTFF; + /**< Allows the receiver to stay on after a position session in order to + collect information that will help reduce the TTFF + when the next position request is made. The receiver will stay + on only if the engine determines that it needs to collect some + information. The receiver will stay on for the duration needed to + collect the information. + If enabled, the clients may see a delay in receiving the Engine Off + event after the position session ends. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF + \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced + TTFF + \end{itemize1} + The default value is TRUE.*/ }qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ /** @} @@ -7080,7 +7147,7 @@ typedef enum { QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with low confidence. This setting results in lower - power usage. This setting can impact the "yield" because + power usage. This setting can impact the "yield" because incorrect breach events may be sent. */ eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with medium confidence. This is the default setting. */ @@ -7155,7 +7222,7 @@ typedef struct { /* Include Position in Breach Event */ uint8_t includePosition; /**< Specifies whether the Geofence engine is to include the position - in a breach event. + in a breach event. Valid values: \begin{itemize1} \item 0x01 (TRUE) -- Position will be reported with the breach event @@ -7167,9 +7234,9 @@ typedef struct { /* Responsiveness */ uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. + /**< Specifies the rate of detection for a Geofence breach. This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications + when it is reported. This parameter has power implications and is to be fine-tuned to optimize power savings. Valid values: \begin{itemize1} @@ -7182,9 +7249,9 @@ typedef struct { /* Confidence */ uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and is to be fine-tuned to optimize power savings. Valid values: \begin{itemize1} @@ -7232,7 +7299,7 @@ typedef struct { /* Geofence ID */ uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. + /**< Geofence identifier allocated by the engine. The client must include this identifier in all transactions pertaining to this Geofence. */ }qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ @@ -7401,7 +7468,7 @@ typedef struct { uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ qmiLocGeofencePositionEnumT_v02 posWrtGeofence; /**< Indicates if the client is currently inside or outside - the Geofence. + the Geofence. Valid values: \begin{itemize1} \item 0x00000001 -- GEOFENCE_ POSITION_INSIDE @@ -7454,7 +7521,7 @@ typedef struct { /**< Specifies whether the Geofence is to be actively monitored. Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE + \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND \vspace{-0.18in} \end{itemize1} */ @@ -7530,7 +7597,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Used by the control point to get the best available +/** Request Message; Used by the control point to get the best available position estimate from the location engine. */ typedef struct { @@ -7547,7 +7614,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Used by the control point to get the best available +/** Indication Message; Used by the control point to get the best available position estimate from the location engine. */ typedef struct { @@ -7679,13 +7746,13 @@ typedef struct { uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ qmiLocReliabilityEnumT_v02 horReliability; /**< Specifies the reliability of the horizontal position. - + Valid values: \begin{itemize1} \item 0x00000000 -- RELIABILITY_NOT_ SET \item 0x00000001 -- RELIABILITY_ VERY_LOW \item 0x00000002 -- RELIABILITY_LOW \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH + \item 0x00000004 -- RELIABILITY_HIGH \vspace{-0.18in} \end{itemize1} */ /* Optional */ @@ -7765,7 +7832,7 @@ typedef struct { /* Magnetic Deviation */ uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown + /**< Difference between the bearing to true north and the bearing shown on a magnetic compass. The deviation is positive when the magnetic north is east of true north. */ @@ -7774,15 +7841,18 @@ typedef struct { uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ qmiLocPosTechMaskT_v02 technologyMask; /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_ LOCATION - \item 0x00000020 -- INJECTED_COARSE_ POSITION - \vspace{-0.18in} \end{itemize1} */ + Valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- WiFi access points were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix. + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix. + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to + generate the fix. + - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix. + - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to + generate the fix. + */ /* Optional */ /* Dilution of Precision */ @@ -7800,26 +7870,26 @@ typedef struct { qmiLocTimeSourceEnumT_v02 timeSrc; /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). - GNSS time is maintained irrespective of the GNSS receiver state + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from the system clock (better known as the slow clock); + GNSS time is maintained irrespective of the GNSS receiver state */ /* Optional */ @@ -7833,12 +7903,12 @@ typedef struct { uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following + used for calculating this position report. The following information is associated with each SV ID: \begin{itemize1} \item Range: \begin{itemize1} \item For GPS: 1 to 32 \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 + \item For GLONASS: 65 to 96 \item For QZSS: 193 to 197 \vspace{-0.18in} \end{itemize1} \end{itemize1} */ }qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ @@ -7886,13 +7956,13 @@ typedef struct { /**< Current motion state of the user. Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.1in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute + \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.1in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute rest by reducing probability_of_state. */ @@ -7900,62 +7970,62 @@ typedef struct { /**< Modes of user motion. Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. + is in Pedestrian mode; nothing else is known about the movement. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. + is in Pedestrian Walking mode. \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. + is in Pedestrian Running mode. \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.1in} \end{itemize1} - + in Vehicular mode; nothing else is known about the movement. + \vspace{0.1in} \end{itemize1} + The motion_mode value is independent of the motion_state value. */ float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, and motion_sub_mode. \vspace{0.1in} - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.1in} + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.1in} It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} If the motion_state is not known, the value in this field is not used. */ uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. + /**< Age of the motion data in milliseconds at the time of injection. */ uint16_t timeout; /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is received. \n - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. */ }qmiLocMotionDataStructT_v02; /* Type */ /** @@ -7985,7 +8055,7 @@ typedef struct { /* Mandatory */ /* Inject Motion Data Request Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. + /**< Status of the Inject Motion Data request. Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS @@ -8040,7 +8110,7 @@ typedef struct { /* Transaction ID */ uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI + /**< Transaction ID that was specified in the Get NI Geofence ID List request. */ /* Optional */ @@ -8049,7 +8119,7 @@ typedef struct { uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n + - Type: Array of unsigned 32-bit integers \n - Maximum NI Geofence ID List length: 16 */ }qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ /** @@ -8062,16 +8132,16 @@ typedef struct { typedef struct { uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ uint32_t MNC; - /**< GSM mobile network code. Refer to \hyperref[R2]{[R2]}. */ + /**< GSM mobile network code. Refer to \hyperref[S6]{[S6]}. */ uint32_t LAC; - /**< GSM location area code. Refer to \hyperref[R2]{[R2]}. */ + /**< GSM location area code. Refer to \hyperref[S6]{[S6]}. */ uint32_t CID; - /**< GSM cell identification. Refer to \hyperref[R2]{[R2]}. */ + /**< GSM cell identification. Refer to \hyperref[S6]{[S6]}. */ }qmiLocGSMCellIdStructT_v02; /* Type */ /** @} @@ -8080,19 +8150,19 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Injects GSM cell information into the location +/** Request Message; Injects GSM cell information into the location engine. */ typedef struct { /* Mandatory */ /* GSM Cell ID */ qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< \n Identifies the GSM cell on which the device is currently camped. */ + /**< \vspace{0.06in} \n Identifies the GSM cell on which the device is currently camped. */ /* Mandatory */ /* Roaming Status */ uint8_t roamingStatus; - /**< Whether the device is roaming. + /**< Indicates whether the device is roaming. \begin{itemize1} \item 0x01 (TRUE) -- Device is roaming \item 0x00 (FALSE) -- Device is not roaming @@ -8102,8 +8172,8 @@ typedef struct { /* Timing Advance */ uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ uint32_t timingAdvance; - /**< The round trip delay between the MS and the BS, in unit of 3.69 microseconds. - Refer to 3GPP TS 05.10 and TS 45.010 */ + /**< Round trip delay between the MS and the BS, in units of 3.69 microseconds. + Refer to 3GPP TS 05.10 and TS 45.010. */ }qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ /** @} @@ -8112,7 +8182,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Injects GSM cell information into the location +/** Indication Message; Injects GSM cell information into the location engine. */ typedef struct { @@ -8128,7 +8198,7 @@ typedef struct { \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ /** @} @@ -8139,7 +8209,7 @@ typedef struct { */ typedef enum { QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network */ + eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network. */ eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network. */ QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocRoamingStatusEnumT_v02; @@ -8153,13 +8223,13 @@ typedef enum { typedef struct { uint32_t mcc; - /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ uint32_t mnc; - /**< WCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + /**< WCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ uint32_t cid; - /**< WCDMA Cell Identity. Refer to \hyperref[R2]{[R2]}. */ + /**< WCDMA cell identity. Refer to \hyperref[S6]{[S6]}. */ }qmiLocWCDMACellIdStructT_v02; /* Type */ /** @} @@ -8168,7 +8238,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Injects WCDMA cell information into the location +/** Request Message; Injects WCDMA cell information into the location engine. */ typedef struct { @@ -8180,23 +8250,29 @@ typedef struct { /* Mandatory */ /* Roaming Status */ qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Whether the device is roaming. + /**< Indicates whether the device is roaming. Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e., it is camped on its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e., it is camped on a roaming network. - \vspace{0.1in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ /* Optional */ + /* Cell Frequency */ uint8_t freq_valid; /**< Must be set to true if freq is being passed */ uint32_t freq; - /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ + /**< Frequency information of the serving cell. \n + Valid range: 0 to 16383 \n + Refer to TS 25.331 \hyperref[S7]{[S7]}. */ /* Optional */ + /* Primary Scrambling Code */ uint8_t psc_valid; /**< Must be set to true if psc is being passed */ uint32_t psc; - /**< PrimaryScramblingCode of the serving cell. Valid range is 0 to 511. Refer to TS 25.331 */ + /**< Primary scrambling code of the serving cell. \n + Valid range: 0 to 511 \n + Refer to \hyperref[S7]{[S7]}. */ }qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ /** @} @@ -8205,7 +8281,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Injects WCDMA cell information into the location +/** Indication Message; Injects WCDMA cell information into the location engine. */ typedef struct { @@ -8221,7 +8297,7 @@ typedef struct { \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ /** @} @@ -8233,16 +8309,16 @@ typedef struct { typedef struct { uint32_t mcc; - /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ uint32_t mnc; - /**< TDSCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + /**< TDSCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ uint32_t cid; - /**< TDSCDMA Cell Identity. Refer to TS 25.331. */ + /**< TDSCDMA cell identity. Refer to TS 25.331 \hyperref[S7]{[S7]}. */ uint32_t lac; - /**< TDSCDMA location area code. Refer to \hyperref[R2]{[R2]}. */ + /**< TDSCDMA location area code. Refer to \hyperref[S6]{[S6]}. */ }qmiLocTDSCDMACellIdStructT_v02; /* Type */ /** @} @@ -8251,7 +8327,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Injects TDSCDMA cell information into the location +/** Request Message; Injects TDSCDMA cell information into the location engine. */ typedef struct { @@ -8263,18 +8339,21 @@ typedef struct { /* Mandatory */ /* Roaming Status */ qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Whether the device is roaming. + /**< Indicates whether the device is roaming. Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e., it is camped on its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped - on a roaming network. - \vspace{0.1in} \end{itemize1} */ + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e., it is camped + on a roaming network + \vspace{-0.18in} \end{itemize1} */ /* Optional */ + /* Cell Frequency */ uint8_t freq_valid; /**< Must be set to true if freq is being passed */ uint32_t freq; - /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ + /**< Frequency information of the serving cell. \n + Valid range: 0 to 16383 \n + Refer to \hyperref[S7]{[S7]}. */ }qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ /** @} @@ -8283,7 +8362,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Injects TDSCDMA cell information into the location +/** Indication Message; Injects TDSCDMA cell information into the location engine. */ typedef struct { @@ -8299,7 +8378,7 @@ typedef struct { \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ /** @} @@ -8315,13 +8394,13 @@ typedef struct { /* Preferred IMSI */ uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ uint64_t preferredIMSI; - /**< \n The IMSI number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ + /**< IMSI number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ /* Optional */ /* Preferred MSISDN */ uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ uint64_t preferredMSISDN; - /**< \n The MSISDN number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ + /**< MSISDN number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ }qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ /** @} @@ -8345,7 +8424,7 @@ typedef struct { \item 0x00000003 -- INVALID_ PARAMETER \item 0x00000004 -- ENGINE_BUSY \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ + \vspace{-0.18in} \end{itemize1} */ }qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ /** @} @@ -8366,7 +8445,7 @@ typedef enum { /** @addtogroup loc_qmi_messages @{ */ -/** Request Message; Injects a network-initiated message into the location +/** Request Message; Injects a network-initiated message into the location engine. */ typedef struct { @@ -8382,7 +8461,7 @@ typedef struct { /* Injected Network Initiated Message */ uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network-initiated message body. + /**< Network-initiated message body. If the inject NI message type is TYPE_SUPL, the message contains a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ }qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ @@ -8393,7 +8472,7 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Injects a network-initiated message into the location +/** Indication Message; Injects a network-initiated message into the location engine. */ typedef struct { @@ -8458,43 +8537,43 @@ typedef struct { /* Mandatory */ /* Time Source */ qmiLocSensorDataTimeSourceEnumT_v02 timeSource; - /**< Time source for the pedometer. Location service will use - this field to identify the time reference used in the - pedometer data timestamp. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine*/ + /**< Time source for the pedometer. The location service uses + this field to identify the time reference used in the + pedometer data time stamp. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine. */ /* Mandatory */ - /* Pedometer report timestamp */ + /* Pedometer Report Timestamp */ uint32_t timestamp; - /**< Timestamp of the last step event in this report, i.e timestamp - of the step event that caused this report to be generated. - The timestamp is in the time reference scale that is + /**< Time stamp of the last step event in this report, i.e., the time stamp + of the step event that caused this report to be generated. + The time stamp is in the time reference scale that is used by the pedometer time source. \n - - Unit: Milliseconds */ + - Units: Milliseconds */ /* Mandatory */ /* Time Interval */ uint32_t timeInterval; /**< Time interval during which the step count was calculated. Subtracting - timeInterval from the timestamp field will yield the the time when - the step detection for the first step in this report started. - Unit : Milliseconds. */ + timeInterval from the timestamp field yields the time when + the step detection for the first step in this report started. \n + - Units: Milliseconds */ /* Mandatory */ /* Step Count */ uint32_t stepCount; - /**< Number for steps counted during the time interval.*/ + /**< Number of steps counted during the time interval. */ /* Optional */ /* Step Confidence */ uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ uint8_t stepConfidence; /**< Confidence associated with the step. This field is only applicable - for a single step report, i.e if the stepCount is one. - Range: 0 to 100. - Note: The report will be ignored if confidence is 0. */ + for a single step report, i.e., if the step count is one. \n + - Range: 0 to 100 \n + \textbf{Note:} The report is ignored if confidence is 0. */ /* Optional */ /* Step Count Uncertainty */ @@ -8506,10 +8585,9 @@ typedef struct { /* Step Rate */ uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ float stepRate; - /**< Current estimate for the rate of steps per second. - Units: steps/second - Range: >= 0.0 - */ + /**< Current estimate for the rate of steps per second. \n + - Units: steps/second \n + - Range: >= 0.0 */ }qmiLocPedometerReportReqMsgT_v02; /* Message */ /** @} @@ -8523,11 +8601,9 @@ typedef struct { typedef struct { /* Mandatory */ - /* Status of Pedometer report request */ + /* Status of Pedometer Report Request */ qmiLocStatusEnumT_v02 status; - /**< Status of the pedometer report request - - Valid values: \begin{itemize1} + /**< Valid values: \begin{itemize1} \item 0x00000000 -- SUCCESS \item 0x00000001 -- GENERAL_FAILURE \item 0x00000002 -- UNSUPPORTED @@ -8546,6 +8622,10 @@ typedef struct { /** @addtogroup loc_qmi_msg_ids @{ */ +#define QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02 0x001E +#define QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02 0x001E +#define QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02 0x001F +#define QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02 0x001F #define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 #define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 #define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 @@ -8758,21 +8838,21 @@ typedef struct { */ /* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor +/** @addtogroup wms_qmi_accessor @{ */ /** This function is used internally by the autogenerated code. Clients should use the macro loc_get_service_object_v02( ) that takes in no arguments. */ qmi_idl_service_object_type loc_get_service_object_internal_v02 ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ + +/** This macro should be used to get the service object */ #define loc_get_service_object_v02( ) \ loc_get_service_object_internal_v02( \ LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ LOC_V02_IDL_TOOL_VERS ) -/** - @} +/** + @} */ @@ -8780,4 +8860,3 @@ qmi_idl_service_object_type loc_get_service_object_internal_v02 } #endif #endif - From 313788ea592ed33994ebcf61653b2b0e5b629c56 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Fri, 31 May 2013 16:31:24 -0700 Subject: [PATCH 116/945] Adds logic to pass through PIP User setting Changes to manage user preference for Precise Indoor Positioning Control through settings on the OS UI menu CRs-Fixed: 492707 Change-Id: I6a0cc0a92c35d05122efce310274f20590a16118 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 ++++-- loc_api/libloc_api_50001/loc_eng_msg.h | 6 ++++-- loc_api/libloc_api_50001/loc_ulp.h | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8fa87a0b..d837a414 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2113,11 +2113,13 @@ int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, LOC_LOGD("loc_eng_ulp_phone_context_settings: context_type - 0x%x is_agps_enabled - %d " "is_battery_charging %d ,is_gps_enabled %d, is_network_position_available %d," - "is_wifi_setting_enabled %d, is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + "is_wifi_setting_enabled %d, is_agps_setting_enabled %d, is_enh_location_services_enabled %d," + "is_pip_user_setting_enabled %d\n", settings->context_type ,settings->is_agps_enabled,settings->is_battery_charging, settings->is_gps_enabled, settings->is_network_position_available, settings->is_wifi_setting_enabled, settings->is_agps_enabled, - settings->is_enh_location_services_enabled ); + settings->is_enh_location_services_enabled, + settings->is_pip_user_setting_enabled); if(loc_eng_data.ulp_initialized == true) { diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index df7cc092..97d19d3b 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -905,14 +905,16 @@ struct ulp_msg_inject_phone_context_settings : public loc_eng_msg { phoneSetting(setting) { LOC_LOGV("context type: %d\n gps enabled: %d\n network position available %d\n wifi setting enabled %d\n battery charging %d" - "is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + "is_agps_setting_enabled %d, is_enh_location_services_enabled %d" + " is_pip_user_setting_enabled %d\n", phoneSetting.context_type, phoneSetting.is_gps_enabled, phoneSetting.is_network_position_available, phoneSetting.is_wifi_setting_enabled, phoneSetting.is_battery_charging, phoneSetting.is_agps_enabled, - phoneSetting.is_enh_location_services_enabled); + phoneSetting.is_enh_location_services_enabled, + phoneSetting.is_pip_user_setting_enabled); } }; diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h index 5822b7ca..6372e6ea 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -345,6 +345,7 @@ typedef struct #define ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE (0x08) #define ULP_PHONE_CONTEXT_AGPS_SETTING (0x010) #define ULP_PHONE_CONTEXT_ENH_LOCATION_SERVICES_SETTING (0x020) +#define ULP_PHONE_CONTEXT_PIP_USER_SETTING (0x040) /** return phone context only once */ #define ULP_PHONE_CONTEXT_REQUEST_TYPE_SINGLE (0x01) @@ -390,6 +391,8 @@ typedef struct { bool is_agps_enabled; /* is Enhanced Location Services enabled by user*/ bool is_enh_location_services_enabled; + /* is PIP Services enabled by user in Android Settings*/ + bool is_pip_user_setting_enabled; } UlpPhoneContextSettings; /** Represent the phone contxt interface */ From bc1fb0bce5c0be9de33dcabf21f9d5cdd1b213fd Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 13 May 2013 21:30:01 -0700 Subject: [PATCH 117/945] Fixes ULP and FLP operation when GPS not enabled Changes to ensure FLP positioning call flow works even if GPS is disabled on the Android settings menu. CRs-Fixed: 476628 Change-Id: I54b9f9861a14f7c42f45c48e57e9558f14a4de92 --- loc_api/libloc_api_50001/Android.mk | 3 +- loc_api/libloc_api_50001/loc.cpp | 248 ++++++++++++++++++++------- loc_api/libloc_api_50001/loc_eng.cpp | 3 - 3 files changed, 184 insertions(+), 70 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index c91405d3..c9bef520 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -107,7 +107,8 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libloc_eng \ libgps.utils \ - libdl + libdl \ + libandroid_runtime LOCAL_SRC_FILES += \ loc.cpp \ diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f51b8842..4ab9ee80 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -50,11 +51,18 @@ static const ulpInterface * loc_eng_get_ulp_inf(void); static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; -static void loc_cb(UlpLocation* location, void* locExt); -static void sv_cb(GpsSvStatus* sv_status, void* svExt); +static void local_loc_cb(UlpLocation* location, void* locExt); +static void local_status_cb(GpsStatus* status); +static void local_sv_cb(GpsSvStatus* sv_status, void* svExt); +static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length); +static void local_set_capabilities_cb(uint32_t capabilities); +static void local_acquire_wakelock_cb(void); +static void local_release_wakelock_cb(void); +static void local_request_utc_time_cb(void); // Function declarations for sLocEngInterface static int loc_init(GpsCallbacks* callbacks); +static int loc_hal_init(void); static int loc_start(); static int loc_stop(); static void loc_cleanup(); @@ -188,6 +196,7 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = static loc_eng_data_s_type loc_afw_data; static UlpCallbacks ulp_cb_data; +static LocCallbacks afw_cb_data; static int gss_fd = 0; /*=========================================================================== @@ -224,6 +233,18 @@ const GpsInterface* gps_get_hardware_interface () ret_val = &sLocEngInterface; } + if (0 != loc_hal_init()) { + LOC_LOGE("HAL could not be initialized"); + ret_val = NULL; + } else { + ret_val = &sLocEngInterface; + } + + loc_eng_read_config(); + + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + EXIT_LOG(%p, ret_val); return ret_val; } @@ -232,27 +253,33 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { targetEnumType target = TARGET_OTHER; - loc_eng_read_config(); + if (NULL == loc_afw_data.context) { + loc_eng_read_config(); - //We load up libulp module at this point itself - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - target = get_target(); - LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - //APQ8064 and APQ8030 - if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { - 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); + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + //APQ8064 and APQ8030 + if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { + 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); + } + } + //MPQ8064 + else if(target == TARGET_MPQ8064) { + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; + } + if (0 != loc_hal_init()) { + LOC_LOGE("HAL could not be initialized"); + return NULL; } - } - //MPQ8064 - else if(target == TARGET_MPQ8064) { - LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); - return NULL; } return &sLocEngInterface; } @@ -269,7 +296,7 @@ void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) } /*=========================================================================== -FUNCTION loc_init +FUNCTION loc_hal_init DESCRIPTION Initialize the location engine, this include setting up global datas @@ -285,15 +312,10 @@ SIDE EFFECTS N/Ax ===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) +static int loc_hal_init(void) { int retVal = -1; ENTRY_LOG(); - if(callbacks == NULL) { - LOC_LOGE("loc_init failed. cb = NULL\n"); - EXIT_LOG(%d, retVal); - return retVal; - } LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | LOC_API_ADAPTER_BIT_SATELLITE_REPORT | @@ -303,19 +325,18 @@ static int loc_init(GpsCallbacks* callbacks) LOC_API_ADAPTER_BIT_STATUS_REPORT | LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; - LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ - callbacks->status_cb, /* status_cb */ - 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 */ + LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ + local_status_cb, /* status_cb */ + local_sv_cb, /* sv_status_cb */ + local_nmea_cb, /* nmea_cb */ + local_set_capabilities_cb, /* set_capabilities_cb */ + local_acquire_wakelock_cb, /* acquire_wakelock_cb */ + local_release_wakelock_cb, /* release_wakelock_cb */ + (pthread_t (*)(const char*, void (*)(void*), void*)) + android::AndroidRuntime::createJavaThread, /* create_thread_cb */ NULL, /* location_ext_parser */ NULL, /* sv_ext_parser */ - callbacks->request_utc_time_cb /* request_utc_time_cb */}; - gps_loc_cb = callbacks->location_cb; - gps_sv_cb = callbacks->sv_status_cb; + local_request_utc_time_cb /* request_utc_time_cb */}; if (loc_eng_ulp_inf == NULL) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, @@ -324,17 +345,6 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, loc_ulp_msg_sender); - if (ulp_cb_data.phone_context_cb) { - //ULP initilization already occurred so redo intializations here - //to restore callback table - loc_eng_ulp_phone_context_init(loc_afw_data, ulp_cb_data.phone_context_cb); - } - - if (ulp_cb_data.network_location_cb) { - loc_eng_ulp_network_init(loc_afw_data, ulp_cb_data.network_location_cb); - } - - int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); //Initialize the cached min_interval loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; @@ -1036,7 +1046,7 @@ static bool loc_inject_raw_command(char* command, int length) return ret_val; } -static void loc_cb(UlpLocation* location, void* locExt) +static void local_loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); if (NULL != location) { @@ -1044,7 +1054,9 @@ static void loc_cb(UlpLocation* location, void* locExt) if (ULP_LOCATION_IS_FROM_GNSS == location->position_source ) { if (NULL != gps_loc_cb) { gps_loc_cb(&location->gpsLocation); - } + } else { + LOC_LOGE("Error. GPS not enabled"); + } } else { if (NULL != ulp_loc_cb) { ulp_loc_cb(location); @@ -1054,13 +1066,15 @@ static void loc_cb(UlpLocation* location, void* locExt) EXIT_LOG(%s, VOID_RET); } -static void sv_cb(GpsSvStatus* sv_status, void* svExt) +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); - } + } else { + LOC_LOGE("Error. GPS not enabled"); + } EXIT_LOG(%s, VOID_RET); } @@ -1136,12 +1150,7 @@ static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) { ENTRY_LOG(); int ret_val = -1; - if (loc_afw_data.context) { - ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); - } else - { - ulp_cb_data.phone_context_cb = callbacks; - } + ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); EXIT_LOG(%d, ret_val); return ret_val; } @@ -1191,13 +1200,7 @@ static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) { ENTRY_LOG(); int ret_val = -1; - if (loc_afw_data.context) { - ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); - } else - { - ulp_cb_data.network_location_cb = callbacks; - } - + ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); EXIT_LOG(%d, ret_val); return ret_val; } @@ -1279,3 +1282,116 @@ static int loc_ulp_engine_stop() } +/*=========================================================================== +FUNCTION loc_init + +DESCRIPTION + Registers the AFW call backs with the local tables + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/Ax + +===========================================================================*/ +static int loc_init(GpsCallbacks* callbacks) +{ + int retVal = -1; + ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE(" loc_init. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } + memset(&afw_cb_data, NULL, sizeof (LocCallbacks)); + gps_loc_cb = callbacks->location_cb; + afw_cb_data.status_cb = callbacks->status_cb; + gps_sv_cb = callbacks->sv_status_cb; + afw_cb_data.set_capabilities_cb = callbacks->set_capabilities_cb; + afw_cb_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + afw_cb_data.release_wakelock_cb = callbacks->release_wakelock_cb; + afw_cb_data.request_utc_time_cb = callbacks->request_utc_time_cb; + afw_cb_data.nmea_cb = callbacks->nmea_cb; + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + retVal = 0; + EXIT_LOG(%d, retVal); + return retVal; +} + +static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length) +{ + ENTRY_LOG(); + if (0 != length) { + if (NULL != afw_cb_data.nmea_cb) { + afw_cb_data.nmea_cb(timestamp, nmea, length); + } else + { + LOC_LOGE("Error. GPS not enabled"); + } + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_set_capabilities_cb(uint32_t capabilities) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.set_capabilities_cb) { + afw_cb_data.set_capabilities_cb(capabilities); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_acquire_wakelock_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.acquire_wakelock_cb) { + afw_cb_data.acquire_wakelock_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_release_wakelock_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.release_wakelock_cb) { + afw_cb_data.release_wakelock_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_request_utc_time_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.request_utc_time_cb) { + afw_cb_data.request_utc_time_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_status_cb(GpsStatus* status) +{ + ENTRY_LOG(); + if (NULL != status) { + CALLBACK_LOG_CALLFLOW("status_callback - status", %d, status->status); + if (NULL != afw_cb_data.status_cb) { + afw_cb_data.status_cb(status); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + } + EXIT_LOG(%s, VOID_RET); +} diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 00ef79b8..1f66674f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -307,9 +307,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, // Create context (msg q + thread) (if not yet created) // This will also parse gps.conf, if not done. loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; From 838f00b1ef086231e9ef49744eaf7006619b27aa Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 30 May 2013 15:46:10 -0700 Subject: [PATCH 118/945] jb_2.6 bring up changes. Enable gps.conf and remove dependancy on libgeofence.so Change-Id: I3f58f0b6afcb017504af51699b7030db07051402 --- etc/Android.mk | 16 ++++++++-------- etc/gps.conf | 8 ++++---- loc_api/libloc_api_50001/Android.mk | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/etc/Android.mk b/etc/Android.mk index 26a39dbd..96dc5d78 100755 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,11 +1,11 @@ -#LOCAL_PATH := $(call my-dir) -#include $(CLEAR_VARS) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) -#LOCAL_MODULE := gps.conf -#LOCAL_MODULE_TAGS := optional -#LOCAL_MODULE_CLASS := ETC -#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ -#LOCAL_SRC_FILES := gps.conf -#include $(BUILD_PREBUILT) +LOCAL_MODULE := gps.conf +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ +LOCAL_SRC_FILES := gps.conf +include $(BUILD_PREBUILT) diff --git a/etc/gps.conf b/etc/gps.conf index 322fe162..7ba64837 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -30,8 +30,8 @@ ERR_ESTIMATE=0 # SCHEDULING = 1 # MSB = 2 # MSA = 4 -# ULP = 0x20 -# default = MSA | MSB | SCHEDULING | ULP +# GEOFENCE = 0x20 +# default = MSA | MSB | SCHEDULING | GEOFENCE CAPABILITIES=0x27 # Accuracy threshold for intermediate positions @@ -67,7 +67,7 @@ SENSOR_GYRO_SAMPLES_PER_BATCH=5 SENSOR_CONTROL_MODE=0 # Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) -SENSOR_USAGE=0 +SENSOR_USAGE=1 # Choose GSIFF sensor provider (1=DSPS, 2=Android NDK) SENSOR_PROVIDER=1 @@ -82,7 +82,7 @@ QUIPC_ENABLED = 0 # EXTRA SETTINGS ################################ # Enable or Disable Wiper (1=Enable, 0=Disable) -ENABLE_WIPER=1 +ENABLE_WIPER=0 #################################### # LTE Positioning Profile Settings diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index a5696de3..4af7c1a5 100755 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -108,7 +108,6 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libloc_eng \ libgps.utils \ - libgeofence \ libdl LOCAL_SRC_FILES += \ From b05358920cbce7891a1d8605126eaeafe39ce2e2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 7 Jun 2013 13:39:24 -0700 Subject: [PATCH 119/945] Make Loc Init Asynchronous GPS-enable gets too heavy at powerup, when loc_init is synchronous, where loc goes to get the hardware handle if AP init happens faster than the GPS hardware. The loc init calling thread is from Android framework, and it locks a mutex that in turn could lock up system server main thread upon race conditions. The second half of loc init, i.e. the reinit, is now moved to loc worker thread. This should help release some of the powerup timing pressure on the framework threads. Add a message just for asynchrous Loc Init so as to execute init specifically. Change-Id: I369e461ca4ca61cea3a9729c84d24af4ffa8e51d CRs-fixed: 472843 --- .../libloc_api-rpc-glue/src/loc_api_rpc_glue.c | 18 +++++++++++++++--- loc_api/libloc_api_50001/loc_eng.cpp | 16 ++++++++-------- loc_api/libloc_api_50001/loc_eng_log.cpp | 3 ++- loc_api/libloc_api_50001/loc_eng_msg_id.h | 3 +++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c index 11c9e3d4..c047cb34 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -62,6 +62,9 @@ /* Logging Improvement */ #include "log_util.h" +/*Maximum number of Modem init*/ +#define RPC_TRY_NUM 10 + /* Uncomment to force ALOGD messages */ // #define ALOGD ALOGI @@ -308,6 +311,7 @@ rpc_loc_client_handle_type loc_open ( void* userData ) { + int try_num = RPC_TRY_NUM; ENTRY_LOG(); LOC_GLUE_CHECK_INIT(rpc_loc_client_handle_type); @@ -352,14 +356,22 @@ rpc_loc_client_handle_type loc_open ( enum clnt_stat stat = RPC_SUCCESS; EXIT_LOG_CALLFLOW(%s, "loc client open"); - stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); + + /*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; - ret_val = (rpc_loc_client_handle_type) rets.loc_open_result; - return ret_val; } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 00ef79b8..9383e24e 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -348,14 +348,9 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, } else { LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); - // call reinit to send initialization messages - int tries = 30; - while (tries > 0 && - LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { - tries--; - LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); - sleep(1); - } + /*send reinit event to QMI instead of call reinit directly*/ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_LOC_INIT)); + locEngHandle.sendMsge(locEngHandle.owner, msg); } EXIT_LOG(%d, ret_val); @@ -1942,6 +1937,11 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_LOC_INIT: + { + loc_eng_reinit(*loc_eng_data_p); + } + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 895db1db..ce1bcdf5 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -107,7 +107,8 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( ULP_MSG_MONITOR ), NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), - NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ) + NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ), + NAME_VAL( LOC_ENG_MSG_LOC_INIT ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index bcdf2969..7b0aee05 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -131,6 +131,9 @@ enum loc_eng_msg_ids_t { /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ LOC_ENG_MSG_A_GLONASS_PROTOCOL, + + //Message is sent by LOC to do LOC INIT + LOC_ENG_MSG_LOC_INIT, }; #ifdef __cplusplus From 85f672fa7130c68030239940fcfb9308c4f49f33 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 5 Jun 2013 09:11:09 -0700 Subject: [PATCH 120/945] Merge branch jb_mr1 into jb_2.6 Merged from from label AU_LINUX_ANDROID_JB_MR1.04.02.02.049.306 Change-Id: Ie2f7fd3d25f8f28f5d1b6e733974bb5f75999ee8 --- CleanSpec.mk | 0 etc/Android.mk | 0 etc/gps.conf | 82 +- loc_api/Android.mk | 22 +- loc_api/NOTICE | 0 loc_api/libloc_api-rpc-50001/Android.mk | 0 .../libloc_api-rpc-glue/Android.mk | 4 + .../rpc_inc/LocApiRpcAdapter.h | 25 +- .../libloc_api-rpc-glue/rpc_inc/debug.h | 10 +- .../rpc_inc/loc_api_fixup.h | 4 +- .../libloc_api-rpc-glue/rpc_inc/loc_api_log.h | 4 +- .../rpc_inc/loc_api_rpc_glue.h | 4 +- .../rpc_inc/loc_api_sync_call.h | 4 +- .../rpc_inc/loc_apicb_appinit.h | 4 +- .../src/LocApiRpcAdapter.cpp | 221 +- .../libloc_api-rpc-glue/src/loc_api_fixup.c | 4 +- .../libloc_api-rpc-glue/src/loc_api_log.c | 4 +- .../src/loc_api_rpc_glue.c | 32 +- .../src/loc_api_sync_call.c | 91 +- .../src/loc_apicb_appinit.c | 4 +- .../libloc_api-rpc-stub/Android.mk | 0 .../inc/loc_api_rpcgen_cb_rpc.h | 4 +- .../inc/loc_api_rpcgen_common_rpc.h | 4 +- .../inc/loc_api_rpcgen_rpc.h | 4 +- .../inc/loc_apicb_appinit.h | 4 +- .../src/loc_api_rpcgen_cb_svc.c | 4 +- .../src/loc_api_rpcgen_cb_xdr.c | 4 +- .../src/loc_api_rpcgen_clnt.c | 4 +- .../src/loc_api_rpcgen_common_xdr.c | 4 +- .../src/loc_api_rpcgen_xdr.c | 4 +- .../src/loc_apicb_appinit.c | 4 +- .../libloc_api-rpc-stub/xdr/loc_api.xdr | 466 +- .../libloc_api-rpc-stub/xdr/loc_api_cb.xdr | 318 +- .../xdr/loc_api_common.xdr | 1986 ++-- loc_api/libloc_api-rpc/Android.mk | 0 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 0 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 0 .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 0 .../gen-1240/loc_api_common.xdr | 0 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 0 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 0 .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 0 .../gen-3200/loc_api_common.xdr | 0 loc_api/libloc_api/Android.mk | 0 loc_api/libloc_api/gps.c | 4 +- loc_api/libloc_api/loc_eng.cpp | 14 +- loc_api/libloc_api/loc_eng.h | 4 +- loc_api/libloc_api/loc_eng_ioctl.cpp | 4 +- loc_api/libloc_api/loc_eng_ioctl.h | 4 +- loc_api/libloc_api/loc_eng_ni.cpp | 4 +- loc_api/libloc_api/loc_eng_ni.h | 4 +- loc_api/libloc_api/loc_eng_xtra.cpp | 4 +- loc_api/libloc_api/loc_eng_xtra.h | 4 +- loc_api/libloc_api_50001/Android.mk | 38 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 52 +- loc_api/libloc_api_50001/LocApiAdapter.h | 55 +- loc_api/libloc_api_50001/gps.c | 4 +- loc_api/libloc_api_50001/loc.cpp | 528 +- loc_api/libloc_api_50001/loc.h | 28 +- loc_api/libloc_api_50001/loc_eng.cpp | 942 +- loc_api/libloc_api_50001/loc_eng.h | 108 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 130 +- loc_api/libloc_api_50001/loc_eng_agps.h | 81 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 106 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 12 +- .../loc_eng_dmn_conn_glue_msg.c | 4 +- .../loc_eng_dmn_conn_glue_msg.h | 4 +- .../loc_eng_dmn_conn_glue_pipe.c | 14 +- .../loc_eng_dmn_conn_glue_pipe.h | 4 +- .../loc_eng_dmn_conn_handler.cpp | 174 +- .../loc_eng_dmn_conn_handler.h | 30 +- .../loc_eng_dmn_conn_thread_helper.c | 4 +- .../loc_eng_dmn_conn_thread_helper.h | 4 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 35 +- loc_api/libloc_api_50001/loc_eng_log.h | 8 +- loc_api/libloc_api_50001/loc_eng_msg.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_msg.h | 516 +- loc_api/libloc_api_50001/loc_eng_msg_id.h | 56 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 8 +- loc_api/libloc_api_50001/loc_eng_ni.h | 4 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 703 ++ loc_api/libloc_api_50001/loc_eng_nmea.h | 42 + loc_api/libloc_api_50001/loc_eng_xtra.cpp | 19 +- loc_api/libloc_api_50001/loc_eng_xtra.h | 4 +- loc_api/libloc_api_50001/loc_ulp.h | 415 + loc_api/loc_api_v02/Android.mk | 50 + loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2257 +++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 173 + loc_api/loc_api_v02/loc_api_sync_req.c | 547 + loc_api/loc_api_v02/loc_api_sync_req.h | 68 + loc_api/loc_api_v02/loc_api_v02_client.c | 2210 +++++ loc_api/loc_api_v02/loc_api_v02_client.h | 1437 +++ loc_api/loc_api_v02/loc_api_v02_log.c | 293 + loc_api/loc_api_v02/loc_api_v02_log.h | 50 + loc_api/loc_api_v02/loc_util_log.h | 75 + loc_api/loc_api_v02/location_service_v02.c | 3328 +++++++ loc_api/loc_api_v02/location_service_v02.h | 8783 +++++++++++++++++ loc_api/ulp/inc/ulp.h | 29 +- utils/Android.mk | 8 +- utils/linked_list.c | 4 +- utils/linked_list.h | 4 +- utils/loc_cfg.cpp | 260 +- utils/loc_cfg.h | 49 +- utils/loc_log.cpp | 35 +- utils/loc_log.h | 6 +- utils/loc_target.cpp | 118 + utils/loc_target.h | 52 + utils/log_util.h | 17 +- utils/msg_q.c | 6 +- utils/msg_q.h | 4 +- 110 files changed, 24981 insertions(+), 2393 deletions(-) mode change 100755 => 100644 CleanSpec.mk mode change 100755 => 100644 etc/Android.mk mode change 100644 => 100755 etc/gps.conf mode change 100755 => 100644 loc_api/Android.mk mode change 100755 => 100644 loc_api/NOTICE mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/Android.mk mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr mode change 100755 => 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr mode change 100755 => 100644 loc_api/libloc_api/Android.mk mode change 100755 => 100644 loc_api/libloc_api_50001/Android.mk create mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.cpp create mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.h create mode 100644 loc_api/libloc_api_50001/loc_ulp.h create mode 100644 loc_api/loc_api_v02/Android.mk create mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp create mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h create mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c create mode 100644 loc_api/loc_api_v02/loc_api_sync_req.h create mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c create mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h create mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c create mode 100644 loc_api/loc_api_v02/loc_api_v02_log.h create mode 100644 loc_api/loc_api_v02/loc_util_log.h create mode 100644 loc_api/loc_api_v02/location_service_v02.c create mode 100644 loc_api/loc_api_v02/location_service_v02.h mode change 100755 => 100644 utils/Android.mk create mode 100644 utils/loc_target.cpp create mode 100644 utils/loc_target.h diff --git a/CleanSpec.mk b/CleanSpec.mk old mode 100755 new mode 100644 diff --git a/etc/Android.mk b/etc/Android.mk old mode 100755 new mode 100644 diff --git a/etc/gps.conf b/etc/gps.conf old mode 100644 new mode 100755 index 7ba64837..36cf35fe --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,3 +1,12 @@ +XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin + +# Error Estimate +# _SET = 1 +# _CLEAR = 0 +ERR_ESTIMATE=0 + #Test NTP_SERVER=time.gpsonextra.net #Asia @@ -7,13 +16,9 @@ NTP_SERVER=time.gpsonextra.net #North America # NTP_SERVER=north-america.pool.ntp.org -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin - # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose -DEBUG_LEVEL = 2 +DEBUG_LEVEL = 3 # Intermediate position report, 1=enable, 0=disable INTERMEDIATE_POS=0 @@ -21,18 +26,14 @@ INTERMEDIATE_POS=0 # supl version 1.0 SUPL_VER=0x10000 -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - # GPS Capabilities bit mask -# SCHEDULING = 1 -# MSB = 2 -# MSA = 4 +# SCHEDULING = 0x01 +# MSB = 0x02 +# MSA = 0x04 +# ON_DEMAND_TIME = 0x10 # GEOFENCE = 0x20 -# default = MSA | MSB | SCHEDULING | GEOFENCE -CAPABILITIES=0x27 +# 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 @@ -50,42 +51,25 @@ CAPABILITIES=0x27 # C2K_HOST=c2k.pde.com or IP # C2K_PORT=1234 -################################ -# Sensor Settings -################################ - -# Needs to be set explicitly based on sensor -# There is no default value. -#GYRO_BIAS_RANDOM_WALK= - -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 Control Mode (0=AUTO, 1=FORCE_ON) -SENSOR_CONTROL_MODE=0 - -# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) -SENSOR_USAGE=1 - -# Choose GSIFF sensor provider (1=DSPS, 2=Android NDK) -SENSOR_PROVIDER=1 - -################################ -# Indoor Positioning Settings -################################ -# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only -QUIPC_ENABLED = 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 = 0 ################################ # EXTRA SETTINGS ################################ -# Enable or Disable Wiper (1=Enable, 0=Disable) -ENABLE_WIPER=0 +# NMEA provider (1=Modem Processor, 0=Application Processor) +NMEA_PROVIDER=0 -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) 1: Enable LPP_User_Plane on LTE -LPP_PROFILE = 0 +################################################## +# Select Positioning Protocol on A-GLONASS system +################################################## +# 0x1: RRC CPlane +# 0x2: RRLP UPlane +# 0x4: LLP Uplane +A_GLONASS_POS_PROTOCOL_SELECT = 0 diff --git a/loc_api/Android.mk b/loc_api/Android.mk old mode 100755 new mode 100644 index e9c8d1e6..dd7a8f31 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,18 +1,12 @@ -# Copyright (c) 2009, QUALCOMM USA, INC. -# 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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := -ifeq (exists, $(shell test -d $(TOP)/vendor/qcom/proprietary/qmi-framework && echo exists)) +FEATURE_IPV6 := true +FEATURE_DELEXT := true +FEATURE_ULP := true # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) @@ -23,8 +17,18 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC +ifeq ($(BOARD_USES_QCOM_HARDWARE), true) +#add QMI libraries for QMI targets +QMI_BOARD_PLATFORM_LIST := msm8960 +QMI_BOARD_PLATFORM_LIST += msm8974 +QMI_BOARD_PLATFORM_LIST += msm8226 +QMI_BOARD_PLATFORM_LIST += msm8610 endif +ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) +GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ +endif #is-board-platform-in-list + GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ #call the subfolders diff --git a/loc_api/NOTICE b/loc_api/NOTICE old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk old mode 100755 new mode 100644 index c7a245b8..6a7c11cb --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -20,6 +20,10 @@ LOCAL_CFLAGS+=$(GPS_FEATURES) # for loc_api_fixup.c LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL +ifeq ($(FEATURE_IPV6), true) +LOCAL_CFLAGS += -DFEATURE_IPV6 +endif #FEATURE_IPV6 + LOCAL_SHARED_LIBRARIES:= \ librpc \ libutils \ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h index 7b1f59ba..bdb28be4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -38,6 +38,8 @@ class LocApiRpcAdapter : public LocApiAdapter { // RPC communication establishment rpc_loc_client_handle_type client_handle; rpc_loc_event_mask_type eMask; + int dataEnableLastSet; + char apnLastSet[MAX_APN_LEN]; static const rpc_loc_event_mask_type locBits[]; static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); @@ -71,10 +73,11 @@ public: virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + 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); + 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 @@ -83,20 +86,30 @@ public: 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); + 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); +#ifdef FEATURE_IPV6 virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); +#else + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsType agpsType); +#endif 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); }; #endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h index 8b20a3f5..49a6d0be 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -37,7 +37,7 @@ #define PRINT(x...) do { \ fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stdout, ##x); \ - LOGD(x); \ + ALOGD(x); \ } while(0) #ifdef DEBUG @@ -55,14 +55,14 @@ #define E(x...) do { \ fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ fprintf(stderr, ##x); \ - LOGE(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); \ - LOGE(##msg); \ + ALOGE(##msg); \ } \ } while(0) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h index 9bfe5f0c..c483b4a1 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h index c0bcda16..f0374280 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h index 16552a0c..010e1478 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h index 266f8ec8..43208bda 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h index 8dbcb9ac..ba41d08b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index ec98bed2..9c2749bd 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -98,7 +98,7 @@ static void loc_rpc_global_cb(void* user, CLIENT* clnt, enum rpc_reset_event eve } -extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng) +LocApiAdapter* getLocApiAdapter(LocEng &locEng) { return new LocApiRpcAdapter(locEng); } @@ -119,8 +119,10 @@ const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : LocApiAdapter(locEng), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - eMask(convertMask(locEng.eventMask)) + eMask(convertMask(locEng.eventMask)), + dataEnableLastSet(-1) { + memset(apnLastSet, 0, sizeof(apnLastSet)); loc_api_glue_init(); } @@ -298,9 +300,7 @@ LocApiRpcAdapter::stopFix() { } enum loc_api_adapter_err -LocApiRpcAdapter::setPositionMode(LocPositionMode mode, - GpsPositionRecurrence recurrence, uint32_t min_interval, - uint32_t preferred_accuracy, uint32_t preferred_time) +LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_fix_criteria_s_type *fix_criteria_ptr; @@ -308,10 +308,13 @@ LocApiRpcAdapter::setPositionMode(LocPositionMode mode, rpc_loc_operation_mode_e_type op_mode; int ret_val; - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) client_handle, min_interval, mode); + if (NULL != posMode) + fixCriteria = *posMode; - switch (mode) + 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; @@ -329,6 +332,7 @@ LocApiRpcAdapter::setPositionMode(LocPositionMode mode, 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; @@ -339,29 +343,22 @@ LocApiRpcAdapter::setPositionMode(LocPositionMode mode, fix_criteria_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; 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 = min_interval; + fix_criteria_ptr->min_interval = fixCriteria.min_interval; fix_criteria_ptr->preferred_operation_mode = op_mode; - if (min_interval > 0) { - fix_criteria_ptr->min_interval = min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - }else if(min_interval == 0) - { - /*If the framework passes in 0 transalate it into the maximum frequency we can report positions - which is 1 Hz or once very second */ - fix_criteria_ptr->min_interval = MIN_POSSIBLE_FIX_INTERVAL; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - } - if (preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = preferred_accuracy; + 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 (preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = preferred_time; + 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 (recurrence) { + switch (fixCriteria.recurrence) { case GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; @@ -484,20 +481,42 @@ LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, } enum loc_api_adapter_err - LocApiRpcAdapter::setAPN(char* apn, int len) +LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) { - 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, len+1); + 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); - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); + if (false == navigating) { + 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 LocApiRpcAdapter::setInSession(bool inSession) +{ + LocApiAdapter::setInSession(inSession); + if (false == navigating) { + enableData(dataEnableLastSet, true); + setAPN(apnLastSet, sizeof(apnLastSet)-1, true); + } } enum loc_api_adapter_err @@ -567,18 +586,26 @@ LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) } enum loc_api_adapter_err -LocApiRpcAdapter::enableData(int enable) +LocApiRpcAdapter::enableData(int enable, boolean force) { - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_SET_DATA_ENABLE, {0}}; + enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; + if (force || dataEnableLastSet != enable) { + dataEnableLastSet = enable; - ioctl_data.rpc_loc_ioctl_data_u_type_u.data_enable = enable; - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_DATA_ENABLE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); + if (false == navigating) { + 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 @@ -598,9 +625,13 @@ LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { - GpsLocation location = {0}; + 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 @@ -613,56 +644,89 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca (location_report_ptr->latitude != 0 || location_report_ptr->longitude != 0)) { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; + 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.timestamp = location_report_ptr->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.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->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_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; + location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); } // Heading if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->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.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->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"); LocApiAdapter::reportPosition(location, + locationExtended, locEngHandle.extPosInfo((void*)location_report_ptr), (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS)); + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + tech_Mask); } } else { LocApiAdapter::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); @@ -677,6 +741,8 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus = {0}; + GpsLocationExtended locationExtended = {0}; + locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; const rpc_loc_sv_info_s_type *sv_info_ptr; @@ -760,9 +826,20 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) } } + 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) { LocApiAdapter::reportSv(SvStatus, + locationExtended, locEngHandle.extSvInfo((void*)gnss_report_ptr)); } } @@ -881,13 +958,22 @@ LocApiRpcAdapter::setXtraData(char* data, int length) return convertErr(rpc_ret_val); } +#ifdef FEATURE_IPV6 enum loc_api_adapter_err LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) +#else +enum loc_api_adapter_err +LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType) +#endif { 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; +#ifdef FEATURE_IPV6 if (AGPS_TYPE_INVALID == agpsType) { +#else + if (false) { +#endif rpc_loc_server_open_status_s_type *conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; @@ -924,6 +1010,7 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerTy conn_multi_open_status_ptr->apn_name[0] = 0; } +#ifdef FEATURE_IPV6 switch(bearer) { case AGPS_APN_BEARER_IPV4: @@ -938,7 +1025,9 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerTy default: conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_PPP; } - +#else + conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IP; +#endif 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, @@ -992,16 +1081,22 @@ void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_requ 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 { +#ifdef FEATURE_IPV6 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); +#else + break; +#endif } requestATL(connHandle, agps_type); break; +#ifdef FEATURE_IPV6 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; +#endif 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); diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c index 32e3cda8..837ef113 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c index 6aa5254f..256545ad 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c index 10b2d221..11c9e3d4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -62,8 +62,8 @@ /* Logging Improvement */ #include "log_util.h" -/* Uncomment to force LOGD messages */ -// #define LOGD LOGI +/* Uncomment to force ALOGD messages */ +// #define ALOGD ALOGI /*===================================================================== External declarations @@ -316,30 +316,23 @@ rpc_loc_client_handle_type loc_open ( rpc_loc_open_args args; args.event_reg_mask = event_reg_mask; - int i; + int i, j = LOC_API_CB_MAX_CLIENTS; for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) { - if (loc_glue_callback_table[i].cb_func == event_callback || - loc_glue_callback_table[i].user == userData) + 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) { - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].cb_func == NULL) - { - 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; - break; - } - } + i = j; } if (i == LOC_API_CB_MAX_CLIENTS) @@ -348,6 +341,10 @@ rpc_loc_client_handle_type loc_open ( 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); @@ -405,6 +402,7 @@ void loc_clear(rpc_loc_client_handle_type handle) { 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; } } diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c index e2a5786f..9541a40b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -195,7 +195,7 @@ void loc_api_callback_process_sync_call( { int i; - LOGV("loc_handle = 0x%lx, loc_event = 0x%lx", loc_handle, loc_event); + 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]; @@ -211,7 +211,7 @@ void loc_api_callback_process_sync_call( slot->loc_cb_received_event_mask = loc_event; - LOGV("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); + 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; @@ -252,21 +252,19 @@ static int loc_lock_a_slot() loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; if (pthread_mutex_trylock(&slot->lock) == EBUSY) { - LOGV("trylock EBUSY : %d", i); + ALOGV("trylock EBUSY : %d", i); continue; } if (!slot->in_use && !slot->not_available) { select_id = i; - slot->in_use = 1; - slot->signal_sent = 0; /* Return from here and leave the mutex locked. * will unlock it in loc_unlock_slot() */ break; } - /* LOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */ + /* ALOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */ pthread_mutex_unlock(&slot->lock); } @@ -278,7 +276,7 @@ static int loc_lock_a_slot() FUNCTION loc_unlock_slot DESCRIPTION - Frees a buffer slot after the synchronous API call + Unlocks a buffer slot DEPENDENCIES N/A @@ -292,13 +290,58 @@ SIDE EFFECTS ===========================================================================*/ static void loc_unlock_slot(int select_id) { - loc_sync_data.slots[select_id].in_use = 0; - 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 @@ -399,7 +442,7 @@ static int loc_api_wait_callback( ) { int ret_val = RPC_LOC_API_SUCCESS; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ + int rc = 0; /* return code from pthread calls */ struct timespec expire_time; @@ -417,7 +460,7 @@ static int loc_api_wait_callback( if (rc == ETIMEDOUT) { ret_val = RPC_LOC_API_TIMEOUT; /* Timed out */ - LOGE("TIMEOUT: %d", select_id); + ALOGE("TIMEOUT: %d", select_id); } else { /* Obtained the first awaited callback */ @@ -462,29 +505,38 @@ int loc_api_sync_ioctl if (select_id < 0 || select_id >= loc_sync_data.num_of_slots) { - LOGE("slot not available ioctl_type = %s", + 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) { - LOGE("loc_ioctl failed select_id = %d, ioctl_type %s, returned %s", + 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 { - LOGV("select_id = %d, ioctl_type %d, returned RPC_LOC_API_SUCCESS", + 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 - LOGE("callback wait failed select_id = %d, ioctl_type %s, returned %s", + 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 @@ -493,15 +545,16 @@ int loc_api_sync_ioctl if (callback_data.status != RPC_LOC_API_SUCCESS) { rc = callback_data.status; - LOGE("callback status failed select_id = %d, ioctl_type %s, returned %s", + 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 { - LOGV("callback status success select_id = %d, ioctl_type %d, returned %d", + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c index b257fb81..db5b291a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h index 47478e80..87f2c377 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h index 507103ce..8107de2a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h index f11bb654..6138432e 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h index e109852c..875c4f08 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c index b0443487..2ef5852e 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c index 7f519281..ad171dc4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c index d2152ab4..3e39576b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c index da066b42..21be8f43 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c index e8a2aa78..a0fdcabe 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c index b4aeb5e7..b469eb0a 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr old mode 100755 new mode 100644 index 3d6c759e..82dca569 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -26,236 +26,236 @@ * 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. - - --------------------------------------------------------------------------- +/* 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; + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr old mode 100755 new mode 100644 index 36d0e6d2..4756c6c5 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -26,162 +26,162 @@ * 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. - - --------------------------------------------------------------------------- +/* 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; + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr old mode 100755 new mode 100644 index fcdaf57f..e059c661 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -26,996 +26,996 @@ * 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. - - --------------------------------------------------------------------------- +/* 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; -}; - + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + 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/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk old mode 100755 new mode 100644 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c index 5f6d8095..36bfcb63 100644 --- a/loc_api/libloc_api/gps.c +++ b/loc_api/libloc_api/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 68ac002c..944326b0 100644 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -78,8 +78,8 @@ static int loc_eng_agps_data_conn_failed(); static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); -static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, +static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, + rpc_loc_event_mask_type loc_event, const rpc_loc_event_payload_u_type* loc_event_payload); static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); @@ -743,7 +743,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) { - GpsLocation location; + UlpLocation location; LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); @@ -831,7 +831,7 @@ static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus; int num_svs_max, i; - const rpc_loc_sv_info_s_type *sv_info_ptr; + const rpc_loc_sv_info_s_type *sv_info_ptr; LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", (uint32) gnss_report_ptr->valid_mask, @@ -1273,7 +1273,7 @@ static void loc_eng_process_atl_deferred_action (int flags) LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - + if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) { ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h index 553a97e0..b8553316 100644 --- a/loc_api/libloc_api/loc_eng.h +++ b/loc_api/libloc_api/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp index a43d8cca..dc7b2c11 100644 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ b/loc_api/libloc_api/loc_eng_ioctl.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h index eb0c201a..b8191256 100644 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ b/loc_api/libloc_api/loc_eng_ioctl.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp index 3df0af14..11d7abac 100644 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ b/loc_api/libloc_api/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h index 193b9f85..cfd2ab18 100644 --- a/loc_api/libloc_api/loc_eng_ni.h +++ b/loc_api/libloc_api/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp index 1ec3bf07..0c3e476a 100644 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ b/loc_api/libloc_api/loc_eng_xtra.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h index 82778ae5..a72b1528 100644 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ b/loc_api/libloc_api/loc_eng_xtra.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk old mode 100755 new mode 100644 index 4af7c1a5..9cd3b197 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -1,12 +1,6 @@ ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image -BIT_ENABLED_BOARD_PLATFORM_LIST := msm7630_fusion -BIT_ENABLED_BOARD_PLATFORM_LIST += msm8660 -ifeq ($(call is-board-platform-in-list,$(BIT_ENABLED_BOARD_PLATFORM_LIST)),true) -FEATURE_GNSS_BIT_API := true -endif # is-board-platform-in-list - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -31,6 +25,14 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ +ifeq ($(FEATURE_IPV6), true) +LOCAL_CFLAGS += -DFEATURE_IPV6 +endif #FEATURE_IPV6 + +ifeq ($(FEATURE_DELEXT), true) +LOCAL_CFLAGS += -DFEATURE_DELEXT +endif #FEATURE_DELEXT + LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils @@ -44,7 +46,8 @@ LOCAL_COPY_HEADERS:= \ loc_eng_agps.h \ loc_eng_msg.h \ loc_eng_msg_id.h \ - loc_eng_log.h + loc_eng_log.h \ + loc_ulp.h LOCAL_PRELINK_MODULE := false @@ -61,19 +64,15 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ liblog \ libloc_adapter \ - libgps.utils \ - libdl + libgps.utils LOCAL_SRC_FILES += \ loc_eng.cpp \ loc_eng_agps.cpp \ loc_eng_xtra.cpp \ loc_eng_ni.cpp \ - loc_eng_log.cpp - -ifeq ($(FEATURE_GNSS_BIT_API), true) -LOCAL_CFLAGS += -DFEATURE_GNSS_BIT_API -endif # FEATURE_GNSS_BIT_API + loc_eng_log.cpp \ + loc_eng_nmea.cpp LOCAL_SRC_FILES += \ loc_eng_dmn_conn.cpp \ @@ -86,6 +85,10 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ +ifeq ($(FEATURE_IPV6), true) +LOCAL_CFLAGS += -DFEATURE_IPV6 +endif #FEATURE_IPV6 + LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ hardware/qcom/gps/loc_api/ulp/inc @@ -118,9 +121,14 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ \ +ifeq ($(FEATURE_IPV6), true) +LOCAL_CFLAGS += -DFEATURE_IPV6 +endif #FEATURE_IPV6 + ## Includes LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/ulp/inc LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index a6a1ed94..8e5b1ee1 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -45,11 +45,13 @@ LocEng::LocEng(void* caller, gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, + loc_msg_sender msgUlpSender, loc_ext_parser posParser, loc_ext_parser svParser) : owner(caller), eventMask(emask), acquireWakelock(acqwl), releaseWakeLock(relwl), sendMsge(msgSender), + sendUlpMsg(msgUlpSender), extPosInfo(NULL == posParser ? noProc : posParser), extSvInfo(NULL == svParser ? noProc : svParser) { @@ -57,7 +59,7 @@ LocEng::LocEng(void* caller, } LocApiAdapter::LocApiAdapter(LocEng &locEng) : - locEngHandle(locEng) + locEngHandle(locEng), fixCriteria(), navigating(false) { LOC_LOGD("LocApiAdapter created"); } @@ -75,21 +77,14 @@ LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) handle = dlopen ("libloc_api_v02.so", RTLD_NOW); if (!handle) { - LOC_LOGI("%s: dlopen(libloc_api_v02.so) failed, trying to load libloc_api-rpc-qc.so", __FUNCTION__); handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); } - else - LOC_LOGE("%s: dlopen(libloc_api_v02.so) succeeded.", __FUNCTION__); if (!handle) { - LOC_LOGI("%s: dlopen(libloc_api-rpc-qc.so) failed, constructing LocApiAdapter", __FUNCTION__); adapter = new LocApiAdapter(locEng); } else { getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); - if (!getHandle) { - LOC_LOGE("%s: dlsym(getLocApiAdapter) failed", __FUNCTION__); - return NULL; - } + adapter = (*getHandle)(locEng); } @@ -141,21 +136,36 @@ int LocApiAdapter::decodeAddress(char *addr_string, int string_size, return idxOutput; } -void LocApiAdapter::reportPosition(GpsLocation &location, +void LocApiAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, void* locationExt, - enum loc_sess_status status) + enum loc_sess_status status, + LocPosTechMask loc_technology_mask ) { loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, location, + locationExtended, locationExt, - status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); + status, + loc_technology_mask)); + if (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } } -void LocApiAdapter::reportSv(GpsSvStatus &svStatus, void* svExt) +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { - loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, svExt)); - locEngHandle.sendMsge(locEngHandle.owner, msg); + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, 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 (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } } void LocApiAdapter::reportStatus(GpsStatusValue status) @@ -192,9 +202,9 @@ void LocApiAdapter::requestXtraData() void LocApiAdapter::requestTime() { - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); + LOC_LOGD("loc_event_cb: XTRA time download request"); + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + locEngHandle.sendMsge(locEngHandle.owner, msg); } void LocApiAdapter::requestLocation() diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 5e8a1da8..65fac91a 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -32,9 +32,13 @@ #include #include #include +#include #include +#include -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ +#define MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) enum loc_api_adapter_err { LOC_API_ADAPTER_ERR_SUCCESS = 0, @@ -85,6 +89,7 @@ struct LocEng { const gps_acquire_wakelock acquireWakelock; const gps_release_wakelock releaseWakeLock; const loc_msg_sender sendMsge; + const loc_msg_sender sendUlpMsg; const loc_ext_parser extPosInfo; const loc_ext_parser extSvInfo; @@ -93,6 +98,7 @@ struct LocEng { gps_acquire_wakelock acqwl, gps_release_wakelock relwl, loc_msg_sender msgSender, + loc_msg_sender msgUlpSender, loc_ext_parser posParser, loc_ext_parser svParser); }; @@ -100,6 +106,8 @@ struct LocEng { class LocApiAdapter { protected: const LocEng locEngHandle; + LocPosMode fixCriteria; + bool navigating; LocApiAdapter(LocEng &locEng); @@ -114,10 +122,14 @@ public: static int decodeAddress(char *addr_string, int string_size, const char *data, int data_size); - void reportPosition(GpsLocation &location, + void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, void* locationExt, - enum loc_sess_status status); - void reportSv(GpsSvStatus &svStatus, void* svExt); + enum loc_sess_status status, + LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); + void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); void reportAgpsStatus(AGpsStatus &agpsStatus); @@ -159,7 +171,7 @@ public: inline virtual enum loc_api_adapter_err setXtraData(char* data, int length) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 inline virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} @@ -172,9 +184,7 @@ public: atlCloseStatus(int handle, int is_succ) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err - setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) + setPositionMode(const LocPosMode *posMode) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setServer(const char* url, int len) @@ -189,16 +199,37 @@ public: inline virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setLPPConfig(uint32_t profile) + {LOC_LOGW("%s: default implementation invoked", __func__); + return LOC_API_ADAPTER_ERR_SUCCESS; } inline virtual enum loc_api_adapter_err setSensorControlConfig(int sensorUsage) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err - setSensorProperties(float gyroBiasVarianceRandomWalk) + 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) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setExtPowerConfig(int isBatteryCharging) + {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol) + {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + + inline const LocPosMode& getPositionMode() const {return fixCriteria;} + + inline bool isInSession() { return navigating; } + inline virtual void setInSession(bool inSession) { navigating = inSession; } }; extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng); diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index c9e4999b..82bc7420 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 154b42e6..18d0fe05 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -31,16 +31,28 @@ #define LOG_TAG "LocSvc_afw" #include -#include +#include #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include + +//Globals defns +static const ulpInterface * loc_eng_ulp_inf = NULL; +static const ulpInterface * loc_eng_get_ulp_inf(void); static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; -static void loc_cb(GpsLocation* location, void* locExt); +static void loc_cb(UlpLocation* location, void* locExt); static void sv_cb(GpsSvStatus* sv_status, void* svExt); static const GpsGeofencingInterface* get_geofence_interface(void); @@ -56,10 +68,19 @@ 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); + +//ULP/Hybrid provider Function definitions +static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks); +static int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report); +static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callback); +static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings); +static int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria); static const void* loc_get_extension(const char* name); -#ifdef QCOM_FEATURE_ULP -static int loc_update_criteria(UlpLocationCriteria criteria); -#endif +static ulp_location_callback ulp_loc_cb = NULL; +static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks); +static int loc_ulp_engine_start(); +static int loc_ulp_engine_stop(); + // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = @@ -74,14 +95,11 @@ static const GpsInterface sLocEngInterface = loc_delete_aiding_data, loc_set_position_mode, loc_get_extension -#ifdef QCOM_FEATURE_ULP - ,loc_update_criteria -#endif }; // Function declarations for sLocEngAGpsInterface static void loc_agps_init(AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 static int loc_agps_open(AGpsType agpsType, const char* apn, AGpsBearerType bearerType); static int loc_agps_closed(AGpsType agpsType); @@ -141,7 +159,15 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = loc_agps_ril_update_network_availability }; -#ifdef QCOM_FEATURE_ULP +static const UlpEngineInterface sLocEngUlpEngInterface = +{ + sizeof(UlpEngineInterface), + loc_ulp_engine_init, + loc_ulp_engine_update_criteria, + loc_ulp_engine_start, + loc_ulp_engine_stop +}; + static bool loc_inject_raw_command(char* command, int length); static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = @@ -149,9 +175,23 @@ static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = sizeof(InjectRawCmdInterface), loc_inject_raw_command }; -#endif + +//ULP/Hybrid provider interfaces +static const UlpNetworkInterface sUlpNetworkInterface = +{ + sizeof(UlpNetworkInterface), + loc_ulp_network_init, + loc_ulp_send_network_position +}; +static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = +{ + sizeof(UlpPhoneContextInterface), + loc_ulp_phone_context_init, + loc_ulp_phone_context_settings_update +}; static loc_eng_data_s_type loc_afw_data; +static UlpCallbacks ulp_cb_data; static int gss_fd = 0; /*=========================================================================== @@ -195,20 +235,43 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if (strcmp(baseband,"apq") == 0) - { + targetEnumType target = TARGET_OTHER; + loc_eng_read_config(); + + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + //APQ8064 and APQ8030 + if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); - if (gss_fd < 0) { + 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); } - LOC_LOGD("GSS open success! CAPABILITIES %0x\n", gps_conf.CAPABILITIES); } - + //MPQ8064 + else if(target == TARGET_MPQ8064) { + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; + } return &sLocEngInterface; } + +static void loc_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); +} + /*=========================================================================== FUNCTION loc_init @@ -228,7 +291,13 @@ SIDE EFFECTS ===========================================================================*/ static int loc_init(GpsCallbacks* callbacks) { + int retVal = -1; ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE("loc_init failed. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | LOC_API_ADAPTER_BIT_SATELLITE_REPORT | @@ -247,14 +316,36 @@ static int loc_init(GpsCallbacks* callbacks) callbacks->release_wakelock_cb, /* release_wakelock_cb */ callbacks->create_thread_cb, /* create_thread_cb */ NULL, /* location_ext_parser */ - NULL /* sv_ext_parser */}; + NULL, /* sv_ext_parser */ + callbacks->request_utc_time_cb /* request_utc_time_cb */}; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; - int ret_val = loc_eng_init(loc_afw_data, &clientCallbacks, event); + if (loc_eng_ulp_inf == NULL) + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, + NULL); + else + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, + loc_ulp_msg_sender); - EXIT_LOG(%d, ret_val); - return ret_val; + if (ulp_cb_data.phone_context_cb) { + //ULP initilization already occurred so redo intializations here + //to restore callback table + loc_eng_ulp_phone_context_init(loc_afw_data, ulp_cb_data.phone_context_cb); + } + + if (ulp_cb_data.network_location_cb) { + loc_eng_ulp_network_init(loc_afw_data, ulp_cb_data.network_location_cb); + } + + + int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); + //Initialize the cached min_interval + loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; + LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1); + + EXIT_LOG(%d, retVal); + return retVal; } /*=========================================================================== @@ -279,6 +370,15 @@ static void loc_cleanup() loc_eng_cleanup(loc_afw_data); gps_loc_cb = NULL; gps_sv_cb = NULL; + + /* + * if (get_target() == TARGET_NAME_APQ8064_STANDALONE) + * { + * close(gss_fd); + * LOC_LOGD("GSS shutdown.\n"); + * } + */ + EXIT_LOG(%s, VOID_RET); } @@ -326,8 +426,27 @@ SIDE EFFECTS static int loc_stop() { ENTRY_LOG(); - int ret_val = loc_eng_stop(loc_afw_data); - + int ret_val = -1; + if (loc_afw_data.ulp_initialized) { + //ULP initialized so we need to simulate REMOVE_CRITERIA for + //last client to libulp and we dont need to send loc_eng_stop + UlpLocationCriteria native_criteria; + native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | + ULP_CRITERIA_HAS_MIN_INTERVAL); + native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; + native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now + native_criteria.recurrence_type = loc_afw_data.recurrence_type_cached; + loc_afw_data.recurrence_type_cached = ULP_LOC_RECURRENCE_PERIODIC; + //For a GPS client horizontal_accuracy & power_consumption are irrelevant + native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; + native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; + native_criteria.action = ULP_REMOVE_CRITERIA; + native_criteria.min_interval = loc_afw_data.min_interval_cached; + loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; + ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); + } else { + ret_val = loc_eng_stop(loc_afw_data); + } EXIT_LOG(%d, ret_val); return ret_val; } @@ -355,21 +474,46 @@ static int loc_set_position_mode(GpsPositionMode mode, uint32_t preferred_time) { ENTRY_LOG(); - 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; + int ret_val = -1; + if (!loc_afw_data.ulp_initialized) { + 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; + } + + LocPosMode params(locMode, recurrence, min_interval, + preferred_accuracy, preferred_time, NULL, NULL); + ret_val = loc_eng_set_position_mode(loc_afw_data, params); + } else { + //ULP initialized so suppress set_position_mode updates to loc_eng + UlpLocationCriteria native_criteria; + native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | + ULP_CRITERIA_HAS_MIN_INTERVAL); + native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; + native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now + + if (LOC_POSITION_MODE_MS_ASSISTED == mode) + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_SINGLE; + else + native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; + + //For a GPS client horizontal_accuracy & power_consumption are irrelevant + native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; + native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; + native_criteria.action = ULP_ADD_CRITERIA; + native_criteria.min_interval = min_interval; + loc_afw_data.min_interval_cached = min_interval; //cache a copy + loc_afw_data.recurrence_type_cached = native_criteria.recurrence_type; //cache a copy + ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); } - int ret_val = loc_eng_set_position_mode(loc_afw_data, locMode, - recurrence, min_interval, - preferred_accuracy, preferred_time); EXIT_LOG(%d, ret_val); return ret_val; @@ -395,7 +539,6 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain { ENTRY_LOG(); int ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - EXIT_LOG(%d, ret_val); return ret_val; } @@ -419,9 +562,32 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { + static bool initialized = false; + static bool enable_cpi = true; ENTRY_LOG(); - int ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + if(!initialized) + { + char value[PROPERTY_VALUE_MAX]; + memset(value, 0, sizeof(value)); + (void)property_get("persist.gps.qc_nlp_in_use", value, "0"); + if(0 == strcmp(value, "1")) + { + enable_cpi = false; + LOC_LOGI("GPS HAL coarse position injection disabled"); + } + else + { + LOC_LOGI("GPS HAL coarse position injection enabled"); + } + initialized = true; + } + + int ret_val = 0; + if(enable_cpi) + { + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + } EXIT_LOG(%d, ret_val); return ret_val; } @@ -455,7 +621,6 @@ static void loc_delete_aiding_data(GpsAidingData f) EXIT_LOG(%s, VOID_RET); } -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_update_criteria @@ -472,7 +637,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_update_criteria(UlpLocationCriteria criteria) +int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria) { ENTRY_LOG(); int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); @@ -480,7 +645,6 @@ static int loc_update_criteria(UlpLocationCriteria criteria) EXIT_LOG(%d, ret_val); return ret_val; } -#endif const GpsGeofencingInterface* get_geofence_interface(void) { @@ -532,11 +696,12 @@ SIDE EFFECTS N/A ===========================================================================*/ -static const void* loc_get_extension(const char* name) +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; @@ -554,24 +719,38 @@ static const void* loc_get_extension(const char* name) else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { - ret_val = &sLocEngAGpsRilInterface; + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if (strcmp(baseband, "csfb") == 0) + { + ret_val = &sLocEngAGpsRilInterface; + } } - - else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + else if (strcmp(name, ULP_ENGINE_INTERFACE) == 0) { - ret_val = get_geofence_interface(); + ret_val = &sLocEngUlpEngInterface; } -#ifdef QCOM_FEATURE_ULP else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) { ret_val = &sLocEngInjectRawCmdInterface; } -#endif + else if(strcmp(name, ULP_PHONE_CONTEXT_INTERFACE) == 0) + { + ret_val = &sLocEngUlpPhoneContextInterface; + } + else if(strcmp(name, ULP_NETWORK_INTERFACE) == 0) + { + ret_val = &sUlpNetworkInterface; + } + else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + { + ret_val = get_geofence_interface(); + } + else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); } - EXIT_LOG(%p, ret_val); return ret_val; } @@ -616,7 +795,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 static int loc_agps_open(AGpsType agpsType, const char* apn, AGpsBearerType bearerType) { @@ -654,7 +833,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 static int loc_agps_closed(AGpsType agpsType) { ENTRY_LOG(); @@ -691,7 +870,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 int loc_agps_open_failed(AGpsType agpsType) { ENTRY_LOG(); @@ -875,7 +1054,6 @@ static void loc_agps_ril_update_network_availability(int available, const char* EXIT_LOG(%s, VOID_RET); } -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_inject_raw_command @@ -899,19 +1077,21 @@ static bool loc_inject_raw_command(char* command, int length) EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); return ret_val; } -#endif - -static void loc_cb(GpsLocation* location, void* locExt) +static void loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); - if (NULL != gps_loc_cb && NULL != location) { -#ifdef QCOM_FEATURE_ULP + if (NULL != location) { CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); -#else - CALLBACK_LOG_CALLFLOW("location_cb - at", %llu, location->timestamp); -#endif - gps_loc_cb(location); + if (ULP_LOCATION_IS_FROM_GNSS == location->position_source ) { + if (NULL != gps_loc_cb) { + gps_loc_cb(&location->gpsLocation); + } + } else { + if (NULL != ulp_loc_cb) { + ulp_loc_cb(location); + } + } } EXIT_LOG(%s, VOID_RET); } @@ -925,3 +1105,219 @@ static void sv_cb(GpsSvStatus* sv_status, void* svExt) } EXIT_LOG(%s, VOID_RET); } + +/*=========================================================================== +FUNCTION loc_eng_get_ulp_inf + +DESCRIPTION + This function checks if ULP is enabled, and loads the libulp2.so and + returns its interface + +DEPENDENCIES + None + +RETURN VALUE + interface pointer to libulp: no error + NULL: errors + +SIDE EFFECTS + N/A + +===========================================================================*/ +const ulpInterface * loc_eng_get_ulp_inf(void) +{ + ENTRY_LOG(); + void *handle; + const char *error; + get_ulp_interface* get_ulp_inf; + const ulpInterface* loc_eng_ulpInf = NULL; + + dlerror(); /* Clear any existing error */ + + handle = dlopen ("libulp2.so", RTLD_NOW); + + if (!handle) + { + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlopen for libulp.so failed, error = %s\n", __func__, error); + } + goto exit; + } + dlerror(); /* Clear any existing error */ + get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); + goto exit; + } + + // Initialize the ULP interface + loc_eng_ulpInf = get_ulp_inf(); + +exit: + EXIT_LOG(%d, loc_eng_ulpInf == NULL); + return loc_eng_ulpInf; +} + +/*=========================================================================== +FUNCTION loc_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) +{ + ENTRY_LOG(); + int ret_val = -1; + if (loc_afw_data.context) { + ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); + } else + { + ulp_cb_data.phone_context_cb = callbacks; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} +/*=========================================================================== +FUNCTION loc_ulp_phone_context_settings_update + +DESCRIPTION + This is used to inform the ULP module of phone settings changes carried out + by the users +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ + +static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings) +{ + ENTRY_LOG(); + int ret_val = -1; + ret_val = loc_eng_ulp_phone_context_settings_update(loc_afw_data, settings); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) +{ + ENTRY_LOG(); + int ret_val = -1; + if (loc_afw_data.context) { + ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); + } else + { + ulp_cb_data.network_location_cb = callbacks; + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_send_network_position + +DESCRIPTION + Ulp send data + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report) +{ + ENTRY_LOG(); + int ret_val = -1; + ret_val = loc_eng_ulp_send_network_position(loc_afw_data, position_report); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_ulp_engine_init + +DESCRIPTION + Initialize the ULP Engine interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks) +{ + int retVal = -1; + ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE("loc_ulp_engine_init failed. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } + //Intilize the ulp call back cache at this point + memset(&ulp_cb_data, 0, sizeof(UlpCallbacks)); + ulp_loc_cb = callbacks->location_cb; + retVal = 0; + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_ulp_engine_start() +{ + ENTRY_LOG(); + int ret_val = loc_eng_start(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +static int loc_ulp_engine_stop() +{ + ENTRY_LOG(); + int ret_val = loc_eng_stop(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + + diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index bf942373..51273ddf 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -37,6 +37,9 @@ extern "C" { #include #include #include +#include + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ typedef enum loc_server_type { LOC_AGPS_CDMA_PDE_SERVER, @@ -52,10 +55,11 @@ typedef enum loc_position_mode_type { LOC_POSITION_MODE_RESERVED_1, LOC_POSITION_MODE_RESERVED_2, LOC_POSITION_MODE_RESERVED_3, - LOC_POSITION_MODE_RESERVED_4 + LOC_POSITION_MODE_RESERVED_4, + LOC_POSITION_MODE_RESERVED_5 } LocPositionMode; -typedef void (*loc_location_cb_ext) (GpsLocation* location, void* locExt); +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); @@ -70,14 +74,30 @@ typedef struct { 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; } LocCallbacks; +typedef struct { + UlpNetworkLocationCallbacks* network_location_cb; + UlpPhoneContextCallbacks* phone_context_cb; +} UlpCallbacks; + 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) + +void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3fe9a77e..8fa87a0b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -43,7 +43,6 @@ #include #include #include -#include #include "LocApiAdapter.h" @@ -58,9 +57,9 @@ #include #include #include +#include #include - -#include "ulp.h" +#include #include "log_util.h" #include "loc_eng_log.h" @@ -68,31 +67,106 @@ #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 static void loc_eng_deferred_action_thread(void* context); static void* loc_eng_create_msg_q(); static void loc_eng_free_msg(void* msg); -struct LocEngContext { - // Data variables used by deferred action thread - const void* deferred_q; - const pthread_t deferred_action_thread; - static LocEngContext* get(gps_create_thread threadCreator); - void drop(); - static pthread_mutex_t lock; - static pthread_cond_t cond; -private: - int counter; - static LocEngContext *me; - LocEngContext(gps_create_thread threadCreator); -}; - pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; LocEngContext* LocEngContext::me = NULL; +boolean configAlreadyRead = false; +unsigned int agpsStatus = 0; + +loc_gps_cfg_s_type gps_conf; +loc_sap_cfg_s_type sap_conf; + +/* Parameter spec table */ +static loc_param_s_type loc_parameter_table[] = +{ + {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, + {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, + {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, NULL, 'n'}, + {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, + {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, + {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, + {"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'}, + {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, + {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, +}; + +static void loc_default_parameters(void) +{ + /* defaults */ + gps_conf.INTERMEDIATE_POS = 0; + gps_conf.ACCURACY_THRES = 0; + gps_conf.ENABLE_WIPER = 0; + gps_conf.NMEA_PROVIDER = 0; + gps_conf.SUPL_VER = 0x10000; + gps_conf.CAPABILITIES = 0x7; + + 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; + + /* 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; +} LocEngContext::LocEngContext(gps_create_thread threadCreator) : deferred_q((const void*)loc_eng_create_msg_q()), + + //TODO: should we conditionally create ulp msg q? + ulp_q((const void*)loc_eng_create_msg_q()), + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), counter(0) { @@ -106,11 +180,6 @@ LocEngContext* LocEngContext::get(gps_create_thread threadCreator) pthread_mutex_lock(&lock); // gonna need mutex protection here... if (NULL == me) { - // gps.conf is not part of the context class. But we only want to parse the conf - // file once. This is the only good place to ensure that. - // In fact one day the conf file should go into context as well. - loc_read_gps_conf(); - me = new LocEngContext(threadCreator); } me->counter++; @@ -134,6 +203,9 @@ void LocEngContext::drop() pthread_cond_wait(&cond, &lock); msg_q_destroy((void**)&deferred_q); + + msg_q_destroy((void**)&ulp_q); + delete me; me = NULL; } @@ -162,13 +234,6 @@ 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 char extra_data[100]; - -#ifdef QCOM_FEATURE_ULP -// ULP integration -static const ulpInterface* locEngUlpInf = NULL; -static int loc_eng_ulp_init(void* handle) ; -#endif - /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -221,14 +286,17 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event) -{ - ENTRY_LOG_CALLFLOW(); + LOC_API_ADAPTER_EVENT_MASK_T event, + void (*loc_external_msg_sender) (void*, void*)) +{ + int ret_val =-1; + + ENTRY_LOG_CALLFLOW(); if (NULL == callbacks || 0 == event) { LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); - EXIT_LOG(%d, 0); - return 0; + EXIT_LOG(%d, ret_val); + return ret_val; } STATE_CHECK((NULL == loc_eng_data.context), @@ -250,7 +318,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.nmea_cb = callbacks->nmea_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.intermediateFix = gps_conf.INTERMEDIATE_POS; // initial states taken care of by the memset above @@ -258,16 +326,21 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, // loc_eng_data.fix_session_status -- GPS_STATUS_NONE; // loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE; -#ifdef QCOM_FEATURE_ULP - loc_eng_ulp_init(&loc_eng_data); -#endif + 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 + { + loc_eng_data.generateNmea = false; + } LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, callbacks->location_ext_parser, callbacks->sv_ext_parser); loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); - int ret_val =-1; if (NULL == loc_eng_data.client_handle) { // drop the context and declare failure ((LocEngContext*)(loc_eng_data.context))->drop(); @@ -302,29 +375,65 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, supl_msg, loc_eng_free_msg); + loc_eng_msg_lpp_config *lpp_msg(new loc_eng_msg_lpp_config(&loc_eng_data, + gps_conf.LPP_PROFILE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + lpp_msg, loc_eng_free_msg); + loc_eng_msg_sensor_control_config *sensor_control_config_msg( - new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE)); + new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_control_config_msg, loc_eng_free_msg); - /* Make sure this is specified by the user in the gps.conf file */ - if(gps_conf.GYRO_BIAS_RANDOM_WALK_VALID) + loc_eng_msg_a_glonass_protocol *a_glonass_protocol_msg(new loc_eng_msg_a_glonass_protocol(&loc_eng_data, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + a_glonass_protocol_msg, loc_eng_free_msg); + + /* 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 ) { loc_eng_msg_sensor_properties *sensor_properties_msg( - new loc_eng_msg_sensor_properties(&loc_eng_data, gps_conf.GYRO_BIAS_RANDOM_WALK)); + new loc_eng_msg_sensor_properties(&loc_eng_data, + 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)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_properties_msg, loc_eng_free_msg); } loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, - gps_conf.SENSOR_CONTROL_MODE, - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC)); + 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)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, sensor_perf_control_conf_msg, loc_eng_free_msg); + + //Send data disable to modem. This will be set to enable when + //an UPDATE_NETWORK_STATE event is received from Android + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, + 0, (agpsStatus ? 1:0))); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } EXIT_LOG(%d, ret_val); @@ -366,7 +475,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.internet_nif = NULL; } #endif - if (loc_eng_data.navigating) + if (loc_eng_data.client_handle->isInSession()) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); loc_eng_stop(loc_eng_data); @@ -380,8 +489,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) // De-initialize ulp if (locEngUlpInf != NULL) { - locEngUlpInf->destroy (); locEngUlpInf = NULL; + msg_q_destroy( &loc_eng_data.ulp_q); } if (loc_eng_data.client_handle != NULL) @@ -391,17 +500,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.client_handle = NULL; } -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) - { - loc_eng_dmn_conn_loc_api_server_unblock(); - loc_eng_dmn_conn_loc_api_server_join(); - } - } -#endif /* FEATURE_GNSS_BIT_API */ + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); #endif @@ -430,10 +530,19 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - + if(loc_eng_data.ulp_initialized == true) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_START_FIX)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, + msg, loc_eng_free_msg); + } + else + { + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } EXIT_LOG(%d, 0); return 0; } @@ -443,21 +552,14 @@ 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.navigating) { -#ifdef QCOM_FEATURE_ULP - if (NULL == locEngUlpInf || - locEngUlpInf->start_fix () == 1) { - ret_val = loc_eng_data.client_handle->startFix(); - } -#else + if (!loc_eng_data.client_handle->isInSession()) { ret_val = loc_eng_data.client_handle->startFix(); -#endif if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { + loc_eng_data.client_handle->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); - loc_eng_data.navigating = TRUE; } } @@ -466,7 +568,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) } /*=========================================================================== -FUNCTION loc_eng_stop +FUNCTION loc_eng_stop_wrapper DESCRIPTION Stops the tracking session @@ -486,9 +588,19 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + if(loc_eng_data.ulp_initialized == true) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_STOP_FIX)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, + msg, loc_eng_free_msg); + } + else + { + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); + } EXIT_LOG(%d, 0); return 0; @@ -499,14 +611,7 @@ 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.navigating) { -#ifdef QCOM_FEATURE_ULP - // Stops the ULP - if (locEngUlpInf != NULL) - { - locEngUlpInf->stop_fix (); - } -#endif + if (loc_eng_data.client_handle->isInSession()) { ret_val = loc_eng_data.client_handle->stopFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) @@ -514,7 +619,7 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } - loc_eng_data.navigating = FALSE; + loc_eng_data.client_handle->setInSession(FALSE); } EXIT_LOG(%d, ret_val); @@ -561,18 +666,12 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) + LocPosMode ¶ms) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, mode, - recurrence, min_interval, - preferred_accuracy, preferred_time)); + new loc_eng_msg_position_mode(&loc_eng_data, params)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); @@ -608,7 +707,6 @@ int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, uncertainty)); msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); - EXIT_LOG(%d, 0); return 0; } @@ -683,6 +781,7 @@ void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData } /*=========================================================================== + FUNCTION loc_inform_gps_state DESCRIPTION @@ -752,7 +851,7 @@ static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data) loc_eng_data.c2k_host_buf, loc_eng_data.c2k_port_buf); } - EXIT_LOG(%p, VOID_RET); + EXIT_LOG(%s, VOID_RET); } /*=========================================================================== FUNCTION loc_eng_agps_init @@ -777,32 +876,30 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac 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; + } loc_eng_data.agps_status_cb = callbacks->status_cb; loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); -#ifdef QCOM_FEATURE_IPV6 + AGPS_TYPE_SUPL, + false); +#ifdef FEATURE_IPV6 loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_WWAN_ANY); -#else - loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL); + AGPS_TYPE_WWAN_ANY, + false); + loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + AGPS_TYPE_WIFI, + true); #endif -#ifdef FEATURE_GNSS_BIT_API - { - char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); - if ((strcmp(baseband,"svlte2a") == 0)) - { - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); - } - } -#endif /* FEATURE_GNSS_BIT_API */ loc_eng_agps_reinit(loc_eng_data); - EXIT_LOG(%p, VOID_RET); + EXIT_LOG(%s, VOID_RET); } /*=========================================================================== @@ -822,7 +919,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, const char* apn, AGpsBearerType bearerType) { @@ -893,7 +990,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) { ENTRY_LOG_CALLFLOW(); @@ -940,7 +1037,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) { ENTRY_LOG_CALLFLOW(); @@ -1146,6 +1243,14 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d 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.context, return); if (apn != NULL) { @@ -1197,9 +1302,10 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Session End is not reported during Android navigating state + boolean navigating = loc_eng_data.client_handle->isInSession(); if (status != GPS_STATUS_NONE && - !(status == GPS_STATUS_SESSION_END && loc_eng_data.navigating) && - !(status == GPS_STATUS_SESSION_BEGIN && !loc_eng_data.navigating)) + !(status == GPS_STATUS_SESSION_END && navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) { if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION) { @@ -1259,7 +1365,9 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.agps_status_cb != NULL) { loc_eng_data.agnss_nif->dropAllSubscribers(); +#ifdef FEATURE_IPV6 loc_eng_data.internet_nif->dropAllSubscribers(); +#endif loc_eng_agps_reinit(loc_eng_data); } @@ -1267,15 +1375,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.navigating) { - loc_eng_data.client_handle->setPositionMode( - loc_eng_data.position_mode.pMode, - loc_eng_data.position_mode.pRecurrence, - loc_eng_data.position_mode.minInterval, - loc_eng_data.position_mode.preferredAccuracy, - loc_eng_data.position_mode.preferredTime); - // not mutex protected, assuming fw won't call start twice without a - // stop call in between. + if (loc_eng_data.client_handle->isInSession()) { + // This sets the copy in adapter to modem + loc_eng_data.client_handle->setPositionMode(NULL); + loc_eng_data.client_handle->setInSession(false); loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); @@ -1372,10 +1475,7 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_SET_POSITION_MODE: { loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; - loc_eng_data_p->client_handle->setPositionMode(pmMsg->pMode, pmMsg->pRecurrence, - pmMsg->minInterval,pmMsg->preferredAccuracy, - pmMsg->preferredTime); - memcpy((void*)&loc_eng_data_p->position_mode, (void*)pmMsg, sizeof(*pmMsg)); + loc_eng_data_p->client_handle->setPositionMode(&(pmMsg->pMode)); } break; @@ -1411,6 +1511,13 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_A_GLONASS_PROTOCOL: + { + loc_eng_msg_a_glonass_protocol *svMsg = (loc_eng_msg_a_glonass_protocol*)msg; + loc_eng_data_p->client_handle->setAGLONASSProtocol(svMsg->a_glonass_protocol); + } + break; + case LOC_ENG_MSG_SUPL_VERSION: { loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; @@ -1418,6 +1525,13 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_LPP_CONFIG: + { + loc_eng_msg_lpp_config *svMsg = (loc_eng_msg_lpp_config*)msg; + loc_eng_data_p->client_handle->setLPPConfig(svMsg->lpp_config); + } + break; + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: { loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; @@ -1428,7 +1542,16 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: { loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; - loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk); + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk_valid, + spMsg->gyroBiasVarianceRandomWalk, + spMsg->accelRandomWalk_valid, + spMsg->accelRandomWalk, + spMsg->angleRandomWalk_valid, + spMsg->angleRandomWalk, + spMsg->rateRandomWalk_valid, + spMsg->rateRandomWalk, + spMsg->velocityRandomWalk_valid, + spMsg->velocityRandomWalk); } break; @@ -1436,36 +1559,85 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec); + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, + spccMsg->accelSamplesPerBatchHigh, spccMsg->accelBatchesPerSecHigh, + spccMsg->gyroSamplesPerBatchHigh, spccMsg->gyroBatchesPerSecHigh, + spccMsg->algorithmConfig); + } + break; + + case LOC_ENG_MSG_EXT_POWER_CONFIG: + { + loc_eng_msg_ext_power_config *pwrMsg = (loc_eng_msg_ext_power_config*)msg; + loc_eng_data_p->client_handle->setExtPowerConfig(pwrMsg->isBatteryCharging); } break; case LOC_ENG_MSG_REPORT_POSITION: if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { + bool reported = false; loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; if (loc_eng_data_p->location_cb != NULL) { if (LOC_SESS_FAILURE == rpMsg->status) { // in case we want to handle the failure case loc_eng_data_p->location_cb(NULL, NULL); + reported = true; } // what's in the else if is... (line by line) // 1. this is a good fix; or + // 1.1 there is source info; or + // 1.1.1 this is from hybrid provider; + // 1.2 it is a Satellite fix; or + // 1.2.1 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 == rpMsg->status || + else if ((LOC_SESS_SUCCESS == rpMsg->status && ( + ((LOCATION_HAS_SOURCE_INFO & rpMsg->location.gpsLocation.flags) && + ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || + ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || + (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && - !((rpMsg->location.flags & GPS_LOCATION_HAS_ACCURACY) && + !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && (gps_conf.ACCURACY_THRES != 0) && - (rpMsg->location.accuracy > gps_conf.ACCURACY_THRES)))) { - loc_eng_data_p->location_cb((GpsLocation*)&(rpMsg->location), + (rpMsg->location.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((UlpLocation*)&(rpMsg->location), (void*)rpMsg->locationExt); + reported = true; } } + + // if we have reported this fix + if (reported && + // and if this is a singleshot + GPS_POSITION_RECURRENCE_SINGLE == + loc_eng_data_p->client_handle->getPositionMode().recurrence) { + if (LOC_SESS_INTERMEDIATE == rpMsg->status) { + // modem could be still working for a final fix, + // although we no longer need it. So stopFix(). + loc_eng_data_p->client_handle->stopFix(); + } + // turn off the session flag. + loc_eng_data_p->client_handle->setInSession(false); + } + + if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) + { + loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended); + } + + // Free the allocated memory for rawData + UlpLocation* gp = (UlpLocation*)&(rpMsg->location); + if (gp != NULL && gp->rawData != NULL) + { + delete (char*)gp->rawData; + gp->rawData = NULL; + gp->rawDataSize = 0; + } } break; @@ -1478,6 +1650,12 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), (void*)rsMsg->svExt); } + + if (loc_eng_data_p->generateNmea) + { + loc_eng_nmea_generate_sv(loc_eng_data_p, rsMsg->svStatus, rsMsg->locationExtended); + } + } break; @@ -1498,10 +1676,18 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_REQUEST_BIT: { + AgpsStateMachine* stateMachine; loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; - AgpsStateMachine* stateMachine = (brqMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; +#ifdef FEATURE_IPV6 + } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; +#endif + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); + break; + } BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); stateMachine->subscribeRsrc((Subscriber*)&subscriber); @@ -1510,10 +1696,18 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_RELEASE_BIT: { + AgpsStateMachine* stateMachine; loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; - AgpsStateMachine* stateMachine = (brlMsg->isSupl) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; +#ifdef FEATURE_IPV6 + } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; +#endif + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); + break; + } BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); @@ -1523,12 +1717,20 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_REQUEST_ATL: { loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type) ? +#ifdef FEATURE_IPV6 + boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || + backwardCompatibleMode) ? loc_eng_data_p->agnss_nif : loc_eng_data_p->internet_nif; +#else + boolean backwardCompatibleMode = false; + AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; +#endif ATLSubscriber subscriber(arqMsg->handle, stateMachine, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + backwardCompatibleMode); stateMachine->subscribeRsrc((Subscriber*)&subscriber); } @@ -1539,18 +1741,49 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; ATLSubscriber s1(arlMsg->handle, loc_eng_data_p->agnss_nif, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + false); // attempt to unsubscribe from agnss_nif first if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { +#ifdef FEATURE_IPV6 ATLSubscriber s2(arlMsg->handle, loc_eng_data_p->internet_nif, - loc_eng_data_p->client_handle); + loc_eng_data_p->client_handle, + false); // if unsuccessful, try internet_nif loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); +#endif } } break; +#ifdef FEATURE_IPV6 + case LOC_ENG_MSG_REQUEST_WIFI: + { + loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; + if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } else { + LOC_LOGE("%s]%d ERROR: unknown sender ID", __func__, __LINE__); + break; + } + } + break; + + case LOC_ENG_MSG_RELEASE_WIFI: + { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + loc_eng_msg_release_wifi* wrlMsg = (loc_eng_msg_release_wifi*)msg; + WIFISubscriber subscriber(stateMachine, wrlMsg->ssid, wrlMsg->password, wrlMsg->senderId); + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; +#endif + case LOC_ENG_MSG_REQUEST_XTRA_DATA: if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) { @@ -1559,6 +1792,14 @@ static void loc_eng_deferred_action_thread(void* arg) break; case LOC_ENG_MSG_REQUEST_TIME: + if (loc_eng_data_p->request_utc_time_cb != NULL) + { + loc_eng_data_p->request_utc_time_cb(); + } + else + { + LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__); + } break; case LOC_ENG_MSG_REQUEST_POSITION: @@ -1572,7 +1813,8 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; loc_eng_data_p->client_handle->enableData(unaMsg->enable); - loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + if(unaMsg->apn != NULL) + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); } break; @@ -1586,14 +1828,25 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_OPEN_SUCCESS: { loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aosMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + AgpsStateMachine* stateMachine; +#ifdef FEATURE_IPV6 + switch (aosMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } stateMachine->setBearer(aosMsg->bearerType); #else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; + stateMachine = loc_eng_data_p->agnss_nif; #endif stateMachine->setAPN(aosMsg->apn, aosMsg->length); stateMachine->onRsrcEvent(RSRC_GRANTED); @@ -1603,14 +1856,24 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_CLOSED: { loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == acsMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + AgpsStateMachine* stateMachine; +#ifdef FEATURE_IPV6 + switch (acsMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } #else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; + stateMachine = loc_eng_data_p->agnss_nif; #endif - stateMachine->onRsrcEvent(RSRC_RELEASED); } break; @@ -1618,14 +1881,24 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_ATL_OPEN_FAILED: { loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; -#ifdef QCOM_FEATURE_IPV6 - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == aofMsg->agpsType) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; + AgpsStateMachine* stateMachine; +#ifdef FEATURE_IPV6 + switch (aofMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } #else - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; + stateMachine = loc_eng_data_p->agnss_nif; #endif - stateMachine->onRsrcEvent(RSRC_DENIED); } break; @@ -1638,6 +1911,36 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_handle_engine_up(*loc_eng_data_p); break; + case LOC_ENG_MSG_REQUEST_NETWORK_POSIITON: + { + loc_eng_msg_request_network_position *nlprequestmsg = (loc_eng_msg_request_network_position*)msg; + //loc_eng_handle_request_network_position(nlprequestmsg ); + LOC_LOGD("Received n/w position request from ULP.Request type %d Periodicity: %d\n", + nlprequestmsg->networkPosRequest.request_type, + nlprequestmsg->networkPosRequest.interval_ms); + if(loc_eng_data_p->ulp_network_callback != NULL) + { + loc_eng_data_p->ulp_network_callback((UlpNetworkRequestPos*)&(nlprequestmsg->networkPosRequest)); + } + else + LOC_LOGE("Ulp Network call back not initialized"); + } + break; + + case LOC_ENG_MSG_REQUEST_PHONE_CONTEXT: + { + loc_eng_msg_request_phone_context *contextReqMsg = (loc_eng_msg_request_phone_context*)msg; + LOC_LOGD("Received phone context request from ULP.context_type 0x%x,request_type 0x%x ", + contextReqMsg->contextRequest.context_type,contextReqMsg->contextRequest.request_type) + if(loc_eng_data_p->ulp_phone_context_req_cb != NULL) + { + loc_eng_data_p->ulp_phone_context_req_cb((UlpPhoneContextRequest*)&(contextReqMsg->contextRequest)); + } + else + LOC_LOGE("Ulp Phone context request call back not initialized"); + } + break; + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; @@ -1668,52 +1971,6 @@ static void loc_eng_deferred_action_thread(void* arg) EXIT_LOG(%s, VOID_RET); } -/*=========================================================================== -FUNCTION loc_eng_report_position_ulp - -DESCRIPTION - Report a ULP position - p_ulp_pos_absolute, ULP position in absolute coordinates - -DEPENDENCIES - None - -RETURN VALUE - 0: SUCCESS - others: error - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_report_position_ulp (void* handle, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data) -{ - ENTRY_LOG(); - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)handle; - - INIT_CHECK(loc_eng_data_p->context && loc_eng_data_p->client_handle, - return -1); - - if (ext_data_length > sizeof (extra_data)) - { - ext_data_length = sizeof (extra_data); - } - - memcpy(extra_data, - ext_data, - ext_data_length); - - loc_eng_data_p->client_handle->reportPosition((GpsLocation&)*location_report_ptr, - NULL, LOC_SESS_SUCCESS); - - EXIT_LOG(%d, 0); - return 0; -} - -#ifdef QCOM_FEATURE_ULP /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -1732,43 +1989,19 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_eng_ulp_init(void* owner) +int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf) { ENTRY_LOG(); - int ret_val; - void *handle; - const char *error; - get_ulp_interface* get_ulp_inf; - - if (!(gps_conf.CAPABILITIES & ULP_CAPABILITY)) { - LOC_LOGD ("%s, ULP is not supported\n", __func__); - ret_val = -1; - goto exit; - } - - handle = dlopen ("libulp.so", RTLD_NOW); - if (!handle) + int ret_val=-1; + if((loc_eng_ulpInf != NULL) && (((ulpInterface *)loc_eng_ulpInf)->init != NULL)) { - LOC_LOGE ("%s, dlopen for libulp.so failed\n", __func__); - ret_val = -1; - goto exit; + // Initialize the ULP interface + ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); + loc_eng_data.ulp_initialized = TRUE; + ret_val = 0; } - dlerror(); /* Clear any existing error */ - - get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); - ret_val = -1; - goto exit; - } - - locEngUlpInf = get_ulp_inf(); - - // Initialize the ULP interface - locEngUlpInf->init (owner, loc_eng_report_position_ulp); - - ret_val = 0; -exit: + else + LOC_LOGE("ulp not initialized. NULL parameter"); EXIT_LOG(%d, ret_val); return ret_val; } @@ -1798,6 +2031,19 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, LOC_LOGD("loc_eng_send_extra_command: %s\n", command); ret_val = TRUE; + if(loc_eng_data.ulp_initialized == true) + { + ulp_msg_inject_raw_command *msg( + new ulp_msg_inject_raw_command(&loc_eng_data,command, length)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); return ret_val; } @@ -1823,9 +2069,205 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); int ret_val; - ret_val = 0; + + if(loc_eng_data.ulp_initialized == true) + { + LOC_LOGD("SJ:loc_eng_update_criteria: valid 0x%x action:%d, minTime:%ld, minDistance:%f, singleShot:%d, horizontalAccuracy:%d, powerRequirement:%d \n", + criteria.valid_mask, criteria.action, criteria.min_interval, criteria.min_distance, criteria.recurrence_type, criteria.preferred_horizontal_accuracy, + criteria.preferred_power_consumption ); + ulp_msg_update_criteria *msg( + new ulp_msg_update_criteria(&loc_eng_data,criteria)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_phone_context_settings_update + +DESCRIPTION + This is used to inform the ULP module of phone settings changes carried out + by the users +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ + +int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextSettings *settings) +{ + ENTRY_LOG(); + int ret_val = -1; + + LOC_LOGD("loc_eng_ulp_phone_context_settings: context_type - 0x%x is_agps_enabled - %d " + "is_battery_charging %d ,is_gps_enabled %d, is_network_position_available %d," + "is_wifi_setting_enabled %d, is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + settings->context_type ,settings->is_agps_enabled,settings->is_battery_charging, + settings->is_gps_enabled, settings->is_network_position_available, + settings->is_wifi_setting_enabled, settings->is_agps_enabled, + settings->is_enh_location_services_enabled ); + + if(loc_eng_data.ulp_initialized == true) + { + ulp_msg_inject_phone_context_settings *msg + (new ulp_msg_inject_phone_context_settings(&loc_eng_data, *settings)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, msg, loc_eng_free_msg); + ret_val = 0; + } + + // Send battery information to modem for processing. + if(settings->context_type & ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE) + { + loc_eng_msg_ext_power_config *msg(new loc_eng_msg_ext_power_config(&loc_eng_data, settings->is_battery_charging)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); + } EXIT_LOG(%d, ret_val); return ret_val; } -#endif +/*=========================================================================== +FUNCTION loc_eng_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data,UlpPhoneContextCallbacks *callback) +{ + int ret_val = -1; + ENTRY_LOG(); + if(callback != NULL) { + loc_eng_data.ulp_phone_context_req_cb = callback->ulp_request_phone_context_cb ; + ret_val = 0; + } + else + LOC_LOGE("loc_eng_ulp_phone_context_init: bad parameters cb %p", callback); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_ulp_network_init + +DESCRIPTION + Initialize the ULP network interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, + UlpNetworkLocationCallbacks *callbacks) +{ + int ret_val = -1; + ENTRY_LOG_CALLFLOW(); + if(callbacks != NULL) { + loc_eng_data.ulp_network_callback = callbacks->ulp_network_location_request_cb; + ret_val = 0; + } + else + LOC_LOGE("loc_eng_ulp_network_init: bad parameters cb %p", callbacks); + EXIT_LOG(%d, ret_val); + return ret_val; +} + + +/*=========================================================================== +FUNCTION loc_eng_ulp_send_network_position + +DESCRIPTION + Ulp send data + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, + UlpNetworkPositionReport *position_report) +{ + ENTRY_LOG(); + int ret_val = 0; + if(loc_eng_data.ulp_initialized == true) + { + ulp_msg_inject_network_position *msg + (new ulp_msg_inject_network_position(&loc_eng_data, *position_report)); + msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q + , msg, loc_eng_free_msg); + ret_val = 0; + }else + { + ret_val = -1; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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, loc_parameter_table); + UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table); + configAlreadyRead = true; + } else { + LOC_LOGV("GPS Config file has already been read\n"); + } + + EXIT_LOG(%d, 0); + return 0; +} + diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 73578ec8..d61cb12b 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -36,6 +36,7 @@ extern "C" { // 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; @@ -67,9 +68,10 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 -#define MAX_APN_LEN 100 -#define MAX_URL_LEN 256 -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) +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, @@ -77,6 +79,21 @@ enum loc_mute_session_e_type { LOC_MUTE_SESS_IN_SESSION }; +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const void* ulp_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + // Module data typedef struct { @@ -89,6 +106,9 @@ typedef struct gps_ni_notify_callback ni_notify_cb; gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; + gps_request_utc_time request_utc_time_cb; + ulp_network_location_request ulp_network_callback; + ulp_request_phone_context ulp_phone_context_req_cb; boolean intermediateFix; AGpsStatusValue agps_status; // used to defer stopping the GPS engine until AGPS data calls are done @@ -97,11 +117,10 @@ typedef struct loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; - boolean navigating; - // AGPS state machines AgpsStateMachine* agnss_nif; AgpsStateMachine* internet_nif; + AgpsStateMachine* wifi_nif; // GPS engine status GpsStatusValue engine_status; @@ -112,11 +131,16 @@ typedef struct void* context; - loc_eng_msg_position_mode position_mode; - // For muting session broadcast loc_mute_session_e_type mute_session_state; + // For nmea generation + boolean generateNmea; + uint32_t sv_used_mask; + float hdop; + float pdop; + float vdop; + // Address buffers, for addressing setting before init int supl_host_set; char supl_host_buf[101]; @@ -127,12 +151,60 @@ typedef struct int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; + bool ulp_initialized; + uint32_t min_interval_cached; + UlpRecurrenceCriteria recurrence_type_cached; } loc_eng_data_s_type; +#include "ulp.h" + +/* GPS.conf support */ +typedef struct loc_gps_cfg_s +{ + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long ENABLE_WIPER; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + unsigned long QUIPC_ENABLED; + unsigned long LPP_PROFILE; + uint8_t NMEA_PROVIDER; + unsigned long A_GLONASS_POS_PROTOCOL_SELECT; +} loc_gps_cfg_s_type; + +typedef struct +{ + uint8_t GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + unsigned long 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; +} loc_sap_cfg_s_type; + +extern loc_gps_cfg_s_type gps_conf; +extern loc_sap_cfg_s_type sap_conf; int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event); + LOC_API_ADAPTER_EVENT_MASK_T event, + void (*loc_external_msg_sender) (void*, void*)); +int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf); 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); @@ -145,19 +217,15 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, 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, - LocPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); + LocPosMode ¶ms); const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, const char* name); -#ifdef QCOM_FEATURE_ULP int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, UlpLocationCriteria criteria); -#endif void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbacks); -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, const char* apn, AGpsBearerType bearerType); int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); @@ -196,7 +264,15 @@ 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); +int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, UlpNetworkLocationCallbacks *callbacks); +int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextSettings *settings); +int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data, + UlpPhoneContextCallbacks *callback); +int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, + UlpNetworkPositionReport *position_report); +int loc_eng_read_config(void); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 07475680..5bdae3d7 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -87,7 +87,7 @@ const int Notification::BROADCAST_INACTIVE = 0x80000002; //====================================================================== -// Subscriber: BITSubscriber / ATLSubscriber +// Subscriber: BITSubscriber / ATLSubscriber / WIFISubscriber //====================================================================== bool Subscriber::forMe(Notification ¬ification) { @@ -120,14 +120,17 @@ bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) 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: @@ -150,20 +153,38 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_DENIED: + { +#ifdef FEATURE_IPV6 + AGpsType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 mStateMachine->getBearer(), + type); +#else + AGpsType type = mStateMachine->getType(); + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + (char*)mStateMachine->getAPN(), + type); #endif - mStateMachine->getType()); + } break; case RSRC_GRANTED: + { +#ifdef FEATURE_IPV6 + AGpsType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), -#ifdef QCOM_FEATURE_IPV6 mStateMachine->getBearer(), + type); +#else + AGpsType type = mStateMachine->getType(); + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + (char*)mStateMachine->getAPN(), + type); #endif - mStateMachine->getType()); + } break; default: notify = false; @@ -173,6 +194,39 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) return notify; } +#ifdef FEATURE_IPV6 +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; +} +#endif //====================================================================== // AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState @@ -276,23 +330,25 @@ AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) Subscriber* subscriber = (Subscriber*) data; if (subscriber->waitForCloseComplete()) { subscriber->setInactive(); - if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasingState; - } } 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; + // 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); - } + // 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; @@ -381,13 +437,13 @@ AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) // now check if there is any subscribers left if (!mStateMachine->hasSubscribers()) { // no more subscribers, move to RELEASED state - nextState = mReleasingState; + nextState = mReleasedState; // tell connecivity service we can release NIF mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); } else if (!mStateMachine->hasActiveSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; + // only inactive subscribers, move to RELEASING state + nextState = mReleasingState; // tell connecivity service we can release NIF mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); @@ -469,21 +525,14 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) // now check if there is any subscribers left if (!mStateMachine->hasSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { // no more subscribers, move to RELEASED state nextState = mReleasedState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); } } break; + case RSRC_DENIED: + // A race condition subscriber unsubscribes before AFW denies resource. case RSRC_RELEASED: { nextState = mAcquiredState; @@ -503,7 +552,6 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) break; case RSRC_GRANTED: - case RSRC_DENIED: default: LOC_LOGE("%s: unrecognized event %d", whoami(), event); // no state change. @@ -520,11 +568,13 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) //====================================================================== AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), - AGpsType type) : + AGpsType type, + bool enforceSingleSubscriber) : mServicer(servicer), mType(type), mStatePtr(new AgpsReleasedState(this)), mAPN(NULL), - mAPNLen(0) + mAPNLen(0), + mEnforceSingleSubscriber(enforceSingleSubscriber) { linked_list_init(&mSubscribers); @@ -643,7 +693,7 @@ void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const { Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ALL); + Notification notification(Notification::BROADCAST_ACTIVE); linked_list_search(mSubscribers, (void**)&s, hasSubscriber, (void*)¬ification, false); @@ -653,12 +703,15 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const nifRequest.type = mType; nifRequest.status = action; -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; nifRequest.ipv6_addr[0] = 0; + nifRequest.ssid[0] = '\0'; + nifRequest.password[0] = '\0'; } else { s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setWifiInfo(nifRequest.ssid, nifRequest.password); } #else if (s == NULL) { @@ -675,7 +728,12 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) { - mStatePtr = mStatePtr->onRsrcEvent(RSRC_SUBSCRIBE, (void*)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) diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 1fd0f450..22160c36 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -37,6 +37,7 @@ #include #include #include +#include "loc_eng_msg.h" // forward declaration class AgpsStateMachine; @@ -149,20 +150,21 @@ class AgpsStateMachine { char* mAPN; // for convenience, we don't do strlen each time. unsigned int mAPNLen; -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 // bear AGpsBearerType mBearer; #endif // ipv4 address for routing + bool mEnforceSingleSubscriber; public: - AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type); + AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType 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; } -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline AGpsBearerType getBearer() const { return mBearer; } #endif @@ -198,14 +200,16 @@ public: // multiple clients from modem. In the case of BIT, there is only one // cilent from BIT daemon. struct Subscriber { - const int ID; + 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(int &v4, char* v6) = 0; + virtual void setIPAddresses(uint32_t &v4, char* v6) = 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; } @@ -239,7 +243,7 @@ struct BITSubscriber : public Subscriber { virtual bool notifyRsrcStatus(Notification ¬ification); - inline virtual void setIPAddresses(int &v4, char* v6) + inline virtual void setIPAddresses(uint32_t &v4, char* v6) { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } virtual Subscriber* clone() @@ -256,19 +260,72 @@ private: // ATLSubscriber, created with requests from ATL struct ATLSubscriber : public Subscriber { const LocApiAdapter* mLocAdapter; + const bool mBackwardCompatibleMode; inline ATLSubscriber(const int id, const AgpsStateMachine* stateMachine, - const LocApiAdapter* adapter) : - Subscriber(id, stateMachine), mLocAdapter(adapter) {} + const LocApiAdapter* adapter, + const bool compatibleMode) : + Subscriber(id, stateMachine), mLocAdapter(adapter), + mBackwardCompatibleMode(compatibleMode){} virtual bool notifyRsrcStatus(Notification ¬ification); - inline virtual void setIPAddresses(int &v4, char* v6) + inline virtual void setIPAddresses(uint32_t &v4, char* v6) { v4 = INADDR_NONE; v6[0] = 0; } inline virtual Subscriber* clone() { - return new ATLSubscriber(ID, mStateMachine, mLocAdapter); + return new ATLSubscriber(ID, mStateMachine, mLocAdapter, + mBackwardCompatibleMode); } }; +#ifdef FEATURE_IPV6 +// 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 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); + } +}; +#endif + #endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index f2f9a501..86489086 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -33,24 +33,78 @@ #include #include #include +#include +#include +#include #include "log_util.h" #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; } @@ -80,6 +134,7 @@ static int loc_api_server_proc(void *context) 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 0; @@ -114,6 +169,9 @@ 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; } @@ -165,16 +223,48 @@ int loc_eng_dmn_conn_loc_api_server_join(void) return 0; } -int loc_eng_dmn_conn_loc_api_server_data_conn(int status) { +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; - LOC_LOGD("%s:%d] status = %d",__func__, __LINE__, status); - 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; + 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/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h index 414fd553..c7c100b2 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -35,11 +35,17 @@ #define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" #define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/data/misc/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 @@ -47,7 +53,7 @@ int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread 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 loc_eng_dmn_conn_loc_api_server_data_conn(int, int); #endif /* LOC_ENG_DATA_SERVER_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c index 9cd19228..6b97a238 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h index 8bc6f2a3..d685c87e 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c index 74769088..d0bee29c 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -64,13 +64,21 @@ int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode) int result; LOC_LOGD("%s, mode = %d\n", pipe_name, mode); - result = mkfifo(pipe_name, 0666); + 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) { diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h index 3136e411..b2fa3a03 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index fd15f001..6c060f64 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -47,15 +47,91 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, return 1; } - loc_eng_msg_request_bit *msg( - new loc_eng_msg_request_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + if (NULL != loc_api_handle) { + loc_if_req_type_e_type type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = LOC_ENG_IF_REQUEST_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"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } + } #else - loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_REQUEST_SUCCESS); + 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; } @@ -64,14 +140,88 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, { LOC_LOGD("%s:%d]\n", __func__, __LINE__); #ifndef DEBUG_DMN_LOC_API - loc_eng_msg_release_bit *msg( + loc_if_req_type_e_type type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = LOC_ENG_IF_REQUEST_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"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + loc_eng_msg_release_bit *msg( new loc_eng_msg_release_bit(loc_api_handle, - pmsg->cmsg.cmsg_if_request.is_supl, + type, pmsg->cmsg.cmsg_if_request.ipv4_addr, (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); loc_eng_msg_sender(loc_api_handle, msg); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } #else - loc_eng_dmn_conn_loc_api_server_data_conn(GPSONE_LOC_API_IF_RELEASE_SUCCESS); + 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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h index 833e971b..1c0edd55 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -32,6 +32,13 @@ #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, @@ -55,10 +62,27 @@ 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 { - unsigned is_supl; /* 1: use Android SUPL connection; 0: use Android default internet connection */ + 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 */ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c index 478b686f..67e31879 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h index 07869f90..89e598b5 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index d813cd65..895db1db 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -31,7 +31,6 @@ #define LOG_TAG "LocSvc_eng" #include "hardware/gps.h" -#include "loc.h" #include "loc_log.h" #include "loc_eng_log.h" #include "loc_eng_msg_id.h" @@ -88,10 +87,27 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_WIFI ), + NAME_VAL( LOC_ENG_MSG_RELEASE_WIFI ), NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ) + NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ), + NAME_VAL( LOC_ENG_MSG_EXT_POWER_CONFIG ), + NAME_VAL( LOC_ENG_MSG_REQUEST_POSITION ), + NAME_VAL( LOC_ENG_MSG_REQUEST_PHONE_CONTEXT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_NETWORK_POSIITON ), + NAME_VAL( ULP_MSG_UPDATE_CRITERIA ), + NAME_VAL( ULP_MSG_START_FIX ), + NAME_VAL( ULP_MSG_STOP_FIX ), + NAME_VAL( ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS ), + NAME_VAL( ULP_MSG_INJECT_NETWORK_POSITION ), + NAME_VAL( ULP_MSG_REPORT_QUIPC_POSITION ), + NAME_VAL( ULP_MSG_REQUEST_COARSE_POSITION ), + NAME_VAL( ULP_MSG_MONITOR ), + NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), + NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), + NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); @@ -111,7 +127,8 @@ static loc_name_val_s_type loc_eng_position_modes[] = 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_4 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_5 ) }; static int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type); @@ -150,7 +167,7 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), NAME_VAL( GPS_DELETE_CELLDB_INFO ) -#ifdef QCOM_FEATURE_DELEXT +#ifdef FEATURE_DELEXT ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), @@ -172,13 +189,13 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data) static loc_name_val_s_type loc_eng_agps_types[] = { -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 NAME_VAL( AGPS_TYPE_INVALID ), NAME_VAL( AGPS_TYPE_ANY ), #endif NAME_VAL( AGPS_TYPE_SUPL ), NAME_VAL( AGPS_TYPE_C2K ) -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) #endif }; @@ -233,7 +250,7 @@ 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); } -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 static loc_name_val_s_type loc_eng_agps_bears[] = { NAME_VAL( AGPS_APN_BEARER_INVALID ), diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index eff1593b..4ee978af 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -37,7 +37,7 @@ extern "C" #include #include -#include "loc_eng_msg_id.h" +#include const char* loc_get_gps_status_name(GpsStatusValue gps_status); const char* loc_get_msg_name(int id); @@ -48,7 +48,7 @@ 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); -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 const char* loc_get_agps_bear_name(AGpsBearerType bear); #endif const char* loc_get_server_type_name(LocServerType type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp index 97c0457c..a296dce3 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.cpp +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 41548f09..df7cc092 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -31,18 +31,130 @@ #include +#include #include #include #include "log_util.h" #include "loc.h" -#include "loc_eng_log.h" +#include #include "loc_eng_msg_id.h" +#ifndef SSID_BUF_SIZE + #define SSID_BUF_SIZE (32+1) +#endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + 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); + } + } + + LocPosMode() : + mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), + min_interval(MIN_POSSIBLE_FIX_INTERVAL), preferred_accuracy(50), preferred_time(120000) { + 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); + } + + inline void 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); + } +}; + +/** 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 + +/** 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; +} GpsLocationExtended; + +typedef enum { + LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, + LOC_ENG_IF_REQUEST_TYPE_WIFI, + LOC_ENG_IF_REQUEST_TYPE_ANY +} loc_if_req_type_e_type; + +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; + struct loc_eng_msg { const void* owner; const int msgid; @@ -50,13 +162,24 @@ struct loc_eng_msg { owner(instance), msgid(id) { LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); + LOC_LOGV("creating msg ox%x", msgid); } virtual ~loc_eng_msg() { - LOC_LOGV("deleting msg %s", loc_get_msg_name(msgid)); + LOC_LOGV("deleting msg %s (0x%x)", loc_get_msg_name(msgid), msgid); } }; +struct loc_eng_msg_a_glonass_protocol : public loc_eng_msg { + const unsigned long a_glonass_protocol; + inline loc_eng_msg_a_glonass_protocol(void* instance, unsigned long protocol) : + loc_eng_msg(instance, LOC_ENG_MSG_A_GLONASS_PROTOCOL), + a_glonass_protocol(protocol) + { + LOC_LOGV("A-GLONASS protocol: 0x%lx", protocol); + } +}; + struct loc_eng_msg_suple_version : public loc_eng_msg { const int supl_version; inline loc_eng_msg_suple_version(void* instance, int version) : @@ -67,6 +190,26 @@ struct loc_eng_msg_suple_version : public loc_eng_msg { } }; +struct loc_eng_msg_lpp_config : public loc_eng_msg { + const int lpp_config; + inline loc_eng_msg_lpp_config(void *instance, int profile) : + loc_eng_msg(instance, LOC_ENG_MSG_LPP_CONFIG), + lpp_config(profile) + { + LOC_LOGV("lpp profile: %d", profile); + } +}; + +struct loc_eng_msg_ext_power_config : public loc_eng_msg { + const int isBatteryCharging; + inline loc_eng_msg_ext_power_config(void* instance, int isBattCharging) : + loc_eng_msg(instance, LOC_ENG_MSG_EXT_POWER_CONFIG), + isBatteryCharging(isBattCharging) + { + LOC_LOGV("isBatteryCharging: %d", isBatteryCharging); + } +}; + struct loc_eng_msg_sensor_control_config : public loc_eng_msg { const int sensorsDisabled; inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : @@ -78,12 +221,51 @@ struct loc_eng_msg_sensor_control_config : public loc_eng_msg { }; struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const bool gyroBiasVarianceRandomWalk_valid; const float gyroBiasVarianceRandomWalk; - inline loc_eng_msg_sensor_properties(void* instance, float gyroBiasRandomWalk) : + const bool accelRandomWalk_valid; + const float accelRandomWalk; + const bool angleRandomWalk_valid; + const float angleRandomWalk; + const bool rateRandomWalk_valid; + const float rateRandomWalk; + const bool velocityRandomWalk_valid; + const float velocityRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, 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) : loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), - gyroBiasVarianceRandomWalk(gyroBiasRandomWalk) + gyroBiasVarianceRandomWalk_valid(gyroBiasRandomWalk_valid), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk), + accelRandomWalk_valid(accelRandomWalk_valid), + accelRandomWalk(accelRandomWalk), + angleRandomWalk_valid(angleRandomWalk_valid), + angleRandomWalk(angleRandomWalk), + rateRandomWalk_valid(rateRandomWalk_valid), + rateRandomWalk(rateRandomWalk), + velocityRandomWalk_valid(velocityRandomWalk_valid), + velocityRandomWalk(velocityRandomWalk) { - LOC_LOGV("Gyro Bias Random Walk: %f", gyroBiasRandomWalk); + 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", + gyroBiasRandomWalk_valid, + accelRandomWalk_valid, + angleRandomWalk_valid, + rateRandomWalk_valid, + velocityRandomWalk_valid + ); + LOC_LOGV("Sensor properties, Gyro Random walk: %f Accel Random Walk: %f " + "Angle Random Walk: %f Rate Random Walk: %f " + "Velocity Random Walk: %f", + gyroBiasRandomWalk, + accelRandomWalk, + angleRandomWalk, + rateRandomWalk, + velocityRandomWalk + ); } }; @@ -93,55 +275,56 @@ struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { const int accelBatchesPerSec; const int gyroSamplesPerBatch; const int gyroBatchesPerSec; + const int accelSamplesPerBatchHigh; + const int accelBatchesPerSecHigh; + const int gyroSamplesPerBatchHigh; + const int gyroBatchesPerSecHigh; + const int algorithmConfig; inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec) : + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, + int algorithmConfig) : loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), controlMode(controlMode), accelSamplesPerBatch(accelSamplesPerBatch), accelBatchesPerSec(accelBatchesPerSec), gyroSamplesPerBatch(gyroSamplesPerBatch), - gyroBatchesPerSec(gyroBatchesPerSec) + gyroBatchesPerSec(gyroBatchesPerSec), + accelSamplesPerBatchHigh(accelSamplesPerBatchHigh), + accelBatchesPerSecHigh(accelBatchesPerSecHigh), + gyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), + gyroBatchesPerSecHigh(gyroBatchesPerSecHigh), + algorithmConfig(algorithmConfig) { LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u)\n", + "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", controlMode, accelSamplesPerBatch, accelBatchesPerSec, gyroSamplesPerBatch, - gyroBatchesPerSec + gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, + algorithmConfig ); } }; struct loc_eng_msg_position_mode : public loc_eng_msg { - const LocPositionMode pMode; - const GpsPositionRecurrence pRecurrence; - const uint32_t minInterval; - const uint32_t preferredAccuracy; - const uint32_t preferredTime; - inline loc_eng_msg_position_mode() : - loc_eng_msg(NULL, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(LOC_POSITION_MODE_STANDALONE), - pRecurrence(0), minInterval(0), - preferredAccuracy(0), preferredTime(0) {} + const LocPosMode pMode; inline loc_eng_msg_position_mode(void* instance, - LocPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) : + LocPosMode &mode) : loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(mode), pRecurrence(recurrence), minInterval(min_interval), - preferredAccuracy(preferred_accuracy), preferredTime(preferred_time) + pMode(mode) { - LOC_LOGV("Position mode: %s\n Position recurrence: %s\n min interval: %d\n preferred accuracy: %d\n preferred time: %d", - loc_get_position_mode_name(pMode), - loc_get_position_recurrence_name(pRecurrence), - minInterval, - preferredAccuracy, - preferredTime); + pMode.logv(); } }; @@ -185,34 +368,45 @@ struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { }; struct loc_eng_msg_report_position : public loc_eng_msg { - const GpsLocation location; + const UlpLocation location; + const GpsLocationExtended locationExtended; const void* locationExt; const enum loc_sess_status status; - inline loc_eng_msg_report_position(void* instance, GpsLocation &loc, void* locExt, + const LocPosTechMask technology_mask; + inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st) : loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExt(locExt), status(st) + location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) { -#ifdef QCOM_FEATURE_ULP - 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: %s", - location.flags, location.position_source, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, location.rawDataSize, location.rawData, - loc_get_position_sess_status_name(status)); -#else - LOC_LOGV("flags: %d\n latitude: %f\n longitude: %f\n altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n timestamp: %lld\n Session status: %s", - location.flags, location.latitude, location.longitude, - location.altitude, location.speed, location.bearing, location.accuracy, - location.timestamp, loc_get_position_sess_status_name(status)); -#endif + 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", + 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,technology_mask); + } + inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, + enum loc_sess_status st, LocPosTechMask technology) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), + location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(technology) + { + 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", + 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,technology_mask); } }; struct loc_eng_msg_report_sv : public loc_eng_msg { const GpsSvStatus svStatus; + const GpsLocationExtended locationExtended; const void* svExt; - inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, void* ext) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), svExt(ext) + inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, GpsLocationExtended &locExtended, void* ext) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), locationExtended(locExtended), svExt(ext) { LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); @@ -256,23 +450,23 @@ struct loc_eng_msg_report_nmea : public loc_eng_msg { }; struct loc_eng_msg_request_bit : public loc_eng_msg { - const unsigned int isSupl; + const loc_if_req_type_e_type ifType; const int ipv4Addr; char* const ipv6Addr; inline loc_eng_msg_request_bit(void* instance, - unsigned int is_supl, + loc_if_req_type_e_type type, int ipv4, char* ipv6) : loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), - isSupl(is_supl), ipv4Addr(ipv4), + ifType(type), ipv4Addr(ipv4), ipv6Addr(NULL == ipv6 ? NULL : new char[16]) { if (NULL != ipv6Addr) memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), (unsigned char)ipv4, NULL != ipv6Addr ? ipv6Addr : ""); } @@ -285,24 +479,61 @@ struct loc_eng_msg_request_bit : public loc_eng_msg { } }; +struct loc_eng_msg_request_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_request_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != ssid) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != password) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_request_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } +}; + struct loc_eng_msg_release_bit : public loc_eng_msg { - const unsigned int isSupl; + const loc_if_req_type_e_type ifType; const int ipv4Addr; char* const ipv6Addr; inline loc_eng_msg_release_bit(void* instance, - unsigned int is_supl, + loc_if_req_type_e_type type, int ipv4, char* ipv6) : loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), - isSupl(is_supl), ipv4Addr(ipv4), + ifType(type), ipv4Addr(ipv4), ipv6Addr(NULL == ipv6 ? NULL : new char[16]) { if (NULL != ipv6Addr) memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("isSupl: %d, ipv4: %d.%d.%d.%d, ipv6: %s", isSupl, - (unsigned char)ipv4>>24, - (unsigned char)ipv4>>16, - (unsigned char)ipv4>>8, + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), (unsigned char)ipv4, NULL != ipv6Addr ? ipv6Addr : ""); } @@ -315,6 +546,43 @@ struct loc_eng_msg_release_bit : public loc_eng_msg { } }; +struct loc_eng_msg_release_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_release_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != s) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != p) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_release_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } +}; + struct loc_eng_msg_request_atl : public loc_eng_msg { const int handle; const AGpsType type; @@ -452,7 +720,7 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { } }; -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 struct loc_eng_msg_atl_open_success : public loc_eng_msg { const AGpsStatusValue agpsType; const int length; @@ -502,7 +770,7 @@ struct loc_eng_msg_atl_open_success : public loc_eng_msg { }; #endif -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 struct loc_eng_msg_atl_open_failed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_open_failed(void* instance, @@ -524,7 +792,7 @@ struct loc_eng_msg_atl_open_failed : public loc_eng_msg { }; #endif -#ifdef QCOM_FEATURE_IPV6 +#ifdef FEATURE_IPV6 struct loc_eng_msg_atl_closed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_closed(void* instance, @@ -567,6 +835,118 @@ struct loc_eng_msg_set_data_enable : public loc_eng_msg { } }; +struct loc_eng_msg_request_network_position : public loc_eng_msg { + const UlpNetworkRequestPos networkPosRequest; + inline loc_eng_msg_request_network_position (void* instance, UlpNetworkRequestPos networkPosReq) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NETWORK_POSIITON), + networkPosRequest(networkPosReq) + { + LOC_LOGV("network position request: desired pos source %d\n request type: %d\n interval ms: %d ", + networkPosReq.desired_position_source, + networkPosReq.request_type, + networkPosReq.interval_ms); + } +}; + +struct loc_eng_msg_request_phone_context : public loc_eng_msg { + const UlpPhoneContextRequest contextRequest; + inline loc_eng_msg_request_phone_context (void* instance, UlpPhoneContextRequest contextReq) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_PHONE_CONTEXT), + contextRequest(contextReq) + { + LOC_LOGV("phone context request: request type 0x%x context type: 0x%x ", + contextRequest.request_type, + contextRequest.context_type); + } +}; + +struct ulp_msg_update_criteria : public loc_eng_msg { + const UlpLocationCriteria locationCriteria; + inline ulp_msg_update_criteria (void* instance, UlpLocationCriteria criteria) : + loc_eng_msg(instance, ULP_MSG_UPDATE_CRITERIA), + locationCriteria(criteria) + { + LOC_LOGV("location criteria: aciton %d\n valid mask: %d\n provider source: %d\n accuracy %d\n recurrence type %d\n min interval %d\n power consumption %d\n intermediate pos %d ", + locationCriteria.action, + locationCriteria.valid_mask, + locationCriteria.provider_source, + locationCriteria.preferred_horizontal_accuracy, + locationCriteria.recurrence_type, + locationCriteria.min_interval, + locationCriteria.preferred_power_consumption, + locationCriteria.intermediate_pos_report_enabled); + } +}; + +struct ulp_msg_inject_raw_command : public loc_eng_msg { + const char* rawCommand; + const int rawCommandLength; + inline ulp_msg_inject_raw_command (void* instance, char* command, int length) : + loc_eng_msg(instance, ULP_MSG_INJECT_RAW_COMMAND), + rawCommand(new char[length]), + rawCommandLength(length) + { + memcpy((void*)rawCommand, (void*)command, length); + LOC_LOGV("inject raw command: command %s\n command length: %d\n ", + rawCommand, + rawCommandLength); + } + + inline ~ulp_msg_inject_raw_command() + { + delete[] rawCommand; + } +}; + +struct ulp_msg_inject_phone_context_settings : public loc_eng_msg { + const UlpPhoneContextSettings phoneSetting; + inline ulp_msg_inject_phone_context_settings(void* instance, UlpPhoneContextSettings setting) : + loc_eng_msg(instance, ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS), + phoneSetting(setting) + { + LOC_LOGV("context type: %d\n gps enabled: %d\n network position available %d\n wifi setting enabled %d\n battery charging %d" + "is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", + phoneSetting.context_type, + phoneSetting.is_gps_enabled, + phoneSetting.is_network_position_available, + phoneSetting.is_wifi_setting_enabled, + phoneSetting.is_battery_charging, + phoneSetting.is_agps_enabled, + phoneSetting.is_enh_location_services_enabled); + } +}; + +struct ulp_msg_inject_network_position : public loc_eng_msg { + const UlpNetworkPositionReport networkPosition; + inline ulp_msg_inject_network_position(void* instance, UlpNetworkPositionReport networkPos) : + loc_eng_msg(instance, ULP_MSG_INJECT_NETWORK_POSITION), + networkPosition(networkPos) + { + LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n accuracy %f", + networkPosition.valid_flag, + networkPosition.position.pos_source, + networkPosition.position.latitude, + networkPosition.position.longitude, + networkPosition.position.HEPE); + } +}; + +struct ulp_msg_report_quipc_position : public loc_eng_msg { + const UlpLocation location; + const int quipc_error_code; + inline ulp_msg_report_quipc_position(void* instance, UlpLocation &loc, + int quipc_err) : + loc_eng_msg(instance, ULP_MSG_REPORT_QUIPC_POSITION), + location(loc), quipc_error_code(quipc_err) + { + 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 Quipc error: %d", + 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, + quipc_error_code); + } +}; + void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); int loc_eng_msgget(int * p_req_msgq); int loc_eng_msgremove(int req_msgq); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index f05f1f44..bcdf2969 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -76,11 +76,61 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_RELEASE_BIT, LOC_ENG_MSG_REQUEST_ATL, LOC_ENG_MSG_RELEASE_ATL, + LOC_ENG_MSG_REQUEST_WIFI, + LOC_ENG_MSG_RELEASE_WIFI, LOC_ENG_MSG_REQUEST_NI, LOC_ENG_MSG_INFORM_NI_RESPONSE, LOC_ENG_MSG_REQUEST_XTRA_DATA, LOC_ENG_MSG_REQUEST_TIME, - LOC_ENG_MSG_REQUEST_POSITION + LOC_ENG_MSG_REQUEST_POSITION, + LOC_ENG_MSG_EXT_POWER_CONFIG, + + // The following messages are added for ulp + LOC_ENG_MSG_REQUEST_PHONE_CONTEXT, + LOC_ENG_MSG_REQUEST_NETWORK_POSIITON, + + /* Following messages are for ulp, start at index 0x600 */ + + // Message is sent by GPS HAL layer to add/remove unique request criteria + ULP_MSG_UPDATE_CRITERIA = 0x600, + + // Message is sent by GPS HAL layer to request ULP to start producing position fixes + + ULP_MSG_START_FIX, + + // Message is sent by Android framework(GpsLocationProvider) + // to request ULP to stop producing position fixes + ULP_MSG_STOP_FIX, + + // Message is sent by Android framework(GpsLocationProvider) + // to inject phone context setting include initial phone context setting and subsequent changes + ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS, + + // Message is sent by network provider to INJECT the position in UlpNetworkPositionReport format + ULP_MSG_INJECT_NETWORK_POSITION, + + // Message is sent by QUIPC provider in order to report the position in GpsPosition format with QUIPC status + ULP_MSG_REPORT_QUIPC_POSITION, + + // Message is sent by QUIPC module in order to request some info from ULP + ULP_MSG_REQUEST_COARSE_POSITION, + + // Message is sent to ULP module to re-evaluate its subsystems + ULP_MSG_MONITOR, + + // Last ULP MSG + ULP_MSG_LAST = 0x700, + + /* Message is sent by HAL to LOC API to configure LTE Positioning + Profile in modem */ + LOC_ENG_MSG_LPP_CONFIG, + + // Message is sent by Android framework (GpsLocationProvider) + // to inject the raw command + ULP_MSG_INJECT_RAW_COMMAND, + + /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ + LOC_ENG_MSG_A_GLONASS_PROTOCOL, }; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index c2d78af8..146b15b5 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -249,7 +249,9 @@ void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiCallbacks *callback { ENTRY_LOG_CALLFLOW(); - if (NULL == callbacks->notify_cb) { + 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."); diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 9b1c5f34..9cbc57dc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp new file mode 100644 index 00000000..9f087ca5 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -0,0 +1,703 @@ +/* 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. + * + */ + +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_eng_nmea" + +#include +#include +#include +#include "log_util.h" + +/*=========================================================================== +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; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); + 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++; + } + + int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); + return (length + checksumLength); +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_pos + +DESCRIPTION + Generate NMEA sentences generated based on position report + +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) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + + time_t utcTime(location.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); + 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; + + // ------------------ + // ------$GPGSA------ + // ------------------ + + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + uint32_t mask = loc_eng_data_p->sv_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->sv_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); + + // ------------------ + // ------$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->client_handle->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,A," , + utcHours, utcMinutes, utcSeconds); + + 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->client_handle->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," , + utcHours, utcMinutes, utcSeconds); + + 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->client_handle->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); + + // 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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + + // ------------------ + // ------$GPGSV------ + // ------------------ + + if (svStatus.num_svs <= 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 + { + int svCount = svStatus.num_svs; + int sentenceCount = svCount / 4; + if (svStatus.num_svs % 4) + sentenceCount++; + int sentenceNumber = 1; + int svNumber = 1; + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d", + sentenceCount, sentenceNumber, svCount); + + 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); i++, svNumber++) + { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svStatus.sv_list[svNumber-1].prn, + (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int + (int)(0.5 + svStatus.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.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + sentenceNumber++; + + } + } + + if (svStatus.used_in_fix_mask == 0) + { // No sv used, so there will be no position report, so send + // blank NMEA sentences + 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, "$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); + } + else + { // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; + + // 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/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h new file mode 100644 index 00000000..69305937 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -0,0 +1,42 @@ +/* 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 + +#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 GpsSvStatus &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); + +#endif // LOC_ENG_NMEA_H diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index ebc7c6fb..4b2d109d 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* Copyright (c) 2009-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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -54,12 +54,17 @@ SIDE EFFECTS int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, GpsXtraCallbacks* callbacks) { - loc_eng_xtra_data_s_type *xtra_module_data_ptr; + int ret_val = -1; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; - xtra_module_data_ptr = &loc_eng_data.xtra_module_data; - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - - return 0; + 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; + ret_val = 0; + } + return ret_val; } /*=========================================================================== diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h index 7e01e146..614348de 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h new file mode 100644 index 00000000..5822b7ca --- /dev/null +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -0,0 +1,415 @@ +/* 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. + * + */ + +#ifndef __LOC_ULP_H__ +#define __LOC_ULP_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +#define ULP_ENGINE_INTERFACE "ulp-engine-interface" +#define ULP_NETWORK_INTERFACE "ulp-network-interface" +#define ULP_RAW_CMD_INTERFACE "ulp-raw-cmd" +#define ULP_PHONE_CONTEXT_INTERFACE "ulp-phone-context" + +/** 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 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + +/** Represents recurrence of location */ +typedef enum{ + ULP_LOC_RECURRENCE_PERIODIC = 0, + ULP_LOC_RECURRENCE_SINGLE, +}UlpRecurrenceCriteria; + +/** Represents horizontal accuracy options */ +typedef enum { + ULP_HORZ_ACCURACY_DONT_CARE = 0, + ULP_HORZ_ACCURACY_LOW, + ULP_HORZ_ACCURACY_MED, + ULP_HORZ_ACCURACY_HIGH, +}UlpHorzAccuracyCriteria; + +/** Represents accuracy options (for speed, altitude, and + * bearing) */ +typedef enum { + ULP_ACCURACY_DONT_CARE = 0, + ULP_ACCURACY_LOW, + ULP_ACCURACY_HIGH, +}UlpAccuracyCriteria; + +/** Represents power consumption options */ +typedef enum { + ULP_POWER_REQ_DONT_CARE = 0, + ULP_POWER_REQ_LOW, + ULP_POWER_REQ_HIGH, +}UlpPowerCriteria; + +/** Represents data usage options */ +typedef enum { + ULP_DATA_REQ_DONT_CARE = 0, + ULP_DATA_ALLOW, + ULP_DATA_DENY, +}UlpDataUsageCriteria; + +/** Enable the reporting of altitude in location reports */ +#define ULP_ENABLE_ALTITUDE_REPORT 0x01 +/** Enable the reporting of speed in location reports */ +#define ULP_ENABLE_SPEED_REPORT 0x02 +/** Enable the reporting of bearing in location reports */ +#define ULP_ENABLE_BEARING_REPORT 0x04 + +#define ULP_CRITERIA_HAS_ACTION 0x00000001 +#define ULP_CRITERIA_HAS_PROVIDER_SOURCE 0x00000002 +#define ULP_CRITERIA_HAS_RECURRENCE_TYPE 0x00000004 +#define ULP_CRITERIA_HAS_PREFERRED_RESPONSE_TIME 0x00000010 +#define ULP_CRITERIA_HAS_MIN_INTERVAL 0x00000020 +#define ULP_CRITERIA_HAS_MIN_DISTANCE 0x00000040 +#define ULP_CRITERIA_HAS_MIN_DIST_SAMPLE_INTERVAL 0x00000080 +#define ULP_CRITERIA_HAS_DESIRED_OUTPUT_PARAMETER 0x00000100 +#define ULP_CRITERIA_HAS_PREFERRED_HORIZONTAL_ACCURACY 0x00000200 +#define ULP_CRITERIA_HAS_PREFERRED_POWER_CONSUMPTION 0x00000400 +#define ULP_CRITERIA_HAS_PREFERRED_ALTITUDE_ACCURACY 0x00000800 +#define ULP_CRITERIA_HAS_PREFERRED_BEARING_ACCURACY 0x00001000 +#define ULP_CRITERIA_HAS_PREFERRED_DATA_USAGE 0x00002000 +#define ULP_CRITERIA_HAS_INTERMEDIATE_POS_REPORT_ENABLED 0x00004000 + +#define ULP_PROVIDER_SOURCE_GNSS 0x00000001 +#define ULP_PROVIDER_SOURCE_HYBRID 0x00000002 + +#define ULP_ADD_CRITERIA 1 +#define ULP_REMOVE_CRITERIA 2 + +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; + +/** Callback with location information. + */ +typedef void (* ulp_location_callback)(UlpLocation* location); + +/** ULP Engine callback structure. */ +typedef struct { + /** set to sizeof(UlpCallbacks) */ + size_t size; + ulp_location_callback location_cb; +} UlpEngineCallbacks; + +typedef struct { + + uint32_t valid_mask; + /* delete or add. This is a mandatory field */ + int action; + /*via gps or hybrid provider*/ + int provider_source; + /** PERIODIC or SINGLE */ + UlpRecurrenceCriteria recurrence_type; + /** obtain position within the specified response time */ + uint32_t preferred_response_time; + /** Send updates after the specified interval */ + uint32_t min_interval; + /** Send updates after device moved a specified distance */ + float min_distance; + uint32_t min_dist_sample_interval; + /** Fields specfied in the mask should be reported in the + * position report (altitude, bearing and speed) */ + uint32_t desired_output_parameter; + /** Desired accuracy for latitude, longitude */ + UlpHorzAccuracyCriteria preferred_horizontal_accuracy; + /** Desired power consumption level */ + UlpPowerCriteria preferred_power_consumption; + /** Desired accuracy for altitude */ + UlpAccuracyCriteria preferred_altitude_accuracy; + /** Desired accuracy for bearing */ + UlpAccuracyCriteria preferred_bearing_accuracy; + UlpDataUsageCriteria preferred_data_usage; + bool intermediate_pos_report_enabled; +} UlpLocationCriteria; + +/** Represents the Ulp Egine interface. */ +typedef struct { + /** set to sizeof(UlpEngineInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implemenation of this interface. + */ + int (*init)( UlpEngineCallbacks* callbacks ); + + /* set criterias of location requests */ + int (*update_criteria) (UlpLocationCriteria criteria ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); +} UlpEngineInterface; + + +/** Extended interface for raw GPS command support. */ +typedef struct { + /** set to sizeof(ExtraCmdInterface) */ + size_t size; + /** Injects Android extra cmd into the ulp. Clarify if they are blocking calls */ + bool (*inject_raw_cmd)(char* bundle, int bundle_length ); + +} InjectRawCmdInterface; + +/** ULP Network Interface */ +/** Request for network position status */ +#define ULP_NETWORK_POS_STATUS_REQUEST (0x01) +/** Request for periodic network positions */ +#define ULP_NETWORK_POS_START_PERIODIC_REQUEST (0x02) +/** Request last known location */ +#define ULP_NETWORK_POS_GET_LAST_KNOWN_LOCATION_REQUEST (0x03) +/** Cancel request */ +#define ULP_NETWORK_POS_STOP_REQUEST (0x04) + +/** Position was obtained using Wifi Network */ +#define ULP_NETWORK_POSITION_SRC_WIFI (0x01) +/** Position was obtained using Cell Network */ +#define ULP_NETWORK_POSITION_SRC_CELL (0x02) +/** Position was obtained using an Unknown Network */ +#define ULP_NETWORK_POSITION_SRC_UNKNOWN (0x00) + +/** Represents the ULP network request */ +typedef struct { + /** type of request */ + uint16_t request_type; + /** Desired time between network positions/measurements in ms. + * Shall be set to 0 if only one position is requested */ + int interval_ms; + /** network position source to be used */ + uint16_t desired_position_source; +}UlpNetworkRequestPos; + +/** Callback with network position request. */ +typedef void (*ulp_network_location_request)(UlpNetworkRequestPos *req); + +/** ULP Network callback structure. */ +typedef struct { + ulp_network_location_request ulp_network_location_request_cb; +} UlpNetworkLocationCallbacks; + +/** represent a network position */ +typedef struct { + /** source of the position (Wifi, Cell) */ + uint16_t pos_source; + /** latitude in degrees */ + double latitude; + /** longitude in degrees */ + double longitude; + /** Horzizontal error estimate in meters */ + float HEPE; +} UlpNetworkPosition; + +/** Represents access point information */ +typedef struct { + /** Mac adderess */ + char mac_addr[6]; + /** signal strength in dbM */ + int32_t rssi; + /** Beacon channel for access point */ + uint16_t channel; + + /** Bit 0 = AP is used by WiFi positioning system + * Bit 1 = AP doesn't broadcast SSID Bit 2 = AP has encrption + * turned on Bit 3 = AP is in infrastructure mode and not in + * ad-hoc/unknown mode */ + uint8_t ap_qualifier; +} UlpNetworkAccessPointInfo; + +/** Represents Wifi information */ +typedef struct { + /** Number of APs in the calculated position (-1 means + * unknown) */ + uint8_t num_aps_in_pos; + /** Information of the scanned ap's used in the position estimation*/ + UlpNetworkAccessPointInfo *ap_info; +} UlpNetworkWifiInfo; + + +/** Represent network landscape information */ +typedef struct { + /** network type Cell/Wifi */ + uint8_t network_type; + /** network information */ + union { + UlpNetworkWifiInfo wifi_info; + uint32_t cell_info; + } u; +} UlpNetworkLandscape; + +/** network report valid flags */ +/** fix time is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_FIX_TIME (0x01) +/** position is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_POSITION (0x02) +/** landscape is valid */ +#define ULP_NETWORK_POSITION_REPORT_HAS_LANDSCAPE (0x04) + +/** Represents the network position report */ +typedef struct +{ + /** validity flags */ + uint16_t valid_flag; + /** time fo network fix */ + GpsUtcTime fix_time; + /** network position */ + UlpNetworkPosition position; + /** network landscape */ + UlpNetworkLandscape landscape_info; +}UlpNetworkPositionReport; + +/** represents ULP network interface extension */ +typedef struct +{ + /** set to sizeof(UlpNetworkInterface) */ + size_t size; + /** initialize network interface */ + int ( *init)(UlpNetworkLocationCallbacks *callback); + /** send network position */ + int ( *ulp_send_network_position)(UlpNetworkPositionReport *position_report); +}UlpNetworkInterface; + +/** Information for the ULP Phone context interface */ + +/** the Location settings context supports only ON_CHANGE + * request type */ +#define ULP_PHONE_CONTEXT_GPS_SETTING (0x01) +#define ULP_PHONE_CONTEXT_NETWORK_POSITION_SETTING (0x02) +#define ULP_PHONE_CONTEXT_WIFI_SETTING (0x04) +/** The battery charging state context supports only + * ON_CHANGE request type */ +#define ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE (0x08) +#define ULP_PHONE_CONTEXT_AGPS_SETTING (0x010) +#define ULP_PHONE_CONTEXT_ENH_LOCATION_SERVICES_SETTING (0x020) + +/** return phone context only once */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_SINGLE (0x01) +/** return phone context periodcially */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_PERIODIC (0x02) +/** return phone context when it changes */ +#define ULP_PHONE_CONTEXT_REQUEST_TYPE_ON_CHANGE (0x03) + + +/** Represents ULP phone context request */ +typedef struct { + /** context type requested */ + uint16_t context_type; + /** request type */ + uint16_t request_type; + /** interval in ms if request type is periodic */ + int interval_ms; +}UlpPhoneContextRequest; + +/** Callback for phone context request. */ +typedef void (*ulp_request_phone_context)(UlpPhoneContextRequest *req); + +/** ULP Phone Context callback structure. */ +typedef struct { + ulp_request_phone_context ulp_request_phone_context_cb; +}UlpPhoneContextCallbacks; + +/** Represents the phone context settings */ +typedef struct { + /** Phone context information type */ + uint16_t context_type; + + /** network information */ + /** gps setting */ + bool is_gps_enabled; + /** is network positioning enabled */ + bool is_network_position_available; + /** is wifi turned on */ + bool is_wifi_setting_enabled; + /** is battery being currently charged */ + bool is_battery_charging; + /* is agps enabled for single shot */ + bool is_agps_enabled; + /* is Enhanced Location Services enabled by user*/ + bool is_enh_location_services_enabled; +} UlpPhoneContextSettings; + +/** Represent the phone contxt interface */ +typedef struct +{ + /** set to sizeof(UlpPhoneContextInterface) */ + size_t size; + /** Initialize, register callback */ + int (*init)(UlpPhoneContextCallbacks *callback); + /** send the phone context settings */ + int (*ulp_phone_context_settings_update) (UlpPhoneContextSettings *settings ); +}UlpPhoneContextInterface; + + +//int loc_update_criteria(UlpLocationCriteria criteria); +//const void* loc_get_extension(const char* name); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_ULP_H__ diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk new file mode 100644 index 00000000..8617f3cb --- /dev/null +++ b/loc_api/loc_api_v02/Android.mk @@ -0,0 +1,50 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api_v02 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libloc_adapter \ + libgps.utils + +LOCAL_SRC_FILES += \ + LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +ifeq ($(FEATURE_IPV6), true) +LOCAL_CFLAGS += -DFEATURE_IPV6 +endif #FEATURE_IPV6 + +ifeq ($(FEATURE_DELEXT), true) +LOCAL_CFLAGS += -DFEATURE_DELEXT +endif #FEATURE_DELEXT + +## Includes +LOCAL_C_INCLUDES := \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/qmi-framework/inc \ + $(TARGET_OUT_HEADERS)/qmi/inc \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp new file mode 100644 index 00000000..d7276e95 --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -0,0 +1,2257 @@ +/* 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 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. + */ + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_adapter" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include "LocApiV02Adapter.h" +#include "loc_api_v02_client.h" +#include "loc_api_v02_log.h" +#include "loc_api_sync_req.h" +#include "LocApiAdapter.h" +#include "loc_util_log.h" + + +/* Default session id ; TBD needs incrementing for each */ +#define LOC_API_V02_DEF_SESSION_ID (1) + +/* Default minimium interval in ms */ +#define LOC_API_V02_DEF_MIN_INTERVAL (1000) + +/* Default horizontal accuracy in meters*/ +#define LOC_API_V02_DEF_HORZ_ACCURACY (50) + +/* Default timeout in ms; TBD: needs implementing */ +#define LOC_API_V02_DEF_TIMEOUT (120000) + +/* UMTS CP Address key*/ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +/* GPS SV Id offset */ +#define GPS_SV_ID_OFFSET (1) + +/* GLONASS SV Id offset */ +#define GLONASS_SV_ID_OFFSET (65) + +/* SV ID range */ +#define SV_ID_RANGE (32) + + + +/* static event callbacks that call the LocApiV02Adapter callbacks*/ + +/* global event callback, call the eventCb function in loc api adapter v02 + instance */ +static void globalEventCb(locClientHandleType clientHandle, + uint32_t eventId, + const locClientEventIndUnionType eventPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, eventId, pClientCookie); + + // return if null is passed + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", + __func__, __LINE__, clientHandle, eventId); + return; + } + locApiV02AdapterInstance->eventCb(clientHandle, + eventId, + eventPayload); +} + +/* global response callback, it calls the sync request process + indication function to unblock the request that is waiting on this + response indication*/ +static void globalRespCb(locClientHandleType clientHandle, + uint32_t respId, + const locClientRespIndUnionType respPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + + LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, respId, pClientCookie); + + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", + __func__, __LINE__, clientHandle, respId); + return; + } + // process the sync call + // use pDeleteAssistDataInd as a dummy pointer + loc_sync_process_ind(clientHandle, respId, + (void *)respPayload.pDeleteAssistDataInd); +} + +/* global error callback, it will call the handle service down + function in the loc api adapter instance. */ +static void globalErrorCb (locClientHandleType clientHandle, + locClientErrorEnumType errorId, + void *pClientCookie) +{ + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, errorId, pClientCookie); + if( NULL == locApiV02AdapterInstance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", + __func__, __LINE__, clientHandle, errorId); + return; + } + locApiV02AdapterInstance->errorCb(clientHandle, + errorId); +} + +/* global structure containing the callbacks */ +locClientCallbacksType globalCallbacks = +{ + sizeof(locClientCallbacksType), + globalEventCb, + globalRespCb, + globalErrorCb +}; + +/* Constructor for LocApiV02Adapter */ +LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): + LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), + eventMask(convertMask(locEng.eventMask)) +{ + // initialize loc_sync_req interface + loc_sync_req_init(); +} + +/* Destructor for LocApiV02Adapter */ +LocApiV02Adapter :: ~LocApiV02Adapter() +{ + deInitLocClient(); +} + +/* close Loc API V02 client */ +int LocApiV02Adapter :: deInitLocClient() +{ + return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; +} + +/* Initialize a loc api v02 client */ +enum loc_api_adapter_err LocApiV02Adapter :: reinit() +{ + locClientStatusEnumType status; + /* If the client is already open close it first */ + if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) + { + status = locClientClose(&clientHandle); + if( eLOC_CLIENT_SUCCESS != status) + { + LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, + __LINE__, status); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + } + + LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, + __LINE__, this); + /* initialize the loc api v02 interface, note that + the locClientOpen() function will block if the + service is unavailable for a fixed time out */ + + status = locClientOpen( + eventMask, &globalCallbacks, &clientHandle, (void *)this); + + if (eLOC_CLIENT_SUCCESS != status || + clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) + { + LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, + __LINE__, loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_FAILURE); + } + + // return SUCCESS + return (LOC_API_ADAPTER_ERR_SUCCESS); +} + +/* start positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: startFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStartReqMsgT_v02 start_msg; + + qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; + qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; + + // clear all fields, validity masks + memset (&start_msg, 0, sizeof(start_msg)); + memset (&set_mode_msg, 0, sizeof(set_mode_msg)); + memset (&set_mode_ind, 0, sizeof(set_mode_ind)); + + LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + fixCriteria.logv(); + + // fill in the start request + switch(fixCriteria.mode) + { + case LOC_POSITION_MODE_MS_BASED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; + break; + + case LOC_POSITION_MODE_MS_ASSISTED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; + break; + + case LOC_POSITION_MODE_RESERVED_4: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; + break; + + case LOC_POSITION_MODE_RESERVED_5: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_WWAN_V02; + break; + + default: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; + break; + } + + req_union.pSetOperationModeReq = &set_mode_msg; + + // send the mode first, before the start message. + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_OPERATION_MODE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_OPERATION_MODE_IND_V02, + &set_mode_ind); // NULL? + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) + { + LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " + "ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_mode_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error + } + + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; + + if (fixCriteria.preferred_accuracy >= 0) { + start_msg.horizontalAccuracyLevel_valid = 1; + + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } + } + + start_msg.fixRecurrence_valid = 1; + if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; + } + else + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; + } + + //dummy session id + // TBD: store session ID, check for session id in pos reports. + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + if (fixCriteria.credentials[0] != 0) { + int size1 = sizeof(start_msg.applicationId.applicationName); + int size2 = sizeof(fixCriteria.credentials); + int len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationName, + fixCriteria.credentials, + len); + + size1 = sizeof(start_msg.applicationId.applicationProvider); + size2 = sizeof(fixCriteria.provider); + len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationProvider, + fixCriteria.provider, + len); + + start_msg.applicationId_valid = 1; + } + + req_union.pStartReq = &start_msg; + + status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, + req_union ); + + if( eLOC_CLIENT_SUCCESS == status) + { + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; +} + +/* stop a positioning session */ +enum loc_api_adapter_err LocApiV02Adapter :: stopFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStopReqMsgT_v02 stop_msg; + + LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); + + memset(&stop_msg, 0, sizeof(stop_msg)); + + // dummy session id + stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pStopReq = &stop_msg; + + status = locClientSendReq(clientHandle, + QMI_LOC_STOP_REQ_V02, + req_union); + + if( eLOC_CLIENT_SUCCESS == status) + { + return LOC_API_ADAPTER_ERR_SUCCESS; + } + + LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, + loc_get_v02_client_status_name(status)); + return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); +} + +/* set the positioning fix criteria */ +enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( + const LocPosMode *posMode) +{ + LOC_LOGV ("%s:%d]: posMode %p",__func__, __LINE__, posMode); + + if (NULL != posMode && + !fixCriteria.equals(*posMode)) { + //making a copy of the fix criteria + fixCriteria = *posMode; + + LOC_LOGD ("%s:%d]: new fix criteria", __func__, __LINE__); + + if(true == navigating) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); + + return( startFix()); + } + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject time into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; + qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; + + memset(&inject_time_msg, 0, sizeof(inject_time_msg)); + + inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; + + inject_time_msg.timeUtc = time; + + inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); + + inject_time_msg.timeUnc = uncertainty; + + req_union.pInjectUtcTimeReq = &inject_time_msg; + + LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, + uncertainty); + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_UTC_TIME_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_UTC_TIME_IND_V02, + &inject_time_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) + { + LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_time_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject position into the position engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + injectPosition(double latitude, double longitude, float accuracy) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; + qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; + + memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); + + inject_pos_msg.latitude_valid = 1; + inject_pos_msg.latitude = latitude; + + inject_pos_msg.longitude_valid = 1; + inject_pos_msg.longitude = longitude; + + inject_pos_msg.horUncCircular_valid = 1; + + inject_pos_msg.horUncCircular = accuracy; //meters assumed + + inject_pos_msg.horConfidence_valid = 1; + + inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) + + /* Log */ + LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, + inject_pos_msg.latitude, inject_pos_msg.longitude, + inject_pos_msg.horUncCircular); + + req_union.pInjectPositionReq = &inject_pos_msg; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_POSITION_IND_V02, + &inject_pos_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_pos_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* delete assistance date */ +enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteAssistDataReqMsgT_v02 delete_req; + qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; + + memset(&delete_req, 0, sizeof(delete_req)); + memset(&delete_resp, 0, sizeof(delete_resp)); + + if( f == GPS_DELETE_ALL ) + { + delete_req.deleteAllFlag = true; + } + + else + { + /* to keep track of svInfoList for GPS and GLO*/ + uint32_t curr_sv_len = 0; + uint32_t curr_sv_idx = 0; + uint32_t sv_id = 0; + + if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) + { + /* do delete for all GPS SV's */ + + curr_sv_len += SV_ID_RANGE; + + sv_id = GPS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + // increment the current index + curr_sv_idx += SV_ID_RANGE; + + } + +#ifdef FEATURE_DELEXT + if( f & GPS_DELETE_TIME_GPS ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; + } +#endif + + if(f & GPS_DELETE_POSITION ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; + } + + if(f & GPS_DELETE_TIME ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; + } + + if(f & GPS_DELETE_IONO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; + } + + if(f & GPS_DELETE_UTC ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; + } + + if(f & GPS_DELETE_HEALTH ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; + } + + if(f & GPS_DELETE_SVDIR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; + } + if(f & GPS_DELETE_SADATA ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; + } + if(f & GPS_DELETE_RTI ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; + } + if(f & GPS_DELETE_CELLDB_INFO ) + { + delete_req.deleteCellDbDataMask_valid = 1; + delete_req.deleteCellDbDataMask = + ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; + + } +#ifdef FEATURE_DELEXT + if(f & GPS_DELETE_ALMANAC_CORR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; + } + if(f & GPS_DELETE_FREQ_BIAS_EST ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; + } + if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) + { + /* do delete for all GLONASS SV's (65 - 96) + */ + curr_sv_len += SV_ID_RANGE; + + sv_id = GLONASS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" + "and sv id %d to %d \n", + __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, + sv_id, sv_id+SV_ID_RANGE); + + + for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) + { + delete_req.deleteSvInfoList[i].gnssSvId = sv_id; + + delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + curr_sv_idx += SV_ID_RANGE; + } + + if(f & GPS_DELETE_SVDIR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; + } + + if(f & GPS_DELETE_SVSTEER_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; + } + + if(f & GPS_DELETE_ALMANAC_CORR_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; + } + + if(f & GPS_DELETE_TIME_GLO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; + } +#endif + } + + req_union.pDeleteAssistDataReq = &delete_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + &delete_resp); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != delete_resp.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(delete_resp.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* send NI user repsonse to the engine */ +enum loc_api_adapter_err LocApiV02Adapter :: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + + qmiLocNiUserRespReqMsgT_v02 ni_resp; + qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; + + memset(&ni_resp,0, sizeof(ni_resp)); + + memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); + + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; + break; + case GPS_NI_RESPONSE_DENY: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; + break; + case GPS_NI_RESPONSE_NORESP: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; + break; + default: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, + ni_resp.userResp); + + ni_resp.notificationType = request_pass_back->notificationType; + + // copy SUPL payload from request + if(request_pass_back->NiSuplInd_valid == 1) + { + ni_resp.NiSuplPayload_valid = 1; + memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), + sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); + + } + // should this be an "else if"?? we don't need to decide + + // copy UMTS-CP payload from request + if( request_pass_back->NiUmtsCpInd_valid == 1 ) + { + ni_resp.NiUmtsCpPayload_valid = 1; + memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), + sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); + } + + //copy Vx payload from the request + if( request_pass_back->NiVxInd_valid == 1) + { + ni_resp.NiVxPayload_valid = 1; + memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), + sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); + } + + // copy Vx service interaction payload from the request + if(request_pass_back->NiVxServiceInteractionInd_valid == 1) + { + ni_resp.NiVxServiceInteractionPayload_valid = 1; + memcpy(&(ni_resp.NiVxServiceInteractionPayload), + &(request_pass_back->NiVxServiceInteractionInd), + sizeof(qmiLocNiVxServiceInteractionStructT_v02)); + } + + // copy Network Initiated SUPL Version 2 Extension + if (request_pass_back->NiSuplVer2ExtInd_valid == 1) + { + ni_resp.NiSuplVer2ExtPayload_valid = 1; + memcpy(&(ni_resp.NiSuplVer2ExtPayload), + &(request_pass_back->NiSuplVer2ExtInd), + sizeof(qmiLocNiSuplVer2ExtStructT_v02)); + } + + // copy SUPL Emergency Notification + if(request_pass_back->suplEmergencyNotification_valid) + { + ni_resp.suplEmergencyNotification_valid = 1; + memcpy(&(ni_resp.suplEmergencyNotification), + &(request_pass_back->suplEmergencyNotification), + sizeof(qmiLocEmergencyNotificationStructT_v02)); + } + + req_union.pNiUserRespReq = &ni_resp; + + status = loc_sync_send_req ( + clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ni_resp_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Set UMTs SLP server URL */ +enum loc_api_adapter_err LocApiV02Adapter :: setServer( + const char* url, int len) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + + if(len <=0 || len > sizeof(set_server_req.urlAddr)) + { + LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", + __func__, __LINE__, len); + + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); + + set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; + + set_server_req.urlAddr_valid = 1; + + strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +enum loc_api_adapter_err LocApiV02Adapter :: + setServer(unsigned int ip, int port, LocServerType type) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + qmiLocServerTypeEnumT_v02 set_server_cmd; + + switch (type) { + case LOC_AGPS_MPC_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; + break; + case LOC_AGPS_CUSTOM_PDE_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; + break; + default: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; + break; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); + + set_server_req.serverType = set_server_cmd; + set_server_req.ipv4Addr_valid = 1; + set_server_req.ipv4Addr.addr = ip; + set_server_req.ipv4Addr.port = port; + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* Inject XTRA data, this module breaks down the XTRA + file into "chunks" and injects them one at a time */ +enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( + char* data, int length) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + int total_parts; + uint8_t part; + uint16_t len_injected; + + locClientReqUnionType req_union; + qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; + qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; + + req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; + + LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); + + inject_xtra.formatType_valid = 1; + inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; + inject_xtra.totalSize = length; + + total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; + + inject_xtra.totalParts = total_parts; + + len_injected = 0; // O bytes injected + + // XTRA injection starts with part 1 + for (part = 1; part <= total_parts; part++) + { + inject_xtra.partNum = part; + + if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) + { + inject_xtra.partData_len = length - len_injected; + } + else + { + inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; + } + + // copy data into the message + memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); + + LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", + __func__, __LINE__, + inject_xtra.partNum, total_parts, inject_xtra.partData_len, + len_injected); + + status = loc_sync_send_req( clientHandle, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + &inject_xtra_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || + inject_xtra.partNum != inject_xtra_ind.partNum) + { + LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," + " part num = %d, ind.partNum = %d\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_xtra_ind.status), + inject_xtra.partNum, inject_xtra_ind.partNum); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + break; + } + + len_injected += inject_xtra.partData_len; + LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, + len_injected); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +#ifdef FEATURE_IPV6 +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType) +#else +enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( + int handle, int is_succ, char* apn, + AGpsType agpsType) +#endif +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + +#ifdef FEATURE_IPV6 + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s], bearer = %d \n", __func__, __LINE__, + handle, is_succ, apn, bear); +#else + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s] \n", __func__, __LINE__, + handle, is_succ, apn); +#endif + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + +#ifdef FEATURE_IPV6 + switch(bear) + { + case AGPS_APN_BEARER_IPV4: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + break; + + case AGPS_APN_BEARER_IPV6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + break; + + case AGPS_APN_BEARER_IPV4V6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + break; + + default: + LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } +#else + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; +#endif + + conn_status_req.apnProfile_valid = 1; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; + +} + + +/* close atl connection */ +enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( + int handle, int is_succ) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", + __func__, __LINE__, handle, is_succ); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the SUPL version */ +enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; + + LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); + + + memset(&supl_config_req, 0, sizeof(supl_config_req)); + memset(&supl_config_ind, 0, sizeof(supl_config_ind)); + + supl_config_req.suplVersion_valid = 1; + // SUPL version from MSByte to LSByte: + // (reserved)(major version)(minor version)(serviceIndicator) + + supl_config_req.suplVersion = (version == 0x00020000)? + eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; + + req_union.pSetProtocolConfigParametersReq = &supl_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &supl_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(supl_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the configuration for LTE positioning profile (LPP) */ +enum loc_api_adapter_err LocApiV02Adapter :: setLPPConfig(uint32_t profile) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 lpp_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 lpp_config_ind; + + LOC_LOGD("%s:%d]: lpp profile = %d\n", __func__, __LINE__, profile); + + memset(&lpp_config_req, 0, sizeof(lpp_config_req)); + memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); + + lpp_config_req.lppConfig_valid = 1; + + lpp_config_req.lppConfig = profile; + + req_union.pSetProtocolConfigParametersReq = &lpp_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &lpp_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != lpp_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(lpp_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Configuration */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; + qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; + + LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); + + memset(&sensor_config_req, 0, sizeof(sensor_config_req)); + memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); + + sensor_config_req.sensorsUsage_valid = 1; + sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 + : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; + + req_union.pSetSensorControlConfigReq = &sensor_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + &sensor_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Properties */ +enum loc_api_adapter_err LocApiV02Adapter :: 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) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; + qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; + + LOC_LOGI("%s:%d]: sensors prop: gyroBiasRandomWalk = %f, accelRandomWalk = %f, " + "angleRandomWalk = %f, rateRandomWalk = %f, velocityRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk, accelBiasVarianceRandomWalk, + angleBiasVarianceRandomWalk, rateBiasVarianceRandomWalk, velocityBiasVarianceRandomWalk); + + memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); + memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); + + /* Set the validity bit and value for each sensor property */ + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = gyroBiasVarianceRandomWalk_valid; + sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + + sensor_prop_req.accelerationRandomWalkSpectralDensity_valid = accelBiasVarianceRandomWalk_valid; + sensor_prop_req.accelerationRandomWalkSpectralDensity = accelBiasVarianceRandomWalk; + + sensor_prop_req.angleRandomWalkSpectralDensity_valid = angleBiasVarianceRandomWalk_valid; + sensor_prop_req.angleRandomWalkSpectralDensity = angleBiasVarianceRandomWalk; + + sensor_prop_req.rateRandomWalkSpectralDensity_valid = rateBiasVarianceRandomWalk_valid; + sensor_prop_req.rateRandomWalkSpectralDensity = rateBiasVarianceRandomWalk; + + sensor_prop_req.velocityRandomWalkSpectralDensity_valid = velocityBiasVarianceRandomWalk_valid; + sensor_prop_req.velocityRandomWalkSpectralDensity = velocityBiasVarianceRandomWalk; + + req_union.pSetSensorPropertiesReq = &sensor_prop_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + &sensor_prop_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_prop_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Sensor Performance Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, + int algorithmConfig) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; + qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; + + LOC_LOGD("%s:%d]: 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", + __FUNCTION__, + __LINE__, + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, + algorithmConfig + ); + + memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); + memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); + + sensor_perf_config_req.performanceControlMode_valid = 1; + sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; + sensor_perf_config_req.accelSamplingSpec_valid = 1; + sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; + sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; + sensor_perf_config_req.gyroSamplingSpec_valid = 1; + sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; + sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + sensor_perf_config_req.accelSamplingSpecHigh_valid = 1; + sensor_perf_config_req.accelSamplingSpecHigh.batchesPerSecond = accelBatchesPerSecHigh; + sensor_perf_config_req.accelSamplingSpecHigh.samplesPerBatch = accelSamplesPerBatchHigh; + sensor_perf_config_req.gyroSamplingSpecHigh_valid = 1; + sensor_perf_config_req.gyroSamplingSpecHigh.batchesPerSecond = gyroBatchesPerSecHigh; + sensor_perf_config_req.gyroSamplingSpecHigh.samplesPerBatch = gyroSamplesPerBatchHigh; + sensor_perf_config_req.algorithmConfig_valid = 1; + sensor_perf_config_req.algorithmConfig = algorithmConfig; + + req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + &sensor_perf_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the External Power Config */ +enum loc_api_adapter_err LocApiV02Adapter :: setExtPowerConfig(int isBatteryCharging) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetExternalPowerConfigReqMsgT_v02 ext_pwr_req; + qmiLocGetExternalPowerConfigIndMsgT_v02 ext_pwr_ind; + + LOC_LOGI("%s:%d]: Ext Pwr Config (isBatteryCharging)(%u)", + __FUNCTION__, + __LINE__, + isBatteryCharging + ); + + memset(&ext_pwr_req, 0, sizeof(ext_pwr_req)); + memset(&ext_pwr_ind, 0, sizeof(ext_pwr_ind)); + + switch(isBatteryCharging) + { + /* Charging */ + case 1: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02; + break; + + /* Not charging */ + case 0: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02; + break; + + default: + LOC_LOGE("%s:%d]: Invalid ext power state = %d!", + __FUNCTION__, + __LINE__, + isBatteryCharging); + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + break; + } + + req_union.pSetExternalPowerConfigReq = &ext_pwr_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + &ext_pwr_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ext_pwr_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %d, ind..status = %d ", + __func__, __LINE__, result, ext_pwr_ind.status); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* set the Positioning Protocol on A-GLONASS system */ +enum loc_api_adapter_err LocApiV02Adapter :: setAGLONASSProtocol(unsigned long aGlonassProtocol) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind; + + memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req)); + memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind)); + + aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1; + aGlonassProtocol_req.assistedGlonassProtocolMask = aGlonassProtocol; + + req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req; + + LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%lx\n", __func__, __LINE__, + aGlonassProtocol_req.assistedGlonassProtocolMask); + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &aGlonassProtocol_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status)); + + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + return LOC_API_ADAPTER_ERR_SUCCESS; +} + + +/* Convert event mask from loc eng to loc_api_v02 format */ +locClientEventMaskType LocApiV02Adapter :: convertMask( + LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + locClientEventMaskType eventMask = 0; + LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); + + if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + + if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + + /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ + if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || + (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) + eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; + + if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; + + if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) + { + // TBD: This needs to be decoupled in the HAL + eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; + } + + if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) + { + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); + } + + if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; + + return eventMask; +} + +/* Convert error from loc_api_v02 to loc eng format*/ +enum loc_api_adapter_err LocApiV02Adapter :: convertErr( + locClientStatusEnumType status) +{ + switch( status) + { + case LOC_API_ADAPTER_ERR_SUCCESS: + return LOC_API_ADAPTER_ERR_SUCCESS; + + case eLOC_CLIENT_FAILURE_GENERAL: + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + + case eLOC_CLIENT_FAILURE_UNSUPPORTED: + return LOC_API_ADAPTER_ERR_UNSUPPORTED; + + case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + + case eLOC_CLIENT_FAILURE_ENGINE_BUSY: + return LOC_API_ADAPTER_ERR_ENGINE_BUSY; + + case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: + return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; + + case eLOC_CLIENT_FAILURE_TIMEOUT: + return LOC_API_ADAPTER_ERR_TIMEOUT; + + case eLOC_CLIENT_FAILURE_INVALID_HANDLE: + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + + case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: + return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; + + default: + return LOC_API_ADAPTER_ERR_FAILURE; + } +} + +/* convert position report to loc eng format and send the converted + position to loc eng */ + +void LocApiV02Adapter :: reportPosition ( + const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) +{ + UlpLocation location; + LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; + LOC_LOGD("Reporting postion from V2 Adapter\n"); + memset(&location, 0, sizeof (UlpLocation)); + location.size = sizeof(location); + GpsLocationExtended locationExtended; + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); + // Process the position from final and intermediate reports + + if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || + (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) + ) + { + // Latitude & Longitude + if( (location_report_ptr->latitude_valid == 1 ) && + (location_report_ptr->longitude_valid == 1) && + (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->timestampUtc_valid == 1) + { + location.gpsLocation.timestamp = location_report_ptr->timestampUtc; + } + + // Altitude + if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.gpsLocation.altitude = location_report_ptr->altitudeWrtEllipsoid; + } + + // Speed + if((location_report_ptr->speedHorizontal_valid == 1) && + (location_report_ptr->speedVertical_valid ==1 ) ) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; + location.gpsLocation.speed = sqrt( + (location_report_ptr->speedHorizontal * + location_report_ptr->speedHorizontal) + + (location_report_ptr->speedVertical * + location_report_ptr->speedVertical) ); + } + + // Heading + if(location_report_ptr->heading_valid == 1) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; + location.gpsLocation.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if( (location_report_ptr->horUncCircular_valid ) ) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; + location.gpsLocation.accuracy = location_report_ptr->horUncCircular; + } + + // Technology Mask + tech_Mask |= location_report_ptr->technologyMask; + + //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->magneticDeviation_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; + locationExtended.magneticDeviation = location_report_ptr->magneticDeviation; + } + + if (location_report_ptr->DOP_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; + locationExtended.pdop = location_report_ptr->DOP.PDOP; + locationExtended.hdop = location_report_ptr->DOP.HDOP; + locationExtended.vdop = location_report_ptr->DOP.VDOP; + } + + if (location_report_ptr->altitudeWrtMeanSeaLevel_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; + locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; + } + + if (location_report_ptr->vertUnc_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; + locationExtended.vert_unc = location_report_ptr->vertUnc; + } + + if (location_report_ptr->speedUnc_valid ) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; + locationExtended.speed_unc = location_report_ptr->speedUnc; + } + + LocApiAdapter::reportPosition( location, + locationExtended, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->sessionStatus + == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + tech_Mask); + } + } + else + { + LocApiAdapter::reportPosition(location, + locationExtended, + NULL, + LOC_SESS_FAILURE); + + LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " + "fix id = %u\n", __func__, __LINE__, + location_report_ptr->sessionStatus, + location_report_ptr->fixId ); + } +} + +/* convert satellite report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportSv ( + const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + GpsLocationExtended locationExtended; + int num_svs_max, i; + const qmiLocSvInfoStructT_v02 *sv_info_ptr; + + LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, + gnss_report_ptr->svList_len); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); + if(gnss_report_ptr->svList_valid == 1) + { + num_svs_max = gnss_report_ptr->svList_len; + if(num_svs_max > GPS_MAX_SVS) + { + num_svs_max = GPS_MAX_SVS; + } + SvStatus.num_svs = 0; + for(i = 0; i < num_svs_max; i++) + { + sv_info_ptr = &(gnss_report_ptr->svList[i]); + if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && + (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) + && (sv_info_ptr->gnssSvId != 0 )) + { + if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; + + // We only have the data field to report gps eph and alm mask + if(sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) + { + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) + { + SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) + { + SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + (65-1); + } + // Unsupported SV system + else + { + continue; + } + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) + { + SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) + { + SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) + { + SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; + } + + SvStatus.num_svs++; + } + } + + if (SvStatus.num_svs >= 0) + { + LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); + LocApiAdapter::reportSv(SvStatus, + locationExtended, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); + } +} + +/* convert engine state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) +{ + + LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, + engine_state_ptr->engineState); + + if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) + { + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); + } + else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) + { + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); + } + else + { + LocApiAdapter::reportStatus(GPS_STATUS_NONE); + } + +} + +/* convert fix session state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) +{ + GpsStatusValue status; + LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, + fix_session_state_ptr->sessionState); + + status = GPS_STATUS_NONE; + if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (fix_session_state_ptr->sessionState + == eQMI_LOC_FIX_SESSION_FINISHED_V02) + { + status = GPS_STATUS_SESSION_END; + } + LocApiAdapter::reportStatus(status); +} + +/* convert NMEA report to loc eng format and send the converted + report to loc eng */ +void LocApiV02Adapter :: reportNmea ( + const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) +{ + + LocApiAdapter::reportNmea(nmea_report_ptr->nmea, + strlen(nmea_report_ptr->nmea)); + + LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, + nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], + nmea_report_ptr->nmea[5]); +} + +/* convert and report an ATL request to loc engine */ +void LocApiV02Adapter :: reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) +{ + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) + { + AGpsType agpsType; +#ifdef FEATURE_IPV6 + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + break; + + default: + agpsType = AGPS_TYPE_WWAN_ANY; + break; + } +#else + agpsType = AGPS_TYPE_SUPL; +#endif + LocApiAdapter::requestATL(connHandle, agpsType); + } + + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + LocApiAdapter::releaseATL(connHandle); + } +} + +/* conver the NI report to loc eng format and send t loc engine */ +void LocApiV02Adapter :: reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) +{ + GpsNiNotification notif; + + /* initialize the notification*/ + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + /* NI timeout gets overwritten in LocApiAdapter, + initializing to 0 here */ + notif.timeout = 0; + + notif.text_encoding = GPS_ENC_NONE ; + + notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + + notif.notify_flags = 0; + + notif.default_response = GPS_NI_RESPONSE_NORESP; + + /*Handle Vx request */ + if(ni_req_ptr->NiVxInd_valid == 1) + { + const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); + + notif.ni_type = GPS_NI_TYPE_VOICE; + + // Requestor ID, the requestor id recieved is NULL terminated + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char *)vx_req->requestorId, vx_req->requestorId_len ); + } + + /* Handle UMTS CP request*/ + else if(ni_req_ptr->NiUmtsCpInd_valid == 1) + { + const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = + &ni_req_ptr->NiUmtsCpInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + + /* notificationText should always be a NULL terminated string */ + hexcode(notif.text, sizeof notif.text, + (char *)umts_cp_req->notificationText, + umts_cp_req->notificationText_len); + + /* Store requestor ID */ + hexcode(notif.requestor_id, sizeof(notif.requestor_id), + (char *)umts_cp_req->requestorId.codedString, + umts_cp_req->requestorId.codedString_len); + + /* convert encodings */ + notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); + + notif.requestor_id_encoding = + convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); + + /* LCS address (using extras field) */ + if ( umts_cp_req->clientAddress_len != 0) + { + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + + // 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; + address_source = (char *)umts_cp_req->clientAddress; + // client Address is always NULL terminated + addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, + umts_cp_req->clientAddress_len); + + // The address is ASCII string + if (addr_len) + { + strlcat(notif.extras, lcs_addr, sizeof notif.extras); + } + } + + } + else if(ni_req_ptr->NiSuplInd_valid == 1) + { + const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = + &ni_req_ptr->NiSuplInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + + // Client name + if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) + { + hexcode(notif.text, sizeof(notif.text), + (char *)supl_req->clientName.formattedString, + supl_req->clientName.formattedString_len); + LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, + notif.text); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", + __func__, __LINE__); + } + + // Requestor ID + if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char*)supl_req->requestorId.formattedString, + supl_req->requestorId.formattedString_len ); + + LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, + notif.requestor_id); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", + __func__, __LINE__); + } + + // Encoding type + if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) + { + notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); + + notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); + } + else + { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + } //ni_req_ptr->NiSuplInd_valid == 1 + + else + { + LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); + return; + } + + // Set default_response & notify_flags + convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); + + if( NULL != ni_req_copy_ptr) + { + memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); + + LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); + } + else + { + LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); + } + +} + +/* convert Ni Encoding type from QMI_LOC to loc eng format */ +GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case eQMI_LOC_NI_SUPL_UTF8_V02: + enc = GPS_ENC_SUPL_UTF8; + break; + case eQMI_LOC_NI_SUPL_UCS2_V02: + enc = GPS_ENC_SUPL_UCS2; + break; + case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + break; + default: + break; + } + + return enc; +} + +/*convert NI notify verify type from QMI LOC to loc eng format*/ +bool LocApiV02Adapter :: convertNiNotifyVerifyType ( + GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv) +{ + switch (notif_priv) + { + case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: + notif->notify_flags = 0; + break; + + case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_ACCEPT; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_DENY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return false; + } + + return true; +} + +/* event callback registered with the loc_api v02 interface */ +void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, + uint32_t eventId, locClientEventIndUnionType eventPayload) +{ + LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, + eventId); + + switch(eventId) + { + //Position Report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + reportPosition(eventPayload.pPositionReportEvent); + break; + + // Satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + reportSv(eventPayload.pGnssSvInfoReportEvent); + break; + + // Status report + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + reportEngineState(eventPayload.pEngineState); + break; + + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + reportFixSessionState(eventPayload.pFixSessionState); + break; + + // NMEA + case QMI_LOC_EVENT_NMEA_IND_V02: + reportNmea(eventPayload.pNmeaReportEvent); + break; + + // XTRA request + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + LOC_LOGD("%s:%d]: XTRA download request\n", __func__, + __LINE__); + requestXtraData(); + break; + + // time request + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + LOC_LOGD("%s:%d]: Time request\n", __func__, + __LINE__); + requestTime(); + break; + + //position request + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + LOC_LOGD("%s:%d]: Position request\n", __func__, + __LINE__); + //requestPosition(); + break; + + // NI request + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); + break; + + // AGPS connection request + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + reportAtlRequest(eventPayload.pLocationServerConnReqEvent); + break; + } +} + +/* Call the service LocApiAdapter down event*/ +void LocApiV02Adapter :: errorCb(locClientHandleType handle, + locClientErrorEnumType errorId) +{ + if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) + { + LOC_LOGE("%s:%d]: Service unavailable error\n", + __func__, __LINE__); + + LocApiAdapter::handleEngineDownEvent(); + + /* immediately send the engine up event so that + the loc engine re-initializes the adapter and the + loc-api_v02 interface */ + + LocApiAdapter::handleEngineUpEvent(); + } +} + +/* return a Loc API adapter */ +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return(new LocApiV02Adapter(locEng)); +} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h new file mode 100644 index 00000000..10ea4069 --- /dev/null +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -0,0 +1,173 @@ +/* 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_API_V_0_2_ADAPTER_H +#define LOC_API_V_0_2_ADAPTER_H + +#include +#include "loc_api_v02_client.h" +#include +#include + +/* This class derives from the LocApiAdapter class. + The members of this class are responsible for converting + the Loc API V02 data structures into Loc Engine data structures. + This class also implements some of the virtual functions that + handle the requests from loc engine. */ +class LocApiV02Adapter : public LocApiAdapter { + + /* loc api v02 handle*/ + locClientHandleType clientHandle; + + /* events the client is registered for */ + locClientEventMaskType eventMask; + + /* Convert event mask from loc eng to loc_api_v02 format */ + locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + + /* Convert error from loc_api_v02 to loc eng format*/ + enum loc_api_adapter_err convertErr(locClientStatusEnumType status); + + /* convert Ni Encoding type from QMI_LOC to loc eng format */ + GpsNiEncodingType convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); + + /*convert NI notify verify type from QMI LOC to loc eng format*/ + bool convertNiNotifyVerifyType (GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv); + + /* close Loc API V02 client */ + int deInitLocClient(); + + /* convert position report to loc eng format and send the converted + position to loc eng */ + void reportPosition + (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); + + /* convert satellite report to loc eng format and send the converted + report to loc eng */ + void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); + + /* convert engine state report to loc eng format and send the converted + report to loc eng */ + void reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); + + /* convert fix session report to loc eng format and send the converted + report to loc eng */ + void reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); + + /* convert NMEA report to loc eng format and send the converted + report to loc eng */ + void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); + + /* convert and report an ATL request to loc engine */ + void reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 + *server_request_ptr); + + /* convert and report NI request to loc eng */ + void reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); + +public: + LocApiV02Adapter(LocEng &locEng); + ~LocApiV02Adapter(); + + /* event callback registered with the loc_api v02 interface */ + void eventCb(locClientHandleType client_handle, + uint32_t loc_event_id, + locClientEventIndUnionType loc_event_payload); + + /* error callback, this function handles the service unavailable + error */ + void errorCb(locClientHandleType handle, + locClientErrorEnumType errorId); + + virtual enum loc_api_adapter_err reinit(); + + virtual enum loc_api_adapter_err startFix(); + + virtual enum loc_api_adapter_err stopFix(); + + virtual enum loc_api_adapter_err + setPositionMode(const LocPosMode *mode); + + 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); + + 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); +#ifdef FEATURE_IPV6 + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType); +#else + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsType agpsType); +#endif + virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); + + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage); + + 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 setExtPowerConfig(int isBatteryCharging); + virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); +}; + +#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c new file mode 100644 index 00000000..6a086667 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.c @@ -0,0 +1,547 @@ +/* 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 +#include "loc_api_v02_client.h" +#include "loc_api_sync_req.h" + +/* Logging */ +// Uncomment to log verbose logs +#define LOG_NDEBUG 1 + +// log debug logs +#define LOG_NDDEBUG 1 +#define LOG_TAG "LocSvc_api_v02" +#include "loc_util_log.h" + +#define LOC_SYNC_REQ_BUFFER_SIZE 8 +#define GPS_CONF_FILE "/etc/gps.conf" +pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool loc_sync_call_initialized = false; + +typedef struct { + pthread_mutex_t sync_req_lock; + + /* Client ID */ + locClientHandleType client_handle; + + /* waiting conditional variable */ + pthread_cond_t ind_arrived_cond; + + /* Callback waiting data block, protected by loc_cb_data_mutex */ + bool ind_is_selected; /* is cb selected? */ + bool ind_is_waiting; /* is waiting? */ + bool ind_has_arrived; /* callback has arrived */ + uint32_t req_id; /* sync request */ + void *recv_ind_payload_ptr; /* received payload */ + uint32_t recv_ind_id; /* received ind */ + +} loc_sync_req_data_s_type; + +typedef struct { + bool in_use; /* at least one sync call is active */ + bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; + loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; +} loc_sync_req_array_s_type; + +/*************************************************************************** + * DATA FOR ASYNCHRONOUS RPC PROCESSING + **************************************************************************/ +loc_sync_req_array_s_type loc_sync_array; + +/*=========================================================================== + +FUNCTION loc_sync_req_init + +DESCRIPTION + Initialize this module + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_req_init() +{ + LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE); + pthread_mutex_lock(&loc_sync_call_mutex); + if(true == loc_sync_call_initialized) + { + LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + loc_sync_array.in_use = false; + + memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); + + int i; + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + pthread_mutex_init(&slot->sync_req_lock, NULL); + pthread_cond_init(&slot->ind_arrived_cond, NULL); + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; /* req id */ + } + + loc_sync_call_initialized = true; + pthread_mutex_unlock(&loc_sync_call_mutex); +} + + +/*=========================================================================== + +FUNCTION loc_sync_process_ind + +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_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* ind id */ + void *ind_payload_ptr /* payload */ +) +{ + + LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n", + __func__,__LINE__, client_handle, ind_id); + + pthread_mutex_lock(&loc_sync_call_mutex); + + if (!loc_sync_array.in_use) + { + LOC_LOGD("%s:%d]: loc_sync_array not in use \n", + __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + bool in_use = false, consumed = false; + int i; + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + in_use |= loc_sync_array.slot_in_use[i]; + + pthread_mutex_lock(&slot->sync_req_lock); + + if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) + && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) + { + // copy the payload to the slot waiting for this ind + size_t payload_size = 0; + + LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", + __func__, __LINE__, i, ind_id); + + if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && + NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) + { + LOC_LOGV("%s:%d]: copying ind payload size = %u \n", + __func__, __LINE__, payload_size); + + memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); + + consumed = true; + + } + /* Received a callback while waiting, wake up thread to check it */ + if (slot->ind_is_waiting) + { + slot->recv_ind_id = ind_id; + + pthread_cond_signal(&slot->ind_arrived_cond); + } + else + { + /* If callback arrives before wait, remember it */ + LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", + __func__, __LINE__, ind_id); + + slot->ind_has_arrived = true; + } + } + pthread_mutex_unlock(&slot->sync_req_lock); + } + + if (!in_use) { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_alloc_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_alloc_slot() +{ + int i, select_id = -1; /* no free buffer */ + + pthread_mutex_lock(&loc_sync_call_mutex); + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (!loc_sync_array.slot_in_use[i]) + { + select_id = i; + loc_sync_array.slot_in_use[i] = 1; + loc_sync_array.in_use = true; + break; + } + } + + pthread_mutex_unlock(&loc_sync_call_mutex); + LOC_LOGV("%s:%d]: returning slot %d\n", + __func__, __LINE__, select_id); + return select_id; +} + +/*=========================================================================== + +FUNCTION loc_free_slot + +DESCRIPTION + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_free_slot(int select_id) +{ + int i; + loc_sync_req_data_s_type *slot; + + pthread_mutex_lock(&loc_sync_call_mutex); + + LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); + + loc_sync_array.slot_in_use[select_id] = 0; + + slot = &loc_sync_array.slots[select_id]; + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; + + // check if all slots are now free + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (loc_sync_array.slot_in_use[i]) break; + } + + if (i >= LOC_SYNC_REQ_BUFFER_SIZE) + { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_sync_select_ind + +DESCRIPTION + Selects which indication to wait for. + + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -ENOMEM : out of buffer + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_select_ind( + locClientHandleType client_handle, /* Client handle */ + uint32_t ind_id, /* ind Id wait for */ + uint32_t req_id, /* req id */ + void * ind_payload_ptr /* ptr where payload should be copied to*/ +) +{ + int select_id = loc_alloc_slot(); + + LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n", + __func__, __LINE__, client_handle, ind_id, req_id); + + if (select_id < 0) + { + LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", + __func__, __LINE__, loc_get_v02_event_name(req_id)); + return -ENOMEM; + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + pthread_mutex_lock(&slot->sync_req_lock); + + slot->client_handle = client_handle; + slot->ind_is_selected = true; + slot->ind_is_waiting = false; + slot->ind_has_arrived = false; + + slot->recv_ind_id = ind_id; + slot->req_id = req_id; + slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr + + pthread_mutex_unlock(&slot->sync_req_lock); + + return select_id; +} + + +/*=========================================================================== + +FUNCTION loc_sync_wait_for_ind + +DESCRIPTION + Waits for a selected indication. The wait expires in timeout_seconds seconds. + If the function is called before an existing wait has finished, it will + immediately return error. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 on SUCCESS, -ve value on failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_wait_for_ind( + int select_id, /* ID from loc_sync_select_ind() */ + int timeout_seconds, /* Timeout in this number of seconds */ + uint32_t ind_id +) +{ + if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) + { + LOC_LOGE("%s:%d]: invalid select_id: %d \n", + __func__, __LINE__, select_id); + + return (-EINVAL); + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + int ret_val = 0; /* the return value of this function: 0 = no error */ + int rc; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + pthread_mutex_lock(&slot->sync_req_lock); + + do + { + if (slot->ind_has_arrived) + { + ret_val = 0; /* success */ + break; + } + + if (slot->ind_is_waiting) + { + LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, + __LINE__, select_id); + ret_val = -EBUSY; // busy + break; + } + + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_sec += timeout_seconds; + + /* Take new wait request */ + slot->ind_is_waiting = true; + + /* Waiting */ + rc = pthread_cond_timedwait(&slot->ind_arrived_cond, + &slot->sync_req_lock, &expire_time); + + slot->ind_is_waiting = false; + + if(rc == ETIMEDOUT) + { + LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", + __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); + ret_val = -ETIMEDOUT; //time out + } + + } while (0); + + pthread_mutex_unlock(&slot->sync_req_lock); + loc_free_slot(select_id); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_sync_send_req + +DESCRIPTION + Synchronous req call (thread safe) + +DEPENDENCIES + N/A + +RETURN VALUE + Loc API 2.0 status + +SIDE EFFECTS + N/A + +===========================================================================*/ +locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; + int select_id; + int rc = 0; + + // Select the callback we are waiting for + select_id = loc_sync_select_ind(client_handle, ind_id, req_id, + ind_payload_ptr); + + if (select_id >= 0) + { + status = locClientSendReq (client_handle, req_id, req_payload); + LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", + __func__, __LINE__, select_id, status); + + if (status != eLOC_CLIENT_SUCCESS ) + { + loc_free_slot(select_id); + } + else + { + // Wait for the indication callback + if (( rc = loc_sync_wait_for_ind( select_id, + timeout_msec / 1000, + ind_id) ) < 0) + { + if ( rc == -ETIMEDOUT) + status = eLOC_CLIENT_FAILURE_TIMEOUT; + else + status = eLOC_CLIENT_FAILURE_INTERNAL; + + // Callback waiting failed + LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " + "select id %d, status %s", __func__, __LINE__, rc , + select_id, loc_get_v02_client_status_name(status)); + } + else + { + status = eLOC_CLIENT_SUCCESS; + LOC_LOGV("%s:%d]: success (select id %d)\n", + __func__, __LINE__, select_id); + } + } + } /* select id */ + + return status; +} + + diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h new file mode 100644 index 00000000..4bd2b462 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_sync_req.h @@ -0,0 +1,68 @@ +/* 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_SYNC_REQ_H +#define LOC_SYNC_REQ_H + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include +#include "loc_api_v02_client.h" + +#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second + +/* Init function */ +extern void loc_sync_req_init(); + + +/* Process Loc API indications to wake up blocked user threads */ +extern void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* respInd id */ + void *ind_payload_ptr /* payload */ +); + +/* Thread safe synchronous request, using Loc API status return code */ +extern locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c new file mode 100644 index 00000000..882c5276 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -0,0 +1,2210 @@ +/* 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 "qmi_client.h" +#include "qmi_idl_lib.h" +#include "qmi_cci_target_ext.h" + +#if defined( _ANDROID_) +#include "qmi_cci_target.h" +#include "qmi_cci_common.h" +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" +#endif //_ANDROID_ + + +#include "loc_api_v02_client.h" +#include "loc_util_log.h" + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (5000) + +#else + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (1000) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +//timeout in ms that the service waits for qmi-fw notification +#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) +// total timeout for the service to come up +#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) + +/* Table to relate eventId, size and mask value used to enable the event*/ +typedef struct +{ + uint32_t eventId; + size_t eventSize; + locClientEventMaskType eventMask; +}locClientEventIndTableStructT; + + +static locClientEventIndTableStructT locClientEventIndTable[]= { + + // position report ind + { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, + + // satellite report ind + { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, + sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), + QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, + + // NMEA report ind + { QMI_LOC_EVENT_NMEA_IND_V02, + sizeof(qmiLocEventNmeaIndMsgT_v02), + QMI_LOC_EVENT_MASK_NMEA_V02 }, + + //NI event ind + { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, + sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, + + //Time Injection Request Ind + { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, + sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, + + //Predicted Orbits Injection Request + { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, + sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, + + //Position Injection Request Ind + { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, + sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , + + //Engine State Report Ind + { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, + sizeof(qmiLocEventEngineStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, + + //Fix Session State Report Ind + { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, + sizeof(qmiLocEventFixSessionStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, + + //Wifi Request Indication + { QMI_LOC_EVENT_WIFI_REQ_IND_V02, + sizeof(qmiLocEventWifiReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, + + //Sensor Streaming Ready Status Ind + { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, + sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, + + // Time Sync Request Indication + { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, + sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, + + //Set Spi Streaming Report Event + { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, + sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, + + //Location Server Connection Request event + { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, + sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 }, + + // NI Geofence Event + { QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, + sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02}, + + // Geofence General Alert Event + { QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, + sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02}, + + //Geofence Breach event + { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02}, + + //Pedometer Control event + { QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, + sizeof(qmiLocEventPedometerControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 }, + + //Motion Data Control event + { QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, + sizeof(qmiLocEventMotionDataControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 } +}; + +/* table to relate the respInd Id with its size */ +typedef struct +{ + uint32_t respIndId; + size_t respIndSize; +}locClientRespIndTableStructT; + +static locClientRespIndTableStructT locClientRespIndTable[]= { + + // get service revision ind + { QMI_LOC_GET_SERVICE_REVISION_IND_V02, + sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, + + // Get Fix Criteria Resp Ind + { QMI_LOC_GET_FIX_CRITERIA_IND_V02, + sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, + + // NI User Resp In + { QMI_LOC_NI_USER_RESPONSE_IND_V02, + sizeof(qmiLocNiUserRespIndMsgT_v02)}, + + //Inject Predicted Orbits Data Resp Ind + { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, + + //Get Predicted Orbits Data Src Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, + + // Get Predicted Orbits Data Validity Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, + + // Inject UTC Time Resp Ind + { QMI_LOC_INJECT_UTC_TIME_IND_V02, + sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, + + //Inject Position Resp Ind + { QMI_LOC_INJECT_POSITION_IND_V02, + sizeof(qmiLocInjectPositionIndMsgT_v02)}, + + //Set Engine Lock Resp Ind + { QMI_LOC_SET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocSetEngineLockIndMsgT_v02)}, + + //Get Engine Lock Resp Ind + { QMI_LOC_GET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocGetEngineLockIndMsgT_v02)}, + + //Set SBAS Config Resp Ind + { QMI_LOC_SET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, + + //Get SBAS Config Resp Ind + { QMI_LOC_GET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, + + //Set NMEA Types Resp Ind + { QMI_LOC_SET_NMEA_TYPES_IND_V02, + sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, + + //Get NMEA Types Resp Ind + { QMI_LOC_GET_NMEA_TYPES_IND_V02, + sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, + + //Set Low Power Mode Resp Ind + { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, + + //Get Low Power Mode Resp Ind + { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, + + //Set Server Resp Ind + { QMI_LOC_SET_SERVER_IND_V02, + sizeof(qmiLocSetServerIndMsgT_v02)}, + + //Get Server Resp Ind + { QMI_LOC_GET_SERVER_IND_V02, + sizeof(qmiLocGetServerIndMsgT_v02)}, + + //Delete Assist Data Resp Ind + { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + + //Set XTRA-T Session Control Resp Ind + { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, + + //Get XTRA-T Session Control Resp Ind + { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, + + //Inject Wifi Position Resp Ind + { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, + sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, + + //Notify Wifi Status Resp Ind + { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, + + //Get Registered Events Resp Ind + { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, + sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, + + //Set Operation Mode Resp Ind + { QMI_LOC_SET_OPERATION_MODE_IND_V02, + sizeof(qmiLocSetOperationModeIndMsgT_v02)}, + + //Get Operation Mode Resp Ind + { QMI_LOC_GET_OPERATION_MODE_IND_V02, + sizeof(qmiLocGetOperationModeIndMsgT_v02)}, + + //Set SPI Status Resp Ind + { QMI_LOC_SET_SPI_STATUS_IND_V02, + sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, + + //Inject Sensor Data Resp Ind + { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, + + //Inject Time Sync Data Resp Ind + { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, + sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, + + //Set Cradle Mount config Resp Ind + { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, + + //Get Cradle Mount config Resp Ind + { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, + + //Set External Power config Resp Ind + { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, + + //Get External Power config Resp Ind + { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, + + //Location server connection status + { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, + + //Set Protocol Config Parameters + { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, + + //Get Protocol Config Parameters + { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, + + //Set Sensor Control Config + { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, + + //Get Sensor Control Config + { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, + + //Set Sensor Properties + { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, + + //Get Sensor Properties + { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, + + //Set Sensor Performance Control Config + { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, + + //Get Sensor Performance Control Config + { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, + //Inject SUPL certificate + { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, + + //Delete SUPL certificate + { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, + + // Set Position Engine Config + { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, + + // Get Position Engine Config + { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)}, + + //Add a Circular Geofence + { QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, + sizeof(qmiLocAddCircularGeofenceIndMsgT_v02)}, + + //Delete a Geofence + { QMI_LOC_DELETE_GEOFENCE_IND_V02, + sizeof(qmiLocDeleteGeofenceIndMsgT_v02)} , + + //Query a Geofence + { QMI_LOC_QUERY_GEOFENCE_IND_V02, + sizeof(qmiLocQueryGeofenceIndMsgT_v02)}, + + //Edit a Geofence + { QMI_LOC_EDIT_GEOFENCE_IND_V02, + sizeof(qmiLocEditGeofenceIndMsgT_v02)}, + + //Get best available position + { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, + sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, + + //Inject motion data + { QMI_LOC_INJECT_MOTION_DATA_IND_V02, + sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, + + //Get NI Geofence list + { QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, + sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02)}, + + //Inject GSM Cell Info + { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, + sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02)}, + + //Inject Network Initiated Message + { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, + sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, + + //WWAN Out of Service Notification + { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, + sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)}, + + //Pedomete Report + { QMI_LOC_PEDOMETER_REPORT_IND_V02, + sizeof(qmiLocPedometerReportIndMsgT_v02)}, + + { QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, + sizeof(qmiLocInjectSubscriberIDIndMsgT_v02)} +}; + + +/** whether indication is an event or a response */ +typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; + + +/** @struct locClientInternalState + */ + +typedef struct locClientCbDataStructT locClientCallbackDataType; + +struct locClientCbDataStructT +{ + // client cookie + void *pClientCookie; + //QCCI handle for this control point + qmi_client_type userHandle; + + // callbacks registered by the clients + locClientEventIndCbType eventCallback; + locClientRespIndCbType respCallback; + locClientErrorCbType errorCallback; + + // the event mask the client has registered for + locClientEventMaskType eventRegMask; + + //pointer to itself for checking consistency data + locClientCallbackDataType *pMe; +}; + + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** locClientGetSizeAndTypeByIndId + * @brief this function gets the size and the type (event, + * response)of the indication structure from its ID + * @param [in] indId ID of the indication + * @param [out] type event or response indication + * @param [out] size size of the indications + * + * @return true if the ID was found, false otherwise */ + +static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, + locClientIndEnumT *pIndType) +{ + // look in the event table + if(true == locClientGetSizeByEventIndId(indId, pIndSize)) + { + *pIndType = eventIndType; + + LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + //else look in response table + if(true == locClientGetSizeByRespIndId(indId, pIndSize)) + { + *pIndType = respIndType; + + LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + // Id not found + LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); + return false; +} + +/** isClientRegisteredForEvent +* @brief checks the mask to identify if the client has +* registered for the specified event Id +* @param [in] eventIndId +* @param [in] eventRegMask +* @return true if client regstered for event; else false */ + +static bool isClientRegisteredForEvent( + locClientEventMaskType eventRegMask, + uint32_t eventIndId) +{ + size_t idx = 0, eventIndTableSize = 0; + + // look in the event table + eventIndTableSize = + (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); + + for(idx=0; idx>32), + (uint32_t)(eventRegMask & 0xFFFFFFFF), + (uint32_t)(locClientEventIndTable[idx].eventMask >> 32), + (uint32_t)(locClientEventIndTable[idx].eventMask & 0xFFFFFFFF)); + + return(( + eventRegMask & locClientEventIndTable[idx].eventMask)? + true:false); + } + } + LOC_LOGW("%s:%d]: eventId %d not found\n", __func__, __LINE__, + eventIndId); + return false; +} + +/** convertQmiResponseToLocStatus + @brief converts a qmiLocGenRespMsgT to locClientStatusEnumType* + @param [in] pResponse; pointer to the response received from + QMI_LOC service. + @return locClientStatusEnumType corresponding to the + response. +*/ + +static locClientStatusEnumType convertQmiResponseToLocStatus( + qmiLocGenRespMsgT_v02 *pResponse) +{ + locClientStatusEnumType status = eLOC_CLIENT_FAILURE_INTERNAL; + + // if result == SUCCESS don't look at error code + if(pResponse->resp.result == QMI_RESULT_SUCCESS_V01 ) + { + status = eLOC_CLIENT_SUCCESS; + } + else + { + switch(pResponse->resp.error) + { + case QMI_ERR_MALFORMED_MSG_V01: + case QMI_ERR_INVALID_ARG_V01: + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + + case QMI_ERR_DEVICE_IN_USE_V01: + status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; + break; + + default: + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + } + LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", + __func__, __LINE__, pResponse->resp.result, + pResponse->resp.error, status); + return status; +} + +/** convertQmiErrorToLocError + @brief converts a qmi service error type to + locClientErrorEnumType + @param [in] error received QMI service. + @return locClientErrorEnumType corresponding to the error. +*/ + +static locClientErrorEnumType convertQmiErrorToLocError( + qmi_client_error_type error) +{ + locClientErrorEnumType locError ; + switch(error) + { + case QMI_SERVICE_ERR: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + + default: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + } + LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", + __func__, __LINE__, error, locError); + return locError; +} + +/** locClienHandlePosReportInd + * @brief Validates a position report ind + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if pos report is valid, false otherwise +*/ +static bool locClientHandlePosReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate position report + qmiLocEventPositionReportIndMsgT_v02 *posReport = + (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", + __func__, __LINE__, ind_buf_len, + posReport->latitude, posReport->longitude, + posReport->altitudeWrtEllipsoid); + + return true; +} +//----------------------------------------------------------------------------- + +/** locClientHandleSatReportInd + * @brief Validates a satellite report indication. Dk + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if sat report is valid, false otherwise +*/ +static bool locClientHandleSatReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate sat reports + unsigned int idx = 0; + qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = + (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" + " validity = %d \n ", __func__, __LINE__, + ind_buf_len, satReport->altitudeAssumed, + satReport->svList_len, satReport->svList_valid); + //Log SV report + for( idx = 0; idx svList_len; idx++ ) + { + LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " + "status = %d \n", __func__, __LINE__, + satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, + satReport->svList[idx].system, satReport->svList[idx].svStatus); + } + + return true; +} + + +/** locClientHandleNmeaReportInd + * @brief Validate a NMEA report indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if nmea report is valid, false otherwise +*/ + + +static bool locClientHandleNmeaReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate NMEA report + return true; +} + +/** locClientHandleGetServiceRevisionRespInd + * @brief Handles a Get Service Revision Rresponse indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if service revision is valid, false otherwise +*/ + +static bool locClientHandleGetServiceRevisionRespInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + LOC_LOGV("%s:%d] :\n", __func__, __LINE__); + return true; +} + +/** locClientHandleIndication + * @brief looks at each indication and calls the appropriate + * validation handler + * @param [in] indId + * @param [in] indBuffer + * @param [in] indSize + * @return true if indication was validated; else false */ + +static bool locClientHandleIndication( + uint32_t indId, + void* indBuffer, + size_t indSize + ) +{ + bool status = false; + switch(indId) + { + // handle the event indications + //------------------------------------------------------------------------- + + // handle position report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + { + status = locClientHandlePosReportInd(indId, indBuffer, indSize); + break; + } + // handle satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + { + status = locClientHandleSatReportInd(indId, indBuffer, indSize); + break; + } + + // handle NMEA report + case QMI_LOC_EVENT_NMEA_IND_V02: + { + status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); + break; + } + + // handle NI Notify Verify Request Ind + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + { + // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Time Inject request Ind + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + { + // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle XTRA data Inject request Ind + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + { + // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle position inject request Ind + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + { + // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle engine state Ind + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + { + // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle fix session state Ind + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + { + // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Wifi request Ind + case QMI_LOC_EVENT_WIFI_REQ_IND_V02: + { + // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle sensor streaming ready status Ind + case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: + { + // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle time sync Ind + case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: + { + // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle set streaming report ind + case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: + { + // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + { + //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: + { + //locClientHandleNiGeofenceNotificationInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: + { + //locClientHandleGeofenceGenAlertInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: + { + //locClientHandleGeofenceBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : + { + //locClientHandlePedometerControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: + { + //locClientHandleMotionDataControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + //------------------------------------------------------------------------- + + // handle the response indications + //------------------------------------------------------------------------- + + // Get service Revision response indication + case QMI_LOC_GET_SERVICE_REVISION_IND_V02: + { + status = locClientHandleGetServiceRevisionRespInd(indId, + indBuffer, indSize); + break; + } + + case QMI_LOC_GET_FIX_CRITERIA_IND_V02: + { + status = true; + break; + } + + // predicted orbits data response indication + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: + { + //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // get predicted orbits source response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: + { + //locClientHandleGetPredictedOrbitsSourceInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // get predicted orbits validity response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: + { + //locClientHandleGetPredictedOrbitsDataValidityInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : + { + //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: + { + //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: + { + //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: + { + //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: + { + //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: + { + // locClientHandleAddCircularGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_DELETE_GEOFENCE_IND_V02: + { + // locClientHandleDeleteGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EDIT_GEOFENCE_IND_V02: + { + // locClientHandleEditGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_QUERY_GEOFENCE_IND_V02: + { + // locClientHandleQueryGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: + { + status = true; + break; + } + case QMI_LOC_GET_ENGINE_LOCK_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_PEDOMETER_REPORT_IND_V02: + { + status = true; + break; + } + + // for indications that only have a "status" field + case QMI_LOC_NI_USER_RESPONSE_IND_V02: + case QMI_LOC_INJECT_UTC_TIME_IND_V02: + case QMI_LOC_INJECT_POSITION_IND_V02: + case QMI_LOC_SET_ENGINE_LOCK_IND_V02: + case QMI_LOC_SET_SBAS_CONFIG_IND_V02: + case QMI_LOC_SET_NMEA_TYPES_IND_V02: + case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: + case QMI_LOC_SET_SERVER_IND_V02: + case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: + case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: + case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: + case QMI_LOC_SET_OPERATION_MODE_IND_V02: + case QMI_LOC_SET_SPI_STATUS_IND_V02: + case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: + case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: + case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: + case QMI_LOC_INJECT_MOTION_DATA_IND_V02: + case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: + case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: + case QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02: + case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: + { + status = true; + break; + } + default: + LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, + (uint32_t)indId); + status = false; + break; + } + return status; +} + + +/** locClientErrorCb + * @brief handles the QCCI error events, this is called by the + * QCCI infrastructure when the service is no longer + * available. + * @param [in] user handle + * @param [in] error + * @param [in] *err_cb_data + */ + +static void locClientErrorCb +( + qmi_client_type user_handle, + qmi_client_error_type error, + void *err_cb_data +) +{ + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)err_cb_data; + locClientErrorCbType localErrorCallback = NULL; + + /* copy the errorCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and error callback. + */ + if(NULL != pCallbackData) + { + localErrorCallback = pCallbackData->errorCallback; + } + + LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", + __func__, __LINE__, error, err_cb_data); + + /* call the error callback + * To avoid calling the errorCallback after locClientClose + * is called, check pCallbackData->errorCallback again here + */ + + if( (NULL != pCallbackData) && + (NULL != localErrorCallback) && + (NULL != pCallbackData->errorCallback) && + (pCallbackData == pCallbackData->pMe) ) + { + //invoke the error callback for the corresponding client + localErrorCallback( + (locClientHandleType)pCallbackData, + convertQmiErrorToLocError(error), + pCallbackData->pClientCookie); + } +} + + +/** locClientIndCb + * @brief handles the indications sent from the service, if a + * response indication was received then the it is sent + * to the response callback. If a event indication was + * received then it is sent to the event callback + * @param [in] user handle + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @param [in] ind_cb_data */ + +static void locClientIndCb +( + qmi_client_type user_handle, + unsigned int msg_id, + void *ind_buf, + unsigned int ind_buf_len, + void *ind_cb_data +) +{ + locClientIndEnumT indType; + size_t indSize = 0; + qmi_client_error_type rc ; + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)ind_cb_data; + + LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", + __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, + pCallbackData); + + // check callback data + if(NULL == pCallbackData ||(pCallbackData != pCallbackData->pMe)) + { + LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); + return; + } + + // check user handle + if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) + { + LOC_LOGE("%s:%d]: invalid user_handle got %p expected %p\n", + __func__, __LINE__, + user_handle, pCallbackData->userHandle); + return; + } + // Get the indication size and type ( eventInd or respInd) + if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) + { + void *indBuffer = NULL; + + // if the client did not register for this event then just drop it + if( (eventIndType == indType) && + ( (NULL == pCallbackData->eventCallback) || + (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) + { + LOC_LOGW("%s:%d]: client is not registered for event %d\n", + __func__, __LINE__, (uint32_t)msg_id); + return; + } + + // decode the indication + indBuffer = malloc(indSize); + + if(NULL == indBuffer) + { + LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); + return; + } + + // decode the indication + rc = qmi_client_message_decode( + user_handle, + QMI_IDL_INDICATION, + msg_id, + ind_buf, + ind_buf_len, + indBuffer, + indSize); + + if( rc == QMI_NO_ERR ) + { + //validate indication + if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + { + if(eventIndType == indType) + { + locClientEventIndUnionType eventIndUnion; + + /* copy the eventCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientEventIndCbType localEventCallback = + pCallbackData->eventCallback; + + // dummy event + eventIndUnion.pPositionReportEvent = + (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; + + /* call the event callback + * To avoid calling the eventCallback after locClientClose + * is called, check pCallbackData->eventCallback again here + */ + if((NULL != localEventCallback) && + (NULL != pCallbackData->eventCallback)) + { + localEventCallback( + (locClientHandleType)pCallbackData, + msg_id, + eventIndUnion, + pCallbackData->pClientCookie); + } + } + else if(respIndType == indType) + { + locClientRespIndUnionType respIndUnion; + + /* copy the respCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientRespIndCbType localRespCallback = + pCallbackData->respCallback; + + // dummy to suppress compiler warnings + respIndUnion.pDeleteAssistDataInd = + (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; + + /* call the response callback + * To avoid calling the respCallback after locClientClose + * is called, check pCallbackData->respCallback again here + */ + if((NULL != localRespCallback) && + (NULL != pCallbackData->respCallback)) + { + localRespCallback( + (locClientHandleType)pCallbackData, + msg_id, + respIndUnion, + pCallbackData->pClientCookie); + } + } + } + else // error handling indication + { + LOC_LOGE("%s:%d]: Error handling the indication %d\n", + __func__, __LINE__, (uint32_t)msg_id); + } + } + else + { + LOC_LOGE("%s:%d]: Error decoding indication %d\n", + __func__, __LINE__, rc); + } + if(indBuffer) + { + free (indBuffer); + } + } + else // Id not found + { + LOC_LOGE("%s:%d]: Error indication not found %d\n", + __func__, __LINE__,(uint32_t)msg_id); + } + return; +} + + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +static bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientReqUnionType reqUnion; + qmiLocRegEventsReqMsgT_v02 regEventsReq; + + memset(®EventsReq, 0, sizeof(regEventsReq)); + + regEventsReq.eventRegMask = eventRegMask; + reqUnion.pRegEventsReq = ®EventsReq; + + status = locClientSendReq(clientHandle, + QMI_LOC_REG_EVENTS_REQ_V02, + reqUnion); + + if(eLOC_CLIENT_SUCCESS != status ) + { + LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status) ); + return false; + } + + return true; +} + +/** validateRequest + @brief validates the input request + @param [in] reqId request ID + @param [in] reqPayload Union of pointers to message payload + @param [out] ppOutData Pointer to void *data if successful + @param [out] pOutLen Pointer to length of data if succesful. + @return false on failure, true on Success +*/ + +static bool validateRequest( + uint32_t reqId, + const locClientReqUnionType reqPayload, + void **ppOutData, + uint32_t *pOutLen ) + +{ + bool noPayloadFlag = false; + + LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); + switch(reqId) + { + case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); + break; + } + + case QMI_LOC_REG_EVENTS_REQ_V02: + { + *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); + break; + } + + case QMI_LOC_START_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopReqMsgT_v02); + break; + } + + case QMI_LOC_NI_USER_RESPONSE_REQ_V02: + { + *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_UTC_TIME_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); + break; + } + + case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_NMEA_TYPES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SERVER_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); + break; + } + + case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_OPERATION_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SPI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocAddCircularGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_QUERY_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocQueryGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_EDIT_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocEditGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); + break; + } + + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02); + break; + } + + case QMI_LOC_PEDOMETER_REPORT_REQ_V02: + { + *pOutLen = sizeof(qmiLocPedometerReportReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: + { + *pOutLen = sizeof(qmiLocInjectSubscriberIDReqMsgT_v02); + break; + } + + // ALL requests with no payload + case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: + case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: + case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: + case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: + case QMI_LOC_GET_NMEA_TYPES_REQ_V02: + case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: + case QMI_LOC_GET_SERVER_REQ_V02: + case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: + case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: + case QMI_LOC_GET_OPERATION_MODE_REQ_V02: + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: + { + noPayloadFlag = true; + break; + } + + default: + LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, + reqId); + return false; + } + if(true == noPayloadFlag) + { + *ppOutData = NULL; + *pOutLen = 0; + } + else + { + //set dummy pointer for request union + *ppOutData = (void*) reqPayload.pInformClientRevisionReq; + } + LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, + reqId, *pOutLen); + return true; +} + +/** locClientQmiCtrlPointInit + @brief wait for the service to come up or timeout; when the + service comes up initialize the control point and set + internal handle and indication callback. + @param pQmiClient, +*/ + +static locClientStatusEnumType locClientQmiCtrlPointInit( + locClientCallbackDataType *pLocClientCbData) +{ + qmi_client_type clnt, notifier; + bool notifierInitFlag = false; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + // instances of this service + qmi_service_info *pServiceInfo = NULL; + + do + { + uint32_t num_services = 0, num_entries = 0; + qmi_client_error_type rc = QMI_NO_ERR; + bool nosignal = false; + qmi_client_os_params os_params; + int timeout = 0; + + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); + + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); + + if (rc != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + // get the service addressing information + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + /* If service is not up wait on a signal until the service is up + * or a timeout occurs. */ + if (rc != QMI_NO_ERR) { + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); + nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + if (!nosignal) + rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, + &num_services); + } + + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " + "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); + + if (0 == num_services || rc != QMI_NO_ERR) { + if (!nosignal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up !!! Error %d \n", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + } else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," + " final Err %d", __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_TIMEOUT; + } + break; + } + + pServiceInfo = + (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + + if(NULL == pServiceInfo) + { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + //set the number of entries to get equal to the total number of + //services. + num_entries = num_services; + //populate the serviceInfo + rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, + &num_entries, &num_services); + + + LOC_LOGV("%s:%d]: qmi_client_get_service_list()" + " returned %d num_entries = %d num_services = %d\n", + __func__, __LINE__, + rc, num_entries, num_services); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); + + // initialize the client + //sent the address of the first service found + // if IPC router is present, this will go to the service instance + // enumerated over IPC router, else it will go over the next transport where + // the service was enumerated. + rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + status = eLOC_CLIENT_SUCCESS; + + } while(0); + + /* release the notifier handle */ + if(true == notifierInitFlag) + { + qmi_client_release(notifier); + } + + if(NULL != pServiceInfo) + { + free((void *)pServiceInfo); + } + + return status; +} +//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- + +/** locClientOpen + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ + +locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientCallbackDataType *pCallbackData = NULL; + + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + return eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + } + + do + { + // Allocate memory for the callback data + pCallbackData = + ( locClientCallbackDataType*)calloc( + 1, sizeof(locClientCallbackDataType)); + + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize the QMI control point; this function will block + * until a service is up or a timeout occurs. If the connection to + * the service succeeds the callback data will be filled in with + * a qmi_client value. + */ + + + EXIT_LOG_CALLFLOW(%s, "loc client open"); + status = locClientQmiCtrlPointInit(pCallbackData); + + LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + + if(status != eLOC_CLIENT_SUCCESS) + { + free(pCallbackData); + pCallbackData = NULL; + LOC_LOGE ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + break; + } + // set the self pointer + pCallbackData->pMe = pCallbackData; + // set the handle to the callback data + *pLocClientHandle = (locClientHandleType)pCallbackData; + + if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) + { + LOC_LOGE("%s:%d]: Error sending registration mask\n", + __func__, __LINE__); + + // release the client + locClientClose(pLocClientHandle); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize rest of the client structure now that the connection + * to the service has been created successfully. + */ + + //fill in the event callback + pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; + + //fill in the response callback + pCallbackData->respCallback = pLocClientCallbacks->respIndCb; + + //fill in the error callback + pCallbackData->errorCallback = pLocClientCallbacks->errorCb; + + //set the client event registration mask + pCallbackData->eventRegMask = eventRegMask; + + // set the client cookie + pCallbackData->pClientCookie = (void *)pClientCookie; + + }while(0); + + if(eLOC_CLIENT_SUCCESS != status) + { + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); + } + + else + { + LOC_LOGD("%s:%d]: returning handle = %p, user_handle=%p, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + } + + return(status); +} + +/** locClientClose + @brief Disconnects a client from the location engine. + @param [in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) - On success. + - non-zero error code(see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientClose( + locClientHandleType* pLocClientHandle) +{ + // convert handle to callback data + locClientCallbackDataType *pCallbackData; + qmi_client_error_type rc = QMI_NO_ERR; //No error + + if(NULL == pLocClientHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid pointer to handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + pCallbackData = (locClientCallbackDataType *)(*pLocClientHandle); + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + LOC_LOGV("locClientClose releasing handle %p, user handle %p\n", + *pLocClientHandle, pCallbackData->userHandle ); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, "loc client close"); + + // release the handle + rc = qmi_client_release(pCallbackData->userHandle); + if(QMI_NO_ERR != rc ) + { + LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", + __func__, __LINE__, rc, pCallbackData->userHandle); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* clear the memory allocated to callback data to minimize the chances + * of a race condition occurring between close and the indication + * callback + */ + memset(pCallbackData, 0, sizeof(*pCallbackData)); + + // free the memory assigned in locClientOpen + free(pCallbackData); + pCallbackData= NULL; + + // set the handle to invalid value + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + return eLOC_CLIENT_SUCCESS; +} + +/** locClientSendReq + @brief Sends a message to the location engine. If the locClientSendMsg() + function is successful, the client should expect an indication + (except start, stop, event reg and sensor injection messages), + through the registered callback in the locOpen() function. The + indication will contain the status of the request and if status is a + success, indication also contains the payload + associated with response. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] reqId message ID of the request + @param [in] reqPayload Payload of the request, can be NULL + if request has no payload + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS ) - On success. + - non-zero error code (see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload ) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGenRespMsgT_v02 resp; + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) + { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + // validate that the request is correct + if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) + { + + LOC_LOGE("%s:%d] error invalid request\n", __func__, + __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, + __LINE__, reqId, reqLen); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + reqId, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + // if the request is to change registered events, update the + // loc api copy of that + if(eLOC_CLIENT_SUCCESS == status && + QMI_LOC_REG_EVENTS_REQ_V02 == reqId) + { + if(NULL != reqPayload.pRegEventsReq ) + { + pCallbackData->eventRegMask = + (locClientEventMaskType)(reqPayload.pRegEventsReq->eventRegMask); + } + } + return(status); +} + +/** locClientGetSizeByRespIndId + * @brief Get the size of the response indication structure, + * from a specified id + * @param [in] respIndId + * @param [out] pRespIndSize + * @return true if resp ID was found; else false +*/ + +bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) +{ + size_t idx = 0, respIndTableSize = 0; + respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); + for(idx=0; idx +#include + +#include "location_service_v02.h" //QMI LOC Service data types definitions + +#include + +/****************************************************************************** + * Constants and configuration + *****************************************************************************/ + +/** @ingroup constants_macros + Specific value of #locClientHandleType, indicating an invalid handle. */ +#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) + + +/** @addtogroup data_types +@{ */ + +/** Location client handle used to represent a specific client. Negative values + are invalid handles. +*/ +typedef void* locClientHandleType; + +/** Data type for events and event masks. */ +typedef uint64_t locClientEventMaskType; + +/** Location client status values. +*/ +typedef enum +{ + eLOC_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + eLOC_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + eLOC_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + eLOC_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12, + /**< Failed because the service has not been initialized. */ + + eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 + /**< Failed because there is not enough memory to do the operation. */ + +}locClientStatusEnumType; + +/** Location client error values +*/ +typedef enum +{ + eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 + /**< Service is no longer available. Upon getting this error, the client + must close the existing connection and reopen the connection. */ + +}locClientErrorEnumType; + + +/** Request messages the client can send to the location engine. + + The following requests do not have any data associated, so they do not have a + payload structure defined: + + - GetServiceRevision + - GetFixCriteria + - GetPredictedOrbitsDataSource + - GetPredictedOrbitsDataValidity + - GetEngineLock + - GetSbasConfigReq + - GetRegisteredEvents + - GetNmeaTypes + - GetLowPowerMode + - GetXtraTSessionControl + - GetRegisteredEvents + - GetOperationMode + - GetCradleMountConfig + - GetExternalPowerConfig + - GetSensorControlConfig + - GetSensorPerformanceControlConfiguration + - WWANOutOfServiceNotification +*/ +typedef union +{ + const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; + /**< Notifies the service about the revision the client is using. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ + + const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; + /**< Changes the events the client is interested in receiving. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_REG_EVENTS_REQ_V02. */ + + const qmiLocStartReqMsgT_v02* pStartReq; + /**< Starts a positioning session. + + The client receives the following indications: position report, + satellite report, fix session report, and NMEA report (if applicable). + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_START_REQ_V02. */ + + const qmiLocStopReqMsgT_v02* pStopReq; + /**< Stops a positioning session. The client receives a fix session report + denoting that the fix session ended after this message was sent. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_STOP_REQ_V02. */ + + const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; + /**< Informs the service about the user response for a network-initiated call. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NI_USER_RESPONSE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ + + const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; + /**< Injects the predicted orbits data into the service. + + When all predicted orbits data parts have been injected, the client + receives the following indication containing a response: + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. + + The client injects successive data parts without waiting for this + indication as long as locClientSendReq() returns successfully. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ + + const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; + /**< Injects UTC time into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_UTC_TIME_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ + + const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; + /**< Injects a position into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_POSITION_REQ_V02. */ + + const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; + /**< Sets the location engine lock. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_ENGINE_LOCK_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ + + const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; + /**< Sets the SBAS configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SBAS_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ + + const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; + /**< Sets the NMEA types configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_NMEA_TYPES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ + + const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; + /**< Sets the Low Power mode configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ + + const qmiLocSetServerReqMsgT_v02* pSetServerReq; + /**< Sets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SERVER_REQ_V02. */ + + const qmiLocGetServerReqMsgT_v02* pGetServerReq; + /**< Gets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SERVER_REQ_V02. */ + + const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; + /**< Deletes the aiding data from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; + /**< Sets XTRA-T session control in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ + + const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; + /**< Injects a WiFi position into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ + + const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; + /**< Notifies the engine about the WiFi status. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ + + const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; + /**< Sets the engine Operation mode. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_OPERATION_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ + + const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; + /**< Sends the stationary position status to the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SPI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SPI_STATUS_REQ_V02. */ + + const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; + /**< Injects sensor data into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ + + const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; + /**< Injects time synchronization information into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ + + const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; + /**< Sets the cradle mount state information in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + SET_CRADLE_MOUNT_CONFIG_REQ_V02. + + To send this request, set the reqId field in locClientSendReq() to + SET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; + /**< Sets external power configuration state in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ + + const qmiLocInformLocationServerConnStatusReqMsgT_v02* + pInformLocationServerConnStatusReq; + /**< Informs the engine about the connection status to the location server. + + This can be sent in response to a + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The + service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 + response indication for this request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. */ + + const qmiLocSetProtocolConfigParametersReqMsgT_v02* + pSetProtocolConfigParametersReq; + /**< Sets the protocol configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetProtocolConfigParametersReqMsgT_v02* + pGetProtocolConfigParametersReq; + /**< Retrieves protocol configuration parameters from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocSetSensorControlConfigReqMsgT_v02* + pSetSensorControlConfigReq; + /**< Sets the sensor control configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. */ + + const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* + pSetSensorPerformanceControlConfigReq; + /**< Sets the sensor performance configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. */ + + const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; + /**< Retrieves the sensor properties from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. */ + + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; + /**< Sets the sensor properties in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. */ + + const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; + /**< Injects a SUPL certificate into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. */ + + const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; + /**< Deletes a SUPL certificate from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. */ + + const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* + pSetPositionEngineConfigParametersReq; + /**< Sets position engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* + pGetPositionEngineConfigParametersReq; + /**< Gets position engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; + /**< Adds a circular geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 */ + + const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; + /**< Deletes a geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_GEOFENCE_REQ_V02 */ + + const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; + /**< Queries a geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_QUERY_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_QUERY_GEOFENCE_REQ_V02. */ + + const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; + /**< Edits geofence parameters. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_EDIT_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_EDIT_GEOFENCE_REQ_V02. */ + + const qmiLocGetBestAvailablePositionReqMsgT_v02* + pGetBestAvailablePositionReq; + /**< Get the best available position from location engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ + + const qmiLocInjectMotionDataReqMsgT_v02* pInjectMotionDataReq; + /**< Inject motion data in the location engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_MOTION_DATA_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_MOTION_DATA_REQ_V02 */ + + const qmiLocGetNiGeofenceIdListReqMsgT_v02* pGetNiGeofenceIdListReq; + /**< Get the list of Network Initiated Geofences from the location engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 */ + + const qmiLocInjectGSMCellInfoReqMsgT_v02 *pInjectGSMCellInfoReq; + /**< Inject GSM Cell Information into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 */ + + const qmiLocInjectNetworkInitiatedMessageReqMsgT_v02 + *pInjectNetworkInitiatedMessageReq; + /**< Inject Network Initiated Message into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ + + const void *pWWANOutOfServiceNotificationReq; + + const qmiLocPedometerReportReqMsgT_v02 *pPedometerReportReq; + /**< Send pedometer data to the location engine. If the request is + accepted by the service, the client receives the following + indication containing a response: + QMI_LOC_PEDOMETER_REPORT_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ + + const qmiLocInjectWCDMACellInfoReqMsgT_v02 *pInjectWCDMACellInfoReq; + const qmiLocInjectTDSCDMACellInfoReqMsgT_v02 *pInjectTDSCDMACellInfoReq; + const qmiLocInjectSubscriberIDReqMsgT_v02 *pInjectSubscriberIDReq; + +}locClientReqUnionType; + + +/** Event indications that are sent by the service. +*/ +typedef union +{ + const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; + /**< Contains the position information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. If + periodic fix criteria is specified, this event is generated multiple + times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is + sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ + + const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; + /**< Contains the GNSS satellite information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. This event + is generated at 1 Hz if the location engine is tracking satellites to + make a location fix. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ + + const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; + /**< Contains an NMEA report sentence. + + The entire NMEA report consisting of multiple sentences is sent at a + 1 Hz rate. This event is generated after QMI_LOC_START_REQ_V02 is sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NMEA_IND_V02. */ + + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; + /**< Notifies a location client when the network triggers a positioning + request to the mobile. + + Upon getting this event, the location client displays the + network-initiated fix request in a dialog and prompts the user to + accept or deny the request. The client responds to this request with + the message QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ + + const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; + /**< Asks the client for time assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The eventIndId field in the event indication callback is + set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ + + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + pInjectPredictedOrbitsReqEvent; + /**< Asks the client for predicted orbits data assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ + + const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; + /**< Asks the client for position assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_POSITION_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ + + const qmiLocEventEngineStateIndMsgT_v02* pEngineState; + /**< Sent by the engine whenever it turns on or off. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ + + const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; + /**< Sent by the engine when a location session begins or ends. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ + + const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; + /**< Sent by the engine when it needs WiFi support. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ + + const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* + pSensorStreamingReadyStatusEvent; + /**< Notifies the client that the engine is ready to accept sensor data. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ + + const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; + /**< Sent by the engine when it needs to synchronize its time with the sensor + processor time. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ + + const qmiLocEventSetSpiStreamingReportIndMsgT_v02* + pSetSpiStreamingReportEvent; + /**< Asks the client to start/stop sending a Stationary Position Indicator + (SPI) stream. + + The eventIndId field in the event indication callback is set to + QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ + + const qmiLocEventLocationServerConnectionReqIndMsgT_v02* + pLocationServerConnReqEvent; + /**< Sent by the engine to ask the client to open or close a connection to + a location server. + + The client responds to this request by sending the + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. */ + + const qmiLocEventNiGeofenceNotificationIndMsgT_v02* + pNiGeofenceNotificationEvent; + /**< Sent by the engine to notify the client about changes to a + network-initiated geofence. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. */ + + const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; + /**< Sent by the engine to notify the client about updates that may + affect a geofence operation. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. */ + + const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; + /**< Sent by the engine to notify the client about a geofence breach + event. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ + + const qmiLocEventPedometerControlIndMsgT_v02* pPedometerControlEvent; + /**< Sent by the engine to recommend how pedometer data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02. @newpagetable */ + + const qmiLocEventMotionDataControlIndMsgT_v02* pMotionDataControlEvent; + /**< Sent by the engine to recommend how motion data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02. @newpagetable */ + +}locClientEventIndUnionType; + + +/** Response indications that are sent by the service. +*/ +typedef union +{ + const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; + /**< Response to the QMI_LOC_GET_SERVICE_REVISION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ + + const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; + /**< Response to the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ + + const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; + /**< Response to the QMI_LOC_NI_USER_RESPONSE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_NI_USER_RESPONSE_IND_V02. */ + + const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* + pInjectPredictedOrbitsDataInd; + /**< Sent after a predicted orbits data part has been successfully injected. + + The client waits for this indication before injecting the next part. + This indication is sent in response to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* + pGetPredictedOrbitsDataSourceInd; + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* + pGetPredictedOrbitsDataValidityInd; + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ + + const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; + /**< Response to the QMI_LOC_INJECT_UTC_TIME_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_UTC_TIME_IND_V02. */ + + const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; + /**< Response to the QMI_LOC_INJECT_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_POSITION_IND_V02. */ + + const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; + /**< Response to the QMI_LOC_SET_ENGINE_LOCK_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ + + const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; + /**< Response to the QMI_LOC_GET_ENGINE_LOCK_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ + + const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; + /**< Response to the QMI_LOC_SET_SBAS_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ + + const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; + /**< Response to the QMI_LOC_GET_SBAS_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ + + const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; + /**< Response to the QMI_LOC_SET_NMEA_TYPES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_NMEA_TYPES_IND_V02. */ + + const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; + /**< Response to the QMI_LOC_GET_NMEA_TYPES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NMEA_TYPES_IND_V02. */ + + const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; + /**< Response to the QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; + /**< Response to the QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocSetServerIndMsgT_v02* pSetServerInd; + /**< Response to the QMI_LOC_SET_SERVER_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SERVER_IND_V02. */ + + const qmiLocGetServerIndMsgT_v02* pGetServerInd; + /**< Response to the QMI_LOC_GET_SERVER_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVER_IND_V02. */ + + const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; + /**< Response to the QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; + /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; + /**< Response to the QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; + /**< Response to the QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ + + const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; + /**< Response to the QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ + + const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; + /**< Response to the QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ + + const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; + /**< Response to the QMI_LOC_SET_OPERATION_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_OPERATION_MODE_IND_V02. */ + + const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; + /**< Response to the QMI_LOC_GET_OPERATION_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_OPERATION_MODE_IND_V02. */ + + const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; + /**< Response to the QMI_LOC_SET_SPI_STATUS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SPI_STATUS_IND_V02. */ + + const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; + /**< Response to the QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ + + const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; + /**< Response to the QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ + + const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; + /**< Response to the QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ + + const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; + /**< Response to the QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; + /**< Response to the QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; + /**< Response to the QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocInformLocationServerConnStatusIndMsgT_v02* + pInformLocationServerConnStatusInd; + /**< Response to the QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ + + const qmiLocSetProtocolConfigParametersIndMsgT_v02* + pSetProtocolConfigParametersInd; + /**< Response to the QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetProtocolConfigParametersIndMsgT_v02* + pGetProtocolConfigParametersInd; + /**< Response to the QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; + /**< Response to the QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + */ + + const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; + /**< Response to the QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. + */ + + const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; + /**< Response to the QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + */ + + const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; + /**< Response to the QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + */ + + const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* + pSetSensorPerformanceControlConfigInd; + /**< Response to the + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ + + const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* + pGetSensorPerformanceControlConfigInd; + /**< Response to the + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ + + const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; + /**< Response to the QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. */ + + const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; + /**< Response to the QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. */ + + const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* + pSetPositionEngineConfigParametersInd; + /**< Response to the QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* + pGetPositionEngineConfigParametersInd; + /**< Response to the QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; + /**< Response to the QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. */ + + const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; + /**< Response to the QMI_LOC_DELETE_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_GEOFENCE_IND_V02. */ + + const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; + /**< Response to the QMI_LOC_QUERY_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_QUERY_GEOFENCE_IND_V02. */ + + const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; + /**< Response to the QMI_LOC_EDIT_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_EDIT_GEOFENCE_IND_V02. */ + + const qmiLocGetBestAvailablePositionIndMsgT_v02* + pGetBestAvailablePositionInd; + /**< Response to the QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ + + const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; + /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_MOTION_DATA_IND_V02. */ + + const qmiLocGetNiGeofenceIdListIndMsgT_v02* pGetNiGeofenceIdListInd; + /**< Response to the QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02. */ + + const qmiLocInjectGSMCellInfoIndMsgT_v02* pInjectGSMCellInfoInd; + /**< Response to the QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02. */ + + const qmiLocInjectNetworkInitiatedMessageIndMsgT_v02* + pInjectNetworkInitiatedMessageInd; + + /**< Response to the QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02. */ + + const qmiLocWWANOutOfServiceNotificationIndMsgT_v02* + pWWANOutOfServiceNotificationInd; + + /**< Response to the QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 + request. + The respIndId field in the response indication callback is set to + QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ + + const qmiLocPedometerReportIndMsgT_v02* pPedometerReportInd; + + /**< Response to the QMI_LOC_PEDOMETER_REPORT_REQ_V02 request. + The respIndId field in the response indication callback is set to + QMI_LOC_PEDOMETER_REPORT_IND_V02. */ + + const qmiLocInjectWCDMACellInfoIndMsgT_v02 *pInjectWCDMACellInfoInd; + const qmiLocInjectTDSCDMACellInfoIndMsgT_v02 *pInjectTDSCDMACellInfoInd; + const qmiLocInjectSubscriberIDIndMsgT_v02 *pInjectSubscriberIDInd; + +}locClientRespIndUnionType; + +/** @} */ /* end_addtogroup data_types */ + +/** @addtogroup callback_functions +@{ */ +/** + Location event indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the asynchronous event indications. + + @datatypes + #locClientHandleType \n + #locClientEventIndUnionType + + @param handle Location client for this event. Only the client who + registered for the corresponding event receives + this callback. + @param eventIndId ID of the event indication. + @param eventIndPayload Event indication payload. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @return + None. + + @dependencies + None. @newpage +*/ +typedef void (*locClientEventIndCbType)( + locClientHandleType handle, + uint32_t eventIndId, + const locClientEventIndUnionType eventIndPayload, + void *pClientCookie +); + +/** + Location response indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the response indications. + + @datatypes + #locClientHandleType \n + #locClientRespIndUnionType + + @param handle Location client who sent the request for which this + response indication is generated. + @param respIndId ID of the response. It is the same value as the ID + of request sent to the engine. + @param respIndPayload Payload of the response indication. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @return + None. + + @dependencies + None. @newpage +*/ +typedef void (*locClientRespIndCbType)( + locClientHandleType handle, + uint32_t respIndId, + const locClientRespIndUnionType respIndPayload, + void *pClientCookie +); + +/** + Location error callback function type. This function is called to inform + the client that the service is no longer available. When the client + receives this callback, it must close the existing connection and reopen + the client connection. + + @datatypes + #locClientHandleType \n + #locClientErrorEnumType + + @param handle Location client who sent the request for which this + error indication is generated. + @param errorId Error ID. + @param pClientCookie Payload associated with the error indication. + + @return + None. + + @dependencies + None. +*/ +typedef void (*locClientErrorCbType)( + locClientHandleType handle, + locClientErrorEnumType errorId, + void* pClientCookie + ); +/** @} */ /* end_addtogroup callback_functions */ + + +/** @ingroup data_types + Callback functions to be registered during locClientOpen(). +*/ +typedef struct +{ + uint32_t size; /**< Size of the structure. */ + locClientEventIndCbType eventIndCb; /**< Event indication callback. */ + locClientRespIndCbType respIndCb; /**< Response indication callback. */ + locClientErrorCbType errorCb; /**< Error indication callback. + @newpagetable */ +}locClientCallbacksType; + + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ +/** @addtogroup operation_functions +@{ */ +/*========================================================================== + locClientOpen */ +/** @xreflabel{hdr:locClientOpenFunction} + Connects a location client to the location engine. If the connection is + successful, this function returns a handle that the location client uses for + future location operations. + + @datatypes + #locClientStatusEnumType \n + #locClientEventMaskType \n + #locClientCallbacksType \n + #locClientHandleType + + @param[in] eventRegMask Mask of asynchronous events the client is + interested in receiving. + @param[in] pLocClientCallbacks Pointer to structure containing the + callbacks. + @param[out] pLocClientHandle Pointer to the handle to be used by the + client for any subsequent requests. + @param[in] pLocClientCookie Pointer to a cookie to be returned to the + client along with the callbacks. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - Non-zero error code (see #locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pLocClientCookie +); + + +/*========================================================================== + locClientClose */ +/** @xreflabel{hdr:locClientCloseFunction} + Disconnects a client from the location engine and sets the handle to + LOC_CLIENT_INVALID_HANDLE_VALUE. + + @datatypes + #locClientStatusEnumType \n + #locClientHandleType + + @param[in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientClose ( + locClientHandleType* pLocClientHandle +); + +/*============================================================================= + locClientSendReq */ +/** @xreflabel{hdr:locClientSendReqFunction} + Sends a message to the location engine. If this function is successful, the + client expects an indication (except start, stop, event registration, and + sensor injection messages) through the registered callback in the + locClientOpen() function. + + The indication contains the status of the request. If the status is a success, + the indication also contains the payload associated with response. + + @datatypes + #locClientStatusEnumType \n + #locClientHandleType \n + #locClientReqUnionType + + @param[in] handle Handle returned by the locClientOpen() function. + @param[in] reqId QMI_LOC service message ID of the request. + @param[in] reqPayload Payload of the request. This can be NULL if the + request has no payload. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload +); + + +/*============================================================================= + locClientGetSizeByEventIndId */ +/** Gets the size of the event indication structure from a specified ID. + + @param[in] eventIndId Event indicator ID. + @param[out] pEventIndSize Pointer to the size of the structure. + + @return + TRUE -- The event ID was found. \n + FALSE -- Otherwise. + + @dependencies + None. @newpage +*/ +extern bool locClientGetSizeByEventIndId( + uint32_t eventIndId, + size_t *pEventIndSize); + + +/*============================================================================= + locClientGetSizeByRespIndId */ +/** Gets the size of the response indication structure from a specified ID. + + @param[in] respIndId Response indicator ID. + @param[out] pRespIndSize Pointer to the size of the structure. + + @return + TRUE -- The response ID was found. \n + FALSE -- Otherwise. + + @dependencies + None. +*/ +extern bool locClientGetSizeByRespIndId( + uint32_t respIndId, + size_t *pRespIndSize); + +/*=============================================================================*/ +/** @} */ /* end_addtogroup operation_functions */ + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c new file mode 100644 index 00000000..769222b8 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -0,0 +1,293 @@ +/* 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 + +static loc_name_val_s_type loc_v02_event_name[] = +{ + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_START_REQ_V02), + NAME_VAL(QMI_LOC_START_RESP_V02), + NAME_VAL(QMI_LOC_STOP_REQ_V02), + NAME_VAL(QMI_LOC_STOP_RESP_V02), + NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02) +}; +static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_event_name(uint32_t event) +{ + return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); +} + +static loc_name_val_s_type loc_v02_client_status_name[] = +{ + NAME_VAL(eLOC_CLIENT_SUCCESS), + NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), + NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), + NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), + NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), + NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), + NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY), +}; +static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_client_status_name(locClientStatusEnumType status) +{ + return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); +} + + +static loc_name_val_s_type loc_v02_qmi_status_name[] = +{ + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, + eQMI_LOC_SUCCESS_V02, + eQMI_LOC_GENERAL_FAILURE_V02, + eQMI_LOC_UNSUPPORTED_V02, + eQMI_LOC_INVALID_PARAMETER_V02, + eQMI_LOC_ENGINE_BUSY_V02, + eQMI_LOC_PHONE_OFFLINE_V02, + eQMI_LOC_TIMEOUT_V02, + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02, + eQMI_LOC_INSUFFICIENT_MEMORY_V02, + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 +}; +static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) +{ + return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); +} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h new file mode 100644 index 00000000..8d4670c3 --- /dev/null +++ b/loc_api/loc_api_v02/loc_api_v02_log.h @@ -0,0 +1,50 @@ +/* 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_V02_LOG_H +#define LOC_API_V02_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_v02_event_name(uint32_t event); +const char* loc_get_v02_client_status_name(locClientStatusEnumType status); +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); + + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h new file mode 100644 index 00000000..7f4e62d2 --- /dev/null +++ b/loc_api/loc_api_v02/loc_util_log.h @@ -0,0 +1,75 @@ +/* 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_UTIL_LOG_H +#define LOC_UTIL_LOG_H + +#if defined(_ANDROID_) +#include "loc_api_v02_log.h" +#include + +#else // no _ANDROID_ + +// common for QNX and Griffon + +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#define loc_get_v02_event_name(X) #X +#define loc_get_v02_client_status_name(X) #X + +#define loc_get_v02_qmi_status_name(X) #X + +//specific to OFF TARGET +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +#include +# include +# include + +// get around strl*: not found in glibc +// TBD:look for presence of eglibc other libraries +// with strlcpy supported. +#define strlcpy(X,Y,Z) strcpy(X,Y) +#define strlcat(X,Y,Z) strcat(X,Y) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +#endif //_ANDROID_ + +#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c new file mode 100644 index 00000000..c7ebd6db --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.c @@ -0,0 +1,3328 @@ +/* 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. + */ + +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 6.0 + It requires encode/decode library version 5 or later + It was generated on: Thu Dec 13 2012 (Spin ) + From IDL File: location_service_v02.idl */ + +#include "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), + QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), + QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), + QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + 8, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + 9, 0, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + 10, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + 6, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + 7, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + 12, 0, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + 12, 0, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + 5, 0, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + 17, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + 17, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + 21, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + 30, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), + 32, 0, + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocMotionDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, cid), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTDSCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mcc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, cid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, lac), + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + 0, 1 +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + 0x2C, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + 4, 0 +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + 14, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), + 15, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), + 16, 0 +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + 18, 0 +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + 20, 0 +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + 22, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + 22, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), + 22, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), + 22, 0 +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) +}; + +static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) +}; + +static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), + 23, 0 +}; + +static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) +}; + +static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), + QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), + QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, + QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), + QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), + 0, 0 +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + 5, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + 11, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + 13, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + 14, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), + 15, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), + 16, 0 +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + 19, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + 20, 0 +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + 24, 0 +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + 25, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + 8, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + 9, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + 26, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + 27, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + 28, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + 29, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + 31, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + 31, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), + 33, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), + 33, 0 +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + 34, 0 +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), + 21, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), + 21, 0 +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + 21, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), + 21, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), + 21, 0 +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) +}; + +static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), + 35, 0, + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), + + 0x04, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) +}; + +static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) +}; + +static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), + 35, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) +}; + +static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) +}; + +static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) +}; + +static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), + 0x21, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), + 0x24, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), + 0x25, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), + 0x26, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), + 0x27, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), + 0x29, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), + 2, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), + 1, 0, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), + 0x2C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), + 3, 0, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), + 0x2D, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), + 36, 0 +}; + +static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), + QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) +}; + +static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), + 37, 0, + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) +}; + +static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), + 38, 0, + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) +}; + +static const uint8_t qmiLocInjectWCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), + 39, 0, + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSubscriberIDReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) +}; + +static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + +static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), + + 0x04, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) +}; + +static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, + {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, + {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, + {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, + {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, + {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, + {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {0, 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, + {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02} +}; + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02 +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 103}, + {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 26), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 28), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 30), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 34), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 36), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 38), 112}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 42), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 46), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 50), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 54), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 58), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 60), 929}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 64), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 66), 694}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 68), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 70), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 74), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 76), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 2063}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 80), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 90), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 53}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 94), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 98), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 35}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 102), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 106), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 110), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 12}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 114), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 25}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 124), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 126), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 128), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 130), 30}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 138), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 140), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 142), 46}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 132), 36}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 134), 33}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 136), 22} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_PEDOMETER_REPORT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 388}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, QMI_IDL_TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, QMI_IDL_TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, QMI_IDL_TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, QMI_IDL_TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, QMI_IDL_TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, QMI_IDL_TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 15), 32}, + {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, + {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, + {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 25), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 27), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 29), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 31), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 33), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 35), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 43), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 47), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 51), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 55), 11}, + {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 7}, + {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 59), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 65), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 69), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 71), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 75), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 77), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 30}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 81), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 91), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 95), 60}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 103), 42}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 107), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 111), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 115), 19}, + {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, + {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, + {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 78}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 125), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 127), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 129), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, + {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 22), 15}, + {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 23), 4}, + {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 135), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 137), 7} +}; + +/*Service Object*/ +struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x05, + 0x02, + 0x10, + 2248, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, + { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, + &loc_qmi_idl_type_table_object_v02, + 0x12, + NULL +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h new file mode 100644 index 00000000..57f7c746 --- /dev/null +++ b/loc_api/loc_api_v02/location_service_v02.h @@ -0,0 +1,8783 @@ +/* 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_SERVICE_H +#define LOC_SERVICE_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ + +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 6.0 + It requires encode/decode library version 5 or later + It was generated on: Thu Dec 13 2012 (Spin ) + From IDL File: location_service_v02.idl */ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** Major Version Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MAJOR_VERS 0x02 +/** Revision Number of the IDL used to generate this file */ +#define LOC_V02_IDL_MINOR_VERS 0x12 +/** Major Version Number of the qmi_idl_compiler used to generate this file */ +#define LOC_V02_IDL_TOOL_VERS 0x06 +/** Maximum Defined Message ID */ +#define LOC_V02_MAX_MESSAGE_ID 0x0072; +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum string length for the Provider field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 + +/** Maximum string length for the Name field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 + +/** Maximum string length for the Version field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 + +/** Maximum length of the list containing the SVs that were used to generate + a position report. */ +#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPV6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum GNSS Measurement Engine Firmware Version String length. */ +#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ +#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Full Version String length. */ +#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of the SUPL certificate. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 + +/** Maximum length of the network-initiated Geofence ID + list. */ +#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 + +/** Maximum value of WDMA frequency for injection of WCDMA cell + information */ +#define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 + +/** Maximum value of PSC for injection of WCDMA cell information */ +#define QMI_LOC_MAX_WCDMA_PSC_V02 511 + +/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell + information */ +#define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 + +/** Maximum length of the injected network-initiated message. */ +#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. */ +#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. */ +#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. */ +#define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Refer to the definition of the following bitmasks: + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. + + Multiple events can be registered by ORing the individual masks and + sending them in this TLV. All unused bits in this mask must be set to 0. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; + /**< Application provider. */ + + char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; + /**< Application name. */ + + uint8_t applicationVersion_valid; + /**< Specifies whether the application version string contains + a valid value: \begin{itemize1} + \item 0x00 (FALSE) -- Application version string is invalid + \item 0x01 (TRUE) -- Application version string is valid + \vspace{-0.18in} \end{itemize1} */ + + char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; + /**< Application version. */ +}qmiLocApplicationIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - 0x00000001 -- Request periodic fixes \n + - 0x00000002 -- Request a single fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} + \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Units: Milliseconds \n + - Default: 1000 ms + */ + + /* Optional */ + /* ID of the Application that Sent this Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be + generated until either the fix criteria specified by the client + are met or the client response timeout occurs. */ + eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \item PDOP = square root of (HDOP^2 + VDOP^2) + \vspace{-0.18in} \end{itemize1} */ + + float HDOP; + /**< Horizontal dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ + + float VDOP; + /**< Vertical dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors were used in calculating the position in the + position report. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SENSOR_USED_ ACCEL + \item 0x00000002 -- SENSOR_USED_ GYRO + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results were aided by sensors. + + Valid bitmasks: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites. */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ + eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state */ + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the position report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SESS_STATUS_ SUCCESS + \item 0x00000001 -- SESS_STATUS_ IN_PROGRESS + \item 0x00000002 -- SESS_STATUS_ GENERAL_FAILURE + \item 0x00000003 -- SESS_STATUS_ TIMEOUT + \item 0x00000004 -- SESS_STATUS_ USER_END + \item 0x00000005 -- SESS_STATUS_ BAD_PARAMETER + \item 0x00000006 -- SESS_STATUS_ PHONE_OFFLINE + \item 0x00000007 -- SESS_STATUS_ ENGINE_LOCKED + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_ MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Speed Uncertainty */ + uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ + float speedUnc; + /**< 3-D Speed uncertainty.\n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence.\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. \n + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_ MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_ LOCATION + \item 0x00000020 -- INJECTED_COARSE_ POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \n Whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- VALID_SYSTEM + \item 0x00000002 -- VALID_GNSS_SVID + \item 0x00000004 -- VALID_HEALTH_ STATUS + \item 0x00000008 -- VALID_PROCESS_ STATUS + \item 0x00000010 -- VALID_SVINFO_ MASK + \item 0x00000020 -- VALID_ELEVATION + \item 0x00000040 -- VALID_AZIMUTH + \item 0x00000080 -- VALID_SNR + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} */ + + uint16_t gnssSvId; + /**< GNSS SV ID. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For GLONASS: 1 to 32 + \item For SBAS: 120 to 151 + \end{itemize1} \end{itemize1} + + The GPS and GLONASS SVs can be disambiguated using the system field. */ + + uint8_t healthStatus; + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy + \vspace{-0.18in} \end{itemize1}*/ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. \n + Valid values:\n + - 0x00000001 -- SV_STATUS_IDLE \n + - 0x00000002 -- SV_STATUS_SEARCH \n + - 0x00000003 -- SV_STATUS_TRACK + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Whether almanac and ephemeris information is available. \n + Valid bitmasks: \n + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Source */ + uint8_t altitudeAssumed; + /**< Whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Valid altitude is calculated + \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be + enough satellites to determine precise altitude + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends NMEA sentences to the control point */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 201 + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ + eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. */ + + uint32_t timeBetweenFixes; + /**< Time between fixes.\n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_VX_MS_ ASSISTED_ONLY + \item 0x00000002 -- NI_VX_MS_BASED_ ONLY + \item 0x00000003 -- NI_VX_MS_ ASSISTED_PREFERRED_ MS_BASED_ALLOWED + \item 0x00000004 -- NI_VX_MS_ BASED_PREFERRED_ MS_ASSISTED_ALLOWED + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: \begin{itemize1} + \item 0x00000000 -- NI_VX_OCTET + \item 0x00000001 -- NI_VX_EXN_ PROTOCOL_MSG + \item 0x00000002 -- NI_VX_ASCII + \item 0x00000003 -- NI_VX_IA5 + \item 0x00000004 -- NI_VX_UNICODE + \item 0x00000005 -- NI_VX_SHIFT_JIS + \item 0x00000006 -- NI_VX_KOREAN + \item 0x00000007 -- NI_VX_LATIN_ HEBREW + \item 0x00000008 -- NI_VX_LATIN + \item 0x00000009 -- NI_VX_GSM + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \begin{itemize1} + \item 0x00000000 -- FORMAT_LOGICAL_ NAME + \item 0x00000001 -- FORMAT_EMAIL_ ADDRESS + \item 0x00000002 -- FORMAT_MSISDN + \item 0x00000003 -- FORMAT_URL + \item 0x00000004 -- FORMAT_SIP_URL + \item 0x00000005 -- FORMAT_MIN + \item 0x00000006 -- FORMAT_MDN + \item 0x00000007 -- FORMAT_ IMSPUBLIC_IDENTITY + \item 0x7FFFFFFF -- FORMAT_OSS_ UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID*/ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPV4 address. */ + + uint16_t port; + /**< IPV4 port. */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPV6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPV6 port. */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPV4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPV6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL notify verify request event. This mask is set in + the valid_flags field of a notify verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid_flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SUPL_SERVER_INFO + \item 0x00000002 -- SUPL_SESSION_ID + \item 0x00000004 -- SUPL_HASH + \item 0x00000008 -- SUPL_POS_METHOD + \item 0x00000010 -- SUPL_DATA_ CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ ID + \item 0x00000040 -- SUPL_CLIENT_ NAME + \item 0x00000080 -- SUPL_QOP + \item 0x00000100 -- SUPL_USER_RESP_ TIMER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + + Valid values: \begin{itemize1} + \item 0x00000001 -- AGPS_SETASSISTED + \item 0x00000002 -- AGPS_SETBASED + \item 0x00000003 -- AGPS_ SETASSISTED_PREF + \item 0x00000004 -- AGPS_SETBASED_ PREF + \item 0x00000005 -- AUTONOMOUS_GPS + \item 0x00000006 -- AFLT + \item 0x00000007 -- ECID + \item 0x00000008 -- EOTD + \item 0x00000009 -- OTDOA + \item 0x0000000A -- NO_POSITION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds*/ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT + \vspace{-0.18in} \end{itemize1} + + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI notify verify request event. + This mask is set in the valid flags field of a + notify verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- INVOKE_ID_MASK + \item 0x0002 -- DATA_CODING_ SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_ MASK + \item 0x0008 -- CLIENT_ADDRESS_ MASK + \item 0x0010 -- LOCATION_TYPE_ MASK + \item 0x0020 -- REQUESTOR_ID_MASK + \item 0x0040 -- CODEWORD_STRING_ MASK + \item 0x0080 -- SERVICE_TYPE_MASK + \item 0x0100 -- USER_RESP_TIMER_ MASK + \vspace{-0.18in} \end{itemize1} + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \begin{itemize1} + \item 0x0000000C -- NI_SS_GERMAN + \item 0x0000000D -- NI_SS_ENGLISH + \item 0x0000000E -- NI_SS_ITALIAN + \item 0x0000000F -- NI_SS_FRENCH + \item 0x00000010 -- NI_SS_SPANISH + \item 0x00000011 -- NI_SS_DUTCH + \item 0x00000012 -- NI_SS_SWEDISH + \item 0x00000013 -- NI_SS_DANISH + \item 0x00000014 -- NI_SS_PORTUGUESE + \item 0x00000015 -- NI_SS_FINNISH + \item 0x00000016 -- NI_SS_NORWEGIAN + \item 0x00000017 -- NI_SS_GREEK + \item 0x00000018 -- NI_SS_TURKISH + \item 0x00000019 -- NI_SS_HUNGARIAN + \item 0x0000001A -- NI_SS_POLISH + \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC + \item 0x0000001C -- NI_SUPL_UTF8 + \item 0x0000001D -- NI_SUPL_UCS2 + \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT + \vspace{-0.18in} \end{itemize1} + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- CURRENT_ LOCATION + \item 0x00000002 -- CURRENT_OR_ LAST_KNOWN_LOCATION + \item 0x00000004 -- INITIAL_LOCATION + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ONGOING_NI_ INCOMING_MO + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID + and multiple location IDs in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of + multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed + as part of multiple location ID in the SUPL_POS_INIT message. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic + triggered session. */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event + triggered session. */ + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; + /**< Specifies which type of network measurements are allowed to be sent as + part of the Location ID or Multiple Location IDs parameter in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- SUPPORTED_NETWORK_ WLAN + \item 0x0002 -- SUPPORTED_NETWORK_ GSM + \item 0x0004 -- SUPPORTED_NETWORK_ WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_ CDMA + \item 0x0010 -- SUPPORTED_NETWORK_ HRDP + \item 0x0020 -- SUPPORTED_NETWORK_ UMB + \item 0x0040 -- SUPPORTED_NETWORK_ LTE + \item 0x0080 -- SUPPORTED_NETWORK_ WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_ HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_ NONSVRV + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; + /**< Specifies the type of session trigger requested in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid values: \begin{itemize1} + \item 0xFFFFFFFF -- TRIGGER_TYPE_ SINGLE_SHOT + \item 0x00000000 -- TRIGGER_TYPE_ PERIODIC + \item 0x00000001 -- TRIGGER_TYPE_ AREA_EVENT + \vspace{-0.18in} \end{itemize1} */ + + qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; + /**< Specifies which GNSS technologies are allowed as positioning + technologies. + + Valid bitmasks: \n + - 0x0001 -- GNSS_GPS \n + - 0x0002 -- GNSS_GLONASS \n + - 0x0004 -- GNSS_GALILEO \n + - 0x0008 -- GNSS_SBAS \n + - 0x0010 -- GNSS_QZSS \n + - 0x0020 -- GNSS_MODERN_GPS + */ +}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< The ESLP URL + Maximum length: 255 bytes */ +}qmiLocEmergencyNotificationStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI notify/verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_ VERIFY + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_ RESP + \item 0x00000005 -- PRIVACY_ OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; + /**< \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL + indication payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< This specifies that the corresponding NI notification is an + emergency notification. Emergency notification + can be given even without an ESLP address */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - 0x00000001 -- ON \n + - 0x00000002 -- OFF + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - 0x00000001 -- STARTED \n + - 0x00000002 -- FINISHED + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a WiFi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type as specified in qmiWifiRequestEnumT. + + Valid values: \begin{itemize1} + \item 0x00000000 -- START_PERIODIC_ HI_FREQ_FIXES + \item 0x00000001 -- START_PERIODIC_ KEEP_WARM + \item 0x00000002 -- STOP_PERIODIC_ FIXES + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n + + samplesPerBatch must be a nonzero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in an integral number of batches per + second (Hz). \vspace{-0.06in} \n + + batchesPerSecond must be a nonzero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor + data + \item 0x00 (FALSE) -- GNSS location engine is not ready to accept + sensor data + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + sensor data. + */ + + /* Optional */ + /* Gyroscope Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor + data. + */ + + /* Optional */ + /* Accelerometer Temperature Accept Ready */ + uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; + /**< \n Whether the GNSS location engine is ready to accept accelerometer + temperature data. + */ + + /* Optional */ + /* Gyroscope Temperature Accept Ready */ + uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; + /**< \n Whether the GNSS location engine is ready to accept gyroscope + temperature data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Whether the client is to start or stop sending an SPI status stream. + \begin{itemize1} + \item 0x01 (TRUE) -- Client is to start sending an SPI status stream + \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- WWAN_TYPE_ INTERNET + \item 0x00000001 -- WWAN_TYPE_ AGNSS + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the + Geofence to find the its current state. */ + QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiGeofenceOperationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Informs the control point about + network-initiated Geofences. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Operation Type */ + qmiLocNiGeofenceOperationEnumT_v02 operationType; + /**< Operation for which this notification was generated. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NI_GEOFENCE_ ADDED + \item 0x00000002 -- NI_GEOFENCE_ DELETED + \item 0x00000003 -- NI_GEOFENCE_ EDITED + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can + be used to monitor Geofences. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage + information is available. */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ + QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceGenAlertEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + Geofence status. */ +typedef struct { + + /* Mandatory */ + /* Geofence General Alert */ + qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; + /**< Specifies the Geofence general alert type. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_GEN_ ALERT_GNSS_UNAVAILABLE + \item 0x00000002 -- GEOFENCE_GEN_ ALERT_GNSS_AVAILABLE + \item 0x00000003 -- GEOFENCE_GEN_ ALERT_OOS + \item 0x00000004 -- GEOFENCE_GEN_ ALERT_TIME_INVALID + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ + QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceBreachTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Elliptical Horizontal Uncertainty Azimuth */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Horizontal Speed validity bit */ + uint8_t speedHorizontal_valid; + /**< Indicates whether the Horizontal speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Horizontal speed is valid + \item 0x00 (FALSE) -- Horizontal speed is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Horizontal Speed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Altitude validity bit */ + uint8_t altitudeWrtEllipsoid_valid; + /**< Indicates whether the altitude field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Altitude field is valid + \item 0x00 (FALSE) -- Altitude field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} + */ + + /* Altitude With Respect to Ellipsoid */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Vertical Uncertainty validity bit */ + uint8_t vertUnc_valid; + /**< Indicates whether the Vertical Uncertainty field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Uncertainty field is valid + \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Uncertainty */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Vertical Speed validity bit */ + uint8_t speedVertical_valid; + /**< Indicates whether the Vertical Speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Speed field is valid + \item 0x00 (FALSE) -- Vertical Speed field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Speed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* heading validity bit */ + uint8_t heading_valid; + /**< Indicates whether the Heading field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Heading field is valid + \item 0x00 (FALSE) -- Heading field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Heading */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ +}qmiLocGeofencePositionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of + a Geofence breach event. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< The type of breach that generated this event. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ BREACH_TYPE_ENTERING + \item 0x00000002 -- GEOFENCE_ BREACH_TYPE_LEAVING + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Geofence Position */ + uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ + qmiLocGeofencePositionStructT_v02 geofencePosition; + /**< \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ +}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how pedometer reports should be + sent to the location engine */ +typedef struct { + + /* Mandatory */ + /* Request Pedometer Data */ + uint8_t requestPedometerData; + /**< \n Whether GNSS location engine is requesting the client to + send pedometer data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + pedometer data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + pedometer data + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Reset Step Count */ + uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ + uint8_t resetStepCount; + /**< Whether location engine desires the step count to be reset. + \begin{itemize1} + \item 0x01 (TRUE) -- Pedometer step count should be reset. + \item 0x00 (FALSE) -- Pedometer step count should not be reset. + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Step Count Threshold */ + uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ + uint32_t stepCountThreshold; + /**< Specifies the number of steps to be sampled in a pedometer report + as recommended by the the location engine. If the threshold is set to 0 + then the location engine desires a pedometer report at every step event. + */ +}qmiLocEventPedometerControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how motion data reports should be + sent to the location engine */ +typedef struct { + + /* Mandatory */ + /* Request Motion Data */ + uint8_t requestMotionData; + /**< \n Whether GNSS location engine is requesting the client to + send motion data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + motion data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + motion data + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventMotionDataControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ + eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent + memory for the request. */ + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * typedef struct { + * }qmiLocGetServiceRevisionReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. */ + + /* Optional */ + /* GNSS Measurement Engine Firmware Version String */ + uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ + char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS measurement engine software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in} \end{itemize1} + + \textbf{Note:} This string is only provided on platforms that have + a measurement engine that supports this version string. On all other + platforms, this optional TLV is not provided. */ + + /* Optional */ + /* GNSS Hosted Software Version String */ + uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ + char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS hosted software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in}\end{itemize1} + + \textbf{Note:} This string is only provided on hosted architectures + (measurement and position engine running on different processors) that + support this version string. On all other platforms, this optional TLV + is not provided. */ + + /* Optional */ + /* GNSS Software Version String */ + uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ + char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Aggregate version of the GNSS software. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * typedef struct { + * }qmiLocGetFixCriteriaReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \begin{itemize1} + \item 0x00000001 -- LOW: Client requires low horizontal accuracy + \item 0x00000002 -- MED: Client requires medium horizontal accuracy + \item 0x00000003 -- HIGH: Client requires high horizontal accuracy + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at \n 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. + + Valid values: \begin{itemize1} + \item 0x00000001 -- ON: Client is interested in receiving intermediate + reports + \item 0x00000002 -- OFF: Client is not interested in receiving + intermediate reports + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Minimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Units: Milliseconds */ + + /* Optional */ + /* ID of the Application that Sent the Position Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NOTIFY_VERIFY_ ACCEPT + \item 0x00000002 -- NOTIFY_VERIFY_ DENY + \item 0x00000003 -- NOTIFY_VERIFY_ NORESP + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \begin{itemize1} + \item 0x00000001 -- NO_NOTIFY_NO_ VERIF + \item 0x00000002 -- NOTIFY_ONLY + \item 0x00000003 -- ALLOW_NO_RESP + \item 0x00000004 -- NOT_ALLOW_NO_ RESP + \item 0x00000005 -- PRIVACY_ OVERRIDE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; + /**< \n Optional SUPL Version 2 Extension payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< SUPL Emergency notification payload. Emergency notification + can be given even without an ESLP address */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. + + Valid values: \begin{itemize1} + \item 0x00000000 -- PREDICTED_ ORBITS_XTRA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * typedef struct { + * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Units: Milliseconds */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only. */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided). */ + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ALT_SRC_ UNKNOWN + \item 0x00000001 -- ALT_SRC_GPS + \item 0x00000002 -- ALT_SRC_CELL_ID + \item 0x00000003 -- ALT_SRC_ ENHANCED_CELL_ID + \item 0x00000004 -- ALT_SRC_WIFI + \item 0x00000005 -- ALT_SRC_ TERRESTRIAL + \item 0x00000006 -- ALT_SRC_ TERRESTRIAL_HYBRID + \item 0x00000007 -- ALT_SRC_ ALTITUDE_DATABASE + \item 0x00000008 -- ALT_SRC_ BAROMETRIC_ALTIMETER + \item 0x00000009 -- ALT_SRC_OTHER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SRC_LINKAGE_ NOT_SPECIFIED + \item 0x00000001 -- SRC_LINKAGE_ FULLY_INTERDEPENDENT + \item 0x00000002 -- SRC_LINKAGE_ DEPENDS_ON_LAT_LONG + \item 0x00000003 -- SRC_LINKAGE_ FULLY_INDEPENDENT + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \begin{itemize1} + \item 0x00000000 -- UNCERTAINTY_ NOT_SPECIFIED + \item 0x00000001 -- UNCERTAINTY_ POINT: Altitude uncertainty is valid + at the injected horizontal position coordinates + only. + \item 0x00000002 -- UNCERTAINTY_ FULL: Altitude uncertainty applies to + the position of the device regardless of + horizontal position (within the horizontal + uncertainty region, if provided). + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0 to 99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with horizontal uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid. + \begin{itemize1} + \item Units: Meters \begin{itemize1} + \item Positive = height + \item Negative = depth + \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0-99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Units: Milliseconds */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from which this position was obtained. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_ POSITION_SRC_GNSS + \item 0x00000001 -- eQMI_LOC_ POSITION_SRC_CELLID + \item 0x00000002 -- eQMI_LOC_ POSITION_SRC_ENH_CELLID + \item 0x00000003 -- eQMI_LOC_ POSITION_SRC_WIFI + \item 0x00000004 -- eQMI_LOC_ POSITION_SRC_TERRESTRIAL + \item 0x00000005 -- eQMI_LOC_ POSITION_SRC_GNSS_ TERRESTRIAL_HYBRID + \item 0x00000006 -- eQMI_LOC_ POSITION_SRC_OTHER + \end{itemize1} \vspace{0.05in} + + If altitude is specified and the altitude source is not specified, the engine + assumes that the altitude was obtained using the specified position source. \n + If both altitude and altitude source are specified, the engine assumes + that only latitude and longitude were obtained using the specified position + source. + */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ + eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetEngineLockReqMsgT is empty + * typedef struct { + * }qmiLocGetEngineLockReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - 0x00000001 -- LOCK_NONE \n + - 0x00000002 -- LOCK_MI \n + - 0x00000003 -- LOCK_MT \n + - 0x00000004 -- LOCK_ALL + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSbasConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ +#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ +#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * typedef struct { + * }qmiLocGetNmeaTypesReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - 0x0000ffff -- NMEA_MASK_ALL \n + - 0x00000001 -- NMEA_MASK_GGA \n + - 0x00000002 -- NMEA_MASK_RMC \n + - 0x00000004 -- NMEA_MASK_GSV \n + - 0x00000008 -- NMEA_MASK_GSA \n + - 0x00000010 -- NMEA_MASK_VTG \n + - 0x00000020 -- NMEA_MASK_PQXFI \n + - 0x00000040 -- NMEA_MASK_PSTIS + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * typedef struct { + * }qmiLocGetLowPowerModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPV4 \n + - 0x02 -- IPV6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server, as defined in qmiLocServerTypeEnumT. + + Valid values: \n + - 0x00000001 -- CDMA_PDE \n + - 0x00000002 -- CDMA_MPC \n + - 0x00000003 -- UMTS_SLP \n + - 0x00000004 -- CUSTOM_PDE + */ + + /* Optional */ + /* IPV4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \n IPV4 address and port. */ + + /* Optional */ + /* IPV6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \n IPV6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ +typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ +#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ +#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \begin{itemize1} + \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS + \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO + \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS + \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS + \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Whether all assistance data is to be deleted. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this + message are ignored + \item 0x00 (FALSE) -- The optional fields in the message are to be + used to determine which data is to be deleted + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \n List of satellites for which the assistance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_GPS_SVDIR + \item 0x00000002 -- DELETE_GPS_ SVSTEER + \item 0x00000004 -- DELETE_GPS_TIME + \item 0x00000008 -- DELETE_GPS_ALM_ CORR + \item 0x00000010 -- DELETE_GLO_ SVDIR + \item 0x00000020 -- DELETE_GLO_ SVSTEER + \item 0x00000040 -- DELETE_GLO_TIME + \item 0x00000080 -- DELETE_GLO_ALM_ CORR + \item 0x00000100 -- DELETE_SBAS_ SVDIR + \item 0x00000200 -- DELETE_SBAS_ SVSTEER + \item 0x00000400 -- DELETE_POSITION + \item 0x00000800 -- DELETE_TIME + \item 0x00001000 -- DELETE_IONO + \item 0x00002000 -- DELETE_UTC + \item 0x00004000 -- DELETE_HEALTH + \item 0x00008000 -- DELETE_SADATA + \item 0x00010000 -- DELETE_RTI + \item 0x00020000 -- DELETE_SV_NO_ EXIST + \item 0x00040000 -- DELETE_FREQ_ BIAS_EST + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CELLDB_ POS + \item 0x00000002 -- DELETE_CELLDB_ LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_ OTA_POS + \item 0x00000008 -- DELETE_CELLDB_ EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_ TIMETAG + \item 0x00000020 -- DELETE_CELLDB_ CELLID + \item 0x00000040 -- DELETE_CELLDB_ CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_ LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_ CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_ NEIGHBOR_INFO + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CLOCK_ INFO_TIME_EST + \item 0x00000002 -- DELETE_CLOCK_ INFO_FREQ_EST + \item 0x00000004 -- DELETE_CLOCK_ INFO_WEEK_NUMBER + \item 0x00000008 -- DELETE_CLOCK_ INFO_RTC_TIME + \item 0x00000010 -- DELETE_CLOCK_ INFO_TIME_TRANSFER + \item 0x00000020 -- DELETE_CLOCK_ INFO_GPSTIME_EST + \item 0x00000040 -- DELETE_CLOCK_ INFO_GLOTIME_EST + \item 0x00000080 -- DELETE_CLOCK_ INFO_GLODAY_NUMBER + \item 0x00000100 -- DELETE_CLOCK_ INFO_GLO4YEAR_NUMBER + \item 0x00000200 -- DELETE_CLOCK_ INFO_GLO_RF_GRP_DELAY + \item 0x00000400 -- DELETE_CLOCK_ INFO_DISABLE_TT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * typedef struct { + * }qmiLocGetXtraTSessionControlReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< WiFi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< WiFi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< WiFi position HEPE.\n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< WiFi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the WiFi positioning system can be provided + here. + + Valid values: \begin{itemize1} + \item 0x00000000 -- ERROR_SUCCESS + \item 0x00000001 -- ERROR_WIFI_NOT_ AVAILABLE + \item 0x00000002 -- ERROR_NO_AP_ FOUND + \item 0x00000003 -- ERROR_ UNAUTHORIZED + \item 0x00000004 -- ERROR_SERVER_ UNAVAILABLE + \item 0x00000005 -- ERROR_LOCATION_ CANNOT_BE_DETERMINED + \item 0x00000006 -- ERROR_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< WiFi channel on which a beacon was received. */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. + + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the WiFi position. */ +typedef struct { + + /* Optional */ + /* WiFi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \n Time of WiFi position fix. */ + + /* Optional */ + /* WiFi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \n WiFi position fix. */ + + /* Optional */ + /* WiFi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n AP scan list. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET + \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW + \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW + \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM + \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the WiFi position. */ +typedef struct { + + /* Mandatory */ + /* Inject WiFi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WiFi Position request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of WiFi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< WiFi status information. + + Valid values: \begin{itemize1} + \item 0x00000001 -- WIFI_STATUS_ AVAILABLE + \item 0x00000002 -- WIFI_STATUS_ UNAVAILABLE + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the WiFi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify WiFi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WiFi Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * typedef struct { + * }qmiLocGetRegisteredEventsReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + Valid bitmasks: \n + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + GPS engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when the UE enters + or leaves the perimeter of a Geofence. + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer + control requests from the location engine. Location engine sends + this event out to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. Location engine sends + this event out to control the injection of motion data. + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is + set, AFLT will be used for 1x networks and OTDOA will be used + for LTE networks. */ + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + \label{operationMode} + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_ DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_ STANDALONE + \item 0x00000005 -- OPER_MODE_ CELL_ID + \item 0x00000006 -- OPER_MODE_ WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. This command is not to be used + by multiple clients concurrently. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetOperationModeReqMsgT is empty + * typedef struct { + * }qmiLocGetOperationModeReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \begin{itemize1} + \item 0x00000001 -- OPER_MODE_ DEFAULT + \item 0x00000002 -- OPER_MODE_MSB + \item 0x00000003 -- OPER_MODE_MSA + \item 0x00000004 -- OPER_MODE_ STANDALONE + \item 0x00000005 -- OPER_MODE_ CELL_ID + \item 0x00000006 -- OPER_MODE_ WWAN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Whether the device is stationary: + \begin{itemize1} + \item 0x00 (FALSE) -- Device is not stationary + \item 0x01 (TRUE) -- Device is stationary + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data. Only applies to the accelerometer samples. */ +#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem + time stamp. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified */ + eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and + the location engine */ + QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorDataTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor data sample.\n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message.The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: \begin{itemize1} + \item 0x01 -- SIGN_REVERSAL + \item 0X02 -- SENSOR_TIME_IS_ MODEM_TIME + \vspace{-0.18in} \end{itemize1} */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor sample.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + float temperature; + /**< Sensor temperature. \n + - Type: Floating point \n + - Units: Degree Celsius \n + - Range: -50 to +100.00 Degree Celsius */ +}qmiLocSensorTemperatureSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Denotes the time source of the sensor data. Location service will use + this field to identify the time reference used in the + sensor data timestamps. Values :\n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message. The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Type: Unsigned integer \n + - Units: Milliseconds */ + + uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ + qmiLocSensorTemperatureSampleStructT_v02 temperatureData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor temperature samples. \n + - Maximum length of the array: 50 */ +}qmiLocSensorTemperatureSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyroscope Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \n Gyroscope sensor samples. */ + + /* Optional */ + /* 3-Axis Accelerometer Data Time Source */ + uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; + /**< Time source for the 3-axis accelerometer data. Location service will use + this field to identify the time reference used in the accelerometer data + timestamps. If not specified the location service will assume that the + time source for the accelereometer data is unknown. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* 3-Axis Gyroscope Data Time Source */ + uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; + /**< Time source for the 3-axis gyroscope data. Location service will use + this field to identify the time reference used in the gyroscope data + timestamps.If not specified the locations ervice will assume that the + time source for the gyroscope data is unknown. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* Accelerometer Temperature Data */ + uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; + /**< Accelerometer temperature samples. This data is optional and does not + have to be included in the message along with accelerometer data. */ + + /* Optional */ + /* Gyroscope Temperature Data */ + uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; + /**< Gyroscope temperature samples. This data is optional and does not + have to be included in the message along with gyroscope data. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< Opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< Lets the client know how many 3-axis accelerometer samples + were accepted. This field is present only if the accelerometer + samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< Lets the client know how many 3-axis gyroscope samples were + accepted. This field is present only if the gyroscope + samples were sent in the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ + uint8_t accelTemperatureSamplesAccepted; + /**< This field lets the client know how many accelerometer temperature + samples were accepted. This field is present only if the accelerometer + temperature samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Temperature Samples Accepted */ + uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ + uint8_t gyroTemperatureSamplesAccepted; + /**< This field lets the client know how many gyroscope temperature samples + were accepted. This field is present only if the gyroscope + temperature samples were sent in the request. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< Value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetCradleMountConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_ MOUNTED + \item 0x00000002 -- CRADLE_STATE_ UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED + \item 0x00000001 -- CRADLE_STATE_ MOUNTED + \item 0x00000002 -- CRADLE_STATE_ UNKNOWN + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetExternalPowerConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \begin{itemize1} + \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED + \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED + \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the APN profile. + + Valid values: \n + - 0x00000001 -- PDN_TYPE_IPV4 \n + - 0x00000002 -- PDN_TYPE_IPV6 \n + - 0x00000003 -- PDN_TYPE_IPV4V6 \n + - 0x00000004 -- PDN_TYPE_PPP + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 101 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - 0x00000001 -- OPEN \n + - 0x00000002 -- CLOSE + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - 0x00000001 -- STATUS_SUCCESS = 1 \n + - 0x00000002 -- STATUS_FAILURE = 2 + + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \n Access Point Name (APN) profile information is present only when + requestType is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocLppConfigMaskT_v02; +#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ +#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ +typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA1 Hash Algorithm for SUPL Version 2.0 or higher */ + eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ + QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplHashAlgoEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS Version 1.0 */ + eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS Version 1.1 */ + QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplTlsVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< use Control plane protocol during emergency while on WCDMA */ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< use SUPL 2.0 emergency services during emergency while on WCDMA */ + QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEmergencyProtocolEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_ V1_ONLY + \item 0x00000002 -- VX_VERSION_ V2_ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Configures the protocols that the location service supports + for assisted GLONASS. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL Hash Algorithm that needs to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL TLS (Transport Layer Security) Version. This configuration is only + applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + Values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< Configures the protocol to be used during emergency. + Note: Currently only can select on WCDMA. FOR GSM and 1x UE + will always allow only Control plane NI trigger for positioning. + For LTE, UE Can allow either SUPL or Control plane NI trigger. + Values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted glonass configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL Hash algorithm configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter. */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< Identifies parameters that were not set successfully. This field + is sent only if the status is not a success. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \begin{itemize1} + \item 0x00000001 -- VX_VERSION_V1_ ONLY + \item 0x00000002 -- VX_VERSION_V2_ ONLY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - 0x00000001 -- SUPL_VERSION_1_0 \n + - 0x00000002 -- SUPL_VERSION_2_0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Assisted GLONASS Protocol mask. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. + The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set + in the LPP configuration for this to take effect. + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL Hash Algorithm that needs to be used. Values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL TLS (Transport Layer Security) Version. This configuration is only + applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. + Values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< The protocol to be used during emergency. + Values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position + improvement. */ + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SENSORS_USE_ ENABLED: + Sensors data is to be requested whenever a position request is + received. If sensors data is injected, the GNSS location engine + attempts to improve the heading and positioning performance using + sensors. This is the default. + \item 0x00000001 -- SENSORS_USE_ DISABLED: + Inertial sensors are not to be used to aid in the heading and + position improvement. + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPropertiesMaskT_v02; +#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_ SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Set Sensor Properties */ + uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ + qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; + /**< This field will be sent only if the status is not a success. + Identifies the parameters that were not set successfully. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Sensor Properties Config Parameters */ + qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; + /**< Mask denoting the sensor properties parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK + \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY + \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY + \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000007 -- CONFIG_NOT_ SUPPORTED + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; +#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with + GNSS. They can still be used for aiding in heading improvements. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x00000001 -- FORCED: \n + The GNSS location engine must request use of sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request acceleration data to be used by the low data rate + filter. The sensor data rate is specified in terms of the nominal number + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location + engine is to request gyro data to be used by the high data rate filter. + The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Sets which sensor algorithms are to be used when processing sensor data. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< Identifies parameters that were not configured successfully. This field + is sent only if the status is not a success. + + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- PERFORMANCE_ MODE + \item 0x00000002 -- ACCEL_SAMPLING_ SPEC + \item 0x00000004 -- GYRO_SAMPLING_ SPEC + \item 0x00000008 -- ALGORITHM_ CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_ SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_ SPEC_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * typedef struct { + * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \begin{itemize1} + \item 0x00000000 -- AUTO: \n + The GNSS location engine can decide when to request sensor data + injection based on internal criteria. This is the default. + \item 0x0000001 -- FORCED: \n + The GNSS location engine must request use of the sensors every time + the GNSS location engine turns on. + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Informs which sensor algorithms are currently set. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate ID */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate. \n + - Units: Bytes \n + - Range: 0 to 9 */ + + /* Mandatory */ + /* SUPL Certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< SUPL certificate contents. \n + - Type: Array of bytes. \n + - Maximum certificate size: 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate ID */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate to be deleted. \n + - Units: Bytes \n + - Range: 0 to 9 \n + If suplCertId is not specified, + all SUPL certificates are deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete SUPL Certificate request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the + injected position in a direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position is used in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Use the injected position in a direct position + calculation + \item 0x00 (FALSE) -- Do not use the injected position in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Filter the usage of SVs in the fix + \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data is to be stored in + persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Store assistance data in persistent memory + \item 0x00 (FALSE) -- Do not store assistance data in persistent memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< Identifies the parameters that were not set successfully. + This field is sent only if the status is other than SUCCESS. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_ POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_ DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- INJECTED_ POSITION_CONTROL + \item 0x00000002 -- FILTER_SV_USAGE + \item 0x00000004 -- STORE_ASSIST_ DATA + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies whether the injected position is used for a direct calculation + in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- The injected position is used in a direct + position calculation + \item 0x00 (FALSE) -- The injected position is not used in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- SV usage is filtered in the fix + \item 0x00 (FALSE) -- SV usage is not filtered in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies whether assistance data is stored in persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Assistance data is stored in persistent memory + \item 0x00 (FALSE) -- Assistance data is not stored in persistent + memory + \end{itemize1} + The default value is TRUE. + */ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocGeofenceBreachMaskT_v02; +#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported + when the Geofence is entered. */ +#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported + when the Geofence is exited. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a + lower rate. The gap between actual breach and + the time it is reported is higher. This + setting results in lower power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a + medium rate. This is the default setting. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a + high rate. The gap between actual breach and + the time it is reported is low. This results + in higher power usage. */ + QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceResponsivenessEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with + low confidence. This setting results in lower + power usage. This setting can impact the "yield" because + incorrect breach events may be sent. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with + medium confidence. This is the default setting. */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with + high confidence. This setting results in higher + power usage. */ + QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceConfidenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double latitude; + /**< Latitude of the center of the Geofence.*/ + + double longitude; + /**< Longitude of the center of the Geofence.*/ + + uint32_t radius; + /**< Radius of the circular Geofence in meters. */ +}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ + QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofencePositionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add Circular Geofence + indication. */ + + /* Mandatory */ + /* Circular Geofence Arguments */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Mandatory */ + /* Breach Event Mask */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Mandatory */ + /* Include Position in Breach Event */ + uint8_t includePosition; + /**< Specifies whether the Geofence engine is to include the position + in a breach event. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Position will be reported with the breach event + \item 0x00 (FALSE) -- Position will not be reported with the breach + event + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ RESPONSIVENESS_LOW + \item 0x00000002 -- GEOFENCE_ RESPONSIVENESS_MED + \item 0x00000003 -- GEOFENCE_ RESPONSIVENESS_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Confidence */ + uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 confidence; + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and + is to be fine-tuned to optimize power savings. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ CONFIDENCE_LOW + \item 0x00000002 -- GEOFENCE_ CONFIDENCE_MED + \item 0x00000003 -- GEOFENCE_ CONFIDENCE_HIGH + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Add Circular Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add Circular Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_ MEMORY + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Add Circular + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + The client must include this identifier in all transactions + pertaining to this Geofence. */ +}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be deleted. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete Geofence + indication. */ +}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Delete Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was deleted. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Delete + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ + QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceOriginEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ + QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be queried. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Query Geofence + indication. */ +}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Query Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was queried. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Query + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence Origin */ + uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ + qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; + /**< Originator of the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ ORIGIN_NETWORK + \item 0x00000002 -- GEOFENCE_ ORIGIN_DEVICE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Position with Respect to Geofence */ + uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ + qmiLocGeofencePositionEnumT_v02 posWrtGeofence; + /**< Indicates if the client is currently inside or outside + the Geofence. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_ POSITION_INSIDE + \item 0x00000002 -- GEOFENCE_ POSITION_OUTSIDE + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Circular Geofence Parameters */ + uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND + \vspace{-0.18in} \end{itemize1} */ +}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence to be edited. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Edit Geofence + request. This parameter will always be present if the + status field is set to SUCCESS. + */ + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE + \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Breach Event Mask */ + uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; +#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ +#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Edit Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Edit Geofence request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was edited. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is specified in the Edit Geofence request. */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ + qmiLocGeofenceConfigParamMaskT_v02 failedParams; + /**< Specified only when the status is not set to SUCCESS. If + the mask corresponding to a field is set, it indicates that + the Geofence parameter could not be edited. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_PARAM_ MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_ MASK_BREACH_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Best Available Position indication. */ +}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Best Available Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Best Available Position request. + + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get Best + Available Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item Range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_ MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ + float horSpeed; + /**< Horizontal speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Horizontal Speed Uncertainty */ + uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ + float horSpeedUnc; + /**< Horizontal speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \begin{itemize1} + \item 0x00000000 -- RELIABILITY_NOT_ SET + \item 0x00000001 -- RELIABILITY_ VERY_LOW + \item 0x00000002 -- RELIABILITY_LOW + \item 0x00000003 -- RELIABILITY_ MEDIUM + \item 0x00000004 -- RELIABILITY_HIGH + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Vertical Speed */ + uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ + float vertSpeed; + /**< Vertical speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Vertical Speed Uncertainty */ + uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ + float vertSpeedUnc; + /**< Vertical speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading. \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty. \n + - Type: Floating point \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. */ + + /* Optional */ + /* Technology Used Mask */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SATELLITE + \item 0x00000002 -- CELLID + \item 0x00000004 -- WIFI + \item 0x00000008 -- SENSORS + \item 0x00000010 -- REFERENCE_ LOCATION + \item 0x00000020 -- INJECTED_COARSE_ POSITION + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time). + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite. + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites. + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. + This is done when the clock time uncertainty is large. + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). + GNSS time is maintained irrespective of the GNSS receiver state + */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ + uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; + /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID: \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \item For QZSS: 193 to 197 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ +}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ + QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ + QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocMotionStateEnumT_v02 motion_state; + /**< Current motion state of the user. + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. + \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. + \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. + \vspace{0.1in} \end{itemize1} + + Absolute rest and relative rest are both indicated by setting motion_state + to Stationary. The relative rest state can be distinguished from absolute + rest by reducing probability_of_state. + */ + + qmiLocMotionModeEnumT_v02 motion_mode; + /**< Modes of user motion. + + Valid values: \begin{itemize1} + \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. + \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement + is in Pedestrian mode; nothing else is known about the movement. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement + is in Pedestrian Walking mode. + \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement + is in Pedestrian Running mode. + \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is + in Vehicular mode; nothing else is known about the movement. + \vspace{0.1in} \end{itemize1} + + The motion_mode value is independent of the motion_state value. + */ + + float probability_of_state; + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.1in} + + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.1in} + + It is recommended that if a particular combination of motion_state and + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} + + If the motion_state is not known, the value in this field is not used. + */ + + uint16_t age; + /**< Age of the motion data in milliseconds at the time of injection. + */ + + uint16_t timeout; + /**< If the age of the motion data input exceeds the timeout value, the data + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is + received. \n + + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} + + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. + */ +}qmiLocMotionDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Motion Data */ + qmiLocMotionDataStructT_v02 motion_data; +}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Inject Motion Data Request Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Motion Data request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The same transaction ID + will be returned in the Get NI Geofence ID List indication. */ +}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Get NI Geofence ID List Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NI Geofence ID List request. + Valid values: \n + - 0x00000000 -- SUCCESS \n + - 0x00000001 -- GENERAL_FAILURE \n + - 0x00000002 -- UNSUPPORTED \n + - 0x00000004 -- ENGINE_BUSY \n + - 0x00000006 -- TIMEOUT */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get NI + Geofence ID List request. */ + + /* Optional */ + /* NI Geofence ID List */ + uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ + uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ + uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; + /**< List containing the NI Geofence IDs. + - Type: Array of unsigned 32-bit integers \n + - Maximum NI Geofence ID List length: 16 */ +}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t MCC; + /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + + uint32_t MNC; + /**< GSM mobile network code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t LAC; + /**< GSM location area code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t CID; + /**< GSM cell identification. Refer to \hyperref[R2]{[R2]}. */ +}qmiLocGSMCellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects GSM cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* GSM Cell ID */ + qmiLocGSMCellIdStructT_v02 gsmCellId; + /**< \n Identifies the GSM cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + uint8_t roamingStatus; + /**< Whether the device is roaming. + \begin{itemize1} + \item 0x01 (TRUE) -- Device is roaming + \item 0x00 (FALSE) -- Device is not roaming + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Timing Advance */ + uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ + uint32_t timingAdvance; + /**< The round trip delay between the MS and the BS, in unit of 3.69 microseconds. + Refer to 3GPP TS 05.10 and TS 45.010 */ +}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects GSM cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject GSM Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject GSM Cell Info request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network */ + eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network. */ + QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocRoamingStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + + uint32_t mnc; + /**< WCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t cid; + /**< WCDMA Cell Identity. Refer to \hyperref[R2]{[R2]}. */ +}qmiLocWCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* WCDMA Cell ID */ + qmiLocWCDMACellIdStructT_v02 wcdmaCellId; + /**< \n Identifies the WCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Whether the device is roaming. + Valid values: \begin{itemize1} + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + its home network + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped + on a roaming network. + \vspace{0.1in} \end{itemize1} */ + + /* Optional */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ + + /* Optional */ + uint8_t psc_valid; /**< Must be set to true if psc is being passed */ + uint32_t psc; + /**< PrimaryScramblingCode of the serving cell. Valid range is 0 to 511. Refer to TS 25.331 */ +}qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject WCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WCDMA Cell Info request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ + + uint32_t mnc; + /**< TDSCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ + + uint32_t cid; + /**< TDSCDMA Cell Identity. Refer to TS 25.331. */ + + uint32_t lac; + /**< TDSCDMA location area code. Refer to \hyperref[R2]{[R2]}. */ +}qmiLocTDSCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* TDSCDMA Cell ID */ + qmiLocTDSCDMACellIdStructT_v02 tdscdmaCellId; + /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Whether the device is roaming. + Valid values: \begin{itemize1} + \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on + its home network + \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped + on a roaming network. + \vspace{0.1in} \end{itemize1} */ + + /* Optional */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ +}qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject TDSCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject TDSCDMA Cell Info request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Optional */ + /* Preferred IMSI */ + uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ + uint64_t preferredIMSI; + /**< \n The IMSI number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ + + /* Optional */ + /* Preferred MSISDN */ + uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ + uint64_t preferredMSISDN; + /**< \n The MSISDN number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ +}qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Subscriber ID Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Subscriber ID request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-018in} \end{itemize1} */ +}qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL network-initiated message is being injected. */ + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a network-initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Injected Network Initiated Message Type */ + qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; + /**< Type of the network-initiated message being injected. + + Valid values: + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL network-initiated message is being injected. */ + + /* Mandatory */ + /* Injected Network Initiated Message */ + uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ + uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; + /**< Network-initiated message body. + If the inject NI message type is TYPE_SUPL, the message contains + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ +}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a network-initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Network Initiated Message Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Network Initiated Message request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \item 0x00000008 -- INSUFFICIENT_ MEMORY + \vspace{-0.18in} \end{itemize1} */ +}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ +/** + @} + */ + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * typedef struct { + * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine that the device is out of + service. */ +typedef struct { + + /* Mandatory */ + /* Notify WWAN Out of Service Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WWAN Out of Service request. + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_ PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Time Source */ + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Time source for the pedometer. Location service will use + this field to identify the time reference used in the + pedometer data timestamp. Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and + the location engine*/ + + /* Mandatory */ + /* Pedometer report timestamp */ + uint32_t timestamp; + /**< Timestamp of the last step event in this report, i.e timestamp + of the step event that caused this report to be generated. + The timestamp is in the time reference scale that is + used by the pedometer time source. \n + - Unit: Milliseconds */ + + /* Mandatory */ + /* Time Interval */ + uint32_t timeInterval; + /**< Time interval during which the step count was calculated. Subtracting + timeInterval from the timestamp field will yield the the time when + the step detection for the first step in this report started. + Unit : Milliseconds. */ + + /* Mandatory */ + /* Step Count */ + uint32_t stepCount; + /**< Number for steps counted during the time interval.*/ + + /* Optional */ + /* Step Confidence */ + uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ + uint8_t stepConfidence; + /**< Confidence associated with the step. This field is only applicable + for a single step report, i.e if the stepCount is one. + Range: 0 to 100. + Note: The report will be ignored if confidence is 0. */ + + /* Optional */ + /* Step Count Uncertainty */ + uint8_t stepCountUncertainty_valid; /**< Must be set to true if stepCountUncertainty is being passed */ + float stepCountUncertainty; + /**< Uncertainty (in steps) associated with the step count. */ + + /* Optional */ + /* Step Rate */ + uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ + float stepRate; + /**< Current estimate for the rate of steps per second. + Units: steps/second + Range: >= 0.0 + */ +}qmiLocPedometerReportReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Status of Pedometer report request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the pedometer report request + + Valid values: \begin{itemize1} + \item 0x00000000 -- SUCCESS + \item 0x00000001 -- GENERAL_FAILURE + \item 0x00000002 -- UNSUPPORTED + \item 0x00000003 -- INVALID_PARAMETER + \item 0x00000004 -- ENGINE_BUSY + \item 0x00000005 -- PHONE_OFFLINE + \item 0x00000006 -- TIMEOUT + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocPedometerReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 +#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 +#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 +#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 +#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 +#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 +#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 +#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C +#define QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 0x006D +#define QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02 0x006E +#define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02 0x0070 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02 0x0071 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02 0x0072 +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h index 6321bb9c..94f2ebd8 100644 --- a/loc_api/ulp/inc/ulp.h +++ b/loc_api/ulp/inc/ulp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -36,14 +36,7 @@ extern "C" #endif #include - -typedef int (ulp_report_position_cb) -( - void* owner, - const GpsLocation* location_report_ptr, - unsigned int ext_data_length, - unsigned char* ext_data -); +#include "loc_eng.h" /** Represents the standard ulp module interface. */ typedef struct { @@ -51,24 +44,14 @@ typedef struct { size_t size; /** - * Starts the ulp module. 0: success + * Starts the libulp module. 0: success */ - int (*init)( void* owner, ulp_report_position_cb* cb); + int (*init)(loc_eng_data_s_type &loc_eng_data); - /** Starts the ulp engine. 0: success */ - int (*start_fix)( void ); - - /** Stops the ulp engine. 0: success */ - int (*stop_fix)( void ); - - /** Closes the interface */ - int (*destroy)( void ); - -} ulpInterface; +}ulpInterface; typedef const ulpInterface* (get_ulp_interface) (void); - #ifdef __cplusplus } #endif diff --git a/utils/Android.mk b/utils/Android.mk old mode 100755 new mode 100644 index ff2810b0..912dcae4 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -16,12 +16,15 @@ LOCAL_SRC_FILES += \ loc_log.cpp \ loc_cfg.cpp \ msg_q.c \ - linked_list.c + linked_list.c \ + loc_target.cpp LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ +LOCAL_LDFLAGS += -Wl,--export-dynamic + ## Includes LOCAL_C_INCLUDES:= @@ -31,7 +34,8 @@ LOCAL_COPY_HEADERS:= \ loc_cfg.h \ log_util.h \ linked_list.h \ - msg_q.h + msg_q.h \ + loc_target.h LOCAL_MODULE := libgps.utils diff --git a/utils/linked_list.c b/utils/linked_list.c index 16f2aa22..31ec52d2 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/linked_list.h b/utils/linked_list.h index cfc945a7..a85f09a3 100644 --- a/utils/linked_list.h +++ b/utils/linked_list.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index de960788..e4a47722 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -47,76 +47,17 @@ *============================================================================*/ /* Parameter data */ -loc_gps_cfg_s_type gps_conf; +static uint8_t DEBUG_LEVEL = 3; +static uint8_t TIMESTAMP = 0; /* Parameter spec table */ - -loc_param_s_type loc_parameter_table[] = +static loc_param_s_type loc_parameter_table[] = { - {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, 'n'}, - {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, 'n'}, - {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, 'n'}, - /* DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info - 4 - Debug, 5 - Verbose */ - {"DEBUG_LEVEL", &gps_conf.DEBUG_LEVEL, 'n'}, - {"SUPL_VER", &gps_conf.SUPL_VER, 'n'}, - {"CAPABILITIES", &gps_conf.CAPABILITIES, 'n'}, - {"TIMESTAMP", &gps_conf.TIMESTAMP, 'n'}, - {"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, 'f'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, 'n'}, - {"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, 'n'}, - {"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; - int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); -/*=========================================================================== -FUNCTION loc_default_parameters - -DESCRIPTION - Resets the parameters to default - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ - -static void loc_default_parameters() -{ - /* defaults */ - gps_conf.INTERMEDIATE_POS = 0; - gps_conf.ACCURACY_THRES = 0; - gps_conf.ENABLE_WIPER = 0; - gps_conf.DEBUG_LEVEL = 3; /* debug level */ - gps_conf.SUPL_VER = 0x10000; - gps_conf.CAPABILITIES = 0x7; - gps_conf.TIMESTAMP = 0; - - gps_conf.GYRO_BIAS_RANDOM_WALK = 0; - - gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; - gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; - gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - gps_conf.SENSOR_USAGE = 0; /* Enabled */ - - /* Value MUST be set by OEMs in configuration for sensor-assisted - navigation to work. There is NO default value */ - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; - - /* reset logging mechanism */ - loc_logger_init(gps_conf.DEBUG_LEVEL, 0); -} - /*=========================================================================== FUNCTION trim_space @@ -161,11 +102,26 @@ void trim_space(char *org_string) if (last_nonspace) { *last_nonspace = '\0'; } } +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_read_gps_conf +FUNCTION loc_set_config_entry DESCRIPTION - Reads the gps.conf file and sets global parameter data + 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 @@ -176,97 +132,151 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_gps_conf(void) +void loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +{ + if(NULL == config_entry || NULL == config_value) + { + LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); + return; + } + + 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; + } + 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; + } + 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; + } + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); + } + } +} + +/*=========================================================================== +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, loc_param_s_type* config_table, uint32_t table_length) { FILE *gps_conf_fp = NULL; char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ char *lasts; - char *param_name, *param_str_value; - int param_int_value = 0; - double param_double_value = 0; - int i; + loc_param_v_type config_value; + uint32_t i; - loc_default_parameters(); - - if((gps_conf_fp = fopen(GPS_CONF_FILE, "r")) != NULL) + if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) { - LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE); + LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); } else { - LOC_LOGW("%s: no %s file, using defaults", __FUNCTION__, GPS_CONF_FILE); + LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); return; /* no parameter file */ } + /* Clear all validity bits */ + for(i = 0; NULL != config_table && i < table_length; i++) + { + if(NULL != config_table[i].param_set) + { + *(config_table[i].param_set) = 0; + } + } + while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) { + memset(&config_value, 0, sizeof(config_value)); + /* Separate variable and value */ - param_name = strtok_r(input_buf, "=", &lasts); - if (param_name == NULL) continue; /* skip lines that do not contain "=" */ - param_str_value = strtok_r(NULL, "=", &lasts); - if (param_str_value == NULL) continue; /* skip lines that do not contain two operands */ + config_value.param_name = strtok_r(input_buf, "=", &lasts); + if (config_value.param_name == NULL) continue; /* skip lines that do not contain "=" */ + config_value.param_str_value = strtok_r(NULL, "=", &lasts); + if (config_value.param_str_value == NULL) continue; /* skip lines that do not contain two operands */ /* Trim leading and trailing spaces */ - trim_space(param_name); - trim_space(param_str_value); - - // printf("*(%s) = (%s)\n", param_name, param_str_value); + trim_space(config_value.param_name); + trim_space(config_value.param_str_value); /* Parse numerical value */ - if (param_str_value[0] == '0' && tolower(param_str_value[1]) == 'x') + if (config_value.param_str_value[0] == '0' && tolower(config_value.param_str_value[1]) == 'x') { /* hex */ - param_int_value = (int) strtol(¶m_str_value[2], (char**) NULL, 16); + config_value.param_int_value = (int) strtol(&config_value.param_str_value[2], (char**) NULL, 16); } else { - param_double_value = (double) atof(param_str_value); /* float */ - param_int_value = atoi(param_str_value); /* dec */ + 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 */ } - if (strcmp("GYRO_BIAS_RANDOM_WALK", param_name) == 0) + for(i = 0; NULL != config_table && i < table_length; i++) { - gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 1; + loc_set_config_entry(&config_table[i], &config_value); } for(i = 0; i < loc_param_num; i++) { - if (strcmp(loc_parameter_table[i].param_name, param_name) == 0 && - loc_parameter_table[i].param_ptr) - { - switch (loc_parameter_table[i].param_type) - { - case 's': - if (strcmp(param_str_value, "NULL") == 0) - { - *((char*)loc_parameter_table[i].param_ptr) = '\0'; - } - else { - strlcpy((char*) loc_parameter_table[i].param_ptr, - param_str_value, - LOC_MAX_PARAM_STRING + 1); - } - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, param_name, (char*)loc_parameter_table[i].param_ptr); - break; - case 'n': - *((int *)loc_parameter_table[i].param_ptr) = param_int_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, param_name, param_int_value); - break; - case 'f': - *((double *)loc_parameter_table[i].param_ptr) = param_double_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, param_name, param_double_value); - break; - default: - LOC_LOGE("%s: PARAM %s parameter type must be n or n", __FUNCTION__, param_name); - } - } + loc_set_config_entry(&loc_parameter_table[i], &config_value); } } fclose(gps_conf_fp); /* Initialize logging mechanism with parsed data */ - loc_logger_init(gps_conf.DEBUG_LEVEL, gps_conf.TIMESTAMP); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index ffeb83c4..df833389 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -30,14 +30,17 @@ #ifndef LOC_CFG_H #define LOC_CFG_H -#define LOC_MAX_PARAM_NAME 36 +#include + +#define LOC_MAX_PARAM_NAME 48 #define LOC_MAX_PARAM_STRING 80 #define LOC_MAX_PARAM_LINE 80 -// Don't want to overwrite the pre-def'ed value -#ifndef GPS_CONF_FILE -#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent -#endif +#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])) /*============================================================================= * @@ -48,30 +51,12 @@ typedef struct { char param_name[LOC_MAX_PARAM_NAME]; void *param_ptr; - char param_type; /* 'n' for number; 's' for string */ + 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; -/* GPS.conf support */ -typedef struct loc_gps_cfg_s -{ - unsigned long INTERMEDIATE_POS; - unsigned long ACCURACY_THRES; - unsigned long ENABLE_WIPER; - unsigned long DEBUG_LEVEL; - unsigned long SUPL_VER; - unsigned long CAPABILITIES; - unsigned long TIMESTAMP; - unsigned long GYRO_BIAS_RANDOM_WALK_VALID; - double GYRO_BIAS_RANDOM_WALK; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; - unsigned long SENSOR_CONTROL_MODE; - unsigned long SENSOR_USAGE; - // char string_val[LOC_MAX_PARAM_STRING + 1]; /* An example string value */ -} loc_gps_cfg_s_type; - /*============================================================================= * * MODULE EXTERNAL DATA @@ -82,14 +67,14 @@ typedef struct loc_gps_cfg_s extern "C" { #endif -extern loc_gps_cfg_s_type gps_conf; - /*============================================================================= * * MODULE EXPORTED FUNCTIONS * *============================================================================*/ -extern void loc_read_gps_conf(void); +extern void loc_read_conf(const char* conf_file_name, + loc_param_s_type* config_table, + uint32_t table_length); #ifdef __cplusplus } diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index e4fb76c4..ecdfc8f5 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -34,7 +34,6 @@ #include #include "loc_log.h" #include "msg_q.h" - #include "log_util.h" // Logging Improvements @@ -100,6 +99,36 @@ const char* log_succ_fail_string(int is_succ) return is_succ? "successful" : "failed"; } +//Target names +loc_name_val_s_type target_name[] = +{ + NAME_VAL(TARGET_OTHER), + NAME_VAL(TARGET_APQ8064_STANDALONE), + NAME_VAL(TARGET_APQ8064_FUSION3), + NAME_VAL(TARGET_MPQ8064), + NAME_VAL(TARGET_MSM8930), + NAME_VAL(TARGET_APQ8030_STANDALONE) +}; + +static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); + +/*=========================================================================== + +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(targetEnumType target) +{ + return loc_get_name_from_val(target_name, target_name_num, (long)target); +} /*=========================================================================== diff --git a/utils/loc_log.h b/utils/loc_log.h index 8b071a48..abe29b77 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -36,6 +36,7 @@ extern "C" #endif #include +#include "loc_target.h" typedef struct { @@ -54,6 +55,7 @@ typedef struct const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); const char* loc_get_msg_q_status(int status); +const char* loc_get_target_name(targetEnumType target); extern const char* log_succ_fail_string(int is_succ); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp new file mode 100644 index 00000000..92eaa45f --- /dev/null +++ b/utils/loc_target.cpp @@ -0,0 +1,118 @@ +/* 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "loc_target.h" +#include "loc_log.h" +#include "log_util.h" + +#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 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 + +static int gss_fd = 0; + +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; +} + +targetEnumType get_target(void) +{ + targetEnumType target = TARGET_OTHER; + + char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; + char id[] = "/sys/devices/system/soc/soc0/id"; + 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]; + + read_a_line(hw_platform, rd_hw_platform, LINE_LEN); + read_a_line( id, rd_id, LINE_LEN); + + 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)) + target = TARGET_APQ8064_FUSION3; + else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || + (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) + target = TARGET_APQ8064_STANDALONE; + else if((!memcmp(rd_id, APQ8030_ID_1, LENGTH(APQ8030_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8030_ID_1)]))) + target = TARGET_APQ8030_STANDALONE; + } + else if (!memcmp(rd_id, APQ8074_ID_1, LENGTH(APQ8074_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8074_ID_1)])) + target = TARGET_APQ8064_STANDALONE; + else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) + target = TARGET_MPQ8064; + 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)])) ) + target = TARGET_MSM8930; + return target; +} diff --git a/utils/loc_target.h b/utils/loc_target.h new file mode 100644 index 00000000..32c64b56 --- /dev/null +++ b/utils/loc_target.h @@ -0,0 +1,52 @@ +/* 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_TARGET_H +#define LOC_TARGET_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef enum { + TARGET_OTHER = 0, + TARGET_APQ8064_STANDALONE, + TARGET_APQ8064_FUSION3, + TARGET_MPQ8064, + TARGET_MSM8930, + TARGET_APQ8030_STANDALONE +}targetEnumType; + +targetEnumType get_target(void); + +#ifdef __cplusplus +} +#endif + +#endif /*LOC_TARGET_H*/ diff --git a/utils/log_util.h b/utils/log_util.h index b3dae3c3..56dca624 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -86,15 +86,15 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGW("W/"__VA_ARGS__); } #define LOC_LOGI(...) \ if (loc_logger.DEBUG_LEVEL >= 3) { ALOGE("I/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("I/"__VA_ARGS__); } #define LOC_LOGD(...) \ if (loc_logger.DEBUG_LEVEL >= 4) { ALOGE("D/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("D/"__VA_ARGS__); } #define LOC_LOGV(...) \ if (loc_logger.DEBUG_LEVEL >= 5) { ALOGE("V/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } +else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("V/"__VA_ARGS__); } #else /* DEBUG_DMN_LOC_API */ @@ -135,7 +135,6 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } #define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) -#ifdef DEBUG_TRACE_CALLFLOW // Used for logging callflow from Android Framework #define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") // Used for logging callflow to Modem @@ -144,12 +143,6 @@ else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("W/"__VA_ARGS__); } #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) -#else -#define ENTRY_LOG_CALLFLOW() -#define EXIT_LOG_CALLFLOW(SPEC, VAL) -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) -#endif #ifdef __cplusplus } diff --git a/utils/msg_q.c b/utils/msg_q.c index 252921ef..2c264170 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * @@ -249,7 +249,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Received message %p rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/utils/msg_q.h b/utils/msg_q.h index 4171540a..d3d5cc5d 100644 --- a/utils/msg_q.h +++ b/utils/msg_q.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* 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 @@ -9,7 +9,7 @@ * 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 Code Aurora Forum, Inc. nor the names of its + * * 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. * From 926d20ad7720934055a6bca897b54c0af4cb1cc6 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 12 Feb 2013 17:18:49 -0800 Subject: [PATCH 121/945] gps: moving agps/ni/xtra/time features out of afw Moving these features out of afw allows these features to still work on platforms that do not allow changes to afw and it also gives us more control. Change-Id: I6923b302f93222dc10189c3a6a7b6ba2ec1a3378 --- loc_api/Android.mk | 2 - .../libloc_api-rpc-glue/Android.mk | 4 - .../rpc_inc/LocApiRpcAdapter.h | 8 +- .../src/LocApiRpcAdapter.cpp | 20 +- loc_api/libloc_api/loc_eng.cpp | 2 +- loc_api/libloc_api_50001/Android.mk | 13 +- loc_api/libloc_api_50001/LocApiAdapter.h | 10 +- loc_api/libloc_api_50001/gps_extended.h | 94 +++++ loc_api/libloc_api_50001/loc.cpp | 333 +----------------- loc_api/libloc_api_50001/loc.h | 3 +- loc_api/libloc_api_50001/loc_eng.cpp | 100 +----- loc_api/libloc_api_50001/loc_eng.h | 20 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 36 +- loc_api/libloc_api_50001/loc_eng_agps.h | 16 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 12 +- loc_api/libloc_api_50001/loc_eng_log.h | 4 +- loc_api/libloc_api_50001/loc_eng_msg.h | 51 +-- loc_api/libloc_api_50001/loc_eng_ni.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 4 +- loc_api/loc_api_v02/Android.mk | 4 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 24 +- loc_api/loc_api_v02/LocApiV02Adapter.h | 8 +- 22 files changed, 148 insertions(+), 624 deletions(-) create mode 100644 loc_api/libloc_api_50001/gps_extended.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index dd7a8f31..85dcb56b 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -4,9 +4,7 @@ LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := -FEATURE_IPV6 := true FEATURE_DELEXT := true -FEATURE_ULP := true # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index 6a7c11cb..c7a245b8 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -20,10 +20,6 @@ LOCAL_CFLAGS+=$(GPS_FEATURES) # for loc_api_fixup.c LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - LOCAL_SHARED_LIBRARIES:= \ librpc \ libutils \ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h index bdb28be4..1574a896 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. +/* 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 @@ -96,14 +96,8 @@ public: setServer(unsigned int ip, int port, LocServerType type); virtual enum loc_api_adapter_err setXtraData(char* data, int length); -#ifdef FEATURE_IPV6 virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 9c2749bd..022daffe 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -958,22 +958,13 @@ LocApiRpcAdapter::setXtraData(char* data, int length) return convertErr(rpc_ret_val); } -#ifdef FEATURE_IPV6 enum loc_api_adapter_err LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) -#else -enum loc_api_adapter_err -LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType) -#endif { 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; -#ifdef FEATURE_IPV6 if (AGPS_TYPE_INVALID == agpsType) { -#else - if (false) { -#endif rpc_loc_server_open_status_s_type *conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; @@ -1010,7 +1001,6 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agp conn_multi_open_status_ptr->apn_name[0] = 0; } -#ifdef FEATURE_IPV6 switch(bearer) { case AGPS_APN_BEARER_IPV4: @@ -1025,9 +1015,7 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agp default: conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_PPP; } -#else - conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IP; -#endif + 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, @@ -1081,22 +1069,16 @@ void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_requ 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 { -#ifdef FEATURE_IPV6 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); -#else - break; -#endif } requestATL(connHandle, agps_type); break; -#ifdef FEATURE_IPV6 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; -#endif 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); diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp index 944326b0..3b286303 100644 --- a/loc_api/libloc_api/loc_eng.cpp +++ b/loc_api/libloc_api/loc_eng.cpp @@ -1421,7 +1421,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_eng_process_deferred_action (void* arg) { - AGpsStatus status; + AGpsExtStatus status; status.size = sizeof(status); status.type = AGPS_TYPE_SUPL; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 9cd3b197..f36ae4fe 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -25,10 +25,6 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - ifeq ($(FEATURE_DELEXT), true) LOCAL_CFLAGS += -DFEATURE_DELEXT endif #FEATURE_DELEXT @@ -40,6 +36,7 @@ LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ LocApiAdapter.h \ loc.h \ + gps_extended.h \ loc_eng.h \ loc_eng_xtra.h \ loc_eng_ni.h \ @@ -85,10 +82,6 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ hardware/qcom/gps/loc_api/ulp/inc @@ -121,10 +114,6 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ \ -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 65fac91a..95b91740 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -132,7 +132,7 @@ public: void* svExt); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); - void reportAgpsStatus(AGpsStatus &agpsStatus); + void reportAgpsStatus(AGpsExtStatus &agpsStatus); void requestXtraData(); void requestTime(); void requestLocation(); @@ -171,15 +171,9 @@ public: inline virtual enum loc_api_adapter_err setXtraData(char* data, int length) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#ifdef FEATURE_IPV6 inline virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#else - inline virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType) - {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} -#endif inline virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h new file mode 100644 index 00000000..8e688c95 --- /dev/null +++ b/loc_api/libloc_api_50001/gps_extended.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution. + * + * Copyright (C) 2010 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. + */ + +#ifndef GPS_EXTENDED_H +#define GPS_EXTENDED_H + +/** 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 + +/** 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 structure for the XTRA interface. */ +typedef struct { + gps_xtra_download_request download_request_cb; + gps_create_thread create_thread_cb; +} GpsXtraExtCallbacks; + +/** Represents the status of AGPS. */ +typedef struct { + /** set to sizeof(AGpsExtStatus) */ + size_t size; + + AGpsExtType type; + AGpsStatusValue status; + uint32_t ipv4_addr; + char ipv6_addr[16]; + 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; + + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiExtCallbacks; + +#endif /* GPS_EXTENDED_H */ + diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 18d0fe05..d7362477 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -97,50 +97,6 @@ static const GpsInterface sLocEngInterface = loc_get_extension }; -// Function declarations for sLocEngAGpsInterface -static void loc_agps_init(AGpsCallbacks* callbacks); -#ifdef FEATURE_IPV6 -static int loc_agps_open(AGpsType agpsType, - const char* apn, AGpsBearerType bearerType); -static int loc_agps_closed(AGpsType agpsType); -static int loc_agps_open_failed(AGpsType agpsType); -#else -static int loc_agps_open(const char* apn); -static int loc_agps_closed(); -static int loc_agps_open_failed(); -#endif -static int loc_agps_set_server(AGpsType type, const char *hostname, int port); - -static const AGpsInterface sLocEngAGpsInterface = -{ - sizeof(AGpsInterface), - loc_agps_init, - loc_agps_open, - loc_agps_closed, - loc_agps_open_failed, - loc_agps_set_server -}; - -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); - -const GpsNiInterface sLocEngNiInterface = -{ - sizeof(GpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - 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); @@ -301,12 +257,9 @@ static int loc_init(GpsCallbacks* callbacks) LOC_API_ADAPTER_EVENT_MASK_T event = 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; + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ callbacks->status_cb, /* status_cb */ sv_cb, /* sv_status_cb */ @@ -537,10 +490,8 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) { - ENTRY_LOG(); - int ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - EXIT_LOG(%d, ret_val); - return ret_val; + //inject time not handled by AFW + return 0; } @@ -704,19 +655,16 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - ret_val = &sLocEngXTRAInterface; + //xtra not handled by AFW } - else if (strcmp(name, AGPS_INTERFACE) == 0) { - ret_val = &sLocEngAGpsInterface; + //agps not handled by AFW } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - ret_val = &sLocEngNiInterface; + //ni not handled by AFW } - else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { char baseband[PROPERTY_VALUE_MAX]; @@ -746,7 +694,6 @@ const void* loc_get_extension(const char* name) { ret_val = get_geofence_interface(); } - else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); @@ -755,274 +702,6 @@ const void* loc_get_extension(const char* name) 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, 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 - -===========================================================================*/ -#ifdef FEATURE_IPV6 -static int loc_agps_open(AGpsType agpsType, - const char* apn, AGpsBearerType bearerType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -static int loc_agps_open(const char* apn) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open(loc_afw_data, apn); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef FEATURE_IPV6 -static int loc_agps_closed(AGpsType agpsType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -static int loc_agps_closed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_closed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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 - -===========================================================================*/ -#ifdef FEATURE_IPV6 -int loc_agps_open_failed(AGpsType agpsType) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#else -int loc_agps_open_failed() -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_open_failed(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} -#endif - -/*=========================================================================== -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; - } - int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION 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(); - int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks); - - 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -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(); - loc_eng_ni_init(loc_afw_data, callbacks); - 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) {} diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 51273ddf..08392179 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -38,6 +38,7 @@ extern "C" { #include #include #include +#include "gps_extended.h" #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8fa87a0b..fb24249d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -869,7 +869,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbacks) +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return); @@ -886,14 +886,12 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, false); -#ifdef FEATURE_IPV6 loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, AGPS_TYPE_WWAN_ANY, false); loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); -#endif loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); @@ -919,8 +917,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef FEATURE_IPV6 -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, const char* apn, AGpsBearerType bearerType) { ENTRY_LOG_CALLFLOW(); @@ -945,33 +942,6 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, - const char* apn) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && 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_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, apn, - apn_len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== FUNCTION loc_eng_agps_closed @@ -990,8 +960,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef FEATURE_IPV6 -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, @@ -1004,21 +973,6 @@ int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== FUNCTION loc_eng_agps_open_failed @@ -1037,8 +991,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -#ifdef FEATURE_IPV6 -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType) +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, @@ -1051,21 +1004,6 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsTyp EXIT_LOG(%d, 0); return 0; } -#else -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - - EXIT_LOG(%d, 0); - return 0; -} -#endif /*=========================================================================== @@ -1365,9 +1303,7 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.agps_status_cb != NULL) { loc_eng_data.agnss_nif->dropAllSubscribers(); -#ifdef FEATURE_IPV6 loc_eng_data.internet_nif->dropAllSubscribers(); -#endif loc_eng_agps_reinit(loc_eng_data); } @@ -1680,10 +1616,8 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { stateMachine = loc_eng_data_p->agnss_nif; -#ifdef FEATURE_IPV6 } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { stateMachine = loc_eng_data_p->internet_nif; -#endif } else { LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); break; @@ -1700,10 +1634,8 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { stateMachine = loc_eng_data_p->agnss_nif; -#ifdef FEATURE_IPV6 } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { stateMachine = loc_eng_data_p->internet_nif; -#endif } else { LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); break; @@ -1717,16 +1649,11 @@ static void loc_eng_deferred_action_thread(void* arg) case LOC_ENG_MSG_REQUEST_ATL: { loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; -#ifdef FEATURE_IPV6 boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || backwardCompatibleMode) ? loc_eng_data_p->agnss_nif : loc_eng_data_p->internet_nif; -#else - boolean backwardCompatibleMode = false; - AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif; -#endif ATLSubscriber subscriber(arqMsg->handle, stateMachine, loc_eng_data_p->client_handle, @@ -1745,19 +1672,16 @@ static void loc_eng_deferred_action_thread(void* arg) false); // attempt to unsubscribe from agnss_nif first if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { -#ifdef FEATURE_IPV6 ATLSubscriber s2(arlMsg->handle, loc_eng_data_p->internet_nif, loc_eng_data_p->client_handle, false); // if unsuccessful, try internet_nif loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); -#endif } } break; -#ifdef FEATURE_IPV6 case LOC_ENG_MSG_REQUEST_WIFI: { loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; @@ -1782,7 +1706,6 @@ static void loc_eng_deferred_action_thread(void* arg) stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); } break; -#endif case LOC_ENG_MSG_REQUEST_XTRA_DATA: if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) @@ -1829,7 +1752,7 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; AgpsStateMachine* stateMachine; -#ifdef FEATURE_IPV6 + switch (aosMsg->agpsType) { case AGPS_TYPE_WIFI: { stateMachine = loc_eng_data_p->wifi_nif; @@ -1845,9 +1768,6 @@ static void loc_eng_deferred_action_thread(void* arg) } stateMachine->setBearer(aosMsg->bearerType); -#else - stateMachine = loc_eng_data_p->agnss_nif; -#endif stateMachine->setAPN(aosMsg->apn, aosMsg->length); stateMachine->onRsrcEvent(RSRC_GRANTED); } @@ -1857,7 +1777,7 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; AgpsStateMachine* stateMachine; -#ifdef FEATURE_IPV6 + switch (acsMsg->agpsType) { case AGPS_TYPE_WIFI: { stateMachine = loc_eng_data_p->wifi_nif; @@ -1871,9 +1791,6 @@ static void loc_eng_deferred_action_thread(void* arg) stateMachine = loc_eng_data_p->internet_nif; } } -#else - stateMachine = loc_eng_data_p->agnss_nif; -#endif stateMachine->onRsrcEvent(RSRC_RELEASED); } break; @@ -1882,7 +1799,7 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; AgpsStateMachine* stateMachine; -#ifdef FEATURE_IPV6 + switch (aofMsg->agpsType) { case AGPS_TYPE_WIFI: { stateMachine = loc_eng_data_p->wifi_nif; @@ -1896,9 +1813,6 @@ static void loc_eng_deferred_action_thread(void* arg) stateMachine = loc_eng_data_p->internet_nif; } } -#else - stateMachine = loc_eng_data_p->agnss_nif; -#endif stateMachine->onRsrcEvent(RSRC_DENIED); } break; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index d61cb12b..38940977 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -101,7 +101,7 @@ typedef struct loc_location_cb_ext location_cb; gps_status_callback status_cb; loc_sv_status_cb_ext sv_status_cb; - agps_status_callback agps_status_cb; + agps_status_extended agps_status_cb; gps_nmea_callback nmea_cb; gps_ni_notify_callback ni_notify_cb; gps_acquire_wakelock acquire_wakelock_cb; @@ -224,17 +224,11 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, UlpLocationCriteria criteria); void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, - AGpsCallbacks* callbacks); -#ifdef FEATURE_IPV6 -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType, + 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, AGpsType agpsType); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType); -#else -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn); -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data); -#endif +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); int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, LocServerType type, const char *hostname, int port); @@ -251,13 +245,13 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, - GpsXtraCallbacks* callbacks); + GpsXtraExtCallbacks* callbacks); int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length); extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, - GpsNiCallbacks *callbacks); + 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, diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 5bdae3d7..1f7d1ab7 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -154,36 +154,22 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) break; case RSRC_DENIED: { -#ifdef FEATURE_IPV6 - AGpsType type = mBackwardCompatibleMode ? + AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); -#else - AGpsType type = mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, - (char*)mStateMachine->getAPN(), - type); -#endif } break; case RSRC_GRANTED: { -#ifdef FEATURE_IPV6 - AGpsType type = mBackwardCompatibleMode ? + AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); -#else - AGpsType type = mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, - (char*)mStateMachine->getAPN(), - type); -#endif } break; default: @@ -194,7 +180,6 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) return notify; } -#ifdef FEATURE_IPV6 bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification) { bool notify = forMe(notification); @@ -226,7 +211,6 @@ bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification) return notify; } -#endif //====================================================================== // AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState @@ -567,8 +551,8 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) // AgpsStateMachine //====================================================================== -AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status), - AGpsType type, +AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsExtStatus* status), + AGpsExtType type, bool enforceSingleSubscriber) : mServicer(servicer), mType(type), mStatePtr(new AgpsReleasedState(this)), @@ -698,12 +682,11 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const (void*)¬ification, false); if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { - AGpsStatus nifRequest; + AGpsExtStatus nifRequest; nifRequest.size = sizeof(nifRequest); nifRequest.type = mType; nifRequest.status = action; -#ifdef FEATURE_IPV6 if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; nifRequest.ipv6_addr[0] = 0; @@ -713,13 +696,6 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); s->setWifiInfo(nifRequest.ssid, nifRequest.password); } -#else - if (s == NULL) { - nifRequest.ipaddr = INADDR_NONE; - } else { - nifRequest.ipaddr = s->ID; - } -#endif CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); (*mServicer)(&nifRequest); diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 22160c36..ff5a92ab 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -137,9 +137,9 @@ class AgpsStateMachine { friend class AgpsState; // handle to whoever provides the service - void (* const mServicer)(AGpsStatus* status); + void (* const mServicer)(AGpsExtStatus* status); // NIF type: AGNSS or INTERNET. - const AGpsType mType; + const AGpsExtType mType; // pointer to the current state. AgpsState* mStatePtr; // a linked list of subscribers. @@ -150,25 +150,21 @@ class AgpsStateMachine { char* mAPN; // for convenience, we don't do strlen each time. unsigned int mAPNLen; -#ifdef FEATURE_IPV6 // bear AGpsBearerType mBearer; -#endif // ipv4 address for routing bool mEnforceSingleSubscriber; public: - AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type, bool enforceSingleSubscriber); + AgpsStateMachine(void (*servicer)(AGpsExtStatus* status), 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; } -#ifdef FEATURE_IPV6 inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline AGpsBearerType getBearer() const { return mBearer; } -#endif - inline AGpsType getType() const { return (AGpsType)mType; } + inline AGpsExtType getType() const { return (AGpsExtType)mType; } // someone, a ATL client or BIT, is asking for NIF void subscribeRsrc(Subscriber *subscriber); @@ -279,7 +275,6 @@ struct ATLSubscriber : public Subscriber { } }; -#ifdef FEATURE_IPV6 // WIFISubscriber, created with requests from MSAPM or QuIPC struct WIFISubscriber : public Subscriber { char * mSSID; @@ -326,6 +321,5 @@ struct WIFISubscriber : public Subscriber { return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId); } }; -#endif #endif //__LOC_ENG_AGPS_H__ diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 895db1db..99959abb 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -189,15 +189,11 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data) static loc_name_val_s_type loc_eng_agps_types[] = { -#ifdef FEATURE_IPV6 NAME_VAL( AGPS_TYPE_INVALID ), NAME_VAL( AGPS_TYPE_ANY ), -#endif NAME_VAL( AGPS_TYPE_SUPL ), - NAME_VAL( AGPS_TYPE_C2K ) -#ifdef FEATURE_IPV6 - ,NAME_VAL( AGPS_TYPE_WWAN_ANY ) -#endif + NAME_VAL( AGPS_TYPE_C2K ), + NAME_VAL( AGPS_TYPE_WWAN_ANY ) }; static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type); @@ -250,7 +246,6 @@ 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); } -#ifdef FEATURE_IPV6 static loc_name_val_s_type loc_eng_agps_bears[] = { NAME_VAL( AGPS_APN_BEARER_INVALID ), @@ -264,7 +259,6 @@ 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); } -#endif static loc_name_val_s_type loc_eng_server_types[] = { diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index 4ee978af..95a672fd 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -48,9 +48,7 @@ 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); -#ifdef FEATURE_IPV6 const char* loc_get_agps_bear_name(AGpsBearerType bear); -#endif 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); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index df7cc092..7b14cf11 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -39,10 +39,6 @@ #include #include "loc_eng_msg_id.h" -#ifndef SSID_BUF_SIZE - #define SSID_BUF_SIZE (32+1) -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -720,7 +716,6 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { } }; -#ifdef FEATURE_IPV6 struct loc_eng_msg_atl_open_success : public loc_eng_msg { const AGpsStatusValue agpsType; const int length; @@ -747,30 +742,8 @@ struct loc_eng_msg_atl_open_success : public loc_eng_msg { delete[] apn; } }; -#else -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const int length; - char* const apn; - inline loc_eng_msg_atl_open_success(void* instance, - const char* name, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - length(len), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n", - apn); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } -}; -#endif -#ifdef FEATURE_IPV6 + struct loc_eng_msg_atl_open_failed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_open_failed(void* instance, @@ -782,17 +755,8 @@ struct loc_eng_msg_atl_open_failed : public loc_eng_msg { loc_get_agps_type_name(agpsType)); } }; -#else -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - inline loc_eng_msg_atl_open_failed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED) - { - LOC_LOGV(""); - } -}; -#endif -#ifdef FEATURE_IPV6 + struct loc_eng_msg_atl_closed : public loc_eng_msg { const AGpsStatusValue agpsType; inline loc_eng_msg_atl_closed(void* instance, @@ -804,15 +768,6 @@ struct loc_eng_msg_atl_closed : public loc_eng_msg { loc_get_agps_type_name(agpsType)); } }; -#else -struct loc_eng_msg_atl_closed : public loc_eng_msg { - inline loc_eng_msg_atl_closed(void* instance) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED) - { - LOC_LOGV(""); - } -}; -#endif struct loc_eng_msg_set_data_enable : public loc_eng_msg { const int enable; diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 146b15b5..29900039 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -245,7 +245,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiCallbacks *callbacks) +void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks) { ENTRY_LOG_CALLFLOW(); diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 4b2d109d..e971891e 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -52,7 +52,7 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, - GpsXtraCallbacks* callbacks) + GpsXtraExtCallbacks* callbacks) { int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk index 8617f3cb..b5b55303 100644 --- a/loc_api/loc_api_v02/Android.mk +++ b/loc_api/loc_api_v02/Android.mk @@ -28,10 +28,6 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - ifeq ($(FEATURE_DELEXT), true) LOCAL_CFLAGS += -DFEATURE_DELEXT endif #FEATURE_DELEXT diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index d7276e95..33bc36a0 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1022,30 +1022,19 @@ enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( return LOC_API_ADAPTER_ERR_SUCCESS; } -#ifdef FEATURE_IPV6 enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) -#else -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, - AGpsType agpsType) -#endif { locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; locClientReqUnionType req_union; qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; -#ifdef FEATURE_IPV6 + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " "APN = [%s], bearer = %d \n", __func__, __LINE__, handle, is_succ, apn, bear); -#else - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s] \n", __func__, __LINE__, - handle, is_succ, apn); -#endif memset(&conn_status_req, 0, sizeof(conn_status_req)); memset(&conn_status_ind, 0, sizeof(conn_status_ind)); @@ -1062,7 +1051,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( strlcpy(conn_status_req.apnProfile.apnName, apn, sizeof(conn_status_req.apnProfile.apnName) ); -#ifdef FEATURE_IPV6 switch(bear) { case AGPS_APN_BEARER_IPV4: @@ -1084,10 +1072,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); return LOC_API_ADAPTER_ERR_INVALID_HANDLE; } -#else - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; -#endif conn_status_req.apnProfile_valid = 1; } @@ -1915,7 +1899,7 @@ void LocApiV02Adapter :: reportAtlRequest( if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) { AGpsType agpsType; -#ifdef FEATURE_IPV6 + switch(server_request_ptr->wwanType) { case eQMI_LOC_WWAN_TYPE_INTERNET_V02: @@ -1930,9 +1914,7 @@ void LocApiV02Adapter :: reportAtlRequest( agpsType = AGPS_TYPE_WWAN_ANY; break; } -#else - agpsType = AGPS_TYPE_SUPL; -#endif + LocApiAdapter::requestATL(connHandle, agpsType); } diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h index 10ea4069..3eda7526 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -138,15 +138,9 @@ public: setServer(unsigned int ip, int port, LocServerType type); virtual enum loc_api_adapter_err setXtraData(char* data, int length); -#ifdef FEATURE_IPV6 virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); From 399f53047e71da5fe614353e927b88f2e0002d03 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 28 May 2013 10:11:17 -0700 Subject: [PATCH 122/945] gps: Added xtra server query loc api In order to prevent the issue where the xtra server url that stored in gps.conf is incorrect (like xtra.bin instead of xtra2.bin) for a particular modem, I've made this change so that the xtra server url can be queried through loc api. CRs-fixed: 366599 Change-Id: If65de98d837f068fd61a235cbf1104026246e5a9 --- etc/gps.conf | 8 ++-- .../rpc_inc/LocApiRpcAdapter.h | 2 + .../src/LocApiRpcAdapter.cpp | 43 +++++++++++++++++ loc_api/libloc_api_50001/LocApiAdapter.cpp | 6 +++ loc_api/libloc_api_50001/LocApiAdapter.h | 6 ++- loc_api/libloc_api_50001/gps_extended.h | 7 +++ loc_api/libloc_api_50001/loc_eng.cpp | 14 ++++++ loc_api/libloc_api_50001/loc_eng.h | 2 + loc_api/libloc_api_50001/loc_eng_msg.h | 35 ++++++++++++++ loc_api/libloc_api_50001/loc_eng_msg_id.h | 2 + loc_api/libloc_api_50001/loc_eng_xtra.cpp | 30 ++++++++++++ loc_api/libloc_api_50001/loc_eng_xtra.h | 1 + loc_api/loc_api_v02/LocApiV02Adapter.cpp | 48 +++++++++++++++++++ loc_api/loc_api_v02/LocApiV02Adapter.h | 2 + 14 files changed, 202 insertions(+), 4 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 36cf35fe..aeaf96ab 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,6 +1,8 @@ -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +# Customized XTRA server urls can go here, which will +# override the default urls that are given by the modem +#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin # Error Estimate # _SET = 1 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h index 1574a896..32ea6e7f 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -96,6 +96,8 @@ public: 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 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 022daffe..22e4f7ee 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -958,6 +958,49 @@ LocApiRpcAdapter::setXtraData(char* data, int length) return convertErr(rpc_ret_val); } +/* Request the Xtra Server Url from the modem */ +enum loc_api_adapter_err +LocApiRpcAdapter::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; + } + + LocApiAdapter::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 LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) { diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index 8e5b1ee1..f5a498d7 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -180,6 +180,12 @@ void LocApiAdapter::reportNmea(const char* nmea, int length) locEngHandle.sendMsge(locEngHandle.owner, msg); } +void LocApiAdapter::reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength) +{ + loc_eng_msg_report_xtra_server *msg(new loc_eng_msg_report_xtra_server(locEngHandle.owner, url1, url2, url3, maxlength)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) { loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 95b91740..0cfdb356 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -132,7 +132,8 @@ public: void* svExt); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); - void reportAgpsStatus(AGpsExtStatus &agpsStatus); + void reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength); + void reportAgpsStatus(AGpsStatus &agpsStatus); void requestXtraData(); void requestTime(); void requestLocation(); @@ -171,6 +172,9 @@ public: inline virtual enum loc_api_adapter_err setXtraData(char* data, int length) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} + inline virtual enum loc_api_adapter_err + requestXtraServer() + {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} inline virtual enum loc_api_adapter_err atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h index 8e688c95..9ccbf2eb 100644 --- a/loc_api/libloc_api_50001/gps_extended.h +++ b/loc_api/libloc_api_50001/gps_extended.h @@ -49,10 +49,17 @@ typedef struct { 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. */ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index fb24249d..9d231626 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1610,6 +1610,14 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_REPORT_XTRA_SERVER: + if (NULL != loc_eng_data_p->xtra_module_data.report_xtra_server_cb) { + loc_eng_msg_report_xtra_server* xsMsg = (loc_eng_msg_report_xtra_server*)msg; + CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, xsMsg->server1); + loc_eng_data_p->xtra_module_data.report_xtra_server_cb(xsMsg->server1, xsMsg->server2, xsMsg->server3); + } + break; + case LOC_ENG_MSG_REQUEST_BIT: { AgpsStateMachine* stateMachine; @@ -1748,6 +1756,12 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_REQUEST_XTRA_SERVER: + { + loc_eng_data_p->client_handle->requestXtraServer(); + } + break; + case LOC_ENG_MSG_ATL_OPEN_SUCCESS: { loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 38940977..db69befa 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -250,6 +250,8 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, 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); + 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, diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 7b14cf11..9d9c1581 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -445,6 +445,33 @@ struct loc_eng_msg_report_nmea : public loc_eng_msg { } }; +struct loc_eng_msg_report_xtra_server : public loc_eng_msg { + char *server1; + char *server2; + char *server3; + inline loc_eng_msg_report_xtra_server(void *instance, + const char *url1, + const char *url2, + const char *url3, + const int maxlength) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_XTRA_SERVER), + server1(new char[maxlength+1]), server2(new char[maxlength+1]), server3(new char[maxlength+1]) + { + strlcpy(server1, url1, maxlength); + strlcpy(server2, url2, maxlength); + strlcpy(server3, url3, maxlength); + + LOC_LOGV("maxlength: %d\n server1: %s\n server2: %s\n server3: %s\n", + maxlength, server1, server2, server3); + } + inline ~loc_eng_msg_report_xtra_server() + { + delete[] server1; + delete[] server2; + delete[] server3; + } +}; + struct loc_eng_msg_request_bit : public loc_eng_msg { const loc_if_req_type_e_type ifType; const int ipv4Addr; @@ -716,6 +743,14 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { } }; +struct loc_eng_msg_request_xtra_server : public loc_eng_msg { + inline loc_eng_msg_request_xtra_server(void *instance) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_XTRA_SERVER) + { + + } +}; + struct loc_eng_msg_atl_open_success : public loc_eng_msg { const AGpsStatusValue agpsType; const int length; diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index bcdf2969..19a2ab6f 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -51,6 +51,7 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_SET_POSITION_MODE, LOC_ENG_MSG_SET_TIME, LOC_ENG_MSG_INJECT_XTRA_DATA, + LOC_ENG_MSG_REQUEST_XTRA_SERVER, LOC_ENG_MSG_INJECT_LOCATION, LOC_ENG_MSG_DELETE_AIDING_DATA, LOC_ENG_MSG_SET_APN, @@ -72,6 +73,7 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_REPORT_SV, LOC_ENG_MSG_REPORT_STATUS, LOC_ENG_MSG_REPORT_NMEA, + LOC_ENG_MSG_REPORT_XTRA_SERVER, LOC_ENG_MSG_REQUEST_BIT, LOC_ENG_MSG_RELEASE_BIT, LOC_ENG_MSG_REQUEST_ATL, diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index e971891e..44433733 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -62,6 +62,8 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, 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; } return ret_val; @@ -93,3 +95,31 @@ int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, return 0; } +/*=========================================================================== +FUNCTION loc_eng_xtra_request_server + +DESCRIPTION + Request the Xtra server url from the modem + +DEPENDENCIES + N/A + +RETURN VALUE + length of server string + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) +{ + loc_eng_msg_request_xtra_server *msg(new loc_eng_msg_request_xtra_server(&loc_eng_data)); + + if (NULL == msg) + return -1; + + loc_eng_msg_sender(&loc_eng_data, msg); + + return 0; + +} diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h index 614348de..175f497d 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -37,6 +37,7 @@ 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 diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 33bc36a0..68dd560d 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -1022,6 +1022,54 @@ enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( return LOC_API_ADAPTER_ERR_SUCCESS; } +/* Request the Xtra Server Url from the modem */ +enum loc_api_adapter_err LocApiV02Adapter :: requestXtraServer() +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + + locClientReqUnionType req_union; + qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02 request_xtra_server_ind; + + status = loc_sync_send_req( clientHandle, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + &request_xtra_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != request_xtra_server_ind.status || + false == request_xtra_server_ind.serverList_valid || + 0 == request_xtra_server_ind.serverList.serverList_len) + { + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + + if (request_xtra_server_ind.serverList.serverList_len == 1) + { + LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + "", + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else if (request_xtra_server_ind.serverList.serverList_len == 2) + { + LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + request_xtra_server_ind.serverList.serverList[1].serverUrl, + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else + { + LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + request_xtra_server_ind.serverList.serverList[1].serverUrl, + request_xtra_server_ind.serverList.serverList[2].serverUrl, + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h index 3eda7526..60d4a47e 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -138,6 +138,8 @@ public: 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); From 7af44a9436662d0d4f36bdeba2442fcd599259b5 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 11 Jun 2013 13:34:18 -0700 Subject: [PATCH 123/945] Timed Alarm service utility The utility launches a separate thread that holds a mutex for x milisecs and then calls a callback function to notify the caller about the time lapse Change-Id: If033eed71d28a8736c8393f6ff609ac59d8877d9 --- utils/Android.mk | 6 +- utils/loc_timer.c | 157 ++++++++++++++++++++++++++++++++++++++++++++++ utils/loc_timer.h | 54 ++++++++++++++++ 3 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 utils/loc_timer.c create mode 100644 utils/loc_timer.h diff --git a/utils/Android.mk b/utils/Android.mk index 7dc1799e..57f636f6 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -16,7 +16,8 @@ LOCAL_SRC_FILES += \ loc_cfg.cpp \ msg_q.c \ linked_list.c \ - loc_target.cpp + loc_target.cpp \ + loc_timer.c LOCAL_CFLAGS += \ -fno-short-enums \ @@ -34,7 +35,8 @@ LOCAL_COPY_HEADERS:= \ log_util.h \ linked_list.h \ msg_q.h \ - loc_target.h + loc_target.h \ + loc_timer.h LOCAL_MODULE := libgps.utils diff --git a/utils/loc_timer.c b/utils/loc_timer.c new file mode 100644 index 00000000..13f7786f --- /dev/null +++ b/utils/loc_timer.c @@ -0,0 +1,157 @@ +/* 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 +#include "loc_timer.h" +#include +#include + +#define MAX_DELAY_RETRIES 3 + +typedef struct { + loc_timer_callback callback_func; + void *user_data; + unsigned int time_msec; +}timer_data; + +static void *timer_thread(void *thread_data) +{ + int ret; + unsigned char retries=0; + struct timespec ts; + struct timeval tv; + timer_data t; + t.callback_func = ((timer_data *)thread_data)->callback_func; + t.user_data = ((timer_data *)thread_data)->user_data; + t.time_msec = ((timer_data *)thread_data)->time_msec; + pthread_cond_t timer_cond; + pthread_mutex_t timer_mutex; + + LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t.time_msec); + //Copied over all info into local variable. Do not need allocated struct + free(thread_data); + + if(pthread_cond_init(&timer_cond, NULL)) { + LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); + ret = -1; + goto err; + } + if(pthread_mutex_init(&timer_mutex, NULL)) { + LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); + ret = -1; + goto mutex_err; + } + while(retries < MAX_DELAY_RETRIES) { + gettimeofday(&tv, NULL); + clock_gettime(CLOCK_REALTIME, &ts); + if(t.time_msec >= 1000) { + ts.tv_sec += t.time_msec/1000; + t.time_msec = t.time_msec % 1000; + } + if(t.time_msec) + ts.tv_nsec += t.time_msec * 1000000; + if(ts.tv_nsec > 999999999) { + LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); + ts.tv_sec += 1; + ts.tv_nsec -= 1000000000; + } + LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n", + __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec); + LOC_LOGD("%s:%d]: Current time: %d sec; %d nsec\n", + __func__, __LINE__, (int)tv.tv_sec, (int)tv.tv_usec*1000); + pthread_mutex_lock(&(timer_mutex)); + ret = pthread_cond_timedwait(&timer_cond, &timer_mutex, &ts); + pthread_mutex_unlock(&(timer_mutex)); + if(ret != ETIMEDOUT) { + LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", + __func__, __LINE__,ret); + ret = -1; + retries++; + } + else { + ret = 0; + break; + } + } + + pthread_mutex_destroy(&timer_mutex); +mutex_err: + pthread_cond_destroy(&timer_cond); +err: + if(!ret) + t.callback_func(t.user_data, ret); + LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); + return NULL; +} + +int loc_timer_start(unsigned int msec, loc_timer_callback cb_func, + void* caller_data) +{ + int ret=0; + timer_data *t=NULL; + pthread_attr_t tattr; + pthread_t id; + LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); + if(cb_func == NULL || msec == 0) { + LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); + ret = -1; + goto err; + } + t = (timer_data *)calloc(1, sizeof(timer_data)); + if(t == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", + __func__, __LINE__); + ret = -1; + goto err; + } + + t->callback_func = cb_func; + t->user_data = caller_data; + t->time_msec = msec; + + pthread_attr_init(&tattr); + pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); + if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { + LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); + ret = -1; + goto attr_err; + } + else { + LOC_LOGD("%s:%d]: Created thread with id: %d\n", + __func__, __LINE__, (int)id); + } + +attr_err: + pthread_attr_destroy(&tattr); +err: + LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); + return ret; +} diff --git a/utils/loc_timer.h b/utils/loc_timer.h new file mode 100644 index 00000000..213da209 --- /dev/null +++ b/utils/loc_timer.h @@ -0,0 +1,54 @@ +/* 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. + * + */ + +#ifndef __LOC_DELAY_H__ +#define __LOC_DELAY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +#include +#include "log_util.h" + +/* + Return values: + Success = 0 + Failure = Non zero +*/ +typedef void(*loc_timer_callback)(void *user_data, int result); + +//int loc_timer_start(loc_timer_client_data *p_thread); +int loc_timer_start(unsigned int delay_msec, + loc_timer_callback, + void* user_data); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_DELAY_H__ From 6bc10c567a253008aa7078f2cd41ca776075c6b6 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 26 Mar 2013 15:52:00 -0700 Subject: [PATCH 124/945] Generate position report NMEAs only on final fix Position report NMEAs will be generated only if the position report is a final fix and not an intermediate fix. Blank NMEAs will be sent otherwise. CRs-fixed: 467575 Change-Id: I60e63faf3e4503f5a6ce93211d4017aa7695b78b --- loc_api/libloc_api_50001/loc_eng.cpp | 5 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 770 +++++++++++----------- loc_api/libloc_api_50001/loc_eng_nmea.h | 2 +- 3 files changed, 401 insertions(+), 376 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 21cee3e0..7413051f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1620,7 +1620,10 @@ static void loc_eng_deferred_action_thread(void* arg) if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) { - loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, rpMsg->locationExtended); + unsigned char generate_nmea = reported && (rpMsg->status != LOC_SESS_FAILURE); + loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, + rpMsg->locationExtended, + generate_nmea); } // Free the allocated memory for rawData diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 9f087ca5..c4be2ab8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -110,7 +110,9 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, - const UlpLocation &location, const GpsLocationExtended &locationExtended) + const UlpLocation &location, + const GpsLocationExtended &locationExtended, + unsigned char generate_nmea) { ENTRY_LOG(); @@ -128,46 +130,32 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; - // ------------------ - // ------$GPGSA------ - // ------------------ + if (generate_nmea) { + // ------------------ + // ------$GPGSA------ + // ------------------ - uint32_t svUsedCount = 0; - uint32_t svUsedList[32] = {0}; - uint32_t mask = loc_eng_data_p->sv_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->sv_used_mask = 0; + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + uint32_t mask = loc_eng_data_p->sv_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->sv_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]); + char fixType; + if (svUsedCount == 0) + fixType = '1'; // no fix + else if (svUsedCount <= 3) + fixType = '2'; // 2D fix else - length = snprintf(pMarker, lengthRemaining, ","); + fixType = '3'; // 3D fix + + length = snprintf(pMarker, lengthRemaining, "$GPGSA,A,%c,", fixType); if (length < 0 || length >= lengthRemaining) { @@ -176,378 +164,412 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, } 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, ",,"); - } + 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, ","); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } - // ------------------ - // ------$GPVTG------ - // ------------------ + 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, ",,"); + } - pMarker = sentence; - lengthRemaining = sizeof(sentence); + 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->client_handle->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,A," , + utcHours, utcMinutes, utcSeconds); + + 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 (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; - } + float magneticVariation = locationExtended.magneticDeviation; + char direction; + if (magneticVariation < 0.0) + { + direction = 'W'; + magneticVariation *= -1.0; + } + else + { + direction = 'E'; + } - 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->client_handle->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,A," , - utcHours, utcMinutes, utcSeconds); - - 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'; + length = snprintf(pMarker, lengthRemaining, "%.1lf,%c,", + magneticVariation, direction); } else { - latHemisphere = 'S'; - latitude *= -1.0; + length = snprintf(pMarker, lengthRemaining, ",,"); } - if (longitude < 0) + if (length < 0 || length >= lengthRemaining) { - lonHemisphere = 'W'; - longitude *= -1.0; + 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->client_handle->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," , + utcHours, utcMinutes, utcSeconds); + + 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 { - lonHemisphere = 'E'; + length = snprintf(pMarker, lengthRemaining,",,,,"); } - 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) + if (length < 0 || length >= lengthRemaining) { - direction = 'W'; - magneticVariation *= -1.0; + 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->client_handle->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 { - direction = 'E'; + length = snprintf(pMarker, lengthRemaining,",,"); } - 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->client_handle->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," , - utcHours, utcMinutes, utcSeconds); - - 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) + if (length < 0 || length >= lengthRemaining) { - latHemisphere = 'N'; + 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 { - latHemisphere = 'S'; - latitude *= -1.0; + length = snprintf(pMarker, lengthRemaining,",,,"); } - if (longitude < 0) - { - lonHemisphere = 'W'; - longitude *= -1.0; - } - else - { - lonHemisphere = 'E'; - } + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); - latMinutes = fmod(latitude * 60.0 , 60.0); - lonMinutes = fmod(longitude * 60.0 , 60.0); + } + //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); - 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,",,,,"); - } + 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); - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; + 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); - 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->client_handle->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); + 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); } - 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); - // clear the dop cache so they can't be used again loc_eng_data_p->pdop = 0; loc_eng_data_p->hdop = 0; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 69305937..40c6dbbd 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -37,6 +37,6 @@ 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 GpsSvStatus &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); +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 From c3f16206d77043f15dee31c6dec6a1d38fdb6ae2 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 18 Jun 2013 11:06:27 -0700 Subject: [PATCH 125/945] Return the correct value from loc_eng_init The function was returning an error code which was causing GPSLocationProvider to fail initialization CRs-fixed: 501318 Change-Id: Icec707c3b9edc60bd07914b130077f9a96c5e794 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 21cee3e0..17d2cbe6 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -290,11 +290,12 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, void (*loc_external_msg_sender) (void*, void*)) { - int ret_val =-1; + 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; } @@ -1931,13 +1932,14 @@ static void loc_eng_deferred_action_thread(void* arg) } else LOC_LOGE("Ulp Phone context request call back not initialized"); - } + } break; case LOC_ENG_MSG_LOC_INIT: { loc_eng_reinit(*loc_eng_data_p); } + break; default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); From 0f66892e50b944365f1c2c665e5754519496738c Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 25 Feb 2013 11:40:32 -0800 Subject: [PATCH 126/945] Add support for SUPL Emergency Services Introduced support for handling modem request to start an emergency call using QMI WDS profiles or fallback to an ATL request if the call does not succeed. Change-Id: I29b617687db0d3f26610bc74f8dc95940574f52d --- loc_api/Android.mk | 1 + loc_api/ds_api/Android.mk | 49 ++ loc_api/ds_api/ds_client.c | 704 +++++++++++++++++++++ loc_api/ds_api/ds_client.h | 142 +++++ loc_api/libloc_api_50001/LocApiAdapter.cpp | 27 + loc_api/libloc_api_50001/LocApiAdapter.h | 14 +- loc_api/libloc_api_50001/loc_eng.cpp | 101 ++- loc_api/libloc_api_50001/loc_eng.h | 2 + loc_api/libloc_api_50001/loc_eng_agps.cpp | 271 +++++++- loc_api/libloc_api_50001/loc_eng_agps.h | 117 +++- loc_api/libloc_api_50001/loc_eng_log.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_msg.h | 25 +- loc_api/libloc_api_50001/loc_eng_msg_id.h | 6 + loc_api/loc_api_v02/Android.mk | 6 +- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 186 ++++-- loc_api/loc_api_v02/LocApiV02Adapter.h | 9 + 16 files changed, 1576 insertions(+), 88 deletions(-) create mode 100644 loc_api/ds_api/Android.mk create mode 100644 loc_api/ds_api/ds_client.c create mode 100644 loc_api/ds_api/ds_client.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index dd7a8f31..5613c87d 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -27,6 +27,7 @@ endif ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ +GPS_DIR_LIST += $(LOCAL_PATH)/ds_api/ endif #is-board-platform-in-list GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ diff --git a/loc_api/ds_api/Android.mk b/loc_api/ds_api/Android.mk new file mode 100644 index 00000000..ca04f51d --- /dev/null +++ b/loc_api/ds_api/Android.mk @@ -0,0 +1,49 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libds_api + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libgps.utils \ + libdsi_netctrl \ + libqmiservices + + +LOCAL_SRC_FILES += \ + ds_client.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_COPY_HEADERS_TO:= ds_api/ + +LOCAL_COPY_HEADERS:= \ + ds_client.h + +LOCAL_LDFLAGS += -Wl,--export-dynamic + +## Includes +LOCAL_C_INCLUDES := \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/qmi-framework/inc \ + $(TARGET_OUT_HEADERS)/qmi/inc \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/data/inc + + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/loc_api/ds_api/ds_client.c b/loc_api/ds_api/ds_client.c new file mode 100644 index 00000000..2dcf0636 --- /dev/null +++ b/loc_api/ds_api/ds_client.c @@ -0,0 +1,704 @@ +/* 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. + */ + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_ds_client" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//Timeout to wait for wds service notification from qmi +#define DS_CLIENT_SERVICE_TIMEOUT (4000) +//Max timeout for the service to come up +#define DS_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) +//Timeout for the service to respond to sync msg +#define DS_CLIENT_SYNC_MSG_TIMEOUT (5000) +/*Request messages the WDS client can send to the WDS service*/ +typedef union +{ + /*Requests the service for a list of all profiles present*/ + wds_get_profile_list_req_msg_v01 *p_get_profile_list_req; + /*Requests the service for a profile's settings*/ + wds_get_profile_settings_req_msg_v01 *p_get_profile_settings_req; +}ds_client_req_union_type; + +/*Response indications that are sent by the WDS service*/ +typedef union +{ + wds_get_profile_list_resp_msg_v01 *p_get_profile_list_resp; + wds_get_profile_settings_resp_msg_v01 *p_get_profile_setting_resp; +}ds_client_resp_union_type; + +struct event_strings_s +{ + char * str; + dsi_net_evt_t evt; +}; + +struct event_strings_s event_string_tbl[DSI_EVT_MAX] = +{ + NAME_VAL(DSI_EVT_INVALID), + NAME_VAL(DSI_EVT_NET_IS_CONN), + NAME_VAL(DSI_EVT_NET_NO_NET), + NAME_VAL(DSI_EVT_PHYSLINK_DOWN_STATE), + NAME_VAL(DSI_EVT_PHYSLINK_UP_STATE), + NAME_VAL(DSI_EVT_NET_RECONFIGURED), +}; + +typedef struct +{ + ds_client_event_ind_cb_type event_cb; + void *caller_cookie; +}ds_caller_data; + +typedef struct { + //Global dsi handle + dsi_hndl_t dsi_net_handle; + //Handle to caller's data + ds_caller_data caller_data; +} ds_client_session_data; + +void net_ev_cb(dsi_hndl_t handle, void* user_data, + dsi_net_evt_t evt, dsi_evt_payload_t *payload_ptr) +{ + int i; + (void)handle; + (void)user_data; + (void)payload_ptr; + ds_caller_data *callback_data = (ds_caller_data *)user_data; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + if(evt > DSI_EVT_INVALID && evt < DSI_EVT_MAX) + { + for(i=0;ievent_cb(E_DS_CLIENT_DATA_CALL_CONNECTED, + callback_data->caller_cookie); + break; + } + case DSI_EVT_NET_NO_NET: + { + LOC_LOGD("%s:%d]: Emergency call stopped\n", __func__, __LINE__); + callback_data->event_cb(E_DS_CLIENT_DATA_CALL_DISCONNECTED, + callback_data->caller_cookie); + break; + } + default: + LOC_LOGD("%s:%d]: uninteresting event\n", __func__, __LINE__); + } + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); +} + +/*This function is called to obtain a handle to the QMI WDS service*/ +static ds_client_status_enum_type +ds_client_qmi_ctrl_point_init(qmi_client_type *p_wds_qmi_client) +{ + qmi_client_type wds_qmi_client, notifier = NULL; + ds_client_status_enum_type status = E_DS_CLIENT_SUCCESS; + qmi_service_info *p_service_info = NULL; + uint32_t num_services = 0, num_entries = 0; + qmi_client_error_type ret = QMI_NO_ERR; + unsigned char no_signal = 0; + qmi_client_os_params os_params; + int timeout = 0; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + //Get service object for QMI_WDS service + qmi_idl_service_object_type ds_client_service_object = + wds_get_service_object_v01(); + if(ds_client_service_object == NULL) { + LOC_LOGE("%s:%d]: wds_get_service_object_v01 failed\n" , + __func__, __LINE__); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + //get service addressing information + ret = qmi_client_get_service_list(ds_client_service_object, NULL, NULL, + &num_services); + LOC_LOGD("%s:%d]: qmi_client_get_service_list() first try ret %d, " + "num_services %d]\n", __func__, __LINE__, ret, num_services); + if(ret != QMI_NO_ERR) { + //Register for service notification + ret = qmi_client_notifier_init(ds_client_service_object, &os_params, ¬ifier); + if (ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + ret = qmi_client_get_service_list(ds_client_service_object, NULL, + NULL, &num_services); + if(ret != QMI_NO_ERR) { + QMI_CCI_OS_SIGNAL_WAIT(&os_params, DS_CLIENT_SERVICE_TIMEOUT); + no_signal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + if(!no_signal) + ret = qmi_client_get_service_list(ds_client_service_object, NULL, + NULL, &num_services); + } + timeout += DS_CLIENT_SERVICE_TIMEOUT; + LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned ret: %d," + "no_signal: %d, total timeout: %d\n", __func__, __LINE__, + ret, no_signal, timeout); + } while( (timeout < DS_CLIENT_SERVICE_TIMEOUT_TOTAL) && + no_signal && + (ret != QMI_NO_ERR) ); + } + + //Handle failure cases + if(num_services == 0 || ret != QMI_NO_ERR) { + if(!no_signal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up! Error: %d \n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + } + else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries" + "Error: %d \n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_TIMEOUT; + } + goto err; + } + + LOC_LOGD("%s:%d]: qmi_client_get_service_list succeeded\n", __func__, __LINE__); + + //Success + p_service_info = (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + if(p_service_info == NULL) { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + num_entries = num_services; + + //Populate service info + ret = qmi_client_get_service_list(ds_client_service_object, p_service_info, + &num_entries, &num_services); + if(ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed. ret: %d \n", + __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + //Initialize wds_qmi_client + LOC_LOGD("%s:%d]: Initializing WDS client with qmi_client_init\n", __func__, + __LINE__); + ret = qmi_client_init(&p_service_info[0], ds_client_service_object, + NULL, NULL, NULL, &wds_qmi_client); + if(ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_init Error. ret: %d\n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + LOC_LOGD("%s:%d]: WDS client initialized with qmi_client_init\n", __func__, + __LINE__); + + //Store WDS QMI client handle in the parameter passed in + *p_wds_qmi_client = wds_qmi_client; + + status = E_DS_CLIENT_SUCCESS; + LOC_LOGD("%s:%d]: init success\n", __func__, __LINE__); + + if(notifier) + qmi_client_release(notifier); + +err: + if(p_service_info) + free(p_service_info); + + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return status; +} + +/*This function reads the error code from within the response struct*/ +static ds_client_status_enum_type ds_client_convert_qmi_response( + uint32_t req_id, + ds_client_resp_union_type *resp_union) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + switch(req_id) + { + case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : + { + if(resp_union->p_get_profile_list_resp->resp.error != + QMI_ERR_NONE_V01) { + LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, + resp_union->p_get_profile_list_resp->resp.error); + } + else + ret = E_DS_CLIENT_SUCCESS; + } + break; + + case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : + { + if(resp_union->p_get_profile_setting_resp->resp.error != + QMI_ERR_NONE_V01) { + LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, + resp_union->p_get_profile_setting_resp->resp.error); + } + else + ret = E_DS_CLIENT_SUCCESS; + } + break; + + default: + LOC_LOGE("%s:%d]: Unknown request ID\n", __func__, __LINE__); + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + + +static ds_client_status_enum_type ds_client_send_qmi_sync_req( + qmi_client_type *ds_client_handle, + uint32_t req_id, + ds_client_resp_union_type *resp_union, + ds_client_req_union_type *req_union) +{ + uint32_t req_len = 0; + uint32_t resp_len = 0; + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + qmi_client_error_type qmi_ret = QMI_NO_ERR; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + switch(req_id) + { + case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : + { + req_len = sizeof(wds_get_profile_list_req_msg_v01); + resp_len = sizeof(wds_get_profile_list_resp_msg_v01); + LOC_LOGD("%s:%d]: req_id = GET_PROFILE_LIST_REQ\n", + __func__, __LINE__); + } + break; + + case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : + { + req_len = sizeof(wds_get_profile_settings_req_msg_v01); + resp_len = sizeof(wds_get_profile_settings_resp_msg_v01); + LOC_LOGD("%s:%d]: req_id = GET_PROFILE_SETTINGS_REQ\n", + __func__, __LINE__); + } + break; + + default: + LOC_LOGE("%s:%d]: Error unknown req_id=%d\n", __func__, __LINE__, + req_id); + ret = E_DS_CLIENT_FAILURE_INVALID_PARAMETER; + goto err; + } + + LOC_LOGD("%s:%d]: req_id=%d, len = %d; resp_len= %d\n", __func__, __LINE__, + req_id, req_len, resp_len); + //Send msg through QCCI + qmi_ret = qmi_client_send_msg_sync( + *ds_client_handle, + req_id, + (void *)req_union->p_get_profile_list_req, + req_len, + (void *)resp_union->p_get_profile_list_resp, + resp_len, + DS_CLIENT_SYNC_MSG_TIMEOUT); + LOC_LOGD("%s:%d]: qmi_client_send_msg_sync returned: %d", __func__, __LINE__, qmi_ret); + + if(qmi_ret != QMI_NO_ERR) { + ret = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + ret = ds_client_convert_qmi_response(req_id, resp_union); + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/*This function obtains the list of supported profiles*/ +static ds_client_status_enum_type ds_client_get_profile_list( + qmi_client_type *ds_client_handle, + ds_client_resp_union_type *profile_list_resp_msg, + wds_profile_type_enum_v01 profile_type) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_req_union_type req_union; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + req_union.p_get_profile_list_req = NULL; + req_union.p_get_profile_list_req = (wds_get_profile_list_req_msg_v01 *) + calloc(1, sizeof(wds_get_profile_list_req_msg_v01)); + if(req_union.p_get_profile_list_req == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "wds_get_profile_list_req_msg_v01\n", __func__, __LINE__); + goto err; + } + //Populate required members of the request structure + req_union.p_get_profile_list_req->profile_type_valid = 1; + req_union.p_get_profile_list_req->profile_type = profile_type; + ret = ds_client_send_qmi_sync_req(ds_client_handle, + QMI_WDS_GET_PROFILE_LIST_REQ_V01, + profile_list_resp_msg, &req_union); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + if(req_union.p_get_profile_list_req) + free(req_union.p_get_profile_list_req); + return ret; +} + +/*This function obtains settings for the profile specified by + the profile_identifier*/ +static ds_client_status_enum_type ds_client_get_profile_settings( + qmi_client_type *ds_client_handle, + ds_client_resp_union_type *profile_settings_resp_msg, + wds_profile_identifier_type_v01 *profile_identifier) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_req_union_type req_union; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + //Since it's a union containing a pointer to a structure, + //following entities have the same address + //- req_union + //- req_union.p_get_profile_settings_req + //- req_union.p_get_profile_settings_req->profile + //so we can very well assign req_union = profile_identifier + req_union.p_get_profile_settings_req = + (wds_get_profile_settings_req_msg_v01 *)profile_identifier; + ret = ds_client_send_qmi_sync_req(ds_client_handle, + QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01, + profile_settings_resp_msg, &req_union); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/* + Starts data call using the handle and the profile index +*/ +ds_client_status_enum_type +ds_client_start_call(dsClientHandleType client_handle, int profile_index) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + dsi_call_param_value_t param_info; + dsi_hndl_t dsi_handle; + ds_client_session_data *ds_global_data = (ds_client_session_data *)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); + goto err; + } + dsi_handle = ds_global_data->dsi_net_handle; + //Set profile index as call parameter + param_info.buf_val = NULL; + param_info.num_val = profile_index; + dsi_set_data_call_param(dsi_handle, + DSI_CALL_INFO_UMTS_PROFILE_IDX, + ¶m_info); + LOC_LOGD("%s:%d]: Starting emergency call with profile index %d\n", + __func__, __LINE__, param_info.num_val); + if(dsi_start_data_call(dsi_handle) == DSI_SUCCESS) { + LOC_LOGD("%s:%d]: Sent request to start data call\n", + __func__, __LINE__); + ret = E_DS_CLIENT_SUCCESS; + } + else { + LOC_LOGE("%s:%d]: Could not send req to start data call \n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; + +} + +/*Function to open an emergency call. Does the following things: + - Obtains a handle to the WDS service + - Obtains a list of profiles configured in the modem + - Queries each profile and obtains settings to check if emergency calls + are supported + - Returns the profile index that supports emergency calls + - Returns handle to dsi_netctrl*/ +ds_client_status_enum_type +ds_client_open_call(dsClientHandleType *client_handle, + ds_client_cb_data *callback, + void *caller_cookie, + int *profile_index) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + ds_client_resp_union_type profile_list_resp_msg; + ds_client_resp_union_type profile_settings_resp_msg; + wds_profile_identifier_type_v01 profile_identifier; + uint32_t i=0; + dsi_hndl_t dsi_handle; + ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; + unsigned char call_profile_index_found = 0; + uint32_t emergency_profile_index=0; + qmi_client_type wds_qmi_client; + + profile_list_resp_msg.p_get_profile_list_resp = NULL; + profile_settings_resp_msg.p_get_profile_setting_resp = NULL; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(callback == NULL || ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); + goto err; + } + + ret = ds_client_qmi_ctrl_point_init(&wds_qmi_client); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_qmi_ctrl_point_init failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + + //Allocate memory for the response msg to obtain a list of profiles + profile_list_resp_msg.p_get_profile_list_resp = (wds_get_profile_list_resp_msg_v01 *) + calloc(1, sizeof(wds_get_profile_list_resp_msg_v01)); + if(profile_list_resp_msg.p_get_profile_list_resp == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "p_get_profile_list_resp\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + LOC_LOGD("%s:%d]: Getting profile list\n", __func__, __LINE__); + ret = ds_client_get_profile_list(&wds_qmi_client, + &profile_list_resp_msg, + WDS_PROFILE_TYPE_3GPP_V01); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_get_profile_list failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + LOC_LOGD("%s:%d]: Got profile list; length = %d\n", __func__, __LINE__, + profile_list_resp_msg.p_get_profile_list_resp->profile_list_len); + + //Allocate memory for the response msg to obtain profile settings + //We allocate memory for only one response msg and keep re-using it + profile_settings_resp_msg.p_get_profile_setting_resp = + (wds_get_profile_settings_resp_msg_v01 *) + calloc(1, sizeof(wds_get_profile_settings_resp_msg_v01)); + if(profile_settings_resp_msg.p_get_profile_setting_resp == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "p_get_profile_setting_resp\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + //Loop over the list of profiles to find a profile that supports + //emergency calls + for(i=0; i < profile_list_resp_msg.p_get_profile_list_resp->profile_list_len; i++) { + /*QMI_WDS_GET_PROFILE_SETTINGS_REQ requires an input data + structure that is of type wds_profile_identifier_type_v01 + We have to fill that structure for each profile from the + info obtained from the profile list*/ + //copy profile type + profile_identifier.profile_type = + profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_type; + //copy profile index + profile_identifier.profile_index = + profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_index; + + ret = ds_client_get_profile_settings(&wds_qmi_client, + &profile_settings_resp_msg, + &profile_identifier); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_get_profile_settings failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + LOC_LOGD("%s:%d]: Got profile setting for profile %d\n", __func__, __LINE__, i); + LOC_LOGD("%s:%d]: Profile name: %s\n", __func__, __LINE__, + profile_settings_resp_msg.p_get_profile_setting_resp->profile_name); + + if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls_valid) { + if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls) { + LOC_LOGD("%s:%d]: Found emergency profile in profile %d" + , __func__, __LINE__, i); + call_profile_index_found = 1; + emergency_profile_index = profile_identifier.profile_index; + break; + } + else + LOC_LOGE("%s:%d]: Emergency profile valid but not supported in profile: %d " + , __func__, __LINE__, i); + } + //Since this struct is loaded with settings for the next profile, + //it is important to clear out the memory to avoid values/flags + //from being carried over + memset((void *)profile_settings_resp_msg.p_get_profile_setting_resp, + 0, sizeof(wds_get_profile_settings_resp_msg_v01)); + } + + //Release qmi client handle + if(qmi_client_release(wds_qmi_client) != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: Could not release qmi client handle\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + } + + if(call_profile_index_found) { + *profile_index = emergency_profile_index; + *ds_global_data = (ds_client_session_data *)calloc(1, sizeof(ds_client_session_data)); + if(*ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for ds_global_data. Failing\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + (*ds_global_data)->caller_data.event_cb = callback->event_cb; + (*ds_global_data)->caller_data.caller_cookie = caller_cookie; + dsi_handle = dsi_get_data_srvc_hndl(net_ev_cb, &(*ds_global_data)->caller_data); + if(dsi_handle == NULL) { + LOC_LOGE("%s:%d]: Could not get data handle. Retry Later\n", + __func__, __LINE__); + ret = E_DS_CLIENT_RETRY_LATER; + goto err; + } + else + (*ds_global_data)->dsi_net_handle = dsi_handle; + } + else { + LOC_LOGE("%s:%d]: Could not find a profile that supports emergency calls", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + } +err: + if(profile_list_resp_msg.p_get_profile_list_resp) + free(profile_list_resp_msg.p_get_profile_list_resp); + if(profile_settings_resp_msg.p_get_profile_setting_resp) + free(profile_settings_resp_msg.p_get_profile_setting_resp); + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_session_data *p_ds_global_data = (ds_client_session_data *)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + if(client_handle == NULL) { + LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + + if(dsi_stop_data_call(p_ds_global_data->dsi_net_handle) == DSI_SUCCESS) { + LOC_LOGD("%s:%d]: Sent request to stop data call\n", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Could not send request to stop data call\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/* + Stops data call associated with the data handle +*/ +void ds_client_close_call(dsClientHandleType *client_handle) +{ + ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(client_handle == NULL || *client_handle == NULL) { + LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); + goto err; + } + dsi_rel_data_srvc_hndl((*ds_global_data)->dsi_net_handle); + (*ds_global_data)->dsi_net_handle = NULL; + free(*ds_global_data); + *ds_global_data = NULL; + LOC_LOGD("%s:%d]: Released Data handle\n", __func__, __LINE__); +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return; +} + +int ds_client_init() +{ + int ret = 0; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(DSI_SUCCESS != dsi_init(DSI_MODE_GENERAL)) + { + LOC_LOGE("%s:%d]:dsi_init failed\n", __func__, __LINE__); + ret = -1; + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} diff --git a/loc_api/ds_api/ds_client.h b/loc_api/ds_api/ds_client.h new file mode 100644 index 00000000..044f96a3 --- /dev/null +++ b/loc_api/ds_api/ds_client.h @@ -0,0 +1,142 @@ +/* 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. + */ + +#ifndef _DS_CLIENT_H_ +#define _DS_CLIENT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* dsClientHandleType; + +typedef enum +{ + E_DS_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + E_DS_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + E_DS_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + E_DS_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + E_DS_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + E_DS_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + E_DS_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + E_DS_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + E_DS_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + E_DS_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + E_DS_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + E_DS_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + E_DS_CLIENT_FAILURE_NOT_INITIALIZED = 12, + /**< Failed because the service has not been initialized. */ + + E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13, + /**< Failed because not rnough memory to do the operation.*/ + + E_DS_CLIENT_SERVICE_ALREADY_STARTED = 14, + /*Service is already started*/ + + E_DS_CLIENT_DATA_CALL_CONNECTED = 15, + + E_DS_CLIENT_DATA_CALL_DISCONNECTED = 16, + + E_DS_CLIENT_RETRY_LATER = 17 +}ds_client_status_enum_type; + +typedef enum { + DATA_CALL_NONE = 0, + DATA_CALL_OPEN, + DATA_CALL_CLOSE +}data_call_request_enum_type; + +typedef void (*ds_client_event_ind_cb_type)(ds_client_status_enum_type result, + void* loc_adapter_cookie); +typedef struct { + ds_client_event_ind_cb_type event_cb; +}ds_client_cb_data; + +/* + This function is to be called as a first step by each process that + needs to use data services. This call internally calls dsi_init() + and prepares the module for making data calls. + Needs to be called once for every process +*/ +int ds_client_init(); + +/* + Obtains a handle to the dsi_netctrl layer and looks up the profile + to make the call. As of now. It only searches for profiles that + support emergency calls + */ +ds_client_status_enum_type ds_client_open_call(dsClientHandleType *client_handle, + ds_client_cb_data *callback, + void *loc_adapter_cookie, + int *profile_index); + +/* + Starts a data call using the profile number provided + */ +ds_client_status_enum_type ds_client_start_call(dsClientHandleType client_handle, + int profile_index); + +/* + Stops a data call associated with the handle +*/ +ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle); + +/* + Releases the handle used for making data calls +*/ +void ds_client_close_call(dsClientHandleType *client_handle); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp index 8e5b1ee1..8d84b0d3 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -186,6 +186,18 @@ void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) locEngHandle.sendMsge(locEngHandle.owner, msg); } +void LocApiAdapter::requestSuplES(int connHandle) +{ + loc_eng_msg_request_supl_es *msg(new loc_eng_msg_request_supl_es(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseDataHandle(void) +{ + loc_eng_msg_close_data_call *msg(new loc_eng_msg_close_data_call(locEngHandle.owner)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + void LocApiAdapter::releaseATL(int connHandle) { loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); @@ -234,3 +246,18 @@ void LocApiAdapter::handleEngineUpEvent() loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); locEngHandle.sendMsge(locEngHandle.owner, msg); } + +void LocApiAdapter::reportDataCallOpened() +{ + loc_eng_msg_atl_open_success *msg(new loc_eng_msg_atl_open_success(locEngHandle.owner, + AGPS_TYPE_INVALID, + NULL, 0, 0)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportDataCallClosed() +{ + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(locEngHandle.owner, + AGPS_TYPE_INVALID)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index 65fac91a..f0d4215b 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -141,7 +141,10 @@ public: void requestNiNotify(GpsNiNotification ¬ify, const void* data); void handleEngineDownEvent(); void handleEngineUpEvent(); - + void requestSuplES(int connHandle); + void releaseDataHandle(void); + void reportDataCallOpened(void); + void reportDataCallClosed(void); // All below functions are to be defined by adapter specific modules: // RPC, QMI, etc. The default implementation is empty. inline virtual enum loc_api_adapter_err @@ -230,6 +233,15 @@ public: inline bool isInSession() { return navigating; } inline virtual void setInSession(bool inSession) { navigating = inSession; } + inline virtual int openAndStartDataCall() + {LOC_LOGW("%s: default implementation invoked", __func__); return -1;} + inline virtual void stopDataCall() + {LOC_LOGW("%s: default implementation invoked", __func__);} + inline virtual void closeDataCall() + {LOC_LOGW("%s: default implementation invoked", __func__);} + inline virtual int initDataServiceClient() + {LOC_LOGW("%s: default implementation invoked", __func__); return -1;} + }; extern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 319b4de9..0422f505 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -60,7 +60,6 @@ #include #include #include - #include "log_util.h" #include "loc_eng_log.h" @@ -810,6 +809,38 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa EXIT_LOG(%s, VOID_RET); } +/* + 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; + LocApiAdapter *locAdapter = (LocApiAdapter *)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 @@ -876,17 +907,27 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac } loc_eng_data.agps_status_cb = callbacks->status_cb; - loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, false); #ifdef FEATURE_IPV6 - loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WWAN_ANY, false); - loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb, + loc_eng_data.wifi_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); #endif + if(!loc_eng_data.client_handle->initDataServiceClient()) { + LOC_LOGD("%s:%d]: Creating new ds state machine\n", __func__, __LINE__); + loc_eng_data.ds_nif = new DSStateMachine(servicerTypeExt, + (void *)dataCallCb, + loc_eng_data.client_handle); + LOC_LOGD("%s:%d]: Created new ds state machine\n", __func__, __LINE__); + } loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); @@ -1741,14 +1782,27 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_data_p->client_handle, false); // attempt to unsubscribe from agnss_nif first - if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + if (loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { #ifdef FEATURE_IPV6 + LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", __func__, __LINE__); + } + else { ATLSubscriber s2(arlMsg->handle, loc_eng_data_p->internet_nif, loc_eng_data_p->client_handle, false); // if unsuccessful, try internet_nif - loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2); + if(loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { + LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", __func__, __LINE__); + } + else { + DSSubscriber s3(loc_eng_data_p->ds_nif, + arlMsg->handle); + LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", + __func__, __LINE__, arlMsg->handle); + loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3); + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + } #endif } } @@ -1827,16 +1881,25 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; AgpsStateMachine* stateMachine; #ifdef FEATURE_IPV6 + LOC_LOGD("%s:%d]: AGPS_TYPE: %d\n", __func__, __LINE__, (int)aosMsg->agpsType); switch (aosMsg->agpsType) { case AGPS_TYPE_WIFI: { + LOC_LOGD("%s:%d]: AGPS Type wifi\n", __func__, __LINE__); stateMachine = loc_eng_data_p->wifi_nif; break; } case AGPS_TYPE_SUPL: { + LOC_LOGD("%s:%d]: AGPS Type supl\n", __func__, __LINE__); stateMachine = loc_eng_data_p->agnss_nif; break; } + case AGPS_TYPE_INVALID: { + stateMachine = loc_eng_data_p->ds_nif; + LOC_LOGD("%s:%d]: AGPS Type invalid\n", __func__, __LINE__); + } + break; default: { + LOC_LOGD("%s:%d]: AGPS Type default internet\n", __func__, __LINE__); stateMachine = loc_eng_data_p->internet_nif; } } @@ -1864,6 +1927,10 @@ static void loc_eng_deferred_action_thread(void* arg) stateMachine = loc_eng_data_p->agnss_nif; break; } + case AGPS_TYPE_INVALID: { + stateMachine = loc_eng_data_p->ds_nif; + break; + } default: { stateMachine = loc_eng_data_p->internet_nif; } @@ -1928,7 +1995,7 @@ static void loc_eng_deferred_action_thread(void* arg) { loc_eng_msg_request_phone_context *contextReqMsg = (loc_eng_msg_request_phone_context*)msg; LOC_LOGD("Received phone context request from ULP.context_type 0x%x,request_type 0x%x ", - contextReqMsg->contextRequest.context_type,contextReqMsg->contextRequest.request_type) + contextReqMsg->contextRequest.context_type,contextReqMsg->contextRequest.request_type); if(loc_eng_data_p->ulp_phone_context_req_cb != NULL) { loc_eng_data_p->ulp_phone_context_req_cb((UlpPhoneContextRequest*)&(contextReqMsg->contextRequest)); @@ -1944,6 +2011,25 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_REQUEST_SUPL_ES: + { + loc_eng_msg_request_supl_es *reqMsg = + (loc_eng_msg_request_supl_es *)msg; + AgpsStateMachine *stateMachine = loc_eng_data_p->ds_nif; + DSSubscriber subscriber(stateMachine, reqMsg->handle); + LOC_LOGD("%s:%d]: Starting data call\n", __func__, __LINE__); + stateMachine->subscribeRsrc((Subscriber *)&subscriber); + } + break; + + case LOC_ENG_MSG_CLOSE_DATA_CALL: + { + loc_eng_data_p->client_handle->closeDataCall(); + LOC_LOGD("%s:%d]: Request to close data call\n", + __func__, __LINE__); + } + break; + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; @@ -2273,4 +2359,3 @@ int loc_eng_read_config(void) EXIT_LOG(%d, 0); return 0; } - diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index d61cb12b..04d6714b 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -121,6 +121,8 @@ typedef struct AgpsStateMachine* agnss_nif; AgpsStateMachine* internet_nif; AgpsStateMachine* wifi_nif; + //State machine for Data Services + AgpsStateMachine* ds_nif; // GPS engine status GpsStatusValue engine_status; diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 5bdae3d7..1d5a59bb 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -35,6 +35,7 @@ #include #include #include +#include //====================================================================== // C callbacks @@ -84,8 +85,8 @@ static bool notifySubscriber(void* fromCaller, void* fromList) 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 //====================================================================== @@ -227,7 +228,29 @@ bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification) return notify; } #endif - +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 //====================================================================== @@ -249,13 +272,14 @@ public: 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;; + AgpsState* nextState = this; switch (event) { case RSRC_SUBSCRIBE: @@ -263,13 +287,16 @@ AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data) // no notification until we get RSRC_GRANTED // but we need to add subscriber to the list mStateMachine->addSubscriber((Subscriber*)data); - // move the state to PENDING - nextState = mPendingState; - // request from connecivity service for NIF - mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + //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; + break; case RSRC_UNSUBSCRIBE: { @@ -313,6 +340,7 @@ public: AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) { AgpsState* nextState = this;; + LOC_LOGD("AgpsPendingState::onRsrcEvent; event:%d\n", (int)event); switch (event) { case RSRC_SUBSCRIBE: @@ -351,7 +379,7 @@ AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); } } - break; + break; case RSRC_GRANTED: { @@ -408,6 +436,7 @@ public: AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) { AgpsState* nextState = this; + LOC_LOGD("AgpsAcquiredState::onRsrcEvent; event:%d\n", (int)event); switch (event) { case RSRC_SUBSCRIBE: @@ -441,7 +470,8 @@ AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) // tell connecivity service we can release NIF mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { + } + else if (!mStateMachine->hasActiveSubscribers()) { // only inactive subscribers, move to RELEASING state nextState = mReleasingState; @@ -500,7 +530,9 @@ public: AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) { AgpsState* nextState = this;; - switch (event) + LOC_LOGD("AgpsReleasingState::onRsrcEvent; event:%d\n", (int)event); + + switch (event) { case RSRC_SUBSCRIBE: { @@ -541,7 +573,7 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) // by setting false, we keep subscribers on the linked list mStateMachine->notifySubscribers(notification); - if (mStateMachine->hasSubscribers()) { + if (mStateMachine->hasActiveSubscribers()) { nextState = mPendingState; // request from connecivity service for NIF mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); @@ -561,20 +593,58 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) 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(void (*servicer)(AGpsStatus* status), +AgpsStateMachine::AgpsStateMachine(servicerType servType, + void *cb_func, AGpsType type, bool enforceSingleSubscriber) : - mServicer(servicer), mType(type), - mStatePtr(new AgpsReleasedState(this)), + mStatePtr(new AgpsReleasedState(this)),mType(type), mAPN(NULL), mAPNLen(0), - mEnforceSingleSubscriber(enforceSingleSubscriber) + mEnforceSingleSubscriber(enforceSingleSubscriber), + mServicer(Servicer :: getServicer(servType, (void *)cb_func)) { linked_list_init(&mSubscribers); @@ -615,6 +685,7 @@ AgpsStateMachine::~AgpsStateMachine() delete releasedState; delete pendindState; delete releasingState; + delete mServicer; linked_list_destroy(&mSubscribers); if (NULL != mAPN) { @@ -669,6 +740,7 @@ void AgpsStateMachine::notifySubscribers(Notification& notification) const // 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 @@ -690,7 +762,7 @@ void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const } } -void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const { Subscriber* s = NULL; Notification notification(Notification::BROADCAST_ACTIVE); @@ -722,8 +794,9 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const #endif CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); - (*mServicer)(&nifRequest); + mServicer->requestRsrc((void *)&nifRequest); } + return 0; } void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) @@ -758,3 +831,163 @@ bool AgpsStateMachine::hasActiveSubscribers() const 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, + LocApiAdapter* 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: + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + break; + case RSRC_RELEASED: + ((LocApiAdapter*)mLocAdapter)->releaseDataHandle(); + break; + case RSRC_DENIED: + ((DSStateMachine *)this)->mRetries = 0; + mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); + break; + case RSRC_GRANTED: + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + NULL, + AGPS_APN_BEARER_INVALID, + AGPS_TYPE_INVALID); + break; + default: + LOC_LOGW("DSStateMachine :: informStatus - unknown status"); + } + return; +} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 22160c36..4fad021e 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -38,6 +38,7 @@ #include #include #include "loc_eng_msg.h" +#include // forward declaration class AgpsStateMachine; @@ -53,6 +54,18 @@ typedef enum { RSRC_STATUS_MAX } AgpsRsrcStatus; +typedef enum { + servicerTypeNoCbParam, + servicerTypeAgps, + servicerTypeExt +}servicerType; + +//DS Callback struct +typedef struct { + LocApiAdapter *mAdapter; + AGpsStatusValue action; +}dsCbData; + // information bundle for subscribers struct Notification { // goes to every subscriber @@ -101,7 +114,7 @@ class AgpsState { // 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; @@ -129,21 +142,56 @@ public: 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; - - // handle to whoever provides the service - void (* const mServicer)(AGpsStatus* status); - // NIF type: AGNSS or INTERNET. - const AGpsType mType; // pointer to the current state. AgpsState* mStatePtr; - // a linked list of subscribers. - void* mSubscribers; +private: + // NIF type: AGNSS or INTERNET. + const AGpsType mType; // apn to the NIF. Each state machine tracks // resource state of a particular NIF. For each // NIF, there is also an active APN. @@ -158,7 +206,8 @@ class AgpsStateMachine { bool mEnforceSingleSubscriber; public: - AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type, bool enforceSingleSubscriber); + AgpsStateMachine(servicerType servType, void *cb_func, + AGpsType type, bool enforceSingleSubscriber); virtual ~AgpsStateMachine(); // self explanatory methods below @@ -179,11 +228,15 @@ public: // add a subscriber in the linked list, if not already there. void addSubscriber(Subscriber* subscriber) const; - void onRsrcEvent(AgpsRsrcStatus event); + virtual void onRsrcEvent(AgpsRsrcStatus event); // put the data together and send the FW - void sendRsrcRequest(AGpsStatusValue action) const; + 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); } @@ -194,6 +247,24 @@ public: // 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; + LocApiAdapter* mLocAdapter; + unsigned char mRetries; +public: + DSStateMachine(servicerType type, + void *cb_func, + LocApiAdapter* 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 @@ -252,7 +323,7 @@ struct BITSubscriber : public Subscriber { } virtual bool equals(const Subscriber *s) const; - + inline virtual ~BITSubscriber(){} private: char ipv6Addr[16]; }; @@ -277,6 +348,7 @@ struct ATLSubscriber : public Subscriber { return new ATLSubscriber(ID, mStateMachine, mLocAdapter, mBackwardCompatibleMode); } + inline virtual ~ATLSubscriber(){} }; #ifdef FEATURE_IPV6 @@ -325,7 +397,28 @@ struct WIFISubscriber : public Subscriber { { return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId); } + inline virtual ~WIFISubscriber(){} }; #endif +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) {} + 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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index ce1bcdf5..9b4a21b9 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -108,7 +108,9 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ), - NAME_VAL( LOC_ENG_MSG_LOC_INIT ) + NAME_VAL( LOC_ENG_MSG_LOC_INIT ), + NAME_VAL( LOC_ENG_MSG_REQUEST_SUPL_ES ), + NAME_VAL( LOC_ENG_MSG_CLOSE_DATA_CALL) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index df7cc092..116f551c 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -597,6 +597,23 @@ struct loc_eng_msg_request_atl : public loc_eng_msg { } }; +struct loc_eng_msg_request_supl_es : public loc_eng_msg { + const int handle; + inline loc_eng_msg_request_supl_es(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_SUPL_ES), + handle(hndl) + { + LOC_LOGV("handle: %d\n", handle); + } +}; + +struct loc_eng_msg_close_data_call: public loc_eng_msg { + inline loc_eng_msg_close_data_call(void *instance) : + loc_eng_msg(instance, LOC_ENG_MSG_CLOSE_DATA_CALL) + { + LOC_LOGV("%s:%d]Close data call: ", __func__, __LINE__); + } +}; struct loc_eng_msg_release_atl : public loc_eng_msg { const int handle; inline loc_eng_msg_release_atl(void* instance, int hndl) : @@ -722,12 +739,12 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { #ifdef FEATURE_IPV6 struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const AGpsStatusValue agpsType; + const AGpsType agpsType; const int length; char* const apn; const AGpsBearerType bearerType; inline loc_eng_msg_atl_open_success(void* instance, - AGpsStatusValue atype, + AGpsType atype, const char* name, int len, AGpsBearerType btype) : @@ -794,9 +811,9 @@ struct loc_eng_msg_atl_open_failed : public loc_eng_msg { #ifdef FEATURE_IPV6 struct loc_eng_msg_atl_closed : public loc_eng_msg { - const AGpsStatusValue agpsType; + const AGpsType agpsType; inline loc_eng_msg_atl_closed(void* instance, - AGpsStatusValue atype) : + AGpsType atype) : loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), agpsType(atype) { diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index 7b0aee05..fb3dfd32 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -134,6 +134,12 @@ enum loc_eng_msg_ids_t { //Message is sent by LOC to do LOC INIT LOC_ENG_MSG_LOC_INIT, + + /*Message is sent by modem to request emergency call setup*/ + LOC_ENG_MSG_REQUEST_SUPL_ES, + + /*Ask the DS client to close the data call by releasing the handle*/ + LOC_ENG_MSG_CLOSE_DATA_CALL, }; #ifdef __cplusplus diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk index 8617f3cb..1835dc58 100644 --- a/loc_api/loc_api_v02/Android.mk +++ b/loc_api/loc_api_v02/Android.mk @@ -15,7 +15,8 @@ LOCAL_SHARED_LIBRARIES := \ libqmi_csi \ libqmi_common_so \ libloc_adapter \ - libgps.utils + libgps.utils \ + libds_api LOCAL_SRC_FILES += \ LocApiV02Adapter.cpp \ @@ -41,7 +42,8 @@ LOCAL_C_INCLUDES := \ $(TARGET_OUT_HEADERS)/libloc_eng \ $(TARGET_OUT_HEADERS)/qmi-framework/inc \ $(TARGET_OUT_HEADERS)/qmi/inc \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/ds_api LOCAL_PRELINK_MODULE := false diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index d7276e95..16532e89 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -45,7 +45,6 @@ #include "LocApiAdapter.h" #include "loc_util_log.h" - /* Default session id ; TBD needs incrementing for each */ #define LOC_API_V02_DEF_SESSION_ID (1) @@ -160,6 +159,7 @@ locClientCallbacksType globalCallbacks = /* Constructor for LocApiV02Adapter */ LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): + dsClientHandle(NULL), LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), eventMask(convertMask(locEng.eventMask)) { @@ -1059,28 +1059,36 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( { conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); + if(apn != NULL) + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); #ifdef FEATURE_IPV6 switch(bear) { - case AGPS_APN_BEARER_IPV4: + case AGPS_APN_BEARER_IPV4: conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + conn_status_req.apnProfile_valid = 1; break; - case AGPS_APN_BEARER_IPV6: + case AGPS_APN_BEARER_IPV6: conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + conn_status_req.apnProfile_valid = 1; break; - case AGPS_APN_BEARER_IPV4V6: + case AGPS_APN_BEARER_IPV4V6: conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + conn_status_req.apnProfile_valid = 1; break; - default: + case AGPS_APN_BEARER_INVALID: + conn_status_req.apnProfile_valid = 0; + break; + + default: LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); return LOC_API_ADAPTER_ERR_INVALID_HANDLE; } @@ -1089,7 +1097,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; #endif - conn_status_req.apnProfile_valid = 1; } else { @@ -1523,7 +1530,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: setAGLONASSProtocol(unsigned long a return LOC_API_ADAPTER_ERR_SUCCESS; } - /* Convert event mask from loc eng to loc_api_v02 format */ locClientEventMaskType LocApiV02Adapter :: convertMask( LOC_API_ADAPTER_EVENT_MASK_T mask) @@ -1908,39 +1914,42 @@ void LocApiV02Adapter :: reportNmea ( /* convert and report an ATL request to loc engine */ void LocApiV02Adapter :: reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) { - uint32_t connHandle = server_request_ptr->connHandle; - // service ATL open request; copy the WWAN type - if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) - { - AGpsType agpsType; -#ifdef FEATURE_IPV6 - switch(server_request_ptr->wwanType) + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) { - case eQMI_LOC_WWAN_TYPE_INTERNET_V02: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - - case eQMI_LOC_WWAN_TYPE_AGNSS_V02: - agpsType = AGPS_TYPE_SUPL; - break; - - default: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - } + AGpsType agpsType; +#ifdef FEATURE_IPV6 + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + LocApiAdapter::requestATL(connHandle, agpsType); + break; + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + LocApiAdapter::requestATL(connHandle, agpsType); + break; + case eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02: + LocApiAdapter::requestSuplES(connHandle); + break; + default: + agpsType = AGPS_TYPE_WWAN_ANY; + LocApiAdapter::requestATL(connHandle, agpsType); + break; + } #else - agpsType = AGPS_TYPE_SUPL; + agpsType = AGPS_TYPE_SUPL; + LocApiAdapter::requestATL(connHandle, agpsType); #endif - LocApiAdapter::requestATL(connHandle, agpsType); - } - - // service the ATL close request - else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) - { - LocApiAdapter::releaseATL(connHandle); - } + } + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + LocApiAdapter::releaseATL(connHandle); + } } /* conver the NI report to loc eng format and send t loc engine */ @@ -2255,3 +2264,98 @@ LocApiAdapter* getLocApiAdapter(LocEng &locEng) { return(new LocApiV02Adapter(locEng)); } + +static void ds_client_global_event_cb(ds_client_status_enum_type result, + void *loc_adapter_cookie) +{ + LocApiV02Adapter *locApiV02AdapterInstance = + (LocApiV02Adapter *)loc_adapter_cookie; + locApiV02AdapterInstance->ds_client_event_cb(result); + return; +} + +void LocApiV02Adapter::ds_client_event_cb(ds_client_status_enum_type result) +{ + if(result == E_DS_CLIENT_DATA_CALL_CONNECTED) { + LOC_LOGD("%s:%d]: Emergency call is up", __func__, __LINE__); + LocApiAdapter::reportDataCallOpened(); + } + else if(result == E_DS_CLIENT_DATA_CALL_DISCONNECTED) { + LOC_LOGE("%s:%d]: Emergency call is stopped", __func__, __LINE__); + LocApiAdapter::reportDataCallClosed(); + } + return; +} + +ds_client_cb_data ds_client_cb{ + ds_client_global_event_cb +}; + +int LocApiV02Adapter :: openAndStartDataCall() +{ + enum loc_api_adapter_err ret; + int profile_index; + ds_client_status_enum_type result = ds_client_open_call(&dsClientHandle, + &ds_client_cb, + (void *)this, + &profile_index); + if(result == E_DS_CLIENT_SUCCESS) { + result = ds_client_start_call(dsClientHandle, profile_index); + + if(result == E_DS_CLIENT_SUCCESS) { + LOC_LOGD("%s:%d]: Request to start Emergency call sent\n", + __func__, __LINE__); + ret = LOC_API_ADAPTER_ERR_SUCCESS; + } + else { + LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. ret = %d", + __func__, __LINE__, (int)ret); + ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; + } + } + else if(result == E_DS_CLIENT_RETRY_LATER) { + LOC_LOGE("%s:%d]: Could not start emergency call. Retry after delay\n", + __func__, __LINE__); + ret = LOC_API_ADAPTER_ERR_ENGINE_BUSY; + } + else { + LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. ret = %d", + __func__, __LINE__, (int)ret); + ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; + } + + return (int)ret; +} + +void LocApiV02Adapter :: stopDataCall() +{ + ds_client_status_enum_type ret = + ds_client_stop_call(dsClientHandle); + if (ret == E_DS_CLIENT_SUCCESS) { + LOC_LOGD("%s:%d]: Request to Close SUPL ES call sent\n", __func__, __LINE__); + } + else { + if (ret == E_DS_CLIENT_FAILURE_INVALID_HANDLE) { + LOC_LOGE("%s:%d]: Conn handle not found for SUPL ES", + __func__, __LINE__); + } + LOC_LOGE("%s:%d]: Could not close SUPL ES call. Ret: %d\n" + ,__func__, __LINE__, ret); + } + return; +} + +void LocApiV02Adapter :: closeDataCall() +{ + ds_client_close_call(&dsClientHandle); + LOC_LOGD("%s:%d]: Release data client handle\n", __func__, __LINE__); + return; +} + +int LocApiV02Adapter :: initDataServiceClient() +{ + int ret=0; + ret = ds_client_init(); + LOC_LOGD("%s:%d]: ret = %d\n", __func__, __LINE__,ret); + return ret; +} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h index 10ea4069..df5ab527 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ b/loc_api/loc_api_v02/LocApiV02Adapter.h @@ -33,6 +33,7 @@ #include "loc_api_v02_client.h" #include #include +#include "ds_client.h" /* This class derives from the LocApiAdapter class. The members of this class are responsible for converting @@ -40,6 +41,8 @@ This class also implements some of the virtual functions that handle the requests from loc engine. */ class LocApiV02Adapter : public LocApiAdapter { + /*ds client handle*/ + dsClientHandleType dsClientHandle; /* loc api v02 handle*/ locClientHandleType clientHandle; @@ -110,6 +113,12 @@ public: void errorCb(locClientHandleType handle, locClientErrorEnumType errorId); + void ds_client_event_cb(ds_client_status_enum_type result); + int openAndStartDataCall(); + void stopDataCall(); + void closeDataCall(); + int initDataServiceClient(); + virtual enum loc_api_adapter_err reinit(); virtual enum loc_api_adapter_err startFix(); From 3a0c1dc804e571a959a89cbf57c57845020fc151 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 26 Jun 2013 17:30:48 -0700 Subject: [PATCH 127/945] Redefine struct returning error strings The struct was not defined in the NAME_VAL() format and hence was returning garbage characters in place of error strings Change-Id: Ic59e636c8bf99fe91488c312b83f31c36941c202 --- loc_api/loc_api_v02/loc_api_v02_log.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c index dc8092c2..bcae199c 100644 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/loc_api/loc_api_v02/loc_api_v02_log.c @@ -277,17 +277,15 @@ const char* loc_get_v02_client_status_name(locClientStatusEnumType status) static loc_name_val_s_type loc_v02_qmi_status_name[] = { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, - eQMI_LOC_SUCCESS_V02, - eQMI_LOC_GENERAL_FAILURE_V02, - eQMI_LOC_UNSUPPORTED_V02, - eQMI_LOC_INVALID_PARAMETER_V02, - eQMI_LOC_ENGINE_BUSY_V02, - eQMI_LOC_PHONE_OFFLINE_V02, - eQMI_LOC_TIMEOUT_V02, - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02, - eQMI_LOC_INSUFFICIENT_MEMORY_V02, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 + NAME_VAL(eQMI_LOC_SUCCESS_V02), + NAME_VAL(eQMI_LOC_GENERAL_FAILURE_V02), + NAME_VAL(eQMI_LOC_UNSUPPORTED_V02), + NAME_VAL(eQMI_LOC_INVALID_PARAMETER_V02), + NAME_VAL(eQMI_LOC_ENGINE_BUSY_V02), + NAME_VAL(eQMI_LOC_PHONE_OFFLINE_V02), + NAME_VAL(eQMI_LOC_TIMEOUT_V02), + NAME_VAL(eQMI_LOC_CONFIG_NOT_SUPPORTED_V02), + NAME_VAL(eQMI_LOC_INSUFFICIENT_MEMORY_V02), }; static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); From 6fa0e8a9833271cc720c6ac751930b69395db096 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 20 Jun 2013 17:24:37 -0700 Subject: [PATCH 128/945] DEBUG_LEVEL 0 to produce no logs In accordance to gps.conf, debug level of 0 now produces no logs at all. In addition, if the parameter DEBUG_LEVEL is commented in gps.conf, logs will be printed according to Android's logging levels CRs-fixed: 503157 Change-Id: I26ca2be67fbc7ce2bf633f66d9b88ca6450e9d27 --- etc/gps.conf | 1 + loc_api/libloc_api_50001/loc.cpp | 3 ++- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 3 ++- utils/loc_cfg.cpp | 2 +- utils/log_util.h | 24 ++++++++++++++--------- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 84283154..f73401f9 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -18,6 +18,7 @@ NTP_SERVER=time.gpsonextra.net # 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 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4ab9ee80..f1d76836 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -265,8 +265,9 @@ extern "C" const GpsInterface* get_gps_interface() if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); - if (gss_fd < 0) + 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); } diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 4b2d109d..0298dcaf 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -57,8 +57,9 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; - if(callbacks == NULL) + 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; diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index e4a47722..652eb107 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -47,7 +47,7 @@ *============================================================================*/ /* Parameter data */ -static uint8_t DEBUG_LEVEL = 3; +static uint8_t DEBUG_LEVEL = 0xff; static uint8_t TIMESTAMP = 0; /* Parameter spec table */ diff --git a/utils/log_util.h b/utils/log_util.h index 56dca624..8a9647ce 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -78,23 +78,29 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #ifndef DEBUG_DMN_LOC_API /* LOGGING MACROS */ -#define LOC_LOGE(...) ALOGE("E/"__VA_ARGS__) +/*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 LOC_LOGE(...) \ +if ((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("W/"__VA_ARGS__); } #define LOC_LOGW(...) \ -if (loc_logger.DEBUG_LEVEL >= 2) { ALOGE("W/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGW("W/"__VA_ARGS__); } +if ((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/"__VA_ARGS__); } #define LOC_LOGI(...) \ -if (loc_logger.DEBUG_LEVEL >= 3) { ALOGE("I/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGI("I/"__VA_ARGS__); } +if ((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("I/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/"__VA_ARGS__); } #define LOC_LOGD(...) \ -if (loc_logger.DEBUG_LEVEL >= 4) { ALOGE("D/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGD("D/"__VA_ARGS__); } +if ((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("D/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/"__VA_ARGS__); } #define LOC_LOGV(...) \ -if (loc_logger.DEBUG_LEVEL >= 5) { ALOGE("V/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL <= 0) { ALOGV("V/"__VA_ARGS__); } +if ((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("V/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/"__VA_ARGS__); } #else /* DEBUG_DMN_LOC_API */ From b8fb0677fab72a19d9a04734de39601804d06412 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 20 Jun 2013 15:41:59 -0700 Subject: [PATCH 129/945] Return ATL Close failure if no handle found When a request to RELEASE ATL finds no active subscribers, return ATL close failure Change-Id: I591d5456d5ce1218cc82bf7ba430176ec4f13174 CRs-fixed: 502024 --- loc_api/libloc_api_50001/loc_eng.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 0422f505..77322c97 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1800,8 +1800,14 @@ static void loc_eng_deferred_action_thread(void* arg) arlMsg->handle); LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", __func__, __LINE__, arlMsg->handle); - loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3); - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + if(loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Could not release ATL. No subscribers found\n", + __func__, __LINE__); + loc_eng_data_p->client_handle->atlCloseStatus(arlMsg->handle, 0); + } } #endif } From 0590a64deb4ec63a27b779ae6bec91b2ae6eb980 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Tue, 7 May 2013 09:25:21 -0700 Subject: [PATCH 130/945] hardware/qcom/gps: Porting HAL and Loc API 2.0 - Wrote makefiles, config and other files - Made code changes to minimize android dependencies Change-Id: I350de6378684f5db81a36cc4c6d014c5a8189d4c --- Makefile.am | 10 +++ configure.ac | 85 +++++++++++++++++++ loc-api.pc.in | 10 +++ .../libloc_api-rpc-glue/Makefile.am | 46 ++++++++++ .../rpc_inc/loc_api_rpc_glue.h | 4 +- .../src/LocApiRpcAdapter.cpp | 10 ++- .../libloc_api-rpc-glue/src/loc_api_log.c | 1 + .../src/loc_api_rpc_glue.c | 4 +- .../src/loc_api_sync_call.c | 2 + .../libloc_api-rpc-stub/Makefile.am | 42 +++++++++ loc_api/libloc_api_50001/LocApiAdapter.h | 1 + loc_api/libloc_api_50001/Makefile.am | 79 +++++++++++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 36 +++++++- loc_api/libloc_api_50001/loc_eng.h | 2 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 1 + loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 2 +- .../loc_eng_dmn_conn_glue_msg.c | 2 +- .../loc_eng_dmn_conn_glue_pipe.c | 2 +- .../loc_eng_dmn_conn_handler.cpp | 1 + .../loc_eng_dmn_conn_thread_helper.c | 1 + loc_api/libloc_api_50001/loc_eng_msg.h | 6 ++ loc_api/libloc_api_50001/loc_eng_ni.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 2 +- loc_api/loc_api_v02/LocApiV02Adapter.cpp | 6 +- loc_api/loc_api_v02/Makefile.am | 42 +++++++++ loc_api/ulp/inc/ulp.h | 5 +- .../elapsed_millis_since_boot.cpp | 46 ++++++++++ .../platform_lib_includes.h | 35 ++++++++ .../platform_lib_macros.h | 57 +++++++++++++ platform_lib_abstractions/platform_lib_time.h | 35 ++++++++ utils/Makefile.am | 44 ++++++++++ utils/linked_list.c | 2 +- utils/loc_cfg.cpp | 4 + utils/loc_log.cpp | 5 +- utils/log_util.h | 20 ++++- utils/msg_q.c | 2 +- 36 files changed, 633 insertions(+), 21 deletions(-) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 loc-api.pc.in create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am create mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am create mode 100644 loc_api/libloc_api_50001/Makefile.am create mode 100644 loc_api/loc_api_v02/Makefile.am create mode 100644 platform_lib_abstractions/elapsed_millis_since_boot.cpp create mode 100644 platform_lib_abstractions/platform_lib_includes.h create mode 100644 platform_lib_abstractions/platform_lib_macros.h create mode 100644 platform_lib_abstractions/platform_lib_time.h create mode 100644 utils/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..f374a5c5 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +# Makefile.am - Automake script for gps loc_api +# + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = utils loc_api/libloc_api_50001 loc_api/loc_api_v02 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = loc-api.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..dca18a19 --- /dev/null +++ b/configure.ac @@ -0,0 +1,85 @@ +# configure.ac -- Autoconf script for gps loc_api +# +# 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_api package version 1.0.0 +AC_INIT([loc-api],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([QMIF], [qmi-framework]) +AC_SUBST([QMIF_CFLAGS]) +AC_SUBST([QMIF_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 \ + loc_api/libloc_api_50001/Makefile \ + loc_api/loc_api_v02/Makefile \ + loc-api.pc \ + ]) + +AC_OUTPUT diff --git a/loc-api.pc.in b/loc-api.pc.in new file mode 100644 index 00000000..3b18615d --- /dev/null +++ b/loc-api.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: loc-api +Description: Qualcomm GPS Location API +Version: @VERSION@ +Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_eng_so -lgps_default_so -lloc_api +Cflags: -I${includedir}/loc-api/libloc_api_50001 -I${includedir}/loc-api/utils -I${includedir}/ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am new file mode 100644 index 00000000..f5c51369 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am @@ -0,0 +1,46 @@ +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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h index 010e1478..6df33ae1 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h @@ -48,8 +48,8 @@ typedef unsigned char boolean; #define TRUE 1 #define FALSE 0 -#include "rpc_inc/loc_api_fixup.h" -#include "rpc_inc/loc_api_sync_call.h" +#include "loc_api_fixup.h" +#include "loc_api_sync_call.h" #include #ifdef __cplusplus diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 9c2749bd..7a1e9c1c 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -31,12 +31,20 @@ #include #include +#ifndef USE_GLIB #include +#endif /* USE_GLIB */ #include "LocApiRpcAdapter.h" #include "loc_api_rpcgen_common_rpc.h" #include "log_util.h" #include "loc_log.h" #include "loc_api_log.h" +#ifdef USE_GLIB +#include +#endif +#include "librpc.h" +#include "platform_lib_includes.h" + #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (3072) @@ -390,7 +398,7 @@ LocApiRpcAdapter::setTime(GpsUtcTime time, int64_t timeReference, int uncertaint 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)(android::elapsedRealtime() - timeReference); + 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; diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c index 256545ad..1c482325 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -33,6 +33,7 @@ #include "loc_api_log.h" #include "loc_log.h" #include "log_util.h" +#include "platform_lib_includes.h" #include "rpc/rpc.h" #include "loc_api_fixup.h" diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c index c047cb34..e4f609b3 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -57,11 +57,13 @@ /* Logging */ #define LOG_TAG "LocSvc_api_rpc_glue" #define LOG_NDDEBUG 0 +#ifndef USE_GLIB #include +#endif /* USE_GLIB */ /* Logging Improvement */ #include "log_util.h" - +#include "platform_lib_includes.h" /*Maximum number of Modem init*/ #define RPC_TRY_NUM 10 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c index 9541a40b..ae629d7c 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c @@ -40,7 +40,9 @@ /* Logging */ #define LOG_TAG "LocSvc_api_rpc_glue" // #define LOG_NDDEBUG 0 +#ifndef USE_GLIB #include +#endif /* USE_GLIB */ /*************************************************************************** * DATA FOR ASYNCHRONOUS RPC PROCESSING diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am new file mode 100644 index 00000000..4ac8c8a4 --- /dev/null +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am @@ -0,0 +1,42 @@ +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/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h index f0d4215b..f0be1a38 100644 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -35,6 +35,7 @@ #include #include #include +#include "platform_lib_includes.h" #define MAX_APN_LEN 100 #define MAX_URL_LEN 256 diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am new file mode 100644 index 00000000..93e633f5 --- /dev/null +++ b/loc_api/libloc_api_50001/Makefile.am @@ -0,0 +1,79 @@ +AM_CFLAGS = \ + -I../../utils \ + -I../../platform_lib_abstractions \ + -I../ulp/inc \ + -fno-short-enums \ + -DFEATURE_GNSS_BIT_API + +libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocApiAdapter.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 = \ + LocApiAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_msg_id.h \ + loc_eng_log.h \ + ../ulp/inc/ulp.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/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 77322c97..e34531e4 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -47,8 +47,16 @@ #include "LocApiAdapter.h" #include +#ifndef USE_GLIB #include #include +#endif /* USE_GLIB */ + +#ifdef USE_GLIB +#include +#include +#endif /* USE_GLIB */ + #include #include @@ -61,6 +69,7 @@ #include #include #include "log_util.h" +#include "platform_lib_includes.h" #include "loc_eng_log.h" #define SUCCESS TRUE @@ -170,7 +179,7 @@ LocEngContext::LocEngContext(gps_create_thread threadCreator) : counter(0) { LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", - getpid(), gettid(), + getpid(), GETTID_PLATFORM_LIB_ABSTRACTION, deferred_action_thread); } @@ -1418,6 +1427,29 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) EXIT_LOG(%s, VOID_RET); } +#ifdef USE_GLIB +/*=========================================================================== +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 + +===========================================================================*/ +static int set_sched_policy(int tid, SchedPolicy policy) +{ + return 0; +} +#endif /* USE_GLIB */ + /*=========================================================================== FUNCTION loc_eng_deferred_action_thread @@ -1442,7 +1474,7 @@ static void loc_eng_deferred_action_thread(void* arg) LocEngContext* context = (LocEngContext*)arg; // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); + set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); while (1) { diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 04d6714b..e1320cf5 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -95,7 +95,7 @@ private: }; // Module data -typedef struct +typedef struct loc_eng_data_s { LocApiAdapter *client_handle; loc_location_cb_ext location_cb; diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 1d5a59bb..d13231fe 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "platform_lib_includes.h" #include #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index 86489086..918ae220 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -38,7 +38,7 @@ #include #include "log_util.h" - +#include "platform_lib_includes.h" #include "loc_eng_dmn_conn_glue_msg.h" #include "loc_eng_dmn_conn_handler.h" #include "loc_eng_dmn_conn.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c index 6b97a238..a1076ff9 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -32,7 +32,7 @@ #include #include "log_util.h" - +#include "platform_lib_includes.h" #include "loc_eng_dmn_conn_glue_msg.h" #include "loc_eng_dmn_conn_handler.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c index d0bee29c..dffcad06 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -38,7 +38,7 @@ #include "loc_eng_dmn_conn_glue_pipe.h" #include "log_util.h" - +#include "platform_lib_includes.h" /*=========================================================================== FUNCTION loc_eng_dmn_conn_glue_pipeget diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index 6c060f64..8176ab43 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -32,6 +32,7 @@ #include #include "log_util.h" +#include "platform_lib_includes.h" #include "loc_eng_msg.h" #include "loc_eng_dmn_conn.h" #include "loc_eng_dmn_conn_handler.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c index 67e31879..9fed9d42 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -29,6 +29,7 @@ #include #include "log_util.h" +#include "platform_lib_includes.h" #include "loc_eng_dmn_conn_thread_helper.h" /*=========================================================================== diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 116f551c..5928de4f 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -42,6 +42,12 @@ #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) #endif +#ifdef USE_GLIB + +#include + +#endif /* USE_GLIB */ +#include "platform_lib_includes.h" #ifdef __cplusplus extern "C" { diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 146b15b5..e9dc6757 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -43,7 +43,7 @@ #include #include "log_util.h" - +#include "platform_lib_includes.h" /*============================================================================= * * DATA DECLARATION diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 0298dcaf..9262cb09 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -33,7 +33,7 @@ #include #include #include "log_util.h" - +#include "platform_lib_includes.h" /*=========================================================================== FUNCTION loc_eng_xtra_init diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp index 16532e89..21e93865 100644 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ b/loc_api/loc_api_v02/LocApiV02Adapter.cpp @@ -37,13 +37,17 @@ #include #include + +#ifndef USE_GLIB #include +#endif /* USE_GLIB */ #include "LocApiV02Adapter.h" #include "loc_api_v02_client.h" #include "loc_api_v02_log.h" #include "loc_api_sync_req.h" #include "LocApiAdapter.h" #include "loc_util_log.h" +#include "platform_lib_includes.h" /* Default session id ; TBD needs incrementing for each */ #define LOC_API_V02_DEF_SESSION_ID (1) @@ -419,7 +423,7 @@ enum loc_api_adapter_err LocApiV02Adapter :: inject_time_msg.timeUtc = time; - inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); + inject_time_msg.timeUtc += (int64_t)(ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION - timeReference); inject_time_msg.timeUnc = uncertainty; diff --git a/loc_api/loc_api_v02/Makefile.am b/loc_api/loc_api_v02/Makefile.am new file mode 100644 index 00000000..2308cd44 --- /dev/null +++ b/loc_api/loc_api_v02/Makefile.am @@ -0,0 +1,42 @@ +AM_CFLAGS = \ + ${QMIF_CFLAGS} \ + -I../../utils \ + -I../../platform_lib_abstractions \ + -I../libloc_api_50001 + +requiredlibs = \ + ${QMIF_LIBS} \ + ../libloc_api_50001/libloc_adapter_so.la \ + ../../utils/libgps_utils_so.la + +h_sources = LocApiV02Adapter.h \ + loc_util_log.h \ + location_service_v02.h \ + loc_api_sync_req.h \ + loc_api_v02_client.h \ + loc_api_v02_log.h + +c_sources = LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +library_includedir = $(pkgincludedir) +library_include_HEADERS = $(h_sources) + +libloc_api_la_SOURCES = $(c_sources) $(h_sources) + +if USE_GLIB +libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libloc_api_la_CFLAGS = $(AM_CFLAGS) +libloc_api_la_LDFLAGS = -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libloc_api_la_LIBADD = $(requiredlibs) -lstdc++ + +lib_LTLIBRARIES = libloc_api.la diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h index 94f2ebd8..c27bef11 100644 --- a/loc_api/ulp/inc/ulp.h +++ b/loc_api/ulp/inc/ulp.h @@ -36,7 +36,8 @@ extern "C" #endif #include -#include "loc_eng.h" + +struct loc_eng_data_s; /** Represents the standard ulp module interface. */ typedef struct { @@ -46,7 +47,7 @@ typedef struct { /** * Starts the libulp module. 0: success */ - int (*init)(loc_eng_data_s_type &loc_eng_data); + int (*init)(struct loc_eng_data_s &loc_eng_data); }ulpInterface; diff --git a/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/platform_lib_abstractions/elapsed_millis_since_boot.cpp new file mode 100644 index 00000000..e8cb93a9 --- /dev/null +++ b/platform_lib_abstractions/elapsed_millis_since_boot.cpp @@ -0,0 +1,46 @@ +/* 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/platform_lib_abstractions/platform_lib_includes.h b/platform_lib_abstractions/platform_lib_includes.h new file mode 100644 index 00000000..5858674f --- /dev/null +++ b/platform_lib_abstractions/platform_lib_includes.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_INCLUDES_H_ +#define _PLATFORM_LIB_INCLUDES_H_ + +#include "platform_lib_time.h" +#include "platform_lib_macros.h" + +#endif diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/platform_lib_macros.h new file mode 100644 index 00000000..f7c6f820 --- /dev/null +++ b/platform_lib_abstractions/platform_lib_macros.h @@ -0,0 +1,57 @@ +/* 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. + */ + +#ifndef __PLATFORM_LIB_MACROS_H__ +#define __PLATFORM_LIB_MACROS_H__ + +#ifdef USE_GLIB + +#define strlcat g_strlcat +#define strlcpy g_strlcpy + +#define ALOGE(format, x...) printf("E/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) +#define ALOGW(format, x...) printf("W/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) +#define ALOGI(format, x...) printf("I/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) +#define ALOGD(format, x...) printf("D/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) +#define ALOGV(format, x...) printf("V/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) + +#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) + +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) + + +#else + +#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) + +#endif + +#endif diff --git a/platform_lib_abstractions/platform_lib_time.h b/platform_lib_abstractions/platform_lib_time.h new file mode 100644 index 00000000..ce013afc --- /dev/null +++ b/platform_lib_abstractions/platform_lib_time.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_TIME_H_ +#define _PLATFORM_LIB_TIME_H_ + +int64_t systemTime(int clock); +int64_t elapsedMillisSinceBoot(); + +#endif diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 00000000..e5935f05 --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,44 @@ +AM_CFLAGS = -Wundef \ + -MD \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ + -I../platform_lib_abstractions + +libgps_utils_so_la_h_sources = log_util.h \ + msg_q.h \ + linked_list.h \ + loc_cfg.h \ + loc_log.h \ + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h + +libgps_utils_so_la_c_sources = linked_list.c \ + msg_q.c \ + loc_cfg.cpp \ + loc_log.cpp \ + ../platform_lib_abstractions/elapsed_millis_since_boot.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++ -lcutils + +#Create and Install libraries +lib_LTLIBRARIES = libgps_utils_so.la diff --git a/utils/linked_list.c b/utils/linked_list.c index 31ec52d2..92617fee 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -32,7 +32,7 @@ #define LOG_TAG "LocSvc_utils_ll" #include "log_util.h" - +#include "platform_lib_includes.h" #include #include diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 652eb107..73d1ca41 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -39,6 +39,10 @@ #include #include #include +#ifdef USE_GLIB +#include +#endif +#include "platform_lib_includes.h" /*============================================================================= * diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index ecdfc8f5..533fabde 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -34,8 +34,11 @@ #include #include "loc_log.h" #include "msg_q.h" +#ifdef USE_GLIB +#include +#endif /* USE_GLIB */ #include "log_util.h" - +#include "platform_lib_includes.h" // Logging Improvements const char *loc_logger_boolStr[]={"False","True"}; const char VOID_RET[] = "None"; diff --git a/utils/log_util.h b/utils/log_util.h index 8a9647ce..7fb0c780 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -30,6 +30,23 @@ #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" { @@ -72,9 +89,6 @@ extern const char ENTRY_TAG[]; extern void loc_logger_init(unsigned long debug, unsigned long timestamp); extern char* get_timestamp(char* str, unsigned long buf_size); - -#include - #ifndef DEBUG_DMN_LOC_API /* LOGGING MACROS */ diff --git a/utils/msg_q.c b/utils/msg_q.c index 2c264170..c4f3b9d9 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_utils_q" #include "log_util.h" - +#include "platform_lib_includes.h" #include "linked_list.h" #include #include From ca57336da8005595a5c279e67dff5d4dc757e4f4 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Sun, 24 Feb 2013 11:42:01 -0800 Subject: [PATCH 131/945] hardware/qcom/gps: Fixing gettid issue extern to C namespace for C functions to use Change-Id: Ib8eb442653ce62f4a65b2573dd5ed69af7a744ae --- platform_lib_abstractions/platform_lib_macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/platform_lib_macros.h index f7c6f820..66fbb604 100644 --- a/platform_lib_abstractions/platform_lib_macros.h +++ b/platform_lib_abstractions/platform_lib_macros.h @@ -48,6 +48,15 @@ #else +#ifdef __cplusplus +extern "C" { +#endif +pid_t gettid(void); + +#ifdef __cplusplus +} +#endif + #define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) From 492ae0bcbc68c860184443b67ea2123da62eacd5 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Wed, 6 Mar 2013 13:28:00 -0800 Subject: [PATCH 132/945] hardware/qcom/gps: Enabled Timestamps for on-target logging timestamp is added for LE on-target logging Change-Id: I02cd869a5014c9113b4faf142b535e73f17744e5 --- .../platform_lib_macros.h | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/platform_lib_macros.h index 66fbb604..bc48dd99 100644 --- a/platform_lib_abstractions/platform_lib_macros.h +++ b/platform_lib_abstractions/platform_lib_macros.h @@ -29,16 +29,31 @@ #ifndef __PLATFORM_LIB_MACROS_H__ #define __PLATFORM_LIB_MACROS_H__ +#include + +#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); \ +} + + #ifdef USE_GLIB #define strlcat g_strlcat #define strlcpy g_strlcpy -#define ALOGE(format, x...) printf("E/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) -#define ALOGW(format, x...) printf("W/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) -#define ALOGI(format, x...) printf("I/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) -#define ALOGD(format, x...) printf("D/%s (%d): " format "\n", LOG_TAG, getpid(), ##x) -#define ALOGV(format, x...) printf("V/%s (%d): " format "\n", LOG_TAG, getpid(), ##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) #define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) From a5e2030015cb75e38884a9231ce3488f6e255aca Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Fri, 8 Mar 2013 15:56:28 -0800 Subject: [PATCH 133/945] hardware/qcom/gps: Read gps.conf file for config information gps.conf needs to be initialized for native GARDEn test Change-Id: I08a3dd46ff42786f81636ab6929fdfa6d19b1400 --- loc_api/libloc_api_50001/loc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f1d76836..bfc68c3d 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -223,6 +223,8 @@ const GpsInterface* gps_get_hardware_interface () char propBuf[PROPERTY_VALUE_MAX]; + loc_eng_read_config(); + // check to see if GPS should be disabled property_get("gps.disable", propBuf, ""); if (propBuf[0] == '1') From 207b8ee9a5303239f8275f1317e894cd67ca170d Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Wed, 20 Mar 2013 11:25:41 -0700 Subject: [PATCH 134/945] hardware/qcom/gps: fixing build failure minor fix for LE: missing loc-api include path Change-Id: I73f99e2159016d2cb65feb407bb3c38a481fdbf5 --- loc-api.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc-api.pc.in b/loc-api.pc.in index 3b18615d..3b4f81bf 100644 --- a/loc-api.pc.in +++ b/loc-api.pc.in @@ -7,4 +7,4 @@ Name: loc-api Description: Qualcomm GPS Location API Version: @VERSION@ Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_eng_so -lgps_default_so -lloc_api -Cflags: -I${includedir}/loc-api/libloc_api_50001 -I${includedir}/loc-api/utils -I${includedir}/ +Cflags: -I${includedir}/loc-api/libloc_api_50001 -I${includedir}/loc-api/utils -I${includedir}/ -I${includedir}/loc-api From fed389ab357f49778070b554bfbf254411093c75 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Tue, 7 May 2013 09:31:48 -0700 Subject: [PATCH 135/945] GARDEn: porting LE enhancement to Android - fix build error Add platform abstraction layer into include path Change-Id: I1e27a60f3afcc259449d264697bd39c03ef9609f --- loc_api/libloc_api_50001/Android.mk | 2 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 3 +-- utils/Android.mk | 13 ++++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index c9bef520..6bf05302 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -32,7 +32,7 @@ LOCAL_CFLAGS += -DFEATURE_DELEXT endif #FEATURE_DELEXT LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 9262cb09..d8c72266 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -59,8 +59,7 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, if(callbacks == NULL) { LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); - } - else { + } else { xtra_module_data_ptr = &loc_eng_data.xtra_module_data; xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; ret_val = 0; diff --git a/utils/Android.mk b/utils/Android.mk index 57f636f6..418f00d2 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -17,7 +17,9 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - loc_timer.c + loc_timer.c \ + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + LOCAL_CFLAGS += \ -fno-short-enums \ @@ -26,7 +28,8 @@ LOCAL_CFLAGS += \ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes -LOCAL_C_INCLUDES:= +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/../platform_lib_abstractions LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -36,7 +39,11 @@ LOCAL_COPY_HEADERS:= \ linked_list.h \ msg_q.h \ loc_target.h \ - loc_timer.h + loc_timer.h \ + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h + LOCAL_MODULE := libgps.utils From dbc7464692b0d67636a26bdd167d454bad3c869d Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 3 Jul 2013 16:35:51 -0700 Subject: [PATCH 136/945] Handle SSR based on service list No longer waiting on signal to determine whether or not the service it up Change-Id: I04602eb49bafd4485ff625c92ba2b64f8c711641 --- loc_api/loc_api_v02/loc_api_v02_client.c | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c index 13befd02..86003dab 100644 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1727,21 +1727,21 @@ static locClientStatusEnumType locClientQmiCtrlPointInit( // get the service addressing information rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, &num_services); - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - if (rc != QMI_NO_ERR) { - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); - nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - if (!nosignal) - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - } + LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc: %d " + "total timeout: %d", __func__, __LINE__, rc, timeout); - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + if(rc == QMI_NO_ERR) + break; - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " - "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); + /* Service is not up. Wait on a signal until the service is up + or a timeout occurs. */ + LOC_LOGD("%s:%d]: Service not up. Starting delay timer\n", __func__, __LINE__); + QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); + nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + if(nosignal) + timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; + + } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL); if (0 == num_services || rc != QMI_NO_ERR) { if (!nosignal) { @@ -2209,4 +2209,3 @@ bool locClientGetSizeByEventIndId(uint32_t eventIndId, size_t *pEventIndSize) // not found return false; } - From 3156a1d44a66c3db443de773e78c446f00a8a375 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 31 May 2013 14:45:50 -0700 Subject: [PATCH 137/945] Move loc_api_v02 to vendor/qcom-opensource/location Change-Id: I70a427826c90114f895df4a666c6450fd4c3df54 --- loc_api/Android.mk | 5 +- loc_api/loc_api_v02/Android.mk | 46 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2287 ----- loc_api/loc_api_v02/LocApiV02Adapter.h | 169 - loc_api/loc_api_v02/loc_api_sync_req.c | 547 -- loc_api/loc_api_v02/loc_api_sync_req.h | 68 - loc_api/loc_api_v02/loc_api_v02_client.c | 2210 ----- loc_api/loc_api_v02/loc_api_v02_client.h | 1437 ---- loc_api/loc_api_v02/loc_api_v02_log.c | 293 - loc_api/loc_api_v02/loc_api_v02_log.h | 50 - loc_api/loc_api_v02/loc_util_log.h | 75 - loc_api/loc_api_v02/location_service_v02.c | 3328 -------- loc_api/loc_api_v02/location_service_v02.h | 8783 -------------------- 13 files changed, 1 insertion(+), 19297 deletions(-) delete mode 100644 loc_api/loc_api_v02/Android.mk delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.h delete mode 100644 loc_api/loc_api_v02/loc_util_log.h delete mode 100644 loc_api/loc_api_v02/location_service_v02.c delete mode 100644 loc_api/loc_api_v02/location_service_v02.h diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 85dcb56b..45e08c82 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -4,7 +4,7 @@ LOCAL_PATH := $(call my-dir) GPS_DIR_LIST := -FEATURE_DELEXT := true +FEATURE_DELEXT := false # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) @@ -23,9 +23,6 @@ QMI_BOARD_PLATFORM_LIST += msm8226 QMI_BOARD_PLATFORM_LIST += msm8610 endif -ifeq ($(call is-board-platform-in-list,$(QMI_BOARD_PLATFORM_LIST)),true) -GPS_DIR_LIST += $(LOCAL_PATH)/loc_api_v02/ -endif #is-board-platform-in-list GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk deleted file mode 100644 index b5b55303..00000000 --- a/loc_api/loc_api_v02/Android.mk +++ /dev/null @@ -1,46 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_api_v02 - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libqmi_cci \ - libqmi_csi \ - libqmi_common_so \ - libloc_adapter \ - libgps.utils - -LOCAL_SRC_FILES += \ - LocApiV02Adapter.cpp \ - loc_api_v02_log.c \ - loc_api_v02_client.c \ - loc_api_sync_req.c \ - location_service_v02.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -ifeq ($(FEATURE_DELEXT), true) -LOCAL_CFLAGS += -DFEATURE_DELEXT -endif #FEATURE_DELEXT - -## Includes -LOCAL_C_INCLUDES := \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - $(TARGET_OUT_HEADERS)/qmi-framework/inc \ - $(TARGET_OUT_HEADERS)/qmi/inc \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp deleted file mode 100644 index 68dd560d..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ /dev/null @@ -1,2287 +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 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. - */ - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_adapter" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include "LocApiV02Adapter.h" -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" -#include "LocApiAdapter.h" -#include "loc_util_log.h" - - -/* Default session id ; TBD needs incrementing for each */ -#define LOC_API_V02_DEF_SESSION_ID (1) - -/* Default minimium interval in ms */ -#define LOC_API_V02_DEF_MIN_INTERVAL (1000) - -/* Default horizontal accuracy in meters*/ -#define LOC_API_V02_DEF_HORZ_ACCURACY (50) - -/* Default timeout in ms; TBD: needs implementing */ -#define LOC_API_V02_DEF_TIMEOUT (120000) - -/* UMTS CP Address key*/ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -/* GPS SV Id offset */ -#define GPS_SV_ID_OFFSET (1) - -/* GLONASS SV Id offset */ -#define GLONASS_SV_ID_OFFSET (65) - -/* SV ID range */ -#define SV_ID_RANGE (32) - - - -/* static event callbacks that call the LocApiV02Adapter callbacks*/ - -/* global event callback, call the eventCb function in loc api adapter v02 - instance */ -static void globalEventCb(locClientHandleType clientHandle, - uint32_t eventId, - const locClientEventIndUnionType eventPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, eventId, pClientCookie); - - // return if null is passed - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", - __func__, __LINE__, clientHandle, eventId); - return; - } - locApiV02AdapterInstance->eventCb(clientHandle, - eventId, - eventPayload); -} - -/* global response callback, it calls the sync request process - indication function to unblock the request that is waiting on this - response indication*/ -static void globalRespCb(locClientHandleType clientHandle, - uint32_t respId, - const locClientRespIndUnionType respPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - - LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, respId, pClientCookie); - - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", - __func__, __LINE__, clientHandle, respId); - return; - } - // process the sync call - // use pDeleteAssistDataInd as a dummy pointer - loc_sync_process_ind(clientHandle, respId, - (void *)respPayload.pDeleteAssistDataInd); -} - -/* global error callback, it will call the handle service down - function in the loc api adapter instance. */ -static void globalErrorCb (locClientHandleType clientHandle, - locClientErrorEnumType errorId, - void *pClientCookie) -{ - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, errorId, pClientCookie); - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", - __func__, __LINE__, clientHandle, errorId); - return; - } - locApiV02AdapterInstance->errorCb(clientHandle, - errorId); -} - -/* global structure containing the callbacks */ -locClientCallbacksType globalCallbacks = -{ - sizeof(locClientCallbacksType), - globalEventCb, - globalRespCb, - globalErrorCb -}; - -/* Constructor for LocApiV02Adapter */ -LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): - LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), - eventMask(convertMask(locEng.eventMask)) -{ - // initialize loc_sync_req interface - loc_sync_req_init(); -} - -/* Destructor for LocApiV02Adapter */ -LocApiV02Adapter :: ~LocApiV02Adapter() -{ - deInitLocClient(); -} - -/* close Loc API V02 client */ -int LocApiV02Adapter :: deInitLocClient() -{ - return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; -} - -/* Initialize a loc api v02 client */ -enum loc_api_adapter_err LocApiV02Adapter :: reinit() -{ - locClientStatusEnumType status; - /* If the client is already open close it first */ - if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) - { - status = locClientClose(&clientHandle); - if( eLOC_CLIENT_SUCCESS != status) - { - LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, - __LINE__, status); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - } - - LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, - __LINE__, this); - /* initialize the loc api v02 interface, note that - the locClientOpen() function will block if the - service is unavailable for a fixed time out */ - - status = locClientOpen( - eventMask, &globalCallbacks, &clientHandle, (void *)this); - - if (eLOC_CLIENT_SUCCESS != status || - clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) - { - LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, - __LINE__, loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - - // return SUCCESS - return (LOC_API_ADAPTER_ERR_SUCCESS); -} - -/* start positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: startFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStartReqMsgT_v02 start_msg; - - qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; - qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; - - // clear all fields, validity masks - memset (&start_msg, 0, sizeof(start_msg)); - memset (&set_mode_msg, 0, sizeof(set_mode_msg)); - memset (&set_mode_ind, 0, sizeof(set_mode_ind)); - - LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); - fixCriteria.logv(); - - // fill in the start request - switch(fixCriteria.mode) - { - case LOC_POSITION_MODE_MS_BASED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; - break; - - case LOC_POSITION_MODE_MS_ASSISTED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; - break; - - case LOC_POSITION_MODE_RESERVED_4: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; - break; - - case LOC_POSITION_MODE_RESERVED_5: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_WWAN_V02; - break; - - default: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; - break; - } - - req_union.pSetOperationModeReq = &set_mode_msg; - - // send the mode first, before the start message. - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_OPERATION_MODE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_OPERATION_MODE_IND_V02, - &set_mode_ind); // NULL? - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) - { - LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " - "ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_mode_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error - } - - start_msg.minInterval_valid = 1; - start_msg.minInterval = fixCriteria.min_interval; - - if (fixCriteria.preferred_accuracy >= 0) { - start_msg.horizontalAccuracyLevel_valid = 1; - - if (fixCriteria.preferred_accuracy <= 100) - { - // fix needs high accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; - } - else if (fixCriteria.preferred_accuracy <= 1000) - { - //fix needs med accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; - } - else - { - //fix needs low accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; - } - } - - start_msg.fixRecurrence_valid = 1; - if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; - } - else - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; - } - - //dummy session id - // TBD: store session ID, check for session id in pos reports. - start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - if (fixCriteria.credentials[0] != 0) { - int size1 = sizeof(start_msg.applicationId.applicationName); - int size2 = sizeof(fixCriteria.credentials); - int len = ((size1 < size2) ? size1 : size2) - 1; - memcpy(start_msg.applicationId.applicationName, - fixCriteria.credentials, - len); - - size1 = sizeof(start_msg.applicationId.applicationProvider); - size2 = sizeof(fixCriteria.provider); - len = ((size1 < size2) ? size1 : size2) - 1; - memcpy(start_msg.applicationId.applicationProvider, - fixCriteria.provider, - len); - - start_msg.applicationId_valid = 1; - } - - req_union.pStartReq = &start_msg; - - status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, - req_union ); - - if( eLOC_CLIENT_SUCCESS == status) - { - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; -} - -/* stop a positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: stopFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStopReqMsgT_v02 stop_msg; - - LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); - - memset(&stop_msg, 0, sizeof(stop_msg)); - - // dummy session id - stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - req_union.pStopReq = &stop_msg; - - status = locClientSendReq(clientHandle, - QMI_LOC_STOP_REQ_V02, - req_union); - - if( eLOC_CLIENT_SUCCESS == status) - { - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, - loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); -} - -/* set the positioning fix criteria */ -enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( - const LocPosMode *posMode) -{ - LOC_LOGV ("%s:%d]: posMode %p",__func__, __LINE__, posMode); - - if (NULL != posMode && - !fixCriteria.equals(*posMode)) { - //making a copy of the fix criteria - fixCriteria = *posMode; - - LOC_LOGD ("%s:%d]: new fix criteria", __func__, __LINE__); - - if(true == navigating) - { - //fix is in progress, send a restart - LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " - "criteria\n", __func__, __LINE__); - - return( startFix()); - } - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject time into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; - qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; - - memset(&inject_time_msg, 0, sizeof(inject_time_msg)); - - inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; - - inject_time_msg.timeUtc = time; - - inject_time_msg.timeUtc += (int64_t)(android::elapsedRealtime() - timeReference); - - inject_time_msg.timeUnc = uncertainty; - - req_union.pInjectUtcTimeReq = &inject_time_msg; - - LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, - uncertainty); - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_UTC_TIME_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_UTC_TIME_IND_V02, - &inject_time_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) - { - LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_time_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject position into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - injectPosition(double latitude, double longitude, float accuracy) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; - qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; - - memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); - - inject_pos_msg.latitude_valid = 1; - inject_pos_msg.latitude = latitude; - - inject_pos_msg.longitude_valid = 1; - inject_pos_msg.longitude = longitude; - - inject_pos_msg.horUncCircular_valid = 1; - - inject_pos_msg.horUncCircular = accuracy; //meters assumed - - inject_pos_msg.horConfidence_valid = 1; - - inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) - - /* Log */ - LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, - inject_pos_msg.latitude, inject_pos_msg.longitude, - inject_pos_msg.horUncCircular); - - req_union.pInjectPositionReq = &inject_pos_msg; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_POSITION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_POSITION_IND_V02, - &inject_pos_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_pos_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* delete assistance date */ -enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocDeleteAssistDataReqMsgT_v02 delete_req; - qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; - - memset(&delete_req, 0, sizeof(delete_req)); - memset(&delete_resp, 0, sizeof(delete_resp)); - - if( f == GPS_DELETE_ALL ) - { - delete_req.deleteAllFlag = true; - } - - else - { - /* to keep track of svInfoList for GPS and GLO*/ - uint32_t curr_sv_len = 0; - uint32_t curr_sv_idx = 0; - uint32_t sv_id = 0; - - if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) - { - /* do delete for all GPS SV's */ - - curr_sv_len += SV_ID_RANGE; - - sv_id = GPS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - // increment the current index - curr_sv_idx += SV_ID_RANGE; - - } - -#ifdef FEATURE_DELEXT - if( f & GPS_DELETE_TIME_GPS ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; - } -#endif - - if(f & GPS_DELETE_POSITION ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; - } - - if(f & GPS_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; - } - - if(f & GPS_DELETE_IONO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; - } - - if(f & GPS_DELETE_UTC ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; - } - - if(f & GPS_DELETE_HEALTH ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; - } - - if(f & GPS_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; - } - if(f & GPS_DELETE_SADATA ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; - } - if(f & GPS_DELETE_RTI ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; - } - if(f & GPS_DELETE_CELLDB_INFO ) - { - delete_req.deleteCellDbDataMask_valid = 1; - delete_req.deleteCellDbDataMask = - ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; - - } -#ifdef FEATURE_DELEXT - if(f & GPS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; - } - if(f & GPS_DELETE_FREQ_BIAS_EST ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; - } - if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) - { - /* do delete for all GLONASS SV's (65 - 96) - */ - curr_sv_len += SV_ID_RANGE; - - sv_id = GLONASS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - curr_sv_idx += SV_ID_RANGE; - } - - if(f & GPS_DELETE_SVDIR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; - } - - if(f & GPS_DELETE_SVSTEER_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; - } - - if(f & GPS_DELETE_ALMANAC_CORR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; - } - - if(f & GPS_DELETE_TIME_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; - } -#endif - } - - req_union.pDeleteAssistDataReq = &delete_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - &delete_resp); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != delete_resp.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(delete_resp.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* send NI user repsonse to the engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - - qmiLocNiUserRespReqMsgT_v02 ni_resp; - qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; - - memset(&ni_resp,0, sizeof(ni_resp)); - - memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); - - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; - break; - case GPS_NI_RESPONSE_DENY: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; - break; - case GPS_NI_RESPONSE_NORESP: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; - break; - default: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, - ni_resp.userResp); - - ni_resp.notificationType = request_pass_back->notificationType; - - // copy SUPL payload from request - if(request_pass_back->NiSuplInd_valid == 1) - { - ni_resp.NiSuplPayload_valid = 1; - memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), - sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); - - } - // should this be an "else if"?? we don't need to decide - - // copy UMTS-CP payload from request - if( request_pass_back->NiUmtsCpInd_valid == 1 ) - { - ni_resp.NiUmtsCpPayload_valid = 1; - memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), - sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); - } - - //copy Vx payload from the request - if( request_pass_back->NiVxInd_valid == 1) - { - ni_resp.NiVxPayload_valid = 1; - memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), - sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); - } - - // copy Vx service interaction payload from the request - if(request_pass_back->NiVxServiceInteractionInd_valid == 1) - { - ni_resp.NiVxServiceInteractionPayload_valid = 1; - memcpy(&(ni_resp.NiVxServiceInteractionPayload), - &(request_pass_back->NiVxServiceInteractionInd), - sizeof(qmiLocNiVxServiceInteractionStructT_v02)); - } - - // copy Network Initiated SUPL Version 2 Extension - if (request_pass_back->NiSuplVer2ExtInd_valid == 1) - { - ni_resp.NiSuplVer2ExtPayload_valid = 1; - memcpy(&(ni_resp.NiSuplVer2ExtPayload), - &(request_pass_back->NiSuplVer2ExtInd), - sizeof(qmiLocNiSuplVer2ExtStructT_v02)); - } - - // copy SUPL Emergency Notification - if(request_pass_back->suplEmergencyNotification_valid) - { - ni_resp.suplEmergencyNotification_valid = 1; - memcpy(&(ni_resp.suplEmergencyNotification), - &(request_pass_back->suplEmergencyNotification), - sizeof(qmiLocEmergencyNotificationStructT_v02)); - } - - req_union.pNiUserRespReq = &ni_resp; - - status = loc_sync_send_req ( - clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(ni_resp_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Set UMTs SLP server URL */ -enum loc_api_adapter_err LocApiV02Adapter :: setServer( - const char* url, int len) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - - if(len <=0 || len > sizeof(set_server_req.urlAddr)) - { - LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", - __func__, __LINE__, len); - - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); - - set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; - - set_server_req.urlAddr_valid = 1; - - strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err LocApiV02Adapter :: - setServer(unsigned int ip, int port, LocServerType type) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - qmiLocServerTypeEnumT_v02 set_server_cmd; - - switch (type) { - case LOC_AGPS_MPC_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; - break; - case LOC_AGPS_CUSTOM_PDE_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; - break; - default: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; - break; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); - - set_server_req.serverType = set_server_cmd; - set_server_req.ipv4Addr_valid = 1; - set_server_req.ipv4Addr.addr = ip; - set_server_req.ipv4Addr.port = port; - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Inject XTRA data, this module breaks down the XTRA - file into "chunks" and injects them one at a time */ -enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( - char* data, int length) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - int total_parts; - uint8_t part; - uint16_t len_injected; - - locClientReqUnionType req_union; - qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; - qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; - - req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; - - LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); - - inject_xtra.formatType_valid = 1; - inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; - inject_xtra.totalSize = length; - - total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; - - inject_xtra.totalParts = total_parts; - - len_injected = 0; // O bytes injected - - // XTRA injection starts with part 1 - for (part = 1; part <= total_parts; part++) - { - inject_xtra.partNum = part; - - if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) - { - inject_xtra.partData_len = length - len_injected; - } - else - { - inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; - } - - // copy data into the message - memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); - - LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", - __func__, __LINE__, - inject_xtra.partNum, total_parts, inject_xtra.partData_len, - len_injected); - - status = loc_sync_send_req( clientHandle, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - &inject_xtra_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || - inject_xtra.partNum != inject_xtra_ind.partNum) - { - LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," - " part num = %d, ind.partNum = %d\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_xtra_ind.status), - inject_xtra.partNum, inject_xtra_ind.partNum); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - break; - } - - len_injected += inject_xtra.partData_len; - LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, - len_injected); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Request the Xtra Server Url from the modem */ -enum loc_api_adapter_err LocApiV02Adapter :: requestXtraServer() -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - - locClientReqUnionType req_union; - qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02 request_xtra_server_ind; - - status = loc_sync_send_req( clientHandle, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, - &request_xtra_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != request_xtra_server_ind.status || - false == request_xtra_server_ind.serverList_valid || - 0 == request_xtra_server_ind.serverList.serverList_len) - { - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - - if (request_xtra_server_ind.serverList.serverList_len == 1) - { - LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, - "", - "", - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); - } - else if (request_xtra_server_ind.serverList.serverList_len == 2) - { - LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, - request_xtra_server_ind.serverList.serverList[1].serverUrl, - "", - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); - } - else - { - LocApiAdapter::reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, - request_xtra_server_ind.serverList.serverList[1].serverUrl, - request_xtra_server_ind.serverList.serverList[2].serverUrl, - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s], bearer = %d \n", __func__, __LINE__, - handle, is_succ, apn, bear); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - - switch(bear) - { - case AGPS_APN_BEARER_IPV4: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - break; - - case AGPS_APN_BEARER_IPV6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; - break; - - case AGPS_APN_BEARER_IPV4V6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; - break; - - default: - LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } - - conn_status_req.apnProfile_valid = 1; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} - - -/* close atl connection */ -enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( - int handle, int is_succ) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", - __func__, __LINE__, handle, is_succ); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the SUPL version */ -enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; - - LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); - - - memset(&supl_config_req, 0, sizeof(supl_config_req)); - memset(&supl_config_ind, 0, sizeof(supl_config_ind)); - - supl_config_req.suplVersion_valid = 1; - // SUPL version from MSByte to LSByte: - // (reserved)(major version)(minor version)(serviceIndicator) - - supl_config_req.suplVersion = (version == 0x00020000)? - eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; - - req_union.pSetProtocolConfigParametersReq = &supl_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &supl_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(supl_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the configuration for LTE positioning profile (LPP) */ -enum loc_api_adapter_err LocApiV02Adapter :: setLPPConfig(uint32_t profile) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocSetProtocolConfigParametersReqMsgT_v02 lpp_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 lpp_config_ind; - - LOC_LOGD("%s:%d]: lpp profile = %d\n", __func__, __LINE__, profile); - - memset(&lpp_config_req, 0, sizeof(lpp_config_req)); - memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); - - lpp_config_req.lppConfig_valid = 1; - - lpp_config_req.lppConfig = profile; - - req_union.pSetProtocolConfigParametersReq = &lpp_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &lpp_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != lpp_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(lpp_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Configuration */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; - qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; - - LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); - - memset(&sensor_config_req, 0, sizeof(sensor_config_req)); - memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); - - sensor_config_req.sensorsUsage_valid = 1; - sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 - : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; - - req_union.pSetSensorControlConfigReq = &sensor_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - &sensor_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Properties */ -enum loc_api_adapter_err LocApiV02Adapter :: 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) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; - qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; - - LOC_LOGI("%s:%d]: sensors prop: gyroBiasRandomWalk = %f, accelRandomWalk = %f, " - "angleRandomWalk = %f, rateRandomWalk = %f, velocityRandomWalk = %f\n", - __func__, __LINE__, gyroBiasVarianceRandomWalk, accelBiasVarianceRandomWalk, - angleBiasVarianceRandomWalk, rateBiasVarianceRandomWalk, velocityBiasVarianceRandomWalk); - - memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); - memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); - - /* Set the validity bit and value for each sensor property */ - sensor_prop_req.gyroBiasVarianceRandomWalk_valid = gyroBiasVarianceRandomWalk_valid; - sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; - - sensor_prop_req.accelerationRandomWalkSpectralDensity_valid = accelBiasVarianceRandomWalk_valid; - sensor_prop_req.accelerationRandomWalkSpectralDensity = accelBiasVarianceRandomWalk; - - sensor_prop_req.angleRandomWalkSpectralDensity_valid = angleBiasVarianceRandomWalk_valid; - sensor_prop_req.angleRandomWalkSpectralDensity = angleBiasVarianceRandomWalk; - - sensor_prop_req.rateRandomWalkSpectralDensity_valid = rateBiasVarianceRandomWalk_valid; - sensor_prop_req.rateRandomWalkSpectralDensity = rateBiasVarianceRandomWalk; - - sensor_prop_req.velocityRandomWalkSpectralDensity_valid = velocityBiasVarianceRandomWalk_valid; - sensor_prop_req.velocityRandomWalkSpectralDensity = velocityBiasVarianceRandomWalk; - - req_union.pSetSensorPropertiesReq = &sensor_prop_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - &sensor_prop_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_prop_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Performance Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, - int algorithmConfig) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; - qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; - - LOC_LOGD("%s:%d]: 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", - __FUNCTION__, - __LINE__, - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec, - accelSamplesPerBatchHigh, - accelBatchesPerSecHigh, - gyroSamplesPerBatchHigh, - gyroBatchesPerSecHigh, - algorithmConfig - ); - - memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); - memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); - - sensor_perf_config_req.performanceControlMode_valid = 1; - sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; - sensor_perf_config_req.accelSamplingSpec_valid = 1; - sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; - sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; - sensor_perf_config_req.gyroSamplingSpec_valid = 1; - sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; - sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; - sensor_perf_config_req.accelSamplingSpecHigh_valid = 1; - sensor_perf_config_req.accelSamplingSpecHigh.batchesPerSecond = accelBatchesPerSecHigh; - sensor_perf_config_req.accelSamplingSpecHigh.samplesPerBatch = accelSamplesPerBatchHigh; - sensor_perf_config_req.gyroSamplingSpecHigh_valid = 1; - sensor_perf_config_req.gyroSamplingSpecHigh.batchesPerSecond = gyroBatchesPerSecHigh; - sensor_perf_config_req.gyroSamplingSpecHigh.samplesPerBatch = gyroSamplesPerBatchHigh; - sensor_perf_config_req.algorithmConfig_valid = 1; - sensor_perf_config_req.algorithmConfig = algorithmConfig; - - req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - &sensor_perf_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the External Power Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setExtPowerConfig(int isBatteryCharging) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetExternalPowerConfigReqMsgT_v02 ext_pwr_req; - qmiLocGetExternalPowerConfigIndMsgT_v02 ext_pwr_ind; - - LOC_LOGI("%s:%d]: Ext Pwr Config (isBatteryCharging)(%u)", - __FUNCTION__, - __LINE__, - isBatteryCharging - ); - - memset(&ext_pwr_req, 0, sizeof(ext_pwr_req)); - memset(&ext_pwr_ind, 0, sizeof(ext_pwr_ind)); - - switch(isBatteryCharging) - { - /* Charging */ - case 1: - ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02; - break; - - /* Not charging */ - case 0: - ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02; - break; - - default: - LOC_LOGE("%s:%d]: Invalid ext power state = %d!", - __FUNCTION__, - __LINE__, - isBatteryCharging); - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - break; - } - - req_union.pSetExternalPowerConfigReq = &ext_pwr_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - &ext_pwr_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ext_pwr_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %d, ind..status = %d ", - __func__, __LINE__, result, ext_pwr_ind.status); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Positioning Protocol on A-GLONASS system */ -enum loc_api_adapter_err LocApiV02Adapter :: setAGLONASSProtocol(unsigned long aGlonassProtocol) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind; - - memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req)); - memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind)); - - aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1; - aGlonassProtocol_req.assistedGlonassProtocolMask = aGlonassProtocol; - - req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req; - - LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%lx\n", __func__, __LINE__, - aGlonassProtocol_req.assistedGlonassProtocolMask); - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &aGlonassProtocol_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - return LOC_API_ADAPTER_ERR_SUCCESS; -} - - -/* Convert event mask from loc eng to loc_api_v02 format */ -locClientEventMaskType LocApiV02Adapter :: convertMask( - LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - locClientEventMaskType eventMask = 0; - LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); - - if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; - - if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; - - /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ - if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || - (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) - eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; - - if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; - - if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) - { - // TBD: This needs to be decoupled in the HAL - eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; - } - - if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) - { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); - } - - if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; - - return eventMask; -} - -/* Convert error from loc_api_v02 to loc eng format*/ -enum loc_api_adapter_err LocApiV02Adapter :: convertErr( - locClientStatusEnumType status) -{ - switch( status) - { - case LOC_API_ADAPTER_ERR_SUCCESS: - return LOC_API_ADAPTER_ERR_SUCCESS; - - case eLOC_CLIENT_FAILURE_GENERAL: - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - - case eLOC_CLIENT_FAILURE_UNSUPPORTED: - return LOC_API_ADAPTER_ERR_UNSUPPORTED; - - case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - - case eLOC_CLIENT_FAILURE_ENGINE_BUSY: - return LOC_API_ADAPTER_ERR_ENGINE_BUSY; - - case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: - return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; - - case eLOC_CLIENT_FAILURE_TIMEOUT: - return LOC_API_ADAPTER_ERR_TIMEOUT; - - case eLOC_CLIENT_FAILURE_INVALID_HANDLE: - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - - case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: - return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; - - default: - return LOC_API_ADAPTER_ERR_FAILURE; - } -} - -/* convert position report to loc eng format and send the converted - position to loc eng */ - -void LocApiV02Adapter :: reportPosition ( - const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) -{ - UlpLocation location; - LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; - LOC_LOGD("Reporting postion from V2 Adapter\n"); - memset(&location, 0, sizeof (UlpLocation)); - location.size = sizeof(location); - GpsLocationExtended locationExtended; - memset(&locationExtended, 0, sizeof (GpsLocationExtended)); - locationExtended.size = sizeof(locationExtended); - // Process the position from final and intermediate reports - - if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || - (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) - ) - { - // Latitude & Longitude - if( (location_report_ptr->latitude_valid == 1 ) && - (location_report_ptr->longitude_valid == 1) && - (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->timestampUtc_valid == 1) - { - location.gpsLocation.timestamp = location_report_ptr->timestampUtc; - } - - // Altitude - if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.gpsLocation.altitude = location_report_ptr->altitudeWrtEllipsoid; - } - - // Speed - if((location_report_ptr->speedHorizontal_valid == 1) && - (location_report_ptr->speedVertical_valid ==1 ) ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt( - (location_report_ptr->speedHorizontal * - location_report_ptr->speedHorizontal) + - (location_report_ptr->speedVertical * - location_report_ptr->speedVertical) ); - } - - // Heading - if(location_report_ptr->heading_valid == 1) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; - location.gpsLocation.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if( (location_report_ptr->horUncCircular_valid ) ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; - location.gpsLocation.accuracy = location_report_ptr->horUncCircular; - } - - // Technology Mask - tech_Mask |= location_report_ptr->technologyMask; - - //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->magneticDeviation_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; - locationExtended.magneticDeviation = location_report_ptr->magneticDeviation; - } - - if (location_report_ptr->DOP_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; - locationExtended.pdop = location_report_ptr->DOP.PDOP; - locationExtended.hdop = location_report_ptr->DOP.HDOP; - locationExtended.vdop = location_report_ptr->DOP.VDOP; - } - - if (location_report_ptr->altitudeWrtMeanSeaLevel_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; - locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; - } - - if (location_report_ptr->vertUnc_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; - locationExtended.vert_unc = location_report_ptr->vertUnc; - } - - if (location_report_ptr->speedUnc_valid ) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; - locationExtended.speed_unc = location_report_ptr->speedUnc; - } - - LocApiAdapter::reportPosition( location, - locationExtended, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->sessionStatus - == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), - tech_Mask); - } - } - else - { - LocApiAdapter::reportPosition(location, - locationExtended, - NULL, - LOC_SESS_FAILURE); - - LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " - "fix id = %u\n", __func__, __LINE__, - location_report_ptr->sessionStatus, - location_report_ptr->fixId ); - } -} - -/* convert satellite report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportSv ( - const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - GpsLocationExtended locationExtended; - int num_svs_max, i; - const qmiLocSvInfoStructT_v02 *sv_info_ptr; - - LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, - gnss_report_ptr->svList_len); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - memset(&locationExtended, 0, sizeof (GpsLocationExtended)); - locationExtended.size = sizeof(locationExtended); - if(gnss_report_ptr->svList_valid == 1) - { - num_svs_max = gnss_report_ptr->svList_len; - if(num_svs_max > GPS_MAX_SVS) - { - num_svs_max = GPS_MAX_SVS; - } - SvStatus.num_svs = 0; - for(i = 0; i < num_svs_max; i++) - { - sv_info_ptr = &(gnss_report_ptr->svList[i]); - if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && - (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) - && (sv_info_ptr->gnssSvId != 0 )) - { - if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); - SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; - - // We only have the data field to report gps eph and alm mask - if(sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) - { - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) - { - SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) - { - SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - } - - if((sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) - && - (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) - { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + (65-1); - } - // Unsupported SV system - else - { - continue; - } - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) - { - SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) - { - SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) - { - SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; - } - - SvStatus.num_svs++; - } - } - - if (SvStatus.num_svs >= 0) - { - LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); - LocApiAdapter::reportSv(SvStatus, - locationExtended, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); - } -} - -/* convert engine state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) -{ - - LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, - engine_state_ptr->engineState); - - if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); - } - else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); - } - -} - -/* convert fix session state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) -{ - GpsStatusValue status; - LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, - fix_session_state_ptr->sessionState); - - status = GPS_STATUS_NONE; - if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) - { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (fix_session_state_ptr->sessionState - == eQMI_LOC_FIX_SESSION_FINISHED_V02) - { - status = GPS_STATUS_SESSION_END; - } - LocApiAdapter::reportStatus(status); -} - -/* convert NMEA report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportNmea ( - const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) -{ - - LocApiAdapter::reportNmea(nmea_report_ptr->nmea, - strlen(nmea_report_ptr->nmea)); - - LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, - nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], - nmea_report_ptr->nmea[5]); -} - -/* convert and report an ATL request to loc engine */ -void LocApiV02Adapter :: reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) -{ - uint32_t connHandle = server_request_ptr->connHandle; - // service ATL open request; copy the WWAN type - if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) - { - AGpsType agpsType; - - switch(server_request_ptr->wwanType) - { - case eQMI_LOC_WWAN_TYPE_INTERNET_V02: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - - case eQMI_LOC_WWAN_TYPE_AGNSS_V02: - agpsType = AGPS_TYPE_SUPL; - break; - - default: - agpsType = AGPS_TYPE_WWAN_ANY; - break; - } - - LocApiAdapter::requestATL(connHandle, agpsType); - } - - // service the ATL close request - else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) - { - LocApiAdapter::releaseATL(connHandle); - } -} - -/* conver the NI report to loc eng format and send t loc engine */ -void LocApiV02Adapter :: reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) -{ - GpsNiNotification notif; - - /* initialize the notification*/ - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - /* NI timeout gets overwritten in LocApiAdapter, - initializing to 0 here */ - notif.timeout = 0; - - notif.text_encoding = GPS_ENC_NONE ; - - notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - - notif.notify_flags = 0; - - notif.default_response = GPS_NI_RESPONSE_NORESP; - - /*Handle Vx request */ - if(ni_req_ptr->NiVxInd_valid == 1) - { - const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); - - notif.ni_type = GPS_NI_TYPE_VOICE; - - // Requestor ID, the requestor id recieved is NULL terminated - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char *)vx_req->requestorId, vx_req->requestorId_len ); - } - - /* Handle UMTS CP request*/ - else if(ni_req_ptr->NiUmtsCpInd_valid == 1) - { - const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = - &ni_req_ptr->NiUmtsCpInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - - /* notificationText should always be a NULL terminated string */ - hexcode(notif.text, sizeof notif.text, - (char *)umts_cp_req->notificationText, - umts_cp_req->notificationText_len); - - /* Store requestor ID */ - hexcode(notif.requestor_id, sizeof(notif.requestor_id), - (char *)umts_cp_req->requestorId.codedString, - umts_cp_req->requestorId.codedString_len); - - /* convert encodings */ - notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); - - notif.requestor_id_encoding = - convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); - - /* LCS address (using extras field) */ - if ( umts_cp_req->clientAddress_len != 0) - { - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - - // 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; - address_source = (char *)umts_cp_req->clientAddress; - // client Address is always NULL terminated - addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, - umts_cp_req->clientAddress_len); - - // The address is ASCII string - if (addr_len) - { - strlcat(notif.extras, lcs_addr, sizeof notif.extras); - } - } - - } - else if(ni_req_ptr->NiSuplInd_valid == 1) - { - const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = - &ni_req_ptr->NiSuplInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - - // Client name - if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) - { - hexcode(notif.text, sizeof(notif.text), - (char *)supl_req->clientName.formattedString, - supl_req->clientName.formattedString_len); - LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, - notif.text); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", - __func__, __LINE__); - } - - // Requestor ID - if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char*)supl_req->requestorId.formattedString, - supl_req->requestorId.formattedString_len ); - - LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, - notif.requestor_id); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", - __func__, __LINE__); - } - - // Encoding type - if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) - { - notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); - - notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); - } - else - { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - } //ni_req_ptr->NiSuplInd_valid == 1 - - else - { - LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); - return; - } - - // Set default_response & notify_flags - convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); - - if( NULL != ni_req_copy_ptr) - { - memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); - - LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); - } - else - { - LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); - } - -} - -/* convert Ni Encoding type from QMI_LOC to loc eng format */ -GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case eQMI_LOC_NI_SUPL_UTF8_V02: - enc = GPS_ENC_SUPL_UTF8; - break; - case eQMI_LOC_NI_SUPL_UCS2_V02: - enc = GPS_ENC_SUPL_UCS2; - break; - case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - break; - default: - break; - } - - return enc; -} - -/*convert NI notify verify type from QMI LOC to loc eng format*/ -bool LocApiV02Adapter :: convertNiNotifyVerifyType ( - GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv) -{ - switch (notif_priv) - { - case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: - notif->notify_flags = 0; - break; - - case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_ACCEPT; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_DENY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return false; - } - - return true; -} - -/* event callback registered with the loc_api v02 interface */ -void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, - uint32_t eventId, locClientEventIndUnionType eventPayload) -{ - LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, - eventId); - - switch(eventId) - { - //Position Report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - reportPosition(eventPayload.pPositionReportEvent); - break; - - // Satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - reportSv(eventPayload.pGnssSvInfoReportEvent); - break; - - // Status report - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - reportEngineState(eventPayload.pEngineState); - break; - - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - reportFixSessionState(eventPayload.pFixSessionState); - break; - - // NMEA - case QMI_LOC_EVENT_NMEA_IND_V02: - reportNmea(eventPayload.pNmeaReportEvent); - break; - - // XTRA request - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - LOC_LOGD("%s:%d]: XTRA download request\n", __func__, - __LINE__); - requestXtraData(); - break; - - // time request - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - LOC_LOGD("%s:%d]: Time request\n", __func__, - __LINE__); - requestTime(); - break; - - //position request - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - LOC_LOGD("%s:%d]: Position request\n", __func__, - __LINE__); - //requestPosition(); - break; - - // NI request - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); - break; - - // AGPS connection request - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - reportAtlRequest(eventPayload.pLocationServerConnReqEvent); - break; - } -} - -/* Call the service LocApiAdapter down event*/ -void LocApiV02Adapter :: errorCb(locClientHandleType handle, - locClientErrorEnumType errorId) -{ - if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) - { - LOC_LOGE("%s:%d]: Service unavailable error\n", - __func__, __LINE__); - - LocApiAdapter::handleEngineDownEvent(); - - /* immediately send the engine up event so that - the loc engine re-initializes the adapter and the - loc-api_v02 interface */ - - LocApiAdapter::handleEngineUpEvent(); - } -} - -/* return a Loc API adapter */ -LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return(new LocApiV02Adapter(locEng)); -} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h deleted file mode 100644 index 60d4a47e..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ /dev/null @@ -1,169 +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_API_V_0_2_ADAPTER_H -#define LOC_API_V_0_2_ADAPTER_H - -#include -#include "loc_api_v02_client.h" -#include -#include - -/* This class derives from the LocApiAdapter class. - The members of this class are responsible for converting - the Loc API V02 data structures into Loc Engine data structures. - This class also implements some of the virtual functions that - handle the requests from loc engine. */ -class LocApiV02Adapter : public LocApiAdapter { - - /* loc api v02 handle*/ - locClientHandleType clientHandle; - - /* events the client is registered for */ - locClientEventMaskType eventMask; - - /* Convert event mask from loc eng to loc_api_v02 format */ - locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - - /* Convert error from loc_api_v02 to loc eng format*/ - enum loc_api_adapter_err convertErr(locClientStatusEnumType status); - - /* convert Ni Encoding type from QMI_LOC to loc eng format */ - GpsNiEncodingType convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); - - /*convert NI notify verify type from QMI LOC to loc eng format*/ - bool convertNiNotifyVerifyType (GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv); - - /* close Loc API V02 client */ - int deInitLocClient(); - - /* convert position report to loc eng format and send the converted - position to loc eng */ - void reportPosition - (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); - - /* convert satellite report to loc eng format and send the converted - report to loc eng */ - void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); - - /* convert engine state report to loc eng format and send the converted - report to loc eng */ - void reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); - - /* convert fix session report to loc eng format and send the converted - report to loc eng */ - void reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); - - /* convert NMEA report to loc eng format and send the converted - report to loc eng */ - void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); - - /* convert and report an ATL request to loc engine */ - void reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 - *server_request_ptr); - - /* convert and report NI request to loc eng */ - void reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); - -public: - LocApiV02Adapter(LocEng &locEng); - ~LocApiV02Adapter(); - - /* event callback registered with the loc_api v02 interface */ - void eventCb(locClientHandleType client_handle, - uint32_t loc_event_id, - locClientEventIndUnionType loc_event_payload); - - /* error callback, this function handles the service unavailable - error */ - void errorCb(locClientHandleType handle, - locClientErrorEnumType errorId); - - virtual enum loc_api_adapter_err reinit(); - - virtual enum loc_api_adapter_err startFix(); - - virtual enum loc_api_adapter_err stopFix(); - - virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode *mode); - - 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); - - 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 enum loc_api_adapter_err setLPPConfig(uint32_t profile); - - virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); - - 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 setExtPowerConfig(int isBatteryCharging); - virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); -}; - -#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c deleted file mode 100644 index 6a086667..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ /dev/null @@ -1,547 +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 -#include "loc_api_v02_client.h" -#include "loc_api_sync_req.h" - -/* Logging */ -// Uncomment to log verbose logs -#define LOG_NDEBUG 1 - -// log debug logs -#define LOG_NDDEBUG 1 -#define LOG_TAG "LocSvc_api_v02" -#include "loc_util_log.h" - -#define LOC_SYNC_REQ_BUFFER_SIZE 8 -#define GPS_CONF_FILE "/etc/gps.conf" -pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; - -static bool loc_sync_call_initialized = false; - -typedef struct { - pthread_mutex_t sync_req_lock; - - /* Client ID */ - locClientHandleType client_handle; - - /* waiting conditional variable */ - pthread_cond_t ind_arrived_cond; - - /* Callback waiting data block, protected by loc_cb_data_mutex */ - bool ind_is_selected; /* is cb selected? */ - bool ind_is_waiting; /* is waiting? */ - bool ind_has_arrived; /* callback has arrived */ - uint32_t req_id; /* sync request */ - void *recv_ind_payload_ptr; /* received payload */ - uint32_t recv_ind_id; /* received ind */ - -} loc_sync_req_data_s_type; - -typedef struct { - bool in_use; /* at least one sync call is active */ - bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; - loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; -} loc_sync_req_array_s_type; - -/*************************************************************************** - * DATA FOR ASYNCHRONOUS RPC PROCESSING - **************************************************************************/ -loc_sync_req_array_s_type loc_sync_array; - -/*=========================================================================== - -FUNCTION loc_sync_req_init - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_sync_req_init() -{ - LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); - UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE); - pthread_mutex_lock(&loc_sync_call_mutex); - if(true == loc_sync_call_initialized) - { - LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - loc_sync_array.in_use = false; - - memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); - - int i; - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - pthread_mutex_init(&slot->sync_req_lock, NULL); - pthread_cond_init(&slot->ind_arrived_cond, NULL); - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; /* req id */ - } - - loc_sync_call_initialized = true; - pthread_mutex_unlock(&loc_sync_call_mutex); -} - - -/*=========================================================================== - -FUNCTION loc_sync_process_ind - -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_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* ind id */ - void *ind_payload_ptr /* payload */ -) -{ - - LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n", - __func__,__LINE__, client_handle, ind_id); - - pthread_mutex_lock(&loc_sync_call_mutex); - - if (!loc_sync_array.in_use) - { - LOC_LOGD("%s:%d]: loc_sync_array not in use \n", - __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - bool in_use = false, consumed = false; - int i; - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - in_use |= loc_sync_array.slot_in_use[i]; - - pthread_mutex_lock(&slot->sync_req_lock); - - if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) - && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) - { - // copy the payload to the slot waiting for this ind - size_t payload_size = 0; - - LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", - __func__, __LINE__, i, ind_id); - - if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && - NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) - { - LOC_LOGV("%s:%d]: copying ind payload size = %u \n", - __func__, __LINE__, payload_size); - - memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); - - consumed = true; - - } - /* Received a callback while waiting, wake up thread to check it */ - if (slot->ind_is_waiting) - { - slot->recv_ind_id = ind_id; - - pthread_cond_signal(&slot->ind_arrived_cond); - } - else - { - /* If callback arrives before wait, remember it */ - LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", - __func__, __LINE__, ind_id); - - slot->ind_has_arrived = true; - } - } - pthread_mutex_unlock(&slot->sync_req_lock); - } - - if (!in_use) { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_alloc_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_alloc_slot() -{ - int i, select_id = -1; /* no free buffer */ - - pthread_mutex_lock(&loc_sync_call_mutex); - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (!loc_sync_array.slot_in_use[i]) - { - select_id = i; - loc_sync_array.slot_in_use[i] = 1; - loc_sync_array.in_use = true; - break; - } - } - - pthread_mutex_unlock(&loc_sync_call_mutex); - LOC_LOGV("%s:%d]: returning slot %d\n", - __func__, __LINE__, select_id); - return select_id; -} - -/*=========================================================================== - -FUNCTION loc_free_slot - -DESCRIPTION - Frees a buffer slot after the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_free_slot(int select_id) -{ - int i; - loc_sync_req_data_s_type *slot; - - pthread_mutex_lock(&loc_sync_call_mutex); - - LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); - - loc_sync_array.slot_in_use[select_id] = 0; - - slot = &loc_sync_array.slots[select_id]; - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; - - // check if all slots are now free - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (loc_sync_array.slot_in_use[i]) break; - } - - if (i >= LOC_SYNC_REQ_BUFFER_SIZE) - { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_sync_select_ind - -DESCRIPTION - Selects which indication to wait for. - - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -ENOMEM : out of buffer - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_select_ind( - locClientHandleType client_handle, /* Client handle */ - uint32_t ind_id, /* ind Id wait for */ - uint32_t req_id, /* req id */ - void * ind_payload_ptr /* ptr where payload should be copied to*/ -) -{ - int select_id = loc_alloc_slot(); - - LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n", - __func__, __LINE__, client_handle, ind_id, req_id); - - if (select_id < 0) - { - LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", - __func__, __LINE__, loc_get_v02_event_name(req_id)); - return -ENOMEM; - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - pthread_mutex_lock(&slot->sync_req_lock); - - slot->client_handle = client_handle; - slot->ind_is_selected = true; - slot->ind_is_waiting = false; - slot->ind_has_arrived = false; - - slot->recv_ind_id = ind_id; - slot->req_id = req_id; - slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr - - pthread_mutex_unlock(&slot->sync_req_lock); - - return select_id; -} - - -/*=========================================================================== - -FUNCTION loc_sync_wait_for_ind - -DESCRIPTION - Waits for a selected indication. The wait expires in timeout_seconds seconds. - If the function is called before an existing wait has finished, it will - immediately return error. - -DEPENDENCIES - N/A - -RETURN VALUE - 0 on SUCCESS, -ve value on failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_wait_for_ind( - int select_id, /* ID from loc_sync_select_ind() */ - int timeout_seconds, /* Timeout in this number of seconds */ - uint32_t ind_id -) -{ - if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) - { - LOC_LOGE("%s:%d]: invalid select_id: %d \n", - __func__, __LINE__, select_id); - - return (-EINVAL); - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - int ret_val = 0; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ - - struct timeval present_time; - struct timespec expire_time; - - pthread_mutex_lock(&slot->sync_req_lock); - - do - { - if (slot->ind_has_arrived) - { - ret_val = 0; /* success */ - break; - } - - if (slot->ind_is_waiting) - { - LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, - __LINE__, select_id); - ret_val = -EBUSY; // busy - break; - } - - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_nsec = present_time.tv_usec * 1000; - expire_time.tv_sec += timeout_seconds; - - /* Take new wait request */ - slot->ind_is_waiting = true; - - /* Waiting */ - rc = pthread_cond_timedwait(&slot->ind_arrived_cond, - &slot->sync_req_lock, &expire_time); - - slot->ind_is_waiting = false; - - if(rc == ETIMEDOUT) - { - LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", - __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); - ret_val = -ETIMEDOUT; //time out - } - - } while (0); - - pthread_mutex_unlock(&slot->sync_req_lock); - loc_free_slot(select_id); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_sync_send_req - -DESCRIPTION - Synchronous req call (thread safe) - -DEPENDENCIES - N/A - -RETURN VALUE - Loc API 2.0 status - -SIDE EFFECTS - N/A - -===========================================================================*/ -locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; - int select_id; - int rc = 0; - - // Select the callback we are waiting for - select_id = loc_sync_select_ind(client_handle, ind_id, req_id, - ind_payload_ptr); - - if (select_id >= 0) - { - status = locClientSendReq (client_handle, req_id, req_payload); - LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", - __func__, __LINE__, select_id, status); - - if (status != eLOC_CLIENT_SUCCESS ) - { - loc_free_slot(select_id); - } - else - { - // Wait for the indication callback - if (( rc = loc_sync_wait_for_ind( select_id, - timeout_msec / 1000, - ind_id) ) < 0) - { - if ( rc == -ETIMEDOUT) - status = eLOC_CLIENT_FAILURE_TIMEOUT; - else - status = eLOC_CLIENT_FAILURE_INTERNAL; - - // Callback waiting failed - LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " - "select id %d, status %s", __func__, __LINE__, rc , - select_id, loc_get_v02_client_status_name(status)); - } - else - { - status = eLOC_CLIENT_SUCCESS; - LOC_LOGV("%s:%d]: success (select id %d)\n", - __func__, __LINE__, select_id); - } - } - } /* select id */ - - return status; -} - - diff --git a/loc_api/loc_api_v02/loc_api_sync_req.h b/loc_api/loc_api_v02/loc_api_sync_req.h deleted file mode 100644 index 4bd2b462..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.h +++ /dev/null @@ -1,68 +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_SYNC_REQ_H -#define LOC_SYNC_REQ_H - -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#include -#include "loc_api_v02_client.h" - -#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second - -/* Init function */ -extern void loc_sync_req_init(); - - -/* Process Loc API indications to wake up blocked user threads */ -extern void loc_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* respInd id */ - void *ind_payload_ptr /* payload */ -); - -/* Thread safe synchronous request, using Loc API status return code */ -extern locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_SYNC_REQ_H */ diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c deleted file mode 100644 index 882c5276..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ /dev/null @@ -1,2210 +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 "qmi_client.h" -#include "qmi_idl_lib.h" -#include "qmi_cci_target_ext.h" - -#if defined( _ANDROID_) -#include "qmi_cci_target.h" -#include "qmi_cci_common.h" -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_api_v02" -#endif //_ANDROID_ - - -#include "loc_api_v02_client.h" -#include "loc_util_log.h" - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (5000) - -#else - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (1000) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -//timeout in ms that the service waits for qmi-fw notification -#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) -// total timeout for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) - -/* Table to relate eventId, size and mask value used to enable the event*/ -typedef struct -{ - uint32_t eventId; - size_t eventSize; - locClientEventMaskType eventMask; -}locClientEventIndTableStructT; - - -static locClientEventIndTableStructT locClientEventIndTable[]= { - - // position report ind - { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, - sizeof(qmiLocEventPositionReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, - - // satellite report ind - { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, - sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), - QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, - - // NMEA report ind - { QMI_LOC_EVENT_NMEA_IND_V02, - sizeof(qmiLocEventNmeaIndMsgT_v02), - QMI_LOC_EVENT_MASK_NMEA_V02 }, - - //NI event ind - { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, - sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, - - //Time Injection Request Ind - { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, - sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, - - //Predicted Orbits Injection Request - { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, - sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, - - //Position Injection Request Ind - { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, - sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , - - //Engine State Report Ind - { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, - sizeof(qmiLocEventEngineStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, - - //Fix Session State Report Ind - { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, - sizeof(qmiLocEventFixSessionStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, - - //Wifi Request Indication - { QMI_LOC_EVENT_WIFI_REQ_IND_V02, - sizeof(qmiLocEventWifiReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, - - //Sensor Streaming Ready Status Ind - { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, - sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, - - // Time Sync Request Indication - { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, - sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, - - //Set Spi Streaming Report Event - { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, - sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, - - //Location Server Connection Request event - { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, - sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 }, - - // NI Geofence Event - { QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, - sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02}, - - // Geofence General Alert Event - { QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, - sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02}, - - //Geofence Breach event - { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, - sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02}, - - //Pedometer Control event - { QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, - sizeof(qmiLocEventPedometerControlIndMsgT_v02), - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 }, - - //Motion Data Control event - { QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, - sizeof(qmiLocEventMotionDataControlIndMsgT_v02), - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 } -}; - -/* table to relate the respInd Id with its size */ -typedef struct -{ - uint32_t respIndId; - size_t respIndSize; -}locClientRespIndTableStructT; - -static locClientRespIndTableStructT locClientRespIndTable[]= { - - // get service revision ind - { QMI_LOC_GET_SERVICE_REVISION_IND_V02, - sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, - - // Get Fix Criteria Resp Ind - { QMI_LOC_GET_FIX_CRITERIA_IND_V02, - sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, - - // NI User Resp In - { QMI_LOC_NI_USER_RESPONSE_IND_V02, - sizeof(qmiLocNiUserRespIndMsgT_v02)}, - - //Inject Predicted Orbits Data Resp Ind - { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, - - //Get Predicted Orbits Data Src Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, - - // Get Predicted Orbits Data Validity Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, - - // Inject UTC Time Resp Ind - { QMI_LOC_INJECT_UTC_TIME_IND_V02, - sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, - - //Inject Position Resp Ind - { QMI_LOC_INJECT_POSITION_IND_V02, - sizeof(qmiLocInjectPositionIndMsgT_v02)}, - - //Set Engine Lock Resp Ind - { QMI_LOC_SET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocSetEngineLockIndMsgT_v02)}, - - //Get Engine Lock Resp Ind - { QMI_LOC_GET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocGetEngineLockIndMsgT_v02)}, - - //Set SBAS Config Resp Ind - { QMI_LOC_SET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, - - //Get SBAS Config Resp Ind - { QMI_LOC_GET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, - - //Set NMEA Types Resp Ind - { QMI_LOC_SET_NMEA_TYPES_IND_V02, - sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, - - //Get NMEA Types Resp Ind - { QMI_LOC_GET_NMEA_TYPES_IND_V02, - sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, - - //Set Low Power Mode Resp Ind - { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, - - //Get Low Power Mode Resp Ind - { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, - - //Set Server Resp Ind - { QMI_LOC_SET_SERVER_IND_V02, - sizeof(qmiLocSetServerIndMsgT_v02)}, - - //Get Server Resp Ind - { QMI_LOC_GET_SERVER_IND_V02, - sizeof(qmiLocGetServerIndMsgT_v02)}, - - //Delete Assist Data Resp Ind - { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, - - //Set XTRA-T Session Control Resp Ind - { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, - - //Get XTRA-T Session Control Resp Ind - { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, - - //Inject Wifi Position Resp Ind - { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, - sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, - - //Notify Wifi Status Resp Ind - { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, - sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, - - //Get Registered Events Resp Ind - { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, - sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, - - //Set Operation Mode Resp Ind - { QMI_LOC_SET_OPERATION_MODE_IND_V02, - sizeof(qmiLocSetOperationModeIndMsgT_v02)}, - - //Get Operation Mode Resp Ind - { QMI_LOC_GET_OPERATION_MODE_IND_V02, - sizeof(qmiLocGetOperationModeIndMsgT_v02)}, - - //Set SPI Status Resp Ind - { QMI_LOC_SET_SPI_STATUS_IND_V02, - sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, - - //Inject Sensor Data Resp Ind - { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, - sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, - - //Inject Time Sync Data Resp Ind - { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, - sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, - - //Set Cradle Mount config Resp Ind - { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, - - //Get Cradle Mount config Resp Ind - { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, - - //Set External Power config Resp Ind - { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, - - //Get External Power config Resp Ind - { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, - - //Location server connection status - { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, - - //Set Protocol Config Parameters - { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, - - //Get Protocol Config Parameters - { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, - - //Set Sensor Control Config - { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, - - //Get Sensor Control Config - { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, - - //Set Sensor Properties - { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, - - //Get Sensor Properties - { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, - - //Set Sensor Performance Control Config - { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, - - //Get Sensor Performance Control Config - { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, - //Inject SUPL certificate - { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, - - //Delete SUPL certificate - { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, - - // Set Position Engine Config - { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, - - // Get Position Engine Config - { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)}, - - //Add a Circular Geofence - { QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, - sizeof(qmiLocAddCircularGeofenceIndMsgT_v02)}, - - //Delete a Geofence - { QMI_LOC_DELETE_GEOFENCE_IND_V02, - sizeof(qmiLocDeleteGeofenceIndMsgT_v02)} , - - //Query a Geofence - { QMI_LOC_QUERY_GEOFENCE_IND_V02, - sizeof(qmiLocQueryGeofenceIndMsgT_v02)}, - - //Edit a Geofence - { QMI_LOC_EDIT_GEOFENCE_IND_V02, - sizeof(qmiLocEditGeofenceIndMsgT_v02)}, - - //Get best available position - { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, - sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, - - //Inject motion data - { QMI_LOC_INJECT_MOTION_DATA_IND_V02, - sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, - - //Get NI Geofence list - { QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, - sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02)}, - - //Inject GSM Cell Info - { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, - sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02)}, - - //Inject Network Initiated Message - { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, - sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, - - //WWAN Out of Service Notification - { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, - sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)}, - - //Pedomete Report - { QMI_LOC_PEDOMETER_REPORT_IND_V02, - sizeof(qmiLocPedometerReportIndMsgT_v02)}, - - { QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, - sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02)}, - - { QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, - sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02)}, - - { QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, - sizeof(qmiLocInjectSubscriberIDIndMsgT_v02)} -}; - - -/** whether indication is an event or a response */ -typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; - - -/** @struct locClientInternalState - */ - -typedef struct locClientCbDataStructT locClientCallbackDataType; - -struct locClientCbDataStructT -{ - // client cookie - void *pClientCookie; - //QCCI handle for this control point - qmi_client_type userHandle; - - // callbacks registered by the clients - locClientEventIndCbType eventCallback; - locClientRespIndCbType respCallback; - locClientErrorCbType errorCallback; - - // the event mask the client has registered for - locClientEventMaskType eventRegMask; - - //pointer to itself for checking consistency data - locClientCallbackDataType *pMe; -}; - - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** locClientGetSizeAndTypeByIndId - * @brief this function gets the size and the type (event, - * response)of the indication structure from its ID - * @param [in] indId ID of the indication - * @param [out] type event or response indication - * @param [out] size size of the indications - * - * @return true if the ID was found, false otherwise */ - -static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, - locClientIndEnumT *pIndType) -{ - // look in the event table - if(true == locClientGetSizeByEventIndId(indId, pIndSize)) - { - *pIndType = eventIndType; - - LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - //else look in response table - if(true == locClientGetSizeByRespIndId(indId, pIndSize)) - { - *pIndType = respIndType; - - LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - // Id not found - LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); - return false; -} - -/** isClientRegisteredForEvent -* @brief checks the mask to identify if the client has -* registered for the specified event Id -* @param [in] eventIndId -* @param [in] eventRegMask -* @return true if client regstered for event; else false */ - -static bool isClientRegisteredForEvent( - locClientEventMaskType eventRegMask, - uint32_t eventIndId) -{ - size_t idx = 0, eventIndTableSize = 0; - - // look in the event table - eventIndTableSize = - (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); - - for(idx=0; idx>32), - (uint32_t)(eventRegMask & 0xFFFFFFFF), - (uint32_t)(locClientEventIndTable[idx].eventMask >> 32), - (uint32_t)(locClientEventIndTable[idx].eventMask & 0xFFFFFFFF)); - - return(( - eventRegMask & locClientEventIndTable[idx].eventMask)? - true:false); - } - } - LOC_LOGW("%s:%d]: eventId %d not found\n", __func__, __LINE__, - eventIndId); - return false; -} - -/** convertQmiResponseToLocStatus - @brief converts a qmiLocGenRespMsgT to locClientStatusEnumType* - @param [in] pResponse; pointer to the response received from - QMI_LOC service. - @return locClientStatusEnumType corresponding to the - response. -*/ - -static locClientStatusEnumType convertQmiResponseToLocStatus( - qmiLocGenRespMsgT_v02 *pResponse) -{ - locClientStatusEnumType status = eLOC_CLIENT_FAILURE_INTERNAL; - - // if result == SUCCESS don't look at error code - if(pResponse->resp.result == QMI_RESULT_SUCCESS_V01 ) - { - status = eLOC_CLIENT_SUCCESS; - } - else - { - switch(pResponse->resp.error) - { - case QMI_ERR_MALFORMED_MSG_V01: - case QMI_ERR_INVALID_ARG_V01: - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - - case QMI_ERR_DEVICE_IN_USE_V01: - status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; - break; - - default: - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - } - LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", - __func__, __LINE__, pResponse->resp.result, - pResponse->resp.error, status); - return status; -} - -/** convertQmiErrorToLocError - @brief converts a qmi service error type to - locClientErrorEnumType - @param [in] error received QMI service. - @return locClientErrorEnumType corresponding to the error. -*/ - -static locClientErrorEnumType convertQmiErrorToLocError( - qmi_client_error_type error) -{ - locClientErrorEnumType locError ; - switch(error) - { - case QMI_SERVICE_ERR: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - - default: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - } - LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", - __func__, __LINE__, error, locError); - return locError; -} - -/** locClienHandlePosReportInd - * @brief Validates a position report ind - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if pos report is valid, false otherwise -*/ -static bool locClientHandlePosReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate position report - qmiLocEventPositionReportIndMsgT_v02 *posReport = - (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", - __func__, __LINE__, ind_buf_len, - posReport->latitude, posReport->longitude, - posReport->altitudeWrtEllipsoid); - - return true; -} -//----------------------------------------------------------------------------- - -/** locClientHandleSatReportInd - * @brief Validates a satellite report indication. Dk - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if sat report is valid, false otherwise -*/ -static bool locClientHandleSatReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate sat reports - unsigned int idx = 0; - qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = - (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" - " validity = %d \n ", __func__, __LINE__, - ind_buf_len, satReport->altitudeAssumed, - satReport->svList_len, satReport->svList_valid); - //Log SV report - for( idx = 0; idx svList_len; idx++ ) - { - LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " - "status = %d \n", __func__, __LINE__, - satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, - satReport->svList[idx].system, satReport->svList[idx].svStatus); - } - - return true; -} - - -/** locClientHandleNmeaReportInd - * @brief Validate a NMEA report indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if nmea report is valid, false otherwise -*/ - - -static bool locClientHandleNmeaReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate NMEA report - return true; -} - -/** locClientHandleGetServiceRevisionRespInd - * @brief Handles a Get Service Revision Rresponse indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if service revision is valid, false otherwise -*/ - -static bool locClientHandleGetServiceRevisionRespInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - LOC_LOGV("%s:%d] :\n", __func__, __LINE__); - return true; -} - -/** locClientHandleIndication - * @brief looks at each indication and calls the appropriate - * validation handler - * @param [in] indId - * @param [in] indBuffer - * @param [in] indSize - * @return true if indication was validated; else false */ - -static bool locClientHandleIndication( - uint32_t indId, - void* indBuffer, - size_t indSize - ) -{ - bool status = false; - switch(indId) - { - // handle the event indications - //------------------------------------------------------------------------- - - // handle position report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - { - status = locClientHandlePosReportInd(indId, indBuffer, indSize); - break; - } - // handle satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - { - status = locClientHandleSatReportInd(indId, indBuffer, indSize); - break; - } - - // handle NMEA report - case QMI_LOC_EVENT_NMEA_IND_V02: - { - status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); - break; - } - - // handle NI Notify Verify Request Ind - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - { - // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Time Inject request Ind - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - { - // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle XTRA data Inject request Ind - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - { - // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle position inject request Ind - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - { - // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle engine state Ind - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - { - // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle fix session state Ind - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - { - // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Wifi request Ind - case QMI_LOC_EVENT_WIFI_REQ_IND_V02: - { - // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle sensor streaming ready status Ind - case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: - { - // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle time sync Ind - case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: - { - // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle set streaming report ind - case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: - { - // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - { - //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: - { - //locClientHandleNiGeofenceNotificationInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: - { - //locClientHandleGeofenceGenAlertInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: - { - //locClientHandleGeofenceBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : - { - //locClientHandlePedometerControlInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: - { - //locClientHandleMotionDataControlInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - //------------------------------------------------------------------------- - - // handle the response indications - //------------------------------------------------------------------------- - - // Get service Revision response indication - case QMI_LOC_GET_SERVICE_REVISION_IND_V02: - { - status = locClientHandleGetServiceRevisionRespInd(indId, - indBuffer, indSize); - break; - } - - case QMI_LOC_GET_FIX_CRITERIA_IND_V02: - { - status = true; - break; - } - - // predicted orbits data response indication - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: - { - //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // get predicted orbits source response indication - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: - { - //locClientHandleGetPredictedOrbitsSourceInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // get predicted orbits validity response indication - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: - { - //locClientHandleGetPredictedOrbitsDataValidityInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : - { - //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: - { - //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: - { - //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: - { - //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: - { - //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: - { - // locClientHandleAddCircularGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_DELETE_GEOFENCE_IND_V02: - { - // locClientHandleDeleteGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EDIT_GEOFENCE_IND_V02: - { - // locClientHandleEditGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_QUERY_GEOFENCE_IND_V02: - { - // locClientHandleQueryGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: - { - status = true; - break; - } - case QMI_LOC_GET_ENGINE_LOCK_IND_V02: - { - status = true; - break; - } - - case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: - { - status = true; - break; - } - - case QMI_LOC_PEDOMETER_REPORT_IND_V02: - { - status = true; - break; - } - - // for indications that only have a "status" field - case QMI_LOC_NI_USER_RESPONSE_IND_V02: - case QMI_LOC_INJECT_UTC_TIME_IND_V02: - case QMI_LOC_INJECT_POSITION_IND_V02: - case QMI_LOC_SET_ENGINE_LOCK_IND_V02: - case QMI_LOC_SET_SBAS_CONFIG_IND_V02: - case QMI_LOC_SET_NMEA_TYPES_IND_V02: - case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: - case QMI_LOC_SET_SERVER_IND_V02: - case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: - case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: - case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: - case QMI_LOC_SET_OPERATION_MODE_IND_V02: - case QMI_LOC_SET_SPI_STATUS_IND_V02: - case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_INJECT_MOTION_DATA_IND_V02: - case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: - case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: - case QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: - { - status = true; - break; - } - default: - LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, - (uint32_t)indId); - status = false; - break; - } - return status; -} - - -/** locClientErrorCb - * @brief handles the QCCI error events, this is called by the - * QCCI infrastructure when the service is no longer - * available. - * @param [in] user handle - * @param [in] error - * @param [in] *err_cb_data - */ - -static void locClientErrorCb -( - qmi_client_type user_handle, - qmi_client_error_type error, - void *err_cb_data -) -{ - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)err_cb_data; - locClientErrorCbType localErrorCallback = NULL; - - /* copy the errorCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and error callback. - */ - if(NULL != pCallbackData) - { - localErrorCallback = pCallbackData->errorCallback; - } - - LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", - __func__, __LINE__, error, err_cb_data); - - /* call the error callback - * To avoid calling the errorCallback after locClientClose - * is called, check pCallbackData->errorCallback again here - */ - - if( (NULL != pCallbackData) && - (NULL != localErrorCallback) && - (NULL != pCallbackData->errorCallback) && - (pCallbackData == pCallbackData->pMe) ) - { - //invoke the error callback for the corresponding client - localErrorCallback( - (locClientHandleType)pCallbackData, - convertQmiErrorToLocError(error), - pCallbackData->pClientCookie); - } -} - - -/** locClientIndCb - * @brief handles the indications sent from the service, if a - * response indication was received then the it is sent - * to the response callback. If a event indication was - * received then it is sent to the event callback - * @param [in] user handle - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @param [in] ind_cb_data */ - -static void locClientIndCb -( - qmi_client_type user_handle, - unsigned int msg_id, - void *ind_buf, - unsigned int ind_buf_len, - void *ind_cb_data -) -{ - locClientIndEnumT indType; - size_t indSize = 0; - qmi_client_error_type rc ; - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)ind_cb_data; - - LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", - __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, - pCallbackData); - - // check callback data - if(NULL == pCallbackData ||(pCallbackData != pCallbackData->pMe)) - { - LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); - return; - } - - // check user handle - if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) - { - LOC_LOGE("%s:%d]: invalid user_handle got %p expected %p\n", - __func__, __LINE__, - user_handle, pCallbackData->userHandle); - return; - } - // Get the indication size and type ( eventInd or respInd) - if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) - { - void *indBuffer = NULL; - - // if the client did not register for this event then just drop it - if( (eventIndType == indType) && - ( (NULL == pCallbackData->eventCallback) || - (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) - { - LOC_LOGW("%s:%d]: client is not registered for event %d\n", - __func__, __LINE__, (uint32_t)msg_id); - return; - } - - // decode the indication - indBuffer = malloc(indSize); - - if(NULL == indBuffer) - { - LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); - return; - } - - // decode the indication - rc = qmi_client_message_decode( - user_handle, - QMI_IDL_INDICATION, - msg_id, - ind_buf, - ind_buf_len, - indBuffer, - indSize); - - if( rc == QMI_NO_ERR ) - { - //validate indication - if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) - { - if(eventIndType == indType) - { - locClientEventIndUnionType eventIndUnion; - - /* copy the eventCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientEventIndCbType localEventCallback = - pCallbackData->eventCallback; - - // dummy event - eventIndUnion.pPositionReportEvent = - (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; - - /* call the event callback - * To avoid calling the eventCallback after locClientClose - * is called, check pCallbackData->eventCallback again here - */ - if((NULL != localEventCallback) && - (NULL != pCallbackData->eventCallback)) - { - localEventCallback( - (locClientHandleType)pCallbackData, - msg_id, - eventIndUnion, - pCallbackData->pClientCookie); - } - } - else if(respIndType == indType) - { - locClientRespIndUnionType respIndUnion; - - /* copy the respCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientRespIndCbType localRespCallback = - pCallbackData->respCallback; - - // dummy to suppress compiler warnings - respIndUnion.pDeleteAssistDataInd = - (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; - - /* call the response callback - * To avoid calling the respCallback after locClientClose - * is called, check pCallbackData->respCallback again here - */ - if((NULL != localRespCallback) && - (NULL != pCallbackData->respCallback)) - { - localRespCallback( - (locClientHandleType)pCallbackData, - msg_id, - respIndUnion, - pCallbackData->pClientCookie); - } - } - } - else // error handling indication - { - LOC_LOGE("%s:%d]: Error handling the indication %d\n", - __func__, __LINE__, (uint32_t)msg_id); - } - } - else - { - LOC_LOGE("%s:%d]: Error decoding indication %d\n", - __func__, __LINE__, rc); - } - if(indBuffer) - { - free (indBuffer); - } - } - else // Id not found - { - LOC_LOGE("%s:%d]: Error indication not found %d\n", - __func__, __LINE__,(uint32_t)msg_id); - } - return; -} - - -/** locClientRegisterEventMask - * @brief registers the event mask with loc service - * @param [in] clientHandle - * @param [in] eventRegMask - * @return true if indication was validated; else false */ - -static bool locClientRegisterEventMask( - locClientHandleType clientHandle, - locClientEventMaskType eventRegMask) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientReqUnionType reqUnion; - qmiLocRegEventsReqMsgT_v02 regEventsReq; - - memset(®EventsReq, 0, sizeof(regEventsReq)); - - regEventsReq.eventRegMask = eventRegMask; - reqUnion.pRegEventsReq = ®EventsReq; - - status = locClientSendReq(clientHandle, - QMI_LOC_REG_EVENTS_REQ_V02, - reqUnion); - - if(eLOC_CLIENT_SUCCESS != status ) - { - LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status) ); - return false; - } - - return true; -} - -/** validateRequest - @brief validates the input request - @param [in] reqId request ID - @param [in] reqPayload Union of pointers to message payload - @param [out] ppOutData Pointer to void *data if successful - @param [out] pOutLen Pointer to length of data if succesful. - @return false on failure, true on Success -*/ - -static bool validateRequest( - uint32_t reqId, - const locClientReqUnionType reqPayload, - void **ppOutData, - uint32_t *pOutLen ) - -{ - bool noPayloadFlag = false; - - LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); - switch(reqId) - { - case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); - break; - } - - case QMI_LOC_REG_EVENTS_REQ_V02: - { - *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); - break; - } - - case QMI_LOC_START_REQ_V02: - { - *pOutLen = sizeof(qmiLocStartReqMsgT_v02); - break; - } - - case QMI_LOC_STOP_REQ_V02: - { - *pOutLen = sizeof(qmiLocStopReqMsgT_v02); - break; - } - - case QMI_LOC_NI_USER_RESPONSE_REQ_V02: - { - *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_UTC_TIME_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); - break; - } - - case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_NMEA_TYPES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SERVER_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); - break; - } - - case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); - break; - } - - case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_OPERATION_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SPI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocAddCircularGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_QUERY_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocQueryGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_EDIT_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocEditGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); - break; - } - - case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02); - break; - } - - case QMI_LOC_PEDOMETER_REPORT_REQ_V02: - { - *pOutLen = sizeof(qmiLocPedometerReportReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: - { - *pOutLen = sizeof(qmiLocInjectSubscriberIDReqMsgT_v02); - break; - } - - // ALL requests with no payload - case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: - case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: - case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: - case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: - case QMI_LOC_GET_NMEA_TYPES_REQ_V02: - case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: - case QMI_LOC_GET_SERVER_REQ_V02: - case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: - case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: - case QMI_LOC_GET_OPERATION_MODE_REQ_V02: - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: - { - noPayloadFlag = true; - break; - } - - default: - LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, - reqId); - return false; - } - if(true == noPayloadFlag) - { - *ppOutData = NULL; - *pOutLen = 0; - } - else - { - //set dummy pointer for request union - *ppOutData = (void*) reqPayload.pInformClientRevisionReq; - } - LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, - reqId, *pOutLen); - return true; -} - -/** locClientQmiCtrlPointInit - @brief wait for the service to come up or timeout; when the - service comes up initialize the control point and set - internal handle and indication callback. - @param pQmiClient, -*/ - -static locClientStatusEnumType locClientQmiCtrlPointInit( - locClientCallbackDataType *pLocClientCbData) -{ - qmi_client_type clnt, notifier; - bool notifierInitFlag = false; - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - // instances of this service - qmi_service_info *pServiceInfo = NULL; - - do - { - uint32_t num_services = 0, num_entries = 0; - qmi_client_error_type rc = QMI_NO_ERR; - bool nosignal = false; - qmi_client_os_params os_params; - int timeout = 0; - - // Get the service object for the qmiLoc Service - qmi_idl_service_object_type locClientServiceObject = - loc_get_service_object_v02(); - - // Verify that qmiLoc_get_service_object did not return NULL - if (NULL == locClientServiceObject) - { - LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , - __func__, __LINE__ ); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - notifierInitFlag = (NULL != notifier); - - if (rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - // get the service addressing information - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - /* If service is not up wait on a signal until the service is up - * or a timeout occurs. */ - if (rc != QMI_NO_ERR) { - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); - nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - if (!nosignal) - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - } - - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc %d, nosignal %d, " - "total timeout %d", __func__, __LINE__, rc, nosignal, timeout); - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL && nosignal && rc != QMI_NO_ERR); - - if (0 == num_services || rc != QMI_NO_ERR) { - if (!nosignal) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!! Error %d \n", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - } else { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," - " final Err %d", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_TIMEOUT; - } - break; - } - - pServiceInfo = - (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); - - if(NULL == pServiceInfo) - { - LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", - __func__, __LINE__); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - //set the number of entries to get equal to the total number of - //services. - num_entries = num_services; - //populate the serviceInfo - rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, - &num_entries, &num_services); - - - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", - __func__, __LINE__, pLocClientCbData); - - // initialize the client - //sent the address of the first service found - // if IPC router is present, this will go to the service instance - // enumerated over IPC router, else it will go over the next transport where - // the service was enumerated. - rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, - locClientIndCb, (void *) pLocClientCbData, - NULL, &clnt); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_init error %d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to" - "qmi_client_register_error_cb \n", - __func__, __LINE__, pLocClientCbData); - - // register error callback - rc = qmi_client_register_error_cb(clnt, - locClientErrorCb, (void *) pLocClientCbData); - - if( QMI_NO_ERR != rc) - { - LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // copy the clnt handle returned in qmi_client_init - memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - - status = eLOC_CLIENT_SUCCESS; - - } while(0); - - /* release the notifier handle */ - if(true == notifierInitFlag) - { - qmi_client_release(notifier); - } - - if(NULL != pServiceInfo) - { - free((void *)pServiceInfo); - } - - return status; -} -//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- - -/** locClientOpen - @brief Connects a location client to the location engine. If the connection - is successful, returns a handle that the location client uses for - future location operations. - - @param [in] eventRegMask Mask of asynchronous events the client is - interested in receiving - @param [in] eventIndCb Function to be invoked to handle an event. - @param [in] respIndCb Function to be invoked to handle a response - indication. - @param [out] locClientHandle Handle to be used by the client - for any subsequent requests. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - non-zero error code(see locClientStatusEnumType)-- On failure. -*/ - -locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pClientCookie) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientCallbackDataType *pCallbackData = NULL; - - // check input parameters - if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) - || (NULL == pLocClientCallbacks->respIndCb) || - (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) - { - LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", - __func__, __LINE__); - return eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - } - - do - { - // Allocate memory for the callback data - pCallbackData = - ( locClientCallbackDataType*)calloc( - 1, sizeof(locClientCallbackDataType)); - - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize the QMI control point; this function will block - * until a service is up or a timeout occurs. If the connection to - * the service succeeds the callback data will be filled in with - * a qmi_client value. - */ - - - EXIT_LOG_CALLFLOW(%s, "loc client open"); - status = locClientQmiCtrlPointInit(pCallbackData); - - LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - - if(status != eLOC_CLIENT_SUCCESS) - { - free(pCallbackData); - pCallbackData = NULL; - LOC_LOGE ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - break; - } - // set the self pointer - pCallbackData->pMe = pCallbackData; - // set the handle to the callback data - *pLocClientHandle = (locClientHandleType)pCallbackData; - - if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) - { - LOC_LOGE("%s:%d]: Error sending registration mask\n", - __func__, __LINE__); - - // release the client - locClientClose(pLocClientHandle); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize rest of the client structure now that the connection - * to the service has been created successfully. - */ - - //fill in the event callback - pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; - - //fill in the response callback - pCallbackData->respCallback = pLocClientCallbacks->respIndCb; - - //fill in the error callback - pCallbackData->errorCallback = pLocClientCallbacks->errorCb; - - //set the client event registration mask - pCallbackData->eventRegMask = eventRegMask; - - // set the client cookie - pCallbackData->pClientCookie = (void *)pClientCookie; - - }while(0); - - if(eLOC_CLIENT_SUCCESS != status) - { - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); - } - - else - { - LOC_LOGD("%s:%d]: returning handle = %p, user_handle=%p, status = %d\n", - __func__, __LINE__, *pLocClientHandle, - pCallbackData->userHandle, status); - } - - return(status); -} - -/** locClientClose - @brief Disconnects a client from the location engine. - @param [in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) - On success. - - non-zero error code(see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientClose( - locClientHandleType* pLocClientHandle) -{ - // convert handle to callback data - locClientCallbackDataType *pCallbackData; - qmi_client_error_type rc = QMI_NO_ERR; //No error - - if(NULL == pLocClientHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid pointer to handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - pCallbackData = (locClientCallbackDataType *)(*pLocClientHandle); - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle || - pCallbackData != pCallbackData->pMe ) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - LOC_LOGV("locClientClose releasing handle %p, user handle %p\n", - *pLocClientHandle, pCallbackData->userHandle ); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, "loc client close"); - - // release the handle - rc = qmi_client_release(pCallbackData->userHandle); - if(QMI_NO_ERR != rc ) - { - LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", - __func__, __LINE__, rc, pCallbackData->userHandle); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* clear the memory allocated to callback data to minimize the chances - * of a race condition occurring between close and the indication - * callback - */ - memset(pCallbackData, 0, sizeof(*pCallbackData)); - - // free the memory assigned in locClientOpen - free(pCallbackData); - pCallbackData= NULL; - - // set the handle to invalid value - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - return eLOC_CLIENT_SUCCESS; -} - -/** locClientSendReq - @brief Sends a message to the location engine. If the locClientSendMsg() - function is successful, the client should expect an indication - (except start, stop, event reg and sensor injection messages), - through the registered callback in the locOpen() function. The - indication will contain the status of the request and if status is a - success, indication also contains the payload - associated with response. - @param [in] handle Handle returned by the locClientOpen() - function. - @param [in] reqId message ID of the request - @param [in] reqPayload Payload of the request, can be NULL - if request has no payload - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS ) - On success. - - non-zero error code (see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload ) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - qmi_client_error_type rc = QMI_NO_ERR; //No error - qmiLocGenRespMsgT_v02 resp; - uint32_t reqLen = 0; - void *pReqData = NULL; - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)handle; - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle || - pCallbackData != pCallbackData->pMe ) - { - // did not find the handle in the client List - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - // validate that the request is correct - if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) - { - - LOC_LOGE("%s:%d] error invalid request\n", __func__, - __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, - __LINE__, reqId, reqLen); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); - rc = qmi_client_send_msg_sync( - pCallbackData->userHandle, - reqId, - pReqData, - reqLen, - &resp, - sizeof(resp), - LOC_CLIENT_ACK_TIMEOUT); - - LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, - __LINE__, rc); - - if (rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - // map the QCCI response to Loc API v02 status - status = convertQmiResponseToLocStatus(&resp); - - // if the request is to change registered events, update the - // loc api copy of that - if(eLOC_CLIENT_SUCCESS == status && - QMI_LOC_REG_EVENTS_REQ_V02 == reqId) - { - if(NULL != reqPayload.pRegEventsReq ) - { - pCallbackData->eventRegMask = - (locClientEventMaskType)(reqPayload.pRegEventsReq->eventRegMask); - } - } - return(status); -} - -/** locClientGetSizeByRespIndId - * @brief Get the size of the response indication structure, - * from a specified id - * @param [in] respIndId - * @param [out] pRespIndSize - * @return true if resp ID was found; else false -*/ - -bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) -{ - size_t idx = 0, respIndTableSize = 0; - respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); - for(idx=0; idx -#include - -#include "location_service_v02.h" //QMI LOC Service data types definitions - -#include - -/****************************************************************************** - * Constants and configuration - *****************************************************************************/ - -/** @ingroup constants_macros - Specific value of #locClientHandleType, indicating an invalid handle. */ -#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) - - -/** @addtogroup data_types -@{ */ - -/** Location client handle used to represent a specific client. Negative values - are invalid handles. -*/ -typedef void* locClientHandleType; - -/** Data type for events and event masks. */ -typedef uint64_t locClientEventMaskType; - -/** Location client status values. -*/ -typedef enum -{ - eLOC_CLIENT_SUCCESS = 0, - /**< Request was successful. */ - - eLOC_CLIENT_FAILURE_GENERAL = 1, - /**< Failed because of a general failure. */ - - eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, - /**< Failed because the service does not support the command. */ - - eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, - /**< Failed because the request contained invalid parameters. */ - - eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, - /**< Failed because the engine is busy. */ - - eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, - /**< Failed because the phone is offline. */ - - eLOC_CLIENT_FAILURE_TIMEOUT = 6, - /**< Failed because of a timeout. */ - - eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, - /**< Failed because the service is not present. */ - - eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, - /**< Failed because the service version is unsupported. */ - - eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, - /**< Failed because the service does not support client version. */ - - eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, - /**< Failed because an invalid handle was specified. */ - - eLOC_CLIENT_FAILURE_INTERNAL = 11, - /**< Failed because of an internal error in the service. */ - - eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12, - /**< Failed because the service has not been initialized. */ - - eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 - /**< Failed because there is not enough memory to do the operation. */ - -}locClientStatusEnumType; - -/** Location client error values -*/ -typedef enum -{ - eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 - /**< Service is no longer available. Upon getting this error, the client - must close the existing connection and reopen the connection. */ - -}locClientErrorEnumType; - - -/** Request messages the client can send to the location engine. - - The following requests do not have any data associated, so they do not have a - payload structure defined: - - - GetServiceRevision - - GetFixCriteria - - GetPredictedOrbitsDataSource - - GetPredictedOrbitsDataValidity - - GetEngineLock - - GetSbasConfigReq - - GetRegisteredEvents - - GetNmeaTypes - - GetLowPowerMode - - GetXtraTSessionControl - - GetRegisteredEvents - - GetOperationMode - - GetCradleMountConfig - - GetExternalPowerConfig - - GetSensorControlConfig - - GetSensorPerformanceControlConfiguration - - WWANOutOfServiceNotification -*/ -typedef union -{ - const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; - /**< Notifies the service about the revision the client is using. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ - - const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; - /**< Changes the events the client is interested in receiving. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_REG_EVENTS_REQ_V02. */ - - const qmiLocStartReqMsgT_v02* pStartReq; - /**< Starts a positioning session. - - The client receives the following indications: position report, - satellite report, fix session report, and NMEA report (if applicable). - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_START_REQ_V02. */ - - const qmiLocStopReqMsgT_v02* pStopReq; - /**< Stops a positioning session. The client receives a fix session report - denoting that the fix session ended after this message was sent. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_STOP_REQ_V02. */ - - const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; - /**< Informs the service about the user response for a network-initiated call. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NI_USER_RESPONSE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ - - const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; - /**< Injects the predicted orbits data into the service. - - When all predicted orbits data parts have been injected, the client - receives the following indication containing a response: - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. - - The client injects successive data parts without waiting for this - indication as long as locClientSendReq() returns successfully. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ - - const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; - /**< Injects UTC time into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_UTC_TIME_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ - - const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; - /**< Injects a position into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_POSITION_REQ_V02. */ - - const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; - /**< Sets the location engine lock. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_ENGINE_LOCK_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ - - const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; - /**< Sets the SBAS configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SBAS_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ - - const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; - /**< Sets the NMEA types configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_NMEA_TYPES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ - - const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; - /**< Sets the Low Power mode configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ - - const qmiLocSetServerReqMsgT_v02* pSetServerReq; - /**< Sets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SERVER_REQ_V02. */ - - const qmiLocGetServerReqMsgT_v02* pGetServerReq; - /**< Gets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SERVER_REQ_V02. */ - - const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; - /**< Deletes the aiding data from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ - - const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; - /**< Sets XTRA-T session control in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ - - const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; - /**< Injects a WiFi position into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ - - const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; - /**< Notifies the engine about the WiFi status. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ - - const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; - /**< Sets the engine Operation mode. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_OPERATION_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ - - const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; - /**< Sends the stationary position status to the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SPI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SPI_STATUS_REQ_V02. */ - - const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; - /**< Injects sensor data into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ - - const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; - /**< Injects time synchronization information into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ - - const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; - /**< Sets the cradle mount state information in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - SET_CRADLE_MOUNT_CONFIG_REQ_V02. - - To send this request, set the reqId field in locClientSendReq() to - SET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; - /**< Sets external power configuration state in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ - - const qmiLocInformLocationServerConnStatusReqMsgT_v02* - pInformLocationServerConnStatusReq; - /**< Informs the engine about the connection status to the location server. - - This can be sent in response to a - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The - service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 - response indication for this request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. */ - - const qmiLocSetProtocolConfigParametersReqMsgT_v02* - pSetProtocolConfigParametersReq; - /**< Sets the protocol configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetProtocolConfigParametersReqMsgT_v02* - pGetProtocolConfigParametersReq; - /**< Retrieves protocol configuration parameters from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocSetSensorControlConfigReqMsgT_v02* - pSetSensorControlConfigReq; - /**< Sets the sensor control configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. */ - - const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* - pSetSensorPerformanceControlConfigReq; - /**< Sets the sensor performance configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. */ - - const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; - /**< Retrieves the sensor properties from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. */ - - const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; - /**< Sets the sensor properties in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. */ - - const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; - /**< Injects a SUPL certificate into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. */ - - const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; - /**< Deletes a SUPL certificate from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. */ - - const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* - pSetPositionEngineConfigParametersReq; - /**< Sets position engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* - pGetPositionEngineConfigParametersReq; - /**< Gets position engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; - /**< Adds a circular geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 */ - - const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; - /**< Deletes a geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_GEOFENCE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_GEOFENCE_REQ_V02 */ - - const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; - /**< Queries a geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_QUERY_GEOFENCE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_QUERY_GEOFENCE_REQ_V02. */ - - const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; - /**< Edits geofence parameters. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_EDIT_GEOFENCE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_EDIT_GEOFENCE_REQ_V02. */ - - const qmiLocGetBestAvailablePositionReqMsgT_v02* - pGetBestAvailablePositionReq; - /**< Get the best available position from location engine - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ - - const qmiLocInjectMotionDataReqMsgT_v02* pInjectMotionDataReq; - /**< Inject motion data in the location engine - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_MOTION_DATA_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_MOTION_DATA_REQ_V02 */ - - const qmiLocGetNiGeofenceIdListReqMsgT_v02* pGetNiGeofenceIdListReq; - /**< Get the list of Network Initiated Geofences from the location engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 */ - - const qmiLocInjectGSMCellInfoReqMsgT_v02 *pInjectGSMCellInfoReq; - /**< Inject GSM Cell Information into the location engine. - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 */ - - const qmiLocInjectNetworkInitiatedMessageReqMsgT_v02 - *pInjectNetworkInitiatedMessageReq; - /**< Inject Network Initiated Message into the location engine. - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ - - const void *pWWANOutOfServiceNotificationReq; - - const qmiLocPedometerReportReqMsgT_v02 *pPedometerReportReq; - /**< Send pedometer data to the location engine. If the request is - accepted by the service, the client receives the following - indication containing a response: - QMI_LOC_PEDOMETER_REPORT_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ - - const qmiLocInjectWCDMACellInfoReqMsgT_v02 *pInjectWCDMACellInfoReq; - const qmiLocInjectTDSCDMACellInfoReqMsgT_v02 *pInjectTDSCDMACellInfoReq; - const qmiLocInjectSubscriberIDReqMsgT_v02 *pInjectSubscriberIDReq; - -}locClientReqUnionType; - - -/** Event indications that are sent by the service. -*/ -typedef union -{ - const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; - /**< Contains the position information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. If - periodic fix criteria is specified, this event is generated multiple - times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is - sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ - - const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; - /**< Contains the GNSS satellite information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. This event - is generated at 1 Hz if the location engine is tracking satellites to - make a location fix. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ - - const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; - /**< Contains an NMEA report sentence. - - The entire NMEA report consisting of multiple sentences is sent at a - 1 Hz rate. This event is generated after QMI_LOC_START_REQ_V02 is sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NMEA_IND_V02. */ - - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; - /**< Notifies a location client when the network triggers a positioning - request to the mobile. - - Upon getting this event, the location client displays the - network-initiated fix request in a dialog and prompts the user to - accept or deny the request. The client responds to this request with - the message QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ - - const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; - /**< Asks the client for time assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The eventIndId field in the event indication callback is - set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ - - const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* - pInjectPredictedOrbitsReqEvent; - /**< Asks the client for predicted orbits data assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ - - const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; - /**< Asks the client for position assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_POSITION_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ - - const qmiLocEventEngineStateIndMsgT_v02* pEngineState; - /**< Sent by the engine whenever it turns on or off. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ - - const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; - /**< Sent by the engine when a location session begins or ends. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ - - const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; - /**< Sent by the engine when it needs WiFi support. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ - - const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* - pSensorStreamingReadyStatusEvent; - /**< Notifies the client that the engine is ready to accept sensor data. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ - - const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; - /**< Sent by the engine when it needs to synchronize its time with the sensor - processor time. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ - - const qmiLocEventSetSpiStreamingReportIndMsgT_v02* - pSetSpiStreamingReportEvent; - /**< Asks the client to start/stop sending a Stationary Position Indicator - (SPI) stream. - - The eventIndId field in the event indication callback is set to - QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ - - const qmiLocEventLocationServerConnectionReqIndMsgT_v02* - pLocationServerConnReqEvent; - /**< Sent by the engine to ask the client to open or close a connection to - a location server. - - The client responds to this request by sending the - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. */ - - const qmiLocEventNiGeofenceNotificationIndMsgT_v02* - pNiGeofenceNotificationEvent; - /**< Sent by the engine to notify the client about changes to a - network-initiated geofence. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. */ - - const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; - /**< Sent by the engine to notify the client about updates that may - affect a geofence operation. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. */ - - const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; - /**< Sent by the engine to notify the client about a geofence breach - event. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ - - const qmiLocEventPedometerControlIndMsgT_v02* pPedometerControlEvent; - /**< Sent by the engine to recommend how pedometer data is sent to the - location engine. - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02. @newpagetable */ - - const qmiLocEventMotionDataControlIndMsgT_v02* pMotionDataControlEvent; - /**< Sent by the engine to recommend how motion data is sent to the - location engine. - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02. @newpagetable */ - -}locClientEventIndUnionType; - - -/** Response indications that are sent by the service. -*/ -typedef union -{ - const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; - /**< Response to the QMI_LOC_GET_SERVICE_REVISION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ - - const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; - /**< Response to the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ - - const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; - /**< Response to the QMI_LOC_NI_USER_RESPONSE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_NI_USER_RESPONSE_IND_V02. */ - - const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* - pInjectPredictedOrbitsDataInd; - /**< Sent after a predicted orbits data part has been successfully injected. - - The client waits for this indication before injecting the next part. - This indication is sent in response to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* - pGetPredictedOrbitsDataSourceInd; - /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* - pGetPredictedOrbitsDataValidityInd; - /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ - - const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; - /**< Response to the QMI_LOC_INJECT_UTC_TIME_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_UTC_TIME_IND_V02. */ - - const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; - /**< Response to the QMI_LOC_INJECT_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_POSITION_IND_V02. */ - - const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; - /**< Response to the QMI_LOC_SET_ENGINE_LOCK_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ - - const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; - /**< Response to the QMI_LOC_GET_ENGINE_LOCK_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ - - const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; - /**< Response to the QMI_LOC_SET_SBAS_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ - - const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; - /**< Response to the QMI_LOC_GET_SBAS_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ - - const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; - /**< Response to the QMI_LOC_SET_NMEA_TYPES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_NMEA_TYPES_IND_V02. */ - - const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; - /**< Response to the QMI_LOC_GET_NMEA_TYPES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NMEA_TYPES_IND_V02. */ - - const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; - /**< Response to the QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; - /**< Response to the QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocSetServerIndMsgT_v02* pSetServerInd; - /**< Response to the QMI_LOC_SET_SERVER_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SERVER_IND_V02. */ - - const qmiLocGetServerIndMsgT_v02* pGetServerInd; - /**< Response to the QMI_LOC_GET_SERVER_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVER_IND_V02. */ - - const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; - /**< Response to the QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ - - const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; - /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; - /**< Response to the QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; - /**< Response to the QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ - - const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; - /**< Response to the QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ - - const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; - /**< Response to the QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ - - const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; - /**< Response to the QMI_LOC_SET_OPERATION_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_OPERATION_MODE_IND_V02. */ - - const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; - /**< Response to the QMI_LOC_GET_OPERATION_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_OPERATION_MODE_IND_V02. */ - - const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; - /**< Response to the QMI_LOC_SET_SPI_STATUS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SPI_STATUS_IND_V02. */ - - const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; - /**< Response to the QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ - - const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; - /**< Response to the QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ - - const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; - /**< Response to the QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ - - const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; - /**< Response to the QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; - /**< Response to the QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; - /**< Response to the QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocInformLocationServerConnStatusIndMsgT_v02* - pInformLocationServerConnStatusInd; - /**< Response to the QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ - - const qmiLocSetProtocolConfigParametersIndMsgT_v02* - pSetProtocolConfigParametersInd; - /**< Response to the QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetProtocolConfigParametersIndMsgT_v02* - pGetProtocolConfigParametersInd; - /**< Response to the QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; - /**< Response to the QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - */ - - const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; - /**< Response to the QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. - */ - - const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; - /**< Response to the QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - */ - - const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; - /**< Response to the QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - */ - - const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* - pSetSensorPerformanceControlConfigInd; - /**< Response to the - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ - - const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* - pGetSensorPerformanceControlConfigInd; - /**< Response to the - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ - - const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; - /**< Response to the QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. */ - - const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; - /**< Response to the QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. */ - - const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* - pSetPositionEngineConfigParametersInd; - /**< Response to the QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* - pGetPositionEngineConfigParametersInd; - /**< Response to the QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; - /**< Response to the QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. */ - - const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; - /**< Response to the QMI_LOC_DELETE_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_GEOFENCE_IND_V02. */ - - const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; - /**< Response to the QMI_LOC_QUERY_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_QUERY_GEOFENCE_IND_V02. */ - - const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; - /**< Response to the QMI_LOC_EDIT_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_EDIT_GEOFENCE_IND_V02. */ - - const qmiLocGetBestAvailablePositionIndMsgT_v02* - pGetBestAvailablePositionInd; - /**< Response to the QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ - - const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; - /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_MOTION_DATA_IND_V02. */ - - const qmiLocGetNiGeofenceIdListIndMsgT_v02* pGetNiGeofenceIdListInd; - /**< Response to the QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02. */ - - const qmiLocInjectGSMCellInfoIndMsgT_v02* pInjectGSMCellInfoInd; - /**< Response to the QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02. */ - - const qmiLocInjectNetworkInitiatedMessageIndMsgT_v02* - pInjectNetworkInitiatedMessageInd; - - /**< Response to the QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02. */ - - const qmiLocWWANOutOfServiceNotificationIndMsgT_v02* - pWWANOutOfServiceNotificationInd; - - /**< Response to the QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 - request. - The respIndId field in the response indication callback is set to - QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ - - const qmiLocPedometerReportIndMsgT_v02* pPedometerReportInd; - - /**< Response to the QMI_LOC_PEDOMETER_REPORT_REQ_V02 request. - The respIndId field in the response indication callback is set to - QMI_LOC_PEDOMETER_REPORT_IND_V02. */ - - const qmiLocInjectWCDMACellInfoIndMsgT_v02 *pInjectWCDMACellInfoInd; - const qmiLocInjectTDSCDMACellInfoIndMsgT_v02 *pInjectTDSCDMACellInfoInd; - const qmiLocInjectSubscriberIDIndMsgT_v02 *pInjectSubscriberIDInd; - -}locClientRespIndUnionType; - -/** @} */ /* end_addtogroup data_types */ - -/** @addtogroup callback_functions -@{ */ -/** - Location event indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the asynchronous event indications. - - @datatypes - #locClientHandleType \n - #locClientEventIndUnionType - - @param handle Location client for this event. Only the client who - registered for the corresponding event receives - this callback. - @param eventIndId ID of the event indication. - @param eventIndPayload Event indication payload. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @return - None. - - @dependencies - None. @newpage -*/ -typedef void (*locClientEventIndCbType)( - locClientHandleType handle, - uint32_t eventIndId, - const locClientEventIndUnionType eventIndPayload, - void *pClientCookie -); - -/** - Location response indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the response indications. - - @datatypes - #locClientHandleType \n - #locClientRespIndUnionType - - @param handle Location client who sent the request for which this - response indication is generated. - @param respIndId ID of the response. It is the same value as the ID - of request sent to the engine. - @param respIndPayload Payload of the response indication. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @return - None. - - @dependencies - None. @newpage -*/ -typedef void (*locClientRespIndCbType)( - locClientHandleType handle, - uint32_t respIndId, - const locClientRespIndUnionType respIndPayload, - void *pClientCookie -); - -/** - Location error callback function type. This function is called to inform - the client that the service is no longer available. When the client - receives this callback, it must close the existing connection and reopen - the client connection. - - @datatypes - #locClientHandleType \n - #locClientErrorEnumType - - @param handle Location client who sent the request for which this - error indication is generated. - @param errorId Error ID. - @param pClientCookie Payload associated with the error indication. - - @return - None. - - @dependencies - None. -*/ -typedef void (*locClientErrorCbType)( - locClientHandleType handle, - locClientErrorEnumType errorId, - void* pClientCookie - ); -/** @} */ /* end_addtogroup callback_functions */ - - -/** @ingroup data_types - Callback functions to be registered during locClientOpen(). -*/ -typedef struct -{ - uint32_t size; /**< Size of the structure. */ - locClientEventIndCbType eventIndCb; /**< Event indication callback. */ - locClientRespIndCbType respIndCb; /**< Response indication callback. */ - locClientErrorCbType errorCb; /**< Error indication callback. - @newpagetable */ -}locClientCallbacksType; - - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ -/** @addtogroup operation_functions -@{ */ -/*========================================================================== - locClientOpen */ -/** @xreflabel{hdr:locClientOpenFunction} - Connects a location client to the location engine. If the connection is - successful, this function returns a handle that the location client uses for - future location operations. - - @datatypes - #locClientStatusEnumType \n - #locClientEventMaskType \n - #locClientCallbacksType \n - #locClientHandleType - - @param[in] eventRegMask Mask of asynchronous events the client is - interested in receiving. - @param[in] pLocClientCallbacks Pointer to structure containing the - callbacks. - @param[out] pLocClientHandle Pointer to the handle to be used by the - client for any subsequent requests. - @param[in] pLocClientCookie Pointer to a cookie to be returned to the - client along with the callbacks. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - Non-zero error code (see #locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pLocClientCookie -); - - -/*========================================================================== - locClientClose */ -/** @xreflabel{hdr:locClientCloseFunction} - Disconnects a client from the location engine and sets the handle to - LOC_CLIENT_INVALID_HANDLE_VALUE. - - @datatypes - #locClientStatusEnumType \n - #locClientHandleType - - @param[in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientClose ( - locClientHandleType* pLocClientHandle -); - -/*============================================================================= - locClientSendReq */ -/** @xreflabel{hdr:locClientSendReqFunction} - Sends a message to the location engine. If this function is successful, the - client expects an indication (except start, stop, event registration, and - sensor injection messages) through the registered callback in the - locClientOpen() function. - - The indication contains the status of the request. If the status is a success, - the indication also contains the payload associated with response. - - @datatypes - #locClientStatusEnumType \n - #locClientHandleType \n - #locClientReqUnionType - - @param[in] handle Handle returned by the locClientOpen() function. - @param[in] reqId QMI_LOC service message ID of the request. - @param[in] reqPayload Payload of the request. This can be NULL if the - request has no payload. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload -); - - -/*============================================================================= - locClientGetSizeByEventIndId */ -/** Gets the size of the event indication structure from a specified ID. - - @param[in] eventIndId Event indicator ID. - @param[out] pEventIndSize Pointer to the size of the structure. - - @return - TRUE -- The event ID was found. \n - FALSE -- Otherwise. - - @dependencies - None. @newpage -*/ -extern bool locClientGetSizeByEventIndId( - uint32_t eventIndId, - size_t *pEventIndSize); - - -/*============================================================================= - locClientGetSizeByRespIndId */ -/** Gets the size of the response indication structure from a specified ID. - - @param[in] respIndId Response indicator ID. - @param[out] pRespIndSize Pointer to the size of the structure. - - @return - TRUE -- The response ID was found. \n - FALSE -- Otherwise. - - @dependencies - None. -*/ -extern bool locClientGetSizeByRespIndId( - uint32_t respIndId, - size_t *pRespIndSize); - -/*=============================================================================*/ -/** @} */ /* end_addtogroup operation_functions */ - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c deleted file mode 100644 index 769222b8..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ /dev/null @@ -1,293 +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 - -static loc_name_val_s_type loc_v02_event_name[] = -{ - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_START_REQ_V02), - NAME_VAL(QMI_LOC_START_RESP_V02), - NAME_VAL(QMI_LOC_STOP_REQ_V02), - NAME_VAL(QMI_LOC_STOP_RESP_V02), - NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02) -}; -static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_event_name(uint32_t event) -{ - return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); -} - -static loc_name_val_s_type loc_v02_client_status_name[] = -{ - NAME_VAL(eLOC_CLIENT_SUCCESS), - NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), - NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), - NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), - NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), - NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), - NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY), -}; -static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_client_status_name(locClientStatusEnumType status) -{ - return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); -} - - -static loc_name_val_s_type loc_v02_qmi_status_name[] = -{ - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02, - eQMI_LOC_SUCCESS_V02, - eQMI_LOC_GENERAL_FAILURE_V02, - eQMI_LOC_UNSUPPORTED_V02, - eQMI_LOC_INVALID_PARAMETER_V02, - eQMI_LOC_ENGINE_BUSY_V02, - eQMI_LOC_PHONE_OFFLINE_V02, - eQMI_LOC_TIMEOUT_V02, - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02, - eQMI_LOC_INSUFFICIENT_MEMORY_V02, - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 -}; -static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) -{ - return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); -} diff --git a/loc_api/loc_api_v02/loc_api_v02_log.h b/loc_api/loc_api_v02/loc_api_v02_log.h deleted file mode 100644 index 8d4670c3..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.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_API_V02_LOG_H -#define LOC_API_V02_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include - -const char* loc_get_v02_event_name(uint32_t event); -const char* loc_get_v02_client_status_name(locClientStatusEnumType status); -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); - - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_LOG_H */ diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h deleted file mode 100644 index 7f4e62d2..00000000 --- a/loc_api/loc_api_v02/loc_util_log.h +++ /dev/null @@ -1,75 +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_UTIL_LOG_H -#define LOC_UTIL_LOG_H - -#if defined(_ANDROID_) -#include "loc_api_v02_log.h" -#include - -#else // no _ANDROID_ - -// common for QNX and Griffon - -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#define loc_get_v02_event_name(X) #X -#define loc_get_v02_client_status_name(X) #X - -#define loc_get_v02_qmi_status_name(X) #X - -//specific to OFF TARGET -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -#include -# include -# include - -// get around strl*: not found in glibc -// TBD:look for presence of eglibc other libraries -// with strlcpy supported. -#define strlcpy(X,Y,Z) strcpy(X,Y) -#define strlcat(X,Y,Z) strcat(X,Y) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -#endif //_ANDROID_ - -#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c deleted file mode 100644 index c7ebd6db..00000000 --- a/loc_api/loc_api_v02/location_service_v02.c +++ /dev/null @@ -1,3328 +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. - */ - -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 6.0 - It requires encode/decode library version 5 or later - It was generated on: Thu Dec 13 2012 (Spin ) - From IDL File: location_service_v02.idl */ - -#include "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), - QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), - QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), - QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 8, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 9, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 10, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 7, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 12, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 12, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 17, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 17, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 21, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 30, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), - 32, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocMotionDataStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mnc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, cid), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTDSCDMACellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mcc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mnc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, cid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, lac), - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), - 0x2C, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 4, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 14, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), - 15, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), - 16, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 18, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 19, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 20, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 22, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 22, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), - 22, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), - 22, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) -}; - -static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) -}; - -static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 23, 0 -}; - -static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) -}; - -static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), - QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), - QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, - QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), - QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 14, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), - 15, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), - 16, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 19, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 20, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 24, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 25, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 26, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 27, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 28, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 29, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 31, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 31, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), - 33, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), - 0x16, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), - 33, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted_valid)), - 0x14, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 34, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 21, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 21, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 21, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 21, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) -}; - -static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), - - 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 35, 0, - - 0x03, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), - - 0x04, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) -}; - -static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) -}; - -static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 35, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) -}; - -static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) -}; - -static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) -}; - -static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), - 0x12, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), - 0x16, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), - 0x1B, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), - 0x1C, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), - 0x21, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), - 0x24, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), - 0x25, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), - 0x26, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), - 0x27, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), - 0x29, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), - 0x2C, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), - 0x2D, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 36, 0 -}; - -static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), - QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) -}; - -static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 37, 0, - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) -}; - -static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), - 38, 0, - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) -}; - -static const uint8_t qmiLocInjectWCDMACellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), - 39, 0, - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) -}; - -static const uint8_t qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSubscriberIDReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) -}; - -static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), - ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) -}; - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) -}; - -static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), - - 0x04, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) -}; - -static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, - {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, - {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, - {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, - {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, - {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, - {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, - {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, - {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 103}, - {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 26), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 28), 1345}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 30), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 34), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 36), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 38), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 42), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 46), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 50), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 54), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 58), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 60), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 64), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 66), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 68), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 70), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 74), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 76), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 2063}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 80), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 90), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 53}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 94), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 98), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 102), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 106), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 110), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 12}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 114), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 124), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 126), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 128), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 130), 30}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 138), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 140), 0}, - {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 142), 46}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 132), 36}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 134), 33}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 136), 22} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_QUERY_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_EDIT_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_PEDOMETER_REPORT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 388}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, QMI_IDL_TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, QMI_IDL_TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, QMI_IDL_TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, QMI_IDL_TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, QMI_IDL_TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, QMI_IDL_TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 15), 32}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 25), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 27), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 29), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 31), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 33), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 35), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 43), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 47), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 51), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 55), 11}, - {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 7}, - {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 59), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 65), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 69), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 71), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 75), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 77), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 30}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 81), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 91), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 95), 60}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 103), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 107), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 111), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 115), 19}, - {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, - {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, - {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 125), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 127), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 129), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, - {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 22), 15}, - {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 23), 4}, - {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 135), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 137), 7} -}; - -/*Service Object*/ -struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x05, - 0x02, - 0x10, - 2248, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02, - 0x12, - NULL -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} - diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h deleted file mode 100644 index 57f7c746..00000000 --- a/loc_api/loc_api_v02/location_service_v02.h +++ /dev/null @@ -1,8783 +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_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ - -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 6.0 - It requires encode/decode library version 5 or later - It was generated on: Thu Dec 13 2012 (Spin ) - From IDL File: location_service_v02.idl */ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x12 -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x06 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x0072; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum string length for the Provider field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 - -/** Maximum string length for the Name field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 - -/** Maximum string length for the Version field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 - -/** Maximum length of the list containing the SVs that were used to generate - a position report. */ -#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum GNSS Measurement Engine Firmware Version String length. */ -#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ -#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Full Version String length. */ -#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of the SUPL certificate. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 - -/** Maximum length of the network-initiated Geofence ID - list. */ -#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 - -/** Maximum value of WDMA frequency for injection of WCDMA cell - information */ -#define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 - -/** Maximum value of PSC for injection of WCDMA cell information */ -#define QMI_LOC_MAX_WCDMA_PSC_V02 511 - -/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell - information */ -#define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 - -/** Maximum length of the injected network-initiated message. */ -#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI notify verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time-sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. */ -#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. */ -#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. */ -#define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Refer to the definition of the following bitmasks: - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. - - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. - - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. - - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. - - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. - - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. - - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. - - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. - - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; - /**< Application provider. */ - - char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; - /**< Application name. */ - - uint8_t applicationVersion_valid; - /**< Specifies whether the application version string contains - a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid - \item 0x01 (TRUE) -- Application version string is valid - \vspace{-0.18in} \end{itemize1} */ - - char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; - /**< Application version. */ -}qmiLocApplicationIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Units: Milliseconds \n - - Default: 1000 ms - */ - - /* Optional */ - /* ID of the Application that Sent this Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to - generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \item PDOP = square root of (HDOP^2 + VDOP^2) - \vspace{-0.18in} \end{itemize1} */ - - float HDOP; - /**< Horizontal dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ - - float VDOP; - /**< Vertical dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors were used in calculating the position in the - position report. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SENSOR_USED_ ACCEL - \item 0x00000002 -- SENSOR_USED_ GYRO - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results were aided by sensors. - - Valid bitmasks: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from system clock (better known as slow clock). - GNSS time is maintained irrespective of the GNSS receiver state */ - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the position report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SESS_STATUS_ SUCCESS - \item 0x00000001 -- SESS_STATUS_ IN_PROGRESS - \item 0x00000002 -- SESS_STATUS_ GENERAL_FAILURE - \item 0x00000003 -- SESS_STATUS_ TIMEOUT - \item 0x00000004 -- SESS_STATUS_ USER_END - \item 0x00000005 -- SESS_STATUS_ BAD_PARAMETER - \item 0x00000006 -- SESS_STATUS_ PHONE_OFFLINE - \item 0x00000007 -- SESS_STATUS_ ENGINE_LOCKED - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< 3-D Speed uncertainty.\n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_ LOCATION - \item 0x00000020 -- INJECTED_COARSE_ POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). - GNSS time is maintained irrespective of the GNSS receiver state */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \n Whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- VALID_SYSTEM - \item 0x00000002 -- VALID_GNSS_SVID - \item 0x00000004 -- VALID_HEALTH_ STATUS - \item 0x00000008 -- VALID_PROCESS_ STATUS - \item 0x00000010 -- VALID_SVINFO_ MASK - \item 0x00000020 -- VALID_ELEVATION - \item 0x00000040 -- VALID_AZIMUTH - \item 0x00000080 -- VALID_SNR - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} */ - - uint16_t gnssSvId; - /**< GNSS SV ID. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For GLONASS: 1 to 32 - \item For SBAS: 120 to 151 - \end{itemize1} \end{itemize1} - - The GPS and GLONASS SVs can be disambiguated using the system field. */ - - uint8_t healthStatus; - /**< Health status. - \begin{itemize1} - \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy - \vspace{-0.18in} \end{itemize1}*/ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Source */ - uint8_t altitudeAssumed; - /**< Whether altitude is assumed or calculated: \begin{itemize1} - \item 0x00 (FALSE) -- Valid altitude is calculated - \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be - enough satellites to determine precise altitude - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends NMEA sentences to the control point */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 201 - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_VX_MS_ ASSISTED_ONLY - \item 0x00000002 -- NI_VX_MS_BASED_ ONLY - \item 0x00000003 -- NI_VX_MS_ ASSISTED_PREFERRED_ MS_BASED_ALLOWED - \item 0x00000004 -- NI_VX_MS_ BASED_PREFERRED_ MS_ASSISTED_ALLOWED - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \begin{itemize1} - \item 0x00000000 -- NI_VX_OCTET - \item 0x00000001 -- NI_VX_EXN_ PROTOCOL_MSG - \item 0x00000002 -- NI_VX_ASCII - \item 0x00000003 -- NI_VX_IA5 - \item 0x00000004 -- NI_VX_UNICODE - \item 0x00000005 -- NI_VX_SHIFT_JIS - \item 0x00000006 -- NI_VX_KOREAN - \item 0x00000007 -- NI_VX_LATIN_ HEBREW - \item 0x00000008 -- NI_VX_LATIN - \item 0x00000009 -- NI_VX_GSM - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \begin{itemize1} - \item 0x00000000 -- FORMAT_LOGICAL_ NAME - \item 0x00000001 -- FORMAT_EMAIL_ ADDRESS - \item 0x00000002 -- FORMAT_MSISDN - \item 0x00000003 -- FORMAT_URL - \item 0x00000004 -- FORMAT_SIP_URL - \item 0x00000005 -- FORMAT_MIN - \item 0x00000006 -- FORMAT_MDN - \item 0x00000007 -- FORMAT_ IMSPUBLIC_IDENTITY - \item 0x7FFFFFFF -- FORMAT_OSS_ UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID*/ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. */ - - uint16_t port; - /**< IPV4 port. */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL notify verify request event. This mask is set in - the valid_flags field of a notify verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid_flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SUPL_SERVER_INFO - \item 0x00000002 -- SUPL_SESSION_ID - \item 0x00000004 -- SUPL_HASH - \item 0x00000008 -- SUPL_POS_METHOD - \item 0x00000010 -- SUPL_DATA_ CODING_SCHEME - \item 0x00000020 -- SUPL_REQUESTOR_ ID - \item 0x00000040 -- SUPL_CLIENT_ NAME - \item 0x00000080 -- SUPL_QOP - \item 0x00000100 -- SUPL_USER_RESP_ TIMER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \begin{itemize1} - \item 0x00000001 -- AGPS_SETASSISTED - \item 0x00000002 -- AGPS_SETBASED - \item 0x00000003 -- AGPS_ SETASSISTED_PREF - \item 0x00000004 -- AGPS_SETBASED_ PREF - \item 0x00000005 -- AUTONOMOUS_GPS - \item 0x00000006 -- AFLT - \item 0x00000007 -- ECID - \item 0x00000008 -- EOTD - \item 0x00000009 -- OTDOA - \item 0x0000000A -- NO_POSITION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds*/ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI notify verify request event. - This mask is set in the valid flags field of a - notify verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- INVOKE_ID_MASK - \item 0x0002 -- DATA_CODING_ SCHEME_MASK - \item 0x0004 -- NOTIFICATION_TEXT_ MASK - \item 0x0008 -- CLIENT_ADDRESS_ MASK - \item 0x0010 -- LOCATION_TYPE_ MASK - \item 0x0020 -- REQUESTOR_ID_MASK - \item 0x0040 -- CODEWORD_STRING_ MASK - \item 0x0080 -- SERVICE_TYPE_MASK - \item 0x0100 -- USER_RESP_TIMER_ MASK - \vspace{-0.18in} \end{itemize1} - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- CURRENT_ LOCATION - \item 0x00000002 -- CURRENT_OR_ LAST_KNOWN_LOCATION - \item 0x00000004 -- INITIAL_LOCATION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ONGOING_NI_ INCOMING_MO - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID - and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of - multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed - as part of multiple location ID in the SUPL_POS_INIT message. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event - triggered session. */ - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; - /**< Specifies which type of network measurements are allowed to be sent as - part of the Location ID or Multiple Location IDs parameter in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- SUPPORTED_NETWORK_ WLAN - \item 0x0002 -- SUPPORTED_NETWORK_ GSM - \item 0x0004 -- SUPPORTED_NETWORK_ WCDMA - \item 0x0008 -- SUPPORTED_NETWORK_ CDMA - \item 0x0010 -- SUPPORTED_NETWORK_ HRDP - \item 0x0020 -- SUPPORTED_NETWORK_ UMB - \item 0x0040 -- SUPPORTED_NETWORK_ LTE - \item 0x0080 -- SUPPORTED_NETWORK_ WIMAX - \item 0x0100 -- SUPPORTED_NETWORK_ HISTORIC - \item 0x0200 -- SUPPORTED_NETWORK_ NONSVRV - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; - /**< Specifies the type of session trigger requested in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid values: \begin{itemize1} - \item 0xFFFFFFFF -- TRIGGER_TYPE_ SINGLE_SHOT - \item 0x00000000 -- TRIGGER_TYPE_ PERIODIC - \item 0x00000001 -- TRIGGER_TYPE_ AREA_EVENT - \vspace{-0.18in} \end{itemize1} */ - - qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; - /**< Specifies which GNSS technologies are allowed as positioning - technologies. - - Valid bitmasks: \n - - 0x0001 -- GNSS_GPS \n - - 0x0002 -- GNSS_GLONASS \n - - 0x0004 -- GNSS_GALILEO \n - - 0x0008 -- GNSS_SBAS \n - - 0x0010 -- GNSS_QZSS \n - - 0x0020 -- GNSS_MODERN_GPS - */ -}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< The ESLP URL - Maximum length: 255 bytes */ -}qmiLocEmergencyNotificationStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI notify/verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_ VERIFY - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_ RESP - \item 0x00000005 -- PRIVACY_ OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL - indication payload. */ - - /* Optional */ - /* SUPL Emergency Notification */ - uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ - qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< This specifies that the corresponding NI notification is an - emergency notification. Emergency notification - can be given even without an ESLP address */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \begin{itemize1} - \item 0x00000000 -- START_PERIODIC_ HI_FREQ_FIXES - \item 0x00000001 -- START_PERIODIC_ KEEP_WARM - \item 0x00000002 -- STOP_PERIODIC_ FIXES - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n - - samplesPerBatch must be a nonzero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in an integral number of batches per - second (Hz). \vspace{-0.06in} \n - - batchesPerSecond must be a nonzero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor - data - \item 0x00 (FALSE) -- GNSS location engine is not ready to accept - sensor data - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - sensor data. - */ - - /* Optional */ - /* Gyroscope Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope sensor - data. - */ - - /* Optional */ - /* Accelerometer Temperature Accept Ready */ - uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; - /**< \n Whether the GNSS location engine is ready to accept accelerometer - temperature data. - */ - - /* Optional */ - /* Gyroscope Temperature Accept Ready */ - uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; - /**< \n Whether the GNSS location engine is ready to accept gyroscope - temperature data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Whether the client is to start or stop sending an SPI status stream. - \begin{itemize1} - \item 0x01 (TRUE) -- Client is to start sending an SPI status stream - \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- WWAN_TYPE_ INTERNET - \item 0x00000001 -- WWAN_TYPE_ AGNSS - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ - eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ - eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the - Geofence to find the its current state. */ - QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiGeofenceOperationEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Informs the control point about - network-initiated Geofences. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Operation Type */ - qmiLocNiGeofenceOperationEnumT_v02 operationType; - /**< Operation for which this notification was generated. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_GEOFENCE_ ADDED - \item 0x00000002 -- NI_GEOFENCE_ DELETED - \item 0x00000003 -- NI_GEOFENCE_ EDITED - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes - cannot be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can - be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage - information is available. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ - QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceGenAlertEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of the - Geofence status. */ -typedef struct { - - /* Mandatory */ - /* Geofence General Alert */ - qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_GEN_ ALERT_GNSS_UNAVAILABLE - \item 0x00000002 -- GEOFENCE_GEN_ ALERT_GNSS_AVAILABLE - \item 0x00000003 -- GEOFENCE_GEN_ ALERT_OOS - \item 0x00000004 -- GEOFENCE_GEN_ ALERT_TIME_INVALID - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ - QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceBreachTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Elliptical Horizontal Uncertainty Azimuth */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Horizontal Speed validity bit */ - uint8_t speedHorizontal_valid; - /**< Indicates whether the Horizontal speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Horizontal speed is valid - \item 0x00 (FALSE) -- Horizontal speed is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Horizontal Speed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Altitude validity bit */ - uint8_t altitudeWrtEllipsoid_valid; - /**< Indicates whether the altitude field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Altitude field is valid - \item 0x00 (FALSE) -- Altitude field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} - */ - - /* Altitude With Respect to Ellipsoid */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Vertical Uncertainty validity bit */ - uint8_t vertUnc_valid; - /**< Indicates whether the Vertical Uncertainty field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Uncertainty field is valid - \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Uncertainty */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Vertical Speed validity bit */ - uint8_t speedVertical_valid; - /**< Indicates whether the Vertical Speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Speed field is valid - \item 0x00 (FALSE) -- Vertical Speed field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Speed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* heading validity bit */ - uint8_t heading_valid; - /**< Indicates whether the Heading field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Heading field is valid - \item 0x00 (FALSE) -- Heading field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Heading */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ -}qmiLocGeofencePositionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of - a Geofence breach event. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Geofence Breach Type */ - qmiLocGeofenceBreachTypeEnumT_v02 breachType; - /**< The type of breach that generated this event. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ BREACH_TYPE_ENTERING - \item 0x00000002 -- GEOFENCE_ BREACH_TYPE_LEAVING - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Geofence Position */ - uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ - qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< \n Position of the client when it breached the Geofence. - This TLV is included if the client configures the - Geofence to report position. The position is reported - at the same confidence level that was specified in the - Add Circular Geofence request. */ -}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Recommends how pedometer reports should be - sent to the location engine */ -typedef struct { - - /* Mandatory */ - /* Request Pedometer Data */ - uint8_t requestPedometerData; - /**< \n Whether GNSS location engine is requesting the client to - send pedometer data. - \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting - pedometer data - \item 0x00 (FALSE) -- GNSS location engine is not requesting - pedometer data - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Reset Step Count */ - uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ - uint8_t resetStepCount; - /**< Whether location engine desires the step count to be reset. - \begin{itemize1} - \item 0x01 (TRUE) -- Pedometer step count should be reset. - \item 0x00 (FALSE) -- Pedometer step count should not be reset. - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Step Count Threshold */ - uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ - uint32_t stepCountThreshold; - /**< Specifies the number of steps to be sampled in a pedometer report - as recommended by the the location engine. If the threshold is set to 0 - then the location engine desires a pedometer report at every step event. - */ -}qmiLocEventPedometerControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Recommends how motion data reports should be - sent to the location engine */ -typedef struct { - - /* Mandatory */ - /* Request Motion Data */ - uint8_t requestMotionData; - /**< \n Whether GNSS location engine is requesting the client to - send motion data. - \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting - motion data - \item 0x00 (FALSE) -- GNSS location engine is not requesting - motion data - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventMotionDataControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ - eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ - eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent - memory for the request. */ - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. */ - - /* Optional */ - /* GNSS Measurement Engine Firmware Version String */ - uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ - char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS measurement engine software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in} \end{itemize1} - - \textbf{Note:} This string is only provided on platforms that have - a measurement engine that supports this version string. On all other - platforms, this optional TLV is not provided. */ - - /* Optional */ - /* GNSS Hosted Software Version String */ - uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ - char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS hosted software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in}\end{itemize1} - - \textbf{Note:} This string is only provided on hosted architectures - (measurement and position engine running on different processors) that - support this version string. On all other platforms, this optional TLV - is not provided. */ - - /* Optional */ - /* GNSS Software Version String */ - uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ - char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Aggregate version of the GNSS software. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Units: Milliseconds */ - - /* Optional */ - /* ID of the Application that Sent the Position Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied notify verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to notify verify request. */ - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NOTIFY_VERIFY_ ACCEPT - \item 0x00000002 -- NOTIFY_VERIFY_ DENY - \item 0x00000003 -- NOTIFY_VERIFY_ NORESP - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_ VERIF - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_ RESP - \item 0x00000005 -- PRIVACY_ OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \n Optional SUPL Version 2 Extension payload. */ - - /* Optional */ - /* SUPL Emergency Notification */ - uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ - qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< SUPL Emergency notification payload. Emergency notification - can be given even without an ESLP address */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \begin{itemize1} - \item 0x00000000 -- PREDICTED_ ORBITS_XTRA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Units: Milliseconds */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ALT_SRC_ UNKNOWN - \item 0x00000001 -- ALT_SRC_GPS - \item 0x00000002 -- ALT_SRC_CELL_ID - \item 0x00000003 -- ALT_SRC_ ENHANCED_CELL_ID - \item 0x00000004 -- ALT_SRC_WIFI - \item 0x00000005 -- ALT_SRC_ TERRESTRIAL - \item 0x00000006 -- ALT_SRC_ TERRESTRIAL_HYBRID - \item 0x00000007 -- ALT_SRC_ ALTITUDE_DATABASE - \item 0x00000008 -- ALT_SRC_ BAROMETRIC_ALTIMETER - \item 0x00000009 -- ALT_SRC_OTHER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SRC_LINKAGE_ NOT_SPECIFIED - \item 0x00000001 -- SRC_LINKAGE_ FULLY_INTERDEPENDENT - \item 0x00000002 -- SRC_LINKAGE_ DEPENDS_ON_LAT_LONG - \item 0x00000003 -- SRC_LINKAGE_ FULLY_INDEPENDENT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \begin{itemize1} - \item 0x00000000 -- UNCERTAINTY_ NOT_SPECIFIED - \item 0x00000001 -- UNCERTAINTY_ POINT: Altitude uncertainty is valid - at the injected horizontal position coordinates - only. - \item 0x00000002 -- UNCERTAINTY_ FULL: Altitude uncertainty applies to - the position of the device regardless of - horizontal position (within the horizontal - uncertainty region, if provided). - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0 to 99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid. - \begin{itemize1} - \item Units: Meters \begin{itemize1} - \item Positive = height - \item Negative = depth - \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0-99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from which this position was obtained. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ POSITION_SRC_GNSS - \item 0x00000001 -- eQMI_LOC_ POSITION_SRC_CELLID - \item 0x00000002 -- eQMI_LOC_ POSITION_SRC_ENH_CELLID - \item 0x00000003 -- eQMI_LOC_ POSITION_SRC_WIFI - \item 0x00000004 -- eQMI_LOC_ POSITION_SRC_TERRESTRIAL - \item 0x00000005 -- eQMI_LOC_ POSITION_SRC_GNSS_ TERRESTRIAL_HYBRID - \item 0x00000006 -- eQMI_LOC_ POSITION_SRC_OTHER - \end{itemize1} \vspace{0.05in} - - If altitude is specified and the altitude source is not specified, the engine - assumes that the altitude was obtained using the specified position source. \n - If both altitude and altitude source are specified, the engine assumes - that only latitude and longitude were obtained using the specified position - source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ -#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Whether all assistance data is to be deleted. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this - message are ignored - \item 0x00 (FALSE) -- The optional fields in the message are to be - used to determine which data is to be deleted - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \n List of satellites for which the assistance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_GPS_SVDIR - \item 0x00000002 -- DELETE_GPS_ SVSTEER - \item 0x00000004 -- DELETE_GPS_TIME - \item 0x00000008 -- DELETE_GPS_ALM_ CORR - \item 0x00000010 -- DELETE_GLO_ SVDIR - \item 0x00000020 -- DELETE_GLO_ SVSTEER - \item 0x00000040 -- DELETE_GLO_TIME - \item 0x00000080 -- DELETE_GLO_ALM_ CORR - \item 0x00000100 -- DELETE_SBAS_ SVDIR - \item 0x00000200 -- DELETE_SBAS_ SVSTEER - \item 0x00000400 -- DELETE_POSITION - \item 0x00000800 -- DELETE_TIME - \item 0x00001000 -- DELETE_IONO - \item 0x00002000 -- DELETE_UTC - \item 0x00004000 -- DELETE_HEALTH - \item 0x00008000 -- DELETE_SADATA - \item 0x00010000 -- DELETE_RTI - \item 0x00020000 -- DELETE_SV_NO_ EXIST - \item 0x00040000 -- DELETE_FREQ_ BIAS_EST - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CELLDB_ POS - \item 0x00000002 -- DELETE_CELLDB_ LATEST_GPS_POS - \item 0x00000004 -- DELETE_CELLDB_ OTA_POS - \item 0x00000008 -- DELETE_CELLDB_ EXT_REF_POS - \item 0x00000010 -- DELETE_CELLDB_ TIMETAG - \item 0x00000020 -- DELETE_CELLDB_ CELLID - \item 0x00000040 -- DELETE_CELLDB_ CACHED_CELLID - \item 0x00000080 -- DELETE_CELLDB_ LAST_SRV_CELL - \item 0x00000100 -- DELETE_CELLDB_ CUR_SRV_CELL - \item 0x00000200 -- DELETE_CELLDB_ NEIGHBOR_INFO - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CLOCK_ INFO_TIME_EST - \item 0x00000002 -- DELETE_CLOCK_ INFO_FREQ_EST - \item 0x00000004 -- DELETE_CLOCK_ INFO_WEEK_NUMBER - \item 0x00000008 -- DELETE_CLOCK_ INFO_RTC_TIME - \item 0x00000010 -- DELETE_CLOCK_ INFO_TIME_TRANSFER - \item 0x00000020 -- DELETE_CLOCK_ INFO_GPSTIME_EST - \item 0x00000040 -- DELETE_CLOCK_ INFO_GLOTIME_EST - \item 0x00000080 -- DELETE_CLOCK_ INFO_GLODAY_NUMBER - \item 0x00000100 -- DELETE_CLOCK_ INFO_GLO4YEAR_NUMBER - \item 0x00000200 -- DELETE_CLOCK_ INFO_GLO_RF_GRP_DELAY - \item 0x00000400 -- DELETE_CLOCK_ INFO_DISABLE_TT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ERROR_SUCCESS - \item 0x00000001 -- ERROR_WIFI_NOT_ AVAILABLE - \item 0x00000002 -- ERROR_NO_AP_ FOUND - \item 0x00000003 -- ERROR_ UNAUTHORIZED - \item 0x00000004 -- ERROR_SERVER_ UNAVAILABLE - \item 0x00000005 -- ERROR_LOCATION_ CANNOT_BE_DETERMINED - \item 0x00000006 -- ERROR_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. - - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \begin{itemize1} - \item 0x00000001 -- WIFI_STATUS_ AVAILABLE - \item 0x00000002 -- WIFI_STATUS_ UNAVAILABLE - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - Valid bitmasks: \n - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI notify verify request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. - - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. - - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. - - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. - - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time-sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. - - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. - - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. - - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for Pedometer - control requests from the location engine. Location engine sends - this event out to control the injection of pedometer reports. - - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. Location engine sends - this event out to control the injection of motion data. - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ - eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is - set, AFLT will be used for 1x networks and OTDOA will be used - for LTE networks. */ - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - \label{operationMode} - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_ DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_ STANDALONE - \item 0x00000005 -- OPER_MODE_ CELL_ID - \item 0x00000006 -- OPER_MODE_ WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_ DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_ STANDALONE - \item 0x00000005 -- OPER_MODE_ CELL_ID - \item 0x00000006 -- OPER_MODE_ WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Whether the device is stationary: - \begin{itemize1} - \item 0x00 (FALSE) -- Device is not stationary - \item 0x01 (TRUE) -- Device is stationary - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. Only applies to the accelerometer samples. */ -#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem - time stamp. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified */ - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and - the location engine */ - QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorDataTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor data sample.\n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message.The timestamp is in the time reference scale that is - used by the sensor time source.\n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \begin{itemize1} - \item 0x01 -- SIGN_REVERSAL - \item 0X02 -- SENSOR_TIME_IS_ MODEM_TIME - \vspace{-0.18in} \end{itemize1} */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor sample.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - float temperature; - /**< Sensor temperature. \n - - Type: Floating point \n - - Units: Degree Celsius \n - - Range: -50 to +100.00 Degree Celsius */ -}qmiLocSensorTemperatureSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorDataTimeSourceEnumT_v02 timeSource; - /**< Denotes the time source of the sensor data. Location service will use - this field to identify the time reference used in the - sensor data timestamps. Values :\n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine - */ - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message. The timestamp is in the time reference scale that is - used by the sensor time source.\n - - Type: Unsigned integer \n - - Units: Milliseconds */ - - uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ - qmiLocSensorTemperatureSampleStructT_v02 temperatureData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor temperature samples. \n - - Maximum length of the array: 50 */ -}qmiLocSensorTemperatureSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyroscope Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \n Gyroscope sensor samples. */ - - /* Optional */ - /* 3-Axis Accelerometer Data Time Source */ - uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ - qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; - /**< Time source for the 3-axis accelerometer data. Location service will use - this field to identify the time reference used in the accelerometer data - timestamps. If not specified the location service will assume that the - time source for the accelereometer data is unknown. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine - */ - - /* Optional */ - /* 3-Axis Gyroscope Data Time Source */ - uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ - qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; - /**< Time source for the 3-axis gyroscope data. Location service will use - this field to identify the time reference used in the gyroscope data - timestamps.If not specified the locations ervice will assume that the - time source for the gyroscope data is unknown. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine - */ - - /* Optional */ - /* Accelerometer Temperature Data */ - uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ - qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; - /**< Accelerometer temperature samples. This data is optional and does not - have to be included in the message along with accelerometer data. */ - - /* Optional */ - /* Gyroscope Temperature Data */ - uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ - qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; - /**< Gyroscope temperature samples. This data is optional and does not - have to be included in the message along with gyroscope data. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< Opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples - were accepted. This field is present only if the accelerometer - samples were sent in the request. */ - - /* Optional */ - /* Gyroscope Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were - accepted. This field is present only if the gyroscope - samples were sent in the request. */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ - uint8_t accelTemperatureSamplesAccepted; - /**< This field lets the client know how many accelerometer temperature - samples were accepted. This field is present only if the accelerometer - temperature samples were sent in the request. */ - - /* Optional */ - /* Gyroscope Temperature Samples Accepted */ - uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ - uint8_t gyroTemperatureSamplesAccepted; - /**< This field lets the client know how many gyroscope temperature samples - were accepted. This field is present only if the gyroscope - temperature samples were sent in the request. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< Value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_ MOUNTED - \item 0x00000002 -- CRADLE_STATE_ UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_ MOUNTED - \item 0x00000002 -- CRADLE_STATE_ UNKNOWN - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the APN profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 101 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \n Access Point Name (APN) profile information is present only when - requestType is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocLppConfigMaskT_v02; -#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ -#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ -typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA1 Hash Algorithm for SUPL Version 2.0 or higher */ - eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 Hash Algorithm for SUPL Version 2.0 or higher */ - QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplHashAlgoEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS Version 1.0 */ - eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS Version 1.1 */ - QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplTlsVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< use Control plane protocol during emergency while on WCDMA */ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< use SUPL 2.0 emergency services during emergency while on WCDMA */ - QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEmergencyProtocolEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_ V1_ONLY - \item 0x00000002 -- VX_VERSION_ V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports - for assisted GLONASS. - - Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. - */ - - /* Optional */ - /* SUPL Hash Algorithm */ - uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ - qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher - */ - - /* Optional */ - /* SUPL TLS Version */ - uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ - qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL TLS (Transport Layer Security) Version. This configuration is only - applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. - Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 - */ - - /* Optional */ - /* Emergency Protocol */ - uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ - qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< Configures the protocol to be used during emergency. - Note: Currently only can select on WCDMA. FOR GSM and 1x UE - will always allow only Control plane NI trigger for positioning. - For LTE, UE Can allow either SUPL or Control plane NI trigger. - Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted glonass configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL Hash algorithm configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not a success. - - Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted glonass configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL Hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ ONLY - \item 0x00000002 -- VX_VERSION_V2_ ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Assisted GLONASS Protocol mask. - - Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - The QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE should be set - in the LPP configuration for this to take effect. - */ - - /* Optional */ - /* SUPL Hash Algorithm */ - uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ - qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL Hash Algorithm that needs to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA1 Hash Algorithm for SUPL Version 2.0 or higher - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 Hash Algorithm for SUPL Version 2.0 or higher - */ - - /* Optional */ - /* SUPL TLS Version */ - uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ - qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL TLS (Transport Layer Security) Version. This configuration is only - applicable to SUPL 2.0 or higher as SUPL 1.0 always uses TLS version 1.0. - Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS Version 1.0 - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS Version 1.1 - */ - - /* Optional */ - /* Emergency Protocol */ - uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ - qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< The protocol to be used during emergency. - Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- use Control plane protocol during emergency while on WCDMA - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- use SUPL 2.0 emergency services during emergency while on WCDMA - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position - improvement. */ - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in the heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPropertiesMaskT_v02; -#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_ SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Set Sensor Properties */ - uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ - qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field will be sent only if the status is not a success. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Sensor Properties Config Parameters */ - qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; - /**< Mask denoting the sensor properties parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_ SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; -#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with - GNSS. They can still be used for aiding in heading improvements. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request acceleration data to be used by the low data rate - filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n \vspace{0.06in} Sets the nominal rate at which the GNSS location - engine is to request gyro data to be used by the high data rate filter. - The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Sets which sensor algorithms are to be used when processing sensor data. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< Identifies parameters that were not configured successfully. This field - is sent only if the status is not a success. - - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- PERFORMANCE_ MODE - \item 0x00000002 -- ACCEL_SAMPLING_ SPEC - \item 0x00000004 -- GYRO_SAMPLING_ SPEC - \item 0x00000008 -- ALGORITHM_ CONFIG - \item 0x00000010 -- ACCEL_SAMPLING_ SPEC_HIGH - \item 0x00000020 -- GYRO_SAMPLING_ SPEC_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Informs which sensor algorithms are currently set. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate ID */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate. \n - - Units: Bytes \n - - Range: 0 to 9 */ - - /* Mandatory */ - /* SUPL Certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< SUPL certificate contents. \n - - Type: Array of bytes. \n - - Maximum certificate size: 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate ID */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate to be deleted. \n - - Units: Bytes \n - - Range: 0 to 9 \n - If suplCertId is not specified, - all SUPL certificates are deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the - injected position in a direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data - in persistent memory. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position is used in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position - calculation - \item 0x00 (FALSE) -- Do not use the injected position in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Filter the usage of SVs in the fix - \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in - persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Store assistance data in persistent memory - \item 0x00 (FALSE) -- Do not store assistance data in persistent memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< Identifies the parameters that were not set successfully. - This field is sent only if the status is other than SUCCESS. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_ POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_ DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- INJECTED_ POSITION_CONTROL - \item 0x00000002 -- FILTER_SV_USAGE - \item 0x00000004 -- STORE_ASSIST_ DATA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation - in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- The injected position is used in a direct - position calculation - \item 0x00 (FALSE) -- The injected position is not used in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- SV usage is filtered in the fix - \item 0x00 (FALSE) -- SV usage is not filtered in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies whether assistance data is stored in persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Assistance data is stored in persistent memory - \item 0x00 (FALSE) -- Assistance data is not stored in persistent - memory - \end{itemize1} - The default value is TRUE. - */ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocGeofenceBreachMaskT_v02; -#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported - when the Geofence is entered. */ -#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported - when the Geofence is exited. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a - lower rate. The gap between actual breach and - the time it is reported is higher. This - setting results in lower power usage. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a - medium rate. This is the default setting. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a - high rate. The gap between actual breach and - the time it is reported is low. This results - in higher power usage. */ - QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceResponsivenessEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with - low confidence. This setting results in lower - power usage. This setting can impact the "yield" because - incorrect breach events may be sent. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with - medium confidence. This is the default setting. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with - high confidence. This setting results in higher - power usage. */ - QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceConfidenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double latitude; - /**< Latitude of the center of the Geofence.*/ - - double longitude; - /**< Longitude of the center of the Geofence.*/ - - uint32_t radius; - /**< Radius of the circular Geofence in meters. */ -}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ - QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofencePositionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Add Circular Geofence - indication. */ - - /* Mandatory */ - /* Circular Geofence Arguments */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Mandatory */ - /* Breach Event Mask */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ - - /* Mandatory */ - /* Include Position in Breach Event */ - uint8_t includePosition; - /**< Specifies whether the Geofence engine is to include the position - in a breach event. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Position will be reported with the breach event - \item 0x00 (FALSE) -- Position will not be reported with the breach - event - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Responsiveness */ - uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ - qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. - This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications - and is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ RESPONSIVENESS_LOW - \item 0x00000002 -- GEOFENCE_ RESPONSIVENESS_MED - \item 0x00000003 -- GEOFENCE_ RESPONSIVENESS_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Confidence */ - uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ - qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and - is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ CONFIDENCE_LOW - \item 0x00000002 -- GEOFENCE_ CONFIDENCE_MED - \item 0x00000003 -- GEOFENCE_ CONFIDENCE_HIGH - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Add Circular Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Add Circular Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_ MEMORY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Add Circular - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. - The client must include this identifier in all transactions - pertaining to this Geofence. */ -}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be deleted. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Delete Geofence - indication. */ -}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Delete Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was deleted. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Delete - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ -}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ - QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceOriginEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ - eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ - QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be queried. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned with the Query Geofence - indication. */ -}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Query Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Query Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was queried. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Query - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence Origin */ - uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ - qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; - /**< Originator of the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ ORIGIN_NETWORK - \item 0x00000002 -- GEOFENCE_ ORIGIN_DEVICE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Position with Respect to Geofence */ - uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ - qmiLocGeofencePositionEnumT_v02 posWrtGeofence; - /**< Indicates if the client is currently inside or outside - the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ POSITION_INSIDE - \item 0x00000002 -- GEOFENCE_ POSITION_OUTSIDE - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Circular Geofence Parameters */ - uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND - \vspace{-0.18in} \end{itemize1} */ -}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence to be edited. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Edit Geofence - request. This parameter will always be present if the - status field is set to SUCCESS. - */ - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Breach Event Mask */ - uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; -#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ -#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Edit Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Edit Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was edited. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is specified in the Edit Geofence request. */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ - qmiLocGeofenceConfigParamMaskT_v02 failedParams; - /**< Specified only when the status is not set to SUCCESS. If - the mask corresponding to a field is set, it indicates that - the Geofence parameter could not be edited. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_PARAM_ MASK_GEOFENCE_STATE - \item 0x00000002 -- GEOFENCE_PARAM_ MASK_BREACH_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Get Best Available Position indication. */ -}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Best Available Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Best Available Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get Best - Available Position request. This parameter will - always be present if the status field is set to - SUCCESS. */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Major Axis */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation. \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Circular Confidence */ - uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ - uint8_t horCircularConfidence; - /**< Horizontal circular uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Elliptical Confidence */ - uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ - uint8_t horEllipticalConfidence; - /**< Horizontal elliptical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ - float horSpeed; - /**< Horizontal speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Horizontal Speed Uncertainty */ - uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ - float horSpeedUnc; - /**< Horizontal speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level. \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ - float vertSpeed; - /**< Vertical speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Vertical Speed Uncertainty */ - uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ - float vertSpeedUnc; - /**< Vertical speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading. \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty. \n - - Type: Floating point \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used Mask */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SATELLITE - \item 0x00000002 -- CELLID - \item 0x00000004 -- WIFI - \item 0x00000008 -- SENSORS - \item 0x00000010 -- REFERENCE_ LOCATION - \item 0x00000020 -- INJECTED_COARSE_ POSITION - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from system clock (better known as slow clock). - GNSS time is maintained irrespective of the GNSS receiver state - */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ - eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ - eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ - QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ - eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ - QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.1in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute - rest by reducing probability_of_state. - */ - - qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion. - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. - \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.1in} \end{itemize1} - - The motion_mode value is independent of the motion_state value. - */ - - float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.1in} - - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.1in} - - It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} - - If the motion_state is not known, the value in this field is not used. - */ - - uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. - */ - - uint16_t timeout; - /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is - received. \n - - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the - state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} - - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. - */ -}qmiLocMotionDataStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Motion Data */ - qmiLocMotionDataStructT_v02 motion_data; -}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Inject Motion Data Request Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The same transaction ID - will be returned in the Get NI Geofence ID List indication. */ -}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Get NI Geofence ID List Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NI Geofence ID List request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI - Geofence ID List request. */ - - /* Optional */ - /* NI Geofence ID List */ - uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ - uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ - uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; - /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n - - Maximum NI Geofence ID List length: 16 */ -}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ - - uint32_t MNC; - /**< GSM mobile network code. Refer to \hyperref[R2]{[R2]}. */ - - uint32_t LAC; - /**< GSM location area code. Refer to \hyperref[R2]{[R2]}. */ - - uint32_t CID; - /**< GSM cell identification. Refer to \hyperref[R2]{[R2]}. */ -}qmiLocGSMCellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects GSM cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* GSM Cell ID */ - qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< \n Identifies the GSM cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - uint8_t roamingStatus; - /**< Whether the device is roaming. - \begin{itemize1} - \item 0x01 (TRUE) -- Device is roaming - \item 0x00 (FALSE) -- Device is not roaming - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Timing Advance */ - uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ - uint32_t timingAdvance; - /**< The round trip delay between the MS and the BS, in unit of 3.69 microseconds. - Refer to 3GPP TS 05.10 and TS 45.010 */ -}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects GSM cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject GSM Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject GSM Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ -}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network */ - eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network. */ - QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocRoamingStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t mcc; - /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ - - uint32_t mnc; - /**< WCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ - - uint32_t cid; - /**< WCDMA Cell Identity. Refer to \hyperref[R2]{[R2]}. */ -}qmiLocWCDMACellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects WCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* WCDMA Cell ID */ - qmiLocWCDMACellIdStructT_v02 wcdmaCellId; - /**< \n Identifies the WCDMA cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Whether the device is roaming. - Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on - its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped - on a roaming network. - \vspace{0.1in} \end{itemize1} */ - - /* Optional */ - uint8_t freq_valid; /**< Must be set to true if freq is being passed */ - uint32_t freq; - /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ - - /* Optional */ - uint8_t psc_valid; /**< Must be set to true if psc is being passed */ - uint32_t psc; - /**< PrimaryScramblingCode of the serving cell. Valid range is 0 to 511. Refer to TS 25.331 */ -}qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects WCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject WCDMA Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WCDMA Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ -}qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t mcc; - /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[R2]{[R2]}. */ - - uint32_t mnc; - /**< TDSCDMA mobile network code. Refer to \hyperref[R2]{[R2]}. */ - - uint32_t cid; - /**< TDSCDMA Cell Identity. Refer to TS 25.331. */ - - uint32_t lac; - /**< TDSCDMA location area code. Refer to \hyperref[R2]{[R2]}. */ -}qmiLocTDSCDMACellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects TDSCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* TDSCDMA Cell ID */ - qmiLocTDSCDMACellIdStructT_v02 tdscdmaCellId; - /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Whether the device is roaming. - Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e. its camped on - its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e. its camped - on a roaming network. - \vspace{0.1in} \end{itemize1} */ - - /* Optional */ - uint8_t freq_valid; /**< Must be set to true if freq is being passed */ - uint32_t freq; - /**< FrequencyInfo of the serving cell. Valid range is 0 to 16383. Refer to TS 25.331 */ -}qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects TDSCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject TDSCDMA Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject TDSCDMA Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ -}qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the phone's subscriber ID into the location engine. */ -typedef struct { - - /* Optional */ - /* Preferred IMSI */ - uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ - uint64_t preferredIMSI; - /**< \n The IMSI number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ - - /* Optional */ - /* Preferred MSISDN */ - uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ - uint64_t preferredMSISDN; - /**< \n The MSISDN number of the preferred RAT. Refer to \hyperref[R2]{[R2]}.*/ -}qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the phone's subscriber ID into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Subscriber ID Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Subscriber ID request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-018in} \end{itemize1} */ -}qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL network-initiated message is being injected. */ - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a network-initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Injected Network Initiated Message Type */ - qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; - /**< Type of the network-initiated message being injected. - - Valid values: - - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL network-initiated message is being injected. */ - - /* Mandatory */ - /* Injected Network Initiated Message */ - uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ - uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network-initiated message body. - If the inject NI message type is TYPE_SUPL, the message contains - a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ -}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a network-initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Network Initiated Message Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Network Initiated Message request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_ MEMORY - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * typedef struct { - * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine that the device is out of - service. */ -typedef struct { - - /* Mandatory */ - /* Notify WWAN Out of Service Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WWAN Out of Service request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject pedometer data - into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Time Source */ - qmiLocSensorDataTimeSourceEnumT_v02 timeSource; - /**< Time source for the pedometer. Location service will use - this field to identify the time reference used in the - pedometer data timestamp. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine*/ - - /* Mandatory */ - /* Pedometer report timestamp */ - uint32_t timestamp; - /**< Timestamp of the last step event in this report, i.e timestamp - of the step event that caused this report to be generated. - The timestamp is in the time reference scale that is - used by the pedometer time source. \n - - Unit: Milliseconds */ - - /* Mandatory */ - /* Time Interval */ - uint32_t timeInterval; - /**< Time interval during which the step count was calculated. Subtracting - timeInterval from the timestamp field will yield the the time when - the step detection for the first step in this report started. - Unit : Milliseconds. */ - - /* Mandatory */ - /* Step Count */ - uint32_t stepCount; - /**< Number for steps counted during the time interval.*/ - - /* Optional */ - /* Step Confidence */ - uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ - uint8_t stepConfidence; - /**< Confidence associated with the step. This field is only applicable - for a single step report, i.e if the stepCount is one. - Range: 0 to 100. - Note: The report will be ignored if confidence is 0. */ - - /* Optional */ - /* Step Count Uncertainty */ - uint8_t stepCountUncertainty_valid; /**< Must be set to true if stepCountUncertainty is being passed */ - float stepCountUncertainty; - /**< Uncertainty (in steps) associated with the step count. */ - - /* Optional */ - /* Step Rate */ - uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ - float stepRate; - /**< Current estimate for the rate of steps per second. - Units: steps/second - Range: >= 0.0 - */ -}qmiLocPedometerReportReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject pedometer data - into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Status of Pedometer report request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the pedometer report request - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocPedometerReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 -#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 -#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 -#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 -#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 -#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 -#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 -#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C -#define QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 0x006D -#define QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02 0x006E -#define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F -#define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F -#define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02 0x0070 -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02 0x0070 -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02 0x0070 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02 0x0071 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02 0x0071 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02 0x0071 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02 0x0072 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02 0x0072 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02 0x0072 -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif - From c326530244bf8cd1fbdc78bf47e2dbeb0a81259a Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 3 Jun 2013 10:56:48 -0700 Subject: [PATCH 138/945] Add support for having no qcom proprietary qcom bsp will handle xtra/agps/ni/time through qcom propreitary service, and non-qcom bsp will handle xtra/gps/ni/time through android framework. xtra url will be queried from modem on qcom bsp, and read from gps.conf from non-qcom bsp. Change-Id: Ib54a1596caa65f7aa0358f639640c3d1074980e7 --- etc/Android.mk | 1 + etc/gps.conf | 15 +- loc_api/libloc_api_50001/Android.mk | 4 + loc_api/libloc_api_50001/loc.cpp | 312 +++++++++++++++++++++++++++- 4 files changed, 322 insertions(+), 10 deletions(-) diff --git a/etc/Android.mk b/etc/Android.mk index 96dc5d78..025d3f74 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -7,5 +7,6 @@ LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ LOCAL_SRC_FILES := gps.conf + include $(BUILD_PREBUILT) diff --git a/etc/gps.conf b/etc/gps.conf index aeaf96ab..977e7b3a 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,8 +1,13 @@ -# Customized XTRA server urls can go here, which will -# override the default urls that are given by the modem -#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +# XTRA_SERVER_QUERY (1=on, 0=off) +# If XTRA_SERVER_QUERY is on, the XTRA_SERVERs listed +# below will be ignored, and instead the servers will +# be queried from the modem. +XTRA_SERVER_QUERY=1 +# XTRA_SERVERs below are used only if XTRA_SERVER_QUERY +# is off. +XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin # Error Estimate # _SET = 1 diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index f36ae4fe..9cb32fb8 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -114,6 +114,10 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ \ +ifeq ($(TARGET_USES_QCOM_BSP), true) +LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP +endif + ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index d7362477..868fbafa 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -97,6 +97,43 @@ static const GpsInterface sLocEngInterface = 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 const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server +}; + +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); + +const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + 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); @@ -254,12 +291,26 @@ static int loc_init(GpsCallbacks* callbacks) EXIT_LOG(%d, retVal); return retVal; } + +#ifdef TARGET_USES_QCOM_BSP LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | LOC_API_ADAPTER_BIT_SATELLITE_REPORT | LOC_API_ADAPTER_BIT_IOCTL_REPORT | LOC_API_ADAPTER_BIT_STATUS_REPORT | LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; +#else + LOC_API_ADAPTER_EVENT_MASK_T event = + 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; +#endif + LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ callbacks->status_cb, /* status_cb */ sv_cb, /* sv_status_cb */ @@ -490,8 +541,15 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) { - //inject time not handled by AFW - return 0; + ENTRY_LOG(); + int ret_val = 0; + + #ifndef TARGET_USES_QCOM_BSP + ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); + #endif + + EXIT_LOG(%d, ret_val); + return ret_val; } @@ -655,15 +713,21 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - //xtra not handled by AFW + #ifndef TARGET_USES_QCOM_BSP + ret_val = &sLocEngXTRAInterface; + #endif } else if (strcmp(name, AGPS_INTERFACE) == 0) { - //agps not handled by AFW + #ifndef TARGET_USES_QCOM_BSP + ret_val = &sLocEngAGpsInterface; + #endif } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - //ni not handled by AFW + #ifndef TARGET_USES_QCOM_BSP + ret_val = &sLocEngNiInterface; + #endif } else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { @@ -702,6 +766,244 @@ const void* loc_get_extension(const char* name) 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_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; + } + int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION 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(); + int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); + + 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 = loc_eng_xtra_inject_data(loc_afw_data, data, length); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +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(); + loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks); + 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) {} From 112647bd23ae61df61ec7da07536c7ecaa1ab7e9 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 4 Jun 2013 15:53:46 -0700 Subject: [PATCH 139/945] Added more delete assistance data flags Removed FEATURE_DELEXT flag that is no longer needed after adding the flags for this feature to gps_extended.h Change-Id: Id8a095309892e2eb328a02ef17e4aa1b1b54e815 --- loc_api/Android.mk | 13 ------------- loc_api/libloc_api_50001/Android.mk | 4 ---- loc_api/libloc_api_50001/gps_extended.h | 10 ++++++++++ loc_api/libloc_api_50001/loc_eng_log.cpp | 6 ++---- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 45e08c82..c87df1f9 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -2,10 +2,6 @@ ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) -GPS_DIR_LIST := - -FEATURE_DELEXT := false - # add RPC dirs if RPC is available ifneq ($(TARGET_NO_RPC),true) @@ -15,15 +11,6 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC -ifeq ($(BOARD_USES_QCOM_HARDWARE), true) -#add QMI libraries for QMI targets -QMI_BOARD_PLATFORM_LIST := msm8960 -QMI_BOARD_PLATFORM_LIST += msm8974 -QMI_BOARD_PLATFORM_LIST += msm8226 -QMI_BOARD_PLATFORM_LIST += msm8610 -endif - - GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ #call the subfolders diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 9cb32fb8..3409cda1 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -25,10 +25,6 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ -ifeq ($(FEATURE_DELEXT), true) -LOCAL_CFLAGS += -DFEATURE_DELEXT -endif #FEATURE_DELEXT - LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h index 9ccbf2eb..f1db4729 100644 --- a/loc_api/libloc_api_50001/gps_extended.h +++ b/loc_api/libloc_api_50001/gps_extended.h @@ -38,6 +38,16 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 1 #define AGPS_APN_BEARER_IPV4V6 2 +#define GPS_DELETE_ALMANAC_CORR 0x00001000 +#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 +#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 +#define GPS_DELETE_ALMANAC_GLO 0x00008000 +#define GPS_DELETE_SVDIR_GLO 0x00010000 +#define GPS_DELETE_SVSTEER_GLO 0x00020000 +#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 +#define GPS_DELETE_TIME_GPS 0x00080000 +#define GPS_DELETE_TIME_GLO 0x00100000 + /** GPS extended callback structure. */ typedef struct { /** set to sizeof(GpsCallbacks) */ diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 99959abb..42be0d69 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -166,9 +166,8 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SVSTEER ), NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), - NAME_VAL( GPS_DELETE_CELLDB_INFO ) -#ifdef FEATURE_DELEXT - ,NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_CELLDB_INFO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), NAME_VAL( GPS_DELETE_ALMANAC_GLO ), @@ -177,7 +176,6 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), NAME_VAL( GPS_DELETE_TIME_GPS ), NAME_VAL( GPS_DELETE_TIME_GLO ) -#endif }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From cb119e6f520cbbd40e34a526226aa27dcdd8d0c8 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 7 Jun 2013 13:39:24 -0700 Subject: [PATCH 140/945] Make Loc Init Asynchronous GPS-enable gets too heavy at powerup, when loc_init is synchronous, where loc goes to get the hardware handle if AP init happens faster than the GPS hardware. The loc init calling thread is from Android framework, and it locks a mutex that in turn could lock up system server main thread upon race conditions. The second half of loc init, i.e. the reinit, is now moved to loc worker thread. This should help release some of the powerup timing pressure on the framework threads. Added a message just for asynchrous Loc Init so as to execute init specifically. Change-Id: I369e461ca4ca61cea3a9729c84d24af4ffa8e51d CRs-fixed: 472843 --- .../libloc_api-rpc-glue/src/loc_api_rpc_glue.c | 18 +++++++++++++++--- loc_api/libloc_api_50001/loc_eng.cpp | 16 ++++++++-------- loc_api/libloc_api_50001/loc_eng_log.cpp | 3 ++- loc_api/libloc_api_50001/loc_eng_msg_id.h | 3 +++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c index 11c9e3d4..c047cb34 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -62,6 +62,9 @@ /* Logging Improvement */ #include "log_util.h" +/*Maximum number of Modem init*/ +#define RPC_TRY_NUM 10 + /* Uncomment to force ALOGD messages */ // #define ALOGD ALOGI @@ -308,6 +311,7 @@ rpc_loc_client_handle_type loc_open ( void* userData ) { + int try_num = RPC_TRY_NUM; ENTRY_LOG(); LOC_GLUE_CHECK_INIT(rpc_loc_client_handle_type); @@ -352,14 +356,22 @@ rpc_loc_client_handle_type loc_open ( enum clnt_stat stat = RPC_SUCCESS; EXIT_LOG_CALLFLOW(%s, "loc client open"); - stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); + + /*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; - ret_val = (rpc_loc_client_handle_type) rets.loc_open_result; - return ret_val; } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9d231626..6199b211 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -348,14 +348,9 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, } else { LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); - // call reinit to send initialization messages - int tries = 30; - while (tries > 0 && - LOC_API_ADAPTER_ERR_SUCCESS != (ret_val = loc_eng_reinit(loc_eng_data))) { - tries--; - LOC_LOGD("loc_eng_init client open failed, %d more tries", tries); - sleep(1); - } + /*send reinit event to QMI instead of call reinit directly*/ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_LOC_INIT)); + locEngHandle.sendMsge(locEngHandle.owner, msg); } EXIT_LOG(%d, ret_val); @@ -1869,6 +1864,11 @@ static void loc_eng_deferred_action_thread(void* arg) } break; + case LOC_ENG_MSG_LOC_INIT: + { + loc_eng_reinit(*loc_eng_data_p); + } + default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); break; diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 42be0d69..b0d64c68 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -107,7 +107,8 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( ULP_MSG_MONITOR ), NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), - NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ) + NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ), + NAME_VAL( LOC_ENG_MSG_LOC_INIT ) }; static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index 19a2ab6f..6d011240 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -133,6 +133,9 @@ enum loc_eng_msg_ids_t { /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ LOC_ENG_MSG_A_GLONASS_PROTOCOL, + + //Message is sent by LOC to do LOC INIT + LOC_ENG_MSG_LOC_INIT, }; #ifdef __cplusplus From af3b8cb4a9b5b48e4998b9d287701fe548893bb8 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 18 Jun 2013 11:06:27 -0700 Subject: [PATCH 141/945] Return the correct value from loc_eng_init The function was returning an error code which was causing GPSLocationProvider to fail initialization CRs-fixed: 501318 Change-Id: Icec707c3b9edc60bd07914b130077f9a96c5e794 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 6199b211..f27ea283 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -290,11 +290,12 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, void (*loc_external_msg_sender) (void*, void*)) { - int ret_val =-1; + 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; } @@ -1861,13 +1862,14 @@ static void loc_eng_deferred_action_thread(void* arg) } else LOC_LOGE("Ulp Phone context request call back not initialized"); - } + } break; case LOC_ENG_MSG_LOC_INIT: { loc_eng_reinit(*loc_eng_data_p); } + break; default: LOC_LOGE("unsupported msgid = %d\n", msg->msgid); From a7aa6a45fb357f4a79c3b7e4f68d271e66919edd Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 13 May 2013 21:30:01 -0700 Subject: [PATCH 142/945] Fixes ULP and FLP operation when GPS not enabled Changes to ensure FLP positioning call flow works even if GPS is disabled on the Android settings menu. CRs-Fixed: 476628 Change-Id: I54b9f9861a14f7c42f45c48e57e9558f14a4de92 --- loc_api/libloc_api_50001/Android.mk | 3 +- loc_api/libloc_api_50001/loc.cpp | 251 +++++++++++++++++++-------- loc_api/libloc_api_50001/loc_eng.cpp | 3 - 3 files changed, 184 insertions(+), 73 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 3409cda1..74fffc3d 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -100,7 +100,8 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libloc_eng \ libgps.utils \ - libdl + libdl \ + libandroid_runtime LOCAL_SRC_FILES += \ loc.cpp \ diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 868fbafa..fbd556ef 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -43,22 +43,28 @@ #include #include #include +#include #include - //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; -static void loc_cb(UlpLocation* location, void* locExt); -static void sv_cb(GpsSvStatus* sv_status, void* svExt); - +static void local_loc_cb(UlpLocation* location, void* locExt); +static void local_status_cb(GpsStatus* status); +static void local_sv_cb(GpsSvStatus* sv_status, void* svExt); +static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length); +static void local_set_capabilities_cb(uint32_t capabilities); +static void local_acquire_wakelock_cb(void); +static void local_release_wakelock_cb(void); +static void local_request_utc_time_cb(void); static const GpsGeofencingInterface* get_geofence_interface(void); // Function declarations for sLocEngInterface static int loc_init(GpsCallbacks* callbacks); +static int loc_hal_init(void); static int loc_start(); static int loc_stop(); static void loc_cleanup(); @@ -185,6 +191,7 @@ static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = static loc_eng_data_s_type loc_afw_data; static UlpCallbacks ulp_cb_data; +static LocCallbacks afw_cb_data; static int gss_fd = 0; /*=========================================================================== @@ -221,6 +228,18 @@ const GpsInterface* gps_get_hardware_interface () ret_val = &sLocEngInterface; } + if (0 != loc_hal_init()) { + LOC_LOGE("HAL could not be initialized"); + ret_val = NULL; + } else { + ret_val = &sLocEngInterface; + } + + loc_eng_read_config(); + + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + EXIT_LOG(%p, ret_val); return ret_val; } @@ -229,27 +248,33 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { targetEnumType target = TARGET_OTHER; - loc_eng_read_config(); + if (NULL == loc_afw_data.context) { + loc_eng_read_config(); - //We load up libulp module at this point itself - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - target = get_target(); - LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - //APQ8064 and APQ8030 - if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { - 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); + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + //APQ8064 and APQ8030 + if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { + 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); + } + } + //MPQ8064 + else if(target == TARGET_MPQ8064) { + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; + } + if (0 != loc_hal_init()) { + LOC_LOGE("HAL could not be initialized"); + return NULL; } - } - //MPQ8064 - else if(target == TARGET_MPQ8064) { - LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); - return NULL; } return &sLocEngInterface; } @@ -266,7 +291,7 @@ void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) } /*=========================================================================== -FUNCTION loc_init +FUNCTION loc_hal_init DESCRIPTION Initialize the location engine, this include setting up global datas @@ -282,15 +307,10 @@ SIDE EFFECTS N/Ax ===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) +static int loc_hal_init(void) { int retVal = -1; ENTRY_LOG(); - if(callbacks == NULL) { - LOC_LOGE("loc_init failed. cb = NULL\n"); - EXIT_LOG(%d, retVal); - return retVal; - } #ifdef TARGET_USES_QCOM_BSP LOC_API_ADAPTER_EVENT_MASK_T event = @@ -310,20 +330,18 @@ static int loc_init(GpsCallbacks* callbacks) LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; #endif - - LocCallbacks clientCallbacks = {loc_cb, /* location_cb */ - callbacks->status_cb, /* status_cb */ - 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 */ + LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ + local_status_cb, /* status_cb */ + local_sv_cb, /* sv_status_cb */ + local_nmea_cb, /* nmea_cb */ + local_set_capabilities_cb, /* set_capabilities_cb */ + local_acquire_wakelock_cb, /* acquire_wakelock_cb */ + local_release_wakelock_cb, /* release_wakelock_cb */ + (pthread_t (*)(const char*, void (*)(void*), void*)) + android::AndroidRuntime::createJavaThread, /* create_thread_cb */ NULL, /* location_ext_parser */ NULL, /* sv_ext_parser */ - callbacks->request_utc_time_cb /* request_utc_time_cb */}; - gps_loc_cb = callbacks->location_cb; - gps_sv_cb = callbacks->sv_status_cb; + local_request_utc_time_cb /* request_utc_time_cb */}; if (loc_eng_ulp_inf == NULL) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, @@ -332,17 +350,6 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, loc_ulp_msg_sender); - if (ulp_cb_data.phone_context_cb) { - //ULP initilization already occurred so redo intializations here - //to restore callback table - loc_eng_ulp_phone_context_init(loc_afw_data, ulp_cb_data.phone_context_cb); - } - - if (ulp_cb_data.network_location_cb) { - loc_eng_ulp_network_init(loc_afw_data, ulp_cb_data.network_location_cb); - } - - int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); //Initialize the cached min_interval loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; @@ -1059,7 +1066,7 @@ static bool loc_inject_raw_command(char* command, int length) return ret_val; } -static void loc_cb(UlpLocation* location, void* locExt) +static void local_loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); if (NULL != location) { @@ -1067,7 +1074,9 @@ static void loc_cb(UlpLocation* location, void* locExt) if (ULP_LOCATION_IS_FROM_GNSS == location->position_source ) { if (NULL != gps_loc_cb) { gps_loc_cb(&location->gpsLocation); - } + } else { + LOC_LOGE("Error. GPS not enabled"); + } } else { if (NULL != ulp_loc_cb) { ulp_loc_cb(location); @@ -1077,13 +1086,15 @@ static void loc_cb(UlpLocation* location, void* locExt) EXIT_LOG(%s, VOID_RET); } -static void sv_cb(GpsSvStatus* sv_status, void* svExt) +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); - } + } else { + LOC_LOGE("Error. GPS not enabled"); + } EXIT_LOG(%s, VOID_RET); } @@ -1159,12 +1170,7 @@ static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) { ENTRY_LOG(); int ret_val = -1; - if (loc_afw_data.context) { - ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); - } else - { - ulp_cb_data.phone_context_cb = callbacks; - } + ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); EXIT_LOG(%d, ret_val); return ret_val; } @@ -1214,13 +1220,7 @@ static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) { ENTRY_LOG(); int ret_val = -1; - if (loc_afw_data.context) { - ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); - } else - { - ulp_cb_data.network_location_cb = callbacks; - } - + ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); EXIT_LOG(%d, ret_val); return ret_val; } @@ -1302,3 +1302,116 @@ static int loc_ulp_engine_stop() } +/*=========================================================================== +FUNCTION loc_init + +DESCRIPTION + Registers the AFW call backs with the local tables + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/Ax + +===========================================================================*/ +static int loc_init(GpsCallbacks* callbacks) +{ + int retVal = -1; + ENTRY_LOG(); + if(callbacks == NULL) { + LOC_LOGE(" loc_init. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } + memset(&afw_cb_data, NULL, sizeof (LocCallbacks)); + gps_loc_cb = callbacks->location_cb; + afw_cb_data.status_cb = callbacks->status_cb; + gps_sv_cb = callbacks->sv_status_cb; + afw_cb_data.set_capabilities_cb = callbacks->set_capabilities_cb; + afw_cb_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + afw_cb_data.release_wakelock_cb = callbacks->release_wakelock_cb; + afw_cb_data.request_utc_time_cb = callbacks->request_utc_time_cb; + afw_cb_data.nmea_cb = callbacks->nmea_cb; + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + retVal = 0; + EXIT_LOG(%d, retVal); + return retVal; +} + +static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length) +{ + ENTRY_LOG(); + if (0 != length) { + if (NULL != afw_cb_data.nmea_cb) { + afw_cb_data.nmea_cb(timestamp, nmea, length); + } else + { + LOC_LOGE("Error. GPS not enabled"); + } + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_set_capabilities_cb(uint32_t capabilities) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.set_capabilities_cb) { + afw_cb_data.set_capabilities_cb(capabilities); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_acquire_wakelock_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.acquire_wakelock_cb) { + afw_cb_data.acquire_wakelock_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_release_wakelock_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.release_wakelock_cb) { + afw_cb_data.release_wakelock_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_request_utc_time_cb(void) +{ + ENTRY_LOG(); + if (NULL != afw_cb_data.request_utc_time_cb) { + afw_cb_data.request_utc_time_cb(); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_status_cb(GpsStatus* status) +{ + ENTRY_LOG(); + if (NULL != status) { + CALLBACK_LOG_CALLFLOW("status_callback - status", %d, status->status); + if (NULL != afw_cb_data.status_cb) { + afw_cb_data.status_cb(status); + } else { + LOC_LOGE("Error. GPS not enabled"); + } + } + EXIT_LOG(%s, VOID_RET); +} diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f27ea283..9391b5e8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -308,9 +308,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, // Create context (msg q + thread) (if not yet created) // This will also parse gps.conf, if not done. loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; From 002d6ba6296074937e4b95c1f0a32d850ade492c Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Wed, 12 Jun 2013 21:41:51 -0700 Subject: [PATCH 143/945] Removed all ULP specific constructs from HAL Changed the communication path from ULP JNI to libulp engine to avoid the GPS HAL layer. This improves modularity, removes dependencies and promote easier integration for OEMs. Change-Id: I6bc883499b8ed3649cfc194038057a19ba2fd4f6 --- loc_api/libloc_api_50001/Android.mk | 3 +- loc_api/libloc_api_50001/loc.cpp | 362 ++-------------------- loc_api/libloc_api_50001/loc.h | 5 - loc_api/libloc_api_50001/loc_eng.cpp | 319 ++----------------- loc_api/libloc_api_50001/loc_eng.h | 17 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 11 - loc_api/libloc_api_50001/loc_eng_msg.h | 113 ------- loc_api/libloc_api_50001/loc_eng_msg_id.h | 55 +--- loc_api/libloc_api_50001/loc_ulp.h | 331 -------------------- loc_api/ulp/inc/ulp.h | 8 +- 10 files changed, 67 insertions(+), 1157 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 74fffc3d..07172654 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -26,7 +26,8 @@ LOCAL_CFLAGS += \ -D_ANDROID_ LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/libloc_api_50001 LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index fbd556ef..34a0f8c3 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -74,19 +74,7 @@ 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); - -//ULP/Hybrid provider Function definitions -static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks); -static int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report); -static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callback); -static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings); -static int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria); static const void* loc_get_extension(const char* name); -static ulp_location_callback ulp_loc_cb = NULL; -static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks); -static int loc_ulp_engine_start(); -static int loc_ulp_engine_stop(); - // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = @@ -158,39 +146,7 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = loc_agps_ril_update_network_availability }; -static const UlpEngineInterface sLocEngUlpEngInterface = -{ - sizeof(UlpEngineInterface), - loc_ulp_engine_init, - loc_ulp_engine_update_criteria, - loc_ulp_engine_start, - loc_ulp_engine_stop -}; - -static bool loc_inject_raw_command(char* command, int length); - -static const InjectRawCmdInterface sLocEngInjectRawCmdInterface = -{ - sizeof(InjectRawCmdInterface), - loc_inject_raw_command -}; - -//ULP/Hybrid provider interfaces -static const UlpNetworkInterface sUlpNetworkInterface = -{ - sizeof(UlpNetworkInterface), - loc_ulp_network_init, - loc_ulp_send_network_position -}; -static const UlpPhoneContextInterface sLocEngUlpPhoneContextInterface = -{ - sizeof(UlpPhoneContextInterface), - loc_ulp_phone_context_init, - loc_ulp_phone_context_settings_update -}; - static loc_eng_data_s_type loc_afw_data; -static UlpCallbacks ulp_cb_data; static LocCallbacks afw_cb_data; static int gss_fd = 0; @@ -228,6 +184,11 @@ const GpsInterface* gps_get_hardware_interface () ret_val = &sLocEngInterface; } + loc_eng_read_config(); + + //We load up libulp module at this point itself + loc_eng_ulp_inf = loc_eng_get_ulp_inf(); + if (0 != loc_hal_init()) { LOC_LOGE("HAL could not be initialized"); ret_val = NULL; @@ -235,11 +196,6 @@ const GpsInterface* gps_get_hardware_interface () ret_val = &sLocEngInterface; } - loc_eng_read_config(); - - //We load up libulp module at this point itself - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - EXIT_LOG(%p, ret_val); return ret_val; } @@ -351,8 +307,6 @@ static int loc_hal_init(void) loc_ulp_msg_sender); int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); - //Initialize the cached min_interval - loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1); EXIT_LOG(%d, retVal); @@ -438,26 +392,8 @@ static int loc_stop() { ENTRY_LOG(); int ret_val = -1; - if (loc_afw_data.ulp_initialized) { - //ULP initialized so we need to simulate REMOVE_CRITERIA for - //last client to libulp and we dont need to send loc_eng_stop - UlpLocationCriteria native_criteria; - native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | - ULP_CRITERIA_HAS_MIN_INTERVAL); - native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; - native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now - native_criteria.recurrence_type = loc_afw_data.recurrence_type_cached; - loc_afw_data.recurrence_type_cached = ULP_LOC_RECURRENCE_PERIODIC; - //For a GPS client horizontal_accuracy & power_consumption are irrelevant - native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; - native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; - native_criteria.action = ULP_REMOVE_CRITERIA; - native_criteria.min_interval = loc_afw_data.min_interval_cached; - loc_afw_data.min_interval_cached = ULP_MIN_INTERVAL_INVALID; - ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); - } else { - ret_val = loc_eng_stop(loc_afw_data); - } + ret_val = loc_eng_stop(loc_afw_data); + EXIT_LOG(%d, ret_val); return ret_val; } @@ -486,46 +422,23 @@ static int loc_set_position_mode(GpsPositionMode mode, { ENTRY_LOG(); int ret_val = -1; - if (!loc_afw_data.ulp_initialized) { - 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; - } - - LocPosMode params(locMode, recurrence, min_interval, - preferred_accuracy, preferred_time, NULL, NULL); - ret_val = loc_eng_set_position_mode(loc_afw_data, params); - } else { - //ULP initialized so suppress set_position_mode updates to loc_eng - UlpLocationCriteria native_criteria; - native_criteria.valid_mask = (ULP_CRITERIA_HAS_ACTION | ULP_CRITERIA_HAS_PROVIDER_SOURCE | ULP_CRITERIA_HAS_RECURRENCE_TYPE | - ULP_CRITERIA_HAS_MIN_INTERVAL); - native_criteria.provider_source = ULP_PROVIDER_SOURCE_GNSS; - native_criteria.min_distance = 0; //This is not used by ULP engine so leaving it 0 for now - - if (LOC_POSITION_MODE_MS_ASSISTED == mode) - native_criteria.recurrence_type = ULP_LOC_RECURRENCE_SINGLE; - else - native_criteria.recurrence_type = ULP_LOC_RECURRENCE_PERIODIC; - - //For a GPS client horizontal_accuracy & power_consumption are irrelevant - native_criteria.preferred_horizontal_accuracy = ULP_HORZ_ACCURACY_DONT_CARE; - native_criteria.preferred_power_consumption = ULP_POWER_REQ_DONT_CARE; - native_criteria.action = ULP_ADD_CRITERIA; - native_criteria.min_interval = min_interval; - loc_afw_data.min_interval_cached = min_interval; //cache a copy - loc_afw_data.recurrence_type_cached = native_criteria.recurrence_type; //cache a copy - ret_val = loc_eng_update_criteria(loc_afw_data, native_criteria); + 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; } + LocPosMode params(locMode, recurrence, min_interval, + preferred_accuracy, preferred_time, NULL, NULL); + ret_val = loc_eng_set_position_mode(loc_afw_data, params); + EXIT_LOG(%d, ret_val); return ret_val; } @@ -637,31 +550,6 @@ static void loc_delete_aiding_data(GpsAidingData f) EXIT_LOG(%s, VOID_RET); } -/*=========================================================================== -FUNCTION loc_update_criteria - -DESCRIPTION - This is used to inform the ULP module of new unique criteria that are passed - in by the applications -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_ulp_engine_update_criteria(UlpLocationCriteria criteria) -{ - ENTRY_LOG(); - int ret_val = loc_eng_update_criteria(loc_afw_data, criteria); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - const GpsGeofencingInterface* get_geofence_interface(void) { ENTRY_LOG(); @@ -695,7 +583,6 @@ exit: EXIT_LOG(%d, geofence_interface == NULL); return geofence_interface; } - /*=========================================================================== FUNCTION loc_get_extension @@ -745,22 +632,6 @@ const void* loc_get_extension(const char* name) ret_val = &sLocEngAGpsRilInterface; } } - else if (strcmp(name, ULP_ENGINE_INTERFACE) == 0) - { - ret_val = &sLocEngUlpEngInterface; - } - else if (strcmp(name, ULP_RAW_CMD_INTERFACE) == 0) - { - ret_val = &sLocEngInjectRawCmdInterface; - } - else if(strcmp(name, ULP_PHONE_CONTEXT_INTERFACE) == 0) - { - ret_val = &sLocEngUlpPhoneContextInterface; - } - else if(strcmp(name, ULP_NETWORK_INTERFACE) == 0) - { - ret_val = &sUlpNetworkInterface; - } else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) { ret_val = get_geofence_interface(); @@ -1042,45 +913,16 @@ static void loc_agps_ril_update_network_availability(int available, const char* EXIT_LOG(%s, VOID_RET); } -/*=========================================================================== -FUNCTION loc_inject_raw_command - -DESCRIPTION - This is used to send special test modem commands from the applications - down into the HAL -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static bool loc_inject_raw_command(char* command, int length) -{ - ENTRY_LOG(); - int ret_val = loc_eng_inject_raw_command(loc_afw_data, command, length); - EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); - return ret_val; -} - 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 (ULP_LOCATION_IS_FROM_GNSS == location->position_source ) { - if (NULL != gps_loc_cb) { - gps_loc_cb(&location->gpsLocation); - } else { - LOC_LOGE("Error. GPS not enabled"); - } + + if (NULL != gps_loc_cb) { + gps_loc_cb(&location->gpsLocation); } else { - if (NULL != ulp_loc_cb) { - ulp_loc_cb(location); - } + LOC_LOGE("Error. GPS not enabled"); } } EXIT_LOG(%s, VOID_RET); @@ -1150,158 +992,6 @@ exit: return loc_eng_ulpInf; } -/*=========================================================================== -FUNCTION loc_ulp_network_init - -DESCRIPTION - Initialize the ULP network interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_ulp_phone_context_init(UlpPhoneContextCallbacks *callbacks) -{ - ENTRY_LOG(); - int ret_val = -1; - ret_val = loc_eng_ulp_phone_context_init(loc_afw_data, callbacks); - EXIT_LOG(%d, ret_val); - return ret_val; -} -/*=========================================================================== -FUNCTION loc_ulp_phone_context_settings_update - -DESCRIPTION - This is used to inform the ULP module of phone settings changes carried out - by the users -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ - -static int loc_ulp_phone_context_settings_update(UlpPhoneContextSettings *settings) -{ - ENTRY_LOG(); - int ret_val = -1; - ret_val = loc_eng_ulp_phone_context_settings_update(loc_afw_data, settings); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_ulp_network_init - -DESCRIPTION - Initialize the ULP network interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_ulp_network_init(UlpNetworkLocationCallbacks *callbacks) -{ - ENTRY_LOG(); - int ret_val = -1; - ret_val = loc_eng_ulp_network_init(loc_afw_data, callbacks); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_ulp_send_network_position - -DESCRIPTION - Ulp send data - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_ulp_send_network_position(UlpNetworkPositionReport *position_report) -{ - ENTRY_LOG(); - int ret_val = -1; - ret_val = loc_eng_ulp_send_network_position(loc_afw_data, position_report); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_ulp_engine_init - -DESCRIPTION - Initialize the ULP Engine interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_ulp_engine_init(UlpEngineCallbacks* callbacks) -{ - int retVal = -1; - ENTRY_LOG(); - if(callbacks == NULL) { - LOC_LOGE("loc_ulp_engine_init failed. cb = NULL\n"); - EXIT_LOG(%d, retVal); - return retVal; - } - //Intilize the ulp call back cache at this point - memset(&ulp_cb_data, 0, sizeof(UlpCallbacks)); - ulp_loc_cb = callbacks->location_cb; - retVal = 0; - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_ulp_engine_start() -{ - ENTRY_LOG(); - int ret_val = loc_eng_start(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -static int loc_ulp_engine_stop() -{ - ENTRY_LOG(); - int ret_val = loc_eng_stop(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - - /*=========================================================================== FUNCTION loc_init diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 08392179..9b1195b6 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -78,11 +78,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; -typedef struct { - UlpNetworkLocationCallbacks* network_location_cb; - UlpPhoneContextCallbacks* phone_context_cb; -} UlpCallbacks; - enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9391b5e8..91367ca0 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -523,19 +523,13 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if(loc_eng_data.ulp_initialized == true) - { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_START_FIX)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, - msg, loc_eng_free_msg); - } - else - { - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - } + void* target_q = loc_eng_data.ulp_initialized? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -581,19 +575,13 @@ int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.context, return -1); - if(loc_eng_data.ulp_initialized == true) - { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, ULP_MSG_STOP_FIX)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, - msg, loc_eng_free_msg); - } - else - { - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); - } + void* target_q = loc_eng_data.ulp_initialized? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -665,9 +653,13 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, INIT_CHECK(loc_eng_data.context, return -1); loc_eng_msg_position_mode *msg( new loc_eng_msg_position_mode(&loc_eng_data, params)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + void* target_q = loc_eng_data.ulp_initialized? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + + //Pass the start messgage to ULP if present & activated + msg_q_snd(target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -1515,20 +1507,16 @@ static void loc_eng_deferred_action_thread(void* arg) } // what's in the else if is... (line by line) // 1. this is a good fix; or - // 1.1 there is source info; or - // 1.1.1 this is from hybrid provider; - // 1.2 it is a Satellite fix; or - // 1.2.1 it is a sensor fix + // 1.1 it is a Satellite fix; or + // 1.1.1 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 == rpMsg->status && ( - ((LOCATION_HAS_SOURCE_INFO & rpMsg->location.gpsLocation.flags) && - ULP_LOCATION_IS_FROM_HYBRID == rpMsg->location.position_source) || - ((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || + else if ((LOC_SESS_SUCCESS == rpMsg->status && + (((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && @@ -1832,36 +1820,6 @@ static void loc_eng_deferred_action_thread(void* arg) loc_eng_handle_engine_up(*loc_eng_data_p); break; - case LOC_ENG_MSG_REQUEST_NETWORK_POSIITON: - { - loc_eng_msg_request_network_position *nlprequestmsg = (loc_eng_msg_request_network_position*)msg; - //loc_eng_handle_request_network_position(nlprequestmsg ); - LOC_LOGD("Received n/w position request from ULP.Request type %d Periodicity: %d\n", - nlprequestmsg->networkPosRequest.request_type, - nlprequestmsg->networkPosRequest.interval_ms); - if(loc_eng_data_p->ulp_network_callback != NULL) - { - loc_eng_data_p->ulp_network_callback((UlpNetworkRequestPos*)&(nlprequestmsg->networkPosRequest)); - } - else - LOC_LOGE("Ulp Network call back not initialized"); - } - break; - - case LOC_ENG_MSG_REQUEST_PHONE_CONTEXT: - { - loc_eng_msg_request_phone_context *contextReqMsg = (loc_eng_msg_request_phone_context*)msg; - LOC_LOGD("Received phone context request from ULP.context_type 0x%x,request_type 0x%x ", - contextReqMsg->contextRequest.context_type,contextReqMsg->contextRequest.request_type) - if(loc_eng_data_p->ulp_phone_context_req_cb != NULL) - { - loc_eng_data_p->ulp_phone_context_req_cb((UlpPhoneContextRequest*)&(contextReqMsg->contextRequest)); - } - else - LOC_LOGE("Ulp Phone context request call back not initialized"); - } - break; - case LOC_ENG_MSG_LOC_INIT: { loc_eng_reinit(*loc_eng_data_p); @@ -1933,235 +1891,6 @@ int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc return ret_val; } -/*=========================================================================== -FUNCTION loc_eng_inject_raw_command - -DESCRIPTION - This is used to send special test modem commands from the applications - down into the HAL -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, - char* command, int length) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); - boolean ret_val; - LOC_LOGD("loc_eng_send_extra_command: %s\n", command); - ret_val = TRUE; - - if(loc_eng_data.ulp_initialized == true) - { - ulp_msg_inject_raw_command *msg( - new ulp_msg_inject_raw_command(&loc_eng_data,command, length)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q - , msg, loc_eng_free_msg); - ret_val = 0; - }else - { - ret_val = -1; - } - - - EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); - return ret_val; -} -/*=========================================================================== -FUNCTION loc_eng_update_criteria - -DESCRIPTION - This is used to inform the ULP module of new unique criteria that are passed - in by the applications -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data, - UlpLocationCriteria criteria) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); - int ret_val; - - if(loc_eng_data.ulp_initialized == true) - { - LOC_LOGD("SJ:loc_eng_update_criteria: valid 0x%x action:%d, minTime:%ld, minDistance:%f, singleShot:%d, horizontalAccuracy:%d, powerRequirement:%d \n", - criteria.valid_mask, criteria.action, criteria.min_interval, criteria.min_distance, criteria.recurrence_type, criteria.preferred_horizontal_accuracy, - criteria.preferred_power_consumption ); - ulp_msg_update_criteria *msg( - new ulp_msg_update_criteria(&loc_eng_data,criteria)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q - , msg, loc_eng_free_msg); - ret_val = 0; - }else - { - ret_val = -1; - } - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_ulp_phone_context_settings_update - -DESCRIPTION - This is used to inform the ULP module of phone settings changes carried out - by the users -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ - -int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, - UlpPhoneContextSettings *settings) -{ - ENTRY_LOG(); - int ret_val = -1; - - LOC_LOGD("loc_eng_ulp_phone_context_settings: context_type - 0x%x is_agps_enabled - %d " - "is_battery_charging %d ,is_gps_enabled %d, is_network_position_available %d," - "is_wifi_setting_enabled %d, is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", - settings->context_type ,settings->is_agps_enabled,settings->is_battery_charging, - settings->is_gps_enabled, settings->is_network_position_available, - settings->is_wifi_setting_enabled, settings->is_agps_enabled, - settings->is_enh_location_services_enabled ); - - if(loc_eng_data.ulp_initialized == true) - { - ulp_msg_inject_phone_context_settings *msg - (new ulp_msg_inject_phone_context_settings(&loc_eng_data, *settings)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q, msg, loc_eng_free_msg); - ret_val = 0; - } - - // Send battery information to modem for processing. - if(settings->context_type & ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE) - { - loc_eng_msg_ext_power_config *msg(new loc_eng_msg_ext_power_config(&loc_eng_data, settings->is_battery_charging)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, msg, loc_eng_free_msg); - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} -/*=========================================================================== -FUNCTION loc_eng_ulp_network_init - -DESCRIPTION - Initialize the ULP network interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data,UlpPhoneContextCallbacks *callback) -{ - int ret_val = -1; - ENTRY_LOG(); - if(callback != NULL) { - loc_eng_data.ulp_phone_context_req_cb = callback->ulp_request_phone_context_cb ; - ret_val = 0; - } - else - LOC_LOGE("loc_eng_ulp_phone_context_init: bad parameters cb %p", callback); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_ulp_network_init - -DESCRIPTION - Initialize the ULP network interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, - UlpNetworkLocationCallbacks *callbacks) -{ - int ret_val = -1; - ENTRY_LOG_CALLFLOW(); - if(callbacks != NULL) { - loc_eng_data.ulp_network_callback = callbacks->ulp_network_location_request_cb; - ret_val = 0; - } - else - LOC_LOGE("loc_eng_ulp_network_init: bad parameters cb %p", callbacks); - EXIT_LOG(%d, ret_val); - return ret_val; -} - - -/*=========================================================================== -FUNCTION loc_eng_ulp_send_network_position - -DESCRIPTION - Ulp send data - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, - UlpNetworkPositionReport *position_report) -{ - ENTRY_LOG(); - int ret_val = 0; - if(loc_eng_data.ulp_initialized == true) - { - ulp_msg_inject_network_position *msg - (new ulp_msg_inject_network_position(&loc_eng_data, *position_report)); - msg_q_snd( (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q - , msg, loc_eng_free_msg); - ret_val = 0; - }else - { - ret_val = -1; - } - EXIT_LOG(%d, ret_val); - return ret_val; -} - /*=========================================================================== FUNCTION loc_eng_read_config diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index db69befa..52a1d77c 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -95,7 +95,7 @@ private: }; // Module data -typedef struct +typedef struct loc_eng_data_s { LocApiAdapter *client_handle; loc_location_cb_ext location_cb; @@ -107,8 +107,6 @@ typedef struct gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; gps_request_utc_time request_utc_time_cb; - ulp_network_location_request ulp_network_callback; - ulp_request_phone_context ulp_phone_context_req_cb; boolean intermediateFix; AGpsStatusValue agps_status; // used to defer stopping the GPS engine until AGPS data calls are done @@ -152,8 +150,6 @@ typedef struct char mpc_host_buf[101]; int mpc_port_buf; bool ulp_initialized; - uint32_t min_interval_cached; - UlpRecurrenceCriteria recurrence_type_cached; } loc_eng_data_s_type; #include "ulp.h" @@ -220,9 +216,6 @@ 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_update_criteria(loc_eng_data_s_type &loc_eng_data, - UlpLocationCriteria criteria); - 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, @@ -260,14 +253,6 @@ 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); -int loc_eng_ulp_network_init(loc_eng_data_s_type &loc_eng_data, UlpNetworkLocationCallbacks *callbacks); - -int loc_eng_ulp_phone_context_settings_update(loc_eng_data_s_type &loc_eng_data, - UlpPhoneContextSettings *settings); -int loc_eng_ulp_phone_context_init(loc_eng_data_s_type &loc_eng_data, - UlpPhoneContextCallbacks *callback); -int loc_eng_ulp_send_network_position(loc_eng_data_s_type &loc_eng_data, - UlpNetworkPositionReport *position_report); int loc_eng_read_config(void); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index b0d64c68..6667ecbf 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -95,18 +95,7 @@ static loc_name_val_s_type loc_eng_msgs[] = NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ), NAME_VAL( LOC_ENG_MSG_EXT_POWER_CONFIG ), NAME_VAL( LOC_ENG_MSG_REQUEST_POSITION ), - NAME_VAL( LOC_ENG_MSG_REQUEST_PHONE_CONTEXT ), - NAME_VAL( LOC_ENG_MSG_REQUEST_NETWORK_POSIITON ), - NAME_VAL( ULP_MSG_UPDATE_CRITERIA ), - NAME_VAL( ULP_MSG_START_FIX ), - NAME_VAL( ULP_MSG_STOP_FIX ), - NAME_VAL( ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS ), - NAME_VAL( ULP_MSG_INJECT_NETWORK_POSITION ), - NAME_VAL( ULP_MSG_REPORT_QUIPC_POSITION ), - NAME_VAL( ULP_MSG_REQUEST_COARSE_POSITION ), - NAME_VAL( ULP_MSG_MONITOR ), NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), - NAME_VAL( ULP_MSG_INJECT_RAW_COMMAND ), NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ), NAME_VAL( LOC_ENG_MSG_LOC_INIT ) }; diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 9d9c1581..22286777 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -35,7 +35,6 @@ #include #include #include "log_util.h" -#include "loc.h" #include #include "loc_eng_msg_id.h" @@ -825,118 +824,6 @@ struct loc_eng_msg_set_data_enable : public loc_eng_msg { } }; -struct loc_eng_msg_request_network_position : public loc_eng_msg { - const UlpNetworkRequestPos networkPosRequest; - inline loc_eng_msg_request_network_position (void* instance, UlpNetworkRequestPos networkPosReq) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NETWORK_POSIITON), - networkPosRequest(networkPosReq) - { - LOC_LOGV("network position request: desired pos source %d\n request type: %d\n interval ms: %d ", - networkPosReq.desired_position_source, - networkPosReq.request_type, - networkPosReq.interval_ms); - } -}; - -struct loc_eng_msg_request_phone_context : public loc_eng_msg { - const UlpPhoneContextRequest contextRequest; - inline loc_eng_msg_request_phone_context (void* instance, UlpPhoneContextRequest contextReq) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_PHONE_CONTEXT), - contextRequest(contextReq) - { - LOC_LOGV("phone context request: request type 0x%x context type: 0x%x ", - contextRequest.request_type, - contextRequest.context_type); - } -}; - -struct ulp_msg_update_criteria : public loc_eng_msg { - const UlpLocationCriteria locationCriteria; - inline ulp_msg_update_criteria (void* instance, UlpLocationCriteria criteria) : - loc_eng_msg(instance, ULP_MSG_UPDATE_CRITERIA), - locationCriteria(criteria) - { - LOC_LOGV("location criteria: aciton %d\n valid mask: %d\n provider source: %d\n accuracy %d\n recurrence type %d\n min interval %d\n power consumption %d\n intermediate pos %d ", - locationCriteria.action, - locationCriteria.valid_mask, - locationCriteria.provider_source, - locationCriteria.preferred_horizontal_accuracy, - locationCriteria.recurrence_type, - locationCriteria.min_interval, - locationCriteria.preferred_power_consumption, - locationCriteria.intermediate_pos_report_enabled); - } -}; - -struct ulp_msg_inject_raw_command : public loc_eng_msg { - const char* rawCommand; - const int rawCommandLength; - inline ulp_msg_inject_raw_command (void* instance, char* command, int length) : - loc_eng_msg(instance, ULP_MSG_INJECT_RAW_COMMAND), - rawCommand(new char[length]), - rawCommandLength(length) - { - memcpy((void*)rawCommand, (void*)command, length); - LOC_LOGV("inject raw command: command %s\n command length: %d\n ", - rawCommand, - rawCommandLength); - } - - inline ~ulp_msg_inject_raw_command() - { - delete[] rawCommand; - } -}; - -struct ulp_msg_inject_phone_context_settings : public loc_eng_msg { - const UlpPhoneContextSettings phoneSetting; - inline ulp_msg_inject_phone_context_settings(void* instance, UlpPhoneContextSettings setting) : - loc_eng_msg(instance, ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS), - phoneSetting(setting) - { - LOC_LOGV("context type: %d\n gps enabled: %d\n network position available %d\n wifi setting enabled %d\n battery charging %d" - "is_agps_setting_enabled %d, is_enh_location_services_enabled %d\n", - phoneSetting.context_type, - phoneSetting.is_gps_enabled, - phoneSetting.is_network_position_available, - phoneSetting.is_wifi_setting_enabled, - phoneSetting.is_battery_charging, - phoneSetting.is_agps_enabled, - phoneSetting.is_enh_location_services_enabled); - } -}; - -struct ulp_msg_inject_network_position : public loc_eng_msg { - const UlpNetworkPositionReport networkPosition; - inline ulp_msg_inject_network_position(void* instance, UlpNetworkPositionReport networkPos) : - loc_eng_msg(instance, ULP_MSG_INJECT_NETWORK_POSITION), - networkPosition(networkPos) - { - LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n accuracy %f", - networkPosition.valid_flag, - networkPosition.position.pos_source, - networkPosition.position.latitude, - networkPosition.position.longitude, - networkPosition.position.HEPE); - } -}; - -struct ulp_msg_report_quipc_position : public loc_eng_msg { - const UlpLocation location; - const int quipc_error_code; - inline ulp_msg_report_quipc_position(void* instance, UlpLocation &loc, - int quipc_err) : - loc_eng_msg(instance, ULP_MSG_REPORT_QUIPC_POSITION), - location(loc), quipc_error_code(quipc_err) - { - 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 Quipc error: %d", - 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, - quipc_error_code); - } -}; - void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); int loc_eng_msgget(int * p_req_msgq); int loc_eng_msgremove(int req_msgq); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h index 6d011240..6e35312c 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ b/loc_api/libloc_api_50001/loc_eng_msg_id.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -42,13 +42,18 @@ enum loc_eng_msg_ids_t { /* 0x 0 - 0xEF is reserved for daemon internal */ /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ LOC_ENG_MSG_QUIT = 0x200, + /*******************OEMs PLEASE NOTE***************************/ + /* The next five messages are shared with libulp. They are should + not be altered if libulp cannot be recompiled */ + LOC_ENG_MSG_START_FIX, + LOC_ENG_MSG_STOP_FIX, + LOC_ENG_MSG_SET_POSITION_MODE, + LOC_ENG_MSG_REPORT_POSITION, + LOC_ENG_MSG_REPORT_SV, LOC_ENG_MSG_ENGINE_DOWN, LOC_ENG_MSG_ENGINE_UP, - LOC_ENG_MSG_START_FIX, - LOC_ENG_MSG_STOP_FIX, - LOC_ENG_MSG_SET_POSITION_MODE, LOC_ENG_MSG_SET_TIME, LOC_ENG_MSG_INJECT_XTRA_DATA, LOC_ENG_MSG_REQUEST_XTRA_SERVER, @@ -69,8 +74,6 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_ATL_CLOSED, LOC_ENG_MSG_ATL_OPEN_FAILED, - LOC_ENG_MSG_REPORT_POSITION, - LOC_ENG_MSG_REPORT_SV, LOC_ENG_MSG_REPORT_STATUS, LOC_ENG_MSG_REPORT_NMEA, LOC_ENG_MSG_REPORT_XTRA_SERVER, @@ -87,50 +90,10 @@ enum loc_eng_msg_ids_t { LOC_ENG_MSG_REQUEST_POSITION, LOC_ENG_MSG_EXT_POWER_CONFIG, - // The following messages are added for ulp - LOC_ENG_MSG_REQUEST_PHONE_CONTEXT, - LOC_ENG_MSG_REQUEST_NETWORK_POSIITON, - - /* Following messages are for ulp, start at index 0x600 */ - - // Message is sent by GPS HAL layer to add/remove unique request criteria - ULP_MSG_UPDATE_CRITERIA = 0x600, - - // Message is sent by GPS HAL layer to request ULP to start producing position fixes - - ULP_MSG_START_FIX, - - // Message is sent by Android framework(GpsLocationProvider) - // to request ULP to stop producing position fixes - ULP_MSG_STOP_FIX, - - // Message is sent by Android framework(GpsLocationProvider) - // to inject phone context setting include initial phone context setting and subsequent changes - ULP_MSG_INJECT_PHONE_CONTEXT_SETTINGS, - - // Message is sent by network provider to INJECT the position in UlpNetworkPositionReport format - ULP_MSG_INJECT_NETWORK_POSITION, - - // Message is sent by QUIPC provider in order to report the position in GpsPosition format with QUIPC status - ULP_MSG_REPORT_QUIPC_POSITION, - - // Message is sent by QUIPC module in order to request some info from ULP - ULP_MSG_REQUEST_COARSE_POSITION, - - // Message is sent to ULP module to re-evaluate its subsystems - ULP_MSG_MONITOR, - - // Last ULP MSG - ULP_MSG_LAST = 0x700, - /* Message is sent by HAL to LOC API to configure LTE Positioning Profile in modem */ LOC_ENG_MSG_LPP_CONFIG, - // Message is sent by Android framework (GpsLocationProvider) - // to inject the raw command - ULP_MSG_INJECT_RAW_COMMAND, - /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ LOC_ENG_MSG_A_GLONASS_PROTOCOL, diff --git a/loc_api/libloc_api_50001/loc_ulp.h b/loc_api/libloc_api_50001/loc_ulp.h index 5822b7ca..f4b1d0ed 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -38,11 +38,6 @@ extern "C" { #include #include -#define ULP_ENGINE_INTERFACE "ulp-engine-interface" -#define ULP_NETWORK_INTERFACE "ulp-network-interface" -#define ULP_RAW_CMD_INTERFACE "ulp-raw-cmd" -#define ULP_PHONE_CONTEXT_INTERFACE "ulp-phone-context" - /** Location has valid source information. */ #define LOCATION_HAS_SOURCE_INFO 0x0020 /** GpsLocation has valid "is indoor?" flag */ @@ -65,69 +60,6 @@ extern "C" { #define ULP_MIN_INTERVAL_INVALID 0xffffffff -/** Represents recurrence of location */ -typedef enum{ - ULP_LOC_RECURRENCE_PERIODIC = 0, - ULP_LOC_RECURRENCE_SINGLE, -}UlpRecurrenceCriteria; - -/** Represents horizontal accuracy options */ -typedef enum { - ULP_HORZ_ACCURACY_DONT_CARE = 0, - ULP_HORZ_ACCURACY_LOW, - ULP_HORZ_ACCURACY_MED, - ULP_HORZ_ACCURACY_HIGH, -}UlpHorzAccuracyCriteria; - -/** Represents accuracy options (for speed, altitude, and - * bearing) */ -typedef enum { - ULP_ACCURACY_DONT_CARE = 0, - ULP_ACCURACY_LOW, - ULP_ACCURACY_HIGH, -}UlpAccuracyCriteria; - -/** Represents power consumption options */ -typedef enum { - ULP_POWER_REQ_DONT_CARE = 0, - ULP_POWER_REQ_LOW, - ULP_POWER_REQ_HIGH, -}UlpPowerCriteria; - -/** Represents data usage options */ -typedef enum { - ULP_DATA_REQ_DONT_CARE = 0, - ULP_DATA_ALLOW, - ULP_DATA_DENY, -}UlpDataUsageCriteria; - -/** Enable the reporting of altitude in location reports */ -#define ULP_ENABLE_ALTITUDE_REPORT 0x01 -/** Enable the reporting of speed in location reports */ -#define ULP_ENABLE_SPEED_REPORT 0x02 -/** Enable the reporting of bearing in location reports */ -#define ULP_ENABLE_BEARING_REPORT 0x04 - -#define ULP_CRITERIA_HAS_ACTION 0x00000001 -#define ULP_CRITERIA_HAS_PROVIDER_SOURCE 0x00000002 -#define ULP_CRITERIA_HAS_RECURRENCE_TYPE 0x00000004 -#define ULP_CRITERIA_HAS_PREFERRED_RESPONSE_TIME 0x00000010 -#define ULP_CRITERIA_HAS_MIN_INTERVAL 0x00000020 -#define ULP_CRITERIA_HAS_MIN_DISTANCE 0x00000040 -#define ULP_CRITERIA_HAS_MIN_DIST_SAMPLE_INTERVAL 0x00000080 -#define ULP_CRITERIA_HAS_DESIRED_OUTPUT_PARAMETER 0x00000100 -#define ULP_CRITERIA_HAS_PREFERRED_HORIZONTAL_ACCURACY 0x00000200 -#define ULP_CRITERIA_HAS_PREFERRED_POWER_CONSUMPTION 0x00000400 -#define ULP_CRITERIA_HAS_PREFERRED_ALTITUDE_ACCURACY 0x00000800 -#define ULP_CRITERIA_HAS_PREFERRED_BEARING_ACCURACY 0x00001000 -#define ULP_CRITERIA_HAS_PREFERRED_DATA_USAGE 0x00002000 -#define ULP_CRITERIA_HAS_INTERMEDIATE_POS_REPORT_ENABLED 0x00004000 - -#define ULP_PROVIDER_SOURCE_GNSS 0x00000001 -#define ULP_PROVIDER_SOURCE_HYBRID 0x00000002 - -#define ULP_ADD_CRITERIA 1 -#define ULP_REMOVE_CRITERIA 2 typedef struct { /** set to sizeof(UlpLocation) */ @@ -144,269 +76,6 @@ typedef struct { unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE]; } UlpLocation; -/** Callback with location information. - */ -typedef void (* ulp_location_callback)(UlpLocation* location); - -/** ULP Engine callback structure. */ -typedef struct { - /** set to sizeof(UlpCallbacks) */ - size_t size; - ulp_location_callback location_cb; -} UlpEngineCallbacks; - -typedef struct { - - uint32_t valid_mask; - /* delete or add. This is a mandatory field */ - int action; - /*via gps or hybrid provider*/ - int provider_source; - /** PERIODIC or SINGLE */ - UlpRecurrenceCriteria recurrence_type; - /** obtain position within the specified response time */ - uint32_t preferred_response_time; - /** Send updates after the specified interval */ - uint32_t min_interval; - /** Send updates after device moved a specified distance */ - float min_distance; - uint32_t min_dist_sample_interval; - /** Fields specfied in the mask should be reported in the - * position report (altitude, bearing and speed) */ - uint32_t desired_output_parameter; - /** Desired accuracy for latitude, longitude */ - UlpHorzAccuracyCriteria preferred_horizontal_accuracy; - /** Desired power consumption level */ - UlpPowerCriteria preferred_power_consumption; - /** Desired accuracy for altitude */ - UlpAccuracyCriteria preferred_altitude_accuracy; - /** Desired accuracy for bearing */ - UlpAccuracyCriteria preferred_bearing_accuracy; - UlpDataUsageCriteria preferred_data_usage; - bool intermediate_pos_report_enabled; -} UlpLocationCriteria; - -/** Represents the Ulp Egine interface. */ -typedef struct { - /** set to sizeof(UlpEngineInterface) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( UlpEngineCallbacks* callbacks ); - - /* set criterias of location requests */ - int (*update_criteria) (UlpLocationCriteria criteria ); - - /** Starts navigating. */ - int (*start)( void ); - - /** Stops navigating. */ - int (*stop)( void ); -} UlpEngineInterface; - - -/** Extended interface for raw GPS command support. */ -typedef struct { - /** set to sizeof(ExtraCmdInterface) */ - size_t size; - /** Injects Android extra cmd into the ulp. Clarify if they are blocking calls */ - bool (*inject_raw_cmd)(char* bundle, int bundle_length ); - -} InjectRawCmdInterface; - -/** ULP Network Interface */ -/** Request for network position status */ -#define ULP_NETWORK_POS_STATUS_REQUEST (0x01) -/** Request for periodic network positions */ -#define ULP_NETWORK_POS_START_PERIODIC_REQUEST (0x02) -/** Request last known location */ -#define ULP_NETWORK_POS_GET_LAST_KNOWN_LOCATION_REQUEST (0x03) -/** Cancel request */ -#define ULP_NETWORK_POS_STOP_REQUEST (0x04) - -/** Position was obtained using Wifi Network */ -#define ULP_NETWORK_POSITION_SRC_WIFI (0x01) -/** Position was obtained using Cell Network */ -#define ULP_NETWORK_POSITION_SRC_CELL (0x02) -/** Position was obtained using an Unknown Network */ -#define ULP_NETWORK_POSITION_SRC_UNKNOWN (0x00) - -/** Represents the ULP network request */ -typedef struct { - /** type of request */ - uint16_t request_type; - /** Desired time between network positions/measurements in ms. - * Shall be set to 0 if only one position is requested */ - int interval_ms; - /** network position source to be used */ - uint16_t desired_position_source; -}UlpNetworkRequestPos; - -/** Callback with network position request. */ -typedef void (*ulp_network_location_request)(UlpNetworkRequestPos *req); - -/** ULP Network callback structure. */ -typedef struct { - ulp_network_location_request ulp_network_location_request_cb; -} UlpNetworkLocationCallbacks; - -/** represent a network position */ -typedef struct { - /** source of the position (Wifi, Cell) */ - uint16_t pos_source; - /** latitude in degrees */ - double latitude; - /** longitude in degrees */ - double longitude; - /** Horzizontal error estimate in meters */ - float HEPE; -} UlpNetworkPosition; - -/** Represents access point information */ -typedef struct { - /** Mac adderess */ - char mac_addr[6]; - /** signal strength in dbM */ - int32_t rssi; - /** Beacon channel for access point */ - uint16_t channel; - - /** Bit 0 = AP is used by WiFi positioning system - * Bit 1 = AP doesn't broadcast SSID Bit 2 = AP has encrption - * turned on Bit 3 = AP is in infrastructure mode and not in - * ad-hoc/unknown mode */ - uint8_t ap_qualifier; -} UlpNetworkAccessPointInfo; - -/** Represents Wifi information */ -typedef struct { - /** Number of APs in the calculated position (-1 means - * unknown) */ - uint8_t num_aps_in_pos; - /** Information of the scanned ap's used in the position estimation*/ - UlpNetworkAccessPointInfo *ap_info; -} UlpNetworkWifiInfo; - - -/** Represent network landscape information */ -typedef struct { - /** network type Cell/Wifi */ - uint8_t network_type; - /** network information */ - union { - UlpNetworkWifiInfo wifi_info; - uint32_t cell_info; - } u; -} UlpNetworkLandscape; - -/** network report valid flags */ -/** fix time is valid */ -#define ULP_NETWORK_POSITION_REPORT_HAS_FIX_TIME (0x01) -/** position is valid */ -#define ULP_NETWORK_POSITION_REPORT_HAS_POSITION (0x02) -/** landscape is valid */ -#define ULP_NETWORK_POSITION_REPORT_HAS_LANDSCAPE (0x04) - -/** Represents the network position report */ -typedef struct -{ - /** validity flags */ - uint16_t valid_flag; - /** time fo network fix */ - GpsUtcTime fix_time; - /** network position */ - UlpNetworkPosition position; - /** network landscape */ - UlpNetworkLandscape landscape_info; -}UlpNetworkPositionReport; - -/** represents ULP network interface extension */ -typedef struct -{ - /** set to sizeof(UlpNetworkInterface) */ - size_t size; - /** initialize network interface */ - int ( *init)(UlpNetworkLocationCallbacks *callback); - /** send network position */ - int ( *ulp_send_network_position)(UlpNetworkPositionReport *position_report); -}UlpNetworkInterface; - -/** Information for the ULP Phone context interface */ - -/** the Location settings context supports only ON_CHANGE - * request type */ -#define ULP_PHONE_CONTEXT_GPS_SETTING (0x01) -#define ULP_PHONE_CONTEXT_NETWORK_POSITION_SETTING (0x02) -#define ULP_PHONE_CONTEXT_WIFI_SETTING (0x04) -/** The battery charging state context supports only - * ON_CHANGE request type */ -#define ULP_PHONE_CONTEXT_BATTERY_CHARGING_STATE (0x08) -#define ULP_PHONE_CONTEXT_AGPS_SETTING (0x010) -#define ULP_PHONE_CONTEXT_ENH_LOCATION_SERVICES_SETTING (0x020) - -/** return phone context only once */ -#define ULP_PHONE_CONTEXT_REQUEST_TYPE_SINGLE (0x01) -/** return phone context periodcially */ -#define ULP_PHONE_CONTEXT_REQUEST_TYPE_PERIODIC (0x02) -/** return phone context when it changes */ -#define ULP_PHONE_CONTEXT_REQUEST_TYPE_ON_CHANGE (0x03) - - -/** Represents ULP phone context request */ -typedef struct { - /** context type requested */ - uint16_t context_type; - /** request type */ - uint16_t request_type; - /** interval in ms if request type is periodic */ - int interval_ms; -}UlpPhoneContextRequest; - -/** Callback for phone context request. */ -typedef void (*ulp_request_phone_context)(UlpPhoneContextRequest *req); - -/** ULP Phone Context callback structure. */ -typedef struct { - ulp_request_phone_context ulp_request_phone_context_cb; -}UlpPhoneContextCallbacks; - -/** Represents the phone context settings */ -typedef struct { - /** Phone context information type */ - uint16_t context_type; - - /** network information */ - /** gps setting */ - bool is_gps_enabled; - /** is network positioning enabled */ - bool is_network_position_available; - /** is wifi turned on */ - bool is_wifi_setting_enabled; - /** is battery being currently charged */ - bool is_battery_charging; - /* is agps enabled for single shot */ - bool is_agps_enabled; - /* is Enhanced Location Services enabled by user*/ - bool is_enh_location_services_enabled; -} UlpPhoneContextSettings; - -/** Represent the phone contxt interface */ -typedef struct -{ - /** set to sizeof(UlpPhoneContextInterface) */ - size_t size; - /** Initialize, register callback */ - int (*init)(UlpPhoneContextCallbacks *callback); - /** send the phone context settings */ - int (*ulp_phone_context_settings_update) (UlpPhoneContextSettings *settings ); -}UlpPhoneContextInterface; - - -//int loc_update_criteria(UlpLocationCriteria criteria); -//const void* loc_get_extension(const char* name); - #ifdef __cplusplus } diff --git a/loc_api/ulp/inc/ulp.h b/loc_api/ulp/inc/ulp.h index 94f2ebd8..3a2e8e32 100644 --- a/loc_api/ulp/inc/ulp.h +++ b/loc_api/ulp/inc/ulp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -36,7 +36,7 @@ extern "C" #endif #include -#include "loc_eng.h" +struct loc_eng_data_s; /** Represents the standard ulp module interface. */ typedef struct { @@ -46,7 +46,9 @@ typedef struct { /** * Starts the libulp module. 0: success */ - int (*init)(loc_eng_data_s_type &loc_eng_data); + int (*init)(struct loc_eng_data_s &loc_eng_data); + /** Get a pointer to extension information. */ + const void* (*get_extension)(const char* name); }ulpInterface; From b86a09596e189cac8e77e7232bab00ee8d4d1412 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 16 Jul 2013 10:56:52 -0700 Subject: [PATCH 144/945] Checking Geofence Mask in gps.conf Check the CAPABILITIES in gps.conf to see if the geofence is enabled or not. If it is not enabled, the function of getting geofence interface will return null. Change-Id: I6500cedd775d83b4701fbe2b3a111c170c8a34be CRs-fixed: 513494 --- loc_api/libloc_api_50001/loc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 35a99792..63cf8f43 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -637,7 +637,9 @@ const void* loc_get_extension(const char* name) } else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) { - ret_val = get_geofence_interface(); + if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ + ret_val = get_geofence_interface(); + } } else { From d42eeebb5a11ca405a3c84a5ab7e6d38d84c7750 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sun, 14 Jul 2013 17:32:54 -0700 Subject: [PATCH 145/945] made a convenient msg_q_init2 the original msg_q_init takes a q handle in the parameter list which makes it inconvenient for chain statement. This really adds nothing be making it slightly convenient Change-Id: I1e7f931d6b278c804ec6f7d87c1a79a3ffcceb75 --- utils/msg_q.c | 14 ++++++++++++++ utils/msg_q.h | 20 +++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/utils/msg_q.c b/utils/msg_q.c index c4f3b9d9..f82d4c03 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -136,6 +136,20 @@ msq_q_err_type msg_q_init(void** msg_q_data) 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 diff --git a/utils/msg_q.h b/utils/msg_q.h index d3d5cc5d..453b8ce3 100644 --- a/utils/msg_q.h +++ b/utils/msg_q.h @@ -58,7 +58,7 @@ FUNCTION msg_q_init DESCRIPTION Initializes internal structures for message queue. - msg_q_data: State of message queue to be initialized. + msg_q_data: pointer to an opaque Q handle to be returned; NULL if fails DEPENDENCIES N/A @@ -72,6 +72,24 @@ SIDE EFFECTS ===========================================================================*/ 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 From caff225a0b959087edea08180fac844f8ec558df Mon Sep 17 00:00:00 2001 From: Gohulan Balachandran Date: Tue, 23 Jul 2013 20:45:47 -0600 Subject: [PATCH 146/945] Fix merge damage. --- loc_api/ds_api/Android.mk | 49 - loc_api/ds_api/ds_client.c | 704 -- loc_api/ds_api/ds_client.h | 142 - loc_api/loc_api_v02/Android.mk | 52 - loc_api/loc_api_v02/LocApiV02Adapter.cpp | 2365 ------ loc_api/loc_api_v02/LocApiV02Adapter.h | 182 - loc_api/loc_api_v02/Makefile.am | 42 - loc_api/loc_api_v02/loc_api_sync_req.c | 547 -- loc_api/loc_api_v02/loc_api_v02_client.c | 2211 ----- loc_api/loc_api_v02/loc_api_v02_client.h | 1437 ---- loc_api/loc_api_v02/loc_api_v02_log.c | 295 - loc_api/loc_api_v02/loc_util_log.h | 75 - loc_api/loc_api_v02/location_service_v02.c | 3346 -------- loc_api/loc_api_v02/location_service_v02.h | 8862 -------------------- 14 files changed, 20309 deletions(-) delete mode 100644 loc_api/ds_api/Android.mk delete mode 100644 loc_api/ds_api/ds_client.c delete mode 100644 loc_api/ds_api/ds_client.h delete mode 100644 loc_api/loc_api_v02/Android.mk delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.cpp delete mode 100644 loc_api/loc_api_v02/LocApiV02Adapter.h delete mode 100644 loc_api/loc_api_v02/Makefile.am delete mode 100644 loc_api/loc_api_v02/loc_api_sync_req.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.c delete mode 100644 loc_api/loc_api_v02/loc_api_v02_client.h delete mode 100644 loc_api/loc_api_v02/loc_api_v02_log.c delete mode 100644 loc_api/loc_api_v02/loc_util_log.h delete mode 100644 loc_api/loc_api_v02/location_service_v02.c delete mode 100644 loc_api/loc_api_v02/location_service_v02.h diff --git a/loc_api/ds_api/Android.mk b/loc_api/ds_api/Android.mk deleted file mode 100644 index ca04f51d..00000000 --- a/loc_api/ds_api/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libds_api - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libqmi_cci \ - libqmi_csi \ - libqmi_common_so \ - libgps.utils \ - libdsi_netctrl \ - libqmiservices - - -LOCAL_SRC_FILES += \ - ds_client.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_COPY_HEADERS_TO:= ds_api/ - -LOCAL_COPY_HEADERS:= \ - ds_client.h - -LOCAL_LDFLAGS += -Wl,--export-dynamic - -## Includes -LOCAL_C_INCLUDES := \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - $(TARGET_OUT_HEADERS)/qmi-framework/inc \ - $(TARGET_OUT_HEADERS)/qmi/inc \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/data/inc - - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/ds_api/ds_client.c b/loc_api/ds_api/ds_client.c deleted file mode 100644 index 2dcf0636..00000000 --- a/loc_api/ds_api/ds_client.c +++ /dev/null @@ -1,704 +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. - */ - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_ds_client" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -//Timeout to wait for wds service notification from qmi -#define DS_CLIENT_SERVICE_TIMEOUT (4000) -//Max timeout for the service to come up -#define DS_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) -//Timeout for the service to respond to sync msg -#define DS_CLIENT_SYNC_MSG_TIMEOUT (5000) -/*Request messages the WDS client can send to the WDS service*/ -typedef union -{ - /*Requests the service for a list of all profiles present*/ - wds_get_profile_list_req_msg_v01 *p_get_profile_list_req; - /*Requests the service for a profile's settings*/ - wds_get_profile_settings_req_msg_v01 *p_get_profile_settings_req; -}ds_client_req_union_type; - -/*Response indications that are sent by the WDS service*/ -typedef union -{ - wds_get_profile_list_resp_msg_v01 *p_get_profile_list_resp; - wds_get_profile_settings_resp_msg_v01 *p_get_profile_setting_resp; -}ds_client_resp_union_type; - -struct event_strings_s -{ - char * str; - dsi_net_evt_t evt; -}; - -struct event_strings_s event_string_tbl[DSI_EVT_MAX] = -{ - NAME_VAL(DSI_EVT_INVALID), - NAME_VAL(DSI_EVT_NET_IS_CONN), - NAME_VAL(DSI_EVT_NET_NO_NET), - NAME_VAL(DSI_EVT_PHYSLINK_DOWN_STATE), - NAME_VAL(DSI_EVT_PHYSLINK_UP_STATE), - NAME_VAL(DSI_EVT_NET_RECONFIGURED), -}; - -typedef struct -{ - ds_client_event_ind_cb_type event_cb; - void *caller_cookie; -}ds_caller_data; - -typedef struct { - //Global dsi handle - dsi_hndl_t dsi_net_handle; - //Handle to caller's data - ds_caller_data caller_data; -} ds_client_session_data; - -void net_ev_cb(dsi_hndl_t handle, void* user_data, - dsi_net_evt_t evt, dsi_evt_payload_t *payload_ptr) -{ - int i; - (void)handle; - (void)user_data; - (void)payload_ptr; - ds_caller_data *callback_data = (ds_caller_data *)user_data; - - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - - if(evt > DSI_EVT_INVALID && evt < DSI_EVT_MAX) - { - for(i=0;ievent_cb(E_DS_CLIENT_DATA_CALL_CONNECTED, - callback_data->caller_cookie); - break; - } - case DSI_EVT_NET_NO_NET: - { - LOC_LOGD("%s:%d]: Emergency call stopped\n", __func__, __LINE__); - callback_data->event_cb(E_DS_CLIENT_DATA_CALL_DISCONNECTED, - callback_data->caller_cookie); - break; - } - default: - LOC_LOGD("%s:%d]: uninteresting event\n", __func__, __LINE__); - } - } - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); -} - -/*This function is called to obtain a handle to the QMI WDS service*/ -static ds_client_status_enum_type -ds_client_qmi_ctrl_point_init(qmi_client_type *p_wds_qmi_client) -{ - qmi_client_type wds_qmi_client, notifier = NULL; - ds_client_status_enum_type status = E_DS_CLIENT_SUCCESS; - qmi_service_info *p_service_info = NULL; - uint32_t num_services = 0, num_entries = 0; - qmi_client_error_type ret = QMI_NO_ERR; - unsigned char no_signal = 0; - qmi_client_os_params os_params; - int timeout = 0; - - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - - //Get service object for QMI_WDS service - qmi_idl_service_object_type ds_client_service_object = - wds_get_service_object_v01(); - if(ds_client_service_object == NULL) { - LOC_LOGE("%s:%d]: wds_get_service_object_v01 failed\n" , - __func__, __LINE__); - status = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - - //get service addressing information - ret = qmi_client_get_service_list(ds_client_service_object, NULL, NULL, - &num_services); - LOC_LOGD("%s:%d]: qmi_client_get_service_list() first try ret %d, " - "num_services %d]\n", __func__, __LINE__, ret, num_services); - if(ret != QMI_NO_ERR) { - //Register for service notification - ret = qmi_client_notifier_init(ds_client_service_object, &os_params, ¬ifier); - if (ret != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, ret); - status = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - ret = qmi_client_get_service_list(ds_client_service_object, NULL, - NULL, &num_services); - if(ret != QMI_NO_ERR) { - QMI_CCI_OS_SIGNAL_WAIT(&os_params, DS_CLIENT_SERVICE_TIMEOUT); - no_signal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - if(!no_signal) - ret = qmi_client_get_service_list(ds_client_service_object, NULL, - NULL, &num_services); - } - timeout += DS_CLIENT_SERVICE_TIMEOUT; - LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned ret: %d," - "no_signal: %d, total timeout: %d\n", __func__, __LINE__, - ret, no_signal, timeout); - } while( (timeout < DS_CLIENT_SERVICE_TIMEOUT_TOTAL) && - no_signal && - (ret != QMI_NO_ERR) ); - } - - //Handle failure cases - if(num_services == 0 || ret != QMI_NO_ERR) { - if(!no_signal) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up! Error: %d \n", __func__, __LINE__, ret); - status = E_DS_CLIENT_FAILURE_INTERNAL; - } - else { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries" - "Error: %d \n", __func__, __LINE__, ret); - status = E_DS_CLIENT_FAILURE_TIMEOUT; - } - goto err; - } - - LOC_LOGD("%s:%d]: qmi_client_get_service_list succeeded\n", __func__, __LINE__); - - //Success - p_service_info = (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); - if(p_service_info == NULL) { - LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", - __func__, __LINE__); - status = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - num_entries = num_services; - - //Populate service info - ret = qmi_client_get_service_list(ds_client_service_object, p_service_info, - &num_entries, &num_services); - if(ret != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed. ret: %d \n", - __func__, __LINE__, ret); - status = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - - //Initialize wds_qmi_client - LOC_LOGD("%s:%d]: Initializing WDS client with qmi_client_init\n", __func__, - __LINE__); - ret = qmi_client_init(&p_service_info[0], ds_client_service_object, - NULL, NULL, NULL, &wds_qmi_client); - if(ret != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_init Error. ret: %d\n", __func__, __LINE__, ret); - status = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - LOC_LOGD("%s:%d]: WDS client initialized with qmi_client_init\n", __func__, - __LINE__); - - //Store WDS QMI client handle in the parameter passed in - *p_wds_qmi_client = wds_qmi_client; - - status = E_DS_CLIENT_SUCCESS; - LOC_LOGD("%s:%d]: init success\n", __func__, __LINE__); - - if(notifier) - qmi_client_release(notifier); - -err: - if(p_service_info) - free(p_service_info); - - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return status; -} - -/*This function reads the error code from within the response struct*/ -static ds_client_status_enum_type ds_client_convert_qmi_response( - uint32_t req_id, - ds_client_resp_union_type *resp_union) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - switch(req_id) - { - case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : - { - if(resp_union->p_get_profile_list_resp->resp.error != - QMI_ERR_NONE_V01) { - LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, - resp_union->p_get_profile_list_resp->resp.error); - } - else - ret = E_DS_CLIENT_SUCCESS; - } - break; - - case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : - { - if(resp_union->p_get_profile_setting_resp->resp.error != - QMI_ERR_NONE_V01) { - LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, - resp_union->p_get_profile_setting_resp->resp.error); - } - else - ret = E_DS_CLIENT_SUCCESS; - } - break; - - default: - LOC_LOGE("%s:%d]: Unknown request ID\n", __func__, __LINE__); - } - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} - - -static ds_client_status_enum_type ds_client_send_qmi_sync_req( - qmi_client_type *ds_client_handle, - uint32_t req_id, - ds_client_resp_union_type *resp_union, - ds_client_req_union_type *req_union) -{ - uint32_t req_len = 0; - uint32_t resp_len = 0; - ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; - qmi_client_error_type qmi_ret = QMI_NO_ERR; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - switch(req_id) - { - case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : - { - req_len = sizeof(wds_get_profile_list_req_msg_v01); - resp_len = sizeof(wds_get_profile_list_resp_msg_v01); - LOC_LOGD("%s:%d]: req_id = GET_PROFILE_LIST_REQ\n", - __func__, __LINE__); - } - break; - - case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : - { - req_len = sizeof(wds_get_profile_settings_req_msg_v01); - resp_len = sizeof(wds_get_profile_settings_resp_msg_v01); - LOC_LOGD("%s:%d]: req_id = GET_PROFILE_SETTINGS_REQ\n", - __func__, __LINE__); - } - break; - - default: - LOC_LOGE("%s:%d]: Error unknown req_id=%d\n", __func__, __LINE__, - req_id); - ret = E_DS_CLIENT_FAILURE_INVALID_PARAMETER; - goto err; - } - - LOC_LOGD("%s:%d]: req_id=%d, len = %d; resp_len= %d\n", __func__, __LINE__, - req_id, req_len, resp_len); - //Send msg through QCCI - qmi_ret = qmi_client_send_msg_sync( - *ds_client_handle, - req_id, - (void *)req_union->p_get_profile_list_req, - req_len, - (void *)resp_union->p_get_profile_list_resp, - resp_len, - DS_CLIENT_SYNC_MSG_TIMEOUT); - LOC_LOGD("%s:%d]: qmi_client_send_msg_sync returned: %d", __func__, __LINE__, qmi_ret); - - if(qmi_ret != QMI_NO_ERR) { - ret = E_DS_CLIENT_FAILURE_INTERNAL; - goto err; - } - - ret = ds_client_convert_qmi_response(req_id, resp_union); - -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} - -/*This function obtains the list of supported profiles*/ -static ds_client_status_enum_type ds_client_get_profile_list( - qmi_client_type *ds_client_handle, - ds_client_resp_union_type *profile_list_resp_msg, - wds_profile_type_enum_v01 profile_type) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; - ds_client_req_union_type req_union; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - - req_union.p_get_profile_list_req = NULL; - req_union.p_get_profile_list_req = (wds_get_profile_list_req_msg_v01 *) - calloc(1, sizeof(wds_get_profile_list_req_msg_v01)); - if(req_union.p_get_profile_list_req == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory for" - "wds_get_profile_list_req_msg_v01\n", __func__, __LINE__); - goto err; - } - //Populate required members of the request structure - req_union.p_get_profile_list_req->profile_type_valid = 1; - req_union.p_get_profile_list_req->profile_type = profile_type; - ret = ds_client_send_qmi_sync_req(ds_client_handle, - QMI_WDS_GET_PROFILE_LIST_REQ_V01, - profile_list_resp_msg, &req_union); - if(ret != E_DS_CLIENT_SUCCESS) { - LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", - __func__, __LINE__, ret); - goto err; - } -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - if(req_union.p_get_profile_list_req) - free(req_union.p_get_profile_list_req); - return ret; -} - -/*This function obtains settings for the profile specified by - the profile_identifier*/ -static ds_client_status_enum_type ds_client_get_profile_settings( - qmi_client_type *ds_client_handle, - ds_client_resp_union_type *profile_settings_resp_msg, - wds_profile_identifier_type_v01 *profile_identifier) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; - ds_client_req_union_type req_union; - - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - //Since it's a union containing a pointer to a structure, - //following entities have the same address - //- req_union - //- req_union.p_get_profile_settings_req - //- req_union.p_get_profile_settings_req->profile - //so we can very well assign req_union = profile_identifier - req_union.p_get_profile_settings_req = - (wds_get_profile_settings_req_msg_v01 *)profile_identifier; - ret = ds_client_send_qmi_sync_req(ds_client_handle, - QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01, - profile_settings_resp_msg, &req_union); - if(ret != E_DS_CLIENT_SUCCESS) { - LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", - __func__, __LINE__, ret); - goto err; - } -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} - -/* - Starts data call using the handle and the profile index -*/ -ds_client_status_enum_type -ds_client_start_call(dsClientHandleType client_handle, int profile_index) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; - dsi_call_param_value_t param_info; - dsi_hndl_t dsi_handle; - ds_client_session_data *ds_global_data = (ds_client_session_data *)client_handle; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - if(ds_global_data == NULL) { - LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); - goto err; - } - dsi_handle = ds_global_data->dsi_net_handle; - //Set profile index as call parameter - param_info.buf_val = NULL; - param_info.num_val = profile_index; - dsi_set_data_call_param(dsi_handle, - DSI_CALL_INFO_UMTS_PROFILE_IDX, - ¶m_info); - LOC_LOGD("%s:%d]: Starting emergency call with profile index %d\n", - __func__, __LINE__, param_info.num_val); - if(dsi_start_data_call(dsi_handle) == DSI_SUCCESS) { - LOC_LOGD("%s:%d]: Sent request to start data call\n", - __func__, __LINE__); - ret = E_DS_CLIENT_SUCCESS; - } - else { - LOC_LOGE("%s:%d]: Could not send req to start data call \n", __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_GENERAL; - goto err; - } - -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; - -} - -/*Function to open an emergency call. Does the following things: - - Obtains a handle to the WDS service - - Obtains a list of profiles configured in the modem - - Queries each profile and obtains settings to check if emergency calls - are supported - - Returns the profile index that supports emergency calls - - Returns handle to dsi_netctrl*/ -ds_client_status_enum_type -ds_client_open_call(dsClientHandleType *client_handle, - ds_client_cb_data *callback, - void *caller_cookie, - int *profile_index) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; - ds_client_resp_union_type profile_list_resp_msg; - ds_client_resp_union_type profile_settings_resp_msg; - wds_profile_identifier_type_v01 profile_identifier; - uint32_t i=0; - dsi_hndl_t dsi_handle; - ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; - unsigned char call_profile_index_found = 0; - uint32_t emergency_profile_index=0; - qmi_client_type wds_qmi_client; - - profile_list_resp_msg.p_get_profile_list_resp = NULL; - profile_settings_resp_msg.p_get_profile_setting_resp = NULL; - - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - if(callback == NULL || ds_global_data == NULL) { - LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); - goto err; - } - - ret = ds_client_qmi_ctrl_point_init(&wds_qmi_client); - if(ret != E_DS_CLIENT_SUCCESS) { - LOC_LOGE("%s:%d]: ds_client_qmi_ctrl_point_init failed. ret: %d\n", - __func__, __LINE__, ret); - goto err; - } - - //Allocate memory for the response msg to obtain a list of profiles - profile_list_resp_msg.p_get_profile_list_resp = (wds_get_profile_list_resp_msg_v01 *) - calloc(1, sizeof(wds_get_profile_list_resp_msg_v01)); - if(profile_list_resp_msg.p_get_profile_list_resp == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory for" - "p_get_profile_list_resp\n", __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; - goto err; - } - - LOC_LOGD("%s:%d]: Getting profile list\n", __func__, __LINE__); - ret = ds_client_get_profile_list(&wds_qmi_client, - &profile_list_resp_msg, - WDS_PROFILE_TYPE_3GPP_V01); - if(ret != E_DS_CLIENT_SUCCESS) { - LOC_LOGE("%s:%d]: ds_client_get_profile_list failed. ret: %d\n", - __func__, __LINE__, ret); - goto err; - } - LOC_LOGD("%s:%d]: Got profile list; length = %d\n", __func__, __LINE__, - profile_list_resp_msg.p_get_profile_list_resp->profile_list_len); - - //Allocate memory for the response msg to obtain profile settings - //We allocate memory for only one response msg and keep re-using it - profile_settings_resp_msg.p_get_profile_setting_resp = - (wds_get_profile_settings_resp_msg_v01 *) - calloc(1, sizeof(wds_get_profile_settings_resp_msg_v01)); - if(profile_settings_resp_msg.p_get_profile_setting_resp == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory for" - "p_get_profile_setting_resp\n", __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; - goto err; - } - - //Loop over the list of profiles to find a profile that supports - //emergency calls - for(i=0; i < profile_list_resp_msg.p_get_profile_list_resp->profile_list_len; i++) { - /*QMI_WDS_GET_PROFILE_SETTINGS_REQ requires an input data - structure that is of type wds_profile_identifier_type_v01 - We have to fill that structure for each profile from the - info obtained from the profile list*/ - //copy profile type - profile_identifier.profile_type = - profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_type; - //copy profile index - profile_identifier.profile_index = - profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_index; - - ret = ds_client_get_profile_settings(&wds_qmi_client, - &profile_settings_resp_msg, - &profile_identifier); - if(ret != E_DS_CLIENT_SUCCESS) { - LOC_LOGE("%s:%d]: ds_client_get_profile_settings failed. ret: %d\n", - __func__, __LINE__, ret); - goto err; - } - LOC_LOGD("%s:%d]: Got profile setting for profile %d\n", __func__, __LINE__, i); - LOC_LOGD("%s:%d]: Profile name: %s\n", __func__, __LINE__, - profile_settings_resp_msg.p_get_profile_setting_resp->profile_name); - - if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls_valid) { - if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls) { - LOC_LOGD("%s:%d]: Found emergency profile in profile %d" - , __func__, __LINE__, i); - call_profile_index_found = 1; - emergency_profile_index = profile_identifier.profile_index; - break; - } - else - LOC_LOGE("%s:%d]: Emergency profile valid but not supported in profile: %d " - , __func__, __LINE__, i); - } - //Since this struct is loaded with settings for the next profile, - //it is important to clear out the memory to avoid values/flags - //from being carried over - memset((void *)profile_settings_resp_msg.p_get_profile_setting_resp, - 0, sizeof(wds_get_profile_settings_resp_msg_v01)); - } - - //Release qmi client handle - if(qmi_client_release(wds_qmi_client) != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: Could not release qmi client handle\n", - __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_GENERAL; - } - - if(call_profile_index_found) { - *profile_index = emergency_profile_index; - *ds_global_data = (ds_client_session_data *)calloc(1, sizeof(ds_client_session_data)); - if(*ds_global_data == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory for ds_global_data. Failing\n", - __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; - goto err; - } - - (*ds_global_data)->caller_data.event_cb = callback->event_cb; - (*ds_global_data)->caller_data.caller_cookie = caller_cookie; - dsi_handle = dsi_get_data_srvc_hndl(net_ev_cb, &(*ds_global_data)->caller_data); - if(dsi_handle == NULL) { - LOC_LOGE("%s:%d]: Could not get data handle. Retry Later\n", - __func__, __LINE__); - ret = E_DS_CLIENT_RETRY_LATER; - goto err; - } - else - (*ds_global_data)->dsi_net_handle = dsi_handle; - } - else { - LOC_LOGE("%s:%d]: Could not find a profile that supports emergency calls", - __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_GENERAL; - } -err: - if(profile_list_resp_msg.p_get_profile_list_resp) - free(profile_list_resp_msg.p_get_profile_list_resp); - if(profile_settings_resp_msg.p_get_profile_setting_resp) - free(profile_settings_resp_msg.p_get_profile_setting_resp); - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} - -ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle) -{ - ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; - ds_client_session_data *p_ds_global_data = (ds_client_session_data *)client_handle; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - - if(client_handle == NULL) { - LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_GENERAL; - goto err; - } - - if(dsi_stop_data_call(p_ds_global_data->dsi_net_handle) == DSI_SUCCESS) { - LOC_LOGD("%s:%d]: Sent request to stop data call\n", __func__, __LINE__); - } - else { - LOC_LOGE("%s:%d]: Could not send request to stop data call\n", - __func__, __LINE__); - ret = E_DS_CLIENT_FAILURE_GENERAL; - goto err; - } - -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} - -/* - Stops data call associated with the data handle -*/ -void ds_client_close_call(dsClientHandleType *client_handle) -{ - ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - if(client_handle == NULL || *client_handle == NULL) { - LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); - goto err; - } - dsi_rel_data_srvc_hndl((*ds_global_data)->dsi_net_handle); - (*ds_global_data)->dsi_net_handle = NULL; - free(*ds_global_data); - *ds_global_data = NULL; - LOC_LOGD("%s:%d]: Released Data handle\n", __func__, __LINE__); -err: - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return; -} - -int ds_client_init() -{ - int ret = 0; - LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); - if(DSI_SUCCESS != dsi_init(DSI_MODE_GENERAL)) - { - LOC_LOGE("%s:%d]:dsi_init failed\n", __func__, __LINE__); - ret = -1; - } - LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); - return ret; -} diff --git a/loc_api/ds_api/ds_client.h b/loc_api/ds_api/ds_client.h deleted file mode 100644 index 044f96a3..00000000 --- a/loc_api/ds_api/ds_client.h +++ /dev/null @@ -1,142 +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. - */ - -#ifndef _DS_CLIENT_H_ -#define _DS_CLIENT_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* dsClientHandleType; - -typedef enum -{ - E_DS_CLIENT_SUCCESS = 0, - /**< Request was successful. */ - - E_DS_CLIENT_FAILURE_GENERAL = 1, - /**< Failed because of a general failure. */ - - E_DS_CLIENT_FAILURE_UNSUPPORTED = 2, - /**< Failed because the service does not support the command. */ - - E_DS_CLIENT_FAILURE_INVALID_PARAMETER = 3, - /**< Failed because the request contained invalid parameters. */ - - E_DS_CLIENT_FAILURE_ENGINE_BUSY = 4, - /**< Failed because the engine is busy. */ - - E_DS_CLIENT_FAILURE_PHONE_OFFLINE = 5, - /**< Failed because the phone is offline. */ - - E_DS_CLIENT_FAILURE_TIMEOUT = 6, - /**< Failed because of a timeout. */ - - E_DS_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, - /**< Failed because the service is not present. */ - - E_DS_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, - /**< Failed because the service version is unsupported. */ - - E_DS_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, - /**< Failed because the service does not support client version. */ - - E_DS_CLIENT_FAILURE_INVALID_HANDLE = 10, - /**< Failed because an invalid handle was specified. */ - - E_DS_CLIENT_FAILURE_INTERNAL = 11, - /**< Failed because of an internal error in the service. */ - - E_DS_CLIENT_FAILURE_NOT_INITIALIZED = 12, - /**< Failed because the service has not been initialized. */ - - E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13, - /**< Failed because not rnough memory to do the operation.*/ - - E_DS_CLIENT_SERVICE_ALREADY_STARTED = 14, - /*Service is already started*/ - - E_DS_CLIENT_DATA_CALL_CONNECTED = 15, - - E_DS_CLIENT_DATA_CALL_DISCONNECTED = 16, - - E_DS_CLIENT_RETRY_LATER = 17 -}ds_client_status_enum_type; - -typedef enum { - DATA_CALL_NONE = 0, - DATA_CALL_OPEN, - DATA_CALL_CLOSE -}data_call_request_enum_type; - -typedef void (*ds_client_event_ind_cb_type)(ds_client_status_enum_type result, - void* loc_adapter_cookie); -typedef struct { - ds_client_event_ind_cb_type event_cb; -}ds_client_cb_data; - -/* - This function is to be called as a first step by each process that - needs to use data services. This call internally calls dsi_init() - and prepares the module for making data calls. - Needs to be called once for every process -*/ -int ds_client_init(); - -/* - Obtains a handle to the dsi_netctrl layer and looks up the profile - to make the call. As of now. It only searches for profiles that - support emergency calls - */ -ds_client_status_enum_type ds_client_open_call(dsClientHandleType *client_handle, - ds_client_cb_data *callback, - void *loc_adapter_cookie, - int *profile_index); - -/* - Starts a data call using the profile number provided - */ -ds_client_status_enum_type ds_client_start_call(dsClientHandleType client_handle, - int profile_index); - -/* - Stops a data call associated with the handle -*/ -ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle); - -/* - Releases the handle used for making data calls -*/ -void ds_client_close_call(dsClientHandleType *client_handle); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/loc_api/loc_api_v02/Android.mk b/loc_api/loc_api_v02/Android.mk deleted file mode 100644 index 1835dc58..00000000 --- a/loc_api/loc_api_v02/Android.mk +++ /dev/null @@ -1,52 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_api_v02 - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libqmi_cci \ - libqmi_csi \ - libqmi_common_so \ - libloc_adapter \ - libgps.utils \ - libds_api - -LOCAL_SRC_FILES += \ - LocApiV02Adapter.cpp \ - loc_api_v02_log.c \ - loc_api_v02_client.c \ - loc_api_sync_req.c \ - location_service_v02.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -ifeq ($(FEATURE_IPV6), true) -LOCAL_CFLAGS += -DFEATURE_IPV6 -endif #FEATURE_IPV6 - -ifeq ($(FEATURE_DELEXT), true) -LOCAL_CFLAGS += -DFEATURE_DELEXT -endif #FEATURE_DELEXT - -## Includes -LOCAL_C_INCLUDES := \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - $(TARGET_OUT_HEADERS)/qmi-framework/inc \ - $(TARGET_OUT_HEADERS)/qmi/inc \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/ds_api - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.cpp b/loc_api/loc_api_v02/LocApiV02Adapter.cpp deleted file mode 100644 index 21e93865..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.cpp +++ /dev/null @@ -1,2365 +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 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. - */ - -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_adapter" - -#include -#include -#include -#include -#include -#include - -#include - -#ifndef USE_GLIB -#include -#endif /* USE_GLIB */ -#include "LocApiV02Adapter.h" -#include "loc_api_v02_client.h" -#include "loc_api_v02_log.h" -#include "loc_api_sync_req.h" -#include "LocApiAdapter.h" -#include "loc_util_log.h" -#include "platform_lib_includes.h" - -/* Default session id ; TBD needs incrementing for each */ -#define LOC_API_V02_DEF_SESSION_ID (1) - -/* Default minimium interval in ms */ -#define LOC_API_V02_DEF_MIN_INTERVAL (1000) - -/* Default horizontal accuracy in meters*/ -#define LOC_API_V02_DEF_HORZ_ACCURACY (50) - -/* Default timeout in ms; TBD: needs implementing */ -#define LOC_API_V02_DEF_TIMEOUT (120000) - -/* UMTS CP Address key*/ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -/* GPS SV Id offset */ -#define GPS_SV_ID_OFFSET (1) - -/* GLONASS SV Id offset */ -#define GLONASS_SV_ID_OFFSET (65) - -/* SV ID range */ -#define SV_ID_RANGE (32) - - - -/* static event callbacks that call the LocApiV02Adapter callbacks*/ - -/* global event callback, call the eventCb function in loc api adapter v02 - instance */ -static void globalEventCb(locClientHandleType clientHandle, - uint32_t eventId, - const locClientEventIndUnionType eventPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, eventId, pClientCookie); - - // return if null is passed - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", - __func__, __LINE__, clientHandle, eventId); - return; - } - locApiV02AdapterInstance->eventCb(clientHandle, - eventId, - eventPayload); -} - -/* global response callback, it calls the sync request process - indication function to unblock the request that is waiting on this - response indication*/ -static void globalRespCb(locClientHandleType clientHandle, - uint32_t respId, - const locClientRespIndUnionType respPayload, - void* pClientCookie) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - - LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, respId, pClientCookie); - - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", - __func__, __LINE__, clientHandle, respId); - return; - } - // process the sync call - // use pDeleteAssistDataInd as a dummy pointer - loc_sync_process_ind(clientHandle, respId, - (void *)respPayload.pDeleteAssistDataInd); -} - -/* global error callback, it will call the handle service down - function in the loc api adapter instance. */ -static void globalErrorCb (locClientHandleType clientHandle, - locClientErrorEnumType errorId, - void *pClientCookie) -{ - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)pClientCookie; - - LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", - __func__, __LINE__, clientHandle, errorId, pClientCookie); - if( NULL == locApiV02AdapterInstance) - { - LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", - __func__, __LINE__, clientHandle, errorId); - return; - } - locApiV02AdapterInstance->errorCb(clientHandle, - errorId); -} - -/* global structure containing the callbacks */ -locClientCallbacksType globalCallbacks = -{ - sizeof(locClientCallbacksType), - globalEventCb, - globalRespCb, - globalErrorCb -}; - -/* Constructor for LocApiV02Adapter */ -LocApiV02Adapter :: LocApiV02Adapter(LocEng &locEng): - dsClientHandle(NULL), - LocApiAdapter(locEng), clientHandle( LOC_CLIENT_INVALID_HANDLE_VALUE), - eventMask(convertMask(locEng.eventMask)) -{ - // initialize loc_sync_req interface - loc_sync_req_init(); -} - -/* Destructor for LocApiV02Adapter */ -LocApiV02Adapter :: ~LocApiV02Adapter() -{ - deInitLocClient(); -} - -/* close Loc API V02 client */ -int LocApiV02Adapter :: deInitLocClient() -{ - return ( eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? 0 : -1 ; -} - -/* Initialize a loc api v02 client */ -enum loc_api_adapter_err LocApiV02Adapter :: reinit() -{ - locClientStatusEnumType status; - /* If the client is already open close it first */ - if(LOC_CLIENT_INVALID_HANDLE_VALUE != clientHandle) - { - status = locClientClose(&clientHandle); - if( eLOC_CLIENT_SUCCESS != status) - { - LOC_LOGE ("%s:%d]: locClientClose failed, status = %d\n", __func__, - __LINE__, status); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - } - - LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", __func__, - __LINE__, this); - /* initialize the loc api v02 interface, note that - the locClientOpen() function will block if the - service is unavailable for a fixed time out */ - - status = locClientOpen( - eventMask, &globalCallbacks, &clientHandle, (void *)this); - - if (eLOC_CLIENT_SUCCESS != status || - clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) - { - LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, - __LINE__, loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_FAILURE); - } - - // return SUCCESS - return (LOC_API_ADAPTER_ERR_SUCCESS); -} - -/* start positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: startFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStartReqMsgT_v02 start_msg; - - qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; - qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; - - // clear all fields, validity masks - memset (&start_msg, 0, sizeof(start_msg)); - memset (&set_mode_msg, 0, sizeof(set_mode_msg)); - memset (&set_mode_ind, 0, sizeof(set_mode_ind)); - - LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); - fixCriteria.logv(); - - // fill in the start request - switch(fixCriteria.mode) - { - case LOC_POSITION_MODE_MS_BASED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; - break; - - case LOC_POSITION_MODE_MS_ASSISTED: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; - break; - - case LOC_POSITION_MODE_RESERVED_4: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; - break; - - case LOC_POSITION_MODE_RESERVED_5: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_WWAN_V02; - break; - - default: - set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; - break; - } - - req_union.pSetOperationModeReq = &set_mode_msg; - - // send the mode first, before the start message. - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_OPERATION_MODE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_OPERATION_MODE_IND_V02, - &set_mode_ind); // NULL? - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) - { - LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " - "ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_mode_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; // error - } - - start_msg.minInterval_valid = 1; - start_msg.minInterval = fixCriteria.min_interval; - - if (fixCriteria.preferred_accuracy >= 0) { - start_msg.horizontalAccuracyLevel_valid = 1; - - if (fixCriteria.preferred_accuracy <= 100) - { - // fix needs high accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; - } - else if (fixCriteria.preferred_accuracy <= 1000) - { - //fix needs med accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; - } - else - { - //fix needs low accuracy - start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; - } - } - - start_msg.fixRecurrence_valid = 1; - if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; - } - else - { - start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; - } - - //dummy session id - // TBD: store session ID, check for session id in pos reports. - start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - if (fixCriteria.credentials[0] != 0) { - int size1 = sizeof(start_msg.applicationId.applicationName); - int size2 = sizeof(fixCriteria.credentials); - int len = ((size1 < size2) ? size1 : size2) - 1; - memcpy(start_msg.applicationId.applicationName, - fixCriteria.credentials, - len); - - size1 = sizeof(start_msg.applicationId.applicationProvider); - size2 = sizeof(fixCriteria.provider); - len = ((size1 < size2) ? size1 : size2) - 1; - memcpy(start_msg.applicationId.applicationProvider, - fixCriteria.provider, - len); - - start_msg.applicationId_valid = 1; - } - - req_union.pStartReq = &start_msg; - - status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, - req_union ); - - if( eLOC_CLIENT_SUCCESS == status) - { - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; -} - -/* stop a positioning session */ -enum loc_api_adapter_err LocApiV02Adapter :: stopFix() -{ - locClientStatusEnumType status; - locClientReqUnionType req_union; - - qmiLocStopReqMsgT_v02 stop_msg; - - LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); - - memset(&stop_msg, 0, sizeof(stop_msg)); - - // dummy session id - stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; - - req_union.pStopReq = &stop_msg; - - status = locClientSendReq(clientHandle, - QMI_LOC_STOP_REQ_V02, - req_union); - - if( eLOC_CLIENT_SUCCESS == status) - { - return LOC_API_ADAPTER_ERR_SUCCESS; - } - - LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, - loc_get_v02_client_status_name(status)); - return (LOC_API_ADAPTER_ERR_GENERAL_FAILURE); -} - -/* set the positioning fix criteria */ -enum loc_api_adapter_err LocApiV02Adapter :: setPositionMode( - const LocPosMode *posMode) -{ - LOC_LOGV ("%s:%d]: posMode %p",__func__, __LINE__, posMode); - - if (NULL != posMode && - !fixCriteria.equals(*posMode)) { - //making a copy of the fix criteria - fixCriteria = *posMode; - - LOC_LOGD ("%s:%d]: new fix criteria", __func__, __LINE__); - - if(true == navigating) - { - //fix is in progress, send a restart - LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " - "criteria\n", __func__, __LINE__); - - return( startFix()); - } - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject time into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; - qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; - - memset(&inject_time_msg, 0, sizeof(inject_time_msg)); - - inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; - - inject_time_msg.timeUtc = time; - - inject_time_msg.timeUtc += (int64_t)(ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION - timeReference); - - inject_time_msg.timeUnc = uncertainty; - - req_union.pInjectUtcTimeReq = &inject_time_msg; - - LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, - uncertainty); - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_UTC_TIME_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_UTC_TIME_IND_V02, - &inject_time_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) - { - LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_time_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* inject position into the position engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - injectPosition(double latitude, double longitude, float accuracy) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; - qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; - - memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); - - inject_pos_msg.latitude_valid = 1; - inject_pos_msg.latitude = latitude; - - inject_pos_msg.longitude_valid = 1; - inject_pos_msg.longitude = longitude; - - inject_pos_msg.horUncCircular_valid = 1; - - inject_pos_msg.horUncCircular = accuracy; //meters assumed - - inject_pos_msg.horConfidence_valid = 1; - - inject_pos_msg.horConfidence = 63; // 63% (1 std dev assumed) - - /* Log */ - LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf\n", __func__, __LINE__, - inject_pos_msg.latitude, inject_pos_msg.longitude, - inject_pos_msg.horUncCircular); - - req_union.pInjectPositionReq = &inject_pos_msg; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_INJECT_POSITION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_POSITION_IND_V02, - &inject_pos_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_pos_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* delete assistance date */ -enum loc_api_adapter_err LocApiV02Adapter :: deleteAidingData(GpsAidingData f) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocDeleteAssistDataReqMsgT_v02 delete_req; - qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; - - memset(&delete_req, 0, sizeof(delete_req)); - memset(&delete_resp, 0, sizeof(delete_resp)); - - if( f == GPS_DELETE_ALL ) - { - delete_req.deleteAllFlag = true; - } - - else - { - /* to keep track of svInfoList for GPS and GLO*/ - uint32_t curr_sv_len = 0; - uint32_t curr_sv_idx = 0; - uint32_t sv_id = 0; - - if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) - { - /* do delete for all GPS SV's */ - - curr_sv_len += SV_ID_RANGE; - - sv_id = GPS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GPS SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GPS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - // increment the current index - curr_sv_idx += SV_ID_RANGE; - - } - -#ifdef FEATURE_DELEXT - if( f & GPS_DELETE_TIME_GPS ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; - } -#endif - - if(f & GPS_DELETE_POSITION ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; - } - - if(f & GPS_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; - } - - if(f & GPS_DELETE_IONO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; - } - - if(f & GPS_DELETE_UTC ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; - } - - if(f & GPS_DELETE_HEALTH ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; - } - - if(f & GPS_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; - } - if(f & GPS_DELETE_SADATA ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; - } - if(f & GPS_DELETE_RTI ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; - } - if(f & GPS_DELETE_CELLDB_INFO ) - { - delete_req.deleteCellDbDataMask_valid = 1; - delete_req.deleteCellDbDataMask = - ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | - QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | - QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | - QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; - - } -#ifdef FEATURE_DELEXT - if(f & GPS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; - } - if(f & GPS_DELETE_FREQ_BIAS_EST ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; - } - if ( (f & GPS_DELETE_EPHEMERIS_GLO ) || (f & GPS_DELETE_ALMANAC_GLO )) - { - /* do delete for all GLONASS SV's (65 - 96) - */ - curr_sv_len += SV_ID_RANGE; - - sv_id = GLONASS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE); - - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; - - if(f & GPS_DELETE_EPHEMERIS ) - { - // set ephemeris mask for all GPS SV's - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - } - - if( f & GPS_DELETE_ALMANAC ) - { - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - } - curr_sv_idx += SV_ID_RANGE; - } - - if(f & GPS_DELETE_SVDIR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; - } - - if(f & GPS_DELETE_SVSTEER_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; - } - - if(f & GPS_DELETE_ALMANAC_CORR_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; - } - - if(f & GPS_DELETE_TIME_GLO ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; - } -#endif - } - - req_union.pDeleteAssistDataReq = &delete_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - &delete_resp); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != delete_resp.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(delete_resp.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* send NI user repsonse to the engine */ -enum loc_api_adapter_err LocApiV02Adapter :: - informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - - qmiLocNiUserRespReqMsgT_v02 ni_resp; - qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; - - memset(&ni_resp,0, sizeof(ni_resp)); - - memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); - - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; - break; - case GPS_NI_RESPONSE_DENY: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; - break; - case GPS_NI_RESPONSE_NORESP: - ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; - break; - default: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, - ni_resp.userResp); - - ni_resp.notificationType = request_pass_back->notificationType; - - // copy SUPL payload from request - if(request_pass_back->NiSuplInd_valid == 1) - { - ni_resp.NiSuplPayload_valid = 1; - memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), - sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); - - } - // should this be an "else if"?? we don't need to decide - - // copy UMTS-CP payload from request - if( request_pass_back->NiUmtsCpInd_valid == 1 ) - { - ni_resp.NiUmtsCpPayload_valid = 1; - memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), - sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); - } - - //copy Vx payload from the request - if( request_pass_back->NiVxInd_valid == 1) - { - ni_resp.NiVxPayload_valid = 1; - memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), - sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); - } - - // copy Vx service interaction payload from the request - if(request_pass_back->NiVxServiceInteractionInd_valid == 1) - { - ni_resp.NiVxServiceInteractionPayload_valid = 1; - memcpy(&(ni_resp.NiVxServiceInteractionPayload), - &(request_pass_back->NiVxServiceInteractionInd), - sizeof(qmiLocNiVxServiceInteractionStructT_v02)); - } - - // copy Network Initiated SUPL Version 2 Extension - if (request_pass_back->NiSuplVer2ExtInd_valid == 1) - { - ni_resp.NiSuplVer2ExtPayload_valid = 1; - memcpy(&(ni_resp.NiSuplVer2ExtPayload), - &(request_pass_back->NiSuplVer2ExtInd), - sizeof(qmiLocNiSuplVer2ExtStructT_v02)); - } - - // copy SUPL Emergency Notification - if(request_pass_back->suplEmergencyNotification_valid) - { - ni_resp.suplEmergencyNotification_valid = 1; - memcpy(&(ni_resp.suplEmergencyNotification), - &(request_pass_back->suplEmergencyNotification), - sizeof(qmiLocEmergencyNotificationStructT_v02)); - } - - req_union.pNiUserRespReq = &ni_resp; - - status = loc_sync_send_req ( - clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) - { - LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", - __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(ni_resp_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Set UMTs SLP server URL */ -enum loc_api_adapter_err LocApiV02Adapter :: setServer( - const char* url, int len) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - - if(len <=0 || len > sizeof(set_server_req.urlAddr)) - { - LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", - __func__, __LINE__, len); - - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); - - set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; - - set_server_req.urlAddr_valid = 1; - - strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err LocApiV02Adapter :: - setServer(unsigned int ip, int port, LocServerType type) -{ - locClientReqUnionType req_union; - locClientStatusEnumType status; - qmiLocSetServerReqMsgT_v02 set_server_req; - qmiLocSetServerIndMsgT_v02 set_server_ind; - qmiLocServerTypeEnumT_v02 set_server_cmd; - - switch (type) { - case LOC_AGPS_MPC_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; - break; - case LOC_AGPS_CUSTOM_PDE_SERVER: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; - break; - default: - set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; - break; - } - - memset(&set_server_req, 0, sizeof(set_server_req)); - - LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); - - set_server_req.serverType = set_server_cmd; - set_server_req.ipv4Addr_valid = 1; - set_server_req.ipv4Addr.addr = ip; - set_server_req.ipv4Addr.port = port; - - req_union.pSetServerReq = &set_server_req; - - status = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SERVER_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SERVER_IND_V02, - &set_server_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_server_ind.status) - { - LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", - __func__,__LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(set_server_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Inject XTRA data, this module breaks down the XTRA - file into "chunks" and injects them one at a time */ -enum loc_api_adapter_err LocApiV02Adapter :: setXtraData( - char* data, int length) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - int total_parts; - uint8_t part; - uint16_t len_injected; - - locClientReqUnionType req_union; - qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; - qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; - - req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; - - LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); - - inject_xtra.formatType_valid = 1; - inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; - inject_xtra.totalSize = length; - - total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; - - inject_xtra.totalParts = total_parts; - - len_injected = 0; // O bytes injected - - // XTRA injection starts with part 1 - for (part = 1; part <= total_parts; part++) - { - inject_xtra.partNum = part; - - if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) - { - inject_xtra.partData_len = length - len_injected; - } - else - { - inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; - } - - // copy data into the message - memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); - - LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", - __func__, __LINE__, - inject_xtra.partNum, total_parts, inject_xtra.partData_len, - len_injected); - - status = loc_sync_send_req( clientHandle, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - &inject_xtra_ind); - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || - inject_xtra.partNum != inject_xtra_ind.partNum) - { - LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," - " part num = %d, ind.partNum = %d\n", __func__, __LINE__, - loc_get_v02_client_status_name(status), - loc_get_v02_qmi_status_name(inject_xtra_ind.status), - inject_xtra.partNum, inject_xtra_ind.partNum); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - break; - } - - len_injected += inject_xtra.partData_len; - LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, - len_injected); - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -#ifdef FEATURE_IPV6 -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType) -#else -enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus( - int handle, int is_succ, char* apn, - AGpsType agpsType) -#endif -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - -#ifdef FEATURE_IPV6 - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s], bearer = %d \n", __func__, __LINE__, - handle, is_succ, apn, bear); -#else - LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " - "APN = [%s] \n", __func__, __LINE__, - handle, is_succ, apn); -#endif - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - - if(apn != NULL) - strlcpy(conn_status_req.apnProfile.apnName, apn, - sizeof(conn_status_req.apnProfile.apnName) ); - -#ifdef FEATURE_IPV6 - switch(bear) - { - case AGPS_APN_BEARER_IPV4: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; - conn_status_req.apnProfile_valid = 1; - break; - - case AGPS_APN_BEARER_IPV6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; - conn_status_req.apnProfile_valid = 1; - break; - - case AGPS_APN_BEARER_IPV4V6: - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; - conn_status_req.apnProfile_valid = 1; - break; - - case AGPS_APN_BEARER_INVALID: - conn_status_req.apnProfile_valid = 0; - break; - - default: - LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } -#else - conn_status_req.apnProfile.pdnType = - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; -#endif - - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; - -} - - -/* close atl connection */ -enum loc_api_adapter_err LocApiV02Adapter :: atlCloseStatus( - int handle, int is_succ) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; - qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; - - LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", - __func__, __LINE__, handle, is_succ); - - memset(&conn_status_req, 0, sizeof(conn_status_req)); - memset(&conn_status_ind, 0, sizeof(conn_status_ind)); - - // Fill in data - conn_status_req.connHandle = handle; - - conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; - - if(is_succ) - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; - } - else - { - conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; - } - - req_union.pInformLocationServerConnStatusReq = &conn_status_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - &conn_status_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(conn_status_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the SUPL version */ -enum loc_api_adapter_err LocApiV02Adapter :: setSUPLVersion(uint32_t version) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; - - LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); - - - memset(&supl_config_req, 0, sizeof(supl_config_req)); - memset(&supl_config_ind, 0, sizeof(supl_config_ind)); - - supl_config_req.suplVersion_valid = 1; - // SUPL version from MSByte to LSByte: - // (reserved)(major version)(minor version)(serviceIndicator) - - supl_config_req.suplVersion = (version == 0x00020000)? - eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; - - req_union.pSetProtocolConfigParametersReq = &supl_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &supl_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(supl_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the configuration for LTE positioning profile (LPP) */ -enum loc_api_adapter_err LocApiV02Adapter :: setLPPConfig(uint32_t profile) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocSetProtocolConfigParametersReqMsgT_v02 lpp_config_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 lpp_config_ind; - - LOC_LOGD("%s:%d]: lpp profile = %d\n", __func__, __LINE__, profile); - - memset(&lpp_config_req, 0, sizeof(lpp_config_req)); - memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); - - lpp_config_req.lppConfig_valid = 1; - - lpp_config_req.lppConfig = profile; - - req_union.pSetProtocolConfigParametersReq = &lpp_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &lpp_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != lpp_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(lpp_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Configuration */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorControlConfig(int sensorsDisabled) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; - qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; - - LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); - - memset(&sensor_config_req, 0, sizeof(sensor_config_req)); - memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); - - sensor_config_req.sensorsUsage_valid = 1; - sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 - : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; - - req_union.pSetSensorControlConfigReq = &sensor_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - &sensor_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Properties */ -enum loc_api_adapter_err LocApiV02Adapter :: 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) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; - qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; - - LOC_LOGI("%s:%d]: sensors prop: gyroBiasRandomWalk = %f, accelRandomWalk = %f, " - "angleRandomWalk = %f, rateRandomWalk = %f, velocityRandomWalk = %f\n", - __func__, __LINE__, gyroBiasVarianceRandomWalk, accelBiasVarianceRandomWalk, - angleBiasVarianceRandomWalk, rateBiasVarianceRandomWalk, velocityBiasVarianceRandomWalk); - - memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); - memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); - - /* Set the validity bit and value for each sensor property */ - sensor_prop_req.gyroBiasVarianceRandomWalk_valid = gyroBiasVarianceRandomWalk_valid; - sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; - - sensor_prop_req.accelerationRandomWalkSpectralDensity_valid = accelBiasVarianceRandomWalk_valid; - sensor_prop_req.accelerationRandomWalkSpectralDensity = accelBiasVarianceRandomWalk; - - sensor_prop_req.angleRandomWalkSpectralDensity_valid = angleBiasVarianceRandomWalk_valid; - sensor_prop_req.angleRandomWalkSpectralDensity = angleBiasVarianceRandomWalk; - - sensor_prop_req.rateRandomWalkSpectralDensity_valid = rateBiasVarianceRandomWalk_valid; - sensor_prop_req.rateRandomWalkSpectralDensity = rateBiasVarianceRandomWalk; - - sensor_prop_req.velocityRandomWalkSpectralDensity_valid = velocityBiasVarianceRandomWalk_valid; - sensor_prop_req.velocityRandomWalkSpectralDensity = velocityBiasVarianceRandomWalk; - - req_union.pSetSensorPropertiesReq = &sensor_prop_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - &sensor_prop_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_prop_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Sensor Performance Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, - int algorithmConfig) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; - qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; - - LOC_LOGD("%s:%d]: 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", - __FUNCTION__, - __LINE__, - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec, - accelSamplesPerBatchHigh, - accelBatchesPerSecHigh, - gyroSamplesPerBatchHigh, - gyroBatchesPerSecHigh, - algorithmConfig - ); - - memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); - memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); - - sensor_perf_config_req.performanceControlMode_valid = 1; - sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; - sensor_perf_config_req.accelSamplingSpec_valid = 1; - sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; - sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; - sensor_perf_config_req.gyroSamplingSpec_valid = 1; - sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; - sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; - sensor_perf_config_req.accelSamplingSpecHigh_valid = 1; - sensor_perf_config_req.accelSamplingSpecHigh.batchesPerSecond = accelBatchesPerSecHigh; - sensor_perf_config_req.accelSamplingSpecHigh.samplesPerBatch = accelSamplesPerBatchHigh; - sensor_perf_config_req.gyroSamplingSpecHigh_valid = 1; - sensor_perf_config_req.gyroSamplingSpecHigh.batchesPerSecond = gyroBatchesPerSecHigh; - sensor_perf_config_req.gyroSamplingSpecHigh.samplesPerBatch = gyroSamplesPerBatchHigh; - sensor_perf_config_req.algorithmConfig_valid = 1; - sensor_perf_config_req.algorithmConfig = algorithmConfig; - - req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - &sensor_perf_config_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the External Power Config */ -enum loc_api_adapter_err LocApiV02Adapter :: setExtPowerConfig(int isBatteryCharging) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - - qmiLocSetExternalPowerConfigReqMsgT_v02 ext_pwr_req; - qmiLocGetExternalPowerConfigIndMsgT_v02 ext_pwr_ind; - - LOC_LOGI("%s:%d]: Ext Pwr Config (isBatteryCharging)(%u)", - __FUNCTION__, - __LINE__, - isBatteryCharging - ); - - memset(&ext_pwr_req, 0, sizeof(ext_pwr_req)); - memset(&ext_pwr_ind, 0, sizeof(ext_pwr_ind)); - - switch(isBatteryCharging) - { - /* Charging */ - case 1: - ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02; - break; - - /* Not charging */ - case 0: - ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02; - break; - - default: - LOC_LOGE("%s:%d]: Invalid ext power state = %d!", - __FUNCTION__, - __LINE__, - isBatteryCharging); - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - break; - } - - req_union.pSetExternalPowerConfigReq = &ext_pwr_req; - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - &ext_pwr_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != ext_pwr_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %d, ind..status = %d ", - __func__, __LINE__, result, ext_pwr_ind.status); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* set the Positioning Protocol on A-GLONASS system */ -enum loc_api_adapter_err LocApiV02Adapter :: setAGLONASSProtocol(unsigned long aGlonassProtocol) -{ - locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; - locClientReqUnionType req_union; - qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req; - qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind; - - memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req)); - memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind)); - - aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1; - aGlonassProtocol_req.assistedGlonassProtocolMask = aGlonassProtocol; - - req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req; - - LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%lx\n", __func__, __LINE__, - aGlonassProtocol_req.assistedGlonassProtocolMask); - - result = loc_sync_send_req(clientHandle, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, - req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - &aGlonassProtocol_ind); - - if(result != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status) - { - LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", - __func__, __LINE__, - loc_get_v02_client_status_name(result), - loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status)); - - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -/* Convert event mask from loc eng to loc_api_v02 format */ -locClientEventMaskType LocApiV02Adapter :: convertMask( - LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - locClientEventMaskType eventMask = 0; - LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); - - if(mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; - - if(mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) - eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; - - /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ - if( (mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || - (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) - eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; - - if(mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; - - if(mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) - { - // TBD: This needs to be decoupled in the HAL - eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; - eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; - } - - if(mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) - { - eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); - } - - if(mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) - eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; - - return eventMask; -} - -/* Convert error from loc_api_v02 to loc eng format*/ -enum loc_api_adapter_err LocApiV02Adapter :: convertErr( - locClientStatusEnumType status) -{ - switch( status) - { - case LOC_API_ADAPTER_ERR_SUCCESS: - return LOC_API_ADAPTER_ERR_SUCCESS; - - case eLOC_CLIENT_FAILURE_GENERAL: - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - - case eLOC_CLIENT_FAILURE_UNSUPPORTED: - return LOC_API_ADAPTER_ERR_UNSUPPORTED; - - case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - - case eLOC_CLIENT_FAILURE_ENGINE_BUSY: - return LOC_API_ADAPTER_ERR_ENGINE_BUSY; - - case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: - return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; - - case eLOC_CLIENT_FAILURE_TIMEOUT: - return LOC_API_ADAPTER_ERR_TIMEOUT; - - case eLOC_CLIENT_FAILURE_INVALID_HANDLE: - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - - case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: - return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; - - default: - return LOC_API_ADAPTER_ERR_FAILURE; - } -} - -/* convert position report to loc eng format and send the converted - position to loc eng */ - -void LocApiV02Adapter :: reportPosition ( - const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) -{ - UlpLocation location; - LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; - LOC_LOGD("Reporting postion from V2 Adapter\n"); - memset(&location, 0, sizeof (UlpLocation)); - location.size = sizeof(location); - GpsLocationExtended locationExtended; - memset(&locationExtended, 0, sizeof (GpsLocationExtended)); - locationExtended.size = sizeof(locationExtended); - // Process the position from final and intermediate reports - - if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || - (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) - ) - { - // Latitude & Longitude - if( (location_report_ptr->latitude_valid == 1 ) && - (location_report_ptr->longitude_valid == 1) && - (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->timestampUtc_valid == 1) - { - location.gpsLocation.timestamp = location_report_ptr->timestampUtc; - } - - // Altitude - if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.gpsLocation.altitude = location_report_ptr->altitudeWrtEllipsoid; - } - - // Speed - if((location_report_ptr->speedHorizontal_valid == 1) && - (location_report_ptr->speedVertical_valid ==1 ) ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt( - (location_report_ptr->speedHorizontal * - location_report_ptr->speedHorizontal) + - (location_report_ptr->speedVertical * - location_report_ptr->speedVertical) ); - } - - // Heading - if(location_report_ptr->heading_valid == 1) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; - location.gpsLocation.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if( (location_report_ptr->horUncCircular_valid ) ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; - location.gpsLocation.accuracy = location_report_ptr->horUncCircular; - } - - // Technology Mask - tech_Mask |= location_report_ptr->technologyMask; - - //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->magneticDeviation_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; - locationExtended.magneticDeviation = location_report_ptr->magneticDeviation; - } - - if (location_report_ptr->DOP_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; - locationExtended.pdop = location_report_ptr->DOP.PDOP; - locationExtended.hdop = location_report_ptr->DOP.HDOP; - locationExtended.vdop = location_report_ptr->DOP.VDOP; - } - - if (location_report_ptr->altitudeWrtMeanSeaLevel_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; - locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; - } - - if (location_report_ptr->vertUnc_valid) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; - locationExtended.vert_unc = location_report_ptr->vertUnc; - } - - if (location_report_ptr->speedUnc_valid ) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; - locationExtended.speed_unc = location_report_ptr->speedUnc; - } - - LocApiAdapter::reportPosition( location, - locationExtended, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->sessionStatus - == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), - tech_Mask); - } - } - else - { - LocApiAdapter::reportPosition(location, - locationExtended, - NULL, - LOC_SESS_FAILURE); - - LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " - "fix id = %u\n", __func__, __LINE__, - location_report_ptr->sessionStatus, - location_report_ptr->fixId ); - } -} - -/* convert satellite report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportSv ( - const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - GpsLocationExtended locationExtended; - int num_svs_max, i; - const qmiLocSvInfoStructT_v02 *sv_info_ptr; - - LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, - gnss_report_ptr->svList_len); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - memset(&locationExtended, 0, sizeof (GpsLocationExtended)); - locationExtended.size = sizeof(locationExtended); - if(gnss_report_ptr->svList_valid == 1) - { - num_svs_max = gnss_report_ptr->svList_len; - if(num_svs_max > GPS_MAX_SVS) - { - num_svs_max = GPS_MAX_SVS; - } - SvStatus.num_svs = 0; - for(i = 0; i < num_svs_max; i++) - { - sv_info_ptr = &(gnss_report_ptr->svList[i]); - if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && - (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) - && (sv_info_ptr->gnssSvId != 0 )) - { - if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); - SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; - - // We only have the data field to report gps eph and alm mask - if(sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) - { - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) - { - SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - if(sv_info_ptr->svInfoMask & - QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) - { - SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); - } - } - - if((sv_info_ptr->validMask & - QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) - && - (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) - { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-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 == eQMI_LOC_SV_SYSTEM_SBAS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + 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 == eQMI_LOC_SV_SYSTEM_GLONASS_V02) - { - SvStatus.sv_list[SvStatus.num_svs].prn = - sv_info_ptr->gnssSvId + (65-1); - } - // Unsupported SV system - else - { - continue; - } - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) - { - SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) - { - SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; - } - - if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) - { - SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; - } - - SvStatus.num_svs++; - } - } - - if (SvStatus.num_svs >= 0) - { - LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); - LocApiAdapter::reportSv(SvStatus, - locationExtended, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); - } -} - -/* convert engine state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) -{ - - LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, - engine_state_ptr->engineState); - - if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); - } - else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) - { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); - } - -} - -/* convert fix session state report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) -{ - GpsStatusValue status; - LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, - fix_session_state_ptr->sessionState); - - status = GPS_STATUS_NONE; - if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) - { - status = GPS_STATUS_SESSION_BEGIN; - } - else if (fix_session_state_ptr->sessionState - == eQMI_LOC_FIX_SESSION_FINISHED_V02) - { - status = GPS_STATUS_SESSION_END; - } - LocApiAdapter::reportStatus(status); -} - -/* convert NMEA report to loc eng format and send the converted - report to loc eng */ -void LocApiV02Adapter :: reportNmea ( - const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) -{ - - LocApiAdapter::reportNmea(nmea_report_ptr->nmea, - strlen(nmea_report_ptr->nmea)); - - LOC_LOGD("%s:%d]: $%c%c%c\n", __func__, __LINE__, - nmea_report_ptr->nmea[3], nmea_report_ptr->nmea[4], - nmea_report_ptr->nmea[5]); -} - -/* convert and report an ATL request to loc engine */ -void LocApiV02Adapter :: reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) -{ - uint32_t connHandle = server_request_ptr->connHandle; - // service ATL open request; copy the WWAN type - if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) - { - AGpsType agpsType; -#ifdef FEATURE_IPV6 - switch(server_request_ptr->wwanType) - { - case eQMI_LOC_WWAN_TYPE_INTERNET_V02: - agpsType = AGPS_TYPE_WWAN_ANY; - LocApiAdapter::requestATL(connHandle, agpsType); - break; - case eQMI_LOC_WWAN_TYPE_AGNSS_V02: - agpsType = AGPS_TYPE_SUPL; - LocApiAdapter::requestATL(connHandle, agpsType); - break; - case eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02: - LocApiAdapter::requestSuplES(connHandle); - break; - default: - agpsType = AGPS_TYPE_WWAN_ANY; - LocApiAdapter::requestATL(connHandle, agpsType); - break; - } -#else - agpsType = AGPS_TYPE_SUPL; - LocApiAdapter::requestATL(connHandle, agpsType); -#endif - } - // service the ATL close request - else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) - { - LocApiAdapter::releaseATL(connHandle); - } -} - -/* conver the NI report to loc eng format and send t loc engine */ -void LocApiV02Adapter :: reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) -{ - GpsNiNotification notif; - - /* initialize the notification*/ - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - /* NI timeout gets overwritten in LocApiAdapter, - initializing to 0 here */ - notif.timeout = 0; - - notif.text_encoding = GPS_ENC_NONE ; - - notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - - notif.notify_flags = 0; - - notif.default_response = GPS_NI_RESPONSE_NORESP; - - /*Handle Vx request */ - if(ni_req_ptr->NiVxInd_valid == 1) - { - const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); - - notif.ni_type = GPS_NI_TYPE_VOICE; - - // Requestor ID, the requestor id recieved is NULL terminated - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char *)vx_req->requestorId, vx_req->requestorId_len ); - } - - /* Handle UMTS CP request*/ - else if(ni_req_ptr->NiUmtsCpInd_valid == 1) - { - const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = - &ni_req_ptr->NiUmtsCpInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - - /* notificationText should always be a NULL terminated string */ - hexcode(notif.text, sizeof notif.text, - (char *)umts_cp_req->notificationText, - umts_cp_req->notificationText_len); - - /* Store requestor ID */ - hexcode(notif.requestor_id, sizeof(notif.requestor_id), - (char *)umts_cp_req->requestorId.codedString, - umts_cp_req->requestorId.codedString_len); - - /* convert encodings */ - notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); - - notif.requestor_id_encoding = - convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); - - /* LCS address (using extras field) */ - if ( umts_cp_req->clientAddress_len != 0) - { - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - - // 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; - address_source = (char *)umts_cp_req->clientAddress; - // client Address is always NULL terminated - addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, - umts_cp_req->clientAddress_len); - - // The address is ASCII string - if (addr_len) - { - strlcat(notif.extras, lcs_addr, sizeof notif.extras); - } - } - - } - else if(ni_req_ptr->NiSuplInd_valid == 1) - { - const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = - &ni_req_ptr->NiSuplInd; - - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - - // Client name - if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) - { - hexcode(notif.text, sizeof(notif.text), - (char *)supl_req->clientName.formattedString, - supl_req->clientName.formattedString_len); - LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, - notif.text); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", - __func__, __LINE__); - } - - // Requestor ID - if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, - (char*)supl_req->requestorId.formattedString, - supl_req->requestorId.formattedString_len ); - - LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, - notif.requestor_id); - } - else - { - LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", - __func__, __LINE__); - } - - // Encoding type - if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) - { - notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); - - notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); - } - else - { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - } //ni_req_ptr->NiSuplInd_valid == 1 - - else - { - LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); - return; - } - - // Set default_response & notify_flags - convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); - - qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = - (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); - - if( NULL != ni_req_copy_ptr) - { - memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); - - LocApiAdapter::requestNiNotify(notif, (const void*)ni_req_copy_ptr); - } - else - { - LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); - } - -} - -/* convert Ni Encoding type from QMI_LOC to loc eng format */ -GpsNiEncodingType LocApiV02Adapter ::convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case eQMI_LOC_NI_SUPL_UTF8_V02: - enc = GPS_ENC_SUPL_UTF8; - break; - case eQMI_LOC_NI_SUPL_UCS2_V02: - enc = GPS_ENC_SUPL_UCS2; - break; - case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: - enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - break; - default: - break; - } - - return enc; -} - -/*convert NI notify verify type from QMI LOC to loc eng format*/ -bool LocApiV02Adapter :: convertNiNotifyVerifyType ( - GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv) -{ - switch (notif_priv) - { - case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: - notif->notify_flags = 0; - break; - - case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_ACCEPT; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: - notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif->default_response = GPS_NI_RESPONSE_DENY; - break; - - case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return false; - } - - return true; -} - -/* event callback registered with the loc_api v02 interface */ -void LocApiV02Adapter :: eventCb(locClientHandleType clientHandle, - uint32_t eventId, locClientEventIndUnionType eventPayload) -{ - LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, - eventId); - - switch(eventId) - { - //Position Report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - reportPosition(eventPayload.pPositionReportEvent); - break; - - // Satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - reportSv(eventPayload.pGnssSvInfoReportEvent); - break; - - // Status report - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - reportEngineState(eventPayload.pEngineState); - break; - - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - reportFixSessionState(eventPayload.pFixSessionState); - break; - - // NMEA - case QMI_LOC_EVENT_NMEA_IND_V02: - reportNmea(eventPayload.pNmeaReportEvent); - break; - - // XTRA request - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - LOC_LOGD("%s:%d]: XTRA download request\n", __func__, - __LINE__); - requestXtraData(); - break; - - // time request - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - LOC_LOGD("%s:%d]: Time request\n", __func__, - __LINE__); - requestTime(); - break; - - //position request - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - LOC_LOGD("%s:%d]: Position request\n", __func__, - __LINE__); - //requestPosition(); - break; - - // NI request - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); - break; - - // AGPS connection request - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - reportAtlRequest(eventPayload.pLocationServerConnReqEvent); - break; - } -} - -/* Call the service LocApiAdapter down event*/ -void LocApiV02Adapter :: errorCb(locClientHandleType handle, - locClientErrorEnumType errorId) -{ - if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) - { - LOC_LOGE("%s:%d]: Service unavailable error\n", - __func__, __LINE__); - - LocApiAdapter::handleEngineDownEvent(); - - /* immediately send the engine up event so that - the loc engine re-initializes the adapter and the - loc-api_v02 interface */ - - LocApiAdapter::handleEngineUpEvent(); - } -} - -/* return a Loc API adapter */ -LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return(new LocApiV02Adapter(locEng)); -} - -static void ds_client_global_event_cb(ds_client_status_enum_type result, - void *loc_adapter_cookie) -{ - LocApiV02Adapter *locApiV02AdapterInstance = - (LocApiV02Adapter *)loc_adapter_cookie; - locApiV02AdapterInstance->ds_client_event_cb(result); - return; -} - -void LocApiV02Adapter::ds_client_event_cb(ds_client_status_enum_type result) -{ - if(result == E_DS_CLIENT_DATA_CALL_CONNECTED) { - LOC_LOGD("%s:%d]: Emergency call is up", __func__, __LINE__); - LocApiAdapter::reportDataCallOpened(); - } - else if(result == E_DS_CLIENT_DATA_CALL_DISCONNECTED) { - LOC_LOGE("%s:%d]: Emergency call is stopped", __func__, __LINE__); - LocApiAdapter::reportDataCallClosed(); - } - return; -} - -ds_client_cb_data ds_client_cb{ - ds_client_global_event_cb -}; - -int LocApiV02Adapter :: openAndStartDataCall() -{ - enum loc_api_adapter_err ret; - int profile_index; - ds_client_status_enum_type result = ds_client_open_call(&dsClientHandle, - &ds_client_cb, - (void *)this, - &profile_index); - if(result == E_DS_CLIENT_SUCCESS) { - result = ds_client_start_call(dsClientHandle, profile_index); - - if(result == E_DS_CLIENT_SUCCESS) { - LOC_LOGD("%s:%d]: Request to start Emergency call sent\n", - __func__, __LINE__); - ret = LOC_API_ADAPTER_ERR_SUCCESS; - } - else { - LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. ret = %d", - __func__, __LINE__, (int)ret); - ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; - } - } - else if(result == E_DS_CLIENT_RETRY_LATER) { - LOC_LOGE("%s:%d]: Could not start emergency call. Retry after delay\n", - __func__, __LINE__); - ret = LOC_API_ADAPTER_ERR_ENGINE_BUSY; - } - else { - LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. ret = %d", - __func__, __LINE__, (int)ret); - ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; - } - - return (int)ret; -} - -void LocApiV02Adapter :: stopDataCall() -{ - ds_client_status_enum_type ret = - ds_client_stop_call(dsClientHandle); - if (ret == E_DS_CLIENT_SUCCESS) { - LOC_LOGD("%s:%d]: Request to Close SUPL ES call sent\n", __func__, __LINE__); - } - else { - if (ret == E_DS_CLIENT_FAILURE_INVALID_HANDLE) { - LOC_LOGE("%s:%d]: Conn handle not found for SUPL ES", - __func__, __LINE__); - } - LOC_LOGE("%s:%d]: Could not close SUPL ES call. Ret: %d\n" - ,__func__, __LINE__, ret); - } - return; -} - -void LocApiV02Adapter :: closeDataCall() -{ - ds_client_close_call(&dsClientHandle); - LOC_LOGD("%s:%d]: Release data client handle\n", __func__, __LINE__); - return; -} - -int LocApiV02Adapter :: initDataServiceClient() -{ - int ret=0; - ret = ds_client_init(); - LOC_LOGD("%s:%d]: ret = %d\n", __func__, __LINE__,ret); - return ret; -} diff --git a/loc_api/loc_api_v02/LocApiV02Adapter.h b/loc_api/loc_api_v02/LocApiV02Adapter.h deleted file mode 100644 index df5ab527..00000000 --- a/loc_api/loc_api_v02/LocApiV02Adapter.h +++ /dev/null @@ -1,182 +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_API_V_0_2_ADAPTER_H -#define LOC_API_V_0_2_ADAPTER_H - -#include -#include "loc_api_v02_client.h" -#include -#include -#include "ds_client.h" - -/* This class derives from the LocApiAdapter class. - The members of this class are responsible for converting - the Loc API V02 data structures into Loc Engine data structures. - This class also implements some of the virtual functions that - handle the requests from loc engine. */ -class LocApiV02Adapter : public LocApiAdapter { - /*ds client handle*/ - dsClientHandleType dsClientHandle; - - /* loc api v02 handle*/ - locClientHandleType clientHandle; - - /* events the client is registered for */ - locClientEventMaskType eventMask; - - /* Convert event mask from loc eng to loc_api_v02 format */ - locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - - /* Convert error from loc_api_v02 to loc eng format*/ - enum loc_api_adapter_err convertErr(locClientStatusEnumType status); - - /* convert Ni Encoding type from QMI_LOC to loc eng format */ - GpsNiEncodingType convertNiEncoding( - qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); - - /*convert NI notify verify type from QMI LOC to loc eng format*/ - bool convertNiNotifyVerifyType (GpsNiNotification *notif, - qmiLocNiNotifyVerifyEnumT_v02 notif_priv); - - /* close Loc API V02 client */ - int deInitLocClient(); - - /* convert position report to loc eng format and send the converted - position to loc eng */ - void reportPosition - (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); - - /* convert satellite report to loc eng format and send the converted - report to loc eng */ - void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); - - /* convert engine state report to loc eng format and send the converted - report to loc eng */ - void reportEngineState ( - const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); - - /* convert fix session report to loc eng format and send the converted - report to loc eng */ - void reportFixSessionState ( - const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); - - /* convert NMEA report to loc eng format and send the converted - report to loc eng */ - void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); - - /* convert and report an ATL request to loc engine */ - void reportAtlRequest( - const qmiLocEventLocationServerConnectionReqIndMsgT_v02 - *server_request_ptr); - - /* convert and report NI request to loc eng */ - void reportNiRequest( - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); - -public: - LocApiV02Adapter(LocEng &locEng); - ~LocApiV02Adapter(); - - /* event callback registered with the loc_api v02 interface */ - void eventCb(locClientHandleType client_handle, - uint32_t loc_event_id, - locClientEventIndUnionType loc_event_payload); - - /* error callback, this function handles the service unavailable - error */ - void errorCb(locClientHandleType handle, - locClientErrorEnumType errorId); - - void ds_client_event_cb(ds_client_status_enum_type result); - int openAndStartDataCall(); - void stopDataCall(); - void closeDataCall(); - int initDataServiceClient(); - - virtual enum loc_api_adapter_err reinit(); - - virtual enum loc_api_adapter_err startFix(); - - virtual enum loc_api_adapter_err stopFix(); - - virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode *mode); - - 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); - - 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); -#ifdef FEATURE_IPV6 - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, - AGpsType agpsType); -#else - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsType agpsType); -#endif - virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); - virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); - - virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); - - 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 setExtPowerConfig(int isBatteryCharging); - virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); -}; - -#endif //LOC_API_V_0_2_ADAPTER_H diff --git a/loc_api/loc_api_v02/Makefile.am b/loc_api/loc_api_v02/Makefile.am deleted file mode 100644 index 2308cd44..00000000 --- a/loc_api/loc_api_v02/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -AM_CFLAGS = \ - ${QMIF_CFLAGS} \ - -I../../utils \ - -I../../platform_lib_abstractions \ - -I../libloc_api_50001 - -requiredlibs = \ - ${QMIF_LIBS} \ - ../libloc_api_50001/libloc_adapter_so.la \ - ../../utils/libgps_utils_so.la - -h_sources = LocApiV02Adapter.h \ - loc_util_log.h \ - location_service_v02.h \ - loc_api_sync_req.h \ - loc_api_v02_client.h \ - loc_api_v02_log.h - -c_sources = LocApiV02Adapter.cpp \ - loc_api_v02_log.c \ - loc_api_v02_client.c \ - loc_api_sync_req.c \ - location_service_v02.c - -library_includedir = $(pkgincludedir) -library_include_HEADERS = $(h_sources) - -libloc_api_la_SOURCES = $(c_sources) $(h_sources) - -if USE_GLIB -libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_api_la_CFLAGS = $(AM_CFLAGS) -libloc_api_la_LDFLAGS = -shared -version-info 1:0:0 -libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_api_la_LIBADD = $(requiredlibs) -lstdc++ - -lib_LTLIBRARIES = libloc_api.la diff --git a/loc_api/loc_api_v02/loc_api_sync_req.c b/loc_api/loc_api_v02/loc_api_sync_req.c deleted file mode 100644 index 6a086667..00000000 --- a/loc_api/loc_api_v02/loc_api_sync_req.c +++ /dev/null @@ -1,547 +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 -#include "loc_api_v02_client.h" -#include "loc_api_sync_req.h" - -/* Logging */ -// Uncomment to log verbose logs -#define LOG_NDEBUG 1 - -// log debug logs -#define LOG_NDDEBUG 1 -#define LOG_TAG "LocSvc_api_v02" -#include "loc_util_log.h" - -#define LOC_SYNC_REQ_BUFFER_SIZE 8 -#define GPS_CONF_FILE "/etc/gps.conf" -pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; - -static bool loc_sync_call_initialized = false; - -typedef struct { - pthread_mutex_t sync_req_lock; - - /* Client ID */ - locClientHandleType client_handle; - - /* waiting conditional variable */ - pthread_cond_t ind_arrived_cond; - - /* Callback waiting data block, protected by loc_cb_data_mutex */ - bool ind_is_selected; /* is cb selected? */ - bool ind_is_waiting; /* is waiting? */ - bool ind_has_arrived; /* callback has arrived */ - uint32_t req_id; /* sync request */ - void *recv_ind_payload_ptr; /* received payload */ - uint32_t recv_ind_id; /* received ind */ - -} loc_sync_req_data_s_type; - -typedef struct { - bool in_use; /* at least one sync call is active */ - bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; - loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; -} loc_sync_req_array_s_type; - -/*************************************************************************** - * DATA FOR ASYNCHRONOUS RPC PROCESSING - **************************************************************************/ -loc_sync_req_array_s_type loc_sync_array; - -/*=========================================================================== - -FUNCTION loc_sync_req_init - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_sync_req_init() -{ - LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); - UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE); - pthread_mutex_lock(&loc_sync_call_mutex); - if(true == loc_sync_call_initialized) - { - LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - loc_sync_array.in_use = false; - - memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); - - int i; - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - pthread_mutex_init(&slot->sync_req_lock, NULL); - pthread_cond_init(&slot->ind_arrived_cond, NULL); - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; /* req id */ - } - - loc_sync_call_initialized = true; - pthread_mutex_unlock(&loc_sync_call_mutex); -} - - -/*=========================================================================== - -FUNCTION loc_sync_process_ind - -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_sync_process_ind( - locClientHandleType client_handle, /* handle of the client */ - uint32_t ind_id , /* ind id */ - void *ind_payload_ptr /* payload */ -) -{ - - LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n", - __func__,__LINE__, client_handle, ind_id); - - pthread_mutex_lock(&loc_sync_call_mutex); - - if (!loc_sync_array.in_use) - { - LOC_LOGD("%s:%d]: loc_sync_array not in use \n", - __func__, __LINE__); - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - - bool in_use = false, consumed = false; - int i; - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) - { - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; - - in_use |= loc_sync_array.slot_in_use[i]; - - pthread_mutex_lock(&slot->sync_req_lock); - - if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) - && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) - { - // copy the payload to the slot waiting for this ind - size_t payload_size = 0; - - LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", - __func__, __LINE__, i, ind_id); - - if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && - NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) - { - LOC_LOGV("%s:%d]: copying ind payload size = %u \n", - __func__, __LINE__, payload_size); - - memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); - - consumed = true; - - } - /* Received a callback while waiting, wake up thread to check it */ - if (slot->ind_is_waiting) - { - slot->recv_ind_id = ind_id; - - pthread_cond_signal(&slot->ind_arrived_cond); - } - else - { - /* If callback arrives before wait, remember it */ - LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", - __func__, __LINE__, ind_id); - - slot->ind_has_arrived = true; - } - } - pthread_mutex_unlock(&slot->sync_req_lock); - } - - if (!in_use) { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_alloc_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_alloc_slot() -{ - int i, select_id = -1; /* no free buffer */ - - pthread_mutex_lock(&loc_sync_call_mutex); - - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (!loc_sync_array.slot_in_use[i]) - { - select_id = i; - loc_sync_array.slot_in_use[i] = 1; - loc_sync_array.in_use = true; - break; - } - } - - pthread_mutex_unlock(&loc_sync_call_mutex); - LOC_LOGV("%s:%d]: returning slot %d\n", - __func__, __LINE__, select_id); - return select_id; -} - -/*=========================================================================== - -FUNCTION loc_free_slot - -DESCRIPTION - Frees a buffer slot after the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_free_slot(int select_id) -{ - int i; - loc_sync_req_data_s_type *slot; - - pthread_mutex_lock(&loc_sync_call_mutex); - - LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); - - loc_sync_array.slot_in_use[select_id] = 0; - - slot = &loc_sync_array.slots[select_id]; - - slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; - slot->ind_is_selected = false; /* is ind selected? */ - slot->ind_is_waiting = false; /* is waiting? */ - slot->ind_has_arrived = false; /* callback has arrived */ - slot->recv_ind_id = 0; /* ind to wait for */ - slot->recv_ind_payload_ptr = NULL; - slot->req_id = 0; - - // check if all slots are now free - for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) - { - if (loc_sync_array.slot_in_use[i]) break; - } - - if (i >= LOC_SYNC_REQ_BUFFER_SIZE) - { - loc_sync_array.in_use = false; - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_sync_select_ind - -DESCRIPTION - Selects which indication to wait for. - - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -ENOMEM : out of buffer - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_select_ind( - locClientHandleType client_handle, /* Client handle */ - uint32_t ind_id, /* ind Id wait for */ - uint32_t req_id, /* req id */ - void * ind_payload_ptr /* ptr where payload should be copied to*/ -) -{ - int select_id = loc_alloc_slot(); - - LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n", - __func__, __LINE__, client_handle, ind_id, req_id); - - if (select_id < 0) - { - LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", - __func__, __LINE__, loc_get_v02_event_name(req_id)); - return -ENOMEM; - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - pthread_mutex_lock(&slot->sync_req_lock); - - slot->client_handle = client_handle; - slot->ind_is_selected = true; - slot->ind_is_waiting = false; - slot->ind_has_arrived = false; - - slot->recv_ind_id = ind_id; - slot->req_id = req_id; - slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr - - pthread_mutex_unlock(&slot->sync_req_lock); - - return select_id; -} - - -/*=========================================================================== - -FUNCTION loc_sync_wait_for_ind - -DESCRIPTION - Waits for a selected indication. The wait expires in timeout_seconds seconds. - If the function is called before an existing wait has finished, it will - immediately return error. - -DEPENDENCIES - N/A - -RETURN VALUE - 0 on SUCCESS, -ve value on failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_sync_wait_for_ind( - int select_id, /* ID from loc_sync_select_ind() */ - int timeout_seconds, /* Timeout in this number of seconds */ - uint32_t ind_id -) -{ - if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) - { - LOC_LOGE("%s:%d]: invalid select_id: %d \n", - __func__, __LINE__, select_id); - - return (-EINVAL); - } - - loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; - - int ret_val = 0; /* the return value of this function: 0 = no error */ - int rc; /* return code from pthread calls */ - - struct timeval present_time; - struct timespec expire_time; - - pthread_mutex_lock(&slot->sync_req_lock); - - do - { - if (slot->ind_has_arrived) - { - ret_val = 0; /* success */ - break; - } - - if (slot->ind_is_waiting) - { - LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, - __LINE__, select_id); - ret_val = -EBUSY; // busy - break; - } - - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_nsec = present_time.tv_usec * 1000; - expire_time.tv_sec += timeout_seconds; - - /* Take new wait request */ - slot->ind_is_waiting = true; - - /* Waiting */ - rc = pthread_cond_timedwait(&slot->ind_arrived_cond, - &slot->sync_req_lock, &expire_time); - - slot->ind_is_waiting = false; - - if(rc == ETIMEDOUT) - { - LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", - __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); - ret_val = -ETIMEDOUT; //time out - } - - } while (0); - - pthread_mutex_unlock(&slot->sync_req_lock); - loc_free_slot(select_id); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_sync_send_req - -DESCRIPTION - Synchronous req call (thread safe) - -DEPENDENCIES - N/A - -RETURN VALUE - Loc API 2.0 status - -SIDE EFFECTS - N/A - -===========================================================================*/ -locClientStatusEnumType loc_sync_send_req -( - locClientHandleType client_handle, - uint32_t req_id, /* req id */ - locClientReqUnionType req_payload, - uint32_t timeout_msec, - uint32_t ind_id, //ind ID to block for, usually the same as req_id */ - void *ind_payload_ptr /* can be NULL*/ -) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; - int select_id; - int rc = 0; - - // Select the callback we are waiting for - select_id = loc_sync_select_ind(client_handle, ind_id, req_id, - ind_payload_ptr); - - if (select_id >= 0) - { - status = locClientSendReq (client_handle, req_id, req_payload); - LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", - __func__, __LINE__, select_id, status); - - if (status != eLOC_CLIENT_SUCCESS ) - { - loc_free_slot(select_id); - } - else - { - // Wait for the indication callback - if (( rc = loc_sync_wait_for_ind( select_id, - timeout_msec / 1000, - ind_id) ) < 0) - { - if ( rc == -ETIMEDOUT) - status = eLOC_CLIENT_FAILURE_TIMEOUT; - else - status = eLOC_CLIENT_FAILURE_INTERNAL; - - // Callback waiting failed - LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " - "select id %d, status %s", __func__, __LINE__, rc , - select_id, loc_get_v02_client_status_name(status)); - } - else - { - status = eLOC_CLIENT_SUCCESS; - LOC_LOGV("%s:%d]: success (select id %d)\n", - __func__, __LINE__, select_id); - } - } - } /* select id */ - - return status; -} - - diff --git a/loc_api/loc_api_v02/loc_api_v02_client.c b/loc_api/loc_api_v02/loc_api_v02_client.c deleted file mode 100644 index 86003dab..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_client.c +++ /dev/null @@ -1,2211 +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 "qmi_client.h" -#include "qmi_idl_lib.h" -#include "qmi_cci_target_ext.h" - -#if defined( _ANDROID_) -#include "qmi_cci_target.h" -#include "qmi_cci_common.h" -#define LOG_NDEBUG 0 -#define LOG_TAG "LocSvc_api_v02" -#endif //_ANDROID_ - - -#include "loc_api_v02_client.h" -#include "loc_util_log.h" - -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (5000) - -#else - -// timeout in ms before send_msg_sync should return -#define LOC_CLIENT_ACK_TIMEOUT (1000) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -//timeout in ms that the service waits for qmi-fw notification -#define LOC_CLIENT_SERVICE_TIMEOUT_UNIT (4000) -// total timeout for the service to come up -#define LOC_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) - -/* Table to relate eventId, size and mask value used to enable the event*/ -typedef struct -{ - uint32_t eventId; - size_t eventSize; - locClientEventMaskType eventMask; -}locClientEventIndTableStructT; - - -static locClientEventIndTableStructT locClientEventIndTable[]= { - - // position report ind - { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, - sizeof(qmiLocEventPositionReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, - - // satellite report ind - { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, - sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), - QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, - - // NMEA report ind - { QMI_LOC_EVENT_NMEA_IND_V02, - sizeof(qmiLocEventNmeaIndMsgT_v02), - QMI_LOC_EVENT_MASK_NMEA_V02 }, - - //NI event ind - { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, - sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, - - //Time Injection Request Ind - { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, - sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, - - //Predicted Orbits Injection Request - { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, - sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, - - //Position Injection Request Ind - { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, - sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , - - //Engine State Report Ind - { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, - sizeof(qmiLocEventEngineStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, - - //Fix Session State Report Ind - { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, - sizeof(qmiLocEventFixSessionStateIndMsgT_v02), - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, - - //Wifi Request Indication - { QMI_LOC_EVENT_WIFI_REQ_IND_V02, - sizeof(qmiLocEventWifiReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, - - //Sensor Streaming Ready Status Ind - { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, - sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, - - // Time Sync Request Indication - { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, - sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, - - //Set Spi Streaming Report Event - { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, - sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, - - //Location Server Connection Request event - { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, - sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 }, - - // NI Geofence Event - { QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, - sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02}, - - // Geofence General Alert Event - { QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, - sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02}, - - //Geofence Breach event - { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, - sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02}, - - //Pedometer Control event - { QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, - sizeof(qmiLocEventPedometerControlIndMsgT_v02), - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 }, - - //Motion Data Control event - { QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, - sizeof(qmiLocEventMotionDataControlIndMsgT_v02), - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 } -}; - -/* table to relate the respInd Id with its size */ -typedef struct -{ - uint32_t respIndId; - size_t respIndSize; -}locClientRespIndTableStructT; - -static locClientRespIndTableStructT locClientRespIndTable[]= { - - // get service revision ind - { QMI_LOC_GET_SERVICE_REVISION_IND_V02, - sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, - - // Get Fix Criteria Resp Ind - { QMI_LOC_GET_FIX_CRITERIA_IND_V02, - sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, - - // NI User Resp In - { QMI_LOC_NI_USER_RESPONSE_IND_V02, - sizeof(qmiLocNiUserRespIndMsgT_v02)}, - - //Inject Predicted Orbits Data Resp Ind - { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, - sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, - - //Get Predicted Orbits Data Src Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, - - // Get Predicted Orbits Data Validity Resp Ind - { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, - sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, - - // Inject UTC Time Resp Ind - { QMI_LOC_INJECT_UTC_TIME_IND_V02, - sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, - - //Inject Position Resp Ind - { QMI_LOC_INJECT_POSITION_IND_V02, - sizeof(qmiLocInjectPositionIndMsgT_v02)}, - - //Set Engine Lock Resp Ind - { QMI_LOC_SET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocSetEngineLockIndMsgT_v02)}, - - //Get Engine Lock Resp Ind - { QMI_LOC_GET_ENGINE_LOCK_IND_V02, - sizeof(qmiLocGetEngineLockIndMsgT_v02)}, - - //Set SBAS Config Resp Ind - { QMI_LOC_SET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, - - //Get SBAS Config Resp Ind - { QMI_LOC_GET_SBAS_CONFIG_IND_V02, - sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, - - //Set NMEA Types Resp Ind - { QMI_LOC_SET_NMEA_TYPES_IND_V02, - sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, - - //Get NMEA Types Resp Ind - { QMI_LOC_GET_NMEA_TYPES_IND_V02, - sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, - - //Set Low Power Mode Resp Ind - { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, - - //Get Low Power Mode Resp Ind - { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, - sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, - - //Set Server Resp Ind - { QMI_LOC_SET_SERVER_IND_V02, - sizeof(qmiLocSetServerIndMsgT_v02)}, - - //Get Server Resp Ind - { QMI_LOC_GET_SERVER_IND_V02, - sizeof(qmiLocGetServerIndMsgT_v02)}, - - //Delete Assist Data Resp Ind - { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, - sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, - - //Set XTRA-T Session Control Resp Ind - { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, - - //Get XTRA-T Session Control Resp Ind - { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, - sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, - - //Inject Wifi Position Resp Ind - { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, - sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, - - //Notify Wifi Status Resp Ind - { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, - sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, - - //Get Registered Events Resp Ind - { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, - sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, - - //Set Operation Mode Resp Ind - { QMI_LOC_SET_OPERATION_MODE_IND_V02, - sizeof(qmiLocSetOperationModeIndMsgT_v02)}, - - //Get Operation Mode Resp Ind - { QMI_LOC_GET_OPERATION_MODE_IND_V02, - sizeof(qmiLocGetOperationModeIndMsgT_v02)}, - - //Set SPI Status Resp Ind - { QMI_LOC_SET_SPI_STATUS_IND_V02, - sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, - - //Inject Sensor Data Resp Ind - { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, - sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, - - //Inject Time Sync Data Resp Ind - { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, - sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, - - //Set Cradle Mount config Resp Ind - { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, - - //Get Cradle Mount config Resp Ind - { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, - sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, - - //Set External Power config Resp Ind - { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, - - //Get External Power config Resp Ind - { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, - sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, - - //Location server connection status - { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, - sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, - - //Set Protocol Config Parameters - { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, - - //Get Protocol Config Parameters - { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, - - //Set Sensor Control Config - { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, - - //Get Sensor Control Config - { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, - sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, - - //Set Sensor Properties - { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, - - //Get Sensor Properties - { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, - sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, - - //Set Sensor Performance Control Config - { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, - - //Get Sensor Performance Control Config - { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, - sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, - //Inject SUPL certificate - { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, - - //Delete SUPL certificate - { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, - sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, - - // Set Position Engine Config - { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, - - // Get Position Engine Config - { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, - sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)}, - - //Add a Circular Geofence - { QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, - sizeof(qmiLocAddCircularGeofenceIndMsgT_v02)}, - - //Delete a Geofence - { QMI_LOC_DELETE_GEOFENCE_IND_V02, - sizeof(qmiLocDeleteGeofenceIndMsgT_v02)} , - - //Query a Geofence - { QMI_LOC_QUERY_GEOFENCE_IND_V02, - sizeof(qmiLocQueryGeofenceIndMsgT_v02)}, - - //Edit a Geofence - { QMI_LOC_EDIT_GEOFENCE_IND_V02, - sizeof(qmiLocEditGeofenceIndMsgT_v02)}, - - //Get best available position - { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, - sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, - - //Inject motion data - { QMI_LOC_INJECT_MOTION_DATA_IND_V02, - sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, - - //Get NI Geofence list - { QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, - sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02)}, - - //Inject GSM Cell Info - { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, - sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02)}, - - //Inject Network Initiated Message - { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, - sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, - - //WWAN Out of Service Notification - { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, - sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)}, - - //Pedomete Report - { QMI_LOC_PEDOMETER_REPORT_IND_V02, - sizeof(qmiLocPedometerReportIndMsgT_v02)}, - - { QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, - sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02)}, - - { QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, - sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02)}, - - { QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, - sizeof(qmiLocInjectSubscriberIDIndMsgT_v02)} -}; - - -/** whether indication is an event or a response */ -typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; - - -/** @struct locClientInternalState - */ - -typedef struct locClientCbDataStructT locClientCallbackDataType; - -struct locClientCbDataStructT -{ - // client cookie - void *pClientCookie; - //QCCI handle for this control point - qmi_client_type userHandle; - - // callbacks registered by the clients - locClientEventIndCbType eventCallback; - locClientRespIndCbType respCallback; - locClientErrorCbType errorCallback; - - // the event mask the client has registered for - locClientEventMaskType eventRegMask; - - //pointer to itself for checking consistency data - locClientCallbackDataType *pMe; -}; - - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ - -/** locClientGetSizeAndTypeByIndId - * @brief this function gets the size and the type (event, - * response)of the indication structure from its ID - * @param [in] indId ID of the indication - * @param [out] type event or response indication - * @param [out] size size of the indications - * - * @return true if the ID was found, false otherwise */ - -static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, - locClientIndEnumT *pIndType) -{ - // look in the event table - if(true == locClientGetSizeByEventIndId(indId, pIndSize)) - { - *pIndType = eventIndType; - - LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - //else look in response table - if(true == locClientGetSizeByRespIndId(indId, pIndSize)) - { - *pIndType = respIndType; - - LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, - indId, (uint32_t)*pIndSize); - return true; - } - - // Id not found - LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); - return false; -} - -/** isClientRegisteredForEvent -* @brief checks the mask to identify if the client has -* registered for the specified event Id -* @param [in] eventIndId -* @param [in] eventRegMask -* @return true if client regstered for event; else false */ - -static bool isClientRegisteredForEvent( - locClientEventMaskType eventRegMask, - uint32_t eventIndId) -{ - size_t idx = 0, eventIndTableSize = 0; - - // look in the event table - eventIndTableSize = - (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); - - for(idx=0; idx>32), - (uint32_t)(eventRegMask & 0xFFFFFFFF), - (uint32_t)(locClientEventIndTable[idx].eventMask >> 32), - (uint32_t)(locClientEventIndTable[idx].eventMask & 0xFFFFFFFF)); - - return(( - eventRegMask & locClientEventIndTable[idx].eventMask)? - true:false); - } - } - LOC_LOGW("%s:%d]: eventId %d not found\n", __func__, __LINE__, - eventIndId); - return false; -} - -/** convertQmiResponseToLocStatus - @brief converts a qmiLocGenRespMsgT to locClientStatusEnumType* - @param [in] pResponse; pointer to the response received from - QMI_LOC service. - @return locClientStatusEnumType corresponding to the - response. -*/ - -static locClientStatusEnumType convertQmiResponseToLocStatus( - qmiLocGenRespMsgT_v02 *pResponse) -{ - locClientStatusEnumType status = eLOC_CLIENT_FAILURE_INTERNAL; - - // if result == SUCCESS don't look at error code - if(pResponse->resp.result == QMI_RESULT_SUCCESS_V01 ) - { - status = eLOC_CLIENT_SUCCESS; - } - else - { - switch(pResponse->resp.error) - { - case QMI_ERR_MALFORMED_MSG_V01: - case QMI_ERR_INVALID_ARG_V01: - status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - break; - - case QMI_ERR_DEVICE_IN_USE_V01: - status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; - break; - - default: - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - } - LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", - __func__, __LINE__, pResponse->resp.result, - pResponse->resp.error, status); - return status; -} - -/** convertQmiErrorToLocError - @brief converts a qmi service error type to - locClientErrorEnumType - @param [in] error received QMI service. - @return locClientErrorEnumType corresponding to the error. -*/ - -static locClientErrorEnumType convertQmiErrorToLocError( - qmi_client_error_type error) -{ - locClientErrorEnumType locError ; - switch(error) - { - case QMI_SERVICE_ERR: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - - default: - locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; - break; - } - LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", - __func__, __LINE__, error, locError); - return locError; -} - -/** locClienHandlePosReportInd - * @brief Validates a position report ind - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if pos report is valid, false otherwise -*/ -static bool locClientHandlePosReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate position report - qmiLocEventPositionReportIndMsgT_v02 *posReport = - (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", - __func__, __LINE__, ind_buf_len, - posReport->latitude, posReport->longitude, - posReport->altitudeWrtEllipsoid); - - return true; -} -//----------------------------------------------------------------------------- - -/** locClientHandleSatReportInd - * @brief Validates a satellite report indication. Dk - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if sat report is valid, false otherwise -*/ -static bool locClientHandleSatReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate sat reports - unsigned int idx = 0; - qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = - (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; - - LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" - " validity = %d \n ", __func__, __LINE__, - ind_buf_len, satReport->altitudeAssumed, - satReport->svList_len, satReport->svList_valid); - //Log SV report - for( idx = 0; idx svList_len; idx++ ) - { - LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " - "status = %d \n", __func__, __LINE__, - satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, - satReport->svList[idx].system, satReport->svList[idx].svStatus); - } - - return true; -} - - -/** locClientHandleNmeaReportInd - * @brief Validate a NMEA report indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if nmea report is valid, false otherwise -*/ - - -static bool locClientHandleNmeaReportInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - // validate NMEA report - return true; -} - -/** locClientHandleGetServiceRevisionRespInd - * @brief Handles a Get Service Revision Rresponse indication. - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @return true if service revision is valid, false otherwise -*/ - -static bool locClientHandleGetServiceRevisionRespInd -( - uint32_t msg_id, - const void* ind_buf, - uint32_t ind_buf_len -) -{ - LOC_LOGV("%s:%d] :\n", __func__, __LINE__); - return true; -} - -/** locClientHandleIndication - * @brief looks at each indication and calls the appropriate - * validation handler - * @param [in] indId - * @param [in] indBuffer - * @param [in] indSize - * @return true if indication was validated; else false */ - -static bool locClientHandleIndication( - uint32_t indId, - void* indBuffer, - size_t indSize - ) -{ - bool status = false; - switch(indId) - { - // handle the event indications - //------------------------------------------------------------------------- - - // handle position report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - { - status = locClientHandlePosReportInd(indId, indBuffer, indSize); - break; - } - // handle satellite report - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - { - status = locClientHandleSatReportInd(indId, indBuffer, indSize); - break; - } - - // handle NMEA report - case QMI_LOC_EVENT_NMEA_IND_V02: - { - status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); - break; - } - - // handle NI Notify Verify Request Ind - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - { - // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Time Inject request Ind - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - { - // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle XTRA data Inject request Ind - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - { - // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle position inject request Ind - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - { - // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle engine state Ind - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - { - // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle fix session state Ind - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - { - // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle Wifi request Ind - case QMI_LOC_EVENT_WIFI_REQ_IND_V02: - { - // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle sensor streaming ready status Ind - case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: - { - // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle time sync Ind - case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: - { - // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // handle set streaming report ind - case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: - { - // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - { - //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: - { - //locClientHandleNiGeofenceNotificationInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: - { - //locClientHandleGeofenceGenAlertInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: - { - //locClientHandleGeofenceBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : - { - //locClientHandlePedometerControlInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: - { - //locClientHandleMotionDataControlInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - //------------------------------------------------------------------------- - - // handle the response indications - //------------------------------------------------------------------------- - - // Get service Revision response indication - case QMI_LOC_GET_SERVICE_REVISION_IND_V02: - { - status = locClientHandleGetServiceRevisionRespInd(indId, - indBuffer, indSize); - break; - } - - case QMI_LOC_GET_FIX_CRITERIA_IND_V02: - { - status = true; - break; - } - - // predicted orbits data response indication - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: - { - //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // get predicted orbits source response indication - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: - { - //locClientHandleGetPredictedOrbitsSourceInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - // get predicted orbits validity response indication - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: - { - //locClientHandleGetPredictedOrbitsDataValidityInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : - { - //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - { - //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: - { - //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: - { - //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: - { - //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: - { - //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - { - //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - { - // locClientHandleSetPositionEngineConfigParam( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: - { - // locClientHandleAddCircularGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_DELETE_GEOFENCE_IND_V02: - { - // locClientHandleDeleteGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_EDIT_GEOFENCE_IND_V02: - { - // locClientHandleEditGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_QUERY_GEOFENCE_IND_V02: - { - // locClientHandleQueryGeofenceInd( - // user_handle, msg_id, ind_buf, ind_buf_len); - status = true; - break; - } - - case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: - { - status = true; - break; - } - case QMI_LOC_GET_ENGINE_LOCK_IND_V02: - { - status = true; - break; - } - - case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: - { - status = true; - break; - } - - case QMI_LOC_PEDOMETER_REPORT_IND_V02: - { - status = true; - break; - } - - // for indications that only have a "status" field - case QMI_LOC_NI_USER_RESPONSE_IND_V02: - case QMI_LOC_INJECT_UTC_TIME_IND_V02: - case QMI_LOC_INJECT_POSITION_IND_V02: - case QMI_LOC_SET_ENGINE_LOCK_IND_V02: - case QMI_LOC_SET_SBAS_CONFIG_IND_V02: - case QMI_LOC_SET_NMEA_TYPES_IND_V02: - case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: - case QMI_LOC_SET_SERVER_IND_V02: - case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: - case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: - case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: - case QMI_LOC_SET_OPERATION_MODE_IND_V02: - case QMI_LOC_SET_SPI_STATUS_IND_V02: - case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_INJECT_MOTION_DATA_IND_V02: - case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: - case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: - case QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: - { - status = true; - break; - } - default: - LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, - (uint32_t)indId); - status = false; - break; - } - return status; -} - - -/** locClientErrorCb - * @brief handles the QCCI error events, this is called by the - * QCCI infrastructure when the service is no longer - * available. - * @param [in] user handle - * @param [in] error - * @param [in] *err_cb_data - */ - -static void locClientErrorCb -( - qmi_client_type user_handle, - qmi_client_error_type error, - void *err_cb_data -) -{ - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)err_cb_data; - locClientErrorCbType localErrorCallback = NULL; - - /* copy the errorCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and error callback. - */ - if(NULL != pCallbackData) - { - localErrorCallback = pCallbackData->errorCallback; - } - - LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", - __func__, __LINE__, error, err_cb_data); - - /* call the error callback - * To avoid calling the errorCallback after locClientClose - * is called, check pCallbackData->errorCallback again here - */ - - if( (NULL != pCallbackData) && - (NULL != localErrorCallback) && - (NULL != pCallbackData->errorCallback) && - (pCallbackData == pCallbackData->pMe) ) - { - //invoke the error callback for the corresponding client - localErrorCallback( - (locClientHandleType)pCallbackData, - convertQmiErrorToLocError(error), - pCallbackData->pClientCookie); - } -} - - -/** locClientIndCb - * @brief handles the indications sent from the service, if a - * response indication was received then the it is sent - * to the response callback. If a event indication was - * received then it is sent to the event callback - * @param [in] user handle - * @param [in] msg_id - * @param [in] ind_buf - * @param [in] ind_buf_len - * @param [in] ind_cb_data */ - -static void locClientIndCb -( - qmi_client_type user_handle, - unsigned int msg_id, - void *ind_buf, - unsigned int ind_buf_len, - void *ind_cb_data -) -{ - locClientIndEnumT indType; - size_t indSize = 0; - qmi_client_error_type rc ; - locClientCallbackDataType* pCallbackData = - (locClientCallbackDataType *)ind_cb_data; - - LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", - __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, - pCallbackData); - - // check callback data - if(NULL == pCallbackData ||(pCallbackData != pCallbackData->pMe)) - { - LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); - return; - } - - // check user handle - if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) - { - LOC_LOGE("%s:%d]: invalid user_handle got %p expected %p\n", - __func__, __LINE__, - user_handle, pCallbackData->userHandle); - return; - } - // Get the indication size and type ( eventInd or respInd) - if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) - { - void *indBuffer = NULL; - - // if the client did not register for this event then just drop it - if( (eventIndType == indType) && - ( (NULL == pCallbackData->eventCallback) || - (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) - { - LOC_LOGW("%s:%d]: client is not registered for event %d\n", - __func__, __LINE__, (uint32_t)msg_id); - return; - } - - // decode the indication - indBuffer = malloc(indSize); - - if(NULL == indBuffer) - { - LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); - return; - } - - // decode the indication - rc = qmi_client_message_decode( - user_handle, - QMI_IDL_INDICATION, - msg_id, - ind_buf, - ind_buf_len, - indBuffer, - indSize); - - if( rc == QMI_NO_ERR ) - { - //validate indication - if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) - { - if(eventIndType == indType) - { - locClientEventIndUnionType eventIndUnion; - - /* copy the eventCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientEventIndCbType localEventCallback = - pCallbackData->eventCallback; - - // dummy event - eventIndUnion.pPositionReportEvent = - (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; - - /* call the event callback - * To avoid calling the eventCallback after locClientClose - * is called, check pCallbackData->eventCallback again here - */ - if((NULL != localEventCallback) && - (NULL != pCallbackData->eventCallback)) - { - localEventCallback( - (locClientHandleType)pCallbackData, - msg_id, - eventIndUnion, - pCallbackData->pClientCookie); - } - } - else if(respIndType == indType) - { - locClientRespIndUnionType respIndUnion; - - /* copy the respCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientRespIndCbType localRespCallback = - pCallbackData->respCallback; - - // dummy to suppress compiler warnings - respIndUnion.pDeleteAssistDataInd = - (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; - - /* call the response callback - * To avoid calling the respCallback after locClientClose - * is called, check pCallbackData->respCallback again here - */ - if((NULL != localRespCallback) && - (NULL != pCallbackData->respCallback)) - { - localRespCallback( - (locClientHandleType)pCallbackData, - msg_id, - respIndUnion, - pCallbackData->pClientCookie); - } - } - } - else // error handling indication - { - LOC_LOGE("%s:%d]: Error handling the indication %d\n", - __func__, __LINE__, (uint32_t)msg_id); - } - } - else - { - LOC_LOGE("%s:%d]: Error decoding indication %d\n", - __func__, __LINE__, rc); - } - if(indBuffer) - { - free (indBuffer); - } - } - else // Id not found - { - LOC_LOGE("%s:%d]: Error indication not found %d\n", - __func__, __LINE__,(uint32_t)msg_id); - } - return; -} - - -/** locClientRegisterEventMask - * @brief registers the event mask with loc service - * @param [in] clientHandle - * @param [in] eventRegMask - * @return true if indication was validated; else false */ - -static bool locClientRegisterEventMask( - locClientHandleType clientHandle, - locClientEventMaskType eventRegMask) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientReqUnionType reqUnion; - qmiLocRegEventsReqMsgT_v02 regEventsReq; - - memset(®EventsReq, 0, sizeof(regEventsReq)); - - regEventsReq.eventRegMask = eventRegMask; - reqUnion.pRegEventsReq = ®EventsReq; - - status = locClientSendReq(clientHandle, - QMI_LOC_REG_EVENTS_REQ_V02, - reqUnion); - - if(eLOC_CLIENT_SUCCESS != status ) - { - LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, - loc_get_v02_client_status_name(status) ); - return false; - } - - return true; -} - -/** validateRequest - @brief validates the input request - @param [in] reqId request ID - @param [in] reqPayload Union of pointers to message payload - @param [out] ppOutData Pointer to void *data if successful - @param [out] pOutLen Pointer to length of data if succesful. - @return false on failure, true on Success -*/ - -static bool validateRequest( - uint32_t reqId, - const locClientReqUnionType reqPayload, - void **ppOutData, - uint32_t *pOutLen ) - -{ - bool noPayloadFlag = false; - - LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); - switch(reqId) - { - case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); - break; - } - - case QMI_LOC_REG_EVENTS_REQ_V02: - { - *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); - break; - } - - case QMI_LOC_START_REQ_V02: - { - *pOutLen = sizeof(qmiLocStartReqMsgT_v02); - break; - } - - case QMI_LOC_STOP_REQ_V02: - { - *pOutLen = sizeof(qmiLocStopReqMsgT_v02); - break; - } - - case QMI_LOC_NI_USER_RESPONSE_REQ_V02: - { - *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_UTC_TIME_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); - break; - } - - case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_NMEA_TYPES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SERVER_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); - break; - } - - case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); - break; - } - - case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_OPERATION_MODE_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SPI_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); - break; - } - - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); - break; - } - - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: - { - *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); - break; - } - - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); - break; - } - - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); - break; - } - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); - break; - } - case QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocAddCircularGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_DELETE_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocDeleteGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_QUERY_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocQueryGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_EDIT_GEOFENCE_REQ_V02: - { - *pOutLen = sizeof(qmiLocEditGeofenceReqMsgT_v02); - break; - } - case QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); - break; - } - - case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02: - { - *pOutLen = sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02); - break; - } - - case QMI_LOC_PEDOMETER_REPORT_REQ_V02: - { - *pOutLen = sizeof(qmiLocPedometerReportReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02: - { - *pOutLen = sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02); - break; - } - - case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: - { - *pOutLen = sizeof(qmiLocInjectSubscriberIDReqMsgT_v02); - break; - } - - // ALL requests with no payload - case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: - case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: - case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: - case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: - case QMI_LOC_GET_NMEA_TYPES_REQ_V02: - case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: - case QMI_LOC_GET_SERVER_REQ_V02: - case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: - case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: - case QMI_LOC_GET_OPERATION_MODE_REQ_V02: - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: - case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: - case QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02: - case QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02: - { - noPayloadFlag = true; - break; - } - - default: - LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, - reqId); - return false; - } - if(true == noPayloadFlag) - { - *ppOutData = NULL; - *pOutLen = 0; - } - else - { - //set dummy pointer for request union - *ppOutData = (void*) reqPayload.pInformClientRevisionReq; - } - LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, - reqId, *pOutLen); - return true; -} - -/** locClientQmiCtrlPointInit - @brief wait for the service to come up or timeout; when the - service comes up initialize the control point and set - internal handle and indication callback. - @param pQmiClient, -*/ - -static locClientStatusEnumType locClientQmiCtrlPointInit( - locClientCallbackDataType *pLocClientCbData) -{ - qmi_client_type clnt, notifier; - bool notifierInitFlag = false; - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - // instances of this service - qmi_service_info *pServiceInfo = NULL; - - do - { - uint32_t num_services = 0, num_entries = 0; - qmi_client_error_type rc = QMI_NO_ERR; - bool nosignal = false; - qmi_client_os_params os_params; - int timeout = 0; - - // Get the service object for the qmiLoc Service - qmi_idl_service_object_type locClientServiceObject = - loc_get_service_object_v02(); - - // Verify that qmiLoc_get_service_object did not return NULL - if (NULL == locClientServiceObject) - { - LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , - __func__, __LINE__ ); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // register for service notification - rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); - notifierInitFlag = (NULL != notifier); - - if (rc != QMI_NO_ERR) { - LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", - __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - do { - QMI_CCI_OS_SIGNAL_CLEAR(&os_params); - // get the service addressing information - rc = qmi_client_get_service_list(locClientServiceObject, NULL, NULL, - &num_services); - LOC_LOGV("%s:%d]: qmi_client_get_service_list() rc: %d " - "total timeout: %d", __func__, __LINE__, rc, timeout); - - if(rc == QMI_NO_ERR) - break; - - /* Service is not up. Wait on a signal until the service is up - or a timeout occurs. */ - LOC_LOGD("%s:%d]: Service not up. Starting delay timer\n", __func__, __LINE__); - QMI_CCI_OS_SIGNAL_WAIT(&os_params, LOC_CLIENT_SERVICE_TIMEOUT_UNIT); - nosignal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); - if(nosignal) - timeout += LOC_CLIENT_SERVICE_TIMEOUT_UNIT; - - } while (timeout < LOC_CLIENT_SERVICE_TIMEOUT_TOTAL); - - if (0 == num_services || rc != QMI_NO_ERR) { - if (!nosignal) { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" - "service is up !!! Error %d \n", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_INTERNAL; - } else { - LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries," - " final Err %d", __func__, __LINE__, rc); - status = eLOC_CLIENT_FAILURE_TIMEOUT; - } - break; - } - - pServiceInfo = - (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); - - if(NULL == pServiceInfo) - { - LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", - __func__, __LINE__); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - //set the number of entries to get equal to the total number of - //services. - num_entries = num_services; - //populate the serviceInfo - rc = qmi_client_get_service_list( locClientServiceObject, pServiceInfo, - &num_entries, &num_services); - - - LOC_LOGV("%s:%d]: qmi_client_get_service_list()" - " returned %d num_entries = %d num_services = %d\n", - __func__, __LINE__, - rc, num_entries, num_services); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_get_service_list Error %d \n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", - __func__, __LINE__, pLocClientCbData); - - // initialize the client - //sent the address of the first service found - // if IPC router is present, this will go to the service instance - // enumerated over IPC router, else it will go over the next transport where - // the service was enumerated. - rc = qmi_client_init(&pServiceInfo[0], locClientServiceObject, - locClientIndCb, (void *) pLocClientCbData, - NULL, &clnt); - - if(rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: qmi_client_init error %d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - LOC_LOGV("%s:%d]: passing the pointer %p to" - "qmi_client_register_error_cb \n", - __func__, __LINE__, pLocClientCbData); - - // register error callback - rc = qmi_client_register_error_cb(clnt, - locClientErrorCb, (void *) pLocClientCbData); - - if( QMI_NO_ERR != rc) - { - LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", - __func__, __LINE__, rc); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - // copy the clnt handle returned in qmi_client_init - memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); - - status = eLOC_CLIENT_SUCCESS; - - } while(0); - - /* release the notifier handle */ - if(true == notifierInitFlag) - { - qmi_client_release(notifier); - } - - if(NULL != pServiceInfo) - { - free((void *)pServiceInfo); - } - - return status; -} -//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- - -/** locClientOpen - @brief Connects a location client to the location engine. If the connection - is successful, returns a handle that the location client uses for - future location operations. - - @param [in] eventRegMask Mask of asynchronous events the client is - interested in receiving - @param [in] eventIndCb Function to be invoked to handle an event. - @param [in] respIndCb Function to be invoked to handle a response - indication. - @param [out] locClientHandle Handle to be used by the client - for any subsequent requests. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - non-zero error code(see locClientStatusEnumType)-- On failure. -*/ - -locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pClientCookie) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - locClientCallbackDataType *pCallbackData = NULL; - - // check input parameters - if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) - || (NULL == pLocClientCallbacks->respIndCb) || - (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) - { - LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", - __func__, __LINE__); - return eLOC_CLIENT_FAILURE_INVALID_PARAMETER; - } - - do - { - // Allocate memory for the callback data - pCallbackData = - ( locClientCallbackDataType*)calloc( - 1, sizeof(locClientCallbackDataType)); - - if(NULL == pCallbackData) - { - LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", - __func__, __LINE__); - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize the QMI control point; this function will block - * until a service is up or a timeout occurs. If the connection to - * the service succeeds the callback data will be filled in with - * a qmi_client value. - */ - - - EXIT_LOG_CALLFLOW(%s, "loc client open"); - status = locClientQmiCtrlPointInit(pCallbackData); - - LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - - if(status != eLOC_CLIENT_SUCCESS) - { - free(pCallbackData); - pCallbackData = NULL; - LOC_LOGE ("%s:%d] locClientQmiCtrlPointInit returned %d\n", - __func__, __LINE__, status); - break; - } - // set the self pointer - pCallbackData->pMe = pCallbackData; - // set the handle to the callback data - *pLocClientHandle = (locClientHandleType)pCallbackData; - - if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) - { - LOC_LOGE("%s:%d]: Error sending registration mask\n", - __func__, __LINE__); - - // release the client - locClientClose(pLocClientHandle); - - status = eLOC_CLIENT_FAILURE_INTERNAL; - break; - } - - /* Initialize rest of the client structure now that the connection - * to the service has been created successfully. - */ - - //fill in the event callback - pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; - - //fill in the response callback - pCallbackData->respCallback = pLocClientCallbacks->respIndCb; - - //fill in the error callback - pCallbackData->errorCallback = pLocClientCallbacks->errorCb; - - //set the client event registration mask - pCallbackData->eventRegMask = eventRegMask; - - // set the client cookie - pCallbackData->pClientCookie = (void *)pClientCookie; - - }while(0); - - if(eLOC_CLIENT_SUCCESS != status) - { - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); - } - - else - { - LOC_LOGD("%s:%d]: returning handle = %p, user_handle=%p, status = %d\n", - __func__, __LINE__, *pLocClientHandle, - pCallbackData->userHandle, status); - } - - return(status); -} - -/** locClientClose - @brief Disconnects a client from the location engine. - @param [in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) - On success. - - non-zero error code(see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientClose( - locClientHandleType* pLocClientHandle) -{ - // convert handle to callback data - locClientCallbackDataType *pCallbackData; - qmi_client_error_type rc = QMI_NO_ERR; //No error - - if(NULL == pLocClientHandle) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid pointer to handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - pCallbackData = (locClientCallbackDataType *)(*pLocClientHandle); - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle || - pCallbackData != pCallbackData->pMe ) - { - // invalid handle - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - LOC_LOGV("locClientClose releasing handle %p, user handle %p\n", - *pLocClientHandle, pCallbackData->userHandle ); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, "loc client close"); - - // release the handle - rc = qmi_client_release(pCallbackData->userHandle); - if(QMI_NO_ERR != rc ) - { - LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", - __func__, __LINE__, rc, pCallbackData->userHandle); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - /* clear the memory allocated to callback data to minimize the chances - * of a race condition occurring between close and the indication - * callback - */ - memset(pCallbackData, 0, sizeof(*pCallbackData)); - - // free the memory assigned in locClientOpen - free(pCallbackData); - pCallbackData= NULL; - - // set the handle to invalid value - *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; - return eLOC_CLIENT_SUCCESS; -} - -/** locClientSendReq - @brief Sends a message to the location engine. If the locClientSendMsg() - function is successful, the client should expect an indication - (except start, stop, event reg and sensor injection messages), - through the registered callback in the locOpen() function. The - indication will contain the status of the request and if status is a - success, indication also contains the payload - associated with response. - @param [in] handle Handle returned by the locClientOpen() - function. - @param [in] reqId message ID of the request - @param [in] reqPayload Payload of the request, can be NULL - if request has no payload - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS ) - On success. - - non-zero error code (see locClientStatusEnumType) - On failure. -*/ - -locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload ) -{ - locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; - qmi_client_error_type rc = QMI_NO_ERR; //No error - qmiLocGenRespMsgT_v02 resp; - uint32_t reqLen = 0; - void *pReqData = NULL; - locClientCallbackDataType *pCallbackData = - (locClientCallbackDataType *)handle; - - // check the input handle for sanity - if(NULL == pCallbackData || - NULL == pCallbackData->userHandle || - pCallbackData != pCallbackData->pMe ) - { - // did not find the handle in the client List - LOC_LOGE("%s:%d]: invalid handle \n", - __func__, __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); - } - - // validate that the request is correct - if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) - { - - LOC_LOGE("%s:%d] error invalid request\n", __func__, - __LINE__); - - return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); - } - - LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, - __LINE__, reqId, reqLen); - - // NEXT call goes out to modem. We log the callflow before it - // actually happens to ensure the this comes before resp callflow - // back from the modem, to avoid confusing log order. We trust - // that the QMI framework is robust. - EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); - rc = qmi_client_send_msg_sync( - pCallbackData->userHandle, - reqId, - pReqData, - reqLen, - &resp, - sizeof(resp), - LOC_CLIENT_ACK_TIMEOUT); - - LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, - __LINE__, rc); - - if (rc != QMI_NO_ERR) - { - LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); - return(eLOC_CLIENT_FAILURE_INTERNAL); - } - - // map the QCCI response to Loc API v02 status - status = convertQmiResponseToLocStatus(&resp); - - // if the request is to change registered events, update the - // loc api copy of that - if(eLOC_CLIENT_SUCCESS == status && - QMI_LOC_REG_EVENTS_REQ_V02 == reqId) - { - if(NULL != reqPayload.pRegEventsReq ) - { - pCallbackData->eventRegMask = - (locClientEventMaskType)(reqPayload.pRegEventsReq->eventRegMask); - } - } - return(status); -} - -/** locClientGetSizeByRespIndId - * @brief Get the size of the response indication structure, - * from a specified id - * @param [in] respIndId - * @param [out] pRespIndSize - * @return true if resp ID was found; else false -*/ - -bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) -{ - size_t idx = 0, respIndTableSize = 0; - respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); - for(idx=0; idx -#include - -#include "location_service_v02.h" //QMI LOC Service data types definitions - -#include - -/****************************************************************************** - * Constants and configuration - *****************************************************************************/ - -/** @ingroup constants_macros - Specific value of #locClientHandleType, indicating an invalid handle. */ -#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) - - -/** @addtogroup data_types -@{ */ - -/** Location client handle used to represent a specific client. Negative values - are invalid handles. -*/ -typedef void* locClientHandleType; - -/** Data type for events and event masks. */ -typedef uint64_t locClientEventMaskType; - -/** Location client status values. -*/ -typedef enum -{ - eLOC_CLIENT_SUCCESS = 0, - /**< Request was successful. */ - - eLOC_CLIENT_FAILURE_GENERAL = 1, - /**< Failed because of a general failure. */ - - eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, - /**< Failed because the service does not support the command. */ - - eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, - /**< Failed because the request contained invalid parameters. */ - - eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, - /**< Failed because the engine is busy. */ - - eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, - /**< Failed because the phone is offline. */ - - eLOC_CLIENT_FAILURE_TIMEOUT = 6, - /**< Failed because of a timeout. */ - - eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, - /**< Failed because the service is not present. */ - - eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, - /**< Failed because the service version is unsupported. */ - - eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, - /**< Failed because the service does not support client version. */ - - eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, - /**< Failed because an invalid handle was specified. */ - - eLOC_CLIENT_FAILURE_INTERNAL = 11, - /**< Failed because of an internal error in the service. */ - - eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12, - /**< Failed because the service has not been initialized. */ - - eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 - /**< Failed because there is not enough memory to do the operation. */ - -}locClientStatusEnumType; - -/** Location client error values -*/ -typedef enum -{ - eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 - /**< Service is no longer available. Upon getting this error, the client - must close the existing connection and reopen the connection. */ - -}locClientErrorEnumType; - - -/** Request messages the client can send to the location engine. - - The following requests do not have any data associated, so they do not have a - payload structure defined: - - - GetServiceRevision - - GetFixCriteria - - GetPredictedOrbitsDataSource - - GetPredictedOrbitsDataValidity - - GetEngineLock - - GetSbasConfigReq - - GetRegisteredEvents - - GetNmeaTypes - - GetLowPowerMode - - GetXtraTSessionControl - - GetRegisteredEvents - - GetOperationMode - - GetCradleMountConfig - - GetExternalPowerConfig - - GetSensorControlConfig - - GetSensorPerformanceControlConfiguration - - WWANOutOfServiceNotification -*/ -typedef union -{ - const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; - /**< Notifies the service about the revision the client is using. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ - - const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; - /**< Changes the events the client is interested in receiving. - - The client does not receive any indications corresponding to this - request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_REG_EVENTS_REQ_V02. */ - - const qmiLocStartReqMsgT_v02* pStartReq; - /**< Starts a positioning session. - - The client receives the following indications: position report, - satellite report, fix session report, and NMEA report (if applicable). - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_START_REQ_V02. */ - - const qmiLocStopReqMsgT_v02* pStopReq; - /**< Stops a positioning session. The client receives a fix session report - denoting that the fix session ended after this message was sent. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_STOP_REQ_V02. */ - - const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; - /**< Informs the service about the user response for a network-initiated call. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NI_USER_RESPONSE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ - - const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; - /**< Injects the predicted orbits data into the service. - - When all predicted orbits data parts have been injected, the client - receives the following indication containing a response: - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. - - The client injects successive data parts without waiting for this - indication as long as locClientSendReq() returns successfully. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ - - const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; - /**< Injects UTC time into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_UTC_TIME_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ - - const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; - /**< Injects a position into the service. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_POSITION_REQ_V02. */ - - const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; - /**< Sets the location engine lock. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_ENGINE_LOCK_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ - - const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; - /**< Sets the SBAS configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SBAS_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ - - const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; - /**< Sets the NMEA types configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_NMEA_TYPES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ - - const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; - /**< Sets the Low Power mode configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ - - const qmiLocSetServerReqMsgT_v02* pSetServerReq; - /**< Sets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SERVER_REQ_V02. */ - - const qmiLocGetServerReqMsgT_v02* pGetServerReq; - /**< Gets the A-GPS server type and address. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SERVER_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SERVER_REQ_V02. */ - - const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; - /**< Deletes the aiding data from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ - - const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; - /**< Sets XTRA-T session control in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ - - const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; - /**< Injects a WiFi position into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ - - const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; - /**< Notifies the engine about the WiFi status. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ - - const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; - /**< Sets the engine Operation mode. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_OPERATION_MODE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ - - const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; - /**< Sends the stationary position status to the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SPI_STATUS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SPI_STATUS_REQ_V02. */ - - const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; - /**< Injects sensor data into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ - - const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; - /**< Injects time synchronization information into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ - - const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; - /**< Sets the cradle mount state information in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - SET_CRADLE_MOUNT_CONFIG_REQ_V02. - - To send this request, set the reqId field in locClientSendReq() to - SET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; - /**< Sets external power configuration state in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ - - const qmiLocInformLocationServerConnStatusReqMsgT_v02* - pInformLocationServerConnStatusReq; - /**< Informs the engine about the connection status to the location server. - - This can be sent in response to a - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The - service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 - response indication for this request. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. */ - - const qmiLocSetProtocolConfigParametersReqMsgT_v02* - pSetProtocolConfigParametersReq; - /**< Sets the protocol configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetProtocolConfigParametersReqMsgT_v02* - pGetProtocolConfigParametersReq; - /**< Retrieves protocol configuration parameters from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocSetSensorControlConfigReqMsgT_v02* - pSetSensorControlConfigReq; - /**< Sets the sensor control configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. */ - - const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* - pSetSensorPerformanceControlConfigReq; - /**< Sets the sensor performance configuration parameters in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. */ - - const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; - /**< Retrieves the sensor properties from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. */ - - const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; - /**< Sets the sensor properties in the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. */ - - const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; - /**< Injects a SUPL certificate into the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. */ - - const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; - /**< Deletes a SUPL certificate from the engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. */ - - const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* - pSetPositionEngineConfigParametersReq; - /**< Sets position engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* - pGetPositionEngineConfigParametersReq; - /**< Gets position engine configuration. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ - - const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; - /**< Adds a circular geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 */ - - const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; - /**< Deletes a geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_DELETE_GEOFENCE_IND_V02. - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_DELETE_GEOFENCE_REQ_V02 */ - - const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; - /**< Queries a geofence. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_QUERY_GEOFENCE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_QUERY_GEOFENCE_REQ_V02. */ - - const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; - /**< Edits geofence parameters. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_EDIT_GEOFENCE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_EDIT_GEOFENCE_REQ_V02. */ - - const qmiLocGetBestAvailablePositionReqMsgT_v02* - pGetBestAvailablePositionReq; - /**< Get the best available position from location engine - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ - - const qmiLocInjectMotionDataReqMsgT_v02* pInjectMotionDataReq; - /**< Inject motion data in the location engine - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_MOTION_DATA_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_MOTION_DATA_REQ_V02 */ - - const qmiLocGetNiGeofenceIdListReqMsgT_v02* pGetNiGeofenceIdListReq; - /**< Get the list of Network Initiated Geofences from the location engine. - - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 */ - - const qmiLocInjectGSMCellInfoReqMsgT_v02 *pInjectGSMCellInfoReq; - /**< Inject GSM Cell Information into the location engine. - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 */ - - const qmiLocInjectNetworkInitiatedMessageReqMsgT_v02 - *pInjectNetworkInitiatedMessageReq; - /**< Inject Network Initiated Message into the location engine. - If the request is accepted by the service, the client receives the - following indication containing a response: - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ - - const void *pWWANOutOfServiceNotificationReq; - - const qmiLocPedometerReportReqMsgT_v02 *pPedometerReportReq; - /**< Send pedometer data to the location engine. If the request is - accepted by the service, the client receives the following - indication containing a response: - QMI_LOC_PEDOMETER_REPORT_IND_V02 - - To send this request, set the reqId field in locClientSendReq() to - QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ - - const qmiLocInjectWCDMACellInfoReqMsgT_v02 *pInjectWCDMACellInfoReq; - const qmiLocInjectTDSCDMACellInfoReqMsgT_v02 *pInjectTDSCDMACellInfoReq; - const qmiLocInjectSubscriberIDReqMsgT_v02 *pInjectSubscriberIDReq; - -}locClientReqUnionType; - - -/** Event indications that are sent by the service. -*/ -typedef union -{ - const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; - /**< Contains the position information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. If - periodic fix criteria is specified, this event is generated multiple - times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is - sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ - - const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; - /**< Contains the GNSS satellite information. - - This event is generated after QMI_LOC_START_REQ_V02 is sent. This event - is generated at 1 Hz if the location engine is tracking satellites to - make a location fix. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ - - const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; - /**< Contains an NMEA report sentence. - - The entire NMEA report consisting of multiple sentences is sent at a - 1 Hz rate. This event is generated after QMI_LOC_START_REQ_V02 is sent. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NMEA_IND_V02. */ - - const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; - /**< Notifies a location client when the network triggers a positioning - request to the mobile. - - Upon getting this event, the location client displays the - network-initiated fix request in a dialog and prompts the user to - accept or deny the request. The client responds to this request with - the message QMI_LOC_NI_USER_RESPONSE_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ - - const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; - /**< Asks the client for time assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_UTC_TIME_REQ_V02. - - The eventIndId field in the event indication callback is - set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ - - const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* - pInjectPredictedOrbitsReqEvent; - /**< Asks the client for predicted orbits data assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ - - const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; - /**< Asks the client for position assistance. - - The client responds to this request with the message - QMI_LOC_INJECT_POSITION_REQ_V02. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ - - const qmiLocEventEngineStateIndMsgT_v02* pEngineState; - /**< Sent by the engine whenever it turns on or off. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ - - const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; - /**< Sent by the engine when a location session begins or ends. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ - - const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; - /**< Sent by the engine when it needs WiFi support. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ - - const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* - pSensorStreamingReadyStatusEvent; - /**< Notifies the client that the engine is ready to accept sensor data. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ - - const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; - /**< Sent by the engine when it needs to synchronize its time with the sensor - processor time. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ - - const qmiLocEventSetSpiStreamingReportIndMsgT_v02* - pSetSpiStreamingReportEvent; - /**< Asks the client to start/stop sending a Stationary Position Indicator - (SPI) stream. - - The eventIndId field in the event indication callback is set to - QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ - - const qmiLocEventLocationServerConnectionReqIndMsgT_v02* - pLocationServerConnReqEvent; - /**< Sent by the engine to ask the client to open or close a connection to - a location server. - - The client responds to this request by sending the - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. */ - - const qmiLocEventNiGeofenceNotificationIndMsgT_v02* - pNiGeofenceNotificationEvent; - /**< Sent by the engine to notify the client about changes to a - network-initiated geofence. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. */ - - const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; - /**< Sent by the engine to notify the client about updates that may - affect a geofence operation. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. */ - - const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; - /**< Sent by the engine to notify the client about a geofence breach - event. - - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ - - const qmiLocEventPedometerControlIndMsgT_v02* pPedometerControlEvent; - /**< Sent by the engine to recommend how pedometer data is sent to the - location engine. - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02. @newpagetable */ - - const qmiLocEventMotionDataControlIndMsgT_v02* pMotionDataControlEvent; - /**< Sent by the engine to recommend how motion data is sent to the - location engine. - The eventIndId field in the event indication callback is set to - QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02. @newpagetable */ - -}locClientEventIndUnionType; - - -/** Response indications that are sent by the service. -*/ -typedef union -{ - const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; - /**< Response to the QMI_LOC_GET_SERVICE_REVISION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ - - const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; - /**< Response to the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ - - const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; - /**< Response to the QMI_LOC_NI_USER_RESPONSE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_NI_USER_RESPONSE_IND_V02. */ - - const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* - pInjectPredictedOrbitsDataInd; - /**< Sent after a predicted orbits data part has been successfully injected. - - The client waits for this indication before injecting the next part. - This indication is sent in response to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* - pGetPredictedOrbitsDataSourceInd; - /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ - - const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* - pGetPredictedOrbitsDataValidityInd; - /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ - - const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; - /**< Response to the QMI_LOC_INJECT_UTC_TIME_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_UTC_TIME_IND_V02. */ - - const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; - /**< Response to the QMI_LOC_INJECT_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_POSITION_IND_V02. */ - - const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; - /**< Response to the QMI_LOC_SET_ENGINE_LOCK_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ - - const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; - /**< Response to the QMI_LOC_GET_ENGINE_LOCK_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ - - const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; - /**< Response to the QMI_LOC_SET_SBAS_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ - - const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; - /**< Response to the QMI_LOC_GET_SBAS_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ - - const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; - /**< Response to the QMI_LOC_SET_NMEA_TYPES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_NMEA_TYPES_IND_V02. */ - - const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; - /**< Response to the QMI_LOC_GET_NMEA_TYPES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NMEA_TYPES_IND_V02. */ - - const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; - /**< Response to the QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; - /**< Response to the QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ - - const qmiLocSetServerIndMsgT_v02* pSetServerInd; - /**< Response to the QMI_LOC_SET_SERVER_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SERVER_IND_V02. */ - - const qmiLocGetServerIndMsgT_v02* pGetServerInd; - /**< Response to the QMI_LOC_GET_SERVER_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SERVER_IND_V02. */ - - const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; - /**< Response to the QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ - - const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; - /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; - /**< Response to the QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ - - const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; - /**< Response to the QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ - - const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; - /**< Response to the QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ - - const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; - /**< Response to the QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ - - const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; - /**< Response to the QMI_LOC_SET_OPERATION_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_OPERATION_MODE_IND_V02. */ - - const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; - /**< Response to the QMI_LOC_GET_OPERATION_MODE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_OPERATION_MODE_IND_V02. */ - - const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; - /**< Response to the QMI_LOC_SET_SPI_STATUS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SPI_STATUS_IND_V02. */ - - const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; - /**< Response to the QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ - - const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; - /**< Response to the QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ - - const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; - /**< Response to the QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ - - const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; - /**< Response to the QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ - - const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; - /**< Response to the QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; - /**< Response to the QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ - - const qmiLocInformLocationServerConnStatusIndMsgT_v02* - pInformLocationServerConnStatusInd; - /**< Response to the QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ - - const qmiLocSetProtocolConfigParametersIndMsgT_v02* - pSetProtocolConfigParametersInd; - /**< Response to the QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetProtocolConfigParametersIndMsgT_v02* - pGetProtocolConfigParametersInd; - /**< Response to the QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; - /**< Response to the QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. - */ - - const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; - /**< Response to the QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. - */ - - const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; - /**< Response to the QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. - */ - - const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; - /**< Response to the QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. - */ - - const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* - pSetSensorPerformanceControlConfigInd; - /**< Response to the - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ - - const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* - pGetSensorPerformanceControlConfigInd; - /**< Response to the - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ - - const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; - /**< Response to the QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. */ - - const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; - /**< Response to the QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. */ - - const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* - pSetPositionEngineConfigParametersInd; - /**< Response to the QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* - pGetPositionEngineConfigParametersInd; - /**< Response to the QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ - - const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; - /**< Response to the QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. */ - - const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; - /**< Response to the QMI_LOC_DELETE_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_DELETE_GEOFENCE_IND_V02. */ - - const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; - /**< Response to the QMI_LOC_QUERY_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_QUERY_GEOFENCE_IND_V02. */ - - const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; - /**< Response to the QMI_LOC_EDIT_GEOFENCE_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_EDIT_GEOFENCE_IND_V02. */ - - const qmiLocGetBestAvailablePositionIndMsgT_v02* - pGetBestAvailablePositionInd; - /**< Response to the QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ - - const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; - /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_MOTION_DATA_IND_V02. */ - - const qmiLocGetNiGeofenceIdListIndMsgT_v02* pGetNiGeofenceIdListInd; - /**< Response to the QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02. */ - - const qmiLocInjectGSMCellInfoIndMsgT_v02* pInjectGSMCellInfoInd; - /**< Response to the QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02. */ - - const qmiLocInjectNetworkInitiatedMessageIndMsgT_v02* - pInjectNetworkInitiatedMessageInd; - - /**< Response to the QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 - request. - - The respIndId field in the response indication callback is set to - QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02. */ - - const qmiLocWWANOutOfServiceNotificationIndMsgT_v02* - pWWANOutOfServiceNotificationInd; - - /**< Response to the QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 - request. - The respIndId field in the response indication callback is set to - QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ - - const qmiLocPedometerReportIndMsgT_v02* pPedometerReportInd; - - /**< Response to the QMI_LOC_PEDOMETER_REPORT_REQ_V02 request. - The respIndId field in the response indication callback is set to - QMI_LOC_PEDOMETER_REPORT_IND_V02. */ - - const qmiLocInjectWCDMACellInfoIndMsgT_v02 *pInjectWCDMACellInfoInd; - const qmiLocInjectTDSCDMACellInfoIndMsgT_v02 *pInjectTDSCDMACellInfoInd; - const qmiLocInjectSubscriberIDIndMsgT_v02 *pInjectSubscriberIDInd; - -}locClientRespIndUnionType; - -/** @} */ /* end_addtogroup data_types */ - -/** @addtogroup callback_functions -@{ */ -/** - Location event indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the asynchronous event indications. - - @datatypes - #locClientHandleType \n - #locClientEventIndUnionType - - @param handle Location client for this event. Only the client who - registered for the corresponding event receives - this callback. - @param eventIndId ID of the event indication. - @param eventIndPayload Event indication payload. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @return - None. - - @dependencies - None. @newpage -*/ -typedef void (*locClientEventIndCbType)( - locClientHandleType handle, - uint32_t eventIndId, - const locClientEventIndUnionType eventIndPayload, - void *pClientCookie -); - -/** - Location response indication callback function type. The Location service can - generate two types of indications: - - - Asynchronous events indications, such as time injection request and satellite - reports. The client specifies the asynchronous events it is interested in - receiving through the event mask (see locClientOpen()). - - Response indications that are generated as a response to a request. For - example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the - indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. - - This callback handles the response indications. - - @datatypes - #locClientHandleType \n - #locClientRespIndUnionType - - @param handle Location client who sent the request for which this - response indication is generated. - @param respIndId ID of the response. It is the same value as the ID - of request sent to the engine. - @param respIndPayload Payload of the response indication. - @param pClientCookie Pointer to the cookie the client specified during - registration. - - @return - None. - - @dependencies - None. @newpage -*/ -typedef void (*locClientRespIndCbType)( - locClientHandleType handle, - uint32_t respIndId, - const locClientRespIndUnionType respIndPayload, - void *pClientCookie -); - -/** - Location error callback function type. This function is called to inform - the client that the service is no longer available. When the client - receives this callback, it must close the existing connection and reopen - the client connection. - - @datatypes - #locClientHandleType \n - #locClientErrorEnumType - - @param handle Location client who sent the request for which this - error indication is generated. - @param errorId Error ID. - @param pClientCookie Payload associated with the error indication. - - @return - None. - - @dependencies - None. -*/ -typedef void (*locClientErrorCbType)( - locClientHandleType handle, - locClientErrorEnumType errorId, - void* pClientCookie - ); -/** @} */ /* end_addtogroup callback_functions */ - - -/** @ingroup data_types - Callback functions to be registered during locClientOpen(). -*/ -typedef struct -{ - uint32_t size; /**< Size of the structure. */ - locClientEventIndCbType eventIndCb; /**< Event indication callback. */ - locClientRespIndCbType respIndCb; /**< Response indication callback. */ - locClientErrorCbType errorCb; /**< Error indication callback. - @newpagetable */ -}locClientCallbacksType; - - -/*=========================================================================== - * - * FUNCTION DECLARATION - * - *==========================================================================*/ -/** @addtogroup operation_functions -@{ */ -/*========================================================================== - locClientOpen */ -/** @xreflabel{hdr:locClientOpenFunction} - Connects a location client to the location engine. If the connection is - successful, this function returns a handle that the location client uses for - future location operations. - - @datatypes - #locClientStatusEnumType \n - #locClientEventMaskType \n - #locClientCallbacksType \n - #locClientHandleType - - @param[in] eventRegMask Mask of asynchronous events the client is - interested in receiving. - @param[in] pLocClientCallbacks Pointer to structure containing the - callbacks. - @param[out] pLocClientHandle Pointer to the handle to be used by the - client for any subsequent requests. - @param[in] pLocClientCookie Pointer to a cookie to be returned to the - client along with the callbacks. - - @return - One of the following error codes: - - eLOC_CLIENT_SUCCESS -- If the connection is opened. - - Non-zero error code (see #locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientOpen ( - locClientEventMaskType eventRegMask, - const locClientCallbacksType* pLocClientCallbacks, - locClientHandleType* pLocClientHandle, - const void* pLocClientCookie -); - - -/*========================================================================== - locClientClose */ -/** @xreflabel{hdr:locClientCloseFunction} - Disconnects a client from the location engine and sets the handle to - LOC_CLIENT_INVALID_HANDLE_VALUE. - - @datatypes - #locClientStatusEnumType \n - #locClientHandleType - - @param[in] pLocClientHandle Pointer to the handle returned by the - locClientOpen() function. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientClose ( - locClientHandleType* pLocClientHandle -); - -/*============================================================================= - locClientSendReq */ -/** @xreflabel{hdr:locClientSendReqFunction} - Sends a message to the location engine. If this function is successful, the - client expects an indication (except start, stop, event registration, and - sensor injection messages) through the registered callback in the - locClientOpen() function. - - The indication contains the status of the request. If the status is a success, - the indication also contains the payload associated with response. - - @datatypes - #locClientStatusEnumType \n - #locClientHandleType \n - #locClientReqUnionType - - @param[in] handle Handle returned by the locClientOpen() function. - @param[in] reqId QMI_LOC service message ID of the request. - @param[in] reqPayload Payload of the request. This can be NULL if the - request has no payload. - - @return - One of the following error codes: - - 0 (eLOC_CLIENT_SUCCESS) -- On success. - - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. - - @dependencies - None. @newpage -*/ -extern locClientStatusEnumType locClientSendReq( - locClientHandleType handle, - uint32_t reqId, - locClientReqUnionType reqPayload -); - - -/*============================================================================= - locClientGetSizeByEventIndId */ -/** Gets the size of the event indication structure from a specified ID. - - @param[in] eventIndId Event indicator ID. - @param[out] pEventIndSize Pointer to the size of the structure. - - @return - TRUE -- The event ID was found. \n - FALSE -- Otherwise. - - @dependencies - None. @newpage -*/ -extern bool locClientGetSizeByEventIndId( - uint32_t eventIndId, - size_t *pEventIndSize); - - -/*============================================================================= - locClientGetSizeByRespIndId */ -/** Gets the size of the response indication structure from a specified ID. - - @param[in] respIndId Response indicator ID. - @param[out] pRespIndSize Pointer to the size of the structure. - - @return - TRUE -- The response ID was found. \n - FALSE -- Otherwise. - - @dependencies - None. -*/ -extern bool locClientGetSizeByRespIndId( - uint32_t respIndId, - size_t *pRespIndSize); - -/*=============================================================================*/ -/** @} */ /* end_addtogroup operation_functions */ - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_V02_CLIENT_H*/ diff --git a/loc_api/loc_api_v02/loc_api_v02_log.c b/loc_api/loc_api_v02/loc_api_v02_log.c deleted file mode 100644 index bcae199c..00000000 --- a/loc_api/loc_api_v02/loc_api_v02_log.c +++ /dev/null @@ -1,295 +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 - -static loc_name_val_s_type loc_v02_event_name[] = -{ - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_START_REQ_V02), - NAME_VAL(QMI_LOC_START_RESP_V02), - NAME_VAL(QMI_LOC_STOP_REQ_V02), - NAME_VAL(QMI_LOC_STOP_RESP_V02), - NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), - NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), - NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), - NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), - NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), - NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), - NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), - NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), - NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), - NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), - NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), - NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), - NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), - NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), - NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), - NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), - NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02), - NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02), - NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), - NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02), - NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02), - NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02), - NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), - NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), - NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02), - NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02), - NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02), - NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02), - NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02), -}; -static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_event_name(uint32_t event) -{ - return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); -} - -static loc_name_val_s_type loc_v02_client_status_name[] = -{ - NAME_VAL(eLOC_CLIENT_SUCCESS), - NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), - NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), - NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), - NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), - NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), - NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), - NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), - NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), - NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY), -}; -static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_client_status_name(locClientStatusEnumType status) -{ - return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); -} - - -static loc_name_val_s_type loc_v02_qmi_status_name[] = -{ - NAME_VAL(eQMI_LOC_SUCCESS_V02), - NAME_VAL(eQMI_LOC_GENERAL_FAILURE_V02), - NAME_VAL(eQMI_LOC_UNSUPPORTED_V02), - NAME_VAL(eQMI_LOC_INVALID_PARAMETER_V02), - NAME_VAL(eQMI_LOC_ENGINE_BUSY_V02), - NAME_VAL(eQMI_LOC_PHONE_OFFLINE_V02), - NAME_VAL(eQMI_LOC_TIMEOUT_V02), - NAME_VAL(eQMI_LOC_CONFIG_NOT_SUPPORTED_V02), - NAME_VAL(eQMI_LOC_INSUFFICIENT_MEMORY_V02), -}; -static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); - -const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) -{ - return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); -} diff --git a/loc_api/loc_api_v02/loc_util_log.h b/loc_api/loc_api_v02/loc_util_log.h deleted file mode 100644 index 7f4e62d2..00000000 --- a/loc_api/loc_api_v02/loc_util_log.h +++ /dev/null @@ -1,75 +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_UTIL_LOG_H -#define LOC_UTIL_LOG_H - -#if defined(_ANDROID_) -#include "loc_api_v02_log.h" -#include - -#else // no _ANDROID_ - -// common for QNX and Griffon - -//error logs -#define LOC_LOGE(...) printf(__VA_ARGS__) -//warning logs -#define LOC_LOGW(...) printf(__VA_ARGS__) -// debug logs -#define LOC_LOGD(...) printf(__VA_ARGS__) -//info logs -#define LOC_LOGI(...) printf(__VA_ARGS__) -//verbose logs -#define LOC_LOGV(...) printf(__VA_ARGS__) - -#define MODEM_LOG_CALLFLOW(SPEC, VAL) -#define EXIT_LOG_CALLFLOW(SPEC, VAL) - -#define loc_get_v02_event_name(X) #X -#define loc_get_v02_client_status_name(X) #X - -#define loc_get_v02_qmi_status_name(X) #X - -//specific to OFF TARGET -#ifdef LOC_UTIL_TARGET_OFF_TARGET - -#include -# include -# include - -// get around strl*: not found in glibc -// TBD:look for presence of eglibc other libraries -// with strlcpy supported. -#define strlcpy(X,Y,Z) strcpy(X,Y) -#define strlcat(X,Y,Z) strcat(X,Y) - -#endif //LOC_UTIL_TARGET_OFF_TARGET - -#endif //_ANDROID_ - -#endif //LOC_UTIL_LOG_H diff --git a/loc_api/loc_api_v02/location_service_v02.c b/loc_api/loc_api_v02/location_service_v02.c deleted file mode 100644 index e883c369..00000000 --- a/loc_api/loc_api_v02/location_service_v02.c +++ /dev/null @@ -1,3346 +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. - */ - -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 6.1 - It requires encode/decode library version 5 or later - It was generated on: Fri Mar 29 2013 (Spin 1) - From IDL File: location_service_v02.idl */ - -#include "stdint.h" -#include "qmi_idl_lib_internal.h" -#include "location_service_v02.h" -#include "common_v01.h" - - -/*Type Definitions*/ -static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), - QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), - QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), - QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDOPStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), - QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), - QMI_LOC_IPV6_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), - 8, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), - 9, 0, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), - 10, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), - QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), - QMI_LOC_NI_SUPL_HASH_LENGTH_V02, - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), - 6, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), - 7, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), - QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), - QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), - QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), - 12, 0, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), - 12, 0, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), - 5, 0, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), - QMI_LOC_MAX_NTP_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), - QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), - 16, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), - - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), - 20, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), - QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), - 29, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), - QMI_LOC_MAX_APN_NAME_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocMotionDataStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), - - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), - - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), - QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), - 36, 0, - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mnc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, cid), - - QMI_IDL_FLAG_END_VALUE -}; - -static const uint8_t qmiLocTDSCDMACellIdStructT_data_v02[] = { - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mcc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mnc), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, cid), - - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, lac), - - QMI_IDL_FLAG_END_VALUE -}; - -/*Message Definitions*/ -static const uint8_t qmiLocGenRespMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), - 0, 1 -}; - -static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) -}; - -static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocStartReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocStopReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x1B, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), - 0x1D, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), - 0x21, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), - 0x24, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), - 0x25, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), - 0x26, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), - 0x27, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), - 0x29, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), - 0x2C, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed_valid)), - 0x2D, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) -}; - -static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), - QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), - 4, 0 -}; - -static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), - QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 -}; - -static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), - 14, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), - 15, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), - 35, 0 -}; - -static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), - 17, 0 -}; - -static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), - 19, 0 -}; - -static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), - - 0x02, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) -}; - -static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) -}; - -static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) -}; - -static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) -}; - -static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), - 21, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), - 21, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), - 21, 0 -}; - -static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) -}; - -static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) -}; - -static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) -}; - -static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) -}; - -static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) -}; - -static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), - 22, 0 -}; - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), - QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), - QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, - QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), - QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 -}; - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), - 0x13, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), - 0, 0 -}; - -static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), - 5, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), - 11, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), - 13, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), - 14, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), - 15, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), - 35, 0 -}; - -static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), - - 0x02, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), - - 0x03, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), - - 0x04, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), - ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), - 0x10, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) -}; - -static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), - 0x10, - QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) -}; - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), - 18, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), - 19, 0 -}; - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), - 23, 0 -}; - -static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) -}; - -static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), - 0x18, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), - 0x1A, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), - 24, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), - 0x1B, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), - 0x1C, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) -}; - -static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) -}; - -/* - * qmiLocGetEngineLockReqMsgT is empty - * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) -}; - -static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) -}; - -static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) -}; - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) -}; - -static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) -}; - -static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) -}; - -static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), - 8, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), - 9, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), - QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 -}; - -static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), - QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), - 25, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), - 0x11, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) -}; - -static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) -}; - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) -}; - -static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), - 26, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), - 27, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), - 0x12, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), - QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), - 28, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) -}; - -static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) -}; - -static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) -}; - -static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) -}; - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) -}; - -static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) -}; - -/* - * qmiLocGetOperationModeReqMsgT is empty - * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) -}; - -static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) -}; - -static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), - 30, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), - 30, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), - 37, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), - 0x16, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), - 37, 0 -}; - -static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted_valid)), - 0x14, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) -}; - -static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) -}; - -static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) -}; - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) -}; - -static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) -}; - -static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), - 0x10, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), - 31, 0 -}; - -static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) -}; - -static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) -}; - -static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion_valid)), - 0x16, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) -}; - -static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) -}; - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) -}; - -static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) -}; - -static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) -}; - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), - 0x11, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), - 0x12, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), - 20, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), - 20, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), - 0x15, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), - 20, 0 -}; - -static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), - ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) -}; - -static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) -}; - -static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) -}; - -static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) -}; - -static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), - 0x12, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF_valid)), - 0x13, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) -}; - -static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), - - 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), - 32, 0, - - 0x03, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), - - 0x04, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) -}; - -static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) -}; - -static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), - 0x14, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), - 32, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) -}; - -static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), - 0x11, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) -}; - -static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) -}; - -static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), - 0x12, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), - 0x13, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), - 0x14, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), - 0x15, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), - 0x16, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), - 0x17, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), - 0x18, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), - 0x19, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), - 0x1A, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), - 0x1B, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), - 0x1C, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), - 0x1D, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), - 0x1E, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), - 0x1F, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), - 0x20, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), - 0x21, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), - 0x22, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), - 0x23, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), - 0x24, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), - 0x25, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), - 0x26, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), - 0x27, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), - 0x28, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), - 0x29, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), - 2, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), - 0x2A, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), - 1, 0, - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), - 0x2B, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), - 0x2C, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), - 3, 0, - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), - 0x2D, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) -}; - -static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - 33, 0 -}; - -static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) -}; - -static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), - QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) -}; - -static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - 34, 0, - - 0x02, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) -}; - -static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), - ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) -}; - -static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) -}; - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { - * }; - */ - -static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) -}; - -static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) -}; - -static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) -}; - -static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), - - 0x03, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), - - 0x04, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), - 0x10, - QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), - 0x12, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) -}; - -static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), - 38, 0, - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc_valid)), - 0x11, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) -}; - -static const uint8_t qmiLocInjectWCDMACellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), - 39, 0, - - 0x02, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, roamingStatus), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq_valid)), - 0x10, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) -}; - -static const uint8_t qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectSubscriberIDReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI_valid)), - 0x10, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN_valid)), - 0x11, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) -}; - -static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) -}; - -/* Type Table */ -static const qmi_idl_type_table_entry loc_type_table_v02[] = { - {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, - {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, - {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, - {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, - {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, - {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, - {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, - {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, - {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, - {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, - {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, - {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, - {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, - {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, - {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, - {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, - {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, - {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, - {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, - {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, - {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, - {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, - {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, - {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, - {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, - {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, - {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, - {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, - {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, - {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, - {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, - {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, - {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, - {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02} -}; - -/* Message Table */ -static const qmi_idl_message_table_entry loc_message_table_v02[] = { - {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, - {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, - {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, - {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, - {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, - {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, - {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, - {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, - {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, - {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, - {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, - {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, - {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, - {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, - {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, - {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, - {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, - {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, - {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, - {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, - {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, - {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, - {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, - {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, - {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, - {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, - {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, - {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, - {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, - {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, - {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, - {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, - {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, - {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, - {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, - {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, - {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, - {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, - {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, - {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, - {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, - {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, - {0, 0}, - {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, - {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, - {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, - {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, - {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02}, - {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, - {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, - {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02} -}; - -/* Predefine the Type Table Object */ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; - -/*Referenced Tables Array*/ -static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = -{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; - -/*Type Table Object*/ -static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { - sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), - sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), - 1, - loc_type_table_v02, - loc_message_table_v02, - loc_qmi_idl_type_table_object_referenced_tables_v02 -}; - -/*Arrays of service_message_table_entries for commands, responses and indications*/ -static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { - {QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02, QMI_IDL_TYPE16(1, 0), 0}, - {QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02, QMI_IDL_TYPE16(1, 2), 5}, - {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, - {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, - {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 103}, - {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 22), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 24), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 26), 1345}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 28), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 30), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 32), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 34), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 36), 112}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 38), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 40), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 42), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 44), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 46), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 48), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 50), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 52), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 54), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 56), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 58), 929}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 60), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 62), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 64), 694}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 66), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 68), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 70), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 72), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 74), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 76), 2063}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 78), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 82), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 80), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 88), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 90), 53}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 92), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 94), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 96), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 98), 35}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 100), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 102), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 104), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 106), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 108), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 110), 16}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 112), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 114), 52}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 116), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 25}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 122), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 124), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 126), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 128), 30}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 130), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 132), 0}, - {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 136), 46}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 138), 36}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 140), 33}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 142), 22} -}; - -static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { - {QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02, QMI_IDL_TYPE16(1, 1), 8204}, - {QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02, QMI_IDL_TYPE16(1, 3), 115}, - {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_STOP_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_NI_USER_RESPONSE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_UTC_TIME_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SPI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_DELETE_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_QUERY_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_EDIT_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_PEDOMETER_REPORT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} -}; - -static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { - {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 392}, - {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, - {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, - {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, - {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, QMI_IDL_TYPE16(0, 9), 776}, - {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, QMI_IDL_TYPE16(0, 10), 783}, - {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, QMI_IDL_TYPE16(0, 11), 40}, - {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, QMI_IDL_TYPE16(0, 12), 7}, - {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, QMI_IDL_TYPE16(0, 13), 11}, - {QMI_LOC_EVENT_WIFI_REQ_IND_V02, QMI_IDL_TYPE16(0, 14), 12}, - {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 15), 32}, - {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, - {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, - {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 23), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 25), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 27), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 29), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 31), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 33), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 35), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 37), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 41), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 43), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 45), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 47), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 49), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 51), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 53), 11}, - {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 55), 7}, - {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 57), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 59), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 63), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 65), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 69), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 71), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 73), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 75), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 77), 30}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 79), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 83), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 81), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 91), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 93), 60}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 95), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 97), 14}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 99), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 101), 42}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 103), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 105), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 107), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 109), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 111), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 113), 23}, - {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, - {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, - {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 78}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 115), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 117), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 119), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 123), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 125), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 127), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 129), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 131), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, - {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 134), 15}, - {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 135), 4}, - {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 137), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 143), 7} -}; - -/*Service Object*/ -struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { - 0x05, - 0x02, - 0x10, - 8204, - { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), - sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, - { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, - &loc_qmi_idl_type_table_object_v02, - 0x14, - NULL -}; - -/* Service Object Accessor */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ - if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version - || LOC_V02_IDL_TOOL_VERS != library_version) - { - return NULL; - } - return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; -} diff --git a/loc_api/loc_api_v02/location_service_v02.h b/loc_api/loc_api_v02/location_service_v02.h deleted file mode 100644 index e6665c0d..00000000 --- a/loc_api/loc_api_v02/location_service_v02.h +++ /dev/null @@ -1,8862 +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_SERVICE_H -#define LOC_SERVICE_H -/** - @file location_service_v02.h - - @brief This is the public header file which defines the loc service Data structures. - - This header file defines the types and structures that were defined in - loc. It contains the constant values defined, enums, structures, - messages, and service message IDs (in that order) Structures that were - defined in the IDL as messages contain mandatory elements, optional - elements, a combination of mandatory and optional elements (mandatory - always come before optionals in the structure), or nothing (null message) - - An optional element in a message is preceded by a uint8_t value that must be - set to true if the element is going to be included. When decoding a received - message, the uint8_t values will be set to true or false by the decode - routine, and should be checked before accessing the values that they - correspond to. - - Variable sized arrays are defined as static sized arrays with an unsigned - integer (32 bit) preceding it that must be set to the number of elements - in the array that are valid. For Example: - - uint32_t test_opaque_len; - uint8_t test_opaque[16]; - - If only 4 elements are added to test_opaque[] then test_opaque_len must be - set to 4 before sending the message. When decoding, the _len value is set - by the decode routine and should be checked so that the correct number of - elements in the array will be accessed. - -*/ - -/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* - *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY - *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ - -/* This file was generated with Tool version 6.1 - It requires encode/decode library version 5 or later - It was generated on: Fri Mar 29 2013 (Spin 1) - From IDL File: location_service_v02.idl */ - -/** @defgroup loc_qmi_consts Constant values defined in the IDL */ -/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ -/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ -/** @defgroup loc_qmi_messages Structures sent as QMI messages */ -/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ -/** @defgroup loc_qmi_accessor Accessor for QMI service object */ -/** @defgroup loc_qmi_version Constant values for versioning information */ - -#include -#include "qmi_idl_lib.h" -#include "common_v01.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup loc_qmi_version - @{ - */ -/** Major Version Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MAJOR_VERS 0x02 -/** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x14 -/** Major Version Number of the qmi_idl_compiler used to generate this file */ -#define LOC_V02_IDL_TOOL_VERS 0x06 -/** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x0072; -/** - @} - */ - - -/** @addtogroup loc_qmi_consts - @{ - */ - -/** Maximum string length for the Provider field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 - -/** Maximum string length for the Name field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 - -/** Maximum string length for the Version field in the application ID. */ -#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 - -/** Maximum length of the list containing the SVs that were used to generate - a position report. */ -#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 - -/** Maximum number of satellites in the satellite report. */ -#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 - -/** Maximum NMEA string length. */ -#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 - -/** Maximum length of the requestor ID string. */ -#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 - -/** Session ID byte length. */ -#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 - -/** Maximum client name length allowed. */ -#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 - -/** Maximum URL length accepted by the location engine. */ -#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 - -/** IPV6 address length in bytes. */ -#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 - -/** SUPL hash length. */ -#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 - -/** Maximum client address length allowed. */ -#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 - -/** Maximum codeword length allowed. */ -#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 - -/** Maximum number of NTP Servers sent out with this event. */ -#define QMI_LOC_MAX_NTP_SERVERS_V02 3 - -/** Maximum number of predicted orbits servers supported in the location - engine. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 - -/** Maximum GNSS Measurement Engine Firmware Version String length. */ -#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ -#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 - -/** Maximum GNSS Measurement Engine Full Version String length. */ -#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 - -/** Maximum part length that can be injected. The client should - also look at the maxPartSize field in the predicted orbits injection - request indication and pick the minimum of the two. */ -#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 - -/** Maximum length of the delete SV information list */ -#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 - -/** MAC address length in bytes. */ -#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 - -/** Maximum number of APs that the sender can report. */ -#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 - -/** Maximum number of samples that can be injected in a TLV. */ -#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 - -/** Maximum APN string length allowed. */ -#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 - -/** Maximum APN profiles supported. */ -#define QMI_LOC_MAX_APN_PROFILES_V02 6 - -/** Maximum length of the SUPL certificate. */ -#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 - -/** Maximum length of the network-initiated Geofence ID - list. */ -#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 - -/** Maximum value of WDMA frequency for injection of WCDMA cell - information. */ -#define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 - -/** Maximum value of PSC for injection of WCDMA cell information. */ -#define QMI_LOC_MAX_WCDMA_PSC_V02 511 - -/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell - information. */ -#define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 - -/** Maximum length of the injected network-initiated message. */ -#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Response Message; Generic response definition. This message is used to tell - clients whether their message was accepted for further - processing or rejected. */ -typedef struct { - - /* Mandatory */ - /* Result Code */ - qmi_response_type_v01 resp; -}qmiLocGenRespMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Informs the service of the minor revision of the interface - definition that the control point implements. */ -typedef struct { - - /* Mandatory */ - /* Revision */ - uint32_t revision; - /**< Revision that the control point is using. */ -}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocEventRegMaskT_v02; -#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report - event indications. */ -#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. */ -#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI Notify/Verify request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request - event indications. */ -#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request - event indications. */ -#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report - event indications. */ -#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report - event indications. */ -#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive WiFi position request - event indications. */ -#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). */ -#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. */ -#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. */ -#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. */ -#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. */ -#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. */ -#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for pedometer - control requests from the location engine. The location engine sends - this event to control the injection of pedometer reports. */ -#define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data - control requests from the location engine. The location engine sends - this event to control the injection of motion data. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to register for events from the - location subsystem. */ -typedef struct { - - /* Mandatory */ - /* Event Registration Mask */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Specifies the events that the control point is interested in receiving. - Valid bitmasks: - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. - - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. - - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. - - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. - - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. - - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. - - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. - - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer - control requests from the location engine. The location engine sends - this event to control the injection of pedometer reports. - - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. The location engine sends - this event to control the injection of motion data. - - Multiple events can be registered by ORing the individual masks and - sending them in this TLV. All unused bits in this mask must be set to 0. - */ -}qmiLocRegEventsReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes. */ - eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix. */ - QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixRecurrenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy. */ - eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy. */ - eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy. */ - QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAccuracyLevelEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on. */ - eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off. */ - QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocIntermediateReportStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; - /**< Application provider. */ - - char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; - /**< Application name. */ - - uint8_t applicationVersion_valid; - /**< Specifies whether the application version string contains - a valid value: \begin{itemize1} - \item 0x00 (FALSE) -- Application version string is invalid - \item 0x01 (TRUE) -- Application version string is valid - \vspace{-0.18in} \end{itemize1} */ - - char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; - /**< Application version. */ -}qmiLocApplicationIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to initiate a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session as identified by the control point. The session ID - is reported back in the position reports. The control point must - specify the same session ID in the QMI_LOC_STOP_REQ message. \n - - Range: 0 to 255 - */ - - /* Optional */ - /* Recurrence Type */ - uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ - qmiLocFixRecurrenceEnumT_v02 fixRecurrence; - /**< Specifies the type of session in which the control point is interested. - If this TLV is not specified, recurrence defaults to SINGLE. - - Valid values: \n - - 0x00000001 -- Request periodic fixes \n - - 0x00000002 -- Request a single fix - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Specifies the horizontal accuracy level required by the control point. - If not specified, accuracy defaults to LOW. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Reports */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Specifies if the control point is interested in receiving intermediate - reports. The control point must explicitly set this field to OFF if it - does not wish to receive intermediate position reports. Intermediate - position reports are generated at 1 Hz and are ON by default. If - intermediate reports are turned ON, the client receives position reports - even if the accuracy criteria are not met. The status in such a position - report is set to IN_PROGRESS in order for the control point to identify - intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} - \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Position Reports */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Minimum time interval, specified by the control point, that must elapse between - position reports. \n - - Units: Milliseconds \n - - Default: 1000 ms - */ - - /* Optional */ - /* ID of the Application that Sent this Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \n Application provider, name, and version.*/ -}qmiLocStartReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to stop a GPS session. */ -typedef struct { - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - (QMI_LOC_START_REQ).\n - - Range: 0 to 255 */ -}qmiLocStopReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPosTechMaskT_v02; -#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< WiFi access points were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to - generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_AFLT_V02 ((qmiLocPosTechMaskT_v02)0x00000040) /**< AFLT was used to generate the fix. */ -#define QMI_LOC_POS_TECH_MASK_HYBRID_V02 ((qmiLocPosTechMaskT_v02)0x00000080) /**< GNSS and network-provided measurements were used to - generate the fix. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful. */ - eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 1, /**< Session still in progress. Further position reports will be - generated until either the fix criteria specified by the client - are met or the client response timeout occurs. */ - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE_V02 = 2, /**< Session failed. */ - eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out. */ - eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user. */ - eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request. */ - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline. */ - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked. */ - QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSessionStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gpsWeek; - /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n - - Units: Weeks */ - - uint32_t gpsTimeOfWeekMs; - /**< Amount of time into the current GPS week. \n - - Units: Milliseconds */ -}qmiLocGPSTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - float PDOP; - /**< Position dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \item PDOP = square root of (HDOP^2 + VDOP^2) - \vspace{-0.18in} \end{itemize1} */ - - float HDOP; - /**< Horizontal dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ - - float VDOP; - /**< Vertical dilution of precision. - \begin{itemize1} - \item Range: 1 (highest accuracy) to 50 (lowest accuracy) - \vspace{-0.18in} \end{itemize1} */ -}qmiLocDOPStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocSensorUsageMaskT_v02; -#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ -#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ -typedef uint32_t qmiLocSensorAidedMaskT_v02; -#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ -#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ -#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ -#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorUsageMaskT_v02 usageMask; - /**< Specifies which sensors were used in calculating the position in the - position report. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SENSOR_USED_ ACCEL - \item 0x00000002 -- SENSOR_USED_ GYRO - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; - /**< Specifies which results were aided by sensors. - - Valid bitmasks: \n - - 0x00000001 -- AIDED_HEADING \n - - 0x00000002 -- AIDED_SPEED \n - - 0x00000004 -- AIDED_POSITION \n - - 0x00000008 -- AIDED_VELOCITY */ -}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1x system. */ - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). */ - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection. */ - eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. */ - eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data - from multiple satellites. */ - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known. */ - eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained. */ - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. */ - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ - eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ - eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 14, /**< Time is derived from the system clock (better known as the slow clock); - GNSS time is maintained irrespective of the GNSS receiver state */ - QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ - eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ - eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ - eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ - eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ - QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocReliabilityEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the position report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session Status */ - qmiLocSessionStatusEnumT_v02 sessionStatus; - /**< Session status. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SESS_STATUS_ SUCCESS - \item 0x00000001 -- SESS_STATUS_ IN_PROGRESS - \item 0x00000002 -- SESS_STATUS_ GENERAL_FAILURE - \item 0x00000003 -- SESS_STATUS_ TIMEOUT - \item 0x00000004 -- SESS_STATUS_ USER_END - \item 0x00000005 -- SESS_STATUS_ BAD_PARAMETER - \item 0x00000006 -- SESS_STATUS_ PHONE_OFFLINE - \item 0x00000007 -- SESS_STATUS_ ENGINE_LOCKED - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Session ID */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request - QMI_LOC_START_REQ. \n - - Range: 0 to 255 */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Elliptical Horizontal Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Speed Uncertainty */ - uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ - float speedUnc; - /**< 3-D Speed uncertainty.\n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. \n - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - Valid bitmasks: \n - - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- WiFi access points were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix. - - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to - generate the fix. - - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix. - - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to - generate the fix. - */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - /**< \vspace{0.06in} \n Dilution of precision associated with this position. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds since Jan. 1, 1970 */ - - /* Optional */ - /* Leap Seconds */ - uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ - uint8_t leapSeconds; - /**< Leap second information. If leapSeconds is not available, - timestampUtc is calculated based on a hard-coded value - for leap seconds. \n - - Units: Seconds */ - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - /**< \vspace{0.06in} \n The number of weeks since Jan. 5, 1980, and - milliseconds into the current week. */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from the system clock (better known as the slow clock); - GNSS time is maintained irrespective of the GNSS receiver state */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - /**< \vspace{0.06in} \n Indicates whether sensor data was used in computing the position in this - position report. */ - - /* Optional */ - /* Fix Count for This Session */ - uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ - uint32_t fixId; - /**< Fix count for the session. Starts with 0 and increments by one - for each successive position report for a particular session. */ - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Altitude Assumed */ - uint8_t altitudeAssumed_valid; /**< Must be set to true if altitudeAssumed is being passed */ - uint8_t altitudeAssumed; - /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} - \item 0x00 (FALSE) -- Altitude is calculated - \item 0x01 (TRUE) -- Altitude is assumed; there may not be enough - satellites to determine the precise altitude - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventPositionReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite. */ - eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite. */ - eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite. */ - eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite. */ - eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite. */ - QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvSystemEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed. */ - eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV. */ - eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked. */ - QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSvStatusEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSvInfoValidMaskT_v02; -#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information. */ -#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information. */ -typedef uint8_t qmiLocSvInfoMaskT_v02; -#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV. */ -#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSvInfoValidMaskT_v02 validMask; - /**< Bitmask indicating which of the fields in this TLV are valid. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- VALID_SYSTEM - \item 0x00000002 -- VALID_GNSS_SVID - \item 0x00000004 -- VALID_HEALTH_ STATUS - \item 0x00000008 -- VALID_PROCESS_ STATUS - \item 0x00000010 -- VALID_SVINFO_ MASK - \item 0x00000020 -- VALID_ELEVATION - \item 0x00000040 -- VALID_AZIMUTH - \item 0x00000080 -- VALID_SNR - \vspace{-0.18in} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} */ - - uint16_t gnssSvId; - /**< GNSS SV ID. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For GLONASS: 1 to 32 - \item For SBAS: 120 to 151 - \end{itemize1} \end{itemize1} - - The GPS and GLONASS SVs can be disambiguated using the system field. */ - - uint8_t healthStatus; - /**< Health status. - \begin{itemize1} - \item Range: 0 to 1; 0 = unhealthy, \newline 1 = healthy - \vspace{-0.18in} \end{itemize1}*/ - - qmiLocSvStatusEnumT_v02 svStatus; - /**< SV processing status. \n - Valid values:\n - - 0x00000001 -- SV_STATUS_IDLE \n - - 0x00000002 -- SV_STATUS_SEARCH \n - - 0x00000003 -- SV_STATUS_TRACK - */ - - qmiLocSvInfoMaskT_v02 svInfoMask; - /**< Indicates whether almanac and ephemeris information is available. \n - Valid bitmasks: \n - - 0x01 -- SVINFO_HAS_EPHEMERIS \n - - 0x02 -- SVINFO_HAS_ALMANAC - */ - - float elevation; - /**< SV elevation angle.\n - - Units: Degrees \n - - Range: 0 to 90 */ - - float azimuth; - /**< SV azimuth angle.\n - - Units: Degrees \n - - Range: 0 to 360 */ - - float snr; - /**< SV signal-to-noise ratio. \n - - Units: dB-Hz */ -}qmiLocSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a satellite report to the control point. */ -typedef struct { - - /* Mandatory */ - /* Altitude Assumed */ - uint8_t altitudeAssumed; - /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} - \item 0x00 (FALSE) -- Valid altitude is calculated - \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be - enough satellites to determine precise altitude - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Satellite Info */ - uint8_t svList_valid; /**< Must be set to true if svList is being passed */ - uint32_t svList_len; /**< Must be set to # of elements in svList */ - qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; - /**< \vspace{0.06in} \n SV information list. */ -}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends NMEA sentences to the control point */ -typedef struct { - - /* Mandatory */ - /* NMEA String */ - char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; - /**< NMEA string. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 201 - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventNmeaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response. */ - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and Verify, and require a response. */ - QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiNotifyVerifyEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed. */ - eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed. */ - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed. */ - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed. */ - QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxPosModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is OCTET. */ - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN PROTOCOL MSG. */ - eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII. */ - eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5. */ - eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is UNICODE. */ - eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is SHIFT JIS. */ - eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is KOREAN. */ - eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is LATIN HEBREW. */ - eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is LATIN. */ - eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM. */ - QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t posQosIncl; - /**< Indicates whether quality of service is included:\n - - 0x01 (TRUE) -- QoS is included \n - - 0x00 (FALSE) -- QoS is not included */ - - uint8_t posQos; - /**< Position QoS timeout. \n - - Units: Seconds \n - - Range: 0 to 255 */ - - uint32_t numFixes; - /**< Number of fixes allowed. */ - - uint32_t timeBetweenFixes; - /**< Time between fixes.\n - - Units: Seconds */ - - qmiLocNiVxPosModeEnumT_v02 posMode; - /**< Position mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_VX_MS_ ASSISTED_ONLY - \item 0x00000002 -- NI_VX_MS_BASED_ ONLY - \item 0x00000003 -- NI_VX_MS_ ASSISTED_PREFERRED_ MS_BASED_ALLOWED - \item 0x00000004 -- NI_VX_MS_ BASED_PREFERRED_ MS_ASSISTED_ALLOWED - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; - /**< VX encoding scheme. - - Valid values: \begin{itemize1} - \item 0x00000000 -- NI_VX_OCTET - \item 0x00000001 -- NI_VX_EXN_ PROTOCOL_MSG - \item 0x00000002 -- NI_VX_ASCII - \item 0x00000003 -- NI_VX_IA5 - \item 0x00000004 -- NI_VX_UNICODE - \item 0x00000005 -- NI_VX_SHIFT_JIS - \item 0x00000006 -- NI_VX_KOREAN - \item 0x00000007 -- NI_VX_LATIN_ HEBREW - \item 0x00000008 -- NI_VX_LATIN - \item 0x00000009 -- NI_VX_GSM - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ - uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; - /**< Requestor ID. \n - - Type: Array of bytes \n - - Maximum array length: 200 - */ - - uint16_t userRespTimerInSeconds; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS. */ - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration. */ - eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID. */ - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference. */ - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival. */ - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position. */ - QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplPosMethodEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German. */ - eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English. */ - eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian. */ - eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French. */ - eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish. */ - eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch. */ - eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish. */ - eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish. */ - eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese. */ - eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish. */ - eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian. */ - eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek. */ - eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish. */ - eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian. */ - eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish. */ - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified. */ - eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8. */ - eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2. */ - eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default. */ - QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiDataCodingSchemeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format. */ - eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL logical name format. */ - eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format. */ - eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format. */ - eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format. */ - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format. */ - QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplFormatEnumType_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplFormatEnumType_v02 formatType; - /**< Format of the formatted string. - - Valid values: \begin{itemize1} - \item 0x00000000 -- FORMAT_LOGICAL_ NAME - \item 0x00000001 -- FORMAT_EMAIL_ ADDRESS - \item 0x00000002 -- FORMAT_MSISDN - \item 0x00000003 -- FORMAT_URL - \item 0x00000004 -- FORMAT_SIP_URL - \item 0x00000005 -- FORMAT_MIN - \item 0x00000006 -- FORMAT_MDN - \item 0x00000007 -- FORMAT_ IMSPUBLIC_IDENTITY - \item 0x7FFFFFFF -- FORMAT_OSS_ UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ - uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Formatted string. \n - - Type: Byte array \n - - Maximum string length: 64 - */ -}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocSuplQopValidMaskT_v02; -#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP). */ -#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP. */ -#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSuplQopValidMaskT_v02 validMask; - /**< Bit field indicating which fields are valid in this value. - - Valid bitmasks: \n - - 0x01 -- QOP_HORZ_ACC_VALID \n - - 0x02 -- QOP_VER_ACC_VALID \n - - 0x04 -- QOP_MAXAGE_VALID \n - - 0x08 -- QOP_DELAY_VALID*/ - - uint8_t horizontalAccuracy; - /**< Horizontal accuracy. \n - - Units: Meters */ - - uint8_t verticalAccuracy; - /**< Vertical accuracy. \n - - Units: Meters */ - - uint16_t maxLocAge; - /**< Maximum age of the location if the engine sends a previously - computed position. \n - - Units: Seconds */ - - uint8_t delay; - /**< Delay the server is willing to tolerate for the fix. \n - - Units: Seconds */ -}qmiLocNiSuplQopStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocServerAddrTypeMaskT_v02; -#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPV4 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPV6 server address type. */ -#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t addr; - /**< IPV4 address. */ - - uint16_t port; - /**< IPV4 port. */ -}qmiLocIpV4AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; - /**< IPV6 address. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 8 */ - - uint32_t port; - /**< IPV6 port. */ -}qmiLocIpV6AddrStructType_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; - /**< Mask specifying the valid fields in this value. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ - - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< IPV4 address and port. */ - - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< IPV6 address and port. */ - - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiSuplServerInfoStructT_v02; /* Type */ -/** - @} - */ - -typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; -#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information - is present in an NI SUPL Notify/Verify request event. This mask is set in - the valid_flags field of a Notify/Verify structure. */ -#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID - is present in an NI SUPL Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present - in an NI Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present - in an NI SUPL Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme - is present in an NI SUPL Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID - is present in an NI Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID - is present in an NI Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position - is present in an NI Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer - is present in an NI Notify/Verify request event. - This mask is set in the valid_flags field of a - Notify/Verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; - /**< Indicates which of the following fields are present in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- SUPL_SERVER_INFO - \item 0x00000002 -- SUPL_SESSION_ID - \item 0x00000004 -- SUPL_HASH - \item 0x00000008 -- SUPL_POS_METHOD - \item 0x00000010 -- SUPL_DATA_ CODING_SCHEME - \item 0x00000020 -- SUPL_REQUESTOR_ ID - \item 0x00000040 -- SUPL_CLIENT_ NAME - \item 0x00000080 -- SUPL_QOP - \item 0x00000100 -- SUPL_USER_RESP_ TIMER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; - /**< SUPL server information. */ - - uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; - /**< SUPL session ID. \n - - Type: Array of unsigned integers \n - - Maximum length of the array: 4 */ - - uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; - /**< Hash for SUPL_INIT; used to validate that the message was not - corrupted. \n - - Type: Array of unsigned integers \n - - Length of the array: 8 */ - - qmiLocNiSuplPosMethodEnumT_v02 posMethod; - /**< GPS mode to be used for the fix. - - Valid values: \begin{itemize1} - \item 0x00000001 -- AGPS_SETASSISTED - \item 0x00000002 -- AGPS_SETBASED - \item 0x00000003 -- AGPS_ SETASSISTED_PREF - \item 0x00000004 -- AGPS_SETBASED_ PREF - \item 0x00000005 -- AUTONOMOUS_GPS - \item 0x00000006 -- AFLT - \item 0x00000007 -- ECID - \item 0x00000008 -- EOTD - \item 0x00000009 -- OTDOA - \item 0x0000000A -- NO_POSITION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Data coding scheme applies to both the requestor ID and the client - name. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplFormattedStringStructT_v02 requestorId; - /**< Requestor ID. The encoding scheme for requestor_id is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplFormattedStringStructT_v02 clientName; - /**< Client name. The encoding scheme for client_name is specified in - the dataCodingScheme field. */ - - qmiLocNiSuplQopStructT_v02 suplQop; - /**< SUPL QoP. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds*/ -}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location. */ - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be current location. */ - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location. */ - QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiLocationTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Identifies the coding scheme of the coded string. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - - */ - - uint32_t codedString_len; /**< Must be set to # of elements in codedString */ - uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; - /**< Coded string. \n - - Type: Array of bytes \n - - Maximum string length: 20 */ -}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; -#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer - is present in an NI Notify/Verify request event. - This mask is set in the valid flags field of a - Notify/Verify structure. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; - /**< Fields that are valid in this value. - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- INVOKE_ID_MASK - \item 0x0002 -- DATA_CODING_ SCHEME_MASK - \item 0x0004 -- NOTIFICATION_TEXT_ MASK - \item 0x0008 -- CLIENT_ADDRESS_ MASK - \item 0x0010 -- LOCATION_TYPE_ MASK - \item 0x0020 -- REQUESTOR_ID_MASK - \item 0x0040 -- CODEWORD_STRING_ MASK - \item 0x0080 -- SERVICE_TYPE_MASK - \item 0x0100 -- USER_RESP_TIMER_ MASK - \vspace{-0.18in} \end{itemize1} - */ - - uint8_t invokeId; - /**< Supplementary Services invoke ID. */ - - qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; - /**< Type of data encoding scheme for the text. - Applies to both the notification text and the client address. - - Valid values: \begin{itemize1} - \item 0x0000000C -- NI_SS_GERMAN - \item 0x0000000D -- NI_SS_ENGLISH - \item 0x0000000E -- NI_SS_ITALIAN - \item 0x0000000F -- NI_SS_FRENCH - \item 0x00000010 -- NI_SS_SPANISH - \item 0x00000011 -- NI_SS_DUTCH - \item 0x00000012 -- NI_SS_SWEDISH - \item 0x00000013 -- NI_SS_DANISH - \item 0x00000014 -- NI_SS_PORTUGUESE - \item 0x00000015 -- NI_SS_FINNISH - \item 0x00000016 -- NI_SS_NORWEGIAN - \item 0x00000017 -- NI_SS_GREEK - \item 0x00000018 -- NI_SS_TURKISH - \item 0x00000019 -- NI_SS_HUNGARIAN - \item 0x0000001A -- NI_SS_POLISH - \item 0x0000001B -- NI_SS_LANGUAGE_ UNSPEC - \item 0x0000001C -- NI_SUPL_UTF8 - \item 0x0000001D -- NI_SUPL_UCS2 - \item 0x0000001E -- NI_SUPL_GSM_ DEFAULT - \vspace{-0.18in} \end{itemize1} - */ - - uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ - uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; - /**< Notification text; the encoding method is specified in - dataCodingScheme. \n - - Type: Array of bytes \n - - Maximum array length: 64 */ - - uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ - uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; - /**< Client address; the encoding method is specified in - dataCodingScheme. \n - - Maximum array length: 20 */ - - qmiLocNiLocationTypeEnumT_v02 locationType; - /**< Location type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- CURRENT_ LOCATION - \item 0x00000002 -- CURRENT_OR_ LAST_KNOWN_LOCATION - \item 0x00000004 -- INITIAL_LOCATION - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; - /**< Requestor ID; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; - /**< Codeword string; the encoding method is specified in the - qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ - - uint8_t lcsServiceTypeId; - /**< Service type ID. */ - - uint16_t userResponseTimer; - /**< Time to wait for the user to respond. \n - - Units: Seconds */ -}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ - QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiServiceInteractionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; - /**< Ongoing NI session request; this information is currently not filled. */ - - qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; - /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ONGOING_NI_ INCOMING_MO - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID - and multiple location IDs in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID - and multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of - multiple location ID in the SUPL_POS_INIT message. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed - as part of multiple location ID in the SUPL_POS_INIT message. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< The SUPL INIT message indicates a request for a single shot - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< The SUPL INIT message indicates a request for a periodic - triggered session. */ - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< The SUPL INIT message indicates a request for an area event - triggered session. */ - QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; -/** - @} - */ - -typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology. */ -#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; - /**< Specifies which type of network measurements are allowed to be sent as - part of the Location ID or Multiple Location IDs parameter in the - SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). - - Valid bitmasks: \begin{itemize1} - \item 0x0001 -- SUPPORTED_NETWORK_ WLAN - \item 0x0002 -- SUPPORTED_NETWORK_ GSM - \item 0x0004 -- SUPPORTED_NETWORK_ WCDMA - \item 0x0008 -- SUPPORTED_NETWORK_ CDMA - \item 0x0010 -- SUPPORTED_NETWORK_ HRDP - \item 0x0020 -- SUPPORTED_NETWORK_ UMB - \item 0x0040 -- SUPPORTED_NETWORK_ LTE - \item 0x0080 -- SUPPORTED_NETWORK_ WIMAX - \item 0x0100 -- SUPPORTED_NETWORK_ HISTORIC - \item 0x0200 -- SUPPORTED_NETWORK_ NONSVRV - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; - /**< Specifies the type of session trigger requested in the - SUPL_POS_INIT message (refer to \hyperref[S4]{[S4]}). - - Valid values: \begin{itemize1} - \item 0xFFFFFFFF -- TRIGGER_TYPE_ SINGLE_SHOT - \item 0x00000000 -- TRIGGER_TYPE_ PERIODIC - \item 0x00000001 -- TRIGGER_TYPE_ AREA_EVENT - \vspace{-0.18in} \end{itemize1} */ - - qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; - /**< Specifies which GNSS technologies are allowed as positioning - technologies. - - Valid bitmasks: \n - - 0x0001 -- GNSS_GPS \n - - 0x0002 -- GNSS_GLONASS \n - - 0x0004 -- GNSS_GALILEO \n - - 0x0008 -- GNSS_SBAS \n - - 0x0010 -- GNSS_QZSS \n - - 0x0020 -- GNSS_MODERN_GPS - */ -}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< ESLP URL. \n - Maximum length: 255 bytes */ -}qmiLocEmergencyNotificationStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Indicates an NI Notify/Verify request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_ VERIFY - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_ RESP - \item 0x00000005 -- PRIVACY_ OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; - /**< \vspace{0.06in} \n Optional NI Vx request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; - /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; - /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; - /**< \vspace{0.06in} \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; - /**< \vspace{0.06in} \n Optional NI SUPL Version 2 Extension payload. When present, - this payload is to be used in conjunction with the SUPL - indication payload. */ - - /* Optional */ - /* SUPL Emergency Notification */ - uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ - qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< \vspace{0.06in} \n This specifies that the corresponding NI notification is an - emergency notification. Emergency notification - can be given even without an Emergency SUPL Location Platform (ESLP) - address. */ -}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< Assistance server URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAssistanceServerUrlStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t delayThreshold; - /**< The time server is to be skipped if a one-way delay to the server - exceeds this threshold. \n - - Units: Milliseconds */ - - uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ - qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; - /**< List of Time Server URL's that are recommended by the service for time - information, the list is ordered, the client is to use the first - server specified in the list as the primary URL to fetch NTP time, - the second one as secondary, and so on. \n - - Maximum server list items: 3 */ -}qmiLocTimeServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject time information. */ -typedef struct { - - /* Optional */ - /* Time Server Info */ - uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ - qmiLocTimeServerListStructT_v02 timeServerInfo; - /**< \vspace{0.06in} \n Contains information about the time servers recommended by the - location service for NTP time. */ -}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t maxFileSizeInBytes; - /**< Maximum allowable predicted orbits file size (in bytes). */ - - uint32_t maxPartSize; - /**< Maximum allowable predicted orbits file chunk size (in bytes). */ -}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t serverList_len; /**< Must be set to # of elements in serverList */ - qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; - /**< List of predicted orbits URLs. The list is ordered, so the client - must use the first server specified in the list as the primary URL - from which to download predicted orbits data, the second one as - secondary, and so on. \n - - Maximum number of servers that can be specified: 3 */ -}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Allowed Sizes */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \vspace{0.06in} \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \vspace{0.06in} \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to inject a position. */ -typedef struct { - - /* Mandatory */ - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Mandatory */ - /* Circular Horizontal Uncertainty */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Mandatory */ - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on. */ - eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off. */ - QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEngineStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the engine state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Engine State */ - qmiLocEngineStateEnumT_v02 engineState; - /**< Location engine state. - - Valid values: \n - - 0x00000001 -- ON \n - - 0x00000002 -- OFF - */ -}qmiLocEventEngineStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started. */ - eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended. */ - QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocFixSessionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the fix session state to the control point. */ -typedef struct { - - /* Mandatory */ - /* Session State */ - qmiLocFixSessionStateEnumT_v02 sessionState; - /**< LOC fix session state. - - Valid values: \n - - 0x00000001 -- STARTED \n - - 0x00000002 -- FINISHED - */ - - /* Optional */ - /* Session ID */ - uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ - uint8_t sessionId; - /**< ID of the session that was specified in the Start request. - This may not be specified for a fix session corresponding to - a network-initiated request. \n - - Range: 0 to 255 */ -}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency. */ - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads. */ - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request. */ - QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends a WiFi request to the control point. */ -typedef struct { - - /* Mandatory */ - /* Request Type */ - qmiLocWifiRequestEnumT_v02 requestType; - /**< Request type as specified in qmiWifiRequestEnumT. - - Valid values: \begin{itemize1} - \item 0x00000000 -- START_PERIODIC_ HI_FREQ_FIXES - \item 0x00000001 -- START_PERIODIC_ KEEP_WARM - \item 0x00000002 -- STOP_PERIODIC_ FIXES - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Time Between Fixes */ - uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ - uint16_t tbfInMs; - /**< Time between fixes for a periodic request.\n - - Units: Milliseconds */ -}qmiLocEventWifiReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t samplesPerBatch; - /**< Specifies the number of samples per batch the GNSS location engine is to - receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n - - samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n - - samplesPerBatch must be a nonzero positive value. - */ - - uint16_t batchesPerSecond; - /**< Number of sensor-data batches the GNSS location engine is to receive - per second. The rate is specified in an integral number of batches per - second (Hz). \vspace{-0.06in} \n - - batchesPerSecond must be a nonzero positive value. - */ -}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t injectEnable; - /**< Indicates whether the GNSS location engine is ready to accept data from this - sensor. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor - data - \item 0x00 (FALSE) -- GNSS location engine is not ready to accept - sensor data - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; - /**< Rate at which the GNSS engine would like the sensor to be sampled. \n - The rate is specified in integral number of samples per second (Hz)\n - and batches per second. - */ -}qmiLocSensorReadyStatusStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point if the GNSS location engine is - ready to accept sensor data. */ -typedef struct { - - /* Optional */ - /* Accelerometer Accept Ready */ - uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelReady; - /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready - to accept accelerometer sensor data. - */ - - /* Optional */ - /* Gyroscope Accept Ready */ - uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroReady; - /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready - to accept gyroscope sensor data. - */ - - /* Optional */ - /* Accelerometer Temperature Accept Ready */ - uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; - /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready - to accept accelerometer temperature data. - */ - - /* Optional */ - /* Gyroscope Temperature Accept Ready */ - uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ - qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; - /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready - to accept gyroscope temperature data. - */ -}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point to inject time synchronization - data. */ -typedef struct { - - /* Mandatory */ - /* Opaque Time Sync Reference Counter */ - uint32_t refCounter; - /**< This TLV is sent to registered control points. It is sent by - the location engine when it needs to synchronize location engine and - control point (sensor processor) times. - This TLV must be echoed back in the Time Sync Inject request. */ -}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the control point to enable Stationary Position - Indicator (SPI) streaming reports. */ -typedef struct { - - /* Mandatory */ - /* Enable/Disable SPI Requests */ - uint8_t enable; - /**< Indicates whether the client is to start or stop sending an SPI status stream. - \begin{itemize1} - \item 0x01 (TRUE) -- Client is to start sending an SPI status stream - \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection. */ - eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections. */ - eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 = 2, /**< Bring up the WWAN type used for AGNSS Emergency connections. */ - QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWWANTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server. */ - eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server. */ - QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerRequestEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Requests the client to open or close a connection - to the assisted GPS location server. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Identifies a connection across Open and Close request events. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Open or close a connection to the location server. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* WWAN Type */ - qmiLocWWANTypeEnumT_v02 wwanType; - /**< Identifies the WWAN type for this request. - Valid values: \n - - eQMI_LOC_WWAN_TYPE_INTERNET (0) -- Bring up the WWAN type used for an Internet connection. - - eQMI_LOC_WWAN_TYPE_AGNSS (1) -- Bring up the WWAN type used for AGNSS connections. - - eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY (2) -- Bring up the WWAN type used for AGNSS Emergency connections. - */ -}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added. */ - eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted. */ - eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited. The control point can query the - Geofence to find the its current state. */ - QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiGeofenceOperationEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Informs the control point about - network-initiated Geofences. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Operation Type */ - qmiLocNiGeofenceOperationEnumT_v02 operationType; - /**< Operation for which this notification was generated. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NI_GEOFENCE_ ADDED - \item 0x00000002 -- NI_GEOFENCE_ DELETED - \item 0x00000003 -- NI_GEOFENCE_ EDITED - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes - cannot be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can - be used to monitor Geofences. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage - information is available. */ - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time. */ - QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceGenAlertEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of the - Geofence status. */ -typedef struct { - - /* Mandatory */ - /* Geofence General Alert */ - qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; - /**< Specifies the Geofence general alert type. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_GEN_ ALERT_GNSS_UNAVAILABLE - \item 0x00000002 -- GEOFENCE_GEN_ ALERT_GNSS_AVAILABLE - \item 0x00000003 -- GEOFENCE_GEN_ ALERT_OOS - \item 0x00000004 -- GEOFENCE_GEN_ ALERT_TIME_INVALID - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence. */ - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence. */ - QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceBreachTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - /* UTC Timestamp */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Latitude */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Longitude */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty.\n - - Units: Meters */ - - /* Elliptical Horizontal Uncertainty Azimuth */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation.\n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Horizontal Speed validity bit */ - uint8_t speedHorizontal_valid; - /**< Indicates whether the Horizontal speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Horizontal speed is valid - \item 0x00 (FALSE) -- Horizontal speed is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Horizontal Speed */ - float speedHorizontal; - /**< Horizontal speed.\n - - Units: Meters/second */ - - /* Altitude validity bit */ - uint8_t altitudeWrtEllipsoid_valid; - /**< Indicates whether the altitude field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Altitude field is valid - \item 0x00 (FALSE) -- Altitude field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} - */ - - /* Altitude With Respect to Ellipsoid */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Vertical Uncertainty validity bit */ - uint8_t vertUnc_valid; - /**< Indicates whether the Vertical Uncertainty field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Uncertainty field is valid - \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Uncertainty */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Vertical Speed validity bit */ - uint8_t speedVertical_valid; - /**< Indicates whether the Vertical Speed field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Vertical Speed field is valid - \item 0x00 (FALSE) -- Vertical Speed field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Vertical Speed */ - float speedVertical; - /**< Vertical speed.\n - - Units: Meters/second */ - - /* heading validity bit */ - uint8_t heading_valid; - /**< Indicates whether the Heading field contains valid - information. - \begin{itemize1} - \item 0x01 (TRUE) -- Heading field is valid - \item 0x00 (FALSE) -- Heading field is invalid - and is to be ignored - \vspace{-0.18in} \end{itemize1} */ - - /* Heading */ - float heading; - /**< Heading.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ -}qmiLocGeofencePositionStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the control point of - a Geofence breach event. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< ID of the Geofence for which this - notification was generated. */ - - /* Mandatory */ - /* Geofence Breach Type */ - qmiLocGeofenceBreachTypeEnumT_v02 breachType; - /**< The type of breach that generated this event. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ BREACH_TYPE_ENTERING - \item 0x00000002 -- GEOFENCE_ BREACH_TYPE_LEAVING - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Geofence Position */ - uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ - qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< \vspace{0.06in} \n Position of the client when it breached the Geofence. - This TLV is included if the client configures the - Geofence to report position. The position is reported - at the same confidence level that was specified in the - Add Circular Geofence request. */ -}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Recommends how pedometer reports are to be - sent to the location engine. */ -typedef struct { - - /* Mandatory */ - /* Request Pedometer Data */ - uint8_t requestPedometerData; - /**< Indicates whether the GNSS location engine is requesting the client to - send pedometer data. - \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting - pedometer data - \item 0x00 (FALSE) -- GNSS location engine is not requesting - pedometer data - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Reset Step Count */ - uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ - uint8_t resetStepCount; - /**< Indicates whether the location engine is to reset the step count. - \begin{itemize1} - \item 0x01 (TRUE) -- Pedometer step count is to be reset. - \item 0x00 (FALSE) -- Pedometer step count is not to be reset. - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Step Count Threshold */ - uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ - uint32_t stepCountThreshold; - /**< Specifies the number of steps to be sampled in a pedometer report, - as recommended by the the location engine. If the threshold is set to 0, - the location engine wants a pedometer report at every step event. - */ -}qmiLocEventPedometerControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Recommends how motion data reports are to be - sent to the location engine. */ -typedef struct { - - /* Mandatory */ - /* Request Motion Data */ - uint8_t requestMotionData; - /**< Indicates whether the GNSS location engine is requesting - the client to send motion data. - \begin{itemize1} - \item 0x01 (TRUE) -- GNSS location engine is requesting - motion data - \item 0x00 (FALSE) -- GNSS location engine is not requesting - motion data - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocEventMotionDataControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully. */ - eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure. */ - eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported. */ - eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters. */ - eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy. */ - eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline. */ - eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out. */ - eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ - eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficent - memory for the request. */ - QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocStatusEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetServiceRevisionReqMsgT is empty - * typedef struct { - * }qmiLocGetServiceRevisionReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Client can query the service revision using this message. */ -typedef struct { - - /* Mandatory */ - /* Get Revision Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Revision request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Interface Definition Minor Revision */ - uint32_t revision; - /**< Revision of the service. This is the minor revision of the interface that - the service implements. Minor revision updates of the service are always - backward compatible. */ - - /* Optional */ - /* GNSS Measurement Engine Firmware Version String */ - uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ - char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS measurement engine software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in} \end{itemize1} - - \textbf{Note:} This string is only provided on platforms that have - a measurement engine that supports this version string. On all other - platforms, this optional TLV is not provided. */ - - /* Optional */ - /* GNSS Hosted Software Version String */ - uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ - char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Version of the GNSS hosted software running under the LOC API. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 128 - \vspace{0.1in}\end{itemize1} - - \textbf{Note:} This string is only provided on hosted architectures - (measurement and position engine running on different processors) that - support this version string. On all other platforms, this optional TLV - is not provided. */ - - /* Optional */ - /* GNSS Software Version String */ - uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ - char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; - /**< Aggregate version of the GNSS software. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} */ -}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetFixCriteriaReqMsgT is empty - * typedef struct { - * }qmiLocGetFixCriteriaReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the fix criteria from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Fix Criteria Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Fix Criteria request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Horizontal Accuracy */ - uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ - qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; - /**< Horizontal accuracy level. - - Valid values: \begin{itemize1} - \item 0x00000001 -- LOW: Client requires low horizontal accuracy - \item 0x00000002 -- MED: Client requires medium horizontal accuracy - \item 0x00000003 -- HIGH: Client requires high horizontal accuracy - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable Intermediate Fixes */ - uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ - qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; - /**< Intermediate Report state (ON, OFF).\n - The client must explicitly set this field to OFF to stop receiving - intermediate position reports. Intermediate position reports are - generated at \n 1 Hz and are ON by default. If intermediate reports - are turned ON, the client receives position reports even if the - accuracy criteria is not met. The status in the position report is - set to IN_PROGRESS for intermediate reports. - - Valid values: \begin{itemize1} - \item 0x00000001 -- ON: Client is interested in receiving intermediate - reports - \item 0x00000002 -- OFF: Client is not interested in receiving - intermediate reports - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Minimum Interval Between Fixes */ - uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ - uint32_t minInterval; - /**< Time that must elapse before alerting the client. \n - - Units: Milliseconds */ - - /* Optional */ - /* ID of the Application that Sent the Position Request */ - uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ - qmiLocApplicationIdStructT_v02 applicationId; - /**< \vspace{0.06in} \n Application provider, name, and version.*/ -}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted the Notify/Verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied the Notify/Verify request. */ - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to the Notify/Verify request. */ - QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocNiUserRespEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* User Response */ - qmiLocNiUserRespEnumT_v02 userResp; - /**< User accepted or denied. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NOTIFY_VERIFY_ ACCEPT - \item 0x00000002 -- NOTIFY_VERIFY_ DENY - \item 0x00000003 -- NOTIFY_VERIFY_ NORESP - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Notification Type */ - qmiLocNiNotifyVerifyEnumT_v02 notificationType; - /**< Type of notification/verification performed. - - Valid values: \begin{itemize1} - \item 0x00000001 -- NO_NOTIFY_NO_ VERIF - \item 0x00000002 -- NOTIFY_ONLY - \item 0x00000003 -- ALLOW_NO_RESP - \item 0x00000004 -- NOT_ALLOW_NO_ RESP - \item 0x00000005 -- PRIVACY_ OVERRIDE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Network Initiated Vx Request */ - uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ - qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; - /**< \vspace{0.06in} \n Optional NI VX request payload. */ - - /* Optional */ - /* Network Initiated SUPL Request */ - uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ - qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; - /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ - - /* Optional */ - /* Network Initiated UMTS Control Plane Request */ - uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ - qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; - /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ - - /* Optional */ - /* Network Initiated Service Interaction Request */ - uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ - qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; - /**< \vspace{0.06in} \n Optional NI service interaction payload. */ - - /* Optional */ - /* Network Initiated SUPL Version 2 Extension */ - uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ - qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; - /**< \vspace{0.06in} \n Optional SUPL Version 2 Extension payload. */ - - /* Optional */ - /* SUPL Emergency Notification */ - uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ - qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; - /**< \vspace{0.06in} \n SUPL emergency notification payload. Emergency notification - can be given even without an ESLP address */ -}qmiLocNiUserRespReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sends the NI user response back to the engine; success or - failure is reported in a separate indication. */ -typedef struct { - - /* Mandatory */ - /* NI User Response Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the NI User Response request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNiUserRespIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ - QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPredictedOrbitsDataFormatEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Total Size */ - uint32_t totalSize; - /**< Total size of the predicted orbits data to be injected. \n - - Units: Bytes */ - - /* Mandatory */ - /* Total Parts */ - uint16_t totalParts; - /**< Total number of parts into which the predicted orbits data is - divided. */ - - /* Mandatory */ - /* Part Number */ - uint16_t partNum; - /**< Number of the current predicted orbits data part; starts at 1. */ - - /* Mandatory */ - /* Data */ - uint32_t partData_len; /**< Must be set to # of elements in partData */ - char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; - /**< Predicted orbits data. \n - - Type: Array of bytes \n - - Maximum length of the array: 1024 - */ - - /* Optional */ - /* Format Type */ - uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ - qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; - /**< Predicted orbits data format. - - Valid values: \begin{itemize1} - \item 0x00000000 -- PREDICTED_ ORBITS_XTRA - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects predicted orbits data. */ -typedef struct { - - /* Mandatory */ - /* Data Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Data Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Part Number */ - uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ - uint16_t partNum; - /**< Number of the predicted orbits data part for which this indication - is sent; starts at 1. */ -}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data source. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Source Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for a predicted orbits data source. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Allowed Sizes */ - uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ - qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; - /**< \n Maximum part and file size allowed to be injected in the engine. */ - - /* Optional */ - /* Server List */ - uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ - qmiLocPredictedOrbitsServerListStructT_v02 serverList; - /**< \n List of servers that can be used by the client to download - predicted orbits data. */ -}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty - * typedef struct { - * }qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint64_t startTimeInUTC; - /**< Predicted orbits data is valid starting from this time. \n - - Units: Seconds (since Jan. 1, 1970) - */ - - uint16_t durationHours; - /**< Duration from the start time for which the data is valid.\n - - Units: Hours - */ -}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the predicted orbits data validity. */ -typedef struct { - - /* Mandatory */ - /* Predicted Orbits Data Validity Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the query request for predicted orbits data validity. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Validity Info */ - uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ - qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; -}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time */ - uint64_t timeUtc; - /**< UTC time since Jan. 1, 1970.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Time Uncertainty */ - uint32_t timeUnc; - /**< Time uncertainty.\n - - Units: Milliseconds */ -}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects UTC time in the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Time Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Time Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown. */ - eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source. */ - eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source. */ - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID. */ - eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< WiFi is the source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source. */ - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source. */ - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source. */ - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source. */ - eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources. */ - QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent. */ - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude. */ - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent. */ - QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcLinkageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified. */ - eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal - position coordinates only. */ - eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device - regardless of horizontal position (within the horizontal - uncertainty region, if provided). */ - QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocAltSrcUncertaintyCoverageEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocAltSrcEnumT_v02 source; - /**< Specifies the source of the altitude. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ALT_SRC_ UNKNOWN - \item 0x00000001 -- ALT_SRC_GPS - \item 0x00000002 -- ALT_SRC_CELL_ID - \item 0x00000003 -- ALT_SRC_ ENHANCED_CELL_ID - \item 0x00000004 -- ALT_SRC_WIFI - \item 0x00000005 -- ALT_SRC_ TERRESTRIAL - \item 0x00000006 -- ALT_SRC_ TERRESTRIAL_HYBRID - \item 0x00000007 -- ALT_SRC_ ALTITUDE_DATABASE - \item 0x00000008 -- ALT_SRC_ BAROMETRIC_ALTIMETER - \item 0x00000009 -- ALT_SRC_OTHER - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcLinkageEnumT_v02 linkage; - /**< Specifies the dependency between the horizontal and - altitude position components. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SRC_LINKAGE_ NOT_SPECIFIED - \item 0x00000001 -- SRC_LINKAGE_ FULLY_INTERDEPENDENT - \item 0x00000002 -- SRC_LINKAGE_ DEPENDS_ON_LAT_LONG - \item 0x00000003 -- SRC_LINKAGE_ FULLY_INDEPENDENT - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; - /**< Specifies the region of uncertainty. - - Valid values: \begin{itemize1} - \item 0x00000000 -- UNCERTAINTY_ NOT_SPECIFIED - \item 0x00000001 -- UNCERTAINTY_ POINT: Altitude uncertainty is valid - at the injected horizontal position coordinates - only. - \item 0x00000002 -- UNCERTAINTY_ FULL: Altitude uncertainty applies to - the position of the device regardless of - horizontal position (within the horizontal - uncertainty region, if provided). - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS. */ - eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID. */ - eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID. */ - eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is WiFi. */ - eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial. */ - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid. */ - eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources. */ - QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocPositionSrcEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a position to the location engine. */ -typedef struct { - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} - */ - - /* Optional */ - /* Circular Horizontal Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Horizontal Confidence */ - uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ - uint8_t horConfidence; - /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0 to 99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with horizontal uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid. - \begin{itemize1} - \item Units: Meters \begin{itemize1} - \item Positive = height - \item Negative = depth - \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid - or altitudeWrtMeanSeaLevel is specified.\n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). - \begin{itemize1} - \item Units: Percent (0-99) - \item 0 -- invalid value - \item 100 to 256 -- not used - \item If 100 is received, reinterpret to 99 - \end{itemize1} - This field must be specified together with the vertical uncertainty. - If not specified, the default value will be 50. */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Altitude Source Info */ - uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ - qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; - /**< \vspace{0.06in} \n Specifies information regarding the altitude source. */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. \n - - Units: Milliseconds (since Jan. 1, 1970) */ - - /* Optional */ - /* Position Age */ - uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ - int32_t timestampAge; - /**< Position age, which is an estimate of how long ago this fix was made. \n - - Units: Milliseconds */ - - /* Optional */ - /* Position Source */ - uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ - qmiLocPositionSrcEnumT_v02 positionSrc; - /**< Source from which this position was obtained. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ POSITION_SRC_GNSS - \item 0x00000001 -- eQMI_LOC_ POSITION_SRC_CELLID - \item 0x00000002 -- eQMI_LOC_ POSITION_SRC_ENH_CELLID - \item 0x00000003 -- eQMI_LOC_ POSITION_SRC_WIFI - \item 0x00000004 -- eQMI_LOC_ POSITION_SRC_TERRESTRIAL - \item 0x00000005 -- eQMI_LOC_ POSITION_SRC_GNSS_ TERRESTRIAL_HYBRID - \item 0x00000006 -- eQMI_LOC_ POSITION_SRC_OTHER - \end{itemize1} \vspace{0.05in} - - If altitude is specified and the altitude source is not specified, the engine - assumes that the altitude was obtained using the specified position source. \n - If both altitude and altitude source are specified, the engine assumes - that only latitude and longitude were obtained using the specified position - source. - */ -}qmiLocInjectPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a position to the location engine. */ -typedef struct { - - /* Mandatory */ - /* UTC Position Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the UTC Position Injection request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions. */ - eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions. */ - eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions. */ - eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions. */ - QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocLockEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Lock Type */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - - */ -}qmiLocSetEngineLockReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Set Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetEngineLockReqMsgT is empty - * typedef struct { - * }qmiLocGetEngineLockReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location engine lock. */ -typedef struct { - - /* Mandatory */ - /* Get Engine Lock Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Engine Lock request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Lock Type */ - uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ - qmiLocLockEnumT_v02 lockType; - /**< Type of lock. - - Valid values: \n - - 0x00000001 -- LOCK_NONE \n - - 0x00000002 -- LOCK_MI \n - - 0x00000003 -- LOCK_MT \n - - 0x00000004 -- LOCK_ALL - */ -}qmiLocGetEngineLockIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* SBAS Config */ - uint8_t sbasConfig; - /**< Indicates whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the SBAS configuration. */ -typedef struct { - - /* Mandatory */ - /* Set SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSbasConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSbasConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the SBAS configuration from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get SBAS Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get SBAS Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SBAS Config */ - uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ - uint8_t sbasConfig; - /**< Indicates whether SBAS configuration is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SBAS configuration is enabled - \item 0x00 (FALSE) -- SBAS configuration is disabled - \vspace{-0.18in} \end{itemize1}*/ -}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocNmeaSentenceMaskT_v02; -#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type. */ -#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type. */ -#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type. */ -#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type. */ -#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type. */ -#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type. */ -#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* NMEA Sentence Types */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< Bitmasks of NMEA types to enable. - - Valid bitmasks: \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the NMEA types. */ -typedef struct { - - /* Mandatory */ - /* Set NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of Set NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetNmeaTypesReqMsgT is empty - * typedef struct { - * }qmiLocGetNmeaTypesReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the NMEA types from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get NMEA Types Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NMEA Types request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* NMEA Sentence Types */ - uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ - qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; - /**< NMEA types to enable. - - Valid bitmasks: \n - - 0x0000ffff -- NMEA_MASK_ALL \n - - 0x00000001 -- NMEA_MASK_GGA \n - - 0x00000002 -- NMEA_MASK_RMC \n - - 0x00000004 -- NMEA_MASK_GSV \n - - 0x00000008 -- NMEA_MASK_GSA \n - - 0x00000010 -- NMEA_MASK_VTG \n - - 0x00000020 -- NMEA_MASK_PQXFI \n - - 0x00000040 -- NMEA_MASK_PSTIS - */ -}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Enable Low Power Mode */ - uint8_t lowPowerMode; - /**< Indicates whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ -typedef struct { - - /* Mandatory */ - /* Set LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Low Power Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetLowPowerModeReqMsgT is empty - * typedef struct { - * }qmiLocGetLowPowerModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the LPM status from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get LPM Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get LPM request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable LPM */ - uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ - uint8_t lowPowerMode; - /**< Indicates whether to enable Low Power mode:\n - - 0x01 (TRUE) -- Enable LPM \n - - 0x00 (FALSE) -- Disable LPM */ -}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE. */ - eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC. */ - eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP. */ - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE. */ - QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \vspace{0.06in} \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \vspace{0.06in} \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL address. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Specifies the A-GPS server type and address. */ -typedef struct { - - /* Mandatory */ - /* Set Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* Server Address Type */ - uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ - qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; - /**< Type of address the client wants. If unspecified, the - indication will contain all the types of addresses - it has for the specified server type. - - Valid bitmasks: \n - - 0x01 -- IPV4 \n - - 0x02 -- IPV6 \n - - 0x04 -- URL - */ -}qmiLocGetServerReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the location server from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Server Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Server request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Mandatory */ - /* Server Type */ - qmiLocServerTypeEnumT_v02 serverType; - /**< Type of server, as defined in qmiLocServerTypeEnumT. - - Valid values: \n - - 0x00000001 -- CDMA_PDE \n - - 0x00000002 -- CDMA_MPC \n - - 0x00000003 -- UMTS_SLP \n - - 0x00000004 -- CUSTOM_PDE - */ - - /* Optional */ - /* IPV4 Address */ - uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ - qmiLocIpV4AddrStructType_v02 ipv4Addr; - /**< \vspace{0.06in} \n IPV4 address and port. */ - - /* Optional */ - /* IPV6 Address */ - uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ - qmiLocIpV6AddrStructType_v02 ipv6Addr; - /**< \vspace{0.06in} \n IPV6 address and port. */ - - /* Optional */ - /* Uniform Resource Locator */ - uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ - char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; - /**< URL. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 256 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetServerIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time. */ -#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation. */ -#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR. */ -#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER. */ -#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time. */ -#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ -#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ -#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ -#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ -#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ -#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ -#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ -#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ -#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ -#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ -#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ -#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ -typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; -#define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ -#define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ -#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ -#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ -#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ -#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ -#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ -#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ -typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ -#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ -typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; -#define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ -#define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t gnssSvId; - /**< SV ID of the satellite whose data is to be deleted. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - qmiLocSvSystemEnumT_v02 system; - /**< Indicates to which constellation this SV belongs. - - Valid values: \begin{itemize1} - \item 0x00000001 -- eQMI_LOC_SV_ SYSTEM_GPS - \item 0x00000002 -- eQMI_LOC_SV_ SYSTEM_GALILEO - \item 0x00000003 -- eQMI_LOC_SV_ SYSTEM_SBAS - \item 0x00000004 -- eQMI_LOC_SV_ SYSTEM_COMPASS - \item 0x00000005 -- eQMI_LOC_SV_ SYSTEM_GLONASS - \vspace{-0.18in} \end{itemize1} - */ - - qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite - is to be deleted. \n - Valid values: \n - - 0x01 -- DELETE_EPHEMERIS \n - - 0x02 -- DELETE_ALMANAC - */ -}qmiLocDeleteSvInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete All */ - uint8_t deleteAllFlag; - /**< Indicates whether all assistance data is to be deleted. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- All assistance data is to be deleted; if - this flag is set, all the other information - contained in the optional fields for this - message are ignored - \item 0x00 (FALSE) -- The optional fields in the message are to be - used to determine which data is to be deleted - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Delete SV Info */ - uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ - uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ - qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; - /**< \vspace{0.06in} \n List of satellites for which the assistance data is to be deleted. - */ - - /* Optional */ - /* Delete GNSS Data */ - uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ - qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; - /**< Mask for the GNSS data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_GPS_SVDIR - \item 0x00000002 -- DELETE_GPS_ SVSTEER - \item 0x00000004 -- DELETE_GPS_TIME - \item 0x00000008 -- DELETE_GPS_ALM_ CORR - \item 0x00000010 -- DELETE_GLO_ SVDIR - \item 0x00000020 -- DELETE_GLO_ SVSTEER - \item 0x00000040 -- DELETE_GLO_TIME - \item 0x00000080 -- DELETE_GLO_ALM_ CORR - \item 0x00000100 -- DELETE_SBAS_ SVDIR - \item 0x00000200 -- DELETE_SBAS_ SVSTEER - \item 0x00000400 -- DELETE_POSITION - \item 0x00000800 -- DELETE_TIME - \item 0x00001000 -- DELETE_IONO - \item 0x00002000 -- DELETE_UTC - \item 0x00004000 -- DELETE_HEALTH - \item 0x00008000 -- DELETE_SADATA - \item 0x00010000 -- DELETE_RTI - \item 0x00020000 -- DELETE_SV_NO_ EXIST - \item 0x00040000 -- DELETE_FREQ_ BIAS_EST - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Cell Database */ - uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ - qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; - /**< Mask for the cell database assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CELLDB_ POS - \item 0x00000002 -- DELETE_CELLDB_ LATEST_GPS_POS - \item 0x00000004 -- DELETE_CELLDB_ OTA_POS - \item 0x00000008 -- DELETE_CELLDB_ EXT_REF_POS - \item 0x00000010 -- DELETE_CELLDB_ TIMETAG - \item 0x00000020 -- DELETE_CELLDB_ CELLID - \item 0x00000040 -- DELETE_CELLDB_ CACHED_CELLID - \item 0x00000080 -- DELETE_CELLDB_ LAST_SRV_CELL - \item 0x00000100 -- DELETE_CELLDB_ CUR_SRV_CELL - \item 0x00000200 -- DELETE_CELLDB_ NEIGHBOR_INFO - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Delete Clock Info */ - uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ - qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; - /**< Mask for the clock information assistance data that is to be deleted. - - Valid values: \begin{itemize1} - \item 0x00000001 -- DELETE_CLOCK_ INFO_TIME_EST - \item 0x00000002 -- DELETE_CLOCK_ INFO_FREQ_EST - \item 0x00000004 -- DELETE_CLOCK_ INFO_WEEK_NUMBER - \item 0x00000008 -- DELETE_CLOCK_ INFO_RTC_TIME - \item 0x00000010 -- DELETE_CLOCK_ INFO_TIME_TRANSFER - \item 0x00000020 -- DELETE_CLOCK_ INFO_GPSTIME_EST - \item 0x00000040 -- DELETE_CLOCK_ INFO_GLOTIME_EST - \item 0x00000080 -- DELETE_CLOCK_ INFO_GLODAY_NUMBER - \item 0x00000100 -- DELETE_CLOCK_ INFO_GLO4YEAR_NUMBER - \item 0x00000200 -- DELETE_CLOCK_ INFO_GLO_RF_GRP_DELAY - \item 0x00000400 -- DELETE_CLOCK_ INFO_DISABLE_TT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; This command is used to delete the location engine - assistance data */ -typedef struct { - - /* Mandatory */ - /* Delete Assist Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Assist Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Enable XTRA-T */ - uint8_t xtraTSessionControl; - /**< Indicates whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Enables/disables XTRA-T session control. */ -typedef struct { - - /* Mandatory */ - /* Set XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetXtraTSessionControlReqMsgT is empty - * typedef struct { - * }qmiLocGetXtraTSessionControlReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the XTRA-T session control value from the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Get XTRA-T Session Control Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get XTRA-T Session Control request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Enable/Disable XTRA-T */ - uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ - uint8_t xtraTSessionControl; - /**< Indicates whether to enable XTRA-T:\n - - 0x01 (TRUE) -- Enable XTRA-T \n - - 0x00 (FALSE) -- Disable XTRA-T */ -}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t wifiPositionTime; - /**< Common counter (typically, the number of milliseconds since bootup). - This field is only to be provided if the modem and host processors are - synchronized. */ -}qmiLocWifiFixTimeStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< WiFi fix is successful. */ - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< WiFi fix failed because WiFi is not available on the device. */ - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< WiFi fix failed because no access points were found. */ - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< WiFi fix failed because the server denied access due to bad authorization - code. */ - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< WiFi fix failed because the WiFi server was unavailable. */ - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< WiFi fix failed even though APs were found and the server could be reached. - This may be because the APs found are not in the database. */ - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< WiFi fix failed, but the cause could not be determined. */ - QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiFixErrorCodeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double lat; - /**< WiFi position latitude. \n - - Type: Floating point \n - - Units: Degrees */ - - double lon; - /**< WiFi position longitude. \n - - Type: Floating point \n - - Units: Degrees */ - - uint16_t hepe; - /**< WiFi position HEPE.\n - - Units: Meters */ - - uint8_t numApsUsed; - /**< Number of Access Points (AP) used to generate a fix. */ - - qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; - /**< WiFi position error code; set to 0 if the fix succeeds. This position - is only used by a module if the value is 0. If there was a failure, - the error code provided by the WiFi positioning system can be provided - here. - - Valid values: \begin{itemize1} - \item 0x00000000 -- ERROR_SUCCESS - \item 0x00000001 -- ERROR_WIFI_NOT_ AVAILABLE - \item 0x00000002 -- ERROR_NO_AP_ FOUND - \item 0x00000003 -- ERROR_ UNAUTHORIZED - \item 0x00000004 -- ERROR_SERVER_ UNAVAILABLE - \item 0x00000005 -- ERROR_LOCATION_ CANNOT_BE_DETERMINED - \item 0x00000006 -- ERROR_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWifiFixPosStructT_v02; /* Type */ -/** - @} - */ - -typedef uint8_t qmiLocWifiApQualifierMaskT_v02; -#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ -#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; - /**< Associated MAC address of the AP. \n - - Type: Array of unsigned integers \n - - Address length: 6 - */ - - int32_t rssi; - /**< Receive signal strength indicator.\n - - Units: dBm (offset with +100 dB) */ - - uint16_t channel; - /**< WiFi channel on which a beacon was received. */ - - qmiLocWifiApQualifierMaskT_v02 apQualifier; - /**< A bitmask of Boolean qualifiers for APs. - All unused bits in this mask must be set to 0. - - Valid values: \n - - 0x01 -- BEING_USED \n - - 0x02 -- HIDDEN_SSID \n - - 0x04 -- PRIVATE \n - - 0x08 -- INFRASTRUCTURE_MODE - */ -}qmiLocWifiApInfoStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the WiFi position. */ -typedef struct { - - /* Optional */ - /* WiFi Fix Time */ - uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ - qmiLocWifiFixTimeStructT_v02 wifiFixTime; - /**< \vspace{0.06in} \n Time of WiFi position fix. */ - - /* Optional */ - /* WiFi Position */ - uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ - qmiLocWifiFixPosStructT_v02 wifiFixPosition; - /**< \vspace{0.06in} \n WiFi position fix. */ - - /* Optional */ - /* WiFi Access Point Information */ - uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ - uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ - qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; - /**< \vspace{0.06in} \n AP scan list. */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ - qmiLocReliabilityEnumT_v02 horizontalReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- eQMI_LOC_ RELIABILITY_NOT_SET - \item 0x00000001 -- eQMI_LOC_ RELIABILITY_VERY_LOW - \item 0x00000002 -- eQMI_LOC_ RELIABILITY_LOW - \item 0x00000003 -- eQMI_LOC_ RELIABILITY_MEDIUM - \item 0x00000004 -- eQMI_LOC_ RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the WiFi position. */ -typedef struct { - - /* Mandatory */ - /* Inject WiFi Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WiFi Position request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< WiFi is available. */ - eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< WiFi is not available. */ - QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocWifiStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Availablility of WiFi */ - qmiLocWifiStatusEnumT_v02 wifiStatus; - /**< WiFi status information. - - Valid values: \begin{itemize1} - \item 0x00000001 -- WIFI_STATUS_ AVAILABLE - \item 0x00000002 -- WIFI_STATUS_ UNAVAILABLE - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine of the WiFi status. */ -typedef struct { - - /* Mandatory */ - /* Status of Notify WiFi Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WiFi Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetRegisteredEventsReqMsgT is empty - * typedef struct { - * }qmiLocGetRegisteredEventsReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the mask of the events for which a client has - registered. */ -typedef struct { - - /* Mandatory */ - /* Get Registered Events Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Registered Events request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Event Registration Mask */ - uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ - qmiLocEventRegMaskT_v02 eventRegMask; - /**< Event registration mask. - Valid bitmasks: \n - - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report - event indications. - - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report - event indications. These reports are sent at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for - position and satellites in view. The report is at a 1 Hz rate. - - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request - event indications. - - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request - event indications. - - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report - event indications. - - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report - event indications. - - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive WiFi position request - event indications. - - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the - GPS engine indicating its readiness to accept data from the - sensors (accelerometer, gyroscope, etc.). - - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests - from the GPS engine. Time sync enables the GPS engine to synchronize - its clock with the sensor processor's clock. - - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position - Indicator (SPI) streaming report indications. - - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server - requests. These requests are generated when the service wishes to - establish a connection with a location server. - - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications - related to network-initiated Geofences. These events notify the client - when a network-initiated Geofence is added, deleted, or edited. - - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. - These alerts are generated to inform the client of the changes that may - affect Geofence, e.g., if GPS is turned off or if the network is - unavailable. - - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when - a Geofence is breached. These events are generated when the UE enters - or leaves the perimeter of a Geofence. - - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer - control requests from the location engine. The location engine sends - this event to control the injection of pedometer reports. - - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data - control requests from the location engine. The location engine sends - this event to control the injection of motion data. - */ -}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode. */ - eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode. */ - eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode. */ - eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode. */ - eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID. This mode is valid only for a GSM/UMTS network. */ - eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position. If this mode is - set, AFLT will be used for 1x networks and OTDOA will be used - for LTE networks. */ - QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocOperationModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Operation Mode */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Preferred operation mode. - \label{operationMode} - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_ DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_ STANDALONE - \item 0x00000005 -- OPER_MODE_ CELL_ID - \item 0x00000006 -- OPER_MODE_ WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Tells the engine to use the specified operation mode while - making the position fixes. This command is not to be used - by multiple clients concurrently. */ -typedef struct { - - /* Mandatory */ - /* Set Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetOperationModeReqMsgT is empty - * typedef struct { - * }qmiLocGetOperationModeReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Gets the current operation mode from the engine. */ -typedef struct { - - /* Mandatory */ - /* Get Operation Mode Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Operation Mode request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Operation Mode */ - uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ - qmiLocOperationModeEnumT_v02 operationMode; - /**< Current operation mode. - - Valid values: \begin{itemize1} - \item 0x00000001 -- OPER_MODE_ DEFAULT - \item 0x00000002 -- OPER_MODE_MSB - \item 0x00000003 -- OPER_MODE_MSA - \item 0x00000004 -- OPER_MODE_ STANDALONE - \item 0x00000005 -- OPER_MODE_ CELL_ID - \item 0x00000006 -- OPER_MODE_ WWAN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetOperationModeIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Stationary Status */ - uint8_t stationary; - /**< Indicates whether the device is stationary: - \begin{itemize1} - \item 0x00 (FALSE) -- Device is not stationary - \item 0x01 (TRUE) -- Device is stationary - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Confidence */ - uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ - uint8_t confidenceStationary; - /**< Confidence in the Stationary state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the SPI status, which - indicates whether the device is stationary. */ -typedef struct { - - /* Mandatory */ - /* Status of SPI Status Request */ - qmiLocStatusEnumT_v02 status; - /**< Status of the SPI Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocSensorDataFlagMaskT_v02; -#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting - the sensor data. Only applies to the accelerometer samples. */ -#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem - time stamp. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< The sensor time source is unspecified. */ - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< The time source is common between the sensors and - the location engine. */ - QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorDataTimeSourceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor data sample.\n - - Units: Milliseconds */ - - float xAxis; - /**< Sensor x-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float yAxis; - /**< Sensor y-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ - - float zAxis; - /**< Sensor z-axis sample. \n - - Units Accelerometer: ( (meters)/(seconds^2) ) \n - - Units Gyroscope: ( (rads)/(seconds) ) */ -}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message.The timestamp is in the time reference scale that is - used by the sensor time source.\n - - Units: Milliseconds */ - - qmiLocSensorDataFlagMaskT_v02 flags; - /**< Flags to indicate any deviation from the default measurement - assumptions. All unused bits in this field must be set to 0. - - Valid bitmasks: \begin{itemize1} - \item 0x01 -- SIGN_REVERSAL - \item 0X02 -- SENSOR_TIME_IS_ MODEM_TIME - \vspace{-0.18in} \end{itemize1} */ - - uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ - qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor samples. \n - - Maximum length of the array: 50 */ -}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint16_t timeOffset; - /**< Sample time offset. This time offset must be - relative to the timestamp of the first sensor sample.\n - - Units: Milliseconds */ - - float temperature; - /**< Sensor temperature. \n - - Type: Floating point \n - - Units: Degrees Celsius \n - - Range: -50 to +100.00 */ -}qmiLocSensorTemperatureSampleStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocSensorDataTimeSourceEnumT_v02 timeSource; - /**< Denotes the time source of the sensor data. Location service will use - this field to identify the time reference used in the - sensor data timestamps. Values :\n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine. - */ - - uint32_t timeOfFirstSample; - /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this - message. The timestamp is in the time reference scale that is - used by the sensor time source.\n - - Units: Milliseconds */ - - uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ - qmiLocSensorTemperatureSampleStructT_v02 temperatureData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; - /**< Variable length array to specify sensor temperature samples. \n - - Maximum length of the array: 50 */ -}qmiLocSensorTemperatureSampleListStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< An opaque identifier that is sent in by the client that will be echoed - in the indication so the client can relate the indication to the - request. */ - - /* Optional */ - /* 3-Axis Accelerometer Data */ - uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; - /**< \vspace{0.06in} \n Accelerometer sensor samples. */ - - /* Optional */ - /* 3-Axis Gyroscope Data */ - uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ - qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; - /**< \vspace{0.06in} \n Gyroscope sensor samples. */ - - /* Optional */ - /* 3-Axis Accelerometer Data Time Source */ - uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ - qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; - /**< Time source for the 3-axis accelerometer data. The location service uses - this field to identify the time reference used in the accelerometer data - timestamps. If not specified, the location service assumes that the - time source for the accelereometer data is unknown. \n - Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine. - */ - - /* Optional */ - /* 3-Axis Gyroscope Data Time Source */ - uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ - qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; - /**< Time source for the 3-axis gyroscope data. The location service uses - this field to identify the time reference used in the gyroscope data - timestamps. If not specified, the location service assumes that the - time source for the gyroscope data is unknown. \n - Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine. - */ - - /* Optional */ - /* Accelerometer Temperature Data */ - uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ - qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; - /**< \vspace{0.06in} \nAccelerometer temperature samples. This data is optional and does not - have to be included in the message along with accelerometer data. */ - - /* Optional */ - /* Gyroscope Temperature Data */ - uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ - qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; - /**< \vspace{0.06in} \n Gyroscope temperature samples. This data is optional and does not - have to be included in the message along with gyroscope data. */ -}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject sensor data into the - GNSS location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Sensor Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Sensor Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Opaque Identifier */ - uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ - uint32_t opaqueIdentifier; - /**< Opaque identifier that was sent in by the client echoed - so the client can relate the indication to the request. */ - - /* Optional */ - /* Accelerometer Samples Accepted */ - uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ - uint8_t threeAxisAccelSamplesAccepted; - /**< Lets the client know how many 3-axis accelerometer samples - were accepted. This field is present only if the accelerometer - samples were sent in the request. */ - - /* Optional */ - /* Gyroscope Samples Accepted */ - uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ - uint8_t threeAxisGyroSamplesAccepted; - /**< Lets the client know how many 3-axis gyroscope samples were - accepted. This field is present only if the gyroscope - samples were sent in the request. */ - - /* Optional */ - /* Accelerometer Temperature Samples Accepted */ - uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ - uint8_t accelTemperatureSamplesAccepted; - /**< Lets the client know how many accelerometer temperature - samples were accepted. This field is present only if the accelerometer - temperature samples were sent in the request. */ - - /* Optional */ - /* Gyroscope Temperature Samples Accepted */ - uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ - uint8_t gyroTemperatureSamplesAccepted; - /**< Lets the client know how many gyroscope temperature samples - were accepted. This field is present only if the gyroscope - temperature samples were sent in the request. */ -}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Reference Time Sync Counter */ - uint32_t refCounter; - /**< Must be set to the value that was sent to the control point when the - GNSS location engine requested time sync injection. */ - - /* Mandatory */ - /* Sensor Receive Time */ - uint32_t sensorProcRxTime; - /**< Value of the sensor time when the control point received the - Time Sync Inject request from the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ - - /* Mandatory */ - /* Sensor Transmit Time */ - uint32_t sensorProcTxTime; - /**< Value of the sensor time when the control point injects this message - for use by the GNSS location engine. - - Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 - millisecond, never stopping until the process is rebooted.\n - - Units: Milliseconds */ -}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject time sync data. */ -typedef struct { - - /* Mandatory */ - /* Inject Time Sync Data Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Time Sync Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ - eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ - QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocCradleMountStateEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetCradleMountConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetCradleMountConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount State */ - uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_ MOUNTED - \item 0x00000002 -- CRADLE_STATE_ UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence of the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Cradle Mount State */ - qmiLocCradleMountStateEnumT_v02 cradleMountState; - /**< Cradle Mount state set by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- CRADLE_STATE_ NOT_MOUNTED - \item 0x00000001 -- CRADLE_STATE_ MOUNTED - \item 0x00000002 -- CRADLE_STATE_ UNKNOWN - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cradle Mount Confidence */ - uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ - uint8_t confidenceCradleMountState; - /**< Confidence in the Cradle Mount state expressed as a percentage.\n - - Range: 0 to 100 */ -}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - cradle mount configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Cradle Mount Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Cradle Mount Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source. */ - eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state. */ - QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocExternalPowerConfigEnumT_v02; -/** - @} - */ - -/* - * qmiLocGetExternalPowerConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetExternalPowerConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* External Power State */ - uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* External Power State */ - qmiLocExternalPowerConfigEnumT_v02 externalPowerState; - /**< Power state; injected by the control point. - - Valid values: \begin{itemize1} - \item 0x00000000 -- EXTERNAL_ POWER_NOT_CONNECTED - \item 0x00000001 -- EXTERNAL_ POWER_CONNECTED - \item 0x00000002 -- EXTERNAL_ POWER_UNKNOWN - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to set the current - external power configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Ext Power Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set External Power Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPV4 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPV6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPV4V6 PDN type. */ - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type. */ - QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerPDNEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocServerPDNEnumT_v02 pdnType; - /**< PDN type of the APN profile. - - Valid values: \n - - 0x00000001 -- PDN_TYPE_IPV4 \n - - 0x00000002 -- PDN_TYPE_IPV6 \n - - 0x00000003 -- PDN_TYPE_IPV4V6 \n - - 0x00000004 -- PDN_TYPE_PPP - */ - - char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; - /**< APN name. - \begin{itemize1} - \item Type: NULL-terminated string - \item Maximum string length (including NULL terminator): 101 - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocApnProfilesStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful. */ - eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed. */ - QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocServerReqStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Connection Handle */ - uint32_t connHandle; - /**< Connection handle that the service specified in the - Location Server Connection request event. */ - - /* Mandatory */ - /* Request Type */ - qmiLocServerRequestEnumT_v02 requestType; - /**< Type of connection request service that was specified in the - Location Server Connection Request event. - - Valid values: \n - - 0x00000001 -- OPEN \n - - 0x00000002 -- CLOSE - */ - - /* Mandatory */ - /* Connection Status */ - qmiLocServerReqStatusEnumT_v02 statusType; - /**< Status of the Connection request. - - Valid values: \n - - 0x00000001 -- STATUS_SUCCESS = 1 \n - - 0x00000002 -- STATUS_FAILURE = 2 - - */ - - /* Optional */ - /* APN Profile */ - uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ - qmiLocApnProfilesStructT_v02 apnProfile; - /**< \vspace{0.06in} \n Access Point Name (APN) profile information is present only when - requestType is OPEN and statusType is SUCCESS. */ -}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inform the service about the - status of the location server connection request that the - service may have sent via the - QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ -typedef struct { - - /* Mandatory */ - /* Status of Inform Loc Server Conn Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inform Location Server Connection Status request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version. */ - eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version. */ - QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocVxVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0. */ - eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0. */ - QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplVersionEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocLppConfigMaskT_v02; -#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP). */ -#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP. */ -typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane. */ -#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane. - QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set - in the LPP configuration for this to take effect. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA-1 hash algorithm for SUPL version 2.0 or later. */ - eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 hash algorithm for SUPL version 2.0 or later. */ - QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplHashAlgoEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS version 1.0. */ - eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS version 1.1. */ - QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSuplTlsVersionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< Use Control Plane protocol during an emergency while on WCDMA. */ - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< Use SUPL 2.0 emergency services during an emergency while on WCDMA. */ - QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocEmergencyProtocolEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_ V1_ONLY - \item 0x00000002 -- VX_VERSION_ V2_ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Configures the protocols that the location service supports - for assisted GLONASS. - - Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set - in the LPP configuration for this to take effect. - */ - - /* Optional */ - /* SUPL Hash Algorithm */ - uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ - qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL hash algorithm to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later. - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later. - */ - - /* Optional */ - /* SUPL TLS Version */ - uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ - qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL Transport Layer Security (TLS) version. This configuration is only - applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. - Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0. - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1. - */ - - /* Optional */ - /* Emergency Protocol */ - uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ - qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< Configures the protocol to be used during emergency. \n - \textbf{Note:} Currently, this can only be selected on WCDMA. For GSM - and 1x, the UE only allows a control plane NI trigger for positioning. - For LTE, the UE allows either a SUPL or a control plane NI trigger. \n - Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane protocol during an emergency while on WCDMA. - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA. - */ -}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted GLONASS configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL hash algorithm configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter. */ -#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure parameters stored - in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Set Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ - qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; - /**< Identifies parameters that were not set successfully. This field - is sent only if the status is not SUCCESS. - - Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. - */ -}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: \n - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter. - - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter. - */ -}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the configuration - parameters stored in the nonvolatile memory. */ -typedef struct { - - /* Mandatory */ - /* Get Config Params Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Security */ - uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ - uint8_t suplSecurity; - /**< Indicates whether SUPL security is enabled. - \begin{itemize1} - \item 0x01 (TRUE) -- SUPL security is enabled - \item 0x00 (FALSE) -- SUPL security is disabled - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* VX Version */ - uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ - qmiLocVxVersionEnumT_v02 vxVersion; - /**< VX version. - - Valid values: \begin{itemize1} - \item 0x00000001 -- VX_VERSION_V1_ ONLY - \item 0x00000002 -- VX_VERSION_V2_ ONLY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* SUPL Version */ - uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ - qmiLocSuplVersionEnumT_v02 suplVersion; - /**< SUPL version. - - Valid values: \n - - 0x00000001 -- SUPL_VERSION_1_0 \n - - 0x00000002 -- SUPL_VERSION_2_0 - */ - - /* Optional */ - /* LPP Configuration */ - uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ - qmiLocLppConfigMaskT_v02 lppConfig; - /**< LTE Positioning Profile (LPP) configuration. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE - \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Assisted GLONASS Protocol Mask */ - uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ - qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; - /**< Assisted GLONASS Protocol mask. - - Valid bitmasks: \n - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane. - - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane. - QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set - in the LPP configuration for this to take effect. - */ - - /* Optional */ - /* SUPL Hash Algorithm */ - uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ - qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; - /**< SUPL hash algorithm to be used. Values: \n - - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later. - - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later. - */ - - /* Optional */ - /* SUPL TLS Version */ - uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ - qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; - /**< SUPL TLS version. This configuration is only - applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. - Values: \n - - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0. - - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1. - */ - - /* Optional */ - /* Emergency Protocol */ - uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ - qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; - /**< Protocol to be used during emergency. - Values: \n - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane protocol during an emergency while on WCDMA. - - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA. - */ -}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is - received. If sensor data are injected, the positioning engine - attempts to improve the heading and positioning performance using sensors. - This is the default. - */ - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position - improvement. */ - QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorsControlConfigSensorUseEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the sensor control configuration. */ -typedef struct { - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor control configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Sensors Usage */ - uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ - qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; - /**< Controls how sensors are used to aid the heading and positioning - performance. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SENSORS_USE_ ENABLED: - Sensors data is to be requested whenever a position request is - received. If sensors data is injected, the GNSS location engine - attempts to improve the heading and positioning performance using - sensors. This is the default. - \item 0x00000001 -- SENSORS_USE_ DISABLED: - Inertial sensors are not to be used to aid in the heading and - position improvement. - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPropertiesMaskT_v02; -#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter. */ -#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Sets the properties specific to the type of sensor used. - The control point must set sensor properties before they can be - used to aid in heading and positioning performance improvement. - */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_ SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Set Sensor Properties */ - uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ - qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; - /**< This field is sent only if the status is not SUCCESS. - Identifies the parameters that were not set successfully. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Sensor Properties Config Parameters */ - qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; - /**< Mask denoting the sensor properties parameters to be retrieved. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- GYRO_BIAS_ VARIANCE_RANDOM_WALK - \item 0x00000002 -- VELOCITY_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000004 -- ACCELERATION_ RANDOM_WALK_SPECTRAL_ DENSITY - \item 0x00000008 -- ANGLE_RANDOM_ WALK_SPECTRAL_DENSITY - \item 0x00000010 -- RATE_RANDOM_ WALK_SPECTRAL_DENSITY - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor properties. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Properties Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensors Properties request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000007 -- CONFIG_NOT_ SUPPORTED - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Gyro Bias Random Walk Variance */ - uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ - float gyroBiasVarianceRandomWalk; - /**< Specifies the gyro bias random walk variance parameter as a positive - floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. - The gyro bias variance random walk parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians^2/seconds^4 - - */ - - /* Optional */ - /* Velocity Random Walk Spectral Density */ - uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ - float velocityRandomWalkSpectralDensity; - /**< Specifies the velocity random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The velocity random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^2/Hertz^0.5 - - */ - - /* Optional */ - /* Acceleration Random Walk Spectral Density */ - uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ - float accelerationRandomWalkSpectralDensity; - /**< Specifies the acceleration random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The acceleration random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Meters/seconds^3/Hertz^0.5 - - */ - - /* Optional */ - /* Angle Random Walk Spectral Density */ - uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ - float angleRandomWalkSpectralDensity; - /**< Specifies the angle random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The angle random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds/Hertz^0.5 - - */ - - /* Optional */ - /* Rate Random Walk Spectral Density */ - uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ - float rateRandomWalkSpectralDensity; - /**< Specifies the rate random walk spectral density parameter as a positive - floating-point value. This value does not have any internal defaults. - The rate random walk spectral density parameter is derived from either the - sensors data sheet or a sensors conformance test. \n - - Units: Radians/seconds^2/Hertz^0.5 - - */ -}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. - This mode can optimize power consumption and give a - power-balanced positioning and heading enhancement using - inertial sensors */ - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. - This mode can be requested by the control point when - power consumption is not a restriction to the use of - inertial sensors. */ - QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocSensorPerformanceControlModeEnumT_v02; -/** - @} - */ - -typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; -#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with - GNSS. They can still be used for aiding in heading improvements. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Provides fine-grained control of sensor based positioning - performance. */ -typedef struct { - - /* Optional */ - /* Sensor Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensors data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensors control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x00000001 -- FORCED: \n - The GNSS location engine must request use of sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location - engine is to request acceleration data to be used by the low data rate - filter. The sensor data rate is specified in terms of the nominal number - of samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location - engine is to request gyro data to be used by the high data rate filter. - The sensor data rate is specified in terms of the nominal number of - samples per batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Sets which sensor algorithms are to be used when processing sensor data. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification. */ -#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Provides fine-grained control of sensor based positioning - performance. */ -typedef struct { - - /* Mandatory */ - /* Set Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Configuration */ - uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ - qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; - /**< Identifies parameters that were not configured successfully. This field - is sent only if the status is not a success. - - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- PERFORMANCE_ MODE - \item 0x00000002 -- ACCEL_SAMPLING_ SPEC - \item 0x00000004 -- GYRO_SAMPLING_ SPEC - \item 0x00000008 -- ALGORITHM_ CONFIG - \item 0x00000010 -- ACCEL_SAMPLING_ SPEC_HIGH - \item 0x00000020 -- GYRO_SAMPLING_ SPEC_HIGH - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty - * typedef struct { - * }qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Retrieves the current sensor performance control - configuration. */ -typedef struct { - - /* Mandatory */ - /* Get Sensor Perf Control Config Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Sensor Performance Control Configuration request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Performance Control Mode */ - uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ - qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; - /**< Controls when sensor data is requested during GNSS fix processing. - This field is relevant only when sensors have been enabled using the - sensor control configuration. - - Valid values: \begin{itemize1} - \item 0x00000000 -- AUTO: \n - The GNSS location engine can decide when to request sensor data - injection based on internal criteria. This is the default. - \item 0x0000001 -- FORCED: \n - The GNSS location engine must request use of the sensors every time - the GNSS location engine turns on. - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Accelerometer Sampling Specification */ - uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2Hz batching rate. - */ - - /* Optional */ - /* Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data - rate is specified in terms of the nominal number of samples per batch - and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 10 Hz sampling rate and 2 Hz batching rate. - */ - - /* Optional */ - /* Algorithm Configuration */ - uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ - qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; - /**< Informs which sensor algorithms are currently set. - - Valid bitmasks: \begin{itemize1} - \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* High Data Rate Filter Accelerometer Sampling Specification */ - uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - acceleration data to be used by the high data rate filter. The sensor - data rate is specified in terms of the nominal number of samples per - batch and the number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ - - /* Optional */ - /* High Data Rate Filter Gyroscope Sampling Specification */ - uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ - qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; - /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request - gyro data to be used by the high data rate filter. The sensor data rate - is specified in terms of the nominal number of samples per batch and the - number of batches per second. - However, the final control of the actual requested rate resides with - the Sensors Manager Module/GNSS location engine. \n - Default: 100 Hz sampling rate and 4 Hz batching rate. - */ -}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate ID */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate. \n - - Units: Bytes \n - - Range: 0 to 9 */ - - /* Mandatory */ - /* SUPL Certificate Data */ - uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ - uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; - /**< SUPL certificate contents. \n - - Type: Array of bytes. \n - - Maximum certificate size: 2000 bytes */ -}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Injection Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Optional */ - /* SUPL Certificate ID */ - uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ - uint8_t suplCertId; - /**< Certificate ID of the SUPL certificate to be deleted. \n - - Units: Bytes \n - - Range: 0 to 9 \n - If suplCertId is not specified, - all SUPL certificates are deleted. */ -}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Deletes a SUPL certificate. */ -typedef struct { - - /* Mandatory */ - /* SUPL Certificate Deletion Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete SUPL Certificate request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the - injected position in a direct position calculation. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the - SV usage in the fix. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data - in persistent memory. */ -#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000008) /**< Denotes whether the position engine stays on to optimize - the TTFF for the subsequent position fix. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Controls how the injected position is used in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Use the injected position in a direct position - calculation - \item 0x00 (FALSE) -- Do not use the injected position in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Controls whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Filter the usage of SVs in the fix - \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Controls whether assistance data is to be stored in - persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Store assistance data in persistent memory - \item 0x00 (FALSE) -- Do not store assistance data in persistent memory - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Enable Faster TTFF */ - uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ - uint8_t enableFasterTTFF; - /**< Allows the receiver to stay on after a position session in order to - collect information that will help reduce the Time To First Fix (TTFF) - when the next position request is made. The receiver will stay - on only if the engine determines that it needs to collect some - information. The receiver will stay on for the duration needed to - collect the information. - If enabled, the clients may see a delay in receiving the Engine Off - event after the position session ends. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF - \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced - TTFF - \end{itemize1} - The default value is TRUE.*/ -}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to configure position engine - functionality. */ -typedef struct { - - /* Mandatory */ - /* Set Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Set Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ - qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; - /**< Identifies the parameters that were not set successfully. - This field is sent only if the status is other than SUCCESS. - - Valid bitmasks:\n - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the - injected position in a direct position calculation. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the - SV usage in the fix. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data - in persistent memory. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize - the TTFF for the subsequent position fix. - */ -}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Config Parameters */ - qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; - /**< Mask denoting the configuration parameters to be retrieved. - - Valid bitmasks: - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the - injected position in a direct position calculation. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the - SV usage in the fix. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data - in persistent memory. - - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize - the TTFF for the subsequent position fix. - */ -}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the position engine - configuration parameters. */ -typedef struct { - - /* Mandatory */ - /* Get Position Engine Configuration Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Configuration Parameters request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Injected Position Control */ - uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ - uint8_t injectedPositionControl; - /**< Specifies whether the injected position is used for a direct calculation - in the position engine. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- The injected position is used in a direct - position calculation - \item 0x00 (FALSE) -- The injected position is not used in a direct - position calculation - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Filter SV Usage */ - uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ - uint8_t filterSvUsage; - /**< Specifies whether SV usage is filtered in a position fix. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- SV usage is filtered in the fix - \item 0x00 (FALSE) -- SV usage is not filtered in the fix - \end{itemize1} - The default value is FALSE. - */ - - /* Optional */ - /* Store Assist Data */ - uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ - uint8_t storeAssistData; - /**< Specifies whether assistance data is stored in persistent memory. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Assistance data is stored in persistent memory - \item 0x00 (FALSE) -- Assistance data is not stored in persistent - memory - \end{itemize1} - The default value is TRUE. - */ - - /* Optional */ - /* Enable Faster TTFF */ - uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ - uint8_t enableFasterTTFF; - /**< Allows the receiver to stay on after a position session in order to - collect information that will help reduce the TTFF - when the next position request is made. The receiver will stay - on only if the engine determines that it needs to collect some - information. The receiver will stay on for the duration needed to - collect the information. - If enabled, the clients may see a delay in receiving the Engine Off - event after the position session ends. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF - \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced - TTFF - \end{itemize1} - The default value is TRUE.*/ -}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint8_t qmiLocGeofenceBreachMaskT_v02; -#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported - when the Geofence is entered. */ -#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported - when the Geofence is exited. */ -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a - lower rate. The gap between actual breach and - the time it is reported is higher. This - setting results in lower power usage. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a - medium rate. This is the default setting. */ - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a - high rate. The gap between actual breach and - the time it is reported is low. This results - in higher power usage. */ - QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceResponsivenessEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< The Geofence engine indicates a breach with - low confidence. This setting results in lower - power usage. This setting can impact the "yield" because - incorrect breach events may be sent. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< The Geofence engine indicates a breach with - medium confidence. This is the default setting. */ - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< The Geofence engine indicates a breach with - high confidence. This setting results in higher - power usage. */ - QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceConfidenceEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - double latitude; - /**< Latitude of the center of the Geofence.*/ - - double longitude; - /**< Longitude of the center of the Geofence.*/ - - uint32_t radius; - /**< Radius of the circular Geofence in meters. */ -}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position inside a Geofence. */ - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position outside a Geofence. */ - QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofencePositionEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Add Circular Geofence - indication. */ - - /* Mandatory */ - /* Circular Geofence Arguments */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Mandatory */ - /* Breach Event Mask */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ - - /* Mandatory */ - /* Include Position in Breach Event */ - uint8_t includePosition; - /**< Specifies whether the Geofence engine is to include the position - in a breach event. - - Valid values: \begin{itemize1} - \item 0x01 (TRUE) -- Position will be reported with the breach event - \item 0x00 (FALSE) -- Position will not be reported with the breach - event - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Responsiveness */ - uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ - qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; - /**< Specifies the rate of detection for a Geofence breach. - This may impact the time lag between the actual breach event and - when it is reported. This parameter has power implications - and is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ RESPONSIVENESS_LOW - \item 0x00000002 -- GEOFENCE_ RESPONSIVENESS_MED - \item 0x00000003 -- GEOFENCE_ RESPONSIVENESS_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Confidence */ - uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ - qmiLocGeofenceConfidenceEnumT_v02 confidence; - /**< Given a breach event, the confidence determines the probability - that the breach happened at the Geofence boundary. - This parameter has power implications and - is to be fine-tuned to optimize power savings. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ CONFIDENCE_LOW - \item 0x00000002 -- GEOFENCE_ CONFIDENCE_MED - \item 0x00000003 -- GEOFENCE_ CONFIDENCE_HIGH - \vspace{-0.18in} \end{itemize1} */ -}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to add a circular Geofence. */ -typedef struct { - - /* Mandatory */ - /* Add Circular Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Add Circular Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_ MEMORY - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Add Circular - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Geofence identifier allocated by the engine. - The client must include this identifier in all transactions - pertaining to this Geofence. */ -}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be deleted. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Delete Geofence - indication. */ -}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to delete a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Delete Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Delete Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was deleted. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Delete - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ -}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< The Geofence was initiated by a network-initiated client. */ - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< The Geofence was initiated by the device. */ - QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceOriginEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< The Geofence is being actively monitored. */ - eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< The Geofence monitoring is suspended. */ - QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocGeofenceStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence that is to be queried. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned with the Query Geofence - indication. */ -}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to query a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Query Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Query Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was queried. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Query - Geofence request. This parameter will always be present - if the status field is set to SUCCESS. */ - - /* Optional */ - /* Geofence Origin */ - uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ - qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; - /**< Originator of the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ ORIGIN_NETWORK - \item 0x00000002 -- GEOFENCE_ ORIGIN_DEVICE - \vspace{-0.18in} \end{itemize1} - */ - - /* Optional */ - /* Position with Respect to Geofence */ - uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ - qmiLocGeofencePositionEnumT_v02 posWrtGeofence; - /**< Indicates if the client is currently inside or outside - the Geofence. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_ POSITION_INSIDE - \item 0x00000002 -- GEOFENCE_ POSITION_OUTSIDE - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Circular Geofence Parameters */ - uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ - qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND - \vspace{-0.18in} \end{itemize1} */ -}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Geofence ID */ - uint32_t geofenceId; - /**< Identifier for the Geofence to be edited. */ - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Edit Geofence - request. This parameter will always be present if the - status field is set to SUCCESS. - */ - - /* Optional */ - /* Geofence State */ - uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ - qmiLocGeofenceStateEnumT_v02 geofenceState; - /**< Specifies whether the Geofence is to be actively monitored. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_STATE_ ACTIVE - \item 0x00000002 -- GEOFENCE_STATE_ SUSPEND - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Breach Event Mask */ - uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ - qmiLocGeofenceBreachMaskT_v02 breachMask; - /**< Specifies the breach events in which the client is interested. - - Valid values: \begin{itemize1} - \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK - \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceReqMsgT_v02; /* Message */ -/** - @} - */ - -typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; -#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ -#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to edit a Geofence. */ -typedef struct { - - /* Mandatory */ - /* Edit Geofence Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Edit Geofence request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Geofence ID */ - uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ - uint32_t geofenceId; - /**< Identifier for the Geofence that was edited. */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is specified in the Edit Geofence request. */ - - /* Optional */ - /* Failed Parameters */ - uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ - qmiLocGeofenceConfigParamMaskT_v02 failedParams; - /**< Specified only when the status is not set to SUCCESS. If - the mask corresponding to a field is set, it indicates that - the Geofence parameter could not be edited. - - Valid values: \begin{itemize1} - \item 0x00000001 -- GEOFENCE_PARAM_ MASK_GEOFENCE_STATE - \item 0x00000002 -- GEOFENCE_PARAM_ MASK_BREACH_MASK - \vspace{-0.18in} \end{itemize1} */ -}qmiLocEditGeofenceIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The transaction ID - is returned in the Get Best Available Position indication. */ -}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to get the best available - position estimate from the location engine. */ -typedef struct { - - /* Mandatory */ - /* Get Best Available Position Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get Best Available Position request. - - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get Best - Available Position request. This parameter will - always be present if the status field is set to - SUCCESS. */ - - /* Optional */ - /* Latitude */ - uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ - double latitude; - /**< Latitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -90.0 to 90.0 \begin{itemize1} - \item Positive values indicate northern latitude - \item Negative values indicate southern latitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Longitude */ - uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ - double longitude; - /**< Longitude (specified in WGS84 datum). - \begin{itemize1} - \item Type: Floating point - \item Units: Degrees - \item Range: -180.0 to 180.0 \begin{itemize1} - \item Positive values indicate eastern longitude - \item Negative values indicate western longitude - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ - - /* Optional */ - /* Circular Horizontal Position Uncertainty */ - uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ - float horUncCircular; - /**< Horizontal position uncertainty (circular).\n - - Units: Meters */ - - /* Optional */ - /* Altitude With Respect to Ellipsoid */ - uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ - float altitudeWrtEllipsoid; - /**< Altitude with respect to the WGS84 ellipsoid.\n - - Units: Meters \n - - Range: -500 to 15883 */ - - /* Optional */ - /* Vertical Uncertainty */ - uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ - float vertUnc; - /**< Vertical uncertainty.\n - - Units: Meters */ - - /* Optional */ - /* UTC Timestamp */ - uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ - uint64_t timestampUtc; - /**< UTC timestamp. - \begin{itemize1} - \item Units: Milliseconds since Jan. 1, 1970 - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Time Uncertainty */ - uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ - float timeUnc; - /**< Time uncertainty. \n - - Units: Milliseconds */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ - uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ - float horUncEllipseSemiMinor; - /**< Semi-minor axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Semi-Major Axis */ - uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ - float horUncEllipseSemiMajor; - /**< Semi-major axis of horizontal elliptical uncertainty. \n - - Units: Meters */ - - /* Optional */ - /* Horizontal Elliptical Uncertainty Azimuth */ - uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ - float horUncEllipseOrientAzimuth; - /**< Elliptical horizontal uncertainty azimuth of orientation. \n - - Units: Decimal degrees \n - - Range: 0 to 180 */ - - /* Optional */ - /* Horizontal Circular Confidence */ - uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ - uint8_t horCircularConfidence; - /**< Horizontal circular uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Elliptical Confidence */ - uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ - uint8_t horEllipticalConfidence; - /**< Horizontal elliptical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Horizontal Reliability */ - uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ - qmiLocReliabilityEnumT_v02 horReliability; - /**< Specifies the reliability of the horizontal position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Horizontal Speed */ - uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ - float horSpeed; - /**< Horizontal speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Horizontal Speed Uncertainty */ - uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ - float horSpeedUnc; - /**< Horizontal speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Altitude With Respect to Sea Level */ - uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ - float altitudeWrtMeanSeaLevel; - /**< Altitude with respect to mean sea level. \n - - Units: Meters */ - - /* Optional */ - /* Vertical Confidence */ - uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ - uint8_t vertConfidence; - /**< Vertical uncertainty confidence. \n - - Units: Percent \n - - Range: 0 to 99 */ - - /* Optional */ - /* Vertical Reliability */ - uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ - qmiLocReliabilityEnumT_v02 vertReliability; - /**< Specifies the reliability of the vertical position. - - Valid values: \begin{itemize1} - \item 0x00000000 -- RELIABILITY_NOT_ SET - \item 0x00000001 -- RELIABILITY_ VERY_LOW - \item 0x00000002 -- RELIABILITY_LOW - \item 0x00000003 -- RELIABILITY_ MEDIUM - \item 0x00000004 -- RELIABILITY_HIGH - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Vertical Speed */ - uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ - float vertSpeed; - /**< Vertical speed. \n - - Units: Meters/second */ - - /* Optional */ - /* Vertical Speed Uncertainty */ - uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ - float vertSpeedUnc; - /**< Vertical speed uncertainty. \n - - Units: Meters/second */ - - /* Optional */ - /* Heading */ - uint8_t heading_valid; /**< Must be set to true if heading is being passed */ - float heading; - /**< Heading. \n - - Units: Degrees \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Heading Uncertainty */ - uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ - float headingUnc; - /**< Heading uncertainty. \n - - Type: Floating point \n - - Range: 0 to 359.999 */ - - /* Optional */ - /* Magnetic Deviation */ - uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ - float magneticDeviation; - /**< Difference between the bearing to true north and the bearing shown - on a magnetic compass. The deviation is positive when the magnetic - north is east of true north. */ - - /* Optional */ - /* Technology Used Mask */ - uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ - qmiLocPosTechMaskT_v02 technologyMask; - /**< Technology used in computing this fix. - Valid bitmasks: \n - - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- WiFi access points were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix. - - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix. - - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to - generate the fix. - - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix. - - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to - generate the fix. - */ - - /* Optional */ - /* Dilution of Precision */ - uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ - qmiLocDOPStructT_v02 DOP; - - /* Optional */ - /* GPS Time */ - uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ - qmiLocGPSTimeStructT_v02 gpsTime; - - /* Optional */ - /* Time Source */ - uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ - qmiLocTimeSourceEnumT_v02 timeSrc; - /**< Time source. - Valid values: \n - - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1x system. - - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., - associating network time with GPS time). - - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection. - - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data - from one GPS satellite. - - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data - from multiple satellites. - - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known. - - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained. - - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT. - This is done when the clock time uncertainty is large. - - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites - - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time - - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network - - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network - - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown - - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from the system clock (better known as the slow clock); - GNSS time is maintained irrespective of the GNSS receiver state - */ - - /* Optional */ - /* Sensor Data Usage */ - uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ - qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; - - /* Optional */ - /* SVs Used to Calculate the Fix */ - uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ - uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ - uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; - /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For SBAS: 33 to 64 - \item For GLONASS: 65 to 96 - \item For QZSS: 193 to 197 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ -}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ - eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ - eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ - QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionStateEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ - eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ - QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocMotionModeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - qmiLocMotionStateEnumT_v02 motion_state; - /**< Current motion state of the user. - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_ STATE_UNKNOWN (0) -- Device state is not known. - \item eQMI_LOC_MOTION_ STATE_STATIONARY (1) -- Device state is Stationary. - \item eQMI_LOC_MOTION_ STATE_IN_MOTION (2) -- Device state is In Motion. - \vspace{0.1in} \end{itemize1} - - Absolute rest and relative rest are both indicated by setting motion_state - to Stationary. The relative rest state can be distinguished from absolute - rest by reducing probability_of_state. - */ - - qmiLocMotionModeEnumT_v02 motion_mode; - /**< Modes of user motion. - - Valid values: \begin{itemize1} - \item eQMI_LOC_MOTION_MODE_ UNKNOWN (0) -- Device movement is not known. - \item eQMI_LOC_MOTION_MODE_ STATIONARY (1) -- Device is not moving. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_UNKNOWN (200) -- Device movement - is in Pedestrian mode; nothing else is known about the movement. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_WALKING (201) -- Device movement - is in Pedestrian Walking mode. - \item eQMI_LOC_MOTION_MODE_ PEDESTRIAN_RUNNING (202) -- Device movement - is in Pedestrian Running mode. - \item eQMI_LOC_MOTION_MODE_ VEHICLE_UNKNOWN (300) -- Device movement is - in Vehicular mode; nothing else is known about the movement. - \vspace{0.1in} \end{itemize1} - - The motion_mode value is independent of the motion_state value. - */ - - float probability_of_state; - /**< Probability that the device is actually undergoing the motion state - specified by the combination of the values of motion_state, motion_mode, - and motion_sub_mode. \vspace{0.1in} - - This value is a floating point number in the range of 0 to 100, in - units of percent probability. Any value greater than 99.9999 is - applied as 99.9999. \vspace{0.1in} - - It is recommended that if a particular combination of motion_state and - motion_mode cannot be determined with more than 50 percent confidence, - that a more general statement of user motion be made. - For example, if the mode of In-Motion + Pedestrian-Running can only be - determined with 50 percent probability, and the simpler statement of In-Motion - can be determined with 90 percent probability, it is recommended that this field - be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} - - If the motion_state is not known, the value in this field is not used. - */ - - uint16_t age; - /**< Age of the motion data in milliseconds at the time of injection. - */ - - uint16_t timeout; - /**< If the age of the motion data input exceeds the timeout value, the data - will no longer be used. The timeout value is in units of milliseconds. - Values in the range of 0 to 10000 are accepted. If 65535 is provided, - the motion data input is applied until the next input is - received. \n - - If the determination of motion data is an instantaneous observation - and no notice is guaranteed to be given via the QMI on a change in the - state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} - - If the determination of motion data is continuously monitored - external to the QMI and an update is always applied to the QMI upon any - change in state, a value of 65535 is used for this field. - Note that in this case, if a certain mode is set and is not later - unset (e.g., by sending in the request message with a user motion - state of Unknown), the value is applied indefinitely. - */ -}qmiLocMotionDataStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Motion Data */ - qmiLocMotionDataStructT_v02 motion_data; -}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects motion data for MSM GPS service use. */ -typedef struct { - - /* Mandatory */ - /* Inject Motion Data Request Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Motion Data request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Transaction ID */ - uint32_t transactionId; - /**< Identifies the transaction. The same transaction ID - will be returned in the Get NI Geofence ID List indication. */ -}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to retrieve the list of network - initiated Geofence IDs. */ -typedef struct { - - /* Mandatory */ - /* Get NI Geofence ID List Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Get NI Geofence ID List request. - Valid values: \n - - 0x00000000 -- SUCCESS \n - - 0x00000001 -- GENERAL_FAILURE \n - - 0x00000002 -- UNSUPPORTED \n - - 0x00000004 -- ENGINE_BUSY \n - - 0x00000006 -- TIMEOUT */ - - /* Optional */ - /* Transaction ID */ - uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ - uint32_t transactionId; - /**< Transaction ID that was specified in the Get NI - Geofence ID List request. */ - - /* Optional */ - /* NI Geofence ID List */ - uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ - uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ - uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; - /**< List containing the NI Geofence IDs. - - Type: Array of unsigned 32-bit integers \n - - Maximum NI Geofence ID List length: 16 */ -}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t MCC; - /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ - - uint32_t MNC; - /**< GSM mobile network code. Refer to \hyperref[S6]{[S6]}. */ - - uint32_t LAC; - /**< GSM location area code. Refer to \hyperref[S6]{[S6]}. */ - - uint32_t CID; - /**< GSM cell identification. Refer to \hyperref[S6]{[S6]}. */ -}qmiLocGSMCellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects GSM cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* GSM Cell ID */ - qmiLocGSMCellIdStructT_v02 gsmCellId; - /**< \vspace{0.06in} \n Identifies the GSM cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - uint8_t roamingStatus; - /**< Indicates whether the device is roaming. - \begin{itemize1} - \item 0x01 (TRUE) -- Device is roaming - \item 0x00 (FALSE) -- Device is not roaming - \vspace{-0.18in} \end{itemize1}*/ - - /* Optional */ - /* Timing Advance */ - uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ - uint32_t timingAdvance; - /**< Round trip delay between the MS and the BS, in units of 3.69 microseconds. - Refer to 3GPP TS 05.10 and TS 45.010. */ -}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects GSM cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject GSM Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject GSM Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network. */ - eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network. */ - QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocRoamingStatusEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t mcc; - /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ - - uint32_t mnc; - /**< WCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ - - uint32_t cid; - /**< WCDMA cell identity. Refer to \hyperref[S6]{[S6]}. */ -}qmiLocWCDMACellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects WCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* WCDMA Cell ID */ - qmiLocWCDMACellIdStructT_v02 wcdmaCellId; - /**< \n Identifies the WCDMA cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Indicates whether the device is roaming. - Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e., it is camped on - its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e., it is camped - on a roaming network. - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cell Frequency */ - uint8_t freq_valid; /**< Must be set to true if freq is being passed */ - uint32_t freq; - /**< Frequency information of the serving cell. \n - Valid range: 0 to 16383 \n - Refer to TS 25.331 \hyperref[S7]{[S7]}. */ - - /* Optional */ - /* Primary Scrambling Code */ - uint8_t psc_valid; /**< Must be set to true if psc is being passed */ - uint32_t psc; - /**< Primary scrambling code of the serving cell. \n - Valid range: 0 to 511 \n - Refer to \hyperref[S7]{[S7]}. */ -}qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects WCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject WCDMA Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject WCDMA Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_aggregates - @{ - */ -typedef struct { - - uint32_t mcc; - /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ - - uint32_t mnc; - /**< TDSCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ - - uint32_t cid; - /**< TDSCDMA cell identity. Refer to TS 25.331 \hyperref[S7]{[S7]}. */ - - uint32_t lac; - /**< TDSCDMA location area code. Refer to \hyperref[S6]{[S6]}. */ -}qmiLocTDSCDMACellIdStructT_v02; /* Type */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects TDSCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* TDSCDMA Cell ID */ - qmiLocTDSCDMACellIdStructT_v02 tdscdmaCellId; - /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ - - /* Mandatory */ - /* Roaming Status */ - qmiLocRoamingStatusEnumT_v02 roamingStatus; - /**< Indicates whether the device is roaming. - Valid values: \begin{itemize1} - \item eQMI_LOC_PHONE_NOT_ROAMING -- Device not roaming, i.e., it is camped on - its home network - \item eQMI_LOC_PHONE_ROAMING -- Device is currently roaming, i.e., it is camped - on a roaming network - \vspace{-0.18in} \end{itemize1} */ - - /* Optional */ - /* Cell Frequency */ - uint8_t freq_valid; /**< Must be set to true if freq is being passed */ - uint32_t freq; - /**< Frequency information of the serving cell. \n - Valid range: 0 to 16383 \n - Refer to \hyperref[S7]{[S7]}. */ -}qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects TDSCDMA cell information into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject TDSCDMA Cell Info Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject TDSCDMA Cell Info request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects the phone's subscriber ID into the location engine. */ -typedef struct { - - /* Optional */ - /* Preferred IMSI */ - uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ - uint64_t preferredIMSI; - /**< IMSI number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ - - /* Optional */ - /* Preferred MSISDN */ - uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ - uint64_t preferredMSISDN; - /**< MSISDN number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ -}qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects the phone's subscriber ID into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Subscriber ID Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Subscriber ID request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_enums - @{ - */ -typedef enum { - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL network-initiated message is being injected. */ - QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ -}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Injects a network-initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Injected Network Initiated Message Type */ - qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; - /**< Type of the network-initiated message being injected. - - Valid values: - - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL network-initiated message is being injected. */ - - /* Mandatory */ - /* Injected Network Initiated Message */ - uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ - uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; - /**< Network-initiated message body. - If the inject NI message type is TYPE_SUPL, the message contains - a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ -}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Injects a network-initiated message into the location - engine. */ -typedef struct { - - /* Mandatory */ - /* Inject Network Initiated Message Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Inject Network Initiated Message request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \item 0x00000008 -- INSUFFICIENT_ MEMORY - \vspace{-0.18in} \end{itemize1} */ -}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ -/** - @} - */ - -/* - * qmiLocWWANOutOfServiceNotificationReqMsgT is empty - * typedef struct { - * }qmiLocWWANOutOfServiceNotificationReqMsgT_v02; - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Notifies the location engine that the device is out of - service. */ -typedef struct { - - /* Mandatory */ - /* Notify WWAN Out of Service Status */ - qmiLocStatusEnumT_v02 status; - /**< Status of the Notify WWAN Out of Service request. - - Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_ PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Request Message; Used by the control point to inject pedometer data - into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Time Source */ - qmiLocSensorDataTimeSourceEnumT_v02 timeSource; - /**< Time source for the pedometer. The location service uses - this field to identify the time reference used in the - pedometer data time stamp. Values: \n - - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- The sensor time source is unspecified. - - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- The time source is common between the sensors and - the location engine. */ - - /* Mandatory */ - /* Pedometer Report Timestamp */ - uint32_t timestamp; - /**< Time stamp of the last step event in this report, i.e., the time stamp - of the step event that caused this report to be generated. - The time stamp is in the time reference scale that is - used by the pedometer time source. \n - - Units: Milliseconds */ - - /* Mandatory */ - /* Time Interval */ - uint32_t timeInterval; - /**< Time interval during which the step count was calculated. Subtracting - timeInterval from the timestamp field yields the time when - the step detection for the first step in this report started. \n - - Units: Milliseconds */ - - /* Mandatory */ - /* Step Count */ - uint32_t stepCount; - /**< Number of steps counted during the time interval. */ - - /* Optional */ - /* Step Confidence */ - uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ - uint8_t stepConfidence; - /**< Confidence associated with the step. This field is only applicable - for a single step report, i.e., if the step count is one. \n - - Range: 0 to 100 \n - \textbf{Note:} The report is ignored if confidence is 0. */ - - /* Optional */ - /* Step Count Uncertainty */ - uint8_t stepCountUncertainty_valid; /**< Must be set to true if stepCountUncertainty is being passed */ - float stepCountUncertainty; - /**< Uncertainty (in steps) associated with the step count. */ - - /* Optional */ - /* Step Rate */ - uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ - float stepRate; - /**< Current estimate for the rate of steps per second. \n - - Units: steps/second \n - - Range: >= 0.0 */ -}qmiLocPedometerReportReqMsgT_v02; /* Message */ -/** - @} - */ - -/** @addtogroup loc_qmi_messages - @{ - */ -/** Indication Message; Used by the control point to inject pedometer data - into the location engine. */ -typedef struct { - - /* Mandatory */ - /* Status of Pedometer Report Request */ - qmiLocStatusEnumT_v02 status; - /**< Valid values: \begin{itemize1} - \item 0x00000000 -- SUCCESS - \item 0x00000001 -- GENERAL_FAILURE - \item 0x00000002 -- UNSUPPORTED - \item 0x00000003 -- INVALID_PARAMETER - \item 0x00000004 -- ENGINE_BUSY - \item 0x00000005 -- PHONE_OFFLINE - \item 0x00000006 -- TIMEOUT - \vspace{-0.18in} \end{itemize1} - */ -}qmiLocPedometerReportIndMsgT_v02; /* Message */ -/** - @} - */ - -/*Service Message Definition*/ -/** @addtogroup loc_qmi_msg_ids - @{ - */ -#define QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02 0x001E -#define QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02 0x001E -#define QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02 0x001F -#define QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02 0x001F -#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 -#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 -#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 -#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 -#define QMI_LOC_START_REQ_V02 0x0022 -#define QMI_LOC_START_RESP_V02 0x0022 -#define QMI_LOC_STOP_REQ_V02 0x0023 -#define QMI_LOC_STOP_RESP_V02 0x0023 -#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 -#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 -#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 -#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 -#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 -#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 -#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A -#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B -#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C -#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D -#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E -#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F -#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 -#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 -#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 -#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 -#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 -#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 -#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 -#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 -#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 -#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 -#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 -#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 -#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 -#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 -#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A -#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A -#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B -#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B -#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C -#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C -#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D -#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D -#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E -#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E -#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F -#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F -#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 -#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 -#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 -#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 -#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 -#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 -#define QMI_LOC_SET_SERVER_IND_V02 0x0042 -#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 -#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 -#define QMI_LOC_GET_SERVER_IND_V02 0x0043 -#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 -#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 -#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 -#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 -#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 -#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 -#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 -#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 -#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 -#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 -#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A -#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A -#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B -#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B -#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C -#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C -#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D -#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D -#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E -#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F -#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 -#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 -#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 -#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 -#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 -#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 -#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 -#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 -#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 -#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 -#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 -#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 -#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A -#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B -#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C -#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D -#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E -#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F -#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F -#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 -#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 -#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 -#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 -#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 -#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 -#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 -#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 -#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 -#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 -#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 -#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 -#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 -#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 -#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A -#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B -#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C -#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C -#define QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 0x006D -#define QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02 0x006E -#define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F -#define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F -#define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02 0x0070 -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02 0x0070 -#define QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02 0x0070 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02 0x0071 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02 0x0071 -#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02 0x0071 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02 0x0072 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02 0x0072 -#define QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02 0x0072 -/** - @} - */ - -/* Service Object Accessor */ -/** @addtogroup wms_qmi_accessor - @{ - */ -/** This function is used internally by the autogenerated code. Clients should use the - macro loc_get_service_object_v02( ) that takes in no arguments. */ -qmi_idl_service_object_type loc_get_service_object_internal_v02 - ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); - -/** This macro should be used to get the service object */ -#define loc_get_service_object_v02( ) \ - loc_get_service_object_internal_v02( \ - LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ - LOC_V02_IDL_TOOL_VERS ) -/** - @} - */ - - -#ifdef __cplusplus -} -#endif -#endif From 0d78c70622265942a51609a7a6786efe1daec435 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 23 Jul 2013 09:28:20 -0700 Subject: [PATCH 147/945] Disable xtra url query off by default In some targets, the xtra url query can cause modem to crash on bootup. Change-Id: Ib224b382892257737598b1cc40f78ddcd4b90fd2 --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index c0943da3..539c3a12 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -2,7 +2,7 @@ # If XTRA_SERVER_QUERY is on, the XTRA_SERVERs listed # below will be ignored, and instead the servers will # be queried from the modem. -XTRA_SERVER_QUERY=1 +XTRA_SERVER_QUERY=0 # XTRA_SERVERs below are used only if XTRA_SERVER_QUERY # is off. XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin From e5e62728a24fc5c11f6140d11266017c79f1b77e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 30 Jul 2013 13:34:25 -0700 Subject: [PATCH 148/945] A mechanism to detect APQ chip set The current changes to default the operation mode to Standalone by the CHIP ID. A new method is used for solving this issue. CRs-Fixed: 510462 Change-Id: I58fd85e2c28bf824edeaef62660c62c34761bd37 --- loc_api/libloc_api_50001/loc.cpp | 8 +++--- utils/loc_log.cpp | 35 ++++++++++++++++++------ utils/loc_log.h | 2 +- utils/loc_target.cpp | 46 +++++++++++++++++++------------- utils/loc_target.h | 30 ++++++++++++++------- 5 files changed, 80 insertions(+), 41 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 63cf8f43..4ada9072 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -205,7 +205,7 @@ const GpsInterface* gps_get_hardware_interface () // for gps.c extern "C" const GpsInterface* get_gps_interface() { - targetEnumType target = TARGET_OTHER; + unsigned int target = TARGET_DEFAULT; if (NULL == loc_afw_data.context) { loc_eng_read_config(); @@ -214,8 +214,8 @@ extern "C" const GpsInterface* get_gps_interface() target = get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - //APQ8064 and APQ8030 - if((target == TARGET_APQ8064_STANDALONE) || (target == TARGET_APQ8030_STANDALONE)) { + //APQ8064 + if( getTargetGnssType(target) == GNSS_GSS ) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); if (gss_fd < 0) { @@ -226,7 +226,7 @@ extern "C" const GpsInterface* get_gps_interface() } } //MPQ8064 - else if(target == TARGET_MPQ8064) { + else if( getTargetGnssType(target) == GNSS_NONE) { LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); return NULL; } diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 533fabde..f755d70d 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -39,6 +39,9 @@ #endif /* USE_GLIB */ #include "log_util.h" #include "platform_lib_includes.h" + +#define BUFFER_SIZE 120 + // Logging Improvements const char *loc_logger_boolStr[]={"False","True"}; const char VOID_RET[] = "None"; @@ -105,12 +108,12 @@ const char* log_succ_fail_string(int is_succ) //Target names loc_name_val_s_type target_name[] = { - NAME_VAL(TARGET_OTHER), - NAME_VAL(TARGET_APQ8064_STANDALONE), - NAME_VAL(TARGET_APQ8064_FUSION3), - NAME_VAL(TARGET_MPQ8064), - NAME_VAL(TARGET_MSM8930), - NAME_VAL(TARGET_APQ8030_STANDALONE) + NAME_VAL(GNSS_NONE), + NAME_VAL(GNSS_MSM), + NAME_VAL(GNSS_GSS), + NAME_VAL(GNSS_MDM), + NAME_VAL(GNSS_GRIFFON), + NAME_VAL(GNSS_UNKNOWN) }; static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); @@ -128,11 +131,27 @@ RETURN VALUE The target name string ===========================================================================*/ -const char *loc_get_target_name(targetEnumType target) +const char *loc_get_target_name(unsigned int target) { - return loc_get_name_from_val(target_name, target_name_num, (long)target); + int index = 0; + char ret[BUFFER_SIZE]; + + index = getTargetGnssType(target); + if( index >= target_name_num || index < 0) + index = target_name_num - 1; + + if( (target & HAS_SSC) == HAS_SSC ) { + sprintf(ret, " %s with SSC", + loc_get_name_from_val(target_name, target_name_num, (long)index) ); + } + else { + sprintf(ret, " %s without SSC", + loc_get_name_from_val(target_name, target_name_num, (long)index) ); + } + return ret; } + /*=========================================================================== FUNCTION loc_get_time diff --git a/utils/loc_log.h b/utils/loc_log.h index abe29b77..82dc6368 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -55,7 +55,7 @@ typedef struct const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); const char* loc_get_msg_q_status(int status); -const char* loc_get_target_name(targetEnumType target); +const char* loc_get_target_name(unsigned int target); extern const char* log_succ_fail_string(int is_succ); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 92eaa45f..26df4cb1 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -81,9 +81,9 @@ static int read_a_line(const char * file_path, char * line, int line_size) return result; } -targetEnumType get_target(void) +unsigned int get_target(void) { - targetEnumType target = TARGET_OTHER; + unsigned int target = TARGET_DEFAULT; char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; char id[] = "/sys/devices/system/soc/soc0/id"; @@ -92,27 +92,35 @@ targetEnumType get_target(void) char rd_hw_platform[LINE_LEN]; char rd_id[LINE_LEN]; char rd_mdm[LINE_LEN]; + char baseband[LINE_LEN]; + property_get("ro.baseband", baseband, ""); read_a_line(hw_platform, rd_hw_platform, LINE_LEN); read_a_line( id, rd_id, LINE_LEN); - 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)) - target = TARGET_APQ8064_FUSION3; - else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || - (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) - target = TARGET_APQ8064_STANDALONE; - else if((!memcmp(rd_id, APQ8030_ID_1, LENGTH(APQ8030_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8030_ID_1)]))) - target = TARGET_APQ8030_STANDALONE; + 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)]) ) + target = TARGET_MPQ; + else + target = 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)) + target = 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)])) ) + target = TARGET_MSM_NO_SSC; } - else if (!memcmp(rd_id, APQ8074_ID_1, LENGTH(APQ8074_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8074_ID_1)])) - target = TARGET_APQ8064_STANDALONE; - else if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) - target = TARGET_MPQ8064; - 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)])) ) - target = TARGET_MSM8930; return target; } diff --git a/utils/loc_target.h b/utils/loc_target.h index 32c64b56..12cff1d2 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -28,22 +28,34 @@ */ #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_MPQ TARGET_SET(GNSS_NONE,NO_SSC) +#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) +#define getTargetGnssType(target) (target>>1) #ifdef __cplusplus extern "C" { #endif -typedef enum { - TARGET_OTHER = 0, - TARGET_APQ8064_STANDALONE, - TARGET_APQ8064_FUSION3, - TARGET_MPQ8064, - TARGET_MSM8930, - TARGET_APQ8030_STANDALONE -}targetEnumType; +unsigned int get_target(void); -targetEnumType get_target(void); +typedef enum { + GNSS_NONE = 0, + GNSS_MSM, + GNSS_GSS, + GNSS_MDM, + GNSS_GRIFFON, + GNSS_UNKNOWN +}GNSS_TARGET; + +typedef enum { + NO_SSC = 0, + HAS_SSC +}SSC_TYPE; #ifdef __cplusplus } From a915406668658c66698be3386c8796eb438ea282 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sun, 14 Jul 2013 17:45:13 -0700 Subject: [PATCH 149/945] Location Hal Design Level Change for FLP Requirement Changes can be highlighted with below summary: * Split the original LocApiAdapter to LocAdapter and LocApi. Now different adapter implementations can flexibly connect to different LocApi; * LocApi continues to abstract the API binding to RPC or QMI; * MsgTask which creates and owns a msg Q and a thread, and it define a LocMsg base msg class. The handler pulls a msg out of the Q and calls its proc() method. This makes it possible for msg sender to keep the data in the msg encapsulated, as it no longer requires a central msg handler who must under- stand all data format. This used to be where all the compile time dependencies are tangled together; * Added Context to bundle MsgTask and LocApi; * Added LocDualContext specifically for the FLP Location Hal architecture requirement; * Placed all the base classes of the above in loc_core folder / loc_core namespace / libloc_core.so, so other libraries can easily use derive from here without having to pull in the loc_eng implementation, which is a large library to include or link to; Change-Id: I40abfba96dea76757c98530c1f5e076b34ba4ac7 --- core/Android.mk | 49 + core/ContextBase.cpp | 63 + core/ContextBase.h | 61 + core/LocAdapterBase.cpp | 147 ++ core/LocAdapterBase.h | 97 + core/LocApiBase.cpp | 475 ++++ core/LocApiBase.h | 254 ++ core/LocDualContext.cpp | 117 + core/LocDualContext.h | 68 + core/MsgTask.cpp | 133 + core/MsgTask.h | 66 + core/gps_extended.h | 92 + core/gps_extended_c.h | 256 ++ core/loc_core_log.cpp | 250 ++ .../loc_ulp.h => core/loc_core_log.h | 68 +- loc_api/Android.mk | 2 - .../libloc_api-rpc-glue/Android.mk | 12 +- .../{LocApiRpcAdapter.h => LocApiRpc.h} | 40 +- .../{LocApiRpcAdapter.cpp => LocApiRpc.cpp} | 276 +- loc_api/libloc_api_50001/Android.mk | 68 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 269 -- loc_api/libloc_api_50001/LocApiAdapter.h | 250 -- loc_api/libloc_api_50001/LocEngAdapter.cpp | 207 ++ loc_api/libloc_api_50001/LocEngAdapter.h | 238 ++ loc_api/libloc_api_50001/Makefile.am | 4 +- loc_api/libloc_api_50001/gps_extended.h | 111 - loc_api/libloc_api_50001/loc.cpp | 72 +- loc_api/libloc_api_50001/loc.h | 39 +- loc_api/libloc_api_50001/loc_eng.cpp | 2221 ++++++++++------- loc_api/libloc_api_50001/loc_eng.h | 31 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 21 +- loc_api/libloc_api_50001/loc_eng_agps.h | 29 +- .../loc_eng_dmn_conn_handler.cpp | 132 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 201 -- loc_api/libloc_api_50001/loc_eng_log.h | 14 - loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 - loc_api/libloc_api_50001/loc_eng_msg.h | 914 ++----- loc_api/libloc_api_50001/loc_eng_ni.cpp | 56 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 6 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 62 +- 40 files changed, 4617 insertions(+), 2987 deletions(-) create mode 100644 core/Android.mk create mode 100644 core/ContextBase.cpp create mode 100644 core/ContextBase.h create mode 100644 core/LocAdapterBase.cpp create mode 100644 core/LocAdapterBase.h create mode 100644 core/LocApiBase.cpp create mode 100644 core/LocApiBase.h create mode 100644 core/LocDualContext.cpp create mode 100644 core/LocDualContext.h create mode 100644 core/MsgTask.cpp create mode 100644 core/MsgTask.h create mode 100644 core/gps_extended.h create mode 100644 core/gps_extended_c.h create mode 100644 core/loc_core_log.cpp rename loc_api/libloc_api_50001/loc_ulp.h => core/loc_core_log.h (50%) rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/{LocApiRpcAdapter.h => LocApiRpc.h} (84%) rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/{LocApiRpcAdapter.cpp => LocApiRpc.cpp} (85%) delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.h create mode 100644 loc_api/libloc_api_50001/LocEngAdapter.cpp create mode 100644 loc_api/libloc_api_50001/LocEngAdapter.h delete mode 100644 loc_api/libloc_api_50001/gps_extended.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp diff --git a/core/Android.mk b/core/Android.mk new file mode 100644 index 00000000..f9074dbd --- /dev/null +++ b/core/Android.mk @@ -0,0 +1,49 @@ +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 + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + libdl \ + libandroid_runtime + +LOCAL_SRC_FILES += \ + MsgTask.cpp \ + 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 + +LOCAL_COPY_HEADERS_TO:= libloc_core/ +LOCAL_COPY_HEADERS:= \ + MsgTask.h \ + LocApiBase.h \ + LocAdapterBase.h \ + ContextBase.h \ + LocDualContext.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_core_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp new file mode 100644 index 00000000..7922cc21 --- /dev/null +++ b/core/ContextBase.cpp @@ -0,0 +1,63 @@ +/* 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_CtxBase" + +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +const char* ContextBase::mIzatLibName = "libloc_api_v02.so "; +// we initialized this handle to 1 because it can't possibly +// 1 if it ever gets assigned a value. NULL on the otherhand +// is possilbe. +void* ContextBase::mIzatLibHandle = (void*)1; + +void* ContextBase::getIzatLibHandle() +{ + if ((void*)1 == mIzatLibHandle) { + mIzatLibHandle = dlopen(mIzatLibName, RTLD_NOW); + } + return mIzatLibHandle; +} + +ContextBase::ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + mMsgTask(msgTask), + mLocApi(LocApiBase::create(mMsgTask, exMask, getIzatLibHandle())) +{ +} + +} diff --git a/core/ContextBase.h b/core/ContextBase.h new file mode 100644 index 00000000..b04def33 --- /dev/null +++ b/core/ContextBase.h @@ -0,0 +1,61 @@ +/* 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_CONTEXT_BASE__ +#define __LOC_CONTEXT_BASE__ + +#include +#include +#include +#include + +namespace loc_core { + +class LocAdapterBase; + +class ContextBase { + static const char* mIzatLibName; + static void* mIzatLibHandle; +protected: + const MsgTask* mMsgTask; + LocApiBase* mLocApi; + +protected: + ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + inline virtual ~ContextBase() { delete mLocApi; } + +public: + static void* getIzatLibHandle(); + inline const MsgTask* getMsgTask() { return mMsgTask; } + inline LocApiBase* getLocApi() { return mLocApi; } +}; + +} // namespace loc_core + +#endif //__LOC_CONTEXT_BASE__ diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp new file mode 100644 index 00000000..27b9f61f --- /dev/null +++ b/core/LocAdapterBase.cpp @@ -0,0 +1,147 @@ +/* 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_LocAdapterBase" + +#include +#include +#include +#include + +namespace loc_core { + +struct LocOpenMsg : public LocMsg { + LocAdapterBase* mLocAdapter; + LocApiBase* mLocApi; + inline LocOpenMsg(LocAdapterBase* locAdapter, + LocApiBase* locApi) : + LocMsg(), mLocAdapter(locAdapter), mLocApi(locApi) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->addAdapter(mLocAdapter); + } + inline void locallog() { + LOC_LOGV("LocOpen"); + } + inline virtual void log() { + locallog(); + } +}; + +// 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) : + mEvtMask(mask), mContext(context), + mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) +{ + sendMsg(new LocOpenMsg(this, mLocApi)); +} + +// This will be overridden by the individual adapters +// if necessary. +#define DEFAULT_IMPL(rtv) \ +{ \ + LOC_LOGW("%s: default implementation invoked", __func__); \ + return rtv; \ +} + +void LocAdapterBase:: + handleEngineDownEvent() +DEFAULT_IMPL() + +void LocAdapterBase:: + reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +DEFAULT_IMPL() + +void LocAdapterBase:: + reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +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) +} // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h new file mode 100644 index 00000000..aca70f59 --- /dev/null +++ b/core/LocAdapterBase.h @@ -0,0 +1,97 @@ +/* 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_API_ADAPTER_BASE_H +#define LOC_API_ADAPTER_BASE_H + +#include +#include + +namespace loc_core { + +class LocAdapterBase { +protected: + const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + ContextBase* mContext; + LocApiBase* mLocApi; + const MsgTask* mMsgTask; + + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context); + inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } + +public: + 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); + } + + // This will be overridden by the individual adapters + // if necessary. + inline virtual void handleEngineUpEvent() {} + virtual void handleEngineDownEvent() ; + virtual void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + virtual void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + 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; } +}; + +} // namespace loc_core + +#endif //LOC_API_ADAPTER_BASE_H diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp new file mode 100644 index 00000000..c6fef931 --- /dev/null +++ b/core/LocApiBase.cpp @@ -0,0 +1,475 @@ +/* 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_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(); + } +}; + +LocApiBase* LocApiBase::create(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + void* libHandle) +{ + LocApiBase* locApi = NULL; + + // first if can not be MPQ + if (TARGET_MPQ != get_target()) { + getLocApi_t* getter = NULL; + // needto check if locaction.so exists + void* handle = ContextBase::getIzatLibHandle(); + + if (NULL == handle || + NULL == (getter = (getLocApi_t*)dlsym(handle, "getLocApi")) || + NULL == (locApi = (*getter)(msgTask, exMask))) { + // only RPC is the option now + handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if (NULL != getter) { + locApi = (*getter)(msgTask, exMask); + } + } + } + } + + // locApi could still be NULL at this time + // we would then create a dummy one + if (NULL == locApi) { + locApi = new LocApiBase(msgTask, exMask); + } + + return locApi; +} + +LocApiBase::LocApiBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : + mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) +{ + memset(mLocAdapters, 0, sizeof(mLocAdapters)); +} + +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; + + TO_ALL_LOCADAPTERS(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; + open(mMask | (adapter->getEvtMask() & ~mExcludedMask)); + 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 + open(getEvtMask() & ~mExcludedMask); + } + } + } +} + +void LocApiBase::handleEngineUpEvent() +{ + // This will take care of renegotiating the loc handle + mMsgTask->sendMsg(new LocSsrMsg(this)); + + // 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) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask) + ); +} + +void LocApiBase::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportSv(svStatus, + locationExtended, + svExt) + ); +} + +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)); +} + + +// downward calls +// All below functions are to be defined by adapter specific modules: +// RPC, QMI, etc. The default implementation is empty. +#define DEFAULT_IMPL(rtv) \ +{ \ + LOC_LOGW("%s: default implementation invoked", __func__); \ + return rtv; \ +} + +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:: + setLPPConfig(uint32_t profile) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSensorControlConfig(int sensorUsage) +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:: + setExtPowerConfig(int isBatteryCharging) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setAGLONASSProtocol(unsigned long aGlonassProtocol) +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() + + +} // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h new file mode 100644 index 00000000..c027b3f8 --- /dev/null +++ b/core/LocApiBase.h @@ -0,0 +1,254 @@ +/* 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_API_BASE_H +#define LOC_API_BASE_H + +#include +#include +#include +#include + +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) +#define MAX_APN_LEN 100 + +namespace loc_core { + +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); + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< +#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); + +const MsgTask* LocDualContext::mMsgTask = NULL; +ContextBase* LocDualContext::mFgContext = NULL; +ContextBase* LocDualContext::mBgContext = NULL; + +char LocDualContext::mHasAgpsExt = 0xff; + +// the name must be shorter than 15 chars +const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; + +const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tCreator, name); + } + return mMsgTask; +} + +ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mFgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mFgContext = new LocDualContext(msgTask, + mFgExclMask); + } + return mFgContext; +} + +ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mBgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mBgContext = new LocDualContext(msgTask, + mBgExclMask); + } + return mBgContext; +} + +bool LocDualContext::hasAgpsExt() +{ + if (0xff == mHasAgpsExt) { + mHasAgpsExt = 0; + void* handle = ContextBase::getIzatLibHandle(); + if (NULL != handle) { + bool(*getter)() = (bool(*)())dlsym(handle, "hasAgpsExt"); + if (NULL != getter && (*getter)()) { + mHasAgpsExt = 1; + } + } + } + + return mHasAgpsExt == 1; +} + +LocDualContext::LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + ContextBase(msgTask, exMask) +{ +} + +} diff --git a/core/LocDualContext.h b/core/LocDualContext.h new file mode 100644 index 00000000..4e03bf44 --- /dev/null +++ b/core/LocDualContext.h @@ -0,0 +1,68 @@ +/* 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_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 char mHasAgpsExt; + + static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, + const char* name); + +protected: + LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + inline virtual ~LocDualContext() {} + +public: + 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(MsgTask::tCreate tCreator, + const char* name); + static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, + const char* name); + + static bool hasAgpsExt(); +}; + +} + +#endif //__LOC_ENG_CONTEXT__ diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp new file mode 100644 index 00000000..37813394 --- /dev/null +++ b/core/MsgTask.cpp @@ -0,0 +1,133 @@ +/* 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_MsgTask" + +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +#define MAX_TASK_COMM_LEN 15 + +static void LocMsgDestroy(void* msg) { + delete (LocMsg*)msg; +} + +MsgTask::MsgTask(tCreate tCreator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(NULL){ + if (tCreator) { + tCreator(threadName, loopMain, + (void*)new MsgTask(mQ, mAssociator)); + } else { + createPThread(threadName); + } +} + +MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(tAssociator){ + createPThread(threadName); +} + +inline +MsgTask::MsgTask(const void* q, tAssociate associator) : + mQ(q), mAssociator(associator){ +} + +MsgTask::~MsgTask() { + msg_q_unblock((void*)mQ); +} + +void MsgTask::createPThread(const char* threadName) { + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + pthread_t tid; + // create the thread here, then if successful + // and a name is given, we set the thread name + if (!pthread_create(&tid, &attr, loopMain, + (void*)new MsgTask(mQ, mAssociator)) && + NULL != threadName) { + char lname[MAX_TASK_COMM_LEN+1]; + memcpy(lname, threadName, MAX_TASK_COMM_LEN); + lname[MAX_TASK_COMM_LEN] = 0; + pthread_setname_np(tid, lname); + } +} + +void MsgTask::sendMsg(const LocMsg* msg) const { + msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); +} + +void* MsgTask::loopMain(void* arg) { + MsgTask* copy = (MsgTask*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + if (NULL != copy->mAssociator) { + copy->mAssociator(); + } + + LocMsg* msg; + int cnt = 0; + + while (1) { + LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); + + msq_q_err_type result = msg_q_rcv((void*)copy->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)); + // destroy the Q and exit + msg_q_destroy((void**)&(copy->mQ)); + delete copy; + return NULL; + } + + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); + + delete msg; + } + + delete copy; + + return NULL; +} + +} diff --git a/core/MsgTask.h b/core/MsgTask.h new file mode 100644 index 00000000..d09de731 --- /dev/null +++ b/core/MsgTask.h @@ -0,0 +1,66 @@ +/* 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 __MSG_TASK__ +#define __MSG_TASK__ + +#include +#include +#include +#include + +namespace loc_core { + +struct LocMsg { + inline LocMsg() {} + inline virtual ~LocMsg() {} + virtual void proc() const = 0; + inline virtual void log() const {} +}; + +class MsgTask { +public: + typedef void* (*tStart)(void*); + typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); + typedef int (*tAssociate)(); + MsgTask(tCreate tCreator, const char* threadName); + MsgTask(tAssociate tAssociator, const char* threadName); + ~MsgTask(); + void sendMsg(const LocMsg* msg) const; + +private: + const void* mQ; + tAssociate mAssociator; + MsgTask(const void* q, tAssociate associator); + static void* loopMain(void* copy); + void createPThread(const char* name); +}; + +} // namespace loc_core + +#endif //__MSG_TASK__ diff --git a/core/gps_extended.h b/core/gps_extended.h new file mode 100644 index 00000000..88b0415b --- /dev/null +++ b/core/gps_extended.h @@ -0,0 +1,92 @@ +/* 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. + */ + +#ifndef GPS_EXTENDED_H +#define GPS_EXTENDED_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + 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(MIN_POSSIBLE_FIX_INTERVAL), + preferred_accuracy(50), preferred_time(120000) { + 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/core/gps_extended_c.h b/core/gps_extended_c.h new file mode 100644 index 00000000..640668ff --- /dev/null +++ b/core/gps_extended_c.h @@ -0,0 +1,256 @@ +/* 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. + */ + +#ifndef GPS_EXTENDED_C_H +#define GPS_EXTENDED_C_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +/** 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 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + + +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 + +#define GPS_DELETE_ALMANAC_CORR 0x00001000 +#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 +#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 +#define GPS_DELETE_ALMANAC_GLO 0x00008000 +#define GPS_DELETE_SVDIR_GLO 0x00010000 +#define GPS_DELETE_SVSTEER_GLO 0x00020000 +#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 +#define GPS_DELETE_TIME_GPS 0x00080000 +#define GPS_DELETE_TIME_GLO 0x00100000 + +/** 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; + char ipv6_addr[16]; + 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; + + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_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_STANDALONE, + 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; + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +/** 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 + +/** 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; +} 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) + +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; + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* GPS_EXTENDED_C_H */ + diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp new file mode 100644 index 00000000..f67dfe0b --- /dev/null +++ b/core/loc_core_log.cpp @@ -0,0 +1,250 @@ +/* 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_core_log" + +#include +#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 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 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 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +}; +static 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 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 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 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 ) +}; +static 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 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 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 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 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 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_ulp.h b/core/loc_core_log.h similarity index 50% rename from loc_api/libloc_api_50001/loc_ulp.h rename to core/loc_core_log.h index f4b1d0ed..8a1825ac 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/core/loc_core_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -27,58 +27,32 @@ * */ -#ifndef __LOC_ULP_H__ -#define __LOC_ULP_H__ +#ifndef LOC_CORE_LOG_H +#define LOC_CORE_LOG_H #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif #include -#include -#include - -/** 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 - -#define ULP_MIN_INTERVAL_INVALID 0xffffffff - - -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; +#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 /* __cplusplus */ +#endif -#endif //__LOC_ULP_H__ +#endif /* LOC_CORE_LOG_H */ diff --git a/loc_api/Android.mk b/loc_api/Android.mk index c87df1f9..743b3860 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,8 +6,6 @@ LOCAL_PATH := $(call my-dir) ifneq ($(TARGET_NO_RPC),true) GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index c7a245b8..bb3d924b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -9,7 +9,7 @@ source_files:= \ src/loc_apicb_appinit.c \ src/loc_api_fixup.c \ src/loc_api_log.c \ - src/LocApiRpcAdapter.cpp + src/LocApiRpc.cpp LOCAL_SRC_FILES:= $(source_files) @@ -26,7 +26,7 @@ LOCAL_SHARED_LIBRARIES:= \ libcutils \ libcommondefs \ libgps.utils \ - libloc_adapter + libloc_core LOCAL_STATIC_LIBRARIES := \ libloc_api_rpcgen @@ -37,20 +37,20 @@ 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-rpc \ $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ $(TARGET_OUT_HEADERS)/librpc \ $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - hardware/msm7k/librpc + $(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)/loc_apicb_appinit.h \ + $(RPC_INC)/LocApiRpc.h LOCAL_MODULE:= libloc_api-rpc-qc LOCAL_MODULE_OWNER := qcom diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h similarity index 84% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 32ea6e7f..fef42199 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -26,24 +26,30 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#ifndef LOC_API_RPC_ADAPTER_H -#define LOC_API_RPC_ADAPTER_H +#ifndef LOC_API_RPC_H +#define LOC_API_RPC_H #include +#include #include -#include +#include +#include +using namespace loc_core; -class LocApiRpcAdapter : public LocApiAdapter { +class LocApiRpc : public LocApiBase { // RPC communication establishment rpc_loc_client_handle_type client_handle; - rpc_loc_event_mask_type eMask; 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 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); @@ -51,13 +57,16 @@ class LocApiRpcAdapter : public LocApiAdapter { 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); - int NIEventFillVerfiyType(GpsNiNotification ¬if, - rpc_loc_ni_notify_verify_e_type notif_priv); - GpsNiEncodingType convertNiEncodingType(int loc_encoding); + + virtual enum loc_api_adapter_err + open(LOC_API_ADAPTER_EVENT_MASK_T mask); + virtual enum loc_api_adapter_err + close(); public: - LocApiRpcAdapter(LocEng &locEng); - ~LocApiRpcAdapter(); + LocApiRpc(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + ~LocApiRpc(); int locEventCB(rpc_loc_client_handle_type client_handle, rpc_loc_event_mask_type loc_event, @@ -67,13 +76,11 @@ public: // RPC adapter interface implementations virtual enum loc_api_adapter_err - reinit(); - virtual enum loc_api_adapter_err - startFix(); + startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode *mode); + setPositionMode(const LocPosMode& mode); inline virtual enum loc_api_adapter_err enableData(int enable) { return enableData(enable, false); } virtual enum loc_api_adapter_err @@ -108,4 +115,7 @@ public: virtual void setInSession(bool inSession); }; -#endif //LOC_API_RPC_ADAPTER_H +extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + +#endif //LOC_API_RPC_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp similarity index 85% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index e836f103..879244da 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -27,24 +27,27 @@ * */ #define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_adapter" +#define LOG_TAG "LocSvc_api_rpc" #include #include #ifndef USE_GLIB #include #endif /* USE_GLIB */ -#include "LocApiRpcAdapter.h" -#include "loc_api_rpcgen_common_rpc.h" -#include "log_util.h" -#include "loc_log.h" -#include "loc_api_log.h" +#include +#include +#include +#include +#include +#include +#include #ifdef USE_GLIB #include #endif -#include "librpc.h" -#include "platform_lib_includes.h" +#include +#include +using namespace loc_core; #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (3072) @@ -77,7 +80,7 @@ static int32 loc_event_cb { MODEM_LOG_CALLFLOW(%s, loc_get_event_name(loc_event)); loc_callback_log(loc_event, loc_event_payload); - int32 ret_val = ((LocApiRpcAdapter*)user)->locEventCB(client_handle, 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; } @@ -101,17 +104,21 @@ SIDE EFFECTS 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)); - ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, 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; -LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return new LocApiRpcAdapter(locEng); -} - -const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = +const rpc_loc_event_mask_type LocApiRpc::locBits[] = { RPC_LOC_EVENT_PARSED_POSITION_REPORT, RPC_LOC_EVENT_SATELLITE_REPORT, @@ -124,27 +131,24 @@ const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = RPC_LOC_EVENT_STATUS_REPORT }; -LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : - LocApiAdapter(locEng), +// constructor +LocApiRpc::LocApiRpc(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + LocApiBase(msgTask, exMask), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - eMask(convertMask(locEng.eventMask)), dataEnableLastSet(-1) { memset(apnLastSet, 0, sizeof(apnLastSet)); loc_api_glue_init(); } -LocApiRpcAdapter::~LocApiRpcAdapter() +LocApiRpc::~LocApiRpc() { - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - - loc_close(client_handle); + close(); } rpc_loc_event_mask_type -LocApiRpcAdapter::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) +LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) { rpc_loc_event_mask_type newMask = 0; @@ -159,7 +163,7 @@ LocApiRpcAdapter::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) } enum loc_api_adapter_err -LocApiRpcAdapter::convertErr(int rpcErr) +LocApiRpc::convertErr(int rpcErr) { switch(rpcErr) { @@ -188,7 +192,7 @@ LocApiRpcAdapter::convertErr(int rpcErr) } } -void LocApiRpcAdapter::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) +void LocApiRpc::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) { static rpc_loc_engine_state_e_type last_state = RPC_LOC_ENGINE_STATE_MAX; @@ -208,12 +212,10 @@ void LocApiRpcAdapter::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) } } -int32 LocApiRpcAdapter::locEventCB(rpc_loc_client_handle_type client_handle, +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) { - locEngHandle.acquireWakelock(); - // Parsed report if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) { @@ -269,60 +271,89 @@ int32 LocApiRpcAdapter::locEventCB(rpc_loc_client_handle_type client_handle, NIEvent(&loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request); } - locEngHandle.releaseWakeLock(); 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 -LocApiRpcAdapter::reinit() +LocApiRpc::open(LOC_API_ADAPTER_EVENT_MASK_T mask) { enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); + // 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 (client_handle < 0) { - ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; + 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 -LocApiRpcAdapter::startFix() { - LOC_LOGD("LocApiRpcAdapter::startFix() called"); +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 -LocApiRpcAdapter::stopFix() { - LOC_LOGD("LocApiRpcAdapter::stopFix() called"); +LocApiRpc::stopFix() { + LOC_LOGD("LocApiRpc::stopFix() called"); return convertErr( loc_stop_fix(client_handle) ); } enum loc_api_adapter_err -LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) +LocApiRpc::setPositionMode(const LocPosMode& posMode) { rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + 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; - - if (NULL != posMode) - fixCriteria = *posMode; + 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); + (int32) client_handle, fixCriteria->min_interval, fixCriteria->mode); - switch (fixCriteria.mode) + switch (fixCriteria->mode) { case LOC_POSITION_MODE_MS_BASED: op_mode = RPC_LOC_OPER_MODE_MSB; @@ -348,25 +379,24 @@ LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) op_mode = RPC_LOC_OPER_MODE_STANDALONE; } - fix_criteria_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; 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->min_interval = fixCriteria->min_interval; fix_criteria_ptr->preferred_operation_mode = op_mode; - fix_criteria_ptr->min_interval = fixCriteria.min_interval; + 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; + 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; + 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) { + switch (fixCriteria->recurrence) { case GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; @@ -387,7 +417,7 @@ LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) } enum loc_api_adapter_err -LocApiRpcAdapter::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +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; @@ -413,7 +443,7 @@ LocApiRpcAdapter::setTime(GpsUtcTime time, int64_t timeReference, int uncertaint } enum loc_api_adapter_err -LocApiRpcAdapter::injectPosition(double latitude, double longitude, float accuracy) +LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) { /* IOCTL data */ rpc_loc_ioctl_data_u_type ioctl_data; @@ -452,7 +482,7 @@ LocApiRpcAdapter::injectPosition(double latitude, double longitude, float accura } enum loc_api_adapter_err -LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, +LocApiRpc::informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) { rpc_loc_ioctl_data_u_type data; @@ -489,7 +519,7 @@ LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, } enum loc_api_adapter_err -LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) +LocApiRpc::setAPN(char* apn, int len, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; int size = sizeof(apnLastSet); @@ -500,7 +530,7 @@ LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) } memcpy(apnLastSet, apn, size); - if (false == navigating) { + 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; @@ -518,17 +548,16 @@ LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) return rtv; } -void LocApiRpcAdapter::setInSession(bool inSession) +void LocApiRpc::setInSession(bool inSession) { - LocApiAdapter::setInSession(inSession); - if (false == navigating) { + if (!inSession) { enableData(dataEnableLastSet, true); setAPN(apnLastSet, sizeof(apnLastSet)-1, true); } } enum loc_api_adapter_err -LocApiRpcAdapter::setServer(const char* url, int len) +LocApiRpc::setServer(const char* url, int len) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_server_info_s_type *server_info_ptr; @@ -559,7 +588,7 @@ LocApiRpcAdapter::setServer(const char* url, int len) } enum loc_api_adapter_err -LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) +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; @@ -594,13 +623,13 @@ LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) } enum loc_api_adapter_err -LocApiRpcAdapter::enableData(int enable, boolean force) +LocApiRpc::enableData(int enable, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; if (force || dataEnableLastSet != enable) { dataEnableLastSet = enable; - if (false == navigating) { + 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; @@ -617,7 +646,7 @@ LocApiRpcAdapter::enableData(int enable, boolean force) } enum loc_api_adapter_err -LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) +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; @@ -631,7 +660,7 @@ LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) ); } -void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; @@ -723,30 +752,36 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca } LOC_LOGV("reportPosition: fire callback\n"); - LocApiAdapter::reportPosition(location, - locationExtended, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), - tech_Mask); + 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 { - LocApiAdapter::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); + 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"); + LOC_LOGV("loc_eng_report_position: ignore position report " + "when session status is not set\n"); } } -void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) +void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; @@ -846,51 +881,52 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if (SvStatus.num_svs >= 0) { - LocApiAdapter::reportSv(SvStatus, - locationExtended, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); + LocApiBase::reportSv(SvStatus, + locationExtended, + (void*)gnss_report_ptr); } } -void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_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) { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); + 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) { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); + LocApiBase::reportStatus(GPS_STATUS_SESSION_END); + LocApiBase::reportStatus(GPS_STATUS_ENGINE_OFF); } else { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); + LocApiBase::reportStatus(GPS_STATUS_NONE); } } } -void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +void LocApiRpc::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) { #if (AMSS_VERSION==3200) - LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); + LocApiBase::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); #else - LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences, - nmea_report_ptr->length); + 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[3], + nmea_report_ptr->nmea_sentences[4], nmea_report_ptr->nmea_sentences[5]); #endif /* #if (AMSS_VERSION==3200) */ } enum loc_api_adapter_err -LocApiRpcAdapter::setXtraData(char* data, int length) +LocApiRpc::setXtraData(char* data, int length) { int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; int total_parts; @@ -968,7 +1004,7 @@ LocApiRpcAdapter::setXtraData(char* data, int length) /* Request the Xtra Server Url from the modem */ enum loc_api_adapter_err -LocApiRpcAdapter::requestXtraServer() +LocApiRpc::requestXtraServer() { loc_api_adapter_err err; rpc_loc_ioctl_data_u_type data; @@ -1001,16 +1037,19 @@ LocApiRpcAdapter::requestXtraServer() return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; } - LocApiAdapter::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); + 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 -LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) +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; @@ -1084,7 +1123,7 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerTy } enum loc_api_adapter_err -LocApiRpcAdapter::atlCloseStatus(int handle, int is_succ) +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; @@ -1104,7 +1143,7 @@ LocApiRpcAdapter::atlCloseStatus(int handle, int is_succ) ); } -void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) +void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) { int connHandle; AGpsType agps_type; @@ -1140,7 +1179,7 @@ void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_requ } } -void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) +void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) { GpsNiNotification notif = {0}; @@ -1203,8 +1242,8 @@ void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) #endif /* #if (AMSS_VERSION==3200) */ char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - addr_len = LocApiAdapter::decodeAddress(lcs_addr, sizeof lcs_addr, address_source, - umts_cp_req->ext_client_address_data.ext_client_address_len); + 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) @@ -1283,10 +1322,10 @@ void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) // 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)); - LocApiAdapter::requestNiNotify(notif, (const void*)copy); + requestNiNotify(notif, (const void*)copy); } -int LocApiRpcAdapter::NIEventFillVerfiyType(GpsNiNotification ¬if, +int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, rpc_loc_ni_notify_verify_e_type notif_priv) { switch (notif_priv) @@ -1317,7 +1356,7 @@ int LocApiRpcAdapter::NIEventFillVerfiyType(GpsNiNotification ¬if, } enum loc_api_adapter_err -LocApiRpcAdapter::setSUPLVersion(uint32_t version) +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; @@ -1330,7 +1369,7 @@ LocApiRpcAdapter::setSUPLVersion(uint32_t version) ); } -GpsNiEncodingType LocApiRpcAdapter::convertNiEncodingType(int loc_encoding) +GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) { switch (loc_encoding) { @@ -1346,3 +1385,8 @@ GpsNiEncodingType LocApiRpcAdapter::convertNiEncodingType(int loc_encoding) return GPS_ENC_UNKNOWN; } } + +LocApiBase* getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) { + return new LocApiRpc(msgTask, exMask); +} diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 07172654..dd14b5e5 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -5,7 +5,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := libloc_adapter +LOCAL_MODULE := libloc_eng LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -13,51 +13,9 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ + libdl \ liblog \ - libgps.utils \ - libdl - -LOCAL_SRC_FILES += \ - loc_eng_log.cpp \ - LocApiAdapter.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - hardware/qcom/gps/loc_api/libloc_api_50001 - -LOCAL_COPY_HEADERS_TO:= libloc_eng/ -LOCAL_COPY_HEADERS:= \ - LocApiAdapter.h \ - loc.h \ - gps_extended.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_msg_id.h \ - loc_eng_log.h \ - loc_ulp.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_eng - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_adapter \ + libloc_core \ libgps.utils LOCAL_SRC_FILES += \ @@ -66,7 +24,8 @@ LOCAL_SRC_FILES += \ loc_eng_xtra.cpp \ loc_eng_ni.cpp \ loc_eng_log.cpp \ - loc_eng_nmea.cpp + loc_eng_nmea.cpp \ + LocEngAdapter.cpp LOCAL_SRC_FILES += \ loc_eng_dmn_conn.cpp \ @@ -81,8 +40,22 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ + hardware/qcom/gps/loc_api/libloc_api_50001 \ hardware/qcom/gps/loc_api/ulp/inc +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_msg_id.h \ + loc_eng_log.h + LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) @@ -90,6 +63,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -100,6 +74,7 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ liblog \ libloc_eng \ + libloc_core \ libgps.utils \ libdl \ libandroid_runtime @@ -119,6 +94,7 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ hardware/qcom/gps/loc_api/ulp/inc LOCAL_PRELINK_MODULE := false diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp deleted file mode 100644 index b26a4008..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ /dev/null @@ -1,269 +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. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_adapter" - -#include -#include -#include "loc_eng_msg.h" -#include "loc_log.h" -#include "loc_eng_ni.h" - -static void* noProc(void* data) -{ - return NULL; -} - -LocEng::LocEng(void* caller, - LOC_API_ADAPTER_EVENT_MASK_T emask, - gps_acquire_wakelock acqwl, - gps_release_wakelock relwl, - loc_msg_sender msgSender, - loc_msg_sender msgUlpSender, - loc_ext_parser posParser, - loc_ext_parser svParser) : - owner(caller), - eventMask(emask), acquireWakelock(acqwl), - releaseWakeLock(relwl), sendMsge(msgSender), - sendUlpMsg(msgUlpSender), - extPosInfo(NULL == posParser ? noProc : posParser), - extSvInfo(NULL == svParser ? noProc : svParser) -{ - LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); -} - -LocApiAdapter::LocApiAdapter(LocEng &locEng) : - locEngHandle(locEng), fixCriteria(), navigating(false) -{ - LOC_LOGD("LocApiAdapter created"); -} - -LocApiAdapter::~LocApiAdapter() -{ - LOC_LOGV("LocApiAdapter deleted"); -} - -LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) -{ - void* handle; - LocApiAdapter* adapter = NULL; - - handle = dlopen ("libloc_api_v02.so", RTLD_NOW); - - if (!handle) { - handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); - } - - if (!handle) { - adapter = new LocApiAdapter(locEng); - } else { - getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); - - adapter = (*getHandle)(locEng); - } - - return adapter; -} - -int LocApiAdapter::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 LocApiAdapter::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; -} - -void LocApiAdapter::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask ) -{ - loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); - if (locEngHandle.sendUlpMsg) { - locEngHandle.sendUlpMsg(locEngHandle.owner, msg); - } else { - locEngHandle.sendMsge(locEngHandle.owner, msg); - } -} - -void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) -{ - loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, 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 (locEngHandle.sendUlpMsg) { - locEngHandle.sendUlpMsg(locEngHandle.owner, msg); - } else { - locEngHandle.sendMsge(locEngHandle.owner, msg); - } -} - -void LocApiAdapter::reportStatus(GpsStatusValue status) -{ - loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportNmea(const char* nmea, int length) -{ - loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength) -{ - loc_eng_msg_report_xtra_server *msg(new loc_eng_msg_report_xtra_server(locEngHandle.owner, url1, url2, url3, maxlength)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) -{ - loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestSuplES(int connHandle) -{ - loc_eng_msg_request_supl_es *msg(new loc_eng_msg_request_supl_es(locEngHandle.owner, connHandle)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::releaseDataHandle(void) -{ - loc_eng_msg_close_data_call *msg(new loc_eng_msg_close_data_call(locEngHandle.owner)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::releaseATL(int connHandle) -{ - loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestXtraData() -{ - LOC_LOGD("XTRA download request"); - - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestTime() -{ - LOC_LOGD("loc_event_cb: XTRA time download request"); - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestLocation() -{ - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) -{ - notif.size = sizeof(notif); - notif.timeout = LOC_NI_NO_RESPONSE_TIME; - - loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineDownEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineUpEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportDataCallOpened() -{ - loc_eng_msg_atl_open_success *msg(new loc_eng_msg_atl_open_success(locEngHandle.owner, - AGPS_TYPE_INVALID, - NULL, 0, 0)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportDataCallClosed() -{ - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(locEngHandle.owner, - AGPS_TYPE_INVALID)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h deleted file mode 100644 index ace934e4..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ /dev/null @@ -1,250 +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_API_ADAPTER_H -#define LOC_API_ADAPTER_H - -#include -#include -#include -#include -#include -#include -#include "platform_lib_includes.h" - -#define MAX_APN_LEN 100 -#define MAX_URL_LEN 256 -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) - -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_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, - 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_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< +#include "loc_eng_msg.h" +#include "loc_log.h" + +using namespace loc_core; + +LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, + void* owner, loc_msg_sender msgSender, + MsgTask::tCreate tCreator) : + LocAdapterBase(mask, + LocDualContext::getLocFgContext( + tCreator, + LocDualContext::mLocationHalName)), + mOwner(owner), mSendUlpMsg(msgSender), mNavigating(false), + mAgpsEnabled(loc_core::LocDualContext::hasAgpsExt()) +{ + memset(&mFixCriteria, 0, sizeof(mFixCriteria)); + LOC_LOGD("LocEngAdapter created"); +} + +inline +LocEngAdapter::~LocEngAdapter() +{ + LOC_LOGV("LocEngAdapter deleted"); +} + +void LocEngAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask ) +{ + if (mSendUlpMsg) { + loc_eng_msg_report_position *msg( + new loc_eng_msg_report_position(mOwner, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); + mSendUlpMsg(mOwner, msg); + } else { + sendMsg(new LocEngReportPosition(mOwner, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); + } +} + +void LocEngAdapter::reportSv(GpsSvStatus &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 (mSendUlpMsg) { + loc_eng_msg_report_sv *msg( + new loc_eng_msg_report_sv(mOwner, svStatus, + locationExtended, svExt)); + mSendUlpMsg(mOwner, msg); + } else { + sendMsg(new LocEngReportSv(mOwner, svStatus, + locationExtended, svExt)); + } +} + +inline +void LocEngAdapter::reportStatus(GpsStatusValue status) +{ + sendMsg(new LocEngReportStatus(mOwner, 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 (mAgpsEnabled) { + sendMsg(new LocEngReportXtraServer(mOwner, url1, + url2, url3, maxlength)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestATL(mOwner, + connHandle, agps_type)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::releaseATL(int connHandle) +{ + if (mAgpsEnabled) { + sendMsg(new LocEngReleaseATL(mOwner, connHandle)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestXtraData() +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestXtra(mOwner)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestTime() +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestXtra(mOwner)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + if (mAgpsEnabled) { + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + sendMsg(new LocEngRequestNi(mOwner, notif, data)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestSuplES(int connHandle) +{ + sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); + return true; +} + +inline +bool LocEngAdapter::reportDataCallOpened() +{ + sendMsg(new LocEngSuplEsOpened(mOwner)); + return true; +} + +inline +bool LocEngAdapter::reportDataCallClosed() +{ + sendMsg(new LocEngSuplEsClosed(mOwner)); + return true; +} + +inline +void LocEngAdapter::handleEngineDownEvent() +{ + sendMsg(new LocEngDown(mOwner)); +} + +inline +void LocEngAdapter::handleEngineUpEvent() +{ + sendMsg(new LocEngUp(mOwner)); +} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h new file mode 100644 index 00000000..7e6f73bd --- /dev/null +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -0,0 +1,238 @@ +/* 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_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; + +typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); + +class LocEngAdapter : public LocAdapterBase { + void* mOwner; + loc_msg_sender mSendUlpMsg; + LocPosMode mFixCriteria; + bool mNavigating; + +public: + const bool mAgpsEnabled; + + LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, + void* owner, loc_msg_sender msgSender, + MsgTask::tCreate tCreator); + virtual ~LocEngAdapter(); + + 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 + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) + { + return mLocApi->setTime(time, timeReference, uncertainty); + } + 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 + setLPPConfig(uint32_t profile) + { + return mLocApi->setLPPConfig(profile); + } + inline enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage) + { + return mLocApi->setSensorControlConfig(sensorUsage); + } + 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 + setExtPowerConfig(int isBatteryCharging) + { + return mLocApi->setExtPowerConfig(isBatteryCharging); + } + inline virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol) + { + return mLocApi->setAGLONASSProtocol(aGlonassProtocol); + } + 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(); + } + + 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(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + 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(); + + inline const LocPosMode& getPositionMode() const + {return mFixCriteria;} + inline virtual bool isInSession() + { return mNavigating; } + inline void setInSession(bool inSession) + { mNavigating = inSession; mLocApi->setInSession(inSession); } +}; + +#endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index 93e633f5..cee948c1 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -5,7 +5,7 @@ AM_CFLAGS = \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocApiAdapter.cpp +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@ @@ -62,7 +62,7 @@ endif libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la library_include_HEADERS = \ - LocApiAdapter.h \ + LocEngAdapter.h \ loc.h \ loc_eng.h \ loc_eng_xtra.h \ diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h deleted file mode 100644 index f1db4729..00000000 --- a/loc_api/libloc_api_50001/gps_extended.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. - * - * Not a Contribution. - * - * Copyright (C) 2010 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. - */ - -#ifndef GPS_EXTENDED_H -#define GPS_EXTENDED_H - -/** 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 - -/** 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 - -#define GPS_DELETE_ALMANAC_CORR 0x00001000 -#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 -#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 -#define GPS_DELETE_ALMANAC_GLO 0x00008000 -#define GPS_DELETE_SVDIR_GLO 0x00010000 -#define GPS_DELETE_SVSTEER_GLO 0x00020000 -#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 -#define GPS_DELETE_TIME_GPS 0x00080000 -#define GPS_DELETE_TIME_GLO 0x00100000 - -/** 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; - char ipv6_addr[16]; - 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; - - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiExtCallbacks; - -#endif /* GPS_EXTENDED_H */ - diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4ada9072..9749703a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -31,7 +31,7 @@ #define LOG_TAG "LocSvc_afw" #include -#include +#include #include #include #include @@ -43,9 +43,16 @@ #include #include #include -#include - +#include +#include #include + +namespace android { + namespace AndroidRuntime { + void* createJavaThread(const char* name, void (*start)(void *), void* arg); + } +} + //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); @@ -206,7 +213,7 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { unsigned int target = TARGET_DEFAULT; - if (NULL == loc_afw_data.context) { + if (NULL == loc_afw_data.adapter) { loc_eng_read_config(); //We load up libulp module at this point itself @@ -245,8 +252,8 @@ static void loc_free_msg(void* msg) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) { - LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; - msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); + loc_eng_data_s_type* loc_eng = (loc_eng_data_s_type*)loc_eng_data_p; + msg_q_snd(loc_eng->ulp_q, msg, loc_free_msg); } /*=========================================================================== @@ -270,25 +277,24 @@ static int loc_hal_init(void) { int retVal = -1; ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event; -#ifdef TARGET_USES_QCOM_BSP - LOC_API_ADAPTER_EVENT_MASK_T event = - LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; -#else - LOC_API_ADAPTER_EVENT_MASK_T event = - 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; -#endif + if (loc_core::LocDualContext::hasAgpsExt()) { + event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | + LOC_API_ADAPTER_BIT_SATELLITE_REPORT | + LOC_API_ADAPTER_BIT_IOCTL_REPORT | + LOC_API_ADAPTER_BIT_STATUS_REPORT | + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; + } else { + event = 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; + } LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ local_status_cb, /* status_cb */ local_sv_cb, /* sv_status_cb */ @@ -467,9 +473,9 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain ENTRY_LOG(); int ret_val = 0; - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - #endif + } EXIT_LOG(%d, ret_val); return ret_val; @@ -610,21 +616,21 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngXTRAInterface; - #endif + } } else if (strcmp(name, AGPS_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngAGpsInterface; - #endif + } } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngNiInterface; - #endif + } } else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { @@ -1022,7 +1028,7 @@ static int loc_init(GpsCallbacks* callbacks) EXIT_LOG(%d, retVal); return retVal; } - memset(&afw_cb_data, NULL, sizeof (LocCallbacks)); + memset(&afw_cb_data, 0, sizeof (afw_cb_data)); gps_loc_cb = callbacks->location_cb; afw_cb_data.status_cb = callbacks->status_cb; gps_sv_cb = callbacks->sv_status_cb; diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 146063a2..334e03ee 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -37,28 +37,7 @@ extern "C" { #include #include #include -#include -#include "gps_extended.h" - -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ - -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_STANDALONE, - 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; +#include typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); @@ -78,22 +57,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; -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) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index db3cb3f9..ff5fd63c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,7 @@ #include #include -#include "LocApiAdapter.h" +#include #include #ifndef USE_GLIB @@ -70,6 +71,7 @@ #include #include "log_util.h" #include "platform_lib_includes.h" +#include "loc_core_log.h" #include "loc_eng_log.h" #define SUCCESS TRUE @@ -83,16 +85,10 @@ #define SAP_CONF_FILE "/etc/sap.conf" #endif -static void loc_eng_deferred_action_thread(void* context); -static void* loc_eng_create_msg_q(); -static void loc_eng_free_msg(void* msg); +using namespace loc_core; -pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; -LocEngContext* LocEngContext::me = NULL; boolean configAlreadyRead = false; unsigned int agpsStatus = 0; - loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; @@ -169,60 +165,6 @@ static void loc_default_parameters(void) gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; } -LocEngContext::LocEngContext(gps_create_thread threadCreator) : - deferred_q((const void*)loc_eng_create_msg_q()), - - //TODO: should we conditionally create ulp msg q? - ulp_q((const void*)loc_eng_create_msg_q()), - - deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), - counter(0) -{ - LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", - getpid(), GETTID_PLATFORM_LIB_ABSTRACTION, - deferred_action_thread); -} - -LocEngContext* LocEngContext::get(gps_create_thread threadCreator) -{ - pthread_mutex_lock(&lock); - // gonna need mutex protection here... - if (NULL == me) { - me = new LocEngContext(threadCreator); - } - me->counter++; - - pthread_mutex_unlock(&lock); - return me; -} - -void LocEngContext::drop() -{ - if (deferred_action_thread != pthread_self()) { - pthread_mutex_lock(&lock); - counter--; - if (counter == 0) { - loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); - msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); - - // I am not sure if this is going to be hazardous. The calling thread - // might be blocked for a while, if the q is loaded. I am wondering - // if we should just dump all the msgs in the q upon QUIT. - pthread_cond_wait(&cond, &lock); - - msg_q_destroy((void**)&deferred_q); - - msg_q_destroy((void**)&ulp_q); - - delete me; - me = NULL; - } - pthread_mutex_unlock(&lock); - } else { - LOC_LOGE("The HAL thread cannot free itself"); - } -} - // 2nd half of init(), singled out for // modem restart to use. static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data); @@ -241,7 +183,1197 @@ static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_ 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 char extra_data[100]; +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 void deleteAidingData(loc_eng_data_s_type &logEng); +static AgpsStateMachine* +getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType); + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +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(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) +{ + locallog(); +} +inline void LocEngStartFix::proc() const +{ + loc_eng_start_handler(*mLocEng); +} +inline void LocEngStartFix::locallog() const +{ + LOC_LOGV("LocEngStartFix"); +} +inline void LocEngStartFix::log() const +{ + locallog(); +} +void LocEngStartFix::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_STOP_FIX: +LocEngStopFix::LocEngStopFix(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) +{ + locallog(); +} +inline void LocEngStopFix::proc() const +{ + loc_eng_stop_handler(*mLocEng); +} +inline void LocEngStopFix::locallog() const +{ + LOC_LOGV("LocEngStopFix"); +} +inline void LocEngStopFix::log() const +{ + locallog(); +} +void LocEngStopFix::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->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); +} + +// case LOC_ENG_MSG_SET_TIME: +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 { + 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 { + 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 { + mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + } + inline void locallog() const { + LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); + } + 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 { + mAdapter->setSUPLVersion(mSuplVer); + } + inline void locallog() const { + LOC_LOGV("SUPL Version: %d", mSuplVer); + } + 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 { + 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; + inline LocEngSensorControlConfig(LocEngAdapter* adapter, + int sensorsDisabled) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSensorControlConfig(mSensorsDisabled); + } + inline void locallog() const { + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", + mSensorsDisabled); + } + 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_EXT_POWER_CONFIG: +struct LocEngExtPowerConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mIsBatteryCharging; + inline LocEngExtPowerConfig(LocEngAdapter* adapter, + int isBatteryCharging) : + LocMsg(), mAdapter(adapter), + mIsBatteryCharging(isBatteryCharging) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setExtPowerConfig(mIsBatteryCharging); + } + inline void locallog() const { + LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d", + mIsBatteryCharging); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_REPORT_POSITION: +LocEngReportPosition::LocEngReportPosition(void* locEng, + UlpLocation &loc, + GpsLocationExtended &locExtended, + void* locExt, + enum loc_sess_status st, + LocPosTechMask technology) : + LocMsg(), mLocEng(locEng), mLocation(loc), + mLocationExtended(locExtended), + mLocationExt(((loc_eng_data_s_type*)mLocEng)->location_ext_parser(locExt)), + mStatus(st), mTechMask(technology) +{ + locallog(); +} +void LocEngReportPosition::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + + 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) & + 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)))) { + 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); + } + + if (locEng->generateNmea && + mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) + { + 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("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", + mLocation.gpsLocation.flags, mLocation.position_source, + mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, + mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, + mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, + mLocation.gpsLocation.timestamp, mLocation.rawDataSize, + mLocation.rawData, mStatus, mTechMask); +} +void LocEngReportPosition::log() const { + locallog(); +} +void LocEngReportPosition::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + + +// case LOC_ENG_MSG_REPORT_SV: +LocEngReportSv::LocEngReportSv(void* locEng, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExt) : + LocMsg(), mLocEng(locEng), mSvStatus(sv), + mLocationExtended(locExtended), + mSvExt(((loc_eng_data_s_type*)mLocEng)->sv_ext_parser(svExt)) +{ + locallog(); +} +void LocEngReportSv::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->sv_status_cb != NULL) { + locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus), + (void*)mSvExt); + } + + if (locEng->generateNmea) + { + loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended); + } + } +} +void LocEngReportSv::locallog() const { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " + "used in fix mask: %x\n sv: prn snr " + "elevation azimuth", + mSvStatus.num_svs, mSvStatus.ephemeris_mask, + mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); + for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + mSvStatus.sv_list[i].prn, + mSvStatus.sv_list[i].snr, + mSvStatus.sv_list[i].elevation, + mSvStatus.sv_list[i].azimuth); + } +} +inline void LocEngReportSv::log() const { + locallog(); +} +void LocEngReportSv::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_REPORT_STATUS: +LocEngReportStatus::LocEngReportStatus(void* locEng, + GpsStatusValue engineStatus) : + LocMsg(), mLocEng(locEng), mStatus(engineStatus) +{ + locallog(); +} +inline void LocEngReportStatus::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + + 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; + CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); + 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)]) +{ + strlcpy(mServers, url1, mMaxLen); + strlcpy(&mServers[mMaxLen], url2, mMaxLen); + strlcpy(&mServers[mMaxLen<<1], url3, mMaxLen); + 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], + &mServers[mMaxLen<<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], &mServers[mMaxLen<<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>>24), + (unsigned char)(mIPv4Addr>>16), + (unsigned char)(mIPv4Addr>>8), + (unsigned char)mIPv4Addr, + 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; + 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; + 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; + AgpsStateMachine* sm = locEng->ds_nif; + DSSubscriber s(sm, mID); + sm->subscribeRsrc((Subscriber*)&s); +} +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); + ATLSubscriber s(mID, + sm, + locEng->adapter, + AGPS_TYPE_INVALID == mType); + sm->subscribeRsrc((Subscriber*)&s); +} +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; + 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__); + } else { + 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__); + } else { + DSSubscriber s3(locEng->ds_nif, mID); + if(locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", + __func__, __LINE__); + } else { + 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; + WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); + if (mIsReq) { + locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + } else { + locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + } +} +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 (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_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); + } + 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 { + AgpsStateMachine* mStateMachine; + const int mLen; + char* mAPN; + const AGpsBearerType mBearerType; + inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine, + const char* name, + int len, + AGpsBearerType btype) : + LocMsg(), + mStateMachine(statemachine), 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 { + mStateMachine->setBearer(mBearerType); + mStateMachine->setAPN(mAPN, mLen); + mStateMachine->onRsrcEvent(RSRC_GRANTED); + } + inline void locallog() const { + LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" + " bearer type: %s", + loc_get_agps_type_name(mStateMachine->getType()), + mAPN, + loc_get_agps_bear_name(mBearerType)); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ATL_CLOSED: +struct LocEngAtlClosed : public LocMsg { + AgpsStateMachine* mStateMachine; + inline LocEngAtlClosed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->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 { + AgpsStateMachine* mStateMachine; + inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->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(); +} + /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -255,27 +1387,6 @@ static char extra_data[100]; } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) -{ - LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; - msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); -} - -static void* loc_eng_create_msg_q() -{ - void* q = NULL; - if (eMSG_Q_SUCCESS != msg_q_init(&q)) { - LOC_LOGE("loc_eng_create_msg_q Q init failed."); - q = NULL; - } - return q; -} - -static void loc_eng_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - /*=========================================================================== FUNCTION loc_eng_init @@ -308,15 +1419,11 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, return ret_val; } - STATE_CHECK((NULL == loc_eng_data.context), + STATE_CHECK((NULL == loc_eng_data.adapter), "instance already initialized", return 0); memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - // Create context (msg q + thread) (if not yet created) - // This will also parse gps.conf, if not done. - loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); - // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; loc_eng_data.sv_status_cb = callbacks->sv_status_cb; @@ -325,6 +1432,10 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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.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 @@ -342,22 +1453,15 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } - LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, - callbacks->location_ext_parser, callbacks->sv_ext_parser); - loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); + loc_eng_data.adapter = + new LocEngAdapter(event, &loc_eng_data, + loc_external_msg_sender, + (MsgTask::tCreate)callbacks->create_thread_cb); - if (NULL == loc_eng_data.client_handle) { - // drop the context and declare failure - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - } else { - LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); + LOC_LOGD("loc_eng_init created client, id = %p\n", + loc_eng_data.adapter); - /*send reinit event to QMI instead of call reinit directly*/ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_LOC_INIT)); - locEngHandle.sendMsge(locEngHandle.owner, msg); - } + loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data)); EXIT_LOG(%d, ret_val); return ret_val; @@ -366,30 +1470,16 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG(); - int ret_val = loc_eng_data.client_handle->reinit(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { LOC_LOGD("loc_eng_reinit reinit() successful"); - loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, - gps_conf.SUPL_VER)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - supl_msg, loc_eng_free_msg); - - loc_eng_msg_lpp_config *lpp_msg(new loc_eng_msg_lpp_config(&loc_eng_data, - gps_conf.LPP_PROFILE)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - lpp_msg, loc_eng_free_msg); - - loc_eng_msg_sensor_control_config *sensor_control_config_msg( - new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_control_config_msg, loc_eng_free_msg); - - loc_eng_msg_a_glonass_protocol *a_glonass_protocol_msg(new loc_eng_msg_a_glonass_protocol(&loc_eng_data, - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - a_glonass_protocol_msg, loc_eng_free_msg); + LocEngAdapter* adapter = loc_eng_data.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)); + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); /* 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 || @@ -398,43 +1488,32 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - loc_eng_msg_sensor_properties *sensor_properties_msg( - new loc_eng_msg_sensor_properties(&loc_eng_data, - 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)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_properties_msg, loc_eng_free_msg); + 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)); } - loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( - new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, - 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)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_perf_control_conf_msg, loc_eng_free_msg); + 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)); - //Send data disable to modem. This will be set to enable when - //an UPDATE_NETWORK_STATE event is received from Android - loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, - 0, (agpsStatus ? 1:0))); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); } EXIT_LOG(%d, ret_val); @@ -460,7 +1539,7 @@ SIDE EFFECTS void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); // XTRA has no state, so we are fine with it. @@ -476,7 +1555,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.internet_nif = NULL; } #endif - if (loc_eng_data.client_handle->isInSession()) + if (loc_eng_data.adapter->isInSession()) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); loc_eng_stop(loc_eng_data); @@ -484,9 +1563,6 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) #if 0 // can't afford to actually clean up, for many reason. - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - // De-initialize ulp if (locEngUlpInf != NULL) { @@ -494,12 +1570,9 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) msg_q_destroy( &loc_eng_data.ulp_q); } - if (loc_eng_data.client_handle != NULL) - { - LOC_LOGD("loc_eng_init: client opened. close it now."); - delete loc_eng_data.client_handle; - loc_eng_data.client_handle = NULL; - } + 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(); @@ -529,15 +1602,19 @@ SIDE EFFECTS int loc_eng_start(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); - void* target_q = loc_eng_data.ulp_initialized ? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + if(loc_eng_data.ulp_q) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + loc_eng_data.adapter->sendMsg(new LocEngStartFix(&loc_eng_data)); + } - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -547,13 +1624,13 @@ 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.client_handle->isInSession()) { - ret_val = loc_eng_data.client_handle->startFix(); + 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) { - loc_eng_data.client_handle->setInSession(TRUE); + loc_eng_data.adapter->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -581,15 +1658,18 @@ SIDE EFFECTS int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); - void* target_q = loc_eng_data.ulp_initialized ? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; - - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd( target_q, msg, loc_eng_free_msg); + if(loc_eng_data.ulp_q) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + loc_eng_data.adapter->sendMsg(new LocEngStopFix(&loc_eng_data)); + } EXIT_LOG(%d, 0); return 0; @@ -600,15 +1680,15 @@ 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.client_handle->isInSession()) { + if (loc_eng_data.adapter->isInSession()) { - ret_val = loc_eng_data.client_handle->stopFix(); + ret_val = loc_eng_data.adapter->stopFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) { loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } - loc_eng_data.client_handle->setInSession(FALSE); + loc_eng_data.adapter->setInSession(FALSE); } EXIT_LOG(%d, ret_val); @@ -658,16 +1738,23 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, LocPosMode ¶ms) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); loc_eng_msg_position_mode *msg( new loc_eng_msg_position_mode(&loc_eng_data, params)); - void* target_q = loc_eng_data.ulp_initialized? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + if(loc_eng_data.ulp_q) + { + loc_eng_msg_position_mode *msg( + new loc_eng_msg_position_mode(&loc_eng_data, params)); + //Pass the start messgage to ULP if present & activated + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngPositionMode(adapter, params)); + } - //Pass the start messgage to ULP if present & activated - msg_q_snd(target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -692,14 +1779,10 @@ 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.context, return -1); - loc_eng_msg_set_time *msg( - new loc_eng_msg_set_time(&loc_eng_data, - time, - timeReference, - uncertainty)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + 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; } @@ -725,14 +1808,10 @@ 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.context, return -1); - loc_eng_msg_inject_location *msg( - new loc_eng_msg_inject_location(&loc_eng_data, - latitude, - longitude, - accuracy)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + INIT_CHECK(loc_eng_data.adapter, return -1); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, + accuracy)); EXIT_LOG(%d, 0); return 0; @@ -762,13 +1841,9 @@ SIDE EFFECTS void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); - loc_eng_msg_delete_aiding_data *msg( - new loc_eng_msg_delete_aiding_data(&loc_eng_data, - f)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f)); EXIT_LOG(%s, VOID_RET); } @@ -794,19 +1869,14 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa { ENTRY_LOG(); - static GpsStatusValue last_status = GPS_STATUS_NONE; - - GpsStatus gs = { sizeof(gs),status }; - - if (loc_eng_data.status_cb) { - CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); + GpsStatus gs = { sizeof(gs),status }; + CALLBACK_LOG_CALLFLOW("status_cb", %s, + loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); } - last_status = status; - EXIT_LOG(%s, VOID_RET); } @@ -821,7 +1891,7 @@ static int dataCallCb(void *cb_data) int ret=0; if(cb_data != NULL) { dsCbData *cbData = (dsCbData *)cb_data; - LocApiAdapter *locAdapter = (LocApiAdapter *)cbData->mAdapter; + 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(); @@ -897,7 +1967,7 @@ SIDE EFFECTS void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); STATE_CHECK((NULL == loc_eng_data.agps_status_cb), "agps instance already initialized", return); @@ -920,11 +1990,11 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - if(!loc_eng_data.client_handle->initDataServiceClient()) { + if(!loc_eng_data.adapter->initDataServiceClient()) { LOC_LOGD("%s:%d]: Creating new ds state machine\n", __func__, __LINE__); loc_eng_data.ds_nif = new DSStateMachine(servicerTypeExt, (void *)dataCallCb, - loc_eng_data.client_handle); + loc_eng_data.adapter); LOC_LOGD("%s:%d]: Created new ds state machine\n", __func__, __LINE__); } @@ -935,6 +2005,37 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call 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; + } +} + +static AgpsStateMachine* +getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { + AgpsStateMachine* stateMachine; + switch (agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = locEng.wifi_nif; + break; + } + case AGPS_TYPE_INVALID: + case AGPS_TYPE_SUPL: { + stateMachine = locEng.agnss_nif; + break; + } + case AGPS_TYPE_SUPL_ES: { + stateMachine = locEng.ds_nif; + break; + } + default: + stateMachine = locEng.internet_nif; + } + return stateMachine; +} + /*=========================================================================== FUNCTION loc_eng_agps_open @@ -956,7 +2057,7 @@ 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.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); if (apn == NULL) @@ -968,11 +2069,10 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - loc_eng_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, - apn_len, bearerType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + + loc_eng_data.adapter->sendMsg( + new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType)); EXIT_LOG(%d, 0); return 0; @@ -998,12 +2098,11 @@ SIDE EFFECTS int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm)); EXIT_LOG(%d, 0); return 0; @@ -1029,12 +2128,11 @@ SIDE EFFECTS int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm)); EXIT_LOG(%d, 0); return 0; @@ -1105,16 +2203,14 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, { 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 = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); if (sizeof(url) > len) { - loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, - url, len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); } } else if (LOC_AGPS_CDMA_PDE_SERVER == type || LOC_AGPS_CUSTOM_PDE_SERVER == type || @@ -1126,12 +2222,7 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, ret = -2; } else { unsigned int ip = htonl(addr.s_addr); - loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, - ip, - port, - type)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type)); } } else { LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type); @@ -1166,7 +2257,7 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); int ret_val = 0; - if (NULL != loc_eng_data.context) + if (NULL != loc_eng_data.adapter) { ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); } else { @@ -1224,15 +2315,13 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d //us to inform the modem after GPS is enabled agpsStatus = available; - INIT_CHECK(loc_eng_data.context, return); + 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); - loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, - apn_len, available)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngEnableData(adapter, apn, apn_len, available)); } EXIT_LOG(%s, VOID_RET); } @@ -1275,7 +2364,7 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Session End is not reported during Android navigating state - boolean navigating = loc_eng_data.client_handle->isInSession(); + boolean navigating = loc_eng_data.adapter->isInSession(); if (status != GPS_STATUS_NONE && !(status == GPS_STATUS_SESSION_END && navigating) && !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) @@ -1346,10 +2435,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.client_handle->isInSession()) { + if (loc_eng_data.adapter->isInSession()) { // This sets the copy in adapter to modem - loc_eng_data.client_handle->setPositionMode(NULL); - loc_eng_data.client_handle->setInSession(false); + loc_eng_data.adapter->setPositionMode(NULL); + loc_eng_data.adapter->setInSession(false); loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); @@ -1378,610 +2467,6 @@ static int set_sched_policy(int tid, SchedPolicy policy) } #endif /* USE_GLIB */ -/*=========================================================================== -FUNCTION loc_eng_deferred_action_thread - -DESCRIPTION - Main routine for the thread to execute loc_eng commands. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_deferred_action_thread(void* arg) -{ - ENTRY_LOG(); - loc_eng_msg *msg; - static int cnt = 0; - LocEngContext* context = (LocEngContext*)arg; - - // make sure we do not run in background scheduling group - set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); - - while (1) - { - LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); - - // we are only sending / receiving msg pointers - msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; - } - - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; - - LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", - __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); - - // need to ensure the instance data is valid - STATE_CHECK(NULL != loc_eng_data_p->context, - "instance cleanup happened", - delete msg; return); - - switch(msg->msgid) { - case LOC_ENG_MSG_QUIT: - { - LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; - pthread_mutex_lock(&(context->lock)); - pthread_cond_signal(&(context->cond)); - pthread_mutex_unlock(&(context->lock)); - EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); - } - return; - - case LOC_ENG_MSG_REQUEST_NI: - { - loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; - loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_INFORM_NI_RESPONSE: - { - loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; - loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, - nrMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_START_FIX: - loc_eng_start_handler(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_STOP_FIX: - if (loc_eng_data_p->agps_request_pending) - { - loc_eng_data_p->stop_request_pending = true; - LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); - } else { - loc_eng_stop_handler(*loc_eng_data_p); - } - break; - - case LOC_ENG_MSG_SET_POSITION_MODE: - { - loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; - loc_eng_data_p->client_handle->setPositionMode(&(pmMsg->pMode)); - } - break; - - case LOC_ENG_MSG_SET_TIME: - { - loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; - loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, - tMsg->uncertainty); - } - break; - - case LOC_ENG_MSG_INJECT_LOCATION: - { - loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; - loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, - ilMsg->accuracy); - } - break; - - case LOC_ENG_MSG_SET_SERVER_IPV4: - { - loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; - loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, - ssiMsg->port, - ssiMsg->serverType); - } - break; - - case LOC_ENG_MSG_SET_SERVER_URL: - { - loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; - loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); - } - break; - - case LOC_ENG_MSG_A_GLONASS_PROTOCOL: - { - loc_eng_msg_a_glonass_protocol *svMsg = (loc_eng_msg_a_glonass_protocol*)msg; - loc_eng_data_p->client_handle->setAGLONASSProtocol(svMsg->a_glonass_protocol); - } - break; - - case LOC_ENG_MSG_SUPL_VERSION: - { - loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; - loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); - } - break; - - case LOC_ENG_MSG_LPP_CONFIG: - { - loc_eng_msg_lpp_config *svMsg = (loc_eng_msg_lpp_config*)msg; - loc_eng_data_p->client_handle->setLPPConfig(svMsg->lpp_config); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: - { - loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; - loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: - { - loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; - loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk_valid, - spMsg->gyroBiasVarianceRandomWalk, - spMsg->accelRandomWalk_valid, - spMsg->accelRandomWalk, - spMsg->angleRandomWalk_valid, - spMsg->angleRandomWalk, - spMsg->rateRandomWalk_valid, - spMsg->rateRandomWalk, - spMsg->velocityRandomWalk_valid, - spMsg->velocityRandomWalk); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: - { - loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; - loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, - spccMsg->accelSamplesPerBatchHigh, spccMsg->accelBatchesPerSecHigh, - spccMsg->gyroSamplesPerBatchHigh, spccMsg->gyroBatchesPerSecHigh, - spccMsg->algorithmConfig); - } - break; - - case LOC_ENG_MSG_EXT_POWER_CONFIG: - { - loc_eng_msg_ext_power_config *pwrMsg = (loc_eng_msg_ext_power_config*)msg; - loc_eng_data_p->client_handle->setExtPowerConfig(pwrMsg->isBatteryCharging); - } - break; - - case LOC_ENG_MSG_REPORT_POSITION: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - bool reported = false; - loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; - if (loc_eng_data_p->location_cb != NULL) { - if (LOC_SESS_FAILURE == rpMsg->status) { - // in case we want to handle the failure case - loc_eng_data_p->location_cb(NULL, NULL); - reported = true; - } - // what's in the else if is... (line by line) - // 1. this is a good fix; or - // 1.1 it is a Satellite fix; or - // 1.1.1 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 == rpMsg->status && - (((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || - (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || - (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && - !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && - (gps_conf.ACCURACY_THRES != 0) && - (rpMsg->location.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { - loc_eng_data_p->location_cb((UlpLocation*)&(rpMsg->location), - (void*)rpMsg->locationExt); - reported = true; - } - } - - // if we have reported this fix - if (reported && - // and if this is a singleshot - GPS_POSITION_RECURRENCE_SINGLE == - loc_eng_data_p->client_handle->getPositionMode().recurrence) { - if (LOC_SESS_INTERMEDIATE == rpMsg->status) { - // modem could be still working for a final fix, - // although we no longer need it. So stopFix(). - loc_eng_data_p->client_handle->stopFix(); - } - // turn off the session flag. - loc_eng_data_p->client_handle->setInSession(false); - } - - if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) - { - unsigned char generate_nmea = reported && (rpMsg->status != LOC_SESS_FAILURE); - loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, - rpMsg->locationExtended, - generate_nmea); - } - - // Free the allocated memory for rawData - UlpLocation* gp = (UlpLocation*)&(rpMsg->location); - if (gp != NULL && gp->rawData != NULL) - { - delete (char*)gp->rawData; - gp->rawData = NULL; - gp->rawDataSize = 0; - } - } - - break; - - case LOC_ENG_MSG_REPORT_SV: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; - if (loc_eng_data_p->sv_status_cb != NULL) { - loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), - (void*)rsMsg->svExt); - } - - if (loc_eng_data_p->generateNmea) - { - loc_eng_nmea_generate_sv(loc_eng_data_p, rsMsg->svStatus, rsMsg->locationExtended); - } - - } - break; - - case LOC_ENG_MSG_REPORT_STATUS: - loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); - break; - - case LOC_ENG_MSG_REPORT_NMEA: - if (NULL != loc_eng_data_p->nmea_cb) { - loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); - loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); - } - break; - - case LOC_ENG_MSG_REPORT_XTRA_SERVER: - if (NULL != loc_eng_data_p->xtra_module_data.report_xtra_server_cb) { - loc_eng_msg_report_xtra_server* xsMsg = (loc_eng_msg_report_xtra_server*)msg; - CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, xsMsg->server1); - loc_eng_data_p->xtra_module_data.report_xtra_server_cb(xsMsg->server1, xsMsg->server2, xsMsg->server3); - } - break; - - case LOC_ENG_MSG_REQUEST_BIT: - { - AgpsStateMachine* stateMachine; - loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; - if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { - stateMachine = loc_eng_data_p->agnss_nif; - } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { - stateMachine = loc_eng_data_p->internet_nif; - } else { - LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); - break; - } - BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_BIT: - { - AgpsStateMachine* stateMachine; - loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; - if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { - stateMachine = loc_eng_data_p->agnss_nif; - } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { - stateMachine = loc_eng_data_p->internet_nif; - } else { - LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); - break; - } - BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); - - stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_REQUEST_ATL: - { - loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; - boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || - backwardCompatibleMode) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - ATLSubscriber subscriber(arqMsg->handle, - stateMachine, - loc_eng_data_p->client_handle, - backwardCompatibleMode); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_ATL: - { - loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; - ATLSubscriber s1(arlMsg->handle, - loc_eng_data_p->agnss_nif, - loc_eng_data_p->client_handle, - false); - // attempt to unsubscribe from agnss_nif first - if (loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { - LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", __func__, __LINE__); - } - else { - ATLSubscriber s2(arlMsg->handle, - loc_eng_data_p->internet_nif, - loc_eng_data_p->client_handle, - false); - // if unsuccessful, try internet_nif - if(loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { - LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", __func__, __LINE__); - } - else { - DSSubscriber s3(loc_eng_data_p->ds_nif, - arlMsg->handle); - LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", - __func__, __LINE__, arlMsg->handle); - if(loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); - } - else { - LOC_LOGE("%s:%d]: Could not release ATL. No subscribers found\n", - __func__, __LINE__); - loc_eng_data_p->client_handle->atlCloseStatus(arlMsg->handle, 0); - } - } - } - } - break; - - case LOC_ENG_MSG_REQUEST_WIFI: - { - loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; - if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || - wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM || - wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) { - AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; - WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } else { - LOC_LOGE("%s]%d ERROR: unknown sender ID", __func__, __LINE__); - break; - } - } - break; - - case LOC_ENG_MSG_RELEASE_WIFI: - { - AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; - loc_eng_msg_release_wifi* wrlMsg = (loc_eng_msg_release_wifi*)msg; - WIFISubscriber subscriber(stateMachine, wrlMsg->ssid, wrlMsg->password, wrlMsg->senderId); - stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_REQUEST_XTRA_DATA: - if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) - { - loc_eng_data_p->xtra_module_data.download_request_cb(); - } - break; - - case LOC_ENG_MSG_REQUEST_TIME: - if (loc_eng_data_p->request_utc_time_cb != NULL) - { - loc_eng_data_p->request_utc_time_cb(); - } - else - { - LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__); - } - break; - - case LOC_ENG_MSG_REQUEST_POSITION: - break; - - case LOC_ENG_MSG_DELETE_AIDING_DATA: - loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; - break; - - case LOC_ENG_MSG_ENABLE_DATA: - { - loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; - loc_eng_data_p->client_handle->enableData(unaMsg->enable); - if(unaMsg->apn != NULL) - loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); - } - break; - - case LOC_ENG_MSG_INJECT_XTRA_DATA: - { - loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; - loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); - } - break; - - case LOC_ENG_MSG_REQUEST_XTRA_SERVER: - { - loc_eng_data_p->client_handle->requestXtraServer(); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_SUCCESS: - { - loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; - AgpsStateMachine* stateMachine; - LOC_LOGD("%s:%d]: AGPS_TYPE: %d\n", __func__, __LINE__, (int)aosMsg->agpsType); - switch (aosMsg->agpsType) { - case AGPS_TYPE_WIFI: { - LOC_LOGD("%s:%d]: AGPS Type wifi\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - LOC_LOGD("%s:%d]: AGPS Type supl\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - case AGPS_TYPE_INVALID: { - stateMachine = loc_eng_data_p->ds_nif; - LOC_LOGD("%s:%d]: AGPS Type invalid\n", __func__, __LINE__); - } - break; - default: { - LOC_LOGD("%s:%d]: AGPS Type default internet\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->internet_nif; - } - } - - stateMachine->setBearer(aosMsg->bearerType); - stateMachine->setAPN(aosMsg->apn, aosMsg->length); - stateMachine->onRsrcEvent(RSRC_GRANTED); - } - break; - - case LOC_ENG_MSG_ATL_CLOSED: - { - loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; - AgpsStateMachine* stateMachine; - - switch (acsMsg->agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - case AGPS_TYPE_INVALID: { - stateMachine = loc_eng_data_p->ds_nif; - break; - } - default: { - stateMachine = loc_eng_data_p->internet_nif; - } - } - stateMachine->onRsrcEvent(RSRC_RELEASED); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_FAILED: - { - loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; - AgpsStateMachine* stateMachine; - - switch (aofMsg->agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - default: { - stateMachine = loc_eng_data_p->internet_nif; - } - } - stateMachine->onRsrcEvent(RSRC_DENIED); - } - break; - - case LOC_ENG_MSG_ENGINE_DOWN: - loc_eng_handle_engine_down(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_ENGINE_UP: - loc_eng_handle_engine_up(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_LOC_INIT: - { - loc_eng_reinit(*loc_eng_data_p); - } - break; - - case LOC_ENG_MSG_REQUEST_SUPL_ES: - { - loc_eng_msg_request_supl_es *reqMsg = - (loc_eng_msg_request_supl_es *)msg; - AgpsStateMachine *stateMachine = loc_eng_data_p->ds_nif; - DSSubscriber subscriber(stateMachine, reqMsg->handle); - LOC_LOGD("%s:%d]: Starting data call\n", __func__, __LINE__); - stateMachine->subscribeRsrc((Subscriber *)&subscriber); - } - break; - - case LOC_ENG_MSG_CLOSE_DATA_CALL: - { - loc_eng_data_p->client_handle->closeDataCall(); - LOC_LOGD("%s:%d]: Request to close data call\n", - __func__, __LINE__); - } - break; - - default: - LOC_LOGE("unsupported msgid = %d\n", msg->msgid); - break; - } - - if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | - (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | - (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) - { - loc_eng_data_p->agps_request_pending = false; - if (loc_eng_data_p->stop_request_pending) { - loc_eng_stop_handler(*loc_eng_data_p); - loc_eng_data_p->stop_request_pending = false; - } - } - loc_eng_data_p->stop_request_pending = false; - - if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && - loc_eng_data_p->aiding_data_for_deletion != 0) - { - loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); - loc_eng_data_p->aiding_data_for_deletion = 0; - } - - delete msg; - } - - EXIT_LOG(%s, VOID_RET); -} - /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -2008,7 +2493,7 @@ int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc { // Initialize the ULP interface ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); - loc_eng_data.ulp_initialized = TRUE; + loc_eng_data.ulp_q = (void*)msg_q_init2(); ret_val = 0; } else diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index f9566196..fdda66a2 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -55,9 +55,8 @@ typedef unsigned char boolean; #include #include #include -#include #include -#include +#include // The data connection minimal open time #define DATA_OPEN_MIN_TIME 1 /* sec */ @@ -79,25 +78,10 @@ enum loc_mute_session_e_type { LOC_MUTE_SESS_IN_SESSION }; -struct LocEngContext { - // Data variables used by deferred action thread - const void* deferred_q; - const void* ulp_q; - const pthread_t deferred_action_thread; - static LocEngContext* get(gps_create_thread threadCreator); - void drop(); - static pthread_mutex_t lock; - static pthread_cond_t cond; -private: - int counter; - static LocEngContext *me; - LocEngContext(gps_create_thread threadCreator); -}; - // Module data typedef struct loc_eng_data_s { - LocApiAdapter *client_handle; + LocEngAdapter *adapter; loc_location_cb_ext location_cb; gps_status_callback status_cb; loc_sv_status_cb_ext sv_status_cb; @@ -109,9 +93,6 @@ typedef struct loc_eng_data_s gps_request_utc_time request_utc_time_cb; boolean intermediateFix; AGpsStatusValue agps_status; - // used to defer stopping the GPS engine until AGPS data calls are done - boolean agps_request_pending; - boolean stop_request_pending; loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; @@ -129,8 +110,6 @@ typedef struct loc_eng_data_s // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off GpsAidingData aiding_data_for_deletion; - void* context; - // For muting session broadcast loc_mute_session_e_type mute_session_state; @@ -151,7 +130,10 @@ typedef struct loc_eng_data_s int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; - bool ulp_initialized; + void *ulp_q; + + loc_ext_parser location_ext_parser; + loc_ext_parser sv_ext_parser; } loc_eng_data_s_type; #include "ulp.h" @@ -256,6 +238,7 @@ extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, const void* passThrough); extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); int loc_eng_read_config(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index b7821c9e..d6cc1369 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -33,10 +33,10 @@ #include #include #include -#include "platform_lib_includes.h" +#include #include #include -#include +#include //====================================================================== // C callbacks @@ -109,7 +109,7 @@ bool BITSubscriber::equals(const Subscriber *s) const return (ID == bitS->ID && (INADDR_NONE != (unsigned int)ID || - 0 == strncmp(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); + 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr)))); } bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) @@ -152,13 +152,13 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { case RSRC_UNSUBSCRIBE: case RSRC_RELEASED: - ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_DENIED: { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -168,7 +168,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -627,6 +627,7 @@ AgpsStateMachine::AgpsStateMachine(servicerType servType, mStatePtr(new AgpsReleasedState(this)),mType(type), mAPN(NULL), mAPNLen(0), + mBearer(AGPS_APN_BEARER_INVALID), mEnforceSingleSubscriber(enforceSingleSubscriber), mServicer(Servicer :: getServicer(servType, (void *)cb_func)) { @@ -826,7 +827,7 @@ err: } DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, - LocApiAdapter* adapterHandle): + LocEngAdapter* adapterHandle): AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), mLocAdapter(adapterHandle) { @@ -947,17 +948,17 @@ void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const LOC_LOGD("DSStateMachine :: informStatus. Status=%d\n",(int)status); switch(status) { case RSRC_UNSUBSCRIBE: - ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + mLocAdapter->atlCloseStatus(ID, 1); break; case RSRC_RELEASED: - ((LocApiAdapter*)mLocAdapter)->releaseDataHandle(); + mLocAdapter->closeDataCall(); break; case RSRC_DENIED: ((DSStateMachine *)this)->mRetries = 0; mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); break; case RSRC_GRANTED: - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + mLocAdapter->atlOpenStatus(ID, 1, NULL, AGPS_APN_BEARER_INVALID, AGPS_TYPE_INVALID); diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 93980f3c..055d955b 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -35,10 +35,11 @@ #include #include #include +#include +#include #include -#include -#include "loc_eng_msg.h" #include +#include // forward declaration class AgpsStateMachine; @@ -62,7 +63,7 @@ typedef enum { //DS Callback struct typedef struct { - LocApiAdapter *mAdapter; + LocEngAdapter *mAdapter; AGpsStatusValue action; }dsCbData; @@ -249,12 +250,12 @@ public: class DSStateMachine : public AgpsStateMachine { static const unsigned char MAX_START_DATA_CALL_RETRIES; static const unsigned int DATA_CALL_RETRY_DELAY_MSEC; - LocApiAdapter* mLocAdapter; + LocEngAdapter* mLocAdapter; unsigned char mRetries; public: DSStateMachine(servicerType type, - void *cb_func, - LocApiAdapter* adapterHandle); + void *cb_func, + LocEngAdapter* adapterHandle); int sendRsrcRequest(AGpsStatusValue action) const; void onRsrcEvent(AgpsRsrcStatus event); void retryCallback(); @@ -297,40 +298,40 @@ struct Subscriber { // 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) { - ipv6Addr[0] = NULL; + mIPv6Addr[0] = 0; } else { - memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); + memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr)); } } virtual bool notifyRsrcStatus(Notification ¬ification); inline virtual void setIPAddresses(uint32_t &v4, char* v6) - { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } + { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } virtual Subscriber* clone() { - return new BITSubscriber(mStateMachine, ID, ipv6Addr); + return new BITSubscriber(mStateMachine, ID, mIPv6Addr); } virtual bool equals(const Subscriber *s) const; inline virtual ~BITSubscriber(){} -private: - char ipv6Addr[16]; }; // ATLSubscriber, created with requests from ATL struct ATLSubscriber : public Subscriber { - const LocApiAdapter* mLocAdapter; + const LocEngAdapter* mLocAdapter; const bool mBackwardCompatibleMode; inline ATLSubscriber(const int id, const AgpsStateMachine* stateMachine, - const LocApiAdapter* adapter, + const LocEngAdapter* adapter, const bool compatibleMode) : Subscriber(id, stateMachine), mLocAdapter(adapter), mBackwardCompatibleMode(compatibleMode){} diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index 8176ab43..edd53f21 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -49,24 +49,24 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, } if (NULL != loc_api_handle) { - loc_if_req_type_e_type type; + AGpsExtType type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + type = AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + type = AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_ENG_IF_REQUEST_TYPE_ANY; + type = AGPS_TYPE_ANY; break; } default: @@ -79,48 +79,52 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_SENDER_ID_QUIPC: { LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_bit *msg( - new loc_eng_msg_request_bit(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + 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: @@ -141,24 +145,24 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, { LOC_LOGD("%s:%d]\n", __func__, __LINE__); #ifndef DEBUG_DMN_LOC_API - loc_if_req_type_e_type type; + AGpsExtType type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + type = AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + type = AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_ENG_IF_REQUEST_TYPE_ANY; + type = AGPS_TYPE_ANY; break; } default: @@ -171,48 +175,52 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_SENDER_ID_QUIPC: { LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_bit *msg( - new loc_eng_msg_release_bit(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + 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: diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 877566ed..8c494337 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -30,31 +30,10 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_eng" -#include "hardware/gps.h" #include "loc_log.h" #include "loc_eng_log.h" #include "loc_eng_msg_id.h" -/* GPS status names */ -static 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 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 loc_name_val_s_type loc_eng_msgs[] = { NAME_VAL( LOC_ENG_MSG_QUIT ), @@ -111,183 +90,3 @@ const char* loc_get_msg_name(int id) -static 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = -{ - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) -}; -static 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 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_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) -}; -static 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 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 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 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 ) -}; -static 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 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 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 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 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 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_IPV4 ), - NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) -}; -static 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 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index 95a672fd..ec1b7353 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -36,22 +36,8 @@ extern "C" #endif #include -#include -#include -const char* loc_get_gps_status_name(GpsStatusValue gps_status); const char* loc_get_msg_name(int id); -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 } diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp deleted file mode 100644 index a296dce3..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg.cpp +++ /dev/null @@ -1,133 +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_eng_msg.h" -#include "loc_eng_dmn_conn_glue_msg.h" - -#ifdef _ANDROID_ - -#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" - -#else - -#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" - -#endif - -int loc_eng_msgget(int * p_req_msgq) -{ - * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); - return 0; -} - -int loc_eng_msgremove(int req_msgq) -{ - loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); - return 0; -} - -int loc_eng_msgsnd(int msgqid, void * msgp) -{ - int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) -{ - int result; - - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - 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; -} - -int loc_eng_msgrcv(int msgqid, void ** msgp) -{ - int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) -{ - int result; - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); - if (result != sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); - return -1; - } - - if (msgsz < pmsg->msgsz) { - LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); - return -1; - } - - if (pmsg->msgsz > sizeof(struct msgbuf)) { - /* there is msg body */ - msgp += sizeof(struct msgbuf); - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); - - if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { - LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, - (pmsg->msgid), (int) pmsg->msgsz); - return -1; - } - } - - return pmsg->msgsz; -} - -int loc_eng_msgflush(int msgqid) -{ - return loc_eng_dmn_conn_glue_msgflush(msgqid); -} - -int loc_eng_msgunblock(int msgqid) -{ - return loc_eng_dmn_conn_glue_pipeunblock(msgqid); -} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 709f65c9..39b0de52 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -31,13 +31,15 @@ #include -#include +#include #include #include -#include "log_util.h" -#include "loc.h" +#include #include -#include "loc_eng_msg_id.h" +#include +#include +#include +#include #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) @@ -53,113 +55,7 @@ extern "C" { #endif /* __cplusplus */ -struct LocPosMode -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval; - uint32_t preferred_accuracy; - uint32_t preferred_time; - char credentials[14]; - char provider[8]; - LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, - uint32_t gap, uint32_t accu, uint32_t time, - const char* cred, const char* prov) : - mode(m), recurrence(recr), - min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), - preferred_accuracy(accu), preferred_time(time) { - 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); - } - } - - LocPosMode() : - mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), - min_interval(MIN_POSSIBLE_FIX_INTERVAL), preferred_accuracy(50), preferred_time(120000) { - 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); - } - - inline void 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); - } -}; - -/** 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 - -/** 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; -} GpsLocationExtended; - -typedef enum { - LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, - LOC_ENG_IF_REQUEST_TYPE_WIFI, - LOC_ENG_IF_REQUEST_TYPE_ANY -} loc_if_req_type_e_type; - -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; +using namespace loc_core; struct loc_eng_msg { const void* owner; @@ -176,153 +72,6 @@ struct loc_eng_msg { } }; -struct loc_eng_msg_a_glonass_protocol : public loc_eng_msg { - const unsigned long a_glonass_protocol; - inline loc_eng_msg_a_glonass_protocol(void* instance, unsigned long protocol) : - loc_eng_msg(instance, LOC_ENG_MSG_A_GLONASS_PROTOCOL), - a_glonass_protocol(protocol) - { - LOC_LOGV("A-GLONASS protocol: 0x%lx", protocol); - } -}; - -struct loc_eng_msg_suple_version : public loc_eng_msg { - const int supl_version; - inline loc_eng_msg_suple_version(void* instance, int version) : - loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), - supl_version(version) - { - LOC_LOGV("SUPL Version: %d", version); - } -}; - -struct loc_eng_msg_lpp_config : public loc_eng_msg { - const int lpp_config; - inline loc_eng_msg_lpp_config(void *instance, int profile) : - loc_eng_msg(instance, LOC_ENG_MSG_LPP_CONFIG), - lpp_config(profile) - { - LOC_LOGV("lpp profile: %d", profile); - } -}; - -struct loc_eng_msg_ext_power_config : public loc_eng_msg { - const int isBatteryCharging; - inline loc_eng_msg_ext_power_config(void* instance, int isBattCharging) : - loc_eng_msg(instance, LOC_ENG_MSG_EXT_POWER_CONFIG), - isBatteryCharging(isBattCharging) - { - LOC_LOGV("isBatteryCharging: %d", isBatteryCharging); - } -}; - -struct loc_eng_msg_sensor_control_config : public loc_eng_msg { - const int sensorsDisabled; - inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), - sensorsDisabled(disabled) - { - LOC_LOGV("Sensors Disabled: %d", disabled); - } -}; - -struct loc_eng_msg_sensor_properties : public loc_eng_msg { - const bool gyroBiasVarianceRandomWalk_valid; - const float gyroBiasVarianceRandomWalk; - const bool accelRandomWalk_valid; - const float accelRandomWalk; - const bool angleRandomWalk_valid; - const float angleRandomWalk; - const bool rateRandomWalk_valid; - const float rateRandomWalk; - const bool velocityRandomWalk_valid; - const float velocityRandomWalk; - inline loc_eng_msg_sensor_properties(void* instance, 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) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), - gyroBiasVarianceRandomWalk_valid(gyroBiasRandomWalk_valid), - gyroBiasVarianceRandomWalk(gyroBiasRandomWalk), - accelRandomWalk_valid(accelRandomWalk_valid), - accelRandomWalk(accelRandomWalk), - angleRandomWalk_valid(angleRandomWalk_valid), - angleRandomWalk(angleRandomWalk), - rateRandomWalk_valid(rateRandomWalk_valid), - rateRandomWalk(rateRandomWalk), - velocityRandomWalk_valid(velocityRandomWalk_valid), - velocityRandomWalk(velocityRandomWalk) - { - 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", - gyroBiasRandomWalk_valid, - accelRandomWalk_valid, - angleRandomWalk_valid, - rateRandomWalk_valid, - velocityRandomWalk_valid - ); - LOC_LOGV("Sensor properties, Gyro Random walk: %f Accel Random Walk: %f " - "Angle Random Walk: %f Rate Random Walk: %f " - "Velocity Random Walk: %f", - gyroBiasRandomWalk, - accelRandomWalk, - angleRandomWalk, - rateRandomWalk, - velocityRandomWalk - ); - } -}; - -struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { - const int controlMode; - const int accelSamplesPerBatch; - const int accelBatchesPerSec; - const int gyroSamplesPerBatch; - const int gyroBatchesPerSec; - const int accelSamplesPerBatchHigh; - const int accelBatchesPerSecHigh; - const int gyroSamplesPerBatchHigh; - const int gyroBatchesPerSecHigh; - const int algorithmConfig; - inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, - int algorithmConfig) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), - controlMode(controlMode), - accelSamplesPerBatch(accelSamplesPerBatch), - accelBatchesPerSec(accelBatchesPerSec), - gyroSamplesPerBatch(gyroSamplesPerBatch), - gyroBatchesPerSec(gyroBatchesPerSec), - accelSamplesPerBatchHigh(accelSamplesPerBatchHigh), - accelBatchesPerSecHigh(accelBatchesPerSecHigh), - gyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), - gyroBatchesPerSecHigh(gyroBatchesPerSecHigh), - algorithmConfig(algorithmConfig) - { - 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", - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec, - accelSamplesPerBatchHigh, - accelBatchesPerSecHigh, - gyroSamplesPerBatchHigh, - gyroBatchesPerSecHigh, - algorithmConfig - ); - } -}; - - struct loc_eng_msg_position_mode : public loc_eng_msg { const LocPosMode pMode; inline loc_eng_msg_position_mode(void* instance, @@ -334,45 +83,6 @@ struct loc_eng_msg_position_mode : public loc_eng_msg { } }; -struct loc_eng_msg_set_time : public loc_eng_msg { - const GpsUtcTime time; - const int64_t timeReference; - const int uncertainty; - inline loc_eng_msg_set_time(void* instance, - GpsUtcTime t, - int64_t tf, - int unc) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), - time(t), timeReference(tf), uncertainty(unc) - { - LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", - time, timeReference, uncertainty); - } -}; - -struct loc_eng_msg_inject_location : public loc_eng_msg { - const double latitude; - const double longitude; - const float accuracy; - inline loc_eng_msg_inject_location(void* instance, double lat, - double longi, float accur) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), - latitude(lat), longitude(longi), accuracy(accur) - { - LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", - latitude, longitude, accuracy); - } -}; - -struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { - const GpsAidingData type; - inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : - loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) - { - LOC_LOGV("aiding data msak %d", type); - } -}; - struct loc_eng_msg_report_position : public loc_eng_msg { const UlpLocation location; const GpsLocationExtended locationExtended; @@ -427,438 +137,232 @@ struct loc_eng_msg_report_sv : public loc_eng_msg { } }; -struct loc_eng_msg_report_status : public loc_eng_msg { - const GpsStatusValue status; - inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) - { - LOC_LOGV("status: %s", loc_get_gps_status_name(status)); - } -}; -struct loc_eng_msg_report_nmea : public loc_eng_msg { - char* const nmea; - const int length; - inline loc_eng_msg_report_nmea(void* instance, - const char* data, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), - nmea(new char[len]), length(len) - { - memcpy((void*)nmea, (void*)data, len); - LOC_LOGV("length: %d\n nmea: %p - %c%c%c", - length, nmea, nmea[3], nmea[4], nmea[5]); - } - inline ~loc_eng_msg_report_nmea() - { - delete[] nmea; - } -}; - -struct loc_eng_msg_report_xtra_server : public loc_eng_msg { - char *server1; - char *server2; - char *server3; - inline loc_eng_msg_report_xtra_server(void *instance, - const char *url1, - const char *url2, - const char *url3, - const int maxlength) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_XTRA_SERVER), - server1(new char[maxlength+1]), server2(new char[maxlength+1]), server3(new char[maxlength+1]) - { - strlcpy(server1, url1, maxlength); - strlcpy(server2, url2, maxlength); - strlcpy(server3, url3, maxlength); - - LOC_LOGV("maxlength: %d\n server1: %s\n server2: %s\n server3: %s\n", - maxlength, server1, server2, server3); - } - inline ~loc_eng_msg_report_xtra_server() - { - delete[] server1; - delete[] server2; - delete[] server3; - } -}; - -struct loc_eng_msg_request_bit : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_request_bit(void* instance, - loc_if_req_type_e_type type, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), - ifType(type), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, - (unsigned char)(ipv4>>24), - (unsigned char)(ipv4>>16), - (unsigned char)(ipv4>>8), - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_request_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_request_wifi : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const loc_if_req_sender_id_e_type senderId; - char* const ssid; - char* const password; - inline loc_eng_msg_request_wifi(void* instance, - loc_if_req_type_e_type type, - loc_if_req_sender_id_e_type sender_id, - char* s, - char* p) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_WIFI), - ifType(type), senderId(sender_id), - ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), - password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) - { - if (NULL != ssid) - strlcpy(ssid, s, SSID_BUF_SIZE); - if (NULL != password) - strlcpy(password, p, SSID_BUF_SIZE); - LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", - ifType, - senderId, - NULL != ssid ? ssid : "", - NULL != password ? password : ""); - } - - inline ~loc_eng_msg_request_wifi() - { - if (NULL != ssid) { - delete[] ssid; - } - if (NULL != password) { - delete[] password; - } - } -}; - -struct loc_eng_msg_release_bit : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_release_bit(void* instance, - loc_if_req_type_e_type type, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), - ifType(type), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, - (unsigned char)(ipv4>>24), - (unsigned char)(ipv4>>16), - (unsigned char)(ipv4>>8), - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_release_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_release_wifi : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const loc_if_req_sender_id_e_type senderId; - char* const ssid; - char* const password; - inline loc_eng_msg_release_wifi(void* instance, - loc_if_req_type_e_type type, - loc_if_req_sender_id_e_type sender_id, - char* s, - char* p) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_WIFI), - ifType(type), senderId(sender_id), - ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), - password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) - { - if (NULL != s) - strlcpy(ssid, s, SSID_BUF_SIZE); - if (NULL != p) - strlcpy(password, p, SSID_BUF_SIZE); - LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", - ifType, - senderId, - NULL != ssid ? ssid : "", - NULL != password ? password : ""); - } - - inline ~loc_eng_msg_release_wifi() - { - if (NULL != ssid) { - delete[] ssid; - } - if (NULL != password) { - delete[] password; - } - } -}; - -struct loc_eng_msg_request_atl : public loc_eng_msg { - const int handle; - const AGpsType type; - inline loc_eng_msg_request_atl(void* instance, int hndl, - AGpsType agps_type) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), - handle(hndl), type(agps_type) - { - LOC_LOGV("handle: %d\n agps type: %s", - handle, - loc_get_agps_type_name(type)); - } -}; - -struct loc_eng_msg_request_supl_es : public loc_eng_msg { - const int handle; - inline loc_eng_msg_request_supl_es(void* instance, int hndl) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_SUPL_ES), - handle(hndl) - { - LOC_LOGV("handle: %d\n", handle); - } -}; - -struct loc_eng_msg_close_data_call: public loc_eng_msg { - inline loc_eng_msg_close_data_call(void *instance) : - loc_eng_msg(instance, LOC_ENG_MSG_CLOSE_DATA_CALL) - { - LOC_LOGV("%s:%d]Close data call: ", __func__, __LINE__); - } -}; -struct loc_eng_msg_release_atl : public loc_eng_msg { - const int handle; - inline loc_eng_msg_release_atl(void* instance, int hndl) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) - { - LOC_LOGV("handle: %d", handle); - } -}; - -struct loc_eng_msg_request_ni : public loc_eng_msg { - const GpsNiNotification notify; - const void *passThroughData; - inline loc_eng_msg_request_ni(void* instance, - GpsNiNotification ¬if, const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), - notify(notif), passThroughData(data) - { - 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", - notify.notification_id, - loc_get_ni_type_name(notify.ni_type), - notify.notify_flags, - notify.timeout, - loc_get_ni_response_name(notify.default_response), - loc_get_ni_encoding_name(notify.requestor_id_encoding), - loc_get_ni_encoding_name(notify.text_encoding), - passThroughData); - } -}; - -struct loc_eng_msg_inform_ni_response : public loc_eng_msg { - const GpsUserResponseType response; - const void *passThroughData; - inline loc_eng_msg_inform_ni_response(void* instance, - GpsUserResponseType resp, - const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), - response(resp), passThroughData(data) - { - LOC_LOGV("response: %s\n passThroughData: %p", - loc_get_ni_response_name(response), - passThroughData); - } - inline ~loc_eng_msg_inform_ni_response() - { - // this is a bit weird since passThroughData is not - // allocated by this class. But there is no better way. - // passThroughData actually won't be NULL here. - // But better safer than sorry. - if (NULL != passThroughData) { - free((void*)passThroughData); - } - } -}; - -struct loc_eng_msg_set_apn : public loc_eng_msg { - char* const apn; - inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s", apn); - } - inline ~loc_eng_msg_set_apn() - { - delete[] apn; - } +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 loc_eng_msg_set_server_ipv4 : public loc_eng_msg { - const unsigned int nl_addr; - const int port; - const LocServerType serverType; - inline loc_eng_msg_set_server_ipv4(void* instance, - unsigned int ip, - int p, - LocServerType type) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), - nl_addr(ip), port(p), serverType(type) - { - LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); - } +struct LocEngStartFix : public LocMsg { + loc_eng_data_s_type* mLocEng; + LocEngStartFix(loc_eng_data_s_type* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; - -struct loc_eng_msg_set_server_url : public loc_eng_msg { - const int len; - char* const url; - inline loc_eng_msg_set_server_url(void* instance, - const char* urlString, - int url_len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), - len(url_len), url(new char[len+1]) - { - memcpy((void*)url, (void*)urlString, url_len); - url[len] = 0; - LOC_LOGV("url: %s", url); - } - inline ~loc_eng_msg_set_server_url() - { - delete[] url; - } +struct LocEngStopFix : public LocMsg { + loc_eng_data_s_type* mLocEng; + LocEngStopFix(loc_eng_data_s_type* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; -struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { - char* const data; - const int length; - inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), - data(new char[l]), length(l) - { - memcpy((void*)data, (void*)d, l); - LOC_LOGV("length: %d\n data: %p", length, data); - } - inline ~loc_eng_msg_inject_xtra_data() - { - delete[] data; - } +struct LocEngReportPosition : public LocMsg { + void* mLocEng; + const UlpLocation mLocation; + const GpsLocationExtended mLocationExtended; + const void* mLocationExt; + const enum loc_sess_status mStatus; + const LocPosTechMask mTechMask; + LocEngReportPosition(void* locEng, + 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 loc_eng_msg_request_xtra_server : public loc_eng_msg { - inline loc_eng_msg_request_xtra_server(void *instance) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_XTRA_SERVER) - { - - } +struct LocEngReportSv : public LocMsg { + void* mLocEng; + const GpsSvStatus mSvStatus; + const GpsLocationExtended mLocationExtended; + const void* mSvExt; + LocEngReportSv(void* locEng, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExtended); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const AGpsType agpsType; - const int length; - char* const apn; - const AGpsBearerType bearerType; - inline loc_eng_msg_atl_open_success(void* instance, - AGpsType atype, - const char* name, - int len, - AGpsBearerType btype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - agpsType(atype), length(len), - apn(new char[len+1]), bearerType(btype) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", - loc_get_agps_type_name(agpsType), - apn, - loc_get_agps_bear_name(bearerType)); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } +struct LocEngReportStatus : public LocMsg { + void* mLocEng; + const GpsStatusValue mStatus; + LocEngReportStatus(void* locEng, + GpsStatusValue engineStatus); + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - const AGpsStatusValue agpsType; - inline loc_eng_msg_atl_open_failed(void* instance, - AGpsStatusValue atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), - agpsType(atype) +struct LocEngReportNmea : public LocMsg { + void* mLocEng; + char* const mNmea; + const int mLen; + LocEngReportNmea(void* locEng, + const char* data, int len); + inline virtual ~LocEngReportNmea() { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); + delete[] mNmea; } + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_atl_closed : public loc_eng_msg { - const AGpsType agpsType; - inline loc_eng_msg_atl_closed(void* instance, - AGpsType atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), - agpsType(atype) +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() { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); + delete[] mServers; } + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_set_data_enable : public loc_eng_msg { - const int enable; - char* const apn; - const int length; - inline loc_eng_msg_set_data_enable(void* instance, - const char* name, - int len, - int yes) : - loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), - enable(yes), apn(new char[len+1]), length(len) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n enable: %d", apn, enable); - } - inline ~loc_eng_msg_set_data_enable() - { - delete[] apn; - } +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; }; -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); -int loc_eng_msgget(int * p_req_msgq); -int loc_eng_msgremove(int req_msgq); -int loc_eng_msgsnd(int msgqid, void * msgp); -int loc_eng_msgrcv(int msgqid, void ** msgp); -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); -int loc_eng_msgflush(int msgqid); -int loc_eng_msgunblock(int msgqid); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index e9ba91d0..f017cab6 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -39,11 +39,15 @@ #include #include #include +#include #include #include "log_util.h" #include "platform_lib_includes.h" + +using namespace loc_core; + /*============================================================================= * * DATA DECLARATION @@ -57,6 +61,42 @@ *============================================================================*/ 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 @@ -179,15 +219,15 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ // adding this check to support modem restart, in which case, we need the thread - // to exit without calling sending data to loc_eng_msg_q. We made sure that - // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() - loc_eng_msg_inform_ni_response *msg = NULL; + // to exit without calling sending data. We made sure that rawRequest is NULL in + // loc_eng_ni_reset_on_engine_restart() + LocEngAdapter* adapter = loc_eng_data_p->adapter; + LocEngInformNiResponse *msg = NULL; if (NULL != loc_eng_ni_data_p->rawRequest) { - loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; - msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + msg = new LocEngInformNiResponse(adapter, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); loc_eng_ni_data_p->rawRequest = NULL; } pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); @@ -196,7 +236,7 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->reqID++; if (NULL != msg) { - loc_eng_msg_sender(loc_eng_data_p, msg); + adapter->sendMsg(msg); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index c4be2ab8..f5f746b2 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -259,7 +259,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 @@ -412,7 +412,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 @@ -490,7 +490,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 5c030b0b..45822867 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -31,10 +31,57 @@ #define LOG_TAG "LocSvc_eng" #include -#include +#include #include "log_util.h" #include "platform_lib_includes.h" +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(); + } +}; + /*=========================================================================== FUNCTION loc_eng_xtra_init @@ -89,9 +136,8 @@ SIDE EFFECTS int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { - loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, - data, length)); - loc_eng_msg_sender(&loc_eng_data, msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); return 0; } @@ -113,12 +159,8 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) { - loc_eng_msg_request_xtra_server *msg(new loc_eng_msg_request_xtra_server(&loc_eng_data)); - - if (NULL == msg) - return -1; - - loc_eng_msg_sender(&loc_eng_data, msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngRequestXtraServer(adapter)); return 0; From 55a6841843912ef8b46b67cbe9cbc60844244a74 Mon Sep 17 00:00:00 2001 From: Sridhar Gujje Date: Wed, 7 Aug 2013 03:27:16 -0700 Subject: [PATCH 150/945] Revert "Location Hal Design Level Change for FLP Requirement" This reverts commit a915406668658c66698be3386c8796eb438ea282 Change-Id: I7f677a9540a64a60b5f4ed898ba6bed8b3482687 --- core/Android.mk | 49 - core/ContextBase.cpp | 63 - core/ContextBase.h | 61 - core/LocAdapterBase.cpp | 147 -- core/LocAdapterBase.h | 97 - core/LocApiBase.cpp | 475 ---- core/LocApiBase.h | 254 -- core/LocDualContext.cpp | 117 - core/LocDualContext.h | 68 - core/MsgTask.cpp | 133 - core/MsgTask.h | 66 - core/gps_extended.h | 92 - core/gps_extended_c.h | 256 -- core/loc_core_log.cpp | 250 -- loc_api/Android.mk | 2 + .../libloc_api-rpc-glue/Android.mk | 12 +- .../{LocApiRpc.h => LocApiRpcAdapter.h} | 40 +- .../{LocApiRpc.cpp => LocApiRpcAdapter.cpp} | 276 +- loc_api/libloc_api_50001/Android.mk | 68 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 269 ++ loc_api/libloc_api_50001/LocApiAdapter.h | 250 ++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 207 -- loc_api/libloc_api_50001/LocEngAdapter.h | 238 -- loc_api/libloc_api_50001/Makefile.am | 4 +- loc_api/libloc_api_50001/gps_extended.h | 111 + loc_api/libloc_api_50001/loc.cpp | 72 +- loc_api/libloc_api_50001/loc.h | 39 +- loc_api/libloc_api_50001/loc_eng.cpp | 2221 +++++++---------- loc_api/libloc_api_50001/loc_eng.h | 31 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 21 +- loc_api/libloc_api_50001/loc_eng_agps.h | 29 +- .../loc_eng_dmn_conn_handler.cpp | 132 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 201 ++ loc_api/libloc_api_50001/loc_eng_log.h | 14 + loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 + loc_api/libloc_api_50001/loc_eng_msg.h | 898 +++++-- loc_api/libloc_api_50001/loc_eng_ni.cpp | 56 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 6 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 62 +- .../libloc_api_50001/loc_ulp.h | 68 +- 40 files changed, 2979 insertions(+), 4609 deletions(-) delete mode 100644 core/Android.mk delete mode 100644 core/ContextBase.cpp delete mode 100644 core/ContextBase.h delete mode 100644 core/LocAdapterBase.cpp delete mode 100644 core/LocAdapterBase.h delete mode 100644 core/LocApiBase.cpp delete mode 100644 core/LocApiBase.h delete mode 100644 core/LocDualContext.cpp delete mode 100644 core/LocDualContext.h delete mode 100644 core/MsgTask.cpp delete mode 100644 core/MsgTask.h delete mode 100644 core/gps_extended.h delete mode 100644 core/gps_extended_c.h delete mode 100644 core/loc_core_log.cpp rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/{LocApiRpc.h => LocApiRpcAdapter.h} (84%) rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/{LocApiRpc.cpp => LocApiRpcAdapter.cpp} (85%) create mode 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp create mode 100644 loc_api/libloc_api_50001/LocApiAdapter.h delete mode 100644 loc_api/libloc_api_50001/LocEngAdapter.cpp delete mode 100644 loc_api/libloc_api_50001/LocEngAdapter.h create mode 100644 loc_api/libloc_api_50001/gps_extended.h create mode 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp rename core/loc_core_log.h => loc_api/libloc_api_50001/loc_ulp.h (50%) diff --git a/core/Android.mk b/core/Android.mk deleted file mode 100644 index f9074dbd..00000000 --- a/core/Android.mk +++ /dev/null @@ -1,49 +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 - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libgps.utils \ - libdl \ - libandroid_runtime - -LOCAL_SRC_FILES += \ - MsgTask.cpp \ - 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 - -LOCAL_COPY_HEADERS_TO:= libloc_core/ -LOCAL_COPY_HEADERS:= \ - MsgTask.h \ - LocApiBase.h \ - LocAdapterBase.h \ - ContextBase.h \ - LocDualContext.h \ - gps_extended_c.h \ - gps_extended.h \ - loc_core_log.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp deleted file mode 100644 index 7922cc21..00000000 --- a/core/ContextBase.cpp +++ /dev/null @@ -1,63 +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_CtxBase" - -#include -#include -#include -#include -#include -#include -#include - -namespace loc_core { - -const char* ContextBase::mIzatLibName = "libloc_api_v02.so "; -// we initialized this handle to 1 because it can't possibly -// 1 if it ever gets assigned a value. NULL on the otherhand -// is possilbe. -void* ContextBase::mIzatLibHandle = (void*)1; - -void* ContextBase::getIzatLibHandle() -{ - if ((void*)1 == mIzatLibHandle) { - mIzatLibHandle = dlopen(mIzatLibName, RTLD_NOW); - } - return mIzatLibHandle; -} - -ContextBase::ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - mMsgTask(msgTask), - mLocApi(LocApiBase::create(mMsgTask, exMask, getIzatLibHandle())) -{ -} - -} diff --git a/core/ContextBase.h b/core/ContextBase.h deleted file mode 100644 index b04def33..00000000 --- a/core/ContextBase.h +++ /dev/null @@ -1,61 +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_CONTEXT_BASE__ -#define __LOC_CONTEXT_BASE__ - -#include -#include -#include -#include - -namespace loc_core { - -class LocAdapterBase; - -class ContextBase { - static const char* mIzatLibName; - static void* mIzatLibHandle; -protected: - const MsgTask* mMsgTask; - LocApiBase* mLocApi; - -protected: - ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - inline virtual ~ContextBase() { delete mLocApi; } - -public: - static void* getIzatLibHandle(); - inline const MsgTask* getMsgTask() { return mMsgTask; } - inline LocApiBase* getLocApi() { return mLocApi; } -}; - -} // namespace loc_core - -#endif //__LOC_CONTEXT_BASE__ diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp deleted file mode 100644 index 27b9f61f..00000000 --- a/core/LocAdapterBase.cpp +++ /dev/null @@ -1,147 +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_LocAdapterBase" - -#include -#include -#include -#include - -namespace loc_core { - -struct LocOpenMsg : public LocMsg { - LocAdapterBase* mLocAdapter; - LocApiBase* mLocApi; - inline LocOpenMsg(LocAdapterBase* locAdapter, - LocApiBase* locApi) : - LocMsg(), mLocAdapter(locAdapter), mLocApi(locApi) - { - locallog(); - } - inline virtual void proc() const { - mLocApi->addAdapter(mLocAdapter); - } - inline void locallog() { - LOC_LOGV("LocOpen"); - } - inline virtual void log() { - locallog(); - } -}; - -// 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) : - mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) -{ - sendMsg(new LocOpenMsg(this, mLocApi)); -} - -// This will be overridden by the individual adapters -// if necessary. -#define DEFAULT_IMPL(rtv) \ -{ \ - LOC_LOGW("%s: default implementation invoked", __func__); \ - return rtv; \ -} - -void LocAdapterBase:: - handleEngineDownEvent() -DEFAULT_IMPL() - -void LocAdapterBase:: - reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -DEFAULT_IMPL() - -void LocAdapterBase:: - reportSv(GpsSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) -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) -} // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h deleted file mode 100644 index aca70f59..00000000 --- a/core/LocAdapterBase.h +++ /dev/null @@ -1,97 +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_API_ADAPTER_BASE_H -#define LOC_API_ADAPTER_BASE_H - -#include -#include - -namespace loc_core { - -class LocAdapterBase { -protected: - const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; - ContextBase* mContext; - LocApiBase* mLocApi; - const MsgTask* mMsgTask; - - LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context); - inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - -public: - 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); - } - - // This will be overridden by the individual adapters - // if necessary. - inline virtual void handleEngineUpEvent() {} - virtual void handleEngineDownEvent() ; - virtual void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - 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; } -}; - -} // namespace loc_core - -#endif //LOC_API_ADAPTER_BASE_H diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp deleted file mode 100644 index c6fef931..00000000 --- a/core/LocApiBase.cpp +++ /dev/null @@ -1,475 +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_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(); - } -}; - -LocApiBase* LocApiBase::create(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - void* libHandle) -{ - LocApiBase* locApi = NULL; - - // first if can not be MPQ - if (TARGET_MPQ != get_target()) { - getLocApi_t* getter = NULL; - // needto check if locaction.so exists - void* handle = ContextBase::getIzatLibHandle(); - - if (NULL == handle || - NULL == (getter = (getLocApi_t*)dlsym(handle, "getLocApi")) || - NULL == (locApi = (*getter)(msgTask, exMask))) { - // only RPC is the option now - handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { - getter = (getLocApi_t*)dlsym(handle, "getLocApi"); - if (NULL != getter) { - locApi = (*getter)(msgTask, exMask); - } - } - } - } - - // locApi could still be NULL at this time - // we would then create a dummy one - if (NULL == locApi) { - locApi = new LocApiBase(msgTask, exMask); - } - - return locApi; -} - -LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : - mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) -{ - memset(mLocAdapters, 0, sizeof(mLocAdapters)); -} - -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; - - TO_ALL_LOCADAPTERS(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; - open(mMask | (adapter->getEvtMask() & ~mExcludedMask)); - 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 - open(getEvtMask() & ~mExcludedMask); - } - } - } -} - -void LocApiBase::handleEngineUpEvent() -{ - // This will take care of renegotiating the loc handle - mMsgTask->sendMsg(new LocSsrMsg(this)); - - // 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) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportPosition(location, - locationExtended, - locationExt, - status, - loc_technology_mask) - ); -} - -void LocApiBase::reportSv(GpsSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSv(svStatus, - locationExtended, - svExt) - ); -} - -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)); -} - - -// downward calls -// All below functions are to be defined by adapter specific modules: -// RPC, QMI, etc. The default implementation is empty. -#define DEFAULT_IMPL(rtv) \ -{ \ - LOC_LOGW("%s: default implementation invoked", __func__); \ - return rtv; \ -} - -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:: - setLPPConfig(uint32_t profile) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage) -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:: - setExtPowerConfig(int isBatteryCharging) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setAGLONASSProtocol(unsigned long aGlonassProtocol) -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() - - -} // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h deleted file mode 100644 index c027b3f8..00000000 --- a/core/LocApiBase.h +++ /dev/null @@ -1,254 +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_API_BASE_H -#define LOC_API_BASE_H - -#include -#include -#include -#include - -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) -#define MAX_APN_LEN 100 - -namespace loc_core { - -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); - -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_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, - 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_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< -#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); - -const MsgTask* LocDualContext::mMsgTask = NULL; -ContextBase* LocDualContext::mFgContext = NULL; -ContextBase* LocDualContext::mBgContext = NULL; - -char LocDualContext::mHasAgpsExt = 0xff; - -// the name must be shorter than 15 chars -const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; - -const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, - const char* name) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name); - } - return mMsgTask; -} - -ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, - const char* name) -{ - if (NULL == mFgContext) { - const MsgTask* msgTask = getMsgTask(tCreator, name); - mFgContext = new LocDualContext(msgTask, - mFgExclMask); - } - return mFgContext; -} - -ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, - const char* name) -{ - if (NULL == mBgContext) { - const MsgTask* msgTask = getMsgTask(tCreator, name); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); - } - return mBgContext; -} - -bool LocDualContext::hasAgpsExt() -{ - if (0xff == mHasAgpsExt) { - mHasAgpsExt = 0; - void* handle = ContextBase::getIzatLibHandle(); - if (NULL != handle) { - bool(*getter)() = (bool(*)())dlsym(handle, "hasAgpsExt"); - if (NULL != getter && (*getter)()) { - mHasAgpsExt = 1; - } - } - } - - return mHasAgpsExt == 1; -} - -LocDualContext::LocDualContext(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - ContextBase(msgTask, exMask) -{ -} - -} diff --git a/core/LocDualContext.h b/core/LocDualContext.h deleted file mode 100644 index 4e03bf44..00000000 --- a/core/LocDualContext.h +++ /dev/null @@ -1,68 +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_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 char mHasAgpsExt; - - static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, - const char* name); - -protected: - LocDualContext(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - inline virtual ~LocDualContext() {} - -public: - 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(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, - const char* name); - - static bool hasAgpsExt(); -}; - -} - -#endif //__LOC_ENG_CONTEXT__ diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp deleted file mode 100644 index 37813394..00000000 --- a/core/MsgTask.cpp +++ /dev/null @@ -1,133 +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_MsgTask" - -#include -#include -#include -#include -#include -#include -#include - -namespace loc_core { - -#define MAX_TASK_COMM_LEN 15 - -static void LocMsgDestroy(void* msg) { - delete (LocMsg*)msg; -} - -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(NULL){ - if (tCreator) { - tCreator(threadName, loopMain, - (void*)new MsgTask(mQ, mAssociator)); - } else { - createPThread(threadName); - } -} - -MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(tAssociator){ - createPThread(threadName); -} - -inline -MsgTask::MsgTask(const void* q, tAssociate associator) : - mQ(q), mAssociator(associator){ -} - -MsgTask::~MsgTask() { - msg_q_unblock((void*)mQ); -} - -void MsgTask::createPThread(const char* threadName) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_t tid; - // create the thread here, then if successful - // and a name is given, we set the thread name - if (!pthread_create(&tid, &attr, loopMain, - (void*)new MsgTask(mQ, mAssociator)) && - NULL != threadName) { - char lname[MAX_TASK_COMM_LEN+1]; - memcpy(lname, threadName, MAX_TASK_COMM_LEN); - lname[MAX_TASK_COMM_LEN] = 0; - pthread_setname_np(tid, lname); - } -} - -void MsgTask::sendMsg(const LocMsg* msg) const { - msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); -} - -void* MsgTask::loopMain(void* arg) { - MsgTask* copy = (MsgTask*)arg; - - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); - - if (NULL != copy->mAssociator) { - copy->mAssociator(); - } - - LocMsg* msg; - int cnt = 0; - - while (1) { - LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); - - msq_q_err_type result = msg_q_rcv((void*)copy->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)); - // destroy the Q and exit - msg_q_destroy((void**)&(copy->mQ)); - delete copy; - return NULL; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete msg; - } - - delete copy; - - return NULL; -} - -} diff --git a/core/MsgTask.h b/core/MsgTask.h deleted file mode 100644 index d09de731..00000000 --- a/core/MsgTask.h +++ /dev/null @@ -1,66 +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 __MSG_TASK__ -#define __MSG_TASK__ - -#include -#include -#include -#include - -namespace loc_core { - -struct LocMsg { - inline LocMsg() {} - inline virtual ~LocMsg() {} - virtual void proc() const = 0; - inline virtual void log() const {} -}; - -class MsgTask { -public: - typedef void* (*tStart)(void*); - typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); - typedef int (*tAssociate)(); - MsgTask(tCreate tCreator, const char* threadName); - MsgTask(tAssociate tAssociator, const char* threadName); - ~MsgTask(); - void sendMsg(const LocMsg* msg) const; - -private: - const void* mQ; - tAssociate mAssociator; - MsgTask(const void* q, tAssociate associator); - static void* loopMain(void* copy); - void createPThread(const char* name); -}; - -} // namespace loc_core - -#endif //__MSG_TASK__ diff --git a/core/gps_extended.h b/core/gps_extended.h deleted file mode 100644 index 88b0415b..00000000 --- a/core/gps_extended.h +++ /dev/null @@ -1,92 +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. - */ - -#ifndef GPS_EXTENDED_H -#define GPS_EXTENDED_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -struct LocPosMode -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval; - uint32_t preferred_accuracy; - uint32_t preferred_time; - char credentials[14]; - char provider[8]; - LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, - uint32_t gap, uint32_t accu, uint32_t time, - const char* cred, const char* prov) : - mode(m), recurrence(recr), - min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), - preferred_accuracy(accu), preferred_time(time) { - 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(MIN_POSSIBLE_FIX_INTERVAL), - preferred_accuracy(50), preferred_time(120000) { - 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/core/gps_extended_c.h b/core/gps_extended_c.h deleted file mode 100644 index 640668ff..00000000 --- a/core/gps_extended_c.h +++ /dev/null @@ -1,256 +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. - */ - -#ifndef GPS_EXTENDED_C_H -#define GPS_EXTENDED_C_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include -#include - -/** 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 - -#define ULP_MIN_INTERVAL_INVALID 0xffffffff - - -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 - -#define GPS_DELETE_ALMANAC_CORR 0x00001000 -#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 -#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 -#define GPS_DELETE_ALMANAC_GLO 0x00008000 -#define GPS_DELETE_SVDIR_GLO 0x00010000 -#define GPS_DELETE_SVSTEER_GLO 0x00020000 -#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 -#define GPS_DELETE_TIME_GPS 0x00080000 -#define GPS_DELETE_TIME_GLO 0x00100000 - -/** 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; - char ipv6_addr[16]; - 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; - - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_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_STANDALONE, - 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; - -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ - -/** 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 - -/** 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; -} 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) - -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; - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* GPS_EXTENDED_C_H */ - diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp deleted file mode 100644 index f67dfe0b..00000000 --- a/core/loc_core_log.cpp +++ /dev/null @@ -1,250 +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_core_log" - -#include -#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 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 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 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = -{ - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) -}; -static 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 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_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) -}; -static 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 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 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 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 ) -}; -static 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 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 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 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 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 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_IPV4 ), - NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) -}; -static 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 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 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 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 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 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 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/loc_api/Android.mk b/loc_api/Android.mk index 743b3860..c87df1f9 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,6 +6,8 @@ LOCAL_PATH := $(call my-dir) ifneq ($(TARGET_NO_RPC),true) GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ +GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index bb3d924b..c7a245b8 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -9,7 +9,7 @@ source_files:= \ src/loc_apicb_appinit.c \ src/loc_api_fixup.c \ src/loc_api_log.c \ - src/LocApiRpc.cpp + src/LocApiRpcAdapter.cpp LOCAL_SRC_FILES:= $(source_files) @@ -26,7 +26,7 @@ LOCAL_SHARED_LIBRARIES:= \ libcutils \ libcommondefs \ libgps.utils \ - libloc_core + libloc_adapter LOCAL_STATIC_LIBRARIES := \ libloc_api_rpcgen @@ -37,20 +37,20 @@ 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-rpc \ $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ $(TARGET_OUT_HEADERS)/librpc \ $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ - $(TOP)/hardware/msm7k/librpc + $(TARGET_OUT_HEADERS)/libloc_eng \ + 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 + $(RPC_INC)/loc_apicb_appinit.h LOCAL_MODULE:= libloc_api-rpc-qc LOCAL_MODULE_OWNER := qcom diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h similarity index 84% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h index fef42199..32ea6e7f 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h @@ -26,30 +26,24 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#ifndef LOC_API_RPC_H -#define LOC_API_RPC_H +#ifndef LOC_API_RPC_ADAPTER_H +#define LOC_API_RPC_ADAPTER_H #include -#include #include -#include -#include +#include -using namespace loc_core; -class LocApiRpc : public LocApiBase { +class LocApiRpcAdapter : public LocApiAdapter { // RPC communication establishment rpc_loc_client_handle_type client_handle; + rpc_loc_event_mask_type eMask; 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 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); @@ -57,16 +51,13 @@ class LocApiRpc : public LocApiBase { 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); - - virtual enum loc_api_adapter_err - open(LOC_API_ADAPTER_EVENT_MASK_T mask); - virtual enum loc_api_adapter_err - close(); + int NIEventFillVerfiyType(GpsNiNotification ¬if, + rpc_loc_ni_notify_verify_e_type notif_priv); + GpsNiEncodingType convertNiEncodingType(int loc_encoding); public: - LocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - ~LocApiRpc(); + LocApiRpcAdapter(LocEng &locEng); + ~LocApiRpcAdapter(); int locEventCB(rpc_loc_client_handle_type client_handle, rpc_loc_event_mask_type loc_event, @@ -76,11 +67,13 @@ public: // RPC adapter interface implementations virtual enum loc_api_adapter_err - startFix(const LocPosMode& posMode); + reinit(); + virtual enum loc_api_adapter_err + startFix(); virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode& mode); + setPositionMode(const LocPosMode *mode); inline virtual enum loc_api_adapter_err enableData(int enable) { return enableData(enable, false); } virtual enum loc_api_adapter_err @@ -115,7 +108,4 @@ public: virtual void setInSession(bool inSession); }; -extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - -#endif //LOC_API_RPC_H +#endif //LOC_API_RPC_ADAPTER_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp similarity index 85% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp index 879244da..e836f103 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp @@ -27,27 +27,24 @@ * */ #define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_api_rpc" +#define LOG_TAG "LocSvc_adapter" #include #include #ifndef USE_GLIB #include #endif /* USE_GLIB */ -#include -#include -#include -#include -#include -#include -#include +#include "LocApiRpcAdapter.h" +#include "loc_api_rpcgen_common_rpc.h" +#include "log_util.h" +#include "loc_log.h" +#include "loc_api_log.h" #ifdef USE_GLIB #include #endif -#include -#include +#include "librpc.h" +#include "platform_lib_includes.h" -using namespace loc_core; #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (3072) @@ -80,7 +77,7 @@ static int32 loc_event_cb { 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); + int32 ret_val = ((LocApiRpcAdapter*)user)->locEventCB(client_handle, loc_event, loc_event_payload); EXIT_LOG(%d, ret_val); return ret_val; } @@ -104,21 +101,17 @@ SIDE EFFECTS 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); + ((LocApiRpcAdapter*)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[] = +LocApiAdapter* getLocApiAdapter(LocEng &locEng) +{ + return new LocApiRpcAdapter(locEng); +} + +const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = { RPC_LOC_EVENT_PARSED_POSITION_REPORT, RPC_LOC_EVENT_SATELLITE_REPORT, @@ -131,24 +124,27 @@ const rpc_loc_event_mask_type LocApiRpc::locBits[] = RPC_LOC_EVENT_STATUS_REPORT }; -// constructor -LocApiRpc::LocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - LocApiBase(msgTask, exMask), +LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : + LocApiAdapter(locEng), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), + eMask(convertMask(locEng.eventMask)), dataEnableLastSet(-1) { memset(apnLastSet, 0, sizeof(apnLastSet)); loc_api_glue_init(); } -LocApiRpc::~LocApiRpc() +LocApiRpcAdapter::~LocApiRpcAdapter() { - close(); + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } + + loc_close(client_handle); } rpc_loc_event_mask_type -LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) +LocApiRpcAdapter::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) { rpc_loc_event_mask_type newMask = 0; @@ -163,7 +159,7 @@ LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) } enum loc_api_adapter_err -LocApiRpc::convertErr(int rpcErr) +LocApiRpcAdapter::convertErr(int rpcErr) { switch(rpcErr) { @@ -192,7 +188,7 @@ LocApiRpc::convertErr(int rpcErr) } } -void LocApiRpc::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) +void LocApiRpcAdapter::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) { static rpc_loc_engine_state_e_type last_state = RPC_LOC_ENGINE_STATE_MAX; @@ -212,10 +208,12 @@ void LocApiRpc::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) } } -int32 LocApiRpc::locEventCB(rpc_loc_client_handle_type client_handle, +int32 LocApiRpcAdapter::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) { + locEngHandle.acquireWakelock(); + // Parsed report if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) { @@ -271,89 +269,60 @@ int32 LocApiRpc::locEventCB(rpc_loc_client_handle_type client_handle, NIEvent(&loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request); } + locEngHandle.releaseWakeLock(); 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) +LocApiRpcAdapter::reinit() { enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { + loc_clear(client_handle); + } - // 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; + client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); - 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; - } + if (client_handle < 0) { + 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"); +LocApiRpcAdapter::startFix() { + LOC_LOGD("LocApiRpcAdapter::startFix() called"); return convertErr( loc_start_fix(client_handle) ); } enum loc_api_adapter_err -LocApiRpc::stopFix() { - LOC_LOGD("LocApiRpc::stopFix() called"); +LocApiRpcAdapter::stopFix() { + LOC_LOGD("LocApiRpcAdapter::stopFix() called"); return convertErr( loc_stop_fix(client_handle) ); } enum loc_api_adapter_err -LocApiRpc::setPositionMode(const LocPosMode& posMode) +LocApiRpcAdapter::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_fix_criteria_s_type *fix_criteria_ptr; 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; + + if (NULL != posMode) + fixCriteria = *posMode; ALOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) client_handle, fixCriteria->min_interval, fixCriteria->mode); + (int32) client_handle, fixCriteria.min_interval, fixCriteria.mode); - switch (fixCriteria->mode) + switch (fixCriteria.mode) { case LOC_POSITION_MODE_MS_BASED: op_mode = RPC_LOC_OPER_MODE_MSB; @@ -379,24 +348,25 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode) op_mode = RPC_LOC_OPER_MODE_STANDALONE; } + fix_criteria_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; 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->min_interval = fixCriteria.min_interval; fix_criteria_ptr->preferred_operation_mode = op_mode; - fix_criteria_ptr->min_interval = fixCriteria->min_interval; + 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; + 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; + 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) { + switch (fixCriteria.recurrence) { case GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; @@ -417,7 +387,7 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode) } enum loc_api_adapter_err -LocApiRpc::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +LocApiRpcAdapter::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; @@ -443,7 +413,7 @@ LocApiRpc::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) } enum loc_api_adapter_err -LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) +LocApiRpcAdapter::injectPosition(double latitude, double longitude, float accuracy) { /* IOCTL data */ rpc_loc_ioctl_data_u_type ioctl_data; @@ -482,7 +452,7 @@ LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) } enum loc_api_adapter_err -LocApiRpc::informNiResponse(GpsUserResponseType userResponse, +LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) { rpc_loc_ioctl_data_u_type data; @@ -519,7 +489,7 @@ LocApiRpc::informNiResponse(GpsUserResponseType userResponse, } enum loc_api_adapter_err -LocApiRpc::setAPN(char* apn, int len, boolean force) +LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; int size = sizeof(apnLastSet); @@ -530,7 +500,7 @@ LocApiRpc::setAPN(char* apn, int len, boolean force) } memcpy(apnLastSet, apn, size); - if (!isInSession()) { + if (false == navigating) { 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; @@ -548,16 +518,17 @@ LocApiRpc::setAPN(char* apn, int len, boolean force) return rtv; } -void LocApiRpc::setInSession(bool inSession) +void LocApiRpcAdapter::setInSession(bool inSession) { - if (!inSession) { + LocApiAdapter::setInSession(inSession); + if (false == navigating) { enableData(dataEnableLastSet, true); setAPN(apnLastSet, sizeof(apnLastSet)-1, true); } } enum loc_api_adapter_err -LocApiRpc::setServer(const char* url, int len) +LocApiRpcAdapter::setServer(const char* url, int len) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_server_info_s_type *server_info_ptr; @@ -588,7 +559,7 @@ LocApiRpc::setServer(const char* url, int len) } enum loc_api_adapter_err -LocApiRpc::setServer(unsigned int ip, int port, LocServerType type) +LocApiRpcAdapter::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; @@ -623,13 +594,13 @@ LocApiRpc::setServer(unsigned int ip, int port, LocServerType type) } enum loc_api_adapter_err -LocApiRpc::enableData(int enable, boolean force) +LocApiRpcAdapter::enableData(int enable, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; if (force || dataEnableLastSet != enable) { dataEnableLastSet = enable; - if (!isInSession()) { + if (false == navigating) { 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; @@ -646,7 +617,7 @@ LocApiRpc::enableData(int enable, boolean force) } enum loc_api_adapter_err -LocApiRpc::deleteAidingData(GpsAidingData bits) +LocApiRpcAdapter::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; @@ -660,7 +631,7 @@ LocApiRpc::deleteAidingData(GpsAidingData bits) ); } -void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; @@ -752,36 +723,30 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re } 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); + LocApiAdapter::reportPosition(location, + locationExtended, + locEngHandle.extPosInfo((void*)location_report_ptr), + (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + 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); + LocApiAdapter::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"); + 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) +void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; @@ -881,52 +846,51 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if (SvStatus.num_svs >= 0) { - LocApiBase::reportSv(SvStatus, - locationExtended, - (void*)gnss_report_ptr); + LocApiAdapter::reportSv(SvStatus, + locationExtended, + locEngHandle.extSvInfo((void*)gnss_report_ptr)); } } -void LocApiRpc::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) +void LocApiRpcAdapter::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); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); + LocApiAdapter::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); + LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); + LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); } else { - LocApiBase::reportStatus(GPS_STATUS_NONE); + LocApiAdapter::reportStatus(GPS_STATUS_NONE); } } } -void LocApiRpc::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +void LocApiRpcAdapter::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); + LocApiAdapter::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); + LocApiAdapter::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[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) +LocApiRpcAdapter::setXtraData(char* data, int length) { int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; int total_parts; @@ -1004,7 +968,7 @@ LocApiRpc::setXtraData(char* data, int length) /* Request the Xtra Server Url from the modem */ enum loc_api_adapter_err -LocApiRpc::requestXtraServer() +LocApiRpcAdapter::requestXtraServer() { loc_api_adapter_err err; rpc_loc_ioctl_data_u_type data; @@ -1037,19 +1001,16 @@ LocApiRpc::requestXtraServer() 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); + LocApiAdapter::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) +LocApiRpcAdapter::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; @@ -1123,7 +1084,7 @@ LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear } enum loc_api_adapter_err -LocApiRpc::atlCloseStatus(int handle, int is_succ) +LocApiRpcAdapter::atlCloseStatus(int handle, int is_succ) { rpc_loc_ioctl_data_u_type ioctl_data; ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; @@ -1143,7 +1104,7 @@ LocApiRpc::atlCloseStatus(int handle, int is_succ) ); } -void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) +void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) { int connHandle; AGpsType agps_type; @@ -1179,7 +1140,7 @@ void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr } } -void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) +void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) { GpsNiNotification notif = {0}; @@ -1242,8 +1203,8 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) #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); + addr_len = LocApiAdapter::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) @@ -1322,10 +1283,10 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) // 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); + LocApiAdapter::requestNiNotify(notif, (const void*)copy); } -int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, +int LocApiRpcAdapter::NIEventFillVerfiyType(GpsNiNotification ¬if, rpc_loc_ni_notify_verify_e_type notif_priv) { switch (notif_priv) @@ -1356,7 +1317,7 @@ int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, } enum loc_api_adapter_err -LocApiRpc::setSUPLVersion(uint32_t version) +LocApiRpcAdapter::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; @@ -1369,7 +1330,7 @@ LocApiRpc::setSUPLVersion(uint32_t version) ); } -GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) +GpsNiEncodingType LocApiRpcAdapter::convertNiEncodingType(int loc_encoding) { switch (loc_encoding) { @@ -1385,8 +1346,3 @@ GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) return GPS_ENC_UNKNOWN; } } - -LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) { - return new LocApiRpc(msgTask, exMask); -} diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index dd14b5e5..07172654 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -5,7 +5,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := libloc_eng +LOCAL_MODULE := libloc_adapter LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -13,9 +13,51 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - libdl \ liblog \ - libloc_core \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + loc_eng_log.cpp \ + LocApiAdapter.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + hardware/qcom/gps/loc_api/libloc_api_50001 + +LOCAL_COPY_HEADERS_TO:= libloc_eng/ +LOCAL_COPY_HEADERS:= \ + LocApiAdapter.h \ + loc.h \ + gps_extended.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_msg_id.h \ + loc_eng_log.h \ + loc_ulp.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_eng + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + liblog \ + libloc_adapter \ libgps.utils LOCAL_SRC_FILES += \ @@ -24,8 +66,7 @@ LOCAL_SRC_FILES += \ loc_eng_xtra.cpp \ loc_eng_ni.cpp \ loc_eng_log.cpp \ - loc_eng_nmea.cpp \ - LocEngAdapter.cpp + loc_eng_nmea.cpp LOCAL_SRC_FILES += \ loc_eng_dmn_conn.cpp \ @@ -40,22 +81,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - hardware/qcom/gps/loc_api/libloc_api_50001 \ hardware/qcom/gps/loc_api/ulp/inc -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_msg_id.h \ - loc_eng_log.h - LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) @@ -63,7 +90,6 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) -LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -74,7 +100,6 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ liblog \ libloc_eng \ - libloc_core \ libgps.utils \ libdl \ libandroid_runtime @@ -94,7 +119,6 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ hardware/qcom/gps/loc_api/ulp/inc LOCAL_PRELINK_MODULE := false diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp new file mode 100644 index 00000000..b26a4008 --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.cpp @@ -0,0 +1,269 @@ +/* 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. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_adapter" + +#include +#include +#include "loc_eng_msg.h" +#include "loc_log.h" +#include "loc_eng_ni.h" + +static void* noProc(void* data) +{ + return NULL; +} + +LocEng::LocEng(void* caller, + LOC_API_ADAPTER_EVENT_MASK_T emask, + gps_acquire_wakelock acqwl, + gps_release_wakelock relwl, + loc_msg_sender msgSender, + loc_msg_sender msgUlpSender, + loc_ext_parser posParser, + loc_ext_parser svParser) : + owner(caller), + eventMask(emask), acquireWakelock(acqwl), + releaseWakeLock(relwl), sendMsge(msgSender), + sendUlpMsg(msgUlpSender), + extPosInfo(NULL == posParser ? noProc : posParser), + extSvInfo(NULL == svParser ? noProc : svParser) +{ + LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); +} + +LocApiAdapter::LocApiAdapter(LocEng &locEng) : + locEngHandle(locEng), fixCriteria(), navigating(false) +{ + LOC_LOGD("LocApiAdapter created"); +} + +LocApiAdapter::~LocApiAdapter() +{ + LOC_LOGV("LocApiAdapter deleted"); +} + +LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) +{ + void* handle; + LocApiAdapter* adapter = NULL; + + handle = dlopen ("libloc_api_v02.so", RTLD_NOW); + + if (!handle) { + handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); + } + + if (!handle) { + adapter = new LocApiAdapter(locEng); + } else { + getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); + + adapter = (*getHandle)(locEng); + } + + return adapter; +} + +int LocApiAdapter::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 LocApiAdapter::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; +} + +void LocApiAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask ) +{ + loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); + if (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } +} + +void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) +{ + loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, 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 (locEngHandle.sendUlpMsg) { + locEngHandle.sendUlpMsg(locEngHandle.owner, msg); + } else { + locEngHandle.sendMsge(locEngHandle.owner, msg); + } +} + +void LocApiAdapter::reportStatus(GpsStatusValue status) +{ + loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportNmea(const char* nmea, int length) +{ + loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength) +{ + loc_eng_msg_report_xtra_server *msg(new loc_eng_msg_report_xtra_server(locEngHandle.owner, url1, url2, url3, maxlength)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestSuplES(int connHandle) +{ + loc_eng_msg_request_supl_es *msg(new loc_eng_msg_request_supl_es(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseDataHandle(void) +{ + loc_eng_msg_close_data_call *msg(new loc_eng_msg_close_data_call(locEngHandle.owner)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::releaseATL(int connHandle) +{ + loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestXtraData() +{ + LOC_LOGD("XTRA download request"); + + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestTime() +{ + LOC_LOGD("loc_event_cb: XTRA time download request"); + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestLocation() +{ + LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); + // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); + // locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineDownEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::handleEngineUpEvent() +{ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportDataCallOpened() +{ + loc_eng_msg_atl_open_success *msg(new loc_eng_msg_atl_open_success(locEngHandle.owner, + AGPS_TYPE_INVALID, + NULL, 0, 0)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} + +void LocApiAdapter::reportDataCallClosed() +{ + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(locEngHandle.owner, + AGPS_TYPE_INVALID)); + locEngHandle.sendMsge(locEngHandle.owner, msg); +} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h new file mode 100644 index 00000000..ace934e4 --- /dev/null +++ b/loc_api/libloc_api_50001/LocApiAdapter.h @@ -0,0 +1,250 @@ +/* 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_API_ADAPTER_H +#define LOC_API_ADAPTER_H + +#include +#include +#include +#include +#include +#include +#include "platform_lib_includes.h" + +#define MAX_APN_LEN 100 +#define MAX_URL_LEN 256 +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< -#include "loc_eng_msg.h" -#include "loc_log.h" - -using namespace loc_core; - -LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, loc_msg_sender msgSender, - MsgTask::tCreate tCreator) : - LocAdapterBase(mask, - LocDualContext::getLocFgContext( - tCreator, - LocDualContext::mLocationHalName)), - mOwner(owner), mSendUlpMsg(msgSender), mNavigating(false), - mAgpsEnabled(loc_core::LocDualContext::hasAgpsExt()) -{ - memset(&mFixCriteria, 0, sizeof(mFixCriteria)); - LOC_LOGD("LocEngAdapter created"); -} - -inline -LocEngAdapter::~LocEngAdapter() -{ - LOC_LOGV("LocEngAdapter deleted"); -} - -void LocEngAdapter::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask ) -{ - if (mSendUlpMsg) { - loc_eng_msg_report_position *msg( - new loc_eng_msg_report_position(mOwner, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); - mSendUlpMsg(mOwner, msg); - } else { - sendMsg(new LocEngReportPosition(mOwner, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); - } -} - -void LocEngAdapter::reportSv(GpsSvStatus &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 (mSendUlpMsg) { - loc_eng_msg_report_sv *msg( - new loc_eng_msg_report_sv(mOwner, svStatus, - locationExtended, svExt)); - mSendUlpMsg(mOwner, msg); - } else { - sendMsg(new LocEngReportSv(mOwner, svStatus, - locationExtended, svExt)); - } -} - -inline -void LocEngAdapter::reportStatus(GpsStatusValue status) -{ - sendMsg(new LocEngReportStatus(mOwner, 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 (mAgpsEnabled) { - sendMsg(new LocEngReportXtraServer(mOwner, url1, - url2, url3, maxlength)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) -{ - if (mAgpsEnabled) { - sendMsg(new LocEngRequestATL(mOwner, - connHandle, agps_type)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::releaseATL(int connHandle) -{ - if (mAgpsEnabled) { - sendMsg(new LocEngReleaseATL(mOwner, connHandle)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::requestXtraData() -{ - if (mAgpsEnabled) { - sendMsg(new LocEngRequestXtra(mOwner)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::requestTime() -{ - if (mAgpsEnabled) { - sendMsg(new LocEngRequestXtra(mOwner)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) -{ - if (mAgpsEnabled) { - notif.size = sizeof(notif); - notif.timeout = LOC_NI_NO_RESPONSE_TIME; - - sendMsg(new LocEngRequestNi(mOwner, notif, data)); - } - return mAgpsEnabled; -} - -inline -bool LocEngAdapter::requestSuplES(int connHandle) -{ - sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return true; -} - -inline -bool LocEngAdapter::reportDataCallOpened() -{ - sendMsg(new LocEngSuplEsOpened(mOwner)); - return true; -} - -inline -bool LocEngAdapter::reportDataCallClosed() -{ - sendMsg(new LocEngSuplEsClosed(mOwner)); - return true; -} - -inline -void LocEngAdapter::handleEngineDownEvent() -{ - sendMsg(new LocEngDown(mOwner)); -} - -inline -void LocEngAdapter::handleEngineUpEvent() -{ - sendMsg(new LocEngUp(mOwner)); -} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h deleted file mode 100644 index 7e6f73bd..00000000 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ /dev/null @@ -1,238 +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_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; - -typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); - -class LocEngAdapter : public LocAdapterBase { - void* mOwner; - loc_msg_sender mSendUlpMsg; - LocPosMode mFixCriteria; - bool mNavigating; - -public: - const bool mAgpsEnabled; - - LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, loc_msg_sender msgSender, - MsgTask::tCreate tCreator); - virtual ~LocEngAdapter(); - - 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 - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) - { - return mLocApi->setTime(time, timeReference, uncertainty); - } - 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 - setLPPConfig(uint32_t profile) - { - return mLocApi->setLPPConfig(profile); - } - inline enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage) - { - return mLocApi->setSensorControlConfig(sensorUsage); - } - 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 - setExtPowerConfig(int isBatteryCharging) - { - return mLocApi->setExtPowerConfig(isBatteryCharging); - } - inline virtual enum loc_api_adapter_err - setAGLONASSProtocol(unsigned long aGlonassProtocol) - { - return mLocApi->setAGLONASSProtocol(aGlonassProtocol); - } - 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(); - } - - 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(GpsSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - 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(); - - inline const LocPosMode& getPositionMode() const - {return mFixCriteria;} - inline virtual bool isInSession() - { return mNavigating; } - inline void setInSession(bool inSession) - { mNavigating = inSession; mLocApi->setInSession(inSession); } -}; - -#endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index cee948c1..93e633f5 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -5,7 +5,7 @@ AM_CFLAGS = \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp +libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocApiAdapter.cpp if USE_GLIB libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ @@ -62,7 +62,7 @@ endif libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la library_include_HEADERS = \ - LocEngAdapter.h \ + LocApiAdapter.h \ loc.h \ loc_eng.h \ loc_eng_xtra.h \ diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h new file mode 100644 index 00000000..f1db4729 --- /dev/null +++ b/loc_api/libloc_api_50001/gps_extended.h @@ -0,0 +1,111 @@ +/* Copyright (c) 2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution. + * + * Copyright (C) 2010 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. + */ + +#ifndef GPS_EXTENDED_H +#define GPS_EXTENDED_H + +/** 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 + +/** 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 + +#define GPS_DELETE_ALMANAC_CORR 0x00001000 +#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 +#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 +#define GPS_DELETE_ALMANAC_GLO 0x00008000 +#define GPS_DELETE_SVDIR_GLO 0x00010000 +#define GPS_DELETE_SVSTEER_GLO 0x00020000 +#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 +#define GPS_DELETE_TIME_GPS 0x00080000 +#define GPS_DELETE_TIME_GLO 0x00100000 + +/** 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; + char ipv6_addr[16]; + 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; + + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiExtCallbacks; + +#endif /* GPS_EXTENDED_H */ + diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 9749703a..4ada9072 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -31,7 +31,7 @@ #define LOG_TAG "LocSvc_afw" #include -#include +#include #include #include #include @@ -43,16 +43,9 @@ #include #include #include -#include -#include +#include + #include - -namespace android { - namespace AndroidRuntime { - void* createJavaThread(const char* name, void (*start)(void *), void* arg); - } -} - //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); @@ -213,7 +206,7 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { unsigned int target = TARGET_DEFAULT; - if (NULL == loc_afw_data.adapter) { + if (NULL == loc_afw_data.context) { loc_eng_read_config(); //We load up libulp module at this point itself @@ -252,8 +245,8 @@ static void loc_free_msg(void* msg) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) { - loc_eng_data_s_type* loc_eng = (loc_eng_data_s_type*)loc_eng_data_p; - msg_q_snd(loc_eng->ulp_q, msg, loc_free_msg); + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); } /*=========================================================================== @@ -277,24 +270,25 @@ static int loc_hal_init(void) { int retVal = -1; ENTRY_LOG(); - LOC_API_ADAPTER_EVENT_MASK_T event; - if (loc_core::LocDualContext::hasAgpsExt()) { - event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; - } else { - event = 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; - } +#ifdef TARGET_USES_QCOM_BSP + LOC_API_ADAPTER_EVENT_MASK_T event = + LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | + LOC_API_ADAPTER_BIT_SATELLITE_REPORT | + LOC_API_ADAPTER_BIT_IOCTL_REPORT | + LOC_API_ADAPTER_BIT_STATUS_REPORT | + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; +#else + LOC_API_ADAPTER_EVENT_MASK_T event = + 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; +#endif LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ local_status_cb, /* status_cb */ local_sv_cb, /* sv_status_cb */ @@ -473,9 +467,9 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain ENTRY_LOG(); int ret_val = 0; - if (loc_core::LocDualContext::hasAgpsExt()) { + #ifndef TARGET_USES_QCOM_BSP ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - } + #endif EXIT_LOG(%d, ret_val); return ret_val; @@ -616,21 +610,21 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { + #ifndef TARGET_USES_QCOM_BSP ret_val = &sLocEngXTRAInterface; - } + #endif } else if (strcmp(name, AGPS_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { + #ifndef TARGET_USES_QCOM_BSP ret_val = &sLocEngAGpsInterface; - } + #endif } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { + #ifndef TARGET_USES_QCOM_BSP ret_val = &sLocEngNiInterface; - } + #endif } else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { @@ -1028,7 +1022,7 @@ static int loc_init(GpsCallbacks* callbacks) EXIT_LOG(%d, retVal); return retVal; } - memset(&afw_cb_data, 0, sizeof (afw_cb_data)); + memset(&afw_cb_data, NULL, sizeof (LocCallbacks)); gps_loc_cb = callbacks->location_cb; afw_cb_data.status_cb = callbacks->status_cb; gps_sv_cb = callbacks->sv_status_cb; diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 334e03ee..146063a2 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -37,7 +37,28 @@ extern "C" { #include #include #include -#include +#include +#include "gps_extended.h" + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +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_STANDALONE, + 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; typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); @@ -57,6 +78,22 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; +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) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index ff5fd63c..db3cb3f9 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -45,7 +44,7 @@ #include #include -#include +#include "LocApiAdapter.h" #include #ifndef USE_GLIB @@ -71,7 +70,6 @@ #include #include "log_util.h" #include "platform_lib_includes.h" -#include "loc_core_log.h" #include "loc_eng_log.h" #define SUCCESS TRUE @@ -85,10 +83,16 @@ #define SAP_CONF_FILE "/etc/sap.conf" #endif -using namespace loc_core; +static void loc_eng_deferred_action_thread(void* context); +static void* loc_eng_create_msg_q(); +static void loc_eng_free_msg(void* msg); +pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; +LocEngContext* LocEngContext::me = NULL; boolean configAlreadyRead = false; unsigned int agpsStatus = 0; + loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; @@ -165,6 +169,60 @@ static void loc_default_parameters(void) gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; } +LocEngContext::LocEngContext(gps_create_thread threadCreator) : + deferred_q((const void*)loc_eng_create_msg_q()), + + //TODO: should we conditionally create ulp msg q? + ulp_q((const void*)loc_eng_create_msg_q()), + + deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), + counter(0) +{ + LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", + getpid(), GETTID_PLATFORM_LIB_ABSTRACTION, + deferred_action_thread); +} + +LocEngContext* LocEngContext::get(gps_create_thread threadCreator) +{ + pthread_mutex_lock(&lock); + // gonna need mutex protection here... + if (NULL == me) { + me = new LocEngContext(threadCreator); + } + me->counter++; + + pthread_mutex_unlock(&lock); + return me; +} + +void LocEngContext::drop() +{ + if (deferred_action_thread != pthread_self()) { + pthread_mutex_lock(&lock); + counter--; + if (counter == 0) { + loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); + msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); + + // I am not sure if this is going to be hazardous. The calling thread + // might be blocked for a while, if the q is loaded. I am wondering + // if we should just dump all the msgs in the q upon QUIT. + pthread_cond_wait(&cond, &lock); + + msg_q_destroy((void**)&deferred_q); + + msg_q_destroy((void**)&ulp_q); + + delete me; + me = NULL; + } + pthread_mutex_unlock(&lock); + } else { + LOC_LOGE("The HAL thread cannot free itself"); + } +} + // 2nd half of init(), singled out for // modem restart to use. static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data); @@ -183,1197 +241,7 @@ static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_ 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 void deleteAidingData(loc_eng_data_s_type &logEng); -static AgpsStateMachine* -getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType); - -static void loc_eng_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - -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(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) -{ - locallog(); -} -inline void LocEngStartFix::proc() const -{ - loc_eng_start_handler(*mLocEng); -} -inline void LocEngStartFix::locallog() const -{ - LOC_LOGV("LocEngStartFix"); -} -inline void LocEngStartFix::log() const -{ - locallog(); -} -void LocEngStartFix::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); -} - -// case LOC_ENG_MSG_STOP_FIX: -LocEngStopFix::LocEngStopFix(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) -{ - locallog(); -} -inline void LocEngStopFix::proc() const -{ - loc_eng_stop_handler(*mLocEng); -} -inline void LocEngStopFix::locallog() const -{ - LOC_LOGV("LocEngStopFix"); -} -inline void LocEngStopFix::log() const -{ - locallog(); -} -void LocEngStopFix::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->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); -} - -// case LOC_ENG_MSG_SET_TIME: -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 { - 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 { - 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 { - mAdapter->setAGLONASSProtocol(mAGlonassProtocl); - } - inline void locallog() const { - LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); - } - 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 { - mAdapter->setSUPLVersion(mSuplVer); - } - inline void locallog() const { - LOC_LOGV("SUPL Version: %d", mSuplVer); - } - 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 { - 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; - inline LocEngSensorControlConfig(LocEngAdapter* adapter, - int sensorsDisabled) : - LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setSensorControlConfig(mSensorsDisabled); - } - inline void locallog() const { - LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", - mSensorsDisabled); - } - 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_EXT_POWER_CONFIG: -struct LocEngExtPowerConfig : public LocMsg { - LocEngAdapter* mAdapter; - const int mIsBatteryCharging; - inline LocEngExtPowerConfig(LocEngAdapter* adapter, - int isBatteryCharging) : - LocMsg(), mAdapter(adapter), - mIsBatteryCharging(isBatteryCharging) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setExtPowerConfig(mIsBatteryCharging); - } - inline void locallog() const { - LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d", - mIsBatteryCharging); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_REPORT_POSITION: -LocEngReportPosition::LocEngReportPosition(void* locEng, - UlpLocation &loc, - GpsLocationExtended &locExtended, - void* locExt, - enum loc_sess_status st, - LocPosTechMask technology) : - LocMsg(), mLocEng(locEng), mLocation(loc), - mLocationExtended(locExtended), - mLocationExt(((loc_eng_data_s_type*)mLocEng)->location_ext_parser(locExt)), - mStatus(st), mTechMask(technology) -{ - locallog(); -} -void LocEngReportPosition::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; - - 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) & - 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)))) { - 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); - } - - if (locEng->generateNmea && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) - { - 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("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", - mLocation.gpsLocation.flags, mLocation.position_source, - mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, - mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, - mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, - mLocation.gpsLocation.timestamp, mLocation.rawDataSize, - mLocation.rawData, mStatus, mTechMask); -} -void LocEngReportPosition::log() const { - locallog(); -} -void LocEngReportPosition::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); -} - - -// case LOC_ENG_MSG_REPORT_SV: -LocEngReportSv::LocEngReportSv(void* locEng, - GpsSvStatus &sv, - GpsLocationExtended &locExtended, - void* svExt) : - LocMsg(), mLocEng(locEng), mSvStatus(sv), - mLocationExtended(locExtended), - mSvExt(((loc_eng_data_s_type*)mLocEng)->sv_ext_parser(svExt)) -{ - locallog(); -} -void LocEngReportSv::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->sv_status_cb != NULL) { - locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus), - (void*)mSvExt); - } - - if (locEng->generateNmea) - { - loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended); - } - } -} -void LocEngReportSv::locallog() const { - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " - "used in fix mask: %x\n sv: prn snr " - "elevation azimuth", - mSvStatus.num_svs, mSvStatus.ephemeris_mask, - mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); - for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f\n ", - i, - mSvStatus.sv_list[i].prn, - mSvStatus.sv_list[i].snr, - mSvStatus.sv_list[i].elevation, - mSvStatus.sv_list[i].azimuth); - } -} -inline void LocEngReportSv::log() const { - locallog(); -} -void LocEngReportSv::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); -} - -// case LOC_ENG_MSG_REPORT_STATUS: -LocEngReportStatus::LocEngReportStatus(void* locEng, - GpsStatusValue engineStatus) : - LocMsg(), mLocEng(locEng), mStatus(engineStatus) -{ - locallog(); -} -inline void LocEngReportStatus::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; - - 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; - CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); - 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)]) -{ - strlcpy(mServers, url1, mMaxLen); - strlcpy(&mServers[mMaxLen], url2, mMaxLen); - strlcpy(&mServers[mMaxLen<<1], url3, mMaxLen); - 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], - &mServers[mMaxLen<<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], &mServers[mMaxLen<<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>>24), - (unsigned char)(mIPv4Addr>>16), - (unsigned char)(mIPv4Addr>>8), - (unsigned char)mIPv4Addr, - 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; - 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; - 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; - AgpsStateMachine* sm = locEng->ds_nif; - DSSubscriber s(sm, mID); - sm->subscribeRsrc((Subscriber*)&s); -} -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); - ATLSubscriber s(mID, - sm, - locEng->adapter, - AGPS_TYPE_INVALID == mType); - sm->subscribeRsrc((Subscriber*)&s); -} -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; - 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__); - } else { - 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__); - } else { - DSSubscriber s3(locEng->ds_nif, mID); - if(locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", - __func__, __LINE__); - } else { - 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; - WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); - if (mIsReq) { - locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); - } else { - locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); - } -} -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 (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_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); - } - 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 { - AgpsStateMachine* mStateMachine; - const int mLen; - char* mAPN; - const AGpsBearerType mBearerType; - inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine, - const char* name, - int len, - AGpsBearerType btype) : - LocMsg(), - mStateMachine(statemachine), 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 { - mStateMachine->setBearer(mBearerType); - mStateMachine->setAPN(mAPN, mLen); - mStateMachine->onRsrcEvent(RSRC_GRANTED); - } - inline void locallog() const { - LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" - " bearer type: %s", - loc_get_agps_type_name(mStateMachine->getType()), - mAPN, - loc_get_agps_bear_name(mBearerType)); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_ATL_CLOSED: -struct LocEngAtlClosed : public LocMsg { - AgpsStateMachine* mStateMachine; - inline LocEngAtlClosed(AgpsStateMachine* statemachine) : - LocMsg(), mStateMachine(statemachine) { - locallog(); - } - inline virtual void proc() const { - mStateMachine->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 { - AgpsStateMachine* mStateMachine; - inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) : - LocMsg(), mStateMachine(statemachine) { - locallog(); - } - inline virtual void proc() const { - mStateMachine->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(); -} - +static char extra_data[100]; /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -1387,6 +255,27 @@ inline void LocEngUp::log() const { } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) +{ + LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; + msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); +} + +static void* loc_eng_create_msg_q() +{ + void* q = NULL; + if (eMSG_Q_SUCCESS != msg_q_init(&q)) { + LOC_LOGE("loc_eng_create_msg_q Q init failed."); + q = NULL; + } + return q; +} + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + /*=========================================================================== FUNCTION loc_eng_init @@ -1419,11 +308,15 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, return ret_val; } - STATE_CHECK((NULL == loc_eng_data.adapter), + STATE_CHECK((NULL == loc_eng_data.context), "instance already initialized", return 0); memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + // Create context (msg q + thread) (if not yet created) + // This will also parse gps.conf, if not done. + loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); + // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; loc_eng_data.sv_status_cb = callbacks->sv_status_cb; @@ -1432,10 +325,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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.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 @@ -1453,15 +342,22 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } - loc_eng_data.adapter = - new LocEngAdapter(event, &loc_eng_data, - loc_external_msg_sender, - (MsgTask::tCreate)callbacks->create_thread_cb); + LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, + loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, + callbacks->location_ext_parser, callbacks->sv_ext_parser); + loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); - LOC_LOGD("loc_eng_init created client, id = %p\n", - loc_eng_data.adapter); + if (NULL == loc_eng_data.client_handle) { + // drop the context and declare failure + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + } else { + LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); - loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data)); + /*send reinit event to QMI instead of call reinit directly*/ + loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_LOC_INIT)); + locEngHandle.sendMsge(locEngHandle.owner, msg); + } EXIT_LOG(%d, ret_val); return ret_val; @@ -1470,16 +366,30 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG(); - int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + int ret_val = loc_eng_data.client_handle->reinit(); if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { LOC_LOGD("loc_eng_reinit reinit() successful"); - LocEngAdapter* adapter = loc_eng_data.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)); - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, + gps_conf.SUPL_VER)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + supl_msg, loc_eng_free_msg); + + loc_eng_msg_lpp_config *lpp_msg(new loc_eng_msg_lpp_config(&loc_eng_data, + gps_conf.LPP_PROFILE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + lpp_msg, loc_eng_free_msg); + + loc_eng_msg_sensor_control_config *sensor_control_config_msg( + new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_control_config_msg, loc_eng_free_msg); + + loc_eng_msg_a_glonass_protocol *a_glonass_protocol_msg(new loc_eng_msg_a_glonass_protocol(&loc_eng_data, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + a_glonass_protocol_msg, loc_eng_free_msg); /* 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 || @@ -1488,32 +398,43 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) 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)); + loc_eng_msg_sensor_properties *sensor_properties_msg( + new loc_eng_msg_sensor_properties(&loc_eng_data, + 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)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_properties_msg, loc_eng_free_msg); } - 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)); + loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( + new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, + 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)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + sensor_perf_control_conf_msg, loc_eng_free_msg); - adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); + //Send data disable to modem. This will be set to enable when + //an UPDATE_NETWORK_STATE event is received from Android + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, + 0, (agpsStatus ? 1:0))); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } EXIT_LOG(%d, ret_val); @@ -1539,7 +460,7 @@ SIDE EFFECTS void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return); + INIT_CHECK(loc_eng_data.context, return); // XTRA has no state, so we are fine with it. @@ -1555,7 +476,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.internet_nif = NULL; } #endif - if (loc_eng_data.adapter->isInSession()) + if (loc_eng_data.client_handle->isInSession()) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); loc_eng_stop(loc_eng_data); @@ -1563,6 +484,9 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) #if 0 // can't afford to actually clean up, for many reason. + ((LocEngContext*)(loc_eng_data.context))->drop(); + loc_eng_data.context = NULL; + // De-initialize ulp if (locEngUlpInf != NULL) { @@ -1570,9 +494,12 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) msg_q_destroy( &loc_eng_data.ulp_q); } - LOC_LOGD("loc_eng_init: client opened. close it now."); - delete loc_eng_data.adapter; - loc_eng_data.adapter = NULL; + if (loc_eng_data.client_handle != NULL) + { + LOC_LOGD("loc_eng_init: client opened. close it now."); + delete loc_eng_data.client_handle; + loc_eng_data.client_handle = NULL; + } loc_eng_dmn_conn_loc_api_server_unblock(); loc_eng_dmn_conn_loc_api_server_join(); @@ -1602,19 +529,15 @@ SIDE EFFECTS int loc_eng_start(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); + INIT_CHECK(loc_eng_data.context, return -1); - if(loc_eng_data.ulp_q) - { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else - { - loc_eng_data.adapter->sendMsg(new LocEngStartFix(&loc_eng_data)); - } + void* target_q = loc_eng_data.ulp_initialized ? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -1624,13 +547,13 @@ 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 (!loc_eng_data.client_handle->isInSession()) { + ret_val = loc_eng_data.client_handle->startFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { - loc_eng_data.adapter->setInSession(TRUE); + loc_eng_data.client_handle->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -1658,18 +581,15 @@ SIDE EFFECTS int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); + INIT_CHECK(loc_eng_data.context, return -1); - if(loc_eng_data.ulp_q) - { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else - { - loc_eng_data.adapter->sendMsg(new LocEngStopFix(&loc_eng_data)); - } + void* target_q = loc_eng_data.ulp_initialized ? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -1680,15 +600,15 @@ 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()) { + if (loc_eng_data.client_handle->isInSession()) { - ret_val = loc_eng_data.adapter->stopFix(); + ret_val = loc_eng_data.client_handle->stopFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) { loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } - loc_eng_data.adapter->setInSession(FALSE); + loc_eng_data.client_handle->setInSession(FALSE); } EXIT_LOG(%d, ret_val); @@ -1738,23 +658,16 @@ 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); + INIT_CHECK(loc_eng_data.context, return -1); loc_eng_msg_position_mode *msg( new loc_eng_msg_position_mode(&loc_eng_data, params)); - if(loc_eng_data.ulp_q) - { - loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, params)); - //Pass the start messgage to ULP if present & activated - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else - { - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngPositionMode(adapter, params)); - } + void* target_q = loc_eng_data.ulp_initialized? + (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: + (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + //Pass the start messgage to ULP if present & activated + msg_q_snd(target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -1779,10 +692,14 @@ 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)); + INIT_CHECK(loc_eng_data.context, return -1); + loc_eng_msg_set_time *msg( + new loc_eng_msg_set_time(&loc_eng_data, + time, + timeReference, + uncertainty)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -1808,10 +725,14 @@ 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; - adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, - accuracy)); + INIT_CHECK(loc_eng_data.context, return -1); + loc_eng_msg_inject_location *msg( + new loc_eng_msg_inject_location(&loc_eng_data, + latitude, + longitude, + accuracy)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -1841,9 +762,13 @@ SIDE EFFECTS 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); + INIT_CHECK(loc_eng_data.context, return); - loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f)); + loc_eng_msg_delete_aiding_data *msg( + new loc_eng_msg_delete_aiding_data(&loc_eng_data, + f)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%s, VOID_RET); } @@ -1869,14 +794,19 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa { ENTRY_LOG(); + static GpsStatusValue last_status = GPS_STATUS_NONE; + + GpsStatus gs = { sizeof(gs),status }; + + if (loc_eng_data.status_cb) { - GpsStatus gs = { sizeof(gs),status }; - CALLBACK_LOG_CALLFLOW("status_cb", %s, - loc_get_gps_status_name(gs.status)); + CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); } + last_status = status; + EXIT_LOG(%s, VOID_RET); } @@ -1891,7 +821,7 @@ static int dataCallCb(void *cb_data) int ret=0; if(cb_data != NULL) { dsCbData *cbData = (dsCbData *)cb_data; - LocEngAdapter *locAdapter = (LocEngAdapter *)cbData->mAdapter; + LocApiAdapter *locAdapter = (LocApiAdapter *)cbData->mAdapter; if(cbData->action == GPS_REQUEST_AGPS_DATA_CONN) { LOC_LOGD("dataCallCb GPS_REQUEST_AGPS_DATA_CONN\n"); ret = locAdapter->openAndStartDataCall(); @@ -1967,7 +897,7 @@ SIDE EFFECTS 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); + INIT_CHECK(loc_eng_data.context, return); STATE_CHECK((NULL == loc_eng_data.agps_status_cb), "agps instance already initialized", return); @@ -1990,11 +920,11 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - if(!loc_eng_data.adapter->initDataServiceClient()) { + if(!loc_eng_data.client_handle->initDataServiceClient()) { LOC_LOGD("%s:%d]: Creating new ds state machine\n", __func__, __LINE__); loc_eng_data.ds_nif = new DSStateMachine(servicerTypeExt, (void *)dataCallCb, - loc_eng_data.adapter); + loc_eng_data.client_handle); LOC_LOGD("%s:%d]: Created new ds state machine\n", __func__, __LINE__); } @@ -2005,37 +935,6 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call 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; - } -} - -static AgpsStateMachine* -getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { - AgpsStateMachine* stateMachine; - switch (agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = locEng.wifi_nif; - break; - } - case AGPS_TYPE_INVALID: - case AGPS_TYPE_SUPL: { - stateMachine = locEng.agnss_nif; - break; - } - case AGPS_TYPE_SUPL_ES: { - stateMachine = locEng.ds_nif; - break; - } - default: - stateMachine = locEng.internet_nif; - } - return stateMachine; -} - /*=========================================================================== FUNCTION loc_eng_agps_open @@ -2057,7 +956,7 @@ 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, + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, return -1); if (apn == NULL) @@ -2069,10 +968,11 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - - loc_eng_data.adapter->sendMsg( - new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType)); + loc_eng_msg_atl_open_success *msg( + new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, + apn_len, bearerType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -2098,11 +998,12 @@ SIDE EFFECTS 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, + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, return -1); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm)); + loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -2128,11 +1029,12 @@ SIDE EFFECTS 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, + INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, return -1); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm)); + loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; @@ -2203,14 +1105,16 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, { 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 = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); if (sizeof(url) > len) { - adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); + loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, + url, len)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } } else if (LOC_AGPS_CDMA_PDE_SERVER == type || LOC_AGPS_CUSTOM_PDE_SERVER == type || @@ -2222,7 +1126,12 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, ret = -2; } else { unsigned int ip = htonl(addr.s_addr); - adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type)); + loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, + ip, + port, + type)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } } else { LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type); @@ -2257,7 +1166,7 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); int ret_val = 0; - if (NULL != loc_eng_data.adapter) + if (NULL != loc_eng_data.context) { ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); } else { @@ -2315,13 +1224,15 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d //us to inform the modem after GPS is enabled agpsStatus = available; - INIT_CHECK(loc_eng_data.adapter, return); + INIT_CHECK(loc_eng_data.context, 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)); + loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, + apn_len, available)); + msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, + msg, loc_eng_free_msg); } EXIT_LOG(%s, VOID_RET); } @@ -2364,7 +1275,7 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Session End is not reported during Android navigating state - boolean navigating = loc_eng_data.adapter->isInSession(); + boolean navigating = loc_eng_data.client_handle->isInSession(); if (status != GPS_STATUS_NONE && !(status == GPS_STATUS_SESSION_END && navigating) && !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) @@ -2435,10 +1346,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.adapter->isInSession()) { + if (loc_eng_data.client_handle->isInSession()) { // This sets the copy in adapter to modem - loc_eng_data.adapter->setPositionMode(NULL); - loc_eng_data.adapter->setInSession(false); + loc_eng_data.client_handle->setPositionMode(NULL); + loc_eng_data.client_handle->setInSession(false); loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); @@ -2467,6 +1378,610 @@ static int set_sched_policy(int tid, SchedPolicy policy) } #endif /* USE_GLIB */ +/*=========================================================================== +FUNCTION loc_eng_deferred_action_thread + +DESCRIPTION + Main routine for the thread to execute loc_eng commands. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_deferred_action_thread(void* arg) +{ + ENTRY_LOG(); + loc_eng_msg *msg; + static int cnt = 0; + LocEngContext* context = (LocEngContext*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); + + while (1) + { + LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); + + // we are only sending / receiving msg pointers + msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; + } + + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; + + LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", + __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); + + // need to ensure the instance data is valid + STATE_CHECK(NULL != loc_eng_data_p->context, + "instance cleanup happened", + delete msg; return); + + switch(msg->msgid) { + case LOC_ENG_MSG_QUIT: + { + LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; + pthread_mutex_lock(&(context->lock)); + pthread_cond_signal(&(context->cond)); + pthread_mutex_unlock(&(context->lock)); + EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); + } + return; + + case LOC_ENG_MSG_REQUEST_NI: + { + loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; + loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_INFORM_NI_RESPONSE: + { + loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; + loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, + nrMsg->passThroughData); + } + break; + + case LOC_ENG_MSG_START_FIX: + loc_eng_start_handler(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_STOP_FIX: + if (loc_eng_data_p->agps_request_pending) + { + loc_eng_data_p->stop_request_pending = true; + LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); + } else { + loc_eng_stop_handler(*loc_eng_data_p); + } + break; + + case LOC_ENG_MSG_SET_POSITION_MODE: + { + loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; + loc_eng_data_p->client_handle->setPositionMode(&(pmMsg->pMode)); + } + break; + + case LOC_ENG_MSG_SET_TIME: + { + loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; + loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, + tMsg->uncertainty); + } + break; + + case LOC_ENG_MSG_INJECT_LOCATION: + { + loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; + loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, + ilMsg->accuracy); + } + break; + + case LOC_ENG_MSG_SET_SERVER_IPV4: + { + loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; + loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, + ssiMsg->port, + ssiMsg->serverType); + } + break; + + case LOC_ENG_MSG_SET_SERVER_URL: + { + loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; + loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); + } + break; + + case LOC_ENG_MSG_A_GLONASS_PROTOCOL: + { + loc_eng_msg_a_glonass_protocol *svMsg = (loc_eng_msg_a_glonass_protocol*)msg; + loc_eng_data_p->client_handle->setAGLONASSProtocol(svMsg->a_glonass_protocol); + } + break; + + case LOC_ENG_MSG_SUPL_VERSION: + { + loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; + loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); + } + break; + + case LOC_ENG_MSG_LPP_CONFIG: + { + loc_eng_msg_lpp_config *svMsg = (loc_eng_msg_lpp_config*)msg; + loc_eng_data_p->client_handle->setLPPConfig(svMsg->lpp_config); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: + { + loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; + loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: + { + loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; + loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk_valid, + spMsg->gyroBiasVarianceRandomWalk, + spMsg->accelRandomWalk_valid, + spMsg->accelRandomWalk, + spMsg->angleRandomWalk_valid, + spMsg->angleRandomWalk, + spMsg->rateRandomWalk_valid, + spMsg->rateRandomWalk, + spMsg->velocityRandomWalk_valid, + spMsg->velocityRandomWalk); + } + break; + + case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: + { + loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; + loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, + spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, + spccMsg->accelSamplesPerBatchHigh, spccMsg->accelBatchesPerSecHigh, + spccMsg->gyroSamplesPerBatchHigh, spccMsg->gyroBatchesPerSecHigh, + spccMsg->algorithmConfig); + } + break; + + case LOC_ENG_MSG_EXT_POWER_CONFIG: + { + loc_eng_msg_ext_power_config *pwrMsg = (loc_eng_msg_ext_power_config*)msg; + loc_eng_data_p->client_handle->setExtPowerConfig(pwrMsg->isBatteryCharging); + } + break; + + case LOC_ENG_MSG_REPORT_POSITION: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + bool reported = false; + loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; + if (loc_eng_data_p->location_cb != NULL) { + if (LOC_SESS_FAILURE == rpMsg->status) { + // in case we want to handle the failure case + loc_eng_data_p->location_cb(NULL, NULL); + reported = true; + } + // what's in the else if is... (line by line) + // 1. this is a good fix; or + // 1.1 it is a Satellite fix; or + // 1.1.1 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 == rpMsg->status && + (((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || + (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || + (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && + !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && + (gps_conf.ACCURACY_THRES != 0) && + (rpMsg->location.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { + loc_eng_data_p->location_cb((UlpLocation*)&(rpMsg->location), + (void*)rpMsg->locationExt); + reported = true; + } + } + + // if we have reported this fix + if (reported && + // and if this is a singleshot + GPS_POSITION_RECURRENCE_SINGLE == + loc_eng_data_p->client_handle->getPositionMode().recurrence) { + if (LOC_SESS_INTERMEDIATE == rpMsg->status) { + // modem could be still working for a final fix, + // although we no longer need it. So stopFix(). + loc_eng_data_p->client_handle->stopFix(); + } + // turn off the session flag. + loc_eng_data_p->client_handle->setInSession(false); + } + + if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) + { + unsigned char generate_nmea = reported && (rpMsg->status != LOC_SESS_FAILURE); + loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, + rpMsg->locationExtended, + generate_nmea); + } + + // Free the allocated memory for rawData + UlpLocation* gp = (UlpLocation*)&(rpMsg->location); + if (gp != NULL && gp->rawData != NULL) + { + delete (char*)gp->rawData; + gp->rawData = NULL; + gp->rawDataSize = 0; + } + } + + break; + + case LOC_ENG_MSG_REPORT_SV: + if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; + if (loc_eng_data_p->sv_status_cb != NULL) { + loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), + (void*)rsMsg->svExt); + } + + if (loc_eng_data_p->generateNmea) + { + loc_eng_nmea_generate_sv(loc_eng_data_p, rsMsg->svStatus, rsMsg->locationExtended); + } + + } + break; + + case LOC_ENG_MSG_REPORT_STATUS: + loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); + break; + + case LOC_ENG_MSG_REPORT_NMEA: + if (NULL != loc_eng_data_p->nmea_cb) { + loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); + loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); + } + break; + + case LOC_ENG_MSG_REPORT_XTRA_SERVER: + if (NULL != loc_eng_data_p->xtra_module_data.report_xtra_server_cb) { + loc_eng_msg_report_xtra_server* xsMsg = (loc_eng_msg_report_xtra_server*)msg; + CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, xsMsg->server1); + loc_eng_data_p->xtra_module_data.report_xtra_server_cb(xsMsg->server1, xsMsg->server2, xsMsg->server3); + } + break; + + case LOC_ENG_MSG_REQUEST_BIT: + { + AgpsStateMachine* stateMachine; + loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; + if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; + } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); + break; + } + BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_BIT: + { + AgpsStateMachine* stateMachine; + loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; + if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { + stateMachine = loc_eng_data_p->agnss_nif; + } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { + stateMachine = loc_eng_data_p->internet_nif; + } else { + LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); + break; + } + BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); + + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_REQUEST_ATL: + { + loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; + boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; + AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || + backwardCompatibleMode) ? + loc_eng_data_p->agnss_nif : + loc_eng_data_p->internet_nif; + ATLSubscriber subscriber(arqMsg->handle, + stateMachine, + loc_eng_data_p->client_handle, + backwardCompatibleMode); + + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_RELEASE_ATL: + { + loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; + ATLSubscriber s1(arlMsg->handle, + loc_eng_data_p->agnss_nif, + loc_eng_data_p->client_handle, + false); + // attempt to unsubscribe from agnss_nif first + if (loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", __func__, __LINE__); + } + else { + ATLSubscriber s2(arlMsg->handle, + loc_eng_data_p->internet_nif, + loc_eng_data_p->client_handle, + false); + // if unsuccessful, try internet_nif + if(loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { + LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", __func__, __LINE__); + } + else { + DSSubscriber s3(loc_eng_data_p->ds_nif, + arlMsg->handle); + LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", + __func__, __LINE__, arlMsg->handle); + if(loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Could not release ATL. No subscribers found\n", + __func__, __LINE__); + loc_eng_data_p->client_handle->atlCloseStatus(arlMsg->handle, 0); + } + } + } + } + break; + + case LOC_ENG_MSG_REQUEST_WIFI: + { + loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; + if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM || + wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); + stateMachine->subscribeRsrc((Subscriber*)&subscriber); + } else { + LOC_LOGE("%s]%d ERROR: unknown sender ID", __func__, __LINE__); + break; + } + } + break; + + case LOC_ENG_MSG_RELEASE_WIFI: + { + AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; + loc_eng_msg_release_wifi* wrlMsg = (loc_eng_msg_release_wifi*)msg; + WIFISubscriber subscriber(stateMachine, wrlMsg->ssid, wrlMsg->password, wrlMsg->senderId); + stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); + } + break; + + case LOC_ENG_MSG_REQUEST_XTRA_DATA: + if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) + { + loc_eng_data_p->xtra_module_data.download_request_cb(); + } + break; + + case LOC_ENG_MSG_REQUEST_TIME: + if (loc_eng_data_p->request_utc_time_cb != NULL) + { + loc_eng_data_p->request_utc_time_cb(); + } + else + { + LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__); + } + break; + + case LOC_ENG_MSG_REQUEST_POSITION: + break; + + case LOC_ENG_MSG_DELETE_AIDING_DATA: + loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; + break; + + case LOC_ENG_MSG_ENABLE_DATA: + { + loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; + loc_eng_data_p->client_handle->enableData(unaMsg->enable); + if(unaMsg->apn != NULL) + loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); + } + break; + + case LOC_ENG_MSG_INJECT_XTRA_DATA: + { + loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; + loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); + } + break; + + case LOC_ENG_MSG_REQUEST_XTRA_SERVER: + { + loc_eng_data_p->client_handle->requestXtraServer(); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_SUCCESS: + { + loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; + AgpsStateMachine* stateMachine; + LOC_LOGD("%s:%d]: AGPS_TYPE: %d\n", __func__, __LINE__, (int)aosMsg->agpsType); + switch (aosMsg->agpsType) { + case AGPS_TYPE_WIFI: { + LOC_LOGD("%s:%d]: AGPS Type wifi\n", __func__, __LINE__); + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + LOC_LOGD("%s:%d]: AGPS Type supl\n", __func__, __LINE__); + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + case AGPS_TYPE_INVALID: { + stateMachine = loc_eng_data_p->ds_nif; + LOC_LOGD("%s:%d]: AGPS Type invalid\n", __func__, __LINE__); + } + break; + default: { + LOC_LOGD("%s:%d]: AGPS Type default internet\n", __func__, __LINE__); + stateMachine = loc_eng_data_p->internet_nif; + } + } + + stateMachine->setBearer(aosMsg->bearerType); + stateMachine->setAPN(aosMsg->apn, aosMsg->length); + stateMachine->onRsrcEvent(RSRC_GRANTED); + } + break; + + case LOC_ENG_MSG_ATL_CLOSED: + { + loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; + AgpsStateMachine* stateMachine; + + switch (acsMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + case AGPS_TYPE_INVALID: { + stateMachine = loc_eng_data_p->ds_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } + stateMachine->onRsrcEvent(RSRC_RELEASED); + } + break; + + case LOC_ENG_MSG_ATL_OPEN_FAILED: + { + loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; + AgpsStateMachine* stateMachine; + + switch (aofMsg->agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = loc_eng_data_p->wifi_nif; + break; + } + case AGPS_TYPE_SUPL: { + stateMachine = loc_eng_data_p->agnss_nif; + break; + } + default: { + stateMachine = loc_eng_data_p->internet_nif; + } + } + stateMachine->onRsrcEvent(RSRC_DENIED); + } + break; + + case LOC_ENG_MSG_ENGINE_DOWN: + loc_eng_handle_engine_down(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_ENGINE_UP: + loc_eng_handle_engine_up(*loc_eng_data_p); + break; + + case LOC_ENG_MSG_LOC_INIT: + { + loc_eng_reinit(*loc_eng_data_p); + } + break; + + case LOC_ENG_MSG_REQUEST_SUPL_ES: + { + loc_eng_msg_request_supl_es *reqMsg = + (loc_eng_msg_request_supl_es *)msg; + AgpsStateMachine *stateMachine = loc_eng_data_p->ds_nif; + DSSubscriber subscriber(stateMachine, reqMsg->handle); + LOC_LOGD("%s:%d]: Starting data call\n", __func__, __LINE__); + stateMachine->subscribeRsrc((Subscriber *)&subscriber); + } + break; + + case LOC_ENG_MSG_CLOSE_DATA_CALL: + { + loc_eng_data_p->client_handle->closeDataCall(); + LOC_LOGD("%s:%d]: Request to close data call\n", + __func__, __LINE__); + } + break; + + default: + LOC_LOGE("unsupported msgid = %d\n", msg->msgid); + break; + } + + if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | + (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | + (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) + { + loc_eng_data_p->agps_request_pending = false; + if (loc_eng_data_p->stop_request_pending) { + loc_eng_stop_handler(*loc_eng_data_p); + loc_eng_data_p->stop_request_pending = false; + } + } + loc_eng_data_p->stop_request_pending = false; + + if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && + loc_eng_data_p->aiding_data_for_deletion != 0) + { + loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); + loc_eng_data_p->aiding_data_for_deletion = 0; + } + + delete msg; + } + + EXIT_LOG(%s, VOID_RET); +} + /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -2493,7 +2008,7 @@ int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc { // Initialize the ULP interface ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); - loc_eng_data.ulp_q = (void*)msg_q_init2(); + loc_eng_data.ulp_initialized = TRUE; ret_val = 0; } else diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index fdda66a2..f9566196 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -55,8 +55,9 @@ typedef unsigned char boolean; #include #include #include +#include #include -#include +#include // The data connection minimal open time #define DATA_OPEN_MIN_TIME 1 /* sec */ @@ -78,10 +79,25 @@ enum loc_mute_session_e_type { LOC_MUTE_SESS_IN_SESSION }; +struct LocEngContext { + // Data variables used by deferred action thread + const void* deferred_q; + const void* ulp_q; + const pthread_t deferred_action_thread; + static LocEngContext* get(gps_create_thread threadCreator); + void drop(); + static pthread_mutex_t lock; + static pthread_cond_t cond; +private: + int counter; + static LocEngContext *me; + LocEngContext(gps_create_thread threadCreator); +}; + // Module data typedef struct loc_eng_data_s { - LocEngAdapter *adapter; + LocApiAdapter *client_handle; loc_location_cb_ext location_cb; gps_status_callback status_cb; loc_sv_status_cb_ext sv_status_cb; @@ -93,6 +109,9 @@ typedef struct loc_eng_data_s gps_request_utc_time request_utc_time_cb; boolean intermediateFix; AGpsStatusValue agps_status; + // used to defer stopping the GPS engine until AGPS data calls are done + boolean agps_request_pending; + boolean stop_request_pending; loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; @@ -110,6 +129,8 @@ typedef struct loc_eng_data_s // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off GpsAidingData aiding_data_for_deletion; + void* context; + // For muting session broadcast loc_mute_session_e_type mute_session_state; @@ -130,10 +151,7 @@ typedef struct loc_eng_data_s int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; - void *ulp_q; - - loc_ext_parser location_ext_parser; - loc_ext_parser sv_ext_parser; + bool ulp_initialized; } loc_eng_data_s_type; #include "ulp.h" @@ -238,7 +256,6 @@ extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, const void* passThrough); extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); int loc_eng_read_config(void); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index d6cc1369..b7821c9e 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -33,10 +33,10 @@ #include #include #include -#include +#include "platform_lib_includes.h" #include #include -#include +#include //====================================================================== // C callbacks @@ -109,7 +109,7 @@ bool BITSubscriber::equals(const Subscriber *s) const return (ID == bitS->ID && (INADDR_NONE != (unsigned int)ID || - 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr)))); + 0 == strncmp(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); } bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) @@ -152,13 +152,13 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { case RSRC_UNSUBSCRIBE: case RSRC_RELEASED: - ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_DENIED: { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -168,7 +168,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -627,7 +627,6 @@ AgpsStateMachine::AgpsStateMachine(servicerType servType, mStatePtr(new AgpsReleasedState(this)),mType(type), mAPN(NULL), mAPNLen(0), - mBearer(AGPS_APN_BEARER_INVALID), mEnforceSingleSubscriber(enforceSingleSubscriber), mServicer(Servicer :: getServicer(servType, (void *)cb_func)) { @@ -827,7 +826,7 @@ err: } DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, - LocEngAdapter* adapterHandle): + LocApiAdapter* adapterHandle): AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), mLocAdapter(adapterHandle) { @@ -948,17 +947,17 @@ 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); + ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_RELEASED: - mLocAdapter->closeDataCall(); + ((LocApiAdapter*)mLocAdapter)->releaseDataHandle(); break; case RSRC_DENIED: ((DSStateMachine *)this)->mRetries = 0; mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); break; case RSRC_GRANTED: - mLocAdapter->atlOpenStatus(ID, 1, + ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, NULL, AGPS_APN_BEARER_INVALID, AGPS_TYPE_INVALID); diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 055d955b..93980f3c 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -35,11 +35,10 @@ #include #include #include -#include -#include #include +#include +#include "loc_eng_msg.h" #include -#include // forward declaration class AgpsStateMachine; @@ -63,7 +62,7 @@ typedef enum { //DS Callback struct typedef struct { - LocEngAdapter *mAdapter; + LocApiAdapter *mAdapter; AGpsStatusValue action; }dsCbData; @@ -250,12 +249,12 @@ public: class DSStateMachine : public AgpsStateMachine { static const unsigned char MAX_START_DATA_CALL_RETRIES; static const unsigned int DATA_CALL_RETRY_DELAY_MSEC; - LocEngAdapter* mLocAdapter; + LocApiAdapter* mLocAdapter; unsigned char mRetries; public: DSStateMachine(servicerType type, - void *cb_func, - LocEngAdapter* adapterHandle); + void *cb_func, + LocApiAdapter* adapterHandle); int sendRsrcRequest(AGpsStatusValue action) const; void onRsrcEvent(AgpsRsrcStatus event); void retryCallback(); @@ -298,40 +297,40 @@ struct Subscriber { // 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; + ipv6Addr[0] = NULL; } else { - memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr)); + memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); } } virtual bool notifyRsrcStatus(Notification ¬ification); inline virtual void setIPAddresses(uint32_t &v4, char* v6) - { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } + { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } virtual Subscriber* clone() { - return new BITSubscriber(mStateMachine, ID, mIPv6Addr); + return new BITSubscriber(mStateMachine, ID, ipv6Addr); } virtual bool equals(const Subscriber *s) const; inline virtual ~BITSubscriber(){} +private: + char ipv6Addr[16]; }; // ATLSubscriber, created with requests from ATL struct ATLSubscriber : public Subscriber { - const LocEngAdapter* mLocAdapter; + const LocApiAdapter* mLocAdapter; const bool mBackwardCompatibleMode; inline ATLSubscriber(const int id, const AgpsStateMachine* stateMachine, - const LocEngAdapter* adapter, + const LocApiAdapter* adapter, const bool compatibleMode) : Subscriber(id, stateMachine), mLocAdapter(adapter), mBackwardCompatibleMode(compatibleMode){} diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index edd53f21..8176ab43 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -49,24 +49,24 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, } if (NULL != loc_api_handle) { - AGpsExtType type; + loc_if_req_type_e_type type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; + type = LOC_ENG_IF_REQUEST_TYPE_ANY; break; } default: @@ -79,52 +79,48 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, 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(); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_request_wifi *msg( + new loc_eng_msg_request_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_request_bit *msg( + new loc_eng_msg_request_bit(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); break; } default: @@ -145,24 +141,24 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, { LOC_LOGD("%s:%d]\n", __func__, __LINE__); #ifndef DEBUG_DMN_LOC_API - AGpsExtType type; + loc_if_req_type_e_type type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; + type = LOC_ENG_IF_REQUEST_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; + type = LOC_ENG_IF_REQUEST_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; + type = LOC_ENG_IF_REQUEST_TYPE_ANY; break; } default: @@ -175,52 +171,48 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, 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(); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_release_wifi *msg( + new loc_eng_msg_release_wifi(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)); + loc_eng_msg_sender(loc_api_handle, msg); 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(); + loc_eng_msg_release_bit *msg( + new loc_eng_msg_release_bit(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); + loc_eng_msg_sender(loc_api_handle, msg); break; } default: diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 8c494337..877566ed 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -30,10 +30,31 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_eng" +#include "hardware/gps.h" #include "loc_log.h" #include "loc_eng_log.h" #include "loc_eng_msg_id.h" +/* GPS status names */ +static 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 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 loc_name_val_s_type loc_eng_msgs[] = { NAME_VAL( LOC_ENG_MSG_QUIT ), @@ -90,3 +111,183 @@ const char* loc_get_msg_name(int id) +static 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +}; +static 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 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 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 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 ) +}; +static 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 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 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 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 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 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index ec1b7353..95a672fd 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -36,8 +36,22 @@ extern "C" #endif #include +#include +#include +const char* loc_get_gps_status_name(GpsStatusValue gps_status); const char* loc_get_msg_name(int id); +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 } diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp new file mode 100644 index 00000000..a296dce3 --- /dev/null +++ b/loc_api/libloc_api_50001/loc_eng_msg.cpp @@ -0,0 +1,133 @@ +/* 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_eng_msg.h" +#include "loc_eng_dmn_conn_glue_msg.h" + +#ifdef _ANDROID_ + +#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" + +#else + +#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" + +#endif + +int loc_eng_msgget(int * p_req_msgq) +{ + * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); + return 0; +} + +int loc_eng_msgremove(int req_msgq) +{ + loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); + return 0; +} + +int loc_eng_msgsnd(int msgqid, void * msgp) +{ + int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) +{ + int result; + + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + 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; +} + +int loc_eng_msgrcv(int msgqid, void ** msgp) +{ + int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); + return ret; +} + +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) +{ + int result; + struct msgbuf * pmsg = (struct msgbuf *) msgp; + + if (msgsz < sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); + return -1; + } + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); + if (result != sizeof(struct msgbuf)) { + LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); + return -1; + } + + if (msgsz < pmsg->msgsz) { + LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); + return -1; + } + + if (pmsg->msgsz > sizeof(struct msgbuf)) { + /* there is msg body */ + msgp += sizeof(struct msgbuf); + + result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); + + if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { + LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, + (pmsg->msgid), (int) pmsg->msgsz); + return -1; + } + } + + return pmsg->msgsz; +} + +int loc_eng_msgflush(int msgqid) +{ + return loc_eng_dmn_conn_glue_msgflush(msgqid); +} + +int loc_eng_msgunblock(int msgqid) +{ + return loc_eng_dmn_conn_glue_pipeunblock(msgqid); +} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 39b0de52..709f65c9 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -31,15 +31,13 @@ #include -#include +#include #include #include -#include +#include "log_util.h" +#include "loc.h" #include -#include -#include -#include -#include +#include "loc_eng_msg_id.h" #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) @@ -55,7 +53,113 @@ extern "C" { #endif /* __cplusplus */ -using namespace loc_core; +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + 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); + } + } + + LocPosMode() : + mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), + min_interval(MIN_POSSIBLE_FIX_INTERVAL), preferred_accuracy(50), preferred_time(120000) { + 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); + } + + inline void 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); + } +}; + +/** 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 + +/** 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; +} GpsLocationExtended; + +typedef enum { + LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, + LOC_ENG_IF_REQUEST_TYPE_WIFI, + LOC_ENG_IF_REQUEST_TYPE_ANY +} loc_if_req_type_e_type; + +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; struct loc_eng_msg { const void* owner; @@ -72,6 +176,153 @@ struct loc_eng_msg { } }; +struct loc_eng_msg_a_glonass_protocol : public loc_eng_msg { + const unsigned long a_glonass_protocol; + inline loc_eng_msg_a_glonass_protocol(void* instance, unsigned long protocol) : + loc_eng_msg(instance, LOC_ENG_MSG_A_GLONASS_PROTOCOL), + a_glonass_protocol(protocol) + { + LOC_LOGV("A-GLONASS protocol: 0x%lx", protocol); + } +}; + +struct loc_eng_msg_suple_version : public loc_eng_msg { + const int supl_version; + inline loc_eng_msg_suple_version(void* instance, int version) : + loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), + supl_version(version) + { + LOC_LOGV("SUPL Version: %d", version); + } +}; + +struct loc_eng_msg_lpp_config : public loc_eng_msg { + const int lpp_config; + inline loc_eng_msg_lpp_config(void *instance, int profile) : + loc_eng_msg(instance, LOC_ENG_MSG_LPP_CONFIG), + lpp_config(profile) + { + LOC_LOGV("lpp profile: %d", profile); + } +}; + +struct loc_eng_msg_ext_power_config : public loc_eng_msg { + const int isBatteryCharging; + inline loc_eng_msg_ext_power_config(void* instance, int isBattCharging) : + loc_eng_msg(instance, LOC_ENG_MSG_EXT_POWER_CONFIG), + isBatteryCharging(isBattCharging) + { + LOC_LOGV("isBatteryCharging: %d", isBatteryCharging); + } +}; + +struct loc_eng_msg_sensor_control_config : public loc_eng_msg { + const int sensorsDisabled; + inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), + sensorsDisabled(disabled) + { + LOC_LOGV("Sensors Disabled: %d", disabled); + } +}; + +struct loc_eng_msg_sensor_properties : public loc_eng_msg { + const bool gyroBiasVarianceRandomWalk_valid; + const float gyroBiasVarianceRandomWalk; + const bool accelRandomWalk_valid; + const float accelRandomWalk; + const bool angleRandomWalk_valid; + const float angleRandomWalk; + const bool rateRandomWalk_valid; + const float rateRandomWalk; + const bool velocityRandomWalk_valid; + const float velocityRandomWalk; + inline loc_eng_msg_sensor_properties(void* instance, 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) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), + gyroBiasVarianceRandomWalk_valid(gyroBiasRandomWalk_valid), + gyroBiasVarianceRandomWalk(gyroBiasRandomWalk), + accelRandomWalk_valid(accelRandomWalk_valid), + accelRandomWalk(accelRandomWalk), + angleRandomWalk_valid(angleRandomWalk_valid), + angleRandomWalk(angleRandomWalk), + rateRandomWalk_valid(rateRandomWalk_valid), + rateRandomWalk(rateRandomWalk), + velocityRandomWalk_valid(velocityRandomWalk_valid), + velocityRandomWalk(velocityRandomWalk) + { + 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", + gyroBiasRandomWalk_valid, + accelRandomWalk_valid, + angleRandomWalk_valid, + rateRandomWalk_valid, + velocityRandomWalk_valid + ); + LOC_LOGV("Sensor properties, Gyro Random walk: %f Accel Random Walk: %f " + "Angle Random Walk: %f Rate Random Walk: %f " + "Velocity Random Walk: %f", + gyroBiasRandomWalk, + accelRandomWalk, + angleRandomWalk, + rateRandomWalk, + velocityRandomWalk + ); + } +}; + +struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { + const int controlMode; + const int accelSamplesPerBatch; + const int accelBatchesPerSec; + const int gyroSamplesPerBatch; + const int gyroBatchesPerSec; + const int accelSamplesPerBatchHigh; + const int accelBatchesPerSecHigh; + const int gyroSamplesPerBatchHigh; + const int gyroBatchesPerSecHigh; + const int algorithmConfig; + inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, + int algorithmConfig) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), + controlMode(controlMode), + accelSamplesPerBatch(accelSamplesPerBatch), + accelBatchesPerSec(accelBatchesPerSec), + gyroSamplesPerBatch(gyroSamplesPerBatch), + gyroBatchesPerSec(gyroBatchesPerSec), + accelSamplesPerBatchHigh(accelSamplesPerBatchHigh), + accelBatchesPerSecHigh(accelBatchesPerSecHigh), + gyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), + gyroBatchesPerSecHigh(gyroBatchesPerSecHigh), + algorithmConfig(algorithmConfig) + { + 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", + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, + algorithmConfig + ); + } +}; + + struct loc_eng_msg_position_mode : public loc_eng_msg { const LocPosMode pMode; inline loc_eng_msg_position_mode(void* instance, @@ -83,6 +334,45 @@ struct loc_eng_msg_position_mode : public loc_eng_msg { } }; +struct loc_eng_msg_set_time : public loc_eng_msg { + const GpsUtcTime time; + const int64_t timeReference; + const int uncertainty; + inline loc_eng_msg_set_time(void* instance, + GpsUtcTime t, + int64_t tf, + int unc) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), + time(t), timeReference(tf), uncertainty(unc) + { + LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", + time, timeReference, uncertainty); + } +}; + +struct loc_eng_msg_inject_location : public loc_eng_msg { + const double latitude; + const double longitude; + const float accuracy; + inline loc_eng_msg_inject_location(void* instance, double lat, + double longi, float accur) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), + latitude(lat), longitude(longi), accuracy(accur) + { + LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", + latitude, longitude, accuracy); + } +}; + +struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { + const GpsAidingData type; + inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : + loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) + { + LOC_LOGV("aiding data msak %d", type); + } +}; + struct loc_eng_msg_report_position : public loc_eng_msg { const UlpLocation location; const GpsLocationExtended locationExtended; @@ -137,233 +427,439 @@ struct loc_eng_msg_report_sv : public loc_eng_msg { } }; - -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 { - loc_eng_data_s_type* mLocEng; - LocEngStartFix(loc_eng_data_s_type* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngStopFix : public LocMsg { - loc_eng_data_s_type* mLocEng; - LocEngStopFix(loc_eng_data_s_type* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportPosition : public LocMsg { - void* mLocEng; - const UlpLocation mLocation; - const GpsLocationExtended mLocationExtended; - const void* mLocationExt; - const enum loc_sess_status mStatus; - const LocPosTechMask mTechMask; - LocEngReportPosition(void* locEng, - 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 { - void* mLocEng; - const GpsSvStatus mSvStatus; - const GpsLocationExtended mLocationExtended; - const void* mSvExt; - LocEngReportSv(void* locEng, - GpsSvStatus &sv, - GpsLocationExtended &locExtended, - void* svExtended); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportStatus : public LocMsg { - void* mLocEng; - const GpsStatusValue mStatus; - LocEngReportStatus(void* locEng, - 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() +struct loc_eng_msg_report_status : public loc_eng_msg { + const GpsStatusValue status; + inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) { - delete[] mNmea; + LOC_LOGV("status: %s", loc_get_gps_status_name(status)); } - 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() +struct loc_eng_msg_report_nmea : public loc_eng_msg { + char* const nmea; + const int length; + inline loc_eng_msg_report_nmea(void* instance, + const char* data, + int len) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), + nmea(new char[len]), length(len) { - delete[] mServers; + memcpy((void*)nmea, (void*)data, len); + LOC_LOGV("length: %d\n nmea: %p - %c%c%c", + length, nmea, nmea[3], nmea[4], nmea[5]); + } + inline ~loc_eng_msg_report_nmea() + { + delete[] nmea; } - 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 loc_eng_msg_report_xtra_server : public loc_eng_msg { + char *server1; + char *server2; + char *server3; + inline loc_eng_msg_report_xtra_server(void *instance, + const char *url1, + const char *url2, + const char *url3, + const int maxlength) : + loc_eng_msg(instance, LOC_ENG_MSG_REPORT_XTRA_SERVER), + server1(new char[maxlength+1]), server2(new char[maxlength+1]), server3(new char[maxlength+1]) + { + strlcpy(server1, url1, maxlength); + strlcpy(server2, url2, maxlength); + strlcpy(server3, url3, maxlength); + + LOC_LOGV("maxlength: %d\n server1: %s\n server2: %s\n server3: %s\n", + maxlength, server1, server2, server3); + } + inline ~loc_eng_msg_report_xtra_server() + { + delete[] server1; + delete[] server2; + delete[] server3; + } }; -struct LocEngSuplEsClosed : public LocMsg { - void* mLocEng; - LocEngSuplEsClosed(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; +struct loc_eng_msg_request_bit : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_request_bit(void* instance, + loc_if_req_type_e_type type, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), + ifType(type), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_request_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } }; -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 loc_eng_msg_request_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_request_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != ssid) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != password) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_request_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } }; -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 loc_eng_msg_release_bit : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const int ipv4Addr; + char* const ipv6Addr; + inline loc_eng_msg_release_bit(void* instance, + loc_if_req_type_e_type type, + int ipv4, + char* ipv6) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), + ifType(type), ipv4Addr(ipv4), + ipv6Addr(NULL == ipv6 ? NULL : new char[16]) + { + if (NULL != ipv6Addr) + memcpy(ipv6Addr, ipv6, 16); + LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, + (unsigned char)(ipv4>>24), + (unsigned char)(ipv4>>16), + (unsigned char)(ipv4>>8), + (unsigned char)ipv4, + NULL != ipv6Addr ? ipv6Addr : ""); + } + + inline ~loc_eng_msg_release_bit() + { + if (NULL != ipv6Addr) { + delete[] ipv6Addr; + } + } }; -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 loc_eng_msg_release_wifi : public loc_eng_msg { + const loc_if_req_type_e_type ifType; + const loc_if_req_sender_id_e_type senderId; + char* const ssid; + char* const password; + inline loc_eng_msg_release_wifi(void* instance, + loc_if_req_type_e_type type, + loc_if_req_sender_id_e_type sender_id, + char* s, + char* p) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_WIFI), + ifType(type), senderId(sender_id), + ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) + { + if (NULL != s) + strlcpy(ssid, s, SSID_BUF_SIZE); + if (NULL != p) + strlcpy(password, p, SSID_BUF_SIZE); + LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", + ifType, + senderId, + NULL != ssid ? ssid : "", + NULL != password ? password : ""); + } + + inline ~loc_eng_msg_release_wifi() + { + if (NULL != ssid) { + delete[] ssid; + } + if (NULL != password) { + delete[] password; + } + } }; -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 loc_eng_msg_request_atl : public loc_eng_msg { + const int handle; + const AGpsType type; + inline loc_eng_msg_request_atl(void* instance, int hndl, + AGpsType agps_type) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), + handle(hndl), type(agps_type) + { + LOC_LOGV("handle: %d\n agps type: %s", + handle, + loc_get_agps_type_name(type)); + } }; -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 loc_eng_msg_request_supl_es : public loc_eng_msg { + const int handle; + inline loc_eng_msg_request_supl_es(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_SUPL_ES), + handle(hndl) + { + LOC_LOGV("handle: %d\n", handle); + } }; -struct LocEngRequestXtra : public LocMsg { - void* mLocEng; - LocEngRequestXtra(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; +struct loc_eng_msg_close_data_call: public loc_eng_msg { + inline loc_eng_msg_close_data_call(void *instance) : + loc_eng_msg(instance, LOC_ENG_MSG_CLOSE_DATA_CALL) + { + LOC_LOGV("%s:%d]Close data call: ", __func__, __LINE__); + } +}; +struct loc_eng_msg_release_atl : public loc_eng_msg { + const int handle; + inline loc_eng_msg_release_atl(void* instance, int hndl) : + loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) + { + LOC_LOGV("handle: %d", handle); + } }; -struct LocEngRequestTime : public LocMsg { - void* mLocEng; - LocEngRequestTime(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; +struct loc_eng_msg_request_ni : public loc_eng_msg { + const GpsNiNotification notify; + const void *passThroughData; + inline loc_eng_msg_request_ni(void* instance, + GpsNiNotification ¬if, const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), + notify(notif), passThroughData(data) + { + 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", + notify.notification_id, + loc_get_ni_type_name(notify.ni_type), + notify.notify_flags, + notify.timeout, + loc_get_ni_response_name(notify.default_response), + loc_get_ni_encoding_name(notify.requestor_id_encoding), + loc_get_ni_encoding_name(notify.text_encoding), + passThroughData); + } }; -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 loc_eng_msg_inform_ni_response : public loc_eng_msg { + const GpsUserResponseType response; + const void *passThroughData; + inline loc_eng_msg_inform_ni_response(void* instance, + GpsUserResponseType resp, + const void* data) : + loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), + response(resp), passThroughData(data) + { + LOC_LOGV("response: %s\n passThroughData: %p", + loc_get_ni_response_name(response), + passThroughData); + } + inline ~loc_eng_msg_inform_ni_response() + { + // this is a bit weird since passThroughData is not + // allocated by this class. But there is no better way. + // passThroughData actually won't be NULL here. + // But better safer than sorry. + if (NULL != passThroughData) { + free((void*)passThroughData); + } + } }; -struct LocEngDown : public LocMsg { - void* mLocEng; - LocEngDown(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; +struct loc_eng_msg_set_apn : public loc_eng_msg { + char* const apn; + inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), + apn(new char[len+1]) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s", apn); + } + inline ~loc_eng_msg_set_apn() + { + delete[] apn; + } }; -struct LocEngUp : public LocMsg { - void* mLocEng; - LocEngUp(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; + + +struct loc_eng_msg_set_server_ipv4 : public loc_eng_msg { + const unsigned int nl_addr; + const int port; + const LocServerType serverType; + inline loc_eng_msg_set_server_ipv4(void* instance, + unsigned int ip, + int p, + LocServerType type) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), + nl_addr(ip), port(p), serverType(type) + { + LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); + } }; +struct loc_eng_msg_set_server_url : public loc_eng_msg { + const int len; + char* const url; + inline loc_eng_msg_set_server_url(void* instance, + const char* urlString, + int url_len) : + loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), + len(url_len), url(new char[len+1]) + { + memcpy((void*)url, (void*)urlString, url_len); + url[len] = 0; + LOC_LOGV("url: %s", url); + } + inline ~loc_eng_msg_set_server_url() + { + delete[] url; + } +}; + +struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { + char* const data; + const int length; + inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : + loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), + data(new char[l]), length(l) + { + memcpy((void*)data, (void*)d, l); + LOC_LOGV("length: %d\n data: %p", length, data); + } + inline ~loc_eng_msg_inject_xtra_data() + { + delete[] data; + } +}; + +struct loc_eng_msg_request_xtra_server : public loc_eng_msg { + inline loc_eng_msg_request_xtra_server(void *instance) : + loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_XTRA_SERVER) + { + + } +}; + +struct loc_eng_msg_atl_open_success : public loc_eng_msg { + const AGpsType agpsType; + const int length; + char* const apn; + const AGpsBearerType bearerType; + inline loc_eng_msg_atl_open_success(void* instance, + AGpsType atype, + const char* name, + int len, + AGpsBearerType btype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), + agpsType(atype), length(len), + apn(new char[len+1]), bearerType(btype) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", + loc_get_agps_type_name(agpsType), + apn, + loc_get_agps_bear_name(bearerType)); + } + inline ~loc_eng_msg_atl_open_success() + { + delete[] apn; + } +}; + +struct loc_eng_msg_atl_open_failed : public loc_eng_msg { + const AGpsStatusValue agpsType; + inline loc_eng_msg_atl_open_failed(void* instance, + AGpsStatusValue atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; + +struct loc_eng_msg_atl_closed : public loc_eng_msg { + const AGpsType agpsType; + inline loc_eng_msg_atl_closed(void* instance, + AGpsType atype) : + loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), + agpsType(atype) + { + LOC_LOGV("agps type %s", + loc_get_agps_type_name(agpsType)); + } +}; + +struct loc_eng_msg_set_data_enable : public loc_eng_msg { + const int enable; + char* const apn; + const int length; + inline loc_eng_msg_set_data_enable(void* instance, + const char* name, + int len, + int yes) : + loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), + enable(yes), apn(new char[len+1]), length(len) + { + memcpy((void*)apn, (void*)name, len); + apn[len] = 0; + LOC_LOGV("apn: %s\n enable: %d", apn, enable); + } + inline ~loc_eng_msg_set_data_enable() + { + delete[] apn; + } +}; + +void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); +int loc_eng_msgget(int * p_req_msgq); +int loc_eng_msgremove(int req_msgq); +int loc_eng_msgsnd(int msgqid, void * msgp); +int loc_eng_msgrcv(int msgqid, void ** msgp); +int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); +int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); +int loc_eng_msgflush(int msgqid); +int loc_eng_msgunblock(int msgqid); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index f017cab6..e9ba91d0 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -39,15 +39,11 @@ #include #include #include -#include #include #include "log_util.h" #include "platform_lib_includes.h" - -using namespace loc_core; - /*============================================================================= * * DATA DECLARATION @@ -61,42 +57,6 @@ using namespace loc_core; *============================================================================*/ 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 @@ -219,15 +179,15 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ // 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 = loc_eng_data_p->adapter; - LocEngInformNiResponse *msg = NULL; + // to exit without calling sending data to loc_eng_msg_q. We made sure that + // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() + loc_eng_msg_inform_ni_response *msg = NULL; if (NULL != loc_eng_ni_data_p->rawRequest) { - msg = new LocEngInformNiResponse(adapter, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; + msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); loc_eng_ni_data_p->rawRequest = NULL; } pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); @@ -236,7 +196,7 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->reqID++; if (NULL != msg) { - adapter->sendMsg(msg); + loc_eng_msg_sender(loc_eng_data_p, msg); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index f5f746b2..c4be2ab8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -259,7 +259,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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) + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->client_handle->getPositionMode().mode) length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous else length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential @@ -412,7 +412,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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) + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->client_handle->getPositionMode().mode) length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous else length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential @@ -490,7 +490,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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) + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->client_handle->getPositionMode().mode) gpsQuality = '1'; // 1 means GPS fix else gpsQuality = '2'; // 2 means DGPS fix diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 45822867..5c030b0b 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -31,57 +31,10 @@ #define LOG_TAG "LocSvc_eng" #include -#include +#include #include "log_util.h" #include "platform_lib_includes.h" -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(); - } -}; - /*=========================================================================== FUNCTION loc_eng_xtra_init @@ -136,8 +89,9 @@ SIDE EFFECTS int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); + loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, + data, length)); + loc_eng_msg_sender(&loc_eng_data, msg); return 0; } @@ -159,8 +113,12 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) { - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngRequestXtraServer(adapter)); + loc_eng_msg_request_xtra_server *msg(new loc_eng_msg_request_xtra_server(&loc_eng_data)); + + if (NULL == msg) + return -1; + + loc_eng_msg_sender(&loc_eng_data, msg); return 0; diff --git a/core/loc_core_log.h b/loc_api/libloc_api_50001/loc_ulp.h similarity index 50% rename from core/loc_core_log.h rename to loc_api/libloc_api_50001/loc_ulp.h index 8a1825ac..f4b1d0ed 100644 --- a/core/loc_core_log.h +++ b/loc_api/libloc_api_50001/loc_ulp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -27,32 +27,58 @@ * */ -#ifndef LOC_CORE_LOG_H -#define LOC_CORE_LOG_H +#ifndef __LOC_ULP_H__ +#define __LOC_ULP_H__ #ifdef __cplusplus -extern "C" -{ -#endif +extern "C" { +#endif /* __cplusplus */ #include -#include +#include +#include + +/** 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 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + + +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; -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 /* __cplusplus */ -#endif /* LOC_CORE_LOG_H */ +#endif //__LOC_ULP_H__ From 11adbb371f795fc676949a6fee5fe5e918443845 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 7 Aug 2013 18:40:27 -0700 Subject: [PATCH 151/945] Revert "Revert "Location Hal Design Level Change for FLP Requirement"". This reverts commit 55a6841843912ef8b46b67cbe9cbc60844244a74. (cherry picked from commit 363ed1a6b09d7426bfd3726becd2d713da57fa80) Change-Id: I19153a904dd7587dfd517dcc86f51f4b1110289a --- core/Android.mk | 49 + core/ContextBase.cpp | 63 + core/ContextBase.h | 61 + core/LocAdapterBase.cpp | 147 ++ core/LocAdapterBase.h | 97 + core/LocApiBase.cpp | 475 ++++ core/LocApiBase.h | 254 ++ core/LocDualContext.cpp | 117 + core/LocDualContext.h | 68 + core/MsgTask.cpp | 133 + core/MsgTask.h | 66 + core/gps_extended.h | 92 + core/gps_extended_c.h | 256 ++ core/loc_core_log.cpp | 250 ++ .../loc_ulp.h => core/loc_core_log.h | 68 +- loc_api/Android.mk | 2 - .../libloc_api-rpc-glue/Android.mk | 12 +- .../{LocApiRpcAdapter.h => LocApiRpc.h} | 40 +- .../{LocApiRpcAdapter.cpp => LocApiRpc.cpp} | 276 +- loc_api/libloc_api_50001/Android.mk | 68 +- loc_api/libloc_api_50001/LocApiAdapter.cpp | 269 -- loc_api/libloc_api_50001/LocApiAdapter.h | 250 -- loc_api/libloc_api_50001/LocEngAdapter.cpp | 207 ++ loc_api/libloc_api_50001/LocEngAdapter.h | 238 ++ loc_api/libloc_api_50001/Makefile.am | 4 +- loc_api/libloc_api_50001/gps_extended.h | 111 - loc_api/libloc_api_50001/loc.cpp | 72 +- loc_api/libloc_api_50001/loc.h | 39 +- loc_api/libloc_api_50001/loc_eng.cpp | 2221 ++++++++++------- loc_api/libloc_api_50001/loc_eng.h | 31 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 21 +- loc_api/libloc_api_50001/loc_eng_agps.h | 29 +- .../loc_eng_dmn_conn_handler.cpp | 132 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 201 -- loc_api/libloc_api_50001/loc_eng_log.h | 14 - loc_api/libloc_api_50001/loc_eng_msg.cpp | 133 - loc_api/libloc_api_50001/loc_eng_msg.h | 914 ++----- loc_api/libloc_api_50001/loc_eng_ni.cpp | 56 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 6 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 62 +- 40 files changed, 4617 insertions(+), 2987 deletions(-) create mode 100644 core/Android.mk create mode 100644 core/ContextBase.cpp create mode 100644 core/ContextBase.h create mode 100644 core/LocAdapterBase.cpp create mode 100644 core/LocAdapterBase.h create mode 100644 core/LocApiBase.cpp create mode 100644 core/LocApiBase.h create mode 100644 core/LocDualContext.cpp create mode 100644 core/LocDualContext.h create mode 100644 core/MsgTask.cpp create mode 100644 core/MsgTask.h create mode 100644 core/gps_extended.h create mode 100644 core/gps_extended_c.h create mode 100644 core/loc_core_log.cpp rename loc_api/libloc_api_50001/loc_ulp.h => core/loc_core_log.h (50%) rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/{LocApiRpcAdapter.h => LocApiRpc.h} (84%) rename loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/{LocApiRpcAdapter.cpp => LocApiRpc.cpp} (85%) delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.cpp delete mode 100644 loc_api/libloc_api_50001/LocApiAdapter.h create mode 100644 loc_api/libloc_api_50001/LocEngAdapter.cpp create mode 100644 loc_api/libloc_api_50001/LocEngAdapter.h delete mode 100644 loc_api/libloc_api_50001/gps_extended.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg.cpp diff --git a/core/Android.mk b/core/Android.mk new file mode 100644 index 00000000..f9074dbd --- /dev/null +++ b/core/Android.mk @@ -0,0 +1,49 @@ +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 + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + libdl \ + libandroid_runtime + +LOCAL_SRC_FILES += \ + MsgTask.cpp \ + 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 + +LOCAL_COPY_HEADERS_TO:= libloc_core/ +LOCAL_COPY_HEADERS:= \ + MsgTask.h \ + LocApiBase.h \ + LocAdapterBase.h \ + ContextBase.h \ + LocDualContext.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_core_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp new file mode 100644 index 00000000..7922cc21 --- /dev/null +++ b/core/ContextBase.cpp @@ -0,0 +1,63 @@ +/* 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_CtxBase" + +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +const char* ContextBase::mIzatLibName = "libloc_api_v02.so "; +// we initialized this handle to 1 because it can't possibly +// 1 if it ever gets assigned a value. NULL on the otherhand +// is possilbe. +void* ContextBase::mIzatLibHandle = (void*)1; + +void* ContextBase::getIzatLibHandle() +{ + if ((void*)1 == mIzatLibHandle) { + mIzatLibHandle = dlopen(mIzatLibName, RTLD_NOW); + } + return mIzatLibHandle; +} + +ContextBase::ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + mMsgTask(msgTask), + mLocApi(LocApiBase::create(mMsgTask, exMask, getIzatLibHandle())) +{ +} + +} diff --git a/core/ContextBase.h b/core/ContextBase.h new file mode 100644 index 00000000..b04def33 --- /dev/null +++ b/core/ContextBase.h @@ -0,0 +1,61 @@ +/* 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_CONTEXT_BASE__ +#define __LOC_CONTEXT_BASE__ + +#include +#include +#include +#include + +namespace loc_core { + +class LocAdapterBase; + +class ContextBase { + static const char* mIzatLibName; + static void* mIzatLibHandle; +protected: + const MsgTask* mMsgTask; + LocApiBase* mLocApi; + +protected: + ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + inline virtual ~ContextBase() { delete mLocApi; } + +public: + static void* getIzatLibHandle(); + inline const MsgTask* getMsgTask() { return mMsgTask; } + inline LocApiBase* getLocApi() { return mLocApi; } +}; + +} // namespace loc_core + +#endif //__LOC_CONTEXT_BASE__ diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp new file mode 100644 index 00000000..27b9f61f --- /dev/null +++ b/core/LocAdapterBase.cpp @@ -0,0 +1,147 @@ +/* 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_LocAdapterBase" + +#include +#include +#include +#include + +namespace loc_core { + +struct LocOpenMsg : public LocMsg { + LocAdapterBase* mLocAdapter; + LocApiBase* mLocApi; + inline LocOpenMsg(LocAdapterBase* locAdapter, + LocApiBase* locApi) : + LocMsg(), mLocAdapter(locAdapter), mLocApi(locApi) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->addAdapter(mLocAdapter); + } + inline void locallog() { + LOC_LOGV("LocOpen"); + } + inline virtual void log() { + locallog(); + } +}; + +// 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) : + mEvtMask(mask), mContext(context), + mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) +{ + sendMsg(new LocOpenMsg(this, mLocApi)); +} + +// This will be overridden by the individual adapters +// if necessary. +#define DEFAULT_IMPL(rtv) \ +{ \ + LOC_LOGW("%s: default implementation invoked", __func__); \ + return rtv; \ +} + +void LocAdapterBase:: + handleEngineDownEvent() +DEFAULT_IMPL() + +void LocAdapterBase:: + reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +DEFAULT_IMPL() + +void LocAdapterBase:: + reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +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) +} // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h new file mode 100644 index 00000000..aca70f59 --- /dev/null +++ b/core/LocAdapterBase.h @@ -0,0 +1,97 @@ +/* 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_API_ADAPTER_BASE_H +#define LOC_API_ADAPTER_BASE_H + +#include +#include + +namespace loc_core { + +class LocAdapterBase { +protected: + const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + ContextBase* mContext; + LocApiBase* mLocApi; + const MsgTask* mMsgTask; + + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context); + inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } + +public: + 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); + } + + // This will be overridden by the individual adapters + // if necessary. + inline virtual void handleEngineUpEvent() {} + virtual void handleEngineDownEvent() ; + virtual void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + virtual void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + 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; } +}; + +} // namespace loc_core + +#endif //LOC_API_ADAPTER_BASE_H diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp new file mode 100644 index 00000000..c6fef931 --- /dev/null +++ b/core/LocApiBase.cpp @@ -0,0 +1,475 @@ +/* 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_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(); + } +}; + +LocApiBase* LocApiBase::create(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + void* libHandle) +{ + LocApiBase* locApi = NULL; + + // first if can not be MPQ + if (TARGET_MPQ != get_target()) { + getLocApi_t* getter = NULL; + // needto check if locaction.so exists + void* handle = ContextBase::getIzatLibHandle(); + + if (NULL == handle || + NULL == (getter = (getLocApi_t*)dlsym(handle, "getLocApi")) || + NULL == (locApi = (*getter)(msgTask, exMask))) { + // only RPC is the option now + handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if (NULL != getter) { + locApi = (*getter)(msgTask, exMask); + } + } + } + } + + // locApi could still be NULL at this time + // we would then create a dummy one + if (NULL == locApi) { + locApi = new LocApiBase(msgTask, exMask); + } + + return locApi; +} + +LocApiBase::LocApiBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : + mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) +{ + memset(mLocAdapters, 0, sizeof(mLocAdapters)); +} + +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; + + TO_ALL_LOCADAPTERS(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; + open(mMask | (adapter->getEvtMask() & ~mExcludedMask)); + 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 + open(getEvtMask() & ~mExcludedMask); + } + } + } +} + +void LocApiBase::handleEngineUpEvent() +{ + // This will take care of renegotiating the loc handle + mMsgTask->sendMsg(new LocSsrMsg(this)); + + // 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) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask) + ); +} + +void LocApiBase::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportSv(svStatus, + locationExtended, + svExt) + ); +} + +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)); +} + + +// downward calls +// All below functions are to be defined by adapter specific modules: +// RPC, QMI, etc. The default implementation is empty. +#define DEFAULT_IMPL(rtv) \ +{ \ + LOC_LOGW("%s: default implementation invoked", __func__); \ + return rtv; \ +} + +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:: + setLPPConfig(uint32_t profile) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSensorControlConfig(int sensorUsage) +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:: + setExtPowerConfig(int isBatteryCharging) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setAGLONASSProtocol(unsigned long aGlonassProtocol) +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() + + +} // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h new file mode 100644 index 00000000..c027b3f8 --- /dev/null +++ b/core/LocApiBase.h @@ -0,0 +1,254 @@ +/* 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_API_BASE_H +#define LOC_API_BASE_H + +#include +#include +#include +#include + +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) +#define MAX_APN_LEN 100 + +namespace loc_core { + +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); + +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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< +#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); + +const MsgTask* LocDualContext::mMsgTask = NULL; +ContextBase* LocDualContext::mFgContext = NULL; +ContextBase* LocDualContext::mBgContext = NULL; + +char LocDualContext::mHasAgpsExt = 0xff; + +// the name must be shorter than 15 chars +const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; + +const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tCreator, name); + } + return mMsgTask; +} + +ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mFgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mFgContext = new LocDualContext(msgTask, + mFgExclMask); + } + return mFgContext; +} + +ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mBgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mBgContext = new LocDualContext(msgTask, + mBgExclMask); + } + return mBgContext; +} + +bool LocDualContext::hasAgpsExt() +{ + if (0xff == mHasAgpsExt) { + mHasAgpsExt = 0; + void* handle = ContextBase::getIzatLibHandle(); + if (NULL != handle) { + bool(*getter)() = (bool(*)())dlsym(handle, "hasAgpsExt"); + if (NULL != getter && (*getter)()) { + mHasAgpsExt = 1; + } + } + } + + return mHasAgpsExt == 1; +} + +LocDualContext::LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + ContextBase(msgTask, exMask) +{ +} + +} diff --git a/core/LocDualContext.h b/core/LocDualContext.h new file mode 100644 index 00000000..4e03bf44 --- /dev/null +++ b/core/LocDualContext.h @@ -0,0 +1,68 @@ +/* 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_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 char mHasAgpsExt; + + static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, + const char* name); + +protected: + LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + inline virtual ~LocDualContext() {} + +public: + 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(MsgTask::tCreate tCreator, + const char* name); + static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, + const char* name); + + static bool hasAgpsExt(); +}; + +} + +#endif //__LOC_ENG_CONTEXT__ diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp new file mode 100644 index 00000000..37813394 --- /dev/null +++ b/core/MsgTask.cpp @@ -0,0 +1,133 @@ +/* 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_MsgTask" + +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +#define MAX_TASK_COMM_LEN 15 + +static void LocMsgDestroy(void* msg) { + delete (LocMsg*)msg; +} + +MsgTask::MsgTask(tCreate tCreator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(NULL){ + if (tCreator) { + tCreator(threadName, loopMain, + (void*)new MsgTask(mQ, mAssociator)); + } else { + createPThread(threadName); + } +} + +MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(tAssociator){ + createPThread(threadName); +} + +inline +MsgTask::MsgTask(const void* q, tAssociate associator) : + mQ(q), mAssociator(associator){ +} + +MsgTask::~MsgTask() { + msg_q_unblock((void*)mQ); +} + +void MsgTask::createPThread(const char* threadName) { + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + pthread_t tid; + // create the thread here, then if successful + // and a name is given, we set the thread name + if (!pthread_create(&tid, &attr, loopMain, + (void*)new MsgTask(mQ, mAssociator)) && + NULL != threadName) { + char lname[MAX_TASK_COMM_LEN+1]; + memcpy(lname, threadName, MAX_TASK_COMM_LEN); + lname[MAX_TASK_COMM_LEN] = 0; + pthread_setname_np(tid, lname); + } +} + +void MsgTask::sendMsg(const LocMsg* msg) const { + msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); +} + +void* MsgTask::loopMain(void* arg) { + MsgTask* copy = (MsgTask*)arg; + + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); + + if (NULL != copy->mAssociator) { + copy->mAssociator(); + } + + LocMsg* msg; + int cnt = 0; + + while (1) { + LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); + + msq_q_err_type result = msg_q_rcv((void*)copy->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)); + // destroy the Q and exit + msg_q_destroy((void**)&(copy->mQ)); + delete copy; + return NULL; + } + + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); + + delete msg; + } + + delete copy; + + return NULL; +} + +} diff --git a/core/MsgTask.h b/core/MsgTask.h new file mode 100644 index 00000000..d09de731 --- /dev/null +++ b/core/MsgTask.h @@ -0,0 +1,66 @@ +/* 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 __MSG_TASK__ +#define __MSG_TASK__ + +#include +#include +#include +#include + +namespace loc_core { + +struct LocMsg { + inline LocMsg() {} + inline virtual ~LocMsg() {} + virtual void proc() const = 0; + inline virtual void log() const {} +}; + +class MsgTask { +public: + typedef void* (*tStart)(void*); + typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); + typedef int (*tAssociate)(); + MsgTask(tCreate tCreator, const char* threadName); + MsgTask(tAssociate tAssociator, const char* threadName); + ~MsgTask(); + void sendMsg(const LocMsg* msg) const; + +private: + const void* mQ; + tAssociate mAssociator; + MsgTask(const void* q, tAssociate associator); + static void* loopMain(void* copy); + void createPThread(const char* name); +}; + +} // namespace loc_core + +#endif //__MSG_TASK__ diff --git a/core/gps_extended.h b/core/gps_extended.h new file mode 100644 index 00000000..88b0415b --- /dev/null +++ b/core/gps_extended.h @@ -0,0 +1,92 @@ +/* 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. + */ + +#ifndef GPS_EXTENDED_H +#define GPS_EXTENDED_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + 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(MIN_POSSIBLE_FIX_INTERVAL), + preferred_accuracy(50), preferred_time(120000) { + 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/core/gps_extended_c.h b/core/gps_extended_c.h new file mode 100644 index 00000000..640668ff --- /dev/null +++ b/core/gps_extended_c.h @@ -0,0 +1,256 @@ +/* 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. + */ + +#ifndef GPS_EXTENDED_C_H +#define GPS_EXTENDED_C_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +/** 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 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + + +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 + +#define GPS_DELETE_ALMANAC_CORR 0x00001000 +#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 +#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 +#define GPS_DELETE_ALMANAC_GLO 0x00008000 +#define GPS_DELETE_SVDIR_GLO 0x00010000 +#define GPS_DELETE_SVSTEER_GLO 0x00020000 +#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 +#define GPS_DELETE_TIME_GPS 0x00080000 +#define GPS_DELETE_TIME_GLO 0x00100000 + +/** 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; + char ipv6_addr[16]; + 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; + + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_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_STANDALONE, + 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; + +#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ + +/** 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 + +/** 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; +} 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) + +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; + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* GPS_EXTENDED_C_H */ + diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp new file mode 100644 index 00000000..f67dfe0b --- /dev/null +++ b/core/loc_core_log.cpp @@ -0,0 +1,250 @@ +/* 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_core_log" + +#include +#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 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 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 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static 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 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_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GPS_DELETE_TIME_GLO ) +}; +static 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 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 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 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 ) +}; +static 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 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 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 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 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 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static 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 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_ulp.h b/core/loc_core_log.h similarity index 50% rename from loc_api/libloc_api_50001/loc_ulp.h rename to core/loc_core_log.h index f4b1d0ed..8a1825ac 100644 --- a/loc_api/libloc_api_50001/loc_ulp.h +++ b/core/loc_core_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -27,58 +27,32 @@ * */ -#ifndef __LOC_ULP_H__ -#define __LOC_ULP_H__ +#ifndef LOC_CORE_LOG_H +#define LOC_CORE_LOG_H #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif #include -#include -#include - -/** 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 - -#define ULP_MIN_INTERVAL_INVALID 0xffffffff - - -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; +#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 /* __cplusplus */ +#endif -#endif //__LOC_ULP_H__ +#endif /* LOC_CORE_LOG_H */ diff --git a/loc_api/Android.mk b/loc_api/Android.mk index c87df1f9..743b3860 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -6,8 +6,6 @@ LOCAL_PATH := $(call my-dir) ifneq ($(TARGET_NO_RPC),true) GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc/ -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api/ endif #TARGET_NO_RPC diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk index c7a245b8..bb3d924b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk @@ -9,7 +9,7 @@ source_files:= \ src/loc_apicb_appinit.c \ src/loc_api_fixup.c \ src/loc_api_log.c \ - src/LocApiRpcAdapter.cpp + src/LocApiRpc.cpp LOCAL_SRC_FILES:= $(source_files) @@ -26,7 +26,7 @@ LOCAL_SHARED_LIBRARIES:= \ libcutils \ libcommondefs \ libgps.utils \ - libloc_adapter + libloc_core LOCAL_STATIC_LIBRARIES := \ libloc_api_rpcgen @@ -37,20 +37,20 @@ 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-rpc \ $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ $(TARGET_OUT_HEADERS)/librpc \ $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ - $(TARGET_OUT_HEADERS)/libloc_eng \ - hardware/msm7k/librpc + $(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)/loc_apicb_appinit.h \ + $(RPC_INC)/LocApiRpc.h LOCAL_MODULE:= libloc_api-rpc-qc LOCAL_MODULE_OWNER := qcom diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h similarity index 84% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 32ea6e7f..fef42199 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpcAdapter.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -26,24 +26,30 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#ifndef LOC_API_RPC_ADAPTER_H -#define LOC_API_RPC_ADAPTER_H +#ifndef LOC_API_RPC_H +#define LOC_API_RPC_H #include +#include #include -#include +#include +#include +using namespace loc_core; -class LocApiRpcAdapter : public LocApiAdapter { +class LocApiRpc : public LocApiBase { // RPC communication establishment rpc_loc_client_handle_type client_handle; - rpc_loc_event_mask_type eMask; 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 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); @@ -51,13 +57,16 @@ class LocApiRpcAdapter : public LocApiAdapter { 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); - int NIEventFillVerfiyType(GpsNiNotification ¬if, - rpc_loc_ni_notify_verify_e_type notif_priv); - GpsNiEncodingType convertNiEncodingType(int loc_encoding); + + virtual enum loc_api_adapter_err + open(LOC_API_ADAPTER_EVENT_MASK_T mask); + virtual enum loc_api_adapter_err + close(); public: - LocApiRpcAdapter(LocEng &locEng); - ~LocApiRpcAdapter(); + LocApiRpc(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + ~LocApiRpc(); int locEventCB(rpc_loc_client_handle_type client_handle, rpc_loc_event_mask_type loc_event, @@ -67,13 +76,11 @@ public: // RPC adapter interface implementations virtual enum loc_api_adapter_err - reinit(); - virtual enum loc_api_adapter_err - startFix(); + startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode *mode); + setPositionMode(const LocPosMode& mode); inline virtual enum loc_api_adapter_err enableData(int enable) { return enableData(enable, false); } virtual enum loc_api_adapter_err @@ -108,4 +115,7 @@ public: virtual void setInSession(bool inSession); }; -#endif //LOC_API_RPC_ADAPTER_H +extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + +#endif //LOC_API_RPC_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp similarity index 85% rename from loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp rename to loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index e836f103..879244da 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpcAdapter.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -27,24 +27,27 @@ * */ #define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_adapter" +#define LOG_TAG "LocSvc_api_rpc" #include #include #ifndef USE_GLIB #include #endif /* USE_GLIB */ -#include "LocApiRpcAdapter.h" -#include "loc_api_rpcgen_common_rpc.h" -#include "log_util.h" -#include "loc_log.h" -#include "loc_api_log.h" +#include +#include +#include +#include +#include +#include +#include #ifdef USE_GLIB #include #endif -#include "librpc.h" -#include "platform_lib_includes.h" +#include +#include +using namespace loc_core; #define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) #define XTRA_BLOCK_SIZE (3072) @@ -77,7 +80,7 @@ static int32 loc_event_cb { MODEM_LOG_CALLFLOW(%s, loc_get_event_name(loc_event)); loc_callback_log(loc_event, loc_event_payload); - int32 ret_val = ((LocApiRpcAdapter*)user)->locEventCB(client_handle, 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; } @@ -101,17 +104,21 @@ SIDE EFFECTS 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)); - ((LocApiRpcAdapter*)user)->locRpcGlobalCB(clnt, 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; -LocApiAdapter* getLocApiAdapter(LocEng &locEng) -{ - return new LocApiRpcAdapter(locEng); -} - -const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = +const rpc_loc_event_mask_type LocApiRpc::locBits[] = { RPC_LOC_EVENT_PARSED_POSITION_REPORT, RPC_LOC_EVENT_SATELLITE_REPORT, @@ -124,27 +131,24 @@ const rpc_loc_event_mask_type LocApiRpcAdapter::locBits[] = RPC_LOC_EVENT_STATUS_REPORT }; -LocApiRpcAdapter::LocApiRpcAdapter(LocEng &locEng) : - LocApiAdapter(locEng), +// constructor +LocApiRpc::LocApiRpc(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + LocApiBase(msgTask, exMask), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - eMask(convertMask(locEng.eventMask)), dataEnableLastSet(-1) { memset(apnLastSet, 0, sizeof(apnLastSet)); loc_api_glue_init(); } -LocApiRpcAdapter::~LocApiRpcAdapter() +LocApiRpc::~LocApiRpc() { - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - - loc_close(client_handle); + close(); } rpc_loc_event_mask_type -LocApiRpcAdapter::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) +LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) { rpc_loc_event_mask_type newMask = 0; @@ -159,7 +163,7 @@ LocApiRpcAdapter::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) } enum loc_api_adapter_err -LocApiRpcAdapter::convertErr(int rpcErr) +LocApiRpc::convertErr(int rpcErr) { switch(rpcErr) { @@ -188,7 +192,7 @@ LocApiRpcAdapter::convertErr(int rpcErr) } } -void LocApiRpcAdapter::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) +void LocApiRpc::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) { static rpc_loc_engine_state_e_type last_state = RPC_LOC_ENGINE_STATE_MAX; @@ -208,12 +212,10 @@ void LocApiRpcAdapter::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) } } -int32 LocApiRpcAdapter::locEventCB(rpc_loc_client_handle_type client_handle, +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) { - locEngHandle.acquireWakelock(); - // Parsed report if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) { @@ -269,60 +271,89 @@ int32 LocApiRpcAdapter::locEventCB(rpc_loc_client_handle_type client_handle, NIEvent(&loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request); } - locEngHandle.releaseWakeLock(); 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 -LocApiRpcAdapter::reinit() +LocApiRpc::open(LOC_API_ADAPTER_EVENT_MASK_T mask) { enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - client_handle = loc_open(eMask, loc_event_cb, loc_rpc_global_cb, this); + // 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 (client_handle < 0) { - ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; + 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 -LocApiRpcAdapter::startFix() { - LOC_LOGD("LocApiRpcAdapter::startFix() called"); +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 -LocApiRpcAdapter::stopFix() { - LOC_LOGD("LocApiRpcAdapter::stopFix() called"); +LocApiRpc::stopFix() { + LOC_LOGD("LocApiRpc::stopFix() called"); return convertErr( loc_stop_fix(client_handle) ); } enum loc_api_adapter_err -LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) +LocApiRpc::setPositionMode(const LocPosMode& posMode) { rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr; + 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; - - if (NULL != posMode) - fixCriteria = *posMode; + 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); + (int32) client_handle, fixCriteria->min_interval, fixCriteria->mode); - switch (fixCriteria.mode) + switch (fixCriteria->mode) { case LOC_POSITION_MODE_MS_BASED: op_mode = RPC_LOC_OPER_MODE_MSB; @@ -348,25 +379,24 @@ LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) op_mode = RPC_LOC_OPER_MODE_STANDALONE; } - fix_criteria_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; 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->min_interval = fixCriteria->min_interval; fix_criteria_ptr->preferred_operation_mode = op_mode; - fix_criteria_ptr->min_interval = fixCriteria.min_interval; + 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; + 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; + 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) { + switch (fixCriteria->recurrence) { case GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; @@ -387,7 +417,7 @@ LocApiRpcAdapter::setPositionMode(const LocPosMode *posMode) } enum loc_api_adapter_err -LocApiRpcAdapter::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +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; @@ -413,7 +443,7 @@ LocApiRpcAdapter::setTime(GpsUtcTime time, int64_t timeReference, int uncertaint } enum loc_api_adapter_err -LocApiRpcAdapter::injectPosition(double latitude, double longitude, float accuracy) +LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) { /* IOCTL data */ rpc_loc_ioctl_data_u_type ioctl_data; @@ -452,7 +482,7 @@ LocApiRpcAdapter::injectPosition(double latitude, double longitude, float accura } enum loc_api_adapter_err -LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, +LocApiRpc::informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) { rpc_loc_ioctl_data_u_type data; @@ -489,7 +519,7 @@ LocApiRpcAdapter::informNiResponse(GpsUserResponseType userResponse, } enum loc_api_adapter_err -LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) +LocApiRpc::setAPN(char* apn, int len, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; int size = sizeof(apnLastSet); @@ -500,7 +530,7 @@ LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) } memcpy(apnLastSet, apn, size); - if (false == navigating) { + 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; @@ -518,17 +548,16 @@ LocApiRpcAdapter::setAPN(char* apn, int len, boolean force) return rtv; } -void LocApiRpcAdapter::setInSession(bool inSession) +void LocApiRpc::setInSession(bool inSession) { - LocApiAdapter::setInSession(inSession); - if (false == navigating) { + if (!inSession) { enableData(dataEnableLastSet, true); setAPN(apnLastSet, sizeof(apnLastSet)-1, true); } } enum loc_api_adapter_err -LocApiRpcAdapter::setServer(const char* url, int len) +LocApiRpc::setServer(const char* url, int len) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_server_info_s_type *server_info_ptr; @@ -559,7 +588,7 @@ LocApiRpcAdapter::setServer(const char* url, int len) } enum loc_api_adapter_err -LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) +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; @@ -594,13 +623,13 @@ LocApiRpcAdapter::setServer(unsigned int ip, int port, LocServerType type) } enum loc_api_adapter_err -LocApiRpcAdapter::enableData(int enable, boolean force) +LocApiRpc::enableData(int enable, boolean force) { enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; if (force || dataEnableLastSet != enable) { dataEnableLastSet = enable; - if (false == navigating) { + 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; @@ -617,7 +646,7 @@ LocApiRpcAdapter::enableData(int enable, boolean force) } enum loc_api_adapter_err -LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) +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; @@ -631,7 +660,7 @@ LocApiRpcAdapter::deleteAidingData(GpsAidingData bits) ); } -void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) +void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) { LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; @@ -723,30 +752,36 @@ void LocApiRpcAdapter::reportPosition(const rpc_loc_parsed_position_s_type *loca } LOC_LOGV("reportPosition: fire callback\n"); - LocApiAdapter::reportPosition(location, - locationExtended, - locEngHandle.extPosInfo((void*)location_report_ptr), - (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), - tech_Mask); + 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 { - LocApiAdapter::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); + 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"); + LOC_LOGV("loc_eng_report_position: ignore position report " + "when session status is not set\n"); } } -void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) +void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { GpsSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; @@ -846,51 +881,52 @@ void LocApiRpcAdapter::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if (SvStatus.num_svs >= 0) { - LocApiAdapter::reportSv(SvStatus, - locationExtended, - locEngHandle.extSvInfo((void*)gnss_report_ptr)); + LocApiBase::reportSv(SvStatus, + locationExtended, + (void*)gnss_report_ptr); } } -void LocApiRpcAdapter::reportStatus(const rpc_loc_status_event_s_type *status_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) { - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_BEGIN); + 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) { - LocApiAdapter::reportStatus(GPS_STATUS_SESSION_END); - LocApiAdapter::reportStatus(GPS_STATUS_ENGINE_OFF); + LocApiBase::reportStatus(GPS_STATUS_SESSION_END); + LocApiBase::reportStatus(GPS_STATUS_ENGINE_OFF); } else { - LocApiAdapter::reportStatus(GPS_STATUS_NONE); + LocApiBase::reportStatus(GPS_STATUS_NONE); } } } -void LocApiRpcAdapter::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) +void LocApiRpc::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) { #if (AMSS_VERSION==3200) - LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); + LocApiBase::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, + nmea_report_ptr->nmea_sentences.nmea_sentences_len); #else - LocApiAdapter::reportNmea(nmea_report_ptr->nmea_sentences, - nmea_report_ptr->length); + 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[3], + nmea_report_ptr->nmea_sentences[4], nmea_report_ptr->nmea_sentences[5]); #endif /* #if (AMSS_VERSION==3200) */ } enum loc_api_adapter_err -LocApiRpcAdapter::setXtraData(char* data, int length) +LocApiRpc::setXtraData(char* data, int length) { int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; int total_parts; @@ -968,7 +1004,7 @@ LocApiRpcAdapter::setXtraData(char* data, int length) /* Request the Xtra Server Url from the modem */ enum loc_api_adapter_err -LocApiRpcAdapter::requestXtraServer() +LocApiRpc::requestXtraServer() { loc_api_adapter_err err; rpc_loc_ioctl_data_u_type data; @@ -1001,16 +1037,19 @@ LocApiRpcAdapter::requestXtraServer() return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; } - LocApiAdapter::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); + 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 -LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) +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; @@ -1084,7 +1123,7 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerTy } enum loc_api_adapter_err -LocApiRpcAdapter::atlCloseStatus(int handle, int is_succ) +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; @@ -1104,7 +1143,7 @@ LocApiRpcAdapter::atlCloseStatus(int handle, int is_succ) ); } -void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) +void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) { int connHandle; AGpsType agps_type; @@ -1140,7 +1179,7 @@ void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_requ } } -void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) +void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) { GpsNiNotification notif = {0}; @@ -1203,8 +1242,8 @@ void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) #endif /* #if (AMSS_VERSION==3200) */ char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - addr_len = LocApiAdapter::decodeAddress(lcs_addr, sizeof lcs_addr, address_source, - umts_cp_req->ext_client_address_data.ext_client_address_len); + 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) @@ -1283,10 +1322,10 @@ void LocApiRpcAdapter::NIEvent(const rpc_loc_ni_event_s_type *ni_req) // 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)); - LocApiAdapter::requestNiNotify(notif, (const void*)copy); + requestNiNotify(notif, (const void*)copy); } -int LocApiRpcAdapter::NIEventFillVerfiyType(GpsNiNotification ¬if, +int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, rpc_loc_ni_notify_verify_e_type notif_priv) { switch (notif_priv) @@ -1317,7 +1356,7 @@ int LocApiRpcAdapter::NIEventFillVerfiyType(GpsNiNotification ¬if, } enum loc_api_adapter_err -LocApiRpcAdapter::setSUPLVersion(uint32_t version) +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; @@ -1330,7 +1369,7 @@ LocApiRpcAdapter::setSUPLVersion(uint32_t version) ); } -GpsNiEncodingType LocApiRpcAdapter::convertNiEncodingType(int loc_encoding) +GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) { switch (loc_encoding) { @@ -1346,3 +1385,8 @@ GpsNiEncodingType LocApiRpcAdapter::convertNiEncodingType(int loc_encoding) return GPS_ENC_UNKNOWN; } } + +LocApiBase* getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) { + return new LocApiRpc(msgTask, exMask); +} diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 07172654..dd14b5e5 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -5,7 +5,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := libloc_adapter +LOCAL_MODULE := libloc_eng LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -13,51 +13,9 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ + libdl \ liblog \ - libgps.utils \ - libdl - -LOCAL_SRC_FILES += \ - loc_eng_log.cpp \ - LocApiAdapter.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - hardware/qcom/gps/loc_api/libloc_api_50001 - -LOCAL_COPY_HEADERS_TO:= libloc_eng/ -LOCAL_COPY_HEADERS:= \ - LocApiAdapter.h \ - loc.h \ - gps_extended.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_msg_id.h \ - loc_eng_log.h \ - loc_ulp.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_eng - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_adapter \ + libloc_core \ libgps.utils LOCAL_SRC_FILES += \ @@ -66,7 +24,8 @@ LOCAL_SRC_FILES += \ loc_eng_xtra.cpp \ loc_eng_ni.cpp \ loc_eng_log.cpp \ - loc_eng_nmea.cpp + loc_eng_nmea.cpp \ + LocEngAdapter.cpp LOCAL_SRC_FILES += \ loc_eng_dmn_conn.cpp \ @@ -81,8 +40,22 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ + hardware/qcom/gps/loc_api/libloc_api_50001 \ hardware/qcom/gps/loc_api/ulp/inc +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_msg_id.h \ + loc_eng_log.h + LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) @@ -90,6 +63,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional @@ -100,6 +74,7 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ liblog \ libloc_eng \ + libloc_core \ libgps.utils \ libdl \ libandroid_runtime @@ -119,6 +94,7 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ hardware/qcom/gps/loc_api/ulp/inc LOCAL_PRELINK_MODULE := false diff --git a/loc_api/libloc_api_50001/LocApiAdapter.cpp b/loc_api/libloc_api_50001/LocApiAdapter.cpp deleted file mode 100644 index b26a4008..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.cpp +++ /dev/null @@ -1,269 +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. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_adapter" - -#include -#include -#include "loc_eng_msg.h" -#include "loc_log.h" -#include "loc_eng_ni.h" - -static void* noProc(void* data) -{ - return NULL; -} - -LocEng::LocEng(void* caller, - LOC_API_ADAPTER_EVENT_MASK_T emask, - gps_acquire_wakelock acqwl, - gps_release_wakelock relwl, - loc_msg_sender msgSender, - loc_msg_sender msgUlpSender, - loc_ext_parser posParser, - loc_ext_parser svParser) : - owner(caller), - eventMask(emask), acquireWakelock(acqwl), - releaseWakeLock(relwl), sendMsge(msgSender), - sendUlpMsg(msgUlpSender), - extPosInfo(NULL == posParser ? noProc : posParser), - extSvInfo(NULL == svParser ? noProc : svParser) -{ - LOC_LOGV("LocEng constructor %p, %p", posParser, svParser); -} - -LocApiAdapter::LocApiAdapter(LocEng &locEng) : - locEngHandle(locEng), fixCriteria(), navigating(false) -{ - LOC_LOGD("LocApiAdapter created"); -} - -LocApiAdapter::~LocApiAdapter() -{ - LOC_LOGV("LocApiAdapter deleted"); -} - -LocApiAdapter* LocApiAdapter::getLocApiAdapter(LocEng &locEng) -{ - void* handle; - LocApiAdapter* adapter = NULL; - - handle = dlopen ("libloc_api_v02.so", RTLD_NOW); - - if (!handle) { - handle = dlopen ("libloc_api-rpc-qc.so", RTLD_NOW); - } - - if (!handle) { - adapter = new LocApiAdapter(locEng); - } else { - getLocApiAdapter_t* getHandle = (getLocApiAdapter_t*)dlsym(handle, "getLocApiAdapter"); - - adapter = (*getHandle)(locEng); - } - - return adapter; -} - -int LocApiAdapter::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 LocApiAdapter::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; -} - -void LocApiAdapter::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask ) -{ - loc_eng_msg_report_position *msg(new loc_eng_msg_report_position(locEngHandle.owner, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); - if (locEngHandle.sendUlpMsg) { - locEngHandle.sendUlpMsg(locEngHandle.owner, msg); - } else { - locEngHandle.sendMsge(locEngHandle.owner, msg); - } -} - -void LocApiAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) -{ - loc_eng_msg_report_sv *msg(new loc_eng_msg_report_sv(locEngHandle.owner, svStatus, locationExtended, 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 (locEngHandle.sendUlpMsg) { - locEngHandle.sendUlpMsg(locEngHandle.owner, msg); - } else { - locEngHandle.sendMsge(locEngHandle.owner, msg); - } -} - -void LocApiAdapter::reportStatus(GpsStatusValue status) -{ - loc_eng_msg_report_status *msg(new loc_eng_msg_report_status(locEngHandle.owner, status)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportNmea(const char* nmea, int length) -{ - loc_eng_msg_report_nmea *msg(new loc_eng_msg_report_nmea(locEngHandle.owner, nmea, length)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength) -{ - loc_eng_msg_report_xtra_server *msg(new loc_eng_msg_report_xtra_server(locEngHandle.owner, url1, url2, url3, maxlength)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestATL(int connHandle, AGpsType agps_type) -{ - loc_eng_msg_request_atl *msg(new loc_eng_msg_request_atl(locEngHandle.owner, connHandle, agps_type)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestSuplES(int connHandle) -{ - loc_eng_msg_request_supl_es *msg(new loc_eng_msg_request_supl_es(locEngHandle.owner, connHandle)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::releaseDataHandle(void) -{ - loc_eng_msg_close_data_call *msg(new loc_eng_msg_close_data_call(locEngHandle.owner)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::releaseATL(int connHandle) -{ - loc_eng_msg_release_atl *msg(new loc_eng_msg_release_atl(locEngHandle.owner, connHandle)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestXtraData() -{ - LOC_LOGD("XTRA download request"); - - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_XTRA_DATA)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestTime() -{ - LOC_LOGD("loc_event_cb: XTRA time download request"); - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_TIME)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestLocation() -{ - LOC_LOGD("loc_event_cb: XTRA time download request... not supported"); - // loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_REQUEST_POSITION)); - // locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) -{ - notif.size = sizeof(notif); - notif.timeout = LOC_NI_NO_RESPONSE_TIME; - - loc_eng_msg_request_ni *msg(new loc_eng_msg_request_ni(locEngHandle.owner, notif, data)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineDownEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_DOWN)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::handleEngineUpEvent() -{ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_ENGINE_UP)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportDataCallOpened() -{ - loc_eng_msg_atl_open_success *msg(new loc_eng_msg_atl_open_success(locEngHandle.owner, - AGPS_TYPE_INVALID, - NULL, 0, 0)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} - -void LocApiAdapter::reportDataCallClosed() -{ - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(locEngHandle.owner, - AGPS_TYPE_INVALID)); - locEngHandle.sendMsge(locEngHandle.owner, msg); -} diff --git a/loc_api/libloc_api_50001/LocApiAdapter.h b/loc_api/libloc_api_50001/LocApiAdapter.h deleted file mode 100644 index ace934e4..00000000 --- a/loc_api/libloc_api_50001/LocApiAdapter.h +++ /dev/null @@ -1,250 +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_API_ADAPTER_H -#define LOC_API_ADAPTER_H - -#include -#include -#include -#include -#include -#include -#include "platform_lib_includes.h" - -#define MAX_APN_LEN 100 -#define MAX_URL_LEN 256 -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) - -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_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, - 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_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< +#include "loc_eng_msg.h" +#include "loc_log.h" + +using namespace loc_core; + +LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, + void* owner, loc_msg_sender msgSender, + MsgTask::tCreate tCreator) : + LocAdapterBase(mask, + LocDualContext::getLocFgContext( + tCreator, + LocDualContext::mLocationHalName)), + mOwner(owner), mSendUlpMsg(msgSender), mNavigating(false), + mAgpsEnabled(loc_core::LocDualContext::hasAgpsExt()) +{ + memset(&mFixCriteria, 0, sizeof(mFixCriteria)); + LOC_LOGD("LocEngAdapter created"); +} + +inline +LocEngAdapter::~LocEngAdapter() +{ + LOC_LOGV("LocEngAdapter deleted"); +} + +void LocEngAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask ) +{ + if (mSendUlpMsg) { + loc_eng_msg_report_position *msg( + new loc_eng_msg_report_position(mOwner, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); + mSendUlpMsg(mOwner, msg); + } else { + sendMsg(new LocEngReportPosition(mOwner, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); + } +} + +void LocEngAdapter::reportSv(GpsSvStatus &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 (mSendUlpMsg) { + loc_eng_msg_report_sv *msg( + new loc_eng_msg_report_sv(mOwner, svStatus, + locationExtended, svExt)); + mSendUlpMsg(mOwner, msg); + } else { + sendMsg(new LocEngReportSv(mOwner, svStatus, + locationExtended, svExt)); + } +} + +inline +void LocEngAdapter::reportStatus(GpsStatusValue status) +{ + sendMsg(new LocEngReportStatus(mOwner, 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 (mAgpsEnabled) { + sendMsg(new LocEngReportXtraServer(mOwner, url1, + url2, url3, maxlength)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestATL(mOwner, + connHandle, agps_type)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::releaseATL(int connHandle) +{ + if (mAgpsEnabled) { + sendMsg(new LocEngReleaseATL(mOwner, connHandle)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestXtraData() +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestXtra(mOwner)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestTime() +{ + if (mAgpsEnabled) { + sendMsg(new LocEngRequestXtra(mOwner)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + if (mAgpsEnabled) { + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + sendMsg(new LocEngRequestNi(mOwner, notif, data)); + } + return mAgpsEnabled; +} + +inline +bool LocEngAdapter::requestSuplES(int connHandle) +{ + sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); + return true; +} + +inline +bool LocEngAdapter::reportDataCallOpened() +{ + sendMsg(new LocEngSuplEsOpened(mOwner)); + return true; +} + +inline +bool LocEngAdapter::reportDataCallClosed() +{ + sendMsg(new LocEngSuplEsClosed(mOwner)); + return true; +} + +inline +void LocEngAdapter::handleEngineDownEvent() +{ + sendMsg(new LocEngDown(mOwner)); +} + +inline +void LocEngAdapter::handleEngineUpEvent() +{ + sendMsg(new LocEngUp(mOwner)); +} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h new file mode 100644 index 00000000..7e6f73bd --- /dev/null +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -0,0 +1,238 @@ +/* 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_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; + +typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); + +class LocEngAdapter : public LocAdapterBase { + void* mOwner; + loc_msg_sender mSendUlpMsg; + LocPosMode mFixCriteria; + bool mNavigating; + +public: + const bool mAgpsEnabled; + + LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, + void* owner, loc_msg_sender msgSender, + MsgTask::tCreate tCreator); + virtual ~LocEngAdapter(); + + 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 + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) + { + return mLocApi->setTime(time, timeReference, uncertainty); + } + 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 + setLPPConfig(uint32_t profile) + { + return mLocApi->setLPPConfig(profile); + } + inline enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage) + { + return mLocApi->setSensorControlConfig(sensorUsage); + } + 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 + setExtPowerConfig(int isBatteryCharging) + { + return mLocApi->setExtPowerConfig(isBatteryCharging); + } + inline virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol) + { + return mLocApi->setAGLONASSProtocol(aGlonassProtocol); + } + 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(); + } + + 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(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + 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(); + + inline const LocPosMode& getPositionMode() const + {return mFixCriteria;} + inline virtual bool isInSession() + { return mNavigating; } + inline void setInSession(bool inSession) + { mNavigating = inSession; mLocApi->setInSession(inSession); } +}; + +#endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index 93e633f5..cee948c1 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -5,7 +5,7 @@ AM_CFLAGS = \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocApiAdapter.cpp +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@ @@ -62,7 +62,7 @@ endif libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la library_include_HEADERS = \ - LocApiAdapter.h \ + LocEngAdapter.h \ loc.h \ loc_eng.h \ loc_eng_xtra.h \ diff --git a/loc_api/libloc_api_50001/gps_extended.h b/loc_api/libloc_api_50001/gps_extended.h deleted file mode 100644 index f1db4729..00000000 --- a/loc_api/libloc_api_50001/gps_extended.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. - * - * Not a Contribution. - * - * Copyright (C) 2010 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. - */ - -#ifndef GPS_EXTENDED_H -#define GPS_EXTENDED_H - -/** 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 - -/** 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 - -#define GPS_DELETE_ALMANAC_CORR 0x00001000 -#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 -#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 -#define GPS_DELETE_ALMANAC_GLO 0x00008000 -#define GPS_DELETE_SVDIR_GLO 0x00010000 -#define GPS_DELETE_SVSTEER_GLO 0x00020000 -#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 -#define GPS_DELETE_TIME_GPS 0x00080000 -#define GPS_DELETE_TIME_GLO 0x00100000 - -/** 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; - char ipv6_addr[16]; - 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; - - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiExtCallbacks; - -#endif /* GPS_EXTENDED_H */ - diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4ada9072..9749703a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -31,7 +31,7 @@ #define LOG_TAG "LocSvc_afw" #include -#include +#include #include #include #include @@ -43,9 +43,16 @@ #include #include #include -#include - +#include +#include #include + +namespace android { + namespace AndroidRuntime { + void* createJavaThread(const char* name, void (*start)(void *), void* arg); + } +} + //Globals defns static const ulpInterface * loc_eng_ulp_inf = NULL; static const ulpInterface * loc_eng_get_ulp_inf(void); @@ -206,7 +213,7 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { unsigned int target = TARGET_DEFAULT; - if (NULL == loc_afw_data.context) { + if (NULL == loc_afw_data.adapter) { loc_eng_read_config(); //We load up libulp module at this point itself @@ -245,8 +252,8 @@ static void loc_free_msg(void* msg) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) { - LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; - msg_q_snd((void*)loc_eng_context->ulp_q, msg, loc_free_msg); + loc_eng_data_s_type* loc_eng = (loc_eng_data_s_type*)loc_eng_data_p; + msg_q_snd(loc_eng->ulp_q, msg, loc_free_msg); } /*=========================================================================== @@ -270,25 +277,24 @@ static int loc_hal_init(void) { int retVal = -1; ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event; -#ifdef TARGET_USES_QCOM_BSP - LOC_API_ADAPTER_EVENT_MASK_T event = - LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; -#else - LOC_API_ADAPTER_EVENT_MASK_T event = - 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; -#endif + if (loc_core::LocDualContext::hasAgpsExt()) { + event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | + LOC_API_ADAPTER_BIT_SATELLITE_REPORT | + LOC_API_ADAPTER_BIT_IOCTL_REPORT | + LOC_API_ADAPTER_BIT_STATUS_REPORT | + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; + } else { + event = 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; + } LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ local_status_cb, /* status_cb */ local_sv_cb, /* sv_status_cb */ @@ -467,9 +473,9 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain ENTRY_LOG(); int ret_val = 0; - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - #endif + } EXIT_LOG(%d, ret_val); return ret_val; @@ -610,21 +616,21 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngXTRAInterface; - #endif + } } else if (strcmp(name, AGPS_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngAGpsInterface; - #endif + } } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - #ifndef TARGET_USES_QCOM_BSP + if (loc_core::LocDualContext::hasAgpsExt()) { ret_val = &sLocEngNiInterface; - #endif + } } else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { @@ -1022,7 +1028,7 @@ static int loc_init(GpsCallbacks* callbacks) EXIT_LOG(%d, retVal); return retVal; } - memset(&afw_cb_data, NULL, sizeof (LocCallbacks)); + memset(&afw_cb_data, 0, sizeof (afw_cb_data)); gps_loc_cb = callbacks->location_cb; afw_cb_data.status_cb = callbacks->status_cb; gps_sv_cb = callbacks->sv_status_cb; diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 146063a2..334e03ee 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -37,28 +37,7 @@ extern "C" { #include #include #include -#include -#include "gps_extended.h" - -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ - -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_STANDALONE, - 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; +#include typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); @@ -78,22 +57,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; -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) void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index db3cb3f9..ff5fd63c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,7 @@ #include #include -#include "LocApiAdapter.h" +#include #include #ifndef USE_GLIB @@ -70,6 +71,7 @@ #include #include "log_util.h" #include "platform_lib_includes.h" +#include "loc_core_log.h" #include "loc_eng_log.h" #define SUCCESS TRUE @@ -83,16 +85,10 @@ #define SAP_CONF_FILE "/etc/sap.conf" #endif -static void loc_eng_deferred_action_thread(void* context); -static void* loc_eng_create_msg_q(); -static void loc_eng_free_msg(void* msg); +using namespace loc_core; -pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER; -LocEngContext* LocEngContext::me = NULL; boolean configAlreadyRead = false; unsigned int agpsStatus = 0; - loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; @@ -169,60 +165,6 @@ static void loc_default_parameters(void) gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; } -LocEngContext::LocEngContext(gps_create_thread threadCreator) : - deferred_q((const void*)loc_eng_create_msg_q()), - - //TODO: should we conditionally create ulp msg q? - ulp_q((const void*)loc_eng_create_msg_q()), - - deferred_action_thread(threadCreator("loc_eng",loc_eng_deferred_action_thread, this)), - counter(0) -{ - LOC_LOGV("LocEngContext %d : %d pthread_id %ld\n", - getpid(), GETTID_PLATFORM_LIB_ABSTRACTION, - deferred_action_thread); -} - -LocEngContext* LocEngContext::get(gps_create_thread threadCreator) -{ - pthread_mutex_lock(&lock); - // gonna need mutex protection here... - if (NULL == me) { - me = new LocEngContext(threadCreator); - } - me->counter++; - - pthread_mutex_unlock(&lock); - return me; -} - -void LocEngContext::drop() -{ - if (deferred_action_thread != pthread_self()) { - pthread_mutex_lock(&lock); - counter--; - if (counter == 0) { - loc_eng_msg *msg(new loc_eng_msg(this, LOC_ENG_MSG_QUIT)); - msg_q_snd((void*)deferred_q, msg, loc_eng_free_msg); - - // I am not sure if this is going to be hazardous. The calling thread - // might be blocked for a while, if the q is loaded. I am wondering - // if we should just dump all the msgs in the q upon QUIT. - pthread_cond_wait(&cond, &lock); - - msg_q_destroy((void**)&deferred_q); - - msg_q_destroy((void**)&ulp_q); - - delete me; - me = NULL; - } - pthread_mutex_unlock(&lock); - } else { - LOC_LOGE("The HAL thread cannot free itself"); - } -} - // 2nd half of init(), singled out for // modem restart to use. static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data); @@ -241,7 +183,1197 @@ static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_ 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 char extra_data[100]; +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 void deleteAidingData(loc_eng_data_s_type &logEng); +static AgpsStateMachine* +getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType); + +static void loc_eng_free_msg(void* msg) +{ + delete (loc_eng_msg*)msg; +} + +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(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) +{ + locallog(); +} +inline void LocEngStartFix::proc() const +{ + loc_eng_start_handler(*mLocEng); +} +inline void LocEngStartFix::locallog() const +{ + LOC_LOGV("LocEngStartFix"); +} +inline void LocEngStartFix::log() const +{ + locallog(); +} +void LocEngStartFix::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_STOP_FIX: +LocEngStopFix::LocEngStopFix(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) +{ + locallog(); +} +inline void LocEngStopFix::proc() const +{ + loc_eng_stop_handler(*mLocEng); +} +inline void LocEngStopFix::locallog() const +{ + LOC_LOGV("LocEngStopFix"); +} +inline void LocEngStopFix::log() const +{ + locallog(); +} +void LocEngStopFix::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->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); +} + +// case LOC_ENG_MSG_SET_TIME: +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 { + 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 { + 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 { + mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + } + inline void locallog() const { + LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); + } + 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 { + mAdapter->setSUPLVersion(mSuplVer); + } + inline void locallog() const { + LOC_LOGV("SUPL Version: %d", mSuplVer); + } + 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 { + 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; + inline LocEngSensorControlConfig(LocEngAdapter* adapter, + int sensorsDisabled) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSensorControlConfig(mSensorsDisabled); + } + inline void locallog() const { + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", + mSensorsDisabled); + } + 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_EXT_POWER_CONFIG: +struct LocEngExtPowerConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mIsBatteryCharging; + inline LocEngExtPowerConfig(LocEngAdapter* adapter, + int isBatteryCharging) : + LocMsg(), mAdapter(adapter), + mIsBatteryCharging(isBatteryCharging) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setExtPowerConfig(mIsBatteryCharging); + } + inline void locallog() const { + LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d", + mIsBatteryCharging); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_REPORT_POSITION: +LocEngReportPosition::LocEngReportPosition(void* locEng, + UlpLocation &loc, + GpsLocationExtended &locExtended, + void* locExt, + enum loc_sess_status st, + LocPosTechMask technology) : + LocMsg(), mLocEng(locEng), mLocation(loc), + mLocationExtended(locExtended), + mLocationExt(((loc_eng_data_s_type*)mLocEng)->location_ext_parser(locExt)), + mStatus(st), mTechMask(technology) +{ + locallog(); +} +void LocEngReportPosition::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + + 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) & + 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)))) { + 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); + } + + if (locEng->generateNmea && + mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) + { + 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("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", + mLocation.gpsLocation.flags, mLocation.position_source, + mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, + mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, + mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, + mLocation.gpsLocation.timestamp, mLocation.rawDataSize, + mLocation.rawData, mStatus, mTechMask); +} +void LocEngReportPosition::log() const { + locallog(); +} +void LocEngReportPosition::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + + +// case LOC_ENG_MSG_REPORT_SV: +LocEngReportSv::LocEngReportSv(void* locEng, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExt) : + LocMsg(), mLocEng(locEng), mSvStatus(sv), + mLocationExtended(locExtended), + mSvExt(((loc_eng_data_s_type*)mLocEng)->sv_ext_parser(svExt)) +{ + locallog(); +} +void LocEngReportSv::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->sv_status_cb != NULL) { + locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus), + (void*)mSvExt); + } + + if (locEng->generateNmea) + { + loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended); + } + } +} +void LocEngReportSv::locallog() const { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " + "used in fix mask: %x\n sv: prn snr " + "elevation azimuth", + mSvStatus.num_svs, mSvStatus.ephemeris_mask, + mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); + for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + mSvStatus.sv_list[i].prn, + mSvStatus.sv_list[i].snr, + mSvStatus.sv_list[i].elevation, + mSvStatus.sv_list[i].azimuth); + } +} +inline void LocEngReportSv::log() const { + locallog(); +} +void LocEngReportSv::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_REPORT_STATUS: +LocEngReportStatus::LocEngReportStatus(void* locEng, + GpsStatusValue engineStatus) : + LocMsg(), mLocEng(locEng), mStatus(engineStatus) +{ + locallog(); +} +inline void LocEngReportStatus::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + + 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; + CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); + 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)]) +{ + strlcpy(mServers, url1, mMaxLen); + strlcpy(&mServers[mMaxLen], url2, mMaxLen); + strlcpy(&mServers[mMaxLen<<1], url3, mMaxLen); + 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], + &mServers[mMaxLen<<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], &mServers[mMaxLen<<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>>24), + (unsigned char)(mIPv4Addr>>16), + (unsigned char)(mIPv4Addr>>8), + (unsigned char)mIPv4Addr, + 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; + 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; + 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; + AgpsStateMachine* sm = locEng->ds_nif; + DSSubscriber s(sm, mID); + sm->subscribeRsrc((Subscriber*)&s); +} +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); + ATLSubscriber s(mID, + sm, + locEng->adapter, + AGPS_TYPE_INVALID == mType); + sm->subscribeRsrc((Subscriber*)&s); +} +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; + 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__); + } else { + 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__); + } else { + DSSubscriber s3(locEng->ds_nif, mID); + if(locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", + __func__, __LINE__); + } else { + 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; + WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); + if (mIsReq) { + locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + } else { + locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + } +} +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 (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_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); + } + 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 { + AgpsStateMachine* mStateMachine; + const int mLen; + char* mAPN; + const AGpsBearerType mBearerType; + inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine, + const char* name, + int len, + AGpsBearerType btype) : + LocMsg(), + mStateMachine(statemachine), 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 { + mStateMachine->setBearer(mBearerType); + mStateMachine->setAPN(mAPN, mLen); + mStateMachine->onRsrcEvent(RSRC_GRANTED); + } + inline void locallog() const { + LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" + " bearer type: %s", + loc_get_agps_type_name(mStateMachine->getType()), + mAPN, + loc_get_agps_bear_name(mBearerType)); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ATL_CLOSED: +struct LocEngAtlClosed : public LocMsg { + AgpsStateMachine* mStateMachine; + inline LocEngAtlClosed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->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 { + AgpsStateMachine* mStateMachine; + inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->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(); +} + /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -255,27 +1387,6 @@ static char extra_data[100]; } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg) -{ - LocEngContext* loc_eng_context = (LocEngContext*)((loc_eng_data_s_type*)loc_eng_data_p)->context; - msg_q_snd((void*)loc_eng_context->deferred_q, msg, loc_eng_free_msg); -} - -static void* loc_eng_create_msg_q() -{ - void* q = NULL; - if (eMSG_Q_SUCCESS != msg_q_init(&q)) { - LOC_LOGE("loc_eng_create_msg_q Q init failed."); - q = NULL; - } - return q; -} - -static void loc_eng_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - /*=========================================================================== FUNCTION loc_eng_init @@ -308,15 +1419,11 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, return ret_val; } - STATE_CHECK((NULL == loc_eng_data.context), + STATE_CHECK((NULL == loc_eng_data.adapter), "instance already initialized", return 0); memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - // Create context (msg q + thread) (if not yet created) - // This will also parse gps.conf, if not done. - loc_eng_data.context = (void*)LocEngContext::get(callbacks->create_thread_cb); - // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; loc_eng_data.sv_status_cb = callbacks->sv_status_cb; @@ -325,6 +1432,10 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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.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 @@ -342,22 +1453,15 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } - LocEng locEngHandle(&loc_eng_data, event, loc_eng_data.acquire_wakelock_cb, - loc_eng_data.release_wakelock_cb, loc_eng_msg_sender, loc_external_msg_sender, - callbacks->location_ext_parser, callbacks->sv_ext_parser); - loc_eng_data.client_handle = LocApiAdapter::getLocApiAdapter(locEngHandle); + loc_eng_data.adapter = + new LocEngAdapter(event, &loc_eng_data, + loc_external_msg_sender, + (MsgTask::tCreate)callbacks->create_thread_cb); - if (NULL == loc_eng_data.client_handle) { - // drop the context and declare failure - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - } else { - LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.client_handle); + LOC_LOGD("loc_eng_init created client, id = %p\n", + loc_eng_data.adapter); - /*send reinit event to QMI instead of call reinit directly*/ - loc_eng_msg *msg(new loc_eng_msg(locEngHandle.owner, LOC_ENG_MSG_LOC_INIT)); - locEngHandle.sendMsge(locEngHandle.owner, msg); - } + loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data)); EXIT_LOG(%d, ret_val); return ret_val; @@ -366,30 +1470,16 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG(); - int ret_val = loc_eng_data.client_handle->reinit(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { LOC_LOGD("loc_eng_reinit reinit() successful"); - loc_eng_msg_suple_version *supl_msg(new loc_eng_msg_suple_version(&loc_eng_data, - gps_conf.SUPL_VER)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - supl_msg, loc_eng_free_msg); - - loc_eng_msg_lpp_config *lpp_msg(new loc_eng_msg_lpp_config(&loc_eng_data, - gps_conf.LPP_PROFILE)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - lpp_msg, loc_eng_free_msg); - - loc_eng_msg_sensor_control_config *sensor_control_config_msg( - new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_control_config_msg, loc_eng_free_msg); - - loc_eng_msg_a_glonass_protocol *a_glonass_protocol_msg(new loc_eng_msg_a_glonass_protocol(&loc_eng_data, - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - a_glonass_protocol_msg, loc_eng_free_msg); + LocEngAdapter* adapter = loc_eng_data.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)); + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); /* 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 || @@ -398,43 +1488,32 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - loc_eng_msg_sensor_properties *sensor_properties_msg( - new loc_eng_msg_sensor_properties(&loc_eng_data, - 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)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_properties_msg, loc_eng_free_msg); + 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)); } - loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg( - new loc_eng_msg_sensor_perf_control_config(&loc_eng_data, - 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)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - sensor_perf_control_conf_msg, loc_eng_free_msg); + 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)); - //Send data disable to modem. This will be set to enable when - //an UPDATE_NETWORK_STATE event is received from Android - loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, NULL, - 0, (agpsStatus ? 1:0))); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); } EXIT_LOG(%d, ret_val); @@ -460,7 +1539,7 @@ SIDE EFFECTS void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); // XTRA has no state, so we are fine with it. @@ -476,7 +1555,7 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_data.internet_nif = NULL; } #endif - if (loc_eng_data.client_handle->isInSession()) + if (loc_eng_data.adapter->isInSession()) { LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); loc_eng_stop(loc_eng_data); @@ -484,9 +1563,6 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) #if 0 // can't afford to actually clean up, for many reason. - ((LocEngContext*)(loc_eng_data.context))->drop(); - loc_eng_data.context = NULL; - // De-initialize ulp if (locEngUlpInf != NULL) { @@ -494,12 +1570,9 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) msg_q_destroy( &loc_eng_data.ulp_q); } - if (loc_eng_data.client_handle != NULL) - { - LOC_LOGD("loc_eng_init: client opened. close it now."); - delete loc_eng_data.client_handle; - loc_eng_data.client_handle = NULL; - } + 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(); @@ -529,15 +1602,19 @@ SIDE EFFECTS int loc_eng_start(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); - void* target_q = loc_eng_data.ulp_initialized ? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + if(loc_eng_data.ulp_q) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + loc_eng_data.adapter->sendMsg(new LocEngStartFix(&loc_eng_data)); + } - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd( target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -547,13 +1624,13 @@ 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.client_handle->isInSession()) { - ret_val = loc_eng_data.client_handle->startFix(); + 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) { - loc_eng_data.client_handle->setInSession(TRUE); + loc_eng_data.adapter->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -581,15 +1658,18 @@ SIDE EFFECTS int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); - void* target_q = loc_eng_data.ulp_initialized ? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q : - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; - - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd( target_q, msg, loc_eng_free_msg); + if(loc_eng_data.ulp_q) + { + //Pass the start messgage to ULP if present & activated + loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + loc_eng_data.adapter->sendMsg(new LocEngStopFix(&loc_eng_data)); + } EXIT_LOG(%d, 0); return 0; @@ -600,15 +1680,15 @@ 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.client_handle->isInSession()) { + if (loc_eng_data.adapter->isInSession()) { - ret_val = loc_eng_data.client_handle->stopFix(); + ret_val = loc_eng_data.adapter->stopFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) { loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); } - loc_eng_data.client_handle->setInSession(FALSE); + loc_eng_data.adapter->setInSession(FALSE); } EXIT_LOG(%d, ret_val); @@ -658,16 +1738,23 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, LocPosMode ¶ms) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return -1); + INIT_CHECK(loc_eng_data.adapter, return -1); loc_eng_msg_position_mode *msg( new loc_eng_msg_position_mode(&loc_eng_data, params)); - void* target_q = loc_eng_data.ulp_initialized? - (void*)((LocEngContext*)(loc_eng_data.context))->ulp_q: - (void*)((LocEngContext*)(loc_eng_data.context))->deferred_q; + if(loc_eng_data.ulp_q) + { + loc_eng_msg_position_mode *msg( + new loc_eng_msg_position_mode(&loc_eng_data, params)); + //Pass the start messgage to ULP if present & activated + msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); + } + else + { + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngPositionMode(adapter, params)); + } - //Pass the start messgage to ULP if present & activated - msg_q_snd(target_q, msg, loc_eng_free_msg); EXIT_LOG(%d, 0); return 0; } @@ -692,14 +1779,10 @@ 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.context, return -1); - loc_eng_msg_set_time *msg( - new loc_eng_msg_set_time(&loc_eng_data, - time, - timeReference, - uncertainty)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + 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; } @@ -725,14 +1808,10 @@ 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.context, return -1); - loc_eng_msg_inject_location *msg( - new loc_eng_msg_inject_location(&loc_eng_data, - latitude, - longitude, - accuracy)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + INIT_CHECK(loc_eng_data.adapter, return -1); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, + accuracy)); EXIT_LOG(%d, 0); return 0; @@ -762,13 +1841,9 @@ SIDE EFFECTS void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); - loc_eng_msg_delete_aiding_data *msg( - new loc_eng_msg_delete_aiding_data(&loc_eng_data, - f)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f)); EXIT_LOG(%s, VOID_RET); } @@ -794,19 +1869,14 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa { ENTRY_LOG(); - static GpsStatusValue last_status = GPS_STATUS_NONE; - - GpsStatus gs = { sizeof(gs),status }; - - if (loc_eng_data.status_cb) { - CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); + GpsStatus gs = { sizeof(gs),status }; + CALLBACK_LOG_CALLFLOW("status_cb", %s, + loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); } - last_status = status; - EXIT_LOG(%s, VOID_RET); } @@ -821,7 +1891,7 @@ static int dataCallCb(void *cb_data) int ret=0; if(cb_data != NULL) { dsCbData *cbData = (dsCbData *)cb_data; - LocApiAdapter *locAdapter = (LocApiAdapter *)cbData->mAdapter; + 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(); @@ -897,7 +1967,7 @@ SIDE EFFECTS void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context, return); + INIT_CHECK(loc_eng_data.adapter, return); STATE_CHECK((NULL == loc_eng_data.agps_status_cb), "agps instance already initialized", return); @@ -920,11 +1990,11 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - if(!loc_eng_data.client_handle->initDataServiceClient()) { + if(!loc_eng_data.adapter->initDataServiceClient()) { LOC_LOGD("%s:%d]: Creating new ds state machine\n", __func__, __LINE__); loc_eng_data.ds_nif = new DSStateMachine(servicerTypeExt, (void *)dataCallCb, - loc_eng_data.client_handle); + loc_eng_data.adapter); LOC_LOGD("%s:%d]: Created new ds state machine\n", __func__, __LINE__); } @@ -935,6 +2005,37 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call 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; + } +} + +static AgpsStateMachine* +getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { + AgpsStateMachine* stateMachine; + switch (agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = locEng.wifi_nif; + break; + } + case AGPS_TYPE_INVALID: + case AGPS_TYPE_SUPL: { + stateMachine = locEng.agnss_nif; + break; + } + case AGPS_TYPE_SUPL_ES: { + stateMachine = locEng.ds_nif; + break; + } + default: + stateMachine = locEng.internet_nif; + } + return stateMachine; +} + /*=========================================================================== FUNCTION loc_eng_agps_open @@ -956,7 +2057,7 @@ 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.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); if (apn == NULL) @@ -968,11 +2069,10 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - loc_eng_msg_atl_open_success *msg( - new loc_eng_msg_atl_open_success(&loc_eng_data, agpsType, apn, - apn_len, bearerType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + + loc_eng_data.adapter->sendMsg( + new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType)); EXIT_LOG(%d, 0); return 0; @@ -998,12 +2098,11 @@ SIDE EFFECTS int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm)); EXIT_LOG(%d, 0); return 0; @@ -1029,12 +2128,11 @@ SIDE EFFECTS int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb, + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data, agpsType)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm)); EXIT_LOG(%d, 0); return 0; @@ -1105,16 +2203,14 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, { 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 = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); if (sizeof(url) > len) { - loc_eng_msg_set_server_url *msg(new loc_eng_msg_set_server_url(&loc_eng_data, - url, len)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); } } else if (LOC_AGPS_CDMA_PDE_SERVER == type || LOC_AGPS_CUSTOM_PDE_SERVER == type || @@ -1126,12 +2222,7 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, ret = -2; } else { unsigned int ip = htonl(addr.s_addr); - loc_eng_msg_set_server_ipv4 *msg(new loc_eng_msg_set_server_ipv4(&loc_eng_data, - ip, - port, - type)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type)); } } else { LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type); @@ -1166,7 +2257,7 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); int ret_val = 0; - if (NULL != loc_eng_data.context) + if (NULL != loc_eng_data.adapter) { ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); } else { @@ -1224,15 +2315,13 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d //us to inform the modem after GPS is enabled agpsStatus = available; - INIT_CHECK(loc_eng_data.context, return); + 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); - loc_eng_msg_set_data_enable *msg(new loc_eng_msg_set_data_enable(&loc_eng_data, apn, - apn_len, available)); - msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q, - msg, loc_eng_free_msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngEnableData(adapter, apn, apn_len, available)); } EXIT_LOG(%s, VOID_RET); } @@ -1275,7 +2364,7 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Session End is not reported during Android navigating state - boolean navigating = loc_eng_data.client_handle->isInSession(); + boolean navigating = loc_eng_data.adapter->isInSession(); if (status != GPS_STATUS_NONE && !(status == GPS_STATUS_SESSION_END && navigating) && !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) @@ -1346,10 +2435,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.client_handle->isInSession()) { + if (loc_eng_data.adapter->isInSession()) { // This sets the copy in adapter to modem - loc_eng_data.client_handle->setPositionMode(NULL); - loc_eng_data.client_handle->setInSession(false); + loc_eng_data.adapter->setPositionMode(NULL); + loc_eng_data.adapter->setInSession(false); loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); @@ -1378,610 +2467,6 @@ static int set_sched_policy(int tid, SchedPolicy policy) } #endif /* USE_GLIB */ -/*=========================================================================== -FUNCTION loc_eng_deferred_action_thread - -DESCRIPTION - Main routine for the thread to execute loc_eng commands. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_deferred_action_thread(void* arg) -{ - ENTRY_LOG(); - loc_eng_msg *msg; - static int cnt = 0; - LocEngContext* context = (LocEngContext*)arg; - - // make sure we do not run in background scheduling group - set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); - - while (1) - { - LOC_LOGD("%s:%d] %d listening ...\n", __func__, __LINE__, cnt++); - - // we are only sending / receiving msg pointers - msq_q_err_type result = msg_q_rcv((void*)context->deferred_q, (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; - } - - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)msg->owner; - - LOC_LOGD("%s:%d] received msg_id = %s context = %p\n", - __func__, __LINE__, loc_get_msg_name(msg->msgid), loc_eng_data_p->context); - - // need to ensure the instance data is valid - STATE_CHECK(NULL != loc_eng_data_p->context, - "instance cleanup happened", - delete msg; return); - - switch(msg->msgid) { - case LOC_ENG_MSG_QUIT: - { - LocEngContext* context = (LocEngContext*)loc_eng_data_p->context; - pthread_mutex_lock(&(context->lock)); - pthread_cond_signal(&(context->cond)); - pthread_mutex_unlock(&(context->lock)); - EXIT_LOG(%s, "LOC_ENG_MSG_QUIT, signal the main thread and return"); - } - return; - - case LOC_ENG_MSG_REQUEST_NI: - { - loc_eng_msg_request_ni *niMsg = (loc_eng_msg_request_ni*)msg; - loc_eng_ni_request_handler(*loc_eng_data_p, &niMsg->notify, niMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_INFORM_NI_RESPONSE: - { - loc_eng_msg_inform_ni_response *nrMsg = (loc_eng_msg_inform_ni_response*)msg; - loc_eng_data_p->client_handle->informNiResponse(nrMsg->response, - nrMsg->passThroughData); - } - break; - - case LOC_ENG_MSG_START_FIX: - loc_eng_start_handler(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_STOP_FIX: - if (loc_eng_data_p->agps_request_pending) - { - loc_eng_data_p->stop_request_pending = true; - LOC_LOGD("loc_eng_stop - deferring stop until AGPS data call is finished\n"); - } else { - loc_eng_stop_handler(*loc_eng_data_p); - } - break; - - case LOC_ENG_MSG_SET_POSITION_MODE: - { - loc_eng_msg_position_mode *pmMsg = (loc_eng_msg_position_mode*)msg; - loc_eng_data_p->client_handle->setPositionMode(&(pmMsg->pMode)); - } - break; - - case LOC_ENG_MSG_SET_TIME: - { - loc_eng_msg_set_time *tMsg = (loc_eng_msg_set_time*)msg; - loc_eng_data_p->client_handle->setTime(tMsg->time, tMsg->timeReference, - tMsg->uncertainty); - } - break; - - case LOC_ENG_MSG_INJECT_LOCATION: - { - loc_eng_msg_inject_location *ilMsg = (loc_eng_msg_inject_location*) msg; - loc_eng_data_p->client_handle->injectPosition(ilMsg->latitude, ilMsg->longitude, - ilMsg->accuracy); - } - break; - - case LOC_ENG_MSG_SET_SERVER_IPV4: - { - loc_eng_msg_set_server_ipv4 *ssiMsg = (loc_eng_msg_set_server_ipv4*)msg; - loc_eng_data_p->client_handle->setServer(ssiMsg->nl_addr, - ssiMsg->port, - ssiMsg->serverType); - } - break; - - case LOC_ENG_MSG_SET_SERVER_URL: - { - loc_eng_msg_set_server_url *ssuMsg = (loc_eng_msg_set_server_url*)msg; - loc_eng_data_p->client_handle->setServer(ssuMsg->url, ssuMsg->len); - } - break; - - case LOC_ENG_MSG_A_GLONASS_PROTOCOL: - { - loc_eng_msg_a_glonass_protocol *svMsg = (loc_eng_msg_a_glonass_protocol*)msg; - loc_eng_data_p->client_handle->setAGLONASSProtocol(svMsg->a_glonass_protocol); - } - break; - - case LOC_ENG_MSG_SUPL_VERSION: - { - loc_eng_msg_suple_version *svMsg = (loc_eng_msg_suple_version*)msg; - loc_eng_data_p->client_handle->setSUPLVersion(svMsg->supl_version); - } - break; - - case LOC_ENG_MSG_LPP_CONFIG: - { - loc_eng_msg_lpp_config *svMsg = (loc_eng_msg_lpp_config*)msg; - loc_eng_data_p->client_handle->setLPPConfig(svMsg->lpp_config); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: - { - loc_eng_msg_sensor_control_config *sccMsg = (loc_eng_msg_sensor_control_config*)msg; - loc_eng_data_p->client_handle->setSensorControlConfig(sccMsg->sensorsDisabled); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: - { - loc_eng_msg_sensor_properties *spMsg = (loc_eng_msg_sensor_properties*)msg; - loc_eng_data_p->client_handle->setSensorProperties(spMsg->gyroBiasVarianceRandomWalk_valid, - spMsg->gyroBiasVarianceRandomWalk, - spMsg->accelRandomWalk_valid, - spMsg->accelRandomWalk, - spMsg->angleRandomWalk_valid, - spMsg->angleRandomWalk, - spMsg->rateRandomWalk_valid, - spMsg->rateRandomWalk, - spMsg->velocityRandomWalk_valid, - spMsg->velocityRandomWalk); - } - break; - - case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: - { - loc_eng_msg_sensor_perf_control_config *spccMsg = (loc_eng_msg_sensor_perf_control_config*)msg; - loc_eng_data_p->client_handle->setSensorPerfControlConfig(spccMsg->controlMode, spccMsg->accelSamplesPerBatch, spccMsg->accelBatchesPerSec, - spccMsg->gyroSamplesPerBatch, spccMsg->gyroBatchesPerSec, - spccMsg->accelSamplesPerBatchHigh, spccMsg->accelBatchesPerSecHigh, - spccMsg->gyroSamplesPerBatchHigh, spccMsg->gyroBatchesPerSecHigh, - spccMsg->algorithmConfig); - } - break; - - case LOC_ENG_MSG_EXT_POWER_CONFIG: - { - loc_eng_msg_ext_power_config *pwrMsg = (loc_eng_msg_ext_power_config*)msg; - loc_eng_data_p->client_handle->setExtPowerConfig(pwrMsg->isBatteryCharging); - } - break; - - case LOC_ENG_MSG_REPORT_POSITION: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - bool reported = false; - loc_eng_msg_report_position *rpMsg = (loc_eng_msg_report_position*)msg; - if (loc_eng_data_p->location_cb != NULL) { - if (LOC_SESS_FAILURE == rpMsg->status) { - // in case we want to handle the failure case - loc_eng_data_p->location_cb(NULL, NULL); - reported = true; - } - // what's in the else if is... (line by line) - // 1. this is a good fix; or - // 1.1 it is a Satellite fix; or - // 1.1.1 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 == rpMsg->status && - (((LOC_POS_TECH_MASK_SATELLITE & rpMsg->technology_mask) || - (LOC_POS_TECH_MASK_SENSORS & rpMsg->technology_mask)))) || - (LOC_SESS_INTERMEDIATE == loc_eng_data_p->intermediateFix && - !((rpMsg->location.gpsLocation.flags & GPS_LOCATION_HAS_ACCURACY) && - (gps_conf.ACCURACY_THRES != 0) && - (rpMsg->location.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { - loc_eng_data_p->location_cb((UlpLocation*)&(rpMsg->location), - (void*)rpMsg->locationExt); - reported = true; - } - } - - // if we have reported this fix - if (reported && - // and if this is a singleshot - GPS_POSITION_RECURRENCE_SINGLE == - loc_eng_data_p->client_handle->getPositionMode().recurrence) { - if (LOC_SESS_INTERMEDIATE == rpMsg->status) { - // modem could be still working for a final fix, - // although we no longer need it. So stopFix(). - loc_eng_data_p->client_handle->stopFix(); - } - // turn off the session flag. - loc_eng_data_p->client_handle->setInSession(false); - } - - if (loc_eng_data_p->generateNmea && rpMsg->location.position_source == ULP_LOCATION_IS_FROM_GNSS) - { - unsigned char generate_nmea = reported && (rpMsg->status != LOC_SESS_FAILURE); - loc_eng_nmea_generate_pos(loc_eng_data_p, rpMsg->location, - rpMsg->locationExtended, - generate_nmea); - } - - // Free the allocated memory for rawData - UlpLocation* gp = (UlpLocation*)&(rpMsg->location); - if (gp != NULL && gp->rawData != NULL) - { - delete (char*)gp->rawData; - gp->rawData = NULL; - gp->rawDataSize = 0; - } - } - - break; - - case LOC_ENG_MSG_REPORT_SV: - if (loc_eng_data_p->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - loc_eng_msg_report_sv *rsMsg = (loc_eng_msg_report_sv*)msg; - if (loc_eng_data_p->sv_status_cb != NULL) { - loc_eng_data_p->sv_status_cb((GpsSvStatus*)&(rsMsg->svStatus), - (void*)rsMsg->svExt); - } - - if (loc_eng_data_p->generateNmea) - { - loc_eng_nmea_generate_sv(loc_eng_data_p, rsMsg->svStatus, rsMsg->locationExtended); - } - - } - break; - - case LOC_ENG_MSG_REPORT_STATUS: - loc_eng_report_status(*loc_eng_data_p, ((loc_eng_msg_report_status*)msg)->status); - break; - - case LOC_ENG_MSG_REPORT_NMEA: - if (NULL != loc_eng_data_p->nmea_cb) { - loc_eng_msg_report_nmea* nmMsg = (loc_eng_msg_report_nmea*)msg; - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %p, nmMsg->nmea); - loc_eng_data_p->nmea_cb(now, nmMsg->nmea, nmMsg->length); - } - break; - - case LOC_ENG_MSG_REPORT_XTRA_SERVER: - if (NULL != loc_eng_data_p->xtra_module_data.report_xtra_server_cb) { - loc_eng_msg_report_xtra_server* xsMsg = (loc_eng_msg_report_xtra_server*)msg; - CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, xsMsg->server1); - loc_eng_data_p->xtra_module_data.report_xtra_server_cb(xsMsg->server1, xsMsg->server2, xsMsg->server3); - } - break; - - case LOC_ENG_MSG_REQUEST_BIT: - { - AgpsStateMachine* stateMachine; - loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg; - if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { - stateMachine = loc_eng_data_p->agnss_nif; - } else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { - stateMachine = loc_eng_data_p->internet_nif; - } else { - LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType); - break; - } - BITSubscriber subscriber(stateMachine, brqMsg->ipv4Addr, brqMsg->ipv6Addr); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_BIT: - { - AgpsStateMachine* stateMachine; - loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg; - if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) { - stateMachine = loc_eng_data_p->agnss_nif; - } else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) { - stateMachine = loc_eng_data_p->internet_nif; - } else { - LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType); - break; - } - BITSubscriber subscriber(stateMachine, brlMsg->ipv4Addr, brlMsg->ipv6Addr); - - stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_REQUEST_ATL: - { - loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg; - boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type; - AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type || - backwardCompatibleMode) ? - loc_eng_data_p->agnss_nif : - loc_eng_data_p->internet_nif; - ATLSubscriber subscriber(arqMsg->handle, - stateMachine, - loc_eng_data_p->client_handle, - backwardCompatibleMode); - - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_RELEASE_ATL: - { - loc_eng_msg_release_atl* arlMsg = (loc_eng_msg_release_atl*)msg; - ATLSubscriber s1(arlMsg->handle, - loc_eng_data_p->agnss_nif, - loc_eng_data_p->client_handle, - false); - // attempt to unsubscribe from agnss_nif first - if (loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { - LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", __func__, __LINE__); - } - else { - ATLSubscriber s2(arlMsg->handle, - loc_eng_data_p->internet_nif, - loc_eng_data_p->client_handle, - false); - // if unsuccessful, try internet_nif - if(loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { - LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", __func__, __LINE__); - } - else { - DSSubscriber s3(loc_eng_data_p->ds_nif, - arlMsg->handle); - LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", - __func__, __LINE__, arlMsg->handle); - if(loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); - } - else { - LOC_LOGE("%s:%d]: Could not release ATL. No subscribers found\n", - __func__, __LINE__); - loc_eng_data_p->client_handle->atlCloseStatus(arlMsg->handle, 0); - } - } - } - } - break; - - case LOC_ENG_MSG_REQUEST_WIFI: - { - loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg; - if (wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC || - wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM || - wrqMsg->senderId == LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU) { - AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; - WIFISubscriber subscriber(stateMachine, wrqMsg->ssid, wrqMsg->password, wrqMsg->senderId); - stateMachine->subscribeRsrc((Subscriber*)&subscriber); - } else { - LOC_LOGE("%s]%d ERROR: unknown sender ID", __func__, __LINE__); - break; - } - } - break; - - case LOC_ENG_MSG_RELEASE_WIFI: - { - AgpsStateMachine* stateMachine = loc_eng_data_p->wifi_nif; - loc_eng_msg_release_wifi* wrlMsg = (loc_eng_msg_release_wifi*)msg; - WIFISubscriber subscriber(stateMachine, wrlMsg->ssid, wrlMsg->password, wrlMsg->senderId); - stateMachine->unsubscribeRsrc((Subscriber*)&subscriber); - } - break; - - case LOC_ENG_MSG_REQUEST_XTRA_DATA: - if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL) - { - loc_eng_data_p->xtra_module_data.download_request_cb(); - } - break; - - case LOC_ENG_MSG_REQUEST_TIME: - if (loc_eng_data_p->request_utc_time_cb != NULL) - { - loc_eng_data_p->request_utc_time_cb(); - } - else - { - LOC_LOGE("%s] ERROR: Callback function for request_time is NULL", __func__); - } - break; - - case LOC_ENG_MSG_REQUEST_POSITION: - break; - - case LOC_ENG_MSG_DELETE_AIDING_DATA: - loc_eng_data_p->aiding_data_for_deletion |= ((loc_eng_msg_delete_aiding_data*)msg)->type; - break; - - case LOC_ENG_MSG_ENABLE_DATA: - { - loc_eng_msg_set_data_enable *unaMsg = (loc_eng_msg_set_data_enable*)msg; - loc_eng_data_p->client_handle->enableData(unaMsg->enable); - if(unaMsg->apn != NULL) - loc_eng_data_p->client_handle->setAPN(unaMsg->apn, unaMsg->length); - } - break; - - case LOC_ENG_MSG_INJECT_XTRA_DATA: - { - loc_eng_msg_inject_xtra_data *xdMsg = (loc_eng_msg_inject_xtra_data*)msg; - loc_eng_data_p->client_handle->setXtraData(xdMsg->data, xdMsg->length); - } - break; - - case LOC_ENG_MSG_REQUEST_XTRA_SERVER: - { - loc_eng_data_p->client_handle->requestXtraServer(); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_SUCCESS: - { - loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg; - AgpsStateMachine* stateMachine; - LOC_LOGD("%s:%d]: AGPS_TYPE: %d\n", __func__, __LINE__, (int)aosMsg->agpsType); - switch (aosMsg->agpsType) { - case AGPS_TYPE_WIFI: { - LOC_LOGD("%s:%d]: AGPS Type wifi\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - LOC_LOGD("%s:%d]: AGPS Type supl\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - case AGPS_TYPE_INVALID: { - stateMachine = loc_eng_data_p->ds_nif; - LOC_LOGD("%s:%d]: AGPS Type invalid\n", __func__, __LINE__); - } - break; - default: { - LOC_LOGD("%s:%d]: AGPS Type default internet\n", __func__, __LINE__); - stateMachine = loc_eng_data_p->internet_nif; - } - } - - stateMachine->setBearer(aosMsg->bearerType); - stateMachine->setAPN(aosMsg->apn, aosMsg->length); - stateMachine->onRsrcEvent(RSRC_GRANTED); - } - break; - - case LOC_ENG_MSG_ATL_CLOSED: - { - loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg; - AgpsStateMachine* stateMachine; - - switch (acsMsg->agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - case AGPS_TYPE_INVALID: { - stateMachine = loc_eng_data_p->ds_nif; - break; - } - default: { - stateMachine = loc_eng_data_p->internet_nif; - } - } - stateMachine->onRsrcEvent(RSRC_RELEASED); - } - break; - - case LOC_ENG_MSG_ATL_OPEN_FAILED: - { - loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg; - AgpsStateMachine* stateMachine; - - switch (aofMsg->agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = loc_eng_data_p->wifi_nif; - break; - } - case AGPS_TYPE_SUPL: { - stateMachine = loc_eng_data_p->agnss_nif; - break; - } - default: { - stateMachine = loc_eng_data_p->internet_nif; - } - } - stateMachine->onRsrcEvent(RSRC_DENIED); - } - break; - - case LOC_ENG_MSG_ENGINE_DOWN: - loc_eng_handle_engine_down(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_ENGINE_UP: - loc_eng_handle_engine_up(*loc_eng_data_p); - break; - - case LOC_ENG_MSG_LOC_INIT: - { - loc_eng_reinit(*loc_eng_data_p); - } - break; - - case LOC_ENG_MSG_REQUEST_SUPL_ES: - { - loc_eng_msg_request_supl_es *reqMsg = - (loc_eng_msg_request_supl_es *)msg; - AgpsStateMachine *stateMachine = loc_eng_data_p->ds_nif; - DSSubscriber subscriber(stateMachine, reqMsg->handle); - LOC_LOGD("%s:%d]: Starting data call\n", __func__, __LINE__); - stateMachine->subscribeRsrc((Subscriber *)&subscriber); - } - break; - - case LOC_ENG_MSG_CLOSE_DATA_CALL: - { - loc_eng_data_p->client_handle->closeDataCall(); - LOC_LOGD("%s:%d]: Request to close data call\n", - __func__, __LINE__); - } - break; - - default: - LOC_LOGE("unsupported msgid = %d\n", msg->msgid); - break; - } - - if ( (msg->msgid == LOC_ENG_MSG_ATL_OPEN_FAILED) | - (msg->msgid == LOC_ENG_MSG_ATL_CLOSED) | - (msg->msgid == LOC_ENG_MSG_ATL_OPEN_SUCCESS) ) - { - loc_eng_data_p->agps_request_pending = false; - if (loc_eng_data_p->stop_request_pending) { - loc_eng_stop_handler(*loc_eng_data_p); - loc_eng_data_p->stop_request_pending = false; - } - } - loc_eng_data_p->stop_request_pending = false; - - if (loc_eng_data_p->engine_status != GPS_STATUS_ENGINE_ON && - loc_eng_data_p->aiding_data_for_deletion != 0) - { - loc_eng_data_p->client_handle->deleteAidingData(loc_eng_data_p->aiding_data_for_deletion); - loc_eng_data_p->aiding_data_for_deletion = 0; - } - - delete msg; - } - - EXIT_LOG(%s, VOID_RET); -} - /*=========================================================================== FUNCTION loc_eng_ulp_init @@ -2008,7 +2493,7 @@ int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc { // Initialize the ULP interface ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); - loc_eng_data.ulp_initialized = TRUE; + loc_eng_data.ulp_q = (void*)msg_q_init2(); ret_val = 0; } else diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index f9566196..fdda66a2 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -55,9 +55,8 @@ typedef unsigned char boolean; #include #include #include -#include #include -#include +#include // The data connection minimal open time #define DATA_OPEN_MIN_TIME 1 /* sec */ @@ -79,25 +78,10 @@ enum loc_mute_session_e_type { LOC_MUTE_SESS_IN_SESSION }; -struct LocEngContext { - // Data variables used by deferred action thread - const void* deferred_q; - const void* ulp_q; - const pthread_t deferred_action_thread; - static LocEngContext* get(gps_create_thread threadCreator); - void drop(); - static pthread_mutex_t lock; - static pthread_cond_t cond; -private: - int counter; - static LocEngContext *me; - LocEngContext(gps_create_thread threadCreator); -}; - // Module data typedef struct loc_eng_data_s { - LocApiAdapter *client_handle; + LocEngAdapter *adapter; loc_location_cb_ext location_cb; gps_status_callback status_cb; loc_sv_status_cb_ext sv_status_cb; @@ -109,9 +93,6 @@ typedef struct loc_eng_data_s gps_request_utc_time request_utc_time_cb; boolean intermediateFix; AGpsStatusValue agps_status; - // used to defer stopping the GPS engine until AGPS data calls are done - boolean agps_request_pending; - boolean stop_request_pending; loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; @@ -129,8 +110,6 @@ typedef struct loc_eng_data_s // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off GpsAidingData aiding_data_for_deletion; - void* context; - // For muting session broadcast loc_mute_session_e_type mute_session_state; @@ -151,7 +130,10 @@ typedef struct loc_eng_data_s int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; - bool ulp_initialized; + void *ulp_q; + + loc_ext_parser location_ext_parser; + loc_ext_parser sv_ext_parser; } loc_eng_data_s_type; #include "ulp.h" @@ -256,6 +238,7 @@ extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, const void* passThrough); extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); int loc_eng_read_config(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index b7821c9e..d6cc1369 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -33,10 +33,10 @@ #include #include #include -#include "platform_lib_includes.h" +#include #include #include -#include +#include //====================================================================== // C callbacks @@ -109,7 +109,7 @@ bool BITSubscriber::equals(const Subscriber *s) const return (ID == bitS->ID && (INADDR_NONE != (unsigned int)ID || - 0 == strncmp(ipv6Addr, bitS->ipv6Addr, sizeof(ipv6Addr)))); + 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr)))); } bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) @@ -152,13 +152,13 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { case RSRC_UNSUBSCRIBE: case RSRC_RELEASED: - ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); break; case RSRC_DENIED: { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -168,7 +168,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) { AGpsExtType type = mBackwardCompatibleMode ? AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), type); @@ -627,6 +627,7 @@ AgpsStateMachine::AgpsStateMachine(servicerType servType, mStatePtr(new AgpsReleasedState(this)),mType(type), mAPN(NULL), mAPNLen(0), + mBearer(AGPS_APN_BEARER_INVALID), mEnforceSingleSubscriber(enforceSingleSubscriber), mServicer(Servicer :: getServicer(servType, (void *)cb_func)) { @@ -826,7 +827,7 @@ err: } DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, - LocApiAdapter* adapterHandle): + LocEngAdapter* adapterHandle): AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), mLocAdapter(adapterHandle) { @@ -947,17 +948,17 @@ void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const LOC_LOGD("DSStateMachine :: informStatus. Status=%d\n",(int)status); switch(status) { case RSRC_UNSUBSCRIBE: - ((LocApiAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + mLocAdapter->atlCloseStatus(ID, 1); break; case RSRC_RELEASED: - ((LocApiAdapter*)mLocAdapter)->releaseDataHandle(); + mLocAdapter->closeDataCall(); break; case RSRC_DENIED: ((DSStateMachine *)this)->mRetries = 0; mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); break; case RSRC_GRANTED: - ((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + mLocAdapter->atlOpenStatus(ID, 1, NULL, AGPS_APN_BEARER_INVALID, AGPS_TYPE_INVALID); diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 93980f3c..055d955b 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -35,10 +35,11 @@ #include #include #include +#include +#include #include -#include -#include "loc_eng_msg.h" #include +#include // forward declaration class AgpsStateMachine; @@ -62,7 +63,7 @@ typedef enum { //DS Callback struct typedef struct { - LocApiAdapter *mAdapter; + LocEngAdapter *mAdapter; AGpsStatusValue action; }dsCbData; @@ -249,12 +250,12 @@ public: class DSStateMachine : public AgpsStateMachine { static const unsigned char MAX_START_DATA_CALL_RETRIES; static const unsigned int DATA_CALL_RETRY_DELAY_MSEC; - LocApiAdapter* mLocAdapter; + LocEngAdapter* mLocAdapter; unsigned char mRetries; public: DSStateMachine(servicerType type, - void *cb_func, - LocApiAdapter* adapterHandle); + void *cb_func, + LocEngAdapter* adapterHandle); int sendRsrcRequest(AGpsStatusValue action) const; void onRsrcEvent(AgpsRsrcStatus event); void retryCallback(); @@ -297,40 +298,40 @@ struct Subscriber { // 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) { - ipv6Addr[0] = NULL; + mIPv6Addr[0] = 0; } else { - memcpy(ipv6Addr, ipv6, sizeof(ipv6Addr)); + memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr)); } } virtual bool notifyRsrcStatus(Notification ¬ification); inline virtual void setIPAddresses(uint32_t &v4, char* v6) - { v4 = ID; memcpy(v6, ipv6Addr, sizeof(ipv6Addr)); } + { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } virtual Subscriber* clone() { - return new BITSubscriber(mStateMachine, ID, ipv6Addr); + return new BITSubscriber(mStateMachine, ID, mIPv6Addr); } virtual bool equals(const Subscriber *s) const; inline virtual ~BITSubscriber(){} -private: - char ipv6Addr[16]; }; // ATLSubscriber, created with requests from ATL struct ATLSubscriber : public Subscriber { - const LocApiAdapter* mLocAdapter; + const LocEngAdapter* mLocAdapter; const bool mBackwardCompatibleMode; inline ATLSubscriber(const int id, const AgpsStateMachine* stateMachine, - const LocApiAdapter* adapter, + const LocEngAdapter* adapter, const bool compatibleMode) : Subscriber(id, stateMachine), mLocAdapter(adapter), mBackwardCompatibleMode(compatibleMode){} diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index 8176ab43..edd53f21 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -49,24 +49,24 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, } if (NULL != loc_api_handle) { - loc_if_req_type_e_type type; + AGpsExtType type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + type = AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + type = AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_ENG_IF_REQUEST_TYPE_ANY; + type = AGPS_TYPE_ANY; break; } default: @@ -79,48 +79,52 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_SENDER_ID_QUIPC: { LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_wifi *msg( - new loc_eng_msg_request_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_request_bit *msg( - new loc_eng_msg_request_bit(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + 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: @@ -141,24 +145,24 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, { LOC_LOGD("%s:%d]\n", __func__, __LINE__); #ifndef DEBUG_DMN_LOC_API - loc_if_req_type_e_type type; + AGpsExtType type; switch (pmsg->cmsg.cmsg_if_request.type) { case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = LOC_ENG_IF_REQUEST_TYPE_SUPL; + type = AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_ENG_IF_REQUEST_TYPE_WIFI; + type = AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_ENG_IF_REQUEST_TYPE_ANY; + type = AGPS_TYPE_ANY; break; } default: @@ -171,48 +175,52 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_SENDER_ID_QUIPC: { LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_wifi *msg( - new loc_eng_msg_release_wifi(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)); - loc_eng_msg_sender(loc_api_handle, msg); + 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"); - loc_eng_msg_release_bit *msg( - new loc_eng_msg_release_bit(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr)); - loc_eng_msg_sender(loc_api_handle, msg); + 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: diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 877566ed..8c494337 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -30,31 +30,10 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_eng" -#include "hardware/gps.h" #include "loc_log.h" #include "loc_eng_log.h" #include "loc_eng_msg_id.h" -/* GPS status names */ -static 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 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 loc_name_val_s_type loc_eng_msgs[] = { NAME_VAL( LOC_ENG_MSG_QUIT ), @@ -111,183 +90,3 @@ const char* loc_get_msg_name(int id) -static 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 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 loc_name_val_s_type loc_eng_position_recurrences[] = -{ - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) -}; -static 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 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_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) -}; -static 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 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 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 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 ) -}; -static 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 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 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 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 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 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_IPV4 ), - NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) -}; -static 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 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 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 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 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 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 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/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index 95a672fd..ec1b7353 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -36,22 +36,8 @@ extern "C" #endif #include -#include -#include -const char* loc_get_gps_status_name(GpsStatusValue gps_status); const char* loc_get_msg_name(int id); -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 } diff --git a/loc_api/libloc_api_50001/loc_eng_msg.cpp b/loc_api/libloc_api_50001/loc_eng_msg.cpp deleted file mode 100644 index a296dce3..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg.cpp +++ /dev/null @@ -1,133 +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_eng_msg.h" -#include "loc_eng_dmn_conn_glue_msg.h" - -#ifdef _ANDROID_ - -#define LOC_ENG_MSG_REQ_Q_PATH "/data/misc/gpsone_d/loc_eng_msg_req_q" - -#else - -#define LOC_ENG_MSG_REQ_Q_PATH "/tmp/loc_eng_msg_req_q" - -#endif - -int loc_eng_msgget(int * p_req_msgq) -{ - * p_req_msgq = loc_eng_dmn_conn_glue_msgget(LOC_ENG_MSG_REQ_Q_PATH, O_RDWR); - return 0; -} - -int loc_eng_msgremove(int req_msgq) -{ - loc_eng_dmn_conn_glue_piperemove(LOC_ENG_MSG_REQ_Q_PATH, req_msgq); - return 0; -} - -int loc_eng_msgsnd(int msgqid, void * msgp) -{ - int ret = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz) -{ - int result; - - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - 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; -} - -int loc_eng_msgrcv(int msgqid, void ** msgp) -{ - int ret = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(void*)); - return ret; -} - -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz) -{ - int result; - struct msgbuf * pmsg = (struct msgbuf *) msgp; - - if (msgsz < sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] msgbuf is too small %d\n", __func__, __LINE__, msgsz); - return -1; - } - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, sizeof(struct msgbuf)); - if (result != sizeof(struct msgbuf)) { - LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); - return -1; - } - - if (msgsz < pmsg->msgsz) { - LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgsz, (int) pmsg->msgsz); - return -1; - } - - if (pmsg->msgsz > sizeof(struct msgbuf)) { - /* there is msg body */ - msgp += sizeof(struct msgbuf); - - result = loc_eng_dmn_conn_glue_piperead(msgqid, msgp, pmsg->msgsz - sizeof(struct msgbuf)); - - if (result != (int) (pmsg->msgsz - sizeof(struct msgbuf))) { - LOC_LOGE("%s:%d] pipe broken %d, msgid = %p, msgsz = %d\n", __func__, __LINE__, result, - (pmsg->msgid), (int) pmsg->msgsz); - return -1; - } - } - - return pmsg->msgsz; -} - -int loc_eng_msgflush(int msgqid) -{ - return loc_eng_dmn_conn_glue_msgflush(msgqid); -} - -int loc_eng_msgunblock(int msgqid) -{ - return loc_eng_dmn_conn_glue_pipeunblock(msgqid); -} diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 709f65c9..39b0de52 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -31,13 +31,15 @@ #include -#include +#include #include #include -#include "log_util.h" -#include "loc.h" +#include #include -#include "loc_eng_msg_id.h" +#include +#include +#include +#include #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) @@ -53,113 +55,7 @@ extern "C" { #endif /* __cplusplus */ -struct LocPosMode -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval; - uint32_t preferred_accuracy; - uint32_t preferred_time; - char credentials[14]; - char provider[8]; - LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, - uint32_t gap, uint32_t accu, uint32_t time, - const char* cred, const char* prov) : - mode(m), recurrence(recr), - min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), - preferred_accuracy(accu), preferred_time(time) { - 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); - } - } - - LocPosMode() : - mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), - min_interval(MIN_POSSIBLE_FIX_INTERVAL), preferred_accuracy(50), preferred_time(120000) { - 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); - } - - inline void 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); - } -}; - -/** 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 - -/** 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; -} GpsLocationExtended; - -typedef enum { - LOC_ENG_IF_REQUEST_TYPE_SUPL = 0, - LOC_ENG_IF_REQUEST_TYPE_WIFI, - LOC_ENG_IF_REQUEST_TYPE_ANY -} loc_if_req_type_e_type; - -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; +using namespace loc_core; struct loc_eng_msg { const void* owner; @@ -176,153 +72,6 @@ struct loc_eng_msg { } }; -struct loc_eng_msg_a_glonass_protocol : public loc_eng_msg { - const unsigned long a_glonass_protocol; - inline loc_eng_msg_a_glonass_protocol(void* instance, unsigned long protocol) : - loc_eng_msg(instance, LOC_ENG_MSG_A_GLONASS_PROTOCOL), - a_glonass_protocol(protocol) - { - LOC_LOGV("A-GLONASS protocol: 0x%lx", protocol); - } -}; - -struct loc_eng_msg_suple_version : public loc_eng_msg { - const int supl_version; - inline loc_eng_msg_suple_version(void* instance, int version) : - loc_eng_msg(instance, LOC_ENG_MSG_SUPL_VERSION), - supl_version(version) - { - LOC_LOGV("SUPL Version: %d", version); - } -}; - -struct loc_eng_msg_lpp_config : public loc_eng_msg { - const int lpp_config; - inline loc_eng_msg_lpp_config(void *instance, int profile) : - loc_eng_msg(instance, LOC_ENG_MSG_LPP_CONFIG), - lpp_config(profile) - { - LOC_LOGV("lpp profile: %d", profile); - } -}; - -struct loc_eng_msg_ext_power_config : public loc_eng_msg { - const int isBatteryCharging; - inline loc_eng_msg_ext_power_config(void* instance, int isBattCharging) : - loc_eng_msg(instance, LOC_ENG_MSG_EXT_POWER_CONFIG), - isBatteryCharging(isBattCharging) - { - LOC_LOGV("isBatteryCharging: %d", isBatteryCharging); - } -}; - -struct loc_eng_msg_sensor_control_config : public loc_eng_msg { - const int sensorsDisabled; - inline loc_eng_msg_sensor_control_config(void* instance, int disabled) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG), - sensorsDisabled(disabled) - { - LOC_LOGV("Sensors Disabled: %d", disabled); - } -}; - -struct loc_eng_msg_sensor_properties : public loc_eng_msg { - const bool gyroBiasVarianceRandomWalk_valid; - const float gyroBiasVarianceRandomWalk; - const bool accelRandomWalk_valid; - const float accelRandomWalk; - const bool angleRandomWalk_valid; - const float angleRandomWalk; - const bool rateRandomWalk_valid; - const float rateRandomWalk; - const bool velocityRandomWalk_valid; - const float velocityRandomWalk; - inline loc_eng_msg_sensor_properties(void* instance, 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) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PROPERTIES), - gyroBiasVarianceRandomWalk_valid(gyroBiasRandomWalk_valid), - gyroBiasVarianceRandomWalk(gyroBiasRandomWalk), - accelRandomWalk_valid(accelRandomWalk_valid), - accelRandomWalk(accelRandomWalk), - angleRandomWalk_valid(angleRandomWalk_valid), - angleRandomWalk(angleRandomWalk), - rateRandomWalk_valid(rateRandomWalk_valid), - rateRandomWalk(rateRandomWalk), - velocityRandomWalk_valid(velocityRandomWalk_valid), - velocityRandomWalk(velocityRandomWalk) - { - 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", - gyroBiasRandomWalk_valid, - accelRandomWalk_valid, - angleRandomWalk_valid, - rateRandomWalk_valid, - velocityRandomWalk_valid - ); - LOC_LOGV("Sensor properties, Gyro Random walk: %f Accel Random Walk: %f " - "Angle Random Walk: %f Rate Random Walk: %f " - "Velocity Random Walk: %f", - gyroBiasRandomWalk, - accelRandomWalk, - angleRandomWalk, - rateRandomWalk, - velocityRandomWalk - ); - } -}; - -struct loc_eng_msg_sensor_perf_control_config : public loc_eng_msg { - const int controlMode; - const int accelSamplesPerBatch; - const int accelBatchesPerSec; - const int gyroSamplesPerBatch; - const int gyroBatchesPerSec; - const int accelSamplesPerBatchHigh; - const int accelBatchesPerSecHigh; - const int gyroSamplesPerBatchHigh; - const int gyroBatchesPerSecHigh; - const int algorithmConfig; - inline loc_eng_msg_sensor_perf_control_config(void* instance, int controlMode, - int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, - int algorithmConfig) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG), - controlMode(controlMode), - accelSamplesPerBatch(accelSamplesPerBatch), - accelBatchesPerSec(accelBatchesPerSec), - gyroSamplesPerBatch(gyroSamplesPerBatch), - gyroBatchesPerSec(gyroBatchesPerSec), - accelSamplesPerBatchHigh(accelSamplesPerBatchHigh), - accelBatchesPerSecHigh(accelBatchesPerSecHigh), - gyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), - gyroBatchesPerSecHigh(gyroBatchesPerSecHigh), - algorithmConfig(algorithmConfig) - { - 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", - controlMode, - accelSamplesPerBatch, - accelBatchesPerSec, - gyroSamplesPerBatch, - gyroBatchesPerSec, - accelSamplesPerBatchHigh, - accelBatchesPerSecHigh, - gyroSamplesPerBatchHigh, - gyroBatchesPerSecHigh, - algorithmConfig - ); - } -}; - - struct loc_eng_msg_position_mode : public loc_eng_msg { const LocPosMode pMode; inline loc_eng_msg_position_mode(void* instance, @@ -334,45 +83,6 @@ struct loc_eng_msg_position_mode : public loc_eng_msg { } }; -struct loc_eng_msg_set_time : public loc_eng_msg { - const GpsUtcTime time; - const int64_t timeReference; - const int uncertainty; - inline loc_eng_msg_set_time(void* instance, - GpsUtcTime t, - int64_t tf, - int unc) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_TIME), - time(t), timeReference(tf), uncertainty(unc) - { - LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", - time, timeReference, uncertainty); - } -}; - -struct loc_eng_msg_inject_location : public loc_eng_msg { - const double latitude; - const double longitude; - const float accuracy; - inline loc_eng_msg_inject_location(void* instance, double lat, - double longi, float accur) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_LOCATION), - latitude(lat), longitude(longi), accuracy(accur) - { - LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", - latitude, longitude, accuracy); - } -}; - -struct loc_eng_msg_delete_aiding_data : public loc_eng_msg { - const GpsAidingData type; - inline loc_eng_msg_delete_aiding_data(void* instance, GpsAidingData data) : - loc_eng_msg(instance, LOC_ENG_MSG_DELETE_AIDING_DATA), type(data) - { - LOC_LOGV("aiding data msak %d", type); - } -}; - struct loc_eng_msg_report_position : public loc_eng_msg { const UlpLocation location; const GpsLocationExtended locationExtended; @@ -427,438 +137,232 @@ struct loc_eng_msg_report_sv : public loc_eng_msg { } }; -struct loc_eng_msg_report_status : public loc_eng_msg { - const GpsStatusValue status; - inline loc_eng_msg_report_status(void* instance, GpsStatusValue engineStatus) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_STATUS), status(engineStatus) - { - LOC_LOGV("status: %s", loc_get_gps_status_name(status)); - } -}; -struct loc_eng_msg_report_nmea : public loc_eng_msg { - char* const nmea; - const int length; - inline loc_eng_msg_report_nmea(void* instance, - const char* data, - int len) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_NMEA), - nmea(new char[len]), length(len) - { - memcpy((void*)nmea, (void*)data, len); - LOC_LOGV("length: %d\n nmea: %p - %c%c%c", - length, nmea, nmea[3], nmea[4], nmea[5]); - } - inline ~loc_eng_msg_report_nmea() - { - delete[] nmea; - } -}; - -struct loc_eng_msg_report_xtra_server : public loc_eng_msg { - char *server1; - char *server2; - char *server3; - inline loc_eng_msg_report_xtra_server(void *instance, - const char *url1, - const char *url2, - const char *url3, - const int maxlength) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_XTRA_SERVER), - server1(new char[maxlength+1]), server2(new char[maxlength+1]), server3(new char[maxlength+1]) - { - strlcpy(server1, url1, maxlength); - strlcpy(server2, url2, maxlength); - strlcpy(server3, url3, maxlength); - - LOC_LOGV("maxlength: %d\n server1: %s\n server2: %s\n server3: %s\n", - maxlength, server1, server2, server3); - } - inline ~loc_eng_msg_report_xtra_server() - { - delete[] server1; - delete[] server2; - delete[] server3; - } -}; - -struct loc_eng_msg_request_bit : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_request_bit(void* instance, - loc_if_req_type_e_type type, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_BIT), - ifType(type), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, - (unsigned char)(ipv4>>24), - (unsigned char)(ipv4>>16), - (unsigned char)(ipv4>>8), - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_request_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_request_wifi : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const loc_if_req_sender_id_e_type senderId; - char* const ssid; - char* const password; - inline loc_eng_msg_request_wifi(void* instance, - loc_if_req_type_e_type type, - loc_if_req_sender_id_e_type sender_id, - char* s, - char* p) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_WIFI), - ifType(type), senderId(sender_id), - ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), - password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) - { - if (NULL != ssid) - strlcpy(ssid, s, SSID_BUF_SIZE); - if (NULL != password) - strlcpy(password, p, SSID_BUF_SIZE); - LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", - ifType, - senderId, - NULL != ssid ? ssid : "", - NULL != password ? password : ""); - } - - inline ~loc_eng_msg_request_wifi() - { - if (NULL != ssid) { - delete[] ssid; - } - if (NULL != password) { - delete[] password; - } - } -}; - -struct loc_eng_msg_release_bit : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const int ipv4Addr; - char* const ipv6Addr; - inline loc_eng_msg_release_bit(void* instance, - loc_if_req_type_e_type type, - int ipv4, - char* ipv6) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_BIT), - ifType(type), ipv4Addr(ipv4), - ipv6Addr(NULL == ipv6 ? NULL : new char[16]) - { - if (NULL != ipv6Addr) - memcpy(ipv6Addr, ipv6, 16); - LOC_LOGV("ifType: %d, ipv4: %d.%d.%d.%d, ipv6: %s", ifType, - (unsigned char)(ipv4>>24), - (unsigned char)(ipv4>>16), - (unsigned char)(ipv4>>8), - (unsigned char)ipv4, - NULL != ipv6Addr ? ipv6Addr : ""); - } - - inline ~loc_eng_msg_release_bit() - { - if (NULL != ipv6Addr) { - delete[] ipv6Addr; - } - } -}; - -struct loc_eng_msg_release_wifi : public loc_eng_msg { - const loc_if_req_type_e_type ifType; - const loc_if_req_sender_id_e_type senderId; - char* const ssid; - char* const password; - inline loc_eng_msg_release_wifi(void* instance, - loc_if_req_type_e_type type, - loc_if_req_sender_id_e_type sender_id, - char* s, - char* p) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_WIFI), - ifType(type), senderId(sender_id), - ssid(NULL == s ? NULL : new char[SSID_BUF_SIZE]), - password(NULL == p ? NULL : new char[SSID_BUF_SIZE]) - { - if (NULL != s) - strlcpy(ssid, s, SSID_BUF_SIZE); - if (NULL != p) - strlcpy(password, p, SSID_BUF_SIZE); - LOC_LOGV("ifType: %d, senderId: %d, ssid: %s, password: %s", - ifType, - senderId, - NULL != ssid ? ssid : "", - NULL != password ? password : ""); - } - - inline ~loc_eng_msg_release_wifi() - { - if (NULL != ssid) { - delete[] ssid; - } - if (NULL != password) { - delete[] password; - } - } -}; - -struct loc_eng_msg_request_atl : public loc_eng_msg { - const int handle; - const AGpsType type; - inline loc_eng_msg_request_atl(void* instance, int hndl, - AGpsType agps_type) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_ATL), - handle(hndl), type(agps_type) - { - LOC_LOGV("handle: %d\n agps type: %s", - handle, - loc_get_agps_type_name(type)); - } -}; - -struct loc_eng_msg_request_supl_es : public loc_eng_msg { - const int handle; - inline loc_eng_msg_request_supl_es(void* instance, int hndl) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_SUPL_ES), - handle(hndl) - { - LOC_LOGV("handle: %d\n", handle); - } -}; - -struct loc_eng_msg_close_data_call: public loc_eng_msg { - inline loc_eng_msg_close_data_call(void *instance) : - loc_eng_msg(instance, LOC_ENG_MSG_CLOSE_DATA_CALL) - { - LOC_LOGV("%s:%d]Close data call: ", __func__, __LINE__); - } -}; -struct loc_eng_msg_release_atl : public loc_eng_msg { - const int handle; - inline loc_eng_msg_release_atl(void* instance, int hndl) : - loc_eng_msg(instance, LOC_ENG_MSG_RELEASE_ATL), handle(hndl) - { - LOC_LOGV("handle: %d", handle); - } -}; - -struct loc_eng_msg_request_ni : public loc_eng_msg { - const GpsNiNotification notify; - const void *passThroughData; - inline loc_eng_msg_request_ni(void* instance, - GpsNiNotification ¬if, const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_NI), - notify(notif), passThroughData(data) - { - 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", - notify.notification_id, - loc_get_ni_type_name(notify.ni_type), - notify.notify_flags, - notify.timeout, - loc_get_ni_response_name(notify.default_response), - loc_get_ni_encoding_name(notify.requestor_id_encoding), - loc_get_ni_encoding_name(notify.text_encoding), - passThroughData); - } -}; - -struct loc_eng_msg_inform_ni_response : public loc_eng_msg { - const GpsUserResponseType response; - const void *passThroughData; - inline loc_eng_msg_inform_ni_response(void* instance, - GpsUserResponseType resp, - const void* data) : - loc_eng_msg(instance, LOC_ENG_MSG_INFORM_NI_RESPONSE), - response(resp), passThroughData(data) - { - LOC_LOGV("response: %s\n passThroughData: %p", - loc_get_ni_response_name(response), - passThroughData); - } - inline ~loc_eng_msg_inform_ni_response() - { - // this is a bit weird since passThroughData is not - // allocated by this class. But there is no better way. - // passThroughData actually won't be NULL here. - // But better safer than sorry. - if (NULL != passThroughData) { - free((void*)passThroughData); - } - } -}; - -struct loc_eng_msg_set_apn : public loc_eng_msg { - char* const apn; - inline loc_eng_msg_set_apn(void* instance, const char* name, int len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_APN), - apn(new char[len+1]) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s", apn); - } - inline ~loc_eng_msg_set_apn() - { - delete[] apn; - } +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 loc_eng_msg_set_server_ipv4 : public loc_eng_msg { - const unsigned int nl_addr; - const int port; - const LocServerType serverType; - inline loc_eng_msg_set_server_ipv4(void* instance, - unsigned int ip, - int p, - LocServerType type) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_IPV4), - nl_addr(ip), port(p), serverType(type) - { - LOC_LOGV("addr: %x\n , port: %d\n type: %s", nl_addr, port, loc_get_server_type_name(serverType)); - } +struct LocEngStartFix : public LocMsg { + loc_eng_data_s_type* mLocEng; + LocEngStartFix(loc_eng_data_s_type* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; - -struct loc_eng_msg_set_server_url : public loc_eng_msg { - const int len; - char* const url; - inline loc_eng_msg_set_server_url(void* instance, - const char* urlString, - int url_len) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_SERVER_URL), - len(url_len), url(new char[len+1]) - { - memcpy((void*)url, (void*)urlString, url_len); - url[len] = 0; - LOC_LOGV("url: %s", url); - } - inline ~loc_eng_msg_set_server_url() - { - delete[] url; - } +struct LocEngStopFix : public LocMsg { + loc_eng_data_s_type* mLocEng; + LocEngStopFix(loc_eng_data_s_type* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; -struct loc_eng_msg_inject_xtra_data : public loc_eng_msg { - char* const data; - const int length; - inline loc_eng_msg_inject_xtra_data(void* instance, char* d, int l) : - loc_eng_msg(instance, LOC_ENG_MSG_INJECT_XTRA_DATA), - data(new char[l]), length(l) - { - memcpy((void*)data, (void*)d, l); - LOC_LOGV("length: %d\n data: %p", length, data); - } - inline ~loc_eng_msg_inject_xtra_data() - { - delete[] data; - } +struct LocEngReportPosition : public LocMsg { + void* mLocEng; + const UlpLocation mLocation; + const GpsLocationExtended mLocationExtended; + const void* mLocationExt; + const enum loc_sess_status mStatus; + const LocPosTechMask mTechMask; + LocEngReportPosition(void* locEng, + 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 loc_eng_msg_request_xtra_server : public loc_eng_msg { - inline loc_eng_msg_request_xtra_server(void *instance) : - loc_eng_msg(instance, LOC_ENG_MSG_REQUEST_XTRA_SERVER) - { - - } +struct LocEngReportSv : public LocMsg { + void* mLocEng; + const GpsSvStatus mSvStatus; + const GpsLocationExtended mLocationExtended; + const void* mSvExt; + LocEngReportSv(void* locEng, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExtended); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; }; -struct loc_eng_msg_atl_open_success : public loc_eng_msg { - const AGpsType agpsType; - const int length; - char* const apn; - const AGpsBearerType bearerType; - inline loc_eng_msg_atl_open_success(void* instance, - AGpsType atype, - const char* name, - int len, - AGpsBearerType btype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS), - agpsType(atype), length(len), - apn(new char[len+1]), bearerType(btype) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("agps type: %s\n apn: %s\n bearer type: %s", - loc_get_agps_type_name(agpsType), - apn, - loc_get_agps_bear_name(bearerType)); - } - inline ~loc_eng_msg_atl_open_success() - { - delete[] apn; - } +struct LocEngReportStatus : public LocMsg { + void* mLocEng; + const GpsStatusValue mStatus; + LocEngReportStatus(void* locEng, + GpsStatusValue engineStatus); + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_atl_open_failed : public loc_eng_msg { - const AGpsStatusValue agpsType; - inline loc_eng_msg_atl_open_failed(void* instance, - AGpsStatusValue atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED), - agpsType(atype) +struct LocEngReportNmea : public LocMsg { + void* mLocEng; + char* const mNmea; + const int mLen; + LocEngReportNmea(void* locEng, + const char* data, int len); + inline virtual ~LocEngReportNmea() { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); + delete[] mNmea; } + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_atl_closed : public loc_eng_msg { - const AGpsType agpsType; - inline loc_eng_msg_atl_closed(void* instance, - AGpsType atype) : - loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED), - agpsType(atype) +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() { - LOC_LOGV("agps type %s", - loc_get_agps_type_name(agpsType)); + delete[] mServers; } + virtual void proc() const; + void locallog() const; + virtual void log() const; }; -struct loc_eng_msg_set_data_enable : public loc_eng_msg { - const int enable; - char* const apn; - const int length; - inline loc_eng_msg_set_data_enable(void* instance, - const char* name, - int len, - int yes) : - loc_eng_msg(instance, LOC_ENG_MSG_ENABLE_DATA), - enable(yes), apn(new char[len+1]), length(len) - { - memcpy((void*)apn, (void*)name, len); - apn[len] = 0; - LOC_LOGV("apn: %s\n enable: %d", apn, enable); - } - inline ~loc_eng_msg_set_data_enable() - { - delete[] apn; - } +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; }; -void loc_eng_msg_sender(void* loc_eng_data_p, void* msg); -int loc_eng_msgget(int * p_req_msgq); -int loc_eng_msgremove(int req_msgq); -int loc_eng_msgsnd(int msgqid, void * msgp); -int loc_eng_msgrcv(int msgqid, void ** msgp); -int loc_eng_msgsnd_raw(int msgqid, void * msgp, unsigned int msgsz); -int loc_eng_msgrcv_raw(int msgqid, void *msgp, unsigned int msgsz); -int loc_eng_msgflush(int msgqid); -int loc_eng_msgunblock(int msgqid); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index e9ba91d0..f017cab6 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -39,11 +39,15 @@ #include #include #include +#include #include #include "log_util.h" #include "platform_lib_includes.h" + +using namespace loc_core; + /*============================================================================= * * DATA DECLARATION @@ -57,6 +61,42 @@ *============================================================================*/ 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 @@ -179,15 +219,15 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ // adding this check to support modem restart, in which case, we need the thread - // to exit without calling sending data to loc_eng_msg_q. We made sure that - // rawRequest is NULL in loc_eng_ni_reset_on_engine_restart() - loc_eng_msg_inform_ni_response *msg = NULL; + // to exit without calling sending data. We made sure that rawRequest is NULL in + // loc_eng_ni_reset_on_engine_restart() + LocEngAdapter* adapter = loc_eng_data_p->adapter; + LocEngInformNiResponse *msg = NULL; if (NULL != loc_eng_ni_data_p->rawRequest) { - loc_eng_data_s_type *loc_eng_data_p = (loc_eng_data_s_type*)args; - msg = new loc_eng_msg_inform_ni_response(loc_eng_data_p, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + msg = new LocEngInformNiResponse(adapter, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); loc_eng_ni_data_p->rawRequest = NULL; } pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); @@ -196,7 +236,7 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->reqID++; if (NULL != msg) { - loc_eng_msg_sender(loc_eng_data_p, msg); + adapter->sendMsg(msg); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index c4be2ab8..f5f746b2 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -259,7 +259,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 @@ -412,7 +412,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 @@ -490,7 +490,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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->client_handle->getPositionMode().mode) + 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 diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 5c030b0b..45822867 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -31,10 +31,57 @@ #define LOG_TAG "LocSvc_eng" #include -#include +#include #include "log_util.h" #include "platform_lib_includes.h" +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(); + } +}; + /*=========================================================================== FUNCTION loc_eng_xtra_init @@ -89,9 +136,8 @@ SIDE EFFECTS int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { - loc_eng_msg_inject_xtra_data *msg(new loc_eng_msg_inject_xtra_data(&loc_eng_data, - data, length)); - loc_eng_msg_sender(&loc_eng_data, msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); return 0; } @@ -113,12 +159,8 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) { - loc_eng_msg_request_xtra_server *msg(new loc_eng_msg_request_xtra_server(&loc_eng_data)); - - if (NULL == msg) - return -1; - - loc_eng_msg_sender(&loc_eng_data, msg); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngRequestXtraServer(adapter)); return 0; From 3535edcfb0def6f298eea21f51fc91103004c984 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sat, 20 Jul 2013 14:16:32 -0700 Subject: [PATCH 152/945] corresponding to izat_core and LBSAdapter changes. Removed makefile dependency to AndrodRuntime; Renamed library to be loaded from liblocation to libizat_core; Made some class private access to protected for the needs of inheritance; piggy bagged some optimizations. Change-Id: Id7e3127baa1833cbad7739f50808941c733b87f2 (cherry picked from commit c039ceaec84b25573d710b31831c9b06d4f3d1c6) --- core/Android.mk | 3 +- core/ContextBase.cpp | 2 +- core/ContextBase.h | 3 +- core/LocAdapterBase.cpp | 8 ---- core/LocApiBase.cpp | 10 ----- core/LocApiBase.h | 14 ++++++- core/LocDualContext.cpp | 37 ++++++++++++++++++- core/LocDualContext.h | 6 +++ .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 6 ++- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 3 +- loc_api/libloc_api_50001/loc_eng.cpp | 8 ++-- 11 files changed, 67 insertions(+), 33 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index f9074dbd..bb222b87 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -13,8 +13,7 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ libgps.utils \ - libdl \ - libandroid_runtime + libdl LOCAL_SRC_FILES += \ MsgTask.cpp \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 7922cc21..3ab364f3 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -39,7 +39,7 @@ namespace loc_core { -const char* ContextBase::mIzatLibName = "libloc_api_v02.so "; +const char* ContextBase::mIzatLibName = "libizat_core.so"; // we initialized this handle to 1 because it can't possibly // 1 if it ever gets assigned a value. NULL on the otherhand // is possilbe. diff --git a/core/ContextBase.h b/core/ContextBase.h index b04def33..6ad9cad1 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -45,12 +45,11 @@ protected: const MsgTask* mMsgTask; LocApiBase* mLocApi; -protected: +public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask); inline virtual ~ContextBase() { delete mLocApi; } -public: static void* getIzatLibHandle(); inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 27b9f61f..48d179f5 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -68,14 +68,6 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, sendMsg(new LocOpenMsg(this, mLocApi)); } -// This will be overridden by the individual adapters -// if necessary. -#define DEFAULT_IMPL(rtv) \ -{ \ - LOC_LOGW("%s: default implementation invoked", __func__); \ - return rtv; \ -} - void LocAdapterBase:: handleEngineDownEvent() DEFAULT_IMPL() diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c6fef931..11d2ccb6 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -328,16 +328,6 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } - -// downward calls -// All below functions are to be defined by adapter specific modules: -// RPC, QMI, etc. The default implementation is empty. -#define DEFAULT_IMPL(rtv) \ -{ \ - LOC_LOGW("%s: default implementation invoked", __func__); \ - return rtv; \ -} - enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index c027b3f8..3676bff6 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -37,6 +37,14 @@ #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_LOGW("%s: default implementation invoked", __func__); \ + return rtv; \ +} + namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -122,20 +130,20 @@ class LocApiBase { friend class ContextBase; const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask; const MsgTask* mMsgTask; + LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; static LocApiBase* create(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, void* libHandle); +protected: virtual enum loc_api_adapter_err open(LOC_API_ADAPTER_EVENT_MASK_T mask); virtual enum loc_api_adapter_err close(); LOC_API_ADAPTER_EVENT_MASK_T getEvtMask(); - -protected: LOC_API_ADAPTER_EVENT_MASK_T mMask; LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask); @@ -143,6 +151,8 @@ protected: bool isInSession(); public: + inline virtual void* getSibling() { return NULL; } + void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 2218621e..a62a7007 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -70,6 +70,15 @@ const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, return mMsgTask; } +const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tAssociate, name); + } + return mMsgTask; +} + ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, const char* name) { @@ -81,6 +90,18 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, return mFgContext; } +ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mFgContext) { + const MsgTask* msgTask = getMsgTask(tAssociate, name); + mFgContext = new LocDualContext(msgTask, + mFgExclMask); + } + return mFgContext; + +} + ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, const char* name) { @@ -92,6 +113,18 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, return mBgContext; } +ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mBgContext) { + const MsgTask* msgTask = getMsgTask(tAssociate, name); + mBgContext = new LocDualContext(msgTask, + mBgExclMask); + } + return mBgContext; +} + + bool LocDualContext::hasAgpsExt() { if (0xff == mHasAgpsExt) { @@ -99,8 +132,8 @@ bool LocDualContext::hasAgpsExt() void* handle = ContextBase::getIzatLibHandle(); if (NULL != handle) { bool(*getter)() = (bool(*)())dlsym(handle, "hasAgpsExt"); - if (NULL != getter && (*getter)()) { - mHasAgpsExt = 1; + if (NULL != getter) { + mHasAgpsExt = (*getter)(); } } } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 4e03bf44..488f5aa3 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -44,6 +44,8 @@ class LocDualContext : public ContextBase { static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, const char* name); + static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, + const char* name); protected: LocDualContext(const MsgTask* msgTask, @@ -57,8 +59,12 @@ public: static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, const char* name); + static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, + const char* name); static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, const char* name); + static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, + const char* name); static bool hasAgpsExt(); }; diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index fef42199..1b4f3f74 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -38,8 +38,11 @@ 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]; @@ -58,6 +61,7 @@ class LocApiRpc : public LocApiBase { 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 @@ -68,7 +72,7 @@ public: LOC_API_ADAPTER_EVENT_MASK_T exMask); ~LocApiRpc(); - int locEventCB(rpc_loc_client_handle_type client_handle, + 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); diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 879244da..428d5a20 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -128,7 +128,8 @@ const rpc_loc_event_mask_type LocApiRpc::locBits[] = 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_STATUS_REPORT, + RPC_LOC_EVENT_WPS_NEEDED_REQUEST }; // constructor diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index ff5fd63c..15f20cbb 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -878,8 +878,8 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, mServers(new char[3*(mMaxLen+1)]) { strlcpy(mServers, url1, mMaxLen); - strlcpy(&mServers[mMaxLen], url2, mMaxLen); - strlcpy(&mServers[mMaxLen<<1], url3, mMaxLen); + strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen); + strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen); locallog(); } void LocEngReportXtraServer::proc() const { @@ -889,8 +889,8 @@ void LocEngReportXtraServer::proc() const { if (locEngXtra->report_xtra_server_cb != NULL) { CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, mServers); locEngXtra->report_xtra_server_cb(mServers, - &mServers[mMaxLen], - &mServers[mMaxLen<<1]); + &(mServers[mMaxLen+1]), + &(mServers[(mMaxLen+1)<<1])); } else { LOC_LOGE("Callback function for request xtra is NULL"); } From 61fedb45674644dfc549aaaffa70fbee4a7bd4e0 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 24 Jul 2013 13:15:12 -0700 Subject: [PATCH 153/945] removed ulp dependency. ULP will no longer be loaded and init'ed from loc eng HAL. GPS HAL will look for ULP once it completes init and waits for a msg back once it hears from ULP. This is done with introduction of UlpProxy. Default proxy is a no op proxy. Change-Id: If0be0b5744f9de20f12c2f0b9704dea66aa454c0 (cherry picked from commit 2eb4ddcae94283df6c6be450c4c070ffd8ff9cd7) --- core/Android.mk | 2 + core/ContextBase.cpp | 56 ++- core/ContextBase.h | 17 +- loc_api/ulp/inc/ulp.h => core/IzatProxyBase.h | 53 ++- core/LocAdapterBase.h | 10 +- core/LocApiBase.cpp | 36 -- core/LocApiBase.h | 74 ---- core/LocDualContext.cpp | 22 +- core/LocDualContext.h | 4 +- core/UlpProxyBase.h | 63 ++++ core/gps_extended_c.h | 71 ++++ loc_api/libloc_api_50001/Android.mk | 7 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 103 ++++-- loc_api/libloc_api_50001/LocEngAdapter.h | 39 +- loc_api/libloc_api_50001/Makefile.am | 5 +- loc_api/libloc_api_50001/loc.cpp | 334 +++--------------- loc_api/libloc_api_50001/loc.h | 2 - loc_api/libloc_api_50001/loc_eng.cpp | 141 +++----- loc_api/libloc_api_50001/loc_eng.h | 7 +- loc_api/libloc_api_50001/loc_eng_log.cpp | 57 --- loc_api/libloc_api_50001/loc_eng_log.h | 2 - loc_api/libloc_api_50001/loc_eng_msg.h | 101 +----- loc_api/libloc_api_50001/loc_eng_msg_id.h | 114 ------ 23 files changed, 454 insertions(+), 866 deletions(-) rename loc_api/ulp/inc/ulp.h => core/IzatProxyBase.h (65%) create mode 100644 core/UlpProxyBase.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg_id.h diff --git a/core/Android.mk b/core/Android.mk index bb222b87..ef0dd385 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -37,6 +37,8 @@ LOCAL_COPY_HEADERS:= \ LocAdapterBase.h \ ContextBase.h \ LocDualContext.h \ + IzatProxyBase.h \ + UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ loc_core_log.h diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 3ab364f3..1826ec79 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -34,29 +34,63 @@ #include #include #include +#include #include #include namespace loc_core { -const char* ContextBase::mIzatLibName = "libizat_core.so"; -// we initialized this handle to 1 because it can't possibly -// 1 if it ever gets assigned a value. NULL on the otherhand -// is possilbe. -void* ContextBase::mIzatLibHandle = (void*)1; -void* ContextBase::getIzatLibHandle() +IzatProxyBase* ContextBase::getIzatProxy(const char* libName) { - if ((void*)1 == mIzatLibHandle) { - mIzatLibHandle = dlopen(mIzatLibName, RTLD_NOW); + IzatProxyBase* proxy = NULL; + void* lib = dlopen(libName, RTLD_NOW); + + if ((void*)NULL != lib) { + getIzatProxy_t* getter = (getIzatProxy_t*)dlsym(lib, "getIzatProxy"); + if (NULL != getter) { + proxy = (*getter)(); + } } - return mIzatLibHandle; + if (NULL == proxy) { + proxy = new IzatProxyBase(); + } + return proxy; +} + +LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) +{ + LocApiBase* locApi = NULL; + + // first if can not be MPQ + if (TARGET_MPQ != get_target()) { + if (NULL == (locApi = mIzatProxy->getLocApi(mMsgTask, exMask))) { + // only RPC is the option now + void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if (NULL != getter) { + locApi = (*getter)(mMsgTask, exMask); + } + } + } + } + + // locApi could still be NULL at this time + // we would then create a dummy one + if (NULL == locApi) { + locApi = new LocApiBase(mMsgTask, exMask); + } + + return locApi; } ContextBase::ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : + LOC_API_ADAPTER_EVENT_MASK_T exMask, + const char* libName) : + mIzatProxy(getIzatProxy(libName)), mMsgTask(msgTask), - mLocApi(LocApiBase::create(mMsgTask, exMask, getIzatLibHandle())) + mLocApi(createLocApi(exMask)) { } diff --git a/core/ContextBase.h b/core/ContextBase.h index 6ad9cad1..fc60db42 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -33,26 +33,33 @@ #include #include #include +#include namespace loc_core { class LocAdapterBase; class ContextBase { - static const char* mIzatLibName; - static void* mIzatLibHandle; + static IzatProxyBase* getIzatProxy(const char* libName); + LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); protected: + const IzatProxyBase* mIzatProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; public: ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - inline virtual ~ContextBase() { delete mLocApi; } + LOC_API_ADAPTER_EVENT_MASK_T exMask, + const char* libName); + inline virtual ~ContextBase() { delete mLocApi; delete mIzatProxy; } - static void* getIzatLibHandle(); inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } + inline bool hasAgpsExt() { return mIzatProxy->hasAgpsExt(); } + inline void requestUlp(LocAdapterBase* adapter, + unsigned long capabilities) { + mIzatProxy->requestUlp(adapter, capabilities); + } }; } // namespace loc_core diff --git a/loc_api/ulp/inc/ulp.h b/core/IzatProxyBase.h similarity index 65% rename from loc_api/ulp/inc/ulp.h rename to core/IzatProxyBase.h index 3a2e8e32..e7e3d3fa 100644 --- a/loc_api/ulp/inc/ulp.h +++ b/core/IzatProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -26,36 +26,35 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#ifndef IZAT_PROXY_BASE_H +#define IZAT_PROXY_BASE_H -#ifndef ULP_H -#define ULP_H +#include +#include -#ifdef __cplusplus -extern "C" -{ -#endif +namespace loc_core { -#include -struct loc_eng_data_s; +class LocApiBase; +class LocAdapterBase; -/** Represents the standard ulp module interface. */ -typedef struct { - /** set to sizeof(ulpInterface) */ - size_t size; +class IzatProxyBase { + friend class ContextBase; + inline virtual LocApiBase* + getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) const { + return NULL; + } +protected: + inline IzatProxyBase() {} +public: + inline virtual ~IzatProxyBase() {} + inline virtual void requestUlp(LocAdapterBase* adapter, + unsigned long capabilities) const {} + inline virtual bool hasAgpsExt() const { return false; } +}; - /** - * Starts the libulp module. 0: success - */ - int (*init)(struct loc_eng_data_s &loc_eng_data); - /** Get a pointer to extension information. */ - const void* (*get_extension)(const char* name); +typedef IzatProxyBase* (getIzatProxy_t)(); -}ulpInterface; - -typedef const ulpInterface* (get_ulp_interface) (void); - -#ifdef __cplusplus -} -#endif -#endif /* ULP_H */ +} // namespace loc_core +#endif // IZAT_PROXY_BASE_H diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index aca70f59..f279f9fd 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -30,6 +30,7 @@ #define LOC_API_ADAPTER_BASE_H #include +#include #include namespace loc_core { @@ -41,6 +42,9 @@ protected: LocApiBase* mLocApi; const MsgTask* mMsgTask; + inline LocAdapterBase(const MsgTask* msgTask) : + mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context); inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } @@ -65,8 +69,12 @@ public: // This will be overridden by the individual adapters // if necessary. + inline virtual void setUlpProxy(UlpProxyBase* ulp) {} inline virtual void handleEngineUpEvent() {} - virtual void handleEngineDownEvent() ; + virtual void handleEngineDownEvent(); + inline virtual void setPositionModeInt(LocPosMode& posMode) {} + virtual void startFixInt() {} + virtual void stopFixInt() {} virtual void reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 11d2ccb6..f50d3e14 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include namespace loc_core { @@ -104,41 +103,6 @@ struct LocSsrMsg : public LocMsg { } }; -LocApiBase* LocApiBase::create(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - void* libHandle) -{ - LocApiBase* locApi = NULL; - - // first if can not be MPQ - if (TARGET_MPQ != get_target()) { - getLocApi_t* getter = NULL; - // needto check if locaction.so exists - void* handle = ContextBase::getIzatLibHandle(); - - if (NULL == handle || - NULL == (getter = (getLocApi_t*)dlsym(handle, "getLocApi")) || - NULL == (locApi = (*getter)(msgTask, exMask))) { - // only RPC is the option now - handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { - getter = (getLocApi_t*)dlsym(handle, "getLocApi"); - if (NULL != getter) { - locApi = (*getter)(msgTask, exMask); - } - } - } - } - - // locApi could still be NULL at this time - // we would then create a dummy one - if (NULL == locApi) { - locApi = new LocApiBase(msgTask, exMask); - } - - return locApi; -} - LocApiBase::LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 3676bff6..87facf1b 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,17 +34,6 @@ #include #include -#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_LOGW("%s: default implementation invoked", __func__); \ - return rtv; \ -} - namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -52,65 +41,6 @@ int hexcode(char *hexstring, int string_size, int decodeAddress(char *addr_string, int string_size, const char *data, int data_size); -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_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, - 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_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< + +namespace loc_core { + +class LocAdapterBase; + +class UlpProxyBase { +public: + inline UlpProxyBase() {} + inline virtual ~UlpProxyBase() {} + inline virtual bool sendStartFix() { return false;} + inline virtual bool sendStopFix() { return false;} + inline virtual bool sendFixMode(LocPosMode ¶ms) { return false;} + inline virtual bool reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) { + return false; + } + inline virtual bool reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) { + return false; + } + inline virtual void setAdapter(LocAdapterBase* adapter) {} + inline virtual void setCapabilities(unsigned long capabilities) {} +}; + +} // namespace loc_core + +#endif // ULP_PROXY_BASE_H diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 640668ff..6b2bd106 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -247,6 +247,77 @@ typedef enum { } 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_LOGW("%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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, + 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_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1<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::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)); +} + LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, loc_msg_sender msgSender, + void* owner, MsgTask::tCreate tCreator) : LocAdapterBase(mask, LocDualContext::getLocFgContext( tCreator, LocDualContext::mLocationHalName)), - mOwner(owner), mSendUlpMsg(msgSender), mNavigating(false), - mAgpsEnabled(loc_core::LocDualContext::hasAgpsExt()) + mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), + mUlp(new UlpProxyBase()), mNavigating(false), + mAgpsEnabled(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); LOC_LOGD("LocEngAdapter created"); @@ -52,34 +84,61 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, inline LocEngAdapter::~LocEngAdapter() { + delete mInternalAdapter; LOC_LOGV("LocEngAdapter deleted"); } +void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) +{ + delete mUlp; + LOC_LOGV("%s] %p", __func__, ulp); + if (NULL == ulp) { + ulp = new UlpProxyBase(); + } + mUlp = ulp; +} + +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 ) + LocPosTechMask loc_technology_mask) { - if (mSendUlpMsg) { - loc_eng_msg_report_position *msg( - new loc_eng_msg_report_position(mOwner, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); - mSendUlpMsg(mOwner, msg); - } else { - sendMsg(new LocEngReportPosition(mOwner, - location, + if (! mUlp->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask )) { + mInternalAdapter->reportPosition(location, locationExtended, locationExt, status, - loc_technology_mask)); + loc_technology_mask); } } +void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt){ + sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, + locationExtended, svExt)); +} + void LocEngAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) @@ -88,14 +147,8 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, // 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 (mSendUlpMsg) { - loc_eng_msg_report_sv *msg( - new loc_eng_msg_report_sv(mOwner, svStatus, - locationExtended, svExt)); - mSendUlpMsg(mOwner, msg); - } else { - sendMsg(new LocEngReportSv(mOwner, svStatus, - locationExtended, svExt)); + if (! mUlp->reportSv(svStatus, locationExtended, svExt)) { + mInternalAdapter->reportSv(svStatus, locationExtended, svExt); } } diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 7e6f73bd..6ad3ba98 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -36,28 +36,61 @@ #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(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + virtual void setPositionModeInt(LocPosMode& posMode); + virtual void startFixInt(); + virtual void stopFixInt(); + virtual void setUlpProxy(UlpProxyBase* ulp); +}; + typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); class LocEngAdapter : public LocAdapterBase { void* mOwner; - loc_msg_sender mSendUlpMsg; + LocInternalAdapter* mInternalAdapter; + UlpProxyBase* mUlp; LocPosMode mFixCriteria; bool mNavigating; public: - const bool mAgpsEnabled; + bool mAgpsEnabled; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, loc_msg_sender msgSender, + void* owner, MsgTask::tCreate tCreator); virtual ~LocEngAdapter(); + virtual void setUlpProxy(UlpProxyBase* ulp); + 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 hasAgpsExt() { return mContext->hasAgpsExt(); } + inline const MsgTask* getMsgTask() { return mMsgTask; } + inline enum loc_api_adapter_err startFix() { diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index cee948c1..23743570 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -1,7 +1,6 @@ AM_CFLAGS = \ -I../../utils \ -I../../platform_lib_abstractions \ - -I../ulp/inc \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API @@ -69,9 +68,7 @@ library_include_HEADERS = \ loc_eng_ni.h \ loc_eng_agps.h \ loc_eng_msg.h \ - loc_eng_msg_id.h \ - loc_eng_log.h \ - ../ulp/inc/ulp.h + loc_eng_log.h library_includedir = $(pkgincludedir)/libloc_api_50001 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 9749703a..6cca8544 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -37,41 +37,27 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include -namespace android { - namespace AndroidRuntime { - void* createJavaThread(const char* name, void (*start)(void *), void* arg); - } -} +using namespace loc_core; //Globals defns -static const ulpInterface * loc_eng_ulp_inf = NULL; -static const ulpInterface * loc_eng_get_ulp_inf(void); static gps_location_callback gps_loc_cb = NULL; static gps_sv_status_callback gps_sv_cb = NULL; static void local_loc_cb(UlpLocation* location, void* locExt); -static void local_status_cb(GpsStatus* status); static void local_sv_cb(GpsSvStatus* sv_status, void* svExt); -static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length); -static void local_set_capabilities_cb(uint32_t capabilities); -static void local_acquire_wakelock_cb(void); -static void local_release_wakelock_cb(void); -static void local_request_utc_time_cb(void); + static const GpsGeofencingInterface* get_geofence_interface(void); // Function declarations for sLocEngInterface static int loc_init(GpsCallbacks* callbacks); -static int loc_hal_init(void); static int loc_start(); static int loc_stop(); static void loc_cleanup(); @@ -154,7 +140,6 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = }; static loc_eng_data_s_type loc_afw_data; -static LocCallbacks afw_cb_data; static int gss_fd = 0; /*=========================================================================== @@ -195,16 +180,6 @@ const GpsInterface* gps_get_hardware_interface () loc_eng_read_config(); - //We load up libulp module at this point itself - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - - if (0 != loc_hal_init()) { - LOC_LOGE("HAL could not be initialized"); - ret_val = NULL; - } else { - ret_val = &sLocEngInterface; - } - EXIT_LOG(%p, ret_val); return ret_val; } @@ -213,51 +188,32 @@ const GpsInterface* gps_get_hardware_interface () extern "C" const GpsInterface* get_gps_interface() { unsigned int target = TARGET_DEFAULT; - if (NULL == loc_afw_data.adapter) { - loc_eng_read_config(); + loc_eng_read_config(); - //We load up libulp module at this point itself - loc_eng_ulp_inf = loc_eng_get_ulp_inf(); - - target = get_target(); - LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + target = get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); //APQ8064 if( getTargetGnssType(target) == GNSS_GSS ) { - 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); - } + 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)); } - //MPQ8064 + else { + LOC_LOGD("GSS open success! CAPABILITIES %0lx\n", + gps_conf.CAPABILITIES); + } + } + //MPQ8064 else if( getTargetGnssType(target) == GNSS_NONE) { - LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); - return NULL; - } - if (0 != loc_hal_init()) { - LOC_LOGE("HAL could not be initialized"); - return NULL; - } + LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + return NULL; } return &sLocEngInterface; } -static void loc_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - -void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg) -{ - loc_eng_data_s_type* loc_eng = (loc_eng_data_s_type*)loc_eng_data_p; - msg_q_snd(loc_eng->ulp_q, msg, loc_free_msg); -} - /*=========================================================================== -FUNCTION loc_hal_init +FUNCTION loc_init DESCRIPTION Initialize the location engine, this include setting up global datas @@ -273,50 +229,46 @@ SIDE EFFECTS N/Ax ===========================================================================*/ -static int loc_hal_init(void) +static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; - if (loc_core::LocDualContext::hasAgpsExt()) { - event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; - } else { - event = 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; + 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_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; + LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ - local_status_cb, /* status_cb */ + callbacks->status_cb, /* status_cb */ local_sv_cb, /* sv_status_cb */ - local_nmea_cb, /* nmea_cb */ - local_set_capabilities_cb, /* set_capabilities_cb */ - local_acquire_wakelock_cb, /* acquire_wakelock_cb */ - local_release_wakelock_cb, /* release_wakelock_cb */ - (pthread_t (*)(const char*, void (*)(void*), void*)) - android::AndroidRuntime::createJavaThread, /* create_thread_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 */ - local_request_utc_time_cb /* request_utc_time_cb */}; + callbacks->request_utc_time_cb /* request_utc_time_cb */}; - if (loc_eng_ulp_inf == NULL) - retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, - NULL); - else - retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, - loc_ulp_msg_sender); + gps_loc_cb = callbacks->location_cb; + gps_sv_cb = callbacks->sv_status_cb; + + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event); + loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); + loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); - int ret_val1 = loc_eng_ulp_init(loc_afw_data, loc_eng_ulp_inf); - LOC_LOGD("loc_eng_ulp_init returned %d\n",ret_val1); EXIT_LOG(%d, retVal); return retVal; @@ -473,9 +425,8 @@ static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertain ENTRY_LOG(); int ret_val = 0; - if (loc_core::LocDualContext::hasAgpsExt()) { - ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty); - } + ret_val = loc_eng_inject_time(loc_afw_data, time, + timeReference, uncertainty); EXIT_LOG(%d, ret_val); return ret_val; @@ -582,7 +533,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) 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 ulpInterface failed, error = %s\n", __func__, error); + LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } @@ -616,21 +567,15 @@ const void* loc_get_extension(const char* name) LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); if (strcmp(name, GPS_XTRA_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { - ret_val = &sLocEngXTRAInterface; - } + ret_val = &sLocEngXTRAInterface; } else if (strcmp(name, AGPS_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { - ret_val = &sLocEngAGpsInterface; - } + ret_val = &sLocEngAGpsInterface; } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - if (loc_core::LocDualContext::hasAgpsExt()) { - ret_val = &sLocEngNiInterface; - } + ret_val = &sLocEngNiInterface; } else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { @@ -789,6 +734,8 @@ static int loc_agps_set_server(AGpsType type, const char* hostname, int port) 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); @@ -797,7 +744,8 @@ static int loc_agps_set_server(AGpsType type, const char* hostname, int port) } /*=========================================================================== -FUNCTION loc_xtra_init +FUNCTIONf571 + loc_xtra_init DESCRIPTION Initialize XTRA module. @@ -932,8 +880,6 @@ static void local_loc_cb(UlpLocation* location, void* locExt) if (NULL != gps_loc_cb) { gps_loc_cb(&location->gpsLocation); - } else { - LOC_LOGE("Error. GPS not enabled"); } } EXIT_LOG(%s, VOID_RET); @@ -945,174 +891,6 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) if (NULL != gps_sv_cb) { CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs); gps_sv_cb(sv_status); - } else { - LOC_LOGE("Error. GPS not enabled"); - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_get_ulp_inf - -DESCRIPTION - This function checks if ULP is enabled, and loads the libulp2.so and - returns its interface - -DEPENDENCIES - None - -RETURN VALUE - interface pointer to libulp: no error - NULL: errors - -SIDE EFFECTS - N/A - -===========================================================================*/ -const ulpInterface * loc_eng_get_ulp_inf(void) -{ - ENTRY_LOG(); - void *handle; - const char *error; - get_ulp_interface* get_ulp_inf; - const ulpInterface* loc_eng_ulpInf = NULL; - - dlerror(); /* Clear any existing error */ - - handle = dlopen ("libulp2.so", RTLD_NOW); - - if (!handle) - { - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlopen for libulp.so failed, error = %s\n", __func__, error); - } - goto exit; - } - dlerror(); /* Clear any existing error */ - get_ulp_inf = (get_ulp_interface*) dlsym(handle, "ulp_get_interface"); - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlsym for ulpInterface failed, error = %s\n", __func__, error); - goto exit; - } - - // Initialize the ULP interface - loc_eng_ulpInf = get_ulp_inf(); - -exit: - EXIT_LOG(%d, loc_eng_ulpInf == NULL); - return loc_eng_ulpInf; -} - -/*=========================================================================== -FUNCTION loc_init - -DESCRIPTION - Registers the AFW call backs with the local tables - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/Ax - -===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) -{ - int retVal = -1; - ENTRY_LOG(); - if(callbacks == NULL) { - LOC_LOGE(" loc_init. cb = NULL\n"); - EXIT_LOG(%d, retVal); - return retVal; - } - memset(&afw_cb_data, 0, sizeof (afw_cb_data)); - gps_loc_cb = callbacks->location_cb; - afw_cb_data.status_cb = callbacks->status_cb; - gps_sv_cb = callbacks->sv_status_cb; - afw_cb_data.set_capabilities_cb = callbacks->set_capabilities_cb; - afw_cb_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; - afw_cb_data.release_wakelock_cb = callbacks->release_wakelock_cb; - afw_cb_data.request_utc_time_cb = callbacks->request_utc_time_cb; - afw_cb_data.nmea_cb = callbacks->nmea_cb; - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } - retVal = 0; - EXIT_LOG(%d, retVal); - return retVal; -} - -static void local_nmea_cb(GpsUtcTime timestamp, const char* nmea, int length) -{ - ENTRY_LOG(); - if (0 != length) { - if (NULL != afw_cb_data.nmea_cb) { - afw_cb_data.nmea_cb(timestamp, nmea, length); - } else - { - LOC_LOGE("Error. GPS not enabled"); - } - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_set_capabilities_cb(uint32_t capabilities) -{ - ENTRY_LOG(); - if (NULL != afw_cb_data.set_capabilities_cb) { - afw_cb_data.set_capabilities_cb(capabilities); - } else { - LOC_LOGE("Error. GPS not enabled"); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_acquire_wakelock_cb(void) -{ - ENTRY_LOG(); - if (NULL != afw_cb_data.acquire_wakelock_cb) { - afw_cb_data.acquire_wakelock_cb(); - } else { - LOC_LOGE("Error. GPS not enabled"); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_release_wakelock_cb(void) -{ - ENTRY_LOG(); - if (NULL != afw_cb_data.release_wakelock_cb) { - afw_cb_data.release_wakelock_cb(); - } else { - LOC_LOGE("Error. GPS not enabled"); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_request_utc_time_cb(void) -{ - ENTRY_LOG(); - if (NULL != afw_cb_data.request_utc_time_cb) { - afw_cb_data.request_utc_time_cb(); - } else { - LOC_LOGE("Error. GPS not enabled"); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_status_cb(GpsStatus* status) -{ - ENTRY_LOG(); - if (NULL != status) { - CALLBACK_LOG_CALLFLOW("status_callback - status", %d, status->status); - if (NULL != afw_cb_data.status_cb) { - afw_cb_data.status_cb(status); - } else { - LOC_LOGE("Error. GPS not enabled"); - } } EXIT_LOG(%s, VOID_RET); } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 334e03ee..c9593235 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -57,8 +57,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } LocCallbacks; -void loc_ulp_msg_sender(void* loc_eng_data_p, void* msg); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 15f20cbb..7befc740 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -190,11 +189,6 @@ static void deleteAidingData(loc_eng_data_s_type &logEng); static AgpsStateMachine* getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType); -static void loc_eng_free_msg(void* msg) -{ - delete (loc_eng_msg*)msg; -} - 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) @@ -246,14 +240,15 @@ inline void LocEngRequestNi::log() const { // in loc_eng_ni.cpp // case LOC_ENG_MSG_START_FIX: -LocEngStartFix::LocEngStartFix(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) +LocEngStartFix::LocEngStartFix(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) { locallog(); } inline void LocEngStartFix::proc() const { - loc_eng_start_handler(*mLocEng); + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + loc_eng_start_handler(*locEng); } inline void LocEngStartFix::locallog() const { @@ -264,19 +259,19 @@ inline void LocEngStartFix::log() const locallog(); } void LocEngStartFix::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); + mAdapter->sendMsg(this); } // case LOC_ENG_MSG_STOP_FIX: -LocEngStopFix::LocEngStopFix(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) +LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) { locallog(); } inline void LocEngStopFix::proc() const { - loc_eng_stop_handler(*mLocEng); + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + loc_eng_stop_handler(*locEng); } inline void LocEngStopFix::locallog() const { @@ -287,8 +282,7 @@ inline void LocEngStopFix::log() const locallog(); } void LocEngStopFix::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); + mAdapter->sendMsg(this); } // case LOC_ENG_MSG_SET_POSITION_MODE: @@ -669,21 +663,24 @@ struct LocEngExtPowerConfig : public LocMsg { }; // case LOC_ENG_MSG_REPORT_POSITION: -LocEngReportPosition::LocEngReportPosition(void* locEng, +LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, enum loc_sess_status st, LocPosTechMask technology) : - LocMsg(), mLocEng(locEng), mLocation(loc), + LocMsg(), mAdapter(adapter), mLocation(loc), mLocationExtended(locExtended), - mLocationExt(((loc_eng_data_s_type*)mLocEng)->location_ext_parser(locExt)), + mLocationExt(((loc_eng_data_s_type*) + ((LocEngAdapter*) + (mAdapter))->getOwner())->location_ext_parser(locExt)), mStatus(st), mTechMask(technology) { locallog(); } void LocEngReportPosition::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + 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; @@ -768,24 +765,26 @@ void LocEngReportPosition::log() const { locallog(); } void LocEngReportPosition::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); + mAdapter->sendMsg(this); } // case LOC_ENG_MSG_REPORT_SV: -LocEngReportSv::LocEngReportSv(void* locEng, +LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, GpsSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : - LocMsg(), mLocEng(locEng), mSvStatus(sv), + LocMsg(), mAdapter(adapter), mSvStatus(sv), mLocationExtended(locExtended), - mSvExt(((loc_eng_data_s_type*)mLocEng)->sv_ext_parser(svExt)) + mSvExt(((loc_eng_data_s_type*) + ((LocEngAdapter*) + (mAdapter))->getOwner())->sv_ext_parser(svExt)) { locallog(); } void LocEngReportSv::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + 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) { @@ -819,8 +818,7 @@ inline void LocEngReportSv::log() const { locallog(); } void LocEngReportSv::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); + mAdapter->sendMsg(this); } // case LOC_ENG_MSG_REPORT_STATUS: @@ -1405,8 +1403,7 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event, - void (*loc_external_msg_sender) (void*, void*)) + LOC_API_ADAPTER_EVENT_MASK_T event) { int ret_val = 0; @@ -1424,6 +1421,10 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; loc_eng_data.sv_status_cb = callbacks->sv_status_cb; @@ -1455,7 +1456,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, - loc_external_msg_sender, (MsgTask::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", @@ -1563,13 +1563,6 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) #if 0 // can't afford to actually clean up, for many reason. - // De-initialize ulp - if (locEngUlpInf != NULL) - { - locEngUlpInf = NULL; - msg_q_destroy( &loc_eng_data.ulp_q); - } - LOC_LOGD("loc_eng_init: client opened. close it now."); delete loc_eng_data.adapter; loc_eng_data.adapter = NULL; @@ -1604,15 +1597,9 @@ 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.ulp_q) + if(! loc_eng_data.adapter->getUlpProxy()->sendStartFix()) { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_START_FIX)); - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else - { - loc_eng_data.adapter->sendMsg(new LocEngStartFix(&loc_eng_data)); + loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); } EXIT_LOG(%d, 0); @@ -1660,15 +1647,9 @@ 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.ulp_q) + if(! loc_eng_data.adapter->getUlpProxy()->sendStopFix()) { - //Pass the start messgage to ULP if present & activated - loc_eng_msg *msg(new loc_eng_msg(&loc_eng_data, LOC_ENG_MSG_STOP_FIX)); - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else - { - loc_eng_data.adapter->sendMsg(new LocEngStopFix(&loc_eng_data)); + loc_eng_data.adapter->sendMsg(new LocEngStopFix(loc_eng_data.adapter)); } EXIT_LOG(%d, 0); @@ -1739,17 +1720,8 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, params)); - if(loc_eng_data.ulp_q) - { - loc_eng_msg_position_mode *msg( - new loc_eng_msg_position_mode(&loc_eng_data, params)); - //Pass the start messgage to ULP if present & activated - msg_q_snd(loc_eng_data.ulp_q, msg, loc_eng_free_msg); - } - else + if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) { LocEngAdapter* adapter = loc_eng_data.adapter; adapter->sendMsg(new LocEngPositionMode(adapter, params)); @@ -1781,8 +1753,10 @@ int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, 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)); + if (adapter->mAgpsEnabled) { + adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference, + uncertainty)); + } EXIT_LOG(%d, 0); return 0; } @@ -2467,41 +2441,6 @@ static int set_sched_policy(int tid, SchedPolicy policy) } #endif /* USE_GLIB */ -/*=========================================================================== -FUNCTION loc_eng_ulp_init - -DESCRIPTION - This function dynamically loads the libulp.so and calls - its init function to start up the ulp module - -DEPENDENCIES - None - -RETURN VALUE - 0: no error - -1: errors - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf) -{ - ENTRY_LOG(); - int ret_val=-1; - if((loc_eng_ulpInf != NULL) && (((ulpInterface *)loc_eng_ulpInf)->init != NULL)) - { - // Initialize the ULP interface - ((ulpInterface *)loc_eng_ulpInf)->init(loc_eng_data); - loc_eng_data.ulp_q = (void*)msg_q_init2(); - ret_val = 0; - } - else - LOC_LOGE("ulp not initialized. NULL parameter"); - EXIT_LOG(%d, ret_val); - return ret_val; -} - /*=========================================================================== FUNCTION loc_eng_read_config diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index fdda66a2..d5f18559 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -130,14 +130,11 @@ typedef struct loc_eng_data_s int mpc_host_set; char mpc_host_buf[101]; int mpc_port_buf; - void *ulp_q; loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; } loc_eng_data_s_type; -#include "ulp.h" - /* GPS.conf support */ typedef struct loc_gps_cfg_s { @@ -182,9 +179,7 @@ extern loc_sap_cfg_s_type sap_conf; int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event, - void (*loc_external_msg_sender) (void*, void*)); -int loc_eng_ulp_init(loc_eng_data_s_type &loc_eng_data, const ulpInterface * loc_eng_ulpInf); + LOC_API_ADAPTER_EVENT_MASK_T event); 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); diff --git a/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp index 8c494337..3a34167a 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.cpp +++ b/loc_api/libloc_api_50001/loc_eng_log.cpp @@ -32,61 +32,4 @@ #include "loc_log.h" #include "loc_eng_log.h" -#include "loc_eng_msg_id.h" - -static loc_name_val_s_type loc_eng_msgs[] = -{ - NAME_VAL( LOC_ENG_MSG_QUIT ), - NAME_VAL( LOC_ENG_MSG_ENGINE_DOWN ), - NAME_VAL( LOC_ENG_MSG_ENGINE_UP ), - NAME_VAL( LOC_ENG_MSG_START_FIX ), - NAME_VAL( LOC_ENG_MSG_STOP_FIX ), - NAME_VAL( LOC_ENG_MSG_SET_POSITION_MODE ), - NAME_VAL( LOC_ENG_MSG_SET_TIME ), - NAME_VAL( LOC_ENG_MSG_INJECT_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_INJECT_LOCATION ), - NAME_VAL( LOC_ENG_MSG_DELETE_AIDING_DATA ), - NAME_VAL( LOC_ENG_MSG_SET_APN ), - NAME_VAL( LOC_ENG_MSG_SET_SERVER_URL ), - NAME_VAL( LOC_ENG_MSG_SET_SERVER_IPV4 ), - NAME_VAL( LOC_ENG_MSG_ENABLE_DATA ), - NAME_VAL( LOC_ENG_MSG_SUPL_VERSION ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PROPERTIES ), - NAME_VAL( LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG ), - NAME_VAL( LOC_ENG_MSG_MUTE_SESSION ), - NAME_VAL( LOC_ENG_MSG_ATL_OPEN_SUCCESS ), - NAME_VAL( LOC_ENG_MSG_ATL_CLOSED ), - NAME_VAL( LOC_ENG_MSG_ATL_OPEN_FAILED ), - NAME_VAL( LOC_ENG_MSG_REPORT_POSITION ), - NAME_VAL( LOC_ENG_MSG_REPORT_SV ), - NAME_VAL( LOC_ENG_MSG_REPORT_STATUS ), - NAME_VAL( LOC_ENG_MSG_REPORT_NMEA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_ATL ), - NAME_VAL( LOC_ENG_MSG_RELEASE_ATL ), - NAME_VAL( LOC_ENG_MSG_REQUEST_BIT ), - NAME_VAL( LOC_ENG_MSG_RELEASE_BIT ), - NAME_VAL( LOC_ENG_MSG_REQUEST_WIFI ), - NAME_VAL( LOC_ENG_MSG_RELEASE_WIFI ), - NAME_VAL( LOC_ENG_MSG_REQUEST_NI ), - NAME_VAL( LOC_ENG_MSG_INFORM_NI_RESPONSE ), - NAME_VAL( LOC_ENG_MSG_REQUEST_XTRA_DATA ), - NAME_VAL( LOC_ENG_MSG_REQUEST_TIME ), - NAME_VAL( LOC_ENG_MSG_EXT_POWER_CONFIG ), - NAME_VAL( LOC_ENG_MSG_REQUEST_POSITION ), - NAME_VAL( LOC_ENG_MSG_LPP_CONFIG ), - NAME_VAL( LOC_ENG_MSG_A_GLONASS_PROTOCOL ), - NAME_VAL( LOC_ENG_MSG_LOC_INIT ), - NAME_VAL( LOC_ENG_MSG_REQUEST_SUPL_ES ), - NAME_VAL( LOC_ENG_MSG_CLOSE_DATA_CALL) -}; -static int loc_eng_msgs_num = sizeof(loc_eng_msgs) / sizeof(loc_name_val_s_type); - -/* Find Android GPS status name */ -const char* loc_get_msg_name(int id) -{ - return loc_get_name_from_val(loc_eng_msgs, loc_eng_msgs_num, (long) id); -} - - diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/loc_api/libloc_api_50001/loc_eng_log.h index ec1b7353..a68bd847 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/loc_api/libloc_api_50001/loc_eng_log.h @@ -37,8 +37,6 @@ extern "C" #include -const char* loc_get_msg_name(int id); - #ifdef __cplusplus } #endif diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 39b0de52..1a318946 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -57,92 +56,10 @@ extern "C" { using namespace loc_core; -struct loc_eng_msg { - const void* owner; - const int msgid; - inline loc_eng_msg(void* instance, int id) : - owner(instance), msgid(id) - { - LOC_LOGV("creating msg %s", loc_get_msg_name(msgid)); - LOC_LOGV("creating msg ox%x", msgid); - } - virtual ~loc_eng_msg() - { - LOC_LOGV("deleting msg %s (0x%x)", loc_get_msg_name(msgid), msgid); - } -}; - -struct loc_eng_msg_position_mode : public loc_eng_msg { - const LocPosMode pMode; - inline loc_eng_msg_position_mode(void* instance, - LocPosMode &mode) : - loc_eng_msg(instance, LOC_ENG_MSG_SET_POSITION_MODE), - pMode(mode) - { - pMode.logv(); - } -}; - -struct loc_eng_msg_report_position : public loc_eng_msg { - const UlpLocation location; - const GpsLocationExtended locationExtended; - const void* locationExt; - const enum loc_sess_status status; - const LocPosTechMask technology_mask; - inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, - enum loc_sess_status st) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(LOC_POS_TECH_MASK_DEFAULT) - { - 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", - 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,technology_mask); - } - inline loc_eng_msg_report_position(void* instance, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, - enum loc_sess_status st, LocPosTechMask technology) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_POSITION), - location(loc), locationExtended(locExtended), locationExt(locExt), status(st), technology_mask(technology) - { - 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", - 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,technology_mask); - } -}; - -struct loc_eng_msg_report_sv : public loc_eng_msg { - const GpsSvStatus svStatus; - const GpsLocationExtended locationExtended; - const void* svExt; - inline loc_eng_msg_report_sv(void* instance, GpsSvStatus &sv, GpsLocationExtended &locExtended, void* ext) : - loc_eng_msg(instance, LOC_ENG_MSG_REPORT_SV), svStatus(sv), locationExtended(locExtended), svExt(ext) - { - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used in fix mask: %x\n sv: prn snr elevation azimuth", - svStatus.num_svs, svStatus.ephemeris_mask, svStatus.almanac_mask, svStatus.used_in_fix_mask); - for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f\n ", - i, - svStatus.sv_list[i].prn, - svStatus.sv_list[i].snr, - svStatus.sv_list[i].elevation, - svStatus.sv_list[i].azimuth); - } - } -}; - - struct LocEngPositionMode : public LocMsg { LocEngAdapter* mAdapter; const LocPosMode mPosMode; - LocEngPositionMode(LocEngAdapter* adapter, - LocPosMode &mode); + LocEngPositionMode(LocEngAdapter* adapter, LocPosMode &mode); virtual void proc() const; virtual void log() const; void send() const; @@ -150,8 +67,8 @@ struct LocEngPositionMode : public LocMsg { struct LocEngStartFix : public LocMsg { - loc_eng_data_s_type* mLocEng; - LocEngStartFix(loc_eng_data_s_type* locEng); + LocEngAdapter* mAdapter; + LocEngStartFix(LocEngAdapter* adapter); virtual void proc() const; void locallog() const; virtual void log() const; @@ -159,8 +76,8 @@ struct LocEngStartFix : public LocMsg { }; struct LocEngStopFix : public LocMsg { - loc_eng_data_s_type* mLocEng; - LocEngStopFix(loc_eng_data_s_type* locEng); + LocEngAdapter* mAdapter; + LocEngStopFix(LocEngAdapter* adapter); virtual void proc() const; void locallog() const; virtual void log() const; @@ -168,13 +85,13 @@ struct LocEngStopFix : public LocMsg { }; struct LocEngReportPosition : public LocMsg { - void* mLocEng; + LocAdapterBase* mAdapter; const UlpLocation mLocation; const GpsLocationExtended mLocationExtended; const void* mLocationExt; const enum loc_sess_status mStatus; const LocPosTechMask mTechMask; - LocEngReportPosition(void* locEng, + LocEngReportPosition(LocAdapterBase* adapter, UlpLocation &loc, GpsLocationExtended &locExtended, void* locExt, @@ -187,11 +104,11 @@ struct LocEngReportPosition : public LocMsg { }; struct LocEngReportSv : public LocMsg { - void* mLocEng; + LocAdapterBase* mAdapter; const GpsSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; - LocEngReportSv(void* locEng, + LocEngReportSv(LocAdapterBase* adapter, GpsSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); diff --git a/loc_api/libloc_api_50001/loc_eng_msg_id.h b/loc_api/libloc_api_50001/loc_eng_msg_id.h deleted file mode 100644 index 186b53cd..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg_id.h +++ /dev/null @@ -1,114 +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_MSG_ID_H -#define LOC_ENG_MSG_ID_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct msgbuf { - unsigned int msgsz; - void* msgid; -}; - -enum loc_eng_msg_ids_t { - /* 0x 0 - 0xEF is reserved for daemon internal */ - /* 0xF0 - 0x1FF is reserved for daemon & framework communication */ - LOC_ENG_MSG_QUIT = 0x200, - /*******************OEMs PLEASE NOTE***************************/ - /* The next five messages are shared with libulp. They are should - not be altered if libulp cannot be recompiled */ - LOC_ENG_MSG_START_FIX, - LOC_ENG_MSG_STOP_FIX, - LOC_ENG_MSG_SET_POSITION_MODE, - LOC_ENG_MSG_REPORT_POSITION, - LOC_ENG_MSG_REPORT_SV, - - LOC_ENG_MSG_ENGINE_DOWN, - LOC_ENG_MSG_ENGINE_UP, - - LOC_ENG_MSG_SET_TIME, - LOC_ENG_MSG_INJECT_XTRA_DATA, - LOC_ENG_MSG_REQUEST_XTRA_SERVER, - LOC_ENG_MSG_INJECT_LOCATION, - LOC_ENG_MSG_DELETE_AIDING_DATA, - LOC_ENG_MSG_SET_APN, - LOC_ENG_MSG_SET_SERVER_URL, - LOC_ENG_MSG_SET_SERVER_IPV4, - LOC_ENG_MSG_ENABLE_DATA, - - LOC_ENG_MSG_SUPL_VERSION, - LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG, - LOC_ENG_MSG_SET_SENSOR_PROPERTIES, - LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG, - LOC_ENG_MSG_MUTE_SESSION, - - LOC_ENG_MSG_ATL_OPEN_SUCCESS, - LOC_ENG_MSG_ATL_CLOSED, - LOC_ENG_MSG_ATL_OPEN_FAILED, - - LOC_ENG_MSG_REPORT_STATUS, - LOC_ENG_MSG_REPORT_NMEA, - LOC_ENG_MSG_REPORT_XTRA_SERVER, - LOC_ENG_MSG_REQUEST_BIT, - LOC_ENG_MSG_RELEASE_BIT, - LOC_ENG_MSG_REQUEST_ATL, - LOC_ENG_MSG_RELEASE_ATL, - LOC_ENG_MSG_REQUEST_WIFI, - LOC_ENG_MSG_RELEASE_WIFI, - LOC_ENG_MSG_REQUEST_NI, - LOC_ENG_MSG_INFORM_NI_RESPONSE, - LOC_ENG_MSG_REQUEST_XTRA_DATA, - LOC_ENG_MSG_REQUEST_TIME, - LOC_ENG_MSG_REQUEST_POSITION, - LOC_ENG_MSG_EXT_POWER_CONFIG, - - /* Message is sent by HAL to LOC API to configure LTE Positioning - Profile in modem */ - LOC_ENG_MSG_LPP_CONFIG, - - /* Message is sent by HAL to LOC API to select A-GLONASS protocol */ - LOC_ENG_MSG_A_GLONASS_PROTOCOL, - - //Message is sent by LOC to do LOC INIT - LOC_ENG_MSG_LOC_INIT, - - /*Message is sent by modem to request emergency call setup*/ - LOC_ENG_MSG_REQUEST_SUPL_ES, - - /*Ask the DS client to close the data call by releasing the handle*/ - LOC_ENG_MSG_CLOSE_DATA_CALL, -}; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_MSG_ID_H */ From 782431aff037174b5d6bf533975a05aafff98ed2 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 7 Aug 2013 18:48:22 -0700 Subject: [PATCH 154/945] Return NULL AGPS interface on APQ target. The AGPS interface will be returned as null if MSA and MSB capabilities are not set in gps config Change-Id: I388654c9f527bfed128f431ccb8956e19be0f7f2 (cherry picked from commit 50891ecfe09b19a130b675ddc818ecf4ae31a3da) --- loc_api/libloc_api_50001/loc.cpp | 14 +++++++++++++- loc_api/libloc_api_50001/loc_eng.cpp | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 6cca8544..90b3b86e 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -571,7 +571,19 @@ const void* loc_get_extension(const char* name) } else if (strcmp(name, AGPS_INTERFACE) == 0) { - ret_val = &sLocEngAGpsInterface; + //Return an interface to AGPS only if MSA or MSB capabilities + //are present. If the target is an APQ, these masks are + //cleared in get_gps_interface() and the below logic will + //return NULL as the interface for AGPS + if((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { + LOC_LOGD("%s:%d]: AGPS capabilities found\n", __func__, __LINE__); + ret_val = &sLocEngAGpsInterface; + } + else { + LOC_LOGD("%s:%d]: Returning NULL AgpsInterface\n", __func__, __LINE__); + ret_val = NULL; + } } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 7befc740..d23516ef 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1454,6 +1454,13 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } + //Disable AGPS if capabilities are not present + if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && + !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA)) { + event &= ~(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | + LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST); + } + loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, (MsgTask::tCreate)callbacks->create_thread_cb); @@ -1950,6 +1957,17 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call EXIT_LOG(%s, VOID_RET); return; } + + //Proceed to create AGPS framework only if MSA or MSB capabilities + //are present. If the target is an APQ, these masks are + //cleared in get_gps_interface() + if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && + !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { + LOC_LOGD("%s:%d]: No AGPS capabilities found. Returning\n", + __func__, __LINE__); + return; + } + loc_eng_data.agps_status_cb = callbacks->status_cb; loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, From 7d128bf31e4692db64cb94b2c03154db00cb2d77 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 5 Aug 2013 16:43:37 -0700 Subject: [PATCH 155/945] Remove masks for Glonass Masks for deleting aiding data of Glonass satellites have been moved to gps.h. Also added NAME_VAL pairs for BDS Change-Id: I6b5e427e3bac3936f98137ddc1c25cb35f324231 CRs-fixed: 498642 --- core/gps_extended_c.h | 10 ---------- core/loc_core_log.cpp | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 6b2bd106..d11016ec 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -94,16 +94,6 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 1 #define AGPS_APN_BEARER_IPV4V6 2 -#define GPS_DELETE_ALMANAC_CORR 0x00001000 -#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 -#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 -#define GPS_DELETE_ALMANAC_GLO 0x00008000 -#define GPS_DELETE_SVDIR_GLO 0x00010000 -#define GPS_DELETE_SVSTEER_GLO 0x00020000 -#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 -#define GPS_DELETE_TIME_GPS 0x00080000 -#define GPS_DELETE_TIME_GLO 0x00100000 - /** GPS extended callback structure. */ typedef struct { /** set to sizeof(GpsCallbacks) */ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index f67dfe0b..461273ff 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -118,13 +118,20 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_CELLDB_INFO ), NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GLO_DELETE_EPHEMERIS ), + NAME_VAL( GLO_DELETE_ALMANAC ), + NAME_VAL( GLO_DELETE_SVDIR ), + NAME_VAL( GLO_DELETE_SVSTEER ), + NAME_VAL( GLO_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) + NAME_VAL( GLO_DELETE_TIME ), + NAME_VAL( BDS_DELETE_SVDIR ), + NAME_VAL( BDS_DELETE_SVSTEER ), + NAME_VAL( BDS_DELETE_TIME ), + NAME_VAL( BDS_DELETE_ALMANAC_CORR ), + NAME_VAL( BDS_DELETE_EPHEMERIS ), + NAME_VAL( BDS_DELETE_ALMANAC ), + NAME_VAL( GPS_DELETE_ALL) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From aa6fbdba9e721a40b2e04bb9f461e8607f82bfef Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 13 Aug 2013 15:44:27 -0700 Subject: [PATCH 156/945] Remove ENABLE_WIPER parameter ENABLE_WIPER parameter is no longer included in gps.conf and used in the HAL code. So it is removed to avoid confusion. CRs-fixed: 520700 Change-Id: Ic0ffb762d7d27019407a9f5b4600d6ea9693b401 --- loc_api/libloc_api_50001/loc_eng.cpp | 2 -- loc_api/libloc_api_50001/loc_eng.h | 1 - 2 files changed, 3 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index db3cb3f9..60af75b9 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -101,7 +101,6 @@ static loc_param_s_type loc_parameter_table[] = { {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, - {"ENABLE_WIPER", &gps_conf.ENABLE_WIPER, NULL, 'n'}, {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, @@ -131,7 +130,6 @@ static void loc_default_parameters(void) /* defaults */ gps_conf.INTERMEDIATE_POS = 0; gps_conf.ACCURACY_THRES = 0; - gps_conf.ENABLE_WIPER = 0; gps_conf.NMEA_PROVIDER = 0; gps_conf.SUPL_VER = 0x10000; gps_conf.CAPABILITIES = 0x7; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index f9566196..3d1686d7 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -161,7 +161,6 @@ typedef struct loc_gps_cfg_s { unsigned long INTERMEDIATE_POS; unsigned long ACCURACY_THRES; - unsigned long ENABLE_WIPER; unsigned long SUPL_VER; unsigned long CAPABILITIES; unsigned long QUIPC_ENABLED; From cb12f393d26eab74c60129c44a681e6851e1c040 Mon Sep 17 00:00:00 2001 From: Satya Durga Srinivasu Prabhala Date: Tue, 13 Aug 2013 19:24:41 -0700 Subject: [PATCH 157/945] Replace sysdev path sysdev gets deprecated in 3.10 Kernel. Hence, replacing sysdev path with relevant path/s. Change-Id: I8fbb1959ba4dfba34fdac6d271e59fd25237f899 --- utils/loc_target.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 26df4cb1..d68d6c9f 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -85,8 +85,10 @@ unsigned int get_target(void) { unsigned int target = TARGET_DEFAULT; - char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; - char id[] = "/sys/devices/system/soc/soc0/id"; + char hw_platform[] = "/sys/devices/soc0/hw_platform"; + char id[] = "/sys/devices/soc0/soc_id"; + char hw_platform_dep[] = "/sys/devices/system/soc/soc0/hw_platform"; + char id_dep[] = "/sys/devices/system/soc/soc0/id"; char mdm[] = "/dev/mdm"; // No such file or directory char rd_hw_platform[LINE_LEN]; @@ -95,8 +97,16 @@ unsigned int get_target(void) char baseband[LINE_LEN]; property_get("ro.baseband", baseband, ""); - read_a_line(hw_platform, rd_hw_platform, LINE_LEN); - read_a_line( id, rd_id, LINE_LEN); + 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); + } if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) From 318419880311037e5fae834077d49fb56b9eb6e2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 19 Aug 2013 13:57:20 -0700 Subject: [PATCH 158/945] conditionally handle the XTRA download request This may be a temporary fix to filter the reqeust here, because this point the xtra data is already downloaded. Next we should look at how to save the download itself. Change-Id: I0efba22df3d8d330c03a157a07c7ee490a22027d --- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 45822867..02999bb9 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -137,7 +137,9 @@ int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); + if (adapter->mAgpsEnabled) { + adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); + } return 0; } From 42211a946a6aee83666d80fa4eede1e95f4135eb Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Fri, 16 Aug 2013 23:29:00 +0530 Subject: [PATCH 159/945] Resolved On-Demand XTRA time injection issue Resolved issue where XTRA data was being requested instead of time during On-Demand time injection. CRs-Fixed: 530415 Change-Id: Ibf057073dc4eddc011f5df5c13d60eb552eec8c9 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 2cc3e3a3..116a8ae7 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -209,7 +209,7 @@ inline bool LocEngAdapter::requestTime() { if (mAgpsEnabled) { - sendMsg(new LocEngRequestXtra(mOwner)); + sendMsg(new LocEngRequestTime(mOwner)); } return mAgpsEnabled; } From 961d1bdae7041ccace312d894156c674eaf8f763 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Wed, 21 Aug 2013 17:46:13 -0700 Subject: [PATCH 160/945] Fix for the crash that was caused when accessing UlpProxy Changes to ensure that we dont free UlpProxy object by mistake when loc_init is invoked twice. CRs-Fixed: 532599 Change-Id: I0989368b67614181b3d834e61690211497663352 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 116a8ae7..9545681a 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -90,6 +90,11 @@ LocEngAdapter::~LocEngAdapter() 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; + } delete mUlp; LOC_LOGV("%s] %p", __func__, ulp); if (NULL == ulp) { From 112751962e4f72dfe9db4ba65dfba2657127f38b Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 21 Aug 2013 17:57:17 -0700 Subject: [PATCH 161/945] Add API to read and write GPS lock values This change adds an interface to set and get values for the GPS lock Change-Id: I8c83b693fe4c3e6edc9cc5c8c5cbf8471e332c86 --- core/LocApiBase.cpp | 6 +++ core/LocApiBase.h | 14 +++++ .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 15 +++++- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 52 +++++++++++++++++++ loc_api/libloc_api_50001/LocEngAdapter.h | 20 +++++++ 5 files changed, 106 insertions(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index f50d3e14..3dad37db 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -425,5 +425,11 @@ void LocApiBase:: closeDataCall() DEFAULT_IMPL() +int LocApiBase:: + setGpsLock(unsigned int lock) +DEFAULT_IMPL(-1) +int LocApiBase:: + getGpsLock() +DEFAULT_IMPL(-1) } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 87facf1b..861b36f5 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -180,6 +180,20 @@ public: virtual void closeDataCall(); inline 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(unsigned int lock); + /* + Returns + Current value of GPS Lock on success + -1 on failure + */ + virtual int getGpsLock(void); }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 1b4f3f74..55550e74 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -115,8 +115,21 @@ public: 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(unsigned int lock); + /* + Returns + Current value of GPS Lock on success + -1 on failure + */ + virtual int getGpsLock(void); }; extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 428d5a20..08474fc4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -1391,3 +1391,55 @@ LocApiBase* getLocApi(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask) { return new LocApiRpc(msgTask, exMask); } + +/*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(unsigned int lock) +{ + rpc_loc_ioctl_data_u_type ioctl_data; + boolean ret_val; + LOC_LOGD("%s:%d]: lock: %d\n", __func__, __LINE__, lock); + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = (rpc_loc_lock_e_type)lock; + 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/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 6ad3ba98..53a5aca0 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -266,6 +266,26 @@ public: { return mNavigating; } inline void setInSession(bool inSession) { mNavigating = inSession; mLocApi->setInSession(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 + */ + inline int setGpsLock(unsigned int lock) + { + return mLocApi->setGpsLock(lock); + } + /* + Returns + Current value of GPS lock on success + -1 on failure + */ + inline int getGpsLock() + { + return mLocApi->getGpsLock(); + } }; #endif //LOC_API_ENG_ADAPTER_H From 77ae63f106bd3d3426bdcb73599793ce88d3b1de Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 26 Aug 2013 16:16:10 -0700 Subject: [PATCH 162/945] Removed the ability to configure XTRA server query Changes to gps.conf to remove the ability to enable XTRA server query. This is because server info will be obtained from the modem xtra data download request. CRs-Fixed: 513543 Change-Id: Ia6a2b898e27dbac041064f69c534489102680050 --- etc/gps.conf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 539c3a12..ad38567f 100755 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,10 +1,3 @@ -# XTRA_SERVER_QUERY (1=on, 0=off) -# If XTRA_SERVER_QUERY is on, the XTRA_SERVERs listed -# below will be ignored, and instead the servers will -# be queried from the modem. -XTRA_SERVER_QUERY=0 -# XTRA_SERVERs below are used only if XTRA_SERVER_QUERY -# is off. XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin From 05b385d8e0c806437aa0bc30fa8ab7358efcf2f9 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 26 Aug 2013 19:06:19 -0700 Subject: [PATCH 163/945] Separated NMEA GSV for GPS and GLONASS Generate GPGSV and GLGSV sentence separately rather than combination according to satelite prn number. CRs-Fixed: 491156 Change-Id: Ie2bc60ae680a75cbe95702a7f842c1546a3a2f21 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 157 ++++++++++++++++++---- 1 file changed, 132 insertions(+), 25 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index f5f746b2..eb7fd1dc 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -29,7 +29,10 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_eng_nmea" - +#define GPS_PRN_START 1 +#define GPS_PRN_END 32 +#define GLONASS_PRN_START 65 +#define GLONASS_PRN_END 96 #include #include #include @@ -605,12 +608,33 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, 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 + + for(svNumber=1; svNumber <= svCount; svNumber++) { + if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START)&& + (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + { + gpsCount++; + } + else if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) + { + glnCount++; + } + } // ------------------ // ------$GPGSV------ // ------------------ - if (svStatus.num_svs <= 0) + if (gpsCount <= 0) { // no svs in view, so just send a blank $GPGSV sentence strlcpy(sentence, "$GPGSV,1,1,0,", sizeof(sentence)); @@ -619,12 +643,9 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, } else { - int svCount = svStatus.num_svs; - int sentenceCount = svCount / 4; - if (svStatus.num_svs % 4) - sentenceCount++; - int sentenceNumber = 1; - int svNumber = 1; + svNumber = 1; + sentenceNumber = 1; + sentenceCount = gpsCount/4 + (gpsCount % 4 != 0); while (sentenceNumber <= sentenceCount) { @@ -642,26 +663,16 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - for (int i=0; (svNumber <= svCount) && (i < 4); i++, svNumber++) + for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) { - length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", svStatus.sv_list[svNumber-1].prn, (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int (int)(0.5 + svStatus.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.sv_list[svNumber-1].snr > 0) - { - length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int - if (length < 0 || length >= lengthRemaining) { LOC_LOGE("NMEA Error in string formatting"); @@ -669,15 +680,111 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, } pMarker += length; lengthRemaining -= length; - } + + if (svStatus.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //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, svCount); + + 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( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) { + + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svStatus.sv_list[svNumber-1].prn, + (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int + (int)(0.5 + svStatus.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.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //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 if (svStatus.used_in_fix_mask == 0) { // No sv used, so there will be no position report, so send From e399053ebbbdc247e24509e350a45cee357ec771 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 27 Aug 2013 16:26:45 -0700 Subject: [PATCH 164/945] Initialize DS client in the msg thread In order to avoid a synchronous call from Location Manager to the data layer, the call to initialize the data client is sent as a msg to the MsgTask so that it gets handled in a separate thread CRs-fixed: 535079 Change-Id: I3d7a72c32eb629572178c90dc4f55c3d74443332 --- loc_api/libloc_api_50001/loc_eng.cpp | 33 +++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index d23516ef..80a20a3d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -188,7 +188,7 @@ static int loc_eng_stop_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 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) @@ -1372,6 +1372,29 @@ inline void LocEngUp::log() const { locallog(); } +struct LocEngDataClientInit : public LocMsg { + loc_eng_data_s_type* mLocEng; + inline LocEngDataClientInit(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); + } + virtual void proc() const { + loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; + if(!locEng->adapter->initDataServiceClient()) { + locEng->ds_nif = new DSStateMachine(servicerTypeExt, + (void *)dataCallCb, + locEng->adapter); + } + } + void locallog() const { + LOC_LOGV("LocEngDataClientInit\n"); + } + virtual void log() const { + locallog(); + } +}; + + /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -1982,13 +2005,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - if(!loc_eng_data.adapter->initDataServiceClient()) { - LOC_LOGD("%s:%d]: Creating new ds state machine\n", __func__, __LINE__); - loc_eng_data.ds_nif = new DSStateMachine(servicerTypeExt, - (void *)dataCallCb, - loc_eng_data.adapter); - LOC_LOGD("%s:%d]: Created new ds state machine\n", __func__, __LINE__); - } + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); From cdeaa6e0f64b7a417097d5a419640d742f642d06 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Thu, 29 Aug 2013 14:53:55 -0700 Subject: [PATCH 165/945] Fixes a bug in sessionCheck() for all adapters Changes to ensure the code breaks out of the adapter session check loop once any one of them is in session. Change-Id: I73b3a5f4954050abf5ce3d4c5a04245c894725f2 CRs-Fixed: 534811 --- core/LocApiBase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3dad37db..6ba72f9e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -123,7 +123,11 @@ bool LocApiBase::isInSession() { bool inSession = false; - TO_ALL_LOCADAPTERS(inSession = mLocAdapters[i]->isInSession()); + for (int i = 0; + !inSession && i < MAX_ADAPTERS && NULL != mLocAdapters[i]; + i++) { + inSession = mLocAdapters[i]->isInSession(); + } return inSession; } From 50fa10247ae55433a1c7173b673f0247f9899512 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Thu, 29 Aug 2013 14:25:53 -0700 Subject: [PATCH 166/945] Adding check of on_demand_time for inject time Before injecting time, check the gps ON_DEMAND_TIME capability. if it is disabled, it will not sent time inject command. Change-Id: Ie51cf1f65e086bdb49d6159051c3d66700b25d78 --- loc_api/libloc_api_50001/loc_eng.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3f11a1a6..e1ed9376 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1163,10 +1163,12 @@ LocEngRequestTime::LocEngRequestTime(void* locEng) : } void LocEngRequestTime::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->request_utc_time_cb != NULL) { - locEng->request_utc_time_cb(); - } else { - LOC_LOGE("Callback function for request time is NULL"); + 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 { From ef7a8694d7f3e7004ecd66cfb3038526866914d0 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Wed, 4 Sep 2013 09:29:10 -0700 Subject: [PATCH 167/945] Small fixes to conditionally launch the BIT Interface thread Changes to launch the BIT service request handler thread only if AggpsExt is present. Small formatting fixes for pritining the IP address. Change-Id: Iaf3b9bd6d967ba35b04b591750784c5f221ee539 --- loc_api/libloc_api_50001/loc_eng.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 77a6bd1c..c0781d52 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -929,10 +929,10 @@ void LocEngReqRelBIT::proc() const { } inline void LocEngReqRelBIT::locallog() const { LOC_LOGV("LocEngRequestBIT - ipv4: %d.%d.%d.%d, ipv6: %s", - (unsigned char)(mIPv4Addr>>24), - (unsigned char)(mIPv4Addr>>16), - (unsigned char)(mIPv4Addr>>8), (unsigned char)mIPv4Addr, + (unsigned char)(mIPv4Addr>>8), + (unsigned char)(mIPv4Addr>>16), + (unsigned char)(mIPv4Addr>>24), NULL != mIPv6Addr ? mIPv6Addr : ""); } inline void LocEngReqRelBIT::log() const { @@ -1988,7 +1988,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call __func__, __LINE__); return; } - + LocEngAdapter* adapter = loc_eng_data.adapter; loc_eng_data.agps_status_cb = callbacks->status_cb; loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, @@ -2005,9 +2005,10 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call true); loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, - NULL, NULL, &loc_eng_data); - + if (adapter->mAgpsEnabled) { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } loc_eng_agps_reinit(loc_eng_data); EXIT_LOG(%s, VOID_RET); } From a75c8b33d5c07453e6c682c39d17045b082a889b Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 3 Sep 2013 09:45:44 -0700 Subject: [PATCH 168/945] Bug fixed in AGPS checks Fixed conditional check from MSA|MSA to MSA|MSB. Bug was introduced in commit 782431a CRs-Fixed: 533849 Change-Id: I7931563e08c5c875b49cc9ada2969a34373a2890 --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3f11a1a6..9b89c25c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1454,7 +1454,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, //Disable AGPS if capabilities are not present if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA)) { + !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { event &= ~(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST); } From 9f6259f0bcf9da22fd3dae37fa05f7d2c2aa60c5 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Thu, 5 Sep 2013 11:05:12 -0700 Subject: [PATCH 169/945] Avoid multiple xtra download after booting To avoid multiple xtra data auto-downloading, the change delete the 3 xtra URL in gps.conf used by GpsLocationProvider. Meanwhile, GPS HAL become to allow GLP send Xtra data to modem. CRs: 537744 Change-Id: I27f3122f4ecd1d4da4323e9c59bd0358f3d635f2 --- etc/gps.conf | 8 +++++--- loc_api/libloc_api_50001/loc_eng.cpp | 8 ++++---- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 4 +--- 3 files changed, 10 insertions(+), 10 deletions(-) mode change 100755 => 100644 etc/gps.conf diff --git a/etc/gps.conf b/etc/gps.conf old mode 100755 new mode 100644 index ad38567f..5c9b4d3b --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,6 +1,8 @@ -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +#Uncommenting these urls would only enable +#the power up auto injection and force injection(test case). +#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin +#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin +#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin # Error Estimate # _SET = 1 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 77a6bd1c..7165c528 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1781,10 +1781,10 @@ int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if (adapter->mAgpsEnabled) { - adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference, - uncertainty)); - } + + adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference, + uncertainty)); + EXIT_LOG(%d, 0); return 0; } diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 02999bb9..45822867 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -137,9 +137,7 @@ int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { LocEngAdapter* adapter = loc_eng_data.adapter; - if (adapter->mAgpsEnabled) { - adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); - } + adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); return 0; } From b7b7fb9230be982778ffe877107017f9b4b403a1 Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Mon, 9 Sep 2013 16:34:26 -0700 Subject: [PATCH 170/945] Fixes a bug in the reporting for MSA sessions Changes to ensure that positions reported with TECH_MASK_HYBRID are also updated to the location clients. CRs-Fixed: 537773 Change-Id: I09c7d440369d8fc37abd069fbefc2c7e23414ab1 --- loc_api/libloc_api_50001/loc_eng.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3f3fffc9..c1787577 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -700,7 +700,8 @@ void LocEngReportPosition::proc() const { // 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_SENSORS | + LOC_POS_TECH_MASK_HYBRID) & mTechMask)) || (LOC_SESS_INTERMEDIATE == locEng->intermediateFix && !((mLocation.gpsLocation.flags & From 530086a52d862eb9bcf5fd86a56321d587529b9c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 4 Sep 2013 17:51:18 -0700 Subject: [PATCH 171/945] Fix ATL handling Always register for ATL events reguardless of hw target or MSA/MSB capabilities. For APQ target, do not handle certain types of ATL events that it doen't support. For APQ target, use only position mode of Standalone. CRs-fixed: 533932 Change-Id: Icd626e3e7155d5c2ba871a343430e441924ce93c --- loc_api/libloc_api_50001/loc.cpp | 14 +-- loc_api/libloc_api_50001/loc_eng.cpp | 146 ++++++++++++++++----------- utils/loc_target.cpp | 14 +-- utils/loc_target.h | 1 + 4 files changed, 95 insertions(+), 80 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 90b3b86e..6cca8544 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -571,19 +571,7 @@ const void* loc_get_extension(const char* name) } else if (strcmp(name, AGPS_INTERFACE) == 0) { - //Return an interface to AGPS only if MSA or MSB capabilities - //are present. If the target is an APQ, these masks are - //cleared in get_gps_interface() and the below logic will - //return NULL as the interface for AGPS - if((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { - LOC_LOGD("%s:%d]: AGPS capabilities found\n", __func__, __LINE__); - ret_val = &sLocEngAGpsInterface; - } - else { - LOC_LOGD("%s:%d]: Returning NULL AgpsInterface\n", __func__, __LINE__); - ret_val = NULL; - } + ret_val = &sLocEngAGpsInterface; } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c1787577..90df5290 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -979,8 +979,10 @@ LocEngSuplEsOpened::LocEngSuplEsOpened(void* locEng) : } void LocEngSuplEsOpened::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_GRANTED); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_GRANTED); + } } void LocEngSuplEsOpened::locallog() const { LOC_LOGV("LocEngSuplEsOpened"); @@ -996,8 +998,10 @@ LocEngSuplEsClosed::LocEngSuplEsClosed(void* locEng) : } void LocEngSuplEsClosed::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_RELEASED); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_RELEASED); + } } void LocEngSuplEsClosed::locallog() const { LOC_LOGV("LocEngSuplEsClosed"); @@ -1014,9 +1018,13 @@ LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) : } void LocEngRequestSuplEs::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - DSSubscriber s(sm, mID); - sm->subscribeRsrc((Subscriber*)&s); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + DSSubscriber s(sm, mID); + sm->subscribeRsrc((Subscriber*)&s); + } else { + locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1); + } } inline void LocEngRequestSuplEs::locallog() const { LOC_LOGV("LocEngRequestSuplEs"); @@ -1035,11 +1043,15 @@ void LocEngRequestATL::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; AgpsStateMachine* sm = (AgpsStateMachine*) getAgpsStateMachine(*locEng, mType); - ATLSubscriber s(mID, - sm, - locEng->adapter, - AGPS_TYPE_INVALID == mType); - sm->subscribeRsrc((Subscriber*)&s); + 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"); @@ -1055,28 +1067,38 @@ LocEngReleaseATL::LocEngReleaseATL(void* locEng, int id) : } void LocEngReleaseATL::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - 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__); - } else { + + 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__); - } else { - DSSubscriber s3(locEng->ds_nif, mID); - if(locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", - __func__, __LINE__); - } else { - LOC_LOGW("%s:%d]: Could not release ATL. " - "No subscribers found\n", - __func__, __LINE__); - locEng->adapter->atlCloseStatus(mID, 0); - } + 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"); @@ -1110,11 +1132,15 @@ LocEngReqRelWifi::~LocEngReqRelWifi() { } void LocEngReqRelWifi::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); - if (mIsReq) { - locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + if (locEng->wifi_nif) { + WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); + if (mIsReq) { + locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + } else { + locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + } } else { - locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); } } inline void LocEngReqRelWifi::locallog() const { @@ -1478,13 +1504,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } - //Disable AGPS if capabilities are not present - if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { - event &= ~(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | - LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST); - } - loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, (MsgTask::tCreate)callbacks->create_thread_cb); @@ -1752,6 +1771,13 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); + // The position mode for APQ target can only be standalone + bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); + if (isAPQ && params.mode != LOC_POSITION_MODE_STANDALONE) { + params.mode = LOC_POSITION_MODE_STANDALONE; + LOC_LOGD("Position mode changed to standalone for APQ target."); + } + if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) { LocEngAdapter* adapter = loc_eng_data.adapter; @@ -1976,28 +2002,14 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call STATE_CHECK((NULL == loc_eng_data.agps_status_cb), "agps instance already initialized", return); - if(callbacks == NULL) { + if (callbacks == NULL) { LOC_LOGE("loc_eng_agps_init: bad parameters cb %p", callbacks); EXIT_LOG(%s, VOID_RET); return; } - - //Proceed to create AGPS framework only if MSA or MSB capabilities - //are present. If the target is an APQ, these masks are - //cleared in get_gps_interface() - if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { - LOC_LOGD("%s:%d]: No AGPS capabilities found. Returning\n", - __func__, __LINE__); - return; - } LocEngAdapter* adapter = loc_eng_data.adapter; loc_eng_data.agps_status_cb = callbacks->status_cb; - loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL, - false); loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WWAN_ANY, @@ -2006,13 +2018,23 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - if (adapter->mAgpsEnabled) { - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, - NULL, NULL, &loc_eng_data); + bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); + if (!isAPQ) { + loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL, + false); + + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + + if (adapter->mAgpsEnabled) { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + loc_eng_agps_reinit(loc_eng_data); } - loc_eng_agps_reinit(loc_eng_data); + EXIT_LOG(%s, VOID_RET); } @@ -2437,8 +2459,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_reinit(loc_eng_data); if (loc_eng_data.agps_status_cb != NULL) { - loc_eng_data.agnss_nif->dropAllSubscribers(); - loc_eng_data.internet_nif->dropAllSubscribers(); + 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); } diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d68d6c9f..cd781c05 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -58,6 +58,7 @@ #define GPS_CHECK_NO_GPS_HW 1 static int gss_fd = 0; +static unsigned int gTarget = TARGET_UNKNOWN; static int read_a_line(const char * file_path, char * line, int line_size) { @@ -83,7 +84,8 @@ static int read_a_line(const char * file_path, char * line, int line_size) unsigned int get_target(void) { - unsigned int target = TARGET_DEFAULT; + if (gTarget != TARGET_UNKNOWN) + return gTarget; char hw_platform[] = "/sys/devices/soc0/hw_platform"; char id[] = "/sys/devices/soc0/soc_id"; @@ -111,9 +113,9 @@ unsigned int get_target(void) 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)]) ) - target = TARGET_MPQ; + gTarget = TARGET_MPQ; else - target = TARGET_APQ_SA; + gTarget = TARGET_APQ_SA; } else { if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) @@ -124,13 +126,13 @@ unsigned int get_target(void) && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { if (!read_a_line( mdm, rd_mdm, LINE_LEN)) - target = TARGET_MDM; + 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)])) ) - target = TARGET_MSM_NO_SSC; + gTarget = TARGET_MSM_NO_SSC; } - return target; + return gTarget; } diff --git a/utils/loc_target.h b/utils/loc_target.h index 12cff1d2..be68f928 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -34,6 +34,7 @@ #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) +#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) #ifdef __cplusplus From 311e38bcfe0523ca3df06decbcb79ad8bad81847 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 27 Aug 2013 17:43:51 -0700 Subject: [PATCH 172/945] Missing check to build inside libloc_core BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE needs to be checked inside all gps hal module makefiles. libloc_core was missing this check. Change-Id: Ica508bcd2dc0747e354f43d7d87af5b2b06d1437 --- core/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/Android.mk b/core/Android.mk index ef0dd385..298c4131 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -1,3 +1,4 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) LOCAL_PATH := $(call my-dir) @@ -48,3 +49,4 @@ LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE From 73573ef752430b0d54772e9167bb90cf44691351 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 4 Sep 2013 17:51:18 -0700 Subject: [PATCH 173/945] Fix ATL handling Always register for ATL events reguardless of hw target or MSA/MSB capabilities. For APQ target, do not handle certain types of ATL events that it doen't support. For APQ target, use only position mode of Standalone. CRs-fixed: 533932 Change-Id: Icd626e3e7155d5c2ba871a343430e441924ce93c --- loc_api/libloc_api_50001/loc.cpp | 14 +-- loc_api/libloc_api_50001/loc_eng.cpp | 146 ++++++++++++++++----------- utils/loc_target.cpp | 14 +-- utils/loc_target.h | 1 + 4 files changed, 95 insertions(+), 80 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 90b3b86e..6cca8544 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -571,19 +571,7 @@ const void* loc_get_extension(const char* name) } else if (strcmp(name, AGPS_INTERFACE) == 0) { - //Return an interface to AGPS only if MSA or MSB capabilities - //are present. If the target is an APQ, these masks are - //cleared in get_gps_interface() and the below logic will - //return NULL as the interface for AGPS - if((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { - LOC_LOGD("%s:%d]: AGPS capabilities found\n", __func__, __LINE__); - ret_val = &sLocEngAGpsInterface; - } - else { - LOC_LOGD("%s:%d]: Returning NULL AgpsInterface\n", __func__, __LINE__); - ret_val = NULL; - } + ret_val = &sLocEngAGpsInterface; } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3f3fffc9..ad6e54fa 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -978,8 +978,10 @@ LocEngSuplEsOpened::LocEngSuplEsOpened(void* locEng) : } void LocEngSuplEsOpened::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_GRANTED); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_GRANTED); + } } void LocEngSuplEsOpened::locallog() const { LOC_LOGV("LocEngSuplEsOpened"); @@ -995,8 +997,10 @@ LocEngSuplEsClosed::LocEngSuplEsClosed(void* locEng) : } void LocEngSuplEsClosed::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_RELEASED); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_RELEASED); + } } void LocEngSuplEsClosed::locallog() const { LOC_LOGV("LocEngSuplEsClosed"); @@ -1013,9 +1017,13 @@ LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) : } void LocEngRequestSuplEs::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = locEng->ds_nif; - DSSubscriber s(sm, mID); - sm->subscribeRsrc((Subscriber*)&s); + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + DSSubscriber s(sm, mID); + sm->subscribeRsrc((Subscriber*)&s); + } else { + locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1); + } } inline void LocEngRequestSuplEs::locallog() const { LOC_LOGV("LocEngRequestSuplEs"); @@ -1034,11 +1042,15 @@ void LocEngRequestATL::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; AgpsStateMachine* sm = (AgpsStateMachine*) getAgpsStateMachine(*locEng, mType); - ATLSubscriber s(mID, - sm, - locEng->adapter, - AGPS_TYPE_INVALID == mType); - sm->subscribeRsrc((Subscriber*)&s); + 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"); @@ -1054,28 +1066,38 @@ LocEngReleaseATL::LocEngReleaseATL(void* locEng, int id) : } void LocEngReleaseATL::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - 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__); - } else { + + 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__); - } else { - DSSubscriber s3(locEng->ds_nif, mID); - if(locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", - __func__, __LINE__); - } else { - LOC_LOGW("%s:%d]: Could not release ATL. " - "No subscribers found\n", - __func__, __LINE__); - locEng->adapter->atlCloseStatus(mID, 0); - } + 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"); @@ -1109,11 +1131,15 @@ LocEngReqRelWifi::~LocEngReqRelWifi() { } void LocEngReqRelWifi::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); - if (mIsReq) { - locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + if (locEng->wifi_nif) { + WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); + if (mIsReq) { + locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + } else { + locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + } } else { - locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); } } inline void LocEngReqRelWifi::locallog() const { @@ -1477,13 +1503,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.generateNmea = false; } - //Disable AGPS if capabilities are not present - if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { - event &= ~(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | - LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST); - } - loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, (MsgTask::tCreate)callbacks->create_thread_cb); @@ -1751,6 +1770,13 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); + // The position mode for APQ target can only be standalone + bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); + if (isAPQ && params.mode != LOC_POSITION_MODE_STANDALONE) { + params.mode = LOC_POSITION_MODE_STANDALONE; + LOC_LOGD("Position mode changed to standalone for APQ target."); + } + if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) { LocEngAdapter* adapter = loc_eng_data.adapter; @@ -1975,28 +2001,14 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call STATE_CHECK((NULL == loc_eng_data.agps_status_cb), "agps instance already initialized", return); - if(callbacks == NULL) { + if (callbacks == NULL) { LOC_LOGE("loc_eng_agps_init: bad parameters cb %p", callbacks); EXIT_LOG(%s, VOID_RET); return; } - - //Proceed to create AGPS framework only if MSA or MSB capabilities - //are present. If the target is an APQ, these masks are - //cleared in get_gps_interface() - if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) { - LOC_LOGD("%s:%d]: No AGPS capabilities found. Returning\n", - __func__, __LINE__); - return; - } LocEngAdapter* adapter = loc_eng_data.adapter; loc_eng_data.agps_status_cb = callbacks->status_cb; - loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL, - false); loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WWAN_ANY, @@ -2005,13 +2017,23 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_WIFI, true); - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - if (adapter->mAgpsEnabled) { - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, - NULL, NULL, &loc_eng_data); + bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); + if (!isAPQ) { + loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL, + false); + + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + + if (adapter->mAgpsEnabled) { + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + loc_eng_agps_reinit(loc_eng_data); } - loc_eng_agps_reinit(loc_eng_data); + EXIT_LOG(%s, VOID_RET); } @@ -2436,8 +2458,10 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_reinit(loc_eng_data); if (loc_eng_data.agps_status_cb != NULL) { - loc_eng_data.agnss_nif->dropAllSubscribers(); - loc_eng_data.internet_nif->dropAllSubscribers(); + 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); } diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d68d6c9f..cd781c05 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -58,6 +58,7 @@ #define GPS_CHECK_NO_GPS_HW 1 static int gss_fd = 0; +static unsigned int gTarget = TARGET_UNKNOWN; static int read_a_line(const char * file_path, char * line, int line_size) { @@ -83,7 +84,8 @@ static int read_a_line(const char * file_path, char * line, int line_size) unsigned int get_target(void) { - unsigned int target = TARGET_DEFAULT; + if (gTarget != TARGET_UNKNOWN) + return gTarget; char hw_platform[] = "/sys/devices/soc0/hw_platform"; char id[] = "/sys/devices/soc0/soc_id"; @@ -111,9 +113,9 @@ unsigned int get_target(void) 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)]) ) - target = TARGET_MPQ; + gTarget = TARGET_MPQ; else - target = TARGET_APQ_SA; + gTarget = TARGET_APQ_SA; } else { if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) @@ -124,13 +126,13 @@ unsigned int get_target(void) && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { if (!read_a_line( mdm, rd_mdm, LINE_LEN)) - target = TARGET_MDM; + 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)])) ) - target = TARGET_MSM_NO_SSC; + gTarget = TARGET_MSM_NO_SSC; } - return target; + return gTarget; } diff --git a/utils/loc_target.h b/utils/loc_target.h index 12cff1d2..be68f928 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -34,6 +34,7 @@ #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) +#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) #ifdef __cplusplus From 81c423125c5ec95c4293d8f8dc893a611070a28c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 17 Sep 2013 10:19:55 -0700 Subject: [PATCH 174/945] Add LocApi to get Zpp fix. Added get zpp fix API so that different other features can make use of this feature in the AP space. Change-Id: I32e750626704c5d0069723ee1ca949fda4a5505e --- core/LocApiBase.cpp | 4 ++++ core/LocApiBase.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 6ba72f9e..577d21bf 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -413,6 +413,10 @@ enum loc_api_adapter_err LocApiBase:: setAGLONASSProtocol(unsigned long aGlonassProtocol) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +enum loc_api_adapter_err LocApiBase:: + getZppFix(GpsLocation & zppLoc) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + int LocApiBase:: initDataServiceClient() DEFAULT_IMPL(-1) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 861b36f5..2fcac845 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -174,6 +174,8 @@ public: setExtPowerConfig(int isBatteryCharging); virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); + virtual enum loc_api_adapter_err + getZppFix(GpsLocation & zppLoc); virtual int initDataServiceClient(); virtual int openAndStartDataCall(); virtual void stopDataCall(); From 2daacc49050c81ec08d1383613ba81aa97908a99 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 17 Sep 2013 10:19:55 -0700 Subject: [PATCH 175/945] Add LocApi to get Zpp fix. Added get zpp fix API so that different other features can make use of this feature in the AP space. Change-Id: I32e750626704c5d0069723ee1ca949fda4a5505e --- core/LocApiBase.cpp | 4 ++++ core/LocApiBase.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 6ba72f9e..577d21bf 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -413,6 +413,10 @@ enum loc_api_adapter_err LocApiBase:: setAGLONASSProtocol(unsigned long aGlonassProtocol) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +enum loc_api_adapter_err LocApiBase:: + getZppFix(GpsLocation & zppLoc) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + int LocApiBase:: initDataServiceClient() DEFAULT_IMPL(-1) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 861b36f5..2fcac845 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -174,6 +174,8 @@ public: setExtPowerConfig(int isBatteryCharging); virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); + virtual enum loc_api_adapter_err + getZppFix(GpsLocation & zppLoc); virtual int initDataServiceClient(); virtual int openAndStartDataCall(); virtual void stopDataCall(); From eb726cbd2e2f8282e5a0b7b4408006decb19e37e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 23 Sep 2013 16:50:09 -0700 Subject: [PATCH 176/945] Add check for mAgpsEnabled requestSuplES did not have the check for mAgpsEnabled Change-Id: I314fe6bc933e5201e1ac6c6632ee3b53240955b1 CRs-fixed: 543639 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 9545681a..5224473f 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -234,8 +234,9 @@ bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) inline bool LocEngAdapter::requestSuplES(int connHandle) { - sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return true; + if (mAgpsEnabled) + sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); + return mAgpsEnabled; } inline From c66c2fc5f6451e78b63c1eee3febcfe7b703e751 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 23 Sep 2013 16:50:09 -0700 Subject: [PATCH 177/945] Add check for mAgpsEnabled requestSuplES did not have the check for mAgpsEnabled Change-Id: I314fe6bc933e5201e1ac6c6632ee3b53240955b1 CRs-fixed: 543639 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 9545681a..5224473f 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -234,8 +234,9 @@ bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) inline bool LocEngAdapter::requestSuplES(int connHandle) { - sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return true; + if (mAgpsEnabled) + sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); + return mAgpsEnabled; } inline From 4dbc22bd5742529ddaa0939e4bf24d15f749ad03 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Fri, 13 Sep 2013 18:38:26 -0700 Subject: [PATCH 178/945] Changes for liblbs_core Added new module liblbs_core to make LocApiV02 independent of pre-built binaries. This patch provies the necessary changes to support the new module CRs-fixed: 538124 Change-Id: I716cf169de9dae164a141651af971793099a927d --- core/Android.mk | 2 +- core/ContextBase.cpp | 15 ++++++++------- core/ContextBase.h | 12 ++++++------ core/{IzatProxyBase.h => LBSProxyBase.h} | 9 ++++----- core/LocApiBase.cpp | 5 +++++ core/LocApiBase.h | 7 ++++--- core/LocDualContext.cpp | 2 +- 7 files changed, 29 insertions(+), 23 deletions(-) rename core/{IzatProxyBase.h => LBSProxyBase.h} (94%) diff --git a/core/Android.mk b/core/Android.mk index 298c4131..11cecc65 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -38,7 +38,7 @@ LOCAL_COPY_HEADERS:= \ LocAdapterBase.h \ ContextBase.h \ LocDualContext.h \ - IzatProxyBase.h \ + LBSProxyBase.h \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1826ec79..7879015f 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,21 +40,22 @@ namespace loc_core { - -IzatProxyBase* ContextBase::getIzatProxy(const char* libName) +LBSProxyBase* ContextBase::getLBSProxy(const char* libName) { - IzatProxyBase* proxy = NULL; + LBSProxyBase* proxy = NULL; + LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); void* lib = dlopen(libName, RTLD_NOW); if ((void*)NULL != lib) { - getIzatProxy_t* getter = (getIzatProxy_t*)dlsym(lib, "getIzatProxy"); + getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); if (NULL != getter) { proxy = (*getter)(); } } if (NULL == proxy) { - proxy = new IzatProxyBase(); + proxy = new LBSProxyBase(); } + LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); return proxy; } @@ -64,7 +65,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != get_target()) { - if (NULL == (locApi = mIzatProxy->getLocApi(mMsgTask, exMask))) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); if (NULL != handle) { @@ -88,7 +89,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) ContextBase::ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName) : - mIzatProxy(getIzatProxy(libName)), + mLBSProxy(getLBSProxy(libName)), mMsgTask(msgTask), mLocApi(createLocApi(exMask)) { diff --git a/core/ContextBase.h b/core/ContextBase.h index fc60db42..93cb31ff 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -33,17 +33,17 @@ #include #include #include -#include +#include namespace loc_core { class LocAdapterBase; class ContextBase { - static IzatProxyBase* getIzatProxy(const char* libName); + static LBSProxyBase* getLBSProxy(const char* libName); LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); protected: - const IzatProxyBase* mIzatProxy; + const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; @@ -51,14 +51,14 @@ public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName); - inline virtual ~ContextBase() { delete mLocApi; delete mIzatProxy; } + inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } - inline bool hasAgpsExt() { return mIzatProxy->hasAgpsExt(); } + inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { - mIzatProxy->requestUlp(adapter, capabilities); + mLBSProxy->requestUlp(adapter, capabilities); } }; diff --git a/core/IzatProxyBase.h b/core/LBSProxyBase.h similarity index 94% rename from core/IzatProxyBase.h rename to core/LBSProxyBase.h index e7e3d3fa..e643d126 100644 --- a/core/IzatProxyBase.h +++ b/core/LBSProxyBase.h @@ -28,7 +28,6 @@ */ #ifndef IZAT_PROXY_BASE_H #define IZAT_PROXY_BASE_H - #include #include @@ -37,7 +36,7 @@ namespace loc_core { class LocApiBase; class LocAdapterBase; -class IzatProxyBase { +class LBSProxyBase { friend class ContextBase; inline virtual LocApiBase* getLocApi(const MsgTask* msgTask, @@ -45,15 +44,15 @@ class IzatProxyBase { return NULL; } protected: - inline IzatProxyBase() {} + inline LBSProxyBase() {} public: - inline virtual ~IzatProxyBase() {} + inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} inline virtual bool hasAgpsExt() const { return false; } }; -typedef IzatProxyBase* (getIzatProxy_t)(); +typedef LBSProxyBase* (getLBSProxy_t)(); } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 577d21bf..7a6456c1 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -296,6 +296,11 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void* LocApiBase :: getSibling() + DEFAULT_IMPL(NULL) +void* LocApiBase :: getSibling2() + DEFAULT_IMPL(NULL) + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 2fcac845..4ddc57f1 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -33,7 +33,7 @@ #include #include #include - +#include namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -77,8 +77,6 @@ protected: bool isInSession(); public: - inline virtual void* getSibling() { return NULL; } - void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); @@ -111,6 +109,9 @@ public: // 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 void* getSibling2(); virtual enum loc_api_adapter_err startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 5c0c9a72..86c3613a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -58,7 +58,7 @@ ContextBase* LocDualContext::mBgContext = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; -const char* LocDualContext::mIzatLibName = "libizat_core.so"; +const char* LocDualContext::mIzatLibName = "liblbs_core.so"; const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) From 969604adfde63faffabb733efa92df458e58d0a9 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Fri, 13 Sep 2013 18:38:26 -0700 Subject: [PATCH 179/945] Changes for liblbs_core Added new module liblbs_core to make LocApiV02 independent of pre-built binaries. This patch provies the necessary changes to support the new module CRs-fixed: 538124 Change-Id: I716cf169de9dae164a141651af971793099a927d --- core/Android.mk | 2 +- core/ContextBase.cpp | 15 ++++++++------- core/ContextBase.h | 12 ++++++------ core/{IzatProxyBase.h => LBSProxyBase.h} | 9 ++++----- core/LocApiBase.cpp | 5 +++++ core/LocApiBase.h | 7 ++++--- core/LocDualContext.cpp | 2 +- 7 files changed, 29 insertions(+), 23 deletions(-) rename core/{IzatProxyBase.h => LBSProxyBase.h} (94%) diff --git a/core/Android.mk b/core/Android.mk index 298c4131..11cecc65 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -38,7 +38,7 @@ LOCAL_COPY_HEADERS:= \ LocAdapterBase.h \ ContextBase.h \ LocDualContext.h \ - IzatProxyBase.h \ + LBSProxyBase.h \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1826ec79..7879015f 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,21 +40,22 @@ namespace loc_core { - -IzatProxyBase* ContextBase::getIzatProxy(const char* libName) +LBSProxyBase* ContextBase::getLBSProxy(const char* libName) { - IzatProxyBase* proxy = NULL; + LBSProxyBase* proxy = NULL; + LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); void* lib = dlopen(libName, RTLD_NOW); if ((void*)NULL != lib) { - getIzatProxy_t* getter = (getIzatProxy_t*)dlsym(lib, "getIzatProxy"); + getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); if (NULL != getter) { proxy = (*getter)(); } } if (NULL == proxy) { - proxy = new IzatProxyBase(); + proxy = new LBSProxyBase(); } + LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); return proxy; } @@ -64,7 +65,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != get_target()) { - if (NULL == (locApi = mIzatProxy->getLocApi(mMsgTask, exMask))) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); if (NULL != handle) { @@ -88,7 +89,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) ContextBase::ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName) : - mIzatProxy(getIzatProxy(libName)), + mLBSProxy(getLBSProxy(libName)), mMsgTask(msgTask), mLocApi(createLocApi(exMask)) { diff --git a/core/ContextBase.h b/core/ContextBase.h index fc60db42..93cb31ff 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -33,17 +33,17 @@ #include #include #include -#include +#include namespace loc_core { class LocAdapterBase; class ContextBase { - static IzatProxyBase* getIzatProxy(const char* libName); + static LBSProxyBase* getLBSProxy(const char* libName); LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); protected: - const IzatProxyBase* mIzatProxy; + const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; @@ -51,14 +51,14 @@ public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName); - inline virtual ~ContextBase() { delete mLocApi; delete mIzatProxy; } + inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } - inline bool hasAgpsExt() { return mIzatProxy->hasAgpsExt(); } + inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { - mIzatProxy->requestUlp(adapter, capabilities); + mLBSProxy->requestUlp(adapter, capabilities); } }; diff --git a/core/IzatProxyBase.h b/core/LBSProxyBase.h similarity index 94% rename from core/IzatProxyBase.h rename to core/LBSProxyBase.h index e7e3d3fa..e643d126 100644 --- a/core/IzatProxyBase.h +++ b/core/LBSProxyBase.h @@ -28,7 +28,6 @@ */ #ifndef IZAT_PROXY_BASE_H #define IZAT_PROXY_BASE_H - #include #include @@ -37,7 +36,7 @@ namespace loc_core { class LocApiBase; class LocAdapterBase; -class IzatProxyBase { +class LBSProxyBase { friend class ContextBase; inline virtual LocApiBase* getLocApi(const MsgTask* msgTask, @@ -45,15 +44,15 @@ class IzatProxyBase { return NULL; } protected: - inline IzatProxyBase() {} + inline LBSProxyBase() {} public: - inline virtual ~IzatProxyBase() {} + inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} inline virtual bool hasAgpsExt() const { return false; } }; -typedef IzatProxyBase* (getIzatProxy_t)(); +typedef LBSProxyBase* (getLBSProxy_t)(); } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 6ba72f9e..025bce02 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -296,6 +296,11 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void* LocApiBase :: getSibling() + DEFAULT_IMPL(NULL) +void* LocApiBase :: getSibling2() + DEFAULT_IMPL(NULL) + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 861b36f5..5542d4c3 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -33,7 +33,7 @@ #include #include #include - +#include namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -77,8 +77,6 @@ protected: bool isInSession(); public: - inline virtual void* getSibling() { return NULL; } - void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); @@ -111,6 +109,9 @@ public: // 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 void* getSibling2(); virtual enum loc_api_adapter_err startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 5c0c9a72..86c3613a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -58,7 +58,7 @@ ContextBase* LocDualContext::mBgContext = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; -const char* LocDualContext::mIzatLibName = "libizat_core.so"; +const char* LocDualContext::mIzatLibName = "liblbs_core.so"; const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) From e0e4cde06b605b5148dbe05c3d58b774a87ba16e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 25 Sep 2013 11:01:43 -0700 Subject: [PATCH 180/945] Send status report msg through ULP In order to preserve the ordering of position reports and status reports from the GPS engine, status reports are sent through the ULP too CRS-Fixed: 538143 Change-Id: I41be2121493c6a0b35a5726fd546eb0fa5e9b20c --- core/UlpProxyBase.h | 3 +++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 10 ++++++++-- loc_api/libloc_api_50001/LocEngAdapter.h | 1 + loc_api/libloc_api_50001/loc_eng.cpp | 7 ++++--- loc_api/libloc_api_50001/loc_eng_msg.h | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 02ba1678..0873748b 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -54,6 +54,9 @@ public: void* svExt) { return false; } + inline virtual bool reportStatus(GpsStatusValue status) { + return false; + } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} }; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5224473f..468fe973 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -157,10 +157,16 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, } } -inline +void LocInternalAdapter::reportStatus(GpsStatusValue status) +{ + sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); +} + void LocEngAdapter::reportStatus(GpsStatusValue status) { - sendMsg(new LocEngReportStatus(mOwner, status)); + if (!mUlp->reportStatus(status)) { + mInternalAdapter->reportStatus(status); + } } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 53a5aca0..a31cebbb 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -58,6 +58,7 @@ public: virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); + virtual void reportStatus(GpsStatusValue status); virtual void setPositionModeInt(LocPosMode& posMode); virtual void startFixInt(); virtual void stopFixInt(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 90df5290..f6fd54d2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -821,15 +821,16 @@ void LocEngReportSv::send() const { } // case LOC_ENG_MSG_REPORT_STATUS: -LocEngReportStatus::LocEngReportStatus(void* locEng, +LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter, GpsStatusValue engineStatus) : - LocMsg(), mLocEng(locEng), mStatus(engineStatus) + LocMsg(), mAdapter(adapter), mStatus(engineStatus) { locallog(); } inline void LocEngReportStatus::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + 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); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 1a318946..4790bbee 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -119,9 +119,9 @@ struct LocEngReportSv : public LocMsg { }; struct LocEngReportStatus : public LocMsg { - void* mLocEng; + LocAdapterBase* mAdapter; const GpsStatusValue mStatus; - LocEngReportStatus(void* locEng, + LocEngReportStatus(LocAdapterBase* adapter, GpsStatusValue engineStatus); virtual void proc() const; void locallog() const; From c7b006ceccae864adeceef51fafaac4651559ce7 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 4 Oct 2013 18:59:00 -0700 Subject: [PATCH 181/945] Correct print for xtra server urls. The offset calculation on the 2nd and 3rd server urls were wrong. The are off by 1 and 2 bytes respectively. Change-Id: Iab9da5dbd2b0c779e18a6fe4615ad7e705800654 --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 90df5290..098d403b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -895,7 +895,7 @@ void LocEngReportXtraServer::proc() const { inline void LocEngReportXtraServer::locallog() const { LOC_LOGV("LocEngReportXtraServers: server1: %s\n server2: %s\n" " server3: %s\n", - mServers, &mServers[mMaxLen], &mServers[mMaxLen<<1]); + mServers, &mServers[mMaxLen+1], &mServers[(mMaxLen+1)<<1]); } inline void LocEngReportXtraServer::log() const { locallog(); From dc020ef75130b82be37f9c22cd0d159acb625d11 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 4 Oct 2013 18:59:00 -0700 Subject: [PATCH 182/945] Correct print for xtra server urls. The offset calculation on the 2nd and 3rd server urls were wrong. The are off by 1 and 2 bytes respectively. Change-Id: Iab9da5dbd2b0c779e18a6fe4615ad7e705800654 --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 90df5290..098d403b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -895,7 +895,7 @@ void LocEngReportXtraServer::proc() const { inline void LocEngReportXtraServer::locallog() const { LOC_LOGV("LocEngReportXtraServers: server1: %s\n server2: %s\n" " server3: %s\n", - mServers, &mServers[mMaxLen], &mServers[mMaxLen<<1]); + mServers, &mServers[mMaxLen+1], &mServers[(mMaxLen+1)<<1]); } inline void LocEngReportXtraServer::log() const { locallog(); From 7d6ed07fad12c11cec7edec76d699045f517bc16 Mon Sep 17 00:00:00 2001 From: hsankara Date: Wed, 16 Oct 2013 10:46:24 -0700 Subject: [PATCH 183/945] Changes to add new bit mask to support wifi ap info injection Changes to add a new bit mask for supporting wifi ap info injection to modem Change-Id: I7b94fcdbb9cda7996af73811636e270da7f8df7e --- core/gps_extended_c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index d11016ec..198dd68f 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -283,6 +283,7 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -305,6 +306,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REPORT_GENFENCE_BREACH (1< Date: Wed, 16 Oct 2013 16:39:01 -0700 Subject: [PATCH 184/945] Null check for malloc allocation Add NULL check after memory allocation Change-Id: Id5dc6d2e5b13aa7979067ab22963df96b32e49c5 CRs-fixed: 561182 --- loc_api/libloc_api_50001/gps.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index 82bc7420..b0669af2 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -42,6 +42,10 @@ 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; From 7546fd88b9d977bd57d2b7bd83cbe530af161e74 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 9 Oct 2013 18:35:04 -0700 Subject: [PATCH 185/945] enhance ulp handshake send ULP the position mode if it is valid when ULP handle is first received. This helps handling a race condition where ULP handshake happens when a GPS session is about to happen or already happening. Change-Id: I029e5c3bbb9d8e89b220ca44e9704b5a1d1451ff CRs-Fixed: 554340 --- core/gps_extended_c.h | 4 +++- loc_api/libloc_api_50001/LocEngAdapter.cpp | 16 ++++++++++++++++ loc_api/libloc_api_50001/LocEngAdapter.h | 3 +-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 198dd68f..42df7f68 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -161,7 +161,8 @@ typedef enum loc_server_type { } LocServerType; typedef enum loc_position_mode_type { - LOC_POSITION_MODE_STANDALONE, + 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, @@ -169,6 +170,7 @@ typedef enum loc_position_mode_type { LOC_POSITION_MODE_RESERVED_3, LOC_POSITION_MODE_RESERVED_4, LOC_POSITION_MODE_RESERVED_5 + } LocPositionMode; #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5224473f..9e337f12 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -78,6 +78,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, mAgpsEnabled(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; LOC_LOGD("LocEngAdapter created"); } @@ -101,6 +102,12 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) ulp = new UlpProxyBase(); } mUlp = ulp; + + if (LOC_POSITION_MODE_INVALID != mFixCriteria.mode) { + // need to send this mode and start msg to ULP + mUlp->sendFixMode(mFixCriteria); + mUlp->sendStartFix(); + } } void LocInternalAdapter::reportPosition(UlpLocation &location, @@ -157,6 +164,15 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, } } +void LocEngAdapter::setInSession(bool inSession) +{ + mNavigating = inSession; + mLocApi->setInSession(inSession); + if (!mNavigating) { + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; + } +} + inline void LocEngAdapter::reportStatus(GpsStatusValue status) { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 53a5aca0..e0fd2ee5 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -264,8 +264,7 @@ public: {return mFixCriteria;} inline virtual bool isInSession() { return mNavigating; } - inline void setInSession(bool inSession) - { mNavigating = inSession; mLocApi->setInSession(inSession); } + void setInSession(bool inSession); /*Values for lock 1 = Do not lock any position sessions From 351cb70668c3e3fac04bd942c187f8becde0b2b3 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 9 Oct 2013 18:35:04 -0700 Subject: [PATCH 186/945] enhance ulp handshake send ULP the position mode if it is valid when ULP handle is first received. This helps handling a race condition where ULP handshake happens when a GPS session is about to happen or already happening. Change-Id: I029e5c3bbb9d8e89b220ca44e9704b5a1d1451ff CRs-Fixed: 554340 --- core/gps_extended_c.h | 4 +++- loc_api/libloc_api_50001/LocEngAdapter.cpp | 16 ++++++++++++++++ loc_api/libloc_api_50001/LocEngAdapter.h | 3 +-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index d11016ec..e7aa0b98 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -161,7 +161,8 @@ typedef enum loc_server_type { } LocServerType; typedef enum loc_position_mode_type { - LOC_POSITION_MODE_STANDALONE, + 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, @@ -169,6 +170,7 @@ typedef enum loc_position_mode_type { LOC_POSITION_MODE_RESERVED_3, LOC_POSITION_MODE_RESERVED_4, LOC_POSITION_MODE_RESERVED_5 + } LocPositionMode; #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5224473f..9e337f12 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -78,6 +78,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, mAgpsEnabled(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; LOC_LOGD("LocEngAdapter created"); } @@ -101,6 +102,12 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) ulp = new UlpProxyBase(); } mUlp = ulp; + + if (LOC_POSITION_MODE_INVALID != mFixCriteria.mode) { + // need to send this mode and start msg to ULP + mUlp->sendFixMode(mFixCriteria); + mUlp->sendStartFix(); + } } void LocInternalAdapter::reportPosition(UlpLocation &location, @@ -157,6 +164,15 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, } } +void LocEngAdapter::setInSession(bool inSession) +{ + mNavigating = inSession; + mLocApi->setInSession(inSession); + if (!mNavigating) { + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; + } +} + inline void LocEngAdapter::reportStatus(GpsStatusValue status) { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 53a5aca0..e0fd2ee5 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -264,8 +264,7 @@ public: {return mFixCriteria;} inline virtual bool isInSession() { return mNavigating; } - inline void setInSession(bool inSession) - { mNavigating = inSession; mLocApi->setInSession(inSession); } + void setInSession(bool inSession); /*Values for lock 1 = Do not lock any position sessions From 82159c500230c611f2b7044e650b02438b5d0165 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 23 Oct 2013 10:58:06 -0700 Subject: [PATCH 187/945] Check mAgpsEnabled for data call Check AGPS flag to ensure the request is handled by the right adapter Change-Id: I6fb7271ec0be5aec14e9d667c07e5b01b1736c1d CRs-fixed: 551808 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 9e337f12..c9165038 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -258,15 +258,17 @@ bool LocEngAdapter::requestSuplES(int connHandle) inline bool LocEngAdapter::reportDataCallOpened() { - sendMsg(new LocEngSuplEsOpened(mOwner)); - return true; + if(mAgpsEnabled) + sendMsg(new LocEngSuplEsOpened(mOwner)); + return mAgpsEnabled; } inline bool LocEngAdapter::reportDataCallClosed() { - sendMsg(new LocEngSuplEsClosed(mOwner)); - return true; + if(mAgpsEnabled) + sendMsg(new LocEngSuplEsClosed(mOwner)); + return mAgpsEnabled; } inline From 412275d48c53175c509eadf59b26f0b26b5431a1 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 23 Oct 2013 10:58:06 -0700 Subject: [PATCH 188/945] Check mAgpsEnabled for data call Check AGPS flag to ensure the request is handled by the right adapter Change-Id: I6fb7271ec0be5aec14e9d667c07e5b01b1736c1d CRs-fixed: 551808 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5224473f..3ff3ac7a 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -242,15 +242,17 @@ bool LocEngAdapter::requestSuplES(int connHandle) inline bool LocEngAdapter::reportDataCallOpened() { - sendMsg(new LocEngSuplEsOpened(mOwner)); - return true; + if(mAgpsEnabled) + sendMsg(new LocEngSuplEsOpened(mOwner)); + return mAgpsEnabled; } inline bool LocEngAdapter::reportDataCallClosed() { - sendMsg(new LocEngSuplEsClosed(mOwner)); - return true; + if(mAgpsEnabled) + sendMsg(new LocEngSuplEsClosed(mOwner)); + return mAgpsEnabled; } inline From 41d3c44644b843c82688292ad41d31ea6f121cd4 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 25 Sep 2013 11:01:43 -0700 Subject: [PATCH 189/945] Send status report msg through ULP In order to preserve the ordering of position reports and status reports from the GPS engine, status reports are sent through the ULP too CRS-Fixed: 538143 Change-Id: I41be2121493c6a0b35a5726fd546eb0fa5e9b20c --- core/UlpProxyBase.h | 3 +++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 10 ++++++++-- loc_api/libloc_api_50001/LocEngAdapter.h | 1 + loc_api/libloc_api_50001/loc_eng.cpp | 7 ++++--- loc_api/libloc_api_50001/loc_eng_msg.h | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 02ba1678..0873748b 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -54,6 +54,9 @@ public: void* svExt) { return false; } + inline virtual bool reportStatus(GpsStatusValue status) { + return false; + } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} }; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5224473f..468fe973 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -157,10 +157,16 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, } } -inline +void LocInternalAdapter::reportStatus(GpsStatusValue status) +{ + sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); +} + void LocEngAdapter::reportStatus(GpsStatusValue status) { - sendMsg(new LocEngReportStatus(mOwner, status)); + if (!mUlp->reportStatus(status)) { + mInternalAdapter->reportStatus(status); + } } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 53a5aca0..a31cebbb 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -58,6 +58,7 @@ public: virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); + virtual void reportStatus(GpsStatusValue status); virtual void setPositionModeInt(LocPosMode& posMode); virtual void startFixInt(); virtual void stopFixInt(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 90df5290..f6fd54d2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -821,15 +821,16 @@ void LocEngReportSv::send() const { } // case LOC_ENG_MSG_REPORT_STATUS: -LocEngReportStatus::LocEngReportStatus(void* locEng, +LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter, GpsStatusValue engineStatus) : - LocMsg(), mLocEng(locEng), mStatus(engineStatus) + LocMsg(), mAdapter(adapter), mStatus(engineStatus) { locallog(); } inline void LocEngReportStatus::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + 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); diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 1a318946..4790bbee 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -119,9 +119,9 @@ struct LocEngReportSv : public LocMsg { }; struct LocEngReportStatus : public LocMsg { - void* mLocEng; + LocAdapterBase* mAdapter; const GpsStatusValue mStatus; - LocEngReportStatus(void* locEng, + LocEngReportStatus(LocAdapterBase* adapter, GpsStatusValue engineStatus); virtual void proc() const; void locallog() const; From 3b4d23e9cc0d7cd45d2db9ff00631dbeec88e0a6 Mon Sep 17 00:00:00 2001 From: Valeri Atamaniouk Date: Fri, 25 Oct 2013 06:47:17 +0300 Subject: [PATCH 190/945] apq8084: qca1530 configuration handling is added. Provide function for qca1530 detection. Rename 'get_target' to 'loc_get_target'. Fix loc_get_target state detection to avoid double detection. Fix few minor code defects. Change-Id: I3daaff99598771742572aab407475474fad41e93 --- core/ContextBase.cpp | 2 +- loc_api/libloc_api_50001/loc.cpp | 38 +++++++----- loc_api/libloc_api_50001/loc_eng.cpp | 17 ++++-- utils/loc_log.cpp | 8 +-- utils/loc_target.cpp | 88 +++++++++++++++++++++++++--- utils/loc_target.h | 7 ++- 6 files changed, 124 insertions(+), 36 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 7879015f..756983bf 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -64,7 +64,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) LocApiBase* locApi = NULL; // first if can not be MPQ - if (TARGET_MPQ != get_target()) { + if (TARGET_MPQ != loc_get_target()) { if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 6cca8544..9ead486b 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -140,7 +140,7 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = }; static loc_eng_data_s_type loc_afw_data; -static int gss_fd = 0; +static int gss_fd = -1; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -190,10 +190,14 @@ extern "C" const GpsInterface* get_gps_interface() unsigned int target = TARGET_DEFAULT; loc_eng_read_config(); - target = get_target(); + target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + + int gnssType = getTargetGnssType(target); + switch (gnssType) + { + case GNSS_GSS: //APQ8064 - if( getTargetGnssType(target) == GNSS_GSS ) { gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); if (gss_fd < 0) { @@ -203,11 +207,16 @@ extern "C" const GpsInterface* get_gps_interface() LOC_LOGD("GSS open success! CAPABILITIES %0lx\n", gps_conf.CAPABILITIES); } - } - //MPQ8064 - else if( getTargetGnssType(target) == GNSS_NONE) { - LOC_LOGE("No GPS HW on this target (MPQ8064). Not returning interface"); + 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; } @@ -297,13 +306,14 @@ static void loc_cleanup() gps_loc_cb = NULL; gps_sv_cb = NULL; - /* - * if (get_target() == TARGET_NAME_APQ8064_STANDALONE) - * { - * close(gss_fd); - * LOC_LOGD("GSS shutdown.\n"); - * } - */ +/* + if (gss_fd >= 0) + { + close(gss_fd); + gss_fd = -1; + LOC_LOGD("GSS shutdown.\n"); + } +*/ EXIT_LOG(%s, VOID_RET); } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 098d403b..53e3a1f7 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1771,11 +1771,14 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - // The position mode for APQ target can only be standalone - bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); - if (isAPQ && params.mode != LOC_POSITION_MODE_STANDALONE) { + int gnssType = getTargetGnssType(loc_get_target()); + + // The position mode for GSS/QCA1530 can only be standalone + bool is1530 = gnssType == GNSS_QCA1530; + bool isAPQ = gnssType == GNSS_GSS; + if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) { params.mode = LOC_POSITION_MODE_STANDALONE; - LOC_LOGD("Position mode changed to standalone for APQ target."); + LOC_LOGD("Position mode changed to standalone for target with GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -2019,8 +2022,10 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - bool isAPQ = (getTargetGnssType(get_target()) == GNSS_GSS); - if (!isAPQ) { + int gnssType = getTargetGnssType(loc_get_target()); + bool isAPQ = (gnssType == GNSS_GSS); + bool is1530 = (gnssType == GNSS_QCA1530); + if (!isAPQ && !is1530) { loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index f755d70d..597b5b62 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -112,7 +112,7 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_MSM), NAME_VAL(GNSS_GSS), NAME_VAL(GNSS_MDM), - NAME_VAL(GNSS_GRIFFON), + NAME_VAL(GNSS_QCA1530), NAME_VAL(GNSS_UNKNOWN) }; @@ -134,18 +134,18 @@ RETURN VALUE const char *loc_get_target_name(unsigned int target) { int index = 0; - char ret[BUFFER_SIZE]; + static char ret[BUFFER_SIZE]; index = getTargetGnssType(target); if( index >= target_name_num || index < 0) index = target_name_num - 1; if( (target & HAS_SSC) == HAS_SSC ) { - sprintf(ret, " %s with SSC", + snprintf(ret, sizeof(ret), " %s with SSC", loc_get_name_from_val(target_name, target_name_num, (long)index) ); } else { - sprintf(ret, " %s without SSC", + snprintf(ret, sizeof(ret), " %s without SSC", loc_get_name_from_val(target_name, target_name_num, (long)index) ); } return ret; diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index cd781c05..a3ef6b3c 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -56,9 +56,11 @@ #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 #define GPS_CHECK_NO_GPS_HW 1 +#define QCA1530_DETECT_TIMEOUT 30 +#define QCA1530_DETECT_PRESENT "yes" +#define QCA1530_DETECT_PROGRESS "detect" -static int gss_fd = 0; -static unsigned int gTarget = TARGET_UNKNOWN; +static unsigned int gTarget = (unsigned int)-1; static int read_a_line(const char * file_path, char * line, int line_size) { @@ -82,22 +84,85 @@ static int read_a_line(const char * file_path, char * line, int line_size) return result; } -unsigned int get_target(void) +/*! + * \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) { - if (gTarget != TARGET_UNKNOWN) + static const char qca1530_property_name[] = "persist.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 = 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; +} + +unsigned int loc_get_target(void) +{ + if (gTarget != (unsigned int)-1) return gTarget; - char hw_platform[] = "/sys/devices/soc0/hw_platform"; - char id[] = "/sys/devices/soc0/soc_id"; - char hw_platform_dep[] = "/sys/devices/system/soc/soc0/hw_platform"; - char id_dep[] = "/sys/devices/system/soc/soc0/id"; - char mdm[] = "/dev/mdm"; // No such file or directory + 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]; + if (is_qca1530()) { + gTarget = TARGET_QCA1530; + goto detected; + } + property_get("ro.baseband", baseband, ""); if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); @@ -133,6 +198,11 @@ unsigned int get_target(void) (!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; } diff --git a/utils/loc_target.h b/utils/loc_target.h index be68f928..4aebb851 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -34,6 +34,7 @@ #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) #define TARGET_MPQ 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_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) @@ -42,14 +43,16 @@ extern "C" { #endif -unsigned int get_target(void); +unsigned int loc_get_target(void); +/* 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_GRIFFON, + GNSS_QCA1530, GNSS_UNKNOWN }GNSS_TARGET; From 747f69507a5f6beecfdf82791e2afe06c7f7b879 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 23 Oct 2013 11:28:51 -0700 Subject: [PATCH 191/945] Add LocApiProxyBase to context This is so that the izat adapters can get access to LocApiProxy through the context. Change-Id: I15a477d159375740047cd7386f8c8c5163fdaf87 --- core/ContextBase.cpp | 3 ++- core/ContextBase.h | 3 ++- core/LocAdapterBase.cpp | 22 +--------------------- core/LocAdapterBase.h | 6 ++---- core/LocApiBase.cpp | 29 ++++++++++++++++++++++++++--- core/LocApiBase.h | 18 ++++++++++++++---- 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 7879015f..dc47ffbd 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -91,7 +91,8 @@ ContextBase::ContextBase(const MsgTask* msgTask, const char* libName) : mLBSProxy(getLBSProxy(libName)), mMsgTask(msgTask), - mLocApi(createLocApi(exMask)) + mLocApi(createLocApi(exMask)), + mLocApiProxy(mLocApi->getLocApiProxy()) { } diff --git a/core/ContextBase.h b/core/ContextBase.h index 93cb31ff..b41dd780 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -46,7 +46,7 @@ protected: const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; - + LocApiProxyBase *mLocApiProxy; public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, @@ -55,6 +55,7 @@ public: inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } + inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 48d179f5..8bbe873f 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -36,26 +36,6 @@ namespace loc_core { -struct LocOpenMsg : public LocMsg { - LocAdapterBase* mLocAdapter; - LocApiBase* mLocApi; - inline LocOpenMsg(LocAdapterBase* locAdapter, - LocApiBase* locApi) : - LocMsg(), mLocAdapter(locAdapter), mLocApi(locApi) - { - locallog(); - } - inline virtual void proc() const { - mLocApi->addAdapter(mLocAdapter); - } - inline void locallog() { - LOC_LOGV("LocOpen"); - } - inline virtual void log() { - locallog(); - } -}; - // 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, @@ -65,7 +45,7 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) { - sendMsg(new LocOpenMsg(this, mLocApi)); + mLocApi->addAdapter(this); } void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index f279f9fd..be31de6e 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -44,12 +44,10 @@ protected: inline LocAdapterBase(const MsgTask* msgTask) : mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} - +public: + inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context); - inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - -public: inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 7a6456c1..2978fb3f 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -103,6 +103,27 @@ struct LocSsrMsg : public LocMsg { } }; +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) : mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) @@ -137,7 +158,8 @@ void LocApiBase::addAdapter(LocAdapterBase* adapter) for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { if (mLocAdapters[i] == NULL) { mLocAdapters[i] = adapter; - open(mMask | (adapter->getEvtMask() & ~mExcludedMask)); + mMsgTask->sendMsg(new LocOpenMsg(this, + (adapter->getEvtMask()))); break; } } @@ -173,7 +195,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) close(); } else { // else we need to remove the bit - open(getEvtMask() & ~mExcludedMask); + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); } } } @@ -298,7 +320,8 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) -void* LocApiBase :: getSibling2() + +LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 4ddc57f1..04afa53a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,6 +34,7 @@ #include #include #include + namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -51,14 +52,23 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i Date: Wed, 23 Oct 2013 11:28:51 -0700 Subject: [PATCH 192/945] Add LocApiProxyBase to context This is so that the izat adapters can get access to LocApiProxy through the context. Change-Id: I15a477d159375740047cd7386f8c8c5163fdaf87 --- core/ContextBase.cpp | 3 ++- core/ContextBase.h | 3 ++- core/LocAdapterBase.cpp | 22 +--------------------- core/LocAdapterBase.h | 6 ++---- core/LocApiBase.cpp | 29 ++++++++++++++++++++++++++--- core/LocApiBase.h | 18 ++++++++++++++---- 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 7879015f..dc47ffbd 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -91,7 +91,8 @@ ContextBase::ContextBase(const MsgTask* msgTask, const char* libName) : mLBSProxy(getLBSProxy(libName)), mMsgTask(msgTask), - mLocApi(createLocApi(exMask)) + mLocApi(createLocApi(exMask)), + mLocApiProxy(mLocApi->getLocApiProxy()) { } diff --git a/core/ContextBase.h b/core/ContextBase.h index 93cb31ff..b41dd780 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -46,7 +46,7 @@ protected: const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; LocApiBase* mLocApi; - + LocApiProxyBase *mLocApiProxy; public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, @@ -55,6 +55,7 @@ public: inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } + inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 48d179f5..8bbe873f 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -36,26 +36,6 @@ namespace loc_core { -struct LocOpenMsg : public LocMsg { - LocAdapterBase* mLocAdapter; - LocApiBase* mLocApi; - inline LocOpenMsg(LocAdapterBase* locAdapter, - LocApiBase* locApi) : - LocMsg(), mLocAdapter(locAdapter), mLocApi(locApi) - { - locallog(); - } - inline virtual void proc() const { - mLocApi->addAdapter(mLocAdapter); - } - inline void locallog() { - LOC_LOGV("LocOpen"); - } - inline virtual void log() { - locallog(); - } -}; - // 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, @@ -65,7 +45,7 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) { - sendMsg(new LocOpenMsg(this, mLocApi)); + mLocApi->addAdapter(this); } void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index f279f9fd..be31de6e 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -44,12 +44,10 @@ protected: inline LocAdapterBase(const MsgTask* msgTask) : mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} - +public: + inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context); - inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - -public: inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 7a6456c1..2978fb3f 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -103,6 +103,27 @@ struct LocSsrMsg : public LocMsg { } }; +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) : mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) @@ -137,7 +158,8 @@ void LocApiBase::addAdapter(LocAdapterBase* adapter) for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { if (mLocAdapters[i] == NULL) { mLocAdapters[i] = adapter; - open(mMask | (adapter->getEvtMask() & ~mExcludedMask)); + mMsgTask->sendMsg(new LocOpenMsg(this, + (adapter->getEvtMask()))); break; } } @@ -173,7 +195,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) close(); } else { // else we need to remove the bit - open(getEvtMask() & ~mExcludedMask); + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); } } } @@ -298,7 +320,8 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) -void* LocApiBase :: getSibling2() + +LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 4ddc57f1..04afa53a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,6 +34,7 @@ #include #include #include + namespace loc_core { int hexcode(char *hexstring, int string_size, @@ -51,14 +52,23 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i Date: Fri, 6 Sep 2013 18:06:38 -0700 Subject: [PATCH 193/945] Modem Batching Implementation Modem released new batching location feature, which adds new masks for batching. this change is corresponding to new masks. Change-Id: I8bd8e978a0f1066130049b8b2fc669298691d935 --- core/gps_extended_c.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 42df7f68..bda16903 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -175,6 +175,22 @@ typedef enum loc_position_mode_type { #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ +/** GpsLocationExtended has valid latitude and longitude. */ +#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) +/** GpsLocationExtended has valid altitude. */ +#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1) +/** GpsLocationExtended has valid speed. */ +#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2) +/** GpsLocationExtended has valid bearing. */ +#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4) +/** GpsLocationExtended has valid accuracy. */ +#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8) + +/** GPS extended supports geofencing */ +#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001 +/** GPS extended supports batching */ +#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002 + /** Flags to indicate which values are valid in a GpsLocationExtended. */ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ @@ -286,6 +302,8 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -309,6 +327,8 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_PEDOMETER_CTRL (1< Date: Tue, 12 Nov 2013 15:49:32 -0800 Subject: [PATCH 194/945] Memset the xtra url to assure null termination Fixes a potential crash in jni layer caused by invalid characters in the string. CRs-fixed: 555829 Change-Id: I03ae100c4b7e65c95bac5841fcf00b27e2940741 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5cf90872..1c2bac5a 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -875,6 +875,7 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, LocMsg(), mLocEng(locEng), mMaxLen(maxlength), mServers(new char[3*(mMaxLen+1)]) { + memset(mServers, 0, 3*(mMaxLen+1)); strlcpy(mServers, url1, mMaxLen); strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen); strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen); From 000b1ecea4424641ed4b6577fd57e1c35277a295 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 12 Nov 2013 15:49:32 -0800 Subject: [PATCH 195/945] Memset the xtra url to assure null termination Fixes a potential crash in jni layer caused by invalid characters in the string. CRs-fixed: 555829 Change-Id: I03ae100c4b7e65c95bac5841fcf00b27e2940741 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f6fd54d2..d6e69cfc 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -875,6 +875,7 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, LocMsg(), mLocEng(locEng), mMaxLen(maxlength), mServers(new char[3*(mMaxLen+1)]) { + memset(mServers, 0, 3*(mMaxLen+1)); strlcpy(mServers, url1, mMaxLen); strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen); strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen); From e9d40481686a5d1ebc07dbc97a1144cfb69273dc Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Fri, 27 Sep 2013 15:14:44 -0700 Subject: [PATCH 196/945] Fixes loc_ext and AFW concurrency issues Part of changes so that loc_ext stack gets its own QMI_LOC client. CRs-Fixed: 565281 Change-Id: I7dda3cd8e90e699f11391ea621a785f775978e41 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 11 +++++++---- loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc.cpp | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 5 ++--- loc_api/libloc_api_50001/loc_eng.h | 3 ++- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 8b3dbd49..1aef99d3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -67,12 +67,15 @@ void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { } LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, + void* owner, ContextBase* context, MsgTask::tCreate tCreator) : LocAdapterBase(mask, - LocDualContext::getLocFgContext( - tCreator, - LocDualContext::mLocationHalName)), + //Get the AFW context if VzW context has not already been intialized in + //loc_ext + context == NULL? + LocDualContext::getLocFgContext(tCreator, + LocDualContext::mLocationHalName) + :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), mAgpsEnabled(false) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index e7432353..a9a50e68 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -78,7 +78,7 @@ public: bool mAgpsEnabled; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, + void* owner,ContextBase* context, MsgTask::tCreate tCreator); virtual ~LocEngAdapter(); diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 9ead486b..7cedb577 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -274,7 +274,7 @@ static int loc_init(GpsCallbacks* callbacks) gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; - retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event); + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1c2bac5a..8079ada5 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1455,7 +1455,7 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event) + LOC_API_ADAPTER_EVENT_MASK_T event, ContextBase* context) { int ret_val = 0; @@ -1507,12 +1507,11 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, } loc_eng_data.adapter = - new LocEngAdapter(event, &loc_eng_data, + new LocEngAdapter(event, &loc_eng_data, context, (MsgTask::tCreate)callbacks->create_thread_cb); 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); diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 0c552b55..2dfd50f7 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -178,7 +178,8 @@ extern loc_sap_cfg_s_type sap_conf; int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event); + 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); From b5ed3d850555108cb2491ccb7d23fa8f2176d1b9 Mon Sep 17 00:00:00 2001 From: Hema Iyer Sankaranarayanan Date: Thu, 14 Nov 2013 10:25:17 -0800 Subject: [PATCH 197/945] Changes to conditionally check and inject coarse position Changes to GPS HAL to determine if wiper available before it does CPI injection. Change-Id: Ic481c020bf51ae55b001ab28a0b1caaa5de47cdd --- core/ContextBase.h | 1 + core/LBSProxyBase.h | 1 + loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 ++- loc_api/libloc_api_50001/LocEngAdapter.h | 2 ++ loc_api/libloc_api_50001/loc.cpp | 3 ++- loc_api/libloc_api_50001/loc_eng.cpp | 7 +++++-- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index b41dd780..85cbab7e 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -57,6 +57,7 @@ public: inline LocApiBase* getLocApi() { return mLocApi; } inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } + inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index e643d126..f0d1a329 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -50,6 +50,7 @@ public: inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} inline virtual bool hasAgpsExt() const { return false; } + inline virtual bool hasCPIExt() const { return false; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1aef99d3..55418d1d 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -78,7 +78,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mAgpsEnabled(false) + mAgpsEnabled(false), mCPIEnabled(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -291,3 +291,4 @@ void LocEngAdapter::handleEngineUpEvent() { sendMsg(new LocEngUp(mOwner)); } + diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index a9a50e68..3a757dd3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -76,6 +76,7 @@ class LocEngAdapter : public LocAdapterBase { public: bool mAgpsEnabled; + bool mCPIEnabled; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner,ContextBase* context, @@ -90,6 +91,7 @@ public: inline UlpProxyBase* getUlpProxy() { return mUlp; } inline void* getOwner() { return mOwner; } inline bool hasAgpsExt() { return mContext->hasAgpsExt(); } + inline bool hasCPIExt() { return mContext->hasCPIExt(); } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 7cedb577..0b032f0b 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -277,7 +277,7 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); - + loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); EXIT_LOG(%d, retVal); return retVal; @@ -463,6 +463,7 @@ static int loc_inject_location(double latitude, double longitude, float accuracy { static bool initialized = false; static bool enable_cpi = true; + accuracy = 1000; ENTRY_LOG(); if(!initialized) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8079ada5..cf11c183 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1845,8 +1845,11 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, - accuracy)); + if(!adapter->mCPIEnabled) + { + adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, + accuracy)); + } EXIT_LOG(%d, 0); return 0; From 9d9c284fbff28d9bf38191a4568af5def63a2b76 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Wed, 20 Nov 2013 14:12:57 +0530 Subject: [PATCH 198/945] Added NULL check before function call Added NULL check before calling nmea call back function to prevent segmentation fault in case no nmea call back is registered. Change-Id: If2371f4522e12312630043c3953405f583829068 CRs-fixed: 578444 --- loc_api/libloc_api_50001/loc_eng.cpp | 4 +++- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8079ada5..34c94ca7 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -857,7 +857,9 @@ void LocEngReportNmea::proc() const { gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); - locEng->nmea_cb(now, mNmea, mLen); + + if (locEng->nmea_cb != NULL) + locEng->nmea_cb(now, mNmea, mLen); } inline void LocEngReportNmea::locallog() const { LOC_LOGV("LocEngReportNmea"); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index eb7fd1dc..97ba4d58 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -60,7 +60,8 @@ void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_dat gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); - loc_eng_data_p->nmea_cb(now, pNmea, length); + if (loc_eng_data_p->nmea_cb != NULL) + loc_eng_data_p->nmea_cb(now, pNmea, length); LOC_LOGD("NMEA <%s", pNmea); } From 97699b4f4971a95768e99c661483eeaf2766f3d7 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 Nov 2013 10:36:09 -0800 Subject: [PATCH 199/945] Print default implementation at debug level The default implementation print was being printed at warning level, which can create log spam. Change-Id: I2d8c15fa0b8c647da57fbec6d0b7016117a82d7b CRs-fixed: 576609 --- core/gps_extended_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 42df7f68..85419ab3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -246,7 +246,7 @@ typedef enum { // if necessary. #define DEFAULT_IMPL(rtv) \ { \ - LOC_LOGW("%s: default implementation invoked", __func__); \ + LOC_LOGD("%s: default implementation invoked", __func__); \ return rtv; \ } From 0eeb1392f1552cfa7bb3e554246adb1d4e61dc5b Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 3 Jul 2013 22:22:26 -0700 Subject: [PATCH 200/945] added timer stop api loc_timer util currently can not be stopped. Added stop api so that clients can make use of. CRs-Fixed: 579624 Change-Id: I17f80e46ecfbdf1b70eb158f1ee7eb1a92d5e765 --- utils/loc_timer.c | 173 +++++++++++++++++++++++++++------------------- utils/loc_timer.h | 17 +++-- 2 files changed, 114 insertions(+), 76 deletions(-) diff --git a/utils/loc_timer.c b/utils/loc_timer.c index 13f7786f..1e4008eb 100644 --- a/utils/loc_timer.c +++ b/utils/loc_timer.c @@ -34,124 +34,153 @@ #include #include -#define MAX_DELAY_RETRIES 3 +enum timer_state { + READY = 100, + WAITING, + DONE, + ABORT +}; typedef struct { loc_timer_callback callback_func; void *user_data; unsigned int time_msec; + pthread_cond_t timer_cond; + pthread_mutex_t timer_mutex; + enum timer_state state; }timer_data; static void *timer_thread(void *thread_data) { - int ret; - unsigned char retries=0; + int ret = -ETIMEDOUT; struct timespec ts; struct timeval tv; - timer_data t; - t.callback_func = ((timer_data *)thread_data)->callback_func; - t.user_data = ((timer_data *)thread_data)->user_data; - t.time_msec = ((timer_data *)thread_data)->time_msec; - pthread_cond_t timer_cond; - pthread_mutex_t timer_mutex; + timer_data* t = (timer_data*)thread_data; - LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t.time_msec); - //Copied over all info into local variable. Do not need allocated struct - free(thread_data); + LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); - if(pthread_cond_init(&timer_cond, NULL)) { - LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); - ret = -1; - goto err; + gettimeofday(&tv, NULL); + clock_gettime(CLOCK_REALTIME, &ts); + if(t->time_msec >= 1000) { + ts.tv_sec += t->time_msec/1000; + t->time_msec = t->time_msec % 1000; } - if(pthread_mutex_init(&timer_mutex, NULL)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - ret = -1; - goto mutex_err; + if(t->time_msec) + ts.tv_nsec += t->time_msec * 1000000; + if(ts.tv_nsec > 999999999) { + LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); + ts.tv_sec += 1; + ts.tv_nsec -= 1000000000; } - while(retries < MAX_DELAY_RETRIES) { - gettimeofday(&tv, NULL); - clock_gettime(CLOCK_REALTIME, &ts); - if(t.time_msec >= 1000) { - ts.tv_sec += t.time_msec/1000; - t.time_msec = t.time_msec % 1000; - } - if(t.time_msec) - ts.tv_nsec += t.time_msec * 1000000; - if(ts.tv_nsec > 999999999) { - LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); - ts.tv_sec += 1; - ts.tv_nsec -= 1000000000; - } - LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n", - __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec); - LOC_LOGD("%s:%d]: Current time: %d sec; %d nsec\n", - __func__, __LINE__, (int)tv.tv_sec, (int)tv.tv_usec*1000); - pthread_mutex_lock(&(timer_mutex)); - ret = pthread_cond_timedwait(&timer_cond, &timer_mutex, &ts); - pthread_mutex_unlock(&(timer_mutex)); - if(ret != ETIMEDOUT) { - LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", - __func__, __LINE__,ret); - ret = -1; - retries++; - } - else { - ret = 0; - break; - } + LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" + "\t Current time: %d sec; %d nsec", + __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, + (int)tv.tv_sec, (int)tv.tv_usec*1000); + + pthread_mutex_lock(&(t->timer_mutex)); + if (READY == t->state) { + t->state = WAITING; + ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); + t->state = DONE; + } + pthread_mutex_unlock(&(t->timer_mutex)); + + switch (ret) { + case ETIMEDOUT: + LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); + break; + case 0: + LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); + break; + case -ETIMEDOUT: + LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); + break; + default: + LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", + __func__, __LINE__, ret); + break; } - pthread_mutex_destroy(&timer_mutex); -mutex_err: - pthread_cond_destroy(&timer_cond); -err: - if(!ret) - t.callback_func(t.user_data, ret); + pthread_mutex_destroy(&t->timer_mutex); + pthread_cond_destroy(&t->timer_cond); + + if(ETIMEDOUT == ret) + t->callback_func(t->user_data, ret); + + free(t); LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); return NULL; } -int loc_timer_start(unsigned int msec, loc_timer_callback cb_func, - void* caller_data) +void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, + void* caller_data) { - int ret=0; timer_data *t=NULL; pthread_attr_t tattr; pthread_t id; LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); if(cb_func == NULL || msec == 0) { LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); - ret = -1; - goto err; + goto _err; } t = (timer_data *)calloc(1, sizeof(timer_data)); if(t == NULL) { LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", __func__, __LINE__); - ret = -1; - goto err; + goto _err; + } + + if(pthread_cond_init(&(t->timer_cond), NULL)) { + LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); + goto t_err; + } + if(pthread_mutex_init(&(t->timer_mutex), NULL)) { + LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); + goto cond_err; } t->callback_func = cb_func; t->user_data = caller_data; t->time_msec = msec; + t->state = READY; - pthread_attr_init(&tattr); + if (pthread_attr_init(&tattr)) { + LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); + goto mutex_err; + } pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); + if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); - ret = -1; goto attr_err; } - else { - LOC_LOGD("%s:%d]: Created thread with id: %d\n", - __func__, __LINE__, (int)id); - } + + LOC_LOGD("%s:%d]: Created thread with id: %d\n", + __func__, __LINE__, (int)id); + goto _err; attr_err: pthread_attr_destroy(&tattr); -err: +mutex_err: + pthread_mutex_destroy(&t->timer_mutex); +cond_err: + pthread_cond_destroy(&t->timer_cond); +t_err: + free(t); +_err: LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return ret; + return t; +} + +void loc_timer_stop(void* handle) { + timer_data* t = (timer_data*)handle; + + if (NULL != t && (READY == t->state || WAITING == t->state)) { + pthread_mutex_lock(&(t->timer_mutex)); + if (READY == t->state || WAITING == t->state) { + pthread_cond_signal(&t->timer_cond); + t->state = ABORT; + } + pthread_mutex_unlock(&(t->timer_mutex)); + } } diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 213da209..0034d278 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -43,10 +43,19 @@ extern "C" { */ typedef void(*loc_timer_callback)(void *user_data, int result); -//int loc_timer_start(loc_timer_client_data *p_thread); -int loc_timer_start(unsigned int delay_msec, - loc_timer_callback, - void* user_data); + +/* + Returns the handle, which can be used to stop the timer +*/ +void* loc_timer_start(unsigned int delay_msec, + loc_timer_callback, + void* user_data); + +/* + handle becomes invalid upon the return of the callback +*/ +void loc_timer_stop(void* handle); + #ifdef __cplusplus } #endif /* __cplusplus */ From 6fc806515a0f75768c0ec81419805467de63394c Mon Sep 17 00:00:00 2001 From: Satheesh Jayakumar Date: Wed, 2 Oct 2013 16:30:13 -0700 Subject: [PATCH 201/945] Adds ZPP Feature Implementation Changes for enabling Zero Power positioning feature in the location services subsystem.It involves modifications to HAL and ULP engine. CRs-Fixed: 457060 Change-Id: I62187e66d44c5b40e1b2a41cafc0cb3e7c94f6d8 --- core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 4 ++ core/LocApiBase.h | 2 + core/gps_extended_c.h | 2 + loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 ++ loc_api/libloc_api_50001/LocEngAdapter.h | 6 +++ loc_api/libloc_api_50001/loc_eng.cpp | 49 ++++++++++++++++++++++ loc_api/libloc_api_50001/loc_eng_msg.h | 8 ++++ 8 files changed, 75 insertions(+) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index be31de6e..8222b24b 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -73,6 +73,7 @@ public: inline virtual void setPositionModeInt(LocPosMode& posMode) {} virtual void startFixInt() {} virtual void stopFixInt() {} + virtual void getZppInt() {} virtual void reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 2978fb3f..80e23755 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -445,6 +445,10 @@ enum loc_api_adapter_err LocApiBase:: getZppFix(GpsLocation & zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +enum loc_api_adapter_err LocApiBase:: + getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + int LocApiBase:: initDataServiceClient() DEFAULT_IMPL(-1) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 04afa53a..e162cfc7 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -187,6 +187,8 @@ public: setAGLONASSProtocol(unsigned long aGlonassProtocol); virtual enum loc_api_adapter_err getZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); virtual int initDataServiceClient(); virtual int openAndStartDataCall(); virtual void stopDataCall(); diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 42df7f68..8b3167f8 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -56,6 +56,8 @@ extern "C" { #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 #define ULP_MIN_INTERVAL_INVALID 0xffffffff diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 55418d1d..c8d08853 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -49,6 +49,9 @@ void LocInternalAdapter::startFixInt() { void LocInternalAdapter::stopFixInt() { sendMsg(new LocEngStopFix(mLocEngAdapter)); } +void LocInternalAdapter::getZppInt() { + sendMsg(new LocEngGetZpp(mLocEngAdapter)); +} void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { struct LocSetUlpProxy : public LocMsg { LocAdapterBase* mAdapter; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 3a757dd3..d03dc660 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -62,6 +62,7 @@ public: virtual void setPositionModeInt(LocPosMode& posMode); virtual void startFixInt(); virtual void stopFixInt(); + virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); }; @@ -239,6 +240,11 @@ public: { mLocApi->closeDataCall(); } + inline enum loc_api_adapter_err + getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) + { + return mLocApi->getZppFix(zppLoc, tech_mask); + } virtual void handleEngineDownEvent(); virtual void handleEngineUpEvent(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index cd4e34a3..6d6d701a 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -182,6 +182,7 @@ 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* @@ -300,6 +301,28 @@ 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); +} + // case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; @@ -1920,6 +1943,32 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa 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); + memset(&location, 0, sizeof location); + + 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 diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 4790bbee..ae962f55 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -280,6 +280,14 @@ struct LocEngUp : public LocMsg { 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; +}; #ifdef __cplusplus } From 64cecc6a31fef64f96b4ef1d6aa866beb2be2f7f Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 19 Nov 2013 15:42:13 -0800 Subject: [PATCH 202/945] Update NMEA SV numbers for GPGSV and GLGSV, the SV number should be seperate for each. CRs-Fixed: 570728 Change-Id: Ica350094d7220f1ec33cf02686a541c4191afe1d --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index eb7fd1dc..ad19e0bb 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -653,7 +653,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, lengthRemaining = sizeof(sentence); length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d", - sentenceCount, sentenceNumber, svCount); + sentenceCount, sentenceNumber, gpsCount); if (length < 0 || length >= lengthRemaining) { @@ -731,7 +731,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, lengthRemaining = sizeof(sentence); length = snprintf(pMarker, lengthRemaining, "$GLGSV,%d,%d,%02d", - sentenceCount, sentenceNumber, svCount); + sentenceCount, sentenceNumber, glnCount); if (length < 0 || length >= lengthRemaining) { From 4996c5e9551705645bb9e41b40973e096e78c8f6 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 11 Dec 2013 15:38:42 -0800 Subject: [PATCH 203/945] Remove unused code under libloc_api This folder of sources is no longer used and is removed Change-Id: I0b02f56e27346f20f890bc8105e77995e63c0350 CRs-fixed: 566508 --- loc_api/libloc_api/Android.mk | 40 - loc_api/libloc_api/gps.c | 68 -- loc_api/libloc_api/loc_eng.cpp | 1533 -------------------------- loc_api/libloc_api/loc_eng.h | 115 -- loc_api/libloc_api/loc_eng_ioctl.cpp | 354 ------ loc_api/libloc_api/loc_eng_ioctl.h | 69 -- loc_api/libloc_api/loc_eng_ni.cpp | 609 ---------- loc_api/libloc_api/loc_eng_ni.h | 56 - loc_api/libloc_api/loc_eng_xtra.cpp | 180 --- loc_api/libloc_api/loc_eng_xtra.h | 45 - 10 files changed, 3069 deletions(-) delete mode 100644 loc_api/libloc_api/Android.mk delete mode 100644 loc_api/libloc_api/gps.c delete mode 100644 loc_api/libloc_api/loc_eng.cpp delete mode 100644 loc_api/libloc_api/loc_eng.h delete mode 100644 loc_api/libloc_api/loc_eng_ioctl.cpp delete mode 100644 loc_api/libloc_api/loc_eng_ioctl.h delete mode 100644 loc_api/libloc_api/loc_eng_ni.cpp delete mode 100644 loc_api/libloc_api/loc_eng_ni.h delete mode 100644 loc_api/libloc_api/loc_eng_xtra.cpp delete mode 100644 loc_api/libloc_api/loc_eng_xtra.h diff --git a/loc_api/libloc_api/Android.mk b/loc_api/libloc_api/Android.mk deleted file mode 100644 index 2922a4ab..00000000 --- a/loc_api/libloc_api/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -#Compile the old library version from Google push for Passion builds with old modem image -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES:= \ - libloc_api-rpc - -LOCAL_SHARED_LIBRARIES := \ - librpc \ - libutils \ - libcutils - -LOCAL_SRC_FILES += \ - loc_eng.cpp \ - loc_eng_ioctl.cpp \ - loc_eng_xtra.cpp \ - loc_eng_ni.cpp \ - gps.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -DAMSS_VERSION=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/libloc_api-rpc \ - $(TARGET_OUT_HEADERS)/libloc_api-rpc/inc \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc/inc \ - $(TARGET_OUT_HEADERS)/librpc - - -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw - -include $(BUILD_SHARED_LIBRARY) -endif #BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION = 50001 diff --git a/loc_api/libloc_api/gps.c b/loc_api/libloc_api/gps.c deleted file mode 100644 index 36bfcb63..00000000 --- a/loc_api/libloc_api/gps.c +++ /dev/null @@ -1,68 +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. - * - */ - -#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 = malloc(sizeof(struct gps_device_t)); - 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 -}; - -const struct hw_module_t HAL_MODULE_INFO_SYM = { - .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, - .id = GPS_HARDWARE_MODULE_ID, - .name = "loc_api GPS Module", - .author = "Qualcomm USA, Inc.", - .methods = &gps_module_methods, -}; diff --git a/loc_api/libloc_api/loc_eng.cpp b/loc_api/libloc_api/loc_eng.cpp deleted file mode 100644 index 3b286303..00000000 --- a/loc_api/libloc_api/loc_eng.cpp +++ /dev/null @@ -1,1533 +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. - * - */ - -#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "loc_api_rpc_glue.h" -#include "loc_apicb_appinit.h" - -#include -#include -#include - -#include -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -#define DEBUG_MOCK_NI 0 - -// Function declarations for sLocEngInterface -static int loc_eng_init(GpsCallbacks* callbacks); -static int loc_eng_start(); -static int loc_eng_stop(); -static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); -static void loc_eng_cleanup(); -static int loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); -static int loc_eng_inject_location(double latitude, double longitude, float accuracy); -static void loc_eng_delete_aiding_data (GpsAidingData f); -static const void* loc_eng_get_extension(const char* name); - -// Function declarations for sLocEngAGpsInterface -static void loc_eng_agps_init(AGpsCallbacks* callbacks); -static int loc_eng_agps_data_conn_open(const char* apn); -static int loc_eng_agps_data_conn_closed(); -static int loc_eng_agps_data_conn_failed(); -static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port); - - -static int32 loc_event_cb (rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload); -static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr); -static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr); -static void loc_eng_report_status (const rpc_loc_status_event_s_type *status_report_ptr); -static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr); -static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr); - -static void loc_eng_process_deferred_action (void* arg); -static void loc_eng_process_atl_deferred_action (int flags); -static void loc_eng_delete_aiding_data_deferred_action (void); - -static int set_agps_server(); - -// Defines the GpsInterface in gps.h -static const GpsInterface sLocEngInterface = -{ - sizeof(GpsInterface), - loc_eng_init, - loc_eng_start, - loc_eng_stop, - loc_eng_cleanup, - loc_eng_inject_time, - loc_eng_inject_location, - loc_eng_delete_aiding_data, - loc_eng_set_position_mode, - loc_eng_get_extension, -}; - -static const AGpsInterface sLocEngAGpsInterface = -{ - sizeof(AGpsInterface), - loc_eng_agps_init, - loc_eng_agps_data_conn_open, - loc_eng_agps_data_conn_closed, - loc_eng_agps_data_conn_failed, - loc_eng_agps_set_server, -}; - -// Global data structure for location engine -loc_eng_data_s_type loc_eng_data; - -/*=========================================================================== -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 - -===========================================================================*/ -const GpsInterface* gps_get_hardware_interface () -{ - char propBuf[PROPERTY_VALUE_MAX]; - - // check to see if GPS should be disabled - property_get("gps.disable", propBuf, ""); - if (propBuf[0] == '1') - { - LOGD("gps_get_interface returning NULL because gps.disable=1\n"); - return NULL; - } - - return &sLocEngInterface; -} - -/*=========================================================================== -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 - -===========================================================================*/ - -// fully shutting down the GPS is temporarily disabled to avoid intermittent BP crash -#define DISABLE_CLEANUP 1 - -static int loc_eng_init(GpsCallbacks* callbacks) -{ -#if DISABLE_CLEANUP - if (loc_eng_data.deferred_action_thread) { - // already initialized - return 0; - } -#endif - // Start the LOC api RPC service - loc_api_glue_init (); - - callbacks->set_capabilities_cb(GPS_CAPABILITY_SCHEDULING | GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); - - memset (&loc_eng_data, 0, sizeof (loc_eng_data_s_type)); - - // LOC ENG module data initialization - 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.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; - loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; - - rpc_loc_event_mask_type event = RPC_LOC_EVENT_PARSED_POSITION_REPORT | - RPC_LOC_EVENT_SATELLITE_REPORT | - RPC_LOC_EVENT_LOCATION_SERVER_REQUEST | - RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST | - RPC_LOC_EVENT_IOCTL_REPORT | - RPC_LOC_EVENT_STATUS_REPORT | - RPC_LOC_EVENT_NMEA_POSITION_REPORT | - RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; - - loc_eng_data.client_handle = loc_open (event, loc_event_cb); - - pthread_mutex_init (&(loc_eng_data.deferred_action_mutex), NULL); - pthread_cond_init (&(loc_eng_data.deferred_action_cond) , NULL); - pthread_mutex_init (&(loc_eng_data.deferred_stop_mutex), NULL); - - loc_eng_data.loc_event = 0; - loc_eng_data.deferred_action_flags = 0; - memset (loc_eng_data.apn_name, 0, sizeof (loc_eng_data.apn_name)); - - loc_eng_data.aiding_data_for_deletion = 0; - loc_eng_data.engine_status = GPS_STATUS_NONE; - - // XTRA module data initialization - loc_eng_data.xtra_module_data.download_request_cb = NULL; - - // IOCTL module data initialization - loc_eng_data.ioctl_data.cb_is_selected = FALSE; - loc_eng_data.ioctl_data.cb_is_waiting = FALSE; - loc_eng_data.ioctl_data.client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; - memset (&(loc_eng_data.ioctl_data.cb_payload), - 0, - sizeof (rpc_loc_ioctl_callback_s_type)); - - pthread_mutex_init (&(loc_eng_data.ioctl_data.cb_data_mutex), NULL); - pthread_cond_init(&loc_eng_data.ioctl_data.cb_arrived_cond, NULL); - - loc_eng_data.deferred_action_thread = callbacks->create_thread_cb("loc_api", - loc_eng_process_deferred_action, NULL); - - LOGD ("loc_eng_init called, client id = %d\n", (int32) loc_eng_data.client_handle); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_cleanup - -DESCRIPTION - Cleans location engine. The location client handle will be released. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_cleanup() -{ -#if DISABLE_CLEANUP - return; -#else - if (loc_eng_data.deferred_action_thread) - { - /* Terminate deferred action working thread */ - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_QUIT; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - - void* ignoredValue; - pthread_join(loc_eng_data.deferred_action_thread, &ignoredValue); - loc_eng_data.deferred_action_thread = NULL; - } - - // clean up - (void) loc_close (loc_eng_data.client_handle); - - pthread_mutex_destroy (&loc_eng_data.deferred_action_mutex); - pthread_cond_destroy (&loc_eng_data.deferred_action_cond); - - pthread_mutex_destroy (&loc_eng_data.ioctl_data.cb_data_mutex); - pthread_cond_destroy (&loc_eng_data.ioctl_data.cb_arrived_cond); - -// Do not call this as it can result in the ARM9 crashing if it sends events while we are disabled -// loc_apicb_app_deinit(); -#endif -} - - -/*=========================================================================== -FUNCTION loc_eng_start - -DESCRIPTION - Starts the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_start() -{ - int ret_val; - LOGD ("loc_eng_start\n"); - - if (loc_eng_data.position_mode != GPS_POSITION_MODE_STANDALONE && - loc_eng_data.agps_server_host[0] != 0 && - loc_eng_data.agps_server_port != 0) { - int result = set_agps_server(); - LOGD ("set_agps_server returned = %d\n", result); - } - - ret_val = loc_start_fix (loc_eng_data.client_handle); - - if (ret_val != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_eng_start returned error = %d\n", ret_val); - } - - return 0; -} - - -/*=========================================================================== -FUNCTION loc_eng_stop - -DESCRIPTION - Stops the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_stop() -{ - int ret_val; - - LOGD ("loc_eng_stop\n"); - - pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); - // work around problem with loc_eng_stop when AGPS requests are pending - // we defer stopping the engine until the AGPS request is done - if (loc_eng_data.agps_request_pending) - { - loc_eng_data.stop_request_pending = true; - LOGD ("deferring stop until AGPS data call is finished\n"); - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - return 0; - } - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - - ret_val = loc_stop_fix (loc_eng_data.client_handle); - if (ret_val != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_eng_stop returned error = %d\n", ret_val); - } - - return 0; -} - -static int loc_eng_set_gps_lock(rpc_loc_lock_e_type lock_type) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - boolean ret_val; - - LOGD ("loc_eng_set_gps_lock mode, client = %d, lock_type = %d\n", - (int32) loc_eng_data.client_handle, lock_type); - - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = lock_type; - 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*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_set_gps_lock mode failed\n"); - } - - return 0; -} - -/*=========================================================================== -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 - -===========================================================================*/ -static int loc_eng_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr; - boolean ret_val; - - LOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) loc_eng_data.client_handle, min_interval, mode); - - loc_eng_data.position_mode = mode; - ioctl_data.disc = RPC_LOC_IOCTL_SET_FIX_CRITERIA; - - fix_criteria_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria); - fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | - RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; - - switch (mode) { - case GPS_POSITION_MODE_MS_BASED: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSB; - break; - case GPS_POSITION_MODE_MS_ASSISTED: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_MSA; - break; - case GPS_POSITION_MODE_STANDALONE: - default: - fix_criteria_ptr->preferred_operation_mode = RPC_LOC_OPER_MODE_STANDALONE; - break; - } - if (min_interval > 0) { - fix_criteria_ptr->min_interval = min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - } - if (preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = preferred_accuracy; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; - } - if (preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = preferred_time; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; - } - - switch (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; - } - - ret_val = loc_eng_ioctl(loc_eng_data.client_handle, - RPC_LOC_IOCTL_SET_FIX_CRITERIA, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_set_position mode failed\n"); - } - - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_inject_time - -DESCRIPTION - This is used by Java native function to do time injection. - -DEPENDENCIES - None - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_inject_time (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; - boolean ret_val; - - LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); - - ioctl_data.disc = RPC_LOC_IOCTL_INJECT_UTC_TIME; - - 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)(android::elapsedRealtime() - timeReference); - time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_UTC_TIME, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("loc_eng_inject_time failed\n"); - } - - return 0; -} - -static int loc_eng_inject_location (double latitude, double longitude, float accuracy) -{ - /* not yet implemented */ - 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 - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_delete_aiding_data (GpsAidingData f) -{ - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - - // Currently, LOC API only support deletion of all aiding data, - if (f) - loc_eng_data.aiding_data_for_deletion = GPS_DELETE_ALL; - - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) - { - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - - // In case gps engine is ON, the assistance data will be deleted when the engine is OFF - } - - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); -} - -/*=========================================================================== -FUNCTION loc_eng_get_extension - -DESCRIPTION - Get the gps extension to support XTRA. - -DEPENDENCIES - N/A - -RETURN VALUE - The GPS extension interface. - -SIDE EFFECTS - N/A - -===========================================================================*/ -static const void* loc_eng_get_extension(const char* name) -{ - if (strcmp(name, GPS_XTRA_INTERFACE) == 0) - { - return &sLocEngXTRAInterface; - } - else if (strcmp(name, AGPS_INTERFACE) == 0) - { - return &sLocEngAGpsInterface; - } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) - { - return &sLocEngNiInterface; - } - - return NULL; -} - -#if DEBUG_MOCK_NI == 1 -/*=========================================================================== -FUNCTION mock_ni - -DESCRIPTION - DEBUG tool: simulate an NI request - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void* mock_ni(void* arg) -{ - static int busy = 0; - - if (busy) return NULL; - - busy = 1; - - sleep(5); - - rpc_loc_client_handle_type client_handle; - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type payload; - rpc_loc_ni_event_s_type *ni_req; - rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; - - client_handle = (rpc_loc_client_handle_type) arg; - - loc_event = RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST; - payload.disc = loc_event; - - ni_req = &payload.rpc_loc_event_payload_u_type_u.ni_request; - ni_req->event = RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ; - supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; - - // Encodings for Spirent Communications - char client_name[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, - 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; - char requestor_id[80] = {0x53,0x78,0x5A,0x5E,0x76,0xD3,0x41,0xC3,0x77, - 0xBB,0x5D,0x77,0xA7,0xC7,0x61,0x7A,0xFA,0xED,0x9E,0x03}; - - supl_req->flags = RPC_LOC_NI_CLIENT_NAME_PRESENT | - RPC_LOC_NI_REQUESTOR_ID_PRESENT | - RPC_LOC_NI_ENCODING_TYPE_PRESENT; - - supl_req->datacoding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; - - supl_req->client_name.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; // no coding - supl_req->client_name.client_name_string.client_name_string_len = strlen(client_name); - supl_req->client_name.client_name_string.client_name_string_val = client_name; - supl_req->client_name.string_len = strlen(client_name); - - supl_req->requestor_id.data_coding_scheme = RPC_LOC_NI_SUPL_GSM_DEFAULT; - supl_req->requestor_id.requestor_id_string.requestor_id_string_len = strlen(requestor_id); - supl_req->requestor_id.requestor_id_string.requestor_id_string_val = requestor_id; - supl_req->requestor_id.string_len = strlen(requestor_id); - - supl_req->notification_priv_type = RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP; - supl_req->user_response_timer = 10; - - loc_event_cb(client_handle, loc_event, &payload); - - busy = 0; - - return NULL; -} -#endif // DEBUG_MOCK_NI - -/*=========================================================================== -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( - rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload - ) -{ - LOGV ("loc_event_cb, client = %d, loc_event = 0x%x", (int32) client_handle, (uint32) loc_event); - if (client_handle == loc_eng_data.client_handle) - { - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - loc_eng_data.loc_event = loc_event; - memcpy(&loc_eng_data.loc_event_payload, loc_event_payload, sizeof(*loc_event_payload)); - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_EVENT; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - } - else - { - LOGD ("loc client mismatch: received = %d, expected = %d \n", (int32) client_handle, (int32) loc_eng_data.client_handle); - } - - return RPC_LOC_API_SUCCESS; -} - -/*=========================================================================== -FUNCTION loc_eng_report_position - -DESCRIPTION - Reports position information to the Java layer. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_report_position (const rpc_loc_parsed_position_s_type *location_report_ptr) -{ - UlpLocation location; - - LOGV ("loc_eng_report_position: location report, valid mask = 0x%x, sess status = %d\n", - (uint32) location_report_ptr->valid_mask, location_report_ptr->session_status); - - memset (&location, 0, sizeof(location)); - location.size = sizeof(location); - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) - { - // Not a position report, return - if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS) - { - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) - { - location.timestamp = location_report_ptr->timestamp_utc; - } - - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE)) - { - location.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.latitude = location_report_ptr->latitude; - location.longitude = location_report_ptr->longitude; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) - { - location.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.altitude = location_report_ptr->altitude_wrt_ellipsoid; - } - - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) - { - location.flags |= GPS_LOCATION_HAS_SPEED; - location.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) - { - location.flags |= GPS_LOCATION_HAS_BEARING; - location.bearing = location_report_ptr->heading; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) - { - location.flags |= GPS_LOCATION_HAS_ACCURACY; - location.accuracy = location_report_ptr->hor_unc_circular; - } - - if (loc_eng_data.location_cb != NULL) - { - LOGV ("loc_eng_report_position: fire callback\n"); - loc_eng_data.location_cb (&location); - } - } - else - { - LOGV ("loc_eng_report_position: ignore position report when session status = %d\n", location_report_ptr->session_status); - } - } - else - { - LOGV ("loc_eng_report_position: ignore position report when session status is not set\n"); - } -} - -/*=========================================================================== -FUNCTION loc_eng_report_sv - -DESCRIPTION - Reports GPS satellite information to the Java layer. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_report_sv (const rpc_loc_gnss_info_s_type *gnss_report_ptr) -{ - GpsSvStatus SvStatus; - int num_svs_max, i; - const rpc_loc_sv_info_s_type *sv_info_ptr; - - LOGV ("loc_eng_report_sv: valid_mask = 0x%x, num of sv = %d\n", - (uint32) gnss_report_ptr->valid_mask, - gnss_report_ptr->sv_count); - - num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); - 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 (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(GpsSvStatus); - 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.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) - { - 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++; - } - } - - LOGV ("num_svs = %d, eph mask = %d, alm mask = %d\n", SvStatus.num_svs, SvStatus.ephemeris_mask, SvStatus.almanac_mask ); - if ((SvStatus.num_svs != 0) && (loc_eng_data.sv_status_cb != NULL)) - { - loc_eng_data.sv_status_cb(&SvStatus); - } -} - -/*=========================================================================== -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 (const rpc_loc_status_event_s_type *status_report_ptr) -{ - GpsStatus status; - - LOGV ("loc_eng_report_status: event = %d\n", status_report_ptr->event); - - memset (&status, 0, sizeof(status)); - status.size = sizeof(status); - status.status = GPS_STATUS_NONE; - 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) - { - // GPS_STATUS_SESSION_BEGIN implies GPS_STATUS_ENGINE_ON - status.status = GPS_STATUS_SESSION_BEGIN; - loc_eng_data.status_cb(&status); - } - else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) - { - // GPS_STATUS_SESSION_END implies GPS_STATUS_ENGINE_OFF - status.status = GPS_STATUS_ENGINE_OFF; - loc_eng_data.status_cb(&status); - } - } - - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - loc_eng_data.engine_status = status.status; - - // Wake up the thread for aiding data deletion. - if ((loc_eng_data.engine_status != GPS_STATUS_SESSION_BEGIN) && - (loc_eng_data.aiding_data_for_deletion != 0)) - { - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_DELETE_AIDING; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - // In case gps engine is ON, the assistance data will be deleted when the engine is OFF - } - - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); -} - -static void loc_eng_report_nmea (const rpc_loc_nmea_report_s_type *nmea_report_ptr) -{ - if (loc_eng_data.nmea_cb != NULL) - { - struct timeval tv; - - gettimeofday(&tv, (struct timezone *) NULL); - long long now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - -#if (AMSS_VERSION==3200) - loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); -#else - loc_eng_data.nmea_cb(now, nmea_report_ptr->nmea_sentences, nmea_report_ptr->length); -#endif - } -} - -/*=========================================================================== -FUNCTION loc_eng_process_conn_request - -DESCRIPTION - Requests data connection to be brought up/tore down with the location server. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_conn_request (const rpc_loc_server_request_s_type *server_request_ptr) -{ - LOGD ("loc_event_cb: get loc event location server request, event = %d\n", server_request_ptr->event); - - // Signal DeferredActionThread to send the APN name - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - - // This implemenation is based on the fact that modem now at any time has only one data connection for AGPS at any given time - if (server_request_ptr->event == RPC_LOC_SERVER_REQUEST_OPEN) - { - loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; - loc_eng_data.agps_status = GPS_REQUEST_AGPS_DATA_CONN; - loc_eng_data.agps_request_pending = true; - } - else - { - loc_eng_data.conn_handle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; - loc_eng_data.agps_status = GPS_RELEASE_AGPS_DATA_CONN; - loc_eng_data.agps_request_pending = false; - } - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_STATUS; - pthread_cond_signal(&loc_eng_data.deferred_action_cond); - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); -} - -/*=========================================================================== -FUNCTION loc_eng_agps_init - -DESCRIPTION - - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_agps_init(AGpsCallbacks* callbacks) -{ - LOGV("loc_eng_agps_init\n"); - loc_eng_data.agps_status_cb = callbacks->status_cb; -} - -static int loc_eng_agps_data_conn_open(const char* apn) -{ - int apn_len; - LOGD("loc_eng_agps_data_conn_open: %s\n", apn); - - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - - if (apn != NULL) - { - apn_len = strlen (apn); - - if (apn_len >= sizeof(loc_eng_data.apn_name)) - { - LOGD ("loc_eng_set_apn: error, apn name exceeds maximum lenght of 100 chars\n"); - apn_len = sizeof(loc_eng_data.apn_name) - 1; - } - - memcpy (loc_eng_data.apn_name, apn, apn_len); - loc_eng_data.apn_name[apn_len] = '\0'; - } - - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_SUCCESS; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int loc_eng_agps_data_conn_closed() -{ - LOGD("loc_eng_agps_data_conn_closed\n"); - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_CLOSED; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int loc_eng_agps_data_conn_failed() -{ - LOGD("loc_eng_agps_data_conn_failed\n"); - - pthread_mutex_lock(&(loc_eng_data.deferred_action_mutex)); - /* hold a wake lock while events are pending for deferred_action_thread */ - loc_eng_data.acquire_wakelock_cb(); - loc_eng_data.deferred_action_flags |= DEFERRED_ACTION_AGPS_DATA_FAILED; - pthread_cond_signal(&(loc_eng_data.deferred_action_cond)); - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - return 0; -} - -static int set_agps_server() -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_server_info_s_type *server_info_ptr; - boolean ret_val; - uint16 port_temp; - unsigned char *b_ptr; - - if (loc_eng_data.agps_server_host[0] == 0 || loc_eng_data.agps_server_port == 0) - return -1; - - if (loc_eng_data.agps_server_address == 0) { - struct hostent* he = gethostbyname(loc_eng_data.agps_server_host); - if (he) - loc_eng_data.agps_server_address = *(uint32_t *)he->h_addr_list[0]; - } - if (loc_eng_data.agps_server_address == 0) - return -1; - - b_ptr = (unsigned char*) (&loc_eng_data.agps_server_address); - - - server_info_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr); - ioctl_data.disc = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; - server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; - server_info_ptr->addr_info.disc = RPC_LOC_SERVER_ADDR_URL; - -#if (AMSS_VERSION==3200) - char url[24]; - memset(url, 0, sizeof(url)); - snprintf(url, sizeof(url) - 1, "%d.%d.%d.%d:%d", - (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), - (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), - (loc_eng_data.agps_server_port & (0x0000ffff))); - - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = url; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len = strlen(url); - LOGD ("set_agps_server, addr = %s\n", server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val); -#else - char* buf = server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr; - int buf_len = sizeof(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); - memset(buf, 0, buf_len); - snprintf(buf, buf_len - 1, "%d.%d.%d.%d:%d", - (*(b_ptr + 0) & 0x000000ff), (*(b_ptr+1) & 0x000000ff), - (*(b_ptr + 2) & 0x000000ff), (*(b_ptr+3) & 0x000000ff), - (loc_eng_data.agps_server_port & (0x0000ffff))); - - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = buf_len; - LOGD ("set_agps_server, addr = %s\n", buf); -#endif - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - if (ret_val != TRUE) - { - LOGD ("set_agps_server failed\n"); - return -1; - } - else - { - LOGV ("set_agps_server successful\n"); - return 0; - } -} - -static int loc_eng_agps_set_server(AGpsType type, const char* hostname, int port) -{ - LOGD ("loc_eng_set_default_agps_server, type = %d, hostname = %s, port = %d\n", type, hostname, port); - - if (type != AGPS_TYPE_SUPL) - return -1; - - strncpy(loc_eng_data.agps_server_host, hostname, sizeof(loc_eng_data.agps_server_host) - 1); - loc_eng_data.agps_server_port = port; - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_delete_aiding_data_deferred_action - -DESCRIPTION - This is used to remove the aiding data when GPS engine is off. - -DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with - LOC API specification. - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_delete_aiding_data_deferred_action (void) -{ - // Currently, we only support deletion of all aiding data, - // since the Android defined aiding data mask matches with modem, - // so just pass them down without any translation - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_assist_data_delete_s_type *assist_data_ptr; - boolean ret_val; - - ioctl_data.disc = RPC_LOC_IOCTL_DELETE_ASSIST_DATA; - assist_data_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete); - assist_data_ptr->type = loc_eng_data.aiding_data_for_deletion; - loc_eng_data.aiding_data_for_deletion = 0; - - memset (&(assist_data_ptr->reserved), 0, sizeof (assist_data_ptr->reserved)); - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_DELETE_ASSIST_DATA , - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL); - - LOGD("loc_eng_ioctl for aiding data deletion returned %d, 1 for success\n", ret_val); -} - -/*=========================================================================== -FUNCTION loc_eng_process_atl_deferred_action - -DESCRIPTION - This is used to inform the location engine of the processing status for - data connection open/close request. - -DEPENDENCIES - None - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_atl_deferred_action (int flags) -{ - rpc_loc_server_open_status_s_type *conn_open_status_ptr; - rpc_loc_server_close_status_s_type *conn_close_status_ptr; - rpc_loc_ioctl_data_u_type ioctl_data; - boolean ret_val; - int agps_status = -1; - - LOGV("loc_eng_process_atl_deferred_action, agps_status = %d\n", loc_eng_data.agps_status); - - memset (&ioctl_data, 0, sizeof (rpc_loc_ioctl_data_u_type)); - - if (flags & DEFERRED_ACTION_AGPS_DATA_CLOSED) - { - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; - conn_close_status_ptr = &(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status); - conn_close_status_ptr->conn_handle = loc_eng_data.conn_handle; - conn_close_status_ptr->close_status = RPC_LOC_SERVER_CLOSE_SUCCESS; - } - else - { - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; - conn_open_status_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; - conn_open_status_ptr->conn_handle = loc_eng_data.conn_handle; - if (flags & DEFERRED_ACTION_AGPS_DATA_SUCCESS) - { - conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_SUCCESS; - // Both buffer are of the same maximum size, and the source is null terminated - // strcpy (&(ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status.apn_name), &(loc_eng_data.apn_name)); -#if (AMSS_VERSION==3200) - conn_open_status_ptr->apn_name = loc_eng_data.apn_name; -#else - memset(conn_open_status_ptr->apn_name, 0, sizeof(conn_open_status_ptr->apn_name)); - strncpy(conn_open_status_ptr->apn_name, loc_eng_data.apn_name, - sizeof(conn_open_status_ptr->apn_name) - 1); -#endif - // Delay this so that PDSM ATL module will behave properly - sleep (1); - LOGD("loc_eng_ioctl for ATL with apn_name = %s\n", conn_open_status_ptr->apn_name); - } - else // data_connection_failed - { - conn_open_status_ptr->open_status = RPC_LOC_SERVER_OPEN_FAIL; - } - // Delay this so that PDSM ATL module will behave properly - sleep (1); - } - - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - ioctl_data.disc, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL); - - LOGD("loc_eng_ioctl for ATL returned %d (1 for success)\n", ret_val); -} - -/*=========================================================================== -FUNCTION loc_eng_process_loc_event - -DESCRIPTION - This is used to process events received from the location engine. - -DEPENDENCIES - None - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_loc_event (rpc_loc_event_mask_type loc_event, - rpc_loc_event_payload_u_type* loc_event_payload) -{ - if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) - { - loc_eng_report_position (&(loc_event_payload->rpc_loc_event_payload_u_type_u.parsed_location_report)); - } - - if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) - { - loc_eng_report_sv (&(loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report)); - } - - if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) - { - loc_eng_report_status (&(loc_event_payload->rpc_loc_event_payload_u_type_u.status_report)); - } - - if (loc_event & RPC_LOC_EVENT_NMEA_POSITION_REPORT) - { - loc_eng_report_nmea (&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); - } - - // Android XTRA interface 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) - { - LOGD ("loc_event_cb: xtra download requst"); - - // Call Registered callback - if (loc_eng_data.xtra_module_data.download_request_cb != NULL) - { - loc_eng_data.xtra_module_data.download_request_cb (); - } - } - } - - if (loc_event & RPC_LOC_EVENT_IOCTL_REPORT) - { - // Process the received RPC_LOC_EVENT_IOCTL_REPORT - (void) loc_eng_ioctl_process_cb (loc_eng_data.client_handle, - &(loc_event_payload->rpc_loc_event_payload_u_type_u.ioctl_report)); - } - - if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) - { - loc_eng_process_conn_request (&(loc_event_payload->rpc_loc_event_payload_u_type_u.loc_server_request)); - } - - loc_eng_ni_callback(loc_event, loc_event_payload); - -#if DEBUG_MOCK_NI == 1 - // DEBUG only - if ((loc_event & RPC_LOC_EVENT_STATUS_REPORT) && - loc_event_payload->rpc_loc_event_payload_u_type_u.status_report. - payload.rpc_loc_status_event_payload_u_type_u.engine_state - == RPC_LOC_ENGINE_STATE_OFF) - { - // Mock an NI request - pthread_t th; - pthread_create (&th, NULL, mock_ni, (void*) client_handle); - } -#endif /* DEBUG_MOCK_NI == 1 */ -} - -/*=========================================================================== -FUNCTION loc_eng_process_deferred_action - -DESCRIPTION - Main routine for the thread to execute certain commands - that are not safe to be done from within an RPC callback. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_process_deferred_action (void* arg) -{ - AGpsExtStatus status; - status.size = sizeof(status); - status.type = AGPS_TYPE_SUPL; - - LOGD("loc_eng_process_deferred_action started\n"); - - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); - - // disable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_NONE\n"); - loc_eng_set_gps_lock(RPC_LOC_LOCK_NONE); - - while (1) - { - GpsAidingData aiding_data_for_deletion; - GpsStatusValue engine_status; - - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type loc_event_payload; - - // Wait until we are signalled to do a deferred action, or exit - pthread_mutex_lock(&loc_eng_data.deferred_action_mutex); - - // If we have an event we should process it immediately, - // otherwise wait until we are signalled - if (loc_eng_data.deferred_action_flags == 0) { - // do not hold a wake lock while waiting for an event... - loc_eng_data.release_wakelock_cb(); - pthread_cond_wait(&loc_eng_data.deferred_action_cond, - &loc_eng_data.deferred_action_mutex); - // but after we are signalled reacquire the wake lock - // until we are done processing the event. - loc_eng_data.acquire_wakelock_cb(); - } - - if (loc_eng_data.deferred_action_flags & DEFERRED_ACTION_QUIT) - { - pthread_mutex_unlock(&loc_eng_data.deferred_action_mutex); - break; - } - - // copy anything we need before releasing the mutex - loc_event = loc_eng_data.loc_event; - if (loc_event != 0) { - memcpy(&loc_event_payload, &loc_eng_data.loc_event_payload, sizeof(loc_event_payload)); - loc_eng_data.loc_event = 0; - } - - int flags = loc_eng_data.deferred_action_flags; - loc_eng_data.deferred_action_flags = 0; - engine_status = loc_eng_data.agps_status; - aiding_data_for_deletion = loc_eng_data.aiding_data_for_deletion; - status.status = loc_eng_data.agps_status; - loc_eng_data.agps_status = 0; - - // perform all actions after releasing the mutex to avoid blocking RPCs from the ARM9 - pthread_mutex_unlock(&(loc_eng_data.deferred_action_mutex)); - - if (loc_event != 0) { - loc_eng_process_loc_event(loc_event, &loc_event_payload); - } - - // send_delete_aiding_data must be done when GPS engine is off - if ((engine_status != GPS_STATUS_SESSION_BEGIN) && (aiding_data_for_deletion != 0)) - { - loc_eng_delete_aiding_data_deferred_action (); - } - - if (flags & (DEFERRED_ACTION_AGPS_DATA_SUCCESS | - DEFERRED_ACTION_AGPS_DATA_CLOSED | - DEFERRED_ACTION_AGPS_DATA_FAILED)) - { - loc_eng_process_atl_deferred_action(flags); - - pthread_mutex_lock(&(loc_eng_data.deferred_stop_mutex)); - // work around problem with loc_eng_stop when AGPS requests are pending - // we defer stopping the engine until the AGPS request is done - loc_eng_data.agps_request_pending = false; - if (loc_eng_data.stop_request_pending) - { - LOGD ("handling deferred stop\n"); - if (loc_stop_fix(loc_eng_data.client_handle) != RPC_LOC_API_SUCCESS) - { - LOGD ("loc_stop_fix failed!\n"); - } - } - pthread_mutex_unlock(&(loc_eng_data.deferred_stop_mutex)); - } - - if (status.status != 0 && loc_eng_data.agps_status_cb) { - loc_eng_data.agps_status_cb(&status); - } - } - - // reenable the GPS lock - LOGD("Setting GPS privacy lock to RPC_LOC_LOCK_ALL\n"); - loc_eng_set_gps_lock(RPC_LOC_LOCK_ALL); - - LOGD("loc_eng_process_deferred_action thread exiting\n"); - loc_eng_data.release_wakelock_cb(); - - loc_eng_data.deferred_action_thread = 0; -} - -// for gps.c -extern "C" const GpsInterface* get_gps_interface() -{ - return &sLocEngInterface; -} diff --git a/loc_api/libloc_api/loc_eng.h b/loc_api/libloc_api/loc_eng.h deleted file mode 100644 index b8553316..00000000 --- a/loc_api/libloc_api/loc_eng.h +++ /dev/null @@ -1,115 +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_H -#define LOC_ENG_H - -// 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 - -#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds - -enum { - DEFERRED_ACTION_EVENT = 0x01, - DEFERRED_ACTION_DELETE_AIDING = 0x02, - DEFERRED_ACTION_AGPS_STATUS = 0x04, - DEFERRED_ACTION_AGPS_DATA_SUCCESS = 0x08, - DEFERRED_ACTION_AGPS_DATA_CLOSED = 0x10, - DEFERRED_ACTION_AGPS_DATA_FAILED = 0x20, - DEFERRED_ACTION_QUIT = 0x40, -}; - -// Module data -typedef struct -{ - rpc_loc_client_handle_type client_handle; - - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - agps_status_callback agps_status_cb; - gps_nmea_callback nmea_cb; - gps_ni_notify_callback ni_notify_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - int agps_status; - - // used to defer stopping the GPS engine until AGPS data calls are done - boolean agps_request_pending; - boolean stop_request_pending; - pthread_mutex_t deferred_stop_mutex; - - loc_eng_xtra_data_s_type xtra_module_data; - - loc_eng_ioctl_data_s_type ioctl_data; - - // data from loc_event_cb - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type loc_event_payload; - - // TBD: - char agps_server_host[256]; - int agps_server_port; - uint32 agps_server_address; - char apn_name[100]; - int position_mode; - rpc_loc_server_connection_handle conn_handle; - - // GPS engine status - GpsStatusValue engine_status; - - // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off - GpsAidingData aiding_data_for_deletion; - - // Data variables used by deferred action thread - pthread_t deferred_action_thread; - // Mutex used by deferred action thread - pthread_mutex_t deferred_action_mutex; - // Condition variable used by deferred action thread - pthread_cond_t deferred_action_cond; - - // flags for pending events for deferred action thread - int deferred_action_flags; -} loc_eng_data_s_type; - -extern loc_eng_data_s_type loc_eng_data; - -#endif // LOC_ENG_H diff --git a/loc_api/libloc_api/loc_eng_ioctl.cpp b/loc_api/libloc_api/loc_eng_ioctl.cpp deleted file mode 100644 index dc7b2c11..00000000 --- a/loc_api/libloc_api/loc_eng_ioctl.cpp +++ /dev/null @@ -1,354 +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. - * - */ - -#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -// Function declarations -static boolean loc_eng_ioctl_setup_cb( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type -); - -static boolean loc_eng_ioctl_wait_cb( - int timeout_msec, // Timeout in this number of msec - rpc_loc_ioctl_callback_s_type *cb_data_ptr // Output parameter for IOCTL calls -); - -/*=========================================================================== - -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 - -===========================================================================*/ -boolean 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 - ) -{ - boolean ret_val; - int rpc_ret_val; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - LOGV ("loc_eng_ioctl: client = %d, ioctl_type = %d, cb_data =0x%x\n", (int32) handle, ioctl_type, (uint32) cb_data_ptr); - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - // Select the callback we are waiting for - ret_val = loc_eng_ioctl_setup_cb (handle, ioctl_type); - - if (ret_val == TRUE) - { - rpc_ret_val = loc_ioctl (handle, - ioctl_type, - ioctl_data_ptr); - - LOGV ("loc_eng_ioctl: loc_ioctl returned %d \n", rpc_ret_val); - - if (rpc_ret_val == RPC_LOC_API_SUCCESS) - { - // Wait for the callback of loc_ioctl - ret_val = loc_eng_ioctl_wait_cb (timeout_msec, cb_data_ptr); - } - else - { - ret_val = FALSE; - } - } - - // Reset the state when we are done - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - ioctl_cb_data_ptr->cb_is_selected = FALSE; - ioctl_cb_data_ptr->cb_is_waiting = FALSE; - ioctl_cb_data_ptr->cb_has_arrived = FALSE; - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - return ret_val; -} - - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_setup_cb - -DESCRIPTION - Selects which callback is going to be waited for - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -static boolean loc_eng_ioctl_setup_cb( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type - ) -{ - boolean ret_val; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - if (ioctl_cb_data_ptr->cb_is_selected == TRUE) - { - LOGD ("loc_eng_ioctl_setup_cb: ERROR, another ioctl in progress \n"); - ret_val = FALSE; - } - else - { - ioctl_cb_data_ptr->cb_is_selected = TRUE; - ioctl_cb_data_ptr->cb_is_waiting = FALSE; - ioctl_cb_data_ptr->cb_has_arrived = FALSE; - ioctl_cb_data_ptr->client_handle = handle; - ioctl_cb_data_ptr->ioctl_type = ioctl_type; - memset (&(ioctl_cb_data_ptr->cb_payload), 0, sizeof (rpc_loc_ioctl_callback_s_type)); - ret_val = TRUE; - } - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_wait_cb - -DESCRIPTION - Waits for a selected callback. The wait expires in timeout_msec. - - If the function is called before an existing wait has finished, it will - immediately return EBUSY. - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -boolean loc_eng_ioctl_wait_cb( - int timeout_msec, // Timeout in this number of msec - rpc_loc_ioctl_callback_s_type *cb_data_ptr - ) -{ - boolean ret_val = FALSE; // the return value of this function - int rc; // return code from pthread calls - - struct timeval present_time; - struct timespec expire_time; - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - - do { - if (ioctl_cb_data_ptr->cb_is_selected == FALSE) - { - LOGD ("loc_eng_ioctl_wait_cb: ERROR called when cb_is_waiting is set to FALSE \n"); - ret_val = FALSE; - break; - } - - // Calculate absolute expire time - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec; - expire_time.tv_sec += timeout_msec / 1000; - if ((present_time.tv_usec + timeout_msec) >= 1000) - { - expire_time.tv_sec += 1; - } - expire_time.tv_nsec = (present_time.tv_usec + timeout_msec) % 1000 * 1000; - - // Special case where callback is issued before loc_ioctl ever returns - if (ioctl_cb_data_ptr->cb_has_arrived == TRUE) - { - LOGD ("loc_eng_ioctl_wait_cb: cb has arrived without waiting \n"); - ret_val = TRUE; - break; - } - - ioctl_cb_data_ptr->cb_is_waiting = TRUE; - // Wait for the callback until timeout expires - rc = pthread_cond_timedwait(&ioctl_cb_data_ptr->cb_arrived_cond, - &ioctl_cb_data_ptr->cb_data_mutex, - &expire_time); - - if (rc == 0) - { - ret_val = TRUE; - } - else - { - ret_val = FALSE; - } - - LOGV ("loc_eng_ioctl_wait_cb: pthread_cond_timedwait returned %d\n", rc); - - } while (0); - - // Process the ioctl callback data when IOCTL is successful - if (ret_val == TRUE) - { - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - if (ioctl_cb_data_ptr->cb_payload.status == RPC_LOC_API_SUCCESS) - { - ret_val = TRUE; - if (cb_data_ptr != NULL) - { - memcpy (cb_data_ptr, - &(ioctl_cb_data_ptr->cb_payload), - sizeof (rpc_loc_ioctl_callback_s_type)); - } - } - else - { - ret_val = FALSE; - } - } - - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - LOGV ("loc_eng_ioctl_wait_cb: returned %d\n", ret_val); - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_eng_ioctl_process_cb - -DESCRIPTION - This function process the IOCTL callback, parameter specifies the client - that receives the IOCTL callback. - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -boolean loc_eng_ioctl_process_cb ( - rpc_loc_client_handle_type client_handle, - const rpc_loc_ioctl_callback_s_type *cb_data_ptr - ) -{ - boolean ret_val = FALSE; // the return value of this function - loc_eng_ioctl_data_s_type *ioctl_cb_data_ptr; - ioctl_cb_data_ptr = &(loc_eng_data.ioctl_data); - - pthread_mutex_lock(&ioctl_cb_data_ptr->cb_data_mutex); - if (client_handle != ioctl_cb_data_ptr->client_handle) - { - LOGD ("loc_eng_ioctl_process_cb: client handle mismatch, received = %d, expected = %d \n", - (int32) client_handle, (int32) ioctl_cb_data_ptr->client_handle); - ret_val = FALSE; - } - else if (cb_data_ptr->type != ioctl_cb_data_ptr->ioctl_type) - { - LOGD ("loc_eng_ioctl_process_cb: ioctl type mismatch, received = %d, expected = %d \n", - cb_data_ptr->type, ioctl_cb_data_ptr->ioctl_type); - ret_val = FALSE; - } - else // both matches - { - memcpy (&(ioctl_cb_data_ptr->cb_payload), - cb_data_ptr, - sizeof (rpc_loc_ioctl_callback_s_type)); - - ioctl_cb_data_ptr->cb_has_arrived = TRUE; - - LOGV ("loc_eng_ioctl_process_cb: callback arrived for client = %d, ioctl = %d, status = %d\n", - (int32) ioctl_cb_data_ptr->client_handle, ioctl_cb_data_ptr->ioctl_type, - (int32) ioctl_cb_data_ptr->cb_payload.status); - - ret_val = TRUE; - } - - pthread_mutex_unlock(&ioctl_cb_data_ptr->cb_data_mutex); - - // Signal the waiting thread that callback has arrived - if (ret_val == TRUE) - { - pthread_cond_signal (&ioctl_cb_data_ptr->cb_arrived_cond); - } - - return ret_val; -} diff --git a/loc_api/libloc_api/loc_eng_ioctl.h b/loc_api/libloc_api/loc_eng_ioctl.h deleted file mode 100644 index b8191256..00000000 --- a/loc_api/libloc_api/loc_eng_ioctl.h +++ /dev/null @@ -1,69 +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_IOCTL_H -#define LOC_ENG_IOCTL_H - -// Module data -typedef struct loc_eng_ioctl_data_s_type -{ - // We are waiting for an ioctl callback - boolean cb_is_selected; - // The thread has been put in a wait state for an ioctl callback - boolean cb_is_waiting; - // Loc client handle that is waiting for the callback - rpc_loc_client_handle_type client_handle; - // IOCTL type that the loc client is waiting for - rpc_loc_ioctl_e_type ioctl_type; - // The IOCLT report has arrived for the waiting client - boolean cb_has_arrived; - // The payload for the RPC_LOC_EVENT_IOCTL_REPORT - rpc_loc_ioctl_callback_s_type cb_payload; - // Mutex to access this data structure - pthread_mutex_t cb_data_mutex; - // LOC ioctl callback arrived mutex - pthread_cond_t cb_arrived_cond; -} loc_eng_ioctl_data_s_type; - - -extern boolean 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 -); - -extern boolean loc_eng_ioctl_process_cb -( - rpc_loc_client_handle_type client_handle, - const rpc_loc_ioctl_callback_s_type *cb_data_ptr -); -#endif // LOC_ENG_IOCTL_H diff --git a/loc_api/libloc_api/loc_eng_ni.cpp b/loc_api/libloc_api/loc_eng_ni.cpp deleted file mode 100644 index 11d7abac..00000000 --- a/loc_api/libloc_api/loc_eng_ni.cpp +++ /dev/null @@ -1,609 +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. - * - */ - -#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -/*============================================================================= - * - * DATA DECLARATION - * - *============================================================================*/ - -const GpsNiInterface sLocEngNiInterface = -{ - sizeof(GpsNiInterface), - loc_eng_ni_init, - loc_eng_ni_respond, -}; - -boolean loc_eng_ni_data_init = FALSE; -loc_eng_ni_data_s_type loc_eng_ni_data; - -extern loc_eng_data_s_type loc_eng_data; - -/*============================================================================= - * - * FUNCTION DECLARATIONS - * - *============================================================================*/ - -/*=========================================================================== - -FUNCTION respond_from_enum - -DESCRIPTION - Returns the name of the response - -RETURN VALUE - response name string - -===========================================================================*/ -static const char* respond_from_enum(rpc_loc_ni_user_resp_e_type resp) -{ - switch (resp) - { - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT: - return "accept"; - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY: - return "deny"; - case RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP: - return "no response"; - default: - return NULL; - } -} - -/*=========================================================================== - -FUNCTION loc_ni_respond - -DESCRIPTION - Displays the NI request and awaits user input. If a previous request is - in session, the new one is handled using sys.ni_default_response (if exists); - otherwise, it is denied. - -DEPENDENCY - Do not lock the data by mutex loc_ni_lock - -RETURN VALUE - none - -===========================================================================*/ -static void loc_ni_respond(rpc_loc_ni_user_resp_e_type resp, - const rpc_loc_ni_event_s_type *request_pass_back -) -{ - LOGD("Sending NI response: %s\n", respond_from_enum(resp)); - - 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, - request_pass_back, sizeof (rpc_loc_ni_event_s_type)); - data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = resp; - - loc_eng_ioctl( - loc_eng_data.client_handle, - RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, - &data, - LOC_IOCTL_DEFAULT_TIMEOUT, - &callback_payload - ); -} - -/*=========================================================================== - -FUNCTION loc_ni_fill_notif_verify_type - -DESCRIPTION - Fills need_notify, need_verify, etc. - -RETURN VALUE - none - -===========================================================================*/ -static boolean loc_ni_fill_notif_verify_type(GpsNiNotification *notif, - rpc_loc_ni_notify_verify_e_type notif_priv) -{ - notif->notify_flags = 0; - notif->default_response = GPS_NI_RESPONSE_NORESP; - - switch (notif_priv) - { - case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: - notif->notify_flags = 0; - break; - - case RPC_LOC_NI_USER_NOTIFY_ONLY: - notif->notify_flags = GPS_NI_NEED_NOTIFY; - break; - - 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; - break; - - 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; - break; - - case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: - notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; - break; - - default: - return FALSE; - } - - return TRUE; -} - -/*=========================================================================== - -FUNCTION hexcode - -DESCRIPTION - Converts a binary array into a Hex string. E.g., 1F 00 3F --> "1F003F" - -RETURN VALUE - bytes encoded - -===========================================================================*/ -static 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; -} - -static GpsNiEncodingType convert_encoding_type(int loc_encoding) -{ - GpsNiEncodingType enc = GPS_ENC_UNKNOWN; - - switch (loc_encoding) - { - case RPC_LOC_NI_SUPL_UTF8: - enc = GPS_ENC_SUPL_UTF8; - break; - case RPC_LOC_NI_SUPL_UCS2: - enc = GPS_ENC_SUPL_UCS2; - break; - case RPC_LOC_NI_SUPL_GSM_DEFAULT: - enc = GPS_ENC_SUPL_GSM_DEFAULT; - break; - default: - break; - } - - return enc; -} - -/*=========================================================================== - -FUNCTION loc_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 - -===========================================================================*/ -static void loc_ni_request_handler(const char *msg, const rpc_loc_ni_event_s_type *ni_req) -{ - GpsNiNotification notif; - notif.size = sizeof(notif); - strlcpy(notif.text, "[text]", sizeof notif.text); // defaults - strlcpy(notif.requestor_id, "[requestor id]", sizeof notif.requestor_id); - - /* If busy, use default or deny */ - if (loc_eng_ni_data.notif_in_progress) - { -#if 0 - /* Cannot be here because the current thread is in RPC client */ - /* XXX Consider adding an event queue to process overlapped NI requests */ - loc_ni_user_resp_e_type response = - sys.ni_default_resp == 1 /* accept */ ? - LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT : - LOC_NI_LCS_NOTIFY_VERIFY_DENY; - - loc_ni_respond(response, ni_req); */ -#endif - LOGW("loc_ni_request_handler, notification in progress, new NI request ignored, type: %d", - ni_req->event); - } - else { - /* Print notification */ - LOGD("NI Notification: %s, event: %d", msg, ni_req->event); - - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - - /* Save request */ - memcpy(&loc_eng_ni_data.loc_ni_request, ni_req, sizeof loc_eng_ni_data.loc_ni_request); - - /* Set up NI response waiting */ - loc_eng_ni_data.notif_in_progress = TRUE; - loc_eng_ni_data.current_notif_id = abs(rand()); - - /* Fill in notification */ - notif.notification_id = loc_eng_ni_data.current_notif_id; - - const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req; - const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req; - const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req; - - switch (ni_req->event) - { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - vx_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; - notif.ni_type = GPS_NI_TYPE_VOICE; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // vx_req->user_resp_timer_val; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // 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 = convert_encoding_type(vx_req->encoding_scheme); - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, vx_req->notification_priv_type); - - break; - - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - umts_cp_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; - notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // umts_cp_req->user_response_timer; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // Stores notification text - hexcode(notif.text, sizeof notif.text, -#if (AMSS_VERSION==3200) - umts_cp_req->notification_text.notification_text_val, -#else - umts_cp_req->notification_text, -#endif - umts_cp_req->notification_length); - - // Stores requestor ID - hexcode(notif.requestor_id, sizeof notif.requestor_id, -#if (AMSS_VERSION==3200) - umts_cp_req->requestor_id.requestor_id_string.requestor_id_string_val, -#else - umts_cp_req->requestor_id.requestor_id_string, -#endif - umts_cp_req->requestor_id.string_len); - - notif.text_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); - notif.requestor_id_encoding = convert_encoding_type(umts_cp_req->datacoding_scheme); - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, umts_cp_req->notification_priv_type); - - break; - - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - supl_req = &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - notif.timeout = LOC_NI_NO_RESPONSE_TIME; // supl_req->user_response_timer; - memset(notif.extras, 0, sizeof notif.extras); - memset(notif.text, 0, sizeof notif.text); - memset(notif.requestor_id, 0, sizeof notif.requestor_id); - - // Client name - if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) - { - hexcode(notif.text, sizeof notif.text, -#if (AMSS_VERSION==3200) - supl_req->client_name.client_name_string.client_name_string_val, /* buffer */ -#else - supl_req->client_name.client_name_string, /* buffer */ -#endif - supl_req->client_name.string_len /* length */ - ); - LOGD("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); - } else { - LOGD("SUPL NI: client_name not present."); - } - - // Requestor ID - if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) - { - hexcode(notif.requestor_id, sizeof notif.requestor_id, -#if (AMSS_VERSION==3200) - supl_req->requestor_id.requestor_id_string.requestor_id_string_val, /* buffer */ -#else - supl_req->requestor_id.requestor_id_string, /* buffer */ -#endif - supl_req->requestor_id.string_len /* length */ - ); - LOGD("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); - } else { - LOGD("SUPL NI: requestor_id not present."); - } - - // Encoding type - if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) - { - notif.text_encoding = convert_encoding_type(supl_req->datacoding_scheme); - notif.requestor_id_encoding = convert_encoding_type(supl_req->datacoding_scheme); - } else { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - // Set default_response & notify_flags - loc_ni_fill_notif_verify_type(¬if, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); - - break; - - default: - LOGE("loc_ni_request_handler, unknown request event: %d", ni_req->event); - return; - } - - /* Log requestor ID and text for debugging */ - LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif.ni_type, notif.timeout, notif.default_response); - LOGI(" requestor_id: %s (encoding: %d)", notif.requestor_id, notif.requestor_id_encoding); - LOGI(" text: %s text (encoding: %d)", notif.text, notif.text_encoding); - - /* For robustness, always sets a timeout to clear up the notification status, even though - * the OEM layer in java does not do so. - **/ - loc_eng_ni_data.response_time_left = 5 + (notif.timeout != 0 ? notif.timeout : LOC_NI_NO_RESPONSE_TIME); - LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", loc_eng_ni_data.response_time_left); - - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - - /* Notify callback */ - if (loc_eng_data.ni_notify_cb != NULL) - { - loc_eng_data.ni_notify_cb(¬if); - } - } -} - -/*=========================================================================== - -FUNCTION loc_ni_process_user_response - -DESCRIPTION - Handles user input from the UI - -RETURN VALUE - error code (0 for successful, -1 for error) - -===========================================================================*/ -int loc_ni_process_user_response(GpsUserResponseType userResponse) -{ - LOGD("NI response from UI: %d", userResponse); - - rpc_loc_ni_user_resp_e_type resp; - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; - break; - case GPS_NI_RESPONSE_DENY: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; - break; - case GPS_NI_RESPONSE_NORESP: - resp = RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; - break; - default: - return -1; - } - - loc_ni_respond(resp, &loc_eng_ni_data.loc_ni_request); - - /* Make the NI respond */ - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - loc_eng_ni_data.notif_in_progress = FALSE; - loc_eng_ni_data.response_time_left = 0; - loc_eng_ni_data.current_notif_id = -1; - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - - return 0; -} - -/*=========================================================================== - -FUNCTION loc_eng_ni_callback - -DESCRIPTION - Loc API callback handler - -RETURN VALUE - error code (0 for success) - -===========================================================================*/ -int loc_eng_ni_callback ( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -) -{ - int rc = 0; - const rpc_loc_ni_event_s_type *ni_req = &loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request; - if (loc_event == RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) - { - switch (ni_req->event) - { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - LOGI("VX Notification"); - loc_ni_request_handler("VX Notify", ni_req); - break; - - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - LOGI("UMTS CP Notification\n"); - loc_ni_request_handler("UMTS CP Notify", ni_req); - break; - - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - LOGI("SUPL Notification\n"); - loc_ni_request_handler("SUPL Notify", ni_req); - break; - - default: - LOGE("Unknown NI event: %x\n", (int) ni_req->event); - break; - } - } - return rc; -} - -/*=========================================================================== - -FUNCTION loc_ni_thread_proc - -===========================================================================*/ -static void loc_ni_thread_proc(void *unused) -{ - LOGI("Starting Loc NI thread...\n"); - - while (1) - { - /* wakes up every second to check timed out requests */ - sleep(1); - - pthread_mutex_lock(&loc_eng_ni_data.loc_ni_lock); - - if (loc_eng_ni_data.notif_in_progress && loc_eng_ni_data.response_time_left > 0) - { - loc_eng_ni_data.response_time_left--; - if (loc_eng_ni_data.response_time_left <= 0) - { - loc_ni_respond(RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP, &loc_eng_ni_data.loc_ni_request); - loc_eng_ni_data.notif_in_progress = FALSE; - } - } - - pthread_mutex_unlock(&loc_eng_ni_data.loc_ni_lock); - } /* while (1) */ -} - -/*=========================================================================== -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(GpsNiCallbacks *callbacks) -{ - LOGD("loc_eng_ni_init: entered."); - - if (!loc_eng_ni_data_init) - { - pthread_mutex_init(&loc_eng_ni_data.loc_ni_lock, NULL); - callbacks->create_thread_cb("loc_api_ni", loc_ni_thread_proc, NULL); - loc_eng_ni_data_init = TRUE; - } - - loc_eng_ni_data.notif_in_progress = FALSE; - loc_eng_ni_data.current_notif_id = -1; - loc_eng_ni_data.response_time_left = 0; - - srand(time(NULL)); - loc_eng_data.ni_notify_cb = callbacks->notify_cb; -} - -/*=========================================================================== -FUNCTION loc_eng_ni_respond - -DESCRIPTION - This function sends an NI respond to the modem processor - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response) -{ - if (notif_id == loc_eng_ni_data.current_notif_id && loc_eng_ni_data.notif_in_progress) - { - LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); - loc_ni_process_user_response(user_response); - } else { - LOGE("loc_eng_ni_respond: notif_id %d mismatch or notification not in progress, response: %d", - notif_id, user_response); - } -} diff --git a/loc_api/libloc_api/loc_eng_ni.h b/loc_api/libloc_api/loc_eng_ni.h deleted file mode 100644 index cfd2ab18..00000000 --- a/loc_api/libloc_api/loc_eng_ni.h +++ /dev/null @@ -1,56 +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_NI_H -#define LOC_ENG_NI_H - -#include - -#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ - -extern const GpsNiInterface sLocEngNiInterface; - -typedef struct { - pthread_mutex_t loc_ni_lock; - int response_time_left; /* examine time for NI response */ - boolean notif_in_progress; /* NI notification/verification in progress */ - rpc_loc_ni_event_s_type loc_ni_request; - int current_notif_id; /* ID to check against response */ -} loc_eng_ni_data_s_type; - -// Functions for sLocEngNiInterface -extern void loc_eng_ni_init(GpsNiCallbacks *callbacks); -extern void loc_eng_ni_respond(int notif_id, GpsUserResponseType user_response); - -extern int loc_eng_ni_callback ( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -); - -#endif /* LOC_ENG_NI_H */ diff --git a/loc_api/libloc_api/loc_eng_xtra.cpp b/loc_api/libloc_api/loc_eng_xtra.cpp deleted file mode 100644 index 0c3e476a..00000000 --- a/loc_api/libloc_api/loc_eng_xtra.cpp +++ /dev/null @@ -1,180 +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. - * - */ - -#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#define LOG_TAG "lib_locapi" -#include - -// comment this out to enable logging -// #undef LOGD -// #define LOGD(...) {} - -#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) -#define XTRA_BLOCK_SIZE (400) - -static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks); -static int qct_loc_eng_inject_xtra_data(char* data, int length); - -const GpsXtraInterface sLocEngXTRAInterface = -{ - sizeof(GpsXtraInterface), - qct_loc_eng_xtra_init, - qct_loc_eng_inject_xtra_data, -}; - -/*=========================================================================== -FUNCTION qct_loc_eng_xtra_init - -DESCRIPTION - Initialize XTRA module. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int qct_loc_eng_xtra_init (GpsXtraCallbacks* callbacks) -{ - rpc_loc_event_mask_type event; - loc_eng_xtra_data_s_type *xtra_module_data_ptr; - - xtra_module_data_ptr = &(loc_eng_data.xtra_module_data); - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - - return 0; -} - -/*=========================================================================== -FUNCTION qct_loc_eng_inject_xtra_data - -DESCRIPTION - Injects XTRA file into the engine. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - >0: failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int qct_loc_eng_inject_xtra_data(char* data, int length) -{ - int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; - boolean ret_val = 0; - int total_parts; - uint8 part; - uint16 part_len; - uint16 len_injected; - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - - LOGV ("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%x\n", length, (int) data); - - ioctl_data.disc = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_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 / XTRA_BLOCK_SIZE); - if ((total_parts % XTRA_BLOCK_SIZE) != 0) - { - total_parts += 1; - } - predicted_orbits_data_ptr->total_parts = total_parts; - - len_injected = 0; // O bytes injected - // 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; - - LOGV ("qct_loc_eng_inject_xtra_data, inject part = %d, len = %d, len = %d\n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len, predicted_orbits_data_ptr->data_ptr.data_ptr_len); - LOGV ("qct_loc_eng_inject_xtra_data, total part = %d, len = %d \n", predicted_orbits_data_ptr->part, predicted_orbits_data_ptr->part_len); - - if (part < total_parts) - { - // No callback in this case - rpc_ret_val = loc_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, - &ioctl_data); - - if (rpc_ret_val != RPC_LOC_API_SUCCESS) - { - LOGE ("loc_ioctl for xtra returned %d \n", rpc_ret_val); - ret_val = EINVAL; // return error - break; - } - } - else // part == total_parts - { - // Last part injection, will need to wait for callback - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA, - &ioctl_data, - LOC_XTRA_INJECT_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - break; // done with injection - } - - len_injected += predicted_orbits_data_ptr->part_len; - LOGV ("loc_ioctl for xtra len injected %d \n", len_injected); - } - - return ret_val; -} diff --git a/loc_api/libloc_api/loc_eng_xtra.h b/loc_api/libloc_api/loc_eng_xtra.h deleted file mode 100644 index a72b1528..00000000 --- a/loc_api/libloc_api/loc_eng_xtra.h +++ /dev/null @@ -1,45 +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 - -extern const GpsXtraInterface sLocEngXTRAInterface; - -// Module data -typedef struct -{ - // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; - gps_xtra_download_request download_request_cb; - -} loc_eng_xtra_data_s_type; - -#endif // LOC_ENG_XTRA_H From 6fd90ead055af5bc2b5000d40cd3cf3d3636fb58 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 18 Dec 2013 11:30:53 -0800 Subject: [PATCH 204/945] Remove libandroid_runtime from makefile Since libandroid_runtime is not used anymore, it can be removed from the makefile, which will save space in the binary. Change-Id: Iadb3f0378e41af658d7b0256721508c5e7de4daf CRs-fixed: 590483 --- loc_api/libloc_api_50001/Android.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 73e2a274..a1488a02 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -74,8 +74,7 @@ LOCAL_SHARED_LIBRARIES := \ libloc_eng \ libloc_core \ libgps.utils \ - libdl \ - libandroid_runtime + libdl LOCAL_SRC_FILES += \ loc.cpp \ From db7d754cd043f23147003ff71a259c93a0bf515d Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 8 Jan 2014 11:07:25 -0800 Subject: [PATCH 205/945] Add SGLTE target field in gps.conf This field is to indicate if the current device is SGLTE target or not. CRs-Fixed: 595803 Change-Id: Iba5bbd00d535e7616c3a5de86641087a28e8ebfd --- etc/gps.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index 5c9b4d3b..15dda2a4 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -68,6 +68,8 @@ LPP_PROFILE = 0 ################################ # 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 From 04ece63ab2f14a92931b730e0e5637cab25d9571 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 15 Jan 2014 11:08:16 -0800 Subject: [PATCH 206/945] Fix for dsi_init failure Init DS only when the agps stack is available Change-Id: I106e50462ad810ca5baf452d7effc6459c135f6f CRs-fixed: 599478 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 6d6d701a..f54066b2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -2086,9 +2086,9 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_SUPL, false); - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - if (adapter->mAgpsEnabled) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); } From dd90495f7b405f4fb258991ca6559a55c30e5531 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 24 Jan 2014 11:35:16 -0800 Subject: [PATCH 207/945] Add a new LocAdapterProxyBase class LocAdapterProxyBase bridges the LocAdapterBase and IzatAdapterBase to communicate SSR events. CRs-Fixed: 598430 Change-Id: I8aa54f207e474974fa6fd5330c1545f94720a5cb --- core/Android.mk | 3 +- core/LocAdapterBase.cpp | 24 ++++++++++++---- core/LocAdapterBase.h | 11 +++++--- core/LocAdapterProxyBase.h | 56 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 11 deletions(-) create mode 100644 core/LocAdapterProxyBase.h diff --git a/core/Android.mk b/core/Android.mk index 11cecc65..3e2b2eb8 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -42,7 +42,8 @@ LOCAL_COPY_HEADERS:= \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h + loc_core_log.h \ + LocAdapterProxyBase.h LOCAL_PRELINK_MODULE := false diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8bbe873f..a65cb310 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,6 +33,7 @@ #include #include #include +#include namespace loc_core { @@ -41,16 +42,27 @@ namespace loc_core { // 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) : + ContextBase* context, LocAdapterProxyBase *adapterProxyBase) : mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) + mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), + mMsgTask(context->getMsgTask()) { mLocApi->addAdapter(this); } -void LocAdapterBase:: - handleEngineDownEvent() -DEFAULT_IMPL() +void LocAdapterBase::handleEngineUpEvent() +{ + if (mLocAdapterProxyBase) { + mLocAdapterProxyBase->handleEngineUpEvent(); + } +} + +void LocAdapterBase::handleEngineDownEvent() +{ + if (mLocAdapterProxyBase) { + mLocAdapterProxyBase->handleEngineDownEvent(); + } +} void LocAdapterBase:: reportPosition(UlpLocation &location, diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 8222b24b..4e6ff24b 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -35,19 +35,22 @@ namespace loc_core { +class LocAdapterProxyBase; + class LocAdapterBase { protected: const 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), mMsgTask(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); + ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; @@ -68,7 +71,7 @@ public: // This will be overridden by the individual adapters // if necessary. inline virtual void setUlpProxy(UlpProxyBase* ulp) {} - inline virtual void handleEngineUpEvent() {} + virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); inline virtual void setPositionModeInt(LocPosMode& posMode) {} virtual void startFixInt() {} diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h new file mode 100644 index 00000000..adc868c6 --- /dev/null +++ b/core/LocAdapterProxyBase.h @@ -0,0 +1,56 @@ +/* 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: + const 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; + } +public: + inline virtual void handleEngineUpEvent() {}; + inline virtual void handleEngineDownEvent() {}; +}; + +} // namespace loc_core + +#endif //LOC_ADAPTER_PROXY_BASE_H \ No newline at end of file From 82e314e2c42dc978d13da0d6f993b763b9944a19 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 8 Jan 2014 11:07:25 -0800 Subject: [PATCH 208/945] Add SGLTE target field in gps.conf This field is to indicate if the current device is SGLTE target or not. CRs-Fixed: 595803 Change-Id: Iba5bbd00d535e7616c3a5de86641087a28e8ebfd --- etc/gps.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index 5c9b4d3b..15dda2a4 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -68,6 +68,8 @@ LPP_PROFILE = 0 ################################ # 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 From 39bc6e266bc2be92910901f6b14b8ad10ee8ce3d Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 20 Nov 2013 17:04:39 -0800 Subject: [PATCH 209/945] Emergency SUPL This change is for the new added emergency SUPL session. Adding a new field in gps.conf named SUPL_ES, which is for emergency supl NI. CRs-fixed: 600375 Change-Id: I7c21c5589259df4f1cb7ec2f850e708b2c4faa1a --- core/gps_extended_c.h | 4 +++- core/loc_core_log.cpp | 5 +++-- etc/gps.conf | 3 +++ loc_api/libloc_api_50001/loc_eng_ni.cpp | 16 ++++++++++++---- loc_api/libloc_api_50001/loc_eng_ni.h | 3 ++- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index f970b644..55c158e3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -61,6 +61,8 @@ extern "C" { #define ULP_MIN_INTERVAL_INVALID 0xffffffff +/*Emergency SUPL*/ +#define GPS_NI_TYPE_EMERGENCY_SUPL 4 typedef struct { /** set to sizeof(UlpLocation) */ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 461273ff..af2cced7 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -161,7 +161,8 @@ static 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_UMTS_CTRL_PLANE ), + NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL ) }; static int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type); diff --git a/etc/gps.conf b/etc/gps.conf index 15dda2a4..b79b3801 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -29,6 +29,9 @@ INTERMEDIATE_POS=0 # supl version 1.0 SUPL_VER=0x10000 +# Emergency SUPL, 1=enable, 0=disable +SUPL_ES=1 + # GPS Capabilities bit mask # SCHEDULING = 0x01 # MSB = 0x02 diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index f017cab6..74abfd42 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -218,6 +218,8 @@ static void* ni_thread_proc(void *args) "pthread_cond_timedwait = %d\n",rc ); loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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() @@ -225,9 +227,14 @@ static void* ni_thread_proc(void *args) LocEngInformNiResponse *msg = NULL; if (NULL != loc_eng_ni_data_p->rawRequest) { - msg = new LocEngInformNiResponse(adapter, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n"); + msg = new LocEngInformNiResponse(adapter, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); + } else { + LOC_LOGD("this is the ignore reply for SUPL ES\n"); + } loc_eng_ni_data_p->rawRequest = NULL; } pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); @@ -236,6 +243,7 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->reqID++; if (NULL != msg) { + LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); adapter->sendMsg(msg); } diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 9cbc57dc..8c076041 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved. +/* 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 @@ -34,6 +34,7 @@ #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 */ From cf180fffbe0612cca741768ffef3b3c17a32e80d Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 4 Feb 2014 09:58:01 -0800 Subject: [PATCH 210/945] Force logging level to warning for user builds User builds should not be logging at info level Change-Id: I4e43730d52b3a322e93d61112805fa85669db243 CRs-fixed: 610927 --- utils/Android.mk | 6 ++++-- utils/loc_log.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/Android.mk b/utils/Android.mk index 24ab8a13..abfbb6fa 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -21,11 +21,14 @@ LOCAL_SRC_FILES += \ loc_timer.c \ ../platform_lib_abstractions/elapsed_millis_since_boot.cpp - 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 @@ -45,7 +48,6 @@ LOCAL_COPY_HEADERS:= \ ../platform_lib_abstractions/platform_lib_time.h \ ../platform_lib_abstractions/platform_lib_macros.h - LOCAL_MODULE := libgps.utils LOCAL_MODULE_TAGS := optional diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 597b5b62..392966ee 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -200,6 +200,12 @@ SIDE EFFECTS 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; } From b521eb94ae978cfb9976ad6646cc4383840e9549 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 29 Jan 2014 17:23:29 -0800 Subject: [PATCH 211/945] Add support for batched geofence breach reports QMI_LOC added a new msg that sends geofence breach reports in batches instead of individual breach reports. This change adds constants to support this new msg Change-Id: Ic2f0bb66181ceda371a8a7a8d8681d62207835d1 CRs-fixed: 604766 --- core/gps_extended_c.h | 86 ++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55c158e3..7b9b43a5 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -287,52 +287,54 @@ enum loc_api_adapter_err { }; 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_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_EVENT_MAX }; -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< Date: Mon, 10 Feb 2014 10:39:28 +0200 Subject: [PATCH 212/945] apq8084: qca1530 detection timeout reduced Reduced QCA1530 detection timeout as system server activitity manager gives only 20 seconds for the subsystem initialization. CRs-Fixed: 613611 Change-Id: Ib095db3f2b35765a4b9d7b0e79132e44c173d6cb --- utils/loc_target.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index a3ef6b3c..2aba5fc3 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -56,7 +56,10 @@ #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 #define GPS_CHECK_NO_GPS_HW 1 -#define QCA1530_DETECT_TIMEOUT 30 +/* 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" From 4460543e7d99864f2dee3b3b36fea3aeda34fedf Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 15 Jan 2014 10:24:26 -0800 Subject: [PATCH 213/945] Add new utilities This change makes modifications to existing utilities and adds a couple of new utilites to help with the launcher Change-Id: Ib65ffe8e60c7e4a824c5c362765df5dcba872424 CRs-fixed: 600179 --- utils/Android.mk | 6 +- utils/loc_cfg.cpp | 350 ++++++++++++++++++++------------------- utils/loc_cfg.h | 5 +- utils/loc_misc_utils.cpp | 114 +++++++++++++ utils/loc_misc_utils.h | 99 +++++++++++ utils/loc_target.cpp | 33 +++- utils/loc_target.h | 9 +- utils/log_util.h | 24 ++- 8 files changed, 458 insertions(+), 182 deletions(-) create mode 100644 utils/loc_misc_utils.cpp create mode 100644 utils/loc_misc_utils.h diff --git a/utils/Android.mk b/utils/Android.mk index abfbb6fa..07c1b1da 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -19,7 +19,8 @@ LOCAL_SRC_FILES += \ linked_list.c \ loc_target.cpp \ loc_timer.c \ - ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + loc_misc_utils.cpp LOCAL_CFLAGS += \ -fno-short-enums \ @@ -46,7 +47,8 @@ LOCAL_COPY_HEADERS:= \ loc_timer.h \ ../platform_lib_abstractions/platform_lib_includes.h \ ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.h + ../platform_lib_abstractions/platform_lib_macros.h \ + loc_misc_utils.h LOCAL_MODULE := libgps.utils diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 73d1ca41..abf8086c 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef USE_GLIB #include #endif @@ -57,62 +58,17 @@ static uint8_t TIMESTAMP = 0; /* Parameter spec table */ static loc_param_s_type loc_parameter_table[] = { - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); -/*=========================================================================== -FUNCTION trim_space - -DESCRIPTION - Removes leading and trailing spaces of the string - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void trim_space(char *org_string) -{ - char *scan_ptr, *write_ptr; - char *first_nonspace = NULL, *last_nonspace = NULL; - - scan_ptr = write_ptr = org_string; - - while (*scan_ptr) - { - if ( !isspace(*scan_ptr) && first_nonspace == NULL) - { - first_nonspace = scan_ptr; - } - - if (first_nonspace != NULL) - { - *(write_ptr++) = *scan_ptr; - if ( !isspace(*scan_ptr)) - { - last_nonspace = write_ptr; - } - } - - scan_ptr++; - } - - if (last_nonspace) { *last_nonspace = '\0'; } -} - typedef struct loc_param_v_type { - char* param_name; - - char* param_str_value; - int param_int_value; - double param_double_value; + char* param_name; + char* param_str_value; + int param_int_value; + double param_double_value; }loc_param_v_type; /*=========================================================================== @@ -136,61 +92,166 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) { - if(NULL == config_entry || NULL == config_value) - { - LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); - return; - } + 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 (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; - } - 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 '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; - } - 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; + 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; - } - break; - default: - LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); - } - } + 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_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, loc_param_s_type* config_table, uint32_t table_length) +{ + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + char *lasts; + loc_param_v_type config_value; + uint32_t i; + 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(i = 0; NULL != config_table && i < table_length; i++) + { + if(NULL != config_table[i].param_set) + { + *(config_table[i].param_set) = 0; + } + } + 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; + } + + 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 == NULL) continue; + config_value.param_str_value = strtok_r(NULL, "=", &lasts); + /* skip lines that do not contain two operands */ + if (config_value.param_str_value == NULL) continue; + + /* 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(i = 0; NULL != config_table && i < table_length; i++) + { + if(!loc_set_config_entry(&config_table[i], &config_value)) { + num_params--; + } + } + } + +err: + return ret; } /*=========================================================================== @@ -215,72 +276,25 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, uint32_t table_length) +void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, + uint32_t table_length) { - FILE *gps_conf_fp = NULL; - char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ - char *lasts; - loc_param_v_type config_value; - uint32_t i; + FILE *gps_conf_fp = NULL; + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + char *lasts; + loc_param_v_type config_value; + uint32_t i; - if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) - { - LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); - } - else - { - LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name); - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); - return; /* no parameter file */ - } - - /* Clear all validity bits */ - for(i = 0; NULL != config_table && i < table_length; i++) - { - if(NULL != config_table[i].param_set) - { - *(config_table[i].param_set) = 0; - } - } - - while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) - { - memset(&config_value, 0, sizeof(config_value)); - - /* Separate variable and value */ - config_value.param_name = strtok_r(input_buf, "=", &lasts); - if (config_value.param_name == NULL) continue; /* skip lines that do not contain "=" */ - config_value.param_str_value = strtok_r(NULL, "=", &lasts); - if (config_value.param_str_value == NULL) continue; /* skip lines that do not contain two operands */ - - /* Trim leading and trailing spaces */ - trim_space(config_value.param_name); - trim_space(config_value.param_str_value); - - /* Parse numerical value */ - if (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(i = 0; NULL != config_table && i < table_length; i++) - { - loc_set_config_entry(&config_table[i], &config_value); - } - - for(i = 0; i < loc_param_num; i++) - { - loc_set_config_entry(&loc_parameter_table[i], &config_value); - } - } - - fclose(gps_conf_fp); - - /* Initialize logging mechanism with parsed data */ - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); + if((gps_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(gps_conf_fp, config_table, table_length); + rewind(gps_conf_fp); + } + loc_read_conf_r(gps_conf_fp, loc_parameter_table, loc_param_num); + fclose(gps_conf_fp); + } + /* Initialize logging mechanism with parsed data */ + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index df833389..268f4c24 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -30,6 +30,7 @@ #ifndef LOC_CFG_H #define LOC_CFG_H +#include #include #define LOC_MAX_PARAM_NAME 48 @@ -75,7 +76,7 @@ extern "C" { extern void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, uint32_t table_length); - +extern int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length); #ifdef __cplusplus } #endif diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp new file mode 100644 index 00000000..7e96313f --- /dev/null +++ b/utils/loc_misc_utils.cpp @@ -0,0 +1,114 @@ +/* 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/utils/loc_misc_utils.h b/utils/loc_misc_utils.h new file mode 100644 index 00000000..7d66d842 --- /dev/null +++ b/utils/loc_misc_utils.h @@ -0,0 +1,99 @@ +/* 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/utils/loc_target.cpp b/utils/loc_target.cpp index a3ef6b3c..e22e4476 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -141,6 +141,34 @@ static bool is_qca1530(void) 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__); + } +} + unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) @@ -163,7 +191,8 @@ unsigned int loc_get_target(void) goto detected; } - property_get("ro.baseband", baseband, ""); + loc_get_target_baseband(baseband, sizeof(baseband)); + if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { diff --git a/utils/loc_target.h b/utils/loc_target.h index 4aebb851..9aa525fc 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -45,6 +45,13 @@ extern "C" 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); + /* Please remember to update 'target_name' in loc_log.cpp, if do any changes to this enum. */ typedef enum { diff --git a/utils/log_util.h b/utils/log_util.h index 7fb0c780..5606defa 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 @@ -96,24 +96,34 @@ extern char* get_timestamp(char* str, unsigned long buf_size); 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_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("W/"__VA_ARGS__); } +IF_LOC_LOGE { ALOGE("E/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/"__VA_ARGS__); } #define LOC_LOGW(...) \ -if ((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ +IF_LOC_LOGW { ALOGE("W/"__VA_ARGS__); } \ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/"__VA_ARGS__); } #define LOC_LOGI(...) \ -if ((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("I/"__VA_ARGS__); } \ +IF_LOC_LOGI { ALOGE("I/"__VA_ARGS__); } \ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/"__VA_ARGS__); } #define LOC_LOGD(...) \ -if ((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("D/"__VA_ARGS__); } \ +IF_LOC_LOGD { ALOGE("D/"__VA_ARGS__); } \ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/"__VA_ARGS__); } #define LOC_LOGV(...) \ -if ((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("V/"__VA_ARGS__); } \ +IF_LOC_LOGV { ALOGE("V/"__VA_ARGS__); } \ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/"__VA_ARGS__); } #else /* DEBUG_DMN_LOC_API */ From c019f61276ebeb06fa4f27c0c6dadb8c9876489a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 23 Dec 2013 17:50:44 -0800 Subject: [PATCH 214/945] move location data files under /data/misc/location Different location daemons each has its own locations for data, pipe, or sockets files. Centralize them all under the same dir, namely /data/misc/location CRs-Fixed: 595946 Change-Id: I532e2b0b4bcd100bab600724a12a1e6ba9ebf119 --- loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h index c7c100b2..1d8c1428 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -33,11 +33,11 @@ #ifdef _ANDROID_ -#define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" -#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" -#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" -#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" +#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 From e620608cd786320931c1c21f76a09871c2f8ea41 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 28 Jan 2014 11:41:14 -0800 Subject: [PATCH 215/945] Copy position mode to dummy ULP proxy To avoid the race condition between when the fix criteria is set and checked, the position mode is copied to the dummy ULP proxy and it is used to inform ULP when a true proxy is registered Change-Id: I72285c7926814ec85dae64e6634f0c79ea5e6c51 CRs-fixed: 604905 --- core/UlpProxyBase.h | 18 +++++--- loc_api/libloc_api_50001/LocEngAdapter.cpp | 52 ++++++++++++---------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 0873748b..90097571 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -37,11 +37,19 @@ class LocAdapterBase; class UlpProxyBase { public: - inline UlpProxyBase() {} + LocPosMode mPosMode; + bool mFixSet; + inline UlpProxyBase() { + mPosMode.mode = LOC_POSITION_MODE_INVALID; + mFixSet = false; + } inline virtual ~UlpProxyBase() {} - inline virtual bool sendStartFix() { return false;} - inline virtual bool sendStopFix() { return false;} - inline virtual bool sendFixMode(LocPosMode ¶ms) { return false;} + 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, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index c8d08853..0b17b2c3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -52,22 +52,6 @@ void LocInternalAdapter::stopFixInt() { void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } -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)); -} LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, @@ -95,6 +79,23 @@ LocEngAdapter::~LocEngAdapter() LOC_LOGV("LocEngAdapter deleted"); } +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) { @@ -102,18 +103,24 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) //and we get the same object back for UlpProxyBase . Do nothing return; } - delete mUlp; + LOC_LOGV("%s] %p", __func__, ulp); if (NULL == ulp) { + LOC_LOGE("%s:%d]: ulp pointer is NULL", __func__, __LINE__); ulp = new UlpProxyBase(); } - mUlp = ulp; - if (LOC_POSITION_MODE_INVALID != mFixCriteria.mode) { + if (LOC_POSITION_MODE_INVALID != mUlp->mPosMode.mode) { // need to send this mode and start msg to ULP - mUlp->sendFixMode(mFixCriteria); - mUlp->sendStartFix(); + ulp->sendFixMode(mUlp->mPosMode); } + + if(mUlp->mFixSet) { + ulp->sendStartFix(); + } + + delete mUlp; + mUlp = ulp; } void LocInternalAdapter::reportPosition(UlpLocation &location, @@ -294,4 +301,3 @@ void LocEngAdapter::handleEngineUpEvent() { sendMsg(new LocEngUp(mOwner)); } - From 48c29f5a8fc3007e623bb2de18eea0a505b86f5b Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 28 Jan 2014 11:41:14 -0800 Subject: [PATCH 216/945] Copy position mode to dummy ULP proxy To avoid the race condition between when the fix criteria is set and checked, the position mode is copied to the dummy ULP proxy and it is used to inform ULP when a true proxy is registered Change-Id: I72285c7926814ec85dae64e6634f0c79ea5e6c51 CRs-fixed: 604905 --- core/UlpProxyBase.h | 18 +++++--- loc_api/libloc_api_50001/LocEngAdapter.cpp | 52 ++++++++++++---------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 0873748b..90097571 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -37,11 +37,19 @@ class LocAdapterBase; class UlpProxyBase { public: - inline UlpProxyBase() {} + LocPosMode mPosMode; + bool mFixSet; + inline UlpProxyBase() { + mPosMode.mode = LOC_POSITION_MODE_INVALID; + mFixSet = false; + } inline virtual ~UlpProxyBase() {} - inline virtual bool sendStartFix() { return false;} - inline virtual bool sendStopFix() { return false;} - inline virtual bool sendFixMode(LocPosMode ¶ms) { return false;} + 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, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index c8d08853..0b17b2c3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -52,22 +52,6 @@ void LocInternalAdapter::stopFixInt() { void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } -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)); -} LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, @@ -95,6 +79,23 @@ LocEngAdapter::~LocEngAdapter() LOC_LOGV("LocEngAdapter deleted"); } +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) { @@ -102,18 +103,24 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) //and we get the same object back for UlpProxyBase . Do nothing return; } - delete mUlp; + LOC_LOGV("%s] %p", __func__, ulp); if (NULL == ulp) { + LOC_LOGE("%s:%d]: ulp pointer is NULL", __func__, __LINE__); ulp = new UlpProxyBase(); } - mUlp = ulp; - if (LOC_POSITION_MODE_INVALID != mFixCriteria.mode) { + if (LOC_POSITION_MODE_INVALID != mUlp->mPosMode.mode) { // need to send this mode and start msg to ULP - mUlp->sendFixMode(mFixCriteria); - mUlp->sendStartFix(); + ulp->sendFixMode(mUlp->mPosMode); } + + if(mUlp->mFixSet) { + ulp->sendStartFix(); + } + + delete mUlp; + mUlp = ulp; } void LocInternalAdapter::reportPosition(UlpLocation &location, @@ -294,4 +301,3 @@ void LocEngAdapter::handleEngineUpEvent() { sendMsg(new LocEngUp(mOwner)); } - From ff716bf292ef0293dcf6e00d2fb081e9f4985d64 Mon Sep 17 00:00:00 2001 From: Valeri Atamaniouk Date: Tue, 11 Feb 2014 11:58:28 +0200 Subject: [PATCH 217/945] apq8084: qca1530 detection property changed Changed QCA1530 SoC detection property from persistent to non-pesistent. New property is 'sys.qca1530'. CRs-Fixed: 614154 Change-Id: I61ed4191e6413bb6eab71c61d9ed070a5815c178 --- utils/loc_target.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 2aba5fc3..649c2546 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -101,7 +101,7 @@ static int read_a_line(const char * file_path, char * line, int line_size) */ static bool is_qca1530(void) { - static const char qca1530_property_name[] = "persist.qca1530"; + static const char qca1530_property_name[] = "sys.qca1530"; bool res = false; int ret, i; char buf[PROPERTY_VALUE_MAX]; From e870707275e4d957d03b561eca86fb287262961d Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 15 Jan 2014 11:08:16 -0800 Subject: [PATCH 218/945] Fix for dsi_init failure Init DS only when the agps stack is available Change-Id: I106e50462ad810ca5baf452d7effc6459c135f6f CRs-fixed: 599478 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 6d6d701a..f54066b2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -2086,9 +2086,9 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_SUPL, false); - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - if (adapter->mAgpsEnabled) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); } From e767a55d87aa6af6b5a3b8a1ceb2a3f6e4a8908c Mon Sep 17 00:00:00 2001 From: Hema Iyer Sankaranarayanan Date: Thu, 13 Feb 2014 11:10:26 -0800 Subject: [PATCH 219/945] Changes to inject sensor provider info to modem Changes to inject the sensor provider config info to modem. CRs-fixed: 604557 Change-Id: I3875e295f30d863a540efe22d6daf264d8d81476 --- core/LocApiBase.cpp | 3 ++- core/LocApiBase.h | 2 +- loc_api/libloc_api_50001/LocEngAdapter.h | 4 ++-- loc_api/libloc_api_50001/loc_eng.cpp | 19 +++++++++++++------ loc_api/libloc_api_50001/loc_eng.h | 1 + 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 80e23755..8b6713c1 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -404,7 +404,8 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage) + setSensorControlConfig(int sensorUsage, + int sensorProvider) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index e162cfc7..1d96313e 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -158,7 +158,7 @@ public: virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); + setSensorControlConfig(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index d03dc660..6de663c0 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -185,9 +185,9 @@ public: return mLocApi->setLPPConfig(profile); } inline enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage) + setSensorControlConfig(int sensorUsage, int sensorProvider) { - return mLocApi->setSensorControlConfig(sensorUsage); + return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider); } inline enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 6d6d701a..523081fd 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -118,6 +118,7 @@ static loc_param_s_type loc_parameter_table[] = {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, + {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, }; static void loc_default_parameters(void) @@ -160,6 +161,9 @@ static void loc_default_parameters(void) /*By default no positioning protocol is selected on A-GLONASS system*/ gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; + + /* default provider is SSC */ + sap_conf.SENSOR_PROVIDER = 1; } // 2nd half of init(), singled out for @@ -497,18 +501,20 @@ struct LocEngLppConfig : public LocMsg { struct LocEngSensorControlConfig : public LocMsg { LocEngAdapter* mAdapter; const int mSensorsDisabled; + const int mSensorProvider; inline LocEngSensorControlConfig(LocEngAdapter* adapter, - int sensorsDisabled) : - LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) + int sensorsDisabled, int sensorProvider) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled), + mSensorProvider(sensorProvider) { locallog(); } inline virtual void proc() const { - mAdapter->setSensorControlConfig(mSensorsDisabled); + mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider); } inline void locallog() const { - LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", - mSensorsDisabled); + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d", + mSensorsDisabled, mSensorProvider); } inline virtual void log() const { locallog(); @@ -1554,7 +1560,8 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) LocEngAdapter* adapter = loc_eng_data.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)); + 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)); /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 2dfd50f7..e50e4a58 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -171,6 +171,7 @@ typedef struct double RATE_RANDOM_WALK_SPECTRAL_DENSITY; uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID; double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY; + unsigned long SENSOR_PROVIDER; } loc_sap_cfg_s_type; extern loc_gps_cfg_s_type gps_conf; From 7e546e6afefba214ba9dc14359c1fc018654e8f4 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 20 Nov 2013 17:04:39 -0800 Subject: [PATCH 220/945] Emergency SUPL This change is for the new added emergency SUPL session. Adding a new field in gps.conf named SUPL_ES, which is for emergency supl NI. CRs-fixed: 600375 Change-Id: I7c21c5589259df4f1cb7ec2f850e708b2c4faa1a --- core/gps_extended_c.h | 4 +++- core/loc_core_log.cpp | 5 +++-- etc/gps.conf | 3 +++ loc_api/libloc_api_50001/loc_eng_ni.cpp | 16 ++++++++++++---- loc_api/libloc_api_50001/loc_eng_ni.h | 3 ++- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index f970b644..55c158e3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -61,6 +61,8 @@ extern "C" { #define ULP_MIN_INTERVAL_INVALID 0xffffffff +/*Emergency SUPL*/ +#define GPS_NI_TYPE_EMERGENCY_SUPL 4 typedef struct { /** set to sizeof(UlpLocation) */ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 461273ff..af2cced7 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -161,7 +161,8 @@ static 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_UMTS_CTRL_PLANE ), + NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL ) }; static int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type); diff --git a/etc/gps.conf b/etc/gps.conf index 15dda2a4..b79b3801 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -29,6 +29,9 @@ INTERMEDIATE_POS=0 # supl version 1.0 SUPL_VER=0x10000 +# Emergency SUPL, 1=enable, 0=disable +SUPL_ES=1 + # GPS Capabilities bit mask # SCHEDULING = 0x01 # MSB = 0x02 diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index f017cab6..74abfd42 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -218,6 +218,8 @@ static void* ni_thread_proc(void *args) "pthread_cond_timedwait = %d\n",rc ); loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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() @@ -225,9 +227,14 @@ static void* ni_thread_proc(void *args) LocEngInformNiResponse *msg = NULL; if (NULL != loc_eng_ni_data_p->rawRequest) { - msg = new LocEngInformNiResponse(adapter, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n"); + msg = new LocEngInformNiResponse(adapter, + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); + } else { + LOC_LOGD("this is the ignore reply for SUPL ES\n"); + } loc_eng_ni_data_p->rawRequest = NULL; } pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); @@ -236,6 +243,7 @@ static void* ni_thread_proc(void *args) loc_eng_ni_data_p->reqID++; if (NULL != msg) { + LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); adapter->sendMsg(msg); } diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 9cbc57dc..8c076041 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved. +/* 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 @@ -34,6 +34,7 @@ #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 */ From 7c41d446d95e08172a15bb9f31085da51488040e Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 4 Feb 2014 09:58:01 -0800 Subject: [PATCH 221/945] Force logging level to warning for user builds User builds should not be logging at info level Change-Id: I4e43730d52b3a322e93d61112805fa85669db243 CRs-fixed: 610927 --- utils/Android.mk | 6 ++++-- utils/loc_log.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/Android.mk b/utils/Android.mk index 24ab8a13..abfbb6fa 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -21,11 +21,14 @@ LOCAL_SRC_FILES += \ loc_timer.c \ ../platform_lib_abstractions/elapsed_millis_since_boot.cpp - 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 @@ -45,7 +48,6 @@ LOCAL_COPY_HEADERS:= \ ../platform_lib_abstractions/platform_lib_time.h \ ../platform_lib_abstractions/platform_lib_macros.h - LOCAL_MODULE := libgps.utils LOCAL_MODULE_TAGS := optional diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 597b5b62..392966ee 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -200,6 +200,12 @@ SIDE EFFECTS 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; } From 38f7146444b5bffd31e67c7c79a37ba882f0095b Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 22 Jan 2014 17:13:02 -0800 Subject: [PATCH 222/945] MDM shutdown for Fusion device Use mdmdetect library to detect presence of an mdm and open/close the device node if present CRs-fixed: 605216 Change-Id: I81d5b35ff8259e775dc6cb9d5c531fe06ae77ba0 --- loc_api/libloc_api_50001/Android.mk | 6 ++- loc_api/libloc_api_50001/loc.cpp | 65 +++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 11 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index a1488a02..8f5d389b 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -74,7 +74,8 @@ LOCAL_SHARED_LIBRARIES := \ libloc_eng \ libloc_core \ libgps.utils \ - libdl + libdl \ + libmdmdetect LOCAL_SRC_FILES += \ loc.cpp \ @@ -91,7 +92,8 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libmdmdetect/inc LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 0b032f0b..8a4d6756 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -44,7 +44,13 @@ #include #include #include - +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +#include +#ifdef __cplusplus +} +#endif /* __cplusplus */ using namespace loc_core; //Globals defns @@ -121,6 +127,9 @@ const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; +// For shutting down MDM in fusion devices +static int mdm_fd = -1; + 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); @@ -241,6 +250,7 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; + int i = 0; ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -279,6 +289,43 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); + if(retVal) { + LOC_LOGE("loc_eng_init() fail!"); + goto err; + } + + LOC_LOGD("loc_eng_init() success!"); + if (mdm_fd < 0) { + struct dev_info modem_info; + memset(&modem_info, 0, sizeof(struct dev_info)); + if(get_system_info(&modem_info) != RET_SUCCESS) { + LOC_LOGE("%s:%d]: Error: get_system_info returned error\n", + __func__, __LINE__); + goto err; + } + for(i=0; i= 0) - { - close(gss_fd); - gss_fd = -1; - LOC_LOGD("GSS shutdown.\n"); + if (mdm_fd >= 0) { + LOC_LOGD("closing the powerup node"); + close(mdm_fd); + mdm_fd = -1; + LOC_LOGD("finished closing the powerup node"); + } else { + LOC_LOGD("powerup node has not been opened yet."); } -*/ EXIT_LOG(%s, VOID_RET); } From 6645560ababa9f082880ba979f8cd122014b60fe Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Fri, 31 Jan 2014 12:08:32 -0800 Subject: [PATCH 223/945] Renaming class members for improved readability Renaming class members to reflect their true purpose CRs-fixed: 601353 Change-Id: I1eb2bc111a52845c515d1b9ca10fb800402c7c3d --- core/ContextBase.h | 6 ++-- core/LBSProxyBase.h | 6 ++-- loc_api/libloc_api_50001/LocEngAdapter.cpp | 38 +++++++++++----------- loc_api/libloc_api_50001/LocEngAdapter.h | 14 +++++--- loc_api/libloc_api_50001/loc.cpp | 4 +-- loc_api/libloc_api_50001/loc_eng.cpp | 4 +-- 6 files changed, 38 insertions(+), 34 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 85cbab7e..d7135875 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -56,8 +56,8 @@ public: inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } - inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } - inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } + inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index f0d1a329..99872eef 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -49,8 +49,8 @@ public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} - inline virtual bool hasAgpsExt() const { return false; } - inline virtual bool hasCPIExt() const { return false; } + inline virtual bool hasAgpsExtendedCapabilities() const { return false; } + inline virtual bool hasCPIExtendedCapabilities() const { return false; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 0b17b2c3..ba9ee5ec 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -65,7 +65,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mAgpsEnabled(false), mCPIEnabled(false) + mSupportsAgpsExtendedCapabilities(false), mSupportsCPIExtendedCapabilities(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -210,84 +210,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1, const char* url3, const int maxlength) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngReportXtraServer(mOwner, url1, url2, url3, maxlength)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestATL(mOwner, connHandle, agps_type)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::releaseATL(int connHandle) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngReleaseATL(mOwner, connHandle)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestXtraData() { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestXtra(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestTime() { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestTime(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { notif.size = sizeof(notif); notif.timeout = LOC_NI_NO_RESPONSE_TIME; sendMsg(new LocEngRequestNi(mOwner, notif, data)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestSuplES(int connHandle) { - if (mAgpsEnabled) + if (mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::reportDataCallOpened() { - if(mAgpsEnabled) + if(mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngSuplEsOpened(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::reportDataCallClosed() { - if(mAgpsEnabled) + if(mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngSuplEsClosed(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 6de663c0..fdc4c778 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -76,8 +76,8 @@ class LocEngAdapter : public LocAdapterBase { bool mNavigating; public: - bool mAgpsEnabled; - bool mCPIEnabled; + bool mSupportsAgpsExtendedCapabilities; + bool mSupportsCPIExtendedCapabilities; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner,ContextBase* context, @@ -91,8 +91,12 @@ public: inline LocInternalAdapter* getInternalAdapter() { return mInternalAdapter; } inline UlpProxyBase* getUlpProxy() { return mUlp; } inline void* getOwner() { return mOwner; } - inline bool hasAgpsExt() { return mContext->hasAgpsExt(); } - inline bool hasCPIExt() { return mContext->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { + return mContext->hasAgpsExtendedCapabilities(); + } + inline bool hasCPIExtendedCapabilities() { + return mContext->hasCPIExtendedCapabilities(); + } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 8a4d6756..d98a80fa 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -286,8 +286,8 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); - loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); - loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); + loc_afw_data.adapter->mSupportsAgpsExtendedCapabilities = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); + loc_afw_data.adapter->mSupportsCPIExtendedCapabilities = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5d8381e7..28b0874b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1877,7 +1877,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if(!adapter->mCPIEnabled) + if(!adapter->mSupportsCPIExtendedCapabilities) { adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, accuracy)); @@ -2093,7 +2093,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_SUPL, false); - if (adapter->mAgpsEnabled) { + if (adapter->mSupportsAgpsExtendedCapabilities) { loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, From a2e85b1df70aa4df5288fc39e7f66c13fb834520 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 26 Feb 2014 16:24:10 -0800 Subject: [PATCH 224/945] Add sendMsg to LocApiBase for utility It is useful for LocApiBase derived classes to have access to sending messages to the message handling thread without going through an adapter Change-Id: If60c473bfb504aab68ec661ecdfb012ef410c9cf CRs-fixed: 615958 --- core/LocApiBase.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 1d96313e..1603e6b4 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -70,7 +70,6 @@ class LocApiBase { friend struct LocOpenMsg; friend class ContextBase; const MsgTask* mMsgTask; - LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; protected: @@ -87,6 +86,10 @@ protected: const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask; public: + inline void sendMsg(const LocMsg* msg) const { + mMsgTask->sendMsg(msg); + } + void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); From 0daddfd2fd9f38cce21d604d7d981e8972557740 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Fri, 21 Mar 2014 22:32:30 +0530 Subject: [PATCH 225/945] Avoid GPS build for MSM8916 64bit Avoid GPS compilation for MSM8916 64bit targets CRs-fixed: 628263 Change-Id: I5fde20c25de005feb1c24017107858d4f19eed4f --- core/Android.mk | 2 ++ etc/Android.mk | 4 ++-- loc_api/Android.mk | 2 ++ utils/Android.mk | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 3e2b2eb8..0d1b7c2b 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -1,3 +1,4 @@ +ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) @@ -51,3 +52,4 @@ include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE +endif # not aarch64 diff --git a/etc/Android.mk b/etc/Android.mk index 025d3f74..452dcd21 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,4 +1,4 @@ - +ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -9,4 +9,4 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) - +endif # not aarch64 diff --git a/loc_api/Android.mk b/loc_api/Android.mk index 743b3860..e58f18e2 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,3 +1,4 @@ +ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) @@ -15,3 +16,4 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ include $(addsuffix Android.mk, $(GPS_DIR_LIST)) endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE +endif # not aarch64 diff --git a/utils/Android.mk b/utils/Android.mk index 07c1b1da..82c56f6a 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -1,3 +1,4 @@ +ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image @@ -60,3 +61,4 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE +endif # not aarch64 From 68d41f9b2c0bb8cc6698cf64617fbb4a62188939 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Fri, 21 Mar 2014 10:58:57 -0700 Subject: [PATCH 226/945] Cache geofence breach location Report location from geofence breach to LMS CRs-fixed: 637615 Change-Id: I01a4272200e554e18878658ecb4f70740074b75e --- core/gps_extended_c.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 7b9b43a5..e0e286f9 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -55,9 +55,11 @@ extern "C" { /** Position source is ULP */ #define ULP_LOCATION_IS_FROM_HYBRID 0x0001 /** Position source is GNSS only */ -#define ULP_LOCATION_IS_FROM_GNSS 0x0002 +#define ULP_LOCATION_IS_FROM_GNSS 0x0002 /** Position source is ZPP only */ -#define ULP_LOCATION_IS_FROM_ZPP 0x0004 +#define ULP_LOCATION_IS_FROM_ZPP 0x0004 +/** Position is from a Geofence Breach Event */ +#define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 #define ULP_MIN_INTERVAL_INVALID 0xffffffff From ec1fa23bc5e8504e3492ed910ef5cce147ffc811 Mon Sep 17 00:00:00 2001 From: Valeri Atamaniouk Date: Mon, 17 Mar 2014 08:57:05 +0200 Subject: [PATCH 227/945] Adds power voting for QCA1530 SoC When ALM is enabled, GPS HAL performs power vote for QCA1530 SoC using engine lock mechanics. Change-Id: I97c5c0460843fc1ad995932f97eeadb7b83fcb3b --- core/LocApiBase.cpp | 2 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 37 +++++++++++++++++++++- loc_api/libloc_api_50001/LocEngAdapter.h | 28 +++++++++++++++- loc_api/libloc_api_50001/loc.cpp | 6 ++++ loc_api/libloc_api_50001/loc_eng.cpp | 2 ++ 5 files changed, 72 insertions(+), 3 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8b6713c1..65d2c8d9 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -126,7 +126,7 @@ struct LocOpenMsg : public LocMsg { LocApiBase::LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : - mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) + mMsgTask(msgTask), mExcludedMask(excludedMask), mMask(0) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index ba9ee5ec..44000816 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -65,7 +65,8 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mSupportsAgpsExtendedCapabilities(false), mSupportsCPIExtendedCapabilities(false) + mSupportsAgpsExtendedCapabilities(false), + mSupportsCPIExtendedCapabilities(false), mPowerVote(0) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -123,6 +124,40 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) mUlp = ulp; } +void LocEngAdapter::requestPowerVote() +{ + struct LocEngAdapterVotePower : public LocMsg { + LocEngAdapter* mAdapter; + const bool mPowerUp; + inline LocEngAdapterVotePower(LocEngAdapter* adapter, bool powerUp) : + LocMsg(), mAdapter(adapter), mPowerUp(powerUp) + { + locallog(); + } + inline virtual void proc() const { + /* 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. + */ + int mode = mPowerUp ? 103 : 101; + mAdapter->setGpsLock(mode); + } + inline void locallog() const { + LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", + (int)mPowerUp); + } + inline virtual void log() const { + locallog(); + } + }; + + if (getPowerVoteRight()) { + sendMsg(new LocEngAdapterVotePower(this, getPowerVote())); + } +} + void LocInternalAdapter::reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index fdc4c778..2c6e22d5 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -74,13 +74,19 @@ class LocEngAdapter : public LocAdapterBase { 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; public: bool mSupportsAgpsExtendedCapabilities; bool mSupportsCPIExtendedCapabilities; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner,ContextBase* context, + void* owner, ContextBase* context, MsgTask::tCreate tCreator); virtual ~LocEngAdapter(); @@ -279,6 +285,26 @@ public: { 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(); + } + 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 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index d98a80fa..8c5ce033 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -294,6 +294,9 @@ static int loc_init(GpsCallbacks* callbacks) goto err; } + loc_afw_data.adapter->setPowerVoteRight(loc_get_target() == TARGET_QCA1530); + loc_afw_data.adapter->setPowerVote(true); + LOC_LOGD("loc_eng_init() success!"); if (mdm_fd < 0) { struct dev_info modem_info; @@ -349,6 +352,9 @@ SIDE EFFECTS static void loc_cleanup() { ENTRY_LOG(); + + loc_afw_data.adapter->setPowerVote(false); + loc_eng_cleanup(loc_afw_data); gps_loc_cb = NULL; gps_sv_cb = NULL; diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 28b0874b..cb3c4961 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2525,6 +2525,8 @@ 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(); From 7170b25778208fbd3cbe62b003e8707f12bb6422 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 20 Mar 2014 11:16:00 -0700 Subject: [PATCH 228/945] Change to CPI logic CPI should not be dependent on persist.gps.qc_nlp_in_use property. It should only be dependent on whether CPI is enabled or not. Reduce confidence in position if required. CRs-Fixed: 639153 Change-Id: I9e54ab1ac605143843a2e19607ff8e2e20704d01 --- loc_api/libloc_api_50001/loc.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index d98a80fa..f421ad0b 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -508,33 +508,16 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { - static bool initialized = false; - static bool enable_cpi = true; - accuracy = 1000; ENTRY_LOG(); - if(!initialized) + if (accuracy < 1000) { - char value[PROPERTY_VALUE_MAX]; - memset(value, 0, sizeof(value)); - (void)property_get("persist.gps.qc_nlp_in_use", value, "0"); - if(0 == strcmp(value, "1")) - { - enable_cpi = false; - LOC_LOGI("GPS HAL coarse position injection disabled"); - } - else - { - LOC_LOGI("GPS HAL coarse position injection enabled"); - } - initialized = true; + accuracy = 1000; } int ret_val = 0; - if(enable_cpi) - { - ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); - } + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + EXIT_LOG(%d, ret_val); return ret_val; } From fea5de1caf8f31a5a9cca15a93e02efb16736989 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 31 Mar 2014 14:49:15 -0700 Subject: [PATCH 229/945] Only output NMEA for GNSS/Sensor/Hybrid locations We don't want to output even blank NMEA for Wifi or Cell based locations. Change-Id: I5848686c23c4a5911be1d7150fee4879cd180c65 CRs-fixed: 640049 --- loc_api/libloc_api_50001/loc_eng.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 28b0874b..39732990 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -759,7 +759,10 @@ void LocEngReportPosition::proc() const { } if (locEng->generateNmea && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) + mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS && + mTechMask & (LOC_POS_TECH_MASK_SATELLITE | + LOC_POS_TECH_MASK_SENSORS | + LOC_POS_TECH_MASK_HYBRID)) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); From 25244b3660b7796cf152b569f5a01d3c55f01c2b Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 1 Apr 2014 13:34:07 -0700 Subject: [PATCH 230/945] Close MDM node on shutdown Added call to close mdm power node as part of procedure to shutdown CRs-fixed: 640576 Change-Id: Ie0c05272249401f6cf13e9443417b0ba5de1be52 --- core/LocAdapterBase.cpp | 4 ++ core/LocAdapterBase.h | 1 + loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 ++ loc_api/libloc_api_50001/LocEngAdapter.h | 1 + loc_api/libloc_api_50001/loc.cpp | 46 +++++++++++++++----- loc_api/libloc_api_50001/loc.h | 2 + loc_api/libloc_api_50001/loc_eng.cpp | 49 +++++++++++++++++++++- loc_api/libloc_api_50001/loc_eng.h | 1 + loc_api/libloc_api_50001/loc_eng_msg.h | 7 ++++ 9 files changed, 102 insertions(+), 13 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index a65cb310..eea8eddf 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -128,4 +128,8 @@ DEFAULT_IMPL(false) bool LocAdapterBase:: requestNiNotify(GpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) + +void LocAdapterBase:: + shutdown() +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 4e6ff24b..02b09877 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -100,6 +100,7 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } + virtual void shutdown(); }; } // namespace loc_core diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 44000816..db9f26c2 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -53,6 +53,10 @@ void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } +void LocInternalAdapter::shutdown() { + sendMsg(new LocEngShutdown(mLocEngAdapter)); +} + LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, MsgTask::tCreate tCreator) : diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 2c6e22d5..10b81fb1 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -64,6 +64,7 @@ public: virtual void stopFixInt(); virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); + virtual void shutdown(); }; typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 8c5ce033..9c447cde 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -74,7 +74,7 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static const void* loc_get_extension(const char* name); - +static void loc_close_mdm_node(); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = { @@ -279,7 +279,8 @@ static int loc_init(GpsCallbacks* callbacks) 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->request_utc_time_cb, /* request_utc_time_cb */ + loc_close_mdm_node /*loc_shutdown_cb*/}; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; @@ -333,6 +334,37 @@ err: return retVal; } +/*=========================================================================== +FUNCTION loc_close_mdm_node + +DESCRIPTION + closes mdm_fd which is the modem powerup node obtained in loc_init + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_close_mdm_node() +{ + ENTRY_LOG(); + if (mdm_fd >= 0) { + LOC_LOGD("closing the powerup node"); + close(mdm_fd); + mdm_fd = -1; + LOC_LOGD("finished closing the powerup node"); + } else { + LOC_LOGD("powerup node has not been opened yet."); + } + + EXIT_LOG(%s, VOID_RET); +} + /*=========================================================================== FUNCTION loc_cleanup @@ -356,18 +388,10 @@ static void loc_cleanup() loc_afw_data.adapter->setPowerVote(false); loc_eng_cleanup(loc_afw_data); + loc_close_mdm_node(); gps_loc_cb = NULL; gps_sv_cb = NULL; - if (mdm_fd >= 0) { - LOC_LOGD("closing the powerup node"); - close(mdm_fd); - mdm_fd = -1; - LOC_LOGD("finished closing the powerup node"); - } else { - LOC_LOGD("powerup node has not been opened yet."); - } - EXIT_LOG(%s, VOID_RET); } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index c9593235..7e268273 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -42,6 +42,7 @@ extern "C" { 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 void (*loc_shutdown_cb) (void); typedef struct { loc_location_cb_ext location_cb; @@ -55,6 +56,7 @@ typedef struct { loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; gps_request_utc_time request_utc_time_cb; + loc_shutdown_cb shutdown_cb; } LocCallbacks; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index cb3c4961..bddb30db 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -187,7 +187,7 @@ 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 loc_eng_handle_shutdown(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); @@ -327,6 +327,27 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } + +LocEngShutdown::LocEngShutdown(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) +{ + locallog(); +} +inline void LocEngShutdown::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + LOC_LOGD("%s:%d]: Calling loc_eng_handle_shutdown", __func__, __LINE__); + loc_eng_handle_shutdown(*locEng); +} +inline void LocEngShutdown::locallog() const +{ + LOC_LOGV("LocEngShutdown"); +} +inline void LocEngShutdown::log() const +{ + locallog(); +} + // case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; @@ -1521,7 +1542,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ? callbacks->sv_ext_parser : noProc; loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS; - + loc_eng_data.shutdown_cb = callbacks->shutdown_cb; // 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; @@ -2606,3 +2627,27 @@ int loc_eng_read_config(void) EXIT_LOG(%d, 0); return 0; } + +/*=========================================================================== +FUNCTION loc_eng_handle_shutdown + +DESCRIPTION + Calls the shutdown callback function in the loc interface to close + the modem node + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_handle_shutdown(loc_eng_data_s_type &locEng) +{ + ENTRY_LOG(); + locEng.shutdown_cb(); + EXIT_LOG(%d, 0); +} diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index e50e4a58..3c5d5a7d 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -133,6 +133,7 @@ typedef struct loc_eng_data_s loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; + loc_shutdown_cb shutdown_cb; } loc_eng_data_s_type; /* GPS.conf support */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index ae962f55..b767dc5f 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -289,6 +289,13 @@ struct LocEngGetZpp : public LocMsg { void send() const; }; +struct LocEngShutdown : public LocMsg { + LocEngAdapter* mAdapter; + LocEngShutdown(LocEngAdapter* adapter); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; #ifdef __cplusplus } #endif /* __cplusplus */ From f9a26b2a68082f8de9c8167632d27be095a8fabf Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 2 Apr 2014 14:23:39 -0700 Subject: [PATCH 231/945] Inject location only on CPI disabled Includes inject API from GPS HAL and FLP HAL CRs-fixed: 640452 Change-Id: Ied947e2862fb9ecca0142f9608cdcc889cac8a2b --- core/LocAdapterBase.h | 1 + core/LocAdapterProxyBase.h | 5 ++- loc_api/libloc_api_50001/LocEngAdapter.cpp | 40 +++++++++++----------- loc_api/libloc_api_50001/LocEngAdapter.h | 4 +-- loc_api/libloc_api_50001/loc.cpp | 4 +-- loc_api/libloc_api_50001/loc_eng.cpp | 4 +-- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 02b09877..9348a89c 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -101,6 +101,7 @@ public: const void* data); inline virtual bool isInSession() { return false; } virtual void shutdown(); + ContextBase* getContext() const { return mContext; } }; } // namespace loc_core diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index adc868c6..25af10be 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -46,6 +46,9 @@ protected: inline virtual ~LocAdapterProxyBase() { delete mLocAdapterBase; } + ContextBase* getContext() const { + return mLocAdapterBase->getContext(); + } public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; @@ -53,4 +56,4 @@ public: } // namespace loc_core -#endif //LOC_ADAPTER_PROXY_BASE_H \ No newline at end of file +#endif //LOC_ADAPTER_PROXY_BASE_H diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index db9f26c2..1e6e4e1b 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -69,8 +69,8 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mSupportsAgpsExtendedCapabilities(false), - mSupportsCPIExtendedCapabilities(false), mPowerVote(0) + mSupportsAgpsRequests(false), + mSupportsPositionInjection(false), mPowerVote(0) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -249,84 +249,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1, const char* url3, const int maxlength) { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngReportXtraServer(mOwner, url1, url2, url3, maxlength)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestATL(mOwner, connHandle, agps_type)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::releaseATL(int connHandle) { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngReleaseATL(mOwner, connHandle)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestXtraData() { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestXtra(mOwner)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestTime() { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestTime(mOwner)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) { - if (mSupportsAgpsExtendedCapabilities) { + if (mSupportsAgpsRequests) { notif.size = sizeof(notif); notif.timeout = LOC_NI_NO_RESPONSE_TIME; sendMsg(new LocEngRequestNi(mOwner, notif, data)); } - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestSuplES(int connHandle) { - if (mSupportsAgpsExtendedCapabilities) + if (mSupportsAgpsRequests) sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::reportDataCallOpened() { - if(mSupportsAgpsExtendedCapabilities) + if(mSupportsAgpsRequests) sendMsg(new LocEngSuplEsOpened(mOwner)); - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::reportDataCallClosed() { - if(mSupportsAgpsExtendedCapabilities) + if(mSupportsAgpsRequests) sendMsg(new LocEngSuplEsClosed(mOwner)); - return mSupportsAgpsExtendedCapabilities; + return mSupportsAgpsRequests; } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 10b81fb1..27fb0fa1 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -83,8 +83,8 @@ class LocEngAdapter : public LocAdapterBase { static const unsigned int POWER_VOTE_VALUE = 0x10; public: - bool mSupportsAgpsExtendedCapabilities; - bool mSupportsCPIExtendedCapabilities; + bool mSupportsAgpsRequests; + bool mSupportsPositionInjection; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 910c30c9..97a610ca 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -287,8 +287,8 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); - loc_afw_data.adapter->mSupportsAgpsExtendedCapabilities = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); - loc_afw_data.adapter->mSupportsCPIExtendedCapabilities = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); + loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); + loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index bddb30db..24ad998c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1898,7 +1898,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if(!adapter->mSupportsCPIExtendedCapabilities) + if(adapter->mSupportsPositionInjection) { adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, accuracy)); @@ -2114,7 +2114,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_SUPL, false); - if (adapter->mSupportsAgpsExtendedCapabilities) { + if (adapter->mSupportsAgpsRequests) { loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, From a6e2f769a8893a0f1d83c464b042d982023c4283 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 8 Apr 2014 12:11:25 -0700 Subject: [PATCH 232/945] Fix wrong log tag The log tag for ATL open success was mistakenly set as ATL closed Change-Id: I755fb2545226e09135935956796c951a7e33dab9 CRs-fixed: 645283 --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 24ad998c..54a29315 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1374,7 +1374,7 @@ struct LocEngAtlOpenSuccess : public LocMsg { mStateMachine->onRsrcEvent(RSRC_GRANTED); } inline void locallog() const { - LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" + LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n" " bearer type: %s", loc_get_agps_type_name(mStateMachine->getType()), mAPN, From 7b268f9c105824727ce0a2887c6975ee038c3a8c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 9 Apr 2014 13:15:29 -0700 Subject: [PATCH 233/945] a change to support c++11 The logging macro seems to break c++11 toolchain. A change is make to address that Change-Id: I5056fe0431ff064ac4805facbb59195fe04b154e CRs-Fixed: 646028 --- utils/log_util.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/utils/log_util.h b/utils/log_util.h index 5606defa..8ff6b5a3 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -107,36 +107,36 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #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__); } +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__); } +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__); } +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__); } +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__); } +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_LOGE(...) ALOGE("E/" __VA_ARGS__) -#define LOC_LOGW(...) ALOGW("W/"__VA_ARGS__) +#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) -#define LOC_LOGI(...) ALOGI("I/"__VA_ARGS__) +#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) -#define LOC_LOGD(...) ALOGD("D/"__VA_ARGS__) +#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) -#define LOC_LOGV(...) ALOGV("V/"__VA_ARGS__) +#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) #endif /* DEBUG_DMN_LOC_API */ From bbb724335fc3b251e009bf5b0bd1332eef0ea444 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 2 Apr 2014 17:51:37 -0700 Subject: [PATCH 234/945] NI Emergency overrides a pending NI Network Initiated notify verify request that is the emergency type should override any pending Network Initiaed notify verify session. CRs-fixed: 563670 Change-Id: I2d05449a8ebaa1dfa08f4c839422a7adbd1b871d --- loc_api/libloc_api_50001/loc_eng_ni.cpp | 169 +++++++++++++++--------- loc_api/libloc_api_50001/loc_eng_ni.h | 8 ++ 2 files changed, 118 insertions(+), 59 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 74abfd42..4597b983 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -116,28 +116,45 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, 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 busy, use default or deny */ - if (NULL != loc_eng_ni_data_p->rawRequest) - { - /* XXX Consider sending a NO RESPONSE reply or queue the request */ - LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", - notif->ni_type); - if (NULL != passThrough) { - free((void*)passThrough); + 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; } } - else { + + + if (pSession) { /* Save request */ - loc_eng_ni_data_p->rawRequest = (void*)passThrough; + 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 = loc_eng_ni_data_p->reqID; + ((GpsNiNotification*)notif)->notification_id = pSession->reqID; if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) { @@ -156,16 +173,16 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, /* 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. **/ - loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); + 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(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); + rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession); if (rc) { LOC_LOGE("Loc NI thread is not created.\n"); } - rc = pthread_detach(loc_eng_ni_data_p->thread); + rc = pthread_detach(pSession->thread); if (rc) { LOC_LOGE("Loc NI thread is not detached.\n"); @@ -186,61 +203,61 @@ static void* ni_thread_proc(void *args) { ENTRY_LOG(); - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; + 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(&loc_eng_ni_data_p->tLock); + pthread_mutex_lock(&pSession->tLock); /* Calculate absolute expire time */ gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->respTimeLeft; + 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, loc_eng_ni_data_p->respTimeLeft ); + (long) expire_time.tv_sec, pSession->respTimeLeft ); - while (!loc_eng_ni_data_p->respRecvd) + while (!pSession->respRecvd) { - rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, - &loc_eng_ni_data_p->tLock, + rc = pthread_cond_timedwait(&pSession->tCond, + &pSession->tLock, &expire_time); if (rc == ETIMEDOUT) { - loc_eng_ni_data_p->resp = GPS_NI_RESPONSE_NORESP; + 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 ); - loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + pSession->respRecvd = FALSE; /* Reset the user response flag for the next session*/ - LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->resp); + 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 = loc_eng_data_p->adapter; + LocEngAdapter* adapter = pSession->adapter; LocEngInformNiResponse *msg = NULL; - if (NULL != loc_eng_ni_data_p->rawRequest) { - if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n"); + if (NULL != pSession->rawRequest) { + if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); msg = new LocEngInformNiResponse(adapter, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + pSession->resp, + pSession->rawRequest); } else { LOC_LOGD("this is the ignore reply for SUPL ES\n"); + free(pSession->rawRequest); } - loc_eng_ni_data_p->rawRequest = NULL; + pSession->rawRequest = NULL; } - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + pthread_mutex_unlock(&pSession->tLock); - loc_eng_ni_data_p->respTimeLeft = 0; - loc_eng_ni_data_p->reqID++; + pSession->respTimeLeft = 0; + pSession->reqID = 0; if (NULL != msg) { LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); @@ -262,16 +279,28 @@ void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data) } // only if modem has requested but then died. - if (NULL != loc_eng_ni_data_p->rawRequest) { - free(loc_eng_ni_data_p->rawRequest); - loc_eng_ni_data_p->rawRequest = NULL; + 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->tLock); + 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->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + 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); @@ -305,12 +334,19 @@ void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callb 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->respTimeLeft = 0; - loc_eng_ni_data_p->respRecvd = FALSE; - loc_eng_ni_data_p->rawRequest = NULL; - loc_eng_ni_data_p->reqID = 0; - pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); - pthread_mutex_init(&loc_eng_ni_data_p->tLock, NULL); + 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); @@ -338,25 +374,40 @@ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, { 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->reqID && - NULL != loc_eng_ni_data_p->rawRequest) - { + 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(&loc_eng_ni_data_p->tLock); - loc_eng_ni_data_p->resp = user_response; - loc_eng_ni_data_p->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + 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: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", - loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); + LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 8c076041..068f5cdd 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -31,6 +31,7 @@ #define LOC_ENG_NI_H #include +#include #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ #define LOC_NI_NOTIF_KEY_ADDRESS "Address" @@ -45,6 +46,13 @@ typedef struct { 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; From 996a633c02af8958f66792a958e4243b17df5bd9 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 15 Apr 2014 17:38:42 -0700 Subject: [PATCH 235/945] Assure associate callback is called in msgTask If MsgTask thread is created before context that has associator is initialized, the associator callback was not getting called. CRs-fixed: 650061 Change-Id: I45d81e1b49fc8dcbc93d1ceef4fef38468ecb4f8 --- core/LocDualContext.cpp | 2 ++ core/MsgTask.cpp | 15 +++++++++++++++ core/MsgTask.h | 1 + 3 files changed, 18 insertions(+) diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 86c3613a..fa4c4d60 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -74,6 +74,8 @@ const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, { if (NULL == mMsgTask) { mMsgTask = new MsgTask(tAssociate, name); + } else if (tAssociate) { + mMsgTask->associate(tAssociate); } return mMsgTask; } diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp index 37813394..4db992d9 100644 --- a/core/MsgTask.cpp +++ b/core/MsgTask.cpp @@ -69,6 +69,21 @@ MsgTask::~MsgTask() { msg_q_unblock((void*)mQ); } +void MsgTask::associate(tAssociate tAssociator) const { + struct LocAssociateMsg : public LocMsg { + tAssociate mAssociator; + inline LocAssociateMsg(tAssociate associator) : + LocMsg(), mAssociator(associator) {} + inline virtual void proc() const { + if (mAssociator) { + LOC_LOGD("MsgTask::associate"); + mAssociator(); + } + } + }; + sendMsg(new LocAssociateMsg(tAssociator)); +} + void MsgTask::createPThread(const char* threadName) { pthread_attr_t attr; pthread_attr_init(&attr); diff --git a/core/MsgTask.h b/core/MsgTask.h index d09de731..d50bb31a 100644 --- a/core/MsgTask.h +++ b/core/MsgTask.h @@ -52,6 +52,7 @@ public: MsgTask(tAssociate tAssociator, const char* threadName); ~MsgTask(); void sendMsg(const LocMsg* msg) const; + void associate(tAssociate tAssociator) const; private: const void* mQ; From 9e585cb7bfbbf602555fe7b8e737ff64083ac7f4 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 24 Feb 2014 11:13:57 -0800 Subject: [PATCH 236/945] Inject feature config This change injects feature config through using the first available context CRs-fixed: 616544 Change-Id: Idea5bd8acfff729589c071f20bec18679c89ab25 --- core/ContextBase.cpp | 8 ++-- core/ContextBase.h | 1 + core/LBSProxyBase.h | 5 ++- core/LocApiBase.cpp | 18 ++++++--- core/LocApiBase.h | 16 +++++--- core/LocDualContext.cpp | 38 +++++++++++++++++-- core/LocDualContext.h | 7 ++-- .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 5 ++- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 12 +++--- loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 1 - loc_api/libloc_api_50001/loc_eng.h | 1 - 12 files changed, 82 insertions(+), 32 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1bd138ea..e5a50140 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -65,13 +65,13 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); if (NULL != handle) { getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); if (NULL != getter) { - locApi = (*getter)(mMsgTask, exMask); + locApi = (*getter)(mMsgTask, exMask, this); } } } @@ -80,7 +80,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // locApi could still be NULL at this time // we would then create a dummy one if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask); + locApi = new LocApiBase(mMsgTask, exMask, this); } return locApi; diff --git a/core/ContextBase.h b/core/ContextBase.h index d7135875..2adbedd6 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -62,6 +62,7 @@ public: unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); } + inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); } }; } // namespace loc_core diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 99872eef..0b7dbdf1 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -35,12 +35,14 @@ 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) const { + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context) const { return NULL; } protected: @@ -51,6 +53,7 @@ public: unsigned long capabilities) const {} inline virtual bool hasAgpsExtendedCapabilities() const { return false; } inline virtual bool hasCPIExtendedCapabilities() const { return false; } + virtual void injectFeatureConfig(ContextBase* context) const {} }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 65d2c8d9..90f36531 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,6 +33,7 @@ #include #include #include +#include namespace loc_core { @@ -125,8 +126,9 @@ struct LocOpenMsg : public LocMsg { }; LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : - mMsgTask(msgTask), mExcludedMask(excludedMask), mMask(0) + LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + ContextBase* context) : + mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0), mContext(context) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } @@ -206,6 +208,8 @@ 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()); } @@ -443,11 +447,15 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getZppFix(GpsLocation & zppLoc) + getWwanZppFix(GpsLocation & zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) + getBestAvailableZppFix(GpsLocation & zppLoc) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) int LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 1603e6b4..bef03790 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -36,6 +36,7 @@ #include namespace loc_core { +class ContextBase; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -70,6 +71,7 @@ class LocApiBase { friend struct LocOpenMsg; friend class ContextBase; const MsgTask* mMsgTask; + ContextBase *mContext; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; protected: @@ -80,7 +82,8 @@ protected: LOC_API_ADAPTER_EVENT_MASK_T getEvtMask(); LOC_API_ADAPTER_EVENT_MASK_T mMask; LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask); + LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + ContextBase* context = NULL); inline virtual ~LocApiBase() { close(); } bool isInSession(); const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask; @@ -189,9 +192,11 @@ public: virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); virtual enum loc_api_adapter_err - getZppFix(GpsLocation & zppLoc); + getWwanZppFix(GpsLocation & zppLoc); virtual enum loc_api_adapter_err - getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + getBestAvailableZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); virtual int initDataServiceClient(); virtual int openAndStartDataCall(); virtual void stopDataCall(); @@ -215,7 +220,8 @@ public: }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context); } // namespace loc_core diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index fa4c4d60..ab151109 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -55,10 +55,10 @@ LocDualContext::mBgExclMask = 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"; -const char* LocDualContext::mIzatLibName = "liblbs_core.so"; +const char* LocDualContext::mLBSLibName = "liblbs_core.so"; const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) @@ -88,6 +88,10 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, mFgContext = new LocDualContext(msgTask, mFgExclMask); } + if(NULL == mInjectContext) { + mInjectContext = mFgContext; + injectFeatureConfig(mInjectContext); + } return mFgContext; } @@ -99,6 +103,11 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, mFgContext = new LocDualContext(msgTask, mFgExclMask); } + if(NULL == mInjectContext) { + LOC_LOGD("%s:%d]: mInjectContext is FgContext", __func__, __LINE__); + mInjectContext = mFgContext; + injectFeatureConfig(mInjectContext); + } return mFgContext; } @@ -111,6 +120,11 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, mBgContext = new LocDualContext(msgTask, mBgExclMask); } + if(NULL == mInjectContext) { + LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); + mInjectContext = mBgContext; + injectFeatureConfig(mInjectContext); + } return mBgContext; } @@ -122,12 +136,28 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, mBgContext = new LocDualContext(msgTask, mBgExclMask); } + if(NULL == mInjectContext) { + LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); + mInjectContext = mBgContext; + injectFeatureConfig(mInjectContext); + } 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, mIzatLibName) + ContextBase(msgTask, exMask, mLBSLibName) { } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index e761e764..cdc4df3e 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -40,7 +40,7 @@ class LocDualContext : public ContextBase { static const MsgTask* mMsgTask; static ContextBase* mFgContext; static ContextBase* mBgContext; - + static ContextBase* mInjectContext; static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, const char* name); static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, @@ -52,7 +52,7 @@ protected: inline virtual ~LocDualContext() {} public: - static const char* mIzatLibName; + 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; @@ -65,6 +65,7 @@ public: const char* name); static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, const char* name); + static void injectFeatureConfig(ContextBase *context); }; } diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 55550e74..aafec635 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2013, The Linux Foundation. All rights reserved. +/* 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 @@ -133,6 +133,7 @@ public: }; extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context); #endif //LOC_API_RPC_H diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 08474fc4..e1422923 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -134,8 +134,9 @@ const rpc_loc_event_mask_type LocApiRpc::locBits[] = // constructor LocApiRpc::LocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - LocApiBase(msgTask, exMask), + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context) : + LocApiBase(msgTask, exMask, context), client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), dataEnableLastSet(-1) { @@ -1388,8 +1389,9 @@ GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) } LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) { - return new LocApiRpc(msgTask, exMask); + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context) { + return new LocApiRpc(msgTask, exMask, context); } /*Values for lock diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 27fb0fa1..93f3dc29 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -254,7 +254,7 @@ public: inline enum loc_api_adapter_err getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) { - return mLocApi->getZppFix(zppLoc, tech_mask); + return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); } virtual void handleEngineDownEvent(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 49a38fbe..423f2c1d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -115,7 +115,6 @@ static loc_param_s_type loc_parameter_table[] = {"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'}, - {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 3c5d5a7d..ff787da7 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -143,7 +143,6 @@ typedef struct loc_gps_cfg_s unsigned long ACCURACY_THRES; unsigned long SUPL_VER; unsigned long CAPABILITIES; - unsigned long QUIPC_ENABLED; unsigned long LPP_PROFILE; uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; From 89c671f1878fb56f638a1c60e62730e921d27919 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 6 May 2014 11:14:24 -0700 Subject: [PATCH 237/945] Logging correction when printing IPV6 bearer type Entry for AGPS_APN_BEARER_IPV6 was missing from NAME_VAL. CRs-Fixed: 660143 Change-Id: If439dbc6b47c0483cf9b5d9ea37307c69953bfed --- core/loc_core_log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index af2cced7..d2eda661 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -205,7 +205,7 @@ static 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_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV6 ), NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) }; static int loc_eng_agps_bears_num = sizeof(loc_eng_agps_bears) / sizeof(loc_name_val_s_type); From c7265bbe1daf6033a7c2b047a5e72c50e032ade6 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 7 May 2014 17:12:49 -0700 Subject: [PATCH 238/945] Revert "Avoid GPS build for MSM8916 64bit" This reverts commit 0daddfd2fd9f38cce21d604d7d981e8972557740. Change-Id: I3138bb2d600618cfec5ec7588d5359b15a07cbad --- core/Android.mk | 2 -- etc/Android.mk | 4 ++-- loc_api/Android.mk | 2 -- utils/Android.mk | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 0d1b7c2b..3e2b2eb8 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) @@ -52,4 +51,3 @@ include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/etc/Android.mk b/etc/Android.mk index 452dcd21..025d3f74 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,4 +1,4 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -9,4 +9,4 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) -endif # not aarch64 + diff --git a/loc_api/Android.mk b/loc_api/Android.mk index e58f18e2..743b3860 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) @@ -16,4 +15,3 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ include $(addsuffix Android.mk, $(GPS_DIR_LIST)) endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/utils/Android.mk b/utils/Android.mk index 82c56f6a..07c1b1da 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image @@ -61,4 +60,3 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 From e0895bfa0067042ce29425d390636da77a158cdc Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Fri, 18 Apr 2014 16:04:08 -0700 Subject: [PATCH 239/945] Sending HW FLP request to ULP ULP Should be informed of all sessions in progress. -Added methods to ULP Proxy for the purpose of reporting batching sessions to ULP CRs-fixed: 657554 Change-Id: I6e1d9728a0462b86c4ffe73bd5a6ac98e7c0fafe --- core/UlpProxyBase.h | 11 +++++++++++ core/gps_extended_c.h | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 90097571..b9a8224f 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -50,6 +50,7 @@ public: mPosMode = params; return false; } + inline virtual bool reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, @@ -67,6 +68,16 @@ public: } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} + inline virtual bool reportBatchingSession(GpsExtBatchOptions &options, + bool active) { + return false; + } + inline virtual bool reportPositions(GpsExtLocation * locations, + int32_t number_of_locations, + enum loc_sess_status status, + LocPosTechMask techMask) { + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index e0e286f9..d4a7dbea 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -60,6 +60,8 @@ extern "C" { #define ULP_LOCATION_IS_FROM_ZPP 0x0004 /** Position is from a Geofence Breach Event */ #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 +/** Positioin is from Hardware FLP */ +#define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 #define ULP_MIN_INTERVAL_INVALID 0xffffffff @@ -111,6 +113,14 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } GpsExtCallbacks; +/** GPS extended batch options */ +typedef struct { + double max_power_allocation_mW; + uint32_t sources_to_use; + uint32_t flags; + int64_t period_ns; +} GpsExtBatchOptions; + /** 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 @@ -234,6 +244,19 @@ typedef struct { float speed_unc; } GpsLocationExtended; +typedef struct GpsExtLocation_s { + size_t size; + uint16_t flags; + double latitude; + double longitude; + double altitude; + float speed; + float bearing; + float accuracy; + int64_t timestamp; + uint32_t sources_used; +} GpsExtLocation; + enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, From 6fc3071b05d501a29e163cc63f573f6774e9bae4 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 3 Jun 2014 16:13:59 -0700 Subject: [PATCH 240/945] KW warnings dlsym on gps_geofence_get_interface should check NULL, and gmtime return should also check NULL Change-Id: I23ab17f016ad9f4667ac197c12f016433c48af90 CRs-Fixed: 674884 --- loc_api/libloc_api_50001/loc.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 97a610ca..0a67477f 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -603,7 +603,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL) { + if ((error = dlerror()) != NULL && NULL != get_gps_geofence_interface) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 842eda1f..4c6b9a3a 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -119,14 +119,17 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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; - - time_t utcTime(location.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); 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; From 9ffb10553dca42d752248dadc0c2cb9e620c916e Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 7 May 2014 17:12:49 -0700 Subject: [PATCH 241/945] Revert "Avoid GPS build for MSM8916 64bit" This reverts commit 0daddfd2fd9f38cce21d604d7d981e8972557740. Change-Id: I3138bb2d600618cfec5ec7588d5359b15a07cbad --- core/Android.mk | 2 -- etc/Android.mk | 4 ++-- loc_api/Android.mk | 2 -- utils/Android.mk | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 0d1b7c2b..3e2b2eb8 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) @@ -52,4 +51,3 @@ include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/etc/Android.mk b/etc/Android.mk index 452dcd21..025d3f74 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,4 +1,4 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -9,4 +9,4 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) -endif # not aarch64 + diff --git a/loc_api/Android.mk b/loc_api/Android.mk index e58f18e2..743b3860 100644 --- a/loc_api/Android.mk +++ b/loc_api/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) @@ -16,4 +15,3 @@ GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ include $(addsuffix Android.mk, $(GPS_DIR_LIST)) endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 diff --git a/utils/Android.mk b/utils/Android.mk index 82c56f6a..07c1b1da 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -1,4 +1,3 @@ -ifeq (, $(filter aarch64 arm64, $(TARGET_ARCH))) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image @@ -61,4 +60,3 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE -endif # not aarch64 From e8958a3aab0a154db8566b123273ea2dfebe64b0 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 27 May 2014 17:10:23 -0700 Subject: [PATCH 242/945] Add option to fallback to LocApiV02 In case the lbs or izat libs are not present, fall back to LocApiV02 to obtain the qmi client handle. This change will enable basic GPS functionality without lbs or izat lib dependencies Change-Id: Ic2c8418d785e891ad0a660a615cd5111fafc4ff2 --- core/ContextBase.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index e5a50140..c3cb532a 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -65,13 +65,28 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { - // only RPC is the option now - void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { + 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 (NULL != getter) { - locApi = (*getter)(mMsgTask, exMask, this); + if(getter != NULL) { + LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__); + locApi = (*getter)(mMsgTask,exMask); + } + } + // 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); + } } } } From 08237e52b67a06bb1ed35b5fb4a40aed8cd4c83a Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 17 Jun 2014 11:23:10 -0700 Subject: [PATCH 243/945] Revert "Remove masks for Glonass" This reverts commit 7d128bf31e4692db64cb94b2c03154db00cb2d77 Change-Id: I4e8a42e253237fbf23f02da996b94555653001f5 --- core/gps_extended_c.h | 10 ++++++++++ core/loc_core_log.cpp | 19 ++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index d4a7dbea..63fe32a9 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -102,6 +102,16 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 1 #define AGPS_APN_BEARER_IPV4V6 2 +#define GPS_DELETE_ALMANAC_CORR 0x00001000 +#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 +#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 +#define GPS_DELETE_ALMANAC_GLO 0x00008000 +#define GPS_DELETE_SVDIR_GLO 0x00010000 +#define GPS_DELETE_SVSTEER_GLO 0x00020000 +#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 +#define GPS_DELETE_TIME_GPS 0x00080000 +#define GPS_DELETE_TIME_GLO 0x00100000 + /** GPS extended callback structure. */ typedef struct { /** set to sizeof(GpsCallbacks) */ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index d2eda661..430f4b8e 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -118,20 +118,13 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_CELLDB_INFO ), NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GLO_DELETE_EPHEMERIS ), - NAME_VAL( GLO_DELETE_ALMANAC ), - NAME_VAL( GLO_DELETE_SVDIR ), - NAME_VAL( GLO_DELETE_SVSTEER ), - NAME_VAL( GLO_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_GLO ), + NAME_VAL( GPS_DELETE_SVDIR_GLO ), + NAME_VAL( GPS_DELETE_SVSTEER_GLO ), + NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GLO_DELETE_TIME ), - NAME_VAL( BDS_DELETE_SVDIR ), - NAME_VAL( BDS_DELETE_SVSTEER ), - NAME_VAL( BDS_DELETE_TIME ), - NAME_VAL( BDS_DELETE_ALMANAC_CORR ), - NAME_VAL( BDS_DELETE_EPHEMERIS ), - NAME_VAL( BDS_DELETE_ALMANAC ), - NAME_VAL( GPS_DELETE_ALL) + NAME_VAL( GPS_DELETE_TIME_GLO ) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From c828f0a56a6b778507de13c66568a096666c60c2 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 16 Jun 2014 14:01:33 -0700 Subject: [PATCH 244/945] Changes for GPS HAL compilation Remove dependence on android_runtime and return invalid value if gps daemon is not responding Change-Id: I16dbf1bffe6193114c1da08730f0627377179a2a --- core/ContextBase.cpp | 6 +++--- core/MsgTask.cpp | 1 - loc_api/libloc_api_50001/Android.mk | 2 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 2 +- utils/Android.mk | 1 - 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index c3cb532a..af329587 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -65,7 +65,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { + 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) { @@ -73,7 +73,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) 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); + locApi = (*getter)(mMsgTask,exMask, this); } } // only RPC is the option now @@ -85,7 +85,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) 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); + locApi = (*getter)(mMsgTask, exMask, this); } } } diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp index 4db992d9..5d375aa5 100644 --- a/core/MsgTask.cpp +++ b/core/MsgTask.cpp @@ -35,7 +35,6 @@ #include #include #include -#include namespace loc_core { diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 8f5d389b..50019b89 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -96,7 +96,7 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/libmdmdetect/inc LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_MODULE_RELATIVE_PATH := hw include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index 918ae220..c257dff4 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -137,7 +137,7 @@ static int loc_api_server_proc(void *context) free(p_cmsgbuf); LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); usleep(1000); - return 0; + return -1; } LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); diff --git a/utils/Android.mk b/utils/Android.mk index 07c1b1da..f34e1012 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -56,7 +56,6 @@ LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE From a857b72129514a9b2e757e35fcbceb6279e5dc13 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 23 Jun 2014 18:25:27 -0700 Subject: [PATCH 245/945] Add raw uncertainty to inject position api New qmi loc api v02 adds a raw uncertainty to the inject position api, which will be used by the geofence engine. Change-Id: I307619006c799c31121941ac5c11bf62f4691c86 CRs-fixed: 682963 --- loc_api/libloc_api_50001/loc.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 0a67477f..f9a2133a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -540,11 +540,6 @@ static int loc_inject_location(double latitude, double longitude, float accuracy { ENTRY_LOG(); - if (accuracy < 1000) - { - accuracy = 1000; - } - int ret_val = 0; ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); From fd8712acd22d2edb8936ffdd2f85b23241e08c82 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 27 May 2014 17:10:23 -0700 Subject: [PATCH 246/945] Add option to fallback to LocApiV02 In case the lbs or izat libs are not present, fall back to LocApiV02 to obtain the qmi client handle. This change will enable basic GPS functionality without lbs or izat lib dependencies CRs-fixed: 649065 Change-Id: Ic2c8418d785e891ad0a660a615cd5111fafc4ff2 --- core/ContextBase.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index e5a50140..9f6c4aab 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -66,14 +66,29 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { - // only RPC is the option now - void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { + 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 (NULL != getter) { + 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); + } + } + } } } From cd5c8489bc133e907d0a9057a16c944e99647710 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 16 Jun 2014 14:01:33 -0700 Subject: [PATCH 247/945] Changes for GPS HAL compilation Remove dependence on android_runtime and return invalid value if gps daemon is not responding CRs-fixed: 649065 Change-Id: I16dbf1bffe6193114c1da08730f0627377179a2a --- core/MsgTask.cpp | 1 - loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp index 4db992d9..5d375aa5 100644 --- a/core/MsgTask.cpp +++ b/core/MsgTask.cpp @@ -35,7 +35,6 @@ #include #include #include -#include namespace loc_core { diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index 918ae220..c257dff4 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -137,7 +137,7 @@ static int loc_api_server_proc(void *context) free(p_cmsgbuf); LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); usleep(1000); - return 0; + return -1; } LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); From c091f138efbfda2f9e27a66727e5983faf86fe56 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 26 Jun 2014 11:08:12 -0700 Subject: [PATCH 248/945] Add support for XTRA_VERSION_CHECK QMI LOC msg A new QMI LOC msg is introduced which injects into the modem a value that determines whether or not the version of XTRA is to be checked Change-Id: I0ef579332d064713ce73d80e66dc8c6fef1c1638 CRs-fixed: 649860 --- core/LocApiBase.cpp | 4 + core/LocApiBase.h | 8 ++ etc/gps.conf | 7 ++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 22 +++++ loc_api/libloc_api_50001/LocEngAdapter.h | 3 +- loc_api/libloc_api_50001/loc_eng.cpp | 101 ++++++++++----------- loc_api/libloc_api_50001/loc_eng.h | 32 +++---- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 58 ++++++++++-- 8 files changed, 158 insertions(+), 77 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 90f36531..97c282df 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -481,4 +481,8 @@ DEFAULT_IMPL(-1) 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) } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index bef03790..f489f63f 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -53,6 +53,13 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i setXtraVersionCheck(eCheck); + EXIT_LOG(%d, ret); + return ret; +} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 93f3dc29..a2170ad6 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -256,7 +256,7 @@ public: { return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); } - + enum loc_api_adapter_err setXtraVersionCheck(int check); virtual void handleEngineDownEvent(); virtual void handleEngineUpEvent(); virtual void reportPosition(UlpLocation &location, @@ -325,6 +325,7 @@ public: { return mLocApi->getGpsLock(); } + }; #endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 423f2c1d..320a61d8 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -118,17 +118,25 @@ static loc_param_s_type loc_parameter_table[] = {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, + {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, }; static void loc_default_parameters(void) { - /* defaults */ + /*Defaults for gps.conf*/ gps_conf.INTERMEDIATE_POS = 0; gps_conf.ACCURACY_THRES = 0; gps_conf.NMEA_PROVIDER = 0; gps_conf.SUPL_VER = 0x10000; 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; + /*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; @@ -141,26 +149,17 @@ static void loc_default_parameters(void) 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; - - /* 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; - /* default provider is SSC */ sap_conf.SENSOR_PROVIDER = 1; } @@ -1576,52 +1575,50 @@ 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; - if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { - LOC_LOGD("loc_eng_reinit reinit() successful"); + 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)); - LocEngAdapter* adapter = loc_eng_data.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)); - - /* 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))); + /* 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; } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index ff787da7..109d02d3 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -146,6 +146,7 @@ typedef struct loc_gps_cfg_s unsigned long LPP_PROFILE; uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; + unsigned long XTRA_VERSION_CHECK; } loc_gps_cfg_s_type; typedef struct @@ -177,6 +178,7 @@ typedef struct extern loc_gps_cfg_s_type gps_conf; extern loc_sap_cfg_s_type sap_conf; +//loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LOC_API_ADAPTER_EVENT_MASK_T event, @@ -196,6 +198,12 @@ 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, @@ -203,28 +211,18 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, 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); -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); - - void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, int avaiable, const char* apn); - -bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, - char* command, int length); - - -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); - -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, +//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, +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); -int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); - +//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, @@ -233,8 +231,6 @@ 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); -int loc_eng_read_config(void); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 45822867..7bb80839 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -82,6 +82,25 @@ struct LocEngInjectXtraData : public LocMsg { } }; +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 @@ -103,6 +122,7 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, { int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; + ENTRY_LOG(); if(callbacks == NULL) { LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); @@ -113,6 +133,7 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, ret_val = 0; } + EXIT_LOG(%d, ret_val); return ret_val; } @@ -126,8 +147,7 @@ DEPENDENCIES N/A RETURN VALUE - 0: success - >0: failure + 0 SIDE EFFECTS N/A @@ -136,9 +156,10 @@ SIDE EFFECTS 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; } /*=========================================================================== @@ -151,7 +172,7 @@ DEPENDENCIES N/A RETURN VALUE - length of server string + 0 SIDE EFFECTS N/A @@ -159,9 +180,34 @@ SIDE EFFECTS ===========================================================================*/ 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); } From 8977164eee956eed8f7b287e158ebddb4d2621dd Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sat, 19 Jul 2014 18:37:29 -0700 Subject: [PATCH 249/945] fixing the SSR recovery race condition There is a race condition where when startFix is called right at the time when modem or griffon subsystem is down, GPS HAL doesn't get the correct error code, and therefore the right handling. Mapped ENGINE_DOWN to ENGINE_OFFLINE, as they are the same; and modified loc_eng_start_handler to update the state upon the right error code. There is a one problem though. General failure is also handled as SSR. This is because of an unhandled race condition in the kernel, so the error code returned and propagated is not deterministic enough for us to tell if this is SSR. Until that fix is in place, we might have to treat general failure as SSR although the side effect should be none. Only semantically incorrect. Change-Id: If93823f08428275da171bb22d73a06e38365585b CR-Fixed: 692085 --- core/gps_extended_c.h | 5 +++-- loc_api/libloc_api_50001/loc_eng.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index d4a7dbea..04a78a31 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -306,8 +306,9 @@ enum loc_api_adapter_err { LOC_API_ADAPTER_ERR_TIMEOUT = 8, LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9, - LOC_API_ADAPTER_ERR_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, + /* 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 }; diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 320a61d8..b23df770 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1718,7 +1718,9 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) 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_ENGINE_DOWN || + ret_val == LOC_API_ADAPTER_ERR_PHONE_OFFLINE || + ret_val == LOC_API_ADAPTER_ERR_GENERAL_FAILURE) { loc_eng_data.adapter->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); From 33e5fd9015841f10711a920b0840ccc2e62b812a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sun, 20 Jul 2014 18:55:44 -0700 Subject: [PATCH 250/945] loc timer util fix to handle the race condition loc timer util stop() routine may have race condition with the timer thread, when timer expires at the same time stop() routine tries to lock mutex. The race condition can go 2 ways: * timer thread expires, unlocks mutex, context switch, stop() thread acquires lock, context switch, timer thread destroys mutex. Destroy will fail, resulting mutex leak. * timer thread expires, unlocks mutex, destroys mutex, stop() acqures lock, signal, and releases lock. Would be super rare conditions though. Fix is that we give 5 seconds for stop() thread to give up the lock when destroy. After that the timer thread will release the mutex and go on destroy. Meanwhile the stop() thread would check the lock return to move on with signal and unlock. Change-Id: Iff9e34d08a1faf0828049de2fede2e7a5d15b161 CRs-Fixed: 699856 --- utils/loc_timer.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/utils/loc_timer.c b/utils/loc_timer.c index 1e4008eb..2beca5fa 100644 --- a/utils/loc_timer.c +++ b/utils/loc_timer.c @@ -101,12 +101,28 @@ static void *timer_thread(void *thread_data) break; } - pthread_mutex_destroy(&t->timer_mutex); - pthread_cond_destroy(&t->timer_cond); - if(ETIMEDOUT == ret) t->callback_func(t->user_data, ret); + // A (should be rare) race condition is that, when the loc_time_stop is called + // and acquired mutex, we reach here. pthread_mutex_destroy will fail with + // error code EBUSY. We give it 6 tries in 5 seconds. Should be eanough time + // for loc_timer_stop to complete. With the 7th try, we also perform unlock + // prior to destroy. + { + int i; + for (i = 0; EBUSY == pthread_mutex_destroy(&t->timer_mutex) && i <= 5; i++) { + if (i < 5) { + sleep(1); + } else { + // nah, forget it, something is seriously wrong. Mutex has been + // held too long. Unlock the mutext here. + pthread_mutex_unlock(&t->timer_mutex); + } + } + } + pthread_cond_destroy(&t->timer_cond); + free(t); LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); return NULL; @@ -175,8 +191,8 @@ _err: void loc_timer_stop(void* handle) { timer_data* t = (timer_data*)handle; - if (NULL != t && (READY == t->state || WAITING == t->state)) { - pthread_mutex_lock(&(t->timer_mutex)); + if (NULL != t && (READY == t->state || WAITING == t->state) && + pthread_mutex_lock(&(t->timer_mutex)) == 0) { if (READY == t->state || WAITING == t->state) { pthread_cond_signal(&t->timer_cond); t->state = ABORT; From 6925f8a04aa0190638f311292cc69a41c81c905c Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 28 Jul 2014 16:58:06 -0700 Subject: [PATCH 251/945] Revert "Revert "Remove masks for Glonass"" This reverts commit 08237e52b67a06bb1ed35b5fb4a40aed8cd4c83a. Change-Id: I4e507ef8777d45825234914841562e7f2901bae0 --- core/gps_extended_c.h | 10 ---------- core/loc_core_log.cpp | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 63fe32a9..d4a7dbea 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -102,16 +102,6 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 1 #define AGPS_APN_BEARER_IPV4V6 2 -#define GPS_DELETE_ALMANAC_CORR 0x00001000 -#define GPS_DELETE_FREQ_BIAS_EST 0x00002000 -#define GPS_DELETE_EPHEMERIS_GLO 0x00004000 -#define GPS_DELETE_ALMANAC_GLO 0x00008000 -#define GPS_DELETE_SVDIR_GLO 0x00010000 -#define GPS_DELETE_SVSTEER_GLO 0x00020000 -#define GPS_DELETE_ALMANAC_CORR_GLO 0x00040000 -#define GPS_DELETE_TIME_GPS 0x00080000 -#define GPS_DELETE_TIME_GLO 0x00100000 - /** GPS extended callback structure. */ typedef struct { /** set to sizeof(GpsCallbacks) */ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 430f4b8e..d2eda661 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -118,13 +118,20 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_CELLDB_INFO ), NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GPS_DELETE_EPHEMERIS_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_GLO ), - NAME_VAL( GPS_DELETE_SVDIR_GLO ), - NAME_VAL( GPS_DELETE_SVSTEER_GLO ), - NAME_VAL( GPS_DELETE_ALMANAC_CORR_GLO ), + NAME_VAL( GLO_DELETE_EPHEMERIS ), + NAME_VAL( GLO_DELETE_ALMANAC ), + NAME_VAL( GLO_DELETE_SVDIR ), + NAME_VAL( GLO_DELETE_SVSTEER ), + NAME_VAL( GLO_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GPS_DELETE_TIME_GLO ) + NAME_VAL( GLO_DELETE_TIME ), + NAME_VAL( BDS_DELETE_SVDIR ), + NAME_VAL( BDS_DELETE_SVSTEER ), + NAME_VAL( BDS_DELETE_TIME ), + NAME_VAL( BDS_DELETE_ALMANAC_CORR ), + NAME_VAL( BDS_DELETE_EPHEMERIS ), + NAME_VAL( BDS_DELETE_ALMANAC ), + NAME_VAL( GPS_DELETE_ALL) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From 5cdfc25284b0eae255c4024f40513e621f4b9487 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 1 Nov 2013 15:58:07 -0700 Subject: [PATCH 252/945] agps cert install api implementation Implementation of the install agps certificate API for installing certificates at runtime. Change-Id: I49239b612381e81bd8a4c0a5773783572d4b2d9a --- core/LocApiBase.cpp | 6 ++ core/LocApiBase.h | 4 +- core/gps_extended_c.h | 3 + etc/gps.conf | 8 ++ loc_api/libloc_api_50001/LocEngAdapter.h | 6 ++ loc_api/libloc_api_50001/loc.cpp | 34 ++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 100 +++++++++++++++++++++++ loc_api/libloc_api_50001/loc_eng.h | 6 +- 8 files changed, 165 insertions(+), 2 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 97c282df..4d5355fd 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -478,6 +478,12 @@ int LocApiBase:: setGpsLock(unsigned int lock) DEFAULT_IMPL(-1) +void LocApiBase:: + installAGpsCert(const DerEncodedCertificate* pData, + size_t length, + uint32_t slotBitMask) +DEFAULT_IMPL() + int LocApiBase:: getGpsLock() DEFAULT_IMPL(-1) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f489f63f..b312937e 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -208,7 +208,9 @@ public: 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) {} /*Values for lock diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index d4a7dbea..20b7c406 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -68,6 +68,9 @@ extern "C" { /*Emergency SUPL*/ #define GPS_NI_TYPE_EMERGENCY_SUPL 4 +#define AGPS_CERTIFICATE_MAX_LENGTH 2000 +#define AGPS_CERTIFICATE_MAX_SLOTS 10 + typedef struct { /** set to sizeof(UlpLocation) */ size_t size; diff --git a/etc/gps.conf b/etc/gps.conf index 5a2a1761..678cbab1 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -64,6 +64,14 @@ CAPABILITIES=0x37 # 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 #################################### diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index a2170ad6..34d6d04e 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -257,6 +257,12 @@ public: return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); } 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, diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f9a2133a..0b3c943d 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -148,6 +148,18 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = 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 loc_eng_data_s_type loc_afw_data; static int gss_fd = -1; @@ -658,6 +670,10 @@ const void* loc_get_extension(const char* name) ret_val = get_geofence_interface(); } } + else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) + { + ret_val = &sLocEngAGpsCertInterface; + } else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); @@ -938,6 +954,24 @@ static void loc_agps_ril_update_network_availability(int available, const char* 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 local_loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 320a61d8..fc3121ab 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -119,6 +119,7 @@ static loc_param_s_type loc_parameter_table[] = {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, + {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'} }; static void loc_default_parameters(void) @@ -162,6 +163,9 @@ static void loc_default_parameters(void) 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; } // 2nd half of init(), singled out for @@ -1476,6 +1480,51 @@ struct LocEngDataClientInit : public LocMsg { } }; +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(); + } +}; /********************************************************************* * Initialization checking macros @@ -2446,6 +2495,57 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d 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; +} + + /*=========================================================================== FUNCTION loc_eng_report_status diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 109d02d3..99364cd3 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -147,6 +147,7 @@ typedef struct loc_gps_cfg_s uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; unsigned long XTRA_VERSION_CHECK; + unsigned long AGPS_CERT_WRITABLE_MASK; } loc_gps_cfg_s_type; typedef struct @@ -210,9 +211,11 @@ 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, @@ -231,6 +234,7 @@ 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); + #ifdef __cplusplus } #endif /* __cplusplus */ From 2abe41d44fd391b98a34507781e6856a2797a799 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 7 Aug 2014 18:12:38 -0700 Subject: [PATCH 253/945] Fix for CR 692085, error mapping incorrect in one of the cases eLOC_CLIENT_FAILURE_INTERNAL returned from loc_api_v02 was mapped to LOC_API_ADAPTER_ERR_FAILUR, however in loc_eng_start_handle it is LOC_API_ADAPTER_ERR_GENERAL_FAILURE that is being checked for. Created a new error ID LOC_API_ADAPTER_ERR_INTERNAL specifically for this error case. Change-Id: Ib2ad6e983d6c598ec57f1a2584166da2be95946b CRs-Fixed: 706520 --- core/gps_extended_c.h | 1 + loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 04a78a31..81e0fa00 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -305,6 +305,7 @@ enum loc_api_adapter_err { 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, diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index b23df770..1e8075f7 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1720,7 +1720,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) 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_GENERAL_FAILURE) + ret_val == LOC_API_ADAPTER_ERR_INTERNAL) { loc_eng_data.adapter->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); From 8cdb9cac41707c1ece2e9b5e18defc6399d0058a Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Sun, 24 Aug 2014 12:21:21 -0700 Subject: [PATCH 254/945] Use peripheral mgr to vote for modem power up/down Peripheral manager APIs are now used to vote for modem to be powered up when location is enabled and powered down when location is disabled. If peripheral manager is not supported, the powerup node will be opened and closed to vote CRs-fixed: 655587 Change-Id: I2b865ce1d88bf1a65e3c9b875f24d669579bc61e --- loc_api/libloc_api_50001/Android.mk | 6 +- loc_api/libloc_api_50001/loc.cpp | 139 ++++++++++++++++++++++------ 2 files changed, 116 insertions(+), 29 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 50019b89..484bcd65 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -75,7 +75,8 @@ LOCAL_SHARED_LIBRARIES := \ libloc_core \ libgps.utils \ libdl \ - libmdmdetect + libmdmdetect \ + libperipheral_client LOCAL_SRC_FILES += \ loc.cpp \ @@ -93,7 +94,8 @@ endif LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libmdmdetect/inc + $(TARGET_OUT_HEADERS)/libmdmdetect/inc \ + $(TARGET_OUT_HEADERS)/libperipheralclient/inc LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 0b3c943d..b3c267e6 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -53,6 +54,8 @@ extern "C" { #endif /* __cplusplus */ 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; @@ -127,9 +130,21 @@ const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; -// For shutting down MDM in fusion devices -static int mdm_fd = -1; +typedef struct { + //MAX_NAME_LEN defined in mdm_detect.h + char modem_name[MAX_NAME_LEN]; + //MAX_PATH_LEN defined in mdm_detect.h + char powerup_node[MAX_PATH_LEN]; + //this handle is used by peripheral mgr + void *handle; + int mdm_fd; + MdmType mdm_type; + bool peripheral_mgr_supported; + bool peripheral_mgr_registered; +}s_loc_mdm_info; +static s_loc_mdm_info loc_mdm_info; +static void loc_pm_event_notifier(void *client_data, enum pm_event event); 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); @@ -262,7 +277,10 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; - int i = 0; + enum pm_event mdm_state; + static int mdm_index = -1; + int peripheral_mgr_ret = PM_RET_FAILED; + ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -311,7 +329,11 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->setPowerVote(true); LOC_LOGD("loc_eng_init() success!"); - if (mdm_fd < 0) { + + //if index is 0 or more, then we've looked for mdm already + LOC_LOGD("%s:%d]: mdm_index: %d", __func__, __LINE__, + mdm_index); + if (mdm_index < 0) { struct dev_info modem_info; memset(&modem_info, 0, sizeof(struct dev_info)); if(get_system_info(&modem_info) != RET_SUCCESS) { @@ -319,26 +341,76 @@ static int loc_init(GpsCallbacks* callbacks) __func__, __LINE__); goto err; } - for(i=0; i= 0) { + if(loc_mdm_info.peripheral_mgr_supported == true) { + LOC_LOGD("%s:%d]: Voting for modem power down", __func__, __LINE__); + pm_client_disconnect(loc_mdm_info.handle); + } + else if (loc_mdm_info.mdm_fd >= 0) { LOC_LOGD("closing the powerup node"); - close(mdm_fd); - mdm_fd = -1; + close(loc_mdm_info.mdm_fd); + loc_mdm_info.mdm_fd = -1; LOC_LOGD("finished closing the powerup node"); - } else { + } + else { LOC_LOGD("powerup node has not been opened yet."); } @@ -994,3 +1071,11 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) } EXIT_LOG(%s, VOID_RET); } + +static void loc_pm_event_notifier(void *client_data, enum pm_event event) +{ + ENTRY_LOG(); + LOC_LOGD("%s:%d]: event: %d", __func__, __LINE__, (int)event); + pm_client_event_acknowledge(loc_mdm_info.handle, event); + EXIT_LOG(%s, VOID_RET); +} From 06ccada997650f207a206fd4e2f96c362d0663f0 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 26 Aug 2014 10:00:44 -0700 Subject: [PATCH 255/945] add support for apq8026_lw LW gets a stripped down feature set Change-Id: If46a2e369e8bc8adb33629a0d0bccffb60da9d10 --- core/Android.mk | 4 ++++ core/loc_core_log.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/core/Android.mk b/core/Android.mk index 3e2b2eb8..e076dcc4 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -10,6 +10,10 @@ LOCAL_MODULE_OWNER := qcom LOCAL_MODULE_TAGS := optional +ifeq ($(TARGET_DEVICE),apq8026_lw) +LOCAL_CFLAGS += -DPDK_FEATURE_SET +endif + LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index d2eda661..1b220104 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -116,6 +116,7 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), NAME_VAL( GPS_DELETE_CELLDB_INFO ), +#ifndef PDK_FEATURE_SET NAME_VAL( GPS_DELETE_ALMANAC_CORR ), NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), NAME_VAL( GLO_DELETE_EPHEMERIS ), @@ -131,6 +132,7 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( BDS_DELETE_ALMANAC_CORR ), NAME_VAL( BDS_DELETE_EPHEMERIS ), NAME_VAL( BDS_DELETE_ALMANAC ), +#endif NAME_VAL( GPS_DELETE_ALL) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From 5cef7caea34d49a0a6989fa87d322b333f7332c5 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Tue, 19 Aug 2014 18:44:33 -0700 Subject: [PATCH 256/945] Migrating XTRA from gpsonextra.net to cloud based izatcloud.net *Added logic to remove xtra1.gpsonextra.net from URLs received from modem. *Added logic to override modem URLs with those configured in gps.conf *Replaced all instances of xtra{1,2,3}.gpsonextra.net domain URLs in gps.conf with xtrapath{1,2,3}.izatcloud.net URLs. *Replaced all commented instances of xtra.bin in gps.conf with xtra2.bin. CRs-fixed: 643816 Change-Id: I803b26bce22f06910dcaa1ee057902b9381667bf --- etc/gps.conf | 6 ++--- loc_api/libloc_api_50001/loc_eng.cpp | 35 ++++++++++++++++++++++++---- loc_api/libloc_api_50001/loc_eng.h | 7 +++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 5a2a1761..ccc34837 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,8 +1,8 @@ #Uncommenting these urls would only enable #the power up auto injection and force injection(test case). -#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin +#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin +#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin #Version check for XTRA #DISABLE = 0 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1e8075f7..d7c62e31 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -44,7 +44,7 @@ #include #include #include - +#include #include #include @@ -84,6 +84,8 @@ #define SAP_CONF_FILE "/etc/sap.conf" #endif +#define XTRA1_GPSONEXTRA "xtra1.gpsonextra.net" + using namespace loc_core; boolean configAlreadyRead = false; @@ -119,6 +121,9 @@ static loc_param_s_type loc_parameter_table[] = {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, 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'} }; static void loc_default_parameters(void) @@ -928,12 +933,34 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, LocMsg(), mLocEng(locEng), mMaxLen(maxlength), mServers(new char[3*(mMaxLen+1)]) { + char * cptr = mServers; memset(mServers, 0, 3*(mMaxLen+1)); - strlcpy(mServers, url1, mMaxLen); - strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen); - strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen); + + // 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); diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 109d02d3..ad40606e 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -67,6 +67,8 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 +#define MAX_XTRA_SERVER_URL_LENGTH 256 + enum loc_nmea_provider_e_type { NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA NMEA_PROVIDER_MP // Modem Processor Provider of NMEA @@ -147,6 +149,9 @@ typedef struct loc_gps_cfg_s uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; unsigned long 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]; } loc_gps_cfg_s_type; typedef struct From f78f2857219a1281abb25a44e3f0ab8beb5c6c7f Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Sun, 14 Sep 2014 23:24:22 -0700 Subject: [PATCH 257/945] Vote for modem power only on select targets Since libmdmdetect and peripheral manager are not available on all targets, added compilation flags to use these APIs only on supported targets Change-Id: I404e3273718dc7f9e6475f5a1d2c2f0b010cb33f --- loc_api/libloc_api_50001/Android.mk | 20 ++++++++++++++++---- loc_api/libloc_api_50001/loc.cpp | 19 +++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 484bcd65..27c53cf2 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -74,9 +74,10 @@ LOCAL_SHARED_LIBRARIES := \ libloc_eng \ libloc_core \ libgps.utils \ - libdl \ - libmdmdetect \ - libperipheral_client + libdl + +ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) +endif LOCAL_SRC_FILES += \ loc.cpp \ @@ -93,9 +94,20 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libloc_core + +ifeq ($(filter $(TARGET_DEVICE), apq8064 msm8960),) +$(call print-vars, $(TARGET_DEVICE)) +LOCAL_SHARED_LIBRARIES += \ + libmdmdetect \ + libperipheral_client + +LOCAL_C_INCLUDES += \ $(TARGET_OUT_HEADERS)/libmdmdetect/inc \ $(TARGET_OUT_HEADERS)/libperipheralclient/inc +LOCAL_CFLAGS += \ + -DMODEM_POWER_VOTE +endif LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index b3c267e6..2b604ede 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -44,6 +44,8 @@ #include #include #include + +#ifdef MODEM_POWER_VOTE #include #ifdef __cplusplus extern "C" { @@ -52,6 +54,8 @@ extern "C" { #ifdef __cplusplus } #endif /* __cplusplus */ +#endif /*MODEM_POWER_VOTE*/ + using namespace loc_core; #define LOC_PM_CLIENT_NAME "GPS" @@ -130,6 +134,7 @@ const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; +#ifdef MODEM_POWER_VOTE typedef struct { //MAX_NAME_LEN defined in mdm_detect.h char modem_name[MAX_NAME_LEN]; @@ -142,9 +147,10 @@ typedef struct { bool peripheral_mgr_supported; bool peripheral_mgr_registered; }s_loc_mdm_info; - static s_loc_mdm_info loc_mdm_info; static void loc_pm_event_notifier(void *client_data, enum pm_event event); +#endif /*MODEM_POWER_VOTE*/ + 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); @@ -277,10 +283,11 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; +#ifdef MODEM_POWER_VOTE enum pm_event mdm_state; static int mdm_index = -1; int peripheral_mgr_ret = PM_RET_FAILED; - +#endif /*MODEM_POWER_VOTE*/ ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -330,6 +337,7 @@ static int loc_init(GpsCallbacks* callbacks) LOC_LOGD("loc_eng_init() success!"); +#ifdef MODEM_POWER_VOTE //if index is 0 or more, then we've looked for mdm already LOC_LOGD("%s:%d]: mdm_index: %d", __func__, __LINE__, mdm_index); @@ -412,7 +420,7 @@ static int loc_init(GpsCallbacks* callbacks) else { LOC_LOGD("%s:%d]: Not voted for modem power up due to errors", __func__, __LINE__); } - +#endif /*MODEM_POWER_VOTE*/ err: EXIT_LOG(%d, retVal); return retVal; @@ -437,6 +445,7 @@ SIDE EFFECTS static void loc_close_mdm_node() { ENTRY_LOG(); +#ifdef MODEM_POWER_VOTE if(loc_mdm_info.peripheral_mgr_supported == true) { LOC_LOGD("%s:%d]: Voting for modem power down", __func__, __LINE__); pm_client_disconnect(loc_mdm_info.handle); @@ -450,7 +459,7 @@ static void loc_close_mdm_node() else { LOC_LOGD("powerup node has not been opened yet."); } - +#endif /*MODEM_POWER_VOTE*/ EXIT_LOG(%s, VOID_RET); } @@ -1072,6 +1081,7 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } +#ifdef MODEM_POWER_VOTE static void loc_pm_event_notifier(void *client_data, enum pm_event event) { ENTRY_LOG(); @@ -1079,3 +1089,4 @@ static void loc_pm_event_notifier(void *client_data, enum pm_event event) pm_client_event_acknowledge(loc_mdm_info.handle, event); EXIT_LOG(%s, VOID_RET); } +#endif /*MODEM_POWER_VOTE*/ From fab550522a9dc03590e419a1b8795c2be1860a5c Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Thu, 11 Sep 2014 17:06:23 -0700 Subject: [PATCH 258/945] Ignore the first time inject if it is form Afw. The first time injection is ignored from an adapter that doesn't support CPI Extended Capabilities to prevent time from being injected twice on startup. CRs-fixed: 720540 Change-Id: If786cf2c750906093f21272aae928e4d9fc4dea8 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 22 +++++++++++++++++++++- loc_api/libloc_api_50001/LocEngAdapter.h | 9 ++++----- loc_api/libloc_api_50001/loc.cpp | 1 + 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1327a53a..1043fe82 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -70,7 +70,9 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), mSupportsAgpsRequests(false), - mSupportsPositionInjection(false), mPowerVote(0) + mSupportsPositionInjection(false), + mSupportsTimeInjection(false), + mPowerVote(0) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -341,6 +343,24 @@ 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); + } else { + mSupportsTimeInjection = true; + } + return result; +} + enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) { enum loc_api_adapter_err ret; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index a2170ad6..b9bbedd0 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -85,6 +85,7 @@ class LocEngAdapter : public LocAdapterBase { public: bool mSupportsAgpsRequests; bool mSupportsPositionInjection; + bool mSupportsTimeInjection; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, @@ -136,11 +137,6 @@ public: { return mLocApi->injectPosition(latitude, longitude, accuracy); } - inline enum loc_api_adapter_err - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) - { - return mLocApi->setTime(time, timeReference, uncertainty); - } inline enum loc_api_adapter_err setXtraData(char* data, int length) { @@ -256,6 +252,9 @@ public: { 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); virtual void handleEngineDownEvent(); virtual void handleEngineUpEvent(); diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f9a2133a..73663880 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -289,6 +289,7 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); 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(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); From f1ddcf02a341e35ad8e66e7be9472d0802bf342e Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 28 Jul 2014 14:11:14 -0700 Subject: [PATCH 259/945] Increase the size of string to hold parameter name Some parameter names are more than 48 char in length. Accomodate by increasing parameter name buffer size and increase complete line buffer size. CRs-Fixed: 700902 Change-Id: If2af7288ed11fdd668dc1cad8e60f2c92e7b3c30 --- utils/loc_cfg.cpp | 1 - utils/loc_cfg.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index abf8086c..dc8e3a74 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -280,7 +280,6 @@ void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, uint32_t table_length) { FILE *gps_conf_fp = NULL; - char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ char *lasts; loc_param_v_type config_value; uint32_t i; diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 268f4c24..f575f713 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -33,9 +33,9 @@ #include #include -#define LOC_MAX_PARAM_NAME 48 +#define LOC_MAX_PARAM_NAME 80 #define LOC_MAX_PARAM_STRING 80 -#define LOC_MAX_PARAM_LINE 80 +#define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) #define UTIL_READ_CONF_DEFAULT(filename) \ loc_read_conf((filename), NULL, 0); From 9d0c2d5627206ee3534d1712b4c2c17758da2b2b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 18 Sep 2014 17:18:36 -0700 Subject: [PATCH 260/945] Remove reduntant clearing of GpsLocation memory GpsLocation memory will now be cleared inside the Loc Api handler itself, so no need to do it a second time before calling into the Loc Api handler. Change-Id: Iec37624621d6eb4806eb8e13c807bb4e40584e39 CRs-fixed: 726800 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1e8075f7..54bc75d1 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1981,7 +1981,6 @@ static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data) GpsLocationExtended locationExtended; memset(&locationExtended, 0, sizeof (GpsLocationExtended)); locationExtended.size = sizeof(locationExtended); - memset(&location, 0, sizeof location); ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask); //Mark the location source as from ZPP From a55881f51be3d817c1214956a72f3cf439924ffe Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 16 Sep 2014 11:52:27 -0700 Subject: [PATCH 261/945] Use regular ATL callflow for SUPL ES Added a new gps.conf parameter which can be used to decide whether or not to use data services to bring up call using emergency PDN or use default SUPL PDN Change-Id: I604a1489e66339eb2c27019dafab640f7a15cd84 CRs-fixed: 685639 --- etc/gps.conf | 5 +++++ loc_api/libloc_api_50001/loc_eng.cpp | 24 ++++++++++++++++++++---- loc_api/libloc_api_50001/loc_eng.h | 1 + 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index ccc34837..a60230e6 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -39,6 +39,11 @@ SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable SUPL_ES=1 +#Choose PDN for Emergency SUPL +#1 - Use emergency PDN +#0 - Use regular SUPL PDN for Emergency SUPL +USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 + # GPS Capabilities bit mask # SCHEDULING = 0x01 # MSB = 0x02 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c8b7dd8a..b6a6b2e6 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -101,6 +101,7 @@ static loc_param_s_type loc_parameter_table[] = {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, + {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, {"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'}, @@ -140,6 +141,8 @@ static void loc_default_parameters(void) 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; /*Defaults for sap.conf*/ sap_conf.GYRO_BIAS_RANDOM_WALK = 0; @@ -1104,7 +1107,17 @@ void LocEngRequestSuplEs::proc() const { AgpsStateMachine* sm = locEng->ds_nif; DSSubscriber s(sm, mID); sm->subscribeRsrc((Subscriber*)&s); - } else { + } + 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); } } @@ -2142,8 +2155,9 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call false); if (adapter->mSupportsAgpsRequests) { - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - + if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + } loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); } @@ -2175,7 +2189,9 @@ getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { break; } case AGPS_TYPE_SUPL_ES: { - stateMachine = locEng.ds_nif; + locEng.ds_nif ? + stateMachine = locEng.ds_nif: + stateMachine = locEng.agnss_nif; break; } default: diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index ad40606e..ab945e78 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -152,6 +152,7 @@ typedef struct loc_gps_cfg_s 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]; + unsigned long USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; } loc_gps_cfg_s_type; typedef struct From 79c877db2447b8e08560fa01a5a825ebbb2f58ee Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Mon, 1 Sep 2014 19:07:58 -0700 Subject: [PATCH 262/945] Checking messages supported or not When device boots up, get a list of message supported by modem, based on which some adapeters will be able to update register masks. CRs-fixed: 601349 Change-Id: I6af282f8e551f1f3c6bf8795e968fdbc7b0a9fa3 --- core/LocAdapterBase.h | 14 ++++++++++++-- core/LocAdapterProxyBase.h | 7 ++++++- core/LocApiBase.cpp | 13 ++++++++++++- core/LocApiBase.h | 11 +++++++++++ core/gps_extended_c.h | 11 +++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 9348a89c..2fec3128 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -39,14 +39,15 @@ class LocAdapterProxyBase; class LocAdapterBase { protected: - const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + 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) {} + 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, @@ -68,6 +69,15 @@ public: 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(); + } + // This will be overridden by the individual adapters // if necessary. inline virtual void setUlpProxy(UlpProxyBase* ulp) {} diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 25af10be..df5a48bd 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -37,7 +37,7 @@ namespace loc_core { class LocAdapterProxyBase { private: - const LocAdapterBase *mLocAdapterBase; + LocAdapterBase *mLocAdapterBase; protected: inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context): @@ -49,6 +49,11 @@ protected: ContextBase* getContext() const { return mLocAdapterBase->getContext(); } + inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) { + mLocAdapterBase->updateEvtMask(event,isEnabled); + } + public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 97c282df..5c9380bd 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -128,7 +128,8 @@ struct LocOpenMsg : public LocMsg { LocApiBase::LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : - mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0), mContext(context) + mExcludedMask(excludedMask), mMsgTask(msgTask), + mMask(0), mSupportedMsg(0), mContext(context) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } @@ -203,6 +204,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) } } +void LocApiBase::updateEvtMask() +{ + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); +} + void LocApiBase::handleEngineUpEvent() { // This will take care of renegotiating the loc handle @@ -322,6 +328,11 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) +{ + mSupportedMsg = supportedMsgList; +} + void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f489f63f..5da6b6d1 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -80,6 +80,7 @@ class LocApiBase { const MsgTask* mMsgTask; ContextBase *mContext; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; + uint64_t mSupportedMsg; protected: virtual enum loc_api_adapter_err @@ -128,6 +129,7 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); + void saveSupportedMsgList(uint64_t supportedMsgList); // downward calls // All below functions are to be defined by adapter specific modules: @@ -210,6 +212,15 @@ public: virtual void closeDataCall(); inline virtual void setInSession(bool inSession) {} + inline bool isMessageSupported (LocCheckingMessagesID msgID) const { + if (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 diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 81e0fa00..44ff5ae8 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -68,6 +68,11 @@ extern "C" { /*Emergency SUPL*/ #define GPS_NI_TYPE_EMERGENCY_SUPL 4 +enum loc_registration_mask_status { + LOC_REGISTRATION_MASK_ENABLED, + LOC_REGISTRATION_MASK_DISABLED +}; + typedef struct { /** set to sizeof(UlpLocation) */ size_t size; @@ -365,6 +370,12 @@ enum loc_api_adapter_event_index { typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; +typedef enum loc_api_adapter_msg_to_check_supported { + LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching + LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH, // Geofence Batched Breach + + LOC_API_ADAPTER_MESSAGE_MAX +} LocCheckingMessagesID; #ifdef __cplusplus } From 90378134eafcc137c157a40f92561d69cbf01a7a Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Mon, 1 Sep 2014 19:07:58 -0700 Subject: [PATCH 263/945] Checking messages supported or not When device boots up, get a list of message supported by modem, based on which some adapeters will be able to update register masks. CRs-fixed: 601349 Change-Id: I6af282f8e551f1f3c6bf8795e968fdbc7b0a9fa3 --- core/LocAdapterBase.h | 14 ++++++++++++-- core/LocAdapterProxyBase.h | 7 ++++++- core/LocApiBase.cpp | 13 ++++++++++++- core/LocApiBase.h | 11 +++++++++++ core/gps_extended_c.h | 11 +++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 9348a89c..2fec3128 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -39,14 +39,15 @@ class LocAdapterProxyBase; class LocAdapterBase { protected: - const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + 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) {} + 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, @@ -68,6 +69,15 @@ public: 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(); + } + // This will be overridden by the individual adapters // if necessary. inline virtual void setUlpProxy(UlpProxyBase* ulp) {} diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 25af10be..df5a48bd 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -37,7 +37,7 @@ namespace loc_core { class LocAdapterProxyBase { private: - const LocAdapterBase *mLocAdapterBase; + LocAdapterBase *mLocAdapterBase; protected: inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context): @@ -49,6 +49,11 @@ protected: ContextBase* getContext() const { return mLocAdapterBase->getContext(); } + inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) { + mLocAdapterBase->updateEvtMask(event,isEnabled); + } + public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4d5355fd..141fab6d 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -128,7 +128,8 @@ struct LocOpenMsg : public LocMsg { LocApiBase::LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : - mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0), mContext(context) + mExcludedMask(excludedMask), mMsgTask(msgTask), + mMask(0), mSupportedMsg(0), mContext(context) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } @@ -203,6 +204,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) } } +void LocApiBase::updateEvtMask() +{ + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); +} + void LocApiBase::handleEngineUpEvent() { // This will take care of renegotiating the loc handle @@ -322,6 +328,11 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) +{ + mSupportedMsg = supportedMsgList; +} + void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index b312937e..af9d270c 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -80,6 +80,7 @@ class LocApiBase { const MsgTask* mMsgTask; ContextBase *mContext; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; + uint64_t mSupportedMsg; protected: virtual enum loc_api_adapter_err @@ -128,6 +129,7 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); + void saveSupportedMsgList(uint64_t supportedMsgList); // downward calls // All below functions are to be defined by adapter specific modules: @@ -212,6 +214,15 @@ public: size_t length, uint32_t slotBitMask); inline virtual void setInSession(bool inSession) {} + inline bool isMessageSupported (LocCheckingMessagesID msgID) const { + if (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 diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 6ed73129..33906b51 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -71,6 +71,11 @@ extern "C" { #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 struct { /** set to sizeof(UlpLocation) */ size_t size; @@ -368,6 +373,12 @@ enum loc_api_adapter_event_index { typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; +typedef enum loc_api_adapter_msg_to_check_supported { + LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching + LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH, // Geofence Batched Breach + + LOC_API_ADAPTER_MESSAGE_MAX +} LocCheckingMessagesID; #ifdef __cplusplus } From fb9c641bb869301c9b3728608870673693ff593f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 10 Oct 2014 10:35:28 -0700 Subject: [PATCH 264/945] Added Detection Logic For QMI_PDS Target. Added run time detection of PDS enabled fusion target to loc_target(), to support fusion platforms that has PDS service enabled. Change-Id: Ic53df027540f00eec9259776351b6bbc9afa0521 CRs-Fixed: 699757 --- utils/loc_target.cpp | 9 +++++++-- utils/loc_target.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d46747ac..8dbe885e 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -46,6 +46,7 @@ #define MSM8930_ID_2 "116" #define APQ8030_ID_1 "157" #define APQ8074_ID_1 "184" +#define PDS_ID_1 "178" #define LINE_LEN 100 #define STR_LIQUID "Liquid" @@ -206,8 +207,12 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ + if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1)) + && IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) ) + gTarget = TARGET_PDS; + } + else 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_MPQ; diff --git a/utils/loc_target.h b/utils/loc_target.h index 9aa525fc..208a34cb 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -35,6 +35,7 @@ #define TARGET_MPQ 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_PDS TARGET_SET(GNSS_PDS, NO_SSC) #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) @@ -60,6 +61,7 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, + GNSS_PDS, GNSS_UNKNOWN }GNSS_TARGET; From 0b0b89fbd646ab05433a12ed1cced5e240cad277 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 14 Nov 2012 11:32:40 -0800 Subject: [PATCH 265/945] Add buffer length check for XTRA data To prevent reading beyond the length of the buffer that contains XTRA data, a check has been introduced assuming an approximate limit for the size of the data Change-Id: I7e05beadec76c3308448b9198fd23c8e8b97394d CRs-fixed: 420623 --- loc_api/libloc_api_50001/loc.cpp | 8 ++++++-- loc_api/libloc_api_50001/loc.h | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f9a2133a..65e1bf16 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -855,8 +855,12 @@ SIDE EFFECTS static int loc_xtra_inject_data(char* data, int length) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); - + 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; } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 7e268273..63528664 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -39,6 +39,8 @@ extern "C" { #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); From e6a851c191f269d551730afc9b195a318b1852cd Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 28 Aug 2014 12:34:45 -0700 Subject: [PATCH 266/945] adding update config post power up Some of the parameters configured in gps.conf may be carrier dependent. This provides a mechanism so that GpsLocationProvider can determine current operator resolve of the carrier specific configurations and update HAL with those configurations post init. Bug: 17110478 CRs-fixed: 736966 Change-Id: I80aa4404da7666824335fee074dae2ffcba40548 --- loc_api/libloc_api_50001/loc.cpp | 21 ++- loc_api/libloc_api_50001/loc_eng.cpp | 24 ++++ loc_api/libloc_api_50001/loc_eng.h | 51 +++---- utils/loc_cfg.cpp | 198 ++++++++++++++++++++------- utils/loc_cfg.h | 17 ++- 5 files changed, 230 insertions(+), 81 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 159649b6..5b57635b 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -127,7 +127,7 @@ static const GpsXtraInterface sLocEngXTRAInterface = static void loc_ni_init(GpsNiCallbacks *callbacks); static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); -const GpsNiInterface sLocEngNiInterface = +static const GpsNiInterface sLocEngNiInterface = { sizeof(GpsNiInterface), loc_ni_init, @@ -181,6 +181,14 @@ static const SuplCertificateInterface sLocEngAGpsCertInterface = 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; @@ -761,6 +769,10 @@ const void* loc_get_extension(const char* name) { ret_val = &sLocEngAGpsCertInterface; } + else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) + { + ret_val = &sLocEngConfigInterface; + } else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); @@ -1059,6 +1071,13 @@ static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* finger 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); + EXIT_LOG(%s, VOID_RET); +} + static void local_loc_cb(UlpLocation* location, void* locExt) { ENTRY_LOG(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 4977100c..e02ae1e5 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2589,6 +2589,30 @@ int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, 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(); + INIT_CHECK(loc_eng_data.adapter, return); + + if (config_data && length > 0) { + loc_gps_cfg_s_type gps_conf_old = gps_conf; + UTIL_UPDATE_CONF(config_data, length, loc_parameter_table); + LocEngAdapter* adapter = loc_eng_data.adapter; + if (gps_conf_old.SUPL_VER != gps_conf.SUPL_VER) { + adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); + } + if (gps_conf_old.LPP_PROFILE != gps_conf.LPP_PROFILE) { + adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); + } + if (gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + } + } + + EXIT_LOG(%s, VOID_RET); +} /*=========================================================================== FUNCTION loc_eng_report_status diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 4882b6ff..6ef3336f 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -141,36 +141,36 @@ typedef struct loc_eng_data_s /* GPS.conf support */ typedef struct loc_gps_cfg_s { - unsigned long INTERMEDIATE_POS; - unsigned long ACCURACY_THRES; - unsigned long SUPL_VER; - unsigned long CAPABILITIES; - unsigned long LPP_PROFILE; + uint32_t INTERMEDIATE_POS; + uint32_t ACCURACY_THRES; + uint32_t SUPL_VER; + uint32_t CAPABILITIES; + uint32_t LPP_PROFILE; uint8_t NMEA_PROVIDER; - unsigned long A_GLONASS_POS_PROTOCOL_SELECT; - unsigned long 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]; - unsigned long AGPS_CERT_WRITABLE_MASK; - unsigned long USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; + 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 A_GLONASS_POS_PROTOCOL_SELECT; + uint32_t AGPS_CERT_WRITABLE_MASK; } loc_gps_cfg_s_type; typedef struct { uint8_t GYRO_BIAS_RANDOM_WALK_VALID; double GYRO_BIAS_RANDOM_WALK; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_CONTROL_MODE; - unsigned long SENSOR_USAGE; - unsigned long SENSOR_ALGORITHM_CONFIG_MASK; + 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; @@ -179,7 +179,7 @@ typedef struct double RATE_RANDOM_WALK_SPECTRAL_DENSITY; uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID; double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY; - unsigned long SENSOR_PROVIDER; + uint32_t SENSOR_PROVIDER; } loc_sap_cfg_s_type; extern loc_gps_cfg_s_type gps_conf; @@ -241,6 +241,9 @@ extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, 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); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index dc8e3a74..b4b3ded4 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -56,12 +56,12 @@ static uint8_t DEBUG_LEVEL = 0xff; static uint8_t TIMESTAMP = 0; /* Parameter spec table */ -static loc_param_s_type loc_parameter_table[] = +static loc_param_s_type loc_param_table[] = { {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; -int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); +int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); typedef struct loc_param_v_type { @@ -117,7 +117,8 @@ int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* confi LOC_MAX_PARAM_STRING + 1); } /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, config_entry->param_name, (char*)config_entry->param_ptr); + LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, + config_entry->param_name, (char*)config_entry->param_ptr); if(NULL != config_entry->param_set) { @@ -128,7 +129,8 @@ int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* confi 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); + LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, + config_entry->param_name, config_value->param_int_value); if(NULL != config_entry->param_set) { @@ -139,7 +141,8 @@ int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* confi 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); + LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, + config_entry->param_name, config_value->param_double_value); if(NULL != config_entry->param_set) { @@ -148,12 +151,85 @@ int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* confi ret = 0; break; default: - LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); + 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: No config or incomplete config or invalid parameter + 1: Filled a record + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_fill_conf_item(char* input_buf, + 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) @@ -185,10 +261,6 @@ SIDE EFFECTS ===========================================================================*/ int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length) { - char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ - char *lasts; - loc_param_v_type config_value; - uint32_t i; int ret=0; unsigned int num_params=table_length; @@ -199,13 +271,16 @@ int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t tabl } /* Clear all validity bits */ - for(i = 0; NULL != config_table && i < table_length; i++) + 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) { @@ -214,46 +289,67 @@ int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t tabl break; } - 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 == NULL) continue; - config_value.param_str_value = strtok_r(NULL, "=", &lasts); - /* skip lines that do not contain two operands */ - if (config_value.param_str_value == NULL) continue; - - /* 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(i = 0; NULL != config_table && i < table_length; i++) - { - if(!loc_set_config_entry(&config_table[i], &config_value)) { - num_params--; - } - } + 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, + 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); + 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); + } + } + + return ret; +} + /*=========================================================================== FUNCTION loc_read_conf @@ -279,20 +375,20 @@ SIDE EFFECTS void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, uint32_t table_length) { - FILE *gps_conf_fp = NULL; + FILE *conf_fp = NULL; char *lasts; loc_param_v_type config_value; uint32_t i; - if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) + 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(gps_conf_fp, config_table, table_length); - rewind(gps_conf_fp); + loc_read_conf_r(conf_fp, config_table, table_length); + rewind(conf_fp); } - loc_read_conf_r(gps_conf_fp, loc_parameter_table, loc_param_num); - fclose(gps_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/utils/loc_cfg.h b/utils/loc_cfg.h index f575f713..ea4865b9 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -37,11 +37,15 @@ #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])) + loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) /*============================================================================= * @@ -73,10 +77,13 @@ extern "C" { * MODULE EXPORTED FUNCTIONS * *============================================================================*/ -extern void loc_read_conf(const char* conf_file_name, - loc_param_s_type* config_table, - uint32_t table_length); -extern int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length); +void loc_read_conf(const char* conf_file_name, + loc_param_s_type* config_table, + uint32_t table_length); +int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, + uint32_t table_length); +int loc_update_conf(const char* conf_data, int32_t length, + loc_param_s_type* config_table, uint32_t table_length); #ifdef __cplusplus } #endif From 809dec4e92deee31551fae7dc9754daf80d20697 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 3 Sep 2014 10:00:50 -0700 Subject: [PATCH 267/945] allow reconfiguration update happen before HAL init currently HAL does not allow gps paremeter reconfiguration before HAL init. This change allows that. The new config items will be cached only. Upon HAL init, the parameters that interest modem will be injected. Bug: 17110478 CRs-fixed: 736966 Change-Id: Ie8d180a0ed6a35776f1ee0342f88dfc010ec2746 --- loc_api/libloc_api_50001/loc_eng.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index e02ae1e5..c40a593c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2593,21 +2593,24 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, const char* config_data, int32_t length) { ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return); if (config_data && length > 0) { loc_gps_cfg_s_type gps_conf_old = gps_conf; UTIL_UPDATE_CONF(config_data, length, loc_parameter_table); LocEngAdapter* adapter = loc_eng_data.adapter; - if (gps_conf_old.SUPL_VER != gps_conf.SUPL_VER) { - adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); - } - if (gps_conf_old.LPP_PROFILE != gps_conf.LPP_PROFILE) { - adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); - } - if (gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + + // it is possible that HAL is not init'ed at this time + if (adapter) { + if (gps_conf_old.SUPL_VER != gps_conf.SUPL_VER) { + adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); + } + if (gps_conf_old.LPP_PROFILE != gps_conf.LPP_PROFILE) { + adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); + } + if (gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + } } } From af2762ceca5cf9f99120ab5d1a6971fa1c3b5901 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 11 Sep 2014 12:19:14 -0700 Subject: [PATCH 268/945] GPS_LOCK configuration support GPS_LOCK is defined as a bit mask in the higher layer defined in gps.conf. GPS HAL reads from gps.conf, yet this can be reconfigured by gps.h defined new API to a different value. The current value will be used at cleanup() time, to optionally lock gps modem to the configured mode. This changs also sets SUPL URL to NULL if hostname comes with set_server() API is a NULL string. Also optimized configuration_update() implementation so that no all items will go through the reconfigu scan. Also added SUPL_MODE as a parameter in gps.conf which can be uncommented to over-write the value from config.xml. This can be used for testing purposes Bug: 16131208 Bug: 17288144 CRs-fixed: 736966 Change-Id: I12a89b12ff82b6efd7b5567d2fcd6a7e79414c71 --- core/LocApiBase.cpp | 2 +- core/LocApiBase.h | 2 +- core/gps_extended_c.h | 6 +++ etc/gps.conf | 14 ++++++ .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 3 +- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 20 +++++++-- loc_api/libloc_api_50001/LocEngAdapter.cpp | 37 +++++++++------- loc_api/libloc_api_50001/LocEngAdapter.h | 5 ++- loc_api/libloc_api_50001/loc_eng.cpp | 44 +++++++++++++++---- loc_api/libloc_api_50001/loc_eng.h | 2 + 10 files changed, 103 insertions(+), 32 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 141fab6d..43332dcf 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -486,7 +486,7 @@ void LocApiBase:: DEFAULT_IMPL() int LocApiBase:: - setGpsLock(unsigned int lock) + setGpsLock(LOC_GPS_LOCK_MASK lock) DEFAULT_IMPL(-1) void LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index af9d270c..f68cf739 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -230,7 +230,7 @@ public: 3 = Lock MT position sessions 4 = Lock all position sessions */ - virtual int setGpsLock(unsigned int lock); + virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); /* Returns Current value of GPS Lock on success diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 33906b51..a1ffd85a 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -380,6 +380,12 @@ typedef enum loc_api_adapter_msg_to_check_supported { LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; +typedef uint32_t LOC_GPS_LOCK_MASK; +#define isGpsLockNone(lock) ((lock) == 0) +#define isGpsLockMO(lock) ((lock) & ((LOC_GPS_LOCK_MASK)1)) +#define isGpsLockMT(lock) ((lock) & ((LOC_GPS_LOCK_MASK)2)) +#define isGpsLockAll(lock) (((lock) & ((LOC_GPS_LOCK_MASK)3)) == 3) + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/etc/gps.conf b/etc/gps.conf index c57088a9..beda6da4 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -33,6 +33,13 @@ 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 @@ -44,6 +51,13 @@ SUPL_ES=1 #0 - Use regular SUPL PDN for Emergency SUPL USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 +#SUPL_MODE is a bit mask set in config.xml per carrier by default. +#If it is uncommented here, this value will over write the value from +#config.xml. +#MSA=0X1 +#MSB=0X2 +#SUPL_MODE= + # GPS Capabilities bit mask # SCHEDULING = 0x01 # MSB = 0x02 diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index aafec635..01d67f4c 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -49,6 +49,7 @@ private: 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, @@ -123,7 +124,7 @@ public: 3 = Lock MT position sessions 4 = Lock all position sessions */ - virtual int setGpsLock(unsigned int lock); + virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); /* Returns Current value of GPS Lock on success diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index e1422923..87d6b7c5 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -164,6 +164,20 @@ LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) 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) { @@ -1400,12 +1414,12 @@ LocApiBase* getLocApi(const MsgTask* msgTask, 3 = Lock MT position sessions 4 = Lock all position sessions */ -int LocApiRpc::setGpsLock(unsigned int lock) +int LocApiRpc::setGpsLock(LOC_GPS_LOCK_MASK lockMask) { rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - LOC_LOGD("%s:%d]: lock: %d\n", __func__, __LINE__, lock); - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = (rpc_loc_lock_e_type)lock; + 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, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1043fe82..0ac3df45 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -130,37 +130,42 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) mUlp = ulp; } -void LocEngAdapter::requestPowerVote() +int LocEngAdapter::setGpsLockMsg(LOC_GPS_LOCK_MASK lockMask) { - struct LocEngAdapterVotePower : public LocMsg { + struct LocEngAdapterGpsLock : public LocMsg { LocEngAdapter* mAdapter; - const bool mPowerUp; - inline LocEngAdapterVotePower(LocEngAdapter* adapter, bool powerUp) : - LocMsg(), mAdapter(adapter), mPowerUp(powerUp) + 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 { - /* 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. - */ - int mode = mPowerUp ? 103 : 101; - mAdapter->setGpsLock(mode); + mAdapter->setGpsLock(mLockMask); } inline void locallog() const { - LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", - (int)mPowerUp); + LOC_LOGV("LocEngAdapterGpsLock - mLockMask: %x", mLockMask); } inline virtual void log() const { locallog(); } }; + sendMsg(new LocEngAdapterGpsLock(this, lockMask)); + return 0; +} +void LocEngAdapter::requestPowerVote() +{ if (getPowerVoteRight()) { - sendMsg(new LocEngAdapterVotePower(this, getPowerVote())); + /* 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); } } diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 806f0103..b857d198 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -317,10 +317,13 @@ public: 3 = Lock MT position sessions 4 = Lock all position sessions */ - inline int setGpsLock(unsigned int lock) + 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c40a593c..e32dbc4c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -94,14 +94,22 @@ loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ -static loc_param_s_type loc_parameter_table[] = +static 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'}, + {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, 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'}, - {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, +}; + +static 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'}, @@ -118,8 +126,6 @@ static loc_param_s_type loc_parameter_table[] = {"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'}, - {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, - {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, {"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'}, @@ -134,6 +140,7 @@ static void loc_default_parameters(void) 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.CAPABILITIES = 0x7; /* LTE Positioning Profile configuration is disable by default*/ @@ -1611,7 +1618,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, } STATE_CHECK((NULL == loc_eng_data.adapter), - "instance already initialized", return 0); + "instance already initialized", + return loc_eng_data.adapter->setGpsLockMsg(0)); memset(&loc_eng_data, 0, sizeof (loc_eng_data)); @@ -1624,6 +1632,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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; @@ -1753,6 +1762,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_stop(loc_eng_data); } + loc_eng_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); + #if 0 // can't afford to actually clean up, for many reason. LOC_LOGD("loc_eng_init: client opened. close it now."); @@ -2420,7 +2431,14 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, if (LOC_AGPS_SUPL_SERVER == type) { char url[MAX_URL_LEN]; - unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + 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)); @@ -2596,7 +2614,7 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, if (config_data && length > 0) { loc_gps_cfg_s_type gps_conf_old = gps_conf; - UTIL_UPDATE_CONF(config_data, length, loc_parameter_table); + 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 @@ -2611,7 +2629,15 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); } + if (NULL != loc_eng_data.set_capabilities_cb) { + gps_conf.CAPABILITIES &= gps_conf_old.CAPABILITIES; + if (gps_conf.CAPABILITIES != gps_conf_old.CAPABILITIES) { + loc_eng_data.set_capabilities_cb(gps_conf.CAPABILITIES); + } + } } + + gps_conf.CAPABILITIES = gps_conf_old.CAPABILITIES; } EXIT_LOG(%s, VOID_RET); @@ -2787,8 +2813,8 @@ int loc_eng_read_config(void) 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, loc_parameter_table); - UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table); + 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"); diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 6ef3336f..86bdae43 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -90,6 +90,7 @@ typedef struct loc_eng_data_s agps_status_extended agps_status_cb; gps_nmea_callback nmea_cb; gps_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; @@ -152,6 +153,7 @@ typedef struct loc_gps_cfg_s 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; + uint8_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; } loc_gps_cfg_s_type; From d1cc6bfee73b7277ad93cfcda13006f80e98ab55 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 16 Sep 2014 22:43:56 -0700 Subject: [PATCH 269/945] GPS LOCK did not work when NMEA_PROVIDER follows it there is an implicit requirement on the loc_gps_cfg_s_type field data type, that is they must be 32 bit fields. Otherwise it would only work with the assistance of padding. When two adjacent 8 bit fields are defined, the later filled field would overwrite the previously written neighbor. This is why GPS_LOCK was tested as broken in the latest build. This also fixes a theoretic bug that when there are two of the same fields defined in the config table to be filled, the accounting of the filled entries was incorrect earlier. This is not a realistic bug, as there are no idential entries in the config table HAL fills. Bug: 16131208 CRs-fixed: 736966 Change-Id: I2e262fb30272f6f334508df17bb640022d7b1ef5 --- loc_api/libloc_api_50001/loc_eng.h | 12 +++++++++++- utils/loc_cfg.cpp | 5 ++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 86bdae43..da185462 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -140,6 +140,9 @@ typedef struct loc_eng_data_s } loc_eng_data_s_type; /* 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; @@ -147,17 +150,24 @@ typedef struct loc_gps_cfg_s uint32_t SUPL_VER; uint32_t CAPABILITIES; uint32_t LPP_PROFILE; - uint8_t NMEA_PROVIDER; 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; uint8_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; } 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; diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index b4b3ded4..404f3ed2 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -175,8 +175,7 @@ DEPENDENCIES N/A RETURN VALUE - 0: No config or incomplete config or invalid parameter - 1: Filled a record + 0: Number of records in the config_table filled with input_buf SIDE EFFECTS N/A @@ -220,7 +219,7 @@ int loc_fill_conf_item(char* input_buf, for(uint32_t i = 0; NULL != config_table && i < table_length; i++) { if(!loc_set_config_entry(&config_table[i], &config_value)) { - ret = 1; + ret += 1; } } } From ff78fb363caea2393fd09024015c7eb9f7e5acac Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 19 Sep 2014 12:19:08 -0700 Subject: [PATCH 270/945] GPS lock is stuck as disabled after post powerup enablement when the device boots with gps disabled in settings and later enabled post pwoer up, the lock state doesn't get updated correctly. Bug: 16131208 CRs-fixed: 736966 Change-Id: Ice8237a3fd67740819de573ffebbab851363163d --- loc_api/libloc_api_50001/loc.cpp | 4 +++- loc_api/libloc_api_50001/loc_eng.cpp | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 5b57635b..33fe1eb2 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -331,10 +331,11 @@ static int loc_init(GpsCallbacks* callbacks) gps_sv_cb = callbacks->sv_status_cb; retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); - loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); 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->setGpsLockMsg(0); + loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); @@ -493,6 +494,7 @@ 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); loc_close_mdm_node(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index e32dbc4c..c74299e3 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1618,8 +1618,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, } STATE_CHECK((NULL == loc_eng_data.adapter), - "instance already initialized", - return loc_eng_data.adapter->setGpsLockMsg(0)); + "instance already initialized", return 0); memset(&loc_eng_data, 0, sizeof (loc_eng_data)); @@ -1762,8 +1761,6 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) loc_eng_stop(loc_eng_data); } - loc_eng_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); - #if 0 // can't afford to actually clean up, for many reason. LOC_LOGD("loc_eng_init: client opened. close it now."); From 1ca544cfb509ed399fde737fdb8c0cec8b171696 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 10 Nov 2014 14:18:05 -0800 Subject: [PATCH 271/945] SUPL_MODE needs to be factored in for ULP GpsLocationProvider gets SUPL_MODE, and passes is to GPS HAL along with other configs upon sim hot swap. GPS HAL needs to parse it out and factor in that information in for ULP so that ULP can make correct decision w.r.t. position mode when gnss positioning is needed. Change-Id: I1a14dd9d9e47b5d7ea072ae08ee99bbb7c69dbe0 CRs-Fixed: 749794 --- core/gps_extended_c.h | 1 + etc/gps.conf | 4 +-- loc_api/libloc_api_50001/loc.cpp | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 52 ++++++++++++++++++++++++---- loc_api/libloc_api_50001/loc_eng.h | 6 +++- 5 files changed, 55 insertions(+), 10 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index a1ffd85a..5140a6c6 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -62,6 +62,7 @@ extern "C" { #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 /** Positioin is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 +#define ULP_LOCATION_IS_FROM_NLP 0x0020 #define ULP_MIN_INTERVAL_INVALID 0xffffffff diff --git a/etc/gps.conf b/etc/gps.conf index beda6da4..a1d5d2cc 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -54,8 +54,8 @@ USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 #SUPL_MODE is a bit mask set in config.xml per carrier by default. #If it is uncommented here, this value will over write the value from #config.xml. -#MSA=0X1 -#MSB=0X2 +#MSA=0X2 +#MSB=0X1 #SUPL_MODE= # GPS Capabilities bit mask diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4f0eb3ba..2bcfc7b0 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -335,7 +335,7 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->setGpsLockMsg(0); - loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); + loc_afw_data.adapter->requestUlp(getCarrierCapabilities()); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c74299e3..1b301060 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -101,6 +101,7 @@ static loc_param_s_type gps_conf_table[] = {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, + {"SUPL_MODE", &gps_conf.SUPL_MODE, 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'}, @@ -142,6 +143,7 @@ static void loc_default_parameters(void) gps_conf.NMEA_PROVIDER = 0; gps_conf.GPS_LOCK = 0; gps_conf.SUPL_VER = 0x10000; + gps_conf.SUPL_MODE = 0x3; gps_conf.CAPABILITIES = 0x7; /* LTE Positioning Profile configuration is disable by default*/ gps_conf.LPP_PROFILE = 0; @@ -514,6 +516,24 @@ struct LocEngSuplVer : public LocMsg { } }; +struct LocEngSuplMode : public LocMsg { + UlpProxyBase* mUlp; + + inline LocEngSuplMode(UlpProxyBase* ulp) : + LocMsg(), mUlp(ulp) + { + locallog(); + } + inline virtual void proc() const { + mUlp->setCapabilities(getCarrierCapabilities()); + } + inline void locallog() const { + } + inline virtual void log() const { + locallog(); + } +}; + // case LOC_ENG_MSG_LPP_CONFIG: struct LocEngLppConfig : public LocMsg { LocEngAdapter* mAdapter; @@ -1586,6 +1606,24 @@ struct LocEngInstallAGpsCert : public LocMsg { } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) +uint32_t getCarrierCapabilities() { + #define carrierMSA (uint32_t)0x2 + #define carrierMSB (uint32_t)0x1 + #define gpsConfMSA (uint32_t)0x4 + #define gpsConfMSB (uint32_t)0x2 + uint32_t capabilities = gps_conf.CAPABILITIES; + if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { + capabilities &= ~gpsConfMSA; + } + if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { + capabilities &= ~gpsConfMSB; + } + + LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", + gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities); + return capabilities; +} + /*=========================================================================== FUNCTION loc_eng_init @@ -2626,15 +2664,17 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); } - if (NULL != loc_eng_data.set_capabilities_cb) { - gps_conf.CAPABILITIES &= gps_conf_old.CAPABILITIES; - if (gps_conf.CAPABILITIES != gps_conf_old.CAPABILITIES) { - loc_eng_data.set_capabilities_cb(gps_conf.CAPABILITIES); - } + if (gps_conf_old.SUPL_MODE != gps_conf.SUPL_MODE) { + adapter->sendMsg(new LocEngSuplMode(adapter->getUlpProxy())); } } - gps_conf.CAPABILITIES = gps_conf_old.CAPABILITIES; + gps_conf_old.SUPL_VER = gps_conf.SUPL_VER; + gps_conf_old.LPP_PROFILE = gps_conf.LPP_PROFILE; + gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT; + gps_conf_old.SUPL_MODE = gps_conf.SUPL_MODE; + gps_conf = gps_conf_old; + } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index da185462..d049afae 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -148,6 +148,7 @@ typedef struct loc_gps_cfg_s uint32_t INTERMEDIATE_POS; uint32_t ACCURACY_THRES; uint32_t SUPL_VER; + uint32_t SUPL_MODE; uint32_t CAPABILITIES; uint32_t LPP_PROFILE; uint32_t XTRA_VERSION_CHECK; @@ -156,7 +157,7 @@ typedef struct loc_gps_cfg_s char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH]; uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; uint32_t NMEA_PROVIDER; - uint8_t GPS_LOCK; + uint32_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; } loc_gps_cfg_s_type; @@ -197,6 +198,9 @@ typedef struct extern loc_gps_cfg_s_type gps_conf; extern loc_sap_cfg_s_type sap_conf; + +uint32_t getCarrierCapabilities(); + //loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, From 00fd7bc33b6453a3cb0490ca1e89e0502b77b5b5 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Mon, 3 Nov 2014 14:27:23 -0800 Subject: [PATCH 272/945] Report 2D speed rather than 3D speed. According to Android API standard, it should be only the horizontal speed. Therefore, the speed should be reported in 2D rather than 3D. Change-Id: Ie42aa350637b56394869bac0af0207a5aceeede6 CRs-fixed: 745419 --- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 87d6b7c5..dbfc2fb7 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -715,12 +715,10 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re } // Speed - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) { location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + location.gpsLocation.speed = location_report_ptr->speed_horizontal; } // Heading From a328080552484b592378c617d6fe28a225f649d0 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Fri, 26 Sep 2014 17:00:09 -0700 Subject: [PATCH 273/945] Remove Redundant Log This change removes redundant log printing, including SV info and position report. Change-Id: Ifcf827f73e6c940e3fcb93402bc7a4b22e9a9d4e CRs-fixed: 765333 --- core/LocApiBase.cpp | 24 ++++++++++++++++++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 25 ++----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 43332dcf..82bfe21e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -232,6 +232,17 @@ void LocApiBase::reportPosition(UlpLocation &location, 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", + 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); // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPosition(location, @@ -246,6 +257,19 @@ void LocApiBase::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { + // print the SV info before delivering + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used" + " in fix mask: %x\n sv: prn snr elevation azimuth", + svStatus.num_svs, svStatus.ephemeris_mask, + svStatus.almanac_mask, svStatus.used_in_fix_mask); + for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f", + i, + svStatus.sv_list[i].prn, + svStatus.sv_list[i].snr, + svStatus.sv_list[i].elevation, + svStatus.sv_list[i].azimuth); + } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportSv(svStatus, diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c74299e3..ec53a7d3 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -819,16 +819,7 @@ void LocEngReportPosition::proc() const { } } void LocEngReportPosition::locallog() const { - 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", - mLocation.gpsLocation.flags, mLocation.position_source, - mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, - mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, - mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, - mLocation.gpsLocation.timestamp, mLocation.rawDataSize, - mLocation.rawData, mStatus, mTechMask); + LOC_LOGV("LocEngReportPosition"); } void LocEngReportPosition::log() const { locallog(); @@ -869,19 +860,7 @@ void LocEngReportSv::proc() const { } } void LocEngReportSv::locallog() const { - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " - "used in fix mask: %x\n sv: prn snr " - "elevation azimuth", - mSvStatus.num_svs, mSvStatus.ephemeris_mask, - mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); - for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f\n ", - i, - mSvStatus.sv_list[i].prn, - mSvStatus.sv_list[i].snr, - mSvStatus.sv_list[i].elevation, - mSvStatus.sv_list[i].azimuth); - } + LOC_LOGV("%s:%d] LocEngReportSv",__func__, __LINE__); } inline void LocEngReportSv::log() const { locallog(); From b83679bfc95d7b7f5d1ea427d02915efebc4ecbd Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Tue, 14 May 2013 12:23:58 -0700 Subject: [PATCH 274/945] loc_api_v02: Updating to loc api v02 idl Major:0x02, Minor:0x14 Renames elapsed_millis_since_boot.cpp to platform_lib_time.cpp. Fixed Klockwork null pointer dereference errors. CRs-fixed: 476773 Change-Id: I8c05bb3ab6fdd3ec80d7fe3427160b2e29d7a0d0 --- loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c | 6 ++++-- ...{elapsed_millis_since_boot.cpp => platform_lib_time.cpp} | 2 ++ platform_lib_abstractions/platform_lib_time.h | 1 + utils/Makefile.am | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) rename platform_lib_abstractions/{elapsed_millis_since_boot.cpp => platform_lib_time.cpp} (99%) diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c index dffcad06..5d9a449e 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -110,8 +110,10 @@ SIDE EFFECTS int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd) { close(fd); - if (pipe_name) unlink(pipe_name); - LOC_LOGD("fd = %d, %s\n", fd, pipe_name); + if (pipe_name != NULL) { + unlink(pipe_name); + LOC_LOGD("fd = %d, %s\n", fd, pipe_name); + } return 0; } diff --git a/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/platform_lib_abstractions/platform_lib_time.cpp similarity index 99% rename from platform_lib_abstractions/elapsed_millis_since_boot.cpp rename to platform_lib_abstractions/platform_lib_time.cpp index e8cb93a9..45bb8e6b 100644 --- a/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ b/platform_lib_abstractions/platform_lib_time.cpp @@ -44,3 +44,5 @@ int64_t elapsedMillisSinceBoot() int64_t t_us = systemTime(0); return (int64_t) t_us / 1000LL; } + + diff --git a/platform_lib_abstractions/platform_lib_time.h b/platform_lib_abstractions/platform_lib_time.h index ce013afc..d2f9264a 100644 --- a/platform_lib_abstractions/platform_lib_time.h +++ b/platform_lib_abstractions/platform_lib_time.h @@ -28,6 +28,7 @@ #ifndef _PLATFORM_LIB_TIME_H_ #define _PLATFORM_LIB_TIME_H_ +#include int64_t systemTime(int clock); int64_t elapsedMillisSinceBoot(); diff --git a/utils/Makefile.am b/utils/Makefile.am index e5935f05..13be4bb3 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -20,7 +20,7 @@ libgps_utils_so_la_c_sources = linked_list.c \ msg_q.c \ loc_cfg.cpp \ loc_log.cpp \ - ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + ../platform_lib_abstractions/platform_lib_time.cpp library_includedir = $(pkgincludedir)/utils From fba6dcd31f5eb6af147fc0c7160b29834533f432 Mon Sep 17 00:00:00 2001 From: Ekta Shah Date: Wed, 24 Jul 2013 15:04:43 -0700 Subject: [PATCH 275/945] gps: Remove dependency on libcutils.so Change-Id: Id3d6e2c81eb6d5ee549236c591cc75ac32aa948b --- loc_api/fake_property_service.c | 16 ++++++++++++++++ loc_api/fake_property_service.h | 19 +++++++++++++++++++ loc_api/libloc_api_50001/Makefile.am | 16 ++++++++++------ loc_api/libloc_api_50001/loc.cpp | 6 ++++++ loc_api/libloc_api_50001/loc.h | 1 - loc_api/libloc_api_50001/loc_eng.cpp | 16 ++++++++++++++++ utils/Makefile.am | 2 +- 7 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 loc_api/fake_property_service.c create mode 100644 loc_api/fake_property_service.h diff --git a/loc_api/fake_property_service.c b/loc_api/fake_property_service.c new file mode 100644 index 00000000..82e9cb03 --- /dev/null +++ b/loc_api/fake_property_service.c @@ -0,0 +1,16 @@ +/* Copyright (c) 2011,2012 Qualcomm Technologies, Inc. All Rights Reserved. + * Qualcomm Technologies Proprietary and Confidential. + */ +#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/loc_api/fake_property_service.h b/loc_api/fake_property_service.h new file mode 100644 index 00000000..33fc6b11 --- /dev/null +++ b/loc_api/fake_property_service.h @@ -0,0 +1,19 @@ +/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved. + * Qualcomm Technologies Proprietary and Confidential. + */ +#ifndef _FAKE_PROPERTY_SERVICE_H_ +#define _FAKE_PROPERTY_SERVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define PROPERTY_VALUE_MAX 92 +int property_get(const char *key, char *value, const char *default_value); + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index 23743570..d07d224b 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -1,10 +1,11 @@ AM_CFLAGS = \ -I../../utils \ -I../../platform_lib_abstractions \ + -I../ \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp +libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c if USE_GLIB libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ @@ -15,7 +16,7 @@ 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_adapter_so_la_LIBADD = -lstdc++ ../../utils/libgps_utils_so.la libloc_eng_so_la_SOURCES = \ @@ -28,7 +29,8 @@ libloc_eng_so_la_SOURCES = \ 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 + loc_eng_dmn_conn_glue_pipe.c \ + ../fake_property_service.c if USE_GLIB @@ -41,12 +43,13 @@ 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 +libloc_eng_so_la_LIBADD = -lstdc++ -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la libgps_default_so_la_SOURCES = \ loc.cpp \ - gps.c + gps.c \ + ../fake_property_service.c if USE_GLIB libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ @@ -58,7 +61,7 @@ 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 +libgps_default_so_la_LIBADD = -lstdc++ ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la library_include_HEADERS = \ LocEngAdapter.h \ @@ -69,6 +72,7 @@ library_include_HEADERS = \ loc_eng_agps.h \ loc_eng_msg.h \ loc_eng_log.h + ../fake_property_service.h library_includedir = $(pkgincludedir)/libloc_api_50001 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 0b032f0b..a1db5046 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -43,7 +43,12 @@ #include #include #include +#ifdef _ANDROID #include +#else +#include "fake_property_service.h" +#endif +#include using namespace loc_core; @@ -165,6 +170,7 @@ const GpsInterface* gps_get_hardware_interface () const GpsInterface* ret_val; char propBuf[PROPERTY_VALUE_MAX]; + memset(propBuf, 0, sizeof(propBuf)); loc_eng_read_config(); diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index c9593235..55456193 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -35,7 +35,6 @@ extern "C" { #endif /* __cplusplus */ #include -#include #include #include diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f54066b2..9a05dd7a 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -47,12 +47,22 @@ #include +#ifdef _ANDROID #include +#endif + #ifndef USE_GLIB #include #include #endif /* USE_GLIB */ +#ifndef _ANDROID +typedef enum { + SP_BACKGROUND = 0, + SP_FOREGROUND = 1, +} SchedPolicy; +#endif + #ifdef USE_GLIB #include #include @@ -73,6 +83,12 @@ #include "loc_core_log.h" #include "loc_eng_log.h" +#ifdef _ANDROID +#include +#else +#include "fake_property_service.h" +#endif + #define SUCCESS TRUE #define FAILURE FALSE diff --git a/utils/Makefile.am b/utils/Makefile.am index 13be4bb3..d245439d 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -38,7 +38,7 @@ 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++ -lcutils +libgps_utils_so_la_LIBADD = -lstdc++ #Create and Install libraries lib_LTLIBRARIES = libgps_utils_so.la From 5c8ebe897948f047954e016d6375403a21cc777d Mon Sep 17 00:00:00 2001 From: Yogesh Lal Date: Wed, 31 Jul 2013 16:36:12 +0530 Subject: [PATCH 276/945] gps: Updating copyright. Change-Id: I94124bbbeb6d932a21fd6b1f5536d834f7185cd8 --- loc_api/fake_property_service.c | 30 ++++++++++++++++++++++++++++-- loc_api/fake_property_service.h | 30 ++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/loc_api/fake_property_service.c b/loc_api/fake_property_service.c index 82e9cb03..4df7860b 100644 --- a/loc_api/fake_property_service.c +++ b/loc_api/fake_property_service.c @@ -1,6 +1,32 @@ -/* Copyright (c) 2011,2012 Qualcomm Technologies, Inc. All Rights Reserved. - * Qualcomm Technologies Proprietary and Confidential. +/* 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 int property_get(const char *key, char * value, const char *default_value) diff --git a/loc_api/fake_property_service.h b/loc_api/fake_property_service.h index 33fc6b11..1c15a4ee 100644 --- a/loc_api/fake_property_service.h +++ b/loc_api/fake_property_service.h @@ -1,6 +1,32 @@ -/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved. - * Qualcomm Technologies Proprietary and Confidential. +/* 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. + * */ + #ifndef _FAKE_PROPERTY_SERVICE_H_ #define _FAKE_PROPERTY_SERVICE_H From 78767a18f679b8a92a89cf97adc05e7acc8c1033 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Fri, 30 Aug 2013 16:04:25 -0700 Subject: [PATCH 277/945] loc-api: Making off-target garden-app build and run again After removing libcutils dependency, the off-target garden-app was not building. This change enables it to build and run again Change-Id: Ifb0473f5d05c156f761c72e29f6592b443ee9cb3 --- loc_api/fake_sched_policy.c | 26 ++++++++++++++++++ loc_api/fake_sched_policy.h | 40 ++++++++++++++++++++++++++++ loc_api/libloc_api_50001/Makefile.am | 2 +- loc_api/libloc_api_50001/gps.c | 1 + loc_api/libloc_api_50001/loc_eng.cpp | 39 +++------------------------ 5 files changed, 72 insertions(+), 36 deletions(-) create mode 100644 loc_api/fake_sched_policy.c create mode 100644 loc_api/fake_sched_policy.h diff --git a/loc_api/fake_sched_policy.c b/loc_api/fake_sched_policy.c new file mode 100644 index 00000000..4d6a4e8d --- /dev/null +++ b/loc_api/fake_sched_policy.c @@ -0,0 +1,26 @@ +/* Copyright (c) 2011, Qualcomm Technologies, Inc. All Rights Reserved. + * Qualcomm Technologies Proprietary and Confidential. + */ + +#include "fake_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/loc_api/fake_sched_policy.h b/loc_api/fake_sched_policy.h new file mode 100644 index 00000000..1fea48a7 --- /dev/null +++ b/loc_api/fake_sched_policy.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved. + * Qualcomm Technologies Proprietary and Confidential. + */ + +#ifndef _FAKE_SCHED_POLICY_H +#define _FAKE_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 + +#endif // _FAKE_SCHED_POLICY_H + diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index d07d224b..64d4c13f 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -5,7 +5,7 @@ AM_CFLAGS = \ -fno-short-enums \ -DFEATURE_GNSS_BIT_API -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c +libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c ../fake_sched_policy.c if USE_GLIB libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index b0669af2..46596aa4 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -30,6 +30,7 @@ #include #include +#include extern const GpsInterface* get_gps_interface(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9a05dd7a..a31fb7b1 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -49,6 +49,10 @@ #ifdef _ANDROID #include +#include +#else +#include "fake_sched_policy.h" +#include "fake_property_service.h" #endif #ifndef USE_GLIB @@ -56,12 +60,6 @@ #include #endif /* USE_GLIB */ -#ifndef _ANDROID -typedef enum { - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, -} SchedPolicy; -#endif #ifdef USE_GLIB #include @@ -83,12 +81,6 @@ typedef enum { #include "loc_core_log.h" #include "loc_eng_log.h" -#ifdef _ANDROID -#include -#else -#include "fake_property_service.h" -#endif - #define SUCCESS TRUE #define FAILURE FALSE @@ -2555,29 +2547,6 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) EXIT_LOG(%s, VOID_RET); } -#ifdef USE_GLIB -/*=========================================================================== -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 - -===========================================================================*/ -static int set_sched_policy(int tid, SchedPolicy policy) -{ - return 0; -} -#endif /* USE_GLIB */ - /*=========================================================================== FUNCTION loc_eng_read_config From 508ad95a84a6f01e88e2cbd7504ef6a56ee310f8 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Mon, 2 Sep 2013 13:37:48 -0700 Subject: [PATCH 278/945] loc-api: Fixing copyright Change-Id: Id54e7b212b895c7a521e0252b7c99be8e295b0d9 --- loc_api/fake_sched_policy.c | 29 +++++++++++++++++++++++++++-- loc_api/fake_sched_policy.h | 29 +++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/loc_api/fake_sched_policy.c b/loc_api/fake_sched_policy.c index 4d6a4e8d..96bdc0dd 100644 --- a/loc_api/fake_sched_policy.c +++ b/loc_api/fake_sched_policy.c @@ -1,5 +1,30 @@ -/* Copyright (c) 2011, Qualcomm Technologies, Inc. All Rights Reserved. - * Qualcomm Technologies Proprietary and Confidential. +/* 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 "fake_sched_policy.h" diff --git a/loc_api/fake_sched_policy.h b/loc_api/fake_sched_policy.h index 1fea48a7..343035d6 100644 --- a/loc_api/fake_sched_policy.h +++ b/loc_api/fake_sched_policy.h @@ -1,5 +1,30 @@ -/* Copyright (c) 2013, Qualcomm Technologies, Inc. All Rights Reserved. - * Qualcomm Technologies Proprietary and Confidential. +/* 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. + * */ #ifndef _FAKE_SCHED_POLICY_H From e2bcdc300ee3ac09897c7b99fab350d7b0bca492 Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Wed, 28 Aug 2013 16:11:44 -0700 Subject: [PATCH 279/945] loc-api: Exposing gps_get_hardware_interface to C code Change-Id: Ieffd21d0cb84d88d1304bb82bb5a54137cf967fd --- loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index a1db5046..1ffc42a5 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -164,7 +164,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -const GpsInterface* gps_get_hardware_interface () +extern "C" const GpsInterface* gps_get_hardware_interface () { ENTRY_LOG_CALLFLOW(); const GpsInterface* ret_val; From 70b94ae2c182efb680199b17c3efa5208e67d08f Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Tue, 24 Sep 2013 20:10:04 -0700 Subject: [PATCH 280/945] loc-api: Merging Makefiles of libloc_api_50001 and loc_api_v02 Created a new Makefile.am that builds both libloc_api_50001 and loc_api_v02 Change-Id: I20960f1c087c9a6bf721ea3e25369590f5b2ce85 --- Makefile.am | 2 +- configure.ac | 3 +- loc-api.pc.in | 4 +- loc_api/Makefile.am | 121 +++++++++++++++++++++++++++ loc_api/libloc_api_50001/Makefile.am | 80 ------------------ 5 files changed, 125 insertions(+), 85 deletions(-) create mode 100644 loc_api/Makefile.am delete mode 100644 loc_api/libloc_api_50001/Makefile.am diff --git a/Makefile.am b/Makefile.am index f374a5c5..509ed279 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = utils loc_api/libloc_api_50001 loc_api/loc_api_v02 +SUBDIRS = utils loc_api pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = loc-api.pc diff --git a/configure.ac b/configure.ac index dca18a19..5aac06e5 100644 --- a/configure.ac +++ b/configure.ac @@ -77,8 +77,7 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ utils/Makefile \ - loc_api/libloc_api_50001/Makefile \ - loc_api/loc_api_v02/Makefile \ + loc_api/Makefile \ loc-api.pc \ ]) diff --git a/loc-api.pc.in b/loc-api.pc.in index 3b4f81bf..cf4936f5 100644 --- a/loc-api.pc.in +++ b/loc-api.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: loc-api Description: Qualcomm GPS Location API Version: @VERSION@ -Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_eng_so -lgps_default_so -lloc_api -Cflags: -I${includedir}/loc-api/libloc_api_50001 -I${includedir}/loc-api/utils -I${includedir}/ -I${includedir}/loc-api +Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_api -lloc_eng_so -lgps_default_so +Cflags: -I${includedir}/loc-api/utils -I${includedir}/ -I${includedir}/loc-api diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am new file mode 100644 index 00000000..a479a81b --- /dev/null +++ b/loc_api/Makefile.am @@ -0,0 +1,121 @@ +AM_CFLAGS = \ + $(QMIF_CFLAGS) \ + -I../utils \ + -I../platform_lib_abstractions \ + -I./ulp/inc \ + -I./libloc_api_50001 \ + -I./loc_api_v02 \ + -I./ \ + -fno-short-enums \ + -DFEATURE_GNSS_BIT_API + +libloc_adapter_so_la_SOURCES = \ + libloc_api_50001/loc_eng_log.cpp \ + libloc_api_50001/LocApiAdapter.cpp \ + fake_property_service.c \ + fake_sched_policy.c + +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++ ../utils/libgps_utils_so.la + + +libloc_api_la_SOURCES = \ + loc_api_v02/LocApiV02Adapter.cpp \ + loc_api_v02/loc_api_v02_log.c \ + loc_api_v02/loc_api_v02_client.c \ + loc_api_v02/loc_api_sync_req.c \ + loc_api_v02/location_service_v02.c \ + loc_api_v02/LocApiV02Adapter.h \ + loc_api_v02/loc_util_log.h \ + loc_api_v02/location_service_v02.h \ + loc_api_v02/loc_api_sync_req.h \ + loc_api_v02/loc_api_v02_client.h \ + loc_api_v02/loc_api_v02_log.h + +if USE_GLIB +libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libloc_api_la_CFLAGS = $(AM_CFLAGS) +libloc_api_la_LDFLAGS = -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libloc_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) ../utils/libgps_utils_so.la libloc_adapter_so.la + +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_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 \ + fake_property_service.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++ -ldl ../utils/libgps_utils_so.la libloc_adapter_so.la libloc_api.la + + +libgps_default_so_la_SOURCES = \ + libloc_api_50001/loc.cpp \ + libloc_api_50001/gps.c \ + fake_property_service.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++ ../utils/libgps_utils_so.la -ldl libloc_eng_so.la + +library_include_HEADERS = \ + libloc_api_50001/LocApiAdapter.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_msg_id.h \ + libloc_api_50001/loc_eng_log.h \ + loc_api_v02/LocApiV02Adapter.h \ + loc_api_v02/loc_util_log.h \ + loc_api_v02/location_service_v02.h \ + loc_api_v02/loc_api_sync_req.h \ + loc_api_v02/loc_api_v02_client.h \ + loc_api_v02/loc_api_v02_log.h \ + ulp/inc/ulp.h \ + fake_property_service.h + +library_includedir = $(pkgincludedir) + +#Create and Install libraries +lib_LTLIBRARIES = libloc_adapter_so.la libloc_api.la libloc_eng_so.la libgps_default_so.la diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am deleted file mode 100644 index 64d4c13f..00000000 --- a/loc_api/libloc_api_50001/Makefile.am +++ /dev/null @@ -1,80 +0,0 @@ -AM_CFLAGS = \ - -I../../utils \ - -I../../platform_lib_abstractions \ - -I../ \ - -fno-short-enums \ - -DFEATURE_GNSS_BIT_API - -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp ../fake_property_service.c ../fake_sched_policy.c - -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++ ../../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 \ - ../fake_property_service.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++ -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la - - -libgps_default_so_la_SOURCES = \ - loc.cpp \ - gps.c \ - ../fake_property_service.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++ ../../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 - ../fake_property_service.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 From 91ece00117a01e54e26a863f9a57be2120b55506 Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Fri, 27 Jun 2014 14:21:50 -0700 Subject: [PATCH 281/945] loc-hal:porting from ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.040 It contains the following changes: - porting from AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.040 - updated package loc-api files according to the merge - rename loc-api to loc-hal - dynamically load liblbs_core.so.1 file for LE platforms - print a warning message when loading the lbs_core library fails CRs-fixed: 605821 Change-Id: I54e1a9c742d1734ffa29e6864901119e0ee600c8 --- Makefile.am | 4 +- configure.ac | 17 ++- core/ContextBase.cpp | 7 +- core/LocAdapterBase.cpp | 3 +- core/LocApiBase.cpp | 3 +- core/LocDualContext.cpp | 6 +- core/Makefile.am | 47 ++++++ core/MsgTask.cpp | 11 +- {loc_api => core}/fake_sched_policy.c | 2 +- {loc_api => core}/fake_sched_policy.h | 2 +- core/gps_extended.h | 5 +- core/loc_core_log.cpp | 1 + loc-api.pc.in | 10 -- loc-hal.pc.in | 10 ++ loc_api/Makefile.am | 137 ++++++++++-------- loc_api/fake_property_service.c | 5 +- loc_api/libloc_api_50001/loc.cpp | 3 +- loc_api/libloc_api_50001/loc_eng_agps.h | 6 +- .../platform_lib_macros.h | 19 ++- platform_lib_abstractions/platform_lib_time.h | 11 +- utils/Makefile.am | 35 +++-- utils/loc_target.cpp | 4 +- utils/loc_timer.c | 3 +- 23 files changed, 234 insertions(+), 117 deletions(-) create mode 100644 core/Makefile.am rename {loc_api => core}/fake_sched_policy.c (96%) rename {loc_api => core}/fake_sched_policy.h (96%) delete mode 100644 loc-api.pc.in create mode 100644 loc-hal.pc.in diff --git a/Makefile.am b/Makefile.am index 509ed279..3b4b595b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,8 +3,8 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = utils loc_api +SUBDIRS = utils core loc_api pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-api.pc +pkgconfig_DATA = loc-hal.pc EXTRA_DIST = $(pkgconfig_DATA) diff --git a/configure.ac b/configure.ac index 5aac06e5..9b0f6ce0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -# configure.ac -- Autoconf script for gps loc_api +# 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_api package version 1.0.0 -AC_INIT([loc-api],1.0.0) +# 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 @@ -29,10 +29,18 @@ 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]) + AC_ARG_WITH([libhardware_includes], AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@], [Specify the location of the libhardware headers]), @@ -77,8 +85,9 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ utils/Makefile \ + core/Makefile \ loc_api/Makefile \ - loc-api.pc \ + loc-hal.pc \ ]) AC_OUTPUT diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1bd138ea..db84509c 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -36,6 +36,7 @@ #include #include #include +#include #include namespace loc_core { @@ -52,6 +53,10 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName) proxy = (*getter)(); } } + else + { + LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName); + } if (NULL == proxy) { proxy = new LBSProxyBase(); } diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8bbe873f..c6199da9 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,6 +33,7 @@ #include #include #include +#include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 80e23755..64bc2492 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,6 +33,7 @@ #include #include #include +#include namespace loc_core { diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 86c3613a..d9420ada 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -58,7 +58,11 @@ ContextBase* LocDualContext::mBgContext = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; +#ifndef USE_GLIB const char* LocDualContext::mIzatLibName = "liblbs_core.so"; +#else +const char* LocDualContext::mIzatLibName = "liblbs_core.so.1"; +#endif const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) diff --git a/core/Makefile.am b/core/Makefile.am new file mode 100644 index 00000000..8a3c2a17 --- /dev/null +++ b/core/Makefile.am @@ -0,0 +1,47 @@ +AM_CFLAGS = -I./ \ + -I../utils \ + -I../platform_lib_abstractions \ + -fno-short-enums + +libloc_core_la_h_sources = \ + MsgTask.h \ + LocApiBase.h \ + LocAdapterBase.h \ + ContextBase.h \ + LocDualContext.h \ + LBSProxyBase.h \ + UlpProxyBase.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_core_log.h \ + fake_sched_policy.h + +libloc_core_la_c_sources = \ + MsgTask.cpp \ + LocApiBase.cpp \ + LocAdapterBase.cpp \ + ContextBase.cpp \ + LocDualContext.cpp \ + loc_core_log.cpp \ + fake_sched_policy.c + +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 ../utils/libgps_utils_so.la + +#Create and Install libraries +lib_LTLIBRARIES = libloc_core.la diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp index 37813394..7d70a9d7 100644 --- a/core/MsgTask.cpp +++ b/core/MsgTask.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -29,13 +29,18 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_MsgTask" +#ifdef _ANDROID #include +#include +#else +#include "fake_sched_policy.h" +#endif #include #include #include #include #include -#include +#include namespace loc_core { @@ -95,7 +100,7 @@ void* MsgTask::loopMain(void* arg) { MsgTask* copy = (MsgTask*)arg; // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); + set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); if (NULL != copy->mAssociator) { copy->mAssociator(); diff --git a/loc_api/fake_sched_policy.c b/core/fake_sched_policy.c similarity index 96% rename from loc_api/fake_sched_policy.c rename to core/fake_sched_policy.c index 96bdc0dd..ce99b938 100644 --- a/loc_api/fake_sched_policy.c +++ b/core/fake_sched_policy.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 diff --git a/loc_api/fake_sched_policy.h b/core/fake_sched_policy.h similarity index 96% rename from loc_api/fake_sched_policy.h rename to core/fake_sched_policy.h index 343035d6..5b7c7de5 100644 --- a/loc_api/fake_sched_policy.h +++ b/core/fake_sched_policy.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 diff --git a/core/gps_extended.h b/core/gps_extended.h index 88b0415b..e0be6f3e 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -34,6 +34,9 @@ extern "C" { #endif /* __cplusplus */ #include +#ifdef USE_GLIB +#include +#endif struct LocPosMode { diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index af2cced7..43cd60bc 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -33,6 +33,7 @@ #include #include #include +#include void LocPosMode::logv() const { diff --git a/loc-api.pc.in b/loc-api.pc.in deleted file mode 100644 index cf4936f5..00000000 --- a/loc-api.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-api -Description: Qualcomm GPS Location API -Version: @VERSION@ -Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_api -lloc_eng_so -lgps_default_so -Cflags: -I${includedir}/loc-api/utils -I${includedir}/ -I${includedir}/loc-api diff --git a/loc-hal.pc.in b/loc-hal.pc.in new file mode 100644 index 00000000..36cd4e7d --- /dev/null +++ b/loc-hal.pc.in @@ -0,0 +1,10 @@ +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/loc_api/Makefile.am b/loc_api/Makefile.am index a479a81b..e18d3a74 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -1,56 +1,18 @@ AM_CFLAGS = \ - $(QMIF_CFLAGS) \ - -I../utils \ - -I../platform_lib_abstractions \ - -I./ulp/inc \ - -I./libloc_api_50001 \ - -I./loc_api_v02 \ -I./ \ + -I../core \ + -I./libloc_api_50001 \ + -I../platform_lib_abstractions \ + -I../utils \ -fno-short-enums \ - -DFEATURE_GNSS_BIT_API + -DTARGET_USES_QCOM_BSP -libloc_adapter_so_la_SOURCES = \ - libloc_api_50001/loc_eng_log.cpp \ - libloc_api_50001/LocApiAdapter.cpp \ - fake_property_service.c \ - fake_sched_policy.c - -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++ ../utils/libgps_utils_so.la - - -libloc_api_la_SOURCES = \ - loc_api_v02/LocApiV02Adapter.cpp \ - loc_api_v02/loc_api_v02_log.c \ - loc_api_v02/loc_api_v02_client.c \ - loc_api_v02/loc_api_sync_req.c \ - loc_api_v02/location_service_v02.c \ - loc_api_v02/LocApiV02Adapter.h \ - loc_api_v02/loc_util_log.h \ - loc_api_v02/location_service_v02.h \ - loc_api_v02/loc_api_sync_req.h \ - loc_api_v02/loc_api_v02_client.h \ - loc_api_v02/loc_api_v02_log.h - -if USE_GLIB -libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_api_la_CFLAGS = $(AM_CFLAGS) -libloc_api_la_LDFLAGS = -shared -version-info 1:0:0 -libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) ../utils/libgps_utils_so.la libloc_adapter_so.la +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 \ @@ -58,6 +20,8 @@ libloc_eng_so_la_SOURCES = \ 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 \ @@ -65,6 +29,7 @@ libloc_eng_so_la_SOURCES = \ libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c \ fake_property_service.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@ @@ -76,7 +41,7 @@ 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 ../utils/libgps_utils_so.la libloc_adapter_so.la libloc_api.la +libloc_eng_so_la_LIBADD = -lstdc++ -ldl -llog ../utils/libgps_utils_so.la ../core/libloc_core.la libgps_default_so_la_SOURCES = \ @@ -94,28 +59,76 @@ 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++ ../utils/libgps_utils_so.la -ldl libloc_eng_so.la +libgps_default_so_la_LIBADD = -lstdc++ -llog ../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 ../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 ../core/libloc_core.la ../utils/libgps_utils_so.la libloc_ds_api.la library_include_HEADERS = \ - libloc_api_50001/LocApiAdapter.h \ + 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_msg_id.h \ libloc_api_50001/loc_eng_log.h \ - loc_api_v02/LocApiV02Adapter.h \ - loc_api_v02/loc_util_log.h \ - loc_api_v02/location_service_v02.h \ - loc_api_v02/loc_api_sync_req.h \ - loc_api_v02/loc_api_v02_client.h \ - loc_api_v02/loc_api_v02_log.h \ - ulp/inc/ulp.h \ - fake_property_service.h + fake_property_service.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_adapter_so.la libloc_api.la libloc_eng_so.la libgps_default_so.la +lib_LTLIBRARIES = libloc_eng_so.la libgps_default_so.la libloc_ds_api.la libloc_api_v02.la diff --git a/loc_api/fake_property_service.c b/loc_api/fake_property_service.c index 4df7860b..9d660fac 100644 --- a/loc_api/fake_property_service.c +++ b/loc_api/fake_property_service.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -28,6 +28,9 @@ */ #include +#ifdef USE_GLIB +#include +#endif int property_get(const char *key, char * value, const char *default_value) { diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 1ffc42a5..7031605c 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -48,7 +48,6 @@ #else #include "fake_property_service.h" #endif -#include using namespace loc_core; diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 055d955b..8bab3cd5 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -41,6 +41,10 @@ #include #include +#ifdef USE_GLIB +#include +#endif /* USE_GLIB */ + // forward declaration class AgpsStateMachine; class Subscriber; diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/platform_lib_macros.h index bc48dd99..a09a4a23 100644 --- a/platform_lib_abstractions/platform_lib_macros.h +++ b/platform_lib_abstractions/platform_lib_macros.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -30,6 +30,12 @@ #define __PLATFORM_LIB_MACROS_H__ #include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif #define TS_PRINTF(format, x...) \ { \ @@ -63,19 +69,16 @@ #else -#ifdef __cplusplus -extern "C" { -#endif pid_t gettid(void); -#ifdef __cplusplus -} -#endif - #define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) #endif +#ifdef __cplusplus +} +#endif /*__cplusplus */ + #endif diff --git a/platform_lib_abstractions/platform_lib_time.h b/platform_lib_abstractions/platform_lib_time.h index d2f9264a..8bdffa97 100644 --- a/platform_lib_abstractions/platform_lib_time.h +++ b/platform_lib_abstractions/platform_lib_time.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -28,9 +28,18 @@ #ifndef _PLATFORM_LIB_TIME_H_ #define _PLATFORM_LIB_TIME_H_ + #include +#ifdef __cplusplus +extern "C" { +#endif + int64_t systemTime(int clock); int64_t elapsedMillisSinceBoot(); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif diff --git a/utils/Makefile.am b/utils/Makefile.am index d245439d..0e7083eb 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -5,22 +5,29 @@ AM_CFLAGS = -Wundef \ -fno-inline \ -fno-short-enums \ -fpic \ + -I./ \ -I../platform_lib_abstractions -libgps_utils_so_la_h_sources = log_util.h \ - msg_q.h \ - linked_list.h \ - loc_cfg.h \ - loc_log.h \ - ../platform_lib_abstractions/platform_lib_includes.h \ - ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.h +libgps_utils_so_la_h_sources = \ + log_util.h \ + msg_q.h \ + linked_list.h \ + loc_cfg.h \ + loc_log.h \ + loc_target.h \ + loc_timer.h \ + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h -libgps_utils_so_la_c_sources = linked_list.c \ - msg_q.c \ - loc_cfg.cpp \ - loc_log.cpp \ - ../platform_lib_abstractions/platform_lib_time.cpp +libgps_utils_so_la_c_sources = \ + linked_list.c \ + msg_q.c \ + loc_cfg.cpp \ + loc_log.cpp \ + loc_timer.c \ + loc_target.cpp \ + ../platform_lib_abstractions/platform_lib_time.cpp library_includedir = $(pkgincludedir)/utils @@ -38,7 +45,7 @@ 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++ +libgps_utils_so_la_LIBADD = -lstdc++ -llog #Create and Install libraries lib_LTLIBRARIES = libgps_utils_so.la diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index a3ef6b3c..5eff1714 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include "loc_target.h" #include "loc_log.h" #include "log_util.h" +#include #define APQ8064_ID_1 "109" #define APQ8064_ID_2 "153" diff --git a/utils/loc_timer.c b/utils/loc_timer.c index 1e4008eb..0e9f6bde 100644 --- a/utils/loc_timer.c +++ b/utils/loc_timer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -33,6 +33,7 @@ #include "loc_timer.h" #include #include +#include"platform_lib_includes.h" enum timer_state { READY = 100, From 3e16bc32b5ac1e55e5325012bb3b761110b4a4f2 Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Thu, 14 Aug 2014 17:27:52 -0700 Subject: [PATCH 282/945] Make off-target loc hal libraries built CRs-fixed: 605821 Change-Id: I334ccf21f6e5d045d32c718cb060c67e167be733 --- core/gps_extended.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 4 +++- loc_api/libloc_api_50001/loc_eng_agps.h | 2 +- loc_api/libloc_api_50001/loc_eng_msg.h | 2 +- platform_lib_abstractions/platform_lib_macros.h | 8 +++++--- utils/loc_cfg.cpp | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/gps_extended.h b/core/gps_extended.h index e0be6f3e..9eec3f92 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ #include -#ifdef USE_GLIB +#if defined(USE_GLIB) || defined(OFF_TARGET) #include #endif diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index a31fb7b1..eb307719 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -61,8 +61,10 @@ #endif /* USE_GLIB */ -#ifdef USE_GLIB +#if defined(USE_GLIB) && !defined(OFF_TARGET) #include +#endif +#ifdef USE_GLIB #include #endif /* USE_GLIB */ diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 8bab3cd5..81a4133e 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -41,7 +41,7 @@ #include #include -#ifdef USE_GLIB +#if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif /* USE_GLIB */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index ae962f55..f4ba2dc5 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -43,7 +43,7 @@ #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) #endif -#ifdef USE_GLIB +#if defined(USE_GLIB) && !defined(OFF_TARGET) #include diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/platform_lib_macros.h index a09a4a23..a1db21a9 100644 --- a/platform_lib_abstractions/platform_lib_macros.h +++ b/platform_lib_abstractions/platform_lib_macros.h @@ -51,10 +51,13 @@ extern "C" { #ifdef USE_GLIB - +#ifndef OFF_TARGET #define strlcat g_strlcat #define strlcpy g_strlcpy - +#else +#define strlcat strncat +#define strlcpy strncpy +#endif #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) @@ -66,7 +69,6 @@ extern "C" { #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) - #else pid_t gettid(void); diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 73d1ca41..037ffaf8 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -39,7 +39,7 @@ #include #include #include -#ifdef USE_GLIB +#if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif #include "platform_lib_includes.h" From 4e9741f5278a7f0f8a6315746c23a9cfa7793e5e Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Tue, 19 Aug 2014 18:44:33 -0700 Subject: [PATCH 283/945] Migrating XTRA from gpsonextra.net to cloud based izatcloud.net *Added logic to remove xtra1.gpsonextra.net from URLs received from modem. *Added logic to override modem URLs with those configured in gps.conf *Replaced all instances of xtra{1,2,3}.gpsonextra.net domain URLs in gps.conf with xtrapath{1,2,3}.izatcloud.net URLs. *Replaced all commented instances of xtra.bin in gps.conf with xtra2.bin. CRs-fixed: 643816 Change-Id: I803b26bce22f06910dcaa1ee057902b9381667bf --- etc/gps.conf | 6 ++--- loc_api/libloc_api_50001/loc_eng.cpp | 35 ++++++++++++++++++++++++---- loc_api/libloc_api_50001/loc_eng.h | 7 +++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index b79b3801..a172a8ab 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,8 +1,8 @@ #Uncommenting these urls would only enable #the power up auto injection and force injection(test case). -#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin +#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin +#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin # Error Estimate # _SET = 1 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index eb307719..c3e82f85 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -44,7 +44,7 @@ #include #include #include - +#include #include #ifdef _ANDROID @@ -94,6 +94,8 @@ #define SAP_CONF_FILE "/etc/sap.conf" #endif +#define XTRA1_GPSONEXTRA "xtra1.gpsonextra.net" + using namespace loc_core; boolean configAlreadyRead = false; @@ -128,6 +130,9 @@ static loc_param_s_type loc_parameter_table[] = {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, 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'} }; static void loc_default_parameters(void) @@ -910,12 +915,34 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, LocMsg(), mLocEng(locEng), mMaxLen(maxlength), mServers(new char[3*(mMaxLen+1)]) { + char * cptr = mServers; memset(mServers, 0, 3*(mMaxLen+1)); - strlcpy(mServers, url1, mMaxLen); - strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen); - strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen); + + // 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); diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 2dfd50f7..59351311 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -67,6 +67,8 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 +#define MAX_XTRA_SERVER_URL_LENGTH 256 + enum loc_nmea_provider_e_type { NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA NMEA_PROVIDER_MP // Modem Processor Provider of NMEA @@ -146,6 +148,9 @@ typedef struct loc_gps_cfg_s unsigned long LPP_PROFILE; uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; + 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]; } loc_gps_cfg_s_type; typedef struct From 42c543919b189a758445dc1fd59030e735ad30ec Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Thu, 31 Jul 2014 15:04:33 -0700 Subject: [PATCH 284/945] loc-stub: Create a loc_stub library for stub func Consolidate fake functions and create the loc_stub library out of the fake functions CRs-fixed: 605814 Change-Id: I351426591f220075fa7a7cec776f4f86c837a3f6 --- .../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/Makefile.am | 39 +++++++++++ .../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 +++++++++++++ 14 files changed, 581 insertions(+) create mode 100644 platform_lib_abstractions/loc_stub/Makefile.am create mode 100644 platform_lib_abstractions/loc_stub/configure.ac create mode 100644 platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h create mode 100644 platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h create mode 100644 platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h create mode 100644 platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h create mode 100644 platform_lib_abstractions/loc_stub/include/loc_stub_time.h create mode 100644 platform_lib_abstractions/loc_stub/loc-stub.pc.in create mode 100644 platform_lib_abstractions/loc_stub/src/Makefile.am create mode 100644 platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp create mode 100644 platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp create mode 100644 platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp create mode 100644 platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp create mode 100644 platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp diff --git a/platform_lib_abstractions/loc_stub/Makefile.am b/platform_lib_abstractions/loc_stub/Makefile.am new file mode 100644 index 00000000..d81e363a --- /dev/null +++ b/platform_lib_abstractions/loc_stub/Makefile.am @@ -0,0 +1,9 @@ +# 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/platform_lib_abstractions/loc_stub/configure.ac b/platform_lib_abstractions/loc_stub/configure.ac new file mode 100644 index 00000000..8900f040 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/configure.ac @@ -0,0 +1,67 @@ +# 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/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h b/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h new file mode 100644 index 00000000..c8764eea --- /dev/null +++ b/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h @@ -0,0 +1,45 @@ +/* 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/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h b/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h new file mode 100644 index 00000000..677bc81a --- /dev/null +++ b/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h @@ -0,0 +1,44 @@ +/* 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/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h b/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h new file mode 100644 index 00000000..3677cdf6 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h @@ -0,0 +1,42 @@ +/* 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/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h b/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h new file mode 100644 index 00000000..a42b117b --- /dev/null +++ b/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h @@ -0,0 +1,64 @@ +/* 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/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/platform_lib_abstractions/loc_stub/include/loc_stub_time.h new file mode 100644 index 00000000..271e2ff4 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/include/loc_stub_time.h @@ -0,0 +1,45 @@ +/* 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/platform_lib_abstractions/loc_stub/loc-stub.pc.in b/platform_lib_abstractions/loc_stub/loc-stub.pc.in new file mode 100644 index 00000000..c2ae764b --- /dev/null +++ b/platform_lib_abstractions/loc_stub/loc-stub.pc.in @@ -0,0 +1,10 @@ +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/platform_lib_abstractions/loc_stub/src/Makefile.am b/platform_lib_abstractions/loc_stub/src/Makefile.am new file mode 100644 index 00000000..c8ab5fcb --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/Makefile.am @@ -0,0 +1,39 @@ +AM_CFLAGS = \ + -I../include \ + -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/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp new file mode 100644 index 00000000..1db69b24 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp @@ -0,0 +1,41 @@ +/* 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/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp b/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp new file mode 100644 index 00000000..55ef48a1 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp @@ -0,0 +1,37 @@ +/* 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/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp new file mode 100644 index 00000000..f9d9e3ef --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp @@ -0,0 +1,42 @@ +/* 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/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp new file mode 100644 index 00000000..781be295 --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp @@ -0,0 +1,50 @@ +/* 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/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp new file mode 100644 index 00000000..82dc593f --- /dev/null +++ b/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp @@ -0,0 +1,46 @@ +/* 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; +} From 836bdc4386232b3a86d062f89f3093845d05cb29 Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Tue, 2 Dec 2014 18:39:10 -0800 Subject: [PATCH 285/945] loc-pla: Create Platform Library Abstraction layer Defined PLA functions to enable gps libraries to call platform-dependent library calls transparantly. Removed fake files and replaced the fake function with defined PLA functions. CRs-fixed: 605817 Change-Id: I677f658001329a10ef9b49bd963631a83fb4c85f --- configure.ac | 4 ++ core/ContextBase.cpp | 1 - core/LocAdapterBase.cpp | 1 - core/LocApiBase.cpp | 1 - core/LocApiBase.h | 4 +- core/LocDualContext.cpp | 1 - core/Makefile.am | 10 ++- core/MsgTask.cpp | 9 +-- core/loc_core_log.cpp | 1 - loc_api/Makefile.am | 17 +++--- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 3 +- .../libloc_api-rpc-glue/src/loc_api_log.c | 3 +- .../src/loc_api_rpc_glue.c | 3 +- loc_api/libloc_api_50001/LocEngAdapter.h | 3 +- loc_api/libloc_api_50001/loc.cpp | 12 ++-- loc_api/libloc_api_50001/loc_eng.cpp | 19 +----- loc_api/libloc_api_50001/loc_eng.h | 1 - loc_api/libloc_api_50001/loc_eng_agps.cpp | 3 +- loc_api/libloc_api_50001/loc_eng_agps.h | 2 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 5 +- .../loc_eng_dmn_conn_glue_msg.c | 5 +- .../loc_eng_dmn_conn_glue_pipe.c | 5 +- .../loc_eng_dmn_conn_handler.cpp | 5 +- .../loc_eng_dmn_conn_thread_helper.c | 5 +- loc_api/libloc_api_50001/loc_eng_msg.h | 4 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 3 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 5 +- platform_lib_abstractions/loc_pla/Makefile.am | 10 +++ .../loc_pla/configure.ac | 61 +++++++++++++++++++ .../include/platform_lib_android_runtime.h | 45 ++++++++++++++ .../loc_pla/include/platform_lib_gettid.h | 20 +++--- .../include}/platform_lib_includes.h | 15 +++-- .../loc_pla/include/platform_lib_log_util.h | 25 ++++---- .../include}/platform_lib_macros.h | 43 +++++-------- .../include/platform_lib_property_service.h | 43 +++++++++++++ .../include/platform_lib_sched_policy.h | 37 +++-------- .../{ => loc_pla/include}/platform_lib_time.h | 21 ++----- .../loc_pla/loc-pla.pc.in | 10 +++ .../loc_pla/src/Makefile.am | 40 ++++++++++++ .../src/platform_lib_android_runtime.cpp | 40 ++++++++++++ .../loc_pla/src/platform_lib_gettid.cpp | 23 +++---- .../loc_pla/src/platform_lib_log_util.cpp | 48 +++++++++++++++ .../src/platform_lib_property_service.cpp | 39 ++++++++++++ .../loc_pla/src/platform_lib_sched_policy.cpp | 30 +++------ .../{ => loc_pla/src}/platform_lib_time.cpp | 35 ++++++----- utils/Makefile.am | 13 ++-- utils/linked_list.c | 5 +- utils/loc_cfg.cpp | 4 +- utils/loc_log.cpp | 60 +----------------- utils/loc_target.cpp | 5 +- utils/loc_timer.h | 4 +- utils/msg_q.c | 5 +- 53 files changed, 494 insertions(+), 326 deletions(-) create mode 100644 platform_lib_abstractions/loc_pla/Makefile.am create mode 100644 platform_lib_abstractions/loc_pla/configure.ac create mode 100644 platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h rename loc_api/fake_property_service.h => platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h (85%) rename platform_lib_abstractions/{ => loc_pla/include}/platform_lib_includes.h (81%) rename utils/log_util.h => platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h (93%) rename platform_lib_abstractions/{ => loc_pla/include}/platform_lib_macros.h (82%) create mode 100644 platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h rename core/fake_sched_policy.h => platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h (72%) rename platform_lib_abstractions/{ => loc_pla/include}/platform_lib_time.h (83%) create mode 100644 platform_lib_abstractions/loc_pla/loc-pla.pc.in create mode 100644 platform_lib_abstractions/loc_pla/src/Makefile.am create mode 100644 platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp rename loc_api/fake_property_service.c => platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp (81%) create mode 100644 platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp create mode 100644 platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp rename core/fake_sched_policy.c => platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp (75%) rename platform_lib_abstractions/{ => loc_pla/src}/platform_lib_time.cpp (81%) diff --git a/configure.ac b/configure.ac index 9b0f6ce0..4ef39eed 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,10 @@ 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]), diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index db84509c..b2869bb9 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index c6199da9..054a295c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 64bc2492..3cd2ffa8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include namespace loc_core { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index e162cfc7..c48927c4 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,7 +33,7 @@ #include #include #include -#include +#include namespace loc_core { diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index d9420ada..b4eaf7ff 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include namespace loc_core { diff --git a/core/Makefile.am b/core/Makefile.am index 8a3c2a17..e2d05be4 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,6 +1,6 @@ AM_CFLAGS = -I./ \ -I../utils \ - -I../platform_lib_abstractions \ + $(LOCPLA_CFLAGS) \ -fno-short-enums libloc_core_la_h_sources = \ @@ -13,8 +13,7 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h \ - fake_sched_policy.h + loc_core_log.h libloc_core_la_c_sources = \ MsgTask.cpp \ @@ -22,8 +21,7 @@ libloc_core_la_c_sources = \ LocAdapterBase.cpp \ ContextBase.cpp \ LocDualContext.cpp \ - loc_core_log.cpp \ - fake_sched_policy.c + loc_core_log.cpp library_includedir = $(pkgincludedir)/core @@ -41,7 +39,7 @@ 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 ../utils/libgps_utils_so.la +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/core/MsgTask.cpp b/core/MsgTask.cpp index 7d70a9d7..df6db808 100644 --- a/core/MsgTask.cpp +++ b/core/MsgTask.cpp @@ -29,16 +29,9 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_MsgTask" -#ifdef _ANDROID -#include -#include -#else -#include "fake_sched_policy.h" -#endif #include #include #include -#include #include #include @@ -100,7 +93,7 @@ void* MsgTask::loopMain(void* arg) { MsgTask* copy = (MsgTask*)arg; // make sure we do not run in background scheduling group - set_sched_policy(GETTID_PLATFORM_LIB_ABSTRACTION, SP_FOREGROUND); + platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); if (NULL != copy->mAssociator) { copy->mAssociator(); diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 43cd60bc..7d26ba65 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -31,7 +31,6 @@ #define LOG_TAG "LocSvc_core_log" #include -#include #include #include diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index e18d3a74..c5bffed2 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -2,8 +2,8 @@ AM_CFLAGS = \ -I./ \ -I../core \ -I./libloc_api_50001 \ - -I../platform_lib_abstractions \ -I../utils \ + $(LOCPLA_CFLAGS) \ -fno-short-enums \ -DTARGET_USES_QCOM_BSP @@ -26,8 +26,7 @@ libloc_eng_so_la_SOURCES = \ 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 \ - fake_property_service.c + libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c libloc_eng_so_la_SOURCES += libloc_eng_so_la_h_sources @@ -41,13 +40,12 @@ 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 ../utils/libgps_utils_so.la ../core/libloc_core.la +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 \ - fake_property_service.c + libloc_api_50001/gps.c if USE_GLIB libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ @@ -59,7 +57,7 @@ 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 ../utils/libgps_utils_so.la ../core/libloc_core.la -ldl libloc_eng_so.la +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 = \ @@ -83,7 +81,7 @@ 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 ../utils/libgps_utils_so.la +libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices -ldsi_netctrl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la libloc_api_v02_CFLAGS = \ $(QMIF_CFLAGS) \ @@ -108,7 +106,7 @@ 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 ../core/libloc_core.la ../utils/libgps_utils_so.la libloc_ds_api.la +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 \ @@ -119,7 +117,6 @@ library_include_HEADERS = \ libloc_api_50001/loc_eng_agps.h \ libloc_api_50001/loc_eng_msg.h \ libloc_api_50001/loc_eng_log.h \ - fake_property_service.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 \ diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 08474fc4..24708d43 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #ifdef USE_GLIB diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c index 1c482325..eb685fdf 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 @@ -32,7 +32,6 @@ #include "loc_api_log.h" #include "loc_log.h" -#include "log_util.h" #include "platform_lib_includes.h" #include "rpc/rpc.h" #include "loc_api_fixup.h" diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c index e0f400cf..8c12426b 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -62,7 +62,6 @@ #endif /* USE_GLIB */ /* Logging Improvement */ -#include "log_util.h" #include "platform_lib_includes.h" /*Maximum number of Modem init*/ #define RPC_TRY_NUM 10 diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index d03dc660..ea04f077 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 7031605c..0a933af0 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -43,11 +43,7 @@ #include #include #include -#ifdef _ANDROID -#include -#else -#include "fake_property_service.h" -#endif +#include using namespace loc_core; @@ -174,7 +170,7 @@ extern "C" const GpsInterface* gps_get_hardware_interface () loc_eng_read_config(); // check to see if GPS should be disabled - property_get("gps.disable", propBuf, ""); + platform_lib_abstraction_property_get("gps.disable", propBuf, ""); if (propBuf[0] == '1') { LOC_LOGD("gps_get_interface returning NULL because gps.disable=1\n"); @@ -475,7 +471,7 @@ static int loc_inject_location(double latitude, double longitude, float accuracy { char value[PROPERTY_VALUE_MAX]; memset(value, 0, sizeof(value)); - (void)property_get("persist.gps.qc_nlp_in_use", value, "0"); + (void)platform_lib_abstraction_property_get("persist.gps.qc_nlp_in_use", value, "0"); if(0 == strcmp(value, "1")) { enable_cpi = false; @@ -596,7 +592,7 @@ const void* loc_get_extension(const char* name) else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) { char baseband[PROPERTY_VALUE_MAX]; - property_get("ro.baseband", baseband, "msm"); + platform_lib_abstraction_property_get("ro.baseband", baseband, "msm"); if (strcmp(baseband, "csfb") == 0) { ret_val = &sLocEngAGpsRilInterface; diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c3e82f85..4bc12b3b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -46,21 +46,6 @@ #include #include #include - -#ifdef _ANDROID -#include -#include -#else -#include "fake_sched_policy.h" -#include "fake_property_service.h" -#endif - -#ifndef USE_GLIB -#include -#include -#endif /* USE_GLIB */ - - #if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif @@ -69,7 +54,6 @@ #endif /* USE_GLIB */ #include - #include #include #include @@ -78,8 +62,7 @@ #include #include #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "loc_core_log.h" #include "loc_eng_log.h" diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 59351311..c1dc8af5 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -54,7 +54,6 @@ typedef unsigned char boolean; #include #include #include -#include #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index d6cc1369..cf9fe82d 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -32,7 +32,6 @@ #include #include -#include #include #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 81a4133e..d68970f3 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -40,7 +40,7 @@ #include #include #include - +#include #if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif /* USE_GLIB */ diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index 918ae220..d24e0c9d 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -37,8 +37,7 @@ #include #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "loc_eng_dmn_conn_glue_msg.h" #include "loc_eng_dmn_conn_handler.h" #include "loc_eng_dmn_conn.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c index a1076ff9..e947fa1d 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. +/* 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 @@ -31,8 +31,7 @@ #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "loc_eng_dmn_conn_glue_msg.h" #include "loc_eng_dmn_conn_handler.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c index 5d9a449e..cbc4ea64 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -37,8 +37,7 @@ #include #include "loc_eng_dmn_conn_glue_pipe.h" -#include "log_util.h" -#include "platform_lib_includes.h" +#include /*=========================================================================== FUNCTION loc_eng_dmn_conn_glue_pipeget diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index edd53f21..137f686b 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -31,8 +31,7 @@ #include #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "loc_eng_msg.h" #include "loc_eng_dmn_conn.h" #include "loc_eng_dmn_conn_handler.h" diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c index 9fed9d42..b30f6d7a 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. +/* 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 @@ -28,8 +28,7 @@ */ #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "loc_eng_dmn_conn_thread_helper.h" /*=========================================================================== diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index f4ba2dc5..9a8b0e4d 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -34,11 +34,11 @@ #include #include #include -#include #include #include #include #include +#include #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 74abfd42..cc894481 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -43,8 +43,7 @@ #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include using namespace loc_core; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 842eda1f..8e99d941 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -36,7 +36,7 @@ #include #include #include -#include "log_util.h" +#include /*=========================================================================== FUNCTION loc_eng_nmea_send diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 45822867..1459c4c7 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -32,8 +32,7 @@ #include #include -#include "log_util.h" -#include "platform_lib_includes.h" +#include using namespace loc_core; diff --git a/platform_lib_abstractions/loc_pla/Makefile.am b/platform_lib_abstractions/loc_pla/Makefile.am new file mode 100644 index 00000000..8996763e --- /dev/null +++ b/platform_lib_abstractions/loc_pla/Makefile.am @@ -0,0 +1,10 @@ +# 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/platform_lib_abstractions/loc_pla/configure.ac b/platform_lib_abstractions/loc_pla/configure.ac new file mode 100644 index 00000000..a8b892b5 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/configure.ac @@ -0,0 +1,61 @@ +# 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/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h b/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h new file mode 100644 index 00000000..9a954f08 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h @@ -0,0 +1,45 @@ +/* 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/loc_api/fake_property_service.h b/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h similarity index 85% rename from loc_api/fake_property_service.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h index 1c15a4ee..9956937c 100644 --- a/loc_api/fake_property_service.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -24,22 +24,18 @@ * 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 _FAKE_PROPERTY_SERVICE_H_ -#define _FAKE_PROPERTY_SERVICE_H +#ifndef __PLATFORM_LIB_GETTID_H__ +#define __PLATFORM_LIB_GETTID_H__ + +#include #ifdef __cplusplus extern "C" { #endif - -#define PROPERTY_VALUE_MAX 92 -int property_get(const char *key, char *value, const char *default_value); - +pid_t platform_lib_abstraction_gettid(); #ifdef __cplusplus } -#endif - - -#endif +#endif /* __cplusplus */ +#endif /* __PLATFORM_LIB_GETTID_H__ */ diff --git a/platform_lib_abstractions/platform_lib_includes.h b/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h similarity index 81% rename from platform_lib_abstractions/platform_lib_includes.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_includes.h index 5858674f..47c37df8 100644 --- a/platform_lib_abstractions/platform_lib_includes.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -26,10 +26,15 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _PLATFORM_LIB_INCLUDES_H_ -#define _PLATFORM_LIB_INCLUDES_H_ +#ifndef __PLATFORM_LIB_INCLUDES_H__ +#define __PLATFORM_LIB_INCLUDES_H__ -#include "platform_lib_time.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 +#endif /* __PLATFORM_LIB_INCLUDES_H__ */ diff --git a/utils/log_util.h b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h similarity index 93% rename from utils/log_util.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index 7fb0c780..f78303c9 100644 --- a/utils/log_util.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 @@ -24,26 +24,27 @@ * 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 __PLATFORM_LIB_LOG_UTIL_H__ +#define __PLATFORM_LIB_LOG_UTIL_H__ + +#include "platform_lib_macros.h" #ifndef USE_GLIB #include -#endif /* USE_GLIB */ - -#ifdef USE_GLIB +#else #include +#include +#include #include +#include #include #ifndef LOG_TAG #define LOG_TAG "GPS_UTILS" - -#endif // LOG_TAG +#endif /* LOG_TAG */ #endif /* USE_GLIB */ @@ -86,8 +87,8 @@ extern const char ENTRY_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); +void loc_logger_init(unsigned long debug, unsigned long timestamp); +char* get_timestamp(char* str, unsigned long buf_size); #ifndef DEBUG_DMN_LOC_API @@ -168,4 +169,4 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/"__VA_ARGS__); } } #endif -#endif // __LOG_UTIL_H__ +#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */ diff --git a/platform_lib_abstractions/platform_lib_macros.h b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h similarity index 82% rename from platform_lib_abstractions/platform_lib_macros.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index a1db21a9..32035d28 100644 --- a/platform_lib_abstractions/platform_lib_macros.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,14 +29,21 @@ #ifndef __PLATFORM_LIB_MACROS_H__ #define __PLATFORM_LIB_MACROS_H__ -#include -#include -#include - #ifdef __cplusplus extern "C" { #endif +#ifdef USE_GLIB +#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; \ @@ -49,38 +56,16 @@ extern "C" { fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \ } - -#ifdef USE_GLIB -#ifndef OFF_TARGET -#define strlcat g_strlcat -#define strlcpy g_strlcpy -#else -#define strlcat strncat -#define strlcpy strncpy -#endif #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) -#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) - -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) - -#else - -pid_t gettid(void); - -#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) - -#endif +#endif /* USE_GLIB */ #ifdef __cplusplus } #endif /*__cplusplus */ -#endif +#endif /* __PLATFORM_LIB_MACROS_H__ */ diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h b/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h new file mode 100644 index 00000000..006c94d5 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h @@ -0,0 +1,43 @@ +/* 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 + +#define PROPERTY_VALUE_MAX 92 +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/core/fake_sched_policy.h b/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h similarity index 72% rename from core/fake_sched_policy.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h index 5b7c7de5..d10f1513 100644 --- a/core/fake_sched_policy.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -24,42 +24,23 @@ * 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 _FAKE_SCHED_POLICY_H -#define _FAKE_SCHED_POLICY_H +#ifndef __PLATFORM_LIB_SCHED_POLICY_H__ +#define __PLATFORM_LIB_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); + PLA_SP_BACKGROUND = 0, + PLA_SP_FOREGROUND = 1, +} PLASchedPolicy; +int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy); #ifdef __cplusplus } -#endif +#endif /* __cplusplus */ -#endif // _FAKE_SCHED_POLICY_H +#endif /* __PLATFORM_LIB_SCHED_POLICY_H__ */ diff --git a/platform_lib_abstractions/platform_lib_time.h b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h similarity index 83% rename from platform_lib_abstractions/platform_lib_time.h rename to platform_lib_abstractions/loc_pla/include/platform_lib_time.h index 8bdffa97..c05b15ce 100644 --- a/platform_lib_abstractions/platform_lib_time.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -26,20 +26,11 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _PLATFORM_LIB_TIME_H_ -#define _PLATFORM_LIB_TIME_H_ +#ifndef __PLATFORM_LIB_TIME_H__ +#define __PLATFORM_LIB_TIME_H__ -#include +#include -#ifdef __cplusplus -extern "C" { -#endif +int64_t platform_lib_abstraction_elapsed_millis_since_boot(); -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif +#endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/platform_lib_abstractions/loc_pla/loc-pla.pc.in new file mode 100644 index 00000000..1aad2f47 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/loc-pla.pc.in @@ -0,0 +1,10 @@ +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/platform_lib_abstractions/loc_pla/src/Makefile.am b/platform_lib_abstractions/loc_pla/src/Makefile.am new file mode 100644 index 00000000..3936837d --- /dev/null +++ b/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -0,0 +1,40 @@ +AM_CFLAGS = \ + $(LOCSTUB_CFLAGS) \ + -I../include \ + -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/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp b/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp new file mode 100644 index 00000000..447e02e3 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp @@ -0,0 +1,40 @@ +/* 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 android::AndroidRuntime::createJavaThread(name, start, arg); +} diff --git a/loc_api/fake_property_service.c b/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp similarity index 81% rename from loc_api/fake_property_service.c rename to platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp index 9d660fac..86863273 100644 --- a/loc_api/fake_property_service.c +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -24,22 +24,17 @@ * 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 "platform_lib_gettid.h" + #ifdef USE_GLIB -#include -#endif +#include +#else +#include +#endif /* USE_GLIB */ -int property_get(const char *key, char * value, const char *default_value) +pid_t platform_lib_abstraction_gettid() { - /* This will disable gps interface - value[0] = '1'; - */ - if (strcmp(key, "ro.baseband") == 0) { - memcpy(value, "msm", 4); - } - return 0; + return gettid(); } - diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp new file mode 100644 index 00000000..37a5d4a7 --- /dev/null +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -0,0 +1,48 @@ +/* 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" + +void loc_logger_init(unsigned long debug, unsigned long timestamp) +{ + loc_logger.DEBUG_LEVEL = debug; + loc_logger.TIMESTAMP = timestamp; +} + +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/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp new file mode 100644 index 00000000..1cc63abb --- /dev/null +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp @@ -0,0 +1,39 @@ +/* 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/core/fake_sched_policy.c b/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp similarity index 75% rename from core/fake_sched_policy.c rename to platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp index ce99b938..ba6b3505 100644 --- a/core/fake_sched_policy.c +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -24,28 +24,18 @@ * 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 "fake_sched_policy.h" +#include "platform_lib_sched_policy.h" -/*=========================================================================== -FUNCTION set_sched_policy +#ifdef USE_GLIB +#include +#else +#include +#endif /* USE_GLIB */ -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) +int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy) { - return 0; + return set_sched_policy(tid, (SchedPolicy)policy); } + diff --git a/platform_lib_abstractions/platform_lib_time.cpp b/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp similarity index 81% rename from platform_lib_abstractions/platform_lib_time.cpp rename to platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp index 45bb8e6b..dc7dff11 100644 --- a/platform_lib_abstractions/platform_lib_time.cpp +++ b/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -25,24 +25,23 @@ * 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) +#ifdef USE_GLIB +#include +#else +#include +#endif /* USE_GLIB */ + +int64_t platform_lib_abstraction_elapsed_millis_since_boot() { - struct timeval t; - t.tv_sec = t.tv_usec = 0; - gettimeofday(&t, NULL); - return t.tv_sec*1000000LL + t.tv_usec; +#ifdef USE_GLIB + + return elapsedMillisSinceBoot(); + +#else + + return android::elapsedRealtime(); + +#endif } - - -int64_t elapsedMillisSinceBoot() -{ - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; -} - - diff --git a/utils/Makefile.am b/utils/Makefile.am index 0e7083eb..5e718439 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -6,19 +6,15 @@ AM_CFLAGS = -Wundef \ -fno-short-enums \ -fpic \ -I./ \ - -I../platform_lib_abstractions + $(LOCPLA_CFLAGS) libgps_utils_so_la_h_sources = \ - log_util.h \ msg_q.h \ linked_list.h \ loc_cfg.h \ loc_log.h \ loc_target.h \ - loc_timer.h \ - ../platform_lib_abstractions/platform_lib_includes.h \ - ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.h + loc_timer.h libgps_utils_so_la_c_sources = \ linked_list.c \ @@ -26,8 +22,7 @@ libgps_utils_so_la_c_sources = \ loc_cfg.cpp \ loc_log.cpp \ loc_timer.c \ - loc_target.cpp \ - ../platform_lib_abstractions/platform_lib_time.cpp + loc_target.cpp library_includedir = $(pkgincludedir)/utils @@ -45,7 +40,7 @@ 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 +libgps_utils_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS) #Create and Install libraries lib_LTLIBRARIES = libgps_utils_so.la diff --git a/utils/linked_list.c b/utils/linked_list.c index 92617fee..1109acd3 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. +/* 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 @@ -31,8 +31,7 @@ #include #define LOG_TAG "LocSvc_utils_ll" -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include #include diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 037ffaf8..8c76d1fe 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -38,7 +38,7 @@ #include #include #include -#include +#include #if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 597b5b62..c64310eb 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -34,11 +34,7 @@ #include #include "loc_log.h" #include "msg_q.h" -#ifdef USE_GLIB -#include -#endif /* USE_GLIB */ -#include "log_util.h" -#include "platform_lib_includes.h" +#include #define BUFFER_SIZE 120 @@ -180,55 +176,3 @@ char *loc_get_time(char *time_string, unsigned long buf_size) 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; - 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/utils/loc_target.cpp b/utils/loc_target.cpp index 5eff1714..b5a62972 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -38,7 +38,6 @@ #include #include "loc_target.h" #include "loc_log.h" -#include "log_util.h" #include #define APQ8064_ID_1 "109" @@ -109,7 +108,7 @@ static bool is_qca1530(void) for (i = 0; i < QCA1530_DETECT_TIMEOUT; ++i) { - ret = property_get(qca1530_property_name, buf, NULL); + ret = platform_lib_abstraction_property_get(qca1530_property_name, buf, NULL); if (ret < 0) { LOC_LOGV( "qca1530: property %s is not accessible, ret=%d", @@ -165,7 +164,7 @@ unsigned int loc_get_target(void) goto detected; } - property_get("ro.baseband", baseband, ""); + platform_lib_abstraction_property_get("ro.baseband", baseband, ""); if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 0034d278..5ca15862 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ #include -#include "log_util.h" +#include /* Return values: diff --git a/utils/msg_q.c b/utils/msg_q.c index f82d4c03..1555668c 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -29,8 +29,7 @@ #include "msg_q.h" #define LOG_TAG "LocSvc_utils_q" -#include "log_util.h" -#include "platform_lib_includes.h" +#include #include "linked_list.h" #include #include From 7e9e68a3af03803d2e0ce792d750dd5bd8338e6c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 15 Dec 2014 17:49:40 -0800 Subject: [PATCH 286/945] support reinjecting supl url for sim hot swap modem might reset during sim hot swap, in which case the prior supl url shall be remembered so that can be reinjected. This change enables it. CRs-fixed: 771493 Change-Id: I86ec898a54bc8706720c29a1ea67ce27153ee981 --- loc_api/libloc_api_50001/loc_eng.cpp | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1b301060..6919aab4 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2523,29 +2523,29 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, 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); - } else { - LOC_LOGW("set_server called before init. 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); - } } EXIT_LOG(%d, ret_val); From f014665a5299f281695c8d098f7444afbf623057 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 15 Dec 2014 10:51:42 -0800 Subject: [PATCH 287/945] Enable "auto" target for APQ8960 Automotive ADP platform APQ8960 Automotive platforms use "auto" as a target name for ro.baseband property. Appropriate GPS driver changes were, 1. define GNSS_AUTO enum constant 2. Enable GNSS drivers for "auto" target. Change-Id: I463db7ac1c3e2dd6101e457ad723bb16adf5aacb CRs-Fixed: 771597 --- loc_api/libloc_api_50001/loc.cpp | 1 + utils/loc_log.cpp | 1 + utils/loc_target.cpp | 6 ++++++ utils/loc_target.h | 2 ++ 4 files changed, 10 insertions(+) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 2bcfc7b0..158176f5 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -247,6 +247,7 @@ extern "C" const GpsInterface* get_gps_interface() switch (gnssType) { case GNSS_GSS: + case GNSS_AUTO: //APQ8064 gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 392966ee..18182b74 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -113,6 +113,7 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_GSS), NAME_VAL(GNSS_MDM), NAME_VAL(GNSS_QCA1530), + NAME_VAL(GNSS_AUTO), NAME_VAL(GNSS_UNKNOWN) }; diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 8dbe885e..080e5768 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -53,6 +53,7 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" +#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 @@ -207,6 +208,11 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } + if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + { + gTarget = TARGET_AUTO; + goto detected; + } if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1)) && IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) ) diff --git a/utils/loc_target.h b/utils/loc_target.h index 208a34cb..d7364e91 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -36,6 +36,7 @@ #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) #define TARGET_PDS TARGET_SET(GNSS_PDS, 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) @@ -62,6 +63,7 @@ typedef enum { GNSS_MDM, GNSS_QCA1530, GNSS_PDS, + GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; From 32b1baae2ba3b4c33615dc1f20090f2e751301ee Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 15 Dec 2014 10:51:42 -0800 Subject: [PATCH 288/945] Enable "auto" target for APQ8960 Automotive ADP platform APQ8960 Automotive platforms use "auto" as a target name for ro.baseband property. Appropriate GPS driver changes were, 1. define GNSS_AUTO enum constant 2. Enable GNSS drivers for "auto" target. Change-Id: I463db7ac1c3e2dd6101e457ad723bb16adf5aacb CRs-Fixed: 771597 --- loc_api/libloc_api_50001/loc.cpp | 1 + utils/loc_log.cpp | 1 + utils/loc_target.cpp | 6 ++++++ utils/loc_target.h | 2 ++ 4 files changed, 10 insertions(+) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 2bcfc7b0..158176f5 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -247,6 +247,7 @@ extern "C" const GpsInterface* get_gps_interface() switch (gnssType) { case GNSS_GSS: + case GNSS_AUTO: //APQ8064 gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 392966ee..18182b74 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -113,6 +113,7 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_GSS), NAME_VAL(GNSS_MDM), NAME_VAL(GNSS_QCA1530), + NAME_VAL(GNSS_AUTO), NAME_VAL(GNSS_UNKNOWN) }; diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 8dbe885e..080e5768 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -53,6 +53,7 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" +#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 @@ -207,6 +208,11 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } + if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + { + gTarget = TARGET_AUTO; + goto detected; + } if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1)) && IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) ) diff --git a/utils/loc_target.h b/utils/loc_target.h index 208a34cb..d7364e91 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -36,6 +36,7 @@ #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) #define TARGET_PDS TARGET_SET(GNSS_PDS, 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) @@ -62,6 +63,7 @@ typedef enum { GNSS_MDM, GNSS_QCA1530, GNSS_PDS, + GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; From f311c16b0a3fde00ff4648070ce9064dfaa3b32f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 12 Dec 2014 15:49:26 -0800 Subject: [PATCH 289/945] gps.conf parameters are in sap.conf table due to merge issue, some of the parameters to come out from gps.conf are placed in the table that expects from sap.conf. Moving them into the right place. Change-Id: Ice988b06d0d87bdbc0225296898d6aaad701743f CRs-Fixed: 760152 --- loc_api/libloc_api_50001/loc_eng.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c0d33046..18ffc5ef 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -106,6 +106,10 @@ static loc_param_s_type gps_conf_table[] = {"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'}, }; @@ -127,12 +131,7 @@ static loc_param_s_type sap_conf_table[] = {"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'}, - {"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'}, - {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'} + {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'} }; static void loc_default_parameters(void) From 98e1f83ff46ec7d2a417719bbaf2a91424954896 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Mon, 25 Aug 2014 15:39:02 -0700 Subject: [PATCH 290/945] Added new events and masks for GDT AP These events and masks are for bulk data transfer between AP and MP. CRs-fixed:766059 Change-Id: Id795316a9b114d6984969ad9eadb8d2c66b1743b --- core/gps_extended_c.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 5140a6c6..acf92b36 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -345,6 +345,8 @@ enum loc_api_adapter_event_index { 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_GDT_UPLOAD_BEGIN_REQ, // GDT upload start request + LOC_API_ADAPTER_GDT_UPLOAD_END_REQ, // GDT upload end request LOC_API_ADAPTER_EVENT_MAX }; @@ -371,6 +373,8 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REQUEST_WIFI_AP_DATA (1< Date: Mon, 15 Dec 2014 17:47:50 -0800 Subject: [PATCH 291/945] GNSS measurement Implementation of GNSS Measurements support. In GPS HAL, Only GPS Measurements report will be collected from modem. CRs-fixed: 771496 Change-Id: Ief4368099df4ff573ad1a764f4156d63685e936d --- core/LocAdapterBase.cpp | 4 + core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 16 ++ core/LocApiBase.h | 12 ++ core/LocDualContext.cpp | 3 +- core/gps_extended_c.h | 2 + loc_api/libloc_api_50001/LocEngAdapter.cpp | 33 +++ loc_api/libloc_api_50001/LocEngAdapter.h | 11 + loc_api/libloc_api_50001/loc.cpp | 65 ++++++ loc_api/libloc_api_50001/loc_eng.cpp | 225 +++++++++++++++++++-- loc_api/libloc_api_50001/loc_eng.h | 4 + loc_api/libloc_api_50001/loc_eng_msg.h | 10 + 12 files changed, 370 insertions(+), 16 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index eea8eddf..23184dff 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -132,4 +132,8 @@ DEFAULT_IMPL(false) void LocAdapterBase:: shutdown() DEFAULT_IMPL() + +void LocAdapterBase:: + reportGpsMeasurementData(GpsData &gpsMeasurementData) +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 2fec3128..9d5f6a81 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -112,6 +112,7 @@ public: inline virtual bool isInSession() { return false; } virtual void shutdown(); ContextBase* getContext() const { return mContext; } + virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 82bfe21e..f56694e7 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -363,6 +363,12 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) +void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData)); +} + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -526,4 +532,14 @@ DEFAULT_IMPL(-1) enum loc_api_adapter_err LocApiBase:: setXtraVersionCheck(enum xtra_version_check check) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +int LocApiBase:: + updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) +DEFAULT_IMPL(-1) + +bool LocApiBase:: + gnssConstellationConfig() +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f68cf739..414769b5 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -130,6 +130,7 @@ public: void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); void saveSupportedMsgList(uint64_t supportedMsgList); + void reportGpsMeasurementData(GpsData &gpsMeasurementData); // downward calls // All below functions are to be defined by adapter specific modules: @@ -237,7 +238,18 @@ public: -1 on failure */ virtual int getGpsLock(void); + virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); + + /* + Update gps reporting events + */ + virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled); + /* + Check if the modem support the service + */ + virtual bool gnssConstellationConfig(); }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index ab151109..41ad4f0a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -50,7 +50,8 @@ LocDualContext::mBgExclMask = 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_GEOFENCE_GEN_ALERT | + LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT); const MsgTask* LocDualContext::mMsgTask = NULL; ContextBase* LocDualContext::mFgContext = NULL; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index acf92b36..8a4e340f 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -347,6 +347,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_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_EVENT_MAX }; @@ -375,6 +376,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT (1<updateRegistrationMask(event, isEnabled); + if (result == LOC_API_ADAPTER_ERR_SUCCESS) { + LOC_LOGD("%s] update registration mask succeed.", __func__); + } else { + LOC_LOGE("%s] update registration mask failed.", __func__); + } +} + +/* + Set Gnss Constellation Config + */ +bool LocEngAdapter::gnssConstellationConfig() +{ + LOC_LOGD("entering %s", __func__); + bool result = false; + result = mLocApi->gnssConstellationConfig(); + return result; +} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b857d198..e5d10184 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -284,6 +284,7 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); + virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); inline const LocPosMode& getPositionMode() const {return mFixCriteria;} @@ -334,6 +335,16 @@ public: return mLocApi->getGpsLock(); } + /* + Update Registration Mask + */ + void updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled); + + /* + Set Gnss Constellation Config + */ + bool gnssConstellationConfig(); }; #endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 158176f5..4cf4ba95 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -150,6 +150,17 @@ typedef struct { static s_loc_mdm_info loc_mdm_info; static void loc_pm_event_notifier(void *client_data, enum pm_event event); #endif /*MODEM_POWER_VOTE*/ +// For shutting down MDM in fusion devices +static int mdm_fd = -1; +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); @@ -776,6 +787,10 @@ const void* loc_get_extension(const char* name) { ret_val = &sLocEngConfigInterface; } + else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) + { + ret_val = &sLocEngGpsMeasurementInterface; + } else { LOC_LOGE ("get_extension: Invalid interface passed in\n"); @@ -983,6 +998,56 @@ static int loc_xtra_inject_data(char* data, int length) 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 18ffc5ef..448cc793 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1372,6 +1372,33 @@ struct LocEngEnableData : public LocMsg { // 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(); + } +}; + // case LOC_ENG_MSG_LOC_INIT: struct LocEngInit : public LocMsg { loc_eng_data_s_type* mLocEng; @@ -1382,6 +1409,8 @@ struct LocEngInit : public LocMsg { } inline virtual void proc() const { loc_eng_reinit(*mLocEng); + // set the capabilities + mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng)); } inline void locallog() const { @@ -1571,6 +1600,99 @@ struct LocEngInstallAGpsCert : public LocMsg { } }; +struct LocEngUpdateRegistrationMask : public LocMsg { + loc_eng_data_s_type* mLocEng; + LOC_API_ADAPTER_EVENT_MASK_T mMask; + loc_registration_mask_status mIsEnabled; + inline LocEngUpdateRegistrationMask(loc_eng_data_s_type* locEng, + LOC_API_ADAPTER_EVENT_MASK_T mask, + loc_registration_mask_status isEnabled) : + LocMsg(), mLocEng(locEng), mMask(mask), mIsEnabled(isEnabled) { + locallog(); + } + inline virtual void proc() const { + loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; + locEng->adapter->updateRegistrationMask(mMask, + mIsEnabled); + } + void locallog() const { + LOC_LOGV("LocEngUpdateRegistrationMask\n"); + } + virtual void log() const { + locallog(); + } +}; + +struct LocEngGnssConstellationConfig : public LocMsg { + LocEngAdapter* mAdapter; + inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) { + locallog(); + } + inline virtual void proc() const { + if (mAdapter->gnssConstellationConfig()) { + LOC_LOGV("Modem supports GNSS measurements\n"); + gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS; + } else { + 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: +LocEngReportGpsMeasurement::LocEngReportGpsMeasurement(void* locEng, + GpsData &gpsData) : + LocMsg(), mLocEng(locEng), mGpsData(gpsData) +{ + locallog(); +} +void LocEngReportGpsMeasurement::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->gps_measurement_cb != NULL) { + locEng->gps_measurement_cb((GpsData*)&(mGpsData)); + } + } +} +void LocEngReportGpsMeasurement::locallog() const { + IF_LOC_LOGV { + LOC_LOGV("%s:%d]: Received in GPS HAL." + "GNSS Measurements count: %d \n", + __func__, __LINE__, mGpsData.measurement_count); + for (int i =0; i< mGpsData.measurement_count && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" GNSS measurement data in GPS HAL: \n" + " GPS_HAL => Measurement ID | prn | time_offset_ns | state |" + " received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |" + " pseudorange_rate_uncertainty_mps |" + " accumulated_delta_range_state | flags \n" + " GPS_HAL => %d | %d | %f | %d | %lld | %f | %f | %f | %d | %d \n", + i, + mGpsData.measurements[i].prn, + mGpsData.measurements[i].time_offset_ns, + mGpsData.measurements[i].state, + mGpsData.measurements[i].received_gps_tow_ns, + mGpsData.measurements[i].c_n0_dbhz, + mGpsData.measurements[i].pseudorange_rate_mps, + mGpsData.measurements[i].pseudorange_rate_uncertainty_mps, + mGpsData.measurements[i].accumulated_delta_range_state, + mGpsData.measurements[i].flags); + } + LOC_LOGV(" GPS_HAL => Clocks Info: type | time_ns \n" + " GPS_HAL => Clocks Info: %d | %lld", mGpsData.clock.type, + mGpsData.clock.time_ns); + } +} +inline void LocEngReportGpsMeasurement::log() const { + locallog(); +} + /********************************************************************* * Initialization checking macros *********************************************************************/ @@ -1638,10 +1760,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } - // Save callbacks loc_eng_data.location_cb = callbacks->location_cb; loc_eng_data.sv_status_cb = callbacks->sv_status_cb; @@ -1690,6 +1808,7 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) 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, @@ -2626,33 +2745,32 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); if (config_data && length > 0) { - loc_gps_cfg_s_type gps_conf_old = gps_conf; + 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_old.SUPL_VER != gps_conf.SUPL_VER) { + if (gps_conf_tmp.SUPL_VER != gps_conf.SUPL_VER) { adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); } - if (gps_conf_old.LPP_PROFILE != gps_conf.LPP_PROFILE) { + if (gps_conf_tmp.LPP_PROFILE != gps_conf.LPP_PROFILE) { adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); } - if (gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { + 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_old.SUPL_MODE != gps_conf.SUPL_MODE) { + if (gps_conf_tmp.SUPL_MODE != gps_conf.SUPL_MODE) { adapter->sendMsg(new LocEngSuplMode(adapter->getUlpProxy())); } } - gps_conf_old.SUPL_VER = gps_conf.SUPL_VER; - gps_conf_old.LPP_PROFILE = gps_conf.LPP_PROFILE; - gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT; - gps_conf_old.SUPL_MODE = gps_conf.SUPL_MODE; - gps_conf = gps_conf_old; - + 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.GPS_LOCK = gps_conf.GPS_LOCK; + gps_conf = gps_conf_tmp; } EXIT_LOG(%s, VOID_RET); @@ -2862,3 +2980,80 @@ void loc_eng_handle_shutdown(loc_eng_data_s_type &locEng) locEng.shutdown_cb(); EXIT_LOG(%d, 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.gps_measurement_cb), + "gps 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->sendMsg(new LocEngUpdateRegistrationMask( + &loc_eng_data, + event, + LOC_REGISTRATION_MASK_ENABLED)); + // set up the callback + loc_eng_data.gps_measurement_cb = callbacks->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->sendMsg(new LocEngUpdateRegistrationMask( + &loc_eng_data, + event, + LOC_REGISTRATION_MASK_DISABLED)); + // set up the callback + loc_eng_data.gps_measurement_cb = NULL; + EXIT_LOG(%d, 0); +} diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index d049afae..813da482 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -94,6 +94,7 @@ typedef struct loc_eng_data_s gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; gps_request_utc_time request_utc_time_cb; + gps_measurement_callback gps_measurement_cb; boolean intermediateFix; AGpsStatusValue agps_status; loc_eng_xtra_data_s_type xtra_module_data; @@ -259,6 +260,9 @@ 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 } diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index b767dc5f..e3c48fb4 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -289,6 +289,16 @@ struct LocEngGetZpp : public LocMsg { void send() const; }; +struct LocEngReportGpsMeasurement : public LocMsg { + void* mLocEng; + const GpsData mGpsData; + LocEngReportGpsMeasurement(void* locEng, + GpsData &gpsData); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + struct LocEngShutdown : public LocMsg { LocEngAdapter* mAdapter; LocEngShutdown(LocEngAdapter* adapter); From 2794061c7357903ddeb092f7628ad6c1dceb1c05 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 16 Jan 2015 06:24:40 +0000 Subject: [PATCH 292/945] Propagate DR enablement feature from LNX.LA.2.7.3 Change Summary: * Changes taken from change#812357; * Structure definitions for GNSS SV Measurement and GNSS SV Polynomial to report it to ULP and to external DR module; * New function additions in LocApiBase, LocAdapterBase and LocEngAdapter to report SV Measurement and SV Polynomial; * definition and changes to detect "auto" platform in loc_target; * enable SV Measurement and SV Polynomial report for "auto" platform; Change-Id: I5ac5ee5c44e72e657b16515e37637c9a5c64e638 --- core/LocAdapterBase.cpp | 7 + core/LocAdapterBase.h | 2 + core/LocApiBase.cpp | 16 + core/LocApiBase.h | 2 + core/UlpProxyBase.h | 12 + core/gps_extended_c.h | 587 +++++++++++++++++++++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 17 + loc_api/libloc_api_50001/LocEngAdapter.h | 2 + loc_api/libloc_api_50001/loc.cpp | 10 + loc_api/libloc_api_50001/loc_eng.cpp | 3 + 10 files changed, 658 insertions(+) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index eea8eddf..e0050611 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -78,6 +78,13 @@ void LocAdapterBase:: void* svExt) DEFAULT_IMPL() +void LocAdapterBase:: + reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) +DEFAULT_IMPL() + +void LocAdapterBase:: + reportSvPolynomial(GnssSvPolynomial &svPolynomial) +DEFAULT_IMPL() void LocAdapterBase:: reportStatus(GpsStatusValue status) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 2fec3128..a3d81220 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -95,6 +95,8 @@ public: virtual void reportSv(GpsSvStatus &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, diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 43332dcf..f574e87a 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -254,6 +254,22 @@ void LocApiBase::reportSv(GpsSvStatus &svStatus, ); } +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. diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f68cf739..8d90ff2a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -116,6 +116,8 @@ public: void reportSv(GpsSvStatus &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, diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index b9a8224f..5270cfb3 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -63,6 +63,14 @@ public: void* svExt) { return false; } + inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { + return false; + } + + inline virtual bool reportSvPolynomial(GnssSvPolynomial &svPolynomial) + { + return false; + } inline virtual bool reportStatus(GpsStatusValue status) { return false; } @@ -78,6 +86,10 @@ public: LocPosTechMask techMask) { return false; } + inline virtual bool reportDeleteAidingData(GpsAidingData aidingData) + { + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 5140a6c6..7f374bab 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -63,6 +63,8 @@ extern "C" { /** Positioin is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 #define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from external DR solution*/ +#define ULP_LOCATION_IS_FROM_EXT_DR 0X0040 #define ULP_MIN_INTERVAL_INVALID 0xffffffff @@ -345,6 +347,8 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -371,6 +375,8 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REQUEST_WIFI_AP_DATA (1<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; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b857d198..ae5e514c 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -272,6 +272,8 @@ public: virtual void reportSv(GpsSvStatus &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, diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 158176f5..4f4f61e4 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -297,6 +297,7 @@ static int loc_init(GpsCallbacks* callbacks) static int mdm_index = -1; int peripheral_mgr_ret = PM_RET_FAILED; #endif /*MODEM_POWER_VOTE*/ + unsigned int target = (unsigned int) -1; ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -315,6 +316,15 @@ static int loc_init(GpsCallbacks* callbacks) LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; + target = loc_get_target(); + + /*For "auto" platform enable Measurement report and SV Polynomial report*/ + if(GNSS_AUTO == getTargetGnssType(target)) + { + 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 */ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 1b301060..2c52087d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2070,6 +2070,9 @@ void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData 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); From b38580ee75400205b11c31b0d0aa0c6a0d4ff1c3 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 4 Dec 2014 16:24:20 -0800 Subject: [PATCH 293/945] Revert "Added Detection Logic For QMI_PDS Target." This reverts commit fb9c641bb869301c9b3728608870673693ff593f. CRs-Fixed: 760272 Change-Id: I90a9bcd77447dc5b3d799bd0ad1bdbfae85cef15 --- utils/loc_target.cpp | 9 ++------- utils/loc_target.h | 2 -- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 080e5768..f829d511 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -46,7 +46,6 @@ #define MSM8930_ID_2 "116" #define APQ8030_ID_1 "157" #define APQ8074_ID_1 "184" -#define PDS_ID_1 "178" #define LINE_LEN 100 #define STR_LIQUID "Liquid" @@ -213,12 +212,8 @@ unsigned int loc_get_target(void) gTarget = TARGET_AUTO; goto detected; } - if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ - if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1)) - && IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) ) - gTarget = TARGET_PDS; - } - else if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + 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_MPQ; diff --git a/utils/loc_target.h b/utils/loc_target.h index d7364e91..873ddfc3 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -35,7 +35,6 @@ #define TARGET_MPQ 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_PDS TARGET_SET(GNSS_PDS, 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) @@ -62,7 +61,6 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, - GNSS_PDS, GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; From f4d8e902f7b4cc2a28f1c830e53040a34dc9735e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 3 Feb 2015 12:13:05 -0800 Subject: [PATCH 294/945] Fix bug with switch case The switch case inside setXtraVersionCheck does not have breaks after the cases and the default label is misspelled. This will always cause the check to be disabled Change-Id: Ibcc3703c98e561e0bdfbcc5c8802d1b45c9a511a CRs-Fixed: 790623 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 44f56dcf..2f025af2 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -374,13 +374,17 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) switch (check) { case 0: eCheck = DISABLED; + break; case 1: eCheck = AUTO; + break; case 2: eCheck = XTRA2; + break; case 3: eCheck = XTRA3; - defaul: + break; + default: eCheck = DISABLED; } ret = mLocApi->setXtraVersionCheck(eCheck); From 1777a2fe166188b9048e3eeffff2a3b8cf7bf635 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 3 Feb 2015 12:13:05 -0800 Subject: [PATCH 295/945] Fix bug with switch case The switch case inside setXtraVersionCheck does not have breaks after the cases and the default label is misspelled. This will always cause the check to be disabled Change-Id: Ibcc3703c98e561e0bdfbcc5c8802d1b45c9a511a CRs-Fixed: 790623 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5fca5bfc..ffe6090d 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -391,13 +391,17 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) switch (check) { case 0: eCheck = DISABLED; + break; case 1: eCheck = AUTO; + break; case 2: eCheck = XTRA2; + break; case 3: eCheck = XTRA3; - defaul: + break; + default: eCheck = DISABLED; } ret = mLocApi->setXtraVersionCheck(eCheck); From b45b1606db28e031b1fd5a5bea0f32a63a0754dc Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Mon, 9 Feb 2015 12:49:29 +0530 Subject: [PATCH 296/945] Klockwork P1 issues. fixing Klockwork P1 issues. CRs-Fixed: 793601 Change-Id: I037c17c342f473d6d21a234ec1e980ba55b98cbe --- utils/loc_cfg.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 404f3ed2..7ffe6a43 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -329,9 +329,14 @@ int loc_update_conf(const char* conf_data, int32_t length, 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); - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; + + 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; From 9431a6cb336c2fa1733e6ad3aa4bc323455f1dbf Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 20 Jan 2015 14:42:26 -0800 Subject: [PATCH 297/945] Send GPS tracking fixes to FLP HAL FLP HAL accepts GPS tracking fixes for tracking, so this change sends the tracking fixes to FLP HAL while flp tracking is undergoing. Also, this change adds batching options flags and batching succeed/failure definitions. CRs-fixed: 748687 Change-Id: I11a2ba337433d9a42c903d36fc980ee1a3983a1e --- core/LocAdapterBase.cpp | 10 ++++++++-- core/LocAdapterProxyBase.h | 5 +++++ core/gps_extended_c.h | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 23184dff..b304653a 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -69,8 +69,14 @@ void LocAdapterBase:: GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -DEFAULT_IMPL() + LocPosTechMask loc_technology_mask) { + if (mLocAdapterProxyBase == NULL || + !mLocAdapterProxyBase->reportPosition(location, + status, + loc_technology_mask)) { + DEFAULT_IMPL() + } +} void LocAdapterBase:: reportSv(GpsSvStatus &svStatus, diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index df5a48bd..f6c22afa 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -57,6 +57,11 @@ protected: public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; + inline virtual bool reportPosition(UlpLocation &location, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) { + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 8a4e340f..ff66ef5b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -72,6 +72,30 @@ extern "C" { #define AGPS_CERTIFICATE_MAX_LENGTH 2000 #define AGPS_CERTIFICATE_MAX_SLOTS 10 +/** Batching default ID for dummy batching session*/ +#define GPS_BATCHING_DEFAULT_ID 1 + +/** This cap is used to decide the FLP session cache +size on AP. If the BATCH_SIZE in flp.conf is less than +GPS_AP_BATCHING_SIZE_CAP, FLP session cache size will +be twice the BATCH_SIZE defined in flp.conf. Otherwise, +FLP session cache size will be equal to the BATCH_SIZE.*/ +#define GPS_AP_BATCHING_SIZE_CAP 40 + +#define GPS_BATCHING_OPERATION_SUCCEESS 1 +#define GPS_BATCHING_OPERATION_FAILURE 0 + +/** GPS extended batching flags*/ +#define GPS_EXT_BATCHING_ON_FULL 0x0000001 +#define GPS_EXT_BATCHING_ON_FIX 0x0000002 + +/** Reasons of GPS reports batched locations*/ +typedef enum loc_batching_reported_type { + LOC_BATCHING_ON_FULL_IND_REPORT, + LOC_BATCHING_ON_FIX_IND_REPORT, + LOC_BATCHING_ON_QUERY_REPORT +}LocBatchingReportedType; + enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, LOC_REGISTRATION_MASK_DISABLED From d5389169281474a3a3b3a2817ddb6271897607a3 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 20 Jan 2015 14:42:26 -0800 Subject: [PATCH 298/945] Send GPS tracking fixes to FLP HAL FLP HAL accepts GPS tracking fixes for tracking, so this change sends the tracking fixes to FLP HAL while flp tracking is undergoing. Also, this change adds batching options flags and batching succeed/failure definitions. CRs-fixed: 748687 Change-Id: I11a2ba337433d9a42c903d36fc980ee1a3983a1e --- core/LocAdapterBase.cpp | 10 ++++++++-- core/LocAdapterProxyBase.h | 5 +++++ core/gps_extended_c.h | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 1c0c1bc0..9eb75ec1 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -69,8 +69,14 @@ void LocAdapterBase:: GpsLocationExtended &locationExtended, void* locationExt, enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -DEFAULT_IMPL() + LocPosTechMask loc_technology_mask) { + if (mLocAdapterProxyBase == NULL || + !mLocAdapterProxyBase->reportPosition(location, + status, + loc_technology_mask)) { + DEFAULT_IMPL() + } +} void LocAdapterBase:: reportSv(GpsSvStatus &svStatus, diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index df5a48bd..f6c22afa 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -57,6 +57,11 @@ protected: public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; + inline virtual bool reportPosition(UlpLocation &location, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) { + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 3db36c47..9cfe12f5 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -74,6 +74,30 @@ extern "C" { #define AGPS_CERTIFICATE_MAX_LENGTH 2000 #define AGPS_CERTIFICATE_MAX_SLOTS 10 +/** Batching default ID for dummy batching session*/ +#define GPS_BATCHING_DEFAULT_ID 1 + +/** This cap is used to decide the FLP session cache +size on AP. If the BATCH_SIZE in flp.conf is less than +GPS_AP_BATCHING_SIZE_CAP, FLP session cache size will +be twice the BATCH_SIZE defined in flp.conf. Otherwise, +FLP session cache size will be equal to the BATCH_SIZE.*/ +#define GPS_AP_BATCHING_SIZE_CAP 40 + +#define GPS_BATCHING_OPERATION_SUCCEESS 1 +#define GPS_BATCHING_OPERATION_FAILURE 0 + +/** GPS extended batching flags*/ +#define GPS_EXT_BATCHING_ON_FULL 0x0000001 +#define GPS_EXT_BATCHING_ON_FIX 0x0000002 + +/** Reasons of GPS reports batched locations*/ +typedef enum loc_batching_reported_type { + LOC_BATCHING_ON_FULL_IND_REPORT, + LOC_BATCHING_ON_FIX_IND_REPORT, + LOC_BATCHING_ON_QUERY_REPORT +}LocBatchingReportedType; + enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, LOC_REGISTRATION_MASK_DISABLED From 1fe602a0a9befc09120355724062042210b9c32d Mon Sep 17 00:00:00 2001 From: sudarsanarao makupalli Date: Thu, 26 Feb 2015 11:29:06 -0800 Subject: [PATCH 299/945] Avoiding race conditions during the pallellized builds in Android system Removed relative paths and set Absolute paths in Android.mk file and moved corresponding files to right location Change-Id: Iacf2ee3dadb3e87c9354c1c4b8003cd8cc65ea97 CRs-Fixed: 714112 --- utils/Android.mk | 10 +++++----- .../elapsed_millis_since_boot.cpp | 0 .../platform_lib_abstractions}/platform_lib_includes.h | 0 .../platform_lib_abstractions}/platform_lib_macros.h | 0 .../platform_lib_abstractions}/platform_lib_time.h | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/elapsed_millis_since_boot.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/platform_lib_includes.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/platform_lib_macros.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/platform_lib_time.h (100%) diff --git a/utils/Android.mk b/utils/Android.mk index f34e1012..d672e3a1 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -19,7 +19,7 @@ LOCAL_SRC_FILES += \ linked_list.c \ loc_target.cpp \ loc_timer.c \ - ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + platform_lib_abstractions/elapsed_millis_since_boot.cpp \ loc_misc_utils.cpp LOCAL_CFLAGS += \ @@ -34,7 +34,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../platform_lib_abstractions + $(LOCAL_PATH)/platform_lib_abstractions LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -45,9 +45,9 @@ LOCAL_COPY_HEADERS:= \ msg_q.h \ loc_target.h \ loc_timer.h \ - ../platform_lib_abstractions/platform_lib_includes.h \ - ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.h \ + platform_lib_abstractions/platform_lib_includes.h \ + platform_lib_abstractions/platform_lib_time.h \ + platform_lib_abstractions/platform_lib_macros.h \ loc_misc_utils.h LOCAL_MODULE := libgps.utils diff --git a/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp similarity index 100% rename from platform_lib_abstractions/elapsed_millis_since_boot.cpp rename to utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp diff --git a/platform_lib_abstractions/platform_lib_includes.h b/utils/platform_lib_abstractions/platform_lib_includes.h similarity index 100% rename from platform_lib_abstractions/platform_lib_includes.h rename to utils/platform_lib_abstractions/platform_lib_includes.h diff --git a/platform_lib_abstractions/platform_lib_macros.h b/utils/platform_lib_abstractions/platform_lib_macros.h similarity index 100% rename from platform_lib_abstractions/platform_lib_macros.h rename to utils/platform_lib_abstractions/platform_lib_macros.h diff --git a/platform_lib_abstractions/platform_lib_time.h b/utils/platform_lib_abstractions/platform_lib_time.h similarity index 100% rename from platform_lib_abstractions/platform_lib_time.h rename to utils/platform_lib_abstractions/platform_lib_time.h From 7d367d0e62b59ec820a55d0c52ec9961d87c6d0d Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 2 Mar 2015 13:51:16 -0800 Subject: [PATCH 300/945] Add utility to identify lean targets This utility reads ro.lean system property and returns a 1 if the property is set to true and returns 0 otherwise. Change-Id: I52a8396ee085d44b90d8416131f27b0b1a46575e CRs-fixed: 801990 --- utils/loc_target.cpp | 14 ++++++++++++++ utils/loc_target.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index f829d511..08f5584d 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -244,3 +244,17 @@ 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/utils/loc_target.h b/utils/loc_target.h index 873ddfc3..3bb3b5e2 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -52,6 +52,11 @@ 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); +/*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. */ From f3444670b81fb399c7ef3862e0f101340413b74e Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 20 Mar 2015 09:30:39 -0700 Subject: [PATCH 301/945] Add Course TimeStamp & asso. unc to Measurement We need to add the course time stamp when the measurements are received in GNSS driver to align the measurements and sensor samples received from SLIM. Change-Id: I4ef067890e16c2585f8a9c7809c4d7421b895cd0 --- core/gps_extended_c.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 9cfe12f5..7a359823 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -36,6 +36,7 @@ extern "C" { #include #include #include +#include /** Location has valid source information. */ #define LOCATION_HAS_SOURCE_INFO 0x0020 @@ -905,6 +906,14 @@ typedef struct */ } Gnss_ClockMeasurementStructType; +typedef struct +{ + struct timespec apTimeStamp; + /*boottime received from pps-ktimer*/ + float apTimeStampUncertaintyMs; + /* timestamp uncertainty in milli seconds */ +}Gnss_ApTimeStampStructType; + typedef struct { size_t size; @@ -932,6 +941,8 @@ typedef struct Gnss_LocRcvrClockFrequencyInfoStructType clockFreq; /* Freq */ bool gnssMeasValid; Gnss_ClockMeasurementStructType gnssMeas; + Gnss_ApTimeStampStructType timeStamp; + } GnssSvMeasurementSet; typedef enum From a284b9a83bbef5e4a37cb73a17ea0944e23467ae Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 8 Apr 2015 18:02:42 -0700 Subject: [PATCH 302/945] Adding Mutex for Creating Context Adding lock for creating foreground context and background context, preventing any possible race condition. CRs-fixed: 820078 Change-Id: I7ace685622904ee2aa12f317540f9c04880acc70 --- core/LocDualContext.cpp | 22 ++++++++++++++++++++-- core/LocDualContext.h | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 41ad4f0a..d68cb3bc 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -61,6 +61,8 @@ ContextBase* LocDualContext::mInjectContext = NULL; const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; const char* LocDualContext::mLBSLibName = "liblbs_core.so"; +pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; + const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) { @@ -84,22 +86,30 @@ const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, const char* name) { + 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); 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); return mFgContext; } ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) + const char* name) { + pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); + LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); if (NULL == mFgContext) { + LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); const MsgTask* msgTask = getMsgTask(tAssociate, name); mFgContext = new LocDualContext(msgTask, mFgExclMask); @@ -109,14 +119,17 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, mInjectContext = mFgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mFgContext; - } ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, const char* name) { + 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); mBgContext = new LocDualContext(msgTask, mBgExclMask); @@ -126,13 +139,17 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, mInjectContext = mBgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mBgContext; } ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, const char* name) { + pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); + LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); if (NULL == mBgContext) { + LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); const MsgTask* msgTask = getMsgTask(tAssociate, name); mBgContext = new LocDualContext(msgTask, mBgExclMask); @@ -142,6 +159,7 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, mInjectContext = mBgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mBgContext; } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index cdc4df3e..1e96ea56 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -45,6 +45,7 @@ class LocDualContext : public ContextBase { const char* name); static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, const char* name); + static pthread_mutex_t mGetLocContextMutex; protected: LocDualContext(const MsgTask* msgTask, From 7fa3b1bd2a4f1c192007e140475ab29ae0223f25 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 8 Apr 2015 18:02:42 -0700 Subject: [PATCH 303/945] Adding Mutex for Creating Context Adding lock for creating foreground context and background context, preventing any possible race condition. CRs-fixed: 820078 Change-Id: I7ace685622904ee2aa12f317540f9c04880acc70 --- core/LocDualContext.cpp | 22 ++++++++++++++++++++-- core/LocDualContext.h | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 41ad4f0a..d68cb3bc 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -61,6 +61,8 @@ ContextBase* LocDualContext::mInjectContext = NULL; const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; const char* LocDualContext::mLBSLibName = "liblbs_core.so"; +pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; + const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, const char* name) { @@ -84,22 +86,30 @@ const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, const char* name) { + 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); 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); return mFgContext; } ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) + const char* name) { + pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); + LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); if (NULL == mFgContext) { + LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); const MsgTask* msgTask = getMsgTask(tAssociate, name); mFgContext = new LocDualContext(msgTask, mFgExclMask); @@ -109,14 +119,17 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, mInjectContext = mFgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mFgContext; - } ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, const char* name) { + 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); mBgContext = new LocDualContext(msgTask, mBgExclMask); @@ -126,13 +139,17 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, mInjectContext = mBgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mBgContext; } ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, const char* name) { + pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); + LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); if (NULL == mBgContext) { + LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); const MsgTask* msgTask = getMsgTask(tAssociate, name); mBgContext = new LocDualContext(msgTask, mBgExclMask); @@ -142,6 +159,7 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, mInjectContext = mBgContext; injectFeatureConfig(mInjectContext); } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); return mBgContext; } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index cdc4df3e..1e96ea56 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -45,6 +45,7 @@ class LocDualContext : public ContextBase { const char* name); static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, const char* name); + static pthread_mutex_t mGetLocContextMutex; protected: LocDualContext(const MsgTask* msgTask, From 9f7f4bd6d266f8050d9c0134026b479b461acf0d Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 27 Apr 2015 11:15:07 -0700 Subject: [PATCH 304/945] Remove reporting gps status from loc eng layer GPS Status is reported from Loc Api layer, so reporting it in Loc Eng layer in addition is redundant. Also, SSR should not send engine on status when not in a session. Change-Id: I10bc2d112574de0016110e193d6c2cd071b00b2a CRs-fixed: 826256 --- loc_api/libloc_api_50001/loc_eng.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index cda5ab03..7d3d6c76 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1955,7 +1955,6 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) ret_val == LOC_API_ADAPTER_ERR_INTERNAL) { loc_eng_data.adapter->setInSession(TRUE); - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -2001,11 +2000,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { ret_val = loc_eng_data.adapter->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); - } - loc_eng_data.adapter->setInSession(FALSE); } @@ -2886,8 +2880,6 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_agps_reinit(loc_eng_data); } - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); - // 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 From 892019f6c33829ef18e58b97910931fdc118777b Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Tue, 5 May 2015 14:09:00 -0700 Subject: [PATCH 305/945] Removed unused code and unnecessary notice files libloc_api-rpc code is not built for any targets, so it's removed. NOTICE file is unnecessary and can be remvoed. Change-Id: I7da6f0d5a7d90fd4ad7ef51d9eaee88d2a7a20ac CRs-fixed: 827856 --- loc_api/NOTICE | 13 - loc_api/libloc_api-rpc/Android.mk | 61 - loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 -- .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 - .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 - .../gen-1240/loc_api_common.xdr | 906 --------- .../gen-1240/loc_api_common_xdr.c | 1650 ----------------- .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 - .../gen-1240/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 -- .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 - .../gen-3200/loc_api_common.xdr | 803 -------- .../gen-3200/loc_api_common_xdr.c | 1441 -------------- .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 - .../gen-3200/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 --- loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ------------ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 -- .../inc-1240/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 -- loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 ---------- .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 -- .../inc-3200/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc/debug.h | 57 - loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 - .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 - 37 files changed, 10307 deletions(-) delete mode 100644 loc_api/NOTICE delete mode 100644 loc_api/libloc_api-rpc/Android.mk delete mode 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc/debug.h delete mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c diff --git a/loc_api/NOTICE b/loc_api/NOTICE deleted file mode 100644 index 85b5740d..00000000 --- a/loc_api/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk deleted file mode 100644 index 06e46948..00000000 --- a/loc_api/libloc_api-rpc/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) -RPC_INC:=inc-$(AMSS_VERSION) - -generated_files:= \ - gen-$(AMSS_VERSION)/loc_api_clnt.c \ - gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ - gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ - src/loc_apicb_appinit.c - -LOCAL_SRC_FILES:= $(generated_files) - -# removed from library build since the client should implement this code. -# src/loc_api_cb_server.c - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h -LOCAL_CFLAGS+=-DDEBUG -# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE - -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= librpc -LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc - - - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_cb.h \ - $(RPC_INC)/loc_api_common.h \ - $(RPC_INC)/loc_api.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - inc/debug.h \ - inc/loc_api_rpc_glue.h - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/$(RPC_INC) \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/librpc - -LOCAL_MODULE:= libloc_api-rpc -LOCAL_MODULE_OWNER := qcom - -include $(BUILD_STATIC_LIBRARY) - -endif -endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr deleted file mode 100644 index a9d60aa4..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr +++ /dev/null @@ -1,172 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - - - version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 -RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00040002; - - -} = 0x3000008c; - -const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr deleted file mode 100644 index 1bd4e151..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr +++ /dev/null @@ -1,85 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - -} = 0x3100008c; - -const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c deleted file mode 100644 index 52a0d15b..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c deleted file mode 100644 index dca1e8d5..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr deleted file mode 100644 index 4e01607d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr +++ /dev/null @@ -1,906 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040024; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; -const RPC_LOC_OPEN_VERSION = 0x00040001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; -const RPC_LOC_API_NULL_VERSION = 0x00040001; -const RPC_LOC_STOP_FIX_VERSION = 0x00040001; -const RPC_LOC_IOCTL_VERSION = 0x00040001; -const RPC_LOC_START_FIX_VERSION = 0x00040001; -const RPC_LOC_CLOSE_VERSION = 0x00040001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0004; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef bool rpc_boolean; - -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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[1200]; /* EVAL:[1200]*/ -}; - -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_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]; /* EVAL:[256]*/ -}; - -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; - 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - - typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - 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_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_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_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 -}; - -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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c deleted file mode 100644 index 7c860bf3..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, 1200)) - 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_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; - 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_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; - 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_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_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; - 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_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_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_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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c deleted file mode 100644 index fbaca8b6..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00040001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr deleted file mode 100644 index 981266b3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr +++ /dev/null @@ -1,164 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3000008c; - -const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr deleted file mode 100644 index 3f53504b..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr +++ /dev/null @@ -1,90 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3100008c; - -const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c deleted file mode 100644 index b1aa1998..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c deleted file mode 100644 index 79814d42..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr deleted file mode 100644 index 7ef6357c..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr +++ /dev/null @@ -1,803 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_OPEN_VERSION = 0x00010001; -const RPC_LOC_CLOSE_VERSION = 0x00010001; -const RPC_LOC_START_FIX_VERSION = 0x00010001; -const RPC_LOC_STOP_FIX_VERSION = 0x00010001; -const RPC_LOC_IOCTL_VERSION = 0x00010001; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; -const RPC_LOC_API_API_MAJOR_NUM = 0x0001; -typedef bool rpc_boolean; -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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; -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - 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 -}; - -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; - 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_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; -}; - -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; - 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_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; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - unsigned char 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; -}; - -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; - 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; - 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; -}; - -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; - 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_MAX = 268435456 -}; - -typedef string 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 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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -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_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_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_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_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; -}; - -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 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - string apn_name<>; -}; - -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; -}; - -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_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; - 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: - 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; - 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: - 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_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -const RPC_LOC_API_NULL_VERSION = 0x00010001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c deleted file mode 100644 index 7b37b9c3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, RPC_LOC_API_MAX_SV_COUNT, - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) - 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_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; - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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; - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_u_char (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; - - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) - 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; - - 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_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; - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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_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; - 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_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_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; - 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_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; - 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_string (xdrs, &objp->apn_name, ~0)) - 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_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_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; - 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: - 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; - 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: - 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c deleted file mode 100644 index 8c171222..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00010001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h deleted file mode 100644 index e02648cc..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api.h +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(); -extern bool_t rpc_loc_api_null_0x00040001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00040001(); -extern bool_t rpc_loc_open_0x00040001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(); -extern bool_t rpc_loc_close_0x00040001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00040001(); -extern bool_t rpc_loc_start_fix_0x00040001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); -extern bool_t rpc_loc_stop_fix_0x00040001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00040001(); -extern bool_t rpc_loc_ioctl_0x00040001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); -extern int loc_apiprog_0x00040001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00040002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00040002(); -extern bool_t rpc_loc_api_null_0x00040002_svc(); -extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h deleted file mode 100644 index 67ac0846..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00040001_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_0x00040001(); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); -extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h deleted file mode 100644 index 6ff3baf1..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040024 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 -#define RPC_LOC_OPEN_VERSION 0x00040001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 -#define RPC_LOC_API_NULL_VERSION 0x00040001 -#define RPC_LOC_STOP_FIX_VERSION 0x00040001 -#define RPC_LOC_IOCTL_VERSION 0x00040001 -#define RPC_LOC_START_FIX_VERSION 0x00040001 -#define RPC_LOC_CLOSE_VERSION 0x00040001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0004 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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[1200]; -}; -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_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_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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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_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_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_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; - -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; - -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_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_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_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_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h deleted file mode 100644 index 8998aca4..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(); -extern bool_t rpc_loc_api_null_0x00010001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00010001(); -extern bool_t rpc_loc_open_0x00010001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(); -extern bool_t rpc_loc_close_0x00010001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00010001(); -extern bool_t rpc_loc_start_fix_0x00010001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); -extern bool_t rpc_loc_stop_fix_0x00010001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00010001(); -extern bool_t rpc_loc_ioctl_0x00010001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); -extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h deleted file mode 100644 index 4f2f8f91..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00010001_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_0x00010001(); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); -extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h deleted file mode 100644 index 04be079f..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_OPEN_VERSION 0x00010001 -#define RPC_LOC_CLOSE_VERSION 0x00010001 -#define RPC_LOC_START_FIX_VERSION 0x00010001 -#define RPC_LOC_STOP_FIX_VERSION 0x00010001 -#define RPC_LOC_IOCTL_VERSION 0x00010001 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 -#define RPC_LOC_API_API_MAJOR_NUM 0x0001 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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; - struct { - u_int nmea_sentences_len; - char *nmea_sentences_val; - } nmea_sentences; -}; -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_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; - -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_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_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; - struct { - u_int addr_len; - char *addr_val; - } addr; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; - struct { - u_int requestor_id_string_len; - char *requestor_id_string_val; - } requestor_id_string; - 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; - struct { - u_int client_name_string_len; - char *client_name_string_val; - } client_name_string; - 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; - u_char 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; - struct { - u_int ext_client_address_len; - char *ext_client_address_val; - } ext_client_address; -}; -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; - struct { - u_int lcs_codeword_string_len; - char *lcs_codeword_string_val; - } lcs_codeword_string; - 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; - struct { - u_int notification_text_len; - char *notification_text_val; - } notification_text; - 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; - -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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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; - -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_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_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_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_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; -}; -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; - -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; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; - -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_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_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_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_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; -#define RPC_LOC_API_NULL_VERSION 0x00010001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h deleted file mode 100644 index a71b23a0..00000000 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h deleted file mode 100644 index ef972bd6..00000000 --- a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - @file: loc_api_rpc_glue.h - @brief: Loc API Android glue code header - - DESCRIPTION - Loc API Android glue code header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/17/09 dx Initial version - -$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ -======================================================================*/ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#include "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "loc_api_fixup.h" - -#ifdef __cplusplus -extern "C" -{ -#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 - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - 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 */ -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback -); - -extern int32 loc_close -( - 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 -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c deleted file mode 100644 index 7fcfd6cb..00000000 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "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; - } - xprt_unregister(svrPort); - svc_destroy(svrPort); - //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - svrPort = NULL; -} From 8a3533bd4a5f9dbedfed62723e0049044e2d3e94 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 27 Apr 2015 11:15:07 -0700 Subject: [PATCH 306/945] Remove reporting gps status from loc eng layer GPS Status is reported from Loc Api layer, so reporting it in Loc Eng layer in addition is redundant. Also, SSR should not send engine on status when not in a session. Change-Id: I10bc2d112574de0016110e193d6c2cd071b00b2a CRs-fixed: 826256 --- loc_api/libloc_api_50001/loc_eng.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f6b8cbf3..d3b06bff 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1955,7 +1955,6 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) ret_val == LOC_API_ADAPTER_ERR_INTERNAL) { loc_eng_data.adapter->setInSession(TRUE); - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -2001,11 +2000,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { ret_val = loc_eng_data.adapter->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); - } - loc_eng_data.adapter->setInSession(FALSE); } @@ -2889,8 +2883,6 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_agps_reinit(loc_eng_data); } - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); - // 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 From b8e9ad34cd1c0b2932f776fd6cf9c37e3dd4f0af Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Tue, 5 May 2015 14:09:00 -0700 Subject: [PATCH 307/945] Removed unused code and unnecessary notice files libloc_api-rpc code is not built for any targets, so it's removed. NOTICE file is unnecessary and can be remvoed. Change-Id: I7da6f0d5a7d90fd4ad7ef51d9eaee88d2a7a20ac CRs-fixed: 827856 --- loc_api/NOTICE | 13 - loc_api/libloc_api-rpc/Android.mk | 61 - loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 -- .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 - .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 - .../gen-1240/loc_api_common.xdr | 906 --------- .../gen-1240/loc_api_common_xdr.c | 1650 ----------------- .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 - .../gen-1240/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 -- .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 - .../gen-3200/loc_api_common.xdr | 803 -------- .../gen-3200/loc_api_common_xdr.c | 1441 -------------- .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 - .../gen-3200/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 --- loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ------------ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 -- .../inc-1240/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 -- loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 ---------- .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 -- .../inc-3200/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc/debug.h | 57 - loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 - .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 - 37 files changed, 10307 deletions(-) delete mode 100644 loc_api/NOTICE delete mode 100644 loc_api/libloc_api-rpc/Android.mk delete mode 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc/debug.h delete mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c diff --git a/loc_api/NOTICE b/loc_api/NOTICE deleted file mode 100644 index 85b5740d..00000000 --- a/loc_api/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk deleted file mode 100644 index 06e46948..00000000 --- a/loc_api/libloc_api-rpc/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) -RPC_INC:=inc-$(AMSS_VERSION) - -generated_files:= \ - gen-$(AMSS_VERSION)/loc_api_clnt.c \ - gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ - gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ - src/loc_apicb_appinit.c - -LOCAL_SRC_FILES:= $(generated_files) - -# removed from library build since the client should implement this code. -# src/loc_api_cb_server.c - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h -LOCAL_CFLAGS+=-DDEBUG -# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE - -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= librpc -LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc - - - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_cb.h \ - $(RPC_INC)/loc_api_common.h \ - $(RPC_INC)/loc_api.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - inc/debug.h \ - inc/loc_api_rpc_glue.h - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/$(RPC_INC) \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/librpc - -LOCAL_MODULE:= libloc_api-rpc -LOCAL_MODULE_OWNER := qcom - -include $(BUILD_STATIC_LIBRARY) - -endif -endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr deleted file mode 100644 index a9d60aa4..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr +++ /dev/null @@ -1,172 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - - - version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 -RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00040002; - - -} = 0x3000008c; - -const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr deleted file mode 100644 index 1bd4e151..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr +++ /dev/null @@ -1,85 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - -} = 0x3100008c; - -const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c deleted file mode 100644 index 52a0d15b..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c deleted file mode 100644 index dca1e8d5..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr deleted file mode 100644 index 4e01607d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr +++ /dev/null @@ -1,906 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040024; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; -const RPC_LOC_OPEN_VERSION = 0x00040001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; -const RPC_LOC_API_NULL_VERSION = 0x00040001; -const RPC_LOC_STOP_FIX_VERSION = 0x00040001; -const RPC_LOC_IOCTL_VERSION = 0x00040001; -const RPC_LOC_START_FIX_VERSION = 0x00040001; -const RPC_LOC_CLOSE_VERSION = 0x00040001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0004; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef bool rpc_boolean; - -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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[1200]; /* EVAL:[1200]*/ -}; - -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_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]; /* EVAL:[256]*/ -}; - -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; - 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - - typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - 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_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_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_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 -}; - -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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c deleted file mode 100644 index 7c860bf3..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, 1200)) - 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_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; - 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_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; - 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_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_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; - 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_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_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_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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c deleted file mode 100644 index fbaca8b6..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00040001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr deleted file mode 100644 index 981266b3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr +++ /dev/null @@ -1,164 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3000008c; - -const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr deleted file mode 100644 index 3f53504b..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr +++ /dev/null @@ -1,90 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3100008c; - -const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c deleted file mode 100644 index b1aa1998..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c deleted file mode 100644 index 79814d42..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr deleted file mode 100644 index 7ef6357c..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr +++ /dev/null @@ -1,803 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_OPEN_VERSION = 0x00010001; -const RPC_LOC_CLOSE_VERSION = 0x00010001; -const RPC_LOC_START_FIX_VERSION = 0x00010001; -const RPC_LOC_STOP_FIX_VERSION = 0x00010001; -const RPC_LOC_IOCTL_VERSION = 0x00010001; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; -const RPC_LOC_API_API_MAJOR_NUM = 0x0001; -typedef bool rpc_boolean; -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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; -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - 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 -}; - -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; - 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_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; -}; - -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; - 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_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; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - unsigned char 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; -}; - -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; - 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; - 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; -}; - -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; - 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_MAX = 268435456 -}; - -typedef string 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 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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -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_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_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_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_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; -}; - -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 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - string apn_name<>; -}; - -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; -}; - -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_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; - 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: - 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; - 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: - 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_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -const RPC_LOC_API_NULL_VERSION = 0x00010001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c deleted file mode 100644 index 7b37b9c3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, RPC_LOC_API_MAX_SV_COUNT, - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) - 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_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; - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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; - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_u_char (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; - - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) - 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; - - 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_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; - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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_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; - 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_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_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; - 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_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; - 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_string (xdrs, &objp->apn_name, ~0)) - 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_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_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; - 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: - 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; - 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: - 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c deleted file mode 100644 index 8c171222..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00010001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h deleted file mode 100644 index e02648cc..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api.h +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(); -extern bool_t rpc_loc_api_null_0x00040001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00040001(); -extern bool_t rpc_loc_open_0x00040001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(); -extern bool_t rpc_loc_close_0x00040001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00040001(); -extern bool_t rpc_loc_start_fix_0x00040001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); -extern bool_t rpc_loc_stop_fix_0x00040001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00040001(); -extern bool_t rpc_loc_ioctl_0x00040001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); -extern int loc_apiprog_0x00040001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00040002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00040002(); -extern bool_t rpc_loc_api_null_0x00040002_svc(); -extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h deleted file mode 100644 index 67ac0846..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00040001_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_0x00040001(); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); -extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h deleted file mode 100644 index 6ff3baf1..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040024 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 -#define RPC_LOC_OPEN_VERSION 0x00040001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 -#define RPC_LOC_API_NULL_VERSION 0x00040001 -#define RPC_LOC_STOP_FIX_VERSION 0x00040001 -#define RPC_LOC_IOCTL_VERSION 0x00040001 -#define RPC_LOC_START_FIX_VERSION 0x00040001 -#define RPC_LOC_CLOSE_VERSION 0x00040001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0004 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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[1200]; -}; -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_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_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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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_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_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_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; - -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; - -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_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_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_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_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h deleted file mode 100644 index 8998aca4..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(); -extern bool_t rpc_loc_api_null_0x00010001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00010001(); -extern bool_t rpc_loc_open_0x00010001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(); -extern bool_t rpc_loc_close_0x00010001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00010001(); -extern bool_t rpc_loc_start_fix_0x00010001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); -extern bool_t rpc_loc_stop_fix_0x00010001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00010001(); -extern bool_t rpc_loc_ioctl_0x00010001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); -extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h deleted file mode 100644 index 4f2f8f91..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00010001_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_0x00010001(); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); -extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h deleted file mode 100644 index 04be079f..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_OPEN_VERSION 0x00010001 -#define RPC_LOC_CLOSE_VERSION 0x00010001 -#define RPC_LOC_START_FIX_VERSION 0x00010001 -#define RPC_LOC_STOP_FIX_VERSION 0x00010001 -#define RPC_LOC_IOCTL_VERSION 0x00010001 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 -#define RPC_LOC_API_API_MAJOR_NUM 0x0001 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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; - struct { - u_int nmea_sentences_len; - char *nmea_sentences_val; - } nmea_sentences; -}; -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_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; - -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_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_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; - struct { - u_int addr_len; - char *addr_val; - } addr; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; - struct { - u_int requestor_id_string_len; - char *requestor_id_string_val; - } requestor_id_string; - 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; - struct { - u_int client_name_string_len; - char *client_name_string_val; - } client_name_string; - 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; - u_char 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; - struct { - u_int ext_client_address_len; - char *ext_client_address_val; - } ext_client_address; -}; -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; - struct { - u_int lcs_codeword_string_len; - char *lcs_codeword_string_val; - } lcs_codeword_string; - 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; - struct { - u_int notification_text_len; - char *notification_text_val; - } notification_text; - 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; - -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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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; - -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_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_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_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_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; -}; -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; - -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; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; - -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_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_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_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_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; -#define RPC_LOC_API_NULL_VERSION 0x00010001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h deleted file mode 100644 index a71b23a0..00000000 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h deleted file mode 100644 index ef972bd6..00000000 --- a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - @file: loc_api_rpc_glue.h - @brief: Loc API Android glue code header - - DESCRIPTION - Loc API Android glue code header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/17/09 dx Initial version - -$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ -======================================================================*/ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#include "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "loc_api_fixup.h" - -#ifdef __cplusplus -extern "C" -{ -#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 - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - 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 */ -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback -); - -extern int32 loc_close -( - 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 -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c deleted file mode 100644 index 7fcfd6cb..00000000 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "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; - } - xprt_unregister(svrPort); - svc_destroy(svrPort); - //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - svrPort = NULL; -} From 18d81539155dcb5cd5006c81568851fd8909cdb3 Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Tue, 5 May 2015 14:09:00 -0700 Subject: [PATCH 308/945] Removed unused code and unnecessary notice files libloc_api-rpc code is not built for any targets, so it's removed. NOTICE file is unnecessary and can be remvoed. Change-Id: I7da6f0d5a7d90fd4ad7ef51d9eaee88d2a7a20ac CRs-fixed: 827856 --- loc_api/NOTICE | 13 - loc_api/libloc_api-rpc/Android.mk | 61 - loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 -- .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 - .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 - .../gen-1240/loc_api_common.xdr | 906 --------- .../gen-1240/loc_api_common_xdr.c | 1650 ----------------- .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 - .../gen-1240/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 -- .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 - .../gen-3200/loc_api_common.xdr | 803 -------- .../gen-3200/loc_api_common_xdr.c | 1441 -------------- .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 - .../gen-3200/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 --- loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ------------ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 -- .../inc-1240/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 -- loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 ---------- .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 -- .../inc-3200/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc/debug.h | 57 - loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 - .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 - 37 files changed, 10307 deletions(-) delete mode 100644 loc_api/NOTICE delete mode 100644 loc_api/libloc_api-rpc/Android.mk delete mode 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc/debug.h delete mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c diff --git a/loc_api/NOTICE b/loc_api/NOTICE deleted file mode 100644 index 85b5740d..00000000 --- a/loc_api/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk deleted file mode 100644 index 06e46948..00000000 --- a/loc_api/libloc_api-rpc/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) -RPC_INC:=inc-$(AMSS_VERSION) - -generated_files:= \ - gen-$(AMSS_VERSION)/loc_api_clnt.c \ - gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ - gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ - src/loc_apicb_appinit.c - -LOCAL_SRC_FILES:= $(generated_files) - -# removed from library build since the client should implement this code. -# src/loc_api_cb_server.c - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h -LOCAL_CFLAGS+=-DDEBUG -# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE - -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= librpc -LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc - - - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_cb.h \ - $(RPC_INC)/loc_api_common.h \ - $(RPC_INC)/loc_api.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - inc/debug.h \ - inc/loc_api_rpc_glue.h - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/$(RPC_INC) \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/librpc - -LOCAL_MODULE:= libloc_api-rpc -LOCAL_MODULE_OWNER := qcom - -include $(BUILD_STATIC_LIBRARY) - -endif -endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr deleted file mode 100644 index a9d60aa4..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr +++ /dev/null @@ -1,172 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - - - version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 -RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00040002; - - -} = 0x3000008c; - -const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr deleted file mode 100644 index 1bd4e151..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr +++ /dev/null @@ -1,85 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - -} = 0x3100008c; - -const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c deleted file mode 100644 index 52a0d15b..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c deleted file mode 100644 index dca1e8d5..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr deleted file mode 100644 index 4e01607d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr +++ /dev/null @@ -1,906 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040024; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; -const RPC_LOC_OPEN_VERSION = 0x00040001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; -const RPC_LOC_API_NULL_VERSION = 0x00040001; -const RPC_LOC_STOP_FIX_VERSION = 0x00040001; -const RPC_LOC_IOCTL_VERSION = 0x00040001; -const RPC_LOC_START_FIX_VERSION = 0x00040001; -const RPC_LOC_CLOSE_VERSION = 0x00040001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0004; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef bool rpc_boolean; - -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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[1200]; /* EVAL:[1200]*/ -}; - -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_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]; /* EVAL:[256]*/ -}; - -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; - 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - - typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - 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_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_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_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 -}; - -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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c deleted file mode 100644 index 7c860bf3..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, 1200)) - 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_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; - 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_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; - 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_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_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; - 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_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_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_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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c deleted file mode 100644 index fbaca8b6..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00040001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr deleted file mode 100644 index 981266b3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr +++ /dev/null @@ -1,164 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3000008c; - -const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr deleted file mode 100644 index 3f53504b..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr +++ /dev/null @@ -1,90 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3100008c; - -const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c deleted file mode 100644 index b1aa1998..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c deleted file mode 100644 index 79814d42..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr deleted file mode 100644 index 7ef6357c..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr +++ /dev/null @@ -1,803 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_OPEN_VERSION = 0x00010001; -const RPC_LOC_CLOSE_VERSION = 0x00010001; -const RPC_LOC_START_FIX_VERSION = 0x00010001; -const RPC_LOC_STOP_FIX_VERSION = 0x00010001; -const RPC_LOC_IOCTL_VERSION = 0x00010001; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; -const RPC_LOC_API_API_MAJOR_NUM = 0x0001; -typedef bool rpc_boolean; -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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; -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - 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 -}; - -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; - 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_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; -}; - -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; - 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_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; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - unsigned char 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; -}; - -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; - 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; - 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; -}; - -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; - 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_MAX = 268435456 -}; - -typedef string 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 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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -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_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_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_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_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; -}; - -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 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - string apn_name<>; -}; - -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; -}; - -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_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; - 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: - 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; - 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: - 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_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -const RPC_LOC_API_NULL_VERSION = 0x00010001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c deleted file mode 100644 index 7b37b9c3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, RPC_LOC_API_MAX_SV_COUNT, - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) - 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_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; - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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; - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_u_char (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; - - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) - 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; - - 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_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; - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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_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; - 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_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_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; - 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_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; - 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_string (xdrs, &objp->apn_name, ~0)) - 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_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_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; - 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: - 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; - 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: - 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c deleted file mode 100644 index 8c171222..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00010001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h deleted file mode 100644 index e02648cc..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api.h +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(); -extern bool_t rpc_loc_api_null_0x00040001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00040001(); -extern bool_t rpc_loc_open_0x00040001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(); -extern bool_t rpc_loc_close_0x00040001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00040001(); -extern bool_t rpc_loc_start_fix_0x00040001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); -extern bool_t rpc_loc_stop_fix_0x00040001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00040001(); -extern bool_t rpc_loc_ioctl_0x00040001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); -extern int loc_apiprog_0x00040001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00040002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00040002(); -extern bool_t rpc_loc_api_null_0x00040002_svc(); -extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h deleted file mode 100644 index 67ac0846..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00040001_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_0x00040001(); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); -extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h deleted file mode 100644 index 6ff3baf1..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040024 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 -#define RPC_LOC_OPEN_VERSION 0x00040001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 -#define RPC_LOC_API_NULL_VERSION 0x00040001 -#define RPC_LOC_STOP_FIX_VERSION 0x00040001 -#define RPC_LOC_IOCTL_VERSION 0x00040001 -#define RPC_LOC_START_FIX_VERSION 0x00040001 -#define RPC_LOC_CLOSE_VERSION 0x00040001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0004 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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[1200]; -}; -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_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_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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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_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_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_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; - -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; - -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_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_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_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_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h deleted file mode 100644 index 8998aca4..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(); -extern bool_t rpc_loc_api_null_0x00010001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00010001(); -extern bool_t rpc_loc_open_0x00010001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(); -extern bool_t rpc_loc_close_0x00010001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00010001(); -extern bool_t rpc_loc_start_fix_0x00010001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); -extern bool_t rpc_loc_stop_fix_0x00010001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00010001(); -extern bool_t rpc_loc_ioctl_0x00010001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); -extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h deleted file mode 100644 index 4f2f8f91..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00010001_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_0x00010001(); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); -extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h deleted file mode 100644 index 04be079f..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_OPEN_VERSION 0x00010001 -#define RPC_LOC_CLOSE_VERSION 0x00010001 -#define RPC_LOC_START_FIX_VERSION 0x00010001 -#define RPC_LOC_STOP_FIX_VERSION 0x00010001 -#define RPC_LOC_IOCTL_VERSION 0x00010001 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 -#define RPC_LOC_API_API_MAJOR_NUM 0x0001 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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; - struct { - u_int nmea_sentences_len; - char *nmea_sentences_val; - } nmea_sentences; -}; -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_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; - -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_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_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; - struct { - u_int addr_len; - char *addr_val; - } addr; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; - struct { - u_int requestor_id_string_len; - char *requestor_id_string_val; - } requestor_id_string; - 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; - struct { - u_int client_name_string_len; - char *client_name_string_val; - } client_name_string; - 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; - u_char 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; - struct { - u_int ext_client_address_len; - char *ext_client_address_val; - } ext_client_address; -}; -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; - struct { - u_int lcs_codeword_string_len; - char *lcs_codeword_string_val; - } lcs_codeword_string; - 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; - struct { - u_int notification_text_len; - char *notification_text_val; - } notification_text; - 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; - -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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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; - -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_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_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_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_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; -}; -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; - -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; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; - -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_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_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_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_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; -#define RPC_LOC_API_NULL_VERSION 0x00010001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h deleted file mode 100644 index a71b23a0..00000000 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h deleted file mode 100644 index ef972bd6..00000000 --- a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - @file: loc_api_rpc_glue.h - @brief: Loc API Android glue code header - - DESCRIPTION - Loc API Android glue code header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/17/09 dx Initial version - -$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ -======================================================================*/ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#include "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "loc_api_fixup.h" - -#ifdef __cplusplus -extern "C" -{ -#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 - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - 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 */ -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback -); - -extern int32 loc_close -( - 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 -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c deleted file mode 100644 index 7fcfd6cb..00000000 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "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; - } - xprt_unregister(svrPort); - svc_destroy(svrPort); - //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - svrPort = NULL; -} From 4e8b3506bf3cdc7800f59ee71bab20862d1de5b5 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 1 Jun 2015 10:42:46 -0700 Subject: [PATCH 309/945] Add new event mask for timezone Modem sends this event to request for injection of timezone and offset from UTC Change-Id: Ie94f660efc3163cbde243a9bccb94d37785349b3 CRs-fixed: 846501 --- core/gps_extended_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index ff66ef5b..1af74efa 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -372,7 +372,7 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -401,6 +401,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ (1< Date: Mon, 8 Jun 2015 13:01:43 -0700 Subject: [PATCH 310/945] Fix gps.conf capabilities overwrited by carrier If overwrite happened, loc config update will restore gps.conf capabilities based on target type. Change-Id: I958ce8da0e8062549f12808aca4aebcf4a7fb95d CRs-Fixed: 850144 --- loc_api/libloc_api_50001/loc.cpp | 15 ++++++++++++--- loc_api/libloc_api_50001/loc_eng.cpp | 18 +++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4cf4ba95..1ff6f328 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -202,7 +202,7 @@ static const GnssConfigurationInterface sLocEngConfigInterface = static loc_eng_data_s_type loc_afw_data; static int gss_fd = -1; - +static int sGnssType = GNSS_UNKNOWN; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -254,8 +254,8 @@ extern "C" const GpsInterface* get_gps_interface() target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - int gnssType = getTargetGnssType(target); - switch (gnssType) + sGnssType = getTargetGnssType(target); + switch (sGnssType) { case GNSS_GSS: case GNSS_AUTO: @@ -1147,6 +1147,15 @@ 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); } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 7d3d6c76..9f62ce22 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2052,14 +2052,12 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - int gnssType = getTargetGnssType(loc_get_target()); - - // The position mode for GSS/QCA1530 can only be standalone - bool is1530 = gnssType == GNSS_QCA1530; - bool isAPQ = gnssType == GNSS_GSS; - if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) { + // 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 GSS/qca1530."); + LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -2331,10 +2329,8 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - int gnssType = getTargetGnssType(loc_get_target()); - bool isAPQ = (gnssType == GNSS_GSS); - bool is1530 = (gnssType == GNSS_QCA1530); - if (!isAPQ && !is1530) { + if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, From 634c1bb8bda7a3e953962cbff0343046b74a861f Mon Sep 17 00:00:00 2001 From: Qaing Chen Date: Thu, 11 Jun 2015 16:52:05 -0700 Subject: [PATCH 311/945] Fix Memory leak in util/loc_cfg.cpp deallocate conf_copy after usage. Change-Id: I8ad4e4e8007a2d8b608f3f74503515f062b86c4b CRs-fixed: 852809 --- utils/loc_cfg.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 7ffe6a43..a7697762 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -330,24 +330,25 @@ int loc_update_conf(const char* conf_data, int32_t length, // make a copy, so we do not tokenize the original data char* conf_copy = (char*)malloc(length+1); - if(conf_copy !=NULL) + if (conf_copy != NULL) { - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; - } + 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; + // 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); + 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); } } From 4d44ce3d6c9e0f6c2ba885316401e5103c92dc22 Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Mon, 8 Jun 2015 13:01:43 -0700 Subject: [PATCH 312/945] Fix gps.conf capabilities overwrited by carrier If overwrite happened, loc config update will restore gps.conf capabilities based on target type. Change-Id: I958ce8da0e8062549f12808aca4aebcf4a7fb95d CRs-Fixed: 850144 --- loc_api/libloc_api_50001/loc.cpp | 15 ++++++++++++--- loc_api/libloc_api_50001/loc_eng.cpp | 18 +++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 2c39e925..fda34604 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -202,7 +202,7 @@ static const GnssConfigurationInterface sLocEngConfigInterface = static loc_eng_data_s_type loc_afw_data; static int gss_fd = -1; - +static int sGnssType = GNSS_UNKNOWN; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -254,8 +254,8 @@ extern "C" const GpsInterface* get_gps_interface() target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - int gnssType = getTargetGnssType(target); - switch (gnssType) + sGnssType = getTargetGnssType(target); + switch (sGnssType) { case GNSS_GSS: case GNSS_AUTO: @@ -1157,6 +1157,15 @@ 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); } diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index d3b06bff..8bf6bfac 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2052,14 +2052,12 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - int gnssType = getTargetGnssType(loc_get_target()); - - // The position mode for GSS/QCA1530 can only be standalone - bool is1530 = gnssType == GNSS_QCA1530; - bool isAPQ = gnssType == GNSS_GSS; - if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) { + // 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 GSS/qca1530."); + LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -2334,10 +2332,8 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - int gnssType = getTargetGnssType(loc_get_target()); - bool isAPQ = (gnssType == GNSS_GSS); - bool is1530 = (gnssType == GNSS_QCA1530); - if (!isAPQ && !is1530) { + if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, From 339a4fc58f11c054568c0b69a5a8d7b2dd041690 Mon Sep 17 00:00:00 2001 From: Qaing Chen Date: Thu, 11 Jun 2015 16:52:05 -0700 Subject: [PATCH 313/945] Fix Memory leak in util/loc_cfg.cpp deallocate conf_copy after usage. Change-Id: I8ad4e4e8007a2d8b608f3f74503515f062b86c4b CRs-fixed: 852809 --- utils/loc_cfg.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 7ffe6a43..a7697762 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -330,24 +330,25 @@ int loc_update_conf(const char* conf_data, int32_t length, // make a copy, so we do not tokenize the original data char* conf_copy = (char*)malloc(length+1); - if(conf_copy !=NULL) + if (conf_copy != NULL) { - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; - } + 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; + // 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); + 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); } } From 0826e30db247cb8873f65b14f5e5b054688c5bbb Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 18 Jun 2015 16:02:16 -0700 Subject: [PATCH 314/945] Disable ESUPL from configuration ESUPL initialization path waits on data services to come-up whichtakes approx. 10 sec adding to TTFF. The GSS in APQ will not beused for Emergency services (for VoLTE) hence disabling for APQautomitive Change-Id: Ifc82abadcaa4a859d344251fac065c5e632c8c6f --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index a1d5d2cc..142c8288 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -49,7 +49,7 @@ SUPL_ES=1 #Choose PDN for Emergency SUPL #1 - Use emergency PDN #0 - Use regular SUPL PDN for Emergency SUPL -USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 +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 over write the value from From dd823bc93e10e9a25967d2e9bbfee3d0bb0e454e Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 17 Jun 2015 14:27:50 -0700 Subject: [PATCH 315/945] Add glo and bds to used-in-fix mask The used-in-fix mask is only keeping track of GPS SVs, so add a used-in-fix mask for GlONASS SVs and BDS SVs as well to avoid NMEA generation issues CRs-fixed: 826152 Change-Id: I33862cf8d40db1d667179ef68d18703edc359843 --- core/LocAdapterBase.cpp | 2 +- core/LocAdapterBase.h | 2 +- core/LocApiBase.cpp | 9 ++-- core/LocApiBase.h | 2 +- core/UlpProxyBase.h | 2 +- core/gps_extended_c.h | 41 +++++++++++++++++++ .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 12 ++++-- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 +- loc_api/libloc_api_50001/LocEngAdapter.h | 4 +- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_msg.h | 4 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 8 ++-- loc_api/libloc_api_50001/loc_eng_nmea.h | 3 +- 13 files changed, 73 insertions(+), 22 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index b304653a..4e62693d 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(GpsSvStatus &svStatus, + reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 9d5f6a81..c7e3f1c1 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -92,7 +92,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index f56694e7..5c852729 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -253,15 +253,16 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GpsSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used" - " in fix mask: %x\n sv: prn snr elevation azimuth", + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" + " mask: %x/%x/%x\n sv: prn snr elevation azimuth", svStatus.num_svs, svStatus.ephemeris_mask, - svStatus.almanac_mask, svStatus.used_in_fix_mask); + svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, + svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { LOC_LOGV(" %d: %d %f %f %f", i, diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 414769b5..b1c3d30a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -113,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GpsSvStatus &svStatus, + void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index b9a8224f..d08ad711 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -58,7 +58,7 @@ public: LocPosTechMask loc_technology_mask) { return false; } - inline virtual bool reportSv(GpsSvStatus &svStatus, + inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { return false; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index ff66ef5b..4f3e8fe9 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -290,6 +290,47 @@ typedef struct GpsExtLocation_s { uint32_t sources_used; } GpsExtLocation; +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GnssSvStatus) */ + size_t size; + + /** Number of SVs currently visible. */ + int num_svs; + + /** Contains an array of SV information. */ + GpsSvInfo sv_list[GPS_MAX_SVS]; + + /** Represents a bit mask indicating which SVs + * have ephemeris data. + */ + uint32_t ephemeris_mask; + + /** Represents a bit mask indicating which SVs + * have almanac data. + */ + uint32_t almanac_mask; + + /** + * Represents a bit mask indicating which GPS SVs + * were used for computing the most recent position fix. + */ + uint32_t gps_used_in_fix_mask; + + /** + * Represents a bit mask indicating which GLONASS SVs + * were used for computing the most recent position fix. + */ + uint32_t glo_used_in_fix_mask; + + /** + * Represents a bit mask indicating which BDS SVs + * were used for computing the most recent position fix. + */ + uint64_t bds_used_in_fix_mask; + +} GnssSvStatus; + enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index dbfc2fb7..c7447543 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -797,7 +797,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { - GpsSvStatus SvStatus = {0}; + GnssSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; @@ -823,7 +823,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS) { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + 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 @@ -842,7 +842,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) && (sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK)) { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); + SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); } } // SBAS: GPS RPN: 120-151, @@ -855,6 +855,12 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) // 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 diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 2f025af2..0c497aa3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -203,14 +203,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, +void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GpsSvStatus &svStatus, +void LocEngAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index e5d10184..8ae8992a 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -55,7 +55,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -269,7 +269,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9f62ce22..722f99a2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -850,7 +850,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index e3c48fb4..731f9288 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GpsSvStatus mSvStatus; + const GnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 4c6b9a3a..7bc58bd0 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -604,7 +604,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -790,7 +790,9 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.used_in_fix_mask == 0) + if (svStatus.gps_used_in_fix_mask == 0 && + svStatus.glo_used_in_fix_mask == 0 && + svStatus.bds_used_in_fix_mask == 0) { // No sv used, so there will be no position report, so send // blank NMEA sentences strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); @@ -812,7 +814,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, else { // cache the used in fix mask, as it will be needed to send $GPGSA // during the position report - loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; + loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; // For RPC, the DOP are sent during sv report, so cache them // now to be sent during position report. diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 40c6dbbd..066943aa 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -31,12 +31,13 @@ #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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); +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 From f72e672afe64b2e50004fa3d20edb697ed057b1a Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 25 Jun 2015 21:27:30 -0700 Subject: [PATCH 316/945] Revert "Add new event mask for timezone" This reverts commit 4e8b3506bf3cdc7800f59ee71bab20862d1de5b5 Change-Id: I09a7ec9fdbeda62636df2a43bc6f3a633b978e99 --- core/gps_extended_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index c688f076..4f3e8fe9 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -413,7 +413,7 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -442,7 +442,6 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ (1< Date: Wed, 24 Jun 2015 15:46:43 -0700 Subject: [PATCH 317/945] Add to check ZPP report condition for NMEA generation NMEA is supposed to be generated only when GPS tracking is going on in GPS HAL but it was also observed when ZPP report, so add a check if isInSession is true to avoid that. Change-Id: Ia6152fe78243d45e71adccce956d0a727c3f17a2 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 722f99a2..998681f0 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -815,8 +815,14 @@ void LocEngReportPosition::proc() const { 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 && mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS && + locEng->adapter->isInSession() && mTechMask & (LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID)) From 447fe95020858e01834716bb627883a7da34126f Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:29:29 -0700 Subject: [PATCH 318/945] LCA additions to ULP and log_util defines 1. Add two new ulp location sources (PIP and NLP) ULP_LOCATION_IS_FROM_NLP to mark locations from NLP ULP_LOCATION_IS_FROM_PIP to mark locations from PIP 2. Introduce a macro for printing exit log with error. CRs-Fixed: 694343 Change-Id: Ifa11803df2ed4fc249a5c339acfeeb5d89bf55d5 --- core/gps_extended_c.h | 7 +++++-- utils/loc_log.cpp | 1 + utils/log_util.h | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 7a359823..29375883 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -63,9 +63,12 @@ extern "C" { #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 /** Positioin is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 -#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** 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 0X0040 +#define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 #define ULP_MIN_INTERVAL_INVALID 0xffffffff diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 18182b74..5500dead 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -51,6 +51,7 @@ 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; diff --git a/utils/log_util.h b/utils/log_util.h index 8ff6b5a3..ffd5ca97 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -81,6 +81,8 @@ 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 @@ -157,12 +159,18 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } while(0) - #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 From 8834b304c9219de6dd592a2399ca1ac5c0b7eb0c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:29:55 -0700 Subject: [PATCH 319/945] Fix implicit declaration errors in gps hal Including string.h and stdlib.h to fix compiler errors. Change-Id: I4e79c71b9e5691e51850adcc52f52b36f8e3d088 --- core/gps_extended_c.h | 4 +++- loc_api/libloc_api_50001/gps.c | 3 ++- utils/loc_target.cpp | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 29375883..1014bab2 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -35,6 +35,8 @@ extern "C" { #include #include +#include +#include #include #include diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index b0669af2..29f20f42 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 @@ -30,6 +30,7 @@ #include #include +#include extern const GpsInterface* get_gps_interface(); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 08f5584d..faaedf6c 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include From db7fc90da2f6d85cf3f6844c2a580d24bd344de5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:30:09 -0700 Subject: [PATCH 320/945] Move modem power vote out of hal The modem power vote feature needs to move out of hal as it has non-aosp dependency CRs-fixed: 831075 Change-Id: Ic83276e9d3c0d125a01f50719102fcd7c0455385 --- core/ContextBase.h | 1 + core/LBSProxyBase.h | 1 + core/LocAdapterBase.cpp | 4 - core/LocAdapterBase.h | 1 - loc_api/libloc_api_50001/Android.mk | 13 -- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 - loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc.cpp | 168 +-------------------- loc_api/libloc_api_50001/loc.h | 2 - loc_api/libloc_api_50001/loc_eng.cpp | 48 ------ loc_api/libloc_api_50001/loc_eng.h | 1 - loc_api/libloc_api_50001/loc_eng_msg.h | 7 - 12 files changed, 4 insertions(+), 248 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 2adbedd6..ff7a4b33 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -58,6 +58,7 @@ public: inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } + inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 0b7dbdf1..75ae9922 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -53,6 +53,7 @@ public: unsigned long capabilities) const {} inline virtual bool hasAgpsExtendedCapabilities() const { return false; } inline virtual bool hasCPIExtendedCapabilities() const { return false; } + inline virtual void modemPowerVote(bool power) const {} virtual void injectFeatureConfig(ContextBase* context) const {} }; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 9eb75ec1..19fab0e5 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -142,10 +142,6 @@ bool LocAdapterBase:: requestNiNotify(GpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) -void LocAdapterBase:: - shutdown() -DEFAULT_IMPL() - void LocAdapterBase:: reportGpsMeasurementData(GpsData &gpsMeasurementData) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 8e817b78..7e0b0ebc 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -112,7 +112,6 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } - virtual void shutdown(); ContextBase* getContext() const { return mContext; } virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 27c53cf2..4f80e0a6 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -96,19 +96,6 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core -ifeq ($(filter $(TARGET_DEVICE), apq8064 msm8960),) -$(call print-vars, $(TARGET_DEVICE)) -LOCAL_SHARED_LIBRARIES += \ - libmdmdetect \ - libperipheral_client - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libmdmdetect/inc \ - $(TARGET_OUT_HEADERS)/libperipheralclient/inc -LOCAL_CFLAGS += \ - -DMODEM_POWER_VOTE -endif - LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 4b4cd5e3..7089741b 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -53,10 +53,6 @@ void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } -void LocInternalAdapter::shutdown() { - sendMsg(new LocEngShutdown(mLocEngAdapter)); -} - LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, MsgTask::tCreate tCreator) : diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b8fedec2..bc41ac1d 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -64,7 +64,6 @@ public: virtual void stopFixInt(); virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); - virtual void shutdown(); }; typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); @@ -307,6 +306,7 @@ public: mPowerVote = powerOn ? (mPowerVote | POWER_VOTE_VALUE) : (mPowerVote & ~POWER_VOTE_VALUE); requestPowerVote(); + mContext->modemPowerVote(powerOn); } inline bool getPowerVote() const { return (mPowerVote & POWER_VOTE_VALUE) != 0 ; diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index fda34604..ed9ff9b9 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -45,17 +45,6 @@ #include #include -#ifdef MODEM_POWER_VOTE -#include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -#include -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /*MODEM_POWER_VOTE*/ - using namespace loc_core; #define LOC_PM_CLIENT_NAME "GPS" @@ -81,7 +70,6 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static const void* loc_get_extension(const char* name); -static void loc_close_mdm_node(); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = { @@ -134,24 +122,6 @@ static const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; -#ifdef MODEM_POWER_VOTE -typedef struct { - //MAX_NAME_LEN defined in mdm_detect.h - char modem_name[MAX_NAME_LEN]; - //MAX_PATH_LEN defined in mdm_detect.h - char powerup_node[MAX_PATH_LEN]; - //this handle is used by peripheral mgr - void *handle; - int mdm_fd; - MdmType mdm_type; - bool peripheral_mgr_supported; - bool peripheral_mgr_registered; -}s_loc_mdm_info; -static s_loc_mdm_info loc_mdm_info; -static void loc_pm_event_notifier(void *client_data, enum pm_event event); -#endif /*MODEM_POWER_VOTE*/ -// For shutting down MDM in fusion devices -static int mdm_fd = -1; static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); static void loc_gps_measurement_close(); @@ -303,11 +273,6 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; -#ifdef MODEM_POWER_VOTE - enum pm_event mdm_state; - static int mdm_index = -1; - int peripheral_mgr_ret = PM_RET_FAILED; -#endif /*MODEM_POWER_VOTE*/ unsigned int target = (unsigned int) -1; ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -347,7 +312,7 @@ static int loc_init(GpsCallbacks* callbacks) NULL, /* location_ext_parser */ NULL, /* sv_ext_parser */ callbacks->request_utc_time_cb, /* request_utc_time_cb */ - loc_close_mdm_node /*loc_shutdown_cb*/}; + }; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; @@ -369,132 +334,11 @@ static int loc_init(GpsCallbacks* callbacks) LOC_LOGD("loc_eng_init() success!"); -#ifdef MODEM_POWER_VOTE - //if index is 0 or more, then we've looked for mdm already - LOC_LOGD("%s:%d]: mdm_index: %d", __func__, __LINE__, - mdm_index); - if (mdm_index < 0) { - struct dev_info modem_info; - memset(&modem_info, 0, sizeof(struct dev_info)); - if(get_system_info(&modem_info) != RET_SUCCESS) { - LOC_LOGE("%s:%d]: Error: get_system_info returned error\n", - __func__, __LINE__); - goto err; - } - - for(mdm_index = 0; - mdm_index < modem_info.num_modems; - mdm_index++) { - if(modem_info.mdm_list[mdm_index].mdm_name) { - //Copy modem name to register with peripheral manager - strlcpy(loc_mdm_info.modem_name, - modem_info.mdm_list[mdm_index].mdm_name, - sizeof(loc_mdm_info.modem_name)); - //copy powerup node name if we need to use mdmdetect method - strlcpy(loc_mdm_info.powerup_node, - modem_info.mdm_list[mdm_index].powerup_node, - sizeof(loc_mdm_info.powerup_node)); - loc_mdm_info.mdm_type = modem_info.mdm_list[mdm_index].type; - LOC_LOGD("%s:%d]: Found modem: %s, powerup node:%s at index: %d", - __func__, __LINE__, loc_mdm_info.modem_name, loc_mdm_info.powerup_node, - mdm_index); - break; - } - } - } - - if(loc_mdm_info.peripheral_mgr_registered != true) { - peripheral_mgr_ret = pm_client_register(loc_pm_event_notifier, - &loc_mdm_info, - loc_mdm_info.modem_name, - LOC_PM_CLIENT_NAME, - &mdm_state, - &loc_mdm_info.handle); - if(peripheral_mgr_ret == PM_RET_SUCCESS) { - loc_mdm_info.peripheral_mgr_supported = true; - loc_mdm_info.peripheral_mgr_registered = true; - LOC_LOGD("%s:%d]: registered with peripheral mgr for %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else if(peripheral_mgr_ret == PM_RET_UNSUPPORTED) { - loc_mdm_info.peripheral_mgr_registered = true; - loc_mdm_info.peripheral_mgr_supported = false; - LOC_LOGD("%s:%d]: peripheral mgr unsupported for: %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else { - //Not setting any flags here so that we can try again the next time around - LOC_LOGE("%s:%d]: Error: pm_client_register returned: %d", - __func__, __LINE__, peripheral_mgr_ret); - } - } - - if(loc_mdm_info.peripheral_mgr_supported == false && - loc_mdm_info.peripheral_mgr_registered == true) { - //Peripheral mgr is not supported - //use legacy method to open the powerup node - LOC_LOGD("%s:%d]: powerup_node: %s", __func__, __LINE__, - loc_mdm_info.powerup_node); - loc_mdm_info.mdm_fd = open(loc_mdm_info.powerup_node, O_RDONLY); - - if (loc_mdm_info.mdm_fd < 0) { - LOC_LOGE("Error: %s open failed: %s\n", - loc_mdm_info.powerup_node, strerror(errno)); - } else { - LOC_LOGD("%s opens success!", loc_mdm_info.powerup_node); - } - } - else if(loc_mdm_info.peripheral_mgr_supported == true && - loc_mdm_info.peripheral_mgr_registered == true) { - LOC_LOGD("%s:%d]: Voting for modem power up", __func__, __LINE__); - pm_client_connect(loc_mdm_info.handle); - } - else { - LOC_LOGD("%s:%d]: Not voted for modem power up due to errors", __func__, __LINE__); - } -#endif /*MODEM_POWER_VOTE*/ err: EXIT_LOG(%d, retVal); return retVal; } -/*=========================================================================== -FUNCTION loc_close_mdm_node - -DESCRIPTION - closes loc_mdm_info.mdm_fd which is the modem powerup node obtained in loc_init - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_close_mdm_node() -{ - ENTRY_LOG(); -#ifdef MODEM_POWER_VOTE - if(loc_mdm_info.peripheral_mgr_supported == true) { - LOC_LOGD("%s:%d]: Voting for modem power down", __func__, __LINE__); - pm_client_disconnect(loc_mdm_info.handle); - } - else if (loc_mdm_info.mdm_fd >= 0) { - LOC_LOGD("closing the powerup node"); - close(loc_mdm_info.mdm_fd); - loc_mdm_info.mdm_fd = -1; - LOC_LOGD("finished closing the powerup node"); - } - else { - LOC_LOGD("powerup node has not been opened yet."); - } -#endif /*MODEM_POWER_VOTE*/ - EXIT_LOG(%s, VOID_RET); -} - /*=========================================================================== FUNCTION loc_cleanup @@ -519,7 +363,6 @@ static void loc_cleanup() loc_afw_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); loc_eng_cleanup(loc_afw_data); - loc_close_mdm_node(); gps_loc_cb = NULL; gps_sv_cb = NULL; @@ -1192,12 +1035,3 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } -#ifdef MODEM_POWER_VOTE -static void loc_pm_event_notifier(void *client_data, enum pm_event event) -{ - ENTRY_LOG(); - LOC_LOGD("%s:%d]: event: %d", __func__, __LINE__, (int)event); - pm_client_event_acknowledge(loc_mdm_info.handle, event); - EXIT_LOG(%s, VOID_RET); -} -#endif /*MODEM_POWER_VOTE*/ diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 63528664..e56fdcf8 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -44,7 +44,6 @@ extern "C" { 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 void (*loc_shutdown_cb) (void); typedef struct { loc_location_cb_ext location_cb; @@ -58,7 +57,6 @@ typedef struct { loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; gps_request_utc_time request_utc_time_cb; - loc_shutdown_cb shutdown_cb; } LocCallbacks; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 8bf6bfac..a81df97b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -205,7 +205,6 @@ 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 loc_eng_handle_shutdown(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); @@ -345,28 +344,6 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } - -LocEngShutdown::LocEngShutdown(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngShutdown::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - LOC_LOGD("%s:%d]: Calling loc_eng_handle_shutdown", __func__, __LINE__); - loc_eng_handle_shutdown(*locEng); -} -inline void LocEngShutdown::locallog() const -{ - LOC_LOGV("LocEngShutdown"); -} -inline void LocEngShutdown::log() const -{ - locallog(); -} - -// case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; const GpsUtcTime mTime; @@ -1774,7 +1751,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ? callbacks->sv_ext_parser : noProc; loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS; - loc_eng_data.shutdown_cb = callbacks->shutdown_cb; // 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; @@ -2948,30 +2924,6 @@ int loc_eng_read_config(void) return 0; } -/*=========================================================================== -FUNCTION loc_eng_handle_shutdown - -DESCRIPTION - Calls the shutdown callback function in the loc interface to close - the modem node - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_handle_shutdown(loc_eng_data_s_type &locEng) -{ - ENTRY_LOG(); - locEng.shutdown_cb(); - EXIT_LOG(%d, 0); -} - /*=========================================================================== FUNCTION loc_eng_gps_measurement_init diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 813da482..a203e6bb 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -137,7 +137,6 @@ typedef struct loc_eng_data_s loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; - loc_shutdown_cb shutdown_cb; } loc_eng_data_s_type; /* GPS.conf support */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index e3c48fb4..5626c346 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -299,13 +299,6 @@ struct LocEngReportGpsMeasurement : public LocMsg { virtual void log() const; }; -struct LocEngShutdown : public LocMsg { - LocEngAdapter* mAdapter; - LocEngShutdown(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; #ifdef __cplusplus } #endif /* __cplusplus */ From d33d2162677a787774e4cecbf0982c24f39ff98b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:30:14 -0700 Subject: [PATCH 321/945] Add feature set configuration Some features are flagged out builds because of a lack of support. Change-Id: I067bcf88432d74b49e60eaab86409f178cf45e7d --- core/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/Android.mk b/core/Android.mk index e076dcc4..6a08b6a9 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -12,6 +12,8 @@ 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 := \ From 99606eb4149baabd9ceda3b5c38939ea65317d78 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:29:55 -0700 Subject: [PATCH 322/945] Fix implicit declaration errors in gps hal. Including string.h and stdlib.h to fix compiler errors Change-Id: I4e79c71b9e5691e51850adcc52f52b36f8e3d088 --- core/gps_extended_c.h | 4 +++- loc_api/libloc_api_50001/gps.c | 3 ++- utils/loc_target.cpp | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 4f3e8fe9..f3edbd96 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -35,6 +35,8 @@ extern "C" { #include #include +#include +#include #include /** Location has valid source information. */ diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index b0669af2..29f20f42 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 @@ -30,6 +30,7 @@ #include #include +#include extern const GpsInterface* get_gps_interface(); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 08f5584d..faaedf6c 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include From fb8732c9f53decac543033fead9a71e6a0fa6ca4 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:30:14 -0700 Subject: [PATCH 323/945] Add compile flag to disable unsupported features. Allows compilation on builds that have no support for certain features Change-Id: I067bcf88432d74b49e60eaab86409f178cf45e7d --- core/Android.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/Android.mk b/core/Android.mk index e076dcc4..6a08b6a9 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -12,6 +12,8 @@ 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 := \ From 1b07337c5a12e0d11d84ea0378a15cdffd504e76 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:29:29 -0700 Subject: [PATCH 324/945] LCA additions to ULP and log_util defines. 1. Add two new ulp location sources (PIP and NLP) ULP_LOCATION_IS_FROM_NLP to mark locations from NLP ULP_LOCATION_IS_FROM_PIP to mark locations from PIP 2. Introduce a macro for printing exit log with error CRs-Fixed: 694343 Change-Id: Ifa11803df2ed4fc249a5c339acfeeb5d89bf55d5 --- core/gps_extended_c.h | 5 ++++- utils/loc_log.cpp | 1 + utils/log_util.h | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index f3edbd96..4cb9ede3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -64,7 +64,10 @@ extern "C" { #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 /** Positioin is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 -#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from NLP */ +#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from PIP */ +#define ULP_LOCATION_IS_FROM_PIP 0x0040 #define ULP_MIN_INTERVAL_INVALID 0xffffffff diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 18182b74..5500dead 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -51,6 +51,7 @@ 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; diff --git a/utils/log_util.h b/utils/log_util.h index 8ff6b5a3..ffd5ca97 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -81,6 +81,8 @@ 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 @@ -157,12 +159,18 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } while(0) - #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 From 2572d24770c95cddda04e4c9dce10259033e2382 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Jul 2015 17:30:09 -0700 Subject: [PATCH 325/945] Move modem power vote out of hal. The modem power vote feature needs to move out of hal as it has non-aosp dependency. CRs-fixed: 831075 Change-Id: Ic83276e9d3c0d125a01f50719102fcd7c0455385 --- core/ContextBase.h | 1 + core/LBSProxyBase.h | 1 + core/LocAdapterBase.cpp | 4 - core/LocAdapterBase.h | 1 - loc_api/libloc_api_50001/Android.mk | 13 -- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 - loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc.cpp | 168 +-------------------- loc_api/libloc_api_50001/loc.h | 2 - loc_api/libloc_api_50001/loc_eng.cpp | 48 ------ loc_api/libloc_api_50001/loc_eng.h | 1 - loc_api/libloc_api_50001/loc_eng_msg.h | 7 - 12 files changed, 4 insertions(+), 248 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 2adbedd6..ff7a4b33 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -58,6 +58,7 @@ public: inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } + inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 0b7dbdf1..75ae9922 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -53,6 +53,7 @@ public: unsigned long capabilities) const {} inline virtual bool hasAgpsExtendedCapabilities() const { return false; } inline virtual bool hasCPIExtendedCapabilities() const { return false; } + inline virtual void modemPowerVote(bool power) const {} virtual void injectFeatureConfig(ContextBase* context) const {} }; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 4e62693d..4f7e4f23 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -135,10 +135,6 @@ bool LocAdapterBase:: requestNiNotify(GpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) -void LocAdapterBase:: - shutdown() -DEFAULT_IMPL() - void LocAdapterBase:: reportGpsMeasurementData(GpsData &gpsMeasurementData) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index c7e3f1c1..5f4660b8 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -110,7 +110,6 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } - virtual void shutdown(); ContextBase* getContext() const { return mContext; } virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 27c53cf2..4f80e0a6 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -96,19 +96,6 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core -ifeq ($(filter $(TARGET_DEVICE), apq8064 msm8960),) -$(call print-vars, $(TARGET_DEVICE)) -LOCAL_SHARED_LIBRARIES += \ - libmdmdetect \ - libperipheral_client - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libmdmdetect/inc \ - $(TARGET_OUT_HEADERS)/libperipheralclient/inc -LOCAL_CFLAGS += \ - -DMODEM_POWER_VOTE -endif - LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 0c497aa3..fd6f9b09 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -53,10 +53,6 @@ void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } -void LocInternalAdapter::shutdown() { - sendMsg(new LocEngShutdown(mLocEngAdapter)); -} - LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, MsgTask::tCreate tCreator) : diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 8ae8992a..9e01b98c 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -64,7 +64,6 @@ public: virtual void stopFixInt(); virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); - virtual void shutdown(); }; typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); @@ -305,6 +304,7 @@ public: mPowerVote = powerOn ? (mPowerVote | POWER_VOTE_VALUE) : (mPowerVote & ~POWER_VOTE_VALUE); requestPowerVote(); + mContext->modemPowerVote(powerOn); } inline bool getPowerVote() const { return (mPowerVote & POWER_VOTE_VALUE) != 0 ; diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 1ff6f328..d735b97a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -45,17 +45,6 @@ #include #include -#ifdef MODEM_POWER_VOTE -#include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -#include -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /*MODEM_POWER_VOTE*/ - using namespace loc_core; #define LOC_PM_CLIENT_NAME "GPS" @@ -81,7 +70,6 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static const void* loc_get_extension(const char* name); -static void loc_close_mdm_node(); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = { @@ -134,24 +122,6 @@ static const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; -#ifdef MODEM_POWER_VOTE -typedef struct { - //MAX_NAME_LEN defined in mdm_detect.h - char modem_name[MAX_NAME_LEN]; - //MAX_PATH_LEN defined in mdm_detect.h - char powerup_node[MAX_PATH_LEN]; - //this handle is used by peripheral mgr - void *handle; - int mdm_fd; - MdmType mdm_type; - bool peripheral_mgr_supported; - bool peripheral_mgr_registered; -}s_loc_mdm_info; -static s_loc_mdm_info loc_mdm_info; -static void loc_pm_event_notifier(void *client_data, enum pm_event event); -#endif /*MODEM_POWER_VOTE*/ -// For shutting down MDM in fusion devices -static int mdm_fd = -1; static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); static void loc_gps_measurement_close(); @@ -303,11 +273,6 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; -#ifdef MODEM_POWER_VOTE - enum pm_event mdm_state; - static int mdm_index = -1; - int peripheral_mgr_ret = PM_RET_FAILED; -#endif /*MODEM_POWER_VOTE*/ ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -337,7 +302,7 @@ static int loc_init(GpsCallbacks* callbacks) NULL, /* location_ext_parser */ NULL, /* sv_ext_parser */ callbacks->request_utc_time_cb, /* request_utc_time_cb */ - loc_close_mdm_node /*loc_shutdown_cb*/}; + }; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; @@ -359,132 +324,11 @@ static int loc_init(GpsCallbacks* callbacks) LOC_LOGD("loc_eng_init() success!"); -#ifdef MODEM_POWER_VOTE - //if index is 0 or more, then we've looked for mdm already - LOC_LOGD("%s:%d]: mdm_index: %d", __func__, __LINE__, - mdm_index); - if (mdm_index < 0) { - struct dev_info modem_info; - memset(&modem_info, 0, sizeof(struct dev_info)); - if(get_system_info(&modem_info) != RET_SUCCESS) { - LOC_LOGE("%s:%d]: Error: get_system_info returned error\n", - __func__, __LINE__); - goto err; - } - - for(mdm_index = 0; - mdm_index < modem_info.num_modems; - mdm_index++) { - if(modem_info.mdm_list[mdm_index].mdm_name) { - //Copy modem name to register with peripheral manager - strlcpy(loc_mdm_info.modem_name, - modem_info.mdm_list[mdm_index].mdm_name, - sizeof(loc_mdm_info.modem_name)); - //copy powerup node name if we need to use mdmdetect method - strlcpy(loc_mdm_info.powerup_node, - modem_info.mdm_list[mdm_index].powerup_node, - sizeof(loc_mdm_info.powerup_node)); - loc_mdm_info.mdm_type = modem_info.mdm_list[mdm_index].type; - LOC_LOGD("%s:%d]: Found modem: %s, powerup node:%s at index: %d", - __func__, __LINE__, loc_mdm_info.modem_name, loc_mdm_info.powerup_node, - mdm_index); - break; - } - } - } - - if(loc_mdm_info.peripheral_mgr_registered != true) { - peripheral_mgr_ret = pm_client_register(loc_pm_event_notifier, - &loc_mdm_info, - loc_mdm_info.modem_name, - LOC_PM_CLIENT_NAME, - &mdm_state, - &loc_mdm_info.handle); - if(peripheral_mgr_ret == PM_RET_SUCCESS) { - loc_mdm_info.peripheral_mgr_supported = true; - loc_mdm_info.peripheral_mgr_registered = true; - LOC_LOGD("%s:%d]: registered with peripheral mgr for %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else if(peripheral_mgr_ret == PM_RET_UNSUPPORTED) { - loc_mdm_info.peripheral_mgr_registered = true; - loc_mdm_info.peripheral_mgr_supported = false; - LOC_LOGD("%s:%d]: peripheral mgr unsupported for: %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else { - //Not setting any flags here so that we can try again the next time around - LOC_LOGE("%s:%d]: Error: pm_client_register returned: %d", - __func__, __LINE__, peripheral_mgr_ret); - } - } - - if(loc_mdm_info.peripheral_mgr_supported == false && - loc_mdm_info.peripheral_mgr_registered == true) { - //Peripheral mgr is not supported - //use legacy method to open the powerup node - LOC_LOGD("%s:%d]: powerup_node: %s", __func__, __LINE__, - loc_mdm_info.powerup_node); - loc_mdm_info.mdm_fd = open(loc_mdm_info.powerup_node, O_RDONLY); - - if (loc_mdm_info.mdm_fd < 0) { - LOC_LOGE("Error: %s open failed: %s\n", - loc_mdm_info.powerup_node, strerror(errno)); - } else { - LOC_LOGD("%s opens success!", loc_mdm_info.powerup_node); - } - } - else if(loc_mdm_info.peripheral_mgr_supported == true && - loc_mdm_info.peripheral_mgr_registered == true) { - LOC_LOGD("%s:%d]: Voting for modem power up", __func__, __LINE__); - pm_client_connect(loc_mdm_info.handle); - } - else { - LOC_LOGD("%s:%d]: Not voted for modem power up due to errors", __func__, __LINE__); - } -#endif /*MODEM_POWER_VOTE*/ err: EXIT_LOG(%d, retVal); return retVal; } -/*=========================================================================== -FUNCTION loc_close_mdm_node - -DESCRIPTION - closes loc_mdm_info.mdm_fd which is the modem powerup node obtained in loc_init - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_close_mdm_node() -{ - ENTRY_LOG(); -#ifdef MODEM_POWER_VOTE - if(loc_mdm_info.peripheral_mgr_supported == true) { - LOC_LOGD("%s:%d]: Voting for modem power down", __func__, __LINE__); - pm_client_disconnect(loc_mdm_info.handle); - } - else if (loc_mdm_info.mdm_fd >= 0) { - LOC_LOGD("closing the powerup node"); - close(loc_mdm_info.mdm_fd); - loc_mdm_info.mdm_fd = -1; - LOC_LOGD("finished closing the powerup node"); - } - else { - LOC_LOGD("powerup node has not been opened yet."); - } -#endif /*MODEM_POWER_VOTE*/ - EXIT_LOG(%s, VOID_RET); -} - /*=========================================================================== FUNCTION loc_cleanup @@ -509,7 +353,6 @@ static void loc_cleanup() loc_afw_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); loc_eng_cleanup(loc_afw_data); - loc_close_mdm_node(); gps_loc_cb = NULL; gps_sv_cb = NULL; @@ -1182,12 +1025,3 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } -#ifdef MODEM_POWER_VOTE -static void loc_pm_event_notifier(void *client_data, enum pm_event event) -{ - ENTRY_LOG(); - LOC_LOGD("%s:%d]: event: %d", __func__, __LINE__, (int)event); - pm_client_event_acknowledge(loc_mdm_info.handle, event); - EXIT_LOG(%s, VOID_RET); -} -#endif /*MODEM_POWER_VOTE*/ diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 63528664..e56fdcf8 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -44,7 +44,6 @@ extern "C" { 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 void (*loc_shutdown_cb) (void); typedef struct { loc_location_cb_ext location_cb; @@ -58,7 +57,6 @@ typedef struct { loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; gps_request_utc_time request_utc_time_cb; - loc_shutdown_cb shutdown_cb; } LocCallbacks; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 998681f0..3bb4168f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -205,7 +205,6 @@ 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 loc_eng_handle_shutdown(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); @@ -345,28 +344,6 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } - -LocEngShutdown::LocEngShutdown(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngShutdown::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - LOC_LOGD("%s:%d]: Calling loc_eng_handle_shutdown", __func__, __LINE__); - loc_eng_handle_shutdown(*locEng); -} -inline void LocEngShutdown::locallog() const -{ - LOC_LOGV("LocEngShutdown"); -} -inline void LocEngShutdown::log() const -{ - locallog(); -} - -// case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; const GpsUtcTime mTime; @@ -1780,7 +1757,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ? callbacks->sv_ext_parser : noProc; loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS; - loc_eng_data.shutdown_cb = callbacks->shutdown_cb; // 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; @@ -2951,30 +2927,6 @@ int loc_eng_read_config(void) return 0; } -/*=========================================================================== -FUNCTION loc_eng_handle_shutdown - -DESCRIPTION - Calls the shutdown callback function in the loc interface to close - the modem node - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_handle_shutdown(loc_eng_data_s_type &locEng) -{ - ENTRY_LOG(); - locEng.shutdown_cb(); - EXIT_LOG(%d, 0); -} - /*=========================================================================== FUNCTION loc_eng_gps_measurement_init diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 813da482..a203e6bb 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -137,7 +137,6 @@ typedef struct loc_eng_data_s loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; - loc_shutdown_cb shutdown_cb; } loc_eng_data_s_type; /* GPS.conf support */ diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 731f9288..9c7b9bcd 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -299,13 +299,6 @@ struct LocEngReportGpsMeasurement : public LocMsg { virtual void log() const; }; -struct LocEngShutdown : public LocMsg { - LocEngAdapter* mAdapter; - LocEngShutdown(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; #ifdef __cplusplus } #endif /* __cplusplus */ From d0faf18e26bdc4bfc38c164b3f3060843e443ba5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 May 2015 15:05:48 -0700 Subject: [PATCH 326/945] Remove DeleteAidingData additions The additions of more Satellite types that require gps.h changes are removed. Change-Id: Ib0ab285af7b9bee886c5f7a256d638f2fd7fee9d --- core/loc_core_log.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 1b220104..216dd598 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -116,23 +116,6 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), NAME_VAL( GPS_DELETE_CELLDB_INFO ), -#ifndef PDK_FEATURE_SET - NAME_VAL( GPS_DELETE_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GLO_DELETE_EPHEMERIS ), - NAME_VAL( GLO_DELETE_ALMANAC ), - NAME_VAL( GLO_DELETE_SVDIR ), - NAME_VAL( GLO_DELETE_SVSTEER ), - NAME_VAL( GLO_DELETE_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GLO_DELETE_TIME ), - NAME_VAL( BDS_DELETE_SVDIR ), - NAME_VAL( BDS_DELETE_SVSTEER ), - NAME_VAL( BDS_DELETE_TIME ), - NAME_VAL( BDS_DELETE_ALMANAC_CORR ), - NAME_VAL( BDS_DELETE_EPHEMERIS ), - NAME_VAL( BDS_DELETE_ALMANAC ), -#endif NAME_VAL( GPS_DELETE_ALL) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From 509979c39540f68b7f1325ae5439c6dc16b1440c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 May 2015 15:05:48 -0700 Subject: [PATCH 327/945] Remove DeleteAidingData additions The additions of more Satellite types that require gps.h changes are removed. Change-Id: Ib0ab285af7b9bee886c5f7a256d638f2fd7fee9d --- core/loc_core_log.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 1b220104..216dd598 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -116,23 +116,6 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_SADATA ), NAME_VAL( GPS_DELETE_RTI ), NAME_VAL( GPS_DELETE_CELLDB_INFO ), -#ifndef PDK_FEATURE_SET - NAME_VAL( GPS_DELETE_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), - NAME_VAL( GLO_DELETE_EPHEMERIS ), - NAME_VAL( GLO_DELETE_ALMANAC ), - NAME_VAL( GLO_DELETE_SVDIR ), - NAME_VAL( GLO_DELETE_SVSTEER ), - NAME_VAL( GLO_DELETE_ALMANAC_CORR ), - NAME_VAL( GPS_DELETE_TIME_GPS ), - NAME_VAL( GLO_DELETE_TIME ), - NAME_VAL( BDS_DELETE_SVDIR ), - NAME_VAL( BDS_DELETE_SVSTEER ), - NAME_VAL( BDS_DELETE_TIME ), - NAME_VAL( BDS_DELETE_ALMANAC_CORR ), - NAME_VAL( BDS_DELETE_EPHEMERIS ), - NAME_VAL( BDS_DELETE_ALMANAC ), -#endif NAME_VAL( GPS_DELETE_ALL) }; static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); From 078314504dc235e5f63e1fcf241f47a849f82799 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 3 Aug 2015 18:50:42 -0700 Subject: [PATCH 328/945] NMEA generation change to prevent 2Hz reporting GPGGA/GPRMC/GPGSA can be reported two times per second in some cases where we lose all satellite signals. We should report these NMEA sentences only from position report to prevent this. CRs-fixed: 884484 Change-Id: I123d9f074ca725703c6e90397160b701033e22f0 --- loc_api/libloc_api_50001/loc_eng.cpp | 6 +-- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 54 +++++++---------------- 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3bb4168f..0fee9d60 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -798,11 +798,7 @@ void LocEngReportPosition::proc() const { locEng->engine_status, locEng->adapter->isInSession()); if (locEng->generateNmea && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS && - locEng->adapter->isInSession() && - mTechMask & (LOC_POS_TECH_MASK_SATELLITE | - LOC_POS_TECH_MASK_SENSORS | - LOC_POS_TECH_MASK_HYBRID)) + locEng->adapter->isInSession()) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 7bc58bd0..126a97f0 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -790,48 +790,24 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.gps_used_in_fix_mask == 0 && - svStatus.glo_used_in_fix_mask == 0 && - svStatus.bds_used_in_fix_mask == 0) - { // No sv used, so there will be no position report, so send - // blank NMEA sentences - 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); + // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; - 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); + // 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 - { // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; - - // 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; - } - + { + loc_eng_data_p->pdop = 0; + loc_eng_data_p->hdop = 0; + loc_eng_data_p->vdop = 0; } EXIT_LOG(%d, 0); From bb5d2d4bfb12df717f35f3d2365ce0263d319fe7 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 16 Jun 2015 09:57:42 -0700 Subject: [PATCH 329/945] Adding a number of utilities LocHeap, LocThread, LocTimer, and moved MsgTask to utils. Also added are LocRankable and LocRunnable abstract classes. Change-Id: I76975455d24f2c84a95dcc1b04f79fea562ea5ba CRs-Fixed: 855222 --- core/Android.mk | 2 - utils/Android.mk | 12 +- utils/LocHeap.cpp | 354 +++++++++++++++++++ utils/LocHeap.h | 96 ++++++ utils/LocThread.cpp | 252 ++++++++++++++ utils/LocThread.h | 87 +++++ utils/LocTimer.cpp | 664 ++++++++++++++++++++++++++++++++++++ utils/LocTimer.h | 67 ++++ {core => utils}/MsgTask.cpp | 149 ++++---- {core => utils}/MsgTask.h | 41 ++- utils/loc_timer.c | 202 ----------- utils/loc_timer.h | 32 +- 12 files changed, 1644 insertions(+), 314 deletions(-) create mode 100644 utils/LocHeap.cpp create mode 100644 utils/LocHeap.h create mode 100644 utils/LocThread.cpp create mode 100644 utils/LocThread.h create mode 100644 utils/LocTimer.cpp create mode 100644 utils/LocTimer.h rename {core => utils}/MsgTask.cpp (55%) rename {core => utils}/MsgTask.h (71%) delete mode 100644 utils/loc_timer.c diff --git a/core/Android.mk b/core/Android.mk index 6a08b6a9..267b31f7 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -23,7 +23,6 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_SRC_FILES += \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ @@ -39,7 +38,6 @@ LOCAL_C_INCLUDES:= \ LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ diff --git a/utils/Android.mk b/utils/Android.mk index d672e3a1..c9b1788d 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -18,13 +18,17 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - loc_timer.c \ platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ loc_misc_utils.cpp LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -std=c++11 ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER @@ -43,6 +47,10 @@ LOCAL_COPY_HEADERS:= \ log_util.h \ linked_list.h \ msg_q.h \ + MsgTask.h \ + LocHeap.h \ + LocThread.h \ + LocTimer.h \ loc_target.h \ loc_timer.h \ platform_lib_abstractions/platform_lib_includes.h \ diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp new file mode 100644 index 00000000..41268789 --- /dev/null +++ b/utils/LocHeap.cpp @@ -0,0 +1,354 @@ +/* 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 (!outRanks(*mLeft) || !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 (!outRanks(*mRight) || !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/utils/LocHeap.h b/utils/LocHeap.h new file mode 100644 index 00000000..b491948a --- /dev/null +++ b/utils/LocHeap.h @@ -0,0 +1,96 @@ +/* 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/utils/LocThread.cpp b/utils/LocThread.cpp new file mode 100644 index 00000000..ec1e0719 --- /dev/null +++ b/utils/LocThread.cpp @@ -0,0 +1,252 @@ +/* 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 + +class LocThreadDelegate { + LocRunnable* mRunnable; + bool mJoinable; + pthread_t mThandle; + pthread_mutex_t mMutex; + int mRefCount; + ~LocThreadDelegate(); + LocThreadDelegate(const char* threadName, + LocRunnable* runnable, bool joinable); + void destroy(); +public: + static LocThreadDelegate* create(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(const char* threadName, + LocRunnable* runnable, bool joinable) : + mRunnable(runnable), mJoinable(joinable), + mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) { + // create the thread here, then if successful + // and a name is given, we set the thread name + if (!pthread_create(&mThandle, NULL, threadMain, this)) { + // set thread name + char lname[16]; + const char* defaultName = "LocThread"; + if (!threadName) { + threadName = defaultName; + } + int len = 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(const char* threadName, + LocRunnable* runnable, bool joinable) { + LocThreadDelegate* thread = NULL; + if (runnable) { + thread = new LocThreadDelegate(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(const char* threadName, LocRunnable* runnable, bool joinable) { + mThread = LocThreadDelegate::create(threadName, runnable, joinable); + + // true only if thread is created successfully + return (NULL != mThread); +} + +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/utils/LocThread.h b/utils/LocThread.h new file mode 100644 index 00000000..490d3099 --- /dev/null +++ b/utils/LocThread.h @@ -0,0 +1,87 @@ +/* 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 + +// 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(); + + // 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(const char* threadName, LocRunnable* runnable, bool joinable = true); + + // 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/utils/LocTimer.cpp b/utils/LocTimer.cpp new file mode 100644 index 00000000..22098091 --- /dev/null +++ b/utils/LocTimer.cpp @@ -0,0 +1,664 @@ +/* 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 + +using namespace loc_core; + +/* +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 + const 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); + +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; + struct timespec mFutureTime; + LocTimerContainer* mContainer; + // not a complete obj, just ctor for LocRankable comparisons + inline LocTimerDelegate(struct timespec& delay) + : mClient(NULL), mFutureTime(delay), mContainer(NULL) {} + inline ~LocTimerDelegate() {} +public: + LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire); + void destroy(); + // 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) { + // 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; +} + +// all the heap management is done in the MsgTask context. +inline +void LocTimerContainer::add(LocTimerDelegate& timer) { + struct MsgTimerPush : public LocMsg { + LocTimerContainer* mTimerContainer; + LocHeapNode* mTree; + LocTimerPollTask* mPollTask; + LocTimerDelegate* mTimer; + inline MsgTimerPush(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + mTimerContainer->push((LocRankable&)(*mTimer)); + + // if the tree top changed (new top is the new node), we need to update + // timerfd with the new timerout value. + if (priorTop != mTimerContainer->getSoonestTimer()) { + // if tree was empty before, we need to let poll task poll on this + // do this first to avoid race condition, in case settime is called + // with too small an interval + if (!priorTop) { + mPollTask->addPoll(*mTimerContainer); + } + struct itimerspec delay = {0}; + delay.it_value = mTimer->getFutureTime(); + timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerPush(*this, *mPollTask, timer)); +} + +// all the heap management is done in the MsgTask context. +void LocTimerContainer::remove(LocTimerDelegate& timer) { + struct MsgTimerRemove : public LocMsg { + LocTimerContainer* mTimerContainer; + LocTimerPollTask* mPollTask; + LocTimerDelegate* mTimer; + inline MsgTimerRemove(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); + delete mTimer; + LocTimerDelegate* curTop = mTimerContainer->getSoonestTimer(); + + // if the tree top changed (the removed the node was the tree top), we need + // to update the timerfd with the new timeout value from the new top. + if (priorTop != curTop) { + struct itimerspec delay = {0}; + // if tree is empty now, we need to remove poll from poll task + if (!curTop) { + mPollTask->removePoll(*mTimerContainer); + // setting the values to disarm timer + delay.it_value.tv_sec = 0; + delay.it_value.tv_nsec = 0; + } else { + delay.it_value = curTop->getFutureTime(); + } + // this will either update the timer with the new soonest timeout + // or disarm the timer, if the current tree top empty + timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerRemove(*this, *mPollTask, 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 = mTimerContainer->popIfOutRanks(timerOfNow); + NULL != timer; + timer = mTimerContainer->popIfOutRanks(timerOfNow)) { + // the timer delegate obj will be deleted before the return of this call + timer->expire(); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerExpire(*this)); +} + +LocTimerDelegate* LocTimerContainer::popIfOutRanks(LocTimerDelegate& timer) { + LocTimerDelegate* poppedNode = NULL; + + if (mTree && peek()->outRanks((LocRankable&)(timer))) { + 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; + // 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 will has a context pointer associated with the right timer container + LocTimerContainer* container = (LocTimerContainer*)(ev[i].data.ptr); + if (container) { + container->expire(); + } + } + } + + // 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), mFutureTime(futureTime), mContainer(LocTimerContainer::get(wakeOnExpire)) { + // adding the timer into the container + mContainer->add(*this); +} + +inline +void LocTimerDelegate::destroy() { + if (mContainer) { + mContainer->remove(*this); + mContainer = NULL; + } +} + +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, this obj outRanks higher + rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + } + 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 is already deleted. + LocTimer* client = mClient; + // this obj is already removed from mContainer. + // NULL it here so that dtor won't try to call remove again + mContainer = NULL; + // force a stop, which will force a delete of this obj + mClient->stop(); + // calling client callback with a pointer save on the stack + client->timeOutCallback(); +} + + +/***************************LocTimer methods***************************/ + +bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { + bool success = false; + 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); + } + return success; +} + +bool LocTimer::stop() { + bool success = false; + if (mTimer) { + mTimer->destroy(); + mTimer = NULL; + success = true; + } + return success; +} + +/***************************LocTimerWrapper methods***************************/ +////////////////////////////////////////////////////////////////////////// +// This section below wraps for the C style APIs +////////////////////////////////////////////////////////////////////////// +class LocTimerWrapper : public LocTimer { + loc_timer_callback mCb; + void* mCallerData; +public: + inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : + mCb(cb), mCallerData(callerData) {} + inline virtual void timeOutCallback() { mCb(mCallerData, 0); } +}; + +void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, + void *caller_data, bool wake_on_expire) +{ + LocTimerWrapper* 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->stop(); + delete locTimerWrapper; + 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/utils/LocTimer.h b/utils/LocTimer.h new file mode 100644 index 00000000..c5012927 --- /dev/null +++ b/utils/LocTimer.h @@ -0,0 +1,67 @@ +/* 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; + +// LocTimer client must extend this class and implementthe callback. +// start() / stop() methods are to arm / disarm timer. +class LocTimer +{ + LocTimerDelegate* mTimer; +public: + inline LocTimer() : mTimer(NULL) {} + inline virtual ~LocTimer() { stop(); } + + // 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/core/MsgTask.cpp b/utils/MsgTask.cpp similarity index 55% rename from core/MsgTask.cpp rename to utils/MsgTask.cpp index 5d375aa5..8b645dd5 100644 --- a/core/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -38,66 +38,31 @@ namespace loc_core { -#define MAX_TASK_COMM_LEN 15 - static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; } -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(NULL){ - if (tCreator) { - tCreator(threadName, loopMain, - (void*)new MsgTask(mQ, mAssociator)); - } else { - createPThread(threadName); +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(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(tAssociator){ - createPThread(threadName); -} - -inline -MsgTask::MsgTask(const void* q, tAssociate associator) : - mQ(q), mAssociator(associator){ -} - MsgTask::~MsgTask() { + msg_q_flush((void*)mQ); + msg_q_destroy((void**)&mQ); +} + +void MsgTask::destroy() { msg_q_unblock((void*)mQ); -} - -void MsgTask::associate(tAssociate tAssociator) const { - struct LocAssociateMsg : public LocMsg { - tAssociate mAssociator; - inline LocAssociateMsg(tAssociate associator) : - LocMsg(), mAssociator(associator) {} - inline virtual void proc() const { - if (mAssociator) { - LOC_LOGD("MsgTask::associate"); - mAssociator(); - } - } - }; - sendMsg(new LocAssociateMsg(tAssociator)); -} - -void MsgTask::createPThread(const char* threadName) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_t tid; - // create the thread here, then if successful - // and a name is given, we set the thread name - if (!pthread_create(&tid, &attr, loopMain, - (void*)new MsgTask(mQ, mAssociator)) && - NULL != threadName) { - char lname[MAX_TASK_COMM_LEN+1]; - memcpy(lname, threadName, MAX_TASK_COMM_LEN); - lname[MAX_TASK_COMM_LEN] = 0; - pthread_setname_np(tid, lname); + if (mThread) { + LocThread* thread = mThread; + mThread = NULL; + delete thread; + } else { + delete this; } } @@ -105,43 +70,63 @@ void MsgTask::sendMsg(const LocMsg* msg) const { msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); } -void* MsgTask::loopMain(void* arg) { - MsgTask* copy = (MsgTask*)arg; - +void MsgTask::prerun() { // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); +} - if (NULL != copy->mAssociator) { - copy->mAssociator(); - } - +bool MsgTask::run() { + LOC_LOGD("MsgTask::loop() listening ...\n"); LocMsg* msg; - int cnt = 0; - - while (1) { - LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); - - msq_q_err_type result = msg_q_rcv((void*)copy->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)); - // destroy the Q and exit - msg_q_destroy((void**)&(copy->mQ)); - delete copy; - return NULL; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete 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; } - delete copy; + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); - return NULL; + delete msg; + + return true; } +// TODO: remove the below in the next patch +void MsgTask::associate(tAssociate tAssociator) const { + struct LocAssociateMsg : public LocMsg { + tAssociate mAssociator; + LocAssociateMsg(tAssociate associator) : + mAssociator(associator) {} + inline virtual void proc() const { + static bool sAssociated = false; + if (!sAssociated) { + sAssociated = true; + mAssociator(); + } + } + }; + sendMsg(new LocAssociateMsg(tAssociator)); } + +MsgTask::MsgTask(tCreate tCreator, const char* threadName) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(threadName, this, false)) { + delete mThread; + mThread = NULL; + } +} + +MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(threadName, this, false)) { + delete mThread; + mThread = NULL; + } else { + associate(tAssociator); + } +} + +} // namespace loc_core diff --git a/core/MsgTask.h b/utils/MsgTask.h similarity index 71% rename from core/MsgTask.h rename to utils/MsgTask.h index d50bb31a..c397ee10 100644 --- a/core/MsgTask.h +++ b/utils/MsgTask.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -29,9 +29,8 @@ #ifndef __MSG_TASK__ #define __MSG_TASK__ -#include -#include -#include +#include +// TODO: remove this include in the next patch #include namespace loc_core { @@ -43,23 +42,37 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask { +class MsgTask : public LocRunnable{ + const void* mQ; + LocThread* mThread; + friend class LocThreadDelegate; +protected: + virtual ~MsgTask(); public: + 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() {} + + // TODO: remove the below in the next patch typedef void* (*tStart)(void*); typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); typedef int (*tAssociate)(); MsgTask(tCreate tCreator, const char* threadName); MsgTask(tAssociate tAssociator, const char* threadName); - ~MsgTask(); - void sendMsg(const LocMsg* msg) const; void associate(tAssociate tAssociator) const; - -private: - const void* mQ; - tAssociate mAssociator; - MsgTask(const void* q, tAssociate associator); - static void* loopMain(void* copy); - void createPThread(const char* name); }; } // namespace loc_core diff --git a/utils/loc_timer.c b/utils/loc_timer.c deleted file mode 100644 index 2beca5fa..00000000 --- a/utils/loc_timer.c +++ /dev/null @@ -1,202 +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 -#include "loc_timer.h" -#include -#include - -enum timer_state { - READY = 100, - WAITING, - DONE, - ABORT -}; - -typedef struct { - loc_timer_callback callback_func; - void *user_data; - unsigned int time_msec; - pthread_cond_t timer_cond; - pthread_mutex_t timer_mutex; - enum timer_state state; -}timer_data; - -static void *timer_thread(void *thread_data) -{ - int ret = -ETIMEDOUT; - struct timespec ts; - struct timeval tv; - timer_data* t = (timer_data*)thread_data; - - LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); - - gettimeofday(&tv, NULL); - clock_gettime(CLOCK_REALTIME, &ts); - if(t->time_msec >= 1000) { - ts.tv_sec += t->time_msec/1000; - t->time_msec = t->time_msec % 1000; - } - if(t->time_msec) - ts.tv_nsec += t->time_msec * 1000000; - if(ts.tv_nsec > 999999999) { - LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); - ts.tv_sec += 1; - ts.tv_nsec -= 1000000000; - } - LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" - "\t Current time: %d sec; %d nsec", - __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, - (int)tv.tv_sec, (int)tv.tv_usec*1000); - - pthread_mutex_lock(&(t->timer_mutex)); - if (READY == t->state) { - t->state = WAITING; - ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); - t->state = DONE; - } - pthread_mutex_unlock(&(t->timer_mutex)); - - switch (ret) { - case ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); - break; - case 0: - LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); - break; - case -ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); - break; - default: - LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", - __func__, __LINE__, ret); - break; - } - - if(ETIMEDOUT == ret) - t->callback_func(t->user_data, ret); - - // A (should be rare) race condition is that, when the loc_time_stop is called - // and acquired mutex, we reach here. pthread_mutex_destroy will fail with - // error code EBUSY. We give it 6 tries in 5 seconds. Should be eanough time - // for loc_timer_stop to complete. With the 7th try, we also perform unlock - // prior to destroy. - { - int i; - for (i = 0; EBUSY == pthread_mutex_destroy(&t->timer_mutex) && i <= 5; i++) { - if (i < 5) { - sleep(1); - } else { - // nah, forget it, something is seriously wrong. Mutex has been - // held too long. Unlock the mutext here. - pthread_mutex_unlock(&t->timer_mutex); - } - } - } - pthread_cond_destroy(&t->timer_cond); - - free(t); - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return NULL; -} - -void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, - void* caller_data) -{ - timer_data *t=NULL; - pthread_attr_t tattr; - pthread_t id; - LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); - if(cb_func == NULL || msec == 0) { - LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); - goto _err; - } - t = (timer_data *)calloc(1, sizeof(timer_data)); - if(t == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", - __func__, __LINE__); - goto _err; - } - - if(pthread_cond_init(&(t->timer_cond), NULL)) { - LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); - goto t_err; - } - if(pthread_mutex_init(&(t->timer_mutex), NULL)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto cond_err; - } - - t->callback_func = cb_func; - t->user_data = caller_data; - t->time_msec = msec; - t->state = READY; - - if (pthread_attr_init(&tattr)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto mutex_err; - } - pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); - - if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { - LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); - goto attr_err; - } - - LOC_LOGD("%s:%d]: Created thread with id: %d\n", - __func__, __LINE__, (int)id); - goto _err; - -attr_err: - pthread_attr_destroy(&tattr); -mutex_err: - pthread_mutex_destroy(&t->timer_mutex); -cond_err: - pthread_cond_destroy(&t->timer_cond); -t_err: - free(t); -_err: - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return t; -} - -void loc_timer_stop(void* handle) { - timer_data* t = (timer_data*)handle; - - if (NULL != t && (READY == t->state || WAITING == t->state) && - pthread_mutex_lock(&(t->timer_mutex)) == 0) { - if (READY == t->state || WAITING == t->state) { - pthread_cond_signal(&t->timer_cond); - t->state = ABORT; - } - pthread_mutex_unlock(&(t->timer_mutex)); - } -} diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 0034d278..8836d1ea 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,28 +33,36 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include -#include "log_util.h" +#include /* - Return values: - Success = 0 - Failure = Non zero + 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, int result); +typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* - Returns the handle, which can be used to stop the timer + delay_msec: timeout value for the timer. + loc_timer_callback: callback function pointer, implemented by client. + 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 */ -void* loc_timer_start(unsigned int delay_msec, +void* loc_timer_start(uint64_t delay_msec, loc_timer_callback, - void* user_data); + void *user_data, + bool wake_on_expire=false); /* - handle becomes invalid upon the return of the callback + handle becomes invalid upon the return of the callback */ -void loc_timer_stop(void* handle); +void loc_timer_stop(void*& handle); #ifdef __cplusplus } From 50ae85852a064ee989168c935a59096976fa4ad1 Mon Sep 17 00:00:00 2001 From: Neethu Joseph Date: Fri, 10 Jul 2015 16:25:51 -0700 Subject: [PATCH 330/945] MsgTask thread must call associator function always All instances of MsgTask were not calling associator because of a use of a static variable check. All instance of MsgTask thread must call the associator. CRs-Fixed: 870450 Change-Id: I18314ec3ca0fe21f4bbd12a505bf552e64e25307 --- utils/MsgTask.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 8b645dd5..794bf92a 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -101,11 +101,7 @@ void MsgTask::associate(tAssociate tAssociator) const { LocAssociateMsg(tAssociate associator) : mAssociator(associator) {} inline virtual void proc() const { - static bool sAssociated = false; - if (!sAssociated) { - sAssociated = true; - mAssociator(); - } + mAssociator(); } }; sendMsg(new LocAssociateMsg(tAssociator)); @@ -124,7 +120,7 @@ MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : if (!mThread->start(threadName, this, false)) { delete mThread; mThread = NULL; - } else { + } else if (tAssociator != NULL){ associate(tAssociator); } } From 9de97acc86aafbd401a5fd1d9d80cc9a4da154aa Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 10 Jul 2015 20:30:57 -0700 Subject: [PATCH 331/945] LocTimer repeated expiration Timer must be removed from epoll as soon as it expires, otherwise it continuously expire. Current timer removes from a different thread, this triggers repeated expire events until the maintain thread gets to remove it. Change-Id: Ie523bce5069416521d49bc0178d2cad2dd1f04da CRs-Fixed: 870568 --- utils/LocTimer.cpp | 103 +++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 22098091..e1be1e8a 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -112,6 +112,8 @@ class LocTimerContainer : public LocHeap { 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 @@ -270,74 +272,68 @@ 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; - LocTimerPollTask* mPollTask; LocTimerDelegate* mTimer; - inline MsgTimerPush(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline MsgTimerPush(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); mTimerContainer->push((LocRankable&)(*mTimer)); - - // if the tree top changed (new top is the new node), we need to update - // timerfd with the new timerout value. - if (priorTop != mTimerContainer->getSoonestTimer()) { - // if tree was empty before, we need to let poll task poll on this - // do this first to avoid race condition, in case settime is called - // with too small an interval - if (!priorTop) { - mPollTask->addPoll(*mTimerContainer); - } - struct itimerspec delay = {0}; - delay.it_value = mTimer->getFutureTime(); - timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - } + mTimerContainer->updateSoonestTime(priorTop); } }; - mMsgTask->sendMsg(new MsgTimerPush(*this, *mPollTask, timer)); + 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; - LocTimerPollTask* mPollTask; LocTimerDelegate* mTimer; - inline MsgTimerRemove(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline MsgTimerRemove(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); + mTimerContainer->updateSoonestTime(priorTop); delete mTimer; - LocTimerDelegate* curTop = mTimerContainer->getSoonestTimer(); - - // if the tree top changed (the removed the node was the tree top), we need - // to update the timerfd with the new timeout value from the new top. - if (priorTop != curTop) { - struct itimerspec delay = {0}; - // if tree is empty now, we need to remove poll from poll task - if (!curTop) { - mPollTask->removePoll(*mTimerContainer); - // setting the values to disarm timer - delay.it_value.tv_sec = 0; - delay.it_value.tv_nsec = 0; - } else { - delay.it_value = curTop->getFutureTime(); - } - // this will either update the timer with the new soonest timeout - // or disarm the timer, if the current tree top empty - timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - } } }; - mMsgTask->sendMsg(new MsgTimerRemove(*this, *mPollTask, timer)); + mMsgTask->sendMsg(new MsgTimerRemove(*this, timer)); } // all the heap management is done in the MsgTask context. @@ -355,22 +351,25 @@ void LocTimerContainer::expire() { 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 = mTimerContainer->popIfOutRanks(timerOfNow); + 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 && peek()->outRanks((LocRankable&)(timer))) { + if (mTree && !timer.outRanks(*peek())) { poppedNode = (LocTimerDelegate*)(pop()); } @@ -415,10 +414,12 @@ void LocTimerPollTask::addPoll(LocTimerContainer& timerContainer) { 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); } @@ -431,17 +432,22 @@ void LocTimerPollTask::removePoll(LocTimerContainer& timerContainer) { // 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 will has a context pointer associated with the right timer container + // 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); } } } @@ -464,6 +470,8 @@ void LocTimerDelegate::destroy() { if (mContainer) { mContainer->remove(*this); mContainer = NULL; + } else { + delete this; } } @@ -534,7 +542,10 @@ class LocTimerWrapper : public LocTimer { public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : mCb(cb), mCallerData(callerData) {} - inline virtual void timeOutCallback() { mCb(mCallerData, 0); } + inline virtual void timeOutCallback() { + mCb(mCallerData, 0); + delete this; + } }; void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, From 923698ad8af4e9a01980d082009aa616e91d0a68 Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Thu, 6 Aug 2015 17:39:55 -0700 Subject: [PATCH 332/945] Clear passing up memory for LocApiBase function GpsLocation object need to be cleared in case the base calss member function being called so that no bad values will be passed up. Change-Id: I224ecebb3e4137c1baddd99ce0211a0f60d3e5b4 CRs-fixed: 879356 --- core/LocApiBase.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 5c852729..dcd35fec 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -489,16 +489,23 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation & zppLoc) + getWwanZppFix(GpsLocation& zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation & zppLoc) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + 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) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +{ + memset(&zppLoc, 0, sizeof(zppLoc)); + memset(&tech_mask, 0, sizeof(tech_mask)); + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} int LocApiBase:: initDataServiceClient() From 898c646a7c64e1f8b00a31ea5bffd723c87dddd9 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 20 Jul 2015 15:36:06 -0700 Subject: [PATCH 333/945] crash in LocTimer wrapper LocTimerWrapper implements loc_timer_start/stop calls for backward compatibility. There is a race condtiion where the wrapper object could be deleted by the client thread and expireation handling at rough the same time, which would have the memory freed twice. Now they are mutext protected. Change-Id: I25d7466db88a840a8a09e7a476cface48c91d22e --- utils/LocTimer.cpp | 26 +++++++++++++++++++++----- utils/loc_timer.h | 6 ++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index e1be1e8a..277a8135 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -539,22 +539,38 @@ bool LocTimer::stop() { class LocTimerWrapper : public LocTimer { loc_timer_callback mCb; void* mCallerData; + static pthread_mutex_t mMutex; + inline ~LocTimerWrapper() { mCb = NULL; } public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : mCb(cb), mCallerData(callerData) {} + inline bool isAlive() { return mCb != NULL; } + void destroy() { + pthread_mutex_lock(&mMutex); + if (isAlive()) { + delete this; + } + pthread_mutex_unlock(&mMutex); + } inline virtual void timeOutCallback() { mCb(mCallerData, 0); - delete this; + 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 = new LocTimerWrapper(cb_func, caller_data); + LocTimerWrapper* locTimerWrapper = NULL; - if (locTimerWrapper) { - locTimerWrapper->start(msec, wake_on_expire); + if (cb_func) { + locTimerWrapper = new LocTimerWrapper(cb_func, caller_data); + + if (locTimerWrapper) { + locTimerWrapper->start(msec, wake_on_expire); + } } return locTimerWrapper; @@ -565,7 +581,7 @@ void loc_timer_stop(void*& handle) if (handle) { LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); locTimerWrapper->stop(); - delete locTimerWrapper; + locTimerWrapper->destroy(); handle = NULL; } } diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 8836d1ea..2967858e 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -45,7 +45,8 @@ typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* delay_msec: timeout value for the timer. - loc_timer_callback: callback function pointer, implemented by client. + 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 @@ -53,9 +54,10 @@ typedef void (*loc_timer_callback)(void *user_data, int32_t result); 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, + loc_timer_callback cb_func, void *user_data, bool wake_on_expire=false); From cc9f8dc03b7dc842337eae0af22e41287eb7898e Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 1 Jun 2015 10:42:46 -0700 Subject: [PATCH 334/945] Add new event mask for timezone. Modem sends this event to request for injection of timezone and offset from UTC Change-Id: I664db892bf08f7df9680322405df4c38198cb465 CRs-fixed: 868532 --- core/gps_extended_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 4cb9ede3..843105fb 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -418,7 +418,7 @@ enum loc_api_adapter_event_index { 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_EVENT_MAX }; @@ -447,6 +447,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ (1< Date: Fri, 26 Jun 2015 16:33:29 -0700 Subject: [PATCH 335/945] Set SUPL_ES to 0 in gps.conf Disabled checking for emergency to accept SUPL CRs-fixed: 860504 Change-Id: Iad1605242daf8fa1d6bcce3e69caff7811d9843a --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index a1d5d2cc..5376a1db 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -44,7 +44,7 @@ INTERMEDIATE_POS=0 SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable -SUPL_ES=1 +SUPL_ES=0 #Choose PDN for Emergency SUPL #1 - Use emergency PDN From 87b6a3fff48ca1ba1479dc09b52c0cbbb7892025 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Fri, 26 Jun 2015 10:33:49 -0700 Subject: [PATCH 336/945] Move the flp definitions to gps-noship This change moves those definitions related to FLP form gps_extented_c.h to gps-noship. Change-Id: I3da452fa3e885af509199cae9fe1b1f24ff48100 CRs-fixed: 801916 --- core/Android.mk | 3 +- core/UlpProxyBase.h | 7 +-- core/gps_extended_c.h | 68 +++-------------------------- loc_api/libloc_api_50001/Android.mk | 6 ++- 4 files changed, 15 insertions(+), 69 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 267b31f7..c6d3128d 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -34,7 +34,8 @@ LOCAL_CFLAGS += \ -D_ANDROID_ LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index d08ad711..845fe1eb 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -30,6 +30,7 @@ #define ULP_PROXY_BASE_H #include +#include "fused_location_extended.h" namespace loc_core { @@ -68,11 +69,11 @@ public: } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} - inline virtual bool reportBatchingSession(GpsExtBatchOptions &options, + inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, bool active) { return false; } - inline virtual bool reportPositions(GpsExtLocation * locations, + inline virtual bool reportPositions(FlpExtLocation * locations, int32_t number_of_locations, enum loc_sess_status status, LocPosTechMask techMask) { diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 4cb9ede3..63171542 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -62,7 +62,7 @@ extern "C" { #define ULP_LOCATION_IS_FROM_ZPP 0x0004 /** Position is from a Geofence Breach Event */ #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 -/** Positioin is from Hardware FLP */ +/** Position is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 /** Position is from NLP */ #define ULP_LOCATION_IS_FROM_NLP 0x0020 @@ -77,30 +77,6 @@ extern "C" { #define AGPS_CERTIFICATE_MAX_LENGTH 2000 #define AGPS_CERTIFICATE_MAX_SLOTS 10 -/** Batching default ID for dummy batching session*/ -#define GPS_BATCHING_DEFAULT_ID 1 - -/** This cap is used to decide the FLP session cache -size on AP. If the BATCH_SIZE in flp.conf is less than -GPS_AP_BATCHING_SIZE_CAP, FLP session cache size will -be twice the BATCH_SIZE defined in flp.conf. Otherwise, -FLP session cache size will be equal to the BATCH_SIZE.*/ -#define GPS_AP_BATCHING_SIZE_CAP 40 - -#define GPS_BATCHING_OPERATION_SUCCEESS 1 -#define GPS_BATCHING_OPERATION_FAILURE 0 - -/** GPS extended batching flags*/ -#define GPS_EXT_BATCHING_ON_FULL 0x0000001 -#define GPS_EXT_BATCHING_ON_FIX 0x0000002 - -/** Reasons of GPS reports batched locations*/ -typedef enum loc_batching_reported_type { - LOC_BATCHING_ON_FULL_IND_REPORT, - LOC_BATCHING_ON_FIX_IND_REPORT, - LOC_BATCHING_ON_QUERY_REPORT -}LocBatchingReportedType; - enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, LOC_REGISTRATION_MASK_DISABLED @@ -151,14 +127,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } GpsExtCallbacks; -/** GPS extended batch options */ -typedef struct { - double max_power_allocation_mW; - uint32_t sources_to_use; - uint32_t flags; - int64_t period_ns; -} GpsExtBatchOptions; - /** 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 @@ -229,22 +197,6 @@ typedef enum loc_position_mode_type { #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ -/** GpsLocationExtended has valid latitude and longitude. */ -#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) -/** GpsLocationExtended has valid altitude. */ -#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1) -/** GpsLocationExtended has valid speed. */ -#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2) -/** GpsLocationExtended has valid bearing. */ -#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4) -/** GpsLocationExtended has valid accuracy. */ -#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8) - -/** GPS extended supports geofencing */ -#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001 -/** GPS extended supports batching */ -#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002 - /** Flags to indicate which values are valid in a GpsLocationExtended. */ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ @@ -282,19 +234,6 @@ typedef struct { float speed_unc; } GpsLocationExtended; -typedef struct GpsExtLocation_s { - size_t size; - uint16_t flags; - double latitude; - double longitude; - double altitude; - float speed; - float bearing; - float accuracy; - int64_t timestamp; - uint32_t sources_used; -} GpsExtLocation; - /** Represents SV status. */ typedef struct { /** set to sizeof(GnssSvStatus) */ @@ -451,8 +390,11 @@ enum loc_api_adapter_event_index { typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; typedef enum loc_api_adapter_msg_to_check_supported { - LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching + LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching 1.0 LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH, // Geofence Batched Breach + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING, // DBT 2.0 + LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING, // Batching 1.5 + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING, // Batching 2.0 LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 4f80e0a6..62905e8c 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -41,7 +41,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - hardware/qcom/gps/loc_api/libloc_api_50001 + hardware/qcom/gps/loc_api/libloc_api_50001 \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -94,7 +95,8 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw From a38a8b84771fd0b8b7df126bde012d644b129bb8 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 6 Jul 2015 14:14:17 -0700 Subject: [PATCH 337/945] memory management fixes byte long each, but the loc_set_config_entry() util call writes an int at a time, causing buffer overflow. #2, in loc_xtra-init(), a data structure wrap happened without iniializing the unused data fields. Change-Id: I96b40a330316927d276840a997082fe759263699 CRs-Fixed: 866937 --- loc_api/libloc_api_50001/loc.cpp | 5 ++++- utils/loc_cfg.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index d735b97a..a1ae9933 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -805,7 +805,10 @@ SIDE EFFECTS static int loc_xtra_init(GpsXtraCallbacks* callbacks) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); + 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; diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index a7697762..5c33320d 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -52,8 +52,8 @@ *============================================================================*/ /* Parameter data */ -static uint8_t DEBUG_LEVEL = 0xff; -static uint8_t TIMESTAMP = 0; +static uint32_t DEBUG_LEVEL = 0xff; +static uint32_t TIMESTAMP = 0; /* Parameter spec table */ static loc_param_s_type loc_param_table[] = From a50aaae62e77e3f50a30f4008cefcab0f027ae9a Mon Sep 17 00:00:00 2001 From: Hema Iyer Sankaranarayanan Date: Thu, 20 Aug 2015 13:03:51 -0700 Subject: [PATCH 338/945] Handle race condition in HAL post SSR Post SSR, ensure necessary config injection is done before restarting an existing tracking session Change-Id: I1bec8ff1cab3a9762e73a13958fe91c62f40fb92 CRs-fixed: 888187 --- loc_api/libloc_api_50001/loc_eng.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3bb4168f..1a92478f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2861,9 +2861,8 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &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->setPositionMode(NULL); loc_eng_data.adapter->setInSession(false); - loc_eng_start_handler(loc_eng_data); + loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); } EXIT_LOG(%s, VOID_RET); } From 5e7710897247c8c8da6bed8cdcc7dc43698e2937 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 26 Aug 2015 11:26:46 -0700 Subject: [PATCH 339/945] Fix for timerfd_create on older kernel revisions BOOTTIME_ALARM and BOOTTIME were added to timerfd_create in kernel version 3.11 and 3.15 respectively. But for targets still on older kernel version we fallback on MONOTONIC. CRs-Fixed: 897805 Change-Id: I47d9780d69ce5ee8c183c84baa93ea3c1a00db57 --- utils/LocTimer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 277a8135..524897bb 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -103,7 +103,7 @@ class LocTimerContainer : public LocHeap { // Poll task to provide epoll call and threading to poll. static LocTimerPollTask* mPollTask; // timer / alarm fd - const int mDevFd; + int mDevFd; // ctor LocTimerContainer(bool wakeOnExpire); // dtor @@ -210,6 +210,13 @@ LocTimerPollTask* LocTimerContainer::mPollTask = NULL; // 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(); From 623f5a6fc56486d07f7972b5c6d3c294fde5438c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 19 Jan 2015 16:22:28 -0800 Subject: [PATCH 340/945] adding dev id into xtra user agent setting XTRA_USER_AGENT at GPS HAL init time, incorporating Android sw version, manufacturer, model, board. CRs-Fixed: 788356 Change-Id: I8d9dcc80a0769796a25a0477f5f1598a292fe8b0 --- core/ContextBase.h | 5 +- core/LBSProxyBase.h | 3 +- core/gps_extended_c.h | 2 + loc_api/libloc_api_50001/LocEngAdapter.cpp | 71 +++++++++++++++++++++- loc_api/libloc_api_50001/LocEngAdapter.h | 3 +- loc_api/libloc_api_50001/loc.cpp | 3 +- 6 files changed, 82 insertions(+), 5 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index ff7a4b33..fe0b8606 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -63,6 +63,9 @@ public: unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); } + inline IzatDevId_t getIzatDevId() const { + return mLBSProxy->getIzatDevId(); + } inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); } }; diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 75ae9922..0faf8012 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -55,6 +55,7 @@ public: inline virtual bool hasCPIExtendedCapabilities() const { return false; } inline virtual void modemPowerVote(bool power) const {} virtual void injectFeatureConfig(ContextBase* context) const {} + inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 05730146..06764cf3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -400,6 +400,8 @@ typedef enum loc_api_adapter_msg_to_check_supported { LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; +typedef int IzatDevId_t; + typedef uint32_t LOC_GPS_LOCK_MASK; #define isGpsLockNone(lock) ((lock) == 0) #define isGpsLockMO(lock) ((lock) & ((LOC_GPS_LOCK_MASK)1)) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index fd6f9b09..1afa0a8c 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,10 +29,13 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_EngAdapter" +#include #include #include "loc_eng_msg.h" #include "loc_log.h" +#define CHIPSET_SERIAL_NUMBER_MAX_LEN 16 + using namespace loc_core; LocInternalAdapter::LocInternalAdapter(LocEngAdapter* adapter) : @@ -82,6 +85,72 @@ LocEngAdapter::~LocEngAdapter() 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 carrier[PROPERTY_VALUE_MAX]; + char board[PROPERTY_VALUE_MAX]; + char brand[PROPERTY_VALUE_MAX]; + char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; + char userAgent[PROPERTY_VALUE_MAX]; + 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.carrier", carrier, defVal); + property_get("ro.product.board", board, defVal); + property_get("ro.product.brand", brand, defVal); + getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); + + snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/%s/QCX3/s%u/-/%s/-/%s/-/-/-", + release, manufacture, model, board, carrier, + mContext->getIzatDevId(), chipsetsn, brand); + + for (int i = 0; i < sizeof(userAgent) && userAgent[i]; i++) { + if (' ' == userAgent[i]) userAgent[i] = '#'; + } + + property_set("location.XTRA_USER_AGENT", userAgent); + LOC_LOGV("%s] UserAgent %s", __func__, userAgent); + } + + 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); + } + + return; + } + + }; + + sendMsg(new LocSetXtraUserAgent(mContext)); +} + void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { struct LocSetUlpProxy : public LocMsg { LocAdapterBase* mAdapter; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 9e01b98c..b119d990 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -92,6 +92,7 @@ public: virtual ~LocEngAdapter(); virtual void setUlpProxy(UlpProxyBase* ulp); + void setXtraUserAgent(); inline void requestUlp(unsigned long capabilities) { mContext->requestUlp(mInternalAdapter, capabilities); } diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index a1ae9933..f7d7cb45 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -313,6 +313,7 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->setGpsLockMsg(0); loc_afw_data.adapter->requestUlp(getCarrierCapabilities()); + loc_afw_data.adapter->setXtraUserAgent(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); From 9957a19f5f522d9e010020b5bcad3e91dfc599ca Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 3 Sep 2015 18:08:08 -0700 Subject: [PATCH 341/945] fixing a crash vulnerability due to race condition LocTimer::stop() can be called from different threads, which must be protected. Currently there is a race condition between back to back stop()'s or expire() + stop() events. Change-Id: Iae80b78f049a32da87639f813c6f5126b4ccd072 CRs-Fixed: 904627 --- utils/LocTimer.cpp | 99 +++++++++++++++++++++++++++++++++++----------- utils/LocTimer.h | 11 +++++- 2 files changed, 85 insertions(+), 25 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 277a8135..2d972c47 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -48,6 +48,20 @@ using namespace loc_core; +// a shared lock until, place it here for now. +class LocUtilSharedLock { + uint32_t mRef; + pthread_mutex_t mMutex; + inline ~LocUtilSharedLock() { pthread_mutex_destroy(&mMutex); } +public: + inline LocUtilSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } + inline LocUtilSharedLock* share() { mRef++; return this; } + inline void drop() { if (0 == --mRef) delete this; } + inline void lock() { pthread_mutex_lock(&mMutex); } + inline void unlock() { pthread_mutex_unlock(&mMutex); } +}; + + /* There are implementations of 5 classes in this file: LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper @@ -177,15 +191,16 @@ class LocTimerDelegate : public LocRankable { friend class LocTimerContainer; friend class LocTimer; LocTimer* mClient; + LocUtilSharedLock* mLock; struct timespec mFutureTime; LocTimerContainer* mContainer; // not a complete obj, just ctor for LocRankable comparisons inline LocTimerDelegate(struct timespec& delay) - : mClient(NULL), mFutureTime(delay), mContainer(NULL) {} - inline ~LocTimerDelegate() {} + : 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 destroy(); + void destroyLocked(); // LocRankable virtual method virtual int ranks(LocRankable& rankable); void expire(); @@ -327,8 +342,9 @@ void LocTimerContainer::remove(LocTimerDelegate& timer) { LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); - mTimerContainer->updateSoonestTime(priorTop); + if (NULL != ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { + mTimerContainer->updateSoonestTime(priorTop); + } delete mTimer; } }; @@ -356,6 +372,7 @@ void LocTimerContainer::expire() { timer = mTimerContainer->popIfOutRanks(timerOfNow)) { // the timer delegate obj will be deleted before the return of this call timer->expire(); + delete timer; } mTimerContainer->updateSoonestTime(NULL); } @@ -460,19 +477,30 @@ bool LocTimerPollTask::run() { inline LocTimerDelegate::LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire) - : mClient(&client), mFutureTime(futureTime), mContainer(LocTimerContainer::get(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::destroy() { +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) { - mContainer->remove(*this); + LocTimerContainer* container = mContainer; mContainer = NULL; - } else { - delete this; - } + if (container) { + container->remove(*this); + } + } // else we do not do anything, as *this* will be deleted either + // after it expires or stop is first called (if case above), + // where container->remove() will have it deleted. } int LocTimerDelegate::ranks(LocRankable& rankable) { @@ -488,6 +516,7 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { inline void LocTimerDelegate::expire() { + mLock->lock(); // keeping a copy of client pointer to be safe // when timeOutCallback() is called at the end of this // method, this obj is already deleted. @@ -495,14 +524,29 @@ void LocTimerDelegate::expire() { // this obj is already removed from mContainer. // NULL it here so that dtor won't try to call remove again mContainer = NULL; + mClient = NULL; + mLock->unlock(); // force a stop, which will force a delete of this obj - mClient->stop(); - // calling client callback with a pointer save on the stack - client->timeOutCallback(); + 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 LocUtilSharedLock()) { +} + +LocTimer::~LocTimer() { + stop(); + if (mLock) { + mLock->drop(); + mLock = NULL; + } +} bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool success = false; @@ -525,9 +569,14 @@ bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool LocTimer::stop() { bool success = false; if (mTimer) { - mTimer->destroy(); + mLock->lock(); + LocTimerDelegate* timer = mTimer; mTimer = NULL; - success = true; + if (timer) { + timer->destroyLocked(); + success = true; + } + mLock->unlock(); } return success; } @@ -539,21 +588,26 @@ bool LocTimer::stop() { class LocTimerWrapper : public LocTimer { loc_timer_callback mCb; void* mCallerData; + LocTimerWrapper* mMe; static pthread_mutex_t mMutex; - inline ~LocTimerWrapper() { mCb = NULL; } + inline ~LocTimerWrapper() { mCb = NULL; mMe = NULL; } public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : - mCb(cb), mCallerData(callerData) {} - inline bool isAlive() { return mCb != NULL; } + mCb(cb), mCallerData(callerData), mMe(this) { + } void destroy() { pthread_mutex_lock(&mMutex); - if (isAlive()) { + if (NULL != mCb && this == mMe) { delete this; } pthread_mutex_unlock(&mMutex); } - inline virtual void timeOutCallback() { - mCb(mCallerData, 0); + virtual void timeOutCallback() { + loc_timer_callback cb = mCb; + void* callerData = mCallerData; + if (cb) { + cb(callerData, 0); + } destroy(); } }; @@ -580,7 +634,6 @@ void loc_timer_stop(void*& handle) { if (handle) { LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); - locTimerWrapper->stop(); locTimerWrapper->destroy(); handle = NULL; } diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c5012927..9606fe53 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -35,15 +35,22 @@ // opaque class to provide service implementation. class LocTimerDelegate; +class LocUtilSharedLock; // LocTimer client must extend this class and implementthe callback. // start() / stop() methods are to arm / disarm timer. class LocTimer { LocTimerDelegate* mTimer; + LocUtilSharedLock* 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: - inline LocTimer() : mTimer(NULL) {} - inline virtual ~LocTimer() { stop(); } + LocTimer(); + virtual ~LocTimer(); // timeOutInMs: timeout delay in ms // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer From 9c22ef8bca9c0ef7937e442df0abe58a807565fd Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Thu, 10 Sep 2015 17:32:14 -0700 Subject: [PATCH 342/945] fixed XTRA bug The change included the following fixes: increased buffer size to hold the initial UA string; use file for saving the initial UA string Change-Id: I52ef94e57695f1411a34e338e89325de382b09b5 CRs-fixed: 905170 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 55 +++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1afa0a8c..cebcec0a 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -29,12 +29,16 @@ #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; @@ -99,7 +103,7 @@ void LocEngAdapter::setXtraUserAgent() { char board[PROPERTY_VALUE_MAX]; char brand[PROPERTY_VALUE_MAX]; char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; - char userAgent[PROPERTY_VALUE_MAX]; + char userAgent[USER_AGENT_MAX_LEN]; const char defVal[] = "-"; property_get("ro.build.version.release", release, defVal); @@ -118,10 +122,51 @@ void LocEngAdapter::setXtraUserAgent() { if (' ' == userAgent[i]) userAgent[i] = '#'; } - property_set("location.XTRA_USER_AGENT", userAgent); + 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"; @@ -141,6 +186,12 @@ void LocEngAdapter::setXtraUserAgent() { } fclose(file); + + // remove trailing spaces + size_t len = strlen(buf); + while (--len >= 0 && isspace(buf[len])) { + buf[len] = '\0'; + } } return; From 088a127c3117c4b4b40d303a51b99d709062eef2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 15 Sep 2015 19:02:58 -0700 Subject: [PATCH 343/945] timer bug fix when a ticking timer is stopped, currently kernel doesn't get updated with the next immediate timer's interval. As a result, kernel timer will expire sooner (with the stopped timer's interval), and the next timer's client is notified for this expiration. Change-Id: I0d67d1418cb9bfe7f70ae71252901d4c6bb699b3 CRs-Fixed: 909776 --- utils/LocHeap.cpp | 4 ++-- utils/LocTimer.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp index 41268789..d667f14f 100644 --- a/utils/LocHeap.cpp +++ b/utils/LocHeap.cpp @@ -199,7 +199,7 @@ bool LocHeapNode::checkNodes() { int totalSize = mSize; if (mLeft) { // check the consistency of left subtree - if (!outRanks(*mLeft) || !mLeft->checkNodes()) { + if (mLeft->outRanks(*this) || !mLeft->checkNodes()) { return false; } // subtract the size of left subtree (with subtree head) @@ -208,7 +208,7 @@ bool LocHeapNode::checkNodes() { if (mRight) { // check the consistency of right subtree - if (!outRanks(*mRight) || !mRight->checkNodes()) { + if (mRight->outRanks(*this) || !mRight->checkNodes()) { return false; } // subtract the size of right subtree (with subtree head) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 2d972c47..16993598 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -342,8 +342,12 @@ void LocTimerContainer::remove(LocTimerDelegate& timer) { LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - if (NULL != ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { - mTimerContainer->updateSoonestTime(priorTop); + // 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); } delete mTimer; } From 94ecbf68045cb44f6b6287621007ac845ed88ee2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 Sep 2015 19:40:25 -0700 Subject: [PATCH 344/945] Crash fix with MsgTask API change Removed tCreate and tAssociate from MsgTask. LocThread now can optionally take a tCreate method. Associator is replaced with *firstMsg* option to MsgTask, which is a more generic option, that can associate or do other set up job at the create of a MsgTask. The current MsgTask doesn't use tCreate, which exposes a slight time window for Location HAL when its MsgTask is NOT associated to DVM heap but a message delivery to DVM could be attempted during this time. Change-Id: Iafd5b91b693baacb9b7064463f8c44f74026f54c CRs-Fixed: 902350 --- core/LocDualContext.cpp | 76 ++++++---------------- core/LocDualContext.h | 26 ++++---- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 +- loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 3 +- utils/LocSharedLock.h | 58 +++++++++++++++++ utils/LocThread.cpp | 50 ++++++++------ utils/LocThread.h | 7 +- utils/LocTimer.cpp | 22 +------ utils/LocTimer.h | 4 +- utils/MsgTask.cpp | 44 +++---------- utils/MsgTask.h | 17 +---- 12 files changed, 151 insertions(+), 164 deletions(-) create mode 100644 utils/LocSharedLock.h diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index d68cb3bc..578421cd 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -63,34 +63,28 @@ const char* LocDualContext::mLBSLibName = "liblbs_core.so"; pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; -const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, - const char* name) +const MsgTask* LocDualContext::getMsgTask(LocThread::tCreate tCreator, + const char* name, bool joinable) { if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name); + mMsgTask = new MsgTask(tCreator, name, joinable); } return mMsgTask; } -const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, - const char* name) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tAssociate, name); - } else if (tAssociate) { - mMsgTask->associate(tAssociate); - } - return mMsgTask; +inline +const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { + return getMsgTask((LocThread::tCreate)NULL, name, joinable); } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, - const char* name) +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); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mFgContext = new LocDualContext(msgTask, mFgExclMask); } @@ -100,37 +94,22 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + + if (firstMsg) { + mFgContext->sendMsg(firstMsg); + } + return mFgContext; } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mFgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - 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); - return mFgContext; -} - -ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, - const char* name) +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); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mBgContext = new LocDualContext(msgTask, mBgExclMask); } @@ -140,26 +119,11 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - return mBgContext; -} -ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mBgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); + if (firstMsg) { + mBgContext->sendMsg(firstMsg); } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); - mInjectContext = mBgContext; - injectFeatureConfig(mInjectContext); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + return mBgContext; } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 1e96ea56..ce77a1aa 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -41,10 +41,9 @@ class LocDualContext : public ContextBase { static ContextBase* mFgContext; static ContextBase* mBgContext; static ContextBase* mInjectContext; - static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, - const char* name); - static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, - const char* name); + 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: @@ -58,14 +57,17 @@ public: static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask; static const char* mLocationHalName; - static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name); + 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); }; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index cebcec0a..35447d48 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -62,13 +62,15 @@ void LocInternalAdapter::getZppInt() { LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator) : + 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, - LocDualContext::mLocationHalName) + NULL, + LocDualContext::mLocationHalName, + false) :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b119d990..a193e818 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -88,7 +88,7 @@ public: LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator); + LocThread::tCreate tCreator); virtual ~LocEngAdapter(); virtual void setUlpProxy(UlpProxyBase* ulp); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9c4bcbed..5d92e44a 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -223,7 +223,6 @@ static void* noProc(void* data) return NULL; } - /********************************************************************* * definitions of the static messages used in the file *********************************************************************/ @@ -1770,7 +1769,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, context, - (MsgTask::tCreate)callbacks->create_thread_cb); + (LocThread::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h new file mode 100644 index 00000000..6b9e27f1 --- /dev/null +++ b/utils/LocSharedLock.h @@ -0,0 +1,58 @@ +/* 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 + +// 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 { + uint32_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() { mRef++; return this; } + // whe a client no longer needs this shared lock, drop() shall be called. + inline void drop() { if (0 == --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/utils/LocThread.cpp b/utils/LocThread.cpp index ec1e0719..19bf101a 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -37,12 +37,12 @@ class LocThreadDelegate { pthread_mutex_t mMutex; int mRefCount; ~LocThreadDelegate(); - LocThreadDelegate(const char* threadName, + LocThreadDelegate(LocThread::tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable); void destroy(); public: - static LocThreadDelegate* create(const char* threadName, - LocRunnable* runnable, bool joinable); + 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 @@ -62,19 +62,28 @@ public: // 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(const char* threadName, - LocRunnable* runnable, bool joinable) : - mRunnable(runnable), mJoinable(joinable), +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 (!pthread_create(&mThandle, NULL, threadMain, this)) { + 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]; - const char* defaultName = "LocThread"; - if (!threadName) { - threadName = defaultName; - } int len = sizeof(lname) - 1; memcpy(lname, threadName, len); lname[len] = 0; @@ -99,11 +108,11 @@ LocThreadDelegate::~LocThreadDelegate() { } // factory method so that we could return NULL upon failure -LocThreadDelegate* LocThreadDelegate::create(const char* threadName, - LocRunnable* runnable, bool joinable) { +LocThreadDelegate* LocThreadDelegate::create(LocThread::tCreate creator, + const char* threadName, LocRunnable* runnable, bool joinable) { LocThreadDelegate* thread = NULL; if (runnable) { - thread = new LocThreadDelegate(threadName, runnable, joinable); + thread = new LocThreadDelegate(creator, threadName, runnable, joinable); if (thread && !thread->isRunning()) { thread->destroy(); thread = NULL; @@ -199,11 +208,14 @@ LocThread::~LocThread() { } } -bool LocThread::start(const char* threadName, LocRunnable* runnable, bool joinable) { - mThread = LocThreadDelegate::create(threadName, runnable, joinable); - - // true only if thread is created successfully - return (NULL != mThread); +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() { diff --git a/utils/LocThread.h b/utils/LocThread.h index 490d3099..2a65d8fa 100644 --- a/utils/LocThread.h +++ b/utils/LocThread.h @@ -30,6 +30,7 @@ #define __LOC_THREAD__ #include +#include // abstract class to be implemented by client to provide a runnable class // which gets scheduled by LocThread @@ -64,6 +65,7 @@ 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. @@ -74,7 +76,10 @@ public: // returns true. Else it is client's responsibility // to delete the object // Returns 0 if success; false if failure. - bool start(const char* threadName, LocRunnable* runnable, bool joinable = true); + 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. diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 0f698c54..c992e7c2 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #ifdef __HOST_UNIT_TEST__ @@ -46,22 +46,6 @@ #define CLOCK_BOOTTIME_ALARM CLOCK_MONOTONIC #endif -using namespace loc_core; - -// a shared lock until, place it here for now. -class LocUtilSharedLock { - uint32_t mRef; - pthread_mutex_t mMutex; - inline ~LocUtilSharedLock() { pthread_mutex_destroy(&mMutex); } -public: - inline LocUtilSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } - inline LocUtilSharedLock* share() { mRef++; return this; } - inline void drop() { if (0 == --mRef) delete this; } - inline void lock() { pthread_mutex_lock(&mMutex); } - inline void unlock() { pthread_mutex_unlock(&mMutex); } -}; - - /* There are implementations of 5 classes in this file: LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper @@ -191,7 +175,7 @@ class LocTimerDelegate : public LocRankable { friend class LocTimerContainer; friend class LocTimer; LocTimer* mClient; - LocUtilSharedLock* mLock; + LocSharedLock* mLock; struct timespec mFutureTime; LocTimerContainer* mContainer; // not a complete obj, just ctor for LocRankable comparisons @@ -548,7 +532,7 @@ void LocTimerDelegate::expire() { /***************************LocTimer methods***************************/ -LocTimer::LocTimer() : mTimer(NULL), mLock(new LocUtilSharedLock()) { +LocTimer::LocTimer() : mTimer(NULL), mLock(new LocSharedLock()) { } LocTimer::~LocTimer() { diff --git a/utils/LocTimer.h b/utils/LocTimer.h index 9606fe53..c1468524 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -35,14 +35,14 @@ // opaque class to provide service implementation. class LocTimerDelegate; -class LocUtilSharedLock; +class LocSharedLock; // LocTimer client must extend this class and implementthe callback. // start() / stop() methods are to arm / disarm timer. class LocTimer { LocTimerDelegate* mTimer; - LocUtilSharedLock* mLock; + 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. diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 794bf92a..fdb11026 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -36,12 +36,19 @@ #include #include -namespace loc_core { - 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)) { @@ -93,36 +100,3 @@ bool MsgTask::run() { return true; } - -// TODO: remove the below in the next patch -void MsgTask::associate(tAssociate tAssociator) const { - struct LocAssociateMsg : public LocMsg { - tAssociate mAssociator; - LocAssociateMsg(tAssociate associator) : - mAssociator(associator) {} - inline virtual void proc() const { - mAssociator(); - } - }; - sendMsg(new LocAssociateMsg(tAssociator)); -} - -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(threadName, this, false)) { - delete mThread; - mThread = NULL; - } -} - -MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(threadName, this, false)) { - delete mThread; - mThread = NULL; - } else if (tAssociator != NULL){ - associate(tAssociator); - } -} - -} // namespace loc_core diff --git a/utils/MsgTask.h b/utils/MsgTask.h index c397ee10..9eb1f567 100644 --- a/utils/MsgTask.h +++ b/utils/MsgTask.h @@ -30,10 +30,6 @@ #define __MSG_TASK__ #include -// TODO: remove this include in the next patch -#include - -namespace loc_core { struct LocMsg { inline LocMsg() {} @@ -42,13 +38,14 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask : public LocRunnable{ +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(); @@ -65,16 +62,6 @@ public: // The method to be run after thread loop (conditionally repeatedly) // calls run() inline virtual void postrun() {} - - // TODO: remove the below in the next patch - typedef void* (*tStart)(void*); - typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); - typedef int (*tAssociate)(); - MsgTask(tCreate tCreator, const char* threadName); - MsgTask(tAssociate tAssociator, const char* threadName); - void associate(tAssociate tAssociator) const; }; -} // namespace loc_core - #endif //__MSG_TASK__ From eb01e397ed7935f66f0be24026cdf4f3cae059c5 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Thu, 10 Sep 2015 09:23:24 -0700 Subject: [PATCH 345/945] Sending FLP fixes to ULP For crowd sourcing, FLP HAL needs to share with ULP the flp fixes in real time. This change is making FLP HAL to send flp fixes to ULP. Change-Id: I1a852ec69db8eb50de5c18b03205d1b488cfd4b0 CRs-fixed: 874928 878064 --- core/LocAdapterBase.cpp | 1 + core/LocAdapterProxyBase.h | 1 + core/UlpProxyBase.h | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 4f7e4f23..8fdb8cbb 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -72,6 +72,7 @@ void LocAdapterBase:: LocPosTechMask loc_technology_mask) { if (mLocAdapterProxyBase == NULL || !mLocAdapterProxyBase->reportPosition(location, + locationExtended, status, loc_technology_mask)) { DEFAULT_IMPL() diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index f6c22afa..1ddcca4c 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -58,6 +58,7 @@ public: 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) { return false; diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 845fe1eb..59e265e8 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -73,10 +73,8 @@ public: bool active) { return false; } - inline virtual bool reportPositions(FlpExtLocation * locations, - int32_t number_of_locations, - enum loc_sess_status status, - LocPosTechMask techMask) { + inline virtual bool reportPositions(const FlpExtLocation* locations, + int32_t number_of_locations) { return false; } }; From bf80dfb9e9713c50712e24e9b1b1afce4e2dce79 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 23 Sep 2015 18:01:06 -0700 Subject: [PATCH 346/945] Add 3 new fields in GPS and FLP pipe To support next version of GTP AP protocol, this change adds the support for the below 3 fields in GPS pipe and FLP pipe : 1). heading_unc 2). horizontal_reliability 3). vertical_reliability Change-Id: If51c38f9159f372c2b2c12fbb55d123958cfee95 CRs-Fixed: 898876 --- core/gps_extended_c.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 06764cf3..183fa411 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -211,6 +211,20 @@ typedef uint16_t GpsLocationExtendedFlags; #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 + +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; /** Represents gps location extended. */ typedef struct { @@ -232,6 +246,12 @@ typedef struct { 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; } GpsLocationExtended; /** Represents SV status. */ From e9e399737bc393cd709192d9d6aaa36792d530e0 Mon Sep 17 00:00:00 2001 From: Vamana Murthi Date: Thu, 24 Sep 2015 13:34:17 +0530 Subject: [PATCH 347/945] Fix for Cppcheck warnings Fixed cppcheck warnings reported by customer Change-Id: Ia6cf5e940d204111d8354f9eec71ac816a142719 CRs-fixed: 901373 --- loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index f7d7cb45..4076ce3e 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -563,7 +563,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL && NULL != get_gps_geofence_interface) { + if ((error = dlerror()) != NULL || NULL == get_gps_geofence_interface) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } From 68104bd7018a884673bc2b1b40a1535b7c16fdf3 Mon Sep 17 00:00:00 2001 From: Aravind Asam Date: Thu, 24 Sep 2015 16:30:36 -0700 Subject: [PATCH 348/945] Opt out of clang till issues are fixed Needed for moving to clang Change-Id: I5922c62cb2f6efc297120c5a359c92a82260f3a7 --- utils/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/Android.mk b/utils/Android.mk index c9b1788d..dd47c183 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -59,6 +59,7 @@ LOCAL_COPY_HEADERS:= \ loc_misc_utils.h LOCAL_MODULE := libgps.utils +LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional From 9b3aa46ebb85dc05c5483b844b83b1ec36a59c98 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 25 Sep 2015 15:57:45 -0700 Subject: [PATCH 349/945] another potential race condition LocTimer on timeout would currently delete timer delegate. This meddles into the management of LocTimer::stop() call, and the order of obj delete needs to be synchronized in a few different places as a result. This change lets the delete of the timer delegate obj fold into the stop() handling, which would be easier to synch. Change-Id: Ic3e0b3d183dceb9e6e2db4c47ec9d6e296b0c3f6 CRs-Fixed: 916590 --- utils/LocTimer.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index c992e7c2..70904b2a 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -333,13 +333,15 @@ void LocTimerContainer::remove(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. + + // 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. + // 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; } }; @@ -367,7 +369,6 @@ void LocTimerContainer::expire() { timer = mTimerContainer->popIfOutRanks(timerOfNow)) { // the timer delegate obj will be deleted before the return of this call timer->expire(); - delete timer; } mTimerContainer->updateSoonestTime(NULL); } @@ -493,9 +494,10 @@ void LocTimerDelegate::destroyLocked() { if (container) { container->remove(*this); } - } // else we do not do anything, as *this* will be deleted either - // after it expires or stop is first called (if case above), - // where container->remove() will have it deleted. + } // 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) { @@ -511,17 +513,11 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { inline void LocTimerDelegate::expire() { - mLock->lock(); // keeping a copy of client pointer to be safe // when timeOutCallback() is called at the end of this - // method, this obj is already deleted. + // method, *this* obj may be already deleted. LocTimer* client = mClient; - // this obj is already removed from mContainer. - // NULL it here so that dtor won't try to call remove again - mContainer = NULL; - mClient = NULL; - mLock->unlock(); - // force a stop, which will force a delete of this obj + // 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 @@ -545,6 +541,7 @@ LocTimer::~LocTimer() { bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool success = false; + mLock->lock(); if (!mTimer) { struct timespec futureTime; clock_gettime(CLOCK_BOOTTIME, &futureTime); @@ -558,21 +555,22 @@ bool LocTimer::start(unsigned int timeOutInMs, bool 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) { - mLock->lock(); LocTimerDelegate* timer = mTimer; mTimer = NULL; if (timer) { timer->destroyLocked(); success = true; } - mLock->unlock(); } + mLock->unlock(); return success; } From 8da6427472edff7dbdbb9adc9dbeb9785548cea9 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 14 Jul 2015 20:58:42 -0700 Subject: [PATCH 350/945] Add AP Timestamp for coarse/fine time to position reports Change to add APTimestamp field to position reports to carry Coarse or fine timestamp. Change-Id: Iaf5490cb991865d4b6376b0934b306a31528d90c --- core/gps_extended_c.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 1014bab2..7debee9b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -263,6 +263,13 @@ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid speed uncertainty */ #define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020 +typedef struct { + struct timespec apTimeStamp; + /*boottime received from pps-ktimer*/ + float apTimeStampUncertaintyMs; + /* timestamp uncertainty in milli seconds */ +}Gnss_ApTimeStampStructType; + /** Represents gps location extended. */ typedef struct { /** set to sizeof(GpsLocationExtended) */ @@ -283,6 +290,7 @@ typedef struct { float vert_unc; /** speed uncertainty in m/s */ float speed_unc; + Gnss_ApTimeStampStructType timeStamp; } GpsLocationExtended; typedef struct GpsExtLocation_s { @@ -911,13 +919,6 @@ typedef struct */ } Gnss_ClockMeasurementStructType; -typedef struct -{ - struct timespec apTimeStamp; - /*boottime received from pps-ktimer*/ - float apTimeStampUncertaintyMs; - /* timestamp uncertainty in milli seconds */ -}Gnss_ApTimeStampStructType; typedef struct { From 9336256027d86d6530698e4abf9c2234339ab80c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Apr 2015 15:23:07 -0700 Subject: [PATCH 351/945] Add support for new sockaddr_storage struct In order to handle ipv6 requests, a new struct is being used instead of an array to store ipv6 info CRs-Fixed: 817295 Change-Id: I030d4206c01724f08b311697f0bbefb1f9fd10e6 --- core/gps_extended_c.h | 2 +- loc_api/libloc_api_50001/loc.cpp | 48 ++++++++++++++++++++++- loc_api/libloc_api_50001/loc_eng_agps.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_agps.h | 12 ++++++ 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 183fa411..27deb442 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -148,7 +148,7 @@ typedef struct { AGpsExtType type; AGpsStatusValue status; uint32_t ipv4_addr; - char ipv6_addr[16]; + struct sockaddr_storage addr; char ssid[SSID_BUF_SIZE]; char password[SSID_BUF_SIZE]; } AGpsExtStatus; diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4076ce3e..505fc940 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -91,6 +91,7 @@ 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 = { @@ -99,7 +100,8 @@ static const AGpsInterface sLocEngAGpsInterface = loc_agps_open, loc_agps_closed, loc_agps_open_failed, - loc_agps_set_server + loc_agps_set_server, + loc_agps_open_with_apniptype }; static int loc_xtra_init(GpsXtraCallbacks* callbacks); @@ -694,6 +696,50 @@ static int loc_agps_open(const char* apn) 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_INVALID; + 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 diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index d6cc1369..5016b5c4 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -762,11 +762,11 @@ int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; - nifRequest.ipv6_addr[0] = 0; + memset(&nifRequest.addr, 0, sizeof(nifRequest.addr)); nifRequest.ssid[0] = '\0'; nifRequest.password[0] = '\0'; } else { - s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setIPAddresses(nifRequest.addr); s->setWifiInfo(nifRequest.ssid, nifRequest.password); } diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 055d955b..2d689cee 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -276,6 +276,7 @@ struct Subscriber { 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; } @@ -316,6 +317,9 @@ struct BITSubscriber : public Subscriber { 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); @@ -340,6 +344,9 @@ struct ATLSubscriber : public Subscriber { 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, @@ -372,6 +379,9 @@ struct WIFISubscriber : public Subscriber { 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) @@ -405,6 +415,8 @@ struct DSSubscriber : public Subscriber { 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); From 56a5a75a22c09ce50e8e0a5565c834e83e03947c Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Fri, 9 Oct 2015 10:26:58 -0700 Subject: [PATCH 352/945] set LPP CP as default LPP CPP E911 is required by many carriers on LTE. Change-Id: If0d3a3107652e114bfdf7fbb59fe648cb3ddd940 CRs-fixed: 919242 --- etc/gps.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 5376a1db..4e6b4366 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -52,7 +52,7 @@ SUPL_ES=0 USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 #SUPL_MODE is a bit mask set in config.xml per carrier by default. -#If it is uncommented here, this value will over write the value from +#If it is uncommented here, this value will overwrite the value from #config.xml. #MSA=0X2 #MSB=0X1 @@ -98,7 +98,7 @@ CAPABILITIES=0x37 # 1: Enable LPP_User_Plane on LTE # 2: Enable LPP_Control_Plane # 3: Enable both LPP_User_Plane and LPP_Control_Plane -LPP_PROFILE = 0 +LPP_PROFILE = 2 ################################ # EXTRA SETTINGS From 0b4a33bc4596f7a632587ac0030dba356d6ab7ef Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 9 Oct 2015 15:58:15 -0700 Subject: [PATCH 353/945] missing util header file causing the unit test builds failure. Change-Id: Id65290c0198904eda020b566e6636b0bb772aa1d --- utils/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/Android.mk b/utils/Android.mk index dd47c183..37512a58 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -53,6 +53,7 @@ LOCAL_COPY_HEADERS:= \ LocTimer.h \ loc_target.h \ loc_timer.h \ + LocSharedLock.h \ platform_lib_abstractions/platform_lib_includes.h \ platform_lib_abstractions/platform_lib_time.h \ platform_lib_abstractions/platform_lib_macros.h \ From 594daf969230b494783b0e6c11bf7613bb46d6f1 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 19 Oct 2015 22:30:58 -0700 Subject: [PATCH 354/945] Add AP Coarse Timestamp Uncertainty configuration parameter Change-Id: Ic93291d451704ced88bdf45df3cb9215acf6f2de --- etc/gps.conf | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index 142c8288..9c9e5e92 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -115,3 +115,45 @@ SGLTE_TARGET=0 # 0x2: RRLP UPlane # 0x4: LLP Uplane A_GLONASS_POS_PROTOCOL_SELECT = 0 + +################################################## +# 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 From f5e6e2eeee213112bcfc074d1d78d6f0d4f883f1 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 13 Oct 2015 18:15:16 -0700 Subject: [PATCH 355/945] Add glo and bds to used-in-fix mask The used-in-fix mask is only keeping track of GPS SVs, so add a used-in-fix mask for GlONASS SVs and BDS SVs as well to avoid NMEA generation issues CRs-fixed: 826152 Change-Id: I33862cf8d40db1d667179ef68d18703edc359843 --- core/LocAdapterBase.cpp | 2 +- core/LocAdapterBase.h | 2 +- core/LocApiBase.cpp | 9 ++-- core/LocApiBase.h | 2 +- core/UlpProxyBase.h | 2 +- core/gps_extended_c.h | 41 +++++++++++++++++++ .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 12 ++++-- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 +- loc_api/libloc_api_50001/LocEngAdapter.h | 4 +- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_msg.h | 4 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 8 ++-- loc_api/libloc_api_50001/loc_eng_nmea.h | 3 +- 13 files changed, 73 insertions(+), 22 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 19fab0e5..8da9ff1d 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(GpsSvStatus &svStatus, + reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 7e0b0ebc..197b1c64 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -92,7 +92,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 565967ae..23424583 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -253,15 +253,16 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GpsSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used" - " in fix mask: %x\n sv: prn snr elevation azimuth", + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" + " mask: %x/%x/%x\n sv: prn snr elevation azimuth", svStatus.num_svs, svStatus.ephemeris_mask, - svStatus.almanac_mask, svStatus.used_in_fix_mask); + svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, + svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { LOC_LOGV(" %d: %d %f %f %f", i, diff --git a/core/LocApiBase.h b/core/LocApiBase.h index c71100f4..59622a6c 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -113,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GpsSvStatus &svStatus, + void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 5270cfb3..9eb450bd 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -58,7 +58,7 @@ public: LocPosTechMask loc_technology_mask) { return false; } - inline virtual bool reportSv(GpsSvStatus &svStatus, + inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { return false; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 7debee9b..04fab59b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -306,6 +306,47 @@ typedef struct GpsExtLocation_s { uint32_t sources_used; } GpsExtLocation; +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GnssSvStatus) */ + size_t size; + + /** Number of SVs currently visible. */ + int num_svs; + + /** Contains an array of SV information. */ + GpsSvInfo sv_list[GPS_MAX_SVS]; + + /** Represents a bit mask indicating which SVs + * have ephemeris data. + */ + uint32_t ephemeris_mask; + + /** Represents a bit mask indicating which SVs + * have almanac data. + */ + uint32_t almanac_mask; + + /** + * Represents a bit mask indicating which GPS SVs + * were used for computing the most recent position fix. + */ + uint32_t gps_used_in_fix_mask; + + /** + * Represents a bit mask indicating which GLONASS SVs + * were used for computing the most recent position fix. + */ + uint32_t glo_used_in_fix_mask; + + /** + * Represents a bit mask indicating which BDS SVs + * were used for computing the most recent position fix. + */ + uint64_t bds_used_in_fix_mask; + +} GnssSvStatus; + enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index dbfc2fb7..c7447543 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -797,7 +797,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { - GpsSvStatus SvStatus = {0}; + GnssSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; @@ -823,7 +823,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS) { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + 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 @@ -842,7 +842,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) && (sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK)) { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); + SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); } } // SBAS: GPS RPN: 120-151, @@ -855,6 +855,12 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) // 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 diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 7089741b..d1b8f8fc 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -199,14 +199,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, +void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GpsSvStatus &svStatus, +void LocEngAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index bc41ac1d..e1d8f098 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -55,7 +55,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -268,7 +268,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index a81df97b..917c2ae2 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -827,7 +827,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 5626c346..9c7b9bcd 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GpsSvStatus mSvStatus; + const GnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 4c6b9a3a..7bc58bd0 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -604,7 +604,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -790,7 +790,9 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.used_in_fix_mask == 0) + if (svStatus.gps_used_in_fix_mask == 0 && + svStatus.glo_used_in_fix_mask == 0 && + svStatus.bds_used_in_fix_mask == 0) { // No sv used, so there will be no position report, so send // blank NMEA sentences strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); @@ -812,7 +814,7 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, else { // cache the used in fix mask, as it will be needed to send $GPGSA // during the position report - loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; + loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; // For RPC, the DOP are sent during sv report, so cache them // now to be sent during position report. diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 40c6dbbd..066943aa 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -31,12 +31,13 @@ #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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); +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 From c3643ebf64a443a97c5c8d793bdd704038e8d8d6 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 5 Nov 2015 09:59:54 -0800 Subject: [PATCH 356/945] remove link depedency to dsi_netctrl temporarily the link dependency is necessary for ds_api to work, but it would bring in libqcci_legacy indirectly, which would cause crash at runtime when calling into the qmi client implementation fromlibqcci_legacy, while the right impl is from qmi-frameworks. Change-Id: If986fe059199dd752526dbe837fcf03b4b4d8002 --- loc_api/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index c5bffed2..d42d4d99 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -81,7 +81,7 @@ 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) \ From c9a243bc159404532a13ff2d828cb0c95e0bbb6c Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 30 Oct 2015 19:11:13 -0700 Subject: [PATCH 357/945] Move some debug logs to verbose. While it is important to continue to log events at debug level logs, logging all data may not be as important. Moving such logs to verbose level CRs-Fixed: 936031 Change-Id: I634d173b645180d55d620a24cce2c31aee966b8f --- utils/MsgTask.cpp | 2 +- utils/linked_list.c | 6 +++--- utils/msg_q.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index fdb11026..6f9d0e90 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -83,7 +83,7 @@ void MsgTask::prerun() { } bool MsgTask::run() { - LOC_LOGD("MsgTask::loop() listening ...\n"); + 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) { diff --git a/utils/linked_list.c b/utils/linked_list.c index 92617fee..2c91714b 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -109,7 +109,7 @@ linked_list_err_type linked_list_destroy(void** list_data) ===========================================================================*/ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)) { - LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); + 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__); @@ -161,7 +161,7 @@ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dea ===========================================================================*/ linked_list_err_type linked_list_remove(void* list_data, void **data_obj) { - LOC_LOGD("%s: Removing from list\n", __FUNCTION__); + LOC_LOGV("%s: Removing from list\n", __FUNCTION__); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -268,7 +268,7 @@ 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_LOGD("%s: Search the list\n", __FUNCTION__); + 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", diff --git a/utils/msg_q.c b/utils/msg_q.c index f82d4c03..5be8547e 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -199,7 +199,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) msg_q* p_msg_q = (msg_q*)msg_q_data; pthread_mutex_lock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); if( p_msg_q->unblocked ) { @@ -215,7 +215,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); return rv; } @@ -242,7 +242,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) msg_q* p_msg_q = (msg_q*)msg_q_data; - LOC_LOGD("%s: Waiting on message\n", __FUNCTION__); + LOC_LOGV("%s: Waiting on message\n", __FUNCTION__); pthread_mutex_lock(&p_msg_q->list_mutex); @@ -263,7 +263,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } From 78bb13288e9ac69a985cf8a4b8c15b21770b59c5 Mon Sep 17 00:00:00 2001 From: Valeri Atamaniouk Date: Wed, 21 Oct 2015 18:53:58 +0300 Subject: [PATCH 358/945] Location: reduce memory footprint Reduce memory footprint by moving data sets into const data segments. Update function parameters to accept const parameters when appropriate. CRs-fixed: 928770 Change-Id: I42955cf18de2b0541cfaed89359cdcf9ae6fea8a --- core/loc_core_log.cpp | 50 ++++++++++++++-------------- loc_api/libloc_api_50001/loc_eng.cpp | 6 ++-- utils/loc_cfg.cpp | 16 ++++----- utils/loc_cfg.h | 10 +++--- utils/loc_log.cpp | 22 ++++++------ utils/loc_log.h | 17 ++++++---- 6 files changed, 62 insertions(+), 59 deletions(-) diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 216dd598..3ca6c0a5 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -49,7 +49,7 @@ void LocPosMode::logv() const } /* GPS status names */ -static loc_name_val_s_type gps_status_name[] = +static const loc_name_val_s_type gps_status_name[] = { NAME_VAL( GPS_STATUS_NONE ), NAME_VAL( GPS_STATUS_SESSION_BEGIN ), @@ -57,7 +57,7 @@ static loc_name_val_s_type gps_status_name[] = NAME_VAL( GPS_STATUS_ENGINE_ON ), NAME_VAL( GPS_STATUS_ENGINE_OFF ), }; -static int gps_status_num = sizeof(gps_status_name) / sizeof(loc_name_val_s_type); +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) @@ -68,7 +68,7 @@ const char* loc_get_gps_status_name(GpsStatusValue gps_status) -static loc_name_val_s_type loc_eng_position_modes[] = +static const loc_name_val_s_type loc_eng_position_modes[] = { NAME_VAL( LOC_POSITION_MODE_STANDALONE ), NAME_VAL( LOC_POSITION_MODE_MS_BASED ), @@ -79,7 +79,7 @@ static loc_name_val_s_type loc_eng_position_modes[] = NAME_VAL( LOC_POSITION_MODE_RESERVED_4 ), NAME_VAL( LOC_POSITION_MODE_RESERVED_5 ) }; -static int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type); +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) { @@ -88,12 +88,12 @@ const char* loc_get_position_mode_name(GpsPositionMode mode) -static loc_name_val_s_type loc_eng_position_recurrences[] = +static const loc_name_val_s_type loc_eng_position_recurrences[] = { NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) }; -static int loc_eng_position_recurrence_num = sizeof(loc_eng_position_recurrences) / sizeof(loc_name_val_s_type); +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) { @@ -102,7 +102,7 @@ const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur) -static loc_name_val_s_type loc_eng_aiding_data_bits[] = +static const loc_name_val_s_type loc_eng_aiding_data_bits[] = { NAME_VAL( GPS_DELETE_EPHEMERIS ), NAME_VAL( GPS_DELETE_ALMANAC ), @@ -118,7 +118,7 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] = NAME_VAL( GPS_DELETE_CELLDB_INFO ), NAME_VAL( GPS_DELETE_ALL) }; -static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); +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) { @@ -126,7 +126,7 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data) } -static loc_name_val_s_type loc_eng_agps_types[] = +static const loc_name_val_s_type loc_eng_agps_types[] = { NAME_VAL( AGPS_TYPE_INVALID ), NAME_VAL( AGPS_TYPE_ANY ), @@ -134,7 +134,7 @@ static loc_name_val_s_type loc_eng_agps_types[] = NAME_VAL( AGPS_TYPE_C2K ), NAME_VAL( AGPS_TYPE_WWAN_ANY ) }; -static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type); +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) { @@ -142,14 +142,14 @@ const char* loc_get_agps_type_name(AGpsType type) } -static loc_name_val_s_type loc_eng_ni_types[] = +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 int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type); +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) { @@ -157,13 +157,13 @@ const char* loc_get_ni_type_name(GpsNiType type) } -static loc_name_val_s_type loc_eng_ni_responses[] = +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 int loc_eng_ni_reponse_num = sizeof(loc_eng_ni_responses) / sizeof(loc_name_val_s_type); +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) { @@ -171,7 +171,7 @@ const char* loc_get_ni_response_name(GpsUserResponseType response) } -static loc_name_val_s_type loc_eng_ni_encodings[] = +static const loc_name_val_s_type loc_eng_ni_encodings[] = { NAME_VAL( GPS_ENC_NONE ), NAME_VAL( GPS_ENC_SUPL_GSM_DEFAULT ), @@ -179,55 +179,55 @@ static loc_name_val_s_type loc_eng_ni_encodings[] = NAME_VAL( GPS_ENC_SUPL_UCS2 ), NAME_VAL( GPS_ENC_UNKNOWN ) }; -static int loc_eng_ni_encoding_num = sizeof(loc_eng_ni_encodings) / sizeof(loc_name_val_s_type); +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 loc_name_val_s_type loc_eng_agps_bears[] = +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 int loc_eng_agps_bears_num = sizeof(loc_eng_agps_bears) / sizeof(loc_name_val_s_type); +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 loc_name_val_s_type loc_eng_server_types[] = +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 int loc_eng_server_types_num = sizeof(loc_eng_server_types) / sizeof(loc_name_val_s_type); +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 loc_name_val_s_type loc_eng_position_sess_status_types[] = +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 int loc_eng_position_sess_status_num = sizeof(loc_eng_position_sess_status_types) / sizeof(loc_name_val_s_type); +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 loc_name_val_s_type loc_eng_agps_status_names[] = +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 ), @@ -235,7 +235,7 @@ static loc_name_val_s_type loc_eng_agps_status_names[] = NAME_VAL( GPS_AGPS_DATA_CONN_DONE ), NAME_VAL( GPS_AGPS_DATA_CONN_FAILED ) }; -static int loc_eng_agps_status_num = sizeof(loc_eng_agps_status_names) / sizeof(loc_name_val_s_type); +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) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5d92e44a..2ba6f982 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2009-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 @@ -94,7 +94,7 @@ loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ -static loc_param_s_type gps_conf_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'}, @@ -113,7 +113,7 @@ static loc_param_s_type gps_conf_table[] = {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, }; -static loc_param_s_type sap_conf_table[] = +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'}, diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 5c33320d..967d2f30 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -56,12 +56,12 @@ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; /* Parameter spec table */ -static loc_param_s_type loc_param_table[] = +static const loc_param_s_type loc_param_table[] = { {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; -int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); +static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); typedef struct loc_param_v_type { @@ -92,7 +92,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +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) @@ -181,7 +181,7 @@ SIDE EFFECTS N/A ===========================================================================*/ int loc_fill_conf_item(char* input_buf, - loc_param_s_type* config_table, uint32_t table_length) + const loc_param_s_type* config_table, uint32_t table_length) { int ret = 0; @@ -258,7 +258,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -int loc_read_conf_r(FILE *conf_fp, 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 ret=0; @@ -322,7 +322,7 @@ SIDE EFFECTS N/A ===========================================================================*/ int loc_update_conf(const char* conf_data, int32_t length, - loc_param_s_type* config_table, uint32_t table_length) + const loc_param_s_type* config_table, uint32_t table_length) { int ret = -1; @@ -377,7 +377,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, +void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, uint32_t table_length) { FILE *conf_fp = NULL; diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index ea4865b9..9045e1d5 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -54,7 +54,7 @@ *============================================================================*/ typedef struct { - char param_name[LOC_MAX_PARAM_NAME]; + const char *param_name; void *param_ptr; uint8_t *param_set; /* was this value set by config file? */ char param_type; /* 'n' for number, @@ -78,12 +78,12 @@ extern "C" { * *============================================================================*/ void loc_read_conf(const char* conf_file_name, - loc_param_s_type* config_table, + const loc_param_s_type* config_table, uint32_t table_length); -int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, +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, - loc_param_s_type* config_table, uint32_t table_length); + const loc_param_s_type* config_table, uint32_t table_length); #ifdef __cplusplus } #endif diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 5500dead..76f0c532 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -57,9 +57,9 @@ const char EXIT_ERROR_TAG[] = "Exiting with error"; loc_logger_s_type loc_logger; /* Get names from value */ -const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) +const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val & (long) mask) @@ -71,9 +71,9 @@ const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, } /* Get names from value */ -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value) +const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val == (long) value) @@ -84,7 +84,7 @@ const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, l return UNKNOWN_STR; } -static loc_name_val_s_type loc_msg_q_status[] = +static const loc_name_val_s_type loc_msg_q_status[] = { NAME_VAL( eMSG_Q_SUCCESS ), NAME_VAL( eMSG_Q_FAILURE_GENERAL ), @@ -93,7 +93,7 @@ static loc_name_val_s_type loc_msg_q_status[] = NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ), NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER ) }; -static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); +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) @@ -107,7 +107,7 @@ const char* log_succ_fail_string(int is_succ) } //Target names -loc_name_val_s_type target_name[] = +static const loc_name_val_s_type target_name[] = { NAME_VAL(GNSS_NONE), NAME_VAL(GNSS_MSM), @@ -118,7 +118,7 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_UNKNOWN) }; -static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); +static const size_t target_name_num = LOC_TABLE_SIZE(target_name); /*=========================================================================== @@ -139,7 +139,7 @@ const char *loc_get_target_name(unsigned int target) static char ret[BUFFER_SIZE]; index = getTargetGnssType(target); - if( index >= target_name_num || index < 0) + if( index < 0 || (unsigned)index >= target_name_num ) index = target_name_num - 1; if( (target & HAS_SSC) == HAS_SSC ) { @@ -168,7 +168,7 @@ RETURN VALUE The time string ===========================================================================*/ -char *loc_get_time(char *time_string, unsigned long buf_size) +char *loc_get_time(char *time_string, size_t buf_size) { struct timeval now; /* sec and usec */ struct tm now_tm; /* broken-down time */ diff --git a/utils/loc_log.h b/utils/loc_log.h index 82dc6368..be492b11 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -36,12 +36,13 @@ extern "C" #endif #include +#include #include "loc_target.h" typedef struct { - char name[128]; - long val; + const char *name; + long val; } loc_name_val_s_type; #define NAME_VAL(x) {"" #x "", x } @@ -49,17 +50,19 @@ typedef struct #define UNKNOWN_STR "UNKNOWN" #define CHECK_MASK(type, value, mask_var, mask) \ - ((mask_var & mask) ? (type) value : (type) (-1)) + (((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(loc_name_val_s_type table[], int table_size, long mask); -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long 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, unsigned long buf_size); +extern char *loc_get_time(char *time_string, size_t buf_size); #ifdef __cplusplus } From 30c54b87d961e45e625b64c38e56800a637ac076 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Mon, 9 Nov 2015 16:15:07 -0800 Subject: [PATCH 359/945] Xtra client always reports carrier as 'unknown' The problem was caused by populating the carrier upon phone bootup when the the property maybe not initialized yet. This module is updated to remove the populating code of carrier in phone bootup. Change-Id: I9c3f970aa0f0ca0805fdc2e04aa809329b6a2676 CRs-fixed: 935146 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 35447d48..3e5a6b55 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -101,7 +101,6 @@ void LocEngAdapter::setXtraUserAgent() { char release[PROPERTY_VALUE_MAX]; char manufacture[PROPERTY_VALUE_MAX]; char model[PROPERTY_VALUE_MAX]; - char carrier[PROPERTY_VALUE_MAX]; char board[PROPERTY_VALUE_MAX]; char brand[PROPERTY_VALUE_MAX]; char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; @@ -111,13 +110,12 @@ void LocEngAdapter::setXtraUserAgent() { 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.carrier", carrier, defVal); property_get("ro.product.board", board, defVal); property_get("ro.product.brand", brand, defVal); getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); - snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/%s/QCX3/s%u/-/%s/-/%s/-/-/-", - release, manufacture, model, board, carrier, + 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++) { From c53037dc6aec4ed5a55facda08f1b5321e67ca65 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Fri, 28 Aug 2015 16:54:16 -0700 Subject: [PATCH 360/945] encode field separator characters Replace all separator characters ('/','+','|','%') in the raw string by their corresponding encodings (%2F","%2B","%7C", "%25") Change-Id: I3c895adc2ce1cef36032a25e3c6fd63e70350607 CRs-fixed: 881265 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 3e5a6b55..592662df 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -114,6 +114,12 @@ void LocEngAdapter::setXtraUserAgent() { 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); @@ -197,6 +203,56 @@ void LocEngAdapter::setXtraUserAgent() { 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)); From 58c3d32868997c8607dafe05de047e1a04aac6cc Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 16 Jun 2015 09:57:42 -0700 Subject: [PATCH 361/945] Adding a number of utilities LocHeap, LocThread, LocTimer, and moved MsgTask to utils. Also added are LocRankable and LocRunnable abstract classes. Change-Id: I76975455d24f2c84a95dcc1b04f79fea562ea5ba CRs-Fixed: 855222 --- core/Android.mk | 2 - utils/Android.mk | 12 +- utils/LocHeap.cpp | 354 +++++++++++++++++++ utils/LocHeap.h | 96 ++++++ utils/LocThread.cpp | 252 ++++++++++++++ utils/LocThread.h | 87 +++++ utils/LocTimer.cpp | 664 ++++++++++++++++++++++++++++++++++++ utils/LocTimer.h | 67 ++++ {core => utils}/MsgTask.cpp | 149 ++++---- {core => utils}/MsgTask.h | 41 ++- utils/loc_timer.c | 202 ----------- utils/loc_timer.h | 32 +- 12 files changed, 1644 insertions(+), 314 deletions(-) create mode 100644 utils/LocHeap.cpp create mode 100644 utils/LocHeap.h create mode 100644 utils/LocThread.cpp create mode 100644 utils/LocThread.h create mode 100644 utils/LocTimer.cpp create mode 100644 utils/LocTimer.h rename {core => utils}/MsgTask.cpp (55%) rename {core => utils}/MsgTask.h (71%) delete mode 100644 utils/loc_timer.c diff --git a/core/Android.mk b/core/Android.mk index 6a08b6a9..267b31f7 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -23,7 +23,6 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_SRC_FILES += \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ @@ -39,7 +38,6 @@ LOCAL_C_INCLUDES:= \ LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ diff --git a/utils/Android.mk b/utils/Android.mk index d672e3a1..c9b1788d 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -18,13 +18,17 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - loc_timer.c \ platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ loc_misc_utils.cpp LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -std=c++11 ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER @@ -43,6 +47,10 @@ LOCAL_COPY_HEADERS:= \ log_util.h \ linked_list.h \ msg_q.h \ + MsgTask.h \ + LocHeap.h \ + LocThread.h \ + LocTimer.h \ loc_target.h \ loc_timer.h \ platform_lib_abstractions/platform_lib_includes.h \ diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp new file mode 100644 index 00000000..41268789 --- /dev/null +++ b/utils/LocHeap.cpp @@ -0,0 +1,354 @@ +/* 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 (!outRanks(*mLeft) || !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 (!outRanks(*mRight) || !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/utils/LocHeap.h b/utils/LocHeap.h new file mode 100644 index 00000000..b491948a --- /dev/null +++ b/utils/LocHeap.h @@ -0,0 +1,96 @@ +/* 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/utils/LocThread.cpp b/utils/LocThread.cpp new file mode 100644 index 00000000..ec1e0719 --- /dev/null +++ b/utils/LocThread.cpp @@ -0,0 +1,252 @@ +/* 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 + +class LocThreadDelegate { + LocRunnable* mRunnable; + bool mJoinable; + pthread_t mThandle; + pthread_mutex_t mMutex; + int mRefCount; + ~LocThreadDelegate(); + LocThreadDelegate(const char* threadName, + LocRunnable* runnable, bool joinable); + void destroy(); +public: + static LocThreadDelegate* create(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(const char* threadName, + LocRunnable* runnable, bool joinable) : + mRunnable(runnable), mJoinable(joinable), + mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) { + // create the thread here, then if successful + // and a name is given, we set the thread name + if (!pthread_create(&mThandle, NULL, threadMain, this)) { + // set thread name + char lname[16]; + const char* defaultName = "LocThread"; + if (!threadName) { + threadName = defaultName; + } + int len = 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(const char* threadName, + LocRunnable* runnable, bool joinable) { + LocThreadDelegate* thread = NULL; + if (runnable) { + thread = new LocThreadDelegate(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(const char* threadName, LocRunnable* runnable, bool joinable) { + mThread = LocThreadDelegate::create(threadName, runnable, joinable); + + // true only if thread is created successfully + return (NULL != mThread); +} + +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/utils/LocThread.h b/utils/LocThread.h new file mode 100644 index 00000000..490d3099 --- /dev/null +++ b/utils/LocThread.h @@ -0,0 +1,87 @@ +/* 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 + +// 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(); + + // 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(const char* threadName, LocRunnable* runnable, bool joinable = true); + + // 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/utils/LocTimer.cpp b/utils/LocTimer.cpp new file mode 100644 index 00000000..22098091 --- /dev/null +++ b/utils/LocTimer.cpp @@ -0,0 +1,664 @@ +/* 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 + +using namespace loc_core; + +/* +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 + const 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); + +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; + struct timespec mFutureTime; + LocTimerContainer* mContainer; + // not a complete obj, just ctor for LocRankable comparisons + inline LocTimerDelegate(struct timespec& delay) + : mClient(NULL), mFutureTime(delay), mContainer(NULL) {} + inline ~LocTimerDelegate() {} +public: + LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire); + void destroy(); + // 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) { + // 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; +} + +// all the heap management is done in the MsgTask context. +inline +void LocTimerContainer::add(LocTimerDelegate& timer) { + struct MsgTimerPush : public LocMsg { + LocTimerContainer* mTimerContainer; + LocHeapNode* mTree; + LocTimerPollTask* mPollTask; + LocTimerDelegate* mTimer; + inline MsgTimerPush(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + mTimerContainer->push((LocRankable&)(*mTimer)); + + // if the tree top changed (new top is the new node), we need to update + // timerfd with the new timerout value. + if (priorTop != mTimerContainer->getSoonestTimer()) { + // if tree was empty before, we need to let poll task poll on this + // do this first to avoid race condition, in case settime is called + // with too small an interval + if (!priorTop) { + mPollTask->addPoll(*mTimerContainer); + } + struct itimerspec delay = {0}; + delay.it_value = mTimer->getFutureTime(); + timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerPush(*this, *mPollTask, timer)); +} + +// all the heap management is done in the MsgTask context. +void LocTimerContainer::remove(LocTimerDelegate& timer) { + struct MsgTimerRemove : public LocMsg { + LocTimerContainer* mTimerContainer; + LocTimerPollTask* mPollTask; + LocTimerDelegate* mTimer; + inline MsgTimerRemove(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); + delete mTimer; + LocTimerDelegate* curTop = mTimerContainer->getSoonestTimer(); + + // if the tree top changed (the removed the node was the tree top), we need + // to update the timerfd with the new timeout value from the new top. + if (priorTop != curTop) { + struct itimerspec delay = {0}; + // if tree is empty now, we need to remove poll from poll task + if (!curTop) { + mPollTask->removePoll(*mTimerContainer); + // setting the values to disarm timer + delay.it_value.tv_sec = 0; + delay.it_value.tv_nsec = 0; + } else { + delay.it_value = curTop->getFutureTime(); + } + // this will either update the timer with the new soonest timeout + // or disarm the timer, if the current tree top empty + timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerRemove(*this, *mPollTask, 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 = mTimerContainer->popIfOutRanks(timerOfNow); + NULL != timer; + timer = mTimerContainer->popIfOutRanks(timerOfNow)) { + // the timer delegate obj will be deleted before the return of this call + timer->expire(); + } + } + }; + + mMsgTask->sendMsg(new MsgTimerExpire(*this)); +} + +LocTimerDelegate* LocTimerContainer::popIfOutRanks(LocTimerDelegate& timer) { + LocTimerDelegate* poppedNode = NULL; + + if (mTree && peek()->outRanks((LocRankable&)(timer))) { + 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; + // 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 will has a context pointer associated with the right timer container + LocTimerContainer* container = (LocTimerContainer*)(ev[i].data.ptr); + if (container) { + container->expire(); + } + } + } + + // 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), mFutureTime(futureTime), mContainer(LocTimerContainer::get(wakeOnExpire)) { + // adding the timer into the container + mContainer->add(*this); +} + +inline +void LocTimerDelegate::destroy() { + if (mContainer) { + mContainer->remove(*this); + mContainer = NULL; + } +} + +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, this obj outRanks higher + rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + } + 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 is already deleted. + LocTimer* client = mClient; + // this obj is already removed from mContainer. + // NULL it here so that dtor won't try to call remove again + mContainer = NULL; + // force a stop, which will force a delete of this obj + mClient->stop(); + // calling client callback with a pointer save on the stack + client->timeOutCallback(); +} + + +/***************************LocTimer methods***************************/ + +bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { + bool success = false; + 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); + } + return success; +} + +bool LocTimer::stop() { + bool success = false; + if (mTimer) { + mTimer->destroy(); + mTimer = NULL; + success = true; + } + return success; +} + +/***************************LocTimerWrapper methods***************************/ +////////////////////////////////////////////////////////////////////////// +// This section below wraps for the C style APIs +////////////////////////////////////////////////////////////////////////// +class LocTimerWrapper : public LocTimer { + loc_timer_callback mCb; + void* mCallerData; +public: + inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : + mCb(cb), mCallerData(callerData) {} + inline virtual void timeOutCallback() { mCb(mCallerData, 0); } +}; + +void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, + void *caller_data, bool wake_on_expire) +{ + LocTimerWrapper* 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->stop(); + delete locTimerWrapper; + 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/utils/LocTimer.h b/utils/LocTimer.h new file mode 100644 index 00000000..c5012927 --- /dev/null +++ b/utils/LocTimer.h @@ -0,0 +1,67 @@ +/* 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; + +// LocTimer client must extend this class and implementthe callback. +// start() / stop() methods are to arm / disarm timer. +class LocTimer +{ + LocTimerDelegate* mTimer; +public: + inline LocTimer() : mTimer(NULL) {} + inline virtual ~LocTimer() { stop(); } + + // 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/core/MsgTask.cpp b/utils/MsgTask.cpp similarity index 55% rename from core/MsgTask.cpp rename to utils/MsgTask.cpp index 5d375aa5..8b645dd5 100644 --- a/core/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -38,66 +38,31 @@ namespace loc_core { -#define MAX_TASK_COMM_LEN 15 - static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; } -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(NULL){ - if (tCreator) { - tCreator(threadName, loopMain, - (void*)new MsgTask(mQ, mAssociator)); - } else { - createPThread(threadName); +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(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(tAssociator){ - createPThread(threadName); -} - -inline -MsgTask::MsgTask(const void* q, tAssociate associator) : - mQ(q), mAssociator(associator){ -} - MsgTask::~MsgTask() { + msg_q_flush((void*)mQ); + msg_q_destroy((void**)&mQ); +} + +void MsgTask::destroy() { msg_q_unblock((void*)mQ); -} - -void MsgTask::associate(tAssociate tAssociator) const { - struct LocAssociateMsg : public LocMsg { - tAssociate mAssociator; - inline LocAssociateMsg(tAssociate associator) : - LocMsg(), mAssociator(associator) {} - inline virtual void proc() const { - if (mAssociator) { - LOC_LOGD("MsgTask::associate"); - mAssociator(); - } - } - }; - sendMsg(new LocAssociateMsg(tAssociator)); -} - -void MsgTask::createPThread(const char* threadName) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_t tid; - // create the thread here, then if successful - // and a name is given, we set the thread name - if (!pthread_create(&tid, &attr, loopMain, - (void*)new MsgTask(mQ, mAssociator)) && - NULL != threadName) { - char lname[MAX_TASK_COMM_LEN+1]; - memcpy(lname, threadName, MAX_TASK_COMM_LEN); - lname[MAX_TASK_COMM_LEN] = 0; - pthread_setname_np(tid, lname); + if (mThread) { + LocThread* thread = mThread; + mThread = NULL; + delete thread; + } else { + delete this; } } @@ -105,43 +70,63 @@ void MsgTask::sendMsg(const LocMsg* msg) const { msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); } -void* MsgTask::loopMain(void* arg) { - MsgTask* copy = (MsgTask*)arg; - +void MsgTask::prerun() { // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); +} - if (NULL != copy->mAssociator) { - copy->mAssociator(); - } - +bool MsgTask::run() { + LOC_LOGD("MsgTask::loop() listening ...\n"); LocMsg* msg; - int cnt = 0; - - while (1) { - LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); - - msq_q_err_type result = msg_q_rcv((void*)copy->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)); - // destroy the Q and exit - msg_q_destroy((void**)&(copy->mQ)); - delete copy; - return NULL; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete 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; } - delete copy; + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); - return NULL; + delete msg; + + return true; } +// TODO: remove the below in the next patch +void MsgTask::associate(tAssociate tAssociator) const { + struct LocAssociateMsg : public LocMsg { + tAssociate mAssociator; + LocAssociateMsg(tAssociate associator) : + mAssociator(associator) {} + inline virtual void proc() const { + static bool sAssociated = false; + if (!sAssociated) { + sAssociated = true; + mAssociator(); + } + } + }; + sendMsg(new LocAssociateMsg(tAssociator)); } + +MsgTask::MsgTask(tCreate tCreator, const char* threadName) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(threadName, this, false)) { + delete mThread; + mThread = NULL; + } +} + +MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(threadName, this, false)) { + delete mThread; + mThread = NULL; + } else { + associate(tAssociator); + } +} + +} // namespace loc_core diff --git a/core/MsgTask.h b/utils/MsgTask.h similarity index 71% rename from core/MsgTask.h rename to utils/MsgTask.h index d50bb31a..c397ee10 100644 --- a/core/MsgTask.h +++ b/utils/MsgTask.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -29,9 +29,8 @@ #ifndef __MSG_TASK__ #define __MSG_TASK__ -#include -#include -#include +#include +// TODO: remove this include in the next patch #include namespace loc_core { @@ -43,23 +42,37 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask { +class MsgTask : public LocRunnable{ + const void* mQ; + LocThread* mThread; + friend class LocThreadDelegate; +protected: + virtual ~MsgTask(); public: + 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() {} + + // TODO: remove the below in the next patch typedef void* (*tStart)(void*); typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); typedef int (*tAssociate)(); MsgTask(tCreate tCreator, const char* threadName); MsgTask(tAssociate tAssociator, const char* threadName); - ~MsgTask(); - void sendMsg(const LocMsg* msg) const; void associate(tAssociate tAssociator) const; - -private: - const void* mQ; - tAssociate mAssociator; - MsgTask(const void* q, tAssociate associator); - static void* loopMain(void* copy); - void createPThread(const char* name); }; } // namespace loc_core diff --git a/utils/loc_timer.c b/utils/loc_timer.c deleted file mode 100644 index 2beca5fa..00000000 --- a/utils/loc_timer.c +++ /dev/null @@ -1,202 +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 -#include "loc_timer.h" -#include -#include - -enum timer_state { - READY = 100, - WAITING, - DONE, - ABORT -}; - -typedef struct { - loc_timer_callback callback_func; - void *user_data; - unsigned int time_msec; - pthread_cond_t timer_cond; - pthread_mutex_t timer_mutex; - enum timer_state state; -}timer_data; - -static void *timer_thread(void *thread_data) -{ - int ret = -ETIMEDOUT; - struct timespec ts; - struct timeval tv; - timer_data* t = (timer_data*)thread_data; - - LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); - - gettimeofday(&tv, NULL); - clock_gettime(CLOCK_REALTIME, &ts); - if(t->time_msec >= 1000) { - ts.tv_sec += t->time_msec/1000; - t->time_msec = t->time_msec % 1000; - } - if(t->time_msec) - ts.tv_nsec += t->time_msec * 1000000; - if(ts.tv_nsec > 999999999) { - LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); - ts.tv_sec += 1; - ts.tv_nsec -= 1000000000; - } - LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" - "\t Current time: %d sec; %d nsec", - __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, - (int)tv.tv_sec, (int)tv.tv_usec*1000); - - pthread_mutex_lock(&(t->timer_mutex)); - if (READY == t->state) { - t->state = WAITING; - ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); - t->state = DONE; - } - pthread_mutex_unlock(&(t->timer_mutex)); - - switch (ret) { - case ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); - break; - case 0: - LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); - break; - case -ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); - break; - default: - LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", - __func__, __LINE__, ret); - break; - } - - if(ETIMEDOUT == ret) - t->callback_func(t->user_data, ret); - - // A (should be rare) race condition is that, when the loc_time_stop is called - // and acquired mutex, we reach here. pthread_mutex_destroy will fail with - // error code EBUSY. We give it 6 tries in 5 seconds. Should be eanough time - // for loc_timer_stop to complete. With the 7th try, we also perform unlock - // prior to destroy. - { - int i; - for (i = 0; EBUSY == pthread_mutex_destroy(&t->timer_mutex) && i <= 5; i++) { - if (i < 5) { - sleep(1); - } else { - // nah, forget it, something is seriously wrong. Mutex has been - // held too long. Unlock the mutext here. - pthread_mutex_unlock(&t->timer_mutex); - } - } - } - pthread_cond_destroy(&t->timer_cond); - - free(t); - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return NULL; -} - -void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, - void* caller_data) -{ - timer_data *t=NULL; - pthread_attr_t tattr; - pthread_t id; - LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); - if(cb_func == NULL || msec == 0) { - LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); - goto _err; - } - t = (timer_data *)calloc(1, sizeof(timer_data)); - if(t == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", - __func__, __LINE__); - goto _err; - } - - if(pthread_cond_init(&(t->timer_cond), NULL)) { - LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); - goto t_err; - } - if(pthread_mutex_init(&(t->timer_mutex), NULL)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto cond_err; - } - - t->callback_func = cb_func; - t->user_data = caller_data; - t->time_msec = msec; - t->state = READY; - - if (pthread_attr_init(&tattr)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto mutex_err; - } - pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); - - if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { - LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); - goto attr_err; - } - - LOC_LOGD("%s:%d]: Created thread with id: %d\n", - __func__, __LINE__, (int)id); - goto _err; - -attr_err: - pthread_attr_destroy(&tattr); -mutex_err: - pthread_mutex_destroy(&t->timer_mutex); -cond_err: - pthread_cond_destroy(&t->timer_cond); -t_err: - free(t); -_err: - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return t; -} - -void loc_timer_stop(void* handle) { - timer_data* t = (timer_data*)handle; - - if (NULL != t && (READY == t->state || WAITING == t->state) && - pthread_mutex_lock(&(t->timer_mutex)) == 0) { - if (READY == t->state || WAITING == t->state) { - pthread_cond_signal(&t->timer_cond); - t->state = ABORT; - } - pthread_mutex_unlock(&(t->timer_mutex)); - } -} diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 0034d278..8836d1ea 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -33,28 +33,36 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include -#include "log_util.h" +#include /* - Return values: - Success = 0 - Failure = Non zero + 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, int result); +typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* - Returns the handle, which can be used to stop the timer + delay_msec: timeout value for the timer. + loc_timer_callback: callback function pointer, implemented by client. + 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 */ -void* loc_timer_start(unsigned int delay_msec, +void* loc_timer_start(uint64_t delay_msec, loc_timer_callback, - void* user_data); + void *user_data, + bool wake_on_expire=false); /* - handle becomes invalid upon the return of the callback + handle becomes invalid upon the return of the callback */ -void loc_timer_stop(void* handle); +void loc_timer_stop(void*& handle); #ifdef __cplusplus } From c9db5166b5fe498c22b222c674d19b8833fc5853 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 10 Jul 2015 20:30:57 -0700 Subject: [PATCH 362/945] LocTimer repeated expiration Timer must be removed from epoll as soon as it expires, otherwise it continuously expire. Current timer removes from a different thread, this triggers repeated expire events until the maintain thread gets to remove it. Change-Id: Ie523bce5069416521d49bc0178d2cad2dd1f04da CRs-Fixed: 870568 --- utils/LocTimer.cpp | 103 +++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 22098091..e1be1e8a 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -112,6 +112,8 @@ class LocTimerContainer : public LocHeap { 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 @@ -270,74 +272,68 @@ 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; - LocTimerPollTask* mPollTask; LocTimerDelegate* mTimer; - inline MsgTimerPush(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline MsgTimerPush(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); mTimerContainer->push((LocRankable&)(*mTimer)); - - // if the tree top changed (new top is the new node), we need to update - // timerfd with the new timerout value. - if (priorTop != mTimerContainer->getSoonestTimer()) { - // if tree was empty before, we need to let poll task poll on this - // do this first to avoid race condition, in case settime is called - // with too small an interval - if (!priorTop) { - mPollTask->addPoll(*mTimerContainer); - } - struct itimerspec delay = {0}; - delay.it_value = mTimer->getFutureTime(); - timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - } + mTimerContainer->updateSoonestTime(priorTop); } }; - mMsgTask->sendMsg(new MsgTimerPush(*this, *mPollTask, timer)); + 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; - LocTimerPollTask* mPollTask; LocTimerDelegate* mTimer; - inline MsgTimerRemove(LocTimerContainer& container, LocTimerPollTask& pollTask, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mPollTask(&pollTask), mTimer(&timer) {} + inline MsgTimerRemove(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); + mTimerContainer->updateSoonestTime(priorTop); delete mTimer; - LocTimerDelegate* curTop = mTimerContainer->getSoonestTimer(); - - // if the tree top changed (the removed the node was the tree top), we need - // to update the timerfd with the new timeout value from the new top. - if (priorTop != curTop) { - struct itimerspec delay = {0}; - // if tree is empty now, we need to remove poll from poll task - if (!curTop) { - mPollTask->removePoll(*mTimerContainer); - // setting the values to disarm timer - delay.it_value.tv_sec = 0; - delay.it_value.tv_nsec = 0; - } else { - delay.it_value = curTop->getFutureTime(); - } - // this will either update the timer with the new soonest timeout - // or disarm the timer, if the current tree top empty - timerfd_settime(mTimerContainer->getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - } } }; - mMsgTask->sendMsg(new MsgTimerRemove(*this, *mPollTask, timer)); + mMsgTask->sendMsg(new MsgTimerRemove(*this, timer)); } // all the heap management is done in the MsgTask context. @@ -355,22 +351,25 @@ void LocTimerContainer::expire() { 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 = mTimerContainer->popIfOutRanks(timerOfNow); + 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 && peek()->outRanks((LocRankable&)(timer))) { + if (mTree && !timer.outRanks(*peek())) { poppedNode = (LocTimerDelegate*)(pop()); } @@ -415,10 +414,12 @@ void LocTimerPollTask::addPoll(LocTimerContainer& timerContainer) { 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); } @@ -431,17 +432,22 @@ void LocTimerPollTask::removePoll(LocTimerContainer& timerContainer) { // 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 will has a context pointer associated with the right timer container + // 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); } } } @@ -464,6 +470,8 @@ void LocTimerDelegate::destroy() { if (mContainer) { mContainer->remove(*this); mContainer = NULL; + } else { + delete this; } } @@ -534,7 +542,10 @@ class LocTimerWrapper : public LocTimer { public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : mCb(cb), mCallerData(callerData) {} - inline virtual void timeOutCallback() { mCb(mCallerData, 0); } + inline virtual void timeOutCallback() { + mCb(mCallerData, 0); + delete this; + } }; void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, From 153ba77107f0be57cb7f29852fff58d7fc13c185 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 20 Jul 2015 15:36:06 -0700 Subject: [PATCH 363/945] crash in LocTimer wrapper LocTimerWrapper implements loc_timer_start/stop calls for backward compatibility. There is a race condtiion where the wrapper object could be deleted by the client thread and expireation handling at rough the same time, which would have the memory freed twice. Now they are mutext protected. Change-Id: I25d7466db88a840a8a09e7a476cface48c91d22e --- utils/LocTimer.cpp | 26 +++++++++++++++++++++----- utils/loc_timer.h | 6 ++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index e1be1e8a..277a8135 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -539,22 +539,38 @@ bool LocTimer::stop() { class LocTimerWrapper : public LocTimer { loc_timer_callback mCb; void* mCallerData; + static pthread_mutex_t mMutex; + inline ~LocTimerWrapper() { mCb = NULL; } public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : mCb(cb), mCallerData(callerData) {} + inline bool isAlive() { return mCb != NULL; } + void destroy() { + pthread_mutex_lock(&mMutex); + if (isAlive()) { + delete this; + } + pthread_mutex_unlock(&mMutex); + } inline virtual void timeOutCallback() { mCb(mCallerData, 0); - delete this; + 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 = new LocTimerWrapper(cb_func, caller_data); + LocTimerWrapper* locTimerWrapper = NULL; - if (locTimerWrapper) { - locTimerWrapper->start(msec, wake_on_expire); + if (cb_func) { + locTimerWrapper = new LocTimerWrapper(cb_func, caller_data); + + if (locTimerWrapper) { + locTimerWrapper->start(msec, wake_on_expire); + } } return locTimerWrapper; @@ -565,7 +581,7 @@ void loc_timer_stop(void*& handle) if (handle) { LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); locTimerWrapper->stop(); - delete locTimerWrapper; + locTimerWrapper->destroy(); handle = NULL; } } diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 8836d1ea..2967858e 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -45,7 +45,8 @@ typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* delay_msec: timeout value for the timer. - loc_timer_callback: callback function pointer, implemented by client. + 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 @@ -53,9 +54,10 @@ typedef void (*loc_timer_callback)(void *user_data, int32_t result); 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, + loc_timer_callback cb_func, void *user_data, bool wake_on_expire=false); From 62a30d2faa4ca2cd1050acbded30bbffd5bd0b19 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 26 Aug 2015 11:26:46 -0700 Subject: [PATCH 364/945] Fix for timerfd_create on older kernel revisions BOOTTIME_ALARM and BOOTTIME were added to timerfd_create in kernel version 3.11 and 3.15 respectively. But for targets still on older kernel version we fallback on MONOTONIC. CRs-Fixed: 897805 Change-Id: I47d9780d69ce5ee8c183c84baa93ea3c1a00db57 --- utils/LocTimer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 277a8135..524897bb 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -103,7 +103,7 @@ class LocTimerContainer : public LocHeap { // Poll task to provide epoll call and threading to poll. static LocTimerPollTask* mPollTask; // timer / alarm fd - const int mDevFd; + int mDevFd; // ctor LocTimerContainer(bool wakeOnExpire); // dtor @@ -210,6 +210,13 @@ LocTimerPollTask* LocTimerContainer::mPollTask = NULL; // 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(); From 91488d6fc5ddb23ec1886f02b7a8a21155718d65 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 3 Sep 2015 18:08:08 -0700 Subject: [PATCH 365/945] fixing a crash vulnerability due to race condition LocTimer::stop() can be called from different threads, which must be protected. Currently there is a race condition between back to back stop()'s or expire() + stop() events. Change-Id: Iae80b78f049a32da87639f813c6f5126b4ccd072 CRs-Fixed: 904627 --- utils/LocTimer.cpp | 99 +++++++++++++++++++++++++++++++++++----------- utils/LocTimer.h | 11 +++++- 2 files changed, 85 insertions(+), 25 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 524897bb..53ca700d 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -48,6 +48,20 @@ using namespace loc_core; +// a shared lock until, place it here for now. +class LocUtilSharedLock { + uint32_t mRef; + pthread_mutex_t mMutex; + inline ~LocUtilSharedLock() { pthread_mutex_destroy(&mMutex); } +public: + inline LocUtilSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } + inline LocUtilSharedLock* share() { mRef++; return this; } + inline void drop() { if (0 == --mRef) delete this; } + inline void lock() { pthread_mutex_lock(&mMutex); } + inline void unlock() { pthread_mutex_unlock(&mMutex); } +}; + + /* There are implementations of 5 classes in this file: LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper @@ -177,15 +191,16 @@ class LocTimerDelegate : public LocRankable { friend class LocTimerContainer; friend class LocTimer; LocTimer* mClient; + LocUtilSharedLock* mLock; struct timespec mFutureTime; LocTimerContainer* mContainer; // not a complete obj, just ctor for LocRankable comparisons inline LocTimerDelegate(struct timespec& delay) - : mClient(NULL), mFutureTime(delay), mContainer(NULL) {} - inline ~LocTimerDelegate() {} + : 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 destroy(); + void destroyLocked(); // LocRankable virtual method virtual int ranks(LocRankable& rankable); void expire(); @@ -334,8 +349,9 @@ void LocTimerContainer::remove(LocTimerDelegate& timer) { LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer); - mTimerContainer->updateSoonestTime(priorTop); + if (NULL != ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { + mTimerContainer->updateSoonestTime(priorTop); + } delete mTimer; } }; @@ -363,6 +379,7 @@ void LocTimerContainer::expire() { timer = mTimerContainer->popIfOutRanks(timerOfNow)) { // the timer delegate obj will be deleted before the return of this call timer->expire(); + delete timer; } mTimerContainer->updateSoonestTime(NULL); } @@ -467,19 +484,30 @@ bool LocTimerPollTask::run() { inline LocTimerDelegate::LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire) - : mClient(&client), mFutureTime(futureTime), mContainer(LocTimerContainer::get(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::destroy() { +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) { - mContainer->remove(*this); + LocTimerContainer* container = mContainer; mContainer = NULL; - } else { - delete this; - } + if (container) { + container->remove(*this); + } + } // else we do not do anything, as *this* will be deleted either + // after it expires or stop is first called (if case above), + // where container->remove() will have it deleted. } int LocTimerDelegate::ranks(LocRankable& rankable) { @@ -495,6 +523,7 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { inline void LocTimerDelegate::expire() { + mLock->lock(); // keeping a copy of client pointer to be safe // when timeOutCallback() is called at the end of this // method, this obj is already deleted. @@ -502,14 +531,29 @@ void LocTimerDelegate::expire() { // this obj is already removed from mContainer. // NULL it here so that dtor won't try to call remove again mContainer = NULL; + mClient = NULL; + mLock->unlock(); // force a stop, which will force a delete of this obj - mClient->stop(); - // calling client callback with a pointer save on the stack - client->timeOutCallback(); + 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 LocUtilSharedLock()) { +} + +LocTimer::~LocTimer() { + stop(); + if (mLock) { + mLock->drop(); + mLock = NULL; + } +} bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool success = false; @@ -532,9 +576,14 @@ bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool LocTimer::stop() { bool success = false; if (mTimer) { - mTimer->destroy(); + mLock->lock(); + LocTimerDelegate* timer = mTimer; mTimer = NULL; - success = true; + if (timer) { + timer->destroyLocked(); + success = true; + } + mLock->unlock(); } return success; } @@ -546,21 +595,26 @@ bool LocTimer::stop() { class LocTimerWrapper : public LocTimer { loc_timer_callback mCb; void* mCallerData; + LocTimerWrapper* mMe; static pthread_mutex_t mMutex; - inline ~LocTimerWrapper() { mCb = NULL; } + inline ~LocTimerWrapper() { mCb = NULL; mMe = NULL; } public: inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : - mCb(cb), mCallerData(callerData) {} - inline bool isAlive() { return mCb != NULL; } + mCb(cb), mCallerData(callerData), mMe(this) { + } void destroy() { pthread_mutex_lock(&mMutex); - if (isAlive()) { + if (NULL != mCb && this == mMe) { delete this; } pthread_mutex_unlock(&mMutex); } - inline virtual void timeOutCallback() { - mCb(mCallerData, 0); + virtual void timeOutCallback() { + loc_timer_callback cb = mCb; + void* callerData = mCallerData; + if (cb) { + cb(callerData, 0); + } destroy(); } }; @@ -587,7 +641,6 @@ void loc_timer_stop(void*& handle) { if (handle) { LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); - locTimerWrapper->stop(); locTimerWrapper->destroy(); handle = NULL; } diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c5012927..9606fe53 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -35,15 +35,22 @@ // opaque class to provide service implementation. class LocTimerDelegate; +class LocUtilSharedLock; // LocTimer client must extend this class and implementthe callback. // start() / stop() methods are to arm / disarm timer. class LocTimer { LocTimerDelegate* mTimer; + LocUtilSharedLock* 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: - inline LocTimer() : mTimer(NULL) {} - inline virtual ~LocTimer() { stop(); } + LocTimer(); + virtual ~LocTimer(); // timeOutInMs: timeout delay in ms // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer From f533181bd69fd32a8a49f4138efbe702f5cdc077 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 15 Sep 2015 19:02:58 -0700 Subject: [PATCH 366/945] timer bug fix when a ticking timer is stopped, currently kernel doesn't get updated with the next immediate timer's interval. As a result, kernel timer will expire sooner (with the stopped timer's interval), and the next timer's client is notified for this expiration. Change-Id: I0d67d1418cb9bfe7f70ae71252901d4c6bb699b3 CRs-Fixed: 909776 --- utils/LocHeap.cpp | 4 ++-- utils/LocTimer.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp index 41268789..d667f14f 100644 --- a/utils/LocHeap.cpp +++ b/utils/LocHeap.cpp @@ -199,7 +199,7 @@ bool LocHeapNode::checkNodes() { int totalSize = mSize; if (mLeft) { // check the consistency of left subtree - if (!outRanks(*mLeft) || !mLeft->checkNodes()) { + if (mLeft->outRanks(*this) || !mLeft->checkNodes()) { return false; } // subtract the size of left subtree (with subtree head) @@ -208,7 +208,7 @@ bool LocHeapNode::checkNodes() { if (mRight) { // check the consistency of right subtree - if (!outRanks(*mRight) || !mRight->checkNodes()) { + if (mRight->outRanks(*this) || !mRight->checkNodes()) { return false; } // subtract the size of right subtree (with subtree head) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 53ca700d..0f698c54 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -349,8 +349,12 @@ void LocTimerContainer::remove(LocTimerDelegate& timer) { LocMsg(), mTimerContainer(&container), mTimer(&timer) {} inline virtual void proc() const { LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - if (NULL != ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { - mTimerContainer->updateSoonestTime(priorTop); + // 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); } delete mTimer; } From 2f74f91ac103afe7d92f594c6c57049e1829c773 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 Sep 2015 19:40:25 -0700 Subject: [PATCH 367/945] Crash fix with MsgTask API change Removed tCreate and tAssociate from MsgTask. LocThread now can optionally take a tCreate method. Associator is replaced with *firstMsg* option to MsgTask, which is a more generic option, that can associate or do other set up job at the create of a MsgTask. The current MsgTask doesn't use tCreate, which exposes a slight time window for Location HAL when its MsgTask is NOT associated to DVM heap but a message delivery to DVM could be attempted during this time. Change-Id: Iafd5b91b693baacb9b7064463f8c44f74026f54c CRs-Fixed: 902350 --- core/LocDualContext.cpp | 76 ++++++---------------- core/LocDualContext.h | 26 ++++---- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 +- loc_api/libloc_api_50001/LocEngAdapter.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 3 +- utils/LocSharedLock.h | 58 +++++++++++++++++ utils/LocThread.cpp | 50 ++++++++------ utils/LocThread.h | 7 +- utils/LocTimer.cpp | 22 +------ utils/LocTimer.h | 4 +- utils/MsgTask.cpp | 48 +++----------- utils/MsgTask.h | 17 +---- 12 files changed, 151 insertions(+), 168 deletions(-) create mode 100644 utils/LocSharedLock.h diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index d68cb3bc..578421cd 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -63,34 +63,28 @@ const char* LocDualContext::mLBSLibName = "liblbs_core.so"; pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; -const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, - const char* name) +const MsgTask* LocDualContext::getMsgTask(LocThread::tCreate tCreator, + const char* name, bool joinable) { if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name); + mMsgTask = new MsgTask(tCreator, name, joinable); } return mMsgTask; } -const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, - const char* name) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tAssociate, name); - } else if (tAssociate) { - mMsgTask->associate(tAssociate); - } - return mMsgTask; +inline +const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { + return getMsgTask((LocThread::tCreate)NULL, name, joinable); } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, - const char* name) +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); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mFgContext = new LocDualContext(msgTask, mFgExclMask); } @@ -100,37 +94,22 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + + if (firstMsg) { + mFgContext->sendMsg(firstMsg); + } + return mFgContext; } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mFgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - 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); - return mFgContext; -} - -ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, - const char* name) +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); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mBgContext = new LocDualContext(msgTask, mBgExclMask); } @@ -140,26 +119,11 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - return mBgContext; -} -ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mBgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); + if (firstMsg) { + mBgContext->sendMsg(firstMsg); } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); - mInjectContext = mBgContext; - injectFeatureConfig(mInjectContext); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + return mBgContext; } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 1e96ea56..ce77a1aa 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -41,10 +41,9 @@ class LocDualContext : public ContextBase { static ContextBase* mFgContext; static ContextBase* mBgContext; static ContextBase* mInjectContext; - static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, - const char* name); - static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, - const char* name); + 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: @@ -58,14 +57,17 @@ public: static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask; static const char* mLocationHalName; - static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name); + 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); }; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index d1b8f8fc..a092fbe8 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -55,13 +55,15 @@ void LocInternalAdapter::getZppInt() { LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator) : + 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, - LocDualContext::mLocationHalName) + NULL, + LocDualContext::mLocationHalName, + false) :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index e1d8f098..5eff6f36 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -88,7 +88,7 @@ public: LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator); + LocThread::tCreate tCreator); virtual ~LocEngAdapter(); virtual void setUlpProxy(UlpProxyBase* ulp); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 917c2ae2..258db3e9 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -223,7 +223,6 @@ static void* noProc(void* data) return NULL; } - /********************************************************************* * definitions of the static messages used in the file *********************************************************************/ @@ -1768,7 +1767,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, context, - (MsgTask::tCreate)callbacks->create_thread_cb); + (LocThread::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h new file mode 100644 index 00000000..6b9e27f1 --- /dev/null +++ b/utils/LocSharedLock.h @@ -0,0 +1,58 @@ +/* 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 + +// 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 { + uint32_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() { mRef++; return this; } + // whe a client no longer needs this shared lock, drop() shall be called. + inline void drop() { if (0 == --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/utils/LocThread.cpp b/utils/LocThread.cpp index ec1e0719..19bf101a 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -37,12 +37,12 @@ class LocThreadDelegate { pthread_mutex_t mMutex; int mRefCount; ~LocThreadDelegate(); - LocThreadDelegate(const char* threadName, + LocThreadDelegate(LocThread::tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable); void destroy(); public: - static LocThreadDelegate* create(const char* threadName, - LocRunnable* runnable, bool joinable); + 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 @@ -62,19 +62,28 @@ public: // 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(const char* threadName, - LocRunnable* runnable, bool joinable) : - mRunnable(runnable), mJoinable(joinable), +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 (!pthread_create(&mThandle, NULL, threadMain, this)) { + 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]; - const char* defaultName = "LocThread"; - if (!threadName) { - threadName = defaultName; - } int len = sizeof(lname) - 1; memcpy(lname, threadName, len); lname[len] = 0; @@ -99,11 +108,11 @@ LocThreadDelegate::~LocThreadDelegate() { } // factory method so that we could return NULL upon failure -LocThreadDelegate* LocThreadDelegate::create(const char* threadName, - LocRunnable* runnable, bool joinable) { +LocThreadDelegate* LocThreadDelegate::create(LocThread::tCreate creator, + const char* threadName, LocRunnable* runnable, bool joinable) { LocThreadDelegate* thread = NULL; if (runnable) { - thread = new LocThreadDelegate(threadName, runnable, joinable); + thread = new LocThreadDelegate(creator, threadName, runnable, joinable); if (thread && !thread->isRunning()) { thread->destroy(); thread = NULL; @@ -199,11 +208,14 @@ LocThread::~LocThread() { } } -bool LocThread::start(const char* threadName, LocRunnable* runnable, bool joinable) { - mThread = LocThreadDelegate::create(threadName, runnable, joinable); - - // true only if thread is created successfully - return (NULL != mThread); +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() { diff --git a/utils/LocThread.h b/utils/LocThread.h index 490d3099..2a65d8fa 100644 --- a/utils/LocThread.h +++ b/utils/LocThread.h @@ -30,6 +30,7 @@ #define __LOC_THREAD__ #include +#include // abstract class to be implemented by client to provide a runnable class // which gets scheduled by LocThread @@ -64,6 +65,7 @@ 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. @@ -74,7 +76,10 @@ public: // returns true. Else it is client's responsibility // to delete the object // Returns 0 if success; false if failure. - bool start(const char* threadName, LocRunnable* runnable, bool joinable = true); + 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. diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 0f698c54..c992e7c2 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #ifdef __HOST_UNIT_TEST__ @@ -46,22 +46,6 @@ #define CLOCK_BOOTTIME_ALARM CLOCK_MONOTONIC #endif -using namespace loc_core; - -// a shared lock until, place it here for now. -class LocUtilSharedLock { - uint32_t mRef; - pthread_mutex_t mMutex; - inline ~LocUtilSharedLock() { pthread_mutex_destroy(&mMutex); } -public: - inline LocUtilSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } - inline LocUtilSharedLock* share() { mRef++; return this; } - inline void drop() { if (0 == --mRef) delete this; } - inline void lock() { pthread_mutex_lock(&mMutex); } - inline void unlock() { pthread_mutex_unlock(&mMutex); } -}; - - /* There are implementations of 5 classes in this file: LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper @@ -191,7 +175,7 @@ class LocTimerDelegate : public LocRankable { friend class LocTimerContainer; friend class LocTimer; LocTimer* mClient; - LocUtilSharedLock* mLock; + LocSharedLock* mLock; struct timespec mFutureTime; LocTimerContainer* mContainer; // not a complete obj, just ctor for LocRankable comparisons @@ -548,7 +532,7 @@ void LocTimerDelegate::expire() { /***************************LocTimer methods***************************/ -LocTimer::LocTimer() : mTimer(NULL), mLock(new LocUtilSharedLock()) { +LocTimer::LocTimer() : mTimer(NULL), mLock(new LocSharedLock()) { } LocTimer::~LocTimer() { diff --git a/utils/LocTimer.h b/utils/LocTimer.h index 9606fe53..c1468524 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -35,14 +35,14 @@ // opaque class to provide service implementation. class LocTimerDelegate; -class LocUtilSharedLock; +class LocSharedLock; // LocTimer client must extend this class and implementthe callback. // start() / stop() methods are to arm / disarm timer. class LocTimer { LocTimerDelegate* mTimer; - LocUtilSharedLock* mLock; + 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. diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 8b645dd5..fdb11026 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -36,12 +36,19 @@ #include #include -namespace loc_core { - 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)) { @@ -93,40 +100,3 @@ bool MsgTask::run() { return true; } - -// TODO: remove the below in the next patch -void MsgTask::associate(tAssociate tAssociator) const { - struct LocAssociateMsg : public LocMsg { - tAssociate mAssociator; - LocAssociateMsg(tAssociate associator) : - mAssociator(associator) {} - inline virtual void proc() const { - static bool sAssociated = false; - if (!sAssociated) { - sAssociated = true; - mAssociator(); - } - } - }; - sendMsg(new LocAssociateMsg(tAssociator)); -} - -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(threadName, this, false)) { - delete mThread; - mThread = NULL; - } -} - -MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(threadName, this, false)) { - delete mThread; - mThread = NULL; - } else { - associate(tAssociator); - } -} - -} // namespace loc_core diff --git a/utils/MsgTask.h b/utils/MsgTask.h index c397ee10..9eb1f567 100644 --- a/utils/MsgTask.h +++ b/utils/MsgTask.h @@ -30,10 +30,6 @@ #define __MSG_TASK__ #include -// TODO: remove this include in the next patch -#include - -namespace loc_core { struct LocMsg { inline LocMsg() {} @@ -42,13 +38,14 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask : public LocRunnable{ +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(); @@ -65,16 +62,6 @@ public: // The method to be run after thread loop (conditionally repeatedly) // calls run() inline virtual void postrun() {} - - // TODO: remove the below in the next patch - typedef void* (*tStart)(void*); - typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); - typedef int (*tAssociate)(); - MsgTask(tCreate tCreator, const char* threadName); - MsgTask(tAssociate tAssociator, const char* threadName); - void associate(tAssociate tAssociator) const; }; -} // namespace loc_core - #endif //__MSG_TASK__ From 67d576b55aff644414806c4d25964515c0a604b2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 25 Sep 2015 15:57:45 -0700 Subject: [PATCH 368/945] another potential race condition LocTimer on timeout would currently delete timer delegate. This meddles into the management of LocTimer::stop() call, and the order of obj delete needs to be synchronized in a few different places as a result. This change lets the delete of the timer delegate obj fold into the stop() handling, which would be easier to synch. Change-Id: Ic3e0b3d183dceb9e6e2db4c47ec9d6e296b0c3f6 CRs-Fixed: 916590 --- utils/LocTimer.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index c992e7c2..70904b2a 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -333,13 +333,15 @@ void LocTimerContainer::remove(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. + + // 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. + // 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; } }; @@ -367,7 +369,6 @@ void LocTimerContainer::expire() { timer = mTimerContainer->popIfOutRanks(timerOfNow)) { // the timer delegate obj will be deleted before the return of this call timer->expire(); - delete timer; } mTimerContainer->updateSoonestTime(NULL); } @@ -493,9 +494,10 @@ void LocTimerDelegate::destroyLocked() { if (container) { container->remove(*this); } - } // else we do not do anything, as *this* will be deleted either - // after it expires or stop is first called (if case above), - // where container->remove() will have it deleted. + } // 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) { @@ -511,17 +513,11 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { inline void LocTimerDelegate::expire() { - mLock->lock(); // keeping a copy of client pointer to be safe // when timeOutCallback() is called at the end of this - // method, this obj is already deleted. + // method, *this* obj may be already deleted. LocTimer* client = mClient; - // this obj is already removed from mContainer. - // NULL it here so that dtor won't try to call remove again - mContainer = NULL; - mClient = NULL; - mLock->unlock(); - // force a stop, which will force a delete of this obj + // 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 @@ -545,6 +541,7 @@ LocTimer::~LocTimer() { bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { bool success = false; + mLock->lock(); if (!mTimer) { struct timespec futureTime; clock_gettime(CLOCK_BOOTTIME, &futureTime); @@ -558,21 +555,22 @@ bool LocTimer::start(unsigned int timeOutInMs, bool 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) { - mLock->lock(); LocTimerDelegate* timer = mTimer; mTimer = NULL; if (timer) { timer->destroyLocked(); success = true; } - mLock->unlock(); } + mLock->unlock(); return success; } From fd7b78112e4fef25c3d6c0a0c189baea4c5704c7 Mon Sep 17 00:00:00 2001 From: Vamana Murthi Date: Mon, 23 Nov 2015 19:46:50 +0530 Subject: [PATCH 369/945] gps: enable measurement/poly reports only when AP DR enabled GNSS Measurements and Polynomial reports need to be enabled only when AP DR (EXTERNAL_DR_ENABLED=1) is enabled in gps.conf Change-Id: I13437d997e96a6403923d49f62f1e7c2f70e9c04 CRs-Fixed: 937944 --- loc_api/libloc_api_50001/loc.cpp | 6 ++++-- loc_api/libloc_api_50001/loc_eng.cpp | 1 + loc_api/libloc_api_50001/loc_eng.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index ed9ff9b9..50110bbc 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -294,8 +294,10 @@ static int loc_init(GpsCallbacks* callbacks) target = loc_get_target(); - /*For "auto" platform enable Measurement report and SV Polynomial report*/ - if(GNSS_AUTO == getTargetGnssType(target)) + /* If platform is "auto" and external dr enabled then enable + ** Measurement report and SV Polynomial report + */ + if((1 == gps_conf.EXTERNAL_DR_ENABLED) && (GNSS_AUTO == getTargetGnssType(target))) { event |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT | LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 258db3e9..7114a9d7 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -111,6 +111,7 @@ static loc_param_s_type gps_conf_table[] = {"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'}, + {"EXTERNAL_DR_ENABLED", &gps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, }; static loc_param_s_type sap_conf_table[] = diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index a203e6bb..23f93762 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -160,6 +160,7 @@ typedef struct loc_gps_cfg_s uint32_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; + uint32_t EXTERNAL_DR_ENABLED; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number From 34c44606e99047e8b12c1d40685e123ecd9cde18 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 25 Nov 2015 19:10:06 -0800 Subject: [PATCH 370/945] Add the support for geofence dwell This change adds the support for geofence dwell mask. Change-Id: I4cbde8d3c49ef4ac287d34a88ea25787b507cdbe CRs-Fixed: 940557 --- core/gps_extended_c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 27deb442..fefbcfe0 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -378,6 +378,7 @@ enum loc_api_adapter_event_index { 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 }; @@ -407,6 +408,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_END_REQ (1< Date: Thu, 18 Sep 2014 17:18:36 -0700 Subject: [PATCH 371/945] Remove reduntant clearing of GpsLocation memory GpsLocation memory will now be cleared inside the Loc Api handler itself, so no need to do it a second time before calling into the Loc Api handler. Change-Id: Iec37624621d6eb4806eb8e13c807bb4e40584e39 CRs-fixed: 726800 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 4bc12b3b..19c54a0f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1972,7 +1972,6 @@ static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data) GpsLocationExtended locationExtended; memset(&locationExtended, 0, sizeof (GpsLocationExtended)); locationExtended.size = sizeof(locationExtended); - memset(&location, 0, sizeof location); ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask); //Mark the location source as from ZPP From a4e5f9c15087b61591b56894da1817db22572563 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Wed, 14 Nov 2012 11:32:40 -0800 Subject: [PATCH 372/945] Add buffer length check for XTRA data To prevent reading beyond the length of the buffer that contains XTRA data, a check has been introduced assuming an approximate limit for the size of the data Change-Id: I7e05beadec76c3308448b9198fd23c8e8b97394d CRs-fixed: 420623 --- loc_api/libloc_api_50001/loc.cpp | 8 ++++++-- loc_api/libloc_api_50001/loc.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 0a933af0..83249f40 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -801,8 +801,12 @@ SIDE EFFECTS static int loc_xtra_inject_data(char* data, int length) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); - + 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; } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 55456193..8f41659a 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -38,6 +38,8 @@ extern "C" { #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); From 29a9152e50e2c14aa2072faaf68b56b862fe2212 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 3 Aug 2015 18:50:42 -0700 Subject: [PATCH 373/945] NMEA generation change to prevent 2Hz reporting GPGGA/GPRMC/GPGSA can be reported two times per second in some cases where we lose all satellite signals. We should report these NMEA sentences only from position report to prevent this. CRs-fixed: 884484 Change-Id: I123d9f074ca725703c6e90397160b701033e22f0 --- loc_api/libloc_api_50001/loc_eng.cpp | 5 +-- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 54 +++++++---------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 7114a9d7..cd6cbf96 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -793,10 +793,7 @@ void LocEngReportPosition::proc() const { } if (locEng->generateNmea && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS && - mTechMask & (LOC_POS_TECH_MASK_SATELLITE | - LOC_POS_TECH_MASK_SENSORS | - LOC_POS_TECH_MASK_HYBRID)) + locEng->adapter->isInSession()) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 7bc58bd0..126a97f0 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -790,48 +790,24 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.gps_used_in_fix_mask == 0 && - svStatus.glo_used_in_fix_mask == 0 && - svStatus.bds_used_in_fix_mask == 0) - { // No sv used, so there will be no position report, so send - // blank NMEA sentences - 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); + // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; - 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); + // 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 - { // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; - - // 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; - } - + { + loc_eng_data_p->pdop = 0; + loc_eng_data_p->hdop = 0; + loc_eng_data_p->vdop = 0; } EXIT_LOG(%d, 0); From 05ee1cc69d7829384efd5b811f9ad6c1f5a369a4 Mon Sep 17 00:00:00 2001 From: "ethan.kim" Date: Fri, 26 Jun 2015 16:33:29 -0700 Subject: [PATCH 374/945] Set SUPL_ES to 0 in gps.conf Disabled checking for emergency to accept SUPL CRs-fixed: 860504 Change-Id: Iad1605242daf8fa1d6bcce3e69caff7811d9843a --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index 9c9e5e92..0df940d2 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -44,7 +44,7 @@ INTERMEDIATE_POS=0 SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable -SUPL_ES=1 +SUPL_ES=0 #Choose PDN for Emergency SUPL #1 - Use emergency PDN From 46f999155d24dbb1ed860b5509d794c123163846 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 4 Jan 2016 16:17:34 -0800 Subject: [PATCH 375/945] Reduce TBF limit in GPS HAL Currently Location HAL forces TBF of 1 second or larger even though ALM permits lower values. GPS HAL shall have smaller limits as Modem code actually controls minimum TBF value Change-Id: I4a2bbd51da34e441f148275ec3c2c4fa9ece7599 CRs-Fixed: 951152 --- core/gps_extended.h | 14 ++++++++++---- core/gps_extended_c.h | 34 ++++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/core/gps_extended.h b/core/gps_extended.h index 9eec3f92..b6d7a41b 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,11 +29,16 @@ #ifndef GPS_EXTENDED_H #define GPS_EXTENDED_H +#include +/** + * @file + * @brief C++ declarations for GPS types + */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include #if defined(USE_GLIB) || defined(OFF_TARGET) #include #endif @@ -51,7 +56,8 @@ struct LocPosMode uint32_t gap, uint32_t accu, uint32_t time, const char* cred, const char* prov) : mode(m), recurrence(recr), - min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + min_interval(gap < GPS_MIN_POSSIBLE_FIX_INTERVAL_MS ? + GPS_MIN_POSSIBLE_FIX_INTERVAL_MS : gap), preferred_accuracy(accu), preferred_time(time) { memset(credentials, 0, sizeof(credentials)); memset(provider, 0, sizeof(provider)); @@ -66,7 +72,7 @@ struct LocPosMode inline LocPosMode() : mode(LOC_POSITION_MODE_MS_BASED), recurrence(GPS_POSITION_RECURRENCE_PERIODIC), - min_interval(MIN_POSSIBLE_FIX_INTERVAL), + min_interval(GPS_DEFAULT_FIX_INTERVAL_MS), preferred_accuracy(50), preferred_time(120000) { memset(credentials, 0, sizeof(credentials)); memset(provider, 0, sizeof(provider)); diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55c158e3..f8e540fb 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,14 +29,19 @@ #ifndef GPS_EXTENDED_C_H #define GPS_EXTENDED_C_H -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #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 */ @@ -177,7 +182,24 @@ typedef enum loc_position_mode_type { } LocPositionMode; -#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ +/** + * @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 /** GpsLocationExtended has valid latitude and longitude. */ #define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) From db367819e26af1a6b8cb013e0dcda575d242c732 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 29 Dec 2015 22:35:36 -0800 Subject: [PATCH 376/945] Sub milli sec part in the relevant NMEA Strings NMEA Strings should introduce the sub milli sec part in the relevant NMEA Strings for NHZ Sessions Change-Id: I9bac4caa26e87741e5e82e16a8047af20ac8012b CRs-Fixed: 951144 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 8e99d941..6c9356e4 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -124,7 +124,6 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, char* pMarker = sentence; int lengthRemaining = sizeof(sentence); int length = 0; - time_t utcTime(location.gpsLocation.timestamp/1000); tm * pTm = gmtime(&utcTime); int utcYear = pTm->tm_year % 100; // 2 digit year @@ -133,6 +132,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcHours = pTm->tm_hour; int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; + int utcMSeconds = (location.gpsLocation.timestamp)%1000; if (generate_nmea) { // ------------------ @@ -278,8 +278,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , + utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -431,8 +431,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , + utcHours, utcMinutes, utcSeconds, utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { From 88c17ef7d77438f929b4a4f2c49271a2961904a0 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 1 Dec 2015 17:01:19 -0800 Subject: [PATCH 377/945] Add support for dynamic TBF updating This change adds the support for checking if modem support dynamic TBF updating. Change-Id: Ib6bf917f84d1224e296e91b4fb33b41d6e2c2531 CRs-Fixed: 923601 --- core/gps_extended_c.h | 1 + 1 file changed, 1 insertion(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 27deb442..cc7d31ec 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -416,6 +416,7 @@ typedef enum loc_api_adapter_msg_to_check_supported { LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING, // DBT 2.0 LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING, // Batching 1.5 LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING, // Batching 2.0 + LOC_API_ADAPTER_MESSAGE_UPDATE_TBF_ON_THE_FLY, // Updating Tracking TBF On The Fly LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; From 1c118323524158054651cd061b5d09b8584c2fe8 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 29 Dec 2015 22:35:36 -0800 Subject: [PATCH 378/945] Sub milli sec part in the relevant NMEA Strings NMEA Strings should introduce the sub milli sec part in the relevant NMEA Strings for NHZ Sessions Change-Id: I9bac4caa26e87741e5e82e16a8047af20ac8012b CRs-Fixed: 951144 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 126a97f0..2868c0e8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -136,6 +136,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcHours = pTm->tm_hour; int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; + int utcMSeconds = (location.gpsLocation.timestamp)%1000; if (generate_nmea) { // ------------------ @@ -281,8 +282,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , + utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -434,8 +435,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , + utcHours, utcMinutes, utcSeconds, utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { From f96e5dca060e07f9bf6d259c13dc432ef68487e6 Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Thu, 7 Jan 2016 12:13:08 +0530 Subject: [PATCH 379/945] gps: add SV polynomial parameter enhancedIOD parameter in QMI needs to be added to HLOS driver structures, and appropriate fix in structure members Change-Id: If89de03ff69fabb3d57a7b7dafe957eb73302794 --- core/gps_extended_c.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 04fab59b..a55df3e4 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -531,6 +531,7 @@ enum ulp_gnss_sv_poly_valid_flags{ ULP_GNSS_SV_POLY_ELEVATIONDOT, ULP_GNSS_SV_POLY_ELEVATIONUNC, ULP_GNSS_SV_POLY_VELO_COEFF, + ULP_GNSS_SV_POLY_ENHANCED_IOD, ULP_GNSS_SV_POLY_VALID_FLAGS @@ -553,6 +554,7 @@ enum ulp_gnss_sv_poly_valid_flags{ #define ULP_GNSS_SV_POLY_BIT_ELEVATIONDOT (1< Date: Mon, 9 Nov 2015 16:15:07 -0800 Subject: [PATCH 380/945] Xtra client always reports carrier as 'unknown' The problem was caused by populating the carrier upon phone bootup when the the property maybe not initialized yet. This module is updated to remove the populating code of carrier in phone bootup. Change-Id: I9c3f970aa0f0ca0805fdc2e04aa809329b6a2676 CRs-fixed: 935146 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 35447d48..3e5a6b55 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -101,7 +101,6 @@ void LocEngAdapter::setXtraUserAgent() { char release[PROPERTY_VALUE_MAX]; char manufacture[PROPERTY_VALUE_MAX]; char model[PROPERTY_VALUE_MAX]; - char carrier[PROPERTY_VALUE_MAX]; char board[PROPERTY_VALUE_MAX]; char brand[PROPERTY_VALUE_MAX]; char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; @@ -111,13 +110,12 @@ void LocEngAdapter::setXtraUserAgent() { 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.carrier", carrier, defVal); property_get("ro.product.board", board, defVal); property_get("ro.product.brand", brand, defVal); getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); - snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/%s/QCX3/s%u/-/%s/-/%s/-/-/-", - release, manufacture, model, board, carrier, + 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++) { From 9b9d777c636d9bbe17a34e9b07e3fa630beb62a6 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Fri, 28 Aug 2015 16:54:16 -0700 Subject: [PATCH 381/945] encode field separator characters Replace all separator characters ('/','+','|','%') in the raw string by their corresponding encodings (%2F","%2B","%7C", "%25") Change-Id: I3c895adc2ce1cef36032a25e3c6fd63e70350607 CRs-fixed: 881265 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 3e5a6b55..592662df 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -114,6 +114,12 @@ void LocEngAdapter::setXtraUserAgent() { 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); @@ -197,6 +203,56 @@ void LocEngAdapter::setXtraUserAgent() { 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)); From 625c8c6e4e0ea73349be10721e093b6b20ed0a36 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Wed, 25 Nov 2015 19:10:06 -0800 Subject: [PATCH 382/945] Add the support for geofence dwell This change adds the support for geofence dwell mask. Change-Id: I4cbde8d3c49ef4ac287d34a88ea25787b507cdbe CRs-Fixed: 940557 --- core/gps_extended_c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index cc7d31ec..75ee17e3 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -378,6 +378,7 @@ enum loc_api_adapter_event_index { 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 }; @@ -407,6 +408,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_END_REQ (1< Date: Tue, 29 Dec 2015 22:35:36 -0800 Subject: [PATCH 383/945] Sub milli sec part in the relevant NMEA Strings NMEA Strings should introduce the sub milli sec part in the relevant NMEA Strings for NHZ Sessions Change-Id: I9bac4caa26e87741e5e82e16a8047af20ac8012b CRs-Fixed: 951144 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 126a97f0..2868c0e8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -136,6 +136,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcHours = pTm->tm_hour; int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; + int utcMSeconds = (location.gpsLocation.timestamp)%1000; if (generate_nmea) { // ------------------ @@ -281,8 +282,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , + utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -434,8 +435,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , + utcHours, utcMinutes, utcSeconds, utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { From ecb67363ee73c0374424795ae6014a794065f5ab Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 4 Feb 2016 10:06:28 -0800 Subject: [PATCH 384/945] Fix compilation issues for m_master merge into oe_master Fixed compilation issues for M upgrade Change-Id: I602aa7c8a2db9682a1fe94b7ca892027281deec7 --- core/LocAdapterBase.cpp | 2 +- core/LocApiBase.cpp | 2 +- core/LocDualContext.cpp | 5 ++ core/Makefile.am | 7 +- core/UlpProxyBase.h | 1 - loc_api/Makefile.am | 4 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 +- loc_api/libloc_api_50001/Makefile.am | 78 +++++++++++++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 7 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 2 - .../loc_pla/include/platform_lib_macros.h | 2 + .../loc_pla/include/platform_lib_time.h | 4 +- .../loc_pla/src/Makefile.am | 1 + .../loc_stub/src/Makefile.am | 1 + utils/LocTimer.h | 2 +- utils/Makefile.am | 15 +++- utils/MsgTask.cpp | 3 +- utils/loc_cfg.cpp | 2 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_timer.h | 2 +- 20 files changed, 120 insertions(+), 25 deletions(-) create mode 100644 loc_api/libloc_api_50001/Makefile.am diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8fdb8cbb..e9bec95c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index dcd35fec..45d16e90 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index b5f33ac3..74b2903a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include namespace loc_core { @@ -58,7 +59,11 @@ 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; diff --git a/core/Makefile.am b/core/Makefile.am index e2d05be4..341153ad 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,10 +1,11 @@ AM_CFLAGS = -I./ \ -I../utils \ $(LOCPLA_CFLAGS) \ + -I$(WORKSPACE)/gps-noship/flp \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_core_la_h_sources = \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ @@ -13,10 +14,10 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h + loc_core_log.h \ + LocAdapterProxyBase.h libloc_core_la_c_sources = \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 59e265e8..2bafb0ab 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -31,7 +31,6 @@ #include #include "fused_location_extended.h" - namespace loc_core { class LocAdapterBase; diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index d42d4d99..a5f529bd 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -5,6 +5,7 @@ AM_CFLAGS = \ -I../utils \ $(LOCPLA_CFLAGS) \ -fno-short-enums \ + -D__func__=__PRETTY_FUNCTION__ \ -DTARGET_USES_QCOM_BSP libloc_eng_so_la_h_sources = \ @@ -81,7 +82,8 @@ 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 $(LOCPLA_LIBS) ../utils/libgps_utils_so.la +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) \ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1d1a59ed..f3290dbd 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -339,9 +339,10 @@ void LocEngAdapter::requestPowerVote() LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); setGpsLock(powerUp ? 103 : 101); } - +#ifndef USE_GLIB delete mUlp; mUlp = ulp; +#endif } void LocInternalAdapter::reportPosition(UlpLocation &location, diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am new file mode 100644 index 00000000..c7624272 --- /dev/null +++ b/loc_api/libloc_api_50001/Makefile.am @@ -0,0 +1,78 @@ +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/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index de72aa8d..6aac28ba 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -46,12 +46,7 @@ #include #include #include -#if defined(USE_GLIB) && !defined(OFF_TARGET) -#include -#endif -#ifdef USE_GLIB -#include -#endif /* USE_GLIB */ + #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 3b20bbbc..a29784fc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -235,8 +235,6 @@ static void* ni_thread_proc(void *args) LOC_LOGD("pSession->resp is %d\n",pSession->resp); - LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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() diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index 32035d28..c712122e 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -35,6 +35,8 @@ extern "C" { #ifdef USE_GLIB #include +#include +#include #ifndef OFF_TARGET #include #define strlcat g_strlcat diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h index c05b15ce..7033a7a1 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -30,7 +30,9 @@ #define __PLATFORM_LIB_TIME_H__ #include - +#ifndef USE_GLIB +#include +#endif int64_t platform_lib_abstraction_elapsed_millis_since_boot(); #endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/platform_lib_abstractions/loc_pla/src/Makefile.am b/platform_lib_abstractions/loc_pla/src/Makefile.am index 3936837d..6ee0be70 100644 --- a/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = \ $(LOCSTUB_CFLAGS) \ -I../include \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums h_sources = \ diff --git a/platform_lib_abstractions/loc_stub/src/Makefile.am b/platform_lib_abstractions/loc_stub/src/Makefile.am index c8ab5fcb..8bda7113 100644 --- a/platform_lib_abstractions/loc_stub/src/Makefile.am +++ b/platform_lib_abstractions/loc_stub/src/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = \ -I../include \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_stub_la_extra_h = \ diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c1468524..c6a63620 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -31,7 +31,7 @@ #define __LOC_TIMER_CPP_H__ #include -#include +#include // opaque class to provide service implementation. class LocTimerDelegate; diff --git a/utils/Makefile.am b/utils/Makefile.am index 5e718439..50f10078 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -14,15 +14,24 @@ libgps_utils_so_la_h_sources = \ loc_cfg.h \ loc_log.h \ loc_target.h \ - loc_timer.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_timer.c \ - loc_target.cpp + loc_target.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ + loc_misc_utils.cpp library_includedir = $(pkgincludedir)/utils diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index f33d6024..78a3fe00 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -33,6 +33,7 @@ #include #include #include +#include static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; @@ -77,7 +78,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const { void MsgTask::prerun() { // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); + platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); } bool MsgTask::run() { diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 967d2f30..926781a6 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #ifdef USE_GLIB #include diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index 7e96313f..dfe19a2d 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -28,7 +28,7 @@ */ #include #include -#include +#include #include #include diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 2967858e..25fd1790 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ #include - +#include /* user_data: client context pointer, passthrough. Originally received from calling client when loc_timer_start() is called. From fff5a01dfe63004f4b74c7fe99ceb432d46c894d Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Wed, 10 Feb 2016 16:15:03 +0530 Subject: [PATCH 385/945] fix for compiler warnings Change-Id: I838bfa2c66e77381be483c65b2b3bd68008a25b1 CRs-Fixed: 974489 --- utils/LocThread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index 19bf101a..5c340343 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -84,7 +84,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, if (mThandle) { // set thread name char lname[16]; - int len = sizeof(lname) - 1; + int len = (sizeof(lname)>sizeof(threadName)) ? + (sizeof(threadName) -1):(sizeof(lname) - 1); memcpy(lname, threadName, len); lname[len] = 0; // set the thread name here From 41961e47d58f44dbb7dadad957dfc496cd1cf319 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 Feb 2016 16:34:24 -0800 Subject: [PATCH 386/945] Remove unneeded nmea_cb print The nmea_cb print can cause excess logging Change-Id: Ifb9bfe9b3afff224fd3cfe6ec718f3c3cbe45987 CRs-fixed: 974592 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 - loc_api/libloc_api_50001/loc_eng_nmea.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 2ba6f982..cb7bb46c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -902,7 +902,6 @@ void LocEngReportNmea::proc() const { struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); if (locEng->nmea_cb != NULL) locEng->nmea_cb(now, mNmea, mLen); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 2868c0e8..b0e548c9 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -59,7 +59,6 @@ void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_dat struct timeval tv; gettimeofday(&tv, (struct timezone *) NULL); int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); if (loc_eng_data_p->nmea_cb != NULL) loc_eng_data_p->nmea_cb(now, pNmea, length); LOC_LOGD("NMEA <%s", pNmea); From 411951c341ec169312ee3fbc4bee3aaa662156d2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 11 Feb 2016 14:50:58 -0800 Subject: [PATCH 387/945] make LocSharedLock::mRef ops atomic The current share() and drop() calls are not thread safe, which can cause memory heap correuption. This changes the read / write ops to be atomic. Change-Id: Ic241d4573bdf2e58c4e264e97bd41b56f882c791 CRs-Fixed: 975372 --- utils/LocSharedLock.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h index 6b9e27f1..7fe62376 100644 --- a/utils/LocSharedLock.h +++ b/utils/LocSharedLock.h @@ -30,6 +30,7 @@ #define __LOC_SHARED_LOCK__ #include +#include #include // This is a utility created for use cases such that there are more than @@ -39,16 +40,16 @@ // this share lock's share() method has to be called, so that the obj // can maintain an accurate client count. class LocSharedLock { - uint32_t mRef; + 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() { mRef++; return this; } + 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 (0 == --mRef) delete this; } + 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 From 6060fb7c6b8e1c1f4a64d90b3b0885959ca3af84 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 12 Feb 2016 18:48:59 -0800 Subject: [PATCH 388/945] Additional Position Prameters in position report Updated gps_extended_c.h to include few additional position parameters Change-Id: I3c8b8ba97c5b2eafa7337d580681044b973c5bea CRs-Fixed: 974961 --- core/gps_extended_c.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 75ee17e3..9b73fd59 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -217,6 +217,12 @@ typedef uint16_t GpsLocationExtendedFlags; #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 typedef enum { LOC_RELIABILITY_NOT_SET = 0, @@ -252,6 +258,12 @@ typedef struct { 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; } GpsLocationExtended; /** Represents SV status. */ From 59af75a225983279d5efa400264576a609e4f239 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 22 Feb 2016 14:57:09 -0800 Subject: [PATCH 389/945] fixes SUPL_MODE carrier specific SUPL_MODE is not updated upon sim card insert. gpc_conf must be updated with the new value for config to be updated. Change-Id: I2a5f10fa7d27be9253e9ca6f34c0c886285d1b11 CRs-Fixed: 953942 --- loc_api/libloc_api_50001/loc_eng.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index cb7bb46c..d2fc5bc6 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2735,6 +2735,7 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, 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.GPS_LOCK = gps_conf.GPS_LOCK; gps_conf = gps_conf_tmp; } From 02cad4d9819e07f5827a583ea5fdd2d4b5fa7070 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 11 Feb 2016 14:50:58 -0800 Subject: [PATCH 390/945] make LocSharedLock::mRef ops atomic The current share() and drop() calls are not thread safe, which can cause memory heap correuption. This changes the read / write ops to be atomic. Change-Id: Ic241d4573bdf2e58c4e264e97bd41b56f882c791 CRs-Fixed: 975372 --- utils/LocSharedLock.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h index 6b9e27f1..7fe62376 100644 --- a/utils/LocSharedLock.h +++ b/utils/LocSharedLock.h @@ -30,6 +30,7 @@ #define __LOC_SHARED_LOCK__ #include +#include #include // This is a utility created for use cases such that there are more than @@ -39,16 +40,16 @@ // this share lock's share() method has to be called, so that the obj // can maintain an accurate client count. class LocSharedLock { - uint32_t mRef; + 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() { mRef++; return this; } + 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 (0 == --mRef) delete this; } + 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 From a05f77fa0bc52e4af440f8fe3a4b043209396680 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 11 Feb 2016 14:50:58 -0800 Subject: [PATCH 391/945] make LocSharedLock::mRef ops atomic The current share() and drop() calls are not thread safe, which can cause memory heap correuption. This changes the read / write ops to be atomic. Change-Id: Ic241d4573bdf2e58c4e264e97bd41b56f882c791 CRs-Fixed: 975372 --- utils/LocSharedLock.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h index 6b9e27f1..7fe62376 100644 --- a/utils/LocSharedLock.h +++ b/utils/LocSharedLock.h @@ -30,6 +30,7 @@ #define __LOC_SHARED_LOCK__ #include +#include #include // This is a utility created for use cases such that there are more than @@ -39,16 +40,16 @@ // this share lock's share() method has to be called, so that the obj // can maintain an accurate client count. class LocSharedLock { - uint32_t mRef; + 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() { mRef++; return this; } + 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 (0 == --mRef) delete this; } + 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 From 1a2040c1fe93c5f9d4aa1c9a9ca5faef241217ac Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 4 Mar 2016 15:12:35 +0530 Subject: [PATCH 392/945] Adding a new NMEA sentence : $GNGSA. Currently only $GPGSA was being generated for GPS satellites. This change adds $GNGSA for GLONASS satellites as well. Change-Id: I7ab0e92c7ed4ce73be11909eefe0d570a1a0fc1e CRs-Fixed: 978745 --- loc_api/libloc_api_50001/loc_eng.h | 3 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 112 +++++++++++++++++++++- 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index a203e6bb..b4f2564b 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -119,7 +119,8 @@ typedef struct loc_eng_data_s // For nmea generation boolean generateNmea; - uint32_t sv_used_mask; + uint32_t gps_used_mask; + uint32_t glo_used_mask; float hdop; float pdop; float vdop; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index b0e548c9..d60ecfc4 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -101,6 +101,12 @@ 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 @@ -144,7 +150,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, uint32_t svUsedCount = 0; uint32_t svUsedList[32] = {0}; - uint32_t mask = loc_eng_data_p->sv_used_mask; + uint32_t mask = loc_eng_data_p->gps_used_mask; for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) { if (mask & 1) @@ -152,7 +158,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, mask = mask >> 1; } // clear the cache so they can't be used again - loc_eng_data_p->sv_used_mask = 0; + loc_eng_data_p->gps_used_mask = 0; char fixType; if (svUsedCount == 0) @@ -210,6 +216,99 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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------ // ------------------ @@ -565,6 +664,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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); @@ -790,9 +893,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - // cache the used in fix mask, as it will be needed to send $GPGSA + // cache the used in fix mask, as it will be needed to send $GPGSA/$GNGSA // during the position report - loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; + loc_eng_data_p->gps_used_mask = svStatus.gps_used_in_fix_mask; + loc_eng_data_p->glo_used_mask = svStatus.glo_used_in_fix_mask; // For RPC, the DOP are sent during sv report, so cache them // now to be sent during position report. From e83eaa3a9a1dfb353a097541f5e8e9e0b68b5f4d Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 4 Mar 2016 15:12:35 +0530 Subject: [PATCH 393/945] Adding a new NMEA sentence : $GNGSA. Currently only $GPGSA was being generated for GPS satellites. This change adds $GNGSA for GLONASS satellites as well. Change-Id: I7ab0e92c7ed4ce73be11909eefe0d570a1a0fc1e CRs-Fixed: 978745 --- loc_api/libloc_api_50001/loc_eng.h | 3 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 112 +++++++++++++++++++++- 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 23f93762..46735c9e 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -119,7 +119,8 @@ typedef struct loc_eng_data_s // For nmea generation boolean generateNmea; - uint32_t sv_used_mask; + uint32_t gps_used_mask; + uint32_t glo_used_mask; float hdop; float pdop; float vdop; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 126a97f0..70085dc4 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -102,6 +102,12 @@ 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 @@ -144,7 +150,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, uint32_t svUsedCount = 0; uint32_t svUsedList[32] = {0}; - uint32_t mask = loc_eng_data_p->sv_used_mask; + uint32_t mask = loc_eng_data_p->gps_used_mask; for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) { if (mask & 1) @@ -152,7 +158,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, mask = mask >> 1; } // clear the cache so they can't be used again - loc_eng_data_p->sv_used_mask = 0; + loc_eng_data_p->gps_used_mask = 0; char fixType; if (svUsedCount == 0) @@ -210,6 +216,99 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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------ // ------------------ @@ -565,6 +664,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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); @@ -790,9 +893,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - // cache the used in fix mask, as it will be needed to send $GPGSA + // cache the used in fix mask, as it will be needed to send $GPGSA/$GNGSA // during the position report - loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; + loc_eng_data_p->gps_used_mask = svStatus.gps_used_in_fix_mask; + loc_eng_data_p->glo_used_mask = svStatus.glo_used_in_fix_mask; // For RPC, the DOP are sent during sv report, so cache them // now to be sent during position report. From fa7a874eb0586c7844fe3a4cb8d0063ce53464f0 Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Wed, 2 Mar 2016 12:49:02 -0800 Subject: [PATCH 394/945] Revert "Fix compilation issues for m_master merge into oe_master". This reverts commit ecb67363ee73c0374424795ae6014a794065f5ab Change-Id: I7b540247b246ea4caf710247d2c58b55515dae7c --- core/LocAdapterBase.cpp | 2 +- core/LocApiBase.cpp | 2 +- core/LocDualContext.cpp | 5 -- core/Makefile.am | 7 +- core/UlpProxyBase.h | 1 + loc_api/Makefile.am | 4 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 +- loc_api/libloc_api_50001/Makefile.am | 78 ------------------- loc_api/libloc_api_50001/loc_eng.cpp | 7 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 2 + .../loc_pla/include/platform_lib_macros.h | 2 - .../loc_pla/include/platform_lib_time.h | 4 +- .../loc_pla/src/Makefile.am | 1 - .../loc_stub/src/Makefile.am | 1 - utils/LocTimer.h | 2 +- utils/Makefile.am | 15 +--- utils/MsgTask.cpp | 3 +- utils/loc_cfg.cpp | 2 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_timer.h | 2 +- 20 files changed, 25 insertions(+), 120 deletions(-) delete mode 100644 loc_api/libloc_api_50001/Makefile.am diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index e9bec95c..8fdb8cbb 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 45d16e90..dcd35fec 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 74b2903a..b5f33ac3 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include namespace loc_core { @@ -59,11 +58,7 @@ 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; diff --git a/core/Makefile.am b/core/Makefile.am index 341153ad..e2d05be4 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,11 +1,10 @@ AM_CFLAGS = -I./ \ -I../utils \ $(LOCPLA_CFLAGS) \ - -I$(WORKSPACE)/gps-noship/flp \ - -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_core_la_h_sources = \ + MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ @@ -14,10 +13,10 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h \ - LocAdapterProxyBase.h + loc_core_log.h libloc_core_la_c_sources = \ + MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 2bafb0ab..59e265e8 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -31,6 +31,7 @@ #include #include "fused_location_extended.h" + namespace loc_core { class LocAdapterBase; diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index a5f529bd..d42d4d99 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -5,7 +5,6 @@ AM_CFLAGS = \ -I../utils \ $(LOCPLA_CFLAGS) \ -fno-short-enums \ - -D__func__=__PRETTY_FUNCTION__ \ -DTARGET_USES_QCOM_BSP libloc_eng_so_la_h_sources = \ @@ -82,8 +81,7 @@ 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_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices $(LOCPLA_LIBS) ../utils/libgps_utils_so.la libloc_api_v02_CFLAGS = \ $(QMIF_CFLAGS) \ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index f3290dbd..1d1a59ed 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -339,10 +339,9 @@ void LocEngAdapter::requestPowerVote() LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); setGpsLock(powerUp ? 103 : 101); } -#ifndef USE_GLIB + delete mUlp; mUlp = ulp; -#endif } void LocInternalAdapter::reportPosition(UlpLocation &location, diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am deleted file mode 100644 index c7624272..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 6aac28ba..de72aa8d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -46,7 +46,12 @@ #include #include #include - +#if defined(USE_GLIB) && !defined(OFF_TARGET) +#include +#endif +#ifdef USE_GLIB +#include +#endif /* USE_GLIB */ #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index a29784fc..3b20bbbc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -235,6 +235,8 @@ static void* ni_thread_proc(void *args) LOC_LOGD("pSession->resp is %d\n",pSession->resp); + LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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() diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index c712122e..32035d28 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -35,8 +35,6 @@ extern "C" { #ifdef USE_GLIB #include -#include -#include #ifndef OFF_TARGET #include #define strlcat g_strlcat diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h index 7033a7a1..c05b15ce 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -30,9 +30,7 @@ #define __PLATFORM_LIB_TIME_H__ #include -#ifndef USE_GLIB -#include -#endif + int64_t platform_lib_abstraction_elapsed_millis_since_boot(); #endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/platform_lib_abstractions/loc_pla/src/Makefile.am b/platform_lib_abstractions/loc_pla/src/Makefile.am index 6ee0be70..3936837d 100644 --- a/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -1,7 +1,6 @@ AM_CFLAGS = \ $(LOCSTUB_CFLAGS) \ -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums h_sources = \ diff --git a/platform_lib_abstractions/loc_stub/src/Makefile.am b/platform_lib_abstractions/loc_stub/src/Makefile.am index 8bda7113..c8ab5fcb 100644 --- a/platform_lib_abstractions/loc_stub/src/Makefile.am +++ b/platform_lib_abstractions/loc_stub/src/Makefile.am @@ -1,6 +1,5 @@ AM_CFLAGS = \ -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_stub_la_extra_h = \ diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c6a63620..c1468524 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -31,7 +31,7 @@ #define __LOC_TIMER_CPP_H__ #include -#include +#include // opaque class to provide service implementation. class LocTimerDelegate; diff --git a/utils/Makefile.am b/utils/Makefile.am index 50f10078..5e718439 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -14,24 +14,15 @@ libgps_utils_so_la_h_sources = \ loc_cfg.h \ loc_log.h \ loc_target.h \ - loc_timer.h \ - MsgTask.h \ - LocHeap.h \ - LocThread.h \ - LocTimer.h \ - loc_misc_utils.h + loc_timer.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 + loc_timer.c \ + loc_target.cpp library_includedir = $(pkgincludedir)/utils diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 78a3fe00..f33d6024 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -33,7 +33,6 @@ #include #include #include -#include static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; @@ -78,7 +77,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const { 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); + set_sched_policy(gettid(), SP_FOREGROUND); } bool MsgTask::run() { diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 926781a6..967d2f30 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #ifdef USE_GLIB #include diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index dfe19a2d..7e96313f 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -28,7 +28,7 @@ */ #include #include -#include +#include #include #include diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 25fd1790..2967858e 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ #include -#include + /* user_data: client context pointer, passthrough. Originally received from calling client when loc_timer_start() is called. From a29688ff347be4972133eb11ccecaf03b0d3445e Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Mon, 7 Mar 2016 10:44:34 -0800 Subject: [PATCH 395/945] Revert "Merging m_master changes to oe_master". This reverts commit 1aeb6bad84c0afd0e032c3d4d7e33959501e18f1 Change-Id: Iec0a96e7cdfe55ef5836c92a2ae1cce407f6cd5e --- core/Android.mk | 14 +- core/ContextBase.cpp | 29 +- core/ContextBase.h | 11 +- core/LBSProxyBase.h | 13 +- core/LocAdapterBase.cpp | 41 +- core/LocAdapterBase.h | 27 +- core/LocAdapterProxyBase.h | 70 - core/LocApiBase.cpp | 96 +- core/LocApiBase.h | 60 +- core/LocDualContext.cpp | 97 +- core/LocDualContext.h | 34 +- core/MsgTask.cpp | 131 ++ {utils => core}/MsgTask.h | 45 +- core/UlpProxyBase.h | 14 +- core/gps_extended_c.h | 222 +-- core/loc_core_log.cpp | 67 +- etc/gps.conf | 38 +- loc_api/NOTICE | 13 + .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 8 +- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 48 +- loc_api/libloc_api-rpc/Android.mk | 61 + loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 + loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 ++ .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 + .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 + .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 + .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 + .../gen-1240/loc_api_common.xdr | 906 +++++++++ .../gen-1240/loc_api_common_xdr.c | 1650 +++++++++++++++++ .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 + .../gen-1240/loc_api_rpc_glue.c | 339 ++++ loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 ++ loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 + loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 ++ .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 + .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 + .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 + .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 + .../gen-3200/loc_api_common.xdr | 803 ++++++++ .../gen-3200/loc_api_common_xdr.c | 1441 ++++++++++++++ .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 + .../gen-3200/loc_api_rpc_glue.c | 339 ++++ loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 ++ loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 +++ loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 + .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ++++++++++++ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 ++ .../inc-1240/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 ++ loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 + .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 ++++++++++ .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 ++ .../inc-3200/loc_apicb_appinit.h | 34 + loc_api/libloc_api-rpc/inc/debug.h | 57 + loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 + .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 + loc_api/libloc_api_50001/Android.mk | 11 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 346 +--- loc_api/libloc_api_50001/LocEngAdapter.h | 90 +- loc_api/libloc_api_50001/gps.c | 2 +- loc_api/libloc_api_50001/loc.cpp | 258 +-- loc_api/libloc_api_50001/loc.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 672 ++----- loc_api/libloc_api_50001/loc_eng.h | 106 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_agps.h | 12 - loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 12 +- loc_api/libloc_api_50001/loc_eng_msg.h | 14 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 169 +- loc_api/libloc_api_50001/loc_eng_ni.h | 8 - loc_api/libloc_api_50001/loc_eng_nmea.cpp | 62 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 3 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 58 +- .../loc_pla/include/platform_lib_log_util.h | 52 +- utils/Android.mk | 33 +- utils/LocHeap.cpp | 354 ---- utils/LocHeap.h | 96 - utils/LocSharedLock.h | 59 - utils/LocThread.cpp | 264 --- utils/LocThread.h | 92 - utils/LocTimer.cpp | 737 -------- utils/LocTimer.h | 74 - utils/MsgTask.cpp | 100 - utils/linked_list.c | 6 +- utils/loc_cfg.cpp | 462 ++--- utils/loc_cfg.h | 26 +- utils/loc_log.cpp | 82 +- utils/loc_log.h | 17 +- utils/loc_misc_utils.cpp | 114 -- utils/loc_misc_utils.h | 99 - utils/loc_target.cpp | 62 +- utils/loc_target.h | 16 +- utils/loc_timer.c | 187 ++ utils/loc_timer.h | 36 +- utils/msg_q.c | 8 +- .../elapsed_millis_since_boot.cpp | 46 - .../platform_lib_includes.h | 35 - .../platform_lib_macros.h | 81 - .../platform_lib_time.h | 35 - 100 files changed, 11537 insertions(+), 4839 deletions(-) delete mode 100644 core/LocAdapterProxyBase.h create mode 100644 core/MsgTask.cpp rename {utils => core}/MsgTask.h (67%) create mode 100644 loc_api/NOTICE create mode 100644 loc_api/libloc_api-rpc/Android.mk create mode 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c create mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h create mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h create mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h create mode 100644 loc_api/libloc_api-rpc/inc/debug.h create mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h create mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c delete mode 100644 utils/LocHeap.cpp delete mode 100644 utils/LocHeap.h delete mode 100644 utils/LocSharedLock.h delete mode 100644 utils/LocThread.cpp delete mode 100644 utils/LocThread.h delete mode 100644 utils/LocTimer.cpp delete mode 100644 utils/LocTimer.h delete mode 100644 utils/MsgTask.cpp delete mode 100644 utils/loc_misc_utils.cpp delete mode 100644 utils/loc_misc_utils.h create mode 100644 utils/loc_timer.c delete mode 100644 utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp delete mode 100644 utils/platform_lib_abstractions/platform_lib_includes.h delete mode 100644 utils/platform_lib_abstractions/platform_lib_macros.h delete mode 100644 utils/platform_lib_abstractions/platform_lib_time.h diff --git a/core/Android.mk b/core/Android.mk index c6d3128d..11cecc65 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -10,12 +10,6 @@ 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 \ @@ -23,6 +17,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_SRC_FILES += \ + MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ @@ -34,11 +29,11 @@ LOCAL_CFLAGS += \ -D_ANDROID_ LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libflp + $(TARGET_OUT_HEADERS)/gps.utils LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ + MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ @@ -47,8 +42,7 @@ LOCAL_COPY_HEADERS:= \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h \ - LocAdapterProxyBase.h + loc_core_log.h LOCAL_PRELINK_MODULE := false diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 58dc8a78..b2869bb9 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -69,28 +69,13 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { - 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); - } - } + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { // 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); - } + void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if (NULL != getter) { + locApi = (*getter)(mMsgTask, exMask); } } } @@ -99,7 +84,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // locApi could still be NULL at this time // we would then create a dummy one if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask, this); + locApi = new LocApiBase(mMsgTask, exMask); } return locApi; diff --git a/core/ContextBase.h b/core/ContextBase.h index fe0b8606..85cbab7e 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -56,17 +56,12 @@ public: 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 void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); } + inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } + inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } 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); } }; } // namespace loc_core diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 0faf8012..f0d1a329 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -35,14 +35,12 @@ 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 { + LOC_API_ADAPTER_EVENT_MASK_T exMask) const { return NULL; } protected: @@ -51,11 +49,8 @@ public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} - inline virtual bool hasAgpsExtendedCapabilities() const { return false; } - inline virtual bool hasCPIExtendedCapabilities() const { return false; } - inline virtual void modemPowerVote(bool power) const {} - virtual void injectFeatureConfig(ContextBase* context) const {} - inline virtual IzatDevId_t getIzatDevId() const { return 0; } + inline virtual bool hasAgpsExt() const { return false; } + inline virtual bool hasCPIExt() const { return false; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8fdb8cbb..054a295c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,8 +32,7 @@ #include #include #include -#include -#include +#include namespace loc_core { @@ -42,45 +41,27 @@ namespace loc_core { // 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) : + ContextBase* context) : mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), - mMsgTask(context->getMsgTask()) + mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) { mLocApi->addAdapter(this); } -void LocAdapterBase::handleEngineUpEvent() -{ - if (mLocAdapterProxyBase) { - mLocAdapterProxyBase->handleEngineUpEvent(); - } -} - -void LocAdapterBase::handleEngineDownEvent() -{ - if (mLocAdapterProxyBase) { - mLocAdapterProxyBase->handleEngineDownEvent(); - } -} +void LocAdapterBase:: + handleEngineDownEvent() +DEFAULT_IMPL() 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() - } -} + LocPosTechMask loc_technology_mask) +DEFAULT_IMPL() void LocAdapterBase:: - reportSv(GnssSvStatus &svStatus, + reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() @@ -135,8 +116,4 @@ DEFAULT_IMPL(false) bool LocAdapterBase:: requestNiNotify(GpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) - -void LocAdapterBase:: - reportGpsMeasurementData(GpsData &gpsMeasurementData) -DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 5f4660b8..8222b24b 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -35,23 +35,19 @@ namespace loc_core { -class LocAdapterProxyBase; - class LocAdapterBase { protected: - LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + const 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) {} + mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); + ContextBase* context); inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; @@ -69,19 +65,10 @@ public: 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(); - } - // This will be overridden by the individual adapters // if necessary. inline virtual void setUlpProxy(UlpProxyBase* ulp) {} - virtual void handleEngineUpEvent(); + inline virtual void handleEngineUpEvent() {} virtual void handleEngineDownEvent(); inline virtual void setPositionModeInt(LocPosMode& posMode) {} virtual void startFixInt() {} @@ -92,7 +79,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -110,8 +97,6 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } - ContextBase* getContext() const { return mContext; } - virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; } // namespace loc_core diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h deleted file mode 100644 index 1ddcca4c..00000000 --- a/core/LocAdapterProxyBase.h +++ /dev/null @@ -1,70 +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; - } - ContextBase* getContext() const { - return mLocAdapterBase->getContext(); - } - inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) { - mLocAdapterBase->updateEvtMask(event,isEnabled); - } - -public: - 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) { - return false; - } -}; - -} // namespace loc_core - -#endif //LOC_ADAPTER_PROXY_BASE_H diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index dcd35fec..3cd2ffa8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,8 +32,7 @@ #include #include #include -#include -#include +#include namespace loc_core { @@ -126,10 +125,8 @@ struct LocOpenMsg : public LocMsg { }; LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, - ContextBase* context) : - mExcludedMask(excludedMask), mMsgTask(msgTask), - mMask(0), mSupportedMsg(0), mContext(context) + LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : + mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } @@ -204,18 +201,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) } } -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()); } @@ -232,17 +222,6 @@ void LocApiBase::reportPosition(UlpLocation &location, 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", - 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); // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPosition(location, @@ -253,24 +232,10 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GnssSvStatus &svStatus, +void LocApiBase::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { - // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" - " mask: %x/%x/%x\n sv: prn snr elevation azimuth", - svStatus.num_svs, svStatus.ephemeris_mask, - svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, - svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); - for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f", - i, - svStatus.sv_list[i].prn, - svStatus.sv_list[i].snr, - svStatus.sv_list[i].elevation, - svStatus.sv_list[i].azimuth); - } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportSv(svStatus, @@ -353,23 +318,12 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } -void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) -{ - mSupportedMsg = supportedMsgList; -} - void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData)); -} - enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -450,8 +404,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage, - int sensorProvider) + setSensorControlConfig(int sensorUsage) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -489,23 +442,12 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation& zppLoc) + getZppFix(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) -} + getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) int LocApiBase:: initDataServiceClient() @@ -524,30 +466,10 @@ void LocApiBase:: DEFAULT_IMPL() int LocApiBase:: - setGpsLock(LOC_GPS_LOCK_MASK lock) + setGpsLock(unsigned int 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) - -int LocApiBase:: - updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) -DEFAULT_IMPL(-1) - -bool LocApiBase:: - gnssConstellationConfig() -DEFAULT_IMPL(false) - } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 5a2c56f0..c48927c4 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -36,7 +36,6 @@ #include namespace loc_core { -class ContextBase; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -53,13 +52,6 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i sendMsg(msg); - } - void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); @@ -113,7 +99,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GnssSvStatus &svStatus, + void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); @@ -129,8 +115,6 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); - void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGpsMeasurementData(GpsData &gpsMeasurementData); // downward calls // All below functions are to be defined by adapter specific modules: @@ -174,7 +158,7 @@ public: virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider); + setSensorControlConfig(int sensorUsage); virtual enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, @@ -202,28 +186,15 @@ public: virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); virtual enum loc_api_adapter_err - getWwanZppFix(GpsLocation & zppLoc); + getZppFix(GpsLocation & zppLoc); virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + getZppFix(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) {} - inline bool isMessageSupported (LocCheckingMessagesID msgID) const { - if (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 @@ -231,30 +202,17 @@ public: 3 = Lock MT position sessions 4 = Lock all position sessions */ - virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); + virtual int setGpsLock(unsigned int 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); - - /* - Update gps reporting events - */ - virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled); - /* - Check if the modem support the service - */ - virtual bool gnssConstellationConfig(); }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase *context); + LOC_API_ADAPTER_EVENT_MASK_T exMask); } // namespace loc_core diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index b5f33ac3..b4eaf7ff 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -49,97 +49,86 @@ LocDualContext::mBgExclMask = 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); + LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT); 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"; -const char* LocDualContext::mLBSLibName = "liblbs_core.so"; +#ifndef USE_GLIB +const char* LocDualContext::mIzatLibName = "liblbs_core.so"; +#else +const char* LocDualContext::mIzatLibName = "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) +const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, + const char* name) { if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name, joinable); + mMsgTask = new MsgTask(tCreator, name); } return mMsgTask; } -inline -const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { - return getMsgTask((LocThread::tCreate)NULL, name, joinable); +const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tAssociate, name); + } + return mMsgTask; } -ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator, - LocMsg* firstMsg, const char* name, bool joinable) +ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, + const char* name) { - 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); + const MsgTask* msgTask = getMsgTask(tCreator, name); 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) +ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mFgContext) { + const MsgTask* msgTask = getMsgTask(tAssociate, name); + mFgContext = new LocDualContext(msgTask, + mFgExclMask); + } + return mFgContext; + +} + +ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, + const char* name) { - 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); + const MsgTask* msgTask = getMsgTask(tCreator, name); 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) +ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, + const char* name) { - 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); + if (NULL == mBgContext) { + const MsgTask* msgTask = getMsgTask(tAssociate, name); + mBgContext = new LocDualContext(msgTask, + mBgExclMask); } - LOC_LOGD("%s:%d]: Exit", __func__, __LINE__); + return mBgContext; } LocDualContext::LocDualContext(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask) : - ContextBase(msgTask, exMask, mLBSLibName) + ContextBase(msgTask, exMask, mIzatLibName) { } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index ce77a1aa..e761e764 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -40,11 +40,11 @@ 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; + + static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, + const char* name); + static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, + const char* name); protected: LocDualContext(const MsgTask* msgTask, @@ -52,23 +52,19 @@ protected: inline virtual ~LocDualContext() {} public: - static const char* mLBSLibName; + static const char* mIzatLibName; 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); + static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, + const char* name); + static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, + const char* name); + static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, + const char* name); + static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, + const char* name); }; } diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp new file mode 100644 index 00000000..df6db808 --- /dev/null +++ b/core/MsgTask.cpp @@ -0,0 +1,131 @@ +/* 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_MsgTask" + +#include +#include +#include +#include +#include + +namespace loc_core { + +#define MAX_TASK_COMM_LEN 15 + +static void LocMsgDestroy(void* msg) { + delete (LocMsg*)msg; +} + +MsgTask::MsgTask(tCreate tCreator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(NULL){ + if (tCreator) { + tCreator(threadName, loopMain, + (void*)new MsgTask(mQ, mAssociator)); + } else { + createPThread(threadName); + } +} + +MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : + mQ(msg_q_init2()), mAssociator(tAssociator){ + createPThread(threadName); +} + +inline +MsgTask::MsgTask(const void* q, tAssociate associator) : + mQ(q), mAssociator(associator){ +} + +MsgTask::~MsgTask() { + msg_q_unblock((void*)mQ); +} + +void MsgTask::createPThread(const char* threadName) { + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + pthread_t tid; + // create the thread here, then if successful + // and a name is given, we set the thread name + if (!pthread_create(&tid, &attr, loopMain, + (void*)new MsgTask(mQ, mAssociator)) && + NULL != threadName) { + char lname[MAX_TASK_COMM_LEN+1]; + memcpy(lname, threadName, MAX_TASK_COMM_LEN); + lname[MAX_TASK_COMM_LEN] = 0; + pthread_setname_np(tid, lname); + } +} + +void MsgTask::sendMsg(const LocMsg* msg) const { + msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); +} + +void* MsgTask::loopMain(void* arg) { + MsgTask* copy = (MsgTask*)arg; + + // make sure we do not run in background scheduling group + platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); + + if (NULL != copy->mAssociator) { + copy->mAssociator(); + } + + LocMsg* msg; + int cnt = 0; + + while (1) { + LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); + + msq_q_err_type result = msg_q_rcv((void*)copy->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)); + // destroy the Q and exit + msg_q_destroy((void**)&(copy->mQ)); + delete copy; + return NULL; + } + + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); + + delete msg; + } + + delete copy; + + return NULL; +} + +} diff --git a/utils/MsgTask.h b/core/MsgTask.h similarity index 67% rename from utils/MsgTask.h rename to core/MsgTask.h index 9eb1f567..d09de731 100644 --- a/utils/MsgTask.h +++ b/core/MsgTask.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. +/* 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 @@ -29,7 +29,12 @@ #ifndef __MSG_TASK__ #define __MSG_TASK__ -#include +#include +#include +#include +#include + +namespace loc_core { struct LocMsg { inline LocMsg() {} @@ -38,30 +43,24 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask : public LocRunnable { - const void* mQ; - LocThread* mThread; - friend class LocThreadDelegate; -protected: - virtual ~MsgTask(); +class 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(); + typedef void* (*tStart)(void*); + typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); + typedef int (*tAssociate)(); + MsgTask(tCreate tCreator, const char* threadName); + MsgTask(tAssociate tAssociator, const char* threadName); + ~MsgTask(); 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() {} +private: + const void* mQ; + tAssociate mAssociator; + MsgTask(const void* q, tAssociate associator); + static void* loopMain(void* copy); + void createPThread(const char* name); }; +} // namespace loc_core + #endif //__MSG_TASK__ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 59e265e8..90097571 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -30,7 +30,6 @@ #define ULP_PROXY_BASE_H #include -#include "fused_location_extended.h" namespace loc_core { @@ -51,7 +50,6 @@ public: mPosMode = params; return false; } - inline virtual bool reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, @@ -59,7 +57,7 @@ public: LocPosTechMask loc_technology_mask) { return false; } - inline virtual bool reportSv(GnssSvStatus &svStatus, + inline virtual bool reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { return false; @@ -69,14 +67,6 @@ public: } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} - inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, - bool active) { - return false; - } - inline virtual bool reportPositions(const FlpExtLocation* locations, - int32_t number_of_locations) { - return false; - } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index e37ff482..f8e540fb 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -31,8 +31,6 @@ #include #include -#include -#include #include /** @@ -62,31 +60,15 @@ extern "C" { /** Position source is ULP */ #define ULP_LOCATION_IS_FROM_HYBRID 0x0001 /** Position source is GNSS only */ -#define ULP_LOCATION_IS_FROM_GNSS 0x0002 +#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 +#define ULP_LOCATION_IS_FROM_ZPP 0x0004 #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 struct { /** set to sizeof(UlpLocation) */ size_t size; @@ -153,7 +135,7 @@ typedef struct { AGpsExtType type; AGpsStatusValue status; uint32_t ipv4_addr; - struct sockaddr_storage addr; + char ipv6_addr[16]; char ssid[SSID_BUF_SIZE]; char password[SSID_BUF_SIZE]; } AGpsExtStatus; @@ -219,6 +201,22 @@ typedef enum loc_position_mode_type { */ #define GPS_DEFAULT_FIX_INTERVAL_MS 1000 +/** GpsLocationExtended has valid latitude and longitude. */ +#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) +/** GpsLocationExtended has valid altitude. */ +#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1) +/** GpsLocationExtended has valid speed. */ +#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2) +/** GpsLocationExtended has valid bearing. */ +#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4) +/** GpsLocationExtended has valid accuracy. */ +#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8) + +/** GPS extended supports geofencing */ +#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001 +/** GPS extended supports batching */ +#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002 + /** Flags to indicate which values are valid in a GpsLocationExtended. */ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ @@ -233,20 +231,6 @@ typedef uint16_t GpsLocationExtendedFlags; #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 - -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; /** Represents gps location extended. */ typedef struct { @@ -268,55 +252,8 @@ typedef struct { 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; } GpsLocationExtended; -/** Represents SV status. */ -typedef struct { - /** set to sizeof(GnssSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which GPS SVs - * were used for computing the most recent position fix. - */ - uint32_t gps_used_in_fix_mask; - - /** - * Represents a bit mask indicating which GLONASS SVs - * were used for computing the most recent position fix. - */ - uint32_t glo_used_in_fix_mask; - - /** - * Represents a bit mask indicating which BDS SVs - * were used for computing the most recent position fix. - */ - uint64_t bds_used_in_fix_mask; - -} GnssSvStatus; - enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, @@ -365,95 +302,66 @@ enum loc_api_adapter_err { 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_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, 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_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_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_EVENT_MAX }; -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1<valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) + if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && + (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) { location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = location_report_ptr->speed_horizontal; + location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + + location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); } // Heading @@ -796,7 +783,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { - GnssSvStatus SvStatus = {0}; + GpsSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; @@ -822,7 +809,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { 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].size = sizeof(GpsSvStatus); SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn; // We only have the data field to report gps eph and alm mask @@ -841,7 +828,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) 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)); + SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); } } // SBAS: GPS RPN: 120-151, @@ -854,12 +841,6 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) // 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 @@ -1406,9 +1387,8 @@ GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) } LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase *context) { - return new LocApiRpc(msgTask, exMask, context); + LOC_API_ADAPTER_EVENT_MASK_T exMask) { + return new LocApiRpc(msgTask, exMask); } /*Values for lock @@ -1417,12 +1397,12 @@ LocApiBase* getLocApi(const MsgTask* msgTask, 3 = Lock MT position sessions 4 = Lock all position sessions */ -int LocApiRpc::setGpsLock(LOC_GPS_LOCK_MASK lockMask) +int LocApiRpc::setGpsLock(unsigned int lock) { 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); + LOC_LOGD("%s:%d]: lock: %d\n", __func__, __LINE__, lock); + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = (rpc_loc_lock_e_type)lock; 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, diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk new file mode 100644 index 00000000..06e46948 --- /dev/null +++ b/loc_api/libloc_api-rpc/Android.mk @@ -0,0 +1,61 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) +RPC_INC:=inc-$(AMSS_VERSION) + +generated_files:= \ + gen-$(AMSS_VERSION)/loc_api_clnt.c \ + gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ + gen-$(AMSS_VERSION)/loc_api_xdr.c \ + gen-$(AMSS_VERSION)/loc_api_fixup.c \ + gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ + src/loc_apicb_appinit.c + +LOCAL_SRC_FILES:= $(generated_files) + +# removed from library build since the client should implement this code. +# src/loc_api_cb_server.c + +LOCAL_CFLAGS:=-fno-short-enums +LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h +LOCAL_CFLAGS+=-DDEBUG +# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE + +LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL + +LOCAL_SHARED_LIBRARIES:= librpc +LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc + + + +LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc +LOCAL_COPY_HEADERS:= \ + $(RPC_INC)/loc_api_cb.h \ + $(RPC_INC)/loc_api_common.h \ + $(RPC_INC)/loc_api.h \ + $(RPC_INC)/loc_api_fixup.h \ + $(RPC_INC)/loc_apicb_appinit.h \ + inc/debug.h \ + inc/loc_api_rpc_glue.h + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/inc \ + $(LOCAL_PATH)/$(RPC_INC) \ + $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ + $(TARGET_OUT_HEADERS)/librpc + +LOCAL_MODULE:= libloc_api-rpc +LOCAL_MODULE_OWNER := qcom + +include $(BUILD_STATIC_LIBRARY) + +endif +endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr new file mode 100644 index 00000000..5d9cf6c8 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr @@ -0,0 +1,29 @@ +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:= inc-$(AMSS_VERSION) + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr new file mode 100644 index 00000000..a9d60aa4 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr @@ -0,0 +1,172 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + + + version LOC_APIVERS_0002 { + +/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 +RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ +*/ + + void + rpc_loc_api_null( void ) = 0; + + } = 0x00040002; + + +} = 0x3000008c; + +const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr new file mode 100644 index 00000000..1bd4e151 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr @@ -0,0 +1,85 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$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. 0x00040002 ) + */ + +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; + + + + + } = 0x00040001; + + +} = 0x3100008c; + +const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c new file mode 100644 index 00000000..52a0d15b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c new file mode 100644 index 00000000..dca1e8d5 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c @@ -0,0 +1,91 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "loc_api.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr new file mode 100644 index 00000000..4e01607d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr @@ -0,0 +1,906 @@ +/* LOC_API TOOL VERSION: 4.36 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- + Copyright (c) 2010 QUALCOMM Incorporated. + All Rights Reserved. QUALCOMM Proprietary and Confidential. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 +Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 + +loc_api Definition File(s): +Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + +const LOC_API_TOOLVERS = 0x00040024; +const LOC_API_FEATURES = 0x00000001; + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; +const RPC_LOC_OPEN_VERSION = 0x00040001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; +const RPC_LOC_API_NULL_VERSION = 0x00040001; +const RPC_LOC_STOP_FIX_VERSION = 0x00040001; +const RPC_LOC_IOCTL_VERSION = 0x00040001; +const RPC_LOC_START_FIX_VERSION = 0x00040001; +const RPC_LOC_CLOSE_VERSION = 0x00040001; +const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; +const RPC_LOC_API_API_MAJOR_NUM = 0x0004; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; + +typedef bool rpc_boolean; + +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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[1200]; /* EVAL:[1200]*/ +}; + +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_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]; /* EVAL:[256]*/ +}; + +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; + 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ + + typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + 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_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_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_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 +}; + +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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c new file mode 100644 index 00000000..7c860bf3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c @@ -0,0 +1,1650 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, 1200)) + 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_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; + 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_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; + 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_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_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; + 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_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_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_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; + 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; + 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: + 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c new file mode 100644 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c new file mode 100644 index 00000000..fbaca8b6 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Include RPC headers */ +#include "loc_api_rpc_glue.h" + +/* Callback init */ +#include "loc_apicb_appinit.h" + +/* Logging */ +#define LOG_TAG "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00040001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c new file mode 100644 index 00000000..835f6b18 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c @@ -0,0 +1,171 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr new file mode 100644 index 00000000..5d9cf6c8 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr @@ -0,0 +1,29 @@ +CLIENTS:= loc_api +SERVERS:= loc_api_cb +COMMON:= loc_api_common +RPC_INC:= inc-$(AMSS_VERSION) + +all: $(CLIENTS) $(SERVERS) $(COMMON) fixup + +$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) + +$(CLIENTS) $(SERVERS) $(COMMON):: + rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) + rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) + +$(CLIENTS):: + rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) + +$(SERVERS):: + rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) + +fixup: + mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak + sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h + rm -f ../$(RPC_INC)/loc_api_common.h.bak + +clean: + rm -f $(addsuffix _clnt.c, $(CLIENTS)) + rm -f $(addsuffix _svc.c, $(SERVERS)) + rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) + rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr new file mode 100644 index 00000000..981266b3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr @@ -0,0 +1,164 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3000008c; + +const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr new file mode 100644 index 00000000..3f53504b --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr @@ -0,0 +1,90 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$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. 0x00010001 ) + */ + +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; + + + } = 0x00010001; +} = 0x3100008c; + +const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c new file mode 100644 index 00000000..b1aa1998 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIG_PF +#define SIG_PF void(*)(int) +#endif + +void +loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) +{ + union { + rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; + } argument; + union { + rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) + fprintf (stderr, "%s", "unable to free results"); + + return; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c new file mode 100644 index 00000000..1d7795ed --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c @@ -0,0 +1,32 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_cb.h" + +bool_t +xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) + return FALSE; + return TRUE; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c new file mode 100644 index 00000000..79814d42 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c @@ -0,0 +1,82 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include /* for memset */ +#include "loc_api.h" + +/* Default timeout can be changed using clnt_control() */ +static struct timeval TIMEOUT = { 25, 0 }; + +enum clnt_stat +rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr new file mode 100644 index 00000000..7ef6357c --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr @@ -0,0 +1,803 @@ +/* LOC_API TOOL VERSION: 3.28 */ +/*============================================================================= + 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. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + --------------------------------------------------------------------------- +=============================================================================*/ + +/*============================================================================= + + Edit History + + AUTO GENERATED + +Generated by following versions of Htorpc modules: +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 +Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 + +=============================================================================*/ +/*============================================================================= +$Header$ +=============================================================================*/ + + + + +const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; + +const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; + +const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; + +const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; + +const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; + +const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; + +const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; + +const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; + +const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; + +const RPC_LOC_OPEN_VERSION = 0x00010001; +const RPC_LOC_CLOSE_VERSION = 0x00010001; +const RPC_LOC_START_FIX_VERSION = 0x00010001; +const RPC_LOC_STOP_FIX_VERSION = 0x00010001; +const RPC_LOC_IOCTL_VERSION = 0x00010001; +const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; +const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; +const RPC_LOC_API_API_MAJOR_NUM = 0x0001; +typedef bool rpc_boolean; +typedef unsigned long rpc_uint32; + +typedef unsigned short rpc_uint16; + +typedef unsigned char rpc_uint8; + +typedef long rpc_int32; + +typedef unsigned char rpc_byte; + +typedef unsigned hyper rpc_uint64; + +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; +}; + +struct rpc_loc_nmea_report_s_type { + rpc_uint16 length; + opaque nmea_sentences; +}; + +enum rpc_loc_status_event_e_type { + RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, + 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 +}; + +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; + 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_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; +}; + +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; + 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_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; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_client_name_s_type { + unsigned char data_coding_scheme; + opaque client_name_string; + unsigned char string_len; +}; + +struct rpc_loc_ni_supl_qop_s_type { + unsigned char bit_mask; + unsigned char horacc; + unsigned char veracc; + unsigned char 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; +}; + +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; + 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; + 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; +}; + +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; + 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_MAX = 268435456 +}; + +typedef string 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 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; +}; + +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; + 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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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; + default: + void; +}; + +struct rpc_loc_server_request_s_type { + rpc_loc_server_request_e_type event; + rpc_loc_server_request_u_type payload; +}; + +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_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_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_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_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; +}; + +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 +}; + +struct rpc_loc_server_open_status_s_type { + rpc_loc_server_connection_handle conn_handle; + rpc_loc_server_open_status_e_type open_status; + string apn_name<>; +}; + +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; +}; + +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_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; + 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: + 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; + 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: + 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_RESERVED: + rpc_loc_reserved_payload_s_type reserved; + default: + void; +}; + +const RPC_LOC_API_NULL_VERSION = 0x00010001; +const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c new file mode 100644 index 00000000..7b37b9c3 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c @@ -0,0 +1,1441 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api_common.h" + +bool_t +xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) +{ + register int32_t *buf; + + if (!xdr_bool (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) +{ + register int32_t *buf; + + if (!xdr_u_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) +{ + register int32_t *buf; + + if (!xdr_u_short (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) +{ + register int32_t *buf; + + if (!xdr_long (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) +{ + register int32_t *buf; + + if (!xdr_u_char (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) +{ + register int32_t *buf; + + if (!xdr_u_quad_t (xdrs, objp)) + return FALSE; + return TRUE; +} + +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, RPC_LOC_API_MAX_SV_COUNT, + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) + 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_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; + 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; + + if (!xdr_rpc_uint16 (xdrs, &objp->length)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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; + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_u_char (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; + + if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) + 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; + + if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) + return FALSE; + if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) + 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; + + 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) + 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_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; + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) + 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_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; + 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_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_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; + 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_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; + 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) + return FALSE; + if (!xdr_string (xdrs, &objp->apn_name, ~0)) + 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_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_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; + 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: + 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; + 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: + 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c new file mode 100644 index 00000000..fe512f5d --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c @@ -0,0 +1,48 @@ +/*============================================================================= + L O C _ A P I _ F I X U P . C + +GENERAL DESCRIPTION + This file adds API constants that are not automatically transmitted to + the RPC stubs, and it also fixes other RPC-related problems. + + --------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c new file mode 100644 index 00000000..8c171222 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c @@ -0,0 +1,339 @@ +/****************************************************************************** + @file loc_api_rpc_glue.c + @brief Android Loc API glue code using rpcgen. + + DESCRIPTION + Loc API glue code for Android + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/05/2009 dx Initial version + +======================================================================*/ +/*===================================================================== + + INCLUDE FILES FOR MODULE + +======================================================================*/ +//#define LOG_NDDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Include RPC headers */ +#include "loc_api_rpc_glue.h" + +/* Callback init */ +#include "loc_apicb_appinit.h" + +/* Logging */ +#define LOG_TAG "lib_api_rpc_glue" +#include + +/* Comment this out to enable logging */ +#undef LOGD +#define LOGD(...) {} + +/*===================================================================== + External declarations +======================================================================*/ + +CLIENT* loc_api_clnt = NULL; + +/* Callback ID and pointer */ +#define LOC_API_CB_ID 1 +loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ + +#define RPC_FUNC_VERSION_BASE(a,b) a ## b +#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) + +#define LOC_GLUE_CHECK_INIT(ret_type) \ + if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ + if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } + +/* Callback functions */ +/* Returns 1 if successful */ +bool_t rpc_loc_event_cb_f_type_0x00010001_svc( + rpc_loc_event_cb_f_type_args *argp, + rpc_loc_event_cb_f_type_rets *ret, + struct svc_req *req) +{ + /* Callback not registered, or unexpected ID (shouldn't happen) */ + if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) + { + LOGD("Warning: No callback handler.\n"); + ret->loc_event_cb_f_type_result = 0; + return 1; /* simply return */ + } + + LOGD("proc: %x prog: %x vers: %x\n", + (int) req->rq_proc, + (int) req->rq_prog, + (int) req->rq_vers); + + LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", + (int) argp->loc_event, + (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; + + int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); + 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 + */ + // LOGD("***** loc_apicbprog_freeresult\n"); + + return 1; +} + +int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + return loc_apicbprog_freeresult (transp, xdr_result, result); +} + +/*=========================================================================== + +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) + { + /* Print msg */ + LOGD("Trying to create RPC client...\n"); + loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); + LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); + + if (loc_api_clnt == NULL) + { + fprintf(stderr, "Error: cannot create RPC client.\n"); + return 0; + } + + /* Init RPC callbacks */ + int rc = loc_apicb_app_init(); + if (rc >= 0) + { + LOGD("Loc API callback initialized.\n"); + } else { + fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); + + rpc_loc_open_args args; + args.event_reg_mask = event_reg_mask; + args.event_callback = LOC_API_CB_ID; + loc_api_saved_cb = event_callback; + + rpc_loc_open_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (rpc_loc_client_handle_type) rets.loc_open_result; +} + +int32 loc_close(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_close_args args; + args.handle = handle; + + rpc_loc_close_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_close_result; +} + +int32 loc_start_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_start_fix_args args; + args.handle = handle; + + rpc_loc_start_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_start_fix_result; +} + +int32 loc_stop_fix(rpc_loc_client_handle_type handle) +{ + LOC_GLUE_CHECK_INIT(int32); + + rpc_loc_stop_fix_args args; + args.handle = handle; + + rpc_loc_stop_fix_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_stop_fix_result; +} + +int32 loc_ioctl( + rpc_loc_client_handle_type handle, + rpc_loc_ioctl_e_type ioctl_type, + rpc_loc_ioctl_data_u_type* ioctl_data + ) +{ + LOC_GLUE_CHECK_INIT(int32); + + 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: + case RPC_LOC_IOCTL_SET_FIX_CRITERIA: + case RPC_LOC_IOCTL_GET_FIX_CRITERIA: + case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: + case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: + case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: + case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: + case RPC_LOC_IOCTL_INJECT_UTC_TIME: + case RPC_LOC_IOCTL_INJECT_RTC_VALUE: + case RPC_LOC_IOCTL_INJECT_POSITION: + case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: + case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: + case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: + case RPC_LOC_IOCTL_SET_ENGINE_LOCK: + case RPC_LOC_IOCTL_GET_ENGINE_LOCK: + case RPC_LOC_IOCTL_SET_SBAS_CONFIG: + case RPC_LOC_IOCTL_GET_SBAS_CONFIG: + case RPC_LOC_IOCTL_SET_NMEA_TYPES: + 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: + 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: + break; + case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: + case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: + case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: + case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: + default: + break; + } /* switch */ + } /* ioctl_data != NULL */ + + rpc_loc_ioctl_rets rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets.loc_ioctl_result; +} + +/* Returns 0 if error */ +int32 loc_api_null(void) +{ + LOC_GLUE_CHECK_INIT(int32); + + int32 rets; + enum clnt_stat stat = RPC_SUCCESS; + + stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); + LOC_GLUE_CHECK_RESULT(stat, int32); + + return (int32) rets; +} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c new file mode 100644 index 00000000..835f6b18 --- /dev/null +++ b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c @@ -0,0 +1,171 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#include "loc_api.h" + +bool_t +xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + if (!xdr_rpc_uint32 (xdrs, objp)) + return FALSE; + return TRUE; +} + +bool_t +xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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) +{ + register int32_t *buf; + + 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h new file mode 100644 index 00000000..e02648cc --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api.h @@ -0,0 +1,210 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00040001(); +extern bool_t rpc_loc_api_null_0x00040001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00040001(); +extern bool_t rpc_loc_open_0x00040001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00040001(); +extern bool_t rpc_loc_close_0x00040001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00040001(); +extern bool_t rpc_loc_start_fix_0x00040001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); +extern bool_t rpc_loc_stop_fix_0x00040001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00040001(); +extern bool_t rpc_loc_ioctl_0x00040001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); +extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); +extern int loc_apiprog_0x00040001_freeresult (); +#endif /* K&R C */ +#define LOC_APIVERS_0002 0x00040002 + +#if defined(__STDC__) || defined(__cplusplus) +extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); +extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +extern enum clnt_stat rpc_loc_api_null_0x00040002(); +extern bool_t rpc_loc_api_null_0x00040002_svc(); +extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h new file mode 100644 index 00000000..67ac0846 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_CB_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00040002 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00040001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00040001_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_0x00040001(); +extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); +extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h new file mode 100644 index 00000000..6ff3baf1 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h @@ -0,0 +1,1154 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_COMMON_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOC_API_TOOLVERS 0x00040024 +#define LOC_API_FEATURES 0x00000001 +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 +#define RPC_LOC_OPEN_VERSION 0x00040001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 +#define RPC_LOC_API_NULL_VERSION 0x00040001 +#define RPC_LOC_STOP_FIX_VERSION 0x00040001 +#define RPC_LOC_IOCTL_VERSION 0x00040001 +#define RPC_LOC_START_FIX_VERSION 0x00040001 +#define RPC_LOC_CLOSE_VERSION 0x00040001 +#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 +#define RPC_LOC_API_API_MAJOR_NUM 0x0004 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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[1200]; +}; +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_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_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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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_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_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_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; + +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; + +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_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_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_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_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h new file mode 100644 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h new file mode 100644 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h new file mode 100644 index 00000000..8998aca4 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api.h @@ -0,0 +1,198 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_H_RPCGEN +#define _LOC_API_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APIPROG 0x3000008c +#define LOC_APIVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); +extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); +extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); +extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); +extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); +extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); +extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); +extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define rpc_loc_api_null 0 +extern enum clnt_stat rpc_loc_api_null_0x00010001(); +extern bool_t rpc_loc_api_null_0x00010001_svc(); +#define rpc_loc_api_rpc_glue_code_info_remote 1 +extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); +extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); +#define rpc_loc_open 2 +extern enum clnt_stat rpc_loc_open_0x00010001(); +extern bool_t rpc_loc_open_0x00010001_svc(); +#define rpc_loc_close 3 +extern enum clnt_stat rpc_loc_close_0x00010001(); +extern bool_t rpc_loc_close_0x00010001_svc(); +#define rpc_loc_start_fix 4 +extern enum clnt_stat rpc_loc_start_fix_0x00010001(); +extern bool_t rpc_loc_start_fix_0x00010001_svc(); +#define rpc_loc_stop_fix 5 +extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); +extern bool_t rpc_loc_stop_fix_0x00010001_svc(); +#define rpc_loc_ioctl 6 +extern enum clnt_stat rpc_loc_ioctl_0x00010001(); +extern bool_t rpc_loc_ioctl_0x00010001_svc(); +#define rpc_loc_api_api_versions 0xFFFFFFFF +extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); +extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); +extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h new file mode 100644 index 00000000..4f2f8f91 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h @@ -0,0 +1,64 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_CB_H_RPCGEN +#define _LOC_API_CB_H_RPCGEN + +#include + +#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 0x00010001 + +#define LOC_APICBPROG 0x3100008c +#define LOC_APICBVERS_0001 0x00010001 + +#if defined(__STDC__) || defined(__cplusplus) +#define rpc_loc_event_cb_f_type 1 +extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); +extern int loc_apicbprog_0x00010001_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_0x00010001(); +extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); +extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h new file mode 100644 index 00000000..04be079f --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h @@ -0,0 +1,1031 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _LOC_API_COMMON_H_RPCGEN +#define _LOC_API_COMMON_H_RPCGEN + +#include +#include "loc_api_fixup.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 +#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 +#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 +#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 +#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 +#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 +#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 +#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 +#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 +#define RPC_LOC_OPEN_VERSION 0x00010001 +#define RPC_LOC_CLOSE_VERSION 0x00010001 +#define RPC_LOC_START_FIX_VERSION 0x00010001 +#define RPC_LOC_STOP_FIX_VERSION 0x00010001 +#define RPC_LOC_IOCTL_VERSION 0x00010001 +#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 +#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 +#define RPC_LOC_API_API_MAJOR_NUM 0x0001 + +typedef bool_t rpc_boolean; + +typedef u_long rpc_uint32; + +typedef u_short rpc_uint16; + +typedef u_char rpc_uint8; + +typedef long rpc_int32; + +typedef u_char rpc_byte; + +typedef u_quad_t rpc_uint64; + +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; + struct { + u_int nmea_sentences_len; + char *nmea_sentences_val; + } nmea_sentences; +}; +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_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; + +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_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_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; + struct { + u_int addr_len; + char *addr_val; + } addr; +}; +typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; + struct { + u_int requestor_id_string_len; + char *requestor_id_string_val; + } requestor_id_string; + 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; + struct { + u_int client_name_string_len; + char *client_name_string_val; + } client_name_string; + 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; + u_char 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; + struct { + u_int ext_client_address_len; + char *ext_client_address_val; + } ext_client_address; +}; +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; + struct { + u_int lcs_codeword_string_len; + char *lcs_codeword_string_val; + } lcs_codeword_string; + 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; + struct { + u_int notification_text_len; + char *notification_text_val; + } notification_text; + 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; + +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_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_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_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_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_request_e_type { + RPC_LOC_SERVER_REQUEST_OPEN = 1, + RPC_LOC_SERVER_REQUEST_CLOSE = 2, + 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_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_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; + +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_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_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_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_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; +}; +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; + +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; +}; +typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; + +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_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_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_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_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; +#define RPC_LOC_API_NULL_VERSION 0x00010001 +#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); +extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); +extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); +extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); +extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); +extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); +extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); +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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); +extern bool_t xdr_rpc_uint32 (); +extern bool_t xdr_rpc_uint16 (); +extern bool_t xdr_rpc_uint8 (); +extern bool_t xdr_rpc_int32 (); +extern bool_t xdr_rpc_byte (); +extern bool_t xdr_rpc_uint64 (); +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_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_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_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_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_request_e_type (); +extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h new file mode 100644 index 00000000..e62eb367 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h @@ -0,0 +1,188 @@ +/****************************************************************************** + @file: loc_api_fixup.h + @brief: Loc API Android RPC amendment header + + DESCRIPTION + Loc API Android RPC amendment header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure +#define RPC_LOC_API_RPC_FAILURE (-1234) + +#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_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 + +/* 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 + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h new file mode 100644 index 00000000..92d4e150 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h @@ -0,0 +1,34 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h new file mode 100644 index 00000000..a71b23a0 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc/debug.h @@ -0,0 +1,57 @@ +/* +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" +#include + +#define PRINT(x...) do { \ + fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ + fprintf(stdout, ##x); \ + LOGD(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); \ + LOGE(x); \ + } while(0) + +#define FAILIF(cond, msg...) do { \ + if (__builtin_expect (cond, 0)) { \ + fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ + fprintf(stderr, ##msg); \ + LOGE(##msg); \ + } \ + } while(0) + +#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h new file mode 100644 index 00000000..ef972bd6 --- /dev/null +++ b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h @@ -0,0 +1,100 @@ +/****************************************************************************** + @file: loc_api_rpc_glue.h + @brief: Loc API Android glue code header + + DESCRIPTION + Loc API Android glue code header + + INITIALIZATION AND SEQUENCING REQUIREMENTS + + ----------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + ----------------------------------------------------------------------------- + ******************************************************************************/ + +/*===================================================================== + EDIT HISTORY FOR MODULE + + This section contains comments describing changes made to the module. + Notice that changes are listed in reverse chronological order. + +when who what, where, why +-------- --- ------------------------------------------------------- +03/17/09 dx Initial version + +$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ +======================================================================*/ + +#ifndef LOC_API_RPC_GLUE_H +#define LOC_API_RPC_GLUE_H + +/* Include RPC headers */ +#include "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "loc_api_fixup.h" + +#ifdef __cplusplus +extern "C" +{ +#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 + +extern int loc_api_glue_init(void); +extern int loc_api_null(void); + +typedef int32 (loc_event_cb_f_type)( + 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 */ +); + +extern rpc_loc_client_handle_type loc_open( + rpc_loc_event_mask_type event_reg_mask, + loc_event_cb_f_type *event_callback +); + +extern int32 loc_close +( + 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 +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c new file mode 100644 index 00000000..7fcfd6cb --- /dev/null +++ b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c @@ -0,0 +1,61 @@ +/* ------------------------------------------------------------------------------- +Copyright (c) 2009, QUALCOMM USA, INC. + +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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" +#include "loc_api.h" +#include "loc_api_cb.h" +#include "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; + } + xprt_unregister(svrPort); + svc_destroy(svrPort); + //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); + svrPort = NULL; +} diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 62905e8c..a1488a02 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -41,8 +41,7 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - hardware/qcom/gps/loc_api/libloc_api_50001 \ - $(TARGET_OUT_HEADERS)/libflp + hardware/qcom/gps/loc_api/libloc_api_50001 LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -77,9 +76,6 @@ LOCAL_SHARED_LIBRARIES := \ libgps.utils \ libdl -ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) -endif - LOCAL_SRC_FILES += \ loc.cpp \ gps.c @@ -95,11 +91,10 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libflp + $(TARGET_OUT_HEADERS)/libloc_core LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1d1a59ed..0b17b2c3 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -29,17 +29,10 @@ #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) : @@ -62,22 +55,17 @@ void LocInternalAdapter::getZppInt() { LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - LocThread::tCreate tCreator) : + MsgTask::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) + LocDualContext::mLocationHalName) :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mSupportsAgpsRequests(false), - mSupportsPositionInjection(false), - mSupportsTimeInjection(false), - mPowerVote(0) + mAgpsEnabled(false), mCPIEnabled(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -91,173 +79,6 @@ LocEngAdapter::~LocEngAdapter() 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 - size_t len = strlen(buf); - while (--len >= 0 && isspace(buf[len])) { - buf[len] = '\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; @@ -302,48 +123,6 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) 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); - } - - delete mUlp; - mUlp = ulp; -} - void LocInternalAdapter::reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, @@ -378,14 +157,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, +void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GnssSvStatus &svStatus, +void LocEngAdapter::reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { @@ -431,84 +210,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1, const char* url3, const int maxlength) { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { sendMsg(new LocEngReportXtraServer(mOwner, url1, url2, url3, maxlength)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { sendMsg(new LocEngRequestATL(mOwner, connHandle, agps_type)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::releaseATL(int connHandle) { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { sendMsg(new LocEngReleaseATL(mOwner, connHandle)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::requestXtraData() { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { sendMsg(new LocEngRequestXtra(mOwner)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::requestTime() { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { sendMsg(new LocEngRequestTime(mOwner)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) { - if (mSupportsAgpsRequests) { + if (mAgpsEnabled) { notif.size = sizeof(notif); notif.timeout = LOC_NI_NO_RESPONSE_TIME; sendMsg(new LocEngRequestNi(mOwner, notif, data)); } - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::requestSuplES(int connHandle) { - if (mSupportsAgpsRequests) + if (mAgpsEnabled) sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::reportDataCallOpened() { - if(mSupportsAgpsRequests) + if(mAgpsEnabled) sendMsg(new LocEngSuplEsOpened(mOwner)); - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline bool LocEngAdapter::reportDataCallClosed() { - if(mSupportsAgpsRequests) + if(mAgpsEnabled) sendMsg(new LocEngSuplEsClosed(mOwner)); - return mSupportsAgpsRequests; + return mAgpsEnabled; } inline @@ -522,80 +301,3 @@ 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); - } else { - mSupportsTimeInjection = true; - } - 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::reportGpsMeasurementData(GpsData &gpsMeasurementData) -{ - sendMsg(new LocEngReportGpsMeasurement(mOwner, - gpsMeasurementData)); -} - -/* - Update Registration Mask - */ -void LocEngAdapter::updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) -{ - LOC_LOGD("entering %s", __func__); - int result = LOC_API_ADAPTER_ERR_FAILURE; - result = mLocApi->updateRegistrationMask(event, isEnabled); - if (result == LOC_API_ADAPTER_ERR_SUCCESS) { - LOC_LOGD("%s] update registration mask succeed.", __func__); - } else { - LOC_LOGE("%s] update registration mask failed.", __func__); - } -} - -/* - Set Gnss Constellation Config - */ -bool LocEngAdapter::gnssConstellationConfig() -{ - LOC_LOGD("entering %s", __func__); - bool result = false; - result = mLocApi->gnssConstellationConfig(); - return result; -} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 72b780d1..ea04f077 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -54,7 +54,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -73,37 +73,25 @@ class LocEngAdapter : public LocAdapterBase { 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; public: - bool mSupportsAgpsRequests; - bool mSupportsPositionInjection; - bool mSupportsTimeInjection; + bool mAgpsEnabled; + bool mCPIEnabled; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, ContextBase* context, - LocThread::tCreate tCreator); + void* owner,ContextBase* context, + MsgTask::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 hasAgpsExt() { return mContext->hasAgpsExt(); } + inline bool hasCPIExt() { return mContext->hasCPIExt(); } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err @@ -136,6 +124,11 @@ public: { return mLocApi->injectPosition(latitude, longitude, accuracy); } + inline enum loc_api_adapter_err + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) + { + return mLocApi->setTime(time, timeReference, uncertainty); + } inline enum loc_api_adapter_err setXtraData(char* data, int length) { @@ -191,9 +184,9 @@ public: return mLocApi->setLPPConfig(profile); } inline enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider) + setSensorControlConfig(int sensorUsage) { - return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider); + return mLocApi->setSensorControlConfig(sensorUsage); } inline enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, @@ -249,18 +242,9 @@ public: 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); + return mLocApi->getZppFix(zppLoc, tech_mask); } + virtual void handleEngineDownEvent(); virtual void handleEngineUpEvent(); virtual void reportPosition(UlpLocation &location, @@ -268,7 +252,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -283,7 +267,6 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); inline const LocPosMode& getPositionMode() const {return mFixCriteria;} @@ -291,40 +274,16 @@ public: { 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) + inline int setGpsLock(unsigned int lock) { return mLocApi->setGpsLock(lock); } - - int setGpsLockMsg(LOC_GPS_LOCK_MASK lock); - /* Returns Current value of GPS lock on success @@ -334,17 +293,6 @@ public: { return mLocApi->getGpsLock(); } - - /* - Update Registration Mask - */ - void updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled); - - /* - Set Gnss Constellation Config - */ - bool gnssConstellationConfig(); }; #endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index 29f20f42..46596aa4 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2015 The Linux Foundation. All rights reserved. +/* 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 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 7411dc5a..83249f40 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -47,8 +47,6 @@ 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; @@ -70,6 +68,7 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re 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 = { @@ -91,7 +90,6 @@ 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 = { @@ -100,8 +98,7 @@ static const AGpsInterface sLocEngAGpsInterface = loc_agps_open, loc_agps_closed, loc_agps_open_failed, - loc_agps_set_server, - loc_agps_open_with_apniptype + loc_agps_set_server }; static int loc_xtra_init(GpsXtraCallbacks* callbacks); @@ -117,23 +114,13 @@ static const GpsXtraInterface sLocEngXTRAInterface = static void loc_ni_init(GpsNiCallbacks *callbacks); static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); -static const GpsNiInterface sLocEngNiInterface = +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); @@ -152,29 +139,9 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = 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 @@ -227,11 +194,10 @@ extern "C" const GpsInterface* get_gps_interface() target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - sGnssType = getTargetGnssType(target); - switch (sGnssType) + int gnssType = getTargetGnssType(target); + switch (gnssType) { case GNSS_GSS: - case GNSS_AUTO: //APQ8064 gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); @@ -304,31 +270,16 @@ static int loc_init(GpsCallbacks* callbacks) 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->request_utc_time_cb /* request_utc_time_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->setGpsLockMsg(0); - loc_afw_data.adapter->requestUlp(getCarrierCapabilities()); - loc_afw_data.adapter->setXtraUserAgent(); + loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); + loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); + loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); - 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; } @@ -352,14 +303,19 @@ SIDE EFFECTS 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; +/* + if (gss_fd >= 0) + { + close(gss_fd); + gss_fd = -1; + LOC_LOGD("GSS shutdown.\n"); + } +*/ + EXIT_LOG(%s, VOID_RET); } @@ -506,11 +462,33 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { + static bool initialized = false; + static bool enable_cpi = true; + accuracy = 1000; ENTRY_LOG(); - int ret_val = 0; - ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + if(!initialized) + { + char value[PROPERTY_VALUE_MAX]; + memset(value, 0, sizeof(value)); + (void)platform_lib_abstraction_property_get("persist.gps.qc_nlp_in_use", value, "0"); + if(0 == strcmp(value, "1")) + { + enable_cpi = false; + LOC_LOGI("GPS HAL coarse position injection disabled"); + } + else + { + LOC_LOGI("GPS HAL coarse position injection enabled"); + } + initialized = true; + } + int ret_val = 0; + if(enable_cpi) + { + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + } EXIT_LOG(%d, ret_val); return ret_val; } @@ -566,7 +544,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL || NULL == get_gps_geofence_interface) { + if ((error = dlerror()) != NULL) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } @@ -626,18 +604,6 @@ const void* loc_get_extension(const char* name) 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"); @@ -697,50 +663,6 @@ static int loc_agps_open(const char* apn) 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_INVALID; - 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 @@ -853,10 +775,7 @@ SIDE EFFECTS 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); + int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); EXIT_LOG(%d, ret_val); return ret_val; @@ -892,56 +811,6 @@ static int loc_xtra_inject_data(char* data, int length) 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 @@ -1019,40 +888,6 @@ static void loc_agps_ril_update_network_availability(int available, const char* 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(); @@ -1075,4 +910,3 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) } EXIT_LOG(%s, VOID_RET); } - diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 41b968c4..8f41659a 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. +/* 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index de72aa8d..19c54a0f 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -87,27 +87,13 @@ loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ -static const loc_param_s_type gps_conf_table[] = +static loc_param_s_type loc_parameter_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'}, - {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, - {"SUPL_MODE", &gps_conf.SUPL_MODE, 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'}, + {"SUPL_VER", &gps_conf.SUPL_VER, 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'}, -}; - -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'}, @@ -124,29 +110,23 @@ static const loc_param_s_type sap_conf_table[] = {"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'} + {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, + {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, 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'} }; static void loc_default_parameters(void) { - /*Defaults for gps.conf*/ + /* defaults */ 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.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; - /*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; @@ -159,22 +139,25 @@ static void loc_default_parameters(void) 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; + /* 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; } // 2nd half of init(), singled out for @@ -198,6 +181,7 @@ 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); @@ -216,6 +200,7 @@ static void* noProc(void* data) return NULL; } + /********************************************************************* * definitions of the static messages used in the file *********************************************************************/ @@ -336,6 +321,7 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } +// case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; const GpsUtcTime mTime; @@ -484,24 +470,6 @@ struct LocEngSuplVer : public LocMsg { } }; -struct LocEngSuplMode : public LocMsg { - UlpProxyBase* mUlp; - - inline LocEngSuplMode(UlpProxyBase* ulp) : - LocMsg(), mUlp(ulp) - { - locallog(); - } - inline virtual void proc() const { - mUlp->setCapabilities(getCarrierCapabilities()); - } - inline void locallog() const { - } - inline virtual void log() const { - locallog(); - } -}; - // case LOC_ENG_MSG_LPP_CONFIG: struct LocEngLppConfig : public LocMsg { LocEngAdapter* mAdapter; @@ -527,20 +495,18 @@ struct LocEngLppConfig : public LocMsg { 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) + int sensorsDisabled) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) { locallog(); } inline virtual void proc() const { - mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider); + mAdapter->setSensorControlConfig(mSensorsDisabled); } inline void locallog() const { - LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d", - mSensorsDisabled, mSensorProvider); + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", + mSensorsDisabled); } inline virtual void log() const { locallog(); @@ -784,13 +750,8 @@ void LocEngReportPosition::proc() const { 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()) + mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); @@ -809,7 +770,16 @@ void LocEngReportPosition::proc() const { } } void LocEngReportPosition::locallog() const { - LOC_LOGV("LocEngReportPosition"); + 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", + mLocation.gpsLocation.flags, mLocation.position_source, + mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, + mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, + mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, + mLocation.gpsLocation.timestamp, mLocation.rawDataSize, + mLocation.rawData, mStatus, mTechMask); } void LocEngReportPosition::log() const { locallog(); @@ -821,7 +791,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + GpsSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), @@ -850,7 +820,19 @@ void LocEngReportSv::proc() const { } } void LocEngReportSv::locallog() const { - LOC_LOGV("%s:%d] LocEngReportSv",__func__, __LINE__); + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " + "used in fix mask: %x\n sv: prn snr " + "elevation azimuth", + mSvStatus.num_svs, mSvStatus.ephemeris_mask, + mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); + for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + mSvStatus.sv_list[i].prn, + mSvStatus.sv_list[i].snr, + mSvStatus.sv_list[i].elevation, + mSvStatus.sv_list[i].azimuth); + } } inline void LocEngReportSv::log() const { locallog(); @@ -1087,17 +1069,7 @@ void LocEngRequestSuplEs::proc() const { 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 { + } else { locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1); } } @@ -1343,33 +1315,6 @@ struct LocEngEnableData : public LocMsg { // 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(); - } -}; - // case LOC_ENG_MSG_LOC_INIT: struct LocEngInit : public LocMsg { loc_eng_data_s_type* mLocEng; @@ -1380,8 +1325,6 @@ struct LocEngInit : public LocMsg { } inline virtual void proc() const { loc_eng_reinit(*mLocEng); - // set the capabilities - mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng)); } inline void locallog() const { @@ -1424,7 +1367,7 @@ struct LocEngAtlOpenSuccess : public LocMsg { mStateMachine->onRsrcEvent(RSRC_GRANTED); } inline void locallog() const { - LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n" + LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" " bearer type: %s", loc_get_agps_type_name(mStateMachine->getType()), mAPN, @@ -1525,144 +1468,6 @@ struct LocEngDataClientInit : public LocMsg { } }; -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 LocEngUpdateRegistrationMask : public LocMsg { - loc_eng_data_s_type* mLocEng; - LOC_API_ADAPTER_EVENT_MASK_T mMask; - loc_registration_mask_status mIsEnabled; - inline LocEngUpdateRegistrationMask(loc_eng_data_s_type* locEng, - LOC_API_ADAPTER_EVENT_MASK_T mask, - loc_registration_mask_status isEnabled) : - LocMsg(), mLocEng(locEng), mMask(mask), mIsEnabled(isEnabled) { - locallog(); - } - inline virtual void proc() const { - loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; - locEng->adapter->updateRegistrationMask(mMask, - mIsEnabled); - } - void locallog() const { - LOC_LOGV("LocEngUpdateRegistrationMask\n"); - } - virtual void log() const { - locallog(); - } -}; - -struct LocEngGnssConstellationConfig : public LocMsg { - LocEngAdapter* mAdapter; - inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) { - locallog(); - } - inline virtual void proc() const { - if (mAdapter->gnssConstellationConfig()) { - LOC_LOGV("Modem supports GNSS measurements\n"); - gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS; - } else { - 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: -LocEngReportGpsMeasurement::LocEngReportGpsMeasurement(void* locEng, - GpsData &gpsData) : - LocMsg(), mLocEng(locEng), mGpsData(gpsData) -{ - locallog(); -} -void LocEngReportGpsMeasurement::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->gps_measurement_cb != NULL) { - locEng->gps_measurement_cb((GpsData*)&(mGpsData)); - } - } -} -void LocEngReportGpsMeasurement::locallog() const { - IF_LOC_LOGV { - LOC_LOGV("%s:%d]: Received in GPS HAL." - "GNSS Measurements count: %d \n", - __func__, __LINE__, mGpsData.measurement_count); - for (int i =0; i< mGpsData.measurement_count && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" GNSS measurement data in GPS HAL: \n" - " GPS_HAL => Measurement ID | prn | time_offset_ns | state |" - " received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |" - " pseudorange_rate_uncertainty_mps |" - " accumulated_delta_range_state | flags \n" - " GPS_HAL => %d | %d | %f | %d | %lld | %f | %f | %f | %d | %d \n", - i, - mGpsData.measurements[i].prn, - mGpsData.measurements[i].time_offset_ns, - mGpsData.measurements[i].state, - mGpsData.measurements[i].received_gps_tow_ns, - mGpsData.measurements[i].c_n0_dbhz, - mGpsData.measurements[i].pseudorange_rate_mps, - mGpsData.measurements[i].pseudorange_rate_uncertainty_mps, - mGpsData.measurements[i].accumulated_delta_range_state, - mGpsData.measurements[i].flags); - } - LOC_LOGV(" GPS_HAL => Clocks Info: type | time_ns \n" - " GPS_HAL => Clocks Info: %d | %lld", mGpsData.clock.type, - mGpsData.clock.time_ns); - } -} -inline void LocEngReportGpsMeasurement::log() const { - locallog(); -} /********************************************************************* * Initialization checking macros @@ -1677,24 +1482,6 @@ inline void LocEngReportGpsMeasurement::log() const { } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) -uint32_t getCarrierCapabilities() { - #define carrierMSA (uint32_t)0x2 - #define carrierMSB (uint32_t)0x1 - #define gpsConfMSA (uint32_t)0x4 - #define gpsConfMSB (uint32_t)0x2 - uint32_t capabilities = gps_conf.CAPABILITIES; - if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { - capabilities &= ~gpsConfMSA; - } - if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { - capabilities &= ~gpsConfMSB; - } - - LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", - gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities); - return capabilities; -} - /*=========================================================================== FUNCTION loc_eng_init @@ -1731,12 +1518,15 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + // 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; @@ -1745,6 +1535,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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; @@ -1762,7 +1553,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, context, - (LocThread::tCreate)callbacks->create_thread_cb); + (MsgTask::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); @@ -1776,51 +1567,51 @@ 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)); + if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { + LOC_LOGD("loc_eng_reinit reinit() successful"); - /* 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)); + LocEngAdapter* adapter = loc_eng_data.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)); + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + + /* 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))); } - 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; } @@ -1920,11 +1711,10 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) 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) + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { loc_eng_data.adapter->setInSession(TRUE); + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -1970,6 +1760,11 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { ret_val = loc_eng_data.adapter->stopFix(); + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) + { + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); + } + loc_eng_data.adapter->setInSession(FALSE); } @@ -2022,12 +1817,14 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, 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)) { + int gnssType = getTargetGnssType(loc_get_target()); + + // The position mode for GSS/QCA1530 can only be standalone + bool is1530 = gnssType == GNSS_QCA1530; + bool isAPQ = gnssType == GNSS_GSS; + if ((isAPQ || is1530) && 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."); + LOC_LOGD("Position mode changed to standalone for target with GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -2093,7 +1890,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if(adapter->mSupportsPositionInjection) + if(!adapter->mCPIEnabled) { adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, accuracy)); @@ -2299,17 +2096,18 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { + int gnssType = getTargetGnssType(loc_get_target()); + bool isAPQ = (gnssType == GNSS_GSS); + bool is1530 = (gnssType == GNSS_QCA1530); + if (!isAPQ && !is1530) { loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, false); - if (adapter->mSupportsAgpsRequests) { - if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - } + if (adapter->mAgpsEnabled) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); } @@ -2341,9 +2139,7 @@ getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { break; } case AGPS_TYPE_SUPL_ES: { - locEng.ds_nif ? - stateMachine = locEng.ds_nif: - stateMachine = locEng.agnss_nif; + stateMachine = locEng.ds_nif; break; } default: @@ -2523,14 +2319,7 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, 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); - } + unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); if (sizeof(url) > len) { adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); @@ -2580,29 +2369,29 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, 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); + } else { + LOC_LOGW("set_server called before init. 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); + } } EXIT_LOG(%d, ret_val); @@ -2649,93 +2438,6 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d 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->getUlpProxy())); - } - } - - 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.GPS_LOCK = gps_conf.GPS_LOCK; - gps_conf = gps_conf_tmp; - } - - EXIT_LOG(%s, VOID_RET); -} - /*=========================================================================== FUNCTION loc_eng_report_status @@ -2835,8 +2537,6 @@ 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(); @@ -2846,11 +2546,14 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_agps_reinit(loc_eng_data); } + loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); + // 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->setPositionMode(NULL); loc_eng_data.adapter->setInSession(false); - loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); + loc_eng_start_handler(loc_eng_data); } EXIT_LOG(%s, VOID_RET); } @@ -2880,8 +2583,8 @@ int loc_eng_read_config(void) 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); + UTIL_READ_CONF(GPS_CONF_FILE, loc_parameter_table); + UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table); configAlreadyRead = true; } else { LOC_LOGV("GPS Config file has already been read\n"); @@ -2890,80 +2593,3 @@ int loc_eng_read_config(void) 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.gps_measurement_cb), - "gps 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->sendMsg(new LocEngUpdateRegistrationMask( - &loc_eng_data, - event, - LOC_REGISTRATION_MASK_ENABLED)); - // set up the callback - loc_eng_data.gps_measurement_cb = callbacks->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->sendMsg(new LocEngUpdateRegistrationMask( - &loc_eng_data, - event, - LOC_REGISTRATION_MASK_DISABLED)); - // set up the callback - loc_eng_data.gps_measurement_cb = NULL; - EXIT_LOG(%d, 0); -} diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 92814f8d..c1dc8af5 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -89,11 +89,9 @@ typedef struct loc_eng_data_s agps_status_extended agps_status_cb; gps_nmea_callback nmea_cb; gps_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; - gps_measurement_callback gps_measurement_cb; boolean intermediateFix; AGpsStatusValue agps_status; loc_eng_xtra_data_s_type xtra_module_data; @@ -139,50 +137,36 @@ typedef struct loc_eng_data_s } loc_eng_data_s_type; /* 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 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; + unsigned long INTERMEDIATE_POS; + unsigned long ACCURACY_THRES; + unsigned long SUPL_VER; + unsigned long CAPABILITIES; + unsigned long QUIPC_ENABLED; + unsigned long LPP_PROFILE; + uint8_t NMEA_PROVIDER; + unsigned long A_GLONASS_POS_PROTOCOL_SELECT; + 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]; } 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; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; + unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; + unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; + unsigned long SENSOR_CONTROL_MODE; + unsigned long SENSOR_USAGE; + unsigned long 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; @@ -191,16 +175,11 @@ typedef struct 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; extern loc_gps_cfg_s_type gps_conf; extern loc_sap_cfg_s_type sap_conf; - -uint32_t getCarrierCapabilities(); - -//loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LOC_API_ADAPTER_EVENT_MASK_T event, @@ -220,33 +199,35 @@ 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); + +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); + + 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, + +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length); + + +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); + +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 +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); + 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, @@ -255,12 +236,7 @@ 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); +int loc_eng_read_config(void); #ifdef __cplusplus } diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 43af70fe..cf9fe82d 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -761,11 +761,11 @@ int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; - memset(&nifRequest.addr, 0, sizeof(nifRequest.addr)); + nifRequest.ipv6_addr[0] = 0; nifRequest.ssid[0] = '\0'; nifRequest.password[0] = '\0'; } else { - s->setIPAddresses(nifRequest.addr); + s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); s->setWifiInfo(nifRequest.ssid, nifRequest.password); } diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 8b8f9f44..d68970f3 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -280,7 +280,6 @@ struct Subscriber { 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; } @@ -321,9 +320,6 @@ struct BITSubscriber : public Subscriber { 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); @@ -348,9 +344,6 @@ struct ATLSubscriber : public Subscriber { 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, @@ -383,9 +376,6 @@ struct WIFISubscriber : public Subscriber { 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) @@ -419,8 +409,6 @@ struct DSSubscriber : public Subscriber { 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); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index 5510fc5c..d24e0c9d 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -136,7 +136,7 @@ static int loc_api_server_proc(void *context) free(p_cmsgbuf); LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); usleep(1000); - return -1; + return 0; } LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h index 1d8c1428..c7c100b2 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. +/* 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 @@ -33,11 +33,11 @@ #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" +#define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" #else diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 3a1a86b9..9a8b0e4d 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GnssSvStatus mSvStatus; + const GpsSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + GpsSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; @@ -289,16 +289,6 @@ struct LocEngGetZpp : public LocMsg { void send() const; }; -struct LocEngReportGpsMeasurement : public LocMsg { - void* mLocEng; - const GpsData mGpsData; - LocEngReportGpsMeasurement(void* locEng, - GpsData &gpsData); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 3b20bbbc..cc894481 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -115,45 +115,28 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, 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 busy, use default or deny */ + if (NULL != loc_eng_ni_data_p->rawRequest) + { + /* XXX Consider sending a NO RESPONSE reply or queue the request */ + LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); } } - - - if (pSession) { + else { /* Save request */ - pSession->rawRequest = (void*)passThrough; - pSession->reqID = ++loc_eng_ni_data_p->reqIDCounter; - pSession->adapter = loc_eng_data.adapter; + loc_eng_ni_data_p->rawRequest = (void*)passThrough; /* Fill in notification */ - ((GpsNiNotification*)notif)->notification_id = pSession->reqID; + ((GpsNiNotification*)notif)->notification_id = loc_eng_ni_data_p->reqID; if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) { @@ -172,16 +155,16 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, /* 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); + loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); int rc = 0; - rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession); + rc = pthread_create(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); if (rc) { LOC_LOGE("Loc NI thread is not created.\n"); } - rc = pthread_detach(pSession->thread); + rc = pthread_detach(loc_eng_ni_data_p->thread); if (rc) { LOC_LOGE("Loc NI thread is not detached.\n"); @@ -202,63 +185,61 @@ static void* ni_thread_proc(void *args) { ENTRY_LOG(); - loc_eng_ni_session_s_type* pSession = (loc_eng_ni_session_s_type*)args; + loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; 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); + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); /* Calculate absolute expire time */ gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; + expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->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 ); + (long) expire_time.tv_sec, loc_eng_ni_data_p->respTimeLeft ); - while (!pSession->respRecvd) + while (!loc_eng_ni_data_p->respRecvd) { - rc = pthread_cond_timedwait(&pSession->tCond, - &pSession->tLock, + rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, + &loc_eng_ni_data_p->tLock, &expire_time); if (rc == ETIMEDOUT) { - pSession->resp = GPS_NI_RESPONSE_NORESP; + loc_eng_ni_data_p->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); + loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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; + LocEngAdapter* adapter = loc_eng_data_p->adapter; LocEngInformNiResponse *msg = NULL; - if (NULL != pSession->rawRequest) { - if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); + if (NULL != loc_eng_ni_data_p->rawRequest) { + if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n"); msg = new LocEngInformNiResponse(adapter, - pSession->resp, - pSession->rawRequest); + loc_eng_ni_data_p->resp, + loc_eng_ni_data_p->rawRequest); } else { LOC_LOGD("this is the ignore reply for SUPL ES\n"); - free(pSession->rawRequest); } - pSession->rawRequest = NULL; + loc_eng_ni_data_p->rawRequest = NULL; } - pthread_mutex_unlock(&pSession->tLock); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); - pSession->respTimeLeft = 0; - pSession->reqID = 0; + loc_eng_ni_data_p->respTimeLeft = 0; + loc_eng_ni_data_p->reqID++; if (NULL != msg) { LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); @@ -280,28 +261,16 @@ void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data) } // 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; + if (NULL != loc_eng_ni_data_p->rawRequest) { + free(loc_eng_ni_data_p->rawRequest); + loc_eng_ni_data_p->rawRequest = NULL; - pthread_mutex_lock(&loc_eng_ni_data_p->sessionEs.tLock); + pthread_mutex_lock(&loc_eng_ni_data_p->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); + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); } EXIT_LOG(%s, VOID_RET); @@ -335,19 +304,12 @@ void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callb 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_ni_data_p->respTimeLeft = 0; + loc_eng_ni_data_p->respRecvd = FALSE; + loc_eng_ni_data_p->rawRequest = NULL; + loc_eng_ni_data_p->reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->tLock, NULL); loc_eng_data.ni_notify_cb = callbacks->notify_cb; EXIT_LOG(%s, VOID_RET); @@ -375,40 +337,25 @@ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, { 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) { + if (notif_id == loc_eng_ni_data_p->reqID && + NULL != loc_eng_ni_data_p->rawRequest) + { 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); + pthread_mutex_lock(&loc_eng_ni_data_p->tLock); + loc_eng_ni_data_p->resp = user_response; + loc_eng_ni_data_p->respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); } else { - LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id); + LOC_LOGE("loc_eng_ni_respond: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", + loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 068f5cdd..8c076041 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -31,7 +31,6 @@ #define LOC_ENG_NI_H #include -#include #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ #define LOC_NI_NOTIF_KEY_ADDRESS "Address" @@ -46,13 +45,6 @@ typedef struct { 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; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 2a23db32..6c9356e4 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -119,17 +119,13 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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; + time_t utcTime(location.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); 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; @@ -605,7 +601,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -791,24 +787,46 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; + if (svStatus.used_in_fix_mask == 0) + { // No sv used, so there will be no position report, so send + // blank NMEA sentences + 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); - // 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; + 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); } else - { - loc_eng_data_p->pdop = 0; - loc_eng_data_p->hdop = 0; - loc_eng_data_p->vdop = 0; + { // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; + + // 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/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 066943aa..40c6dbbd 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -31,13 +31,12 @@ #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_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &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/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 9207564b..1459c4c7 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -81,25 +81,6 @@ struct LocEngInjectXtraData : public LocMsg { } }; -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 @@ -121,7 +102,6 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, { int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; - ENTRY_LOG(); if(callbacks == NULL) { LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); @@ -132,7 +112,6 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, ret_val = 0; } - EXIT_LOG(%d, ret_val); return ret_val; } @@ -146,7 +125,8 @@ DEPENDENCIES N/A RETURN VALUE - 0 + 0: success + >0: failure SIDE EFFECTS N/A @@ -155,10 +135,9 @@ SIDE EFFECTS 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; } /*=========================================================================== @@ -171,7 +150,7 @@ DEPENDENCIES N/A RETURN VALUE - 0 + length of server string SIDE EFFECTS N/A @@ -179,34 +158,9 @@ SIDE EFFECTS ===========================================================================*/ 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/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index 205c9fff..f78303c9 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. +/* 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 @@ -82,8 +82,6 @@ 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 @@ -99,47 +97,37 @@ char* get_timestamp(char* str, unsigned long buf_size); 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__); } +if ((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("W/"__VA_ARGS__); } #define LOC_LOGW(...) \ -IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); } +if ((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) { 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__); } +if ((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) { 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__); } +if ((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) { 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__); } +if ((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) { 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_LOGE(...) ALOGE("E/"__VA_ARGS__) -#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) +#define LOC_LOGW(...) ALOGW("W/"__VA_ARGS__) -#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) +#define LOC_LOGI(...) ALOGI("I/"__VA_ARGS__) -#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) +#define LOC_LOGD(...) ALOGD("D/"__VA_ARGS__) -#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) +#define LOC_LOGV(...) ALOGV("V/"__VA_ARGS__) #endif /* DEBUG_DMN_LOC_API */ @@ -160,18 +148,12 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } while(0) + #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 diff --git a/utils/Android.mk b/utils/Android.mk index 37512a58..24ab8a13 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -18,27 +18,19 @@ LOCAL_SRC_FILES += \ 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 + loc_timer.c \ + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 - -ifeq ($(TARGET_BUILD_VARIANT),user) - LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER -endif + -D_ANDROID_ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/platform_lib_abstractions + $(LOCAL_PATH)/../platform_lib_abstractions LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -47,25 +39,20 @@ LOCAL_COPY_HEADERS:= \ 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 \ - platform_lib_abstractions/platform_lib_includes.h \ - platform_lib_abstractions/platform_lib_time.h \ - platform_lib_abstractions/platform_lib_macros.h \ - loc_misc_utils.h + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h + LOCAL_MODULE := libgps.utils -LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp deleted file mode 100644 index d667f14f..00000000 --- a/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/utils/LocHeap.h b/utils/LocHeap.h deleted file mode 100644 index b491948a..00000000 --- a/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/utils/LocSharedLock.h b/utils/LocSharedLock.h deleted file mode 100644 index 7fe62376..00000000 --- a/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/utils/LocThread.cpp b/utils/LocThread.cpp deleted file mode 100644 index 19bf101a..00000000 --- a/utils/LocThread.cpp +++ /dev/null @@ -1,264 +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 - -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) - 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/utils/LocThread.h b/utils/LocThread.h deleted file mode 100644 index 2a65d8fa..00000000 --- a/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/utils/LocTimer.cpp b/utils/LocTimer.cpp deleted file mode 100644 index 70904b2a..00000000 --- a/utils/LocTimer.cpp +++ /dev/null @@ -1,737 +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, this obj outRanks higher - rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; - } - 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/utils/LocTimer.h b/utils/LocTimer.h deleted file mode 100644 index c1468524..00000000 --- a/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/utils/MsgTask.cpp b/utils/MsgTask.cpp deleted file mode 100644 index f33d6024..00000000 --- a/utils/MsgTask.cpp +++ /dev/null @@ -1,100 +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 - -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() { - msg_q_unblock((void*)mQ); - if (mThread) { - LocThread* thread = mThread; - 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 - set_sched_policy(gettid(), 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/utils/linked_list.c b/utils/linked_list.c index acec5b1f..1109acd3 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -108,7 +108,7 @@ linked_list_err_type linked_list_destroy(void** list_data) ===========================================================================*/ 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); + LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -160,7 +160,7 @@ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dea ===========================================================================*/ linked_list_err_type linked_list_remove(void* list_data, void **data_obj) { - LOC_LOGV("%s: Removing from list\n", __FUNCTION__); + LOC_LOGD("%s: Removing from list\n", __FUNCTION__); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -267,7 +267,7 @@ 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__); + LOC_LOGD("%s: Search the list\n", __FUNCTION__); if( list_data == NULL || NULL == equal ) { LOC_LOGE("%s: Invalid list parameter! list_data %p equal %p\n", diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 967d2f30..8c76d1fe 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -38,9 +38,8 @@ #include #include #include -#include -#include -#ifdef USE_GLIB +#include +#if defined(USE_GLIB) && !defined(OFF_TARGET) #include #endif #include "platform_lib_includes.h" @@ -52,23 +51,68 @@ *============================================================================*/ /* Parameter data */ -static uint32_t DEBUG_LEVEL = 0xff; -static uint32_t TIMESTAMP = 0; +static uint8_t DEBUG_LEVEL = 0xff; +static uint8_t TIMESTAMP = 0; /* Parameter spec table */ -static const loc_param_s_type loc_param_table[] = +static loc_param_s_type loc_parameter_table[] = { - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"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); +int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); + +/*=========================================================================== +FUNCTION trim_space + +DESCRIPTION + Removes leading and trailing spaces of the string + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void trim_space(char *org_string) +{ + char *scan_ptr, *write_ptr; + char *first_nonspace = NULL, *last_nonspace = NULL; + + scan_ptr = write_ptr = org_string; + + while (*scan_ptr) + { + if ( !isspace(*scan_ptr) && first_nonspace == NULL) + { + first_nonspace = scan_ptr; + } + + if (first_nonspace != NULL) + { + *(write_ptr++) = *scan_ptr; + if ( !isspace(*scan_ptr)) + { + last_nonspace = write_ptr; + } + } + + scan_ptr++; + } + + if (last_nonspace) { *last_nonspace = '\0'; } +} typedef struct loc_param_v_type { - char* param_name; - char* param_str_value; - int param_int_value; - double param_double_value; + char* param_name; + + char* param_str_value; + int param_int_value; + double param_double_value; }loc_param_v_type; /*=========================================================================== @@ -92,267 +136,61 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* config_value) +void loc_set_config_entry(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(NULL == config_entry || NULL == config_value) + { + LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); + return; + } - 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 (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; + } + 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; + } + 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; + if(NULL != config_entry->param_set) + { + *(config_entry->param_set) = 1; + } + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); + } + } } /*=========================================================================== @@ -377,24 +215,72 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, - uint32_t table_length) +void loc_read_conf(const char* conf_file_name, 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; + FILE *gps_conf_fp = NULL; + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + 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); + if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) + { + LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); + } + else + { + LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name); + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); + return; /* no parameter file */ + } + + /* Clear all validity bits */ + for(i = 0; NULL != config_table && i < table_length; i++) + { + if(NULL != config_table[i].param_set) + { + *(config_table[i].param_set) = 0; + } + } + + while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) + { + memset(&config_value, 0, sizeof(config_value)); + + /* Separate variable and value */ + config_value.param_name = strtok_r(input_buf, "=", &lasts); + if (config_value.param_name == NULL) continue; /* skip lines that do not contain "=" */ + config_value.param_str_value = strtok_r(NULL, "=", &lasts); + if (config_value.param_str_value == NULL) continue; /* skip lines that do not contain two operands */ + + /* Trim leading and trailing spaces */ + trim_space(config_value.param_name); + trim_space(config_value.param_str_value); + + /* Parse numerical value */ + if (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(i = 0; NULL != config_table && i < table_length; i++) + { + loc_set_config_entry(&config_table[i], &config_value); + } + + for(i = 0; i < loc_param_num; i++) + { + loc_set_config_entry(&loc_parameter_table[i], &config_value); + } + } + + fclose(gps_conf_fp); + + /* Initialize logging mechanism with parsed data */ + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 9045e1d5..df833389 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -30,22 +30,17 @@ #ifndef LOC_CFG_H #define LOC_CFG_H -#include #include -#define LOC_MAX_PARAM_NAME 80 +#define LOC_MAX_PARAM_NAME 48 #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 LOC_MAX_PARAM_LINE 80 #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])) + loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) /*============================================================================= * @@ -54,7 +49,7 @@ *============================================================================*/ typedef struct { - const char *param_name; + char param_name[LOC_MAX_PARAM_NAME]; void *param_ptr; uint8_t *param_set; /* was this value set by config file? */ char param_type; /* 'n' for number, @@ -77,13 +72,10 @@ extern "C" { * 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); +extern void loc_read_conf(const char* conf_file_name, + loc_param_s_type* config_table, + uint32_t table_length); + #ifdef __cplusplus } #endif diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index f6b54f91..c64310eb 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, 2015, The Linux Foundation. All rights reserved. +/* 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 @@ -47,15 +47,14 @@ 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) +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) { - size_t i; + int i; for (i = 0; i < table_size; i++) { if (table[i].val & (long) mask) @@ -67,9 +66,9 @@ const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t tab } /* Get names from value */ -const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value) +const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value) { - size_t i; + int i; for (i = 0; i < table_size; i++) { if (table[i].val == (long) value) @@ -80,7 +79,7 @@ const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t tabl return UNKNOWN_STR; } -static const loc_name_val_s_type loc_msg_q_status[] = +static loc_name_val_s_type loc_msg_q_status[] = { NAME_VAL( eMSG_Q_SUCCESS ), NAME_VAL( eMSG_Q_FAILURE_GENERAL ), @@ -89,7 +88,7 @@ static const loc_name_val_s_type loc_msg_q_status[] = 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); +static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); /* Find msg_q status name */ const char* loc_get_msg_q_status(int status) @@ -103,18 +102,17 @@ const char* log_succ_fail_string(int is_succ) } //Target names -static const loc_name_val_s_type target_name[] = +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); +static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); /*=========================================================================== @@ -135,7 +133,7 @@ const char *loc_get_target_name(unsigned int target) static char ret[BUFFER_SIZE]; index = getTargetGnssType(target); - if( index < 0 || (unsigned)index >= target_name_num ) + if( index >= target_name_num || index < 0) index = target_name_num - 1; if( (target & HAS_SSC) == HAS_SSC ) { @@ -164,7 +162,7 @@ RETURN VALUE The time string ===========================================================================*/ -char *loc_get_time(char *time_string, size_t buf_size) +char *loc_get_time(char *time_string, unsigned long buf_size) { struct timeval now; /* sec and usec */ struct tm now_tm; /* broken-down time */ @@ -178,61 +176,3 @@ char *loc_get_time(char *time_string, size_t buf_size) 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/utils/loc_log.h b/utils/loc_log.h index be492b11..82dc6368 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved. +/* 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 @@ -36,13 +36,12 @@ extern "C" #endif #include -#include #include "loc_target.h" typedef struct { - const char *name; - long val; + char name[128]; + long val; } loc_name_val_s_type; #define NAME_VAL(x) {"" #x "", x } @@ -50,19 +49,17 @@ typedef struct #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])) + ((mask_var & mask) ? (type) value : (type) (-1)) /* 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_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); +const char* loc_get_name_from_val(loc_name_val_s_type table[], int 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); +extern char *loc_get_time(char *time_string, unsigned long buf_size); #ifdef __cplusplus } diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp deleted file mode 100644 index 7e96313f..00000000 --- a/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/utils/loc_misc_utils.h b/utils/loc_misc_utils.h deleted file mode 100644 index 7d66d842..00000000 --- a/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/utils/loc_target.cpp b/utils/loc_target.cpp index 30c040c7..b5a62972 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -53,15 +53,11 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" -#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_TIMEOUT 30 #define QCA1530_DETECT_PRESENT "yes" #define QCA1530_DETECT_PROGRESS "detect" @@ -103,7 +99,7 @@ static int read_a_line(const char * file_path, char * line, int line_size) */ static bool is_qca1530(void) { - static const char qca1530_property_name[] = "sys.qca1530"; + static const char qca1530_property_name[] = "persist.qca1530"; bool res = false; int ret, i; char buf[PROPERTY_VALUE_MAX]; @@ -146,34 +142,6 @@ static bool is_qca1530(void) 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__); - } -} - unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) @@ -196,8 +164,7 @@ unsigned int loc_get_target(void) goto detected; } - loc_get_target_baseband(baseband, sizeof(baseband)); - + platform_lib_abstraction_property_get("ro.baseband", baseband, ""); if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { @@ -208,13 +175,8 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) - { - gTarget = TARGET_AUTO; - goto detected; - } - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + 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_MPQ; @@ -245,17 +207,3 @@ 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/utils/loc_target.h b/utils/loc_target.h index 3bb3b5e2..4aebb851 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -35,7 +35,6 @@ #define TARGET_MPQ 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) @@ -46,18 +45,6 @@ extern "C" 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); -/*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 { @@ -66,7 +53,6 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, - GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; diff --git a/utils/loc_timer.c b/utils/loc_timer.c new file mode 100644 index 00000000..0e9f6bde --- /dev/null +++ b/utils/loc_timer.c @@ -0,0 +1,187 @@ +/* Copyright (c) 2013-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 "loc_timer.h" +#include +#include +#include"platform_lib_includes.h" + +enum timer_state { + READY = 100, + WAITING, + DONE, + ABORT +}; + +typedef struct { + loc_timer_callback callback_func; + void *user_data; + unsigned int time_msec; + pthread_cond_t timer_cond; + pthread_mutex_t timer_mutex; + enum timer_state state; +}timer_data; + +static void *timer_thread(void *thread_data) +{ + int ret = -ETIMEDOUT; + struct timespec ts; + struct timeval tv; + timer_data* t = (timer_data*)thread_data; + + LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); + + gettimeofday(&tv, NULL); + clock_gettime(CLOCK_REALTIME, &ts); + if(t->time_msec >= 1000) { + ts.tv_sec += t->time_msec/1000; + t->time_msec = t->time_msec % 1000; + } + if(t->time_msec) + ts.tv_nsec += t->time_msec * 1000000; + if(ts.tv_nsec > 999999999) { + LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); + ts.tv_sec += 1; + ts.tv_nsec -= 1000000000; + } + LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" + "\t Current time: %d sec; %d nsec", + __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, + (int)tv.tv_sec, (int)tv.tv_usec*1000); + + pthread_mutex_lock(&(t->timer_mutex)); + if (READY == t->state) { + t->state = WAITING; + ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); + t->state = DONE; + } + pthread_mutex_unlock(&(t->timer_mutex)); + + switch (ret) { + case ETIMEDOUT: + LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); + break; + case 0: + LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); + break; + case -ETIMEDOUT: + LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); + break; + default: + LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", + __func__, __LINE__, ret); + break; + } + + pthread_mutex_destroy(&t->timer_mutex); + pthread_cond_destroy(&t->timer_cond); + + if(ETIMEDOUT == ret) + t->callback_func(t->user_data, ret); + + free(t); + LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); + return NULL; +} + +void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, + void* caller_data) +{ + timer_data *t=NULL; + pthread_attr_t tattr; + pthread_t id; + LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); + if(cb_func == NULL || msec == 0) { + LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); + goto _err; + } + t = (timer_data *)calloc(1, sizeof(timer_data)); + if(t == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", + __func__, __LINE__); + goto _err; + } + + if(pthread_cond_init(&(t->timer_cond), NULL)) { + LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); + goto t_err; + } + if(pthread_mutex_init(&(t->timer_mutex), NULL)) { + LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); + goto cond_err; + } + + t->callback_func = cb_func; + t->user_data = caller_data; + t->time_msec = msec; + t->state = READY; + + if (pthread_attr_init(&tattr)) { + LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); + goto mutex_err; + } + pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); + + if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { + LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); + goto attr_err; + } + + LOC_LOGD("%s:%d]: Created thread with id: %d\n", + __func__, __LINE__, (int)id); + goto _err; + +attr_err: + pthread_attr_destroy(&tattr); +mutex_err: + pthread_mutex_destroy(&t->timer_mutex); +cond_err: + pthread_cond_destroy(&t->timer_cond); +t_err: + free(t); +_err: + LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); + return t; +} + +void loc_timer_stop(void* handle) { + timer_data* t = (timer_data*)handle; + + if (NULL != t && (READY == t->state || WAITING == t->state)) { + pthread_mutex_lock(&(t->timer_mutex)); + if (READY == t->state || WAITING == t->state) { + pthread_cond_signal(&t->timer_cond); + t->state = ABORT; + } + pthread_mutex_unlock(&(t->timer_mutex)); + } +} diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 2967858e..5ca15862 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -33,38 +33,28 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include +#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. + Return values: + Success = 0 + Failure = Non zero */ -typedef void (*loc_timer_callback)(void *user_data, int32_t result); +typedef void(*loc_timer_callback)(void *user_data, int 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). + Returns the handle, which can be used to stop the timer */ -void* loc_timer_start(uint64_t delay_msec, - loc_timer_callback cb_func, - void *user_data, - bool wake_on_expire=false); +void* loc_timer_start(unsigned int delay_msec, + loc_timer_callback, + void* user_data); /* - handle becomes invalid upon the return of the callback + handle becomes invalid upon the return of the callback */ -void loc_timer_stop(void*& handle); +void loc_timer_stop(void* handle); #ifdef __cplusplus } diff --git a/utils/msg_q.c b/utils/msg_q.c index e412e781..1555668c 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -198,7 +198,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) 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); + LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); if( p_msg_q->unblocked ) { @@ -214,7 +214,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); return rv; } @@ -241,7 +241,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) msg_q* p_msg_q = (msg_q*)msg_q_data; - LOC_LOGV("%s: Waiting on message\n", __FUNCTION__); + LOC_LOGD("%s: Waiting on message\n", __FUNCTION__); pthread_mutex_lock(&p_msg_q->list_mutex); @@ -262,7 +262,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp deleted file mode 100644 index e8cb93a9..00000000 --- a/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/utils/platform_lib_abstractions/platform_lib_includes.h b/utils/platform_lib_abstractions/platform_lib_includes.h deleted file mode 100644 index 5858674f..00000000 --- a/utils/platform_lib_abstractions/platform_lib_includes.h +++ /dev/null @@ -1,35 +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. - */ - -#ifndef _PLATFORM_LIB_INCLUDES_H_ -#define _PLATFORM_LIB_INCLUDES_H_ - -#include "platform_lib_time.h" -#include "platform_lib_macros.h" - -#endif diff --git a/utils/platform_lib_abstractions/platform_lib_macros.h b/utils/platform_lib_abstractions/platform_lib_macros.h deleted file mode 100644 index bc48dd99..00000000 --- a/utils/platform_lib_abstractions/platform_lib_macros.h +++ /dev/null @@ -1,81 +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. - */ - -#ifndef __PLATFORM_LIB_MACROS_H__ -#define __PLATFORM_LIB_MACROS_H__ - -#include - -#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); \ -} - - -#ifdef USE_GLIB - -#define strlcat g_strlcat -#define strlcpy g_strlcpy - -#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) - -#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) - -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) - - -#else - -#ifdef __cplusplus -extern "C" { -#endif -pid_t gettid(void); - -#ifdef __cplusplus -} -#endif - -#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) - -#endif - -#endif diff --git a/utils/platform_lib_abstractions/platform_lib_time.h b/utils/platform_lib_abstractions/platform_lib_time.h deleted file mode 100644 index ce013afc..00000000 --- a/utils/platform_lib_abstractions/platform_lib_time.h +++ /dev/null @@ -1,35 +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. - */ - -#ifndef _PLATFORM_LIB_TIME_H_ -#define _PLATFORM_LIB_TIME_H_ - -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); - -#endif From a376de48267adf99805cf7c0083cc10e06873b38 Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Tue, 15 Mar 2016 12:20:01 -0700 Subject: [PATCH 396/945] Revert "Revert "Merging m_master changes to oe_master"." This reverts commit a29688ff347be4972133eb11ccecaf03b0d3445e Change-Id: Iab525a58ddb6a00e119afe19f4f51b07b7f428f2 --- core/Android.mk | 14 +- core/ContextBase.cpp | 29 +- core/ContextBase.h | 11 +- core/LBSProxyBase.h | 13 +- core/LocAdapterBase.cpp | 41 +- core/LocAdapterBase.h | 27 +- core/LocAdapterProxyBase.h | 70 + core/LocApiBase.cpp | 96 +- core/LocApiBase.h | 60 +- core/LocDualContext.cpp | 97 +- core/LocDualContext.h | 34 +- core/MsgTask.cpp | 131 -- core/UlpProxyBase.h | 14 +- core/gps_extended_c.h | 222 ++- core/loc_core_log.cpp | 67 +- etc/gps.conf | 38 +- loc_api/NOTICE | 13 - .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 8 +- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 48 +- loc_api/libloc_api-rpc/Android.mk | 61 - loc_api/libloc_api-rpc/gen-1240/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-1240/loc_api.xdr | 172 -- .../libloc_api-rpc/gen-1240/loc_api_cb.xdr | 85 - .../libloc_api-rpc/gen-1240/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-1240/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-1240/loc_api_clnt.c | 91 - .../gen-1240/loc_api_common.xdr | 906 --------- .../gen-1240/loc_api_common_xdr.c | 1650 ----------------- .../libloc_api-rpc/gen-1240/loc_api_fixup.c | 48 - .../gen-1240/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/gen-3200/Makefile.xdr | 29 - loc_api/libloc_api-rpc/gen-3200/loc_api.xdr | 164 -- .../libloc_api-rpc/gen-3200/loc_api_cb.xdr | 90 - .../libloc_api-rpc/gen-3200/loc_api_cb_svc.c | 64 - .../libloc_api-rpc/gen-3200/loc_api_cb_xdr.c | 32 - .../libloc_api-rpc/gen-3200/loc_api_clnt.c | 82 - .../gen-3200/loc_api_common.xdr | 803 -------- .../gen-3200/loc_api_common_xdr.c | 1441 -------------- .../libloc_api-rpc/gen-3200/loc_api_fixup.c | 48 - .../gen-3200/loc_api_rpc_glue.c | 339 ---- loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c | 171 -- loc_api/libloc_api-rpc/inc-1240/loc_api.h | 210 --- loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-1240/loc_api_common.h | 1154 ------------ .../libloc_api-rpc/inc-1240/loc_api_fixup.h | 188 -- .../inc-1240/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc-3200/loc_api.h | 198 -- loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h | 64 - .../libloc_api-rpc/inc-3200/loc_api_common.h | 1031 ---------- .../libloc_api-rpc/inc-3200/loc_api_fixup.h | 188 -- .../inc-3200/loc_apicb_appinit.h | 34 - loc_api/libloc_api-rpc/inc/debug.h | 57 - loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h | 100 - .../libloc_api-rpc/src/loc_apicb_appinit.c | 61 - loc_api/libloc_api_50001/Android.mk | 11 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 346 +++- loc_api/libloc_api_50001/LocEngAdapter.h | 90 +- loc_api/libloc_api_50001/gps.c | 2 +- loc_api/libloc_api_50001/loc.cpp | 258 ++- loc_api/libloc_api_50001/loc.h | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 672 +++++-- loc_api/libloc_api_50001/loc_eng.h | 104 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 4 +- loc_api/libloc_api_50001/loc_eng_agps.h | 12 + loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_dmn_conn.h | 12 +- loc_api/libloc_api_50001/loc_eng_msg.h | 14 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 169 +- loc_api/libloc_api_50001/loc_eng_ni.h | 8 + loc_api/libloc_api_50001/loc_eng_nmea.cpp | 62 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 3 +- loc_api/libloc_api_50001/loc_eng_xtra.cpp | 58 +- .../loc_pla/include/platform_lib_log_util.h | 52 +- utils/Android.mk | 33 +- utils/LocHeap.cpp | 354 ++++ utils/LocHeap.h | 96 + utils/LocSharedLock.h | 59 + utils/LocThread.cpp | 264 +++ utils/LocThread.h | 92 + utils/LocTimer.cpp | 737 ++++++++ utils/LocTimer.h | 74 + utils/MsgTask.cpp | 100 + {core => utils}/MsgTask.h | 49 +- utils/linked_list.c | 6 +- utils/loc_cfg.cpp | 462 +++-- utils/loc_cfg.h | 26 +- utils/loc_log.cpp | 82 +- utils/loc_log.h | 17 +- utils/loc_misc_utils.cpp | 114 ++ utils/loc_misc_utils.h | 99 + utils/loc_target.cpp | 62 +- utils/loc_target.h | 16 +- utils/loc_timer.c | 187 -- utils/loc_timer.h | 36 +- utils/msg_q.c | 8 +- .../elapsed_millis_since_boot.cpp | 46 + .../platform_lib_includes.h | 35 + .../platform_lib_macros.h | 81 + .../platform_lib_time.h | 35 + 100 files changed, 4840 insertions(+), 11538 deletions(-) create mode 100644 core/LocAdapterProxyBase.h delete mode 100644 core/MsgTask.cpp delete mode 100644 loc_api/NOTICE delete mode 100644 loc_api/libloc_api-rpc/Android.mk delete mode 100644 loc_api/libloc_api-rpc/gen-1240/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/Makefile.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_common.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc/inc/debug.h delete mode 100644 loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc/src/loc_apicb_appinit.c create mode 100644 utils/LocHeap.cpp create mode 100644 utils/LocHeap.h create mode 100644 utils/LocSharedLock.h create mode 100644 utils/LocThread.cpp create mode 100644 utils/LocThread.h create mode 100644 utils/LocTimer.cpp create mode 100644 utils/LocTimer.h create mode 100644 utils/MsgTask.cpp rename {core => utils}/MsgTask.h (67%) create mode 100644 utils/loc_misc_utils.cpp create mode 100644 utils/loc_misc_utils.h delete mode 100644 utils/loc_timer.c create mode 100644 utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp create mode 100644 utils/platform_lib_abstractions/platform_lib_includes.h create mode 100644 utils/platform_lib_abstractions/platform_lib_macros.h create mode 100644 utils/platform_lib_abstractions/platform_lib_time.h diff --git a/core/Android.mk b/core/Android.mk index 11cecc65..c6d3128d 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -10,6 +10,12 @@ 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 \ @@ -17,7 +23,6 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_SRC_FILES += \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ @@ -29,11 +34,11 @@ LOCAL_CFLAGS += \ -D_ANDROID_ LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ @@ -42,7 +47,8 @@ LOCAL_COPY_HEADERS:= \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h + loc_core_log.h \ + LocAdapterProxyBase.h LOCAL_PRELINK_MODULE := false diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index b2869bb9..58dc8a78 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -69,13 +69,28 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // first if can not be MPQ if (TARGET_MPQ != loc_get_target()) { - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { - // only RPC is the option now - void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { + 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 (NULL != getter) { - locApi = (*getter)(mMsgTask, exMask); + 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); + } } } } @@ -84,7 +99,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // locApi could still be NULL at this time // we would then create a dummy one if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask); + locApi = new LocApiBase(mMsgTask, exMask, this); } return locApi; diff --git a/core/ContextBase.h b/core/ContextBase.h index 85cbab7e..fe0b8606 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -56,12 +56,17 @@ public: inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } - inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } - inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } + inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } + 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); } }; } // namespace loc_core diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index f0d1a329..0faf8012 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* 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 @@ -35,12 +35,14 @@ 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) const { + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context) const { return NULL; } protected: @@ -49,8 +51,11 @@ public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} - inline virtual bool hasAgpsExt() const { return false; } - inline virtual bool hasCPIExt() const { return false; } + inline virtual bool hasAgpsExtendedCapabilities() const { return false; } + inline virtual bool hasCPIExtendedCapabilities() const { return false; } + inline virtual void modemPowerVote(bool power) const {} + virtual void injectFeatureConfig(ContextBase* context) const {} + inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 054a295c..8fdb8cbb 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include namespace loc_core { @@ -41,27 +42,45 @@ namespace loc_core { // 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) : + ContextBase* context, LocAdapterProxyBase *adapterProxyBase) : mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) + mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), + mMsgTask(context->getMsgTask()) { mLocApi->addAdapter(this); } -void LocAdapterBase:: - handleEngineDownEvent() -DEFAULT_IMPL() +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) -DEFAULT_IMPL() + LocPosTechMask loc_technology_mask) { + if (mLocAdapterProxyBase == NULL || + !mLocAdapterProxyBase->reportPosition(location, + locationExtended, + status, + loc_technology_mask)) { + DEFAULT_IMPL() + } +} void LocAdapterBase:: - reportSv(GpsSvStatus &svStatus, + reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() @@ -116,4 +135,8 @@ DEFAULT_IMPL(false) bool LocAdapterBase:: requestNiNotify(GpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) + +void LocAdapterBase:: + reportGpsMeasurementData(GpsData &gpsMeasurementData) +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 8222b24b..5f4660b8 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -35,19 +35,23 @@ namespace loc_core { +class LocAdapterProxyBase; + class LocAdapterBase { protected: - const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + 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), mMsgTask(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); + ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; @@ -65,10 +69,19 @@ public: 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(); + } + // This will be overridden by the individual adapters // if necessary. inline virtual void setUlpProxy(UlpProxyBase* ulp) {} - inline virtual void handleEngineUpEvent() {} + virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); inline virtual void setPositionModeInt(LocPosMode& posMode) {} virtual void startFixInt() {} @@ -79,7 +92,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -97,6 +110,8 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } + ContextBase* getContext() const { return mContext; } + virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; } // namespace loc_core diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h new file mode 100644 index 00000000..1ddcca4c --- /dev/null +++ b/core/LocAdapterProxyBase.h @@ -0,0 +1,70 @@ +/* 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; + } + ContextBase* getContext() const { + return mLocAdapterBase->getContext(); + } + inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) { + mLocAdapterBase->updateEvtMask(event,isEnabled); + } + +public: + 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) { + return false; + } +}; + +} // namespace loc_core + +#endif //LOC_ADAPTER_PROXY_BASE_H diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3cd2ffa8..dcd35fec 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include namespace loc_core { @@ -125,8 +126,10 @@ struct LocOpenMsg : public LocMsg { }; LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask) : - mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0) + LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + ContextBase* context) : + mExcludedMask(excludedMask), mMsgTask(msgTask), + mMask(0), mSupportedMsg(0), mContext(context) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); } @@ -201,11 +204,18 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) } } +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()); } @@ -222,6 +232,17 @@ void LocApiBase::reportPosition(UlpLocation &location, 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", + 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); // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPosition(location, @@ -232,10 +253,24 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GpsSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { + // print the SV info before delivering + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" + " mask: %x/%x/%x\n sv: prn snr elevation azimuth", + svStatus.num_svs, svStatus.ephemeris_mask, + svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, + svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); + for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f", + i, + svStatus.sv_list[i].prn, + svStatus.sv_list[i].snr, + svStatus.sv_list[i].elevation, + svStatus.sv_list[i].azimuth); + } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportSv(svStatus, @@ -318,12 +353,23 @@ void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); } +void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) +{ + mSupportedMsg = supportedMsgList; +} + void* LocApiBase :: getSibling() DEFAULT_IMPL(NULL) LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) +void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData)); +} + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T mask) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -404,7 +450,8 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage) + setSensorControlConfig(int sensorUsage, + int sensorProvider) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -442,12 +489,23 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getZppFix(GpsLocation & zppLoc) + getWwanZppFix(GpsLocation& zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + 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() @@ -466,10 +524,30 @@ void LocApiBase:: DEFAULT_IMPL() int LocApiBase:: - setGpsLock(unsigned int lock) + 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) + +int LocApiBase:: + updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) +DEFAULT_IMPL(-1) + +bool LocApiBase:: + gnssConstellationConfig() +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index c48927c4..5a2c56f0 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -36,6 +36,7 @@ #include namespace loc_core { +class ContextBase; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -52,6 +53,13 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i sendMsg(msg); + } + void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); @@ -99,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GpsSvStatus &svStatus, + void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); @@ -115,6 +129,8 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); + void saveSupportedMsgList(uint64_t supportedMsgList); + void reportGpsMeasurementData(GpsData &gpsMeasurementData); // downward calls // All below functions are to be defined by adapter specific modules: @@ -158,7 +174,7 @@ public: virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage); + setSensorControlConfig(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, @@ -186,15 +202,28 @@ public: virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); virtual enum loc_api_adapter_err - getZppFix(GpsLocation & zppLoc); + getWwanZppFix(GpsLocation & zppLoc); virtual enum loc_api_adapter_err - getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + 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) {} + inline bool isMessageSupported (LocCheckingMessagesID msgID) const { + if (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 @@ -202,17 +231,30 @@ public: 3 = Lock MT position sessions 4 = Lock all position sessions */ - virtual int setGpsLock(unsigned int lock); + 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); + + /* + Update gps reporting events + */ + virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled); + /* + Check if the modem support the service + */ + virtual bool gnssConstellationConfig(); }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context); } // namespace loc_core diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index b4eaf7ff..b5f33ac3 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -49,86 +49,97 @@ LocDualContext::mBgExclMask = 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_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::mIzatLibName = "liblbs_core.so"; -#else -const char* LocDualContext::mIzatLibName = "liblbs_core.so.1"; -#endif +const char* LocDualContext::mLBSLibName = "liblbs_core.so"; -const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, - const char* name) +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); + mMsgTask = new MsgTask(tCreator, name, joinable); } return mMsgTask; } -const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, - const char* name) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tAssociate, name); - } - return mMsgTask; +inline +const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { + return getMsgTask((LocThread::tCreate)NULL, name, joinable); } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, - const char* name) +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) { - const MsgTask* msgTask = getMsgTask(tCreator, name); + 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::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - if (NULL == mFgContext) { - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mFgContext = new LocDualContext(msgTask, - mFgExclMask); - } - return mFgContext; - -} - -ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, - const char* name) +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) { - const MsgTask* msgTask = getMsgTask(tCreator, name); + 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; } -ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name) +void LocDualContext :: injectFeatureConfig(ContextBase *curContext) { - if (NULL == mBgContext) { - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); + 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); } - return mBgContext; + LOC_LOGD("%s:%d]: Exit", __func__, __LINE__); } LocDualContext::LocDualContext(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask) : - ContextBase(msgTask, exMask, mIzatLibName) + ContextBase(msgTask, exMask, mLBSLibName) { } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index e761e764..ce77a1aa 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -40,11 +40,11 @@ class LocDualContext : public ContextBase { static const MsgTask* mMsgTask; static ContextBase* mFgContext; static ContextBase* mBgContext; - - static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, - const char* name); - static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, - const char* name); + 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, @@ -52,19 +52,23 @@ protected: inline virtual ~LocDualContext() {} public: - static const char* mIzatLibName; + 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(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name); + 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); }; } diff --git a/core/MsgTask.cpp b/core/MsgTask.cpp deleted file mode 100644 index df6db808..00000000 --- a/core/MsgTask.cpp +++ /dev/null @@ -1,131 +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_MsgTask" - -#include -#include -#include -#include -#include - -namespace loc_core { - -#define MAX_TASK_COMM_LEN 15 - -static void LocMsgDestroy(void* msg) { - delete (LocMsg*)msg; -} - -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(NULL){ - if (tCreator) { - tCreator(threadName, loopMain, - (void*)new MsgTask(mQ, mAssociator)); - } else { - createPThread(threadName); - } -} - -MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(tAssociator){ - createPThread(threadName); -} - -inline -MsgTask::MsgTask(const void* q, tAssociate associator) : - mQ(q), mAssociator(associator){ -} - -MsgTask::~MsgTask() { - msg_q_unblock((void*)mQ); -} - -void MsgTask::createPThread(const char* threadName) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_t tid; - // create the thread here, then if successful - // and a name is given, we set the thread name - if (!pthread_create(&tid, &attr, loopMain, - (void*)new MsgTask(mQ, mAssociator)) && - NULL != threadName) { - char lname[MAX_TASK_COMM_LEN+1]; - memcpy(lname, threadName, MAX_TASK_COMM_LEN); - lname[MAX_TASK_COMM_LEN] = 0; - pthread_setname_np(tid, lname); - } -} - -void MsgTask::sendMsg(const LocMsg* msg) const { - msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); -} - -void* MsgTask::loopMain(void* arg) { - MsgTask* copy = (MsgTask*)arg; - - // make sure we do not run in background scheduling group - platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); - - if (NULL != copy->mAssociator) { - copy->mAssociator(); - } - - LocMsg* msg; - int cnt = 0; - - while (1) { - LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); - - msq_q_err_type result = msg_q_rcv((void*)copy->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)); - // destroy the Q and exit - msg_q_destroy((void**)&(copy->mQ)); - delete copy; - return NULL; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete msg; - } - - delete copy; - - return NULL; -} - -} diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 90097571..59e265e8 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -30,6 +30,7 @@ #define ULP_PROXY_BASE_H #include +#include "fused_location_extended.h" namespace loc_core { @@ -50,6 +51,7 @@ public: mPosMode = params; return false; } + inline virtual bool reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, @@ -57,7 +59,7 @@ public: LocPosTechMask loc_technology_mask) { return false; } - inline virtual bool reportSv(GpsSvStatus &svStatus, + inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { return false; @@ -67,6 +69,14 @@ public: } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} + inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, + bool active) { + return false; + } + inline virtual bool reportPositions(const FlpExtLocation* locations, + int32_t number_of_locations) { + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index f8e540fb..e37ff482 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -31,6 +31,8 @@ #include #include +#include +#include #include /** @@ -60,15 +62,31 @@ extern "C" { /** Position source is ULP */ #define ULP_LOCATION_IS_FROM_HYBRID 0x0001 /** Position source is GNSS only */ -#define ULP_LOCATION_IS_FROM_GNSS 0x0002 +#define ULP_LOCATION_IS_FROM_GNSS 0x0002 /** Position source is ZPP only */ -#define ULP_LOCATION_IS_FROM_ZPP 0x0004 +#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 #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 struct { /** set to sizeof(UlpLocation) */ size_t size; @@ -135,7 +153,7 @@ typedef struct { AGpsExtType type; AGpsStatusValue status; uint32_t ipv4_addr; - char ipv6_addr[16]; + struct sockaddr_storage addr; char ssid[SSID_BUF_SIZE]; char password[SSID_BUF_SIZE]; } AGpsExtStatus; @@ -201,22 +219,6 @@ typedef enum loc_position_mode_type { */ #define GPS_DEFAULT_FIX_INTERVAL_MS 1000 -/** GpsLocationExtended has valid latitude and longitude. */ -#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) -/** GpsLocationExtended has valid altitude. */ -#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1) -/** GpsLocationExtended has valid speed. */ -#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2) -/** GpsLocationExtended has valid bearing. */ -#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4) -/** GpsLocationExtended has valid accuracy. */ -#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8) - -/** GPS extended supports geofencing */ -#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001 -/** GPS extended supports batching */ -#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002 - /** Flags to indicate which values are valid in a GpsLocationExtended. */ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ @@ -231,6 +233,20 @@ typedef uint16_t GpsLocationExtendedFlags; #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 + +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; /** Represents gps location extended. */ typedef struct { @@ -252,8 +268,55 @@ typedef struct { 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; } GpsLocationExtended; +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GnssSvStatus) */ + size_t size; + + /** Number of SVs currently visible. */ + int num_svs; + + /** Contains an array of SV information. */ + GpsSvInfo sv_list[GPS_MAX_SVS]; + + /** Represents a bit mask indicating which SVs + * have ephemeris data. + */ + uint32_t ephemeris_mask; + + /** Represents a bit mask indicating which SVs + * have almanac data. + */ + uint32_t almanac_mask; + + /** + * Represents a bit mask indicating which GPS SVs + * were used for computing the most recent position fix. + */ + uint32_t gps_used_in_fix_mask; + + /** + * Represents a bit mask indicating which GLONASS SVs + * were used for computing the most recent position fix. + */ + uint32_t glo_used_in_fix_mask; + + /** + * Represents a bit mask indicating which BDS SVs + * were used for computing the most recent position fix. + */ + uint64_t bds_used_in_fix_mask; + +} GnssSvStatus; + enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, @@ -302,66 +365,95 @@ enum loc_api_adapter_err { 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, - LOC_API_ADAPTER_ERR_ENGINE_DOWN = 100, - LOC_API_ADAPTER_ERR_FAILURE, + /* 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_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_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<valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) { location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + location.gpsLocation.speed = location_report_ptr->speed_horizontal; } // Heading @@ -783,7 +796,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { - GpsSvStatus SvStatus = {0}; + GnssSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; @@ -809,7 +822,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS) { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + 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 @@ -828,7 +841,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) && (sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK)) { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); + SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); } } // SBAS: GPS RPN: 120-151, @@ -841,6 +854,12 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) // 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 @@ -1387,8 +1406,9 @@ GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) } LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) { - return new LocApiRpc(msgTask, exMask); + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context) { + return new LocApiRpc(msgTask, exMask, context); } /*Values for lock @@ -1397,12 +1417,12 @@ LocApiBase* getLocApi(const MsgTask* msgTask, 3 = Lock MT position sessions 4 = Lock all position sessions */ -int LocApiRpc::setGpsLock(unsigned int lock) +int LocApiRpc::setGpsLock(LOC_GPS_LOCK_MASK lockMask) { rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - LOC_LOGD("%s:%d]: lock: %d\n", __func__, __LINE__, lock); - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = (rpc_loc_lock_e_type)lock; + 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, diff --git a/loc_api/libloc_api-rpc/Android.mk b/loc_api/libloc_api-rpc/Android.mk deleted file mode 100644 index 06e46948..00000000 --- a/loc_api/libloc_api-rpc/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -AMSS_VERSION:=$(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION) -RPC_INC:=inc-$(AMSS_VERSION) - -generated_files:= \ - gen-$(AMSS_VERSION)/loc_api_clnt.c \ - gen-$(AMSS_VERSION)/loc_api_cb_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_common_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_cb_svc.c \ - gen-$(AMSS_VERSION)/loc_api_xdr.c \ - gen-$(AMSS_VERSION)/loc_api_fixup.c \ - gen-$(AMSS_VERSION)/loc_api_rpc_glue.c \ - src/loc_apicb_appinit.c - -LOCAL_SRC_FILES:= $(generated_files) - -# removed from library build since the client should implement this code. -# src/loc_api_cb_server.c - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-include $(RPC_INC)/loc_api_common.h -LOCAL_CFLAGS+=-DDEBUG -# LOCAL_CFLAGS+=-DDEBUG -DVERBOSE - -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= librpc -LOCAL_STATIC_LIBRARIES:= libcommondefs-rpc - - - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc/inc -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_cb.h \ - $(RPC_INC)/loc_api_common.h \ - $(RPC_INC)/loc_api.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - inc/debug.h \ - inc/loc_api_rpc_glue.h - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/$(RPC_INC) \ - $(TARGET_OUT_HEADERS)/libcommondefs-rpc \ - $(TARGET_OUT_HEADERS)/librpc - -LOCAL_MODULE:= libloc_api-rpc -LOCAL_MODULE_OWNER := qcom - -include $(BUILD_STATIC_LIBRARY) - -endif -endif diff --git a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr b/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr deleted file mode 100644 index a9d60aa4..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api.xdr +++ /dev/null @@ -1,172 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - - - version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_ni_event_e_type in 0x00040002 -RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00040002; - - -} = 0x3000008c; - -const LOC_APIVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr deleted file mode 100644 index 1bd4e151..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb.xdr +++ /dev/null @@ -1,85 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$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. 0x00040002 ) - */ - -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; - - - - - } = 0x00040001; - - -} = 0x3100008c; - -const LOC_APICBVERS = 0x00040002; diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c deleted file mode 100644 index 52a0d15b..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00040001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00040001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00040001_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_0x00040001_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_0x00040001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c deleted file mode 100644 index dca1e8d5..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_clnt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040001(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_0x00040002(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/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr deleted file mode 100644 index 4e01607d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common.xdr +++ /dev/null @@ -1,906 +0,0 @@ -/* LOC_API TOOL VERSION: 4.36 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- - Copyright (c) 2010 QUALCOMM Incorporated. - All Rights Reserved. QUALCOMM Proprietary and Confidential. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/htorpc.pl#20 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Start.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Output.pm#29 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Parser.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/Metacomments.pm#6 -Id: //source/qcom/qct/core/mproc/tools/rel/04.01/htorpc/lib/Htorpc/SymbolTable.pm#3 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#16 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040024; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00040001; -const RPC_LOC_OPEN_VERSION = 0x00040001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00040001; -const RPC_LOC_API_NULL_VERSION = 0x00040001; -const RPC_LOC_STOP_FIX_VERSION = 0x00040001; -const RPC_LOC_IOCTL_VERSION = 0x00040001; -const RPC_LOC_START_FIX_VERSION = 0x00040001; -const RPC_LOC_CLOSE_VERSION = 0x00040001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00040001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0004; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef bool rpc_boolean; - -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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[1200]; /* EVAL:[1200]*/ -}; - -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_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]; /* EVAL:[256]*/ -}; - -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; - 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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[200]*/ - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - - typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; /* EVAL:[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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - 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_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_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_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 -}; - -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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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]; /* EVAL:[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_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]; /* EVAL:[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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c deleted file mode 100644 index 7c860bf3..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_common_xdr.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, 1200)) - 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_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; - 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_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; - 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_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_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; - 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_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_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_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; - 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; - 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: - 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/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c deleted file mode 100644 index fbaca8b6..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00040001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00040001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, /* LOC_APIVERS */ 0x00040001)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-1240/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr b/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr deleted file mode 100644 index 5d9cf6c8..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/Makefile.xdr +++ /dev/null @@ -1,29 +0,0 @@ -CLIENTS:= loc_api -SERVERS:= loc_api_cb -COMMON:= loc_api_common -RPC_INC:= inc-$(AMSS_VERSION) - -all: $(CLIENTS) $(SERVERS) $(COMMON) fixup - -$(CLIENTS) $(SERVERS) $(COMMON):: xdr = $(@:=.xdr) - -$(CLIENTS) $(SERVERS) $(COMMON):: - rpcgen -h -M $(xdr) -o ../$(RPC_INC)/$(addsuffix .h, $@) - rpcgen -c -M $(xdr) -o $(addsuffix _xdr.c, $@) - -$(CLIENTS):: - rpcgen -l -M $(xdr) -o $(addsuffix _clnt.c, $@) - -$(SERVERS):: - rpcgen -m -M $(xdr) -o $(addsuffix _svc.c, $@) - -fixup: - mv ../$(RPC_INC)/loc_api_common.h ../$(RPC_INC)/loc_api_common.h.bak - sed ../$(RPC_INC)/loc_api_common.h.bak -e "/#include ../$(RPC_INC)/loc_api_common.h - rm -f ../$(RPC_INC)/loc_api_common.h.bak - -clean: - rm -f $(addsuffix _clnt.c, $(CLIENTS)) - rm -f $(addsuffix _svc.c, $(SERVERS)) - rm -f $(addsuffix _xdr.c, $(CLIENTS) $(SERVERS) $(COMMON)) - rm -f $(addprefix ../$(RPC_INC)/, $(addsuffix .h, $(CLIENTS) $(SERVERS) $(COMMON))) diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr deleted file mode 100644 index 981266b3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api.xdr +++ /dev/null @@ -1,164 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3000008c; - -const LOC_APIVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr deleted file mode 100644 index 3f53504b..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb.xdr +++ /dev/null @@ -1,90 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$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. 0x00010001 ) - */ - -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; - - - } = 0x00010001; -} = 0x3100008c; - -const LOC_APICBVERS = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c deleted file mode 100644 index b1aa1998..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_svc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00010001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00010001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00010001_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_0x00010001_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_0x00010001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c deleted file mode 100644 index 1d7795ed..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_cb_xdr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_cb.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c deleted file mode 100644 index 79814d42..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_clnt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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_0x00010001(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)); -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr b/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr deleted file mode 100644 index 7ef6357c..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common.xdr +++ /dev/null @@ -1,803 +0,0 @@ -/* LOC_API TOOL VERSION: 3.28 */ -/*============================================================================= - 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. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/htorpc.pl#9 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Start.pm#4 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/XDR.pm#7 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Output.pm#26 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Parser.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/Metacomments.pm#2 -Id: //source/qcom/qct/core/mproc/tools/rel/03.01/htorpc/lib/Htorpc/SymbolTable.pm#4 - -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_OPEN_VERSION = 0x00010001; -const RPC_LOC_CLOSE_VERSION = 0x00010001; -const RPC_LOC_START_FIX_VERSION = 0x00010001; -const RPC_LOC_STOP_FIX_VERSION = 0x00010001; -const RPC_LOC_IOCTL_VERSION = 0x00010001; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00010001; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; -const RPC_LOC_API_API_MAJOR_NUM = 0x0001; -typedef bool rpc_boolean; -typedef unsigned long rpc_uint32; - -typedef unsigned short rpc_uint16; - -typedef unsigned char rpc_uint8; - -typedef long rpc_int32; - -typedef unsigned char rpc_byte; - -typedef unsigned hyper rpc_uint64; - -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; -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - 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 -}; - -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; - 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_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; -}; - -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; - 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_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; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - unsigned char 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; -}; - -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; - 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; - 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; -}; - -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; - 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_MAX = 268435456 -}; - -typedef string 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 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; -}; - -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; - 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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -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_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_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_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_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; -}; - -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 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - string apn_name<>; -}; - -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; -}; - -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_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; - 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: - 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; - 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: - 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_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -const RPC_LOC_API_NULL_VERSION = 0x00010001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00010001; diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c deleted file mode 100644 index 7b37b9c3..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_common_xdr.c +++ /dev/null @@ -1,1441 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_common.h" - -bool_t -xdr_rpc_boolean (XDR *xdrs, rpc_boolean *objp) -{ - register int32_t *buf; - - if (!xdr_bool (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint32 (XDR *xdrs, rpc_uint32 *objp) -{ - register int32_t *buf; - - if (!xdr_u_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint16 (XDR *xdrs, rpc_uint16 *objp) -{ - register int32_t *buf; - - if (!xdr_u_short (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint8 (XDR *xdrs, rpc_uint8 *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_int32 (XDR *xdrs, rpc_int32 *objp) -{ - register int32_t *buf; - - if (!xdr_long (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_byte (XDR *xdrs, rpc_byte *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_uint64 (XDR *xdrs, rpc_uint64 *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, objp)) - return FALSE; - return TRUE; -} - -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, RPC_LOC_API_MAX_SV_COUNT, - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->nmea_sentences.nmea_sentences_val, (u_int *) &objp->nmea_sentences.nmea_sentences_len, RPC_LOC_API_MAX_NMEA_STRING_LENGTH)) - 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_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; - 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; - - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->addr.addr_val, (u_int *) &objp->addr.addr_len, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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; - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->requestor_id_string.requestor_id_string_val, (u_int *) &objp->requestor_id_string.requestor_id_string_len, RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->client_name_string.client_name_string_val, (u_int *) &objp->client_name_string.client_name_string_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_u_char (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; - - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->ext_client_address.ext_client_address_val, (u_int *) &objp->ext_client_address.ext_client_address_len, RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS)) - 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; - - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->lcs_codeword_string.lcs_codeword_string_val, (u_int *) &objp->lcs_codeword_string.lcs_codeword_string_len, RPC_LOC_NI_CODEWORD_LENGTH)) - 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; - - 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_bytes (xdrs, (char **)&objp->notification_text.notification_text_val, (u_int *) &objp->notification_text.notification_text_len, RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH)) - 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_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; - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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, RPC_LOC_API_MAX_SERVER_ADDR_LENGTH)) - 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_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; - 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_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_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; - 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_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; - 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_open_status_s_type (XDR *xdrs, rpc_loc_server_open_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_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_string (xdrs, &objp->apn_name, ~0)) - 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_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_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; - 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: - 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; - 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: - 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_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/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c deleted file mode 100644 index fe512f5d..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_fixup.c +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - L O C _ A P I _ F I X U P . C - -GENERAL DESCRIPTION - This file adds API constants that are not automatically transmitted to - the RPC stubs, and it also fixes other RPC-related problems. - - --------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c deleted file mode 100644 index 8c171222..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_rpc_glue.c +++ /dev/null @@ -1,339 +0,0 @@ -/****************************************************************************** - @file loc_api_rpc_glue.c - @brief Android Loc API glue code using rpcgen. - - DESCRIPTION - Loc API glue code for Android - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/05/2009 dx Initial version - -======================================================================*/ -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -//#define LOG_NDDEBUG 0 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Include RPC headers */ -#include "loc_api_rpc_glue.h" - -/* Callback init */ -#include "loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "lib_api_rpc_glue" -#include - -/* Comment this out to enable logging */ -#undef LOGD -#define LOGD(...) {} - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_ID 1 -loc_event_cb_f_type *loc_api_saved_cb = NULL; /* the only callback of Loc API client */ - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_0x00010001_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (loc_api_saved_cb == NULL || argp->cb_id != LOC_API_CB_ID) - { - LOGD("Warning: No callback handler.\n"); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOGD("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOGD("Callback received: %x (handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - (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; - - int32 rc = loc_api_saved_cb(loc_handle, loc_event, loc_event_payload); - 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 - */ - // LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -int loc_apicbprog_0x00010001_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - return loc_apicbprog_freeresult (transp, xdr_result, result); -} - -/*=========================================================================== - -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) - { - /* Print msg */ - LOGD("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, /*LOC_APIVERS*/ 0x00010000, NULL); - LOGD("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - fprintf(stderr, "Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOGD("Loc API callback initialized.\n"); - } else { - fprintf(stderr, "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_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - args.event_callback = LOC_API_CB_ID; - loc_api_saved_cb = event_callback; - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_open_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (rpc_loc_client_handle_type) rets.loc_open_result; -} - -int32 loc_close(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_close_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_close_result; -} - -int32 loc_start_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_start_fix_result; -} - -int32 loc_stop_fix(rpc_loc_client_handle_type handle) -{ - LOC_GLUE_CHECK_INIT(int32); - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_stop_fix_result; -} - -int32 loc_ioctl( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data - ) -{ - LOC_GLUE_CHECK_INIT(int32); - - 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: - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - case RPC_LOC_IOCTL_INJECT_POSITION: - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - 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: - 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: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, LOC_APIVERS)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets.loc_ioctl_result; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, LOC_APIVERS)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} diff --git a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c b/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c deleted file mode 100644 index 835f6b18..00000000 --- a/loc_api/libloc_api-rpc/gen-3200/loc_api_xdr.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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) -{ - register int32_t *buf; - - 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/loc_api/libloc_api-rpc/inc-1240/loc_api.h b/loc_api/libloc_api-rpc/inc-1240/loc_api.h deleted file mode 100644 index e02648cc..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api.h +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040001_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_0x00040001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_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_0x00040001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00040001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00040001_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_0x00040001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00040001_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_0x00040001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00040001_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_0x00040001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00040001_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_0x00040001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00040001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00040001(); -extern bool_t rpc_loc_api_null_0x00040001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00040001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00040001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00040001(); -extern bool_t rpc_loc_open_0x00040001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00040001(); -extern bool_t rpc_loc_close_0x00040001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00040001(); -extern bool_t rpc_loc_start_fix_0x00040001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00040001(); -extern bool_t rpc_loc_stop_fix_0x00040001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00040001(); -extern bool_t rpc_loc_ioctl_0x00040001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00040001(); -extern bool_t rpc_loc_api_api_versions_0x00040001_svc(); -extern int loc_apiprog_0x00040001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00040002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00040002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00040002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00040002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00040002(); -extern bool_t rpc_loc_api_null_0x00040002_svc(); -extern int loc_apiprog_0x00040002_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h deleted file mode 100644 index 67ac0846..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00040002 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00040001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00040001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00040001_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_0x00040001(); -extern bool_t rpc_loc_event_cb_f_type_0x00040001_svc(); -extern int loc_apicbprog_0x00040001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h deleted file mode 100644 index 6ff3baf1..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_common.h +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040024 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00040001 -#define RPC_LOC_OPEN_VERSION 0x00040001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00040001 -#define RPC_LOC_API_NULL_VERSION 0x00040001 -#define RPC_LOC_STOP_FIX_VERSION 0x00040001 -#define RPC_LOC_IOCTL_VERSION 0x00040001 -#define RPC_LOC_START_FIX_VERSION 0x00040001 -#define RPC_LOC_CLOSE_VERSION 0x00040001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00040001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0004 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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[1200]; -}; -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_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_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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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_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_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_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; - -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; - -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_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_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_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_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-1240/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc-3200/loc_api.h b/loc_api/libloc_api-rpc/inc-3200/loc_api.h deleted file mode 100644 index 8998aca4..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_H_RPCGEN -#define _LOC_API_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APIPROG 0x3000008c -#define LOC_APIVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00010001_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_0x00010001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_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_0x00010001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00010001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00010001_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_0x00010001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00010001_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_0x00010001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00010001_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_0x00010001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00010001_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_0x00010001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00010001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00010001(); -extern bool_t rpc_loc_api_null_0x00010001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00010001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00010001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00010001(); -extern bool_t rpc_loc_open_0x00010001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00010001(); -extern bool_t rpc_loc_close_0x00010001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00010001(); -extern bool_t rpc_loc_start_fix_0x00010001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00010001(); -extern bool_t rpc_loc_stop_fix_0x00010001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00010001(); -extern bool_t rpc_loc_ioctl_0x00010001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00010001(); -extern bool_t rpc_loc_api_api_versions_0x00010001_svc(); -extern int loc_apiprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h deleted file mode 100644 index 4f2f8f91..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_cb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_H_RPCGEN -#define _LOC_API_CB_H_RPCGEN - -#include - -#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 0x00010001 - -#define LOC_APICBPROG 0x3100008c -#define LOC_APICBVERS_0001 0x00010001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00010001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00010001_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_0x00010001(); -extern bool_t rpc_loc_event_cb_f_type_0x00010001_svc(); -extern int loc_apicbprog_0x00010001_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h deleted file mode 100644 index 04be079f..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_common.h +++ /dev/null @@ -1,1031 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_H_RPCGEN -#define _LOC_API_COMMON_H_RPCGEN - -#include -#include "loc_api_fixup.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_OPEN_VERSION 0x00010001 -#define RPC_LOC_CLOSE_VERSION 0x00010001 -#define RPC_LOC_START_FIX_VERSION 0x00010001 -#define RPC_LOC_STOP_FIX_VERSION 0x00010001 -#define RPC_LOC_IOCTL_VERSION 0x00010001 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00010001 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 -#define RPC_LOC_API_API_MAJOR_NUM 0x0001 - -typedef bool_t rpc_boolean; - -typedef u_long rpc_uint32; - -typedef u_short rpc_uint16; - -typedef u_char rpc_uint8; - -typedef long rpc_int32; - -typedef u_char rpc_byte; - -typedef u_quad_t rpc_uint64; - -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; - struct { - u_int nmea_sentences_len; - char *nmea_sentences_val; - } nmea_sentences; -}; -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_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; - -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_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_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; - struct { - u_int addr_len; - char *addr_val; - } addr; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_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_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_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; - struct { - u_int requestor_id_string_len; - char *requestor_id_string_val; - } requestor_id_string; - 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; - struct { - u_int client_name_string_len; - char *client_name_string_val; - } client_name_string; - 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; - u_char 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; - struct { - u_int ext_client_address_len; - char *ext_client_address_val; - } ext_client_address; -}; -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; - struct { - u_int lcs_codeword_string_len; - char *lcs_codeword_string_val; - } lcs_codeword_string; - 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; - struct { - u_int notification_text_len; - char *notification_text_val; - } notification_text; - 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; - -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_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_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_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_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_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - 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_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_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; - -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_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_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_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_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; -}; -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; - -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; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_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; - -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_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_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_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_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; -#define RPC_LOC_API_NULL_VERSION 0x00010001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00010001 - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_boolean (XDR *, rpc_boolean*); -extern bool_t xdr_rpc_uint32 (XDR *, rpc_uint32*); -extern bool_t xdr_rpc_uint16 (XDR *, rpc_uint16*); -extern bool_t xdr_rpc_uint8 (XDR *, rpc_uint8*); -extern bool_t xdr_rpc_int32 (XDR *, rpc_int32*); -extern bool_t xdr_rpc_byte (XDR *, rpc_byte*); -extern bool_t xdr_rpc_uint64 (XDR *, rpc_uint64*); -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_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_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_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_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_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_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_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_open_status_s_type (XDR *, rpc_loc_server_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_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_boolean (); -extern bool_t xdr_rpc_uint32 (); -extern bool_t xdr_rpc_uint16 (); -extern bool_t xdr_rpc_uint8 (); -extern bool_t xdr_rpc_int32 (); -extern bool_t xdr_rpc_byte (); -extern bool_t xdr_rpc_uint64 (); -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_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_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_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_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_request_e_type (); -extern bool_t xdr_rpc_loc_server_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_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_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_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_H_RPCGEN */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h b/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h deleted file mode 100644 index e62eb367..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_api_fixup.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - @file: loc_api_fixup.h - @brief: Loc API Android RPC amendment header - - DESCRIPTION - Loc API Android RPC amendment header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 RCP failure -#define RPC_LOC_API_RPC_FAILURE (-1234) - -#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_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 - -/* 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 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h b/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h deleted file mode 100644 index 92d4e150..00000000 --- a/loc_api/libloc_api-rpc/inc-3200/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/loc_api/libloc_api-rpc/inc/debug.h b/loc_api/libloc_api-rpc/inc/debug.h deleted file mode 100644 index a71b23a0..00000000 --- a/loc_api/libloc_api-rpc/inc/debug.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "libgps-rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - LOGD(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); \ - LOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - LOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h deleted file mode 100644 index ef972bd6..00000000 --- a/loc_api/libloc_api-rpc/inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - @file: loc_api_rpc_glue.h - @brief: Loc API Android glue code header - - DESCRIPTION - Loc API Android glue code header - - INITIALIZATION AND SEQUENCING REQUIREMENTS - - ----------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - ----------------------------------------------------------------------------- - ******************************************************************************/ - -/*===================================================================== - EDIT HISTORY FOR MODULE - - This section contains comments describing changes made to the module. - Notice that changes are listed in reverse chronological order. - -when who what, where, why --------- --- ------------------------------------------------------- -03/17/09 dx Initial version - -$Id: //source/qcom/qct/modem/gps/cgps/dev/locationmiddleware/locapi/app-linux/source/test/loc_api_test/loc_api_cb_log.h#4 $ -======================================================================*/ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#include "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "loc_api_fixup.h" - -#ifdef __cplusplus -extern "C" -{ -#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 - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - 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 */ -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback -); - -extern int32 loc_close -( - 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 -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c deleted file mode 100644 index 7fcfd6cb..00000000 --- a/loc_api/libloc_api-rpc/src/loc_apicb_appinit.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ------------------------------------------------------------------------------- -Copyright (c) 2009, QUALCOMM USA, INC. - -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 QUALCOMM USA, INC. 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "loc_api_common.h" -#include "loc_api.h" -#include "loc_api_cb.h" -#include "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; - } - xprt_unregister(svrPort); - svc_destroy(svrPort); - //svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - svrPort = NULL; -} diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index a1488a02..62905e8c 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -41,7 +41,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - hardware/qcom/gps/loc_api/libloc_api_50001 + hardware/qcom/gps/loc_api/libloc_api_50001 \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -76,6 +77,9 @@ LOCAL_SHARED_LIBRARIES := \ libgps.utils \ libdl +ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) +endif + LOCAL_SRC_FILES += \ loc.cpp \ gps.c @@ -91,10 +95,11 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_MODULE_RELATIVE_PATH := hw include $(BUILD_SHARED_LIBRARY) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 0b17b2c3..1d1a59ed 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -29,10 +29,17 @@ #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) : @@ -55,17 +62,22 @@ void LocInternalAdapter::getZppInt() { LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator) : + 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, - LocDualContext::mLocationHalName) + NULL, + LocDualContext::mLocationHalName, + false) :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mAgpsEnabled(false), mCPIEnabled(false) + mSupportsAgpsRequests(false), + mSupportsPositionInjection(false), + mSupportsTimeInjection(false), + mPowerVote(0) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -79,6 +91,173 @@ LocEngAdapter::~LocEngAdapter() 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 + size_t len = strlen(buf); + while (--len >= 0 && isspace(buf[len])) { + buf[len] = '\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; @@ -123,6 +302,48 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) 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); + } + + delete mUlp; + mUlp = ulp; +} + void LocInternalAdapter::reportPosition(UlpLocation &location, GpsLocationExtended &locationExtended, void* locationExt, @@ -157,14 +378,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, +void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GpsSvStatus &svStatus, +void LocEngAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { @@ -210,84 +431,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1, const char* url3, const int maxlength) { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngReportXtraServer(mOwner, url1, url2, url3, maxlength)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestATL(mOwner, connHandle, agps_type)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::releaseATL(int connHandle) { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngReleaseATL(mOwner, connHandle)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestXtraData() { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestXtra(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestTime() { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestTime(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) { - if (mAgpsEnabled) { + if (mSupportsAgpsRequests) { notif.size = sizeof(notif); notif.timeout = LOC_NI_NO_RESPONSE_TIME; sendMsg(new LocEngRequestNi(mOwner, notif, data)); } - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::requestSuplES(int connHandle) { - if (mAgpsEnabled) + if (mSupportsAgpsRequests) sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::reportDataCallOpened() { - if(mAgpsEnabled) + if(mSupportsAgpsRequests) sendMsg(new LocEngSuplEsOpened(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline bool LocEngAdapter::reportDataCallClosed() { - if(mAgpsEnabled) + if(mSupportsAgpsRequests) sendMsg(new LocEngSuplEsClosed(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsRequests; } inline @@ -301,3 +522,80 @@ 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); + } else { + mSupportsTimeInjection = true; + } + 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::reportGpsMeasurementData(GpsData &gpsMeasurementData) +{ + sendMsg(new LocEngReportGpsMeasurement(mOwner, + gpsMeasurementData)); +} + +/* + Update Registration Mask + */ +void LocEngAdapter::updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) +{ + LOC_LOGD("entering %s", __func__); + int result = LOC_API_ADAPTER_ERR_FAILURE; + result = mLocApi->updateRegistrationMask(event, isEnabled); + if (result == LOC_API_ADAPTER_ERR_SUCCESS) { + LOC_LOGD("%s] update registration mask succeed.", __func__); + } else { + LOC_LOGE("%s] update registration mask failed.", __func__); + } +} + +/* + Set Gnss Constellation Config + */ +bool LocEngAdapter::gnssConstellationConfig() +{ + LOC_LOGD("entering %s", __func__); + bool result = false; + result = mLocApi->gnssConstellationConfig(); + return result; +} diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index ea04f077..72b780d1 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -54,7 +54,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -73,25 +73,37 @@ class LocEngAdapter : public LocAdapterBase { 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; public: - bool mAgpsEnabled; - bool mCPIEnabled; + bool mSupportsAgpsRequests; + bool mSupportsPositionInjection; + bool mSupportsTimeInjection; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner,ContextBase* context, - MsgTask::tCreate tCreator); + 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 hasAgpsExt() { return mContext->hasAgpsExt(); } - inline bool hasCPIExt() { return mContext->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { + return mContext->hasAgpsExtendedCapabilities(); + } + inline bool hasCPIExtendedCapabilities() { + return mContext->hasCPIExtendedCapabilities(); + } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err @@ -124,11 +136,6 @@ public: { return mLocApi->injectPosition(latitude, longitude, accuracy); } - inline enum loc_api_adapter_err - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) - { - return mLocApi->setTime(time, timeReference, uncertainty); - } inline enum loc_api_adapter_err setXtraData(char* data, int length) { @@ -184,9 +191,9 @@ public: return mLocApi->setLPPConfig(profile); } inline enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage) + setSensorControlConfig(int sensorUsage, int sensorProvider) { - return mLocApi->setSensorControlConfig(sensorUsage); + return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider); } inline enum loc_api_adapter_err setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, @@ -242,9 +249,18 @@ public: inline enum loc_api_adapter_err getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) { - return mLocApi->getZppFix(zppLoc, 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, @@ -252,7 +268,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -267,6 +283,7 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); + virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); inline const LocPosMode& getPositionMode() const {return mFixCriteria;} @@ -274,16 +291,40 @@ public: { 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(unsigned int lock) + 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 @@ -293,6 +334,17 @@ public: { return mLocApi->getGpsLock(); } + + /* + Update Registration Mask + */ + void updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled); + + /* + Set Gnss Constellation Config + */ + bool gnssConstellationConfig(); }; #endif //LOC_API_ENG_ADAPTER_H diff --git a/loc_api/libloc_api_50001/gps.c b/loc_api/libloc_api_50001/gps.c index 46596aa4..29f20f42 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* 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 diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 83249f40..7411dc5a 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -47,6 +47,8 @@ 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; @@ -68,7 +70,6 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re 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 = { @@ -90,6 +91,7 @@ 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 = { @@ -98,7 +100,8 @@ static const AGpsInterface sLocEngAGpsInterface = loc_agps_open, loc_agps_closed, loc_agps_open_failed, - loc_agps_set_server + loc_agps_set_server, + loc_agps_open_with_apniptype }; static int loc_xtra_init(GpsXtraCallbacks* callbacks); @@ -114,13 +117,23 @@ static const GpsXtraInterface sLocEngXTRAInterface = static void loc_ni_init(GpsNiCallbacks *callbacks); static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); -const GpsNiInterface sLocEngNiInterface = +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); @@ -139,9 +152,29 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = 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 @@ -194,10 +227,11 @@ extern "C" const GpsInterface* get_gps_interface() target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - int gnssType = getTargetGnssType(target); - switch (gnssType) + 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); @@ -270,16 +304,31 @@ static int loc_init(GpsCallbacks* callbacks) 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->request_utc_time_cb, /* request_utc_time_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->requestUlp(gps_conf.CAPABILITIES); - loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); - loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); + 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->setGpsLockMsg(0); + loc_afw_data.adapter->requestUlp(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; } @@ -303,19 +352,14 @@ SIDE EFFECTS 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; -/* - if (gss_fd >= 0) - { - close(gss_fd); - gss_fd = -1; - LOC_LOGD("GSS shutdown.\n"); - } -*/ - EXIT_LOG(%s, VOID_RET); } @@ -462,33 +506,11 @@ SIDE EFFECTS ===========================================================================*/ static int loc_inject_location(double latitude, double longitude, float accuracy) { - static bool initialized = false; - static bool enable_cpi = true; - accuracy = 1000; ENTRY_LOG(); - if(!initialized) - { - char value[PROPERTY_VALUE_MAX]; - memset(value, 0, sizeof(value)); - (void)platform_lib_abstraction_property_get("persist.gps.qc_nlp_in_use", value, "0"); - if(0 == strcmp(value, "1")) - { - enable_cpi = false; - LOC_LOGI("GPS HAL coarse position injection disabled"); - } - else - { - LOC_LOGI("GPS HAL coarse position injection enabled"); - } - initialized = true; - } - int ret_val = 0; - if(enable_cpi) - { - ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); - } + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + EXIT_LOG(%d, ret_val); return ret_val; } @@ -544,7 +566,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL) { + if ((error = dlerror()) != NULL || NULL == get_gps_geofence_interface) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } @@ -604,6 +626,18 @@ const void* loc_get_extension(const char* name) 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"); @@ -663,6 +697,50 @@ static int loc_agps_open(const char* apn) 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_INVALID; + 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 @@ -775,7 +853,10 @@ SIDE EFFECTS static int loc_xtra_init(GpsXtraCallbacks* callbacks) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); + 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; @@ -811,6 +892,56 @@ static int loc_xtra_inject_data(char* data, int length) 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 @@ -888,6 +1019,40 @@ static void loc_agps_ril_update_network_availability(int available, const char* 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(); @@ -910,3 +1075,4 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) } EXIT_LOG(%s, VOID_RET); } + diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 8f41659a..41b968c4 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 19c54a0f..de72aa8d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2009-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 @@ -87,13 +87,27 @@ loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ -static loc_param_s_type loc_parameter_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'}, + {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, + {"SUPL_MODE", &gps_conf.SUPL_MODE, 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'}, - {"SUPL_VER", &gps_conf.SUPL_VER, 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'}, +}; + +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'}, @@ -110,23 +124,29 @@ static loc_param_s_type loc_parameter_table[] = {"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'}, - {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'}, - {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, - {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, 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'} + {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'} }; static void loc_default_parameters(void) { - /* defaults */ + /*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.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; + /*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; @@ -139,25 +159,22 @@ static void loc_default_parameters(void) 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; - /* 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; + /* None of the 10 slots for agps certificates are writable by default */ + gps_conf.AGPS_CERT_WRITABLE_MASK = 0; } // 2nd half of init(), singled out for @@ -181,7 +198,6 @@ 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); @@ -200,7 +216,6 @@ static void* noProc(void* data) return NULL; } - /********************************************************************* * definitions of the static messages used in the file *********************************************************************/ @@ -321,7 +336,6 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } -// case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; const GpsUtcTime mTime; @@ -470,6 +484,24 @@ struct LocEngSuplVer : public LocMsg { } }; +struct LocEngSuplMode : public LocMsg { + UlpProxyBase* mUlp; + + inline LocEngSuplMode(UlpProxyBase* ulp) : + LocMsg(), mUlp(ulp) + { + locallog(); + } + inline virtual void proc() const { + mUlp->setCapabilities(getCarrierCapabilities()); + } + inline void locallog() const { + } + inline virtual void log() const { + locallog(); + } +}; + // case LOC_ENG_MSG_LPP_CONFIG: struct LocEngLppConfig : public LocMsg { LocEngAdapter* mAdapter; @@ -495,18 +527,20 @@ struct LocEngLppConfig : public LocMsg { struct LocEngSensorControlConfig : public LocMsg { LocEngAdapter* mAdapter; const int mSensorsDisabled; + const int mSensorProvider; inline LocEngSensorControlConfig(LocEngAdapter* adapter, - int sensorsDisabled) : - LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled) + int sensorsDisabled, int sensorProvider) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled), + mSensorProvider(sensorProvider) { locallog(); } inline virtual void proc() const { - mAdapter->setSensorControlConfig(mSensorsDisabled); + mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider); } inline void locallog() const { - LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d", - mSensorsDisabled); + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d", + mSensorsDisabled, mSensorProvider); } inline virtual void log() const { locallog(); @@ -750,8 +784,13 @@ void LocEngReportPosition::proc() const { 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 && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS) + locEng->adapter->isInSession()) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); @@ -770,16 +809,7 @@ void LocEngReportPosition::proc() const { } } void LocEngReportPosition::locallog() const { - 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", - mLocation.gpsLocation.flags, mLocation.position_source, - mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, - mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, - mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, - mLocation.gpsLocation.timestamp, mLocation.rawDataSize, - mLocation.rawData, mStatus, mTechMask); + LOC_LOGV("LocEngReportPosition"); } void LocEngReportPosition::log() const { locallog(); @@ -791,7 +821,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), @@ -820,19 +850,7 @@ void LocEngReportSv::proc() const { } } void LocEngReportSv::locallog() const { - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " - "used in fix mask: %x\n sv: prn snr " - "elevation azimuth", - mSvStatus.num_svs, mSvStatus.ephemeris_mask, - mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); - for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f\n ", - i, - mSvStatus.sv_list[i].prn, - mSvStatus.sv_list[i].snr, - mSvStatus.sv_list[i].elevation, - mSvStatus.sv_list[i].azimuth); - } + LOC_LOGV("%s:%d] LocEngReportSv",__func__, __LINE__); } inline void LocEngReportSv::log() const { locallog(); @@ -1069,7 +1087,17 @@ void LocEngRequestSuplEs::proc() const { AgpsStateMachine* sm = locEng->ds_nif; DSSubscriber s(sm, mID); sm->subscribeRsrc((Subscriber*)&s); - } else { + } + 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); } } @@ -1315,6 +1343,33 @@ struct LocEngEnableData : public LocMsg { // 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(); + } +}; + // case LOC_ENG_MSG_LOC_INIT: struct LocEngInit : public LocMsg { loc_eng_data_s_type* mLocEng; @@ -1325,6 +1380,8 @@ struct LocEngInit : public LocMsg { } inline virtual void proc() const { loc_eng_reinit(*mLocEng); + // set the capabilities + mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng)); } inline void locallog() const { @@ -1367,7 +1424,7 @@ struct LocEngAtlOpenSuccess : public LocMsg { mStateMachine->onRsrcEvent(RSRC_GRANTED); } inline void locallog() const { - LOC_LOGV("LocEngAtlClosed agps type: %s\n apn: %s\n" + LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n" " bearer type: %s", loc_get_agps_type_name(mStateMachine->getType()), mAPN, @@ -1468,6 +1525,144 @@ struct LocEngDataClientInit : public LocMsg { } }; +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 LocEngUpdateRegistrationMask : public LocMsg { + loc_eng_data_s_type* mLocEng; + LOC_API_ADAPTER_EVENT_MASK_T mMask; + loc_registration_mask_status mIsEnabled; + inline LocEngUpdateRegistrationMask(loc_eng_data_s_type* locEng, + LOC_API_ADAPTER_EVENT_MASK_T mask, + loc_registration_mask_status isEnabled) : + LocMsg(), mLocEng(locEng), mMask(mask), mIsEnabled(isEnabled) { + locallog(); + } + inline virtual void proc() const { + loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; + locEng->adapter->updateRegistrationMask(mMask, + mIsEnabled); + } + void locallog() const { + LOC_LOGV("LocEngUpdateRegistrationMask\n"); + } + virtual void log() const { + locallog(); + } +}; + +struct LocEngGnssConstellationConfig : public LocMsg { + LocEngAdapter* mAdapter; + inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) { + locallog(); + } + inline virtual void proc() const { + if (mAdapter->gnssConstellationConfig()) { + LOC_LOGV("Modem supports GNSS measurements\n"); + gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS; + } else { + 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: +LocEngReportGpsMeasurement::LocEngReportGpsMeasurement(void* locEng, + GpsData &gpsData) : + LocMsg(), mLocEng(locEng), mGpsData(gpsData) +{ + locallog(); +} +void LocEngReportGpsMeasurement::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->gps_measurement_cb != NULL) { + locEng->gps_measurement_cb((GpsData*)&(mGpsData)); + } + } +} +void LocEngReportGpsMeasurement::locallog() const { + IF_LOC_LOGV { + LOC_LOGV("%s:%d]: Received in GPS HAL." + "GNSS Measurements count: %d \n", + __func__, __LINE__, mGpsData.measurement_count); + for (int i =0; i< mGpsData.measurement_count && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" GNSS measurement data in GPS HAL: \n" + " GPS_HAL => Measurement ID | prn | time_offset_ns | state |" + " received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |" + " pseudorange_rate_uncertainty_mps |" + " accumulated_delta_range_state | flags \n" + " GPS_HAL => %d | %d | %f | %d | %lld | %f | %f | %f | %d | %d \n", + i, + mGpsData.measurements[i].prn, + mGpsData.measurements[i].time_offset_ns, + mGpsData.measurements[i].state, + mGpsData.measurements[i].received_gps_tow_ns, + mGpsData.measurements[i].c_n0_dbhz, + mGpsData.measurements[i].pseudorange_rate_mps, + mGpsData.measurements[i].pseudorange_rate_uncertainty_mps, + mGpsData.measurements[i].accumulated_delta_range_state, + mGpsData.measurements[i].flags); + } + LOC_LOGV(" GPS_HAL => Clocks Info: type | time_ns \n" + " GPS_HAL => Clocks Info: %d | %lld", mGpsData.clock.type, + mGpsData.clock.time_ns); + } +} +inline void LocEngReportGpsMeasurement::log() const { + locallog(); +} /********************************************************************* * Initialization checking macros @@ -1482,6 +1677,24 @@ struct LocEngDataClientInit : public LocMsg { } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) +uint32_t getCarrierCapabilities() { + #define carrierMSA (uint32_t)0x2 + #define carrierMSB (uint32_t)0x1 + #define gpsConfMSA (uint32_t)0x4 + #define gpsConfMSB (uint32_t)0x2 + uint32_t capabilities = gps_conf.CAPABILITIES; + if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { + capabilities &= ~gpsConfMSA; + } + if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { + capabilities &= ~gpsConfMSB; + } + + LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", + gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities); + return capabilities; +} + /*=========================================================================== FUNCTION loc_eng_init @@ -1518,15 +1731,12 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - if (NULL != callbacks->set_capabilities_cb) { - callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); - } - // 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; @@ -1535,7 +1745,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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; @@ -1553,7 +1762,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, context, - (MsgTask::tCreate)callbacks->create_thread_cb); + (LocThread::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); @@ -1567,51 +1776,51 @@ 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; - if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { - LOC_LOGD("loc_eng_reinit reinit() successful"); + 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)); - LocEngAdapter* adapter = loc_eng_data.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)); - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - - /* 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))); + /* 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; } @@ -1711,10 +1920,11 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) 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_ENGINE_DOWN || + ret_val == LOC_API_ADAPTER_ERR_PHONE_OFFLINE || + ret_val == LOC_API_ADAPTER_ERR_INTERNAL) { loc_eng_data.adapter->setInSession(TRUE); - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -1760,11 +1970,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { ret_val = loc_eng_data.adapter->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); - } - loc_eng_data.adapter->setInSession(FALSE); } @@ -1817,14 +2022,12 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - int gnssType = getTargetGnssType(loc_get_target()); - - // The position mode for GSS/QCA1530 can only be standalone - bool is1530 = gnssType == GNSS_QCA1530; - bool isAPQ = gnssType == GNSS_GSS; - if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) { + // 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 GSS/qca1530."); + LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -1890,7 +2093,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if(!adapter->mCPIEnabled) + if(adapter->mSupportsPositionInjection) { adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, accuracy)); @@ -2096,18 +2299,17 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - int gnssType = getTargetGnssType(loc_get_target()); - bool isAPQ = (gnssType == GNSS_GSS); - bool is1530 = (gnssType == GNSS_QCA1530); - if (!isAPQ && !is1530) { + if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, (void *)loc_eng_data.agps_status_cb, AGPS_TYPE_SUPL, false); - if (adapter->mAgpsEnabled) { - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - + if (adapter->mSupportsAgpsRequests) { + if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + } loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, NULL, NULL, &loc_eng_data); } @@ -2139,7 +2341,9 @@ getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { break; } case AGPS_TYPE_SUPL_ES: { - stateMachine = locEng.ds_nif; + locEng.ds_nif ? + stateMachine = locEng.ds_nif: + stateMachine = locEng.agnss_nif; break; } default: @@ -2319,7 +2523,14 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, if (LOC_AGPS_SUPL_SERVER == type) { char url[MAX_URL_LEN]; - unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + 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)); @@ -2369,29 +2580,29 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, 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); - } else { - LOC_LOGW("set_server called before init. 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); - } } EXIT_LOG(%d, ret_val); @@ -2438,6 +2649,93 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d 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->getUlpProxy())); + } + } + + 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.GPS_LOCK = gps_conf.GPS_LOCK; + gps_conf = gps_conf_tmp; + } + + EXIT_LOG(%s, VOID_RET); +} + /*=========================================================================== FUNCTION loc_eng_report_status @@ -2537,6 +2835,8 @@ 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(); @@ -2546,14 +2846,11 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_agps_reinit(loc_eng_data); } - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); - // 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->setPositionMode(NULL); loc_eng_data.adapter->setInSession(false); - loc_eng_start_handler(loc_eng_data); + loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); } EXIT_LOG(%s, VOID_RET); } @@ -2583,8 +2880,8 @@ int loc_eng_read_config(void) 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, loc_parameter_table); - UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table); + 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"); @@ -2593,3 +2890,80 @@ int loc_eng_read_config(void) 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.gps_measurement_cb), + "gps 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->sendMsg(new LocEngUpdateRegistrationMask( + &loc_eng_data, + event, + LOC_REGISTRATION_MASK_ENABLED)); + // set up the callback + loc_eng_data.gps_measurement_cb = callbacks->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->sendMsg(new LocEngUpdateRegistrationMask( + &loc_eng_data, + event, + LOC_REGISTRATION_MASK_DISABLED)); + // set up the callback + loc_eng_data.gps_measurement_cb = NULL; + EXIT_LOG(%d, 0); +} diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index c1dc8af5..92814f8d 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -89,9 +89,11 @@ typedef struct loc_eng_data_s agps_status_extended agps_status_cb; gps_nmea_callback nmea_cb; gps_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; + gps_measurement_callback gps_measurement_cb; boolean intermediateFix; AGpsStatusValue agps_status; loc_eng_xtra_data_s_type xtra_module_data; @@ -137,36 +139,50 @@ typedef struct loc_eng_data_s } loc_eng_data_s_type; /* 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 { - unsigned long INTERMEDIATE_POS; - unsigned long ACCURACY_THRES; - unsigned long SUPL_VER; - unsigned long CAPABILITIES; - unsigned long QUIPC_ENABLED; - unsigned long LPP_PROFILE; - uint8_t NMEA_PROVIDER; - unsigned long A_GLONASS_POS_PROTOCOL_SELECT; - 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 INTERMEDIATE_POS; + uint32_t ACCURACY_THRES; + uint32_t SUPL_VER; + uint32_t SUPL_MODE; + 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; } 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; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; - unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH; - unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; - unsigned long SENSOR_CONTROL_MODE; - unsigned long SENSOR_USAGE; - unsigned long SENSOR_ALGORITHM_CONFIG_MASK; + 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; @@ -175,11 +191,16 @@ typedef struct 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; extern loc_gps_cfg_s_type gps_conf; extern loc_sap_cfg_s_type sap_conf; + +uint32_t getCarrierCapabilities(); + +//loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LOC_API_ADAPTER_EVENT_MASK_T event, @@ -199,35 +220,33 @@ 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); - -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); - - 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); - -bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, - char* command, int length); - - -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); - -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, +//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, +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); -int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); - +//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, @@ -236,7 +255,12 @@ 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); -int loc_eng_read_config(void); + +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 } diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index cf9fe82d..43af70fe 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -761,11 +761,11 @@ int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; - nifRequest.ipv6_addr[0] = 0; + memset(&nifRequest.addr, 0, sizeof(nifRequest.addr)); nifRequest.ssid[0] = '\0'; nifRequest.password[0] = '\0'; } else { - s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setIPAddresses(nifRequest.addr); s->setWifiInfo(nifRequest.ssid, nifRequest.password); } diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index d68970f3..8b8f9f44 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -280,6 +280,7 @@ struct Subscriber { 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; } @@ -320,6 +321,9 @@ struct BITSubscriber : public Subscriber { 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); @@ -344,6 +348,9 @@ struct ATLSubscriber : public Subscriber { 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, @@ -376,6 +383,9 @@ struct WIFISubscriber : public Subscriber { 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) @@ -409,6 +419,8 @@ struct DSSubscriber : public Subscriber { 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); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp index d24e0c9d..5510fc5c 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -136,7 +136,7 @@ static int loc_api_server_proc(void *context) free(p_cmsgbuf); LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); usleep(1000); - return 0; + return -1; } LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h index c7c100b2..1d8c1428 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -33,11 +33,11 @@ #ifdef _ANDROID_ -#define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" -#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" -#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" -#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" +#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 diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 9a8b0e4d..3a1a86b9 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GpsSvStatus mSvStatus; + const GnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; @@ -289,6 +289,16 @@ struct LocEngGetZpp : public LocMsg { void send() const; }; +struct LocEngReportGpsMeasurement : public LocMsg { + void* mLocEng; + const GpsData mGpsData; + LocEngReportGpsMeasurement(void* locEng, + GpsData &gpsData); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index cc894481..3b20bbbc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -115,28 +115,45 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, 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 busy, use default or deny */ - if (NULL != loc_eng_ni_data_p->rawRequest) - { - /* XXX Consider sending a NO RESPONSE reply or queue the request */ - LOC_LOGW("loc_eng_ni_request_handler, notification in progress, new NI request ignored, type: %d", - notif->ni_type); - if (NULL != passThrough) { - free((void*)passThrough); + 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; } } - else { + + + if (pSession) { /* Save request */ - loc_eng_ni_data_p->rawRequest = (void*)passThrough; + 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 = loc_eng_ni_data_p->reqID; + ((GpsNiNotification*)notif)->notification_id = pSession->reqID; if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) { @@ -155,16 +172,16 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, /* 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. **/ - loc_eng_ni_data_p->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", loc_eng_ni_data_p->respTimeLeft); + 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(&loc_eng_ni_data_p->thread, NULL, ni_thread_proc, &loc_eng_data); + rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession); if (rc) { LOC_LOGE("Loc NI thread is not created.\n"); } - rc = pthread_detach(loc_eng_ni_data_p->thread); + rc = pthread_detach(pSession->thread); if (rc) { LOC_LOGE("Loc NI thread is not detached.\n"); @@ -185,61 +202,63 @@ static void* ni_thread_proc(void *args) { ENTRY_LOG(); - loc_eng_data_s_type* loc_eng_data_p = (loc_eng_data_s_type*)args; - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data_p->loc_eng_ni_data; + 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(&loc_eng_ni_data_p->tLock); + pthread_mutex_lock(&pSession->tLock); /* Calculate absolute expire time */ gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec + loc_eng_ni_data_p->respTimeLeft; + 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, loc_eng_ni_data_p->respTimeLeft ); + (long) expire_time.tv_sec, pSession->respTimeLeft ); - while (!loc_eng_ni_data_p->respRecvd) + while (!pSession->respRecvd) { - rc = pthread_cond_timedwait(&loc_eng_ni_data_p->tCond, - &loc_eng_ni_data_p->tLock, + rc = pthread_cond_timedwait(&pSession->tCond, + &pSession->tLock, &expire_time); if (rc == ETIMEDOUT) { - loc_eng_ni_data_p->resp = GPS_NI_RESPONSE_NORESP; + 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 ); - loc_eng_ni_data_p->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + pSession->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + + LOC_LOGD("pSession->resp is %d\n",pSession->resp); LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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 = loc_eng_data_p->adapter; + LocEngAdapter* adapter = pSession->adapter; LocEngInformNiResponse *msg = NULL; - if (NULL != loc_eng_ni_data_p->rawRequest) { - if (loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("loc_eng_ni_data_p->resp != GPS_NI_RESPONSE_IGNORE \n"); + if (NULL != pSession->rawRequest) { + if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); msg = new LocEngInformNiResponse(adapter, - loc_eng_ni_data_p->resp, - loc_eng_ni_data_p->rawRequest); + pSession->resp, + pSession->rawRequest); } else { LOC_LOGD("this is the ignore reply for SUPL ES\n"); + free(pSession->rawRequest); } - loc_eng_ni_data_p->rawRequest = NULL; + pSession->rawRequest = NULL; } - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + pthread_mutex_unlock(&pSession->tLock); - loc_eng_ni_data_p->respTimeLeft = 0; - loc_eng_ni_data_p->reqID++; + pSession->respTimeLeft = 0; + pSession->reqID = 0; if (NULL != msg) { LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); @@ -261,16 +280,28 @@ void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data) } // only if modem has requested but then died. - if (NULL != loc_eng_ni_data_p->rawRequest) { - free(loc_eng_ni_data_p->rawRequest); - loc_eng_ni_data_p->rawRequest = NULL; + 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->tLock); + 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->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + 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); @@ -304,12 +335,19 @@ void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callb 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->respTimeLeft = 0; - loc_eng_ni_data_p->respRecvd = FALSE; - loc_eng_ni_data_p->rawRequest = NULL; - loc_eng_ni_data_p->reqID = 0; - pthread_cond_init(&loc_eng_ni_data_p->tCond, NULL); - pthread_mutex_init(&loc_eng_ni_data_p->tLock, NULL); + 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); @@ -337,25 +375,40 @@ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, { 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->reqID && - NULL != loc_eng_ni_data_p->rawRequest) - { + 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(&loc_eng_ni_data_p->tLock); - loc_eng_ni_data_p->resp = user_response; - loc_eng_ni_data_p->respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->tLock); + 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: reqID %d and notif_id %d mismatch or rawRequest %p, response: %d", - loc_eng_ni_data_p->reqID, notif_id, loc_eng_ni_data_p->rawRequest, user_response); + LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id); } EXIT_LOG(%s, VOID_RET); diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 8c076041..068f5cdd 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -31,6 +31,7 @@ #define LOC_ENG_NI_H #include +#include #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ #define LOC_NI_NOTIF_KEY_ADDRESS "Address" @@ -45,6 +46,13 @@ typedef struct { 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; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 6c9356e4..2a23db32 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -119,13 +119,17 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, 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; - time_t utcTime(location.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); 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; @@ -601,7 +605,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -787,46 +791,24 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.used_in_fix_mask == 0) - { // No sv used, so there will be no position report, so send - // blank NMEA sentences - 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); + // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask; - 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); + // 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 - { // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask; - - // 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; - } - + { + 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/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 40c6dbbd..066943aa 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -31,12 +31,13 @@ #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 GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); +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/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 1459c4c7..9207564b 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -81,6 +81,25 @@ struct LocEngInjectXtraData : public LocMsg { } }; +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 @@ -102,6 +121,7 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, { int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; + ENTRY_LOG(); if(callbacks == NULL) { LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); @@ -112,6 +132,7 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, ret_val = 0; } + EXIT_LOG(%d, ret_val); return ret_val; } @@ -125,8 +146,7 @@ DEPENDENCIES N/A RETURN VALUE - 0: success - >0: failure + 0 SIDE EFFECTS N/A @@ -135,9 +155,10 @@ SIDE EFFECTS 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; } /*=========================================================================== @@ -150,7 +171,7 @@ DEPENDENCIES N/A RETURN VALUE - length of server string + 0 SIDE EFFECTS N/A @@ -158,9 +179,34 @@ SIDE EFFECTS ===========================================================================*/ 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/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index f78303c9..205c9fff 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014 The Linux Foundation. All rights reserved. +/* 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 @@ -82,6 +82,8 @@ 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 @@ -97,37 +99,47 @@ char* get_timestamp(char* str, unsigned long buf_size); 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_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("W/"__VA_ARGS__); } +IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); } #define LOC_LOGW(...) \ -if ((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("W/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/"__VA_ARGS__); } +IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); } #define LOC_LOGI(...) \ -if ((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("I/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/"__VA_ARGS__); } +IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); } #define LOC_LOGD(...) \ -if ((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("D/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/"__VA_ARGS__); } +IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); } #define LOC_LOGV(...) \ -if ((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) { ALOGE("V/"__VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/"__VA_ARGS__); } +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_LOGE(...) ALOGE("E/" __VA_ARGS__) -#define LOC_LOGW(...) ALOGW("W/"__VA_ARGS__) +#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) -#define LOC_LOGI(...) ALOGI("I/"__VA_ARGS__) +#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) -#define LOC_LOGD(...) ALOGD("D/"__VA_ARGS__) +#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) -#define LOC_LOGV(...) ALOGV("V/"__VA_ARGS__) +#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) #endif /* DEBUG_DMN_LOC_API */ @@ -148,12 +160,18 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/"__VA_ARGS__); } } \ } while(0) - #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 diff --git a/utils/Android.mk b/utils/Android.mk index 24ab8a13..37512a58 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -18,19 +18,27 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - loc_timer.c \ - ../platform_lib_abstractions/elapsed_millis_since_boot.cpp - + platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ + loc_misc_utils.cpp LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -std=c++11 + +ifeq ($(TARGET_BUILD_VARIANT),user) + LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER +endif LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../platform_lib_abstractions + $(LOCAL_PATH)/platform_lib_abstractions LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -39,20 +47,25 @@ LOCAL_COPY_HEADERS:= \ log_util.h \ linked_list.h \ msg_q.h \ + MsgTask.h \ + LocHeap.h \ + LocThread.h \ + LocTimer.h \ loc_target.h \ loc_timer.h \ - ../platform_lib_abstractions/platform_lib_includes.h \ - ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.h - + LocSharedLock.h \ + platform_lib_abstractions/platform_lib_includes.h \ + platform_lib_abstractions/platform_lib_time.h \ + platform_lib_abstractions/platform_lib_macros.h \ + loc_misc_utils.h LOCAL_MODULE := libgps.utils +LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/LocHeap.cpp b/utils/LocHeap.cpp new file mode 100644 index 00000000..d667f14f --- /dev/null +++ b/utils/LocHeap.cpp @@ -0,0 +1,354 @@ +/* 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/utils/LocHeap.h b/utils/LocHeap.h new file mode 100644 index 00000000..b491948a --- /dev/null +++ b/utils/LocHeap.h @@ -0,0 +1,96 @@ +/* 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/utils/LocSharedLock.h b/utils/LocSharedLock.h new file mode 100644 index 00000000..7fe62376 --- /dev/null +++ b/utils/LocSharedLock.h @@ -0,0 +1,59 @@ +/* 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/utils/LocThread.cpp b/utils/LocThread.cpp new file mode 100644 index 00000000..19bf101a --- /dev/null +++ b/utils/LocThread.cpp @@ -0,0 +1,264 @@ +/* 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 + +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) - 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/utils/LocThread.h b/utils/LocThread.h new file mode 100644 index 00000000..2a65d8fa --- /dev/null +++ b/utils/LocThread.h @@ -0,0 +1,92 @@ +/* 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/utils/LocTimer.cpp b/utils/LocTimer.cpp new file mode 100644 index 00000000..70904b2a --- /dev/null +++ b/utils/LocTimer.cpp @@ -0,0 +1,737 @@ +/* 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, this obj outRanks higher + rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + } + 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/utils/LocTimer.h b/utils/LocTimer.h new file mode 100644 index 00000000..c1468524 --- /dev/null +++ b/utils/LocTimer.h @@ -0,0 +1,74 @@ +/* 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/utils/MsgTask.cpp b/utils/MsgTask.cpp new file mode 100644 index 00000000..f33d6024 --- /dev/null +++ b/utils/MsgTask.cpp @@ -0,0 +1,100 @@ +/* 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 + +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() { + msg_q_unblock((void*)mQ); + if (mThread) { + LocThread* thread = mThread; + 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 + set_sched_policy(gettid(), 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/core/MsgTask.h b/utils/MsgTask.h similarity index 67% rename from core/MsgTask.h rename to utils/MsgTask.h index d09de731..9eb1f567 100644 --- a/core/MsgTask.h +++ b/utils/MsgTask.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -29,12 +29,7 @@ #ifndef __MSG_TASK__ #define __MSG_TASK__ -#include -#include -#include -#include - -namespace loc_core { +#include struct LocMsg { inline LocMsg() {} @@ -43,24 +38,30 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask { -public: - typedef void* (*tStart)(void*); - typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); - typedef int (*tAssociate)(); - MsgTask(tCreate tCreator, const char* threadName); - MsgTask(tAssociate tAssociator, const char* threadName); - ~MsgTask(); - void sendMsg(const LocMsg* msg) const; - -private: +class MsgTask : public LocRunnable { const void* mQ; - tAssociate mAssociator; - MsgTask(const void* q, tAssociate associator); - static void* loopMain(void* copy); - void createPThread(const char* name); + 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() {} }; -} // namespace loc_core - #endif //__MSG_TASK__ diff --git a/utils/linked_list.c b/utils/linked_list.c index 1109acd3..acec5b1f 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -108,7 +108,7 @@ linked_list_err_type linked_list_destroy(void** list_data) ===========================================================================*/ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)) { - LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); + 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__); @@ -160,7 +160,7 @@ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dea ===========================================================================*/ linked_list_err_type linked_list_remove(void* list_data, void **data_obj) { - LOC_LOGD("%s: Removing from list\n", __FUNCTION__); + LOC_LOGV("%s: Removing from list\n", __FUNCTION__); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -267,7 +267,7 @@ 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_LOGD("%s: Search the list\n", __FUNCTION__); + 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", diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 8c76d1fe..967d2f30 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -38,8 +38,9 @@ #include #include #include -#include -#if defined(USE_GLIB) && !defined(OFF_TARGET) +#include +#include +#ifdef USE_GLIB #include #endif #include "platform_lib_includes.h" @@ -51,68 +52,23 @@ *============================================================================*/ /* Parameter data */ -static uint8_t DEBUG_LEVEL = 0xff; -static uint8_t TIMESTAMP = 0; +static uint32_t DEBUG_LEVEL = 0xff; +static uint32_t TIMESTAMP = 0; /* Parameter spec table */ -static loc_param_s_type loc_parameter_table[] = +static const loc_param_s_type loc_param_table[] = { - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; -int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type); - -/*=========================================================================== -FUNCTION trim_space - -DESCRIPTION - Removes leading and trailing spaces of the string - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void trim_space(char *org_string) -{ - char *scan_ptr, *write_ptr; - char *first_nonspace = NULL, *last_nonspace = NULL; - - scan_ptr = write_ptr = org_string; - - while (*scan_ptr) - { - if ( !isspace(*scan_ptr) && first_nonspace == NULL) - { - first_nonspace = scan_ptr; - } - - if (first_nonspace != NULL) - { - *(write_ptr++) = *scan_ptr; - if ( !isspace(*scan_ptr)) - { - last_nonspace = write_ptr; - } - } - - scan_ptr++; - } - - if (last_nonspace) { *last_nonspace = '\0'; } -} +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; + char* param_name; + char* param_str_value; + int param_int_value; + double param_double_value; }loc_param_v_type; /*=========================================================================== @@ -136,61 +92,267 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* config_value) { - if(NULL == config_entry || NULL == config_value) - { - LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); - return; - } + 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 (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; - } - 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 '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; - } - 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; + 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; - } - break; - default: - LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name); - } - } + 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; } /*=========================================================================== @@ -215,72 +377,24 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, uint32_t table_length) +void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, + uint32_t table_length) { - FILE *gps_conf_fp = NULL; - char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ - char *lasts; - loc_param_v_type config_value; - uint32_t i; + FILE *conf_fp = NULL; + char *lasts; + loc_param_v_type config_value; + uint32_t i; - if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL) - { - LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); - } - else - { - LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name); - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); - return; /* no parameter file */ - } - - /* Clear all validity bits */ - for(i = 0; NULL != config_table && i < table_length; i++) - { - if(NULL != config_table[i].param_set) - { - *(config_table[i].param_set) = 0; - } - } - - while(fgets(input_buf, LOC_MAX_PARAM_LINE, gps_conf_fp) != NULL) - { - memset(&config_value, 0, sizeof(config_value)); - - /* Separate variable and value */ - config_value.param_name = strtok_r(input_buf, "=", &lasts); - if (config_value.param_name == NULL) continue; /* skip lines that do not contain "=" */ - config_value.param_str_value = strtok_r(NULL, "=", &lasts); - if (config_value.param_str_value == NULL) continue; /* skip lines that do not contain two operands */ - - /* Trim leading and trailing spaces */ - trim_space(config_value.param_name); - trim_space(config_value.param_str_value); - - /* Parse numerical value */ - if (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(i = 0; NULL != config_table && i < table_length; i++) - { - loc_set_config_entry(&config_table[i], &config_value); - } - - for(i = 0; i < loc_param_num; i++) - { - loc_set_config_entry(&loc_parameter_table[i], &config_value); - } - } - - fclose(gps_conf_fp); - - /* Initialize logging mechanism with parsed data */ - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); + 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/utils/loc_cfg.h b/utils/loc_cfg.h index df833389..9045e1d5 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* 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 @@ -30,17 +30,22 @@ #ifndef LOC_CFG_H #define LOC_CFG_H +#include #include -#define LOC_MAX_PARAM_NAME 48 +#define LOC_MAX_PARAM_NAME 80 #define LOC_MAX_PARAM_STRING 80 -#define LOC_MAX_PARAM_LINE 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])) + loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) /*============================================================================= * @@ -49,7 +54,7 @@ *============================================================================*/ typedef struct { - char param_name[LOC_MAX_PARAM_NAME]; + const char *param_name; void *param_ptr; uint8_t *param_set; /* was this value set by config file? */ char param_type; /* 'n' for number, @@ -72,10 +77,13 @@ extern "C" { * MODULE EXPORTED FUNCTIONS * *============================================================================*/ -extern void loc_read_conf(const char* conf_file_name, - loc_param_s_type* config_table, - uint32_t table_length); - +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 diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index c64310eb..f6b54f91 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. +/* 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 @@ -47,14 +47,15 @@ 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(loc_name_val_s_type table[], int table_size, long mask) +const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val & (long) mask) @@ -66,9 +67,9 @@ const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, } /* Get names from value */ -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value) +const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val == (long) value) @@ -79,7 +80,7 @@ const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, l return UNKNOWN_STR; } -static loc_name_val_s_type loc_msg_q_status[] = +static const loc_name_val_s_type loc_msg_q_status[] = { NAME_VAL( eMSG_Q_SUCCESS ), NAME_VAL( eMSG_Q_FAILURE_GENERAL ), @@ -88,7 +89,7 @@ static loc_name_val_s_type loc_msg_q_status[] = NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ), NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER ) }; -static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); +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) @@ -102,17 +103,18 @@ const char* log_succ_fail_string(int is_succ) } //Target names -loc_name_val_s_type target_name[] = +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 int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); +static const size_t target_name_num = LOC_TABLE_SIZE(target_name); /*=========================================================================== @@ -133,7 +135,7 @@ const char *loc_get_target_name(unsigned int target) static char ret[BUFFER_SIZE]; index = getTargetGnssType(target); - if( index >= target_name_num || index < 0) + if( index < 0 || (unsigned)index >= target_name_num ) index = target_name_num - 1; if( (target & HAS_SSC) == HAS_SSC ) { @@ -162,7 +164,7 @@ RETURN VALUE The time string ===========================================================================*/ -char *loc_get_time(char *time_string, unsigned long buf_size) +char *loc_get_time(char *time_string, size_t buf_size) { struct timeval now; /* sec and usec */ struct tm now_tm; /* broken-down time */ @@ -176,3 +178,61 @@ char *loc_get_time(char *time_string, unsigned long buf_size) 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/utils/loc_log.h b/utils/loc_log.h index 82dc6368..be492b11 100644 --- a/utils/loc_log.h +++ b/utils/loc_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* 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 @@ -36,12 +36,13 @@ extern "C" #endif #include +#include #include "loc_target.h" typedef struct { - char name[128]; - long val; + const char *name; + long val; } loc_name_val_s_type; #define NAME_VAL(x) {"" #x "", x } @@ -49,17 +50,19 @@ typedef struct #define UNKNOWN_STR "UNKNOWN" #define CHECK_MASK(type, value, mask_var, mask) \ - ((mask_var & mask) ? (type) value : (type) (-1)) + (((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(loc_name_val_s_type table[], int table_size, long mask); -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long 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, unsigned long buf_size); +extern char *loc_get_time(char *time_string, size_t buf_size); #ifdef __cplusplus } diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp new file mode 100644 index 00000000..7e96313f --- /dev/null +++ b/utils/loc_misc_utils.cpp @@ -0,0 +1,114 @@ +/* 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/utils/loc_misc_utils.h b/utils/loc_misc_utils.h new file mode 100644 index 00000000..7d66d842 --- /dev/null +++ b/utils/loc_misc_utils.h @@ -0,0 +1,99 @@ +/* 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/utils/loc_target.cpp b/utils/loc_target.cpp index b5a62972..30c040c7 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012,2014, The Linux Foundation. All rights reserved. +/* 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 @@ -53,11 +53,15 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" +#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 -#define QCA1530_DETECT_TIMEOUT 30 +/* 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" @@ -99,7 +103,7 @@ static int read_a_line(const char * file_path, char * line, int line_size) */ static bool is_qca1530(void) { - static const char qca1530_property_name[] = "persist.qca1530"; + static const char qca1530_property_name[] = "sys.qca1530"; bool res = false; int ret, i; char buf[PROPERTY_VALUE_MAX]; @@ -142,6 +146,34 @@ static bool is_qca1530(void) 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__); + } +} + unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) @@ -164,7 +196,8 @@ unsigned int loc_get_target(void) goto detected; } - platform_lib_abstraction_property_get("ro.baseband", baseband, ""); + loc_get_target_baseband(baseband, sizeof(baseband)); + if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { @@ -175,8 +208,13 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - + if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + { + gTarget = TARGET_AUTO; + 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_MPQ; @@ -207,3 +245,17 @@ 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/utils/loc_target.h b/utils/loc_target.h index 4aebb851..3bb3b5e2 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -35,6 +35,7 @@ #define TARGET_MPQ 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) @@ -45,6 +46,18 @@ extern "C" 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); +/*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 { @@ -53,6 +66,7 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, + GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; diff --git a/utils/loc_timer.c b/utils/loc_timer.c deleted file mode 100644 index 0e9f6bde..00000000 --- a/utils/loc_timer.c +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2013-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 "loc_timer.h" -#include -#include -#include"platform_lib_includes.h" - -enum timer_state { - READY = 100, - WAITING, - DONE, - ABORT -}; - -typedef struct { - loc_timer_callback callback_func; - void *user_data; - unsigned int time_msec; - pthread_cond_t timer_cond; - pthread_mutex_t timer_mutex; - enum timer_state state; -}timer_data; - -static void *timer_thread(void *thread_data) -{ - int ret = -ETIMEDOUT; - struct timespec ts; - struct timeval tv; - timer_data* t = (timer_data*)thread_data; - - LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); - - gettimeofday(&tv, NULL); - clock_gettime(CLOCK_REALTIME, &ts); - if(t->time_msec >= 1000) { - ts.tv_sec += t->time_msec/1000; - t->time_msec = t->time_msec % 1000; - } - if(t->time_msec) - ts.tv_nsec += t->time_msec * 1000000; - if(ts.tv_nsec > 999999999) { - LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); - ts.tv_sec += 1; - ts.tv_nsec -= 1000000000; - } - LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" - "\t Current time: %d sec; %d nsec", - __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, - (int)tv.tv_sec, (int)tv.tv_usec*1000); - - pthread_mutex_lock(&(t->timer_mutex)); - if (READY == t->state) { - t->state = WAITING; - ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); - t->state = DONE; - } - pthread_mutex_unlock(&(t->timer_mutex)); - - switch (ret) { - case ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); - break; - case 0: - LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); - break; - case -ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); - break; - default: - LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", - __func__, __LINE__, ret); - break; - } - - pthread_mutex_destroy(&t->timer_mutex); - pthread_cond_destroy(&t->timer_cond); - - if(ETIMEDOUT == ret) - t->callback_func(t->user_data, ret); - - free(t); - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return NULL; -} - -void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, - void* caller_data) -{ - timer_data *t=NULL; - pthread_attr_t tattr; - pthread_t id; - LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); - if(cb_func == NULL || msec == 0) { - LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); - goto _err; - } - t = (timer_data *)calloc(1, sizeof(timer_data)); - if(t == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", - __func__, __LINE__); - goto _err; - } - - if(pthread_cond_init(&(t->timer_cond), NULL)) { - LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); - goto t_err; - } - if(pthread_mutex_init(&(t->timer_mutex), NULL)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto cond_err; - } - - t->callback_func = cb_func; - t->user_data = caller_data; - t->time_msec = msec; - t->state = READY; - - if (pthread_attr_init(&tattr)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto mutex_err; - } - pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); - - if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { - LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); - goto attr_err; - } - - LOC_LOGD("%s:%d]: Created thread with id: %d\n", - __func__, __LINE__, (int)id); - goto _err; - -attr_err: - pthread_attr_destroy(&tattr); -mutex_err: - pthread_mutex_destroy(&t->timer_mutex); -cond_err: - pthread_cond_destroy(&t->timer_cond); -t_err: - free(t); -_err: - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return t; -} - -void loc_timer_stop(void* handle) { - timer_data* t = (timer_data*)handle; - - if (NULL != t && (READY == t->state || WAITING == t->state)) { - pthread_mutex_lock(&(t->timer_mutex)); - if (READY == t->state || WAITING == t->state) { - pthread_cond_signal(&t->timer_cond); - t->state = ABORT; - } - pthread_mutex_unlock(&(t->timer_mutex)); - } -} diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 5ca15862..2967858e 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -33,28 +33,38 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include -#include +#include /* - Return values: - Success = 0 - Failure = Non zero + 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, int result); +typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* - Returns the handle, which can be used to stop the timer + 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(unsigned int delay_msec, - loc_timer_callback, - void* user_data); +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 + handle becomes invalid upon the return of the callback */ -void loc_timer_stop(void* handle); +void loc_timer_stop(void*& handle); #ifdef __cplusplus } diff --git a/utils/msg_q.c b/utils/msg_q.c index 1555668c..e412e781 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -198,7 +198,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) msg_q* p_msg_q = (msg_q*)msg_q_data; pthread_mutex_lock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); if( p_msg_q->unblocked ) { @@ -214,7 +214,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); return rv; } @@ -241,7 +241,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) msg_q* p_msg_q = (msg_q*)msg_q_data; - LOC_LOGD("%s: Waiting on message\n", __FUNCTION__); + LOC_LOGV("%s: Waiting on message\n", __FUNCTION__); pthread_mutex_lock(&p_msg_q->list_mutex); @@ -262,7 +262,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp new file mode 100644 index 00000000..e8cb93a9 --- /dev/null +++ b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp @@ -0,0 +1,46 @@ +/* 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/utils/platform_lib_abstractions/platform_lib_includes.h b/utils/platform_lib_abstractions/platform_lib_includes.h new file mode 100644 index 00000000..5858674f --- /dev/null +++ b/utils/platform_lib_abstractions/platform_lib_includes.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_INCLUDES_H_ +#define _PLATFORM_LIB_INCLUDES_H_ + +#include "platform_lib_time.h" +#include "platform_lib_macros.h" + +#endif diff --git a/utils/platform_lib_abstractions/platform_lib_macros.h b/utils/platform_lib_abstractions/platform_lib_macros.h new file mode 100644 index 00000000..bc48dd99 --- /dev/null +++ b/utils/platform_lib_abstractions/platform_lib_macros.h @@ -0,0 +1,81 @@ +/* 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. + */ + +#ifndef __PLATFORM_LIB_MACROS_H__ +#define __PLATFORM_LIB_MACROS_H__ + +#include + +#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); \ +} + + +#ifdef USE_GLIB + +#define strlcat g_strlcat +#define strlcpy g_strlcpy + +#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) + +#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) + +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) + + +#else + +#ifdef __cplusplus +extern "C" { +#endif +pid_t gettid(void); + +#ifdef __cplusplus +} +#endif + +#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) + +#endif + +#endif diff --git a/utils/platform_lib_abstractions/platform_lib_time.h b/utils/platform_lib_abstractions/platform_lib_time.h new file mode 100644 index 00000000..ce013afc --- /dev/null +++ b/utils/platform_lib_abstractions/platform_lib_time.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_TIME_H_ +#define _PLATFORM_LIB_TIME_H_ + +int64_t systemTime(int clock); +int64_t elapsedMillisSinceBoot(); + +#endif From 285d395703e44e57931613e8dfbeb3b7617a0656 Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Tue, 15 Mar 2016 12:20:25 -0700 Subject: [PATCH 397/945] Revert "Revert "Fix compilation issues for m_master merge into oe_master"." This reverts commit fa7a874eb0586c7844fe3a4cb8d0063ce53464f0 Change-Id: Id2415d80fa3cbdc124e0a3bdd2722db7f233ad53 --- core/LocAdapterBase.cpp | 2 +- core/LocApiBase.cpp | 2 +- core/LocDualContext.cpp | 5 ++ core/Makefile.am | 7 +- core/UlpProxyBase.h | 1 - loc_api/Makefile.am | 4 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 +- loc_api/libloc_api_50001/Makefile.am | 78 +++++++++++++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 7 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 2 - .../loc_pla/include/platform_lib_macros.h | 2 + .../loc_pla/include/platform_lib_time.h | 4 +- .../loc_pla/src/Makefile.am | 1 + .../loc_stub/src/Makefile.am | 1 + utils/LocTimer.h | 2 +- utils/Makefile.am | 15 +++- utils/MsgTask.cpp | 3 +- utils/loc_cfg.cpp | 2 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_timer.h | 2 +- 20 files changed, 120 insertions(+), 25 deletions(-) create mode 100644 loc_api/libloc_api_50001/Makefile.am diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8fdb8cbb..e9bec95c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index dcd35fec..45d16e90 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index b5f33ac3..74b2903a 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include namespace loc_core { @@ -58,7 +59,11 @@ 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; diff --git a/core/Makefile.am b/core/Makefile.am index e2d05be4..341153ad 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,10 +1,11 @@ AM_CFLAGS = -I./ \ -I../utils \ $(LOCPLA_CFLAGS) \ + -I$(WORKSPACE)/gps-noship/flp \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_core_la_h_sources = \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ @@ -13,10 +14,10 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ gps_extended_c.h \ gps_extended.h \ - loc_core_log.h + loc_core_log.h \ + LocAdapterProxyBase.h libloc_core_la_c_sources = \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 59e265e8..2bafb0ab 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -31,7 +31,6 @@ #include #include "fused_location_extended.h" - namespace loc_core { class LocAdapterBase; diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index d42d4d99..a5f529bd 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -5,6 +5,7 @@ AM_CFLAGS = \ -I../utils \ $(LOCPLA_CFLAGS) \ -fno-short-enums \ + -D__func__=__PRETTY_FUNCTION__ \ -DTARGET_USES_QCOM_BSP libloc_eng_so_la_h_sources = \ @@ -81,7 +82,8 @@ 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 $(LOCPLA_LIBS) ../utils/libgps_utils_so.la +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) \ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 1d1a59ed..f3290dbd 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -339,9 +339,10 @@ void LocEngAdapter::requestPowerVote() LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); setGpsLock(powerUp ? 103 : 101); } - +#ifndef USE_GLIB delete mUlp; mUlp = ulp; +#endif } void LocInternalAdapter::reportPosition(UlpLocation &location, diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am new file mode 100644 index 00000000..c7624272 --- /dev/null +++ b/loc_api/libloc_api_50001/Makefile.am @@ -0,0 +1,78 @@ +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/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index de72aa8d..6aac28ba 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -46,12 +46,7 @@ #include #include #include -#if defined(USE_GLIB) && !defined(OFF_TARGET) -#include -#endif -#ifdef USE_GLIB -#include -#endif /* USE_GLIB */ + #include #include diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 3b20bbbc..a29784fc 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -235,8 +235,6 @@ static void* ni_thread_proc(void *args) LOC_LOGD("pSession->resp is %d\n",pSession->resp); - LOC_LOGD("loc_eng_ni_data_p->resp is %d\n",loc_eng_ni_data_p->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() diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index 32035d28..c712122e 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -35,6 +35,8 @@ extern "C" { #ifdef USE_GLIB #include +#include +#include #ifndef OFF_TARGET #include #define strlcat g_strlcat diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h index c05b15ce..7033a7a1 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ b/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -30,7 +30,9 @@ #define __PLATFORM_LIB_TIME_H__ #include - +#ifndef USE_GLIB +#include +#endif int64_t platform_lib_abstraction_elapsed_millis_since_boot(); #endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/platform_lib_abstractions/loc_pla/src/Makefile.am b/platform_lib_abstractions/loc_pla/src/Makefile.am index 3936837d..6ee0be70 100644 --- a/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -1,6 +1,7 @@ AM_CFLAGS = \ $(LOCSTUB_CFLAGS) \ -I../include \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums h_sources = \ diff --git a/platform_lib_abstractions/loc_stub/src/Makefile.am b/platform_lib_abstractions/loc_stub/src/Makefile.am index c8ab5fcb..8bda7113 100644 --- a/platform_lib_abstractions/loc_stub/src/Makefile.am +++ b/platform_lib_abstractions/loc_stub/src/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = \ -I../include \ + -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums libloc_stub_la_extra_h = \ diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c1468524..c6a63620 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -31,7 +31,7 @@ #define __LOC_TIMER_CPP_H__ #include -#include +#include // opaque class to provide service implementation. class LocTimerDelegate; diff --git a/utils/Makefile.am b/utils/Makefile.am index 5e718439..50f10078 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -14,15 +14,24 @@ libgps_utils_so_la_h_sources = \ loc_cfg.h \ loc_log.h \ loc_target.h \ - loc_timer.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_timer.c \ - loc_target.cpp + loc_target.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ + loc_misc_utils.cpp library_includedir = $(pkgincludedir)/utils diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index f33d6024..78a3fe00 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -33,6 +33,7 @@ #include #include #include +#include static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; @@ -77,7 +78,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const { void MsgTask::prerun() { // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); + platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); } bool MsgTask::run() { diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 967d2f30..926781a6 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #ifdef USE_GLIB #include diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index 7e96313f..dfe19a2d 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -28,7 +28,7 @@ */ #include #include -#include +#include #include #include diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 2967858e..25fd1790 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ #include - +#include /* user_data: client context pointer, passthrough. Originally received from calling client when loc_timer_start() is called. From 217e7544897c45976a7feff5fbe9c19627e94dfd Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 14 Mar 2016 15:30:09 +0530 Subject: [PATCH 398/945] Enabling CLANG compilation and fixing all resulting errors Removing statement to set LOCAL_CLANG flag explicity to true. It will be true by default. Change-Id: I2eaba5a89e64088e3383b962dceaaa7e975e997a CRs-Fixed: 989476 --- core/LBSProxyBase.h | 20 +++++++++++++++++--- core/LocAdapterBase.h | 10 ++++++++-- core/LocAdapterProxyBase.h | 5 +++++ core/LocApiBase.h | 10 ++++++++-- core/UlpProxyBase.h | 25 +++++++++++++++++++++++-- utils/Android.mk | 5 ++--- 6 files changed, 63 insertions(+), 12 deletions(-) diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 0faf8012..b3736c20 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -43,6 +43,10 @@ class LBSProxyBase { getLocApi(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase* context) const { + + (void)msgTask; + (void)exMask; + (void)context; return NULL; } protected: @@ -50,11 +54,21 @@ protected: public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, - unsigned long capabilities) const {} + 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 {} - virtual void injectFeatureConfig(ContextBase* context) const {} + inline virtual void modemPowerVote(bool power) const { + + (void)power; + } + virtual void injectFeatureConfig(ContextBase* context) const { + + (void)context; + } inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 5f4660b8..4ed1704f 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -80,10 +80,16 @@ public: // This will be overridden by the individual adapters // if necessary. - inline virtual void setUlpProxy(UlpProxyBase* ulp) {} + inline virtual void setUlpProxy(UlpProxyBase* ulp) { + + (void)ulp; + } virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); - inline virtual void setPositionModeInt(LocPosMode& posMode) {} + inline virtual void setPositionModeInt(LocPosMode& posMode) { + + (void)posMode; + } virtual void startFixInt() {} virtual void stopFixInt() {} virtual void getZppInt() {} diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 1ddcca4c..11859de7 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -61,6 +61,11 @@ public: GpsLocationExtended &locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask) { + + (void)location; + (void)locationExtended; + (void)status; + (void)loc_technology_mask; return false; } }; diff --git a/core/LocApiBase.h b/core/LocApiBase.h index b1c3d30a..713ca916 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -214,9 +214,15 @@ public: virtual void installAGpsCert(const DerEncodedCertificate* pData, size_t length, uint32_t slotBitMask); - inline virtual void setInSession(bool inSession) {} + inline virtual void setInSession(bool inSession) { + + (void)inSession; + } inline bool isMessageSupported (LocCheckingMessagesID msgID) const { - if (msgID > (sizeof(mSupportedMsg) << 3)) { + + // 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; diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 59e265e8..50a43fd9 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -57,24 +57,45 @@ public: 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 reportStatus(GpsStatusValue status) { + + (void)status; return false; } - inline virtual void setAdapter(LocAdapterBase* adapter) {} - inline virtual void setCapabilities(unsigned long capabilities) {} + 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 FlpExtLocation* locations, int32_t number_of_locations) { + (void)locations; + (void)number_of_locations; return false; } }; diff --git a/utils/Android.mk b/utils/Android.mk index 37512a58..240d11fa 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -25,10 +25,10 @@ LOCAL_SRC_FILES += \ 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_ \ - -std=c++11 + -D_ANDROID_ ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER @@ -60,7 +60,6 @@ LOCAL_COPY_HEADERS:= \ loc_misc_utils.h LOCAL_MODULE := libgps.utils -LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional From 14f0dc1b52a098191843210e34111ef4f3333dbd Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Tue, 15 Mar 2016 09:39:05 +0530 Subject: [PATCH 399/945] gps: consider nsec while ranking the timer objects We need to consider nsec as well while ranking timer objects Change-Id: Ieaad5dfa80b26b90e998618b3cbe1e590fc00839 CRs-Fixed: 991345 --- utils/LocTimer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 70904b2a..4de6b40b 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); if (timer) { // larger time ranks lower!!! - // IOW, if input obj has bigger tv_sec, this obj outRanks higher + // 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; } From c4c29c3ca72053ac22727972a7ae9191ea78f47c Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Tue, 15 Mar 2016 09:39:05 +0530 Subject: [PATCH 400/945] gps: consider nsec while ranking the timer objects We need to consider nsec as well while ranking timer objects Change-Id: Ieaad5dfa80b26b90e998618b3cbe1e590fc00839 CRs-Fixed: 991345 --- utils/LocTimer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 70904b2a..4de6b40b 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); if (timer) { // larger time ranks lower!!! - // IOW, if input obj has bigger tv_sec, this obj outRanks higher + // 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; } From 4b345c82acab9f25da05cb9c85b91ff65b3f3a8d Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Thu, 17 Mar 2016 11:58:51 +0530 Subject: [PATCH 401/945] gps: include support to check hardware type property automotive platform introduced a new android property called ro.hardware.type to detect automotive platform for the purpose of having automotive specific features. Added changes in loc_target to detect auto platform. Change-Id: Ib886b96b2e95dafc151bead041e5fc3d6740c468 CRs-Fixed: 992647 --- utils/loc_target.cpp | 20 +++++++++++++++++++- utils/loc_target.h | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index faaedf6c..9985b89c 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -174,6 +174,20 @@ 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) +{ + 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) @@ -190,6 +204,7 @@ unsigned int loc_get_target(void) 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; @@ -208,7 +223,10 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + + /*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; diff --git a/utils/loc_target.h b/utils/loc_target.h index 3bb3b5e2..b76ed884 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -52,6 +52,10 @@ 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 From 8f54f693ee413e3716ae4d18a67282404e4df4f7 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Wed, 23 Mar 2016 21:54:12 +0530 Subject: [PATCH 402/945] Fix LA compilation issues after merge Fixed compilation issues for LA after merging oe_master with location.lnx.1.0-dev.1.0. Change-Id: I7940429c369249ab9aa636fe9850c1281cf2dc01 CRs-Fixed: 995520 --- core/Android.mk | 6 +- loc_api/libloc_api_50001/Android.mk | 12 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 - utils/Android.mk | 11 +- utils/log_util.h | 189 ++++++++++++++++++ utils/platform_lib_abstractions/Android.mk | 5 + .../loc_pla/Android.mk | 5 + .../loc_pla/Makefile.am | 0 .../loc_pla/configure.ac | 0 .../include/platform_lib_android_runtime.h | 0 .../loc_pla/include/platform_lib_gettid.h | 0 .../loc_pla/include/platform_lib_includes.h | 0 .../loc_pla/include/platform_lib_log_util.h | 0 .../loc_pla/include/platform_lib_macros.h | 0 .../include/platform_lib_property_service.h | 3 +- .../include/platform_lib_sched_policy.h | 0 .../loc_pla/include/platform_lib_time.h | 3 - .../loc_pla/loc-pla.pc.in | 0 .../loc_pla/src/Android.mk | 58 ++++++ .../loc_pla/src/Makefile.am | 0 .../src/platform_lib_android_runtime.cpp | 4 +- .../loc_pla/src/platform_lib_gettid.cpp | 0 .../loc_pla/src/platform_lib_log_util.cpp | 6 - .../src/platform_lib_property_service.cpp | 0 .../loc_pla/src/platform_lib_sched_policy.cpp | 0 .../loc_pla/src/platform_lib_time.cpp | 0 .../loc_stub/Android.mk | 5 + .../loc_stub/Makefile.am | 0 .../loc_stub/configure.ac | 0 .../include/loc_stub_android_runtime.h | 0 .../loc_stub/include/loc_stub_gettid.h | 0 .../include/loc_stub_property_service.h | 0 .../loc_stub/include/loc_stub_sched_policy.h | 0 .../loc_stub/include/loc_stub_time.h | 0 .../loc_stub/loc-stub.pc.in | 0 .../loc_stub/src/Android.mk | 52 +++++ .../loc_stub/src/Makefile.am | 0 .../loc_stub/src/loc_stub_android_runtime.cpp | 0 .../loc_stub/src/loc_stub_gettid.cpp | 0 .../src/loc_stub_property_service.cpp | 0 .../loc_stub/src/loc_stub_sched_policy.cpp | 0 .../loc_stub/src/loc_stub_time.cpp | 0 .../platform_lib_includes.h | 35 ---- .../platform_lib_macros.h | 81 -------- .../platform_lib_time.h | 35 ---- 45 files changed, 336 insertions(+), 178 deletions(-) create mode 100644 utils/log_util.h create mode 100644 utils/platform_lib_abstractions/Android.mk create mode 100644 utils/platform_lib_abstractions/loc_pla/Android.mk rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/Makefile.am (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/configure.ac (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_android_runtime.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_gettid.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_includes.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_log_util.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_macros.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_property_service.h (98%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_sched_policy.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/include/platform_lib_time.h (96%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/loc-pla.pc.in (100%) create mode 100644 utils/platform_lib_abstractions/loc_pla/src/Android.mk rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/Makefile.am (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_android_runtime.cpp (93%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_gettid.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_log_util.cpp (92%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_property_service.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_sched_policy.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_pla/src/platform_lib_time.cpp (100%) create mode 100644 utils/platform_lib_abstractions/loc_stub/Android.mk rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/Makefile.am (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/configure.ac (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/include/loc_stub_android_runtime.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/include/loc_stub_gettid.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/include/loc_stub_property_service.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/include/loc_stub_sched_policy.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/include/loc_stub_time.h (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/loc-stub.pc.in (100%) create mode 100644 utils/platform_lib_abstractions/loc_stub/src/Android.mk rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/Makefile.am (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/loc_stub_android_runtime.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/loc_stub_gettid.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/loc_stub_property_service.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/loc_stub_sched_policy.cpp (100%) rename {platform_lib_abstractions => utils/platform_lib_abstractions}/loc_stub/src/loc_stub_time.cpp (100%) delete mode 100644 utils/platform_lib_abstractions/platform_lib_includes.h delete mode 100644 utils/platform_lib_abstractions/platform_lib_macros.h delete mode 100644 utils/platform_lib_abstractions/platform_lib_time.h diff --git a/core/Android.mk b/core/Android.mk index c6d3128d..3650fbb3 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -20,7 +20,8 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ libgps.utils \ - libdl + libdl \ + libloc_pla LOCAL_SRC_FILES += \ LocApiBase.cpp \ @@ -35,7 +36,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libflp + $(TARGET_OUT_HEADERS)/libflp \ + $(TARGET_OUT_HEADERS)/libloc_pla LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index 62905e8c..cd4888d8 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -16,7 +16,8 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ liblog \ libloc_core \ - libgps.utils + libgps.utils \ + libloc_pla LOCAL_SRC_FILES += \ loc_eng.cpp \ @@ -42,7 +43,8 @@ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ hardware/qcom/gps/loc_api/libloc_api_50001 \ - $(TARGET_OUT_HEADERS)/libflp + $(TARGET_OUT_HEADERS)/libflp \ + $(TARGET_OUT_HEADERS)/libloc_pla LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -75,7 +77,8 @@ LOCAL_SHARED_LIBRARIES := \ libloc_eng \ libloc_core \ libgps.utils \ - libdl + libdl \ + libloc_pla ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) endif @@ -96,7 +99,8 @@ endif LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libflp + $(TARGET_OUT_HEADERS)/libflp \ + $(TARGET_OUT_HEADERS)/libloc_pla LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index f3290dbd..592662df 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -339,10 +339,6 @@ void LocEngAdapter::requestPowerVote() LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); setGpsLock(powerUp ? 103 : 101); } -#ifndef USE_GLIB - delete mUlp; - mUlp = ulp; -#endif } void LocInternalAdapter::reportPosition(UlpLocation &location, diff --git a/utils/Android.mk b/utils/Android.mk index 240d11fa..45f3c25a 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -6,11 +6,13 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) + ## Libs LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog + liblog \ + libloc_pla LOCAL_SRC_FILES += \ loc_log.cpp \ @@ -38,7 +40,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/platform_lib_abstractions + $(TARGET_OUT_HEADERS)/libloc_pla LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -54,9 +56,6 @@ LOCAL_COPY_HEADERS:= \ loc_target.h \ loc_timer.h \ LocSharedLock.h \ - platform_lib_abstractions/platform_lib_includes.h \ - platform_lib_abstractions/platform_lib_time.h \ - platform_lib_abstractions/platform_lib_macros.h \ loc_misc_utils.h LOCAL_MODULE := libgps.utils @@ -66,5 +65,7 @@ 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 endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/log_util.h b/utils/log_util.h new file mode 100644 index 00000000..ffd5ca97 --- /dev/null +++ b/utils/log_util.h @@ -0,0 +1,189 @@ +/* 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 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/utils/platform_lib_abstractions/Android.mk b/utils/platform_lib_abstractions/Android.mk new file mode 100644 index 00000000..b923a4c9 --- /dev/null +++ b/utils/platform_lib_abstractions/Android.mk @@ -0,0 +1,5 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +include $(call all-subdir-makefiles) + +endif diff --git a/utils/platform_lib_abstractions/loc_pla/Android.mk b/utils/platform_lib_abstractions/loc_pla/Android.mk new file mode 100644 index 00000000..b923a4c9 --- /dev/null +++ b/utils/platform_lib_abstractions/loc_pla/Android.mk @@ -0,0 +1,5 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +include $(call all-subdir-makefiles) + +endif diff --git a/platform_lib_abstractions/loc_pla/Makefile.am b/utils/platform_lib_abstractions/loc_pla/Makefile.am similarity index 100% rename from platform_lib_abstractions/loc_pla/Makefile.am rename to utils/platform_lib_abstractions/loc_pla/Makefile.am diff --git a/platform_lib_abstractions/loc_pla/configure.ac b/utils/platform_lib_abstractions/loc_pla/configure.ac similarity index 100% rename from platform_lib_abstractions/loc_pla/configure.ac rename to utils/platform_lib_abstractions/loc_pla/configure.ac diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_includes.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_macros.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h similarity index 98% rename from platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h index 006c94d5..ed2041f9 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h @@ -32,8 +32,9 @@ #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 diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h similarity index 100% rename from platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h diff --git a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h similarity index 96% rename from platform_lib_abstractions/loc_pla/include/platform_lib_time.h rename to utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h index 7033a7a1..2905a74c 100644 --- a/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -30,9 +30,6 @@ #define __PLATFORM_LIB_TIME_H__ #include -#ifndef USE_GLIB -#include -#endif int64_t platform_lib_abstraction_elapsed_millis_since_boot(); #endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in similarity index 100% rename from platform_lib_abstractions/loc_pla/loc-pla.pc.in rename to utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk new file mode 100644 index 00000000..7099f875 --- /dev/null +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -0,0 +1,58 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +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)/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_CLANG := false + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am similarity index 100% rename from platform_lib_abstractions/loc_pla/src/Makefile.am rename to utils/platform_lib_abstractions/loc_pla/src/Makefile.am diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp similarity index 93% rename from platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp index 447e02e3..090af13b 100644 --- a/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp @@ -31,10 +31,10 @@ #ifdef USE_GLIB #include #else -#include +#include #endif /* USE_GLIB */ pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg) { - return android::AndroidRuntime::createJavaThread(name, start, arg); + return (pthread_t)android::AndroidRuntime::createJavaThread(name, start, arg); } diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp similarity index 100% rename from platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp similarity index 92% rename from platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp index 37a5d4a7..ef23201a 100644 --- a/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -27,12 +27,6 @@ */ #include "platform_lib_log_util.h" -void loc_logger_init(unsigned long debug, unsigned long timestamp) -{ - loc_logger.DEBUG_LEVEL = debug; - loc_logger.TIMESTAMP = timestamp; -} - char * get_timestamp(char *str, unsigned long buf_size) { struct timeval tv; diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp similarity index 100% rename from platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp similarity index 100% rename from platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp diff --git a/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp similarity index 100% rename from platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp rename to utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp diff --git a/utils/platform_lib_abstractions/loc_stub/Android.mk b/utils/platform_lib_abstractions/loc_stub/Android.mk new file mode 100644 index 00000000..b923a4c9 --- /dev/null +++ b/utils/platform_lib_abstractions/loc_stub/Android.mk @@ -0,0 +1,5 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +include $(call all-subdir-makefiles) + +endif diff --git a/platform_lib_abstractions/loc_stub/Makefile.am b/utils/platform_lib_abstractions/loc_stub/Makefile.am similarity index 100% rename from platform_lib_abstractions/loc_stub/Makefile.am rename to utils/platform_lib_abstractions/loc_stub/Makefile.am diff --git a/platform_lib_abstractions/loc_stub/configure.ac b/utils/platform_lib_abstractions/loc_stub/configure.ac similarity index 100% rename from platform_lib_abstractions/loc_stub/configure.ac rename to utils/platform_lib_abstractions/loc_stub/configure.ac diff --git a/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h similarity index 100% rename from platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h rename to utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h diff --git a/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h similarity index 100% rename from platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h rename to utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h diff --git a/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h similarity index 100% rename from platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h rename to utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h diff --git a/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h similarity index 100% rename from platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h rename to utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h diff --git a/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h similarity index 100% rename from platform_lib_abstractions/loc_stub/include/loc_stub_time.h rename to utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h diff --git a/platform_lib_abstractions/loc_stub/loc-stub.pc.in b/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in similarity index 100% rename from platform_lib_abstractions/loc_stub/loc-stub.pc.in rename to utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk new file mode 100644 index 00000000..2cf25b9e --- /dev/null +++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -0,0 +1,52 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +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_CLANG := false + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/platform_lib_abstractions/loc_stub/src/Makefile.am b/utils/platform_lib_abstractions/loc_stub/src/Makefile.am similarity index 100% rename from platform_lib_abstractions/loc_stub/src/Makefile.am rename to utils/platform_lib_abstractions/loc_stub/src/Makefile.am diff --git a/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp similarity index 100% rename from platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp rename to utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp diff --git a/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp similarity index 100% rename from platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp rename to utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp diff --git a/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp similarity index 100% rename from platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp rename to utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp diff --git a/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp similarity index 100% rename from platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp rename to utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp diff --git a/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp similarity index 100% rename from platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp rename to utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp diff --git a/utils/platform_lib_abstractions/platform_lib_includes.h b/utils/platform_lib_abstractions/platform_lib_includes.h deleted file mode 100644 index 5858674f..00000000 --- a/utils/platform_lib_abstractions/platform_lib_includes.h +++ /dev/null @@ -1,35 +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. - */ - -#ifndef _PLATFORM_LIB_INCLUDES_H_ -#define _PLATFORM_LIB_INCLUDES_H_ - -#include "platform_lib_time.h" -#include "platform_lib_macros.h" - -#endif diff --git a/utils/platform_lib_abstractions/platform_lib_macros.h b/utils/platform_lib_abstractions/platform_lib_macros.h deleted file mode 100644 index bc48dd99..00000000 --- a/utils/platform_lib_abstractions/platform_lib_macros.h +++ /dev/null @@ -1,81 +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. - */ - -#ifndef __PLATFORM_LIB_MACROS_H__ -#define __PLATFORM_LIB_MACROS_H__ - -#include - -#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); \ -} - - -#ifdef USE_GLIB - -#define strlcat g_strlcat -#define strlcpy g_strlcpy - -#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) - -#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) - -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) - - -#else - -#ifdef __cplusplus -extern "C" { -#endif -pid_t gettid(void); - -#ifdef __cplusplus -} -#endif - -#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread -#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) - -#endif - -#endif diff --git a/utils/platform_lib_abstractions/platform_lib_time.h b/utils/platform_lib_abstractions/platform_lib_time.h deleted file mode 100644 index ce013afc..00000000 --- a/utils/platform_lib_abstractions/platform_lib_time.h +++ /dev/null @@ -1,35 +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. - */ - -#ifndef _PLATFORM_LIB_TIME_H_ -#define _PLATFORM_LIB_TIME_H_ - -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); - -#endif From 5573c31749e12b387d20ac1a4a76b07b070cf830 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 6 Apr 2016 02:01:30 +0530 Subject: [PATCH 403/945] Adding fix for KW warning Fix for buffer overflow possibility for the thread name passed in to pthread_setname_np() method. Change-Id: Id323dd058eddcf50d6fd9ec8908e9997b30c561b CRs-Fixed: 999457 --- utils/LocThread.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index 19bf101a..a7fd1c8b 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -84,9 +84,7 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, if (mThandle) { // set thread name char lname[16]; - int len = sizeof(lname) - 1; - memcpy(lname, threadName, len); - lname[len] = 0; + strlcpy(lname, threadName, sizeof(lname)); // set the thread name here pthread_setname_np(mThandle, lname); From d30694acf6d4c1156c8a8e6da919b183213408e8 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 5 Apr 2016 15:16:21 -0700 Subject: [PATCH 404/945] Rename GnssSvStatus to QtiGnssSvStatus Change-Id: Ieeeb03af37440214f4762d495d949b4ab59ed237 --- core/LocAdapterBase.cpp | 2 +- core/LocAdapterBase.h | 2 +- core/LocApiBase.cpp | 2 +- core/LocApiBase.h | 2 +- core/UlpProxyBase.h | 2 +- core/gps_extended_c.h | 4 ++-- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 2 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 4 ++-- loc_api/libloc_api_50001/LocEngAdapter.h | 4 ++-- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_msg.h | 4 ++-- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 2 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8fdb8cbb..4f6b9c56 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -80,7 +80,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(GnssSvStatus &svStatus, + reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 4ed1704f..57e77ee1 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -98,7 +98,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index dcd35fec..c09439ea 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -253,7 +253,7 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GnssSvStatus &svStatus, +void LocApiBase::reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 713ca916..8a885585 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -113,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GnssSvStatus &svStatus, + void reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 50a43fd9..45bfae42 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -64,7 +64,7 @@ public: (void)loc_technology_mask; return false; } - inline virtual bool reportSv(GnssSvStatus &svStatus, + inline virtual bool reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { (void)svStatus; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 9b73fd59..bb683f1d 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -268,7 +268,7 @@ typedef struct { /** Represents SV status. */ typedef struct { - /** set to sizeof(GnssSvStatus) */ + /** set to sizeof(QtiGnssSvStatus) */ size_t size; /** Number of SVs currently visible. */ @@ -305,7 +305,7 @@ typedef struct { */ uint64_t bds_used_in_fix_mask; -} GnssSvStatus; +} QtiGnssSvStatus; enum loc_sess_status { LOC_SESS_SUCCESS, diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index c7447543..b946aecf 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -797,7 +797,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { - GnssSvStatus SvStatus = {0}; + QtiGnssSvStatus SvStatus = {0}; GpsLocationExtended locationExtended = {0}; locationExtended.size = sizeof(locationExtended); int num_svs_max = 0; diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 592662df..c674fdf1 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -375,14 +375,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, +void LocInternalAdapter::reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GnssSvStatus &svStatus, +void LocEngAdapter::reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index a193e818..d6295d1c 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -55,7 +55,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -269,7 +269,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(QtiGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index d2fc5bc6..2336600e 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -828,7 +828,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + QtiGnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 9c7b9bcd..31cf9507 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GnssSvStatus mSvStatus; + const QtiGnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + QtiGnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index d60ecfc4..28e59112 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -707,7 +707,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const QtiGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 066943aa..f7ef7fb0 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -37,7 +37,7 @@ 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_sv(loc_eng_data_s_type *loc_eng_data_p, const QtiGnssSvStatus &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 From c3a4fba9b887c147c5971d68b473c35d1001804c Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 6 Apr 2016 15:40:25 -0700 Subject: [PATCH 405/945] Support GnssMeasurement Support the new GnssMeasurement and GnssClock data structures for the new gps.h Change-Id: I40e00711501432760c82d27fb82702b1bf57ebb6 --- core/LocAdapterBase.cpp | 4 +- core/LocAdapterBase.h | 4 +- core/LocApiBase.cpp | 26 +++-- core/LocApiBase.h | 4 +- core/UlpProxyBase.h | 4 +- core/gps_extended_c.h | 41 -------- loc_api/libloc_api_50001/LocEngAdapter.cpp | 10 +- loc_api/libloc_api_50001/LocEngAdapter.h | 9 +- loc_api/libloc_api_50001/loc.cpp | 5 +- loc_api/libloc_api_50001/loc.h | 2 + loc_api/libloc_api_50001/loc_eng.cpp | 111 ++++++++++++++------- loc_api/libloc_api_50001/loc_eng.h | 4 +- loc_api/libloc_api_50001/loc_eng_msg.h | 12 +-- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 60 +++++------ loc_api/libloc_api_50001/loc_eng_nmea.h | 2 +- 15 files changed, 154 insertions(+), 144 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 4f6b9c56..d4727d81 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -80,7 +80,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(QtiGnssSvStatus &svStatus, + reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() @@ -137,6 +137,6 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) void LocAdapterBase:: - reportGpsMeasurementData(GpsData &gpsMeasurementData) + reportGnssMeasurementData(GnssData &gnssMeasurementData) DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 57e77ee1..f92ccee4 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -98,7 +98,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(QtiGnssSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -117,7 +117,7 @@ public: const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } - virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); + virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c09439ea..3a274ed8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -253,23 +253,21 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(QtiGnssSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use" - " mask: %x/%x/%x\n sv: prn snr elevation azimuth", - svStatus.num_svs, svStatus.ephemeris_mask, - svStatus.almanac_mask, svStatus.gps_used_in_fix_mask, - svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask); - for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) { - LOC_LOGV(" %d: %d %f %f %f", + LOC_LOGV("num sv: %d", svStatus.num_svs); + for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) { + LOC_LOGV(" %03d: %02d %d %f %f %f 0x%02X", i, - svStatus.sv_list[i].prn, - svStatus.sv_list[i].snr, - svStatus.sv_list[i].elevation, - svStatus.sv_list[i].azimuth); + svStatus.gnss_sv_list[i].svid, + svStatus.gnss_sv_list[i].constellation, + 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( @@ -364,10 +362,10 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData) +void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData) { // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData)); } enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8a885585..744c688f 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -113,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(QtiGnssSvStatus &svStatus, + void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); @@ -130,7 +130,7 @@ public: void reportDataCallClosed(); void requestNiNotify(GpsNiNotification ¬ify, const void* data); void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGpsMeasurementData(GpsData &gpsMeasurementData); + void reportGnssMeasurementData(GnssData &gnssMeasurementData); // downward calls // All below functions are to be defined by adapter specific modules: diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 45bfae42..ed99e5bb 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -64,7 +64,7 @@ public: (void)loc_technology_mask; return false; } - inline virtual bool reportSv(QtiGnssSvStatus &svStatus, + inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { (void)svStatus; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index bb683f1d..415e763b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -266,47 +266,6 @@ typedef struct { float horUncEllipseOrientAzimuth; } GpsLocationExtended; -/** Represents SV status. */ -typedef struct { - /** set to sizeof(QtiGnssSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which GPS SVs - * were used for computing the most recent position fix. - */ - uint32_t gps_used_in_fix_mask; - - /** - * Represents a bit mask indicating which GLONASS SVs - * were used for computing the most recent position fix. - */ - uint32_t glo_used_in_fix_mask; - - /** - * Represents a bit mask indicating which BDS SVs - * were used for computing the most recent position fix. - */ - uint64_t bds_used_in_fix_mask; - -} QtiGnssSvStatus; - enum loc_sess_status { LOC_SESS_SUCCESS, LOC_SESS_INTERMEDIATE, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index c674fdf1..42299296 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -375,14 +375,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(QtiGnssSvStatus &svStatus, +void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(QtiGnssSvStatus &svStatus, +void LocEngAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { @@ -564,10 +564,10 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) return ret; } -void LocEngAdapter::reportGpsMeasurementData(GpsData &gpsMeasurementData) +void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData) { - sendMsg(new LocEngReportGpsMeasurement(mOwner, - gpsMeasurementData)); + sendMsg(new LocEngReportGnssMeasurement(mOwner, + gnssMeasurementData)); } /* diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index d6295d1c..0e0fdbec 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -55,7 +55,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(QtiGnssSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -85,6 +85,7 @@ public: bool mSupportsAgpsRequests; bool mSupportsPositionInjection; bool mSupportsTimeInjection; + GnssSystemInfo mGnssInfo; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, @@ -269,7 +270,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(QtiGnssSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -284,7 +285,7 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); + virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); inline const LocPosMode& getPositionMode() const {return mFixCriteria;} diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 505fc940..6042a98c 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -285,6 +285,7 @@ static int loc_init(GpsCallbacks* callbacks) } 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 | @@ -304,6 +305,8 @@ static int loc_init(GpsCallbacks* callbacks) 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; diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index e56fdcf8..02ca5385 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -57,6 +57,8 @@ typedef struct { 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 2336600e..d5d17402 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -828,7 +828,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - QtiGnssSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), @@ -845,9 +845,9 @@ void LocEngReportSv::proc() const { if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { - if (locEng->sv_status_cb != NULL) { - locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus), - (void*)mSvExt); + if (locEng->gnss_sv_status_cb != NULL) { + LOC_LOGE("Calling gnss_sv_status_cb"); + locEng->gnss_sv_status_cb((GnssSvStatus*)&(mSvStatus)); } if (locEng->generateNmea) @@ -1376,6 +1376,32 @@ struct LocEngSetCapabilities : public LocMsg { } }; +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_capabilities_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; @@ -1388,6 +1414,7 @@ struct LocEngInit : public LocMsg { loc_eng_reinit(*mLocEng); // set the capabilities mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng)); + mLocEng->adapter->sendMsg(new LocEngSetSystemInfo(mLocEng)); } inline void locallog() const { @@ -1607,10 +1634,13 @@ struct LocEngGnssConstellationConfig : public LocMsg { 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"); } } @@ -1623,50 +1653,59 @@ struct LocEngGnssConstellationConfig : public LocMsg { }; // case LOC_ENG_MSG_REPORT_GNSS_MEASUREMENT: -LocEngReportGpsMeasurement::LocEngReportGpsMeasurement(void* locEng, - GpsData &gpsData) : - LocMsg(), mLocEng(locEng), mGpsData(gpsData) +LocEngReportGnssMeasurement::LocEngReportGnssMeasurement(void* locEng, + GnssData &gnssData) : + LocMsg(), mLocEng(locEng), mGnssData(gnssData) { locallog(); } -void LocEngReportGpsMeasurement::proc() const { +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->gps_measurement_cb != NULL) { - locEng->gps_measurement_cb((GpsData*)&(mGpsData)); + if (locEng->gnss_measurement_cb != NULL) { + LOC_LOGV("Calling gnss_measurement_cb"); + locEng->gnss_measurement_cb((GnssData*)&(mGnssData)); } } } -void LocEngReportGpsMeasurement::locallog() const { +void LocEngReportGnssMeasurement::locallog() const { IF_LOC_LOGV { LOC_LOGV("%s:%d]: Received in GPS HAL." "GNSS Measurements count: %d \n", - __func__, __LINE__, mGpsData.measurement_count); - for (int i =0; i< mGpsData.measurement_count && i < GPS_MAX_SVS; i++) { + __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 | prn | time_offset_ns | state |" - " received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |" + " 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 | %lld | %f | %f | %f | %d | %d \n", + " GPS_HAL => %d | %d | %f | %d | %f | %f | %f | %d | %d \n", i, - mGpsData.measurements[i].prn, - mGpsData.measurements[i].time_offset_ns, - mGpsData.measurements[i].state, - mGpsData.measurements[i].received_gps_tow_ns, - mGpsData.measurements[i].c_n0_dbhz, - mGpsData.measurements[i].pseudorange_rate_mps, - mGpsData.measurements[i].pseudorange_rate_uncertainty_mps, - mGpsData.measurements[i].accumulated_delta_range_state, - mGpsData.measurements[i].flags); + 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: type | time_ns \n" - " GPS_HAL => Clocks Info: %d | %lld", mGpsData.clock.type, - mGpsData.clock.time_ns); + 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 LocEngReportGpsMeasurement::log() const { +inline void LocEngReportGnssMeasurement::log() const { locallog(); } @@ -1746,6 +1785,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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 ? @@ -1770,6 +1811,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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)); @@ -2942,8 +2985,8 @@ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, { ENTRY_LOG_CALLFLOW(); - STATE_CHECK((NULL == loc_eng_data.gps_measurement_cb), - "gps measurement already initialized", + 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", @@ -2959,7 +3002,7 @@ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, event, LOC_REGISTRATION_MASK_ENABLED)); // set up the callback - loc_eng_data.gps_measurement_cb = callbacks->measurement_callback; + loc_eng_data.gnss_measurement_cb = callbacks->gnss_measurement_callback; LOC_LOGD ("%s, event masks updated successfully", __func__); return GPS_MEASUREMENT_OPERATION_SUCCESS; @@ -2994,6 +3037,6 @@ void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data) event, LOC_REGISTRATION_MASK_DISABLED)); // set up the callback - loc_eng_data.gps_measurement_cb = NULL; + loc_eng_data.gnss_measurement_cb = NULL; EXIT_LOG(%d, 0); } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index b4f2564b..157ebc11 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -94,7 +94,9 @@ typedef struct loc_eng_data_s gps_acquire_wakelock acquire_wakelock_cb; gps_release_wakelock release_wakelock_cb; gps_request_utc_time request_utc_time_cb; - gps_measurement_callback gps_measurement_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; diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 31cf9507..435ffbb7 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const QtiGnssSvStatus mSvStatus; + const GnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - QtiGnssSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; @@ -289,11 +289,11 @@ struct LocEngGetZpp : public LocMsg { void send() const; }; -struct LocEngReportGpsMeasurement : public LocMsg { +struct LocEngReportGnssMeasurement : public LocMsg { void* mLocEng; - const GpsData mGpsData; - LocEngReportGpsMeasurement(void* locEng, - GpsData &gpsData); + const GnssData mGnssData; + LocEngReportGnssMeasurement(void* locEng, + GnssData &gnssData); virtual void proc() const; void locallog() const; virtual void log() const; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 28e59112..271e9678 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* 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 @@ -29,10 +29,6 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_eng_nmea" -#define GPS_PRN_START 1 -#define GPS_PRN_END 32 -#define GLONASS_PRN_START 65 -#define GLONASS_PRN_END 96 #include #include #include @@ -707,7 +703,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const QtiGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -724,15 +720,27 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, //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( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START)&& - (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + 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( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && - (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) + 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++; } } @@ -772,13 +780,12 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) { - if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START) && - (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation) { length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svStatus.sv_list[svNumber-1].prn, - (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int - (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int + 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) { @@ -788,10 +795,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (svStatus.sv_list[svNumber-1].snr > 0) + if (svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz > 0) { length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + (int)(0.5 + svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz)); //float to int if (length < 0 || length >= lengthRemaining) { @@ -850,13 +857,13 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) { - if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && - (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) { + if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation) + { length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svStatus.sv_list[svNumber-1].prn, - (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int - (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int + 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) { @@ -866,10 +873,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (svStatus.sv_list[svNumber-1].snr > 0) + if (svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz > 0) { length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + (int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz)); //float to int if (length < 0 || length >= lengthRemaining) { @@ -893,11 +900,6 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - // cache the used in fix mask, as it will be needed to send $GPGSA/$GNGSA - // during the position report - loc_eng_data_p->gps_used_mask = svStatus.gps_used_in_fix_mask; - loc_eng_data_p->glo_used_mask = svStatus.glo_used_in_fix_mask; - // 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. diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index f7ef7fb0..066943aa 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -37,7 +37,7 @@ 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 QtiGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended); +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 From d4c4fbf56ba878f3592854a4398a72fd7073a3f9 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Fri, 15 Apr 2016 16:09:15 -0700 Subject: [PATCH 406/945] XTRA Client 2.0 This project implemented XTRA "Enhancements" grouped as XTRA Client 2.0. 1. Added NTP_SERVER config into gps.conf 2. Removed XTRA Client 2.0 Phase 1 code changes 3. Disabled public api to delete aiding data in user build CRs-fixed: 917950 Change-Id: I18b31da74c9fe0c24d0ced3770f099197ad32d9a --- etc/gps.conf | 10 ++-------- loc_api/libloc_api_50001/loc.cpp | 3 +++ utils/log_util.h | 6 ++++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 4e6b4366..f4153149 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -16,14 +16,8 @@ XTRA_VERSION_CHECK=0 # _CLEAR = 0 ERR_ESTIMATE=0 -#Test -NTP_SERVER=time.gpsonextra.net -#Asia -# NTP_SERVER=asia.pool.ntp.org -#Europe -# NTP_SERVER=europe.pool.ntp.org -#North America -# NTP_SERVER=north-america.pool.ntp.org +#NTP server +NTP_SERVER=time.izatcloud.net # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 6042a98c..0a8091f0 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -541,7 +541,10 @@ SIDE EFFECTS static void loc_delete_aiding_data(GpsAidingData f) { ENTRY_LOG(); + +#ifndef TARGET_BUILD_VARIANT_USER loc_eng_delete_aiding_data(loc_afw_data, f); +#endif EXIT_LOG(%s, VOID_RET); } diff --git a/utils/log_util.h b/utils/log_util.h index ffd5ca97..d27c800d 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -159,6 +159,12 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } 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) From f97a97d0d1bb42268347c3ec2b83e8c125fe2509 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sat, 16 Apr 2016 23:41:45 -0700 Subject: [PATCH 407/945] fixed a copy paste error should NULL check set_system_info_cb instead. Change-Id: If3a4f4bdb3025d92c1fcd2af320fd370d51301aa --- loc_api/libloc_api_50001/loc_eng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index d5d17402..afe044fb 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1384,7 +1384,7 @@ struct LocEngSetSystemInfo : public LocMsg { locallog(); } inline virtual void proc() const { - if (NULL != mLocEng->set_capabilities_cb) { + 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)); From f41f1960c45b3c62163465352e20b28db3ab433a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Sun, 17 Apr 2016 12:41:42 -0700 Subject: [PATCH 408/945] fixing a LE compilation issue missing include of a head file. A late check in for Android introduced this. This blocks LE mainline switching to component model. Change-Id: Idc93f1ec9b1ccb548d3119e72ce0e3e797f2039f CRs-Fixed: 1004488 --- utils/LocThread.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index a7fd1c8b..e8e83929 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -29,6 +29,7 @@ #include #include #include +#include class LocThreadDelegate { LocRunnable* mRunnable; From 04e6ca93b92c37b3e58afc663bebe9428bbefbb9 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 22 Apr 2016 14:19:33 -0700 Subject: [PATCH 409/945] Default apn ip type to ipv4 If a apn ip type is not found for a agps data connection, default to using ipv4 instead of invalid. CRs-fixed: 1007417 Change-Id: Icc71de1fab3fd5967901c39a5c11eaea17b7766c --- loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 7411dc5a..5b6bebab 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -731,7 +731,7 @@ static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) bearerType = AGPS_APN_BEARER_IPV4V6; break; default: - bearerType = AGPS_APN_BEARER_INVALID; + bearerType = AGPS_APN_BEARER_IPV4; break; } From edc2a648b3525006eded5d99091c248268425011 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Thu, 17 Mar 2016 11:58:51 +0530 Subject: [PATCH 410/945] gps: include support to check hardware type property automotive platform introduced a new android property called ro.hardware.type to detect automotive platform for the purpose of having automotive specific features. Added changes in loc_target to detect auto platform. Change-Id: Ib886b96b2e95dafc151bead041e5fc3d6740c468 CRs-Fixed: 992647 --- utils/loc_target.cpp | 20 +++++++++++++++++++- utils/loc_target.h | 4 ++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 30c040c7..92bdca6d 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -174,6 +174,20 @@ 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) +{ + 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) @@ -190,6 +204,7 @@ unsigned int loc_get_target(void) 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; @@ -208,7 +223,10 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + + /*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; diff --git a/utils/loc_target.h b/utils/loc_target.h index 3bb3b5e2..b76ed884 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -52,6 +52,10 @@ 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 From 2d9840bcee4d4290df8bb0b3c518950e75d51108 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 28 Apr 2016 18:23:17 +0530 Subject: [PATCH 411/945] Use QMI_LOC_SET_NMEA_TYPES to set the NMEA sentences required. If NMEA_PROVIDER=1, HLOS needs to use the QMI type QMI_LOC_SET_NMEA_TYPES to set the type of NMEA sentences it needs. This will register for all possible NMEA sentences and instructs modem to send whatever it supports. Change-Id: I3a9e2219c1c9b4ca127a4b55f71b0a78a84cdd11 CRs-Fixed: 1005413 1006831 --- core/LocApiBase.cpp | 6 +++- core/LocApiBase.h | 4 ++- core/gps_extended_c.h | 30 +++++++++++++++++++- loc_api/libloc_api_50001/LocEngAdapter.h | 7 ++++- loc_api/libloc_api_50001/loc_eng.cpp | 36 ++++++++++++++++++++++-- 5 files changed, 77 insertions(+), 6 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 45d16e90..7ef5e68b 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -445,6 +445,10 @@ 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) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 7b80f5f0..1b34e8e0 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -171,6 +171,8 @@ public: 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 diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 5bf11f30..1a24e13b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -346,6 +346,34 @@ typedef uint32_t LocPosTechMask; #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, diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 72b780d1..70468752 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -185,6 +185,11 @@ public: { 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) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 552e1d1c..93aacf6c 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -497,6 +497,31 @@ struct LocEngSuplMode : public LocMsg { } }; +// 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; @@ -1749,7 +1774,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report loc_eng_data.generateNmea = true; } - else + else if (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_MP) { loc_eng_data.generateNmea = false; } @@ -1779,6 +1804,13 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) sap_conf.SENSOR_PROVIDER)); adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + 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 || From 05f58605e172b284056120dfdb468805e798339d Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 24 May 2016 16:58:49 +0530 Subject: [PATCH 412/945] Return the correct length of nmea sentence. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return the correct length of nmea sentence in the function loc_eng_nmea_put_checksum(). The correct length is length of NMEA string including ‘$’ character alongwith length of checksum. Change-Id: I45a086190008df79a93b9386bc69d9c50e47c93b CRs-Fixed: 1020044 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 3672e196..3d2336f7 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -88,8 +88,12 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) length++; } + // length now contains nmea sentence string length not including $ sign. int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); - return (length + checksumLength); + + // 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); } /*=========================================================================== From 183e295b9b7fef1166c6bd0b1778dffd2321627a Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 26 May 2016 14:35:31 -0700 Subject: [PATCH 413/945] Move local gps/sap configuration to Context gps/sap configuration is moved from a global variable in loc eng to a static in ContextBase, so that it is more accessible without having to link with loc eng for access. CRs-fixed: 1012772 Change-Id: I74bf456b44fab3a2db016ef4c4b4b3a2b8cde1b2 --- core/ContextBase.cpp | 21 +++++++++ core/ContextBase.h | 64 +++++++++++++++++++++++++++ core/LocAdapterProxyBase.h | 6 +-- loc_api/libloc_api_50001/loc.cpp | 2 +- loc_api/libloc_api_50001/loc_eng.cpp | 22 +--------- loc_api/libloc_api_50001/loc_eng.h | 65 +--------------------------- 6 files changed, 92 insertions(+), 88 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 58dc8a78..c429c2de 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,6 +40,27 @@ 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; diff --git a/core/ContextBase.h b/core/ContextBase.h index fe0b8606..bd9a19f9 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -35,6 +35,64 @@ #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 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; +} 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; @@ -67,6 +125,12 @@ public: 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 diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 11859de7..82cba6b7 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -46,15 +46,15 @@ protected: inline virtual ~LocAdapterProxyBase() { delete mLocAdapterBase; } - ContextBase* getContext() const { - return mLocAdapterBase->getContext(); - } 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, diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 069a03e2..4453f148 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -318,7 +318,7 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->setGpsLockMsg(0); - loc_afw_data.adapter->requestUlp(getCarrierCapabilities()); + loc_afw_data.adapter->requestUlp(ContextBase::getCarrierCapabilities()); loc_afw_data.adapter->setXtraUserAgent(); if(retVal) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c2de21c3..f150bc36 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -78,8 +78,6 @@ using namespace loc_core; boolean configAlreadyRead = false; unsigned int agpsStatus = 0; -loc_gps_cfg_s_type gps_conf; -loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ static const loc_param_s_type gps_conf_table[] = @@ -488,7 +486,7 @@ struct LocEngSuplMode : public LocMsg { locallog(); } inline virtual void proc() const { - mUlp->setCapabilities(getCarrierCapabilities()); + mUlp->setCapabilities(ContextBase::getCarrierCapabilities()); } inline void locallog() const { } @@ -1735,24 +1733,6 @@ inline void LocEngReportGnssMeasurement::log() const { } #define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) -uint32_t getCarrierCapabilities() { - #define carrierMSA (uint32_t)0x2 - #define carrierMSB (uint32_t)0x1 - #define gpsConfMSA (uint32_t)0x4 - #define gpsConfMSB (uint32_t)0x2 - uint32_t capabilities = gps_conf.CAPABILITIES; - if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { - capabilities &= ~gpsConfMSA; - } - if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { - capabilities &= ~gpsConfMSB; - } - - LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", - gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities); - return capabilities; -} - /*=========================================================================== FUNCTION loc_eng_init diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index a968013a..b1cfe72c 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -66,7 +66,8 @@ typedef unsigned char boolean; #define FAILURE FALSE #define INVALID_ATL_CONNECTION_HANDLE -1 -#define MAX_XTRA_SERVER_URL_LENGTH 256 +#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 @@ -141,68 +142,6 @@ typedef struct loc_eng_data_s loc_ext_parser sv_ext_parser; } loc_eng_data_s_type; -/* 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 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; -} 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; - -extern loc_gps_cfg_s_type gps_conf; -extern loc_sap_cfg_s_type sap_conf; - - -uint32_t getCarrierCapabilities(); - //loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, From 059605367abbcd950935b5b02daecdc617d8d580 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 27 May 2016 13:44:44 +0530 Subject: [PATCH 414/945] Enabling CLANG compilation Removing LOCAL_CLANG := false from makefiles. Couple of instances got added back as part of LE merge. Change-Id: I7d18d573c1d12597914124e35cb024df3343f0db CRs-Fixed: 1021759 --- utils/platform_lib_abstractions/loc_pla/src/Android.mk | 1 - utils/platform_lib_abstractions/loc_stub/src/Android.mk | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index 8a708a81..f3cedd5b 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -47,7 +47,6 @@ LOCAL_COPY_HEADERS:= \ ../include/platform_lib_time.h LOCAL_MODULE := libloc_pla -LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk index 2cf25b9e..e69b012e 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -30,7 +30,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/../include \ - + LOCAL_COPY_HEADERS_TO:= libloc_stub/ LOCAL_COPY_HEADERS:= \ @@ -41,7 +41,6 @@ LOCAL_COPY_HEADERS:= \ ../include/loc_stub_time.h LOCAL_MODULE := libloc_stub -LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional From aa8a474a7424953036f728450044f612de325930 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 6 May 2016 14:20:59 +0530 Subject: [PATCH 415/945] Remove target specific logic for DR Fix Automotove changes needs LE specific fixes which is enabled by adding appropriate Makefiles Change-Id: If814af411dd1c67d7a83b07f45813d57d5f96ca9 CRs-Fixed: 1017254 --- loc_api/libloc_api_50001/loc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 434fd527..55eef9af 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -301,7 +301,7 @@ static int loc_init(GpsCallbacks* callbacks) /* If platform is "auto" and external dr enabled then enable ** Measurement report and SV Polynomial report */ - if((1 == gps_conf.EXTERNAL_DR_ENABLED) && (GNSS_AUTO == getTargetGnssType(target))) + if((1 == gps_conf.EXTERNAL_DR_ENABLED)) { event |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT | LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; From 93e8cad4f2b3cf470e6a546d152590f5bc332bf1 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 7 Jun 2016 17:17:06 +0530 Subject: [PATCH 416/945] Fix GPS related KW P1 issues for MDM9x50. Fix following GPS related KW P1 issues for MDM9x50 - 16806885,16806886,16806887, 16806888. Change-Id: I1f26fee30d7179883a48c3d067b4c90562e9e914 CRs-Fixed: 1025194 --- loc_api/libloc_api_50001/loc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 55eef9af..d225b875 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -579,10 +579,14 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL || NULL == get_gps_geofence_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(); From 0aa6e3aee910a84f8a410403d8b4276d141cac5b Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Wed, 8 Jun 2016 11:30:39 -0700 Subject: [PATCH 417/945] multiple XTRA downloaders could be triggered on boot up Disable loc xtra apis to allow only one XTRA downloader when other XTRA downloader is enabled. Change-Id: I0183608f801cdc6a7d7db730d5d633e556c95386 CRs-fixed: 1022064 --- core/ContextBase.h | 1 + core/LBSProxyBase.h | 1 + loc_api/libloc_api_50001/Android.mk | 4 ++++ loc_api/libloc_api_50001/LocEngAdapter.h | 3 +++ loc_api/libloc_api_50001/loc_eng_xtra.cpp | 7 +++++++ 5 files changed, 16 insertions(+) diff --git a/core/ContextBase.h b/core/ContextBase.h index bd9a19f9..4f8723eb 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -116,6 +116,7 @@ public: 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) { diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index b3736c20..94ddd0fb 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -69,6 +69,7 @@ public: (void)context; } + inline virtual bool hasNativeXtraClient() const { return false; } inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index cd4888d8..ad14e143 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -91,6 +91,10 @@ 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 diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b7f28f33..446acf4e 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -105,6 +105,9 @@ public: inline bool hasCPIExtendedCapabilities() { return mContext->hasCPIExtendedCapabilities(); } + inline bool hasNativeXtraClient() { + return mContext->hasNativeXtraClient(); + } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err diff --git a/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 9207564b..b5bf4e76 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -123,6 +123,13 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, 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 { From 2fc8de7ad455d7e1c879fdfdcb1eb566d18b3298 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 7 Jun 2016 15:14:06 -0700 Subject: [PATCH 418/945] making SUPL ES run time configurable SUPL ES gets updated as part of the sim specific AGPS config hot swap update. We keep that lastest SUPL ES and send that as part of the NI request, to let NI handler to know the config status. Change-Id: I566725d5db9b3abdbd9a423b86c10b819217f4f6 CRs-Fixed: 1024879 --- core/ContextBase.h | 7 ++++--- core/gps_extended_c.h | 4 ++-- loc_api/libloc_api_50001/loc.cpp | 16 +++++++++++++++- loc_api/libloc_api_50001/loc_eng.cpp | 3 +++ loc_api/libloc_api_50001/loc_eng.h | 2 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 2 +- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index bd9a19f9..1ed6715f 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -47,12 +47,13 @@ typedef struct loc_gps_cfg_s 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]; + 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; diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 9b677b87..2780ebcc 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -170,14 +170,14 @@ typedef struct { } 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. */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; + loc_ni_notify_callback notify_cb; } GpsNiExtCallbacks; typedef enum loc_server_type { diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 4453f148..ca9760d3 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -52,9 +52,15 @@ using namespace loc_core; //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); @@ -967,7 +973,8 @@ SIDE EFFECTS void loc_ni_init(GpsNiCallbacks *callbacks) { ENTRY_LOG(); - loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks); + gps_ni_cb = callbacks->notify_cb; + loc_eng_ni_init(loc_afw_data, &sGpsNiExtCallbacks); EXIT_LOG(%s, VOID_RET); } @@ -1082,3 +1089,10 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) 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/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f150bc36..9dc01599 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -88,6 +88,7 @@ static const loc_param_s_type gps_conf_table[] = {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, 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'}, @@ -129,6 +130,7 @@ static void loc_default_parameters(void) 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; @@ -2779,6 +2781,7 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, 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 = gps_conf_tmp; } diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index b1cfe72c..1fe13758 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -89,7 +89,7 @@ typedef struct loc_eng_data_s loc_sv_status_cb_ext sv_status_cb; agps_status_extended agps_status_cb; gps_nmea_callback nmea_cb; - gps_ni_notify_callback ni_notify_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; diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index a29784fc..9b454c66 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -188,7 +188,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, } CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id); - loc_eng_data.ni_notify_cb((GpsNiNotification*)notif); + loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0); } EXIT_LOG(%s, VOID_RET); } From 62743a2219dc57dd223880d575fa304af2a1251f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 9 Jun 2016 14:39:32 -0700 Subject: [PATCH 419/945] make Api ctor non public to protect objs from falsely created, as a NULL parameter for msgTask could eventually cause crash. Change-Id: Ie04fb388dab5f217f2fa520a5276dcffa5962e10 CRs-Fixed: 1026576 --- .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 4 +++- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 01d67f4c..13557c97 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -67,9 +67,11 @@ protected: 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: - LocApiRpc(const MsgTask* msgTask, + static LocApiRpc* createLocApiRpc(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask); ~LocApiRpc(); diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index f2be072f..f4b0ebf4 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -131,6 +131,17 @@ const rpc_loc_event_mask_type LocApiRpc::locBits[] = 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, From 310aa84028c4d8953f2be04131a9a0ed1d258bd8 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 10 May 2016 12:07:28 -0700 Subject: [PATCH 420/945] LPPe feature support. Add two new configuration parameters for LPPe, one to configure technologies for LPPe in Control-Plane and one to configure technologies for LPPe in User-Plane Crs-Fixed: 974312 Change-Id: If664a6dc90a993171ca1221f074ecc1ecd06a106 --- core/ContextBase.h | 2 ++ core/LocAdapterBase.h | 6 ++++- core/LocApiBase.cpp | 22 ++++++++++++++++- core/LocApiBase.h | 12 ++++++++- core/gps_extended_c.h | 7 +++++- etc/gps.conf | 14 +++++++++++ loc_api/libloc_api_50001/LocEngAdapter.h | 5 ++++ loc_api/libloc_api_50001/loc_eng.cpp | 31 ++++++++++++++++++++++++ loc_api/libloc_api_50001/loc_eng.h | 3 ++- 9 files changed, 97 insertions(+), 5 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index bd9a19f9..e32e9829 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -58,6 +58,8 @@ typedef struct loc_gps_cfg_s uint32_t GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; + uint32_t LPPE_CP_TECHNOLOGY; + uint32_t LPPE_UP_TECHNOLOGY; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index f92ccee4..2c7a2e84 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -78,6 +78,10 @@ public: 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) { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 7c114702..bda3dfd1 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* 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 @@ -132,6 +132,7 @@ LocApiBase::LocApiBase(const MsgTask* 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() @@ -356,6 +357,11 @@ 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) @@ -490,6 +496,10 @@ 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) @@ -552,4 +562,14 @@ 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/core/LocApiBase.h b/core/LocApiBase.h index e92cdaa6..372fc74c 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* 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 @@ -44,6 +44,7 @@ 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++) { \ @@ -81,6 +82,7 @@ class LocApiBase { ContextBase *mContext; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; uint64_t mSupportedMsg; + uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH]; protected: virtual enum loc_api_adapter_err @@ -131,6 +133,7 @@ public: 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: @@ -203,6 +206,8 @@ public: setExtPowerConfig(int isBatteryCharging); 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 @@ -258,6 +263,11 @@ public: 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, diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 9b677b87..f6f96f68 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* 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 @@ -87,6 +87,11 @@ enum loc_registration_mask_status { 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; diff --git a/etc/gps.conf b/etc/gps.conf index f4153149..01188132 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -109,3 +109,17 @@ SGLTE_TARGET=0 # 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 diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index b7f28f33..329104b2 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -236,6 +236,11 @@ public: { 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(); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index f150bc36..f04a221d 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -86,6 +86,8 @@ static const loc_param_s_type gps_conf_table[] = {"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'}, {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, @@ -138,6 +140,10 @@ static void loc_default_parameters(void) 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; @@ -456,6 +462,29 @@ struct LocEngAGlonassProtocol : public LocMsg { } }; + +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; @@ -1826,6 +1855,8 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) 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) { diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index b1cfe72c..56ea2efa 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. +/* 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 @@ -142,6 +142,7 @@ typedef struct loc_eng_data_s 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, From 5ceb69dc42710ee9644edb4607723872cd3cbff8 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 14 Jun 2016 16:23:42 -0700 Subject: [PATCH 421/945] Enable/disable PDN for emergency SUPL at runtime This feature makes AGPS enable/disable PDN for emergency SUPL according to new setting in gps.conf when SIM is replaced at runtime Change-Id: Idbc086b938ded02ba702ea080ded69e9b4761e46 CRs-fixed: 1026702 --- loc_api/libloc_api_50001/loc_eng.cpp | 137 ++++++++++++++++----------- 1 file changed, 82 insertions(+), 55 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 9dc01599..2bae27a0 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -196,6 +196,7 @@ 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 && @@ -1102,7 +1103,7 @@ LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) : } void LocEngRequestSuplEs::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->ds_nif) { + 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); @@ -1444,16 +1445,18 @@ struct LocEngInit : public LocMsg { // case LOC_ENG_MSG_ATL_OPEN_SUCCESS: struct LocEngAtlOpenSuccess : public LocMsg { - AgpsStateMachine* mStateMachine; + loc_eng_data_s_type* mLocEng; + const AGpsExtType mAgpsType; const int mLen; char* mAPN; const AGpsBearerType mBearerType; - inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine, + inline LocEngAtlOpenSuccess(loc_eng_data_s_type* locEng, + const AGpsExtType agpsType, const char* name, int len, AGpsBearerType btype) : LocMsg(), - mStateMachine(statemachine), mLen(len), + mLocEng(locEng), mAgpsType(agpsType), mLen(len), mAPN(new char[len+1]), mBearerType(btype) { memcpy((void*)mAPN, (void*)name, len); @@ -1465,14 +1468,15 @@ struct LocEngAtlOpenSuccess : public LocMsg { delete[] mAPN; } inline virtual void proc() const { - mStateMachine->setBearer(mBearerType); - mStateMachine->setAPN(mAPN, mLen); - mStateMachine->onRsrcEvent(RSRC_GRANTED); + 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(mStateMachine->getType()), + loc_get_agps_type_name(mAgpsType), mAPN, loc_get_agps_bear_name(mBearerType)); } @@ -1483,13 +1487,16 @@ struct LocEngAtlOpenSuccess : public LocMsg { // case LOC_ENG_MSG_ATL_CLOSED: struct LocEngAtlClosed : public LocMsg { - AgpsStateMachine* mStateMachine; - inline LocEngAtlClosed(AgpsStateMachine* statemachine) : - LocMsg(), mStateMachine(statemachine) { + 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 { - mStateMachine->onRsrcEvent(RSRC_RELEASED); + AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType); + sm->onRsrcEvent(RSRC_RELEASED); } inline void locallog() const { LOC_LOGV("LocEngAtlClosed"); @@ -1501,13 +1508,16 @@ struct LocEngAtlClosed : public LocMsg { // case LOC_ENG_MSG_ATL_OPEN_FAILED: struct LocEngAtlOpenFailed : public LocMsg { - AgpsStateMachine* mStateMachine; - inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) : - LocMsg(), mStateMachine(statemachine) { + 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 { - mStateMachine->onRsrcEvent(RSRC_DENIED); + AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType); + sm->onRsrcEvent(RSRC_DENIED); } inline void locallog() const { LOC_LOGV("LocEngAtlOpenFailed"); @@ -1549,22 +1559,17 @@ inline void LocEngUp::log() const { locallog(); } -struct LocEngDataClientInit : public LocMsg { +struct LocEngAgnssNifInit : public LocMsg { loc_eng_data_s_type* mLocEng; - inline LocEngDataClientInit(loc_eng_data_s_type* locEng) : + inline LocEngAgnssNifInit(loc_eng_data_s_type* locEng) : LocMsg(), mLocEng(locEng) { locallog(); } virtual void proc() const { - loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; - if(!locEng->adapter->initDataServiceClient()) { - locEng->ds_nif = new DSStateMachine(servicerTypeExt, - (void *)dataCallCb, - locEng->adapter); - } + createAgnssNifs(*mLocEng); } void locallog() const { - LOC_LOGV("LocEngDataClientInit\n"); + LOC_LOGV("LocEngAgnssNifInit\n"); } virtual void log() const { locallog(); @@ -2338,31 +2343,14 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call EXIT_LOG(%s, VOID_RET); return; } + bool agpsCapable = ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)); LocEngAdapter* adapter = loc_eng_data.adapter; loc_eng_data.agps_status_cb = callbacks->status_cb; - loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)loc_eng_data.agps_status_cb, - AGPS_TYPE_WWAN_ANY, - false); - loc_eng_data.wifi_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)loc_eng_data.agps_status_cb, - AGPS_TYPE_WIFI, - true); - - if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) { - loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)loc_eng_data.agps_status_cb, - AGPS_TYPE_SUPL, - false); - + if (agpsCapable && NULL != adapter) { if (adapter->mSupportsAgpsRequests) { - if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); - } - loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, - NULL, NULL, &loc_eng_data); + adapter->sendMsg(new LocEngAgnssNifInit(&loc_eng_data)); } loc_eng_agps_reinit(loc_eng_data); } @@ -2378,6 +2366,35 @@ static void deleteAidingData(loc_eng_data_s_type &logEng) { } } +// 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 (agpsCapable && 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 (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; @@ -2392,9 +2409,14 @@ getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { break; } case AGPS_TYPE_SUPL_ES: { - locEng.ds_nif ? - stateMachine = locEng.ds_nif: + 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: @@ -2436,10 +2458,9 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - loc_eng_data.adapter->sendMsg( - new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType)); + new LocEngAtlOpenSuccess(&loc_eng_data, agpsType, + apn, apn_len, bearerType)); EXIT_LOG(%d, 0); return 0; @@ -2468,8 +2489,8 @@ int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm)); + loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(&loc_eng_data, + agpsType)); EXIT_LOG(%d, 0); return 0; @@ -2498,8 +2519,8 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agps INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, return -1); - AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); - loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm)); + loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(&loc_eng_data, + agpsType)); EXIT_LOG(%d, 0); return 0; @@ -2775,6 +2796,10 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, if (gps_conf_tmp.SUPL_MODE != gps_conf.SUPL_MODE) { adapter->sendMsg(new LocEngSuplMode(adapter->getUlpProxy())); } + // 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; @@ -2783,6 +2808,8 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, 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; } From 54794a45e6c754b21b2a48e2b31f1bc2c2910563 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 8 Apr 2016 19:56:27 -0700 Subject: [PATCH 422/945] AGPS config inject can be configured out a parameter can be added to gps.conf so as to prevent carrier dependent AGPS configs to be injected to modem. This is mainly for test purposes. Change-Id: Ia053bf523329fe7c1abf0696b9bffcc6a7d56a53 CRs-Fixed: 998059 --- core/ContextBase.h | 1 + etc/gps.conf | 15 +++++++++++++++ loc_api/libloc_api_50001/loc_eng.cpp | 24 +++++++++++++++++++----- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 4f7ac394..debdc11e 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -59,6 +59,7 @@ typedef struct loc_gps_cfg_s 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; } loc_gps_cfg_s_type; diff --git a/etc/gps.conf b/etc/gps.conf index 01188132..d1781c81 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -123,3 +123,18 @@ LPPE_CP_TECHNOLOGY = 0 # 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 diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 4aaee18e..ea08d8dd 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -100,6 +100,7 @@ static const loc_param_s_type gps_conf_table[] = {"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'}, }; static const loc_param_s_type sap_conf_table[] = @@ -176,6 +177,9 @@ static void loc_default_parameters(void) /* 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 @@ -403,7 +407,9 @@ struct LocEngSetServerIpv4 : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setServer(mNlAddr, mPort, mServerType); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setServer(mNlAddr, mPort, mServerType); + } } inline void locallog() const { LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s", @@ -434,7 +440,9 @@ struct LocEngSetServerUrl : public LocMsg { delete[] mUrl; } inline virtual void proc() const { - mAdapter->setServer(mUrl, mLen); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setServer(mUrl, mLen); + } } inline void locallog() const { LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl); @@ -455,7 +463,9 @@ struct LocEngAGlonassProtocol : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + } } inline void locallog() const { LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); @@ -499,7 +509,9 @@ struct LocEngSuplVer : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setSUPLVersion(mSuplVer); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setSUPLVersion(mSuplVer); + } } inline void locallog() const { LOC_LOGV("SUPL Version: %d", mSuplVer); @@ -563,7 +575,9 @@ struct LocEngLppConfig : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->setLPPConfig(mLppConfig); + if (gps_conf.AGPS_CONFIG_INJECT) { + mAdapter->setLPPConfig(mLppConfig); + } } inline void locallog() const { LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig); From 0ac496f962e35e2b76024c3733473359dec6827e Mon Sep 17 00:00:00 2001 From: Hema Iyer Sankaranarayanan Date: Tue, 12 Jul 2016 13:40:41 -0700 Subject: [PATCH 423/945] Add field for location clients to chose position sharing option Add new configuration for location clients to specify whether position reports can be shared with other existing clients Change-Id: I44ade2e48124f992a04956ed8c34218e73face81 Crs-Fixed: 1038783 --- core/gps_extended.h | 11 +++++++---- loc_api/libloc_api_50001/loc.cpp | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/gps_extended.h b/core/gps_extended.h index b6d7a41b..9460d4ee 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -50,15 +50,17 @@ struct LocPosMode 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, - const char* cred, const char* prov) : + 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) { + 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) { @@ -73,7 +75,8 @@ struct 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) { + preferred_accuracy(50), preferred_time(120000), + share_position(true) { memset(credentials, 0, sizeof(credentials)); memset(provider, 0, sizeof(provider)); } diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index ca9760d3..6a8fa2e3 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -460,8 +460,12 @@ static int loc_set_position_mode(GpsPositionMode mode, break; } + // set position sharing option to true + bool sharePosition = true; + LocPosMode params(locMode, recurrence, min_interval, - preferred_accuracy, preferred_time, NULL, NULL); + preferred_accuracy, preferred_time, + sharePosition, NULL, NULL); ret_val = loc_eng_set_position_mode(loc_afw_data, params); EXIT_LOG(%d, ret_val); From fae54f18a2f62741abd26c1fa780c59e5802afa2 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 22 Jul 2016 17:35:40 -0700 Subject: [PATCH 424/945] Added debug messages for SV Info Added constellation field in the debug messages for SV Info Change-Id: Ie02b1284cc5c24f526c82c52ff1ecda066655aac CRs-fixed: 1013650 --- core/LocApiBase.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 40188f93..80b1ae36 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -258,24 +258,35 @@ 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", svStatus.num_svs); + 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++) { - LOC_LOGV(" %03d: %02d %d %f %f %f 0x%02X", - i, - svStatus.gnss_sv_list[i].svid, - svStatus.gnss_sv_list[i].constellation, - 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); + 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) - ); + locationExtended, + svExt) + ); } void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) From 4dd7e1c5617d89581cb6969f851177ed5e070bc6 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 6 Jul 2016 09:55:30 -0700 Subject: [PATCH 425/945] Fixed SSR issue for GNSS Measurements Fixed SSR (sub-system reset) issue when GNSS Measurements where not available after an SSR. Change-Id: Ie9ecc851fe53814f4a3e386b503b61bbca9d156d CRs-fixed: 1036070 --- core/LocApiBase.cpp | 5 ---- core/LocApiBase.h | 5 ---- loc_api/libloc_api_50001/LocEngAdapter.cpp | 16 ----------- loc_api/libloc_api_50001/LocEngAdapter.h | 6 ---- loc_api/libloc_api_50001/loc_eng.cpp | 33 ++-------------------- 5 files changed, 2 insertions(+), 63 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 40188f93..c41b9069 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -569,11 +569,6 @@ enum loc_api_adapter_err LocApiBase:: setXtraVersionCheck(enum xtra_version_check check) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -int LocApiBase:: - updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) -DEFAULT_IMPL(-1) - bool LocApiBase:: gnssConstellationConfig() DEFAULT_IMPL(false) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 4500b7e5..8849b1fc 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -256,11 +256,6 @@ public: virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); - /* - Update gps reporting events - */ - virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled); /* Check if the modem support the service */ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 5552045a..f39d70f6 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -587,22 +587,6 @@ void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData) gnssMeasurementData)); } -/* - Update Registration Mask - */ -void LocEngAdapter::updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) -{ - LOC_LOGD("entering %s", __func__); - int result = LOC_API_ADAPTER_ERR_FAILURE; - result = mLocApi->updateRegistrationMask(event, isEnabled); - if (result == LOC_API_ADAPTER_ERR_SUCCESS) { - LOC_LOGD("%s] update registration mask succeed.", __func__); - } else { - LOC_LOGE("%s] update registration mask failed.", __func__); - } -} - /* Set Gnss Constellation Config */ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 949a903c..60af647e 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -351,12 +351,6 @@ public: return mLocApi->getGpsLock(); } - /* - Update Registration Mask - */ - void updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled); - /* Set Gnss Constellation Config */ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 3d1fe58b..79ed037e 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1666,29 +1666,6 @@ struct LocEngInstallAGpsCert : public LocMsg { } }; -struct LocEngUpdateRegistrationMask : public LocMsg { - loc_eng_data_s_type* mLocEng; - LOC_API_ADAPTER_EVENT_MASK_T mMask; - loc_registration_mask_status mIsEnabled; - inline LocEngUpdateRegistrationMask(loc_eng_data_s_type* locEng, - LOC_API_ADAPTER_EVENT_MASK_T mask, - loc_registration_mask_status isEnabled) : - LocMsg(), mLocEng(locEng), mMask(mask), mIsEnabled(isEnabled) { - locallog(); - } - inline virtual void proc() const { - loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; - locEng->adapter->updateRegistrationMask(mMask, - mIsEnabled); - } - void locallog() const { - LOC_LOGV("LocEngUpdateRegistrationMask\n"); - } - virtual void log() const { - locallog(); - } -}; - struct LocEngGnssConstellationConfig : public LocMsg { LocEngAdapter* mAdapter; inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) : @@ -3053,10 +3030,7 @@ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, // updated the mask LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; - loc_eng_data.adapter->sendMsg(new LocEngUpdateRegistrationMask( - &loc_eng_data, - event, - LOC_REGISTRATION_MASK_ENABLED)); + 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__); @@ -3088,10 +3062,7 @@ void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data) // updated the mask LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; - loc_eng_data.adapter->sendMsg(new LocEngUpdateRegistrationMask( - &loc_eng_data, - event, - LOC_REGISTRATION_MASK_DISABLED)); + 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); From c01fcd784c60835f4fd5b8a2ced58a52c6e0ba99 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 19 Jul 2016 02:26:58 +0530 Subject: [PATCH 426/945] Adding new target APQ-NoWGR handling Adding handling for new ro.baseband value provided by target team If the target does not have WGR (GPS Receiver), we return NULL GPS and FLP interfaces. CRs-Fixed: 1033674 Change-Id: I1561518c4f4b0c52ab934feb2fa43e9078c91d86 --- core/ContextBase.cpp | 45 ++++++++++++++++++++++---------------------- utils/loc_target.cpp | 20 ++++++++++++++------ utils/loc_target.h | 2 +- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index c429c2de..d2f90704 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -88,30 +88,29 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) { LocApiBase* locApi = NULL; - // first if can not be MPQ - if (TARGET_MPQ != loc_get_target()) { - 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); - } + 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); - } + } + // 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); } } } diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 92bdca6d..2da2fea0 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -49,11 +49,12 @@ #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_AUTO "auto" +#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 @@ -231,11 +232,18 @@ unsigned int loc_get_target(void) 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_MPQ; + gTarget = TARGET_NO_GNSS; else gTarget = TARGET_APQ_SA; } diff --git a/utils/loc_target.h b/utils/loc_target.h index b76ed884..69395db7 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -32,7 +32,7 @@ #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_MPQ TARGET_SET(GNSS_NONE,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) From cd13c6577df175fe55fed509460273ac1abd512d Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 19 Jul 2016 22:32:07 +0530 Subject: [PATCH 427/945] Upgrade LE.UM.0.0 to use location.lnx.2.0-rel Fix LE compilation issues on location.lnx.2.0-rel branch. CRs-Fixed: 1048907 Change-Id: I5a847c82170fba3847c0132d196cd27a3757b662 --- .../loc_pla/include/platform_lib_log_util.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index 4c2d4943..5989c643 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -158,6 +158,12 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } 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) From f58ae31d1b0b50315b3fb7a82e3d22f3c40d7e53 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 2 Aug 2016 18:19:55 +0800 Subject: [PATCH 428/945] Remove deprecated api LocEngExtPowerConfig LocEngExtPowerConfig is no longer necessary. Remove it from libloc_eng. CRs-fixed: 1047042 Change-Id: I4a053e13a571f4a373899559d82e144f9bc82582 --- core/LocApiBase.cpp | 4 ---- core/LocApiBase.h | 2 -- loc_api/libloc_api_50001/LocEngAdapter.h | 5 ----- loc_api/libloc_api_50001/loc_eng.cpp | 23 ----------------------- 4 files changed, 34 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index d52f27bd..fdfc537b 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -515,10 +515,6 @@ enum loc_api_adapter_err LocApiBase:: int algorithmConfig) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - setExtPowerConfig(int isBatteryCharging) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - enum loc_api_adapter_err LocApiBase:: setAGLONASSProtocol(unsigned long aGlonassProtocol) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8849b1fc..066695ca 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -204,8 +204,6 @@ public: int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig); - virtual enum loc_api_adapter_err - setExtPowerConfig(int isBatteryCharging); virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); virtual enum loc_api_adapter_err diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 60af647e..416e4b70 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -229,11 +229,6 @@ public: gyroSamplesPerBatchHigh, gyroBatchesPerSecHigh, algorithmConfig); } - inline virtual enum loc_api_adapter_err - setExtPowerConfig(int isBatteryCharging) - { - return mLocApi->setExtPowerConfig(isBatteryCharging); - } inline virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 79ed037e..c1cc640b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -757,29 +757,6 @@ struct LocEngSensorPerfControlConfig : public LocMsg { } }; -// case LOC_ENG_MSG_EXT_POWER_CONFIG: -struct LocEngExtPowerConfig : public LocMsg { - LocEngAdapter* mAdapter; - const int mIsBatteryCharging; - inline LocEngExtPowerConfig(LocEngAdapter* adapter, - int isBatteryCharging) : - LocMsg(), mAdapter(adapter), - mIsBatteryCharging(isBatteryCharging) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setExtPowerConfig(mIsBatteryCharging); - } - inline void locallog() const { - LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d", - mIsBatteryCharging); - } - inline virtual void log() const { - locallog(); - } -}; - // case LOC_ENG_MSG_REPORT_POSITION: LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter, UlpLocation &loc, From a8fcfc76fd51771898673c7b9669cc4720eb7139 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Thu, 7 Jul 2016 16:10:03 -0700 Subject: [PATCH 429/945] deprecate legacy NTP time download deprecate boot up NTP time download in legacy XTRA downloader Change-Id: Ib7efe6b3c68677d60cdcc4efebfc04c4db39de32 CRs-fixed: 1034009 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 3 +-- loc_api/libloc_api_50001/loc.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index f39d70f6..2d9eeac0 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -549,9 +549,8 @@ enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time, if (mSupportsTimeInjection) { LOC_LOGD("%s:%d]: Injecting time", __func__, __LINE__); result = mLocApi->setTime(time, timeReference, uncertainty); - } else { - mSupportsTimeInjection = true; } + return result; } diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index bd0d7fc3..01b449ef 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -335,7 +335,8 @@ static int loc_init(GpsCallbacks* callbacks) 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->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(); From 43bb1d24be54a58463917119160189eb36c34975 Mon Sep 17 00:00:00 2001 From: Santoshkumar Zalake Date: Thu, 18 Aug 2016 20:31:28 +0530 Subject: [PATCH 430/945] Update SV ID field as 16 bits in GnssSvPolynomial Change SV ID field in GnssSvPolynomial structure to support new constellations Change-Id: Ieb2c765a9f1999e9fbc9f69c3b59cef3c03913a8 CRs-Fixed: 1055694 --- core/gps_extended_c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index e16d7584..46be08b5 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1016,8 +1016,9 @@ typedef enum typedef struct { size_t size; - uint8_t gnssSvId; - /* GPS: 1-32, GLO: 65-96, 0: Invalid + uint16_t gnssSvId; + /* GPS: 1-32, GLO: 65-96, 0: Invalid, + SBAS: 120-151, BDS:201-237,GAL:301 to 336 All others are reserved */ int8_t freqNum; From b707704985c8fbe252bb01da38907bac71354006 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 11 Aug 2016 13:11:28 +0800 Subject: [PATCH 431/945] Generate GAL NMEA sentences at AP side Generate GAGSV sentence at AP side when NMEA Provider is set to AP in gps.conf Change-Id: I2cd436d61bab09386aaa813e85591e02f560b41e CRs-fixed: 1051996 --- loc_api/libloc_api_50001/loc_eng.h | 1 + loc_api/libloc_api_50001/loc_eng_nmea.cpp | 738 ++++++++++++---------- 2 files changed, 420 insertions(+), 319 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 1ff391ad..dc39f60b 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -123,6 +123,7 @@ typedef struct loc_eng_data_s boolean generateNmea; uint32_t gps_used_mask; uint32_t glo_used_mask; + uint32_t gal_used_mask; float hdop; float pdop; float vdop; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 3d2336f7..ac057c11 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -34,6 +34,105 @@ #include #include +#define GLONASS_SV_ID_OFFSET 64 +#define MAX_SATELLITES_IN_USE 12 +typedef struct loc_nmea_sv_meta_s +{ + char talker[3]; + GnssConstellationType svType; + uint32_t mask; + uint32_t svIdOffset; +} loc_nmea_sv_meta; + +/*=========================================================================== +FUNCTION loc_eng_nmea_sv_meta_init + +DESCRIPTION + Init loc_nmea_sv_meta passed in + +DEPENDENCIES + NONE + +RETURN VALUE + Pointer to loc_nmea_sv_meta + +SIDE EFFECTS + N/A + +===========================================================================*/ +static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data_p, + loc_nmea_sv_meta& sv_meta, GnssConstellationType svType, bool needCombine) +{ + if (!loc_eng_data_p) + return NULL; + + memset(&sv_meta, 0, sizeof(sv_meta)); + sv_meta.svType = svType; + sv_meta.talker[0] = 'G'; + + switch (svType) + { + case GNSS_CONSTELLATION_GPS: + sv_meta.talker[1] = 'P'; + sv_meta.mask = loc_eng_data_p->gps_used_mask; + break; + case GNSS_CONSTELLATION_GLONASS: + sv_meta.talker[1] = 'L'; + sv_meta.mask = loc_eng_data_p->glo_used_mask; + // GLONASS SV ids are from 65-96 + sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; + break; + case GNSS_CONSTELLATION_GALILEO: + sv_meta.talker[1] = 'A'; + sv_meta.mask = loc_eng_data_p->gal_used_mask; + break; + default: + LOC_LOGE("NMEA Error unknow constellation type: %d", svType); + return NULL; + } + if (needCombine && + (loc_eng_data_p->gps_used_mask ? 1 : 0) + + (loc_eng_data_p->glo_used_mask ? 1 : 0) + + (loc_eng_data_p->gal_used_mask ? 1 : 0) > 1) + { + // If GPS, GLONASS, Galileo etc. are combined + // to obtain the reported position solution, + // talker shall be set to GN, to indicate that + // the satellites are used in a combined solution + sv_meta.talker[1] = 'N'; + } + return &sv_meta; +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_count_bits + +DESCRIPTION + Count how many bits are set in mask + +DEPENDENCIES + NONE + +RETURN VALUE + Bits number set in mask + +SIDE EFFECTS + N/A + +===========================================================================*/ +static uint32_t loc_eng_nmea_count_bits(uint32_t mask) +{ + uint32_t count = 0; + while (mask) + { + if (mask & 1) + count++; + mask = mask >> 1; + } + return count; +} + + /*=========================================================================== FUNCTION loc_eng_nmea_send @@ -96,6 +195,249 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) return (length + checksumLength + 1); } +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_GSA + +DESCRIPTION + Generate NMEA GSA sentences generated based on position report + Currently below sentences are generated: + - $GPGSA : GPS DOP and active SVs + - $GLGSA : GLONASS DOP and active SVs + - $GAGSA : GALILEO DOP and active SVs + - $GNGSA : GNSS DOP and active SVs + +DEPENDENCIES + NONE + +RETURN VALUE + Number of SVs used + +SIDE EFFECTS + N/A + +===========================================================================*/ +uint32_t loc_eng_nmea_generate_GSA(loc_eng_data_s_type *loc_eng_data_p, + const GpsLocationExtended &locationExtended, + char* sentence, + int bufSize, + loc_nmea_sv_meta* sv_meta_p) +{ + if (!loc_eng_data_p || !sentence || bufSize <= 0 || !sv_meta_p) + { + LOC_LOGE("NMEA Error invalid arguments."); + return 0; + } + + char* pMarker = sentence; + int lengthRemaining = bufSize; + int length = 0; + + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + + char fixType = '\0'; + + const char* talker = sv_meta_p->talker; + uint32_t svIdOffset = sv_meta_p->svIdOffset; + uint32_t mask = sv_meta_p->mask; + + for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) + { + if (mask & 1) + svUsedList[svUsedCount++] = i + svIdOffset; + mask = mask >> 1; + } + + if (svUsedCount == 0 && GNSS_CONSTELLATION_GPS != sv_meta_p->svType) + return 0; + + if (svUsedCount == 0) + fixType = '1'; // no fix + else if (svUsedCount <= 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 + // 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, "$%sGSA,A,%c,", talker, fixType); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return 0; + } + pMarker += length; + lengthRemaining -= length; + + // Add first 12 satellite IDs + for (uint8_t i = 0; i < 12; i++) + { + 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 0; + } + 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, bufSize); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + + return svUsedCount; +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_GSV + +DESCRIPTION + Generate NMEA GSV sentences generated based on sv report + Currently below sentences are generated: + - $GPGSV: GPS Satellites in View + - $GNGSV: GLONASS Satellites in View + - $GAGSV: GALILEO Satellites in View + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_nmea_generate_GSV(loc_eng_data_s_type *loc_eng_data_p, + const GnssSvStatus &svStatus, + char* sentence, + int bufSize, + loc_nmea_sv_meta* sv_meta_p) +{ + if (!loc_eng_data_p || !sentence || bufSize <= 0) + { + LOC_LOGE("NMEA Error invalid argument."); + return; + } + + char* pMarker = sentence; + int lengthRemaining = bufSize; + int length = 0; + int sentenceCount = 0; + int sentenceNumber = 1; + int svNumber = 1; + + const char* talker = sv_meta_p->talker; + uint32_t svIdOffset = sv_meta_p->svIdOffset; + uint32_t mask = sv_meta_p->mask; + uint32_t svCount = loc_eng_nmea_count_bits(mask); + + + if (svCount <= 0) + { + // no svs in view, so just send a blank $--GSV sentence + snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", talker); + length = loc_eng_nmea_put_checksum(sentence, bufSize); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + return; + } + + svNumber = 1; + sentenceNumber = 1; + sentenceCount = svCount / 4 + (svCount % 4 != 0); + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = bufSize; + + length = snprintf(pMarker, lengthRemaining, "$%sGSV,%d,%d,%02d", + talker, sentenceCount, sentenceNumber, svCount); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (int i=0; (svNumber <= svStatus.num_svs) && (i < 4); svNumber++) + { + if (sv_meta_p->svType == 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, bufSize); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + sentenceNumber++; + + } //while +} + /*=========================================================================== FUNCTION loc_eng_nmea_generate_pos @@ -103,10 +445,12 @@ 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 + - $GLGSA : GLONASS DOP and active SVs + - $GAGSA : GALILEO DOP and active SVs + - $GNGSA : GNSS DOP and active SVs + - $--VTG : Track made good and ground speed + - $--RMC : Recommended minimum navigation information + - $--GGA : Time, position and fix related data DEPENDENCIES NONE @@ -144,174 +488,49 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcMSeconds = (location.gpsLocation.timestamp)%1000; if (generate_nmea) { - // ------------------ - // ------$GPGSA------ - // ------------------ - + char talker[3] = {'G', 'P', '\0'}; 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++) + uint32_t count = 0; + loc_nmea_sv_meta sv_meta; + // ------------------- + // ---$GPGSA/$GNGSA--- + // ------------------- + + count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, true)); + if (count > 0) { - if (mask & 1) - svUsedList[svUsedCount++] = i; - mask = mask >> 1; + svUsedCount += count; + talker[1] = sv_meta.talker[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 + // ------------------- + // ---$GLGSA/$GNGSA--- + // ------------------- - length = snprintf(pMarker, lengthRemaining, "$GPGSA,A,%c,", fixType); - - if (length < 0 || length >= lengthRemaining) + count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, true)); + if (count > 0) { - LOC_LOGE("NMEA Error in string formatting"); - return; + svUsedCount += count; + talker[1] = sv_meta.talker[1]; } - pMarker += length; - lengthRemaining -= length; - for (uint8_t i = 0; i < 12; i++) // only the first 12 sv go in sentence + // ------------------- + // ---$GAGSA/$GNGSA--- + // ------------------- + + count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, true)); + if (count > 0) { - 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; + svUsedCount += count; + talker[1] = sv_meta.talker[1]; } - 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------ - // ------------------ + // ------------------- + // ------$--VTG------- + // ------------------- pMarker = sentence; lengthRemaining = sizeof(sentence); @@ -328,11 +547,11 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, magTrack -= 360.0; } - length = snprintf(pMarker, lengthRemaining, "$GPVTG,%.1lf,T,%.1lf,M,", location.gpsLocation.bearing, magTrack); + length = snprintf(pMarker, lengthRemaining, "$%sVTG,%.1lf,T,%.1lf,M,", talker, location.gpsLocation.bearing, magTrack); } else { - length = snprintf(pMarker, lengthRemaining, "$GPVTG,,T,,M,"); + length = snprintf(pMarker, lengthRemaining, "$%sVTG,,T,,M,", talker); } if (length < 0 || length >= lengthRemaining) @@ -373,15 +592,15 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); loc_eng_nmea_send(sentence, length, loc_eng_data_p); - // ------------------ - // ------$GPRMC------ - // ------------------ + // ------------------- + // ------$--RMC------- + // ------------------- pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , - utcHours, utcMinutes, utcSeconds,utcMSeconds/10); + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , + talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -526,15 +745,15 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); loc_eng_nmea_send(sentence, length, loc_eng_data_p); - // ------------------ - // ------$GPGGA------ - // ------------------ + // ------------------- + // ------$--GGA------- + // ------------------- pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , - utcHours, utcMinutes, utcSeconds, utcMSeconds/10); + length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , + talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -601,6 +820,9 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, else gpsQuality = '2'; // 2 means DGPS fix + // Number of satellites in use, 00-12 + if (svUsedCount > MAX_SATELLITES_IN_USE) + svUsedCount = MAX_SATELLITES_IN_USE; if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { // dop is in locationExtended, (QMI) length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", @@ -657,6 +879,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); loc_eng_nmea_send(sentence, length, loc_eng_data_p); + // clear the cache so they can't be used again + loc_eng_data_p->gps_used_mask = 0; + loc_eng_data_p->glo_used_mask = 0; + loc_eng_data_p->gal_used_mask = 0; } //Send blank NMEA reports for non-final fixes else { @@ -719,13 +945,12 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, 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; + loc_eng_data_p->gal_used_mask = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation) { @@ -735,7 +960,6 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, { 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) { @@ -745,164 +969,40 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, { loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); } - glnCount++; + } + else if (GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation) + { + // cache the used in fix mask, as it will be needed to send $GAGSA + // 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->gal_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); + } } } + loc_nmea_sv_meta sv_meta; // ------------------ // ------$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 + loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, false)); // ------------------ // ------$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); + loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, false)); - while (sentenceNumber <= sentenceCount) - { - pMarker = sentence; - lengthRemaining = sizeof(sentence); + // ------------------ + // ------$GAGSV------ + // ------------------ - length = snprintf(pMarker, lengthRemaining, "$GLGSV,%d,%d,%02d", - sentenceCount, sentenceNumber, glnCount); + loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, false)); - 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. From 7424ac78edd73e3d564a0a561253ee7b1141928c Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sat, 27 Aug 2016 02:46:25 +0530 Subject: [PATCH 432/945] Adding TARGET_NO_GNSS check while creating LocApi In case target is APQ no WGR, create a dummy LocApiBase instance. Change-Id: I621e99f5be5524a58f416ff2e1325d921c8d0546 CRs-Fixed: 1060111 --- core/ContextBase.cpp | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index d2f90704..1ae84823 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -88,31 +88,35 @@ 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) { + // Check the target + if (TARGET_NO_GNSS != loc_get_target()){ + + 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 (NULL != getter) { - LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, + 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); + } + } + } } } From 3493ce50e4fbf177d73731f7ed95f57764e559f9 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 30 Aug 2016 02:13:29 +0530 Subject: [PATCH 433/945] Fix race condition when GPS app is closed around an SSR event Fix race condition to get avoid stuck in modem if GPS application is closed right around a SSR event.This fix will prevent resume the session once HAL loc_stop has been called. Change-Id: I4e5c3f09c097b835d8a685a8b465eb86dd06cd7a CRs-Fixed: 1058559 --- loc_api/libloc_api_50001/loc_eng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index c1cc640b..bd4f8ea6 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -2024,7 +2024,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) 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); } @@ -2933,8 +2932,9 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { // This sets the copy in adapter to modem loc_eng_data.adapter->setInSession(false); - loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); + loc_eng_start_handler(loc_eng_data); } + EXIT_LOG(%s, VOID_RET); } From 5b4dbc2e55ab8577c53a49844b5250039e6ea98f Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 2 Aug 2016 18:34:04 -0700 Subject: [PATCH 434/945] Combo Provider 2.0 Part of overall Combo Provider 2.0 changes. This fix changes getBestWwanPosition API from sync to async, as the QMI API used can now take longer to produce a position CRs-fixed: 994048 Change-Id: I5654f9ab417ffea86ed8653731df1ca47cf7e733 --- core/LocAdapterBase.cpp | 5 +++++ core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 8 +++++++- core/LocApiBase.h | 3 ++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 6a3f969b..899ad847 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -146,4 +146,9 @@ DEFAULT_IMPL(false) void LocAdapterBase:: reportGnssMeasurementData(GnssData &gnssMeasurementData) DEFAULT_IMPL() + +bool LocAdapterBase:: + reportWwanZppFix(GpsLocation &zppLoc) +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index af251386..0b1d3d94 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -124,6 +124,7 @@ public: inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); + virtual bool reportWwanZppFix(GpsLocation &zppLoc); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index d52f27bd..8262ef15 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -254,6 +254,12 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } +void LocApiBase::reportWwanZppFix(GpsLocation &zppLoc) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); +} + void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) @@ -528,7 +534,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation& zppLoc) + getWwanZppFix() DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8849b1fc..067d7e26 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -136,6 +136,7 @@ public: void saveSupportedMsgList(uint64_t supportedMsgList); void reportGnssMeasurementData(GnssData &gnssMeasurementData); void saveSupportedFeatureList(uint8_t *featureList); + void reportWwanZppFix(GpsLocation &zppLoc); // downward calls // All below functions are to be defined by adapter specific modules: @@ -211,7 +212,7 @@ public: virtual enum loc_api_adapter_err setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP); virtual enum loc_api_adapter_err - getWwanZppFix(GpsLocation & zppLoc); + getWwanZppFix(); virtual enum loc_api_adapter_err getBestAvailableZppFix(GpsLocation & zppLoc); virtual enum loc_api_adapter_err From 0ac11fcd8400451a5c9e42de7a7a64400b0fbfb6 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 16 Sep 2016 14:05:37 +0530 Subject: [PATCH 435/945] GTP WWAN should work even if MSA/MSB is not enabled GTP WWAN should work even if MSA/MSB is not enabled in capabilities. Removing wifi_nif we don't need it any more. Change-Id: I6736e5f4320d4c35bc5bbb8272b45e14f66988c3 CRs-Fixed: 1067691 --- loc_api/libloc_api_50001/loc_eng.cpp | 47 ++++++++++------------------ loc_api/libloc_api_50001/loc_eng.h | 1 - 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index bd4f8ea6..318786dc 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1248,16 +1248,7 @@ LocEngReqRelWifi::~LocEngReqRelWifi() { } void LocEngReqRelWifi::proc() const { loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->wifi_nif) { - WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); - if (mIsReq) { - locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); - } else { - locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); - } - } else { - locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); - } + locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); } inline void LocEngReqRelWifi::locallog() const { LOC_LOGV("%s - senderId: %d, ssid: %s, password: %s", @@ -2345,12 +2336,10 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call EXIT_LOG(%s, VOID_RET); return; } - bool agpsCapable = ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)); LocEngAdapter* adapter = loc_eng_data.adapter; loc_eng_data.agps_status_cb = callbacks->status_cb; - if (agpsCapable && NULL != adapter) { + if (NULL != adapter) { if (adapter->mSupportsAgpsRequests) { adapter->sendMsg(new LocEngAgnssNifInit(&loc_eng_data)); } @@ -2373,25 +2362,27 @@ 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 (agpsCapable && NULL != adapter && adapter->mSupportsAgpsRequests) { + 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 (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); + 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); + } } } } @@ -2401,10 +2392,6 @@ static AgpsStateMachine* getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { AgpsStateMachine* stateMachine; switch (agpsType) { - case AGPS_TYPE_WIFI: { - stateMachine = locEng.wifi_nif; - break; - } case AGPS_TYPE_INVALID: case AGPS_TYPE_SUPL: { stateMachine = locEng.agnss_nif; diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index dc39f60b..9418fa95 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -105,7 +105,6 @@ typedef struct loc_eng_data_s // AGPS state machines AgpsStateMachine* agnss_nif; AgpsStateMachine* internet_nif; - AgpsStateMachine* wifi_nif; //State machine for Data Services AgpsStateMachine* ds_nif; From dcd5af2915a091493a4f98486de8e52173f37a52 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Wed, 10 Aug 2016 17:14:18 +0530 Subject: [PATCH 436/945] NMEA report indication to ULP Enabled NMEA report indication to to ulp Change-Id: Ia27fe0d805f53bf17c86f7c27eaaedd960101370 CRs-Fixed: 1055201 --- core/UlpProxyBase.h | 6 ++++++ core/gps_extended_c.h | 9 +++++++++ loc_api/Makefile.am | 6 +++++- loc_api/libloc_api_50001/LocEngAdapter.cpp | 15 +++++++++++---- loc_api/libloc_api_50001/LocEngAdapter.h | 1 + loc_api/libloc_api_50001/loc_eng_nmea.cpp | 3 +++ 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 5d93e2b9..7f896a67 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -112,6 +112,12 @@ public: (void)aidingData; return false; } + inline virtual bool reportNmea(const char* nmea, int length) + { + (void)nmea; + (void)length; + return false; + } }; } // namespace loc_core diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 46be08b5..87599053 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -78,6 +78,7 @@ extern "C" { #define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 #define ULP_MIN_INTERVAL_INVALID 0xffffffff +#define ULP_MAX_NMEA_STRING_SIZE 201 /*Emergency SUPL*/ #define GPS_NI_TYPE_EMERGENCY_SUPL 4 @@ -110,6 +111,14 @@ typedef struct { unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE]; } UlpLocation; +typedef struct { + /** set to sizeof(UlpNmea) */ + size_t size; + char nmea_str[ULP_MAX_NMEA_STRING_SIZE]; + unsigned int len; +} UlpNmea; + + /** AGPS type */ typedef int16_t AGpsExtType; #define AGPS_TYPE_INVALID -1 diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am index a5f529bd..46480974 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -6,7 +6,11 @@ AM_CFLAGS = \ $(LOCPLA_CFLAGS) \ -fno-short-enums \ -D__func__=__PRETTY_FUNCTION__ \ - -DTARGET_USES_QCOM_BSP + -DTARGET_USES_QCOM_BSP \ + -std=c++11 + +AM_CPPFLAGS = \ + -std=c++11 libloc_eng_so_la_h_sources = \ loc_eng_dmn_conn_glue_msg.h \ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 2d9eeac0..73f5ed6d 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* 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 @@ -433,10 +433,17 @@ void LocEngAdapter::reportStatus(GpsStatusValue status) } } -inline -void LocEngAdapter::reportNmea(const char* nmea, int length) +void LocInternalAdapter::reportNmea(const char* nmea, int length) { - sendMsg(new LocEngReportNmea(mOwner, nmea, length)); + sendMsg(new LocEngReportNmea(mLocEngAdapter->getOwner(), nmea, length)); +} + +inline void LocEngAdapter::reportNmea(const char* nmea, int length) +{ + if (!mUlp->reportNmea(nmea, length)) { + //Report it to HAL + mInternalAdapter->reportNmea(nmea, length); + } } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 416e4b70..4afea495 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -63,6 +63,7 @@ public: virtual void stopFixInt(); virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); + virtual void reportNmea(const char* nmea, int length); }; typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index ac057c11..6ab4a5f8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -156,6 +156,9 @@ void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_dat 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_eng_data_p->adapter->getUlpProxy()->reportNmea(pNmea, length); + LOC_LOGD("NMEA <%s", pNmea); } From 2110e55809a67d6a4487ec97260c2421d6928246 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 7 Oct 2016 16:04:40 -0700 Subject: [PATCH 437/945] Remove USE_EMERGENCY_FOR_EMERGENCY_SUPL and SUPL_ES in gps.conf These values can be configured per SIM so they should not be overriden by gps.conf by default. They're left commented out so that it can still be uncommented to allowing overriding SIM configuration for testing purposes Change-Id: Id2f560d88294ab98441005bf54be799af9ed3f8b CRs-fixed: 1075611 --- etc/gps.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index c74e8264..4b48558f 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -38,12 +38,12 @@ INTERMEDIATE_POS=0 SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable -SUPL_ES=0 +#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 +#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 From dad844f3e038bafc891181ee4e264b87ac02bc4f Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 8 Jul 2016 11:20:54 +0530 Subject: [PATCH 438/945] Platform specific changes for QDR Added platform specific abstraction apis for timer modules Change-Id: I71d5cb847fc6a66227137b2b424f7e631e09cae8 --- utils/Makefile.am | 2 +- .../loc_pla/include/platform_lib_time.h | 1 + .../loc_pla/src/platform_lib_time.cpp | 16 ++++++++++++++-- .../loc_stub/include/loc_stub_time.h | 1 + .../loc_stub/src/loc_stub_time.cpp | 13 +++++++++++-- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/utils/Makefile.am b/utils/Makefile.am index 50f10078..f816565b 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -49,7 +49,7 @@ 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) +libgps_utils_so_la_LIBADD = -lcutils -lstdc++ -llog $(LOCPLA_LIBS) #Create and Install libraries lib_LTLIBRARIES = libgps_utils_so.la diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h index 2905a74c..ae25ae60 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h @@ -31,5 +31,6 @@ #include int64_t platform_lib_abstraction_elapsed_millis_since_boot(); +int64_t platform_lib_abstraction_elapsed_micros_since_boot(); #endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp index dc7dff11..3dcd4d3e 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp @@ -31,6 +31,8 @@ #include #else #include +#include + #endif /* USE_GLIB */ int64_t platform_lib_abstraction_elapsed_millis_since_boot() @@ -41,7 +43,17 @@ int64_t platform_lib_abstraction_elapsed_millis_since_boot() #else - return android::elapsedRealtime(); - + //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; + return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; +#endif +} +int64_t platform_lib_abstraction_elapsed_micros_since_boot() +{ +#ifdef USE_GLIB + return elapsedMicrosSinceBoot(); + +#else + //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); + return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); #endif } diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h index 271e2ff4..f00a49bb 100644 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h +++ b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h @@ -37,6 +37,7 @@ extern "C" { int64_t systemTime(int clock); int64_t elapsedMillisSinceBoot(); +int64_t elapsedMicrosSinceBoot(); #ifdef __cplusplus } diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp index 82dc593f..499cf008 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp @@ -29,6 +29,7 @@ #include "loc_stub_time.h" #include #include +#include int64_t systemTime(int clock) { @@ -38,9 +39,17 @@ int64_t systemTime(int clock) return t.tv_sec*1000000LL + t.tv_usec; } +int64_t elapsedMicrosSinceBoot() +{ + struct timespec ts; + int64_t time_ms = 0; + clock_gettime(CLOCK_BOOTTIME, &ts); + time_ms += (ts.tv_sec * 1000000000LL); /* Seconds to nanoseconds */ + time_ms += ts.tv_nsec; /* Add Nanoseconds */ + return time_ms; +} int64_t elapsedMillisSinceBoot() { - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; + return (int64_t) (elapsedMicrosSinceBoot() /1000000LL); } From 90a730d1798a4dcafc8ec622294827234d895fda Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Wed, 26 Oct 2016 16:15:39 +0530 Subject: [PATCH 439/945] Mark SV used_in_fix based on the most recent position report When SV report comes, mark used_in_fix based on the most recent position report. Change-Id: I98f3f4e7836de86f9025bae446cdeac6d1eb5862 CRs-Fixed: 1080013 --- core/LocApiBase.cpp | 9 +++- core/gps_extended_c.h | 21 ++++++++ loc_api/libloc_api_50001/LocEngAdapter.cpp | 1 + loc_api/libloc_api_50001/LocEngAdapter.h | 23 ++++++++- loc_api/libloc_api_50001/loc_eng.cpp | 56 +++++++++++++++++++++- 5 files changed, 105 insertions(+), 5 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3af79b2d..e67f956b 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -237,13 +237,18 @@ void LocApiBase::reportPosition(UlpLocation &location, 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", + "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); + 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, diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 87599053..7da69a93 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -262,6 +262,18 @@ typedef uint16_t GpsLocationExtendedFlags; #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, @@ -278,6 +290,13 @@ typedef struct { /* 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) */ @@ -312,6 +331,8 @@ typedef struct { float horUncEllipseOrientAzimuth; Gnss_ApTimeStampStructType timeStamp; + /** Gnss sv used in position data */ + GnssSvUsedInPosition gnss_sv_used_ids; } GpsLocationExtended; enum loc_sess_status { diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 73f5ed6d..9db513cc 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -81,6 +81,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; + clearGnssSvUsedListData(); LOC_LOGD("LocEngAdapter created"); } diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 4afea495..dd308b8e 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -80,7 +80,9 @@ class LocEngAdapter : public LocAdapterBase { 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; @@ -111,6 +113,25 @@ public: } 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() { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 318786dc..86be6e15 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -290,6 +290,7 @@ LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) : 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 @@ -806,6 +807,10 @@ void LocEngReportPosition::proc() const { (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; @@ -880,14 +885,61 @@ void LocEngReportSv::proc() const { 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; + int prnMin = 0; + uint64_t svUsedIdMask = 0; + for (int i=0; i < numSv; i++) + { + gnssSvId = gnssSvStatus.gnss_sv_list[i].svid; + if (gnssSvId <= GPS_SV_PRN_MAX) + { + svUsedIdMask = gnssSvIdUsedInPosition.gps_sv_used_ids_mask; + prnMin = GPS_SV_PRN_MIN; + } + else if ((gnssSvId >= GLO_SV_PRN_MIN) && (gnssSvId <= GLO_SV_PRN_MAX)) + { + svUsedIdMask = gnssSvIdUsedInPosition.glo_sv_used_ids_mask; + prnMin = GLO_SV_PRN_MIN; + } + else if ((gnssSvId >= BDS_SV_PRN_MIN) && (gnssSvId <= BDS_SV_PRN_MAX)) + { + svUsedIdMask = gnssSvIdUsedInPosition.bds_sv_used_ids_mask; + prnMin = BDS_SV_PRN_MIN; + } + else if ((gnssSvId >= GAL_SV_PRN_MIN) && (gnssSvId <= GAL_SV_PRN_MAX)) + { + svUsedIdMask = gnssSvIdUsedInPosition.gal_sv_used_ids_mask; + prnMin = GAL_SV_PRN_MIN; + } + + // 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 - prnMin))) + { + 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*)&(mSvStatus)); + locEng->gnss_sv_status_cb((GnssSvStatus*)&(gnssSvStatus)); } if (locEng->generateNmea) { - loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended); + loc_eng_nmea_generate_sv(locEng, gnssSvStatus, mLocationExtended); } } } From 1de8a18031532d0253d854d3e6923e02e2ba8405 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 18 Oct 2016 17:13:20 +0530 Subject: [PATCH 440/945] Reinitialize dataservice client post SSR On SSR invoke dsi_release() and dsi_init(Mode_SSR) to recover data call functionality post SSR. Change-Id: Ie784dad73ae8d6d91cf4cb87efe938af9015a7a2 CRs-Fixed: 1073101 --- core/LocApiBase.cpp | 6 +++- core/LocApiBase.h | 3 +- loc_api/libloc_api_50001/LocEngAdapter.h | 8 +++-- loc_api/libloc_api_50001/loc_eng.cpp | 42 +++++++++++++++++++++++- 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3af79b2d..2857e785 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -549,7 +549,7 @@ enum loc_api_adapter_err LocApiBase:: } int LocApiBase:: - initDataServiceClient() + initDataServiceClient(bool isDueToSsr) DEFAULT_IMPL(-1) int LocApiBase:: @@ -564,6 +564,10 @@ void LocApiBase:: closeDataCall() DEFAULT_IMPL() +void LocApiBase:: + releaseDataServiceClient() +DEFAULT_IMPL() + int LocApiBase:: setGpsLock(LOC_GPS_LOCK_MASK lock) DEFAULT_IMPL(-1) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 4655332e..2d0cc8c6 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -215,10 +215,11 @@ public: getBestAvailableZppFix(GpsLocation & zppLoc); virtual enum loc_api_adapter_err getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); - virtual int initDataServiceClient(); + virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); virtual void closeDataCall(); + virtual void releaseDataServiceClient(); virtual void installAGpsCert(const DerEncodedCertificate* pData, size_t length, uint32_t slotBitMask); diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 4afea495..713470a6 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -240,9 +240,9 @@ public: { return mLocApi->setLPPeProtocol(lppeCP, lppeUP); } - inline virtual int initDataServiceClient() + inline virtual int initDataServiceClient(bool isDueToSsr) { - return mLocApi->initDataServiceClient(); + return mLocApi->initDataServiceClient(isDueToSsr); } inline virtual int openAndStartDataCall() { @@ -256,6 +256,10 @@ public: { mLocApi->closeDataCall(); } + inline virtual void releaseDataServiceClient() + { + mLocApi->releaseDataServiceClient(); + } inline enum loc_api_adapter_err getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) { diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 318786dc..ccfc6e74 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -186,6 +186,7 @@ static void loc_default_parameters(void) // 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_dsclient_release(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, @@ -2308,6 +2309,39 @@ static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data) } EXIT_LOG(%s, VOID_RET); } + +/*=========================================================================== +FUNCTION loc_eng_dsclient_release + +DESCRIPTION + Stop/Close/Release DS client when modem SSR happens. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + int result = 1; + LocEngAdapter* adapter = loc_eng_data.adapter; + if (NULL != adapter && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) + { + // stop and close the ds client + adapter->stopDataCall(); + adapter->closeDataCall(); + adapter->releaseDataServiceClient(); + } + EXIT_LOG(%s, VOID_RET); +} + + /*=========================================================================== FUNCTION loc_eng_agps_init @@ -2378,7 +2412,7 @@ static void createAgnssNifs(loc_eng_data_s_type& locEng) { } if (NULL == locEng.ds_nif && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL && - 0 == adapter->initDataServiceClient()) { + 0 == adapter->initDataServiceClient(false)) { locEng.ds_nif = new DSStateMachine(servicerTypeExt, (void *)dataCallCb, locEng.adapter); @@ -2912,6 +2946,12 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.internet_nif) loc_eng_data.internet_nif->dropAllSubscribers(); + // reinitialize DS client in SSR mode + loc_eng_dsclient_release(loc_eng_data); + if (loc_eng_data.adapter->mSupportsAgpsRequests && + gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + loc_eng_data.adapter->initDataServiceClient(true); + } loc_eng_agps_reinit(loc_eng_data); } From f871943dc5bea132f1d4e13d2d5d5d62be15bb25 Mon Sep 17 00:00:00 2001 From: David Ng Date: Thu, 8 Dec 2016 23:53:21 -0800 Subject: [PATCH 441/945] Add explicit liblog dependency Explicitly add liblog as dependency for modules that use Android logging. Also remove obsolete build flag. Change-Id: I91a458b44ff34c91a8f6875f5c3e931f620c613a --- core/Android.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/Android.mk b/core/Android.mk index 3650fbb3..f8f84ce6 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -21,6 +21,7 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libgps.utils \ libdl \ + liblog \ libloc_pla LOCAL_SRC_FILES += \ @@ -52,8 +53,6 @@ LOCAL_COPY_HEADERS:= \ loc_core_log.h \ LocAdapterProxyBase.h -LOCAL_PRELINK_MODULE := false - include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID From 3fe22406e1b49e6c3f01414ba3c9d7a4b3d9389d Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Wed, 23 Nov 2016 10:26:00 -0800 Subject: [PATCH 442/945] update gps.conf added XTRA CA path to gps.conf to support https in XC2.0. assigned the default value. Change-Id: Ie9216a98621762484ab98f9e8459b63223707448 --- etc/gps.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index 4b48558f..01699bf0 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -19,6 +19,9 @@ 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 From 4bb940c0679ab23c9b8954bcb9ad8da5ede093cd Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 19 Oct 2016 10:58:29 +0800 Subject: [PATCH 443/945] Decouple libhardware usage on LE for gnss models Remove all usage of gps.h and fused_location.h from all gnss models except gps/fpl hal librarys Change-Id: I90ba233c6bbe5c31a4cacceeb981833719c871f2 CRs-Fixed: 1067953 --- configure.ac | 10 - core/Android.mk | 1 + core/LocAdapterBase.cpp | 12 +- core/LocAdapterBase.h | 12 +- core/LocApiBase.cpp | 28 +- core/LocApiBase.h | 26 +- core/Makefile.am | 1 + core/UlpProxyBase.h | 6 +- core/gps_extended.h | 6 +- core/gps_extended_c.h | 62 +- core/loc_core_log.cpp | 102 +- core/loc_core_log.h | 18 +- core/loc_gps.h | 2205 +++++++++++++++++ loc-hal.pc.in | 2 +- loc_api/Makefile.am | 21 +- .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 12 +- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 100 +- loc_api/libloc_api_50001/Android.mk | 4 +- loc_api/libloc_api_50001/LocEngAdapter.cpp | 16 +- loc_api/libloc_api_50001/LocEngAdapter.h | 29 +- loc_api/libloc_api_50001/Makefile.am | 140 +- loc_api/libloc_api_50001/gps_converter.cpp | 255 ++ loc_api/libloc_api_50001/gps_converter.h | 69 + loc_api/libloc_api_50001/gps_interface.cpp | 1196 +++++++++ loc_api/libloc_api_50001/loc.cpp | 199 +- loc_api/libloc_api_50001/loc.h | 21 +- loc_api/libloc_api_50001/loc_eng.cpp | 150 +- loc_api/libloc_api_50001/loc_eng.h | 38 +- loc_api/libloc_api_50001/loc_eng_agps.cpp | 30 +- loc_api/libloc_api_50001/loc_eng_agps.h | 11 +- .../loc_eng_dmn_conn_handler.cpp | 12 +- .../loc_eng_dmn_conn_handler.h | 2 - loc_api/libloc_api_50001/loc_eng_msg.h | 17 +- loc_api/libloc_api_50001/loc_eng_ni.cpp | 26 +- loc_api/libloc_api_50001/loc_eng_ni.h | 4 +- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 60 +- loc_api/libloc_api_50001/loc_eng_nmea.h | 3 +- loc_api/libloc_api_50001/loc_eng_xtra.h | 4 +- utils/loc_target.cpp | 1 - 39 files changed, 4293 insertions(+), 618 deletions(-) create mode 100644 core/loc_gps.h create mode 100644 loc_api/libloc_api_50001/gps_converter.cpp create mode 100644 loc_api/libloc_api_50001/gps_converter.h create mode 100644 loc_api/libloc_api_50001/gps_interface.cpp diff --git a/configure.ac b/configure.ac index 4ef39eed..4d14c4fc 100644 --- a/configure.ac +++ b/configure.ac @@ -45,16 +45,6 @@ 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]), diff --git a/core/Android.mk b/core/Android.mk index f8f84ce6..319a02a8 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -48,6 +48,7 @@ LOCAL_COPY_HEADERS:= \ LocDualContext.h \ LBSProxyBase.h \ UlpProxyBase.h \ + loc_gps.h \ gps_extended_c.h \ gps_extended.h \ loc_core_log.h \ diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 899ad847..166fd910 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -80,7 +80,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(GnssSvStatus &svStatus, + reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() @@ -94,7 +94,7 @@ void LocAdapterBase:: DEFAULT_IMPL() void LocAdapterBase:: - reportStatus(GpsStatusValue status) + reportStatus(LocGpsStatusValue status) DEFAULT_IMPL() @@ -120,7 +120,7 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestATL(int connHandle, AGpsType agps_type) + requestATL(int connHandle, LocAGpsType agps_type) DEFAULT_IMPL(false) bool LocAdapterBase:: @@ -140,15 +140,15 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestNiNotify(GpsNiNotification ¬ify, const void* data) + requestNiNotify(LocGpsNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) void LocAdapterBase:: - reportGnssMeasurementData(GnssData &gnssMeasurementData) + reportGnssMeasurementData(LocGnssData &gnssMeasurementData) DEFAULT_IMPL() bool LocAdapterBase:: - reportWwanZppFix(GpsLocation &zppLoc) + reportWwanZppFix(LocGpsLocation &zppLoc) DEFAULT_IMPL(false) } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 0b1d3d94..f3ec4890 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -102,29 +102,29 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - virtual void reportStatus(GpsStatusValue status); + virtual void reportStatus(LocGpsStatusValue 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 requestATL(int connHandle, LocAGpsType agps_type); virtual bool releaseATL(int connHandle); virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual bool requestNiNotify(GpsNiNotification ¬ify, + virtual bool requestNiNotify(LocGpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } - virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); - virtual bool reportWwanZppFix(GpsLocation &zppLoc); + virtual void reportGnssMeasurementData(LocGnssData &gnssMeasurementData); + virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 35041f61..4cc8cb8d 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -259,13 +259,13 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportWwanZppFix(GpsLocation &zppLoc) +void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc) { // loop through adapters, and deliver to the first handling adapter. TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); } -void LocApiBase::reportSv(GnssSvStatus &svStatus, +void LocApiBase::reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { @@ -277,7 +277,7 @@ void LocApiBase::reportSv(GnssSvStatus &svStatus, " sv: constellation svid cN0" " elevation azimuth flags", svStatus.num_svs); - for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) { + for (int i = 0; i < svStatus.num_svs && i < LOC_GNSS_MAX_SVS; i++) { if (svStatus.gnss_sv_list[i].constellation > sizeof(constellationString) / sizeof(constellationString[0]) - 1) { svStatus.gnss_sv_list[i].constellation = 0; @@ -316,7 +316,7 @@ void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) ); } -void LocApiBase::reportStatus(GpsStatusValue status) +void LocApiBase::reportStatus(LocGpsStatusValue status) { // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status)); @@ -354,7 +354,7 @@ void LocApiBase::requestLocation() TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); } -void LocApiBase::requestATL(int connHandle, AGpsType agps_type) +void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type) { // loop through adapters, and deliver to the first handling adapter. TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type)); @@ -384,7 +384,7 @@ void LocApiBase::reportDataCallClosed() TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed()); } -void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) +void LocApiBase::requestNiNotify(LocGpsNiNotification ¬ify, const void* data) { // loop through adapters, and deliver to the first handling adapter. TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); @@ -406,7 +406,7 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData) +void LocApiBase::reportGnssMeasurementData(LocGnssData &gnssMeasurementData) { // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData)); @@ -429,7 +429,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - deleteAidingData(GpsAidingData f) + deleteAidingData(LocGpsAidingData f) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -445,7 +445,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) + setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -458,7 +458,7 @@ 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) + AGpsBearerType bear, LocAGpsType agpsType) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -479,7 +479,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - informNiResponse(GpsUserResponseType userResponse, + informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -539,14 +539,14 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation& zppLoc) + getBestAvailableZppFix(LocGpsLocation& 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) + getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask) { memset(&zppLoc, 0, sizeof(zppLoc)); memset(&tech_mask, 0, sizeof(tech_mask)); @@ -578,7 +578,7 @@ int LocApiBase:: DEFAULT_IMPL(-1) void LocApiBase:: - installAGpsCert(const DerEncodedCertificate* pData, + installAGpsCert(const LocDerEncodedCertificate* pData, size_t length, uint32_t slotBitMask) DEFAULT_IMPL() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 2d0cc8c6..9127a2ea 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -115,28 +115,28 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GnssSvStatus &svStatus, + void reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - void reportStatus(GpsStatusValue status); + void reportStatus(LocGpsStatusValue 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 requestATL(int connHandle, LocAGpsType agps_type); void releaseATL(int connHandle); void requestSuplES(int connHandle); void reportDataCallOpened(); void reportDataCallClosed(); - void requestNiNotify(GpsNiNotification ¬ify, const void* data); + void requestNiNotify(LocGpsNiNotification ¬ify, const void* data); void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGnssMeasurementData(GnssData &gnssMeasurementData); + void reportGnssMeasurementData(LocGnssData &gnssMeasurementData); void saveSupportedFeatureList(uint8_t *featureList); - void reportWwanZppFix(GpsLocation &zppLoc); + void reportWwanZppFix(LocGpsLocation &zppLoc); // downward calls // All below functions are to be defined by adapter specific modules: @@ -149,7 +149,7 @@ public: virtual enum loc_api_adapter_err stopFix(); virtual enum loc_api_adapter_err - deleteAidingData(GpsAidingData f); + deleteAidingData(LocGpsAidingData f); virtual enum loc_api_adapter_err enableData(int enable); virtual enum loc_api_adapter_err @@ -157,13 +157,13 @@ public: 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); + setTime(LocGpsUtcTime 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); + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType); virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err @@ -174,7 +174,7 @@ public: setServer(unsigned int ip, int port, LocServerType type); virtual enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData); + informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData); virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); virtual enum loc_api_adapter_err @@ -212,15 +212,15 @@ public: virtual enum loc_api_adapter_err getWwanZppFix(); virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc); + getBestAvailableZppFix(LocGpsLocation & zppLoc); virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); virtual void closeDataCall(); virtual void releaseDataServiceClient(); - virtual void installAGpsCert(const DerEncodedCertificate* pData, + virtual void installAGpsCert(const LocDerEncodedCertificate* pData, size_t length, uint32_t slotBitMask); inline virtual void setInSession(bool inSession) { diff --git a/core/Makefile.am b/core/Makefile.am index 341153ad..b3d833f6 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -12,6 +12,7 @@ libloc_core_la_h_sources = \ LocDualContext.h \ LBSProxyBase.h \ UlpProxyBase.h \ + loc_gps.h \ gps_extended_c.h \ gps_extended.h \ loc_core_log.h \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index 7f896a67..d30e9cc5 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -63,7 +63,7 @@ public: (void)loc_technology_mask; return false; } - inline virtual bool reportSv(GnssSvStatus &svStatus, + inline virtual bool reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { (void)svStatus; @@ -81,7 +81,7 @@ public: (void)svPolynomial; return false; } - inline virtual bool reportStatus(GpsStatusValue status) { + inline virtual bool reportStatus(LocGpsStatusValue status) { (void)status; return false; @@ -107,7 +107,7 @@ public: (void)number_of_locations; return false; } - inline virtual bool reportDeleteAidingData(GpsAidingData aidingData) + inline virtual bool reportDeleteAidingData(LocGpsAidingData aidingData) { (void)aidingData; return false; diff --git a/core/gps_extended.h b/core/gps_extended.h index 9460d4ee..5255da1a 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -46,14 +46,14 @@ extern "C" { struct LocPosMode { LocPositionMode mode; - GpsPositionRecurrence recurrence; + LocGpsPositionRecurrence 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, + LocPosMode(LocPositionMode m, LocGpsPositionRecurrence recr, uint32_t gap, uint32_t accu, uint32_t time, bool sp, const char* cred, const char* prov) : mode(m), recurrence(recr), @@ -73,7 +73,7 @@ struct LocPosMode inline LocPosMode() : mode(LOC_POSITION_MODE_MS_BASED), - recurrence(GPS_POSITION_RECURRENCE_PERIODIC), + recurrence(LOC_GPS_POSITION_RECURRENCE_PERIODIC), min_interval(GPS_DEFAULT_FIX_INTERVAL_MS), preferred_accuracy(50), preferred_time(120000), share_position(true) { diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 7da69a93..3985e994 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include /** @@ -47,14 +47,14 @@ extern "C" { /** 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 +/** LocGpsLocation has valid "is indoor?" flag */ +#define LOC_GPS_LOCATION_HAS_IS_INDOOR 0x0040 +/** LocGpsLocation has valid floor number */ +#define LOC_GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080 +/** LocGpsLocation has valid map URL*/ +#define LOC_GPS_LOCATION_HAS_MAP_URL 0x0100 +/** LocGpsLocation has valid map index */ +#define LOC_GPS_LOCATION_HAS_MAP_INDEX 0x0200 /** Sizes for indoor fields */ #define GPS_LOCATION_MAP_URL_SIZE 400 @@ -81,10 +81,10 @@ extern "C" { #define ULP_MAX_NMEA_STRING_SIZE 201 /*Emergency SUPL*/ -#define GPS_NI_TYPE_EMERGENCY_SUPL 4 +#define LOC_GPS_NI_TYPE_EMERGENCY_SUPL 4 -#define AGPS_CERTIFICATE_MAX_LENGTH 2000 -#define AGPS_CERTIFICATE_MAX_SLOTS 10 +#define LOC_AGPS_CERTIFICATE_MAX_LENGTH 2000 +#define LOC_AGPS_CERTIFICATE_MAX_SLOTS 10 enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, @@ -99,7 +99,7 @@ typedef enum { typedef struct { /** set to sizeof(UlpLocation) */ size_t size; - GpsLocation gpsLocation; + LocGpsLocation gpsLocation; /* Provider indicator for HYBRID or GPS */ uint16_t position_source; /*allows HAL to pass additional information related to the location */ @@ -121,13 +121,13 @@ typedef struct { /** 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 +#define LOC_AGPS_TYPE_INVALID -1 +#define LOC_AGPS_TYPE_ANY 0 +#define LOC_AGPS_TYPE_SUPL 1 +#define LOC_AGPS_TYPE_C2K 2 +#define LOC_AGPS_TYPE_WWAN_ANY 3 +#define LOC_AGPS_TYPE_WIFI 4 +#define LOC_AGPS_TYPE_SUPL_ES 5 /** SSID length */ #define SSID_BUF_SIZE (32+1) @@ -140,13 +140,13 @@ typedef int16_t AGpsBearerType; /** GPS extended callback structure. */ typedef struct { - /** set to sizeof(GpsCallbacks) */ + /** set to sizeof(LocGpsCallbacks) */ 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; + loc_gps_set_capabilities set_capabilities_cb; + loc_gps_acquire_wakelock acquire_wakelock_cb; + loc_gps_release_wakelock release_wakelock_cb; + loc_gps_create_thread create_thread_cb; + loc_gps_request_utc_time request_utc_time_cb; } GpsExtCallbacks; /** Callback to report the xtra server url to the client. @@ -157,8 +157,8 @@ 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; + loc_gps_xtra_download_request download_request_cb; + loc_gps_create_thread create_thread_cb; report_xtra_server report_xtra_server_cb; } GpsXtraExtCallbacks; @@ -168,7 +168,7 @@ typedef struct { size_t size; AGpsExtType type; - AGpsStatusValue status; + LocAGpsStatusValue status; uint32_t ipv4_addr; struct sockaddr_storage addr; char ssid[SSID_BUF_SIZE]; @@ -183,11 +183,11 @@ 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; + loc_gps_create_thread create_thread_cb; } AGpsExtCallbacks; -typedef void (*loc_ni_notify_callback)(GpsNiNotification *notification, bool esEnalbed); +typedef void (*loc_ni_notify_callback)(LocGpsNiNotification *notification, bool esEnalbed); /** GPS NI callback structure. */ typedef struct { diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 4556fae3..620d1b0a 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -51,16 +51,16 @@ void LocPosMode::logv() const /* 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 ), + NAME_VAL( LOC_GPS_STATUS_NONE ), + NAME_VAL( LOC_GPS_STATUS_SESSION_BEGIN ), + NAME_VAL( LOC_GPS_STATUS_SESSION_END ), + NAME_VAL( LOC_GPS_STATUS_ENGINE_ON ), + NAME_VAL( LOC_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) +const char* loc_get_gps_status_name(LocGpsStatusValue gps_status) { return loc_get_name_from_val(gps_status_name, gps_status_num, (long) gps_status); @@ -81,7 +81,7 @@ static const loc_name_val_s_type loc_eng_position_modes[] = }; 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) +const char* loc_get_position_mode_name(LocGpsPositionMode mode) { return loc_get_name_from_val(loc_eng_position_modes, loc_eng_position_mode_num, (long) mode); } @@ -90,12 +90,12 @@ const char* loc_get_position_mode_name(GpsPositionMode mode) static const loc_name_val_s_type loc_eng_position_recurrences[] = { - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) + NAME_VAL( LOC_GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( LOC_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) +const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur) { return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur); } @@ -104,23 +104,23 @@ const char* loc_get_position_recurrence_name(GpsPositionRecurrence 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) + NAME_VAL( LOC_GPS_DELETE_EPHEMERIS ), + NAME_VAL( LOC_GPS_DELETE_ALMANAC ), + NAME_VAL( LOC_GPS_DELETE_POSITION ), + NAME_VAL( LOC_GPS_DELETE_TIME ), + NAME_VAL( LOC_GPS_DELETE_IONO ), + NAME_VAL( LOC_GPS_DELETE_UTC ), + NAME_VAL( LOC_GPS_DELETE_HEALTH ), + NAME_VAL( LOC_GPS_DELETE_SVDIR ), + NAME_VAL( LOC_GPS_DELETE_SVSTEER ), + NAME_VAL( LOC_GPS_DELETE_SADATA ), + NAME_VAL( LOC_GPS_DELETE_RTI ), + NAME_VAL( LOC_GPS_DELETE_CELLDB_INFO ), + NAME_VAL( LOC_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) +const char* loc_get_aiding_data_mask_names(LocGpsAidingData data) { return NULL; } @@ -128,15 +128,15 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data) 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 ) + NAME_VAL( LOC_AGPS_TYPE_INVALID ), + NAME_VAL( LOC_AGPS_TYPE_ANY ), + NAME_VAL( LOC_AGPS_TYPE_SUPL ), + NAME_VAL( LOC_AGPS_TYPE_C2K ), + NAME_VAL( LOC_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) +const char* loc_get_agps_type_name(LocAGpsType type) { return loc_get_name_from_val(loc_eng_agps_types, loc_eng_agps_type_num, (long) type); } @@ -144,14 +144,14 @@ const char* loc_get_agps_type_name(AGpsType 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 ) + NAME_VAL( LOC_GPS_NI_TYPE_VOICE ), + NAME_VAL( LOC_GPS_NI_TYPE_UMTS_SUPL ), + NAME_VAL( LOC_GPS_NI_TYPE_UMTS_CTRL_PLANE ), + NAME_VAL( LOC_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) +const char* loc_get_ni_type_name(LocGpsNiType type) { return loc_get_name_from_val(loc_eng_ni_types, loc_eng_ni_type_num, (long) type); } @@ -159,13 +159,13 @@ const char* loc_get_ni_type_name(GpsNiType 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 ) + NAME_VAL( LOC_GPS_NI_RESPONSE_ACCEPT ), + NAME_VAL( LOC_GPS_NI_RESPONSE_DENY ), + NAME_VAL( LOC_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) +const char* loc_get_ni_response_name(LocGpsUserResponseType response) { return loc_get_name_from_val(loc_eng_ni_responses, loc_eng_ni_reponse_num, (long) response); } @@ -173,15 +173,15 @@ const char* loc_get_ni_response_name(GpsUserResponseType 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 ) + NAME_VAL( LOC_GPS_ENC_NONE ), + NAME_VAL( LOC_GPS_ENC_SUPL_GSM_DEFAULT ), + NAME_VAL( LOC_GPS_ENC_SUPL_UTF8 ), + NAME_VAL( LOC_GPS_ENC_SUPL_UCS2 ), + NAME_VAL( LOC_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) +const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding) { return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding); } @@ -229,15 +229,15 @@ const char* loc_get_position_sess_status_name(enum loc_sess_status 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 ) + NAME_VAL( LOC_GPS_REQUEST_AGPS_DATA_CONN ), + NAME_VAL( LOC_GPS_RELEASE_AGPS_DATA_CONN ), + NAME_VAL( LOC_GPS_AGPS_DATA_CONNECTED ), + NAME_VAL( LOC_GPS_AGPS_DATA_CONN_DONE ), + NAME_VAL( LOC_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) +const char* loc_get_agps_status_name(LocAGpsStatusValue status) { return loc_get_name_from_val(loc_eng_agps_status_names, loc_eng_agps_status_num, (long) status); } diff --git a/core/loc_core_log.h b/core/loc_core_log.h index 8a1825ac..4fe8d3f2 100644 --- a/core/loc_core_log.h +++ b/core/loc_core_log.h @@ -38,18 +38,18 @@ extern "C" #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_gps_status_name(LocGpsStatusValue gps_status); +const char* loc_get_position_mode_name(LocGpsPositionMode mode); +const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur); +const char* loc_get_aiding_data_mask_names(LocGpsAidingData data); +const char* loc_get_agps_type_name(LocAGpsType type); +const char* loc_get_ni_type_name(LocGpsNiType type); +const char* loc_get_ni_response_name(LocGpsUserResponseType response); +const char* loc_get_ni_encoding_name(LocGpsNiEncodingType 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); +const char* loc_get_agps_status_name(LocAGpsStatusValue status); #ifdef __cplusplus } diff --git a/core/loc_gps.h b/core/loc_gps.h new file mode 100644 index 00000000..cdb1af67 --- /dev/null +++ b/core/loc_gps.h @@ -0,0 +1,2205 @@ +/* + * Copyright (C) 2010 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. + */ + +#ifndef LOC_GPS_H +#define LOC_GPS_H + +#include +#include +#include +#include +#include +#include + +__BEGIN_DECLS + +#define LOC_FLP_STATUS_LOCATION_AVAILABLE 0 +#define LOC_FLP_STATUS_LOCATION_UNAVAILABLE 1 +#define LOC_CAPABILITY_GNSS (1U<<0) +#define LOC_CAPABILITY_WIFI (1U<<1) +#define LOC_CAPABILITY_CELL (1U<<3) + +/** Milliseconds since January 1, 1970 */ +typedef int64_t LocGpsUtcTime; + +/** Maximum number of SVs for loc_gps_sv_status_callback(). */ +#define LOC_GPS_MAX_SVS 32 +/** Maximum number of SVs for loc_gps_sv_status_callback(). */ +#define LOC_GNSS_MAX_SVS 64 + +/** Maximum number of Measurements in loc_gps_measurement_callback(). */ +#define LOC_GPS_MAX_MEASUREMENT 32 + +/** Maximum number of Measurements in loc_gnss_measurement_callback(). */ +#define LOC_GNSS_MAX_MEASUREMENT 64 + +/** Requested operational mode for GPS operation. */ +typedef uint32_t LocGpsPositionMode; +/* IMPORTANT: Note that the following values must match + * constants in GpsLocationProvider.java. */ +/** Mode for running GPS standalone (no assistance). */ +#define LOC_GPS_POSITION_MODE_STANDALONE 0 +/** AGPS MS-Based mode. */ +#define LOC_GPS_POSITION_MODE_MS_BASED 1 +/** + * AGPS MS-Assisted mode. This mode is not maintained by the platform anymore. + * It is strongly recommended to use LOC_GPS_POSITION_MODE_MS_BASED instead. + */ +#define LOC_GPS_POSITION_MODE_MS_ASSISTED 2 + +/** Requested recurrence mode for GPS operation. */ +typedef uint32_t LocGpsPositionRecurrence; +/* IMPORTANT: Note that the following values must match + * constants in GpsLocationProvider.java. */ +/** Receive GPS fixes on a recurring basis at a specified period. */ +#define LOC_GPS_POSITION_RECURRENCE_PERIODIC 0 +/** Request a single shot GPS fix. */ +#define LOC_GPS_POSITION_RECURRENCE_SINGLE 1 + +/** GPS status event values. */ +typedef uint16_t LocGpsStatusValue; +/* IMPORTANT: Note that the following values must match + * constants in GpsLocationProvider.java. */ +/** GPS status unknown. */ +#define LOC_GPS_STATUS_NONE 0 +/** GPS has begun navigating. */ +#define LOC_GPS_STATUS_SESSION_BEGIN 1 +/** GPS has stopped navigating. */ +#define LOC_GPS_STATUS_SESSION_END 2 +/** GPS has powered on but is not navigating. */ +#define LOC_GPS_STATUS_ENGINE_ON 3 +/** GPS is powered off. */ +#define LOC_GPS_STATUS_ENGINE_OFF 4 + +/** Flags to indicate which values are valid in a LocGpsLocation. */ +typedef uint16_t LocGpsLocationFlags; +/* IMPORTANT: Note that the following values must match + * constants in GpsLocationProvider.java. */ +/** LocGpsLocation has valid latitude and longitude. */ +#define LOC_GPS_LOCATION_HAS_LAT_LONG 0x0001 +/** LocGpsLocation has valid altitude. */ +#define LOC_GPS_LOCATION_HAS_ALTITUDE 0x0002 +/** LocGpsLocation has valid speed. */ +#define LOC_GPS_LOCATION_HAS_SPEED 0x0004 +/** LocGpsLocation has valid bearing. */ +#define LOC_GPS_LOCATION_HAS_BEARING 0x0008 +/** LocGpsLocation has valid accuracy. */ +#define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010 + +/** Flags for the loc_gps_set_capabilities callback. */ + +/** + * GPS HAL schedules fixes for LOC_GPS_POSITION_RECURRENCE_PERIODIC mode. If this is + * not set, then the framework will use 1000ms for min_interval and will start + * and call start() and stop() to schedule the GPS. + */ +#define LOC_GPS_CAPABILITY_SCHEDULING (1 << 0) +/** GPS supports MS-Based AGPS mode */ +#define LOC_GPS_CAPABILITY_MSB (1 << 1) +/** GPS supports MS-Assisted AGPS mode */ +#define LOC_GPS_CAPABILITY_MSA (1 << 2) +/** GPS supports single-shot fixes */ +#define LOC_GPS_CAPABILITY_SINGLE_SHOT (1 << 3) +/** GPS supports on demand time injection */ +#define LOC_GPS_CAPABILITY_ON_DEMAND_TIME (1 << 4) +/** GPS supports Geofencing */ +#define LOC_GPS_CAPABILITY_GEOFENCING (1 << 5) +/** GPS supports Measurements. */ +#define LOC_GPS_CAPABILITY_MEASUREMENTS (1 << 6) +/** GPS supports Navigation Messages */ +#define LOC_GPS_CAPABILITY_NAV_MESSAGES (1 << 7) + +/** + * Flags used to specify which aiding data to delete when calling + * delete_aiding_data(). + */ +typedef uint16_t LocGpsAidingData; +/* IMPORTANT: Note that the following values must match + * constants in GpsLocationProvider.java. */ +#define LOC_GPS_DELETE_EPHEMERIS 0x0001 +#define LOC_GPS_DELETE_ALMANAC 0x0002 +#define LOC_GPS_DELETE_POSITION 0x0004 +#define LOC_GPS_DELETE_TIME 0x0008 +#define LOC_GPS_DELETE_IONO 0x0010 +#define LOC_GPS_DELETE_UTC 0x0020 +#define LOC_GPS_DELETE_HEALTH 0x0040 +#define LOC_GPS_DELETE_SVDIR 0x0080 +#define LOC_GPS_DELETE_SVSTEER 0x0100 +#define LOC_GPS_DELETE_SADATA 0x0200 +#define LOC_GPS_DELETE_RTI 0x0400 +#define LOC_GPS_DELETE_CELLDB_INFO 0x8000 +#define LOC_GPS_DELETE_ALL 0xFFFF + +/** AGPS type */ +typedef uint16_t LocAGpsType; +#define LOC_AGPS_TYPE_SUPL 1 +#define LOC_AGPS_TYPE_C2K 2 + +typedef uint16_t LocAGpsSetIDType; +#define LOC_AGPS_SETID_TYPE_NONE 0 +#define LOC_AGPS_SETID_TYPE_IMSI 1 +#define LOC_AGPS_SETID_TYPE_MSISDN 2 + +typedef uint16_t LocApnIpType; +#define LOC_APN_IP_INVALID 0 +#define LOC_APN_IP_IPV4 1 +#define LOC_APN_IP_IPV6 2 +#define LOC_APN_IP_IPV4V6 3 + +/** + * String length constants + */ +#define LOC_GPS_NI_SHORT_STRING_MAXLEN 256 +#define LOC_GPS_NI_LONG_STRING_MAXLEN 2048 + +/** + * LocGpsNiType constants + */ +typedef uint32_t LocGpsNiType; +#define LOC_GPS_NI_TYPE_VOICE 1 +#define LOC_GPS_NI_TYPE_UMTS_SUPL 2 +#define LOC_GPS_NI_TYPE_UMTS_CTRL_PLANE 3 +/*Emergency SUPL*/ +#define LOC_GPS_NI_TYPE_EMERGENCY_SUPL 4 + +/** + * LocGpsNiNotifyFlags constants + */ +typedef uint32_t LocGpsNiNotifyFlags; +/** NI requires notification */ +#define LOC_GPS_NI_NEED_NOTIFY 0x0001 +/** NI requires verification */ +#define LOC_GPS_NI_NEED_VERIFY 0x0002 +/** NI requires privacy override, no notification/minimal trace */ +#define LOC_GPS_NI_PRIVACY_OVERRIDE 0x0004 + +/** + * GPS NI responses, used to define the response in + * NI structures + */ +typedef int LocGpsUserResponseType; +#define LOC_GPS_NI_RESPONSE_ACCEPT 1 +#define LOC_GPS_NI_RESPONSE_DENY 2 +#define LOC_GPS_NI_RESPONSE_NORESP 3 + +/** + * NI data encoding scheme + */ +typedef int LocGpsNiEncodingType; +#define LOC_GPS_ENC_NONE 0 +#define LOC_GPS_ENC_SUPL_GSM_DEFAULT 1 +#define LOC_GPS_ENC_SUPL_UTF8 2 +#define LOC_GPS_ENC_SUPL_UCS2 3 +#define LOC_GPS_ENC_UNKNOWN -1 + +/** AGPS status event values. */ +typedef uint16_t LocAGpsStatusValue; +/** GPS requests data connection for AGPS. */ +#define LOC_GPS_REQUEST_AGPS_DATA_CONN 1 +/** GPS releases the AGPS data connection. */ +#define LOC_GPS_RELEASE_AGPS_DATA_CONN 2 +/** AGPS data connection initiated */ +#define LOC_GPS_AGPS_DATA_CONNECTED 3 +/** AGPS data connection completed */ +#define LOC_GPS_AGPS_DATA_CONN_DONE 4 +/** AGPS data connection failed */ +#define LOC_GPS_AGPS_DATA_CONN_FAILED 5 + +typedef uint16_t LocAGpsRefLocationType; +#define LOC_AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 +#define LOC_AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 +#define LOC_AGPS_REF_LOCATION_TYPE_MAC 3 +#define LOC_AGPS_REF_LOCATION_TYPE_LTE_CELLID 4 + +/* Deprecated, to be removed in the next Android release. */ +#define LOC_AGPS_REG_LOCATION_TYPE_MAC 3 + +/** Network types for update_network_state "type" parameter */ +#define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE 0 +#define LOC_AGPS_RIL_NETWORK_TYPE_WIFI 1 +#define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 +#define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 +#define LOC_AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 +#define LOC_AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 +#define LOC_AGPS_RIL_NETWORK_TTYPE_WIMAX 6 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t LocGpsClockFlags; +#define LOC_GPS_CLOCK_HAS_LEAP_SECOND (1<<0) +#define LOC_GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) +#define LOC_GPS_CLOCK_HAS_FULL_BIAS (1<<2) +#define LOC_GPS_CLOCK_HAS_BIAS (1<<3) +#define LOC_GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) +#define LOC_GPS_CLOCK_HAS_DRIFT (1<<5) +#define LOC_GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) + +/** + * Flags to indicate what fields in LocGnssClock are valid. + */ +typedef uint16_t LocGnssClockFlags; +/** A valid 'leap second' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_LEAP_SECOND (1<<0) +/** A valid 'time uncertainty' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) +/** A valid 'full bias' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_FULL_BIAS (1<<2) +/** A valid 'bias' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_BIAS (1<<3) +/** A valid 'bias uncertainty' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) +/** A valid 'drift' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_DRIFT (1<<5) +/** A valid 'drift uncertainty' is stored in the data structure. */ +#define LOC_GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t LocGpsClockType; +#define LOC_GPS_CLOCK_TYPE_UNKNOWN 0 +#define LOC_GPS_CLOCK_TYPE_LOCAL_HW_TIME 1 +#define LOC_GPS_CLOCK_TYPE_GPS_TIME 2 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint32_t LocGpsMeasurementFlags; +#define LOC_GPS_MEASUREMENT_HAS_SNR (1<<0) +#define LOC_GPS_MEASUREMENT_HAS_ELEVATION (1<<1) +#define LOC_GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2) +#define LOC_GPS_MEASUREMENT_HAS_AZIMUTH (1<<3) +#define LOC_GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4) +#define LOC_GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5) +#define LOC_GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6) +#define LOC_GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7) +#define LOC_GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8) +#define LOC_GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) +#define LOC_GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) +#define LOC_GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) +#define LOC_GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) +#define LOC_GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13) +#define LOC_GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14) +#define LOC_GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15) +#define LOC_GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16) +#define LOC_GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17) +#define LOC_GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE (1<<18) + +/** + * Flags to indicate what fields in LocGnssMeasurement are valid. + */ +typedef uint32_t LocGnssMeasurementFlags; +/** A valid 'snr' is stored in the data structure. */ +#define LOC_GNSS_MEASUREMENT_HAS_SNR (1<<0) +/** A valid 'carrier frequency' is stored in the data structure. */ +#define LOC_GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) +/** A valid 'carrier cycles' is stored in the data structure. */ +#define LOC_GNSS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) +/** A valid 'carrier phase' is stored in the data structure. */ +#define LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) +/** A valid 'carrier phase uncertainty' is stored in the data structure. */ +#define LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t LocGpsLossOfLock; +#define LOC_GPS_LOSS_OF_LOCK_UNKNOWN 0 +#define LOC_GPS_LOSS_OF_LOCK_OK 1 +#define LOC_GPS_LOSS_OF_LOCK_CYCLE_SLIP 2 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. Use LocGnssMultipathIndicator instead. + */ +typedef uint8_t LocGpsMultipathIndicator; +#define LOC_GPS_MULTIPATH_INDICATOR_UNKNOWN 0 +#define LOC_GPS_MULTIPATH_INDICATOR_DETECTED 1 +#define LOC_GPS_MULTIPATH_INDICATOR_NOT_USED 2 + +/** + * Enumeration of available values for the GNSS Measurement's multipath + * indicator. + */ +typedef uint8_t LocGnssMultipathIndicator; +/** The indicator is not available or unknown. */ +#define LOC_GNSS_MULTIPATH_INDICATOR_UNKNOWN 0 +/** The measurement is indicated to be affected by multipath. */ +#define LOC_GNSS_MULTIPATH_INDICATOR_PRESENT 1 +/** The measurement is indicated to be not affected by multipath. */ +#define LOC_GNSS_MULTIPATH_INDICATOR_NOT_PRESENT 2 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t LocGpsMeasurementState; +#define LOC_GPS_MEASUREMENT_STATE_UNKNOWN 0 +#define LOC_GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0) +#define LOC_GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1) +#define LOC_GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) +#define LOC_GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3) +#define LOC_GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) + +/** + * Flags indicating the GNSS measurement state. + * + * The expected behavior here is for GPS HAL to set all the flags that applies. + * For example, if the state for a satellite is only C/A code locked and bit + * synchronized, and there is still millisecond ambiguity, the state should be + * set as: + * + * LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK | LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC | + * LOC_GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS + * + * If GNSS is still searching for a satellite, the corresponding state should be + * set to LOC_GNSS_MEASUREMENT_STATE_UNKNOWN(0). + */ +typedef uint32_t LocGnssMeasurementState; +#define LOC_GNSS_MEASUREMENT_STATE_UNKNOWN 0 +#define LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK (1<<0) +#define LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC (1<<1) +#define LOC_GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) +#define LOC_GNSS_MEASUREMENT_STATE_TOW_DECODED (1<<3) +#define LOC_GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) +#define LOC_GNSS_MEASUREMENT_STATE_SYMBOL_SYNC (1<<5) +#define LOC_GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC (1<<6) +#define LOC_GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED (1<<7) +#define LOC_GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC (1<<8) +#define LOC_GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC (1<<9) +#define LOC_GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK (1<<10) +#define LOC_GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK (1<<11) +#define LOC_GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC (1<<12) +#define LOC_GNSS_MEASUREMENT_STATE_SBAS_SYNC (1<<13) + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t LocGpsAccumulatedDeltaRangeState; +#define LOC_GPS_ADR_STATE_UNKNOWN 0 +#define LOC_GPS_ADR_STATE_VALID (1<<0) +#define LOC_GPS_ADR_STATE_RESET (1<<1) +#define LOC_GPS_ADR_STATE_CYCLE_SLIP (1<<2) + +/** + * Flags indicating the Accumulated Delta Range's states. + */ +typedef uint16_t LocGnssAccumulatedDeltaRangeState; +#define LOC_GNSS_ADR_STATE_UNKNOWN 0 +#define LOC_GNSS_ADR_STATE_VALID (1<<0) +#define LOC_GNSS_ADR_STATE_RESET (1<<1) +#define LOC_GNSS_ADR_STATE_CYCLE_SLIP (1<<2) + +#if 0 +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t GpsNavigationMessageType; +#define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 +#define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1 +#define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2 +#define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3 +#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4 + +/** + * Enumeration of available values to indicate the GNSS Navigation message + * types. + * + * For convenience, first byte is the LocGnssConstellationType on which that signal + * is typically transmitted + */ +typedef int16_t GnssNavigationMessageType; + +#define GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 +/** GPS L1 C/A message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L1CA 0x0101 +/** GPS L2-CNAV message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L2CNAV 0x0102 +/** GPS L5-CNAV message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L5CNAV 0x0103 +/** GPS CNAV-2 message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_CNAV2 0x0104 +/** Glonass L1 CA message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA 0x0301 +/** Beidou D1 message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 0x0501 +/** Beidou D2 message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 0x0502 +/** Galileo I/NAV message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I 0x0601 +/** Galileo F/NAV message contained in the structure. */ +#define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F 0x0602 + +/** + * Status of Navigation Message + * When a message is received properly without any parity error in its navigation words, the + * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received + * with words that failed parity check, but GPS is able to correct those words, the status + * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ +typedef uint16_t NavigationMessageStatus; +#define NAV_MESSAGE_STATUS_UNKNOWN 0 +#define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0) +#define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1) + +/* This constant is deprecated, and will be removed in the next release. */ +#define NAV_MESSAGE_STATUS_UNKONW 0 +#endif + +/** + * Flags that indicate information about the satellite + */ +typedef uint8_t LocGnssSvFlags; +#define LOC_GNSS_SV_FLAGS_NONE 0 +#define LOC_GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA (1 << 0) +#define LOC_GNSS_SV_FLAGS_HAS_ALMANAC_DATA (1 << 1) +#define LOC_GNSS_SV_FLAGS_USED_IN_FIX (1 << 2) + +/** + * Constellation type of LocGnssSvInfo + */ +typedef uint8_t LocGnssConstellationType; +#define LOC_GNSS_CONSTELLATION_UNKNOWN 0 +#define LOC_GNSS_CONSTELLATION_GPS 1 +#define LOC_GNSS_CONSTELLATION_SBAS 2 +#define LOC_GNSS_CONSTELLATION_GLONASS 3 +#define LOC_GNSS_CONSTELLATION_QZSS 4 +#define LOC_GNSS_CONSTELLATION_BEIDOU 5 +#define LOC_GNSS_CONSTELLATION_GALILEO 6 + +/** + * Name for the GPS XTRA interface. + */ +#define LOC_GPS_XTRA_INTERFACE "gps-xtra" + +/** + * Name for the GPS DEBUG interface. + */ +#define LOC_GPS_DEBUG_INTERFACE "gps-debug" + +/** + * Name for the AGPS interface. + */ + +#define LOC_AGPS_INTERFACE "agps" + +/** + * Name of the Supl Certificate interface. + */ +#define LOC_SUPL_CERTIFICATE_INTERFACE "supl-certificate" + +/** + * Name for NI interface + */ +#define LOC_GPS_NI_INTERFACE "gps-ni" + +/** + * Name for the AGPS-RIL interface. + */ +#define LOC_AGPS_RIL_INTERFACE "agps_ril" + +/** + * Name for the GPS_Geofencing interface. + */ +#define LOC_GPS_GEOFENCING_INTERFACE "gps_geofencing" + +/** + * Name of the GPS Measurements interface. + */ +#define LOC_GPS_MEASUREMENT_INTERFACE "gps_measurement" + +/** + * Name of the GPS navigation message interface. + */ +#define LOC_GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message" + +/** + * Name of the GNSS/GPS configuration interface. + */ +#define LOC_GNSS_CONFIGURATION_INTERFACE "gnss_configuration" + +/** Represents a location. */ +typedef struct { + /** set to sizeof(LocGpsLocation) */ + size_t size; + /** Contains LocGpsLocationFlags bits. */ + uint16_t flags; + /** Represents latitude in degrees. */ + double latitude; + /** Represents longitude in degrees. */ + double longitude; + /** + * Represents altitude in meters above the WGS 84 reference ellipsoid. + */ + double altitude; + /** Represents speed in meters per second. */ + float speed; + /** Represents heading in degrees. */ + float bearing; + /** Represents expected accuracy in meters. */ + float accuracy; + /** Timestamp for the location fix. */ + LocGpsUtcTime timestamp; +} LocGpsLocation; + +/** Represents the status. */ +typedef struct { + /** set to sizeof(LocGpsStatus) */ + size_t size; + LocGpsStatusValue status; +} LocGpsStatus; + +/** + * Legacy struct to represents SV information. + * Deprecated, to be removed in the next Android release. + * Use LocGnssSvInfo instead. + */ +typedef struct { + /** set to sizeof(LocGpsSvInfo) */ + size_t size; + /** Pseudo-random number for the SV. */ + int prn; + /** Signal to noise ratio. */ + float snr; + /** Elevation of SV in degrees. */ + float elevation; + /** Azimuth of SV in degrees. */ + float azimuth; +} LocGpsSvInfo; + +typedef struct { + /** set to sizeof(LocGnssSvInfo) */ + size_t size; + + /** + * Pseudo-random number for the SV, or FCN/OSN number for Glonass. The + * distinction is made by looking at constellation field. Values should be + * in the range of: + * + * - GPS: 1-32 + * - SBAS: 120-151, 183-192 + * - GLONASS: 1-24, the orbital slot number (OSN), if known. Or, if not: + * 93-106, the frequency channel number (FCN) (-7 to +6) offset by + 100 + * i.e. report an FCN of -7 as 93, FCN of 0 as 100, and FCN of +6 as 106. + * - QZSS: 193-200 + * - Galileo: 1-36 + * - Beidou: 1-37 + */ + int16_t svid; + + /** + * Defines the constellation of the given SV. Value should be one of those + * LOC_GNSS_CONSTELLATION_* constants + */ + LocGnssConstellationType constellation; + + /** + * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna port. + * + * This is a mandatory value. + */ + float c_n0_dbhz; + + /** Elevation of SV in degrees. */ + float elevation; + + /** Azimuth of SV in degrees. */ + float azimuth; + + /** + * Contains additional data about the given SV. Value should be one of those + * LOC_GNSS_SV_FLAGS_* constants + */ + LocGnssSvFlags flags; + +} LocGnssSvInfo; + +/** + * Legacy struct to represents SV status. + * Deprecated, to be removed in the next Android release. + * Use LocGnssSvStatus instead. + */ +typedef struct { + /** set to sizeof(LocGpsSvStatus) */ + size_t size; + int num_svs; + LocGpsSvInfo sv_list[LOC_GPS_MAX_SVS]; + uint32_t ephemeris_mask; + uint32_t almanac_mask; + uint32_t used_in_fix_mask; +} LocGpsSvStatus; + +/** + * Represents SV status. + */ +typedef struct { + /** set to sizeof(LocGnssSvStatus) */ + size_t size; + + /** Number of GPS SVs currently visible, refers to the SVs stored in sv_list */ + int num_svs; + /** + * Pointer to an array of SVs information for all GNSS constellations, + * except GPS, which is reported using sv_list + */ + LocGnssSvInfo gnss_sv_list[LOC_GNSS_MAX_SVS]; + +} LocGnssSvStatus; + +/* CellID for 2G, 3G and LTE, used in AGPS. */ +typedef struct { + LocAGpsRefLocationType type; + /** Mobile Country Code. */ + uint16_t mcc; + /** Mobile Network Code .*/ + uint16_t mnc; + /** Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE, + * lac is populated with tac, to ensure that we don't break old clients that + * might rely in the old (wrong) behavior. + */ + uint16_t lac; + /** Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */ + uint32_t cid; + /** Tracking Area Code in LTE. */ + uint16_t tac; + /** Physical Cell id in LTE (not used in 2G and 3G) */ + uint16_t pcid; +} LocAGpsRefLocationCellID; + +typedef struct { + uint8_t mac[6]; +} LocAGpsRefLocationMac; + +/** Represents ref locations */ +typedef struct { + LocAGpsRefLocationType type; + union { + LocAGpsRefLocationCellID cellID; + LocAGpsRefLocationMac mac; + } u; +} LocAGpsRefLocation; + +/** + * Callback with location information. Can only be called from a thread created + * by create_thread_cb. + */ +typedef void (* loc_gps_location_callback)(LocGpsLocation* location); + +/** + * Callback with status information. Can only be called from a thread created by + * create_thread_cb. + */ +typedef void (* loc_gps_status_callback)(LocGpsStatus* status); +/** + * Legacy callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + * + * This callback is deprecated, and will be removed in the next release. Use + * loc_gnss_sv_status_callback() instead. + */ +typedef void (* loc_gps_sv_status_callback)(LocGpsSvStatus* sv_info); + +/** + * Callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* loc_gnss_sv_status_callback)(LocGnssSvStatus* sv_info); + +/** + * Callback for reporting NMEA sentences. Can only be called from a thread + * created by create_thread_cb. + */ +typedef void (* loc_gps_nmea_callback)(LocGpsUtcTime timestamp, const char* nmea, int length); + +/** + * Callback to inform framework of the GPS engine's capabilities. Capability + * parameter is a bit field of LOC_GPS_CAPABILITY_* flags. + */ +typedef void (* loc_gps_set_capabilities)(uint32_t capabilities); + +/** + * Callback utility for acquiring the GPS wakelock. This can be used to prevent + * the CPU from suspending while handling GPS events. + */ +typedef void (* loc_gps_acquire_wakelock)(); + +/** Callback utility for releasing the GPS wakelock. */ +typedef void (* loc_gps_release_wakelock)(); + +/** Callback for requesting NTP time */ +typedef void (* loc_gps_request_utc_time)(); + +/** + * Callback for creating a thread that can call into the Java framework code. + * This must be used to create any threads that report events up to the + * framework. + */ +typedef pthread_t (* loc_gps_create_thread)(const char* name, void (*start)(void *), void* arg); + +/** + * Provides information about how new the underlying GPS/GNSS hardware and + * software is. + * + * This information will be available for Android Test Applications. If a GPS + * HAL does not provide this information, it will be considered "2015 or + * earlier". + * + * If a GPS HAL does provide this information, then newer years will need to + * meet newer CTS standards. E.g. if the date are 2016 or above, then N+ level + * LocGpsMeasurement support will be verified. + */ +typedef struct { + /** Set to sizeof(LocGnssSystemInfo) */ + size_t size; + /* year in which the last update was made to the underlying hardware/firmware + * used to capture GNSS signals, e.g. 2016 */ + uint16_t year_of_hw; +} LocGnssSystemInfo; + +/** + * Callback to inform framework of the engine's hardware version information. + */ +typedef void (*loc_gnss_set_system_info)(const LocGnssSystemInfo* info); + +/** New GPS callback structure. */ +typedef struct { + /** set to sizeof(LocGpsCallbacks) */ + size_t size; + loc_gps_location_callback location_cb; + loc_gps_status_callback status_cb; + loc_gps_sv_status_callback sv_status_cb; + loc_gps_nmea_callback nmea_cb; + loc_gps_set_capabilities set_capabilities_cb; + loc_gps_acquire_wakelock acquire_wakelock_cb; + loc_gps_release_wakelock release_wakelock_cb; + loc_gps_create_thread create_thread_cb; + loc_gps_request_utc_time request_utc_time_cb; + + loc_gnss_set_system_info set_system_info_cb; + loc_gnss_sv_status_callback gnss_sv_status_cb; +} LocGpsCallbacks; + +/** Represents the standard GPS interface. */ +typedef struct { + /** set to sizeof(LocGpsInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( LocGpsCallbacks* callbacks ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); + + /** Closes the interface. */ + void (*cleanup)( void ); + + /** Injects the current time. */ + int (*inject_time)(LocGpsUtcTime time, int64_t timeReference, + int uncertainty); + + /** + * Injects current location from another location provider (typically cell + * ID). Latitude and longitude are measured in degrees expected accuracy is + * measured in meters + */ + int (*inject_location)(double latitude, double longitude, float accuracy); + + /** + * Specifies that the next call to start will not use the + * information defined in the flags. LOC_GPS_DELETE_ALL is passed for + * a cold start. + */ + void (*delete_aiding_data)(LocGpsAidingData flags); + + /** + * min_interval represents the time between fixes in milliseconds. + * preferred_accuracy represents the requested fix accuracy in meters. + * preferred_time represents the requested time to first fix in milliseconds. + * + * 'mode' parameter should be one of LOC_GPS_POSITION_MODE_MS_BASED + * or LOC_GPS_POSITION_MODE_STANDALONE. + * It is allowed by the platform (and it is recommended) to fallback to + * LOC_GPS_POSITION_MODE_MS_BASED if LOC_GPS_POSITION_MODE_MS_ASSISTED is passed in, and + * LOC_GPS_POSITION_MODE_MS_BASED is supported. + */ + int (*set_position_mode)(LocGpsPositionMode mode, LocGpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + + /** Get a pointer to extension information. */ + const void* (*get_extension)(const char* name); +} LocGpsInterface; + +/** + * Callback to request the client to download XTRA data. The client should + * download XTRA data and inject it by calling inject_xtra_data(). Can only be + * called from a thread created by create_thread_cb. + */ +typedef void (* loc_gps_xtra_download_request)(); + +/** Callback structure for the XTRA interface. */ +typedef struct { + loc_gps_xtra_download_request download_request_cb; + loc_gps_create_thread create_thread_cb; +} LocGpsXtraCallbacks; + +/** Extended interface for XTRA support. */ +typedef struct { + /** set to sizeof(LocGpsXtraInterface) */ + size_t size; + /** + * Opens the XTRA interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( LocGpsXtraCallbacks* callbacks ); + /** Injects XTRA data into the GPS. */ + int (*inject_xtra_data)( char* data, int length ); +} LocGpsXtraInterface; + +#if 0 +/** Extended interface for DEBUG support. */ +typedef struct { + /** set to sizeof(LocGpsDebugInterface) */ + size_t size; + + /** + * This function should return any information that the native + * implementation wishes to include in a bugreport. + */ + size_t (*get_internal_state)(char* buffer, size_t bufferSize); +} LocGpsDebugInterface; +#endif + +/* + * Represents the status of AGPS augmented to support IPv4 and IPv6. + */ +typedef struct { + /** set to sizeof(LocAGpsStatus) */ + size_t size; + + LocAGpsType type; + LocAGpsStatusValue status; + + /** + * Must be set to a valid IPv4 address if the field 'addr' contains an IPv4 + * address, or set to INADDR_NONE otherwise. + */ + uint32_t ipaddr; + + /** + * Must contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report. + * Any other value of addr.ss_family will be rejected. + */ + struct sockaddr_storage addr; +} LocAGpsStatus; + +/** + * Callback with AGPS status information. Can only be called from a thread + * created by create_thread_cb. + */ +typedef void (* loc_agps_status_callback)(LocAGpsStatus* status); + +/** Callback structure for the AGPS interface. */ +typedef struct { + loc_agps_status_callback status_cb; + loc_gps_create_thread create_thread_cb; +} LocAGpsCallbacks; + +/** + * Extended interface for AGPS support, it is augmented to enable to pass + * extra APN data. + */ +typedef struct { + /** set to sizeof(LocAGpsInterface) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines to the + * implementation of this interface. + */ + void (*init)(LocAGpsCallbacks* callbacks); + /** + * Deprecated. + * If the HAL supports LocAGpsInterface_v2 this API will not be used, see + * data_conn_open_with_apn_ip_type for more information. + */ + int (*data_conn_open)(const char* apn); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)(LocAGpsType type, const char* hostname, int port); + + /** + * Notifies that a data connection is available and sets the name of the + * APN, and its IP type, to be used for SUPL connections. + */ + int (*data_conn_open_with_apn_ip_type)( + const char* apn, + LocApnIpType apnIpType); +} LocAGpsInterface; + +/** Error codes associated with certificate operations */ +#define LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS 0 +#define LOC_AGPS_CERTIFICATE_ERROR_GENERIC -100 +#define LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101 + +/** A data structure that represents an X.509 certificate using DER encoding */ +typedef struct { + size_t length; + u_char* data; +} LocDerEncodedCertificate; + +/** + * A type definition for SHA1 Fingerprints used to identify X.509 Certificates + * The Fingerprint is a digest of the DER Certificate that uniquely identifies it. + */ +typedef struct { + u_char data[20]; +} LocSha1CertificateFingerprint; + +/** AGPS Interface to handle SUPL certificate operations */ +typedef struct { + /** set to sizeof(LocSuplCertificateInterface) */ + size_t size; + + /** + * Installs a set of Certificates used for SUPL connections to the AGPS server. + * If needed the HAL should find out internally any certificates that need to be removed to + * accommodate the certificates to install. + * The certificates installed represent a full set of valid certificates needed to connect to + * AGPS SUPL servers. + * The list of certificates is required, and all must be available at the same time, when trying + * to establish a connection with the AGPS Server. + * + * Parameters: + * certificates - A pointer to an array of DER encoded certificates that are need to be + * installed in the HAL. + * length - The number of certificates to install. + * Returns: + * LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully + * LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES if the HAL cannot store the number of + * certificates attempted to be installed, the state of the certificates stored should + * remain the same as before on this error case. + * + * IMPORTANT: + * If needed the HAL should find out internally the set of certificates that need to be + * removed to accommodate the certificates to install. + */ + int (*install_certificates) ( const LocDerEncodedCertificate* certificates, size_t length ); + + /** + * Notifies the HAL that a list of certificates used for SUPL connections are revoked. It is + * expected that the given set of certificates is removed from the internal store of the HAL. + * + * Parameters: + * fingerprints - A pointer to an array of SHA1 Fingerprints to identify the set of + * certificates to revoke. + * length - The number of fingerprints provided. + * Returns: + * LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully. + * + * IMPORTANT: + * If any of the certificates provided (through its fingerprint) is not known by the HAL, + * it should be ignored and continue revoking/deleting the rest of them. + */ + int (*revoke_certificates) ( const LocSha1CertificateFingerprint* fingerprints, size_t length ); +} LocSuplCertificateInterface; + +/** Represents an NI request */ +typedef struct { + /** set to sizeof(LocGpsNiNotification) */ + size_t size; + + /** + * An ID generated by HAL to associate NI notifications and UI + * responses + */ + int notification_id; + + /** + * An NI type used to distinguish different categories of NI + * events, such as LOC_GPS_NI_TYPE_VOICE, LOC_GPS_NI_TYPE_UMTS_SUPL, ... + */ + LocGpsNiType ni_type; + + /** + * Notification/verification options, combinations of LocGpsNiNotifyFlags constants + */ + LocGpsNiNotifyFlags notify_flags; + + /** + * Timeout period to wait for user response. + * Set to 0 for no time out limit. + */ + int timeout; + + /** + * Default response when time out. + */ + LocGpsUserResponseType default_response; + + /** + * Requestor ID + */ + char requestor_id[LOC_GPS_NI_SHORT_STRING_MAXLEN]; + + /** + * Notification message. It can also be used to store client_id in some cases + */ + char text[LOC_GPS_NI_LONG_STRING_MAXLEN]; + + /** + * Client name decoding scheme + */ + LocGpsNiEncodingType requestor_id_encoding; + + /** + * Client name decoding scheme + */ + LocGpsNiEncodingType text_encoding; + + /** + * A pointer to extra data. Format: + * key_1 = value_1 + * key_2 = value_2 + */ + char extras[LOC_GPS_NI_LONG_STRING_MAXLEN]; + +} LocGpsNiNotification; + +/** + * Callback with NI notification. Can only be called from a thread created by + * create_thread_cb. + */ +typedef void (*loc_gps_ni_notify_callback)(LocGpsNiNotification *notification); + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + loc_gps_ni_notify_callback notify_cb; + loc_gps_create_thread create_thread_cb; +} LocGpsNiCallbacks; + +/** + * Extended interface for Network-initiated (NI) support. + */ +typedef struct +{ + /** set to sizeof(LocGpsNiInterface) */ + size_t size; + + /** Registers the callbacks for HAL to use. */ + void (*init) (LocGpsNiCallbacks *callbacks); + + /** Sends a response to HAL. */ + void (*respond) (int notif_id, LocGpsUserResponseType user_response); +} LocGpsNiInterface; + +#define LOC_AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) +#define LOC_AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) + +#define LOC_AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) +#define LOC_AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) + +typedef void (*loc_agps_ril_request_set_id)(uint32_t flags); +typedef void (*loc_agps_ril_request_ref_loc)(uint32_t flags); + +typedef struct { + loc_agps_ril_request_set_id request_setid; + loc_agps_ril_request_ref_loc request_refloc; + loc_gps_create_thread create_thread_cb; +} LocAGpsRilCallbacks; + +/** Extended interface for AGPS_RIL support. */ +typedef struct { + /** set to sizeof(LocAGpsRilInterface) */ + size_t size; + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( LocAGpsRilCallbacks* callbacks ); + + /** + * Sets the reference location. + */ + void (*set_ref_location) (const LocAGpsRefLocation *agps_reflocation, size_t sz_struct); + /** + * Sets the set ID. + */ + void (*set_set_id) (LocAGpsSetIDType type, const char* setid); + + /** + * Send network initiated message. + */ + void (*ni_message) (uint8_t *msg, size_t len); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_availability) (int avaiable, const char* apn); +} LocAGpsRilInterface; + +/** + * GPS Geofence. + * There are 3 states associated with a Geofence: Inside, Outside, Unknown. + * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. + * + * An example state diagram with confidence level: 95% and Unknown time limit + * set as 30 secs is shown below. (confidence level and Unknown time limit are + * explained latter) + * ____________________________ + * | Unknown (30 secs) | + * """""""""""""""""""""""""""" + * ^ | | ^ + * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN + * | v v | + * ________ EXITED _________ + * | Inside | -----------> | Outside | + * | | <----------- | | + * """""""" ENTERED """"""""" + * + * Inside state: We are 95% confident that the user is inside the geofence. + * Outside state: We are 95% confident that the user is outside the geofence + * Unknown state: Rest of the time. + * + * The Unknown state is better explained with an example: + * + * __________ + * | c| + * | ___ | _______ + * | |a| | | b | + * | """ | """"""" + * | | + * """""""""" + * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy + * circle reported by the GPS subsystem. Now with regard to "b", the system is + * confident that the user is outside. But with regard to "a" is not confident + * whether it is inside or outside the geofence. If the accuracy remains the + * same for a sufficient period of time, the UNCERTAIN transition would be + * triggered with the state set to Unknown. If the accuracy improves later, an + * appropriate transition should be triggered. This "sufficient period of time" + * is defined by the parameter in the add_geofence_area API. + * In other words, Unknown state can be interpreted as a state in which the + * GPS subsystem isn't confident enough that the user is either inside or + * outside the Geofence. It moves to Unknown state only after the expiry of the + * timeout. + * + * The geofence callback needs to be triggered for the ENTERED and EXITED + * transitions, when the GPS system is confident that the user has entered + * (Inside state) or exited (Outside state) the Geofence. An implementation + * which uses a value of 95% as the confidence is recommended. The callback + * should be triggered only for the transitions requested by the + * add_geofence_area call. + * + * Even though the diagram and explanation talks about states and transitions, + * the callee is only interested in the transistions. The states are mentioned + * here for illustrative purposes. + * + * Startup Scenario: When the device boots up, if an application adds geofences, + * and then we get an accurate GPS location fix, it needs to trigger the + * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. + * By default, all the Geofences will be in the Unknown state. + * + * When the GPS system is unavailable, loc_gps_geofence_status_callback should be + * called to inform the upper layers of the same. Similarly, when it becomes + * available the callback should be called. This is a global state while the + * UNKNOWN transition described above is per geofence. + * + * An important aspect to note is that users of this API (framework), will use + * other subsystems like wifi, sensors, cell to handle Unknown case and + * hopefully provide a definitive state transition to the third party + * application. GPS Geofence will just be a signal indicating what the GPS + * subsystem knows about the Geofence. + * + */ +#define LOC_GPS_GEOFENCE_ENTERED (1<<0L) +#define LOC_GPS_GEOFENCE_EXITED (1<<1L) +#define LOC_GPS_GEOFENCE_UNCERTAIN (1<<2L) + +#define LOC_GPS_GEOFENCE_UNAVAILABLE (1<<0L) +#define LOC_GPS_GEOFENCE_AVAILABLE (1<<1L) + +#define LOC_GPS_GEOFENCE_OPERATION_SUCCESS 0 +#define LOC_GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100 +#define LOC_GPS_GEOFENCE_ERROR_ID_EXISTS -101 +#define LOC_GPS_GEOFENCE_ERROR_ID_UNKNOWN -102 +#define LOC_GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103 +#define LOC_GPS_GEOFENCE_ERROR_GENERIC -149 + +/** + * The callback associated with the geofence. + * Parameters: + * geofence_id - The id associated with the add_geofence_area. + * location - The current GPS location. + * transition - Can be one of LOC_GPS_GEOFENCE_ENTERED, LOC_GPS_GEOFENCE_EXITED, + * LOC_GPS_GEOFENCE_UNCERTAIN. + * timestamp - Timestamp when the transition was detected. + * + * The callback should only be called when the caller is interested in that + * particular transition. For instance, if the caller is interested only in + * ENTERED transition, then the callback should NOT be called with the EXITED + * transition. + * + * IMPORTANT: If a transition is triggered resulting in this callback, the GPS + * subsystem will wake up the application processor, if its in suspend state. + */ +typedef void (*loc_gps_geofence_transition_callback) (int32_t geofence_id, LocGpsLocation* location, + int32_t transition, LocGpsUtcTime timestamp); + +/** + * The callback associated with the availability of the GPS system for geofencing + * monitoring. If the GPS system determines that it cannot monitor geofences + * because of lack of reliability or unavailability of the GPS signals, it will + * call this callback with LOC_GPS_GEOFENCE_UNAVAILABLE parameter. + * + * Parameters: + * status - LOC_GPS_GEOFENCE_UNAVAILABLE or LOC_GPS_GEOFENCE_AVAILABLE. + * last_location - Last known location. + */ +typedef void (*loc_gps_geofence_status_callback) (int32_t status, LocGpsLocation* last_location); + +/** + * The callback associated with the add_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - LOC_GPS_GEOFENCE_OPERATION_SUCCESS + * LOC_GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. + * LOC_GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists + * LOC_GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an + * invalid transition + * LOC_GPS_GEOFENCE_ERROR_GENERIC - for other errors. + */ +typedef void (*loc_gps_geofence_add_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the remove_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - LOC_GPS_GEOFENCE_OPERATION_SUCCESS + * LOC_GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * LOC_GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*loc_gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); + + +/** + * The callback associated with the pause_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - LOC_GPS_GEOFENCE_OPERATION_SUCCESS + * LOC_GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * LOC_GPS_GEOFENCE_ERROR_INVALID_TRANSITION - + * when monitor_transitions is invalid + * LOC_GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*loc_gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the resume_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - LOC_GPS_GEOFENCE_OPERATION_SUCCESS + * LOC_GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * LOC_GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*loc_gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); + +typedef struct { + loc_gps_geofence_transition_callback geofence_transition_callback; + loc_gps_geofence_status_callback geofence_status_callback; + loc_gps_geofence_add_callback geofence_add_callback; + loc_gps_geofence_remove_callback geofence_remove_callback; + loc_gps_geofence_pause_callback geofence_pause_callback; + loc_gps_geofence_resume_callback geofence_resume_callback; + loc_gps_create_thread create_thread_cb; +} LocGpsGeofenceCallbacks; + +/** Extended interface for GPS_Geofencing support */ +typedef struct { + /** set to sizeof(LocGpsGeofencingInterface) */ + size_t size; + + /** + * Opens the geofence interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( LocGpsGeofenceCallbacks* callbacks ); + + /** + * Add a geofence area. This api currently supports circular geofences. + * Parameters: + * geofence_id - The id for the geofence. If a geofence with this id + * already exists, an error value (LOC_GPS_GEOFENCE_ERROR_ID_EXISTS) + * should be returned. + * latitude, longtitude, radius_meters - The lat, long and radius + * (in meters) for the geofence + * last_transition - The current state of the geofence. For example, if + * the system already knows that the user is inside the geofence, + * this will be set to LOC_GPS_GEOFENCE_ENTERED. In most cases, it + * will be LOC_GPS_GEOFENCE_UNCERTAIN. + * monitor_transition - Which transitions to monitor. Bitwise OR of + * LOC_GPS_GEOFENCE_ENTERED, LOC_GPS_GEOFENCE_EXITED and + * LOC_GPS_GEOFENCE_UNCERTAIN. + * notification_responsiveness_ms - Defines the best-effort description + * of how soon should the callback be called when the transition + * associated with the Geofence is triggered. For instance, if set + * to 1000 millseconds with LOC_GPS_GEOFENCE_ENTERED, the callback + * should be called 1000 milliseconds within entering the geofence. + * This parameter is defined in milliseconds. + * NOTE: This is not to be confused with the rate that the GPS is + * polled at. It is acceptable to dynamically vary the rate of + * sampling the GPS for power-saving reasons; thus the rate of + * sampling may be faster or slower than this. + * unknown_timer_ms - The time limit after which the UNCERTAIN transition + * should be triggered. This parameter is defined in milliseconds. + * See above for a detailed explanation. + */ + void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); + + /** + * Pause monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + */ + void (*pause_geofence) (int32_t geofence_id); + + /** + * Resume monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + * monitor_transitions - Which transitions to monitor. Bitwise OR of + * LOC_GPS_GEOFENCE_ENTERED, LOC_GPS_GEOFENCE_EXITED and + * LOC_GPS_GEOFENCE_UNCERTAIN. + * This supersedes the value associated provided in the + * add_geofence_area call. + */ + void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); + + /** + * Remove a geofence area. After the function returns, no notifications + * should be sent. + * Parameter: + * geofence_id - The id for the geofence. + */ + void (*remove_geofence_area) (int32_t geofence_id); +} LocGpsGeofencingInterface; + +/** + * Legacy struct to represent an estimate of the GPS clock time. + * Deprecated, to be removed in the next Android release. + * Use LocGnssClock instead. + */ +typedef struct { + /** set to sizeof(LocGpsClock) */ + size_t size; + LocGpsClockFlags flags; + int16_t leap_second; + LocGpsClockType type; + int64_t time_ns; + double time_uncertainty_ns; + int64_t full_bias_ns; + double bias_ns; + double bias_uncertainty_ns; + double drift_nsps; + double drift_uncertainty_nsps; +} LocGpsClock; + +/** + * Represents an estimate of the GPS clock time. + */ +typedef struct { + /** set to sizeof(LocGnssClock) */ + size_t size; + + /** + * A set of flags indicating the validity of the fields in this data + * structure. + */ + LocGnssClockFlags flags; + + /** + * Leap second data. + * The sign of the value is defined by the following equation: + * utc_time_ns = time_ns - (full_bias_ns + bias_ns) - leap_second * + * 1,000,000,000 + * + * If the data is available 'flags' must contain LOC_GNSS_CLOCK_HAS_LEAP_SECOND. + */ + int16_t leap_second; + + /** + * The GNSS receiver internal clock value. This is the local hardware clock + * value. + * + * For local hardware clock, this value is expected to be monotonically + * increasing while the hardware clock remains power on. (For the case of a + * HW clock that is not continuously on, see the + * hw_clock_discontinuity_count field). The receiver's estimate of GPS time + * can be derived by substracting the sum of full_bias_ns and bias_ns (when + * available) from this value. + * + * This GPS time is expected to be the best estimate of current GPS time + * that GNSS receiver can achieve. + * + * Sub-nanosecond accuracy can be provided by means of the 'bias_ns' field. + * The value contains the 'time uncertainty' in it. + * + * This field is mandatory. + */ + int64_t time_ns; + + /** + * 1-Sigma uncertainty associated with the clock's time in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain + * LOC_GNSS_CLOCK_HAS_TIME_UNCERTAINTY. This value is effectively zero (it is + * the reference local clock, by which all other times and time + * uncertainties are measured.) (And thus this field can be not provided, + * per LOC_GNSS_CLOCK_HAS_TIME_UNCERTAINTY flag, or provided & set to 0.) + */ + double time_uncertainty_ns; + + /** + * The difference between hardware clock ('time' field) inside GPS receiver + * and the true GPS time since 0000Z, January 6, 1980, in nanoseconds. + * + * The sign of the value is defined by the following equation: + * local estimate of GPS time = time_ns - (full_bias_ns + bias_ns) + * + * This value is mandatory if the receiver has estimated GPS time. If the + * computed time is for a non-GPS constellation, the time offset of that + * constellation to GPS has to be applied to fill this value. The error + * estimate for the sum of this and the bias_ns is the bias_uncertainty_ns, + * and the caller is responsible for using this uncertainty (it can be very + * large before the GPS time has been solved for.) If the data is available + * 'flags' must contain LOC_GNSS_CLOCK_HAS_FULL_BIAS. + */ + int64_t full_bias_ns; + + /** + * Sub-nanosecond bias. + * The error estimate for the sum of this and the full_bias_ns is the + * bias_uncertainty_ns + * + * If the data is available 'flags' must contain LOC_GNSS_CLOCK_HAS_BIAS. If GPS + * has computed a position fix. This value is mandatory if the receiver has + * estimated GPS time. + */ + double bias_ns; + + /** + * 1-Sigma uncertainty associated with the local estimate of GPS time (clock + * bias) in nanoseconds. The uncertainty is represented as an absolute + * (single sided) value. + * + * If the data is available 'flags' must contain + * LOC_GNSS_CLOCK_HAS_BIAS_UNCERTAINTY. This value is mandatory if the receiver + * has estimated GPS time. + */ + double bias_uncertainty_ns; + + /** + * The clock's drift in nanoseconds (per second). + * + * A positive value means that the frequency is higher than the nominal + * frequency, and that the (full_bias_ns + bias_ns) is growing more positive + * over time. + * + * The value contains the 'drift uncertainty' in it. + * If the data is available 'flags' must contain LOC_GNSS_CLOCK_HAS_DRIFT. + * + * This value is mandatory if the receiver has estimated GNSS time + */ + double drift_nsps; + + /** + * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain + * LOC_GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY. If GPS has computed a position fix this + * field is mandatory and must be populated. + */ + double drift_uncertainty_nsps; + + /** + * When there are any discontinuities in the HW clock, this field is + * mandatory. + * + * A "discontinuity" is meant to cover the case of a switch from one source + * of clock to another. A single free-running crystal oscillator (XO) + * should generally not have any discontinuities, and this can be set and + * left at 0. + * + * If, however, the time_ns value (HW clock) is derived from a composite of + * sources, that is not as smooth as a typical XO, or is otherwise stopped & + * restarted, then this value shall be incremented each time a discontinuity + * occurs. (E.g. this value may start at zero at device boot-up and + * increment each time there is a change in clock continuity. In the + * unlikely event that this value reaches full scale, rollover (not + * clamping) is required, such that this value continues to change, during + * subsequent discontinuity events.) + * + * While this number stays the same, between LocGnssClock reports, it can be + * safely assumed that the time_ns value has been running continuously, e.g. + * derived from a single, high quality clock (XO like, or better, that's + * typically used during continuous GNSS signal sampling.) + * + * It is expected, esp. during periods where there are few GNSS signals + * available, that the HW clock be discontinuity-free as long as possible, + * as this avoids the need to use (waste) a GNSS measurement to fully + * re-solve for the GPS clock bias and drift, when using the accompanying + * measurements, from consecutive LocGnssData reports. + */ + uint32_t hw_clock_discontinuity_count; + +} LocGnssClock; + +/** + * Legacy struct to represent a GPS Measurement, it contains raw and computed + * information. + * Deprecated, to be removed in the next Android release. + * Use LocGnssMeasurement instead. + */ +typedef struct { + /** set to sizeof(LocGpsMeasurement) */ + size_t size; + LocGpsMeasurementFlags flags; + int8_t prn; + double time_offset_ns; + LocGpsMeasurementState state; + int64_t received_gps_tow_ns; + int64_t received_gps_tow_uncertainty_ns; + double c_n0_dbhz; + double pseudorange_rate_mps; + double pseudorange_rate_uncertainty_mps; + LocGpsAccumulatedDeltaRangeState accumulated_delta_range_state; + double accumulated_delta_range_m; + double accumulated_delta_range_uncertainty_m; + double pseudorange_m; + double pseudorange_uncertainty_m; + double code_phase_chips; + double code_phase_uncertainty_chips; + float carrier_frequency_hz; + int64_t carrier_cycles; + double carrier_phase; + double carrier_phase_uncertainty; + LocGpsLossOfLock loss_of_lock; + int32_t bit_number; + int16_t time_from_last_bit_ms; + double doppler_shift_hz; + double doppler_shift_uncertainty_hz; + LocGpsMultipathIndicator multipath_indicator; + double snr_db; + double elevation_deg; + double elevation_uncertainty_deg; + double azimuth_deg; + double azimuth_uncertainty_deg; + bool used_in_fix; +} LocGpsMeasurement; + +/** + * Represents a GNSS Measurement, it contains raw and computed information. + * + * Independence - All signal measurement information (e.g. sv_time, + * pseudorange_rate, multipath_indicator) reported in this struct should be + * based on GNSS signal measurements only. You may not synthesize measurements + * by calculating or reporting expected measurements based on known or estimated + * position, velocity, or time. + */ +typedef struct { + /** set to sizeof(LocGnssMeasurement) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + LocGnssMeasurementFlags flags; + + /** + * Satellite vehicle ID number, as defined in LocGnssSvInfo::svid + * This is a mandatory value. + */ + int16_t svid; + + /** + * Defines the constellation of the given SV. Value should be one of those + * LOC_GNSS_CONSTELLATION_* constants + */ + LocGnssConstellationType constellation; + + /** + * Time offset at which the measurement was taken in nanoseconds. + * The reference receiver's time is specified by LocGpsData::clock::time_ns and should be + * interpreted in the same way as indicated by LocGpsClock::type. + * + * The sign of time_offset_ns is given by the following equation: + * measurement time = LocGpsClock::time_ns + time_offset_ns + * + * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. + * This is a mandatory value. + */ + double time_offset_ns; + + /** + * Per satellite sync state. It represents the current sync state for the associated satellite. + * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. + * + * This is a mandatory value. + */ + LocGnssMeasurementState state; + + /** + * The received GNSS Time-of-Week at the measurement time, in nanoseconds. + * Ensure that this field is independent (see comment at top of + * LocGnssMeasurement struct.) + * + * For GPS & QZSS, this is: + * Received GPS Time-of-Week at the measurement time, in nanoseconds. + * The value is relative to the beginning of the current GPS week. + * + * Given the highest sync state that can be achieved, per each satellite, valid range + * for this field can be: + * Searching : [ 0 ] : LOC_GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync : [ 0 20ms ] : LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe sync : [ 0 6s ] : LOC_GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * TOW decoded : [ 0 1week ] : LOC_GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * Note well: if there is any ambiguity in integer millisecond, + * LOC_GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. + * + * This value must be populated if 'state' != LOC_GNSS_MEASUREMENT_STATE_UNKNOWN. + * + * For Glonass, this is: + * Received Glonass time of day, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : LOC_GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Symbol sync : [ 0 10ms ] : LOC_GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set + * Bit sync : [ 0 20ms ] : LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * String sync : [ 0 2s ] : LOC_GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC is set + * Time of day : [ 0 1day ] : LOC_GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED is set + * + * For Beidou, this is: + * Received Beidou time of week, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : LOC_GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock: [ 0 1ms ] : LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync (D2): [ 0 2ms ] : LOC_GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC is set + * Bit sync (D1): [ 0 20ms ] : LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe (D2): [ 0 0.6s ] : LOC_GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC is set + * Subframe (D1): [ 0 6s ] : LOC_GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * Time of week : [ 0 1week ] : LOC_GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * For Galileo, this is: + * Received Galileo time of week, at the measurement time in nanoseconds. + * + * E1BC code lock : [ 0 4ms ] : LOC_GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK is set + * E1C 2nd code lock: [ 0 100ms ] : + * LOC_GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK is set + * + * E1B page : [ 0 2s ] : LOC_GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC is set + * Time of week: [ 0 1week ] : LOC_GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * For SBAS, this is: + * Received SBAS time, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, + * valid range for this field can be: + * Searching : [ 0 ] : LOC_GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock: [ 0 1ms ] : LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Symbol sync : [ 0 2ms ] : LOC_GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set + * Message : [ 0 1s ] : LOC_GNSS_MEASUREMENT_STATE_SBAS_SYNC is set + */ + int64_t received_sv_time_in_ns; + + /** + * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. + * + * This value must be populated if 'state' != LOC_GPS_MEASUREMENT_STATE_UNKNOWN. + */ + int64_t received_sv_time_uncertainty_in_ns; + + /** + * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna port. + * + * This is a mandatory value. + */ + double c_n0_dbhz; + + /** + * Pseudorange rate at the timestamp in m/s. The correction of a given + * Pseudorange Rate value includes corrections for receiver and satellite + * clock frequency errors. Ensure that this field is independent (see + * comment at top of LocGnssMeasurement struct.) + * + * It is mandatory to provide the 'uncorrected' 'pseudorange rate', and provide LocGpsClock's + * 'drift' field as well (When providing the uncorrected pseudorange rate, do not apply the + * corrections described above.) + * + * The value includes the 'pseudorange rate uncertainty' in it. + * A positive 'uncorrected' value indicates that the SV is moving away from the receiver. + * + * The sign of the 'uncorrected' 'pseudorange rate' and its relation to the sign of 'doppler + * shift' is given by the equation: + * pseudorange rate = -k * doppler shift (where k is a constant) + * + * This should be the most accurate pseudorange rate available, based on + * fresh signal measurements from this channel. + * + * It is mandatory that this value be provided at typical carrier phase PRR + * quality (few cm/sec per second of uncertainty, or better) - when signals + * are sufficiently strong & stable, e.g. signals from a GPS simulator at >= + * 35 dB-Hz. + */ + double pseudorange_rate_mps; + + /** + * 1-Sigma uncertainty of the pseudorange_rate_mps. + * The uncertainty is represented as an absolute (single sided) value. + * + * This is a mandatory value. + */ + double pseudorange_rate_uncertainty_mps; + + /** + * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip + * (indicating loss of lock). + * + * This is a mandatory value. + */ + LocGnssAccumulatedDeltaRangeState accumulated_delta_range_state; + + /** + * Accumulated delta range since the last channel reset in meters. + * A positive value indicates that the SV is moving away from the receiver. + * + * The sign of the 'accumulated delta range' and its relation to the sign of 'carrier phase' + * is given by the equation: + * accumulated delta range = -k * carrier phase (where k is a constant) + * + * This value must be populated if 'accumulated delta range state' != LOC_GPS_ADR_STATE_UNKNOWN. + * However, it is expected that the data is only accurate when: + * 'accumulated delta range state' == LOC_GPS_ADR_STATE_VALID. + */ + double accumulated_delta_range_m; + + /** + * 1-Sigma uncertainty of the accumulated delta range in meters. + * This value must be populated if 'accumulated delta range state' != LOC_GPS_ADR_STATE_UNKNOWN. + */ + double accumulated_delta_range_uncertainty_m; + + /** + * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. + * If the field is not set, the carrier frequency is assumed to be L1. + * + * If the data is available, 'flags' must contain + * LOC_GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY. + */ + float carrier_frequency_hz; + + /** + * The number of full carrier cycles between the satellite and the receiver. + * The reference frequency is given by the field 'carrier_frequency_hz'. + * Indications of possible cycle slips and resets in the accumulation of + * this value can be inferred from the accumulated_delta_range_state flags. + * + * If the data is available, 'flags' must contain + * LOC_GNSS_MEASUREMENT_HAS_CARRIER_CYCLES. + */ + int64_t carrier_cycles; + + /** + * The RF phase detected by the receiver, in the range [0.0, 1.0]. + * This is usually the fractional part of the complete carrier phase measurement. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'carrier-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain + * LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE. + */ + double carrier_phase; + + /** + * 1-Sigma uncertainty of the carrier-phase. + * If the data is available, 'flags' must contain + * LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. + */ + double carrier_phase_uncertainty; + + /** + * An enumeration that indicates the 'multipath' state of the event. + * + * The multipath Indicator is intended to report the presence of overlapping + * signals that manifest as distorted correlation peaks. + * + * - if there is a distorted correlation peak shape, report that multipath + * is LOC_GNSS_MULTIPATH_INDICATOR_PRESENT. + * - if there is not a distorted correlation peak shape, report + * LOC_GNSS_MULTIPATH_INDICATOR_NOT_PRESENT + * - if signals are too weak to discern this information, report + * LOC_GNSS_MULTIPATH_INDICATOR_UNKNOWN + * + * Example: when doing the standardized overlapping Multipath Performance + * test (3GPP TS 34.171) the Multipath indicator should report + * LOC_GNSS_MULTIPATH_INDICATOR_PRESENT for those signals that are tracked, and + * contain multipath, and LOC_GNSS_MULTIPATH_INDICATOR_NOT_PRESENT for those + * signals that are tracked and do not contain multipath. + */ + LocGnssMultipathIndicator multipath_indicator; + + /** + * Signal-to-noise ratio at correlator output in dB. + * If the data is available, 'flags' must contain LOC_GNSS_MEASUREMENT_HAS_SNR. + * This is the power ratio of the "correlation peak height above the + * observed noise floor" to "the noise RMS". + */ + double snr_db; +} LocGnssMeasurement; + +/** + * Legacy struct to represents a reading of GPS measurements. + * Deprecated, to be removed in the next Android release. + * Use LocGnssData instead. + */ +typedef struct { + /** set to sizeof(LocGpsData) */ + size_t size; + size_t measurement_count; + LocGpsMeasurement measurements[LOC_GPS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + LocGpsClock clock; +} LocGpsData; + +/** + * Represents a reading of GNSS measurements. For devices where LocGnssSystemInfo's + * year_of_hw is set to 2016+, it is mandatory that these be provided, on + * request, when the GNSS receiver is searching/tracking signals. + * + * - Reporting of GPS constellation measurements is mandatory. + * - Reporting of all tracked constellations are encouraged. + */ +typedef struct { + /** set to sizeof(LocGnssData) */ + size_t size; + + /** Number of measurements. */ + size_t measurement_count; + + /** The array of measurements. */ + LocGnssMeasurement measurements[LOC_GNSS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + LocGnssClock clock; +} LocGnssData; + +/** + * The legacy callback for to report measurements from the HAL. + * + * This callback is deprecated, and will be removed in the next release. Use + * loc_gnss_measurement_callback() instead. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*loc_gps_measurement_callback) (LocGpsData* data); + +/** + * The callback for to report measurements from the HAL. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*loc_gnss_measurement_callback) (LocGnssData* data); + +typedef struct { + /** set to sizeof(LocGpsMeasurementCallbacks) */ + size_t size; + loc_gps_measurement_callback measurement_callback; + loc_gnss_measurement_callback loc_gnss_measurement_callback; +} LocGpsMeasurementCallbacks; + +#define LOC_GPS_MEASUREMENT_OPERATION_SUCCESS 0 +#define LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT -100 +#define LOC_GPS_MEASUREMENT_ERROR_GENERIC -101 + +/** + * Extended interface for GPS Measurements support. + */ +typedef struct { + /** Set to sizeof(LocGpsMeasurementInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates at its own phase. + * + * Status: + * LOC_GPS_MEASUREMENT_OPERATION_SUCCESS + * LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT - if a callback has already been registered without a + * corresponding call to 'close' + * LOC_GPS_MEASUREMENT_ERROR_GENERIC - if any other error occurred, it is expected that the HAL + * will not generate any updates upon returning this error code. + */ + int (*init) (LocGpsMeasurementCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} LocGpsMeasurementInterface; + +#if 0 +/** + * Legacy struct to represents a GPS navigation message (or a fragment of it). + * Deprecated, to be removed in the next Android release. + * Use GnssNavigationMessage instead. + */ +typedef struct { + /** set to sizeof(GpsNavigationMessage) */ + size_t size; + int8_t prn; + GpsNavigationMessageType type; + NavigationMessageStatus status; + int16_t message_id; + int16_t submessage_id; + size_t data_length; + uint8_t* data; +} GpsNavigationMessage; + +/** Represents a GPS navigation message (or a fragment of it). */ +typedef struct { + /** set to sizeof(GnssNavigationMessage) */ + size_t size; + + /** + * Satellite vehicle ID number, as defined in LocGnssSvInfo::svid + * This is a mandatory value. + */ + int16_t svid; + + /** + * The type of message contained in the structure. + * This is a mandatory value. + */ + GnssNavigationMessageType type; + + /** + * The status of the received navigation message. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ + NavigationMessageStatus status; + + /** + * Message identifier. It provides an index so the complete Navigation + * Message can be assembled. + * + * - For GPS L1 C/A subframe 4 and 5, this value corresponds to the 'frame + * id' of the navigation message, in the range of 1-25 (Subframe 1, 2, 3 + * does not contain a 'frame id' and this value can be set to -1.) + * + * - For Glonass L1 C/A, this refers to the frame ID, in the range of 1-5. + * + * - For BeiDou D1, this refers to the frame number in the range of 1-24 + * + * - For Beidou D2, this refers to the frame number, in the range of 1-120 + * + * - For Galileo F/NAV nominal frame structure, this refers to the subframe + * number, in the range of 1-12 + * + * - For Galileo I/NAV nominal frame structure, this refers to the subframe + * number in the range of 1-24 + */ + int16_t message_id; + + /** + * Sub-message identifier. If required by the message 'type', this value + * contains a sub-index within the current message (or frame) that is being + * transmitted. + * + * - For GPS L1 C/A, BeiDou D1 & BeiDou D2, the submessage id corresponds to + * the subframe number of the navigation message, in the range of 1-5. + * + * - For Glonass L1 C/A, this refers to the String number, in the range from + * 1-15 + * + * - For Galileo F/NAV, this refers to the page type in the range 1-6 + * + * - For Galileo I/NAV, this refers to the word type in the range 1-10+ + */ + int16_t submessage_id; + + /** + * The length of the data (in bytes) contained in the current message. + * If this value is different from zero, 'data' must point to an array of the same size. + * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). + * + * This is a mandatory value. + */ + size_t data_length; + + /** + * The data of the reported GPS message. The bytes (or words) specified + * using big endian format (MSB first). + * + * - For GPS L1 C/A, Beidou D1 & Beidou D2, each subframe contains 10 30-bit + * words. Each word (30 bits) should be fit into the last 30 bits in a + * 4-byte word (skip B31 and B32), with MSB first, for a total of 40 + * bytes, covering a time period of 6, 6, and 0.6 seconds, respectively. + * + * - For Glonass L1 C/A, each string contains 85 data bits, including the + * checksum. These bits should be fit into 11 bytes, with MSB first (skip + * B86-B88), covering a time period of 2 seconds. + * + * - For Galileo F/NAV, each word consists of 238-bit (sync & tail symbols + * excluded). Each word should be fit into 30-bytes, with MSB first (skip + * B239, B240), covering a time period of 10 seconds. + * + * - For Galileo I/NAV, each page contains 2 page parts, even and odd, with + * a total of 2x114 = 228 bits, (sync & tail excluded) that should be fit + * into 29 bytes, with MSB first (skip B229-B232). + */ + uint8_t* data; + +} GnssNavigationMessage; + +/** + * The legacy callback to report an available fragment of a GPS navigation + * messages from the HAL. + * + * This callback is deprecated, and will be removed in the next release. Use + * gnss_navigation_message_callback() instead. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message); + +/** + * The callback to report an available fragment of a GPS navigation messages from the HAL. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gnss_navigation_message_callback) (GnssNavigationMessage* message); + +typedef struct { + /** set to sizeof(GpsNavigationMessageCallbacks) */ + size_t size; + gps_navigation_message_callback navigation_message_callback; + gnss_navigation_message_callback gnss_navigation_message_callback; +} GpsNavigationMessageCallbacks; + +#define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS 0 +#define GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT -100 +#define GPS_NAVIGATION_MESSAGE_ERROR_GENERIC -101 + +/** + * Extended interface for GPS navigation message reporting support. + */ +typedef struct { + /** Set to sizeof(GpsNavigationMessageInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates as they become + * available. + * + * Status: + * GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS + * GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered + * without a corresponding call to 'close'. + * GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that + * the HAL will not generate any updates upon returning this error code. + */ + int (*init) (GpsNavigationMessageCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsNavigationMessageInterface; +#endif + +/** + * Interface for passing GNSS configuration contents from platform to HAL. + */ +typedef struct { + /** Set to sizeof(LocGnssConfigurationInterface) */ + size_t size; + + /** + * Deliver GNSS configuration contents to HAL. + * Parameters: + * config_data - a pointer to a char array which holds what usually is expected from + file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + * length - total number of UTF8 characters in configuraiton data. + * + * IMPORTANT: + * GPS HAL should expect this function can be called multiple times. And it may be + * called even when GpsLocationProvider is already constructed and enabled. GPS HAL + * should maintain the existing requests for various callback regardless the change + * in configuration data. + */ + void (*configuration_update) (const char* config_data, int32_t length); +} LocGnssConfigurationInterface; + +__END_DECLS + +#endif /* LOC_GPS_H */ + diff --git a/loc-hal.pc.in b/loc-hal.pc.in index 36cd4e7d..92e83414 100644 --- a/loc-hal.pc.in +++ b/loc-hal.pc.in @@ -6,5 +6,5 @@ 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 +Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_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/loc_api/Makefile.am b/loc_api/Makefile.am index 46480974..23ccc35e 100644 --- a/loc_api/Makefile.am +++ b/loc_api/Makefile.am @@ -20,6 +20,7 @@ libloc_eng_so_la_h_sources = \ loc_eng_dmn_conn_thread_helper.h libloc_eng_so_la_SOURCES = \ + libloc_api_50001/loc.cpp \ libloc_api_50001/loc_eng.cpp \ libloc_api_50001/loc_eng_agps.cpp \ libloc_api_50001/loc_eng_xtra.cpp \ @@ -47,24 +48,6 @@ 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) \ @@ -134,4 +117,4 @@ library_include_HEADERS = \ 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 +lib_LTLIBRARIES = libloc_eng_so.la libloc_ds_api.la libloc_api_v02.la diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h index 13557c97..b2b4e2ab 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h @@ -51,8 +51,8 @@ private: 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, + static LocGpsNiEncodingType convertNiEncodingType(int loc_encoding); + static int NIEventFillVerfiyType(LocGpsNiNotification ¬if, rpc_loc_ni_notify_verify_e_type notif_priv); void reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr); @@ -93,13 +93,13 @@ public: 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); + setTime(LocGpsUtcTime 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); + deleteAidingData(LocGpsAidingData f); virtual enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData); + informNiResponse(LocGpsUserResponseType 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 @@ -113,7 +113,7 @@ public: 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); + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType); virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index f4b0ebf4..f0f84b50 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -423,10 +423,10 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode) } switch (fixCriteria->recurrence) { - case GPS_POSITION_RECURRENCE_SINGLE: + case LOC_GPS_POSITION_RECURRENCE_SINGLE: fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; break; - case GPS_POSITION_RECURRENCE_PERIODIC: + case LOC_GPS_POSITION_RECURRENCE_PERIODIC: default: fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX; break; @@ -443,7 +443,7 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode) } enum loc_api_adapter_err -LocApiRpc::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +LocApiRpc::setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty) { rpc_loc_ioctl_data_u_type ioctl_data; rpc_loc_assist_data_time_s_type *time_info_ptr; @@ -508,7 +508,7 @@ LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) } enum loc_api_adapter_err -LocApiRpc::informNiResponse(GpsUserResponseType userResponse, +LocApiRpc::informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData) { rpc_loc_ioctl_data_u_type data; @@ -520,15 +520,15 @@ LocApiRpc::informNiResponse(GpsUserResponseType userResponse, rpc_loc_ni_user_resp_e_type resp; switch (userResponse) { - case GPS_NI_RESPONSE_ACCEPT: + case LOC_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: + case LOC_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: + case LOC_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; @@ -672,7 +672,7 @@ LocApiRpc::enableData(int enable, boolean force) } enum loc_api_adapter_err -LocApiRpc::deleteAidingData(GpsAidingData bits) +LocApiRpc::deleteAidingData(LocGpsAidingData 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; @@ -707,7 +707,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re (location_report_ptr->latitude != 0 || location_report_ptr->longitude != 0)) { - location.gpsLocation.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_LAT_LONG; location.gpsLocation.latitude = location_report_ptr->latitude; location.gpsLocation.longitude = location_report_ptr->longitude; @@ -720,28 +720,28 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re // Altitude if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.gpsLocation.flags |= LOC_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.flags |= LOC_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.flags |= LOC_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.flags |= LOC_GPS_LOCATION_HAS_ACCURACY; location.gpsLocation.accuracy = location_report_ptr->hor_unc_circular; } @@ -816,9 +816,9 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_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) + if (num_svs_max > LOC_GPS_MAX_SVS) { - num_svs_max = GPS_MAX_SVS; + num_svs_max = LOC_GPS_MAX_SVS; } } @@ -833,7 +833,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) { 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].size = sizeof(LocGpsSvInfo); SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn; // We only have the data field to report gps eph and alm mask @@ -923,17 +923,17 @@ void LocApiRpc::reportStatus(const rpc_loc_status_event_s_type *status_report_pt 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); + LocApiBase::reportStatus(LOC_GPS_STATUS_ENGINE_ON); + LocApiBase::reportStatus(LOC_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); + LocApiBase::reportStatus(LOC_GPS_STATUS_SESSION_END); + LocApiBase::reportStatus(LOC_GPS_STATUS_ENGINE_OFF); } else { - LocApiBase::reportStatus(GPS_STATUS_NONE); + LocApiBase::reportStatus(LOC_GPS_STATUS_NONE); } } @@ -1079,12 +1079,12 @@ LocApiRpc::requestXtraServer() } enum loc_api_adapter_err -LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) +LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, LocAGpsType 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) { + if (LOC_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; @@ -1176,7 +1176,7 @@ LocApiRpc::atlCloseStatus(int handle, int is_succ) void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) { int connHandle; - AGpsType agps_type; + LocAGpsType agps_type; LOC_LOGV("RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST event %s)", loc_get_event_atl_open_name(server_request_ptr->event)); @@ -1186,18 +1186,18 @@ void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr 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); + agps_type = LOC_AGPS_TYPE_SUPL; + LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_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); + agps_type = LOC_AGPS_TYPE_WWAN_ANY; + LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_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); + requestATL(connHandle, LOC_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; @@ -1211,7 +1211,7 @@ void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) { - GpsNiNotification notif = {0}; + LocGpsNiNotification notif = {0}; switch (ni_req->event) { @@ -1220,7 +1220,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_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; + notif.ni_type = LOC_GPS_NI_TYPE_VOICE; // Requestor ID hexcode(notif.requestor_id, sizeof notif.requestor_id, vx_req->requester_id.requester_id, @@ -1236,7 +1236,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_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 + notif.ni_type= LOC_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, @@ -1289,7 +1289,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_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; + notif.ni_type = LOC_GPS_NI_TYPE_UMTS_SUPL; if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) { @@ -1337,7 +1337,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) notif.requestor_id_encoding = notif.text_encoding; } else { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + notif.text_encoding = notif.requestor_id_encoding = LOC_GPS_ENC_UNKNOWN; } NIEventFillVerfiyType(notif, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); @@ -1355,30 +1355,30 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) requestNiNotify(notif, (const void*)copy); } -int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, +int LocApiRpc::NIEventFillVerfiyType(LocGpsNiNotification ¬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; + notif.default_response = LOC_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; + notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY; + notif.default_response = LOC_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; + notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY; + notif.default_response = LOC_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; + notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY; + notif.default_response = LOC_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; + notif.notify_flags = LOC_GPS_NI_PRIVACY_OVERRIDE; + notif.default_response = LOC_GPS_NI_RESPONSE_NORESP; return 1; default: return 0; @@ -1399,20 +1399,20 @@ LocApiRpc::setSUPLVersion(uint32_t version) ); } -GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) +LocGpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) { switch (loc_encoding) { case RPC_LOC_NI_SUPL_UTF8: - return GPS_ENC_SUPL_UTF8; + return LOC_GPS_ENC_SUPL_UTF8; case RPC_LOC_NI_SUPL_UCS2: - return GPS_ENC_SUPL_UCS2; + return LOC_GPS_ENC_SUPL_UCS2; case RPC_LOC_NI_SUPL_GSM_DEFAULT: - return GPS_ENC_SUPL_GSM_DEFAULT; + return LOC_GPS_ENC_SUPL_GSM_DEFAULT; case RPC_LOC_NI_SS_LANGUAGE_UNSPEC: - return GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + return LOC_GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM default: - return GPS_ENC_UNKNOWN; + return LOC_GPS_ENC_UNKNOWN; } } diff --git a/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk index ad14e143..c33bc915 100644 --- a/loc_api/libloc_api_50001/Android.mk +++ b/loc_api/libloc_api_50001/Android.mk @@ -20,6 +20,7 @@ LOCAL_SHARED_LIBRARIES := \ libloc_pla LOCAL_SRC_FILES += \ + loc.cpp \ loc_eng.cpp \ loc_eng_agps.cpp \ loc_eng_xtra.cpp \ @@ -84,7 +85,8 @@ ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) endif LOCAL_SRC_FILES += \ - loc.cpp \ + gps_interface.cpp \ + gps_converter.cpp \ gps.c LOCAL_CFLAGS += \ diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 9db513cc..c312a24e 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -376,14 +376,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, +void LocInternalAdapter::reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GnssSvStatus &svStatus, +void LocEngAdapter::reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { @@ -422,12 +422,12 @@ void LocEngAdapter::setInSession(bool inSession) } } -void LocInternalAdapter::reportStatus(GpsStatusValue status) +void LocInternalAdapter::reportStatus(LocGpsStatusValue status) { sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); } -void LocEngAdapter::reportStatus(GpsStatusValue status) +void LocEngAdapter::reportStatus(LocGpsStatusValue status) { if (!mUlp->reportStatus(status)) { mInternalAdapter->reportStatus(status); @@ -461,7 +461,7 @@ bool LocEngAdapter::reportXtraServer(const char* url1, } inline -bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) +bool LocEngAdapter::requestATL(int connHandle, LocAGpsType agps_type) { if (mSupportsAgpsRequests) { sendMsg(new LocEngRequestATL(mOwner, @@ -498,7 +498,7 @@ bool LocEngAdapter::requestTime() } inline -bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +bool LocEngAdapter::requestNiNotify(LocGpsNiNotification ¬if, const void* data) { if (mSupportsAgpsRequests) { notif.size = sizeof(notif); @@ -545,7 +545,7 @@ void LocEngAdapter::handleEngineUpEvent() sendMsg(new LocEngUp(mOwner)); } -enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time, +enum loc_api_adapter_err LocEngAdapter::setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty) { @@ -588,7 +588,7 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) return ret; } -void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData) +void LocEngAdapter::reportGnssMeasurementData(LocGnssData &gnssMeasurementData) { sendMsg(new LocEngReportGnssMeasurement(mOwner, gnssMeasurementData)); diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 7afdd001..e341651d 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -30,7 +30,6 @@ #define LOC_API_ENG_ADAPTER_H #include -#include #include #include #include @@ -54,10 +53,10 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); - virtual void reportStatus(GpsStatusValue status); + virtual void reportStatus(LocGpsStatusValue status); virtual void setPositionModeInt(LocPosMode& posMode); virtual void startFixInt(); virtual void stopFixInt(); @@ -87,7 +86,7 @@ public: bool mSupportsAgpsRequests; bool mSupportsPositionInjection; bool mSupportsTimeInjection; - GnssSystemInfo mGnssInfo; + LocGnssSystemInfo mGnssInfo; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, @@ -143,7 +142,7 @@ public: return mLocApi->stopFix(); } inline enum loc_api_adapter_err - deleteAidingData(GpsAidingData f) + deleteAidingData(LocGpsAidingData f) { return mLocApi->deleteAidingData(f); } @@ -173,7 +172,7 @@ public: return mLocApi->requestXtraServer(); } inline enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, LocAGpsType agpsType) { return mLocApi->atlOpenStatus(handle, is_succ, apn, bearer, agpsType); } @@ -202,7 +201,7 @@ public: return mLocApi->setServer(ip, port, type); } inline enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) + informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData) { return mLocApi->informNiResponse(userResponse, passThroughData); } @@ -282,15 +281,15 @@ public: mLocApi->releaseDataServiceClient(); } inline enum loc_api_adapter_err - getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) + getZpp(LocGpsLocation &zppLoc, LocPosTechMask &tech_mask) { return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); } - enum loc_api_adapter_err setTime(GpsUtcTime time, + enum loc_api_adapter_err setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); enum loc_api_adapter_err setXtraVersionCheck(int check); - inline virtual void installAGpsCert(const DerEncodedCertificate* pData, + inline virtual void installAGpsCert(const LocDerEncodedCertificate* pData, size_t length, uint32_t slotBitMask) { @@ -303,24 +302,24 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, + virtual void reportSv(LocGnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - virtual void reportStatus(GpsStatusValue status); + virtual void reportStatus(LocGpsStatusValue 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 requestATL(int connHandle, LocAGpsType agps_type); virtual bool releaseATL(int connHandle); - virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); + virtual bool requestNiNotify(LocGpsNiNotification ¬ify, const void* data); virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); + virtual void reportGnssMeasurementData(LocGnssData &gnssMeasurementData); inline const LocPosMode& getPositionMode() const {return mFixCriteria;} diff --git a/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am index c7624272..4c1ccf7d 100644 --- a/loc_api/libloc_api_50001/Makefile.am +++ b/loc_api/libloc_api_50001/Makefile.am @@ -1,78 +1,62 @@ -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 +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.cpp \ + 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 + +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 diff --git a/loc_api/libloc_api_50001/gps_converter.cpp b/loc_api/libloc_api_50001/gps_converter.cpp new file mode 100644 index 00000000..1ca23cf0 --- /dev/null +++ b/loc_api/libloc_api_50001/gps_converter.cpp @@ -0,0 +1,255 @@ +/* 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 + +void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out) { + memset(&out, 0, sizeof(LocDerEncodedCertificate)); + out.length = in.length; + out.data = in.data; +} + +void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out) { + memset(&out, 0, sizeof(GpsLocation)); + out.size = sizeof(GpsLocation); + out.flags = (LocGpsLocationFlags)in.flags; + out.latitude = in.latitude; + out.longitude = in.longitude; + out.altitude = in.altitude; + out.speed = in.speed; + out.bearing = in.bearing; + out.accuracy = in.accuracy; + out.timestamp = Q2A_GpsUtcTime(in.timestamp); +} + +void Q2A_GpsSvInfo(const LocGpsSvInfo& in, GpsSvInfo& out) { + memset(&out, 0, sizeof(GpsSvInfo)); + out.size = sizeof(GpsSvInfo); + out.prn = in.prn; + out.snr = in.snr; + out.elevation = in.elevation; + out.azimuth = in.azimuth; +} + +void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out) { + memset(&out, 0, sizeof(GpsSvStatus)); + out.size = sizeof(GpsSvStatus); + out.num_svs = in.num_svs; + int len = LOC_GPS_MAX_SVS < GPS_MAX_SVS ? LOC_GPS_MAX_SVS : GPS_MAX_SVS; + for (int i = 0; i < len; i++) { + Q2A_GpsSvInfo(in.sv_list[i], out.sv_list[i]); + } + out.ephemeris_mask = in.ephemeris_mask; + out.almanac_mask = in.almanac_mask; + out.used_in_fix_mask = in.used_in_fix_mask; +} + +void Q2A_GnssSvInfo(const LocGnssSvInfo& in, GnssSvInfo& out) { + memset(&out, 0, sizeof(GnssSvInfo)); + out.size = sizeof(GnssSvInfo); + out.svid = in.svid; + out.constellation = (GnssConstellationType)in.constellation; + out.c_n0_dbhz = in.c_n0_dbhz; + out.elevation = in.elevation; + out.azimuth = in.azimuth; + out.flags = (GnssSvFlags)in.flags; +} + +void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out) { + memset(&out, 0, sizeof(GnssSvStatus)); + out.size = sizeof(GnssSvStatus); + out.num_svs = in.num_svs; + int len = LOC_GNSS_MAX_SVS < GNSS_MAX_SVS ? LOC_GNSS_MAX_SVS : GNSS_MAX_SVS; + for (int i = 0; i < len; i++) { + Q2A_GnssSvInfo(in.gnss_sv_list[i], out.gnss_sv_list[i]); + } +} + +void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out) { + memset(&out, 0, sizeof(GpsNiNotification)); + out.size = sizeof(GpsNiNotification); + out.notification_id = in.notification_id; + out.ni_type = (GpsNiType)in.ni_type; + out.notify_flags = (GpsNiNotifyFlags)in.notify_flags; + out.timeout = in.timeout; + out.default_response = (GpsUserResponseType)in.default_response; + int len = LOC_GPS_NI_SHORT_STRING_MAXLEN < GPS_NI_SHORT_STRING_MAXLEN + ? LOC_GPS_NI_SHORT_STRING_MAXLEN : GPS_NI_SHORT_STRING_MAXLEN; + for (int i = 0; i < len; i++) { + out.requestor_id[i] = in.requestor_id[i]; + } + len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN + ? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN; + for (int i = 0; i < len; i++) { + out.text[i] = in.text[i]; + } + out.requestor_id_encoding = (GpsNiEncodingType)in.requestor_id_encoding; + out.text_encoding = (GpsNiEncodingType)in.text_encoding; + len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN + ? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN; + for (int i = 0; i < len; i++) { + out.extras[i] = in.extras[i]; + } +} + +void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out) { + memset(&out, 0, sizeof(GpsStatus)); + out.size = sizeof(GpsStatus); + out.status = (GpsStatusValue)in.status; +} + +void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out) { + memset(&out, 0, sizeof(GnssSystemInfo)); + out.size = sizeof(GnssSystemInfo); + out.year_of_hw = in.year_of_hw; +} + +void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out) { + memset(&out, 0, sizeof(AGpsStatus)); + out.size = sizeof(AGpsStatus); + out.type = (AGpsType)in.type; + out.status = (AGpsStatusValue)in.status; + out.ipaddr = in.ipaddr; + memcpy(&out.addr, &in.addr, sizeof(sockaddr_storage)); +} + +void Q2A_GpsMeasurement(const LocGpsMeasurement& in, GpsMeasurement& out) { + memset(&out, 0, sizeof(GpsMeasurement)); + out.size = sizeof(GpsMeasurement); + out.flags = (GpsMeasurementFlags)in.flags; + out.prn = in.prn; + out.time_offset_ns = in.time_offset_ns; + out.state = (GpsMeasurementState)in.state; + out.received_gps_tow_ns = in.received_gps_tow_ns; + out.received_gps_tow_uncertainty_ns = in.received_gps_tow_uncertainty_ns; + out.c_n0_dbhz = in.c_n0_dbhz; + out.pseudorange_rate_mps = in.pseudorange_rate_mps; + out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps; + out.accumulated_delta_range_state = (GpsAccumulatedDeltaRangeState)in.accumulated_delta_range_state; + out.accumulated_delta_range_m = in.accumulated_delta_range_m; + out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m; + out.pseudorange_m = in.pseudorange_m; + out.pseudorange_uncertainty_m = in.pseudorange_uncertainty_m; + out.code_phase_chips = in.code_phase_chips; + out.code_phase_uncertainty_chips = in.code_phase_uncertainty_chips; + out.carrier_frequency_hz = in.carrier_frequency_hz; + out.carrier_cycles = in.carrier_cycles; + out.carrier_phase = in.carrier_phase; + out.carrier_phase_uncertainty = in.carrier_phase_uncertainty; + out.loss_of_lock = (GpsLossOfLock)in.loss_of_lock; + out.bit_number = in.bit_number; + out.time_from_last_bit_ms = in.time_from_last_bit_ms; + out.doppler_shift_hz = in.doppler_shift_hz; + out.doppler_shift_uncertainty_hz = in.doppler_shift_uncertainty_hz; + out.multipath_indicator = (GpsMultipathIndicator)in.multipath_indicator; + out.snr_db = in.snr_db; + out.elevation_deg = in.elevation_deg; + out.elevation_uncertainty_deg = in.elevation_uncertainty_deg; + out.azimuth_deg = in.azimuth_deg; + out.azimuth_uncertainty_deg = in.azimuth_uncertainty_deg; + out.used_in_fix = in.used_in_fix; +} + +void Q2A_GpsClock(const LocGpsClock& in, GpsClock& out) { + memset(&out, 0, sizeof(GpsClock)); + out.size = sizeof(GpsClock); + out.flags = (GpsClockFlags)in.flags; + out.leap_second = in.leap_second; + out.type = (GpsClockType)in.type; + out.time_ns = in.time_ns; + out.time_uncertainty_ns = in.time_uncertainty_ns; + out.full_bias_ns = in.full_bias_ns; + out.bias_ns = in.bias_ns; + out.bias_uncertainty_ns = in.bias_uncertainty_ns; + out.drift_nsps = in.drift_nsps; + out.drift_uncertainty_nsps = in.drift_uncertainty_nsps; +} + +void Q2A_GpsData(const LocGpsData& in, GpsData& out) { + memset(&out, 0, sizeof(GpsData)); + out.size = sizeof(GpsData); + out.measurement_count = in.measurement_count; + int len = LOC_GPS_MAX_MEASUREMENT < GPS_MAX_MEASUREMENT + ? LOC_GPS_MAX_MEASUREMENT : GPS_MAX_MEASUREMENT; + for (int i = 0; i < len; i++) { + Q2A_GpsMeasurement(in.measurements[i], out.measurements[i]); + } + Q2A_GpsClock(in.clock, out.clock); +} + +void Q2A_GnssMeasurement(const LocGnssMeasurement& in, GnssMeasurement& out) { + memset(&out, 0, sizeof(GnssMeasurement)); + out.size = sizeof(GnssMeasurement); + out.flags = (GpsMeasurementFlags)in.flags; + out.svid = in.svid; + out.constellation = (GnssConstellationType)in.constellation; + out.time_offset_ns = in.time_offset_ns; + out.state = (GnssMeasurementState)in.state; + out.received_sv_time_in_ns = in.received_sv_time_in_ns; + out.received_sv_time_uncertainty_in_ns = in.received_sv_time_uncertainty_in_ns; + out.c_n0_dbhz = in.c_n0_dbhz; + out.pseudorange_rate_mps = in.pseudorange_rate_mps; + out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps; + out.accumulated_delta_range_state = (GnssAccumulatedDeltaRangeState)in.accumulated_delta_range_state; + out.accumulated_delta_range_m = in.accumulated_delta_range_m; + out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m; + out.carrier_frequency_hz = in.carrier_frequency_hz; + out.carrier_cycles = in.carrier_cycles; + out.carrier_phase = in.carrier_phase; + out.carrier_phase_uncertainty = in.carrier_phase_uncertainty; + out.multipath_indicator = (GnssMultipathIndicator)in.multipath_indicator; + out.snr_db = in.snr_db; +} + +void Q2A_GnssClock(const LocGnssClock& in, GnssClock& out) { + memset(&out, 0, sizeof(GnssClock)); + out.size = sizeof(GnssClock); + out.flags = (GnssClockFlags)in.flags; + out.leap_second = in.leap_second; + out.time_ns = in.time_ns; + out.time_uncertainty_ns = in.time_uncertainty_ns; + out.full_bias_ns = in.full_bias_ns; + out.bias_ns = in.bias_ns; + out.bias_uncertainty_ns = in.bias_uncertainty_ns; + out.drift_nsps = in.drift_nsps; + out.drift_uncertainty_nsps = in.drift_uncertainty_nsps; + out.hw_clock_discontinuity_count = in.hw_clock_discontinuity_count; +} + +void Q2A_GnssData(const LocGnssData& in, GnssData& out) { + memset(&out, 0, sizeof(GnssData)); + out.size = sizeof(GnssData); + out.measurement_count = in.measurement_count; + int len = LOC_GNSS_MAX_MEASUREMENT < GNSS_MAX_MEASUREMENT + ? LOC_GNSS_MAX_MEASUREMENT : GNSS_MAX_MEASUREMENT; + for (int i = 0; i < len; i++) { + Q2A_GnssMeasurement(in.measurements[i], out.measurements[i]); + } + Q2A_GnssClock(in.clock, out.clock); +} diff --git a/loc_api/libloc_api_50001/gps_converter.h b/loc_api/libloc_api_50001/gps_converter.h new file mode 100644 index 00000000..fa7c68a3 --- /dev/null +++ b/loc_api/libloc_api_50001/gps_converter.h @@ -0,0 +1,69 @@ +/* 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. + * + */ + +#ifndef __GPS_CONVERTER_H__ +#define __GPS_CONVERTER_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +#define A2Q_GpsAidingData(in) (LocGpsAidingData)in +#define A2Q_GpsUserResponseType(in) (LocGpsUserResponseType)in +#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in +#define A2Q_GpsUtcTime(in) (LocGpsUtcTime)in +#define A2Q_GpsPositionMode(in) (LocGpsPositionMode)in +#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in +#define A2Q_ApnIpType(in) (LocApnIpType)in +#define A2Q_AGpsType(in) (LocAGpsType)in +#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in + +#define Q2A_GpsUtcTime(in) (GpsUtcTime)in + +void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out); + +void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out); +void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out); +void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out); +void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out); +void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out); +void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out); +void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out); +void Q2A_GpsData(const LocGpsData& in, GpsData& out); +void Q2A_GnssData(const LocGnssData& in, GnssData& out); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__GPS_CONVERTER_H__ diff --git a/loc_api/libloc_api_50001/gps_interface.cpp b/loc_api/libloc_api_50001/gps_interface.cpp new file mode 100644 index 00000000..993874f7 --- /dev/null +++ b/loc_api/libloc_api_50001/gps_interface.cpp @@ -0,0 +1,1196 @@ +/* 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. + * + */ + +#define LOG_NDDEBUG 0 +#define LOG_TAG "GpsInterface" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace loc_core; + +// All functions and variables should be static +// except gps_get_hardware_interface() and get_gps_interface() + +extern "C" const LocGpsInterface* loc_eng_gps_get_hardware_interface (); +extern "C" const LocGpsInterface* loc_eng_get_gps_interface(); + +/*=========================================================================== + Functions and variables for sGpsInterface +===========================================================================*/ +static const LocGpsInterface* pLocGpsInterface = NULL; + +static GpsCallbacks sGpsCallbacks; +static GpsCallbacks* pGpsCallbacks = NULL; + +static void local_gps_location_callback(LocGpsLocation* location); +static void local_gps_sv_status_callback(LocGpsSvStatus* sv_status); +static void local_gps_status_callback(LocGpsStatus* status); +static void local_gps_nmea_callback(LocGpsUtcTime timestamp, const char* nmea, int length); +static void local_gps_set_capabilities(uint32_t capabilities); +static void local_gps_acquire_wakelock(); +static void local_gps_release_wakelock(); +static pthread_t local_gps_create_thread(const char* name, void (*start)(void *), void* arg); +static void local_gps_request_utc_time(); +static void local_gnss_set_system_info(const LocGnssSystemInfo* info); +static void local_gnss_sv_status_callback(LocGnssSvStatus* sv_info); + +static LocGpsCallbacks sLocGpsCallbacks = { + sizeof(LocGpsCallbacks), + local_gps_location_callback, + local_gps_status_callback, + local_gps_sv_status_callback, + local_gps_nmea_callback, + local_gps_set_capabilities, + local_gps_acquire_wakelock, + local_gps_release_wakelock, + local_gps_create_thread, + local_gps_request_utc_time, + local_gnss_set_system_info, + local_gnss_sv_status_callback, +}; + +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); + +static const GpsInterface sGpsInterface = { + 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 +}; + +/*=========================================================================== + Functions and variables for sGpsXtraInterface +===========================================================================*/ +static const LocGpsXtraInterface* pLocGpsXtraInterface = NULL; + +static GpsXtraCallbacks sGpsXtraCallbacks; +static GpsXtraCallbacks* pGpsXtraCallbacks = NULL; + +static void local_gps_xtra_download_request(); +static pthread_t local_gps_xtra_create_thread(const char* name, void (*start)(void *), void* arg); + +static LocGpsXtraCallbacks sLocGpsXtraCallbacks = { + local_gps_xtra_download_request, + local_gps_xtra_create_thread +}; + +static int loc_xtra_init(GpsXtraCallbacks* callbacks); +static int loc_xtra_inject_data(char* data, int length); + +static const GpsXtraInterface sGpsXtraInterface = { + sizeof(GpsXtraInterface), + loc_xtra_init, + loc_xtra_inject_data +}; + +/*=========================================================================== + Functions and variables for sAGpsInterface +===========================================================================*/ +static const LocAGpsInterface* pLocAGpsInterface = NULL; + +static AGpsCallbacks sAGpsCallbacks; +static AGpsCallbacks* pAGpsCallbacks = NULL; + +static void local_agps_status_callback(LocAGpsStatus* status); +static pthread_t local_agps_create_thread(const char* name, void (*start)(void *), void* arg); + +static LocAGpsCallbacks sLocAGpsCallbacks = { + local_agps_status_callback, + local_agps_create_thread +}; + +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 sAGpsInterface = { + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server, + loc_agps_open_with_apniptype +}; + +/*=========================================================================== + Functions and variables for SUPL sSuplCertificateInterface +===========================================================================*/ +static const LocSuplCertificateInterface* pLocSuplCertificateInterface = NULL; + +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 sSuplCertificateInterface = +{ + sizeof(SuplCertificateInterface), + loc_agps_install_certificates, + loc_agps_revoke_certificates +}; + +/*=========================================================================== + Functions and variables for sGpsNiInterface +===========================================================================*/ +static const LocGpsNiInterface* pLocGpsNiInterface = NULL; + +static GpsNiCallbacks sGpsNiCallbacks; +static GpsNiCallbacks* pGpsNiCallbacks = NULL; + +static void local_gps_ni_notify_callback(LocGpsNiNotification *notification); +static pthread_t local_gps_ni_create_thread(const char* name, void (*start)(void *), void* arg); + +static LocGpsNiCallbacks sLocGpsNiCallbacks = { + local_gps_ni_notify_callback, + local_gps_ni_create_thread +}; + +static void loc_ni_init(GpsNiCallbacks *callbacks); +static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); + +static const GpsNiInterface sGpsNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + +/*=========================================================================== + Functions and variables for sAGpsRilInterface +===========================================================================*/ +static const LocAGpsRilInterface* pLocAGpsRilInterface = NULL; + +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 sAGpsRilInterface = +{ + 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 +}; + +/*=========================================================================== + Functions and variables for sGpsGeofencingInterface +===========================================================================*/ +static const LocGpsGeofencingInterface* pLocGpsGeofencingInterface = NULL; + +static GpsGeofenceCallbacks sGpsGeofenceCallbacks; +static GpsGeofenceCallbacks* pGpsGeofenceCallbacks = NULL; + +static void local_gps_geofence_transition_callback(int32_t geofence_id, LocGpsLocation* location, + int32_t transition, LocGpsUtcTime timestamp); +static void local_gps_geofence_status_callback(int32_t status, LocGpsLocation* last_location); +static void local_gps_geofence_add_callback(int32_t geofence_id, int32_t status); +static void local_gps_geofence_remove_callback(int32_t geofence_id, int32_t status); +static void local_gps_geofence_pause_callback(int32_t geofence_id, int32_t status); +static void local_gps_geofence_resume_callback(int32_t geofence_id, int32_t status); +static pthread_t local_geofence_create_thread(const char* name, void (*start)(void *), void* arg); + +static LocGpsGeofenceCallbacks sLocGpsGeofenceCallbacks = +{ + local_gps_geofence_transition_callback, + local_gps_geofence_status_callback, + local_gps_geofence_add_callback, + local_gps_geofence_remove_callback, + local_gps_geofence_pause_callback, + local_gps_geofence_resume_callback, + local_geofence_create_thread +}; + +static void loc_geofence_init(GpsGeofenceCallbacks* callbacks); +static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); +static void loc_pause_geofence(int32_t geofence_id); +static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions); +static void loc_remove_geofence_area(int32_t geofence_id); + +static const GpsGeofencingInterface sGpsGeofencingInterface = +{ + sizeof(GpsGeofencingInterface), + loc_geofence_init, + loc_add_geofence_area, + loc_pause_geofence, + loc_resume_geofence, + loc_remove_geofence_area +}; + +/*=========================================================================== + Functions and variables for sGpsMeasurementInterface +===========================================================================*/ +static const LocGpsMeasurementInterface* pLocGpsMeasurementInterface = NULL; + +static GpsMeasurementCallbacks sGpsMeasurementCallbacks; +static GpsMeasurementCallbacks* pGpsMeasurementCallbacks = NULL; + +static void local_gps_measurement_callback(LocGpsData* data); +static void local_gnss_measurement_callback(LocGnssData* data); + +static LocGpsMeasurementCallbacks sLocGpsMeasurementCallbacks = +{ + sizeof(LocGpsMeasurementCallbacks), + local_gps_measurement_callback, + local_gnss_measurement_callback +}; + +static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); +static void loc_gps_measurement_close(); + +static const GpsMeasurementInterface sGpsMeasurementInterface = +{ + sizeof(GpsMeasurementInterface), + loc_gps_measurement_init, + loc_gps_measurement_close +}; + +/*=========================================================================== + Functions and variables for sGnssConfigurationInterface +===========================================================================*/ +static const LocGnssConfigurationInterface* pLocGnssConfigurationInterface = NULL; + +static void loc_configuration_update(const char* config_data, int32_t length); + +static const GnssConfigurationInterface sGnssConfigurationInterface = +{ + sizeof(GnssConfigurationInterface), + loc_configuration_update +}; + + +/*=========================================================================== +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* retVal; + pLocGpsInterface = loc_eng_gps_get_hardware_interface(); + if (NULL != pLocGpsInterface) { + retVal = &sGpsInterface; + } else { + retVal = NULL; + } + EXIT_LOG(%p, retVal); + return retVal; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + pLocGpsInterface = loc_eng_get_gps_interface(); + return &sGpsInterface; +} + +/*=========================================================================== + Implementation of functions for sGpsInterface +===========================================================================*/ +static void local_gps_location_callback(LocGpsLocation* location) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->location_cb) { + GpsLocation loc; + GpsLocation* p_loc = NULL; + if (NULL != location) { + Q2A_GpsLocation(*location, loc); + p_loc = &loc; + } + // We are not sure whether NULL pointer is a legal + // parameter to the original callback functions or not. + // So we should forward NULL pointer at this layer. + pGpsCallbacks->location_cb(p_loc); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_sv_status_callback(LocGpsSvStatus* sv_status) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->sv_status_cb) { + CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs); + GpsSvStatus st; + GpsSvStatus* p_st = NULL; + if (NULL != sv_status) { + Q2A_GpsSvStatus(*sv_status, st); + p_st = &st; + } + pGpsCallbacks->sv_status_cb(p_st); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_status_callback(LocGpsStatus* status) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->status_cb) { + GpsStatus st; + GpsStatus* p_st = NULL; + if (NULL != status) { + Q2A_GpsStatus(*status, st); + p_st = &st; + } + pGpsCallbacks->status_cb(p_st); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_nmea_callback(LocGpsUtcTime timestamp, const char* nmea, int length) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->nmea_cb) { + pGpsCallbacks->nmea_cb(A2Q_GpsUtcTime(timestamp), nmea, length); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_set_capabilities(uint32_t capabilities) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->set_capabilities_cb) { + pGpsCallbacks->set_capabilities_cb(capabilities); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_acquire_wakelock() +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->acquire_wakelock_cb) { + pGpsCallbacks->acquire_wakelock_cb(); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_release_wakelock() +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->release_wakelock_cb) { + pGpsCallbacks->release_wakelock_cb(); + } + EXIT_LOG(%s, VOID_RET); +} + +static pthread_t local_gps_create_thread(const char* name, void (*start)(void *), void* arg) +{ + ENTRY_LOG(); + pthread_t retVal = -1; + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->create_thread_cb) { + retVal = pGpsCallbacks->create_thread_cb(name, start, arg); + } + EXIT_LOG(%d, (int)retVal); + return retVal; +} + +static void local_gps_request_utc_time() +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->request_utc_time_cb) { + pGpsCallbacks->request_utc_time_cb(); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gnss_set_system_info(const LocGnssSystemInfo* info) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->set_system_info_cb) { + GnssSystemInfo sysinfo; + GnssSystemInfo* p_sysinfo = NULL; + if (NULL != info) { + Q2A_GnssSystemInfo(*info, sysinfo); + p_sysinfo = &sysinfo; + } + pGpsCallbacks->set_system_info_cb(p_sysinfo); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gnss_sv_status_callback(LocGnssSvStatus* sv_info) +{ + ENTRY_LOG(); + if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->gnss_sv_status_cb) { + GnssSvStatus info; + GnssSvStatus* p_info = NULL; + if (NULL != sv_info) { + Q2A_GnssSvStatus(*sv_info, info); + p_info - &info; + } + pGpsCallbacks->gnss_sv_status_cb(p_info); + } + EXIT_LOG(%s, VOID_RET); +} + +static int loc_init(GpsCallbacks* callbacks) +{ + ENTRY_LOG(); + + int retVal = -1; + LocGpsCallbacks* cbs = NULL; + if (NULL != callbacks) { + memcpy(&sGpsCallbacks, callbacks, sizeof(GpsCallbacks)); + pGpsCallbacks = &sGpsCallbacks; + cbs = &sLocGpsCallbacks; + } + + if(NULL != pLocGpsInterface && NULL != pLocGpsInterface->init) { + retVal = pLocGpsInterface->init(cbs); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_start() +{ + ENTRY_LOG(); + int retVal = -1; + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->start) { + retVal = pLocGpsInterface->start(); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_stop() +{ + ENTRY_LOG(); + int retVal = -1; + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->stop) { + retVal = pLocGpsInterface->stop(); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +static void loc_cleanup() +{ + ENTRY_LOG(); + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->cleanup) { + pLocGpsInterface->cleanup(); + } + pLocGpsInterface = NULL; + pGpsCallbacks = NULL; + EXIT_LOG(%s, VOID_RET); +} + +static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + ENTRY_LOG(); + int retVal = -1; + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->inject_time) { + retVal = pLocGpsInterface->inject_time(A2Q_GpsUtcTime(time), + timeReference, uncertainty); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_inject_location(double latitude, double longitude, float accuracy) +{ + ENTRY_LOG(); + int retVal = -1; + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->inject_location) { + retVal = pLocGpsInterface->inject_location(latitude, longitude, accuracy); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +static void loc_delete_aiding_data(GpsAidingData f) +{ + ENTRY_LOG(); + +#ifndef TARGET_BUILD_VARIANT_USER + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->delete_aiding_data) { + pLocGpsInterface->delete_aiding_data(A2Q_GpsAidingData(f)); + } +#endif + + EXIT_LOG(%s, VOID_RET); +} + +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 retVal = -1; + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->set_position_mode) { + retVal = pLocGpsInterface->set_position_mode(A2Q_GpsPositionMode(mode), + A2Q_GpsPositionRecurrence(recurrence), + min_interval, preferred_accuracy, preferred_time); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +const void* loc_get_extension(const char* name) +{ + ENTRY_LOG(); + const void* retVal = NULL; + + LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); + if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->get_extension) { + if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + { + pLocGpsXtraInterface = (const LocGpsXtraInterface*)pLocGpsInterface-> + get_extension(LOC_GPS_XTRA_INTERFACE); + if (NULL != pLocGpsXtraInterface) { + retVal = &sGpsXtraInterface; + } + } + else if (strcmp(name, AGPS_INTERFACE) == 0) + { + pLocAGpsInterface = (const LocAGpsInterface*)pLocGpsInterface-> + get_extension(LOC_AGPS_INTERFACE); + if (NULL != pLocAGpsInterface) { + retVal = &sAGpsInterface; + } + } + else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) + { + pLocSuplCertificateInterface = (const LocSuplCertificateInterface*)pLocGpsInterface-> + get_extension(LOC_SUPL_CERTIFICATE_INTERFACE); + if (NULL != pLocAGpsInterface) { + retVal = &sSuplCertificateInterface; + } + } + else if (strcmp(name, GPS_NI_INTERFACE) == 0) + { + pLocGpsNiInterface = (const LocGpsNiInterface*)pLocGpsInterface-> + get_extension(LOC_GPS_NI_INTERFACE); + if (NULL != pLocGpsNiInterface) { + retVal = &sGpsNiInterface; + } + } + else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) + { + pLocAGpsRilInterface = (const LocAGpsRilInterface*)pLocGpsInterface-> + get_extension(LOC_AGPS_RIL_INTERFACE); + if (NULL != pLocAGpsRilInterface) { + retVal = &sAGpsRilInterface; + } + } + else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + { + pLocGpsGeofencingInterface = (const LocGpsGeofencingInterface*)pLocGpsInterface-> + get_extension(LOC_GPS_GEOFENCING_INTERFACE); + if (NULL != pLocGpsGeofencingInterface) { + retVal = &sGpsGeofencingInterface; + } + } + else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) + { + pLocGpsMeasurementInterface = (const LocGpsMeasurementInterface*)pLocGpsInterface-> + get_extension(LOC_GPS_MEASUREMENT_INTERFACE); + if (NULL != pLocGpsMeasurementInterface) { + retVal = &sGpsMeasurementInterface; + } + } + else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) + { + pLocGnssConfigurationInterface = (const LocGnssConfigurationInterface*)pLocGpsInterface-> + get_extension(LOC_GNSS_CONFIGURATION_INTERFACE); + if (NULL != pLocGnssConfigurationInterface) { + retVal = &sGnssConfigurationInterface; + } + } + else + { + LOC_LOGE ("get_extension: Invalid interface passed in\n"); + } + } + EXIT_LOG(%p, retVal); + return retVal; +} + +/*=========================================================================== + Implementation of functions for sGpsXtraInterface +===========================================================================*/ +static void local_gps_xtra_download_request() +{ + ENTRY_LOG(); + if (NULL != pGpsXtraCallbacks && NULL != pGpsXtraCallbacks->download_request_cb) { + pGpsXtraCallbacks->download_request_cb(); + } + EXIT_LOG(%s, VOID_RET); +} + +static pthread_t local_gps_xtra_create_thread(const char* name, void (*start)(void *), void* arg) +{ + ENTRY_LOG(); + pthread_t retVal = -1; + if (NULL != pGpsXtraCallbacks && NULL != pGpsXtraCallbacks->create_thread_cb) { + retVal = pGpsXtraCallbacks->create_thread_cb(name, start, arg); + } + EXIT_LOG(%d, (int)retVal); + return retVal; +} + +static int loc_xtra_init(GpsXtraCallbacks* callbacks) +{ + ENTRY_LOG(); + + int retVal = -1; + LocGpsXtraCallbacks* cbs = NULL; + if (NULL != callbacks) + { + memcpy(&sGpsXtraCallbacks, callbacks, sizeof(GpsXtraCallbacks)); + pGpsXtraCallbacks = &sGpsXtraCallbacks; + cbs = &sLocGpsXtraCallbacks; + } + + if (NULL != pLocGpsXtraInterface && NULL != pLocGpsXtraInterface->init) { + retVal = pLocGpsXtraInterface->init(cbs); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + + +static int loc_xtra_inject_data(char* data, int length) +{ + ENTRY_LOG(); + int retVal = -1; + if (NULL != pLocGpsXtraInterface && NULL != pLocGpsXtraInterface->inject_xtra_data) { + retVal = pLocGpsXtraInterface->inject_xtra_data(data, length); + } + EXIT_LOG(%d, retVal); + return retVal; +} + +/*=========================================================================== + Implementation of functions for sAGpsInterface +===========================================================================*/ +static void local_agps_status_callback(LocAGpsStatus* status) +{ + ENTRY_LOG(); + if (NULL != pAGpsCallbacks && NULL != pAGpsCallbacks->status_cb) { + AGpsStatus st; + AGpsStatus* p_st = NULL; + if (NULL != status) + { + Q2A_AGpsStatus(*status, st); + p_st = &st; + } + pAGpsCallbacks->status_cb(p_st); + } + EXIT_LOG(%s, VOID_RET); +} + +static pthread_t local_agps_create_thread(const char* name, void (*start)(void *), void* arg) +{ + ENTRY_LOG(); + pthread_t retVal = -1; + if (NULL != pAGpsCallbacks && NULL != pAGpsCallbacks->create_thread_cb) { + retVal = pAGpsCallbacks->create_thread_cb(name, start, arg); + } + EXIT_LOG(%d, (int)retVal); + return retVal; +} + +static void loc_agps_init(AGpsCallbacks* callbacks) +{ + ENTRY_LOG(); + + LocAGpsCallbacks* cbs = NULL; + if (NULL != callbacks) + { + memcpy(&sAGpsCallbacks, callbacks, sizeof(AGpsCallbacks)); + pAGpsCallbacks = &sAGpsCallbacks; + cbs = &sLocAGpsCallbacks; + } + + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->init) { + pLocAGpsInterface->init(cbs); + } + + EXIT_LOG(%s, VOID_RET); +} + +static int loc_agps_open(const char* apn) +{ + ENTRY_LOG(); + + int retVal = -1; + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_open) { + retVal = pLocAGpsInterface->data_conn_open(apn); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_agps_closed() +{ + ENTRY_LOG(); + + int retVal = -1; + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_closed) { + retVal = pLocAGpsInterface->data_conn_closed(); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +int loc_agps_open_failed() +{ + ENTRY_LOG(); + + int retVal = -1; + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_failed) { + retVal = pLocAGpsInterface->data_conn_failed(); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_agps_set_server(AGpsType type, const char* hostname, int port) +{ + ENTRY_LOG(); + + int retVal = -1; + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->set_server) { + retVal = pLocAGpsInterface->set_server(A2Q_AGpsType(type), hostname, port); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) +{ + ENTRY_LOG(); + + int retVal = -1; + if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_open_with_apn_ip_type) { + retVal = pLocAGpsInterface->data_conn_open_with_apn_ip_type(apn, A2Q_ApnIpType(apnIpType)); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +/*=========================================================================== + Implementation of functions for sSuplCertificateInterface +===========================================================================*/ +static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, + size_t length) +{ + ENTRY_LOG(); + + int retVal = -1; + LocDerEncodedCertificate cert; + LocDerEncodedCertificate* p_cert = NULL; + if (NULL != certificates) { + A2Q_DerEncodedCertificate(*certificates, cert); + p_cert = &cert; + } + + if (NULL != pLocSuplCertificateInterface && + NULL != pLocSuplCertificateInterface->install_certificates) { + retVal = pLocSuplCertificateInterface->install_certificates(p_cert, length); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, + size_t length) +{ + ENTRY_LOG(); + LOC_LOGE("%s:%d] agps_revoke_certificates not supported", __func__, __LINE__); + int retVal = AGPS_CERTIFICATE_ERROR_GENERIC; + EXIT_LOG(%d, retVal); + return retVal; +} + +/*=========================================================================== + Implementation of functions for sGpsNiInterface +===========================================================================*/ +static void local_gps_ni_notify_callback(LocGpsNiNotification *notification) +{ + ENTRY_LOG(); + if (NULL != pGpsNiCallbacks && NULL != pGpsNiCallbacks->notify_cb) { + GpsNiNotification notify; + GpsNiNotification* p_notify = NULL; + if (NULL != notification) { + Q2A_GpsNiNotification(*notification, notify); + p_notify = ¬ify; + } + pGpsNiCallbacks->notify_cb(p_notify); + } + EXIT_LOG(%s, VOID_RET); +} + +static pthread_t local_gps_ni_create_thread(const char* name, void (*start)(void *), void* arg) +{ + ENTRY_LOG(); + pthread_t retVal = -1; + if (NULL != pGpsNiCallbacks && NULL != pGpsNiCallbacks->create_thread_cb) { + retVal = pGpsNiCallbacks->create_thread_cb(name, start, arg); + } + EXIT_LOG(%d, (int)retVal); + return retVal; +} + +void loc_ni_init(GpsNiCallbacks *callbacks) +{ + ENTRY_LOG(); + + LocGpsNiCallbacks* cbs = NULL; + if (NULL != callbacks) { + memcpy(&sGpsNiCallbacks, callbacks, sizeof(GpsNiCallbacks)); + pGpsNiCallbacks = &sGpsNiCallbacks; + cbs = &sLocGpsNiCallbacks; + } + + if(NULL != pLocGpsNiInterface && NULL != pLocGpsNiInterface->init) { + pLocGpsNiInterface->init(cbs); + } + + EXIT_LOG(%s, VOID_RET); +} + +void loc_ni_respond(int notif_id, GpsUserResponseType user_response) +{ + ENTRY_LOG(); + + if(NULL != pLocGpsNiInterface && NULL != pLocGpsNiInterface->respond) { + pLocGpsNiInterface->respond(notif_id, A2Q_GpsUserResponseType(user_response)); + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + Implementation of functions for sAGpsRilInterface +===========================================================================*/ +// Below stub functions are members of sAGpsRilInterface +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 available, const char* apn) +{ + ENTRY_LOG(); + + if (NULL != pLocAGpsRilInterface && + NULL != pLocAGpsRilInterface->update_network_availability) { + pLocAGpsRilInterface->update_network_availability(available, apn); + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + Implementation of functions for sGpsGeofencingInterface +===========================================================================*/ +static void local_gps_geofence_transition_callback(int32_t geofence_id, LocGpsLocation* location, + int32_t transition, LocGpsUtcTime timestamp) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_transition_callback) { + GpsLocation loc; + GpsLocation* p_loc = NULL; + if (NULL != location) + { + Q2A_GpsLocation(*location, loc); + p_loc = &loc; + } + pGpsGeofenceCallbacks->geofence_transition_callback(geofence_id, p_loc, transition, Q2A_GpsUtcTime(timestamp)); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_geofence_status_callback(int32_t status, LocGpsLocation* last_location) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_status_callback) { + GpsLocation loc; + GpsLocation* p_loc = NULL; + if (NULL != last_location) + { + Q2A_GpsLocation(*last_location, loc); + p_loc = &loc; + } + pGpsGeofenceCallbacks->geofence_status_callback(status, p_loc); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_geofence_add_callback(int32_t geofence_id, int32_t status) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_add_callback) { + pGpsGeofenceCallbacks->geofence_add_callback(geofence_id, status); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_geofence_remove_callback(int32_t geofence_id, int32_t status) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_remove_callback) { + pGpsGeofenceCallbacks->geofence_remove_callback(geofence_id, status); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_geofence_pause_callback(int32_t geofence_id, int32_t status) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_pause_callback) { + pGpsGeofenceCallbacks->geofence_pause_callback(geofence_id, status); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gps_geofence_resume_callback(int32_t geofence_id, int32_t status) +{ + ENTRY_LOG(); + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_resume_callback) { + pGpsGeofenceCallbacks->geofence_resume_callback(geofence_id, status); + } + EXIT_LOG(%s, VOID_RET); +} + +static pthread_t local_geofence_create_thread(const char* name, void (*start)(void *), void* arg) +{ + ENTRY_LOG(); + pthread_t retVal = -1; + if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->create_thread_cb) { + retVal = pGpsGeofenceCallbacks->create_thread_cb(name, start, arg); + } + EXIT_LOG(%d, (int)retVal); + return retVal; +} + +static void loc_geofence_init(GpsGeofenceCallbacks* callbacks) +{ + ENTRY_LOG(); + if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->init) { + LocGpsGeofenceCallbacks* cbs = NULL; + if (NULL != callbacks) { + memcpy(&sGpsGeofenceCallbacks, callbacks, sizeof(GpsGeofenceCallbacks)); + pGpsGeofenceCallbacks = &sGpsGeofenceCallbacks; + cbs = &sLocGpsGeofenceCallbacks; + } + pLocGpsGeofencingInterface->init(cbs); + } + EXIT_LOG(%s, VOID_RET); +} + +static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms) +{ + ENTRY_LOG(); + if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->add_geofence_area) { + pLocGpsGeofencingInterface->add_geofence_area(geofence_id, latitude, longitude, + radius_meters, last_transition, monitor_transitions, + notification_responsiveness_ms, unknown_timer_ms); + } + EXIT_LOG(%s, VOID_RET); +} + +static void loc_pause_geofence(int32_t geofence_id) +{ + ENTRY_LOG(); + if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->pause_geofence) { + pLocGpsGeofencingInterface->pause_geofence(geofence_id); + } + EXIT_LOG(%s, VOID_RET); +} + +static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions) +{ + ENTRY_LOG(); + if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->resume_geofence) { + pLocGpsGeofencingInterface->resume_geofence(geofence_id, monitor_transitions); + } + EXIT_LOG(%s, VOID_RET); +} + +static void loc_remove_geofence_area(int32_t geofence_id) +{ + ENTRY_LOG(); + if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->remove_geofence_area) { + pLocGpsGeofencingInterface->remove_geofence_area(geofence_id); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + Implementation of functions for sGpsMeasurementInterface +===========================================================================*/ +static void local_gps_measurement_callback(LocGpsData* data) +{ + ENTRY_LOG(); + if (NULL != pGpsMeasurementCallbacks && NULL != pGpsMeasurementCallbacks->measurement_callback) { + GpsData gps_data; + GpsData* p_gps_data = NULL; + if (NULL != data) + { + Q2A_GpsData(*data, gps_data); + p_gps_data = &gps_data; + } + pGpsMeasurementCallbacks->measurement_callback(p_gps_data); + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_gnss_measurement_callback(LocGnssData* data) +{ + ENTRY_LOG(); + if (NULL != pGpsMeasurementCallbacks && NULL != pGpsMeasurementCallbacks->gnss_measurement_callback) { + GnssData gnss_data; + GnssData* p_gnss_data = NULL; + if (NULL != data) + { + Q2A_GnssData(*data, gnss_data); + p_gnss_data = &gnss_data; + } + pGpsMeasurementCallbacks->gnss_measurement_callback(p_gnss_data); + } + EXIT_LOG(%s, VOID_RET); +} + +static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) +{ + ENTRY_LOG(); + + int retVal = -1; + LocGpsMeasurementCallbacks* cbs = NULL; + if (NULL != callbacks) + { + memcpy(&sGpsMeasurementCallbacks, callbacks, sizeof(GpsMeasurementCallbacks)); + pGpsMeasurementCallbacks = &sGpsMeasurementCallbacks; + cbs = &sLocGpsMeasurementCallbacks; + } + + if (NULL != pLocGpsMeasurementInterface && NULL != pLocGpsMeasurementInterface->init) { + pLocGpsMeasurementInterface->init(cbs); + } + + EXIT_LOG(%d, retVal); + return retVal; +} + +static void loc_gps_measurement_close() +{ + ENTRY_LOG(); + + if (NULL != pLocGpsMeasurementInterface && NULL != pLocGpsMeasurementInterface->close) { + pLocGpsMeasurementInterface->close(); + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + Implementation of functions for sGnssConfigurationInterface +===========================================================================*/ +static void loc_configuration_update(const char* config_data, int32_t length) +{ + ENTRY_LOG(); + + if (NULL != pLocGnssConfigurationInterface && + NULL != pLocGnssConfigurationInterface->configuration_update) { + pLocGnssConfigurationInterface->configuration_update(config_data, length); + } + + EXIT_LOG(%s, VOID_RET); +} + diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 222d5da7..8c021b39 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -30,7 +30,6 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_afw" -#include #include #include #include @@ -48,39 +47,33 @@ using namespace loc_core; -#define LOC_PM_CLIENT_NAME "GPS" +// All functions and variables should be static +// except loc_eng_gps_get_hardware_interface() and loc_eng_get_gps_interface() //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 loc_gps_location_callback gps_loc_cb = NULL; +static loc_gps_sv_status_callback gps_sv_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); +static void local_sv_cb(LocGpsSvStatus* sv_status, void* svExt); -GpsNiExtCallbacks sGpsNiExtCallbacks = { - local_ni_cb -}; - -static const GpsGeofencingInterface* get_geofence_interface(void); +static const LocGpsGeofencingInterface* get_geofence_interface(void); // Function declarations for sLocEngInterface -static int loc_init(GpsCallbacks* callbacks); +static int loc_init(LocGpsCallbacks* 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_time(LocGpsUtcTime 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, +static void loc_delete_aiding_data(LocGpsAidingData f); +static int loc_set_position_mode(LocGpsPositionMode mode, LocGpsPositionRecurrence 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 = +static const LocGpsInterface sLocEngInterface = { - sizeof(GpsInterface), + sizeof(LocGpsInterface), loc_init, loc_start, loc_stop, @@ -93,16 +86,16 @@ static const GpsInterface sLocEngInterface = }; // Function declarations for sLocEngAGpsInterface -static void loc_agps_init(AGpsCallbacks* callbacks); +static void loc_agps_init(LocAGpsCallbacks* 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 int loc_agps_set_server(LocAGpsType type, const char *hostname, int port); +static int loc_agps_open_with_apniptype( const char* apn, LocApnIpType apnIpType); -static const AGpsInterface sLocEngAGpsInterface = +static const LocAGpsInterface sLocEngAGpsInterface = { - sizeof(AGpsInterface), + sizeof(LocAGpsInterface), loc_agps_init, loc_agps_open, loc_agps_closed, @@ -111,46 +104,53 @@ static const AGpsInterface sLocEngAGpsInterface = loc_agps_open_with_apniptype }; -static int loc_xtra_init(GpsXtraCallbacks* callbacks); +static int loc_xtra_init(LocGpsXtraCallbacks* callbacks); static int loc_xtra_inject_data(char* data, int length); -static const GpsXtraInterface sLocEngXTRAInterface = +static const LocGpsXtraInterface sLocEngXTRAInterface = { - sizeof(GpsXtraInterface), + sizeof(LocGpsXtraInterface), 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 loc_gps_ni_notify_callback gps_ni_cb = NULL; +static void local_ni_cb(LocGpsNiNotification *notification, bool esEnalbed); -static const GpsNiInterface sLocEngNiInterface = +static GpsNiExtCallbacks sGpsNiExtCallbacks = { + local_ni_cb +}; + +static void loc_ni_init(LocGpsNiCallbacks *callbacks); +static void loc_ni_respond(int notif_id, LocGpsUserResponseType user_response); + +static const LocGpsNiInterface sLocEngNiInterface = { - sizeof(GpsNiInterface), + sizeof(LocGpsNiInterface), loc_ni_init, loc_ni_respond, }; -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); +static int loc_gps_measurement_init(LocGpsMeasurementCallbacks* callbacks); static void loc_gps_measurement_close(); -static const GpsMeasurementInterface sLocEngGpsMeasurementInterface = +static const LocGpsMeasurementInterface sLocEngGpsMeasurementInterface = { - sizeof(GpsMeasurementInterface), + sizeof(LocGpsMeasurementInterface), 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_init( LocAGpsRilCallbacks* callbacks ); +static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct); +static void loc_agps_ril_set_set_id(LocAGpsSetIDType 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 = +static const LocAGpsRilInterface sLocEngAGpsRilInterface = { - sizeof(AGpsRilInterface), + sizeof(LocAGpsRilInterface), loc_agps_ril_init, loc_agps_ril_set_ref_location, loc_agps_ril_set_set_id, @@ -159,23 +159,23 @@ static const AGpsRilInterface sLocEngAGpsRilInterface = loc_agps_ril_update_network_availability }; -static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, +static int loc_agps_install_certificates(const LocDerEncodedCertificate* certificates, size_t length); -static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, +static int loc_agps_revoke_certificates(const LocSha1CertificateFingerprint* fingerprints, size_t length); -static const SuplCertificateInterface sLocEngAGpsCertInterface = +static const LocSuplCertificateInterface sLocEngAGpsCertInterface = { - sizeof(SuplCertificateInterface), + sizeof(LocSuplCertificateInterface), loc_agps_install_certificates, loc_agps_revoke_certificates }; static void loc_configuration_update(const char* config_data, int32_t length); -static const GnssConfigurationInterface sLocEngConfigInterface = +static const LocGnssConfigurationInterface sLocEngConfigInterface = { - sizeof(GnssConfigurationInterface), + sizeof(LocGnssConfigurationInterface), loc_configuration_update }; @@ -183,10 +183,10 @@ static loc_eng_data_s_type loc_afw_data; static int gss_fd = -1; static int sGnssType = GNSS_UNKNOWN; /*=========================================================================== -FUNCTION gps_get_hardware_interface +FUNCTION loc_eng_gps_get_hardware_interface DESCRIPTION - Returns the GPS hardware interaface based on LOC API + Returns LocGpsInterface if GPS is enabled. DEPENDENCIES @@ -199,10 +199,10 @@ SIDE EFFECTS N/A ===========================================================================*/ -extern "C" const GpsInterface* gps_get_hardware_interface () +extern "C" const LocGpsInterface* loc_eng_gps_get_hardware_interface () { ENTRY_LOG_CALLFLOW(); - const GpsInterface* ret_val; + const LocGpsInterface* ret_val; char propBuf[PROPERTY_VALUE_MAX]; memset(propBuf, 0, sizeof(propBuf)); @@ -225,8 +225,7 @@ extern "C" const GpsInterface* gps_get_hardware_interface () return ret_val; } -// for gps.c -extern "C" const GpsInterface* get_gps_interface() +extern "C" const LocGpsInterface* loc_eng_get_gps_interface() { unsigned int target = TARGET_DEFAULT; loc_eng_read_config(); @@ -240,7 +239,7 @@ extern "C" const GpsInterface* get_gps_interface() case GNSS_GSS: case GNSS_AUTO: //APQ8064 - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); if (gss_fd < 0) { LOC_LOGE("GSS open failed: %s\n", strerror(errno)); @@ -256,7 +255,7 @@ extern "C" const GpsInterface* get_gps_interface() return NULL; case GNSS_QCA1530: // qca1530 chip is present - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB); LOC_LOGD("qca1530 present: CAPABILITIES %0lx\n", gps_conf.CAPABILITIES); break; } @@ -280,7 +279,7 @@ SIDE EFFECTS N/Ax ===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) +static int loc_init(LocGpsCallbacks* callbacks) { int retVal = -1; unsigned int target = (unsigned int) -1; @@ -453,8 +452,8 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_set_position_mode(GpsPositionMode mode, - GpsPositionRecurrence recurrence, +static int loc_set_position_mode(LocGpsPositionMode mode, + LocGpsPositionRecurrence recurrence, uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) @@ -463,10 +462,10 @@ static int loc_set_position_mode(GpsPositionMode mode, int ret_val = -1; LocPositionMode locMode; switch (mode) { - case GPS_POSITION_MODE_MS_BASED: + case LOC_GPS_POSITION_MODE_MS_BASED: locMode = LOC_POSITION_MODE_MS_BASED; break; - case GPS_POSITION_MODE_MS_ASSISTED: + case LOC_GPS_POSITION_MODE_MS_ASSISTED: locMode = LOC_POSITION_MODE_MS_ASSISTED; break; default: @@ -502,7 +501,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) +static int loc_inject_time(LocGpsUtcTime time, int64_t timeReference, int uncertainty) { ENTRY_LOG(); int ret_val = 0; @@ -553,7 +552,7 @@ DESCRIPTION will happen when gps engine is turned off. DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with + Assumes the aiding data type specified in LocGpsAidingData matches with LOC API specification. RETURN VALUE @@ -563,7 +562,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_delete_aiding_data(GpsAidingData f) +static void loc_delete_aiding_data(LocGpsAidingData f) { ENTRY_LOG(); @@ -574,14 +573,14 @@ static void loc_delete_aiding_data(GpsAidingData f) EXIT_LOG(%s, VOID_RET); } -const GpsGeofencingInterface* get_geofence_interface(void) +static const LocGpsGeofencingInterface* get_geofence_interface(void) { ENTRY_LOG(); void *handle; const char *error; - typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void); + typedef const LocGpsGeofencingInterface* (*get_gps_geofence_interface_function) (void); get_gps_geofence_interface_function get_gps_geofence_interface; - static const GpsGeofencingInterface* geofence_interface = NULL; + static const LocGpsGeofencingInterface* geofence_interface = NULL; dlerror(); /* Clear any existing error */ @@ -595,7 +594,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) goto exit; } dlerror(); /* Clear any existing error */ - get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); + get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "loc_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; @@ -633,19 +632,19 @@ const void* loc_get_extension(const char* name) const void* ret_val = NULL; LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); - if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + if (strcmp(name, LOC_GPS_XTRA_INTERFACE) == 0) { ret_val = &sLocEngXTRAInterface; } - else if (strcmp(name, AGPS_INTERFACE) == 0) + else if (strcmp(name, LOC_AGPS_INTERFACE) == 0) { ret_val = &sLocEngAGpsInterface; } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) + else if (strcmp(name, LOC_GPS_NI_INTERFACE) == 0) { ret_val = &sLocEngNiInterface; } - else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) + else if (strcmp(name, LOC_AGPS_RIL_INTERFACE) == 0) { char baseband[PROPERTY_VALUE_MAX]; platform_lib_abstraction_property_get("ro.baseband", baseband, "msm"); @@ -654,21 +653,21 @@ const void* loc_get_extension(const char* name) ret_val = &sLocEngAGpsRilInterface; } } - else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + else if (strcmp(name, LOC_GPS_GEOFENCING_INTERFACE) == 0) { - if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ + if ((gps_conf.CAPABILITIES | LOC_GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ ret_val = get_geofence_interface(); } } - else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) + else if (strcmp(name, LOC_SUPL_CERTIFICATE_INTERFACE) == 0) { ret_val = &sLocEngAGpsCertInterface; } - else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) + else if (strcmp(name, LOC_GNSS_CONFIGURATION_INTERFACE) == 0) { ret_val = &sLocEngConfigInterface; } - else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) + else if (strcmp(name, LOC_GPS_MEASUREMENT_INTERFACE) == 0) { ret_val = &sLocEngGpsMeasurementInterface; } @@ -696,7 +695,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_agps_init(AGpsCallbacks* callbacks) +static void loc_agps_init(LocAGpsCallbacks* callbacks) { ENTRY_LOG(); loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks); @@ -723,7 +722,7 @@ SIDE EFFECTS static int loc_agps_open(const char* apn) { ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; + LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL; AGpsBearerType bearerType = AGPS_APN_BEARER_IPV4; int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); @@ -748,20 +747,20 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) +static int loc_agps_open_with_apniptype(const char* apn, LocApnIpType apnIpType) { ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; + LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL; AGpsBearerType bearerType; switch (apnIpType) { - case APN_IP_IPV4: + case LOC_APN_IP_IPV4: bearerType = AGPS_APN_BEARER_IPV4; break; - case APN_IP_IPV6: + case LOC_APN_IP_IPV6: bearerType = AGPS_APN_BEARER_IPV6; break; - case APN_IP_IPV4V6: + case LOC_APN_IP_IPV4V6: bearerType = AGPS_APN_BEARER_IPV4V6; break; default: @@ -795,7 +794,7 @@ SIDE EFFECTS static int loc_agps_closed() { ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; + LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL; int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); EXIT_LOG(%d, ret_val); @@ -822,7 +821,7 @@ SIDE EFFECTS int loc_agps_open_failed() { ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; + LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL; int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); EXIT_LOG(%d, ret_val); @@ -847,15 +846,15 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_agps_set_server(AGpsType type, const char* hostname, int port) +static int loc_agps_set_server(LocAGpsType type, const char* hostname, int port) { ENTRY_LOG(); LocServerType serverType; switch (type) { - case AGPS_TYPE_SUPL: + case LOC_AGPS_TYPE_SUPL: serverType = LOC_AGPS_SUPL_SERVER; break; - case AGPS_TYPE_C2K: + case LOC_AGPS_TYPE_C2K: serverType = LOC_AGPS_CDMA_PDE_SERVER; break; default: @@ -884,7 +883,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_xtra_init(GpsXtraCallbacks* callbacks) +static int loc_xtra_init(LocGpsXtraCallbacks* callbacks) { ENTRY_LOG(); GpsXtraExtCallbacks extCallbacks; @@ -942,7 +941,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) +static int loc_gps_measurement_init(LocGpsMeasurementCallbacks* callbacks) { ENTRY_LOG(); int ret_val = loc_eng_gps_measurement_init(loc_afw_data, @@ -992,7 +991,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -void loc_ni_init(GpsNiCallbacks *callbacks) +void loc_ni_init(LocGpsNiCallbacks *callbacks) { ENTRY_LOG(); gps_ni_cb = callbacks->notify_cb; @@ -1016,7 +1015,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -void loc_ni_respond(int notif_id, GpsUserResponseType user_response) +void loc_ni_respond(int notif_id, LocGpsUserResponseType user_response) { ENTRY_LOG(); loc_eng_ni_respond(loc_afw_data, notif_id, user_response); @@ -1024,9 +1023,9 @@ void loc_ni_respond(int notif_id, GpsUserResponseType user_response) } // 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_init( LocAGpsRilCallbacks* callbacks ) {} +static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct) {} +static void loc_agps_ril_set_set_id(LocAGpsSetIDType 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) {} @@ -1054,7 +1053,7 @@ static void loc_agps_ril_update_network_availability(int available, const char* EXIT_LOG(%s, VOID_RET); } -static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, +static int loc_agps_install_certificates(const LocDerEncodedCertificate* certificates, size_t length) { ENTRY_LOG(); @@ -1062,12 +1061,12 @@ static int loc_agps_install_certificates(const DerEncodedCertificate* certificat EXIT_LOG(%d, ret_val); return ret_val; } -static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, +static int loc_agps_revoke_certificates(const LocSha1CertificateFingerprint* fingerprints, size_t length) { ENTRY_LOG(); - LOC_LOGE("%s:%d]: agps_revoke_certificates not supported"); - int ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; + LOC_LOGE("%s:%d] agps_revoke_certificates not supported", __func__, __LINE__); + int ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC; EXIT_LOG(%d, ret_val); return ret_val; } @@ -1082,7 +1081,7 @@ static void loc_configuration_update(const char* config_data, int32_t length) case GNSS_AUTO: case GNSS_QCA1530: //APQ - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB); break; } EXIT_LOG(%s, VOID_RET); @@ -1101,7 +1100,7 @@ static void local_loc_cb(UlpLocation* location, void* locExt) EXIT_LOG(%s, VOID_RET); } -static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) +static void local_sv_cb(LocGpsSvStatus* sv_status, void* svExt) { ENTRY_LOG(); if (NULL != gps_sv_cb) { @@ -1111,7 +1110,7 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } -static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed) +static void local_ni_cb(LocGpsNiNotification *notification, bool esEnalbed) { if (NULL != gps_ni_cb) { gps_ni_cb(notification); diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 8cf77fc9..9edd8c0a 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -35,29 +35,28 @@ 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_sv_status_cb_ext) (LocGpsSvStatus* 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_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_gps_nmea_callback nmea_cb; + loc_gps_set_capabilities set_capabilities_cb; + loc_gps_acquire_wakelock acquire_wakelock_cb; + loc_gps_release_wakelock release_wakelock_cb; + loc_gps_create_thread create_thread_cb; loc_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; + loc_gps_request_utc_time request_utc_time_cb; + loc_gnss_set_system_info set_system_info_cb; + loc_gnss_sv_status_callback gnss_sv_status_cb; } LocCallbacks; #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 545f3eb2..28ddcf79 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -193,11 +193,11 @@ 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); + LocGpsStatusValue status); static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data, - GpsStatusValue status); + LocGpsStatusValue status); static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data, - int connHandle, AGpsType agps_type); + int connHandle, LocAGpsType 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) ; @@ -211,7 +211,7 @@ 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 && + if (loc_eng_data.engine_status != LOC_GPS_STATUS_ENGINE_ON && loc_eng_data.aiding_data_for_deletion != 0) { loc_eng_data.adapter->deleteAidingData(loc_eng_data.aiding_data_for_deletion); @@ -229,7 +229,7 @@ static void* noProc(void* data) *********************************************************************/ // case LOC_ENG_MSG_REQUEST_NI: LocEngRequestNi::LocEngRequestNi(void* locEng, - GpsNiNotification ¬if, + LocGpsNiNotification ¬if, const void* data) : LocMsg(), mLocEng(locEng), mNotify(notif), mPayload(data) { locallog(); @@ -347,11 +347,11 @@ void LocEngGetZpp::send() const { struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; - const GpsUtcTime mTime; + const LocGpsUtcTime mTime; const int64_t mTimeReference; const int mUncertainty; inline LocEngSetTime(LocEngAdapter* adapter, - GpsUtcTime t, int64_t tf, int unc) : + LocGpsUtcTime t, int64_t tf, int unc) : LocMsg(), mAdapter(adapter), mTime(t), mTimeReference(tf), mUncertainty(unc) { @@ -804,7 +804,7 @@ void LocEngReportPosition::proc() const { mTechMask)) || (LOC_SESS_INTERMEDIATE == locEng->intermediateFix && !((mLocation.gpsLocation.flags & - GPS_LOCATION_HAS_ACCURACY) && + LOC_GPS_LOCATION_HAS_ACCURACY) && (gps_conf.ACCURACY_THRES != 0) && (mLocation.gpsLocation.accuracy > gps_conf.ACCURACY_THRES)))) { @@ -821,7 +821,7 @@ void LocEngReportPosition::proc() const { // if we have reported this fix if (reported && // and if this is a singleshot - GPS_POSITION_RECURRENCE_SINGLE == + LOC_GPS_POSITION_RECURRENCE_SINGLE == locEng->adapter->getPositionMode().recurrence) { if (LOC_SESS_INTERMEDIATE == mStatus) { // modem could be still working for a final fix, @@ -869,7 +869,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + LocGnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), @@ -886,8 +886,8 @@ void LocEngReportSv::proc() const { if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { - GnssSvStatus gnssSvStatus; - memcpy(&gnssSvStatus,&mSvStatus,sizeof(GnssSvStatus)); + LocGnssSvStatus gnssSvStatus; + memcpy(&gnssSvStatus,&mSvStatus,sizeof(LocGnssSvStatus)); if (adapter->isGnssSvIdUsedInPosAvail()) { GnssSvUsedInPosition gnssSvIdUsedInPosition = @@ -924,18 +924,18 @@ void LocEngReportSv::proc() const { // flag, else clear the USED_IN_FIX flag. if (svUsedIdMask & (1 << (gnssSvId - prnMin))) { - gnssSvStatus.gnss_sv_list[i].flags |= GNSS_SV_FLAGS_USED_IN_FIX; + gnssSvStatus.gnss_sv_list[i].flags |= LOC_GNSS_SV_FLAGS_USED_IN_FIX; } else { - gnssSvStatus.gnss_sv_list[i].flags &= ~GNSS_SV_FLAGS_USED_IN_FIX; + gnssSvStatus.gnss_sv_list[i].flags &= ~LOC_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)); + locEng->gnss_sv_status_cb((LocGnssSvStatus*)&(gnssSvStatus)); } if (locEng->generateNmea) @@ -956,7 +956,7 @@ void LocEngReportSv::send() const { // case LOC_ENG_MSG_REPORT_STATUS: LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter, - GpsStatusValue engineStatus) : + LocGpsStatusValue engineStatus) : LocMsg(), mAdapter(adapter), mStatus(engineStatus) { locallog(); @@ -1216,7 +1216,7 @@ void LocEngRequestATL::proc() const { ATLSubscriber s(mID, sm, locEng->adapter, - AGPS_TYPE_INVALID == mType); + LOC_AGPS_TYPE_INVALID == mType); sm->subscribeRsrc((Subscriber*)&s); } else { locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, mType); @@ -1350,7 +1350,7 @@ LocEngRequestTime::LocEngRequestTime(void* locEng) : } 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 (gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_ON_DEMAND_TIME) { if (locEng->request_utc_time_cb != NULL) { locEng->request_utc_time_cb(); } else { @@ -1368,9 +1368,9 @@ inline void LocEngRequestTime::log() const { // case LOC_ENG_MSG_DELETE_AIDING_DATA: struct LocEngDelAidData : public LocMsg { loc_eng_data_s_type* mLocEng; - const GpsAidingData mType; + const LocGpsAidingData mType; inline LocEngDelAidData(loc_eng_data_s_type* locEng, - GpsAidingData f) : + LocGpsAidingData f) : LocMsg(), mLocEng(locEng), mType(f) { locallog(); @@ -1645,14 +1645,14 @@ struct LocEngInstallAGpsCert : public LocMsg { LocEngAdapter* mpAdapter; const size_t mNumberOfCerts; const uint32_t mSlotBitMask; - DerEncodedCertificate* mpData; + LocDerEncodedCertificate* mpData; inline LocEngInstallAGpsCert(LocEngAdapter* adapter, - const DerEncodedCertificate* pData, + const LocDerEncodedCertificate* pData, size_t numberOfCerts, uint32_t slotBitMask) : LocMsg(), mpAdapter(adapter), mNumberOfCerts(numberOfCerts), mSlotBitMask(slotBitMask), - mpData(new DerEncodedCertificate[mNumberOfCerts]) + mpData(new LocDerEncodedCertificate[mNumberOfCerts]) { for (int i=0; i < mNumberOfCerts; i++) { mpData[i].data = new u_char[pData[i].length]; @@ -1694,10 +1694,10 @@ struct LocEngGnssConstellationConfig : public LocMsg { locallog(); } inline virtual void proc() const { - mAdapter->mGnssInfo.size = sizeof(GnssSystemInfo); + mAdapter->mGnssInfo.size = sizeof(LocGnssSystemInfo); if (mAdapter->gnssConstellationConfig()) { LOC_LOGV("Modem supports GNSS measurements\n"); - gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS; + gps_conf.CAPABILITIES |= LOC_GPS_CAPABILITY_MEASUREMENTS; mAdapter->mGnssInfo.year_of_hw = 2016; } else { mAdapter->mGnssInfo.year_of_hw = 2015; @@ -1714,7 +1714,7 @@ struct LocEngGnssConstellationConfig : public LocMsg { // case LOC_ENG_MSG_REPORT_GNSS_MEASUREMENT: LocEngReportGnssMeasurement::LocEngReportGnssMeasurement(void* locEng, - GnssData &gnssData) : + LocGnssData &gnssData) : LocMsg(), mLocEng(locEng), mGnssData(gnssData) { locallog(); @@ -1725,7 +1725,7 @@ void LocEngReportGnssMeasurement::proc() const { { if (locEng->gnss_measurement_cb != NULL) { LOC_LOGV("Calling gnss_measurement_cb"); - locEng->gnss_measurement_cb((GnssData*)&(mGnssData)); + locEng->gnss_measurement_cb((LocGnssData*)&(mGnssData)); } } } @@ -1734,7 +1734,7 @@ void LocEngReportGnssMeasurement::locallog() const { 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++) { + for (int i =0; i< mGnssData.measurement_count && i < LOC_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 |" @@ -1835,8 +1835,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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.engine_status -- LOC_GPS_STATUS_NONE; + // loc_eng_data.fix_session_status -- LOC_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)) @@ -1853,7 +1853,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, 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.size = sizeof(LocGnssSystemInfo); loc_eng_data.adapter->mGnssInfo.year_of_hw = 2015; LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); @@ -2122,8 +2122,8 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, 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) && + if (!(gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB) && + !(gps_conf.CAPABILITIES & LOC_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."); @@ -2155,7 +2155,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, +int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, LocGpsUtcTime time, int64_t timeReference, int uncertainty) { ENTRY_LOG_CALLFLOW(); @@ -2213,7 +2213,7 @@ DESCRIPTION will happen when gps engine is turned off. DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with + Assumes the aiding data type specified in LocGpsAidingData matches with LOC API specification. RETURN VALUE @@ -2223,7 +2223,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f) +void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, LocGpsAidingData f) { ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return); @@ -2253,13 +2253,13 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusValue status) +static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, LocGpsStatusValue status) { ENTRY_LOG(); if (loc_eng_data.status_cb) { - GpsStatus gs = { sizeof(gs),status }; + LocGpsStatus gs = { sizeof(gs),status }; CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status)); loc_eng_data.status_cb(&gs); @@ -2305,12 +2305,12 @@ static int dataCallCb(void *cb_data) 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"); + if(cbData->action == LOC_GPS_REQUEST_AGPS_DATA_CONN) { + LOC_LOGD("dataCallCb LOC_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"); + else if(cbData->action == LOC_GPS_RELEASE_AGPS_DATA_CONN) { + LOC_LOGD("dataCallCb LOC_GPS_RELEASE_AGPS_DATA_CONN\n"); locAdapter->stopDataCall(); } } @@ -2436,7 +2436,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call } static void deleteAidingData(loc_eng_data_s_type &logEng) { - if (logEng.engine_status != GPS_STATUS_ENGINE_ON && + if (logEng.engine_status != LOC_GPS_STATUS_ENGINE_ON && logEng.aiding_data_for_deletion != 0) { logEng.adapter->deleteAidingData(logEng.aiding_data_for_deletion); logEng.aiding_data_for_deletion = 0; @@ -2445,21 +2445,21 @@ static void deleteAidingData(loc_eng_data_s_type &logEng) { // 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)); + bool agpsCapable = ((gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA) || + (gps_conf.CAPABILITIES & LOC_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, + LOC_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, + LOC_AGPS_TYPE_SUPL, false); } if (NULL == locEng.ds_nif && @@ -2478,12 +2478,12 @@ static AgpsStateMachine* getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { AgpsStateMachine* stateMachine; switch (agpsType) { - case AGPS_TYPE_INVALID: - case AGPS_TYPE_SUPL: { + case LOC_AGPS_TYPE_INVALID: + case LOC_AGPS_TYPE_SUPL: { stateMachine = locEng.agnss_nif; break; } - case AGPS_TYPE_SUPL_ES: { + case LOC_AGPS_TYPE_SUPL_ES: { if (gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { if (NULL == locEng.ds_nif) { createAgnssNifs(locEng); @@ -2797,11 +2797,11 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d } int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, - const DerEncodedCertificate* certificates, + const LocDerEncodedCertificate* certificates, size_t numberOfCerts) { ENTRY_LOG_CALLFLOW(); - int ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; + int ret_val = LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS; uint32_t slotBitMask = gps_conf.AGPS_CERT_WRITABLE_MASK; uint32_t slotCount = 0; @@ -2815,26 +2815,26 @@ int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, if (numberOfCerts == 0) { LOC_LOGE("No certs to install, since numberOfCerts is zero"); - ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; + ret_val = LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS; } else if (!adapter) { LOC_LOGE("adapter is null!"); - ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; + ret_val = LOC_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; + ret_val = LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES; } else { for (int i=0; i < numberOfCerts; ++i) { - if (certificates[i].length > AGPS_CERTIFICATE_MAX_LENGTH) { + if (certificates[i].length > LOC_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; + certificates[i].length, LOC_AGPS_CERTIFICATE_MAX_LENGTH); + ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC; break; } } - if (ret_val == AGPS_CERTIFICATE_OPERATION_SUCCESS) { + if (ret_val == LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS) { adapter->sendMsg(new LocEngInstallAGpsCert(adapter, certificates, numberOfCerts, @@ -2907,11 +2907,11 @@ SIDE EFFECTS N/A ===========================================================================*/ -static void loc_eng_report_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, LocGpsStatusValue 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 (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_GPS_STATUS_ENGINE_ON) { if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_WAIT) { @@ -2922,7 +2922,7 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV // 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)) + (status == LOC_GPS_STATUS_SESSION_END || status == LOC_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; @@ -2930,9 +2930,9 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV // 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 (status != LOC_GPS_STATUS_NONE && + !(status == LOC_GPS_STATUS_SESSION_END && navigating) && + !(status == LOC_GPS_STATUS_SESSION_BEGIN && !navigating)) { if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION) { @@ -2945,13 +2945,13 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV } // Only keeps ENGINE ON/OFF in engine_status - if (status == GPS_STATUS_ENGINE_ON || status == GPS_STATUS_ENGINE_OFF) + if (status == LOC_GPS_STATUS_ENGINE_ON || status == LOC_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) + if (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_GPS_STATUS_SESSION_END) { loc_eng_data.fix_session_status = status; } @@ -2981,7 +2981,7 @@ 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); + loc_eng_report_status(loc_eng_data, LOC_GPS_STATUS_ENGINE_OFF); EXIT_LOG(%s, VOID_RET); } @@ -3070,28 +3070,28 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, - GpsMeasurementCallbacks* callbacks) + LocGpsMeasurementCallbacks* callbacks) { ENTRY_LOG_CALLFLOW(); STATE_CHECK((NULL == loc_eng_data.gnss_measurement_cb), "gnss measurement already initialized", - return GPS_MEASUREMENT_ERROR_ALREADY_INIT); + return LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT); STATE_CHECK((callbacks != NULL), "callbacks can not be NULL", - return GPS_MEASUREMENT_ERROR_GENERIC); + return LOC_GPS_MEASUREMENT_ERROR_GENERIC); STATE_CHECK(loc_eng_data.adapter, - "GpsInterface must be initialized first", - return GPS_MEASUREMENT_ERROR_GENERIC); + "LocGpsInterface must be initialized first", + return LOC_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_eng_data.gnss_measurement_cb = callbacks->loc_gnss_measurement_callback; LOC_LOGD ("%s, event masks updated successfully", __func__); - return GPS_MEASUREMENT_OPERATION_SUCCESS; + return LOC_GPS_MEASUREMENT_OPERATION_SUCCESS; } /*=========================================================================== diff --git a/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h index 9418fa95..d78bef4c 100644 --- a/loc_api/libloc_api_50001/loc_eng.h +++ b/loc_api/libloc_api_50001/loc_eng.h @@ -85,20 +85,20 @@ typedef struct loc_eng_data_s { LocEngAdapter *adapter; loc_location_cb_ext location_cb; - gps_status_callback status_cb; + loc_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_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; + loc_gps_set_capabilities set_capabilities_cb; + loc_gps_acquire_wakelock acquire_wakelock_cb; + loc_gps_release_wakelock release_wakelock_cb; + loc_gps_request_utc_time request_utc_time_cb; + loc_gnss_set_system_info set_system_info_cb; + loc_gnss_sv_status_callback gnss_sv_status_cb; + loc_gnss_measurement_callback gnss_measurement_cb; boolean intermediateFix; - AGpsStatusValue agps_status; + LocAGpsStatusValue agps_status; loc_eng_xtra_data_s_type xtra_module_data; loc_eng_ni_data_s_type loc_eng_ni_data; @@ -109,11 +109,11 @@ typedef struct loc_eng_data_s AgpsStateMachine* ds_nif; // GPS engine status - GpsStatusValue engine_status; - GpsStatusValue fix_session_status; + LocGpsStatusValue engine_status; + LocGpsStatusValue 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; + LocGpsAidingData aiding_data_for_deletion; // For muting session broadcast loc_mute_session_e_type mute_session_state; @@ -151,13 +151,13 @@ 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, + LocGpsUtcTime 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); + LocGpsAidingData 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, @@ -177,7 +177,7 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agp 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, + const LocDerEncodedCertificate* certificates, size_t length); //loc_eng_xtra functions @@ -192,16 +192,16 @@ void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, int check); 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); + int notif_id, LocGpsUserResponseType user_response); extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, - const GpsNiNotification *notif, + const LocGpsNiNotification *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); + LocGpsMeasurementCallbacks* callbacks); void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data); #ifdef __cplusplus diff --git a/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp index 43af70fe..93260e3c 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -156,7 +156,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) case RSRC_DENIED: { AGpsExtType type = mBackwardCompatibleMode ? - AGPS_TYPE_INVALID : mStateMachine->getType(); + LOC_AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), @@ -166,7 +166,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) case RSRC_GRANTED: { AGpsExtType type = mBackwardCompatibleMode ? - AGPS_TYPE_INVALID : mStateMachine->getType(); + LOC_AGPS_TYPE_INVALID : mStateMachine->getType(); ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, (char*)mStateMachine->getAPN(), mStateMachine->getBearer(), @@ -275,7 +275,7 @@ AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data) //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)) { + if(!mStateMachine->sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN)) { // move the state to PENDING nextState = mPendingState; } @@ -354,13 +354,13 @@ AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) nextState = mReleasedState; // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + mStateMachine->sendRsrcRequest(LOC_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); + mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN); } } break; @@ -453,13 +453,13 @@ AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) nextState = mReleasedState; // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + mStateMachine->sendRsrcRequest(LOC_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); + mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN); } } break; @@ -559,7 +559,7 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) if (mStateMachine->hasActiveSubscribers()) { nextState = mPendingState; // request from connecivity service for NIF - mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + mStateMachine->sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN); } else { nextState = mReleasedState; } @@ -611,7 +611,7 @@ int ExtServicer :: requestRsrc(void *cb_data) int AGpsServicer :: requestRsrc(void *cb_data) { - callbackAGps((AGpsStatus *)cb_data); + callbackAGps((LocAGpsStatus *)cb_data); return 0; } @@ -746,14 +746,14 @@ void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const } } -int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +int AgpsStateMachine::sendRsrcRequest(LocAGpsStatusValue 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)) { + if ((NULL == s) == (LOC_GPS_RELEASE_AGPS_DATA_CONN == action)) { AGpsExtStatus nifRequest; nifRequest.size = sizeof(nifRequest); nifRequest.type = mType; @@ -827,7 +827,7 @@ err: DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, LocEngAdapter* adapterHandle): - AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), + AgpsStateMachine(type, cb_func, LOC_AGPS_TYPE_INVALID,false), mLocAdapter(adapterHandle) { LOC_LOGD("%s:%d]: New DSStateMachine\n", __func__, __LINE__); @@ -848,7 +848,7 @@ void DSStateMachine :: retryCallback(void) return; } -int DSStateMachine :: sendRsrcRequest(AGpsStatusValue action) const +int DSStateMachine :: sendRsrcRequest(LocAGpsStatusValue action) const { DSSubscriber* s = NULL; dsCbData cbData; @@ -954,13 +954,13 @@ void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const break; case RSRC_DENIED: ((DSStateMachine *)this)->mRetries = 0; - mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); + mLocAdapter->requestATL(ID, LOC_AGPS_TYPE_SUPL); break; case RSRC_GRANTED: mLocAdapter->atlOpenStatus(ID, 1, NULL, AGPS_APN_BEARER_INVALID, - AGPS_TYPE_INVALID); + LOC_AGPS_TYPE_INVALID); break; default: LOC_LOGW("DSStateMachine :: informStatus - unknown status"); diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h index 58ce0843..ff879f4b 100644 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/loc_api/libloc_api_50001/loc_eng_agps.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -68,7 +67,7 @@ typedef enum { //DS Callback struct typedef struct { LocEngAdapter *mAdapter; - AGpsStatusValue action; + LocAGpsStatusValue action; }dsCbData; // information bundle for subscribers @@ -171,12 +170,12 @@ public: }; class AGpsServicer : public Servicer { - void (*callbackAGps)(AGpsStatus* status); + void (*callbackAGps)(LocAGpsStatus* status); public: int requestRsrc(void *cb_data); AGpsServicer() {} AGpsServicer(void *cb_func) - { callbackAGps = (void(*)(AGpsStatus *))(cb_func); } + { callbackAGps = (void(*)(LocAGpsStatus *))(cb_func); } virtual ~AGpsServicer(){} inline virtual char *whoami() {return (char*)"AGpsServicer";} }; @@ -232,7 +231,7 @@ public: virtual void onRsrcEvent(AgpsRsrcStatus event); // put the data together and send the FW - virtual int sendRsrcRequest(AGpsStatusValue action) const; + virtual int sendRsrcRequest(LocAGpsStatusValue action) const; //if list is empty, linked_list_empty returns 1 //else if list is not empty, returns 0 @@ -260,7 +259,7 @@ public: DSStateMachine(servicerType type, void *cb_func, LocEngAdapter* adapterHandle); - int sendRsrcRequest(AGpsStatusValue action) const; + int sendRsrcRequest(LocAGpsStatusValue action) const; void onRsrcEvent(AgpsRsrcStatus event); void retryCallback(); void informStatus(AgpsRsrcStatus status, int ID) const; diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp index 137f686b..7fbe62ff 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -53,19 +53,19 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; + type = LOC_AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; + type = LOC_AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; + type = LOC_AGPS_TYPE_ANY; break; } default: @@ -149,19 +149,19 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, case IF_REQUEST_TYPE_SUPL: { LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; + type = LOC_AGPS_TYPE_SUPL; break; } case IF_REQUEST_TYPE_WIFI: { LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; + type = LOC_AGPS_TYPE_WIFI; break; } case IF_REQUEST_TYPE_ANY: { LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; + type = LOC_AGPS_TYPE_ANY; break; } default: diff --git a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h index 1c0edd55..f1a51c7a 100644 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -33,8 +33,6 @@ #include //for SSID_BUF_SIZE -#include - #ifndef SSID_BUF_SIZE #define SSID_BUF_SIZE (32+1) #endif diff --git a/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h index 2fa9b425..6f335e6b 100644 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/loc_api/libloc_api_50001/loc_eng_msg.h @@ -30,7 +30,6 @@ #define LOC_ENG_MSG_H -#include #include #include #include @@ -105,11 +104,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GnssSvStatus mSvStatus; + const LocGnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, + LocGnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; @@ -120,9 +119,9 @@ struct LocEngReportSv : public LocMsg { struct LocEngReportStatus : public LocMsg { LocAdapterBase* mAdapter; - const GpsStatusValue mStatus; + const LocGpsStatusValue mStatus; LocEngReportStatus(LocAdapterBase* adapter, - GpsStatusValue engineStatus); + LocGpsStatusValue engineStatus); virtual void proc() const; void locallog() const; virtual void log() const; @@ -254,10 +253,10 @@ struct LocEngRequestTime : public LocMsg { struct LocEngRequestNi : public LocMsg { void* mLocEng; - const GpsNiNotification mNotify; + const LocGpsNiNotification mNotify; const void *mPayload; LocEngRequestNi(void* locEng, - GpsNiNotification ¬if, + LocGpsNiNotification ¬if, const void* data); virtual void proc() const; void locallog() const; @@ -291,9 +290,9 @@ struct LocEngGetZpp : public LocMsg { struct LocEngReportGnssMeasurement : public LocMsg { void* mLocEng; - const GnssData mGnssData; + const LocGnssData mGnssData; LocEngReportGnssMeasurement(void* locEng, - GnssData &gnssData); + LocGnssData &gnssData); virtual void proc() const; void locallog() const; virtual void log() const; diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp index 9b454c66..3a7d8fb4 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ b/loc_api/libloc_api_50001/loc_eng_ni.cpp @@ -62,10 +62,10 @@ static void* ni_thread_proc(void *args); struct LocEngInformNiResponse : public LocMsg { LocEngAdapter* mAdapter; - const GpsUserResponseType mResponse; + const LocGpsUserResponseType mResponse; const void *mPayload; inline LocEngInformNiResponse(LocEngAdapter* adapter, - GpsUserResponseType resp, + LocGpsUserResponseType resp, const void* data) : LocMsg(), mAdapter(adapter), mResponse(resp), mPayload(data) @@ -109,7 +109,7 @@ RETURN VALUE ===========================================================================*/ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, - const GpsNiNotification *notif, + const LocGpsNiNotification *notif, const void* passThrough) { ENTRY_LOG(); @@ -122,7 +122,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, return; } - if (notif->ni_type == GPS_NI_TYPE_EMERGENCY_SUPL) { + if (notif->ni_type == LOC_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); @@ -153,9 +153,9 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, pSession->adapter = loc_eng_data.adapter; /* Fill in notification */ - ((GpsNiNotification*)notif)->notification_id = pSession->reqID; + ((LocGpsNiNotification*)notif)->notification_id = pSession->reqID; - if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) + if (notif->notify_flags == LOC_GPS_NI_PRIVACY_OVERRIDE) { loc_eng_mute_one_session(loc_eng_data); } @@ -188,7 +188,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, } CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id); - loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0); + loc_eng_data.ni_notify_cb((LocGpsNiNotification*)notif, gps_conf.SUPL_ES != 0); } EXIT_LOG(%s, VOID_RET); } @@ -224,7 +224,7 @@ static void* ni_thread_proc(void *args) &expire_time); if (rc == ETIMEDOUT) { - pSession->resp = GPS_NI_RESPONSE_NORESP; + pSession->resp = LOC_GPS_NI_RESPONSE_NORESP; LOC_LOGD("ni_thread_proc-Thread time out after valting for specified time. Ret Val %d\n",rc ); break; } @@ -242,8 +242,8 @@ static void* ni_thread_proc(void *args) LocEngInformNiResponse *msg = NULL; if (NULL != pSession->rawRequest) { - if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); + if (pSession->resp != LOC_GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("pSession->resp != LOC_GPS_NI_RESPONSE_IGNORE \n"); msg = new LocEngInformNiResponse(adapter, pSession->resp, pSession->rawRequest); @@ -369,7 +369,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, - int notif_id, GpsUserResponseType user_response) + int notif_id, LocGpsUserResponseType user_response) { ENTRY_LOG_CALLFLOW(); loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; @@ -384,10 +384,10 @@ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, 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 && + if (user_response == LOC_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.resp = LOC_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); diff --git a/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h index 068f5cdd..afb406fb 100644 --- a/loc_api/libloc_api_50001/loc_eng_ni.h +++ b/loc_api/libloc_api_50001/loc_eng_ni.h @@ -35,7 +35,7 @@ #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ #define LOC_NI_NOTIF_KEY_ADDRESS "Address" -#define GPS_NI_RESPONSE_IGNORE 4 +#define LOC_GPS_NI_RESPONSE_IGNORE 4 typedef struct { pthread_t thread; /* NI thread */ @@ -43,7 +43,7 @@ typedef struct { bool respRecvd; /* NI User reponse received or not from Java layer*/ void* rawRequest; int reqID; /* ID to check against response */ - GpsUserResponseType resp; + LocGpsUserResponseType resp; pthread_cond_t tCond; pthread_mutex_t tLock; LocEngAdapter* adapter; diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 6ab4a5f8..e7138b68 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -39,7 +39,7 @@ typedef struct loc_nmea_sv_meta_s { char talker[3]; - GnssConstellationType svType; + LocGnssConstellationType svType; uint32_t mask; uint32_t svIdOffset; } loc_nmea_sv_meta; @@ -61,7 +61,7 @@ SIDE EFFECTS ===========================================================================*/ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data_p, - loc_nmea_sv_meta& sv_meta, GnssConstellationType svType, bool needCombine) + loc_nmea_sv_meta& sv_meta, LocGnssConstellationType svType, bool needCombine) { if (!loc_eng_data_p) return NULL; @@ -72,17 +72,17 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data switch (svType) { - case GNSS_CONSTELLATION_GPS: + case LOC_GNSS_CONSTELLATION_GPS: sv_meta.talker[1] = 'P'; sv_meta.mask = loc_eng_data_p->gps_used_mask; break; - case GNSS_CONSTELLATION_GLONASS: + case LOC_GNSS_CONSTELLATION_GLONASS: sv_meta.talker[1] = 'L'; sv_meta.mask = loc_eng_data_p->glo_used_mask; // GLONASS SV ids are from 65-96 sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; break; - case GNSS_CONSTELLATION_GALILEO: + case LOC_GNSS_CONSTELLATION_GALILEO: sv_meta.talker[1] = 'A'; sv_meta.mask = loc_eng_data_p->gal_used_mask; break; @@ -251,7 +251,7 @@ uint32_t loc_eng_nmea_generate_GSA(loc_eng_data_s_type *loc_eng_data_p, mask = mask >> 1; } - if (svUsedCount == 0 && GNSS_CONSTELLATION_GPS != sv_meta_p->svType) + if (svUsedCount == 0 && LOC_GNSS_CONSTELLATION_GPS != sv_meta_p->svType) return 0; if (svUsedCount == 0) @@ -345,7 +345,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_GSV(loc_eng_data_s_type *loc_eng_data_p, - const GnssSvStatus &svStatus, + const LocGnssSvStatus &svStatus, char* sentence, int bufSize, loc_nmea_sv_meta* sv_meta_p) @@ -500,7 +500,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, // ------------------- count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, true)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, true)); if (count > 0) { svUsedCount += count; @@ -512,7 +512,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, // ------------------- count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, true)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, true)); if (count > 0) { svUsedCount += count; @@ -524,7 +524,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, // ------------------- count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, true)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, true)); if (count > 0) { svUsedCount += count; @@ -538,7 +538,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) { float magTrack = location.gpsLocation.bearing; if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) @@ -565,7 +565,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) { float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); float speedKmPerHour = location.gpsLocation.speed * 3.6; @@ -585,7 +585,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + if (!(location.gpsLocation.flags & LOC_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 @@ -613,7 +613,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { double latitude = location.gpsLocation.latitude; double longitude = location.gpsLocation.longitude; @@ -662,7 +662,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) { float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); @@ -680,7 +680,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) { length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing); } @@ -738,7 +738,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + if (!(location.gpsLocation.flags & LOC_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 @@ -766,7 +766,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) + if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { double latitude = location.gpsLocation.latitude; double longitude = location.gpsLocation.longitude; @@ -816,7 +816,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, lengthRemaining -= length; char gpsQuality; - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + if (!(location.gpsLocation.flags & LOC_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 @@ -868,7 +868,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker += length; lengthRemaining -= length; - if ((location.gpsLocation.flags & GPS_LOCATION_HAS_ALTITUDE) && + if ((location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ALTITUDE) && (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) { length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", @@ -936,7 +936,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const LocGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -955,29 +955,29 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, loc_eng_data_p->glo_used_mask = 0; loc_eng_data_p->gal_used_mask = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { - if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation) + if (LOC_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)) + if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) { loc_eng_data_p->gps_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); } } - else if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation) + else if (LOC_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)) + if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) { loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); } } - else if (GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation) + else if (LOC_GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation) { // cache the used in fix mask, as it will be needed to send $GAGSA // during the position report - if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX)) + if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) { loc_eng_data_p->gal_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); } @@ -990,21 +990,21 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, // ------------------ loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, false)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, false)); // ------------------ // ------$GLGSV------ // ------------------ loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, false)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, false)); // ------------------ // ------$GAGSV------ // ------------------ loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, false)); + loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, false)); // For RPC, the DOP are sent during sv report, so cache them diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h index 066943aa..9480a6ad 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -30,14 +30,13 @@ #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_sv(loc_eng_data_s_type *loc_eng_data_p, const LocGnssSvStatus &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/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h index 175f497d..41a006f9 100644 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ b/loc_api/libloc_api_50001/loc_eng_xtra.h @@ -30,13 +30,11 @@ #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; + loc_gps_xtra_download_request download_request_cb; report_xtra_server report_xtra_server_cb; // XTRA data buffer diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 2da2fea0..10168610 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include "loc_target.h" #include "loc_log.h" From c85c8ff673e4347cea911b353de120f639b39b83 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 28 Feb 2017 16:45:47 -0800 Subject: [PATCH 444/945] LocationAPI implementation Implementation of LocationAPI into gps hal to be a common API that is called into by platform specific APIs. Change-Id: Ie5a7bd217d4ae2175ad49e6aca2fb6ecd4702f3b CRs-fixed: 1112712 --- Android.mk | 5 + android/Android.mk | 56 + android/GeofenceAPIClient.cpp | 242 ++ .../GeofenceAPIClient.h | 38 +- android/GnssAPIClient.cpp | 765 ++++ android/GnssAPIClient.h | 97 + {loc_api/libloc_api_50001 => android}/gps.c | 6 +- android/loc.cpp | 380 ++ android/loc_geofence.cpp | 91 + core/Android.mk | 6 +- core/ContextBase.cpp | 114 +- core/ContextBase.h | 6 +- core/LocAdapterBase.cpp | 47 +- core/LocAdapterBase.h | 77 +- core/LocAdapterProxyBase.h | 15 +- core/LocApiBase.cpp | 122 +- core/LocApiBase.h | 55 +- core/LocDualContext.cpp | 5 +- core/UlpProxyBase.h | 43 +- core/gps_extended.h | 12 +- core/gps_extended_c.h | 6 +- core/loc_core_log.h | 8 +- gnss/Android.mk | 43 + gnss/GnssAdapter.cpp | 2880 +++++++++++++++ gnss/GnssAdapter.h | 259 ++ gnss/location_gnss.cpp | 206 ++ loc_api/Android.mk | 17 - loc_api/Makefile.am | 120 - 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 ------ loc_api/libloc_api_50001/Android.mk | 116 - loc_api/libloc_api_50001/LocEngAdapter.cpp | 606 ---- loc_api/libloc_api_50001/LocEngAdapter.h | 380 -- loc_api/libloc_api_50001/Makefile.am | 62 - loc_api/libloc_api_50001/gps_converter.cpp | 255 -- loc_api/libloc_api_50001/gps_converter.h | 69 - loc_api/libloc_api_50001/gps_interface.cpp | 1196 ------- loc_api/libloc_api_50001/loc.cpp | 1119 ------ loc_api/libloc_api_50001/loc.h | 66 - loc_api/libloc_api_50001/loc_eng.cpp | 3125 ----------------- loc_api/libloc_api_50001/loc_eng.h | 211 -- loc_api/libloc_api_50001/loc_eng_agps.cpp | 969 ----- loc_api/libloc_api_50001/loc_eng_agps.h | 434 --- loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp | 269 -- loc_api/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 | 104 - .../loc_eng_dmn_conn_thread_helper.c | 398 --- .../loc_eng_dmn_conn_thread_helper.h | 74 - loc_api/libloc_api_50001/loc_eng_log.cpp | 35 - loc_api/libloc_api_50001/loc_eng_msg.h | 305 -- loc_api/libloc_api_50001/loc_eng_ni.cpp | 413 --- loc_api/libloc_api_50001/loc_eng_ni.h | 59 - loc_api/libloc_api_50001/loc_eng_nmea.cpp | 1027 ------ loc_api/libloc_api_50001/loc_eng_nmea.h | 42 - loc_api/libloc_api_50001/loc_eng_xtra.cpp | 219 -- loc_api/libloc_api_50001/loc_eng_xtra.h | 45 - location/Android.mk | 41 + location/LocationAPI.cpp | 675 ++++ location/LocationAPI.h | 866 +++++ location/LocationAPIClientBase.cpp | 769 ++++ location/LocationAPIClientBase.h | 457 +++ location/location_interface.h | 86 + utils/MsgTask.cpp | 3 +- utils/linked_list.c | 5 +- utils/msg_q.c | 4 +- 99 files changed, 8279 insertions(+), 22675 deletions(-) create mode 100644 Android.mk create mode 100644 android/Android.mk create mode 100644 android/GeofenceAPIClient.cpp rename loc_api/libloc_api_50001/loc_eng_log.h => android/GeofenceAPIClient.h (52%) create mode 100644 android/GnssAPIClient.cpp create mode 100644 android/GnssAPIClient.h rename {loc_api/libloc_api_50001 => android}/gps.c (94%) create mode 100644 android/loc.cpp create mode 100644 android/loc_geofence.cpp create mode 100644 gnss/Android.mk create mode 100644 gnss/GnssAdapter.cpp create mode 100644 gnss/GnssAdapter.h create mode 100644 gnss/location_gnss.cpp delete mode 100644 loc_api/Android.mk delete mode 100644 loc_api/Makefile.am delete mode 100644 loc_api/libloc_api-rpc-50001/Android.mk delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr delete mode 100644 loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr delete mode 100644 loc_api/libloc_api_50001/Android.mk delete mode 100644 loc_api/libloc_api_50001/LocEngAdapter.cpp delete mode 100644 loc_api/libloc_api_50001/LocEngAdapter.h delete mode 100644 loc_api/libloc_api_50001/Makefile.am delete mode 100644 loc_api/libloc_api_50001/gps_converter.cpp delete mode 100644 loc_api/libloc_api_50001/gps_converter.h delete mode 100644 loc_api/libloc_api_50001/gps_interface.cpp delete mode 100644 loc_api/libloc_api_50001/loc.cpp delete mode 100644 loc_api/libloc_api_50001/loc.h delete mode 100644 loc_api/libloc_api_50001/loc_eng.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_agps.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_agps.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c delete mode 100644 loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_log.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_msg.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_ni.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_ni.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_nmea.h delete mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.cpp delete mode 100644 loc_api/libloc_api_50001/loc_eng_xtra.h create mode 100644 location/Android.mk create mode 100644 location/LocationAPI.cpp create mode 100644 location/LocationAPI.h create mode 100644 location/LocationAPIClientBase.cpp create mode 100644 location/LocationAPIClientBase.h create mode 100644 location/location_interface.h diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..e2c5a56f --- /dev/null +++ b/Android.mk @@ -0,0 +1,5 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +LOCAL_PATH := $(call my-dir) + +include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/android/Android.mk b/android/Android.mk new file mode 100644 index 00000000..d36b4712 --- /dev/null +++ b/android/Android.mk @@ -0,0 +1,56 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE_OWNER := qti + +LOCAL_MODULE_TAGS := optional + +## Libs + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + liblog \ + libloc_core \ + libgps.utils \ + libdl \ + libloc_pla \ + liblocation_api \ + +LOCAL_SRC_FILES += \ + gps.c \ + loc.cpp \ + loc_geofence.cpp \ + GnssAPIClient.cpp \ + GeofenceAPIClient.cpp \ + +LOCAL_CFLAGS += \ + -Wunused-parameter \ + -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)/libloc_pla \ + $(TARGET_OUT_HEADERS)/liblocation_api \ + +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_RELATIVE_PATH := hw + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/android/GeofenceAPIClient.cpp b/android/GeofenceAPIClient.cpp new file mode 100644 index 00000000..aeb4fd5e --- /dev/null +++ b/android/GeofenceAPIClient.cpp @@ -0,0 +1,242 @@ +/* Copyright (c) 2017, 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_GeofenceApiClient" + +#include +#include + +#include "GeofenceAPIClient.h" + +static void convertGpsLocation(Location& in, GpsLocation& out) +{ + memset(&out, 0, sizeof(GpsLocation)); + out.size = sizeof(GpsLocation); + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) + out.flags |= GPS_LOCATION_HAS_LAT_LONG; + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) + out.flags |= GPS_LOCATION_HAS_ALTITUDE; + if (in.flags & LOCATION_HAS_SPEED_BIT) + out.flags |= GPS_LOCATION_HAS_SPEED; + if (in.flags & LOCATION_HAS_BEARING_BIT) + out.flags |= GPS_LOCATION_HAS_BEARING; + if (in.flags & LOCATION_HAS_ACCURACY_BIT) + out.flags |= GPS_LOCATION_HAS_ACCURACY; + out.latitude = in.latitude; + out.longitude = in.longitude; + out.altitude = in.altitude; + out.speed = in.speed; + out.bearing = in.bearing; + out.accuracy = in.accuracy; + out.timestamp = (GpsUtcTime)in.timestamp; +} + +GeofenceAPIClient::GeofenceAPIClient(GpsGeofenceCallbacks* cbs) : + LocationAPIClientBase(), + mGpsGeofenceCallbacks(cbs) +{ + LOC_LOGD("%s]: (%p)", __func__, cbs); + + LocationCallbacks locationCallbacks; + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + + locationCallbacks.geofenceBreachCb = nullptr; + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_transition_callback) { + locationCallbacks.geofenceBreachCb = + [this](GeofenceBreachNotification geofenceBreachNotification) { + onGeofenceBreachCb(geofenceBreachNotification); + }; + } + + locationCallbacks.geofenceStatusCb = nullptr; + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_status_callback) { + locationCallbacks.geofenceStatusCb = + [this](GeofenceStatusNotification geofenceStatusNotification) { + onGeofenceStatusCb(geofenceStatusNotification); + }; + } + + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms) +{ + LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __func__, + geofence_id, latitude, longitude, radius_meters, + last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms); + + GeofenceOption options; + memset(&options, 0, sizeof(GeofenceOption)); + options.size = sizeof(GeofenceOption); + if (monitor_transitions & GPS_GEOFENCE_ENTERED) + options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & GPS_GEOFENCE_EXITED) + options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT; + options.responsiveness = notification_responsiveness_ms; + + GeofenceInfo data; + data.size = sizeof(GeofenceInfo); + data.latitude = latitude; + data.longitude = longitude; + data.radius = radius_meters; + + locAPIAddGeofences(1, &geofence_id, &options, &data); +} + +void GeofenceAPIClient::geofencePause(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __func__, geofence_id); + locAPIPauseGeofences(1, &geofence_id); +} + +void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int monitor_transitions) +{ + LOC_LOGD("%s]: (%d %d)", __func__, geofence_id, monitor_transitions); + GeofenceBreachTypeMask mask = 0; + if (monitor_transitions & GPS_GEOFENCE_ENTERED) + mask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & GPS_GEOFENCE_EXITED) + mask |= GEOFENCE_BREACH_EXIT_BIT; + locAPIResumeGeofences(1, &geofence_id, &mask); +} + +void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __func__, geofence_id); + locAPIRemoveGeofences(1, &geofence_id); +} + +// callbacks +void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) +{ + LOC_LOGD("%s]: (%zu)", __func__, geofenceBreachNotification.count); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_transition_callback) { + for (size_t i = 0; i < geofenceBreachNotification.count; i++) { + GpsLocation location; + convertGpsLocation(geofenceBreachNotification.location, location); + + uint32_t transition; + if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER) + transition = GPS_GEOFENCE_ENTERED; + else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT) + transition = GPS_GEOFENCE_EXITED; + else { + // continue with other breach if transition is + // nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED + continue; + } + GpsUtcTime time = geofenceBreachNotification.timestamp; + + mGpsGeofenceCallbacks->geofence_transition_callback(geofenceBreachNotification.ids[i], + &location, transition, time); + } + } +} + +void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) +{ + LOC_LOGD("%s]: (%d)", __func__, geofenceStatusNotification.available); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_status_callback) { + int32_t status = GPS_GEOFENCE_UNAVAILABLE; + if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) { + status = GPS_GEOFENCE_AVAILABLE; + } + mGpsGeofenceCallbacks->geofence_status_callback(status, nullptr); + } +} + +void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __func__, count); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_add_callback) { + for (size_t i = 0; i < count; i++) { + int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = GPS_GEOFENCE_OPERATION_SUCCESS; + mGpsGeofenceCallbacks->geofence_add_callback(ids[i], status); + } + } +} + +void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __func__, count); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_remove_callback) { + for (size_t i = 0; i < count; i++) { + int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = GPS_GEOFENCE_OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; + mGpsGeofenceCallbacks->geofence_remove_callback(ids[i], status); + } + } +} + +void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __func__, count); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_pause_callback) { + for (size_t i = 0; i < count; i++) { + int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = GPS_GEOFENCE_OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; + mGpsGeofenceCallbacks->geofence_pause_callback(ids[i], status); + } + } +} + +void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __func__, count); + if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_resume_callback) { + for (size_t i = 0; i < count; i++) { + int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = GPS_GEOFENCE_OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; + mGpsGeofenceCallbacks->geofence_resume_callback(ids[i], status); + } + } +} diff --git a/loc_api/libloc_api_50001/loc_eng_log.h b/android/GeofenceAPIClient.h similarity index 52% rename from loc_api/libloc_api_50001/loc_eng_log.h rename to android/GeofenceAPIClient.h index a68bd847..e99d6ba2 100644 --- a/loc_api/libloc_api_50001/loc_eng_log.h +++ b/android/GeofenceAPIClient.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 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 @@ -27,18 +27,34 @@ * */ -#ifndef LOC_ENG_LOG_H -#define LOC_ENG_LOG_H +#ifndef GEOFENCE_API_CLINET_H +#define GEOFENCE_API_CLINET_H -#ifdef __cplusplus -extern "C" +#include +#include + +class GeofenceAPIClient : public LocationAPIClientBase { -#endif +public: + GeofenceAPIClient(GpsGeofenceCallbacks* cbs); + virtual ~GeofenceAPIClient() = default; -#include + void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); + void geofencePause(uint32_t geofence_id); + void geofenceResume(uint32_t geofence_id, int monitor_transitions); + void geofenceRemove(uint32_t geofence_id); -#ifdef __cplusplus -} -#endif + // callbacks + void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final; + void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final; + void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; -#endif /* LOC_ENG_LOG_H */ +private: + GpsGeofenceCallbacks* mGpsGeofenceCallbacks; +}; +#endif // GEOFENCE_API_CLINET_H diff --git a/android/GnssAPIClient.cpp b/android/GnssAPIClient.cpp new file mode 100644 index 00000000..915a82e7 --- /dev/null +++ b/android/GnssAPIClient.cpp @@ -0,0 +1,765 @@ +/* Copyright (c) 2017, 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_GnssAPIClient" + +#include +#include + +#include "GnssAPIClient.h" + +static void convertGpsLocation(Location& in, GpsLocation& out); +static void convertGpsSvStatus(GnssSvNotification& in, GpsSvStatus& out); +static void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out); +static void convertGnssSvStatus(GnssSvNotification& in, GnssSvStatus& out); +static void convertGpsMeasurement(GnssMeasurementsData& in, GpsMeasurement& out); +static void convertGpsClock(GnssMeasurementsClock& in, GpsClock& out); +static void convertGpsData(GnssMeasurementsNotification& in, GpsData& out); +static void convertGnssClock(GnssMeasurementsClock& in, GnssClock& out); +static void convertGnssData(GnssMeasurementsNotification& in, GnssData& out); + +GnssAPIClient::GnssAPIClient(GpsCallbacks* gpsCb, + GpsNiCallbacks* niCb, + GpsMeasurementCallbacks* measurementCb) : + LocationAPIClientBase(), + mGpsCallbacks(nullptr), + mGpsNiCallbacks(nullptr), + mLocationCapabilitiesMask(0), + mGpsMeasurementCallbacks(nullptr) +{ + LOC_LOGD("%s]: (%p %p %p)", __func__, gpsCb, niCb, measurementCb); + pthread_mutex_init(&mLock, nullptr); + + // set default LocationOptions. + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = 1000; + mLocationOptions.minDistance = 0; + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + + gnssUpdateCallbacks(gpsCb, niCb, measurementCb); +} + +GnssAPIClient::~GnssAPIClient() +{ + LOC_LOGD("%s]: ()", __func__); + pthread_mutex_destroy(&mLock); +} + +// for GpsInterface +void GnssAPIClient::gnssUpdateCallbacks(GpsCallbacks* gpsCb, + GpsNiCallbacks* niCb, + GpsMeasurementCallbacks* measurementCb) +{ + LOC_LOGD("%s]: (%p %p %p)", __func__, gpsCb, niCb, measurementCb); + + mGpsCallbacks = gpsCb; + mGpsNiCallbacks = niCb; + mGpsMeasurementCallbacks = measurementCb; + + LocationCallbacks locationCallbacks; + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + if (mGpsCallbacks && mGpsCallbacks->location_cb) { + locationCallbacks.trackingCb = [this](Location location) { + onTrackingCb(location); + }; + } + + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + + locationCallbacks.gnssNiCb = nullptr; + if (mGpsNiCallbacks && mGpsNiCallbacks->notify_cb) { + locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { + onGnssNiCb(id, gnssNiNotification); + }; + } + + locationCallbacks.gnssSvCb = nullptr; + if (mGpsCallbacks && mGpsCallbacks->sv_status_cb) { + locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { + onGnssSvCb(gnssSvNotification); + }; + } + + locationCallbacks.gnssNmeaCb = nullptr; + if (mGpsCallbacks && mGpsCallbacks->nmea_cb) { + locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { + onGnssNmeaCb(gnssNmeaNotification); + }; + } + + locationCallbacks.gnssMeasurementsCb = nullptr; + if (mGpsMeasurementCallbacks && + (mGpsMeasurementCallbacks->measurement_callback || + mGpsMeasurementCallbacks->gnss_measurement_callback)) { + locationCallbacks.gnssMeasurementsCb = + [this](GnssMeasurementsNotification gnssMeasurementsNotification) { + onGnssMeasurementsCb(gnssMeasurementsNotification); + }; + } + + locAPISetCallbacks(locationCallbacks); +} + +int GnssAPIClient::gnssStart() +{ + LOC_LOGD("%s]: ()", __func__); + int retVal = 0; + locAPIStartTracking(mLocationOptions); + return retVal; +} + +int GnssAPIClient::gnssStop() +{ + LOC_LOGD("%s]: ()", __func__); + int retVal = 0; + locAPIStopTracking(); + return retVal; +} + +void GnssAPIClient::gnssDeleteAidingData(GpsAidingData f) +{ + LOC_LOGD("%s]: (%02x)", __func__, f); + GnssAidingData data; + memset(&data, 0, sizeof (GnssAidingData)); + data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS | + GNSS_AIDING_DATA_SV_TYPE_GLONASS | + GNSS_AIDING_DATA_SV_TYPE_QZSS | + GNSS_AIDING_DATA_SV_TYPE_BEIDOU | + GNSS_AIDING_DATA_SV_TYPE_GALILEO; + + if (f == GPS_DELETE_ALL) + data.deleteAll = true; + else { + if (f & GPS_DELETE_EPHEMERIS) data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS; + if (f & GPS_DELETE_ALMANAC) data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC; + if (f & GPS_DELETE_POSITION) data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION; + if (f & GPS_DELETE_TIME) data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME; + if (f & GPS_DELETE_IONO) data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE; + if (f & GPS_DELETE_UTC) data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC; + if (f & GPS_DELETE_HEALTH) data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH; + if (f & GPS_DELETE_SVDIR) data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION; + if (f & GPS_DELETE_SVSTEER) data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER; + if (f & GPS_DELETE_SADATA) data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA; + if (f & GPS_DELETE_RTI) data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI; + if (f & GPS_DELETE_CELLDB_INFO) data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB; + } + locAPIGnssDeleteAidingData(data); +} + +int GnssAPIClient::gnssSetPositionMode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) +{ + LOC_LOGD("%s]: (%d %d %d %d %d)", __func__, + mode, recurrence, min_interval, preferred_accuracy, preferred_time); + int retVal = 0; + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = min_interval; + mLocationOptions.minDistance = preferred_accuracy; + if (mode == GPS_POSITION_MODE_STANDALONE) + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + else if (mode == GPS_POSITION_MODE_MS_BASED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mode == GPS_POSITION_MODE_MS_ASSISTED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + return retVal; +} + +// for AGpsInterface +void GnssAPIClient::gnssAgnssSetServer(AGpsType type, const char *hostname, int port) +{ + LOC_LOGD("%s]: (%d %s %d)", __func__, type, hostname, port); + GnssConfig data; + memset(&data, 0, sizeof(GnssConfig)); + data.size = sizeof(GnssConfig); + data.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + + memset(&data.assistanceServer, 0, sizeof(GnssConfigSetAssistanceServer)); + data.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + if (type == AGPS_TYPE_SUPL) + data.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL; + else if (type == AGPS_TYPE_C2K) + data.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K; + data.assistanceServer.hostName = hostname; + data.assistanceServer.port = port; + + locAPIGnssUpdateConfig(data); +} + +// for GpsNiInterface +void GnssAPIClient::gnssNiRespond(int notif_id, GpsUserResponseType user_response) +{ + LOC_LOGD("%s]: (%d %d)", __func__, notif_id, user_response); + GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; + if (user_response == GPS_NI_RESPONSE_ACCEPT) data = GNSS_NI_RESPONSE_ACCEPT; + else if (user_response == GPS_NI_RESPONSE_DENY) data = GNSS_NI_RESPONSE_DENY; + else if (user_response == GPS_NI_RESPONSE_NORESP) data = GNSS_NI_RESPONSE_NO_RESPONSE; + locAPIGnssNiResponse(notif_id, data); +} + +// for GpsMeasurementInterface +void GnssAPIClient::gnssMeasurementClose() { + LOC_LOGD("%s]: ()", __func__); + pthread_mutex_lock(&mLock); + mGpsMeasurementCallbacks = nullptr; + pthread_mutex_unlock(&mLock); +} + +// for GnssConfigurationInterface +void GnssAPIClient::gnssConfigurationUpdate(const char* config_data, int32_t length) +{ + LOC_LOGD("%s]: (%s %d)", __func__, config_data, length); + int n = 10; + uint8_t flags[n]; + memset(&flags, 0, sizeof(uint8_t) * n); + + GnssConfig data; + memset(&data, 0, sizeof(GnssConfig)); + data.size = sizeof(GnssConfig); + + const loc_param_s_type gnssConfTable[] = + { + {"GPS_LOCK", &data.gpsLock, flags+0, 'n'}, + {"SUPL_VER", &data.suplVersion, flags+1, 'n'}, + //{"ASSISTANCE_SERVER", &data.assistanceServer, nullptr, 's'}, + {"LPP_PROFILE", &data.lppProfile, flags+3, 'n'}, + {"LPPE_CP_TECHNOLOGY", &data.lppeControlPlaneMask, flags+4, 'n'}, + {"LPPE_UP_TECHNOLOGY", &data.lppeUserPlaneMask, flags+5, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &data.aGlonassPositionProtocolMask, flags+6, 'n'}, + {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL",&data.emergencyPdnForEmergencySupl, flags+7, 'n'}, + {"SUPL_ES", &data.suplEmergencyServices, flags+8, 'n'}, + {"SUPL_MODE", &data.suplModeMask, flags+9, 'n'}, + }; + UTIL_UPDATE_CONF(config_data, length, gnssConfTable); + + for (int i = 0; i < n; i++) { + if (flags[i] != 0) + data.flags |= (0x1 << i); + } + locAPIGnssUpdateConfig(data); +} + +// callbacks +void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __func__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; + if (mGpsCallbacks && mGpsCallbacks->set_capabilities_cb) { + uint32_t data = 0; + if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) + data |= GPS_CAPABILITY_SCHEDULING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) + data |= GPS_CAPABILITY_GEOFENCING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) + data |= GPS_CAPABILITY_MEASUREMENTS; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + data |= GPS_CAPABILITY_MSB; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + data |= GPS_CAPABILITY_MSA; + mGpsCallbacks->set_capabilities_cb(data); + } + if (mGpsCallbacks && mGpsCallbacks->set_system_info_cb) { + GnssSystemInfo info; + info.size = sizeof(GnssSystemInfo); + info.year_of_hw = 2015; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + info.year_of_hw = 2017; + } + LOC_LOGV("%s:%d] set_system_info_cb (%d)", __func__, __LINE__, info.year_of_hw); + mGpsCallbacks->set_system_info_cb(&info); + } +} + +void GnssAPIClient::onTrackingCb(Location location) +{ + LOC_LOGD("%s]: (flags: %02x)", __func__, location.flags); + if (mGpsCallbacks && mGpsCallbacks->location_cb) { + GpsLocation data; + convertGpsLocation(location, data); + mGpsCallbacks->location_cb(&data); + } +} + +void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) +{ + LOC_LOGD("%s]: (id: %d)", __func__, id); + if (mGpsNiCallbacks && mGpsNiCallbacks->notify_cb) { + GpsNiNotification data; + memset(&data, 0, sizeof(GpsNiNotification)); + data.size = sizeof(GpsNiNotification); + data.notification_id = id; + + if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE) + data.ni_type = GPS_NI_TYPE_VOICE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL) + data.ni_type = GPS_NI_TYPE_UMTS_SUPL; + else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) + data.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + // GNSS_NI_TYPE_EMERGENCY_SUPL not supported + + if (gnssNiNotification.options == GNSS_NI_OPTIONS_NOTIFICATION) + data.notify_flags = GPS_NI_NEED_NOTIFY; + else if (gnssNiNotification.options == GNSS_NI_OPTIONS_VERIFICATION) + data.notify_flags = GPS_NI_NEED_VERIFY; + else if (gnssNiNotification.options == GNSS_NI_OPTIONS_PRIVACY_OVERRIDE) + data.notify_flags = GPS_NI_PRIVACY_OVERRIDE; + + data.timeout = gnssNiNotification.timeout; + if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT) + data.default_response = GPS_NI_RESPONSE_ACCEPT; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY) + data.default_response = GPS_NI_RESPONSE_DENY; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE || + gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE) + data.default_response = GPS_NI_RESPONSE_NORESP; + + int len = GPS_NI_SHORT_STRING_MAXLEN < GNSS_NI_REQUESTOR_MAX + ? GPS_NI_SHORT_STRING_MAXLEN : GNSS_NI_REQUESTOR_MAX; + memcpy(data.requestor_id, gnssNiNotification.requestor, len); + + len = GPS_NI_LONG_STRING_MAXLEN < GNSS_NI_MESSAGE_ID_MAX + ? GPS_NI_LONG_STRING_MAXLEN : GNSS_NI_MESSAGE_ID_MAX; + memcpy(data.text, gnssNiNotification.message, len); + + if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE) + data.requestor_id_encoding = GPS_ENC_NONE; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + data.requestor_id_encoding = GPS_ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + data.requestor_id_encoding = GPS_ENC_SUPL_UTF8; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + data.requestor_id_encoding = GPS_ENC_SUPL_UCS2; + + if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE) + data.text_encoding = GPS_ENC_NONE; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + data.text_encoding = GPS_ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + data.text_encoding = GPS_ENC_SUPL_UTF8; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + data.text_encoding = GPS_ENC_SUPL_UCS2; + data.text_encoding = gnssNiNotification.messageEncoding; + + memcpy(data.extras, gnssNiNotification.extras, len); + + mGpsNiCallbacks->notify_cb(&data); + } +} + +void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __func__, gnssSvNotification.count); + if (mGpsCallbacks && mGpsCallbacks->sv_status_cb) { + GpsSvStatus data; + convertGpsSvStatus(gnssSvNotification, data); + mGpsCallbacks->sv_status_cb(&data); + } + if (mGpsCallbacks && mGpsCallbacks->gnss_sv_status_cb) { + GnssSvStatus data; + convertGnssSvStatus(gnssSvNotification, data); + mGpsCallbacks->gnss_sv_status_cb(&data); + } +} + +void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) +{ + if (mGpsCallbacks && mGpsCallbacks->nmea_cb) { + mGpsCallbacks->nmea_cb((GpsUtcTime)gnssNmeaNotification.timestamp, + gnssNmeaNotification.nmea, gnssNmeaNotification.length); + } +} + +void GnssAPIClient::onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __func__, gnssMeasurementsNotification.count); + // we don't need to lock the mutext + // if mGpsMeasurementCallbacks is set to nullptr + if (mGpsMeasurementCallbacks) { + pthread_mutex_lock(&mLock); + if (mGpsMeasurementCallbacks) { + if (mGpsMeasurementCallbacks->measurement_callback) { + GpsData data; + convertGpsData(gnssMeasurementsNotification, data); + mGpsMeasurementCallbacks->measurement_callback(&data); + } + if (mGpsMeasurementCallbacks->gnss_measurement_callback) { + GnssData data; + convertGnssData(gnssMeasurementsNotification, data); + mGpsMeasurementCallbacks->gnss_measurement_callback(&data); + } + } + pthread_mutex_unlock(&mLock); + } +} + +void GnssAPIClient::onStartTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __func__, error); + if (error == LOCATION_ERROR_SUCCESS && mGpsCallbacks && mGpsCallbacks->status_cb) { + GpsStatus data; + data.size = sizeof(GpsStatus); + data.status = GPS_STATUS_ENGINE_ON; + mGpsCallbacks->status_cb(&data); + data.status = GPS_STATUS_SESSION_BEGIN; + mGpsCallbacks->status_cb(&data); + } +} + +void GnssAPIClient::onStopTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __func__, error); + if (error == LOCATION_ERROR_SUCCESS && mGpsCallbacks && mGpsCallbacks->status_cb) { + GpsStatus data; + data.size = sizeof(GpsStatus); + data.status = GPS_STATUS_SESSION_END; + mGpsCallbacks->status_cb(&data); + data.status = GPS_STATUS_ENGINE_OFF; + mGpsCallbacks->status_cb(&data); + } +} + +static void convertGpsLocation(Location& in, GpsLocation& out) +{ + memset(&out, 0, sizeof(GpsLocation)); + out.size = sizeof(GpsLocation); + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) + out.flags |= GPS_LOCATION_HAS_LAT_LONG; + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) + out.flags |= GPS_LOCATION_HAS_ALTITUDE; + if (in.flags & LOCATION_HAS_SPEED_BIT) + out.flags |= GPS_LOCATION_HAS_SPEED; + if (in.flags & LOCATION_HAS_BEARING_BIT) + out.flags |= GPS_LOCATION_HAS_BEARING; + if (in.flags & LOCATION_HAS_ACCURACY_BIT) + out.flags |= GPS_LOCATION_HAS_ACCURACY; + out.latitude = in.latitude; + out.longitude = in.longitude; + out.altitude = in.altitude; + out.speed = in.speed; + out.bearing = in.bearing; + out.accuracy = in.accuracy; + out.timestamp = (GpsUtcTime)in.timestamp; +} + +static void convertGpsSvStatus(GnssSvNotification& in, GpsSvStatus& out) +{ + memset(&out, 0, sizeof(GpsSvStatus)); + out.size = sizeof(GpsSvStatus); + out.num_svs = in.count; + int len = GPS_MAX_SVS < GNSS_SV_MAX ? GPS_MAX_SVS : GNSS_SV_MAX; + for (int i = 0; i < len; i++) { + GpsSvInfo& info = out.sv_list[i]; + info.size = sizeof(GpsSvInfo); + info.prn = in.gnssSvs[i].svId; + info.snr = in.gnssSvs[i].cN0Dbhz; + info.elevation = in.gnssSvs[i].elevation; + info.azimuth = in.gnssSvs[i].azimuth; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + out.ephemeris_mask |= 0x1 < i; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + out.almanac_mask |= 0x1 < i; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + out.used_in_fix_mask |= 0x1 < i; + } +} + +static void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) +{ + switch(in) { + case GNSS_SV_TYPE_GPS: + out = GNSS_CONSTELLATION_GPS; + break; + case GNSS_SV_TYPE_SBAS: + out = GNSS_CONSTELLATION_SBAS; + break; + case GNSS_SV_TYPE_GLONASS: + out = GNSS_CONSTELLATION_GLONASS; + break; + case GNSS_SV_TYPE_QZSS: + out = GNSS_CONSTELLATION_QZSS; + break; + case GNSS_SV_TYPE_BEIDOU: + out = GNSS_CONSTELLATION_BEIDOU; + break; + case GNSS_SV_TYPE_GALILEO: + out = GNSS_CONSTELLATION_GALILEO; + break; + default: + out = GNSS_CONSTELLATION_UNKNOWN; + break; + } +} + +static void convertGnssSvStatus(GnssSvNotification& in, GnssSvStatus& out) +{ + memset(&out, 0, sizeof(GnssSvStatus)); + out.size = sizeof(GnssSvStatus); + out.num_svs = in.count; + int len = GNSS_MAX_SVS < GNSS_SV_MAX ? GNSS_MAX_SVS : GNSS_SV_MAX; + for (int i = 0; i < len; i++) { + GnssSvInfo& info = out.gnss_sv_list[i]; + info.size = sizeof(GnssSvInfo); + info.svid = in.gnssSvs[i].svId; + convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); + info.c_n0_dbhz = in.gnssSvs[i].cN0Dbhz; + info.elevation = in.gnssSvs[i].elevation; + info.azimuth = in.gnssSvs[i].azimuth; + info.flags = GNSS_SV_FLAGS_NONE; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + info.flags |= GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + info.flags |= GNSS_SV_FLAGS_HAS_ALMANAC_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + info.flags |= GNSS_SV_FLAGS_USED_IN_FIX; + } +} + +static void convertGpsMeasurement(GnssMeasurementsData& in, GpsMeasurement& out) +{ + memset(&out, 0, sizeof(GpsMeasurement)); + out.size = sizeof(GpsMeasurement); + if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) + out.flags |= GPS_MEASUREMENT_HAS_SNR; + if (in.flags & GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_BIT) + out.flags |= GPS_MEASUREMENT_HAS_PSEUDORANGE; + if (in.flags & GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_UNCERTAINTY_BIT) + out.flags |= GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) + out.flags |= GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) + out.flags |= GPS_MEASUREMENT_HAS_CARRIER_CYCLES; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) + out.flags |= GPS_MEASUREMENT_HAS_CARRIER_PHASE; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) + out.flags |= GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY; + out.prn = in.svId; + out.time_offset_ns = in.timeOffsetNs; + out.state = GNSS_MEASUREMENT_STATE_UNKNOWN; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.state |= GPS_MEASUREMENT_STATE_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.state |= GPS_MEASUREMENT_STATE_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.state |= GPS_MEASUREMENT_STATE_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.state |= GPS_MEASUREMENT_STATE_TOW_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.state |= GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS; + out.received_gps_tow_ns = in.receivedSvTimeNs; + out.received_gps_tow_uncertainty_ns = in.receivedSvTimeUncertaintyNs; + out.c_n0_dbhz = in.carrierToNoiseDbHz; + out.pseudorange_rate_mps = in.pseudorangeRateMps; + out.pseudorange_rate_uncertainty_mps = in.pseudorangeRateUncertaintyMps; + out.accumulated_delta_range_state = GNSS_ADR_STATE_UNKNOWN; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.accumulated_delta_range_state |= GPS_ADR_STATE_VALID; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.accumulated_delta_range_state |= GPS_ADR_STATE_RESET; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.accumulated_delta_range_state |= GPS_ADR_STATE_CYCLE_SLIP; + out.accumulated_delta_range_m = in.adrMeters; + out.accumulated_delta_range_uncertainty_m = in.adrUncertaintyMeters; + out.carrier_frequency_hz = in.carrierFrequencyHz; + out.carrier_cycles = in.carrierCycles; + out.carrier_phase = in.carrierPhase; + out.carrier_phase_uncertainty = in.carrierPhaseUncertainty; + out.loss_of_lock = GPS_LOSS_OF_LOCK_UNKNOWN; + out.multipath_indicator = GPS_MULTIPATH_INDICATOR_UNKNOWN; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) + out.multipath_indicator |= GPS_MULTIPATH_INDICATOR_DETECTED; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) + out.multipath_indicator |= GPS_MULTIPATH_INDICATOR_NOT_USED; + out.snr_db = in.signalToNoiseRatioDb; +} + +static void convertGpsClock(GnssMeasurementsClock& in, GpsClock& out) +{ + memset(&out, 0, sizeof(GpsClock)); + out.size = sizeof(GpsClock); + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) + out.flags |= GPS_CLOCK_HAS_LEAP_SECOND; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) + out.flags |= GPS_CLOCK_HAS_TIME_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) + out.flags |= GPS_CLOCK_HAS_FULL_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) + out.flags |= GPS_CLOCK_HAS_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) + out.flags |= GPS_CLOCK_HAS_BIAS_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) + out.flags |= GPS_CLOCK_HAS_DRIFT; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) + out.flags |= GPS_CLOCK_HAS_DRIFT_UNCERTAINTY; + out.leap_second = in.leapSecond; + out.type = GPS_CLOCK_TYPE_UNKNOWN; + out.time_ns = in.timeNs; + out.time_uncertainty_ns = in.timeUncertaintyNs; + out.full_bias_ns = in.fullBiasNs; + out.bias_ns = in.biasNs; + out.bias_uncertainty_ns = in.biasUncertaintyNs; + out.drift_nsps = in.driftNsps; + out.drift_uncertainty_nsps = in.driftUncertaintyNsps; +} + +static void convertGpsData(GnssMeasurementsNotification& in, GpsData& out) +{ + memset(&out, 0, sizeof(GpsData)); + out.size = sizeof(GpsData); + out.measurement_count = in.count; + int len = GPS_MAX_MEASUREMENT < GNSS_MEASUREMENTS_MAX + ? GPS_MAX_MEASUREMENT : GNSS_MEASUREMENTS_MAX; + for (int i = 0; i < len; i++) { + convertGpsMeasurement(in.measurements[i], out.measurements[i]); + } + convertGpsClock(in.clock, out.clock); +} + +static void convertGnssMeasurement(GnssMeasurementsData& in, GnssMeasurement& out) +{ + memset(&out, 0, sizeof(GnssMeasurement)); + out.size = sizeof(GnssMeasurement); + if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) + out.flags |= GNSS_MEASUREMENT_HAS_SNR; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) + out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) + out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_CYCLES; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) + out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_PHASE; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) + out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY; + out.svid = in.svId; + convertGnssConstellationType(in.svType, out.constellation); + out.time_offset_ns = in.timeOffsetNs; + out.state = GNSS_MEASUREMENT_STATE_UNKNOWN; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.state |= GNSS_MEASUREMENT_STATE_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.state |= GNSS_MEASUREMENT_STATE_TOW_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.state |= GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_SYMBOL_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) + out.state |= GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) + out.state |= GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) + out.state |= GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) + out.state |= GNSS_MEASUREMENT_STATE_SBAS_SYNC; + out.received_sv_time_in_ns = in.receivedSvTimeNs; + out.received_sv_time_uncertainty_in_ns = in.receivedSvTimeUncertaintyNs; + out.c_n0_dbhz = in.carrierToNoiseDbHz; + out.pseudorange_rate_mps = in.pseudorangeRateMps; + out.pseudorange_rate_uncertainty_mps = in.pseudorangeRateUncertaintyMps; + out.accumulated_delta_range_state = GNSS_ADR_STATE_UNKNOWN; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.accumulated_delta_range_state |= GNSS_ADR_STATE_VALID; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.accumulated_delta_range_state |= GNSS_ADR_STATE_RESET; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.accumulated_delta_range_state |= GNSS_ADR_STATE_CYCLE_SLIP; + out.accumulated_delta_range_m = in.adrMeters; + out.accumulated_delta_range_uncertainty_m = in.adrUncertaintyMeters; + out.carrier_frequency_hz = in.carrierFrequencyHz; + out.carrier_cycles = in.carrierCycles; + out.carrier_phase = in.carrierPhase; + out.carrier_phase_uncertainty = in.carrierPhaseUncertainty; + out.multipath_indicator = GNSS_MULTIPATH_INDICATOR_UNKNOWN; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) + out.multipath_indicator |= GNSS_MULTIPATH_INDICATOR_PRESENT; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) + out.multipath_indicator |= GNSS_MULTIPATH_INDICATOR_NOT_PRESENT; + out.snr_db = in.signalToNoiseRatioDb; +} + +static void convertGnssClock(GnssMeasurementsClock& in, GnssClock& out) +{ + memset(&out, 0, sizeof(GnssClock)); + out.size = sizeof(GnssClock); + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) + out.flags |= GNSS_CLOCK_HAS_LEAP_SECOND; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) + out.flags |= GNSS_CLOCK_HAS_TIME_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) + out.flags |= GNSS_CLOCK_HAS_FULL_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) + out.flags |= GNSS_CLOCK_HAS_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) + out.flags |= GNSS_CLOCK_HAS_BIAS_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) + out.flags |= GNSS_CLOCK_HAS_DRIFT; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) + out.flags |= GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY; + out.leap_second = in.leapSecond; + out.time_ns = in.timeNs; + out.time_uncertainty_ns = in.timeUncertaintyNs; + out.full_bias_ns = in.fullBiasNs; + out.bias_ns = in.biasNs; + out.bias_uncertainty_ns = in.biasUncertaintyNs; + out.drift_nsps = in.driftNsps; + out.drift_uncertainty_nsps = in.driftUncertaintyNsps; + out.hw_clock_discontinuity_count = in.hwClockDiscontinuityCount; +} + +static void convertGnssData(GnssMeasurementsNotification& in, GnssData& out) +{ + memset(&out, 0, sizeof(GnssData)); + out.size = sizeof(GnssData); + out.measurement_count = in.count; + int len = GNSS_MAX_MEASUREMENT < GNSS_MEASUREMENTS_MAX + ? GNSS_MAX_MEASUREMENT : GNSS_MEASUREMENTS_MAX; + for (int i = 0; i < len; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i]); + } + convertGnssClock(in.clock, out.clock); +} diff --git a/android/GnssAPIClient.h b/android/GnssAPIClient.h new file mode 100644 index 00000000..77bfa527 --- /dev/null +++ b/android/GnssAPIClient.h @@ -0,0 +1,97 @@ +/* Copyright (c) 2017, 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 GNSS_API_CLINET_H +#define GNSS_API_CLINET_H + +#include + +#include + +class GnssAPIClient : public LocationAPIClientBase +{ +public: + GnssAPIClient(GpsCallbacks* gpsCb, + GpsNiCallbacks* niCb, + GpsMeasurementCallbacks* measurementCb); + virtual ~GnssAPIClient(); + GnssAPIClient(const GnssAPIClient&) = delete; + GnssAPIClient& operator=(const GnssAPIClient&) = delete; + + // for GpsInterface + void gnssUpdateCallbacks(GpsCallbacks* gpsCb, + GpsNiCallbacks* niCb, + GpsMeasurementCallbacks* measurementCb); + int gnssStart(); + int gnssStop(); + void gnssDeleteAidingData(GpsAidingData f); + int gnssSetPositionMode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time); + + // for AGpsInterface + void gnssAgnssSetServer(AGpsType type, const char *hostname, int port); + + // for GpsNiInterface + void gnssNiRespond(int notif_id, GpsUserResponseType user_response); + + // for GpsMeasurementInterface + void gnssMeasurementClose(); + + // for GnssConfigurationInterface + void gnssConfigurationUpdate(const char* config_data, int32_t length); + + inline LocationCapabilitiesMask gnssGetCapabilities() const { + return mLocationCapabilitiesMask; + } + + // callbacks we are interested in + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onTrackingCb(Location location) final; + void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final; + void onGnssSvCb(GnssSvNotification gnssSvNotification) final; + void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final; + void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; + + void onStartTrackingCb(LocationError error) final; + void onStopTrackingCb(LocationError error) final; + +private: + pthread_mutex_t mLock; + + GpsCallbacks* mGpsCallbacks; + GpsNiCallbacks* mGpsNiCallbacks; + + LocationCapabilitiesMask mLocationCapabilitiesMask; + + GpsMeasurementCallbacks* mGpsMeasurementCallbacks; + + LocationOptions mLocationOptions; +}; +#endif // GNSS_API_CLINET_H diff --git a/loc_api/libloc_api_50001/gps.c b/android/gps.c similarity index 94% rename from loc_api/libloc_api_50001/gps.c rename to android/gps.c index 29f20f42..a7248551 100644 --- a/loc_api/libloc_api_50001/gps.c +++ b/android/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2015 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011, 2015-2017 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 @@ -32,16 +32,20 @@ #include #include +#define UNUSED(...) (void)(__VA_ARGS__) + extern const GpsInterface* get_gps_interface(); const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev) { + UNUSED(dev); return get_gps_interface(); } static int open_gps(const struct hw_module_t* module, char const* name, struct hw_device_t** device) { + UNUSED(name); struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t)); if(dev == NULL) diff --git a/android/loc.cpp b/android/loc.cpp new file mode 100644 index 00000000..14d81263 --- /dev/null +++ b/android/loc.cpp @@ -0,0 +1,380 @@ +/* Copyright (c) 2011-2017, 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 "GnssAPIClient.h" + +extern "C" const GpsGeofencingInterface* get_gps_geofence_interface(); + +static GnssAPIClient* sClient = nullptr; +static GpsCallbacks sGpsCallbacks; +static GpsCallbacks* pGpsCallbacks = nullptr; + +static GpsNiCallbacks sGpsNiCallbacks; +static GpsNiCallbacks* pGpsNiCallbacks = nullptr; + +static GpsMeasurementCallbacks sGpsMeasurementCallbacks; +static GpsMeasurementCallbacks* pGpsMeasurementCallbacks = nullptr; + +typedef struct { + bool pending; + AGpsType type; + char *hostname; + int port; +} AgnssServerPack; +static AgnssServerPack pendingAgnssServer = { + false, + AGPS_TYPE_SUPL, + nullptr, + 0 +}; + +typedef struct { + bool pending; + char* config_data; + int32_t length; +} ConfigurationPack; +static ConfigurationPack pendingConfiguration = { + false, + nullptr, + 0 +}; + +static GnssAPIClient* getClient() { + if (!sClient && + // in order to create a GnssClient to call gnssUpdateConfig, + // one of pGpsCallbacks and pGpsNiCallbacks should not be nullptr. + (pGpsCallbacks != nullptr || pGpsNiCallbacks != nullptr)) { + sClient = new GnssAPIClient(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); + if (sClient) { + sClient->locAPIEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + if (pendingAgnssServer.pending && pendingAgnssServer.hostname) { + sClient->gnssAgnssSetServer(pendingAgnssServer.type, + pendingAgnssServer.hostname, + pendingAgnssServer.port); + pendingAgnssServer.pending = false; + free(pendingAgnssServer.hostname); + pendingAgnssServer.hostname = nullptr; + } + if (pendingConfiguration.pending && pendingConfiguration.config_data) { + sClient->gnssConfigurationUpdate(pendingConfiguration.config_data, + pendingConfiguration.length); + pendingConfiguration.pending = false; + free(pendingConfiguration.config_data); + pendingConfiguration.config_data = nullptr; + } + } + } + if (!sClient) { + LOC_LOGE("%s:%d] get GnssAPIClient failed", __func__, __LINE__); + } + return sClient; +} + +/*=========================================================================== + Functions and variables for sGpsInterface +===========================================================================*/ +static int loc_init(GpsCallbacks* callbacks) { + ENTRY_LOG_CALLFLOW(); + int retVal = -1; + if (callbacks) { + GnssAPIClient* client = getClient(); + // backup callbacks in case *callbacks is a stack variable + pGpsCallbacks = &sGpsCallbacks; + pGpsCallbacks->size = callbacks->size; + pGpsCallbacks->location_cb = callbacks->location_cb; + pGpsCallbacks->status_cb = callbacks->status_cb; + pGpsCallbacks->sv_status_cb = callbacks->sv_status_cb; + pGpsCallbacks->nmea_cb = callbacks->nmea_cb; + pGpsCallbacks->set_capabilities_cb = callbacks->set_capabilities_cb; + pGpsCallbacks->set_system_info_cb = callbacks->set_system_info_cb; + pGpsCallbacks->gnss_sv_status_cb = callbacks->gnss_sv_status_cb; + + // create MsgTask + pGpsCallbacks->create_thread_cb = callbacks->create_thread_cb; + loc_core::LocDualContext::getLocFgContext( + (LocThread::tCreate)pGpsCallbacks->create_thread_cb, + nullptr, loc_core::LocDualContext::mLocationHalName, false); + + // will never call these cbs + pGpsCallbacks->acquire_wakelock_cb = nullptr; + pGpsCallbacks->release_wakelock_cb = nullptr; + pGpsCallbacks->request_utc_time_cb = nullptr; + + // we can't create GnssAPIClient before GpsCallbacks or GpsNiCallbacks is set + if (client) { + client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); + } + + retVal = 0; + } + return retVal; +} +static int loc_start() { + ENTRY_LOG_CALLFLOW(); + int retVal = -1; + GnssAPIClient* client = getClient(); + if (client) + retVal = client->gnssStart(); + return retVal; +} +static int loc_stop() { + ENTRY_LOG_CALLFLOW(); + int retVal = -1; + GnssAPIClient* client = getClient(); + if (client) + retVal = client->gnssStop(); + return retVal; +} +static void loc_cleanup() { + ENTRY_LOG_CALLFLOW(); + if (sClient) { + sClient->locAPIDisable(); + } + pGpsCallbacks = nullptr; + pGpsNiCallbacks = nullptr; + pGpsMeasurementCallbacks = nullptr; + + pendingAgnssServer.pending = false; + if (pendingAgnssServer.hostname) { + free(pendingAgnssServer.hostname); + pendingAgnssServer.hostname = nullptr; + } + pendingConfiguration.pending = false; + if (pendingConfiguration.config_data) { + free(pendingConfiguration.config_data); + pendingConfiguration.config_data = nullptr; + } +} +static int loc_inject_time(GpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) { + return -1; +} +static int loc_inject_location(double /*latitude*/, double /*longitude*/, float /*accuracy*/) { + return -1; +} +static void loc_delete_aiding_data(GpsAidingData f) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* client = getClient(); + if (client) + client->gnssDeleteAidingData(f); +} +static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, + uint32_t preferred_time) { + ENTRY_LOG_CALLFLOW(); + int retVal = -1; + GnssAPIClient* client = getClient(); + if (client) + retVal = client->gnssSetPositionMode(mode, recurrence, + min_interval, preferred_accuracy, preferred_time); + return retVal; +} +static const void* loc_get_extension(const char* name); + +static const GpsInterface sGpsInterface = { + 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 +}; + +/*=========================================================================== + Functions and variables for sAGpsInterface +===========================================================================*/ +static void loc_agps_init(AGpsCallbacks* /*callbacks*/) { +} +static int loc_agps_open(const char* /*apn*/) { + return -1; +} +static int loc_agps_closed() { return -1; } +static int loc_agps_open_failed() { return -1; } +static int loc_agps_set_server(AGpsType type, const char *hostname, int port) { + GnssAPIClient* client = getClient(); + if (client) + client->gnssAgnssSetServer(type, hostname, port); + else { + // client is not ready yet + if (pendingAgnssServer.hostname) + free(pendingAgnssServer.hostname); + pendingAgnssServer.type = type; + pendingAgnssServer.hostname = strdup(hostname); + pendingAgnssServer.port = port; + pendingAgnssServer.pending = true; + } + return 0; +} +static int loc_agps_open_with_apniptype(const char* /*apn*/, ApnIpType /*apnIpType*/) { + return -1; +} + +static const AGpsInterface sAGpsInterface = { + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server, + loc_agps_open_with_apniptype +}; + +/*=========================================================================== + Functions and variables for sGpsNiInterface +===========================================================================*/ +static void loc_ni_init(GpsNiCallbacks *callbacks) { + ENTRY_LOG_CALLFLOW(); + if (callbacks) { + GnssAPIClient* client = getClient(); + pGpsNiCallbacks = &sGpsNiCallbacks; + pGpsNiCallbacks->notify_cb = callbacks->notify_cb; + pGpsNiCallbacks->create_thread_cb = callbacks->create_thread_cb; + + if (client) { + client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); + } + } +} +static void loc_ni_respond(int notif_id, GpsUserResponseType user_response) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* client = getClient(); + if (client) + client->gnssNiRespond(notif_id, user_response); +} + +static const GpsNiInterface sGpsNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + loc_ni_respond, +}; + +/*=========================================================================== + Functions and variables for sGpsMeasurementInterface +===========================================================================*/ +static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) { + ENTRY_LOG_CALLFLOW(); + int retVal = -1; + if (callbacks) { + GnssAPIClient* client = getClient(); + pGpsMeasurementCallbacks = &sGpsMeasurementCallbacks; + pGpsMeasurementCallbacks->size = sizeof(GpsMeasurementCallbacks); + pGpsMeasurementCallbacks->measurement_callback = callbacks->measurement_callback; + pGpsMeasurementCallbacks->gnss_measurement_callback = callbacks->gnss_measurement_callback; + + if (client) { + client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); + } + + retVal = 0; + } + return retVal; +} +static void loc_gps_measurement_close() { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* client = getClient(); + if (client) + client->gnssMeasurementClose(); +} + +static const GpsMeasurementInterface sGpsMeasurementInterface = +{ + sizeof(GpsMeasurementInterface), + loc_gps_measurement_init, + loc_gps_measurement_close +}; + +/*=========================================================================== + Functions and variables for sGnssConfigurationInterface +===========================================================================*/ +static void loc_configuration_update(const char* config_data, int32_t length) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* client = getClient(); + if (client) + client->gnssConfigurationUpdate(config_data, length); + else { + // client is not ready yet + if (pendingConfiguration.config_data) + free(pendingConfiguration.config_data); + pendingConfiguration.config_data = strdup(config_data); + pendingConfiguration.length = length; + pendingConfiguration.pending = true; + } +} + +static const GnssConfigurationInterface sGnssConfigurationInterface = +{ + sizeof(GnssConfigurationInterface), + loc_configuration_update +}; + +// Function exposed to gps hal +extern "C" const GpsInterface* get_gps_interface() +{ + unsigned int target = loc_get_target(); + int gnssType = getTargetGnssType(target); + if (gnssType == GNSS_NONE){ + LOC_LOGE("%s:%d] No GNSS HW on this target. Returning nullptr", __func__, __LINE__); + return nullptr; + } + return &sGpsInterface; +} + +const void* loc_get_extension(const char* name) +{ + const void* retVal = nullptr; + + LOC_LOGD("%s:%d] For Interface = %s\n", __func__, __LINE__, name); + if (strcmp(name, AGPS_INTERFACE) == 0) { + retVal = &sAGpsInterface; + } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { + retVal = &sGpsNiInterface; + } else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) { + retVal = get_gps_geofence_interface(); + } else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) { + retVal = &sGpsMeasurementInterface; + } else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) { + retVal = &sGnssConfigurationInterface; + } + + if (!retVal) { + LOC_LOGE ("%s:%d] %s is not supported", __func__, __LINE__, name); + } + return retVal; +} diff --git a/android/loc_geofence.cpp b/android/loc_geofence.cpp new file mode 100644 index 00000000..91a4be82 --- /dev/null +++ b/android/loc_geofence.cpp @@ -0,0 +1,91 @@ +/* Copyright (c) 2017, 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_geofence" + +#include +#include + +static GeofenceAPIClient* sClient = nullptr; + +/*=========================================================================== + Functions and variables for sGpsGeofencingInterface +===========================================================================*/ +static GpsGeofenceCallbacks sGpsGeofenceCbs; + +static void loc_geofence_init(GpsGeofenceCallbacks* callbacks) { + if (callbacks && !sClient) { + sGpsGeofenceCbs.geofence_transition_callback = callbacks->geofence_transition_callback; + sGpsGeofenceCbs.geofence_status_callback = callbacks->geofence_status_callback; + sGpsGeofenceCbs.geofence_add_callback = callbacks->geofence_add_callback; + sGpsGeofenceCbs.geofence_remove_callback = callbacks->geofence_remove_callback; + sGpsGeofenceCbs.geofence_pause_callback = callbacks->geofence_pause_callback; + sGpsGeofenceCbs.geofence_resume_callback = callbacks->geofence_resume_callback; + sGpsGeofenceCbs.create_thread_cb = callbacks->create_thread_cb; + + sClient = new GeofenceAPIClient(&sGpsGeofenceCbs); + } +} +static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms) { + if (sClient) + sClient->geofenceAdd(geofence_id, latitude, longitude, + radius_meters, last_transition, monitor_transitions, + notification_responsiveness_ms, unknown_timer_ms); +} +static void loc_pause_geofence(int32_t geofence_id) { + if (sClient) + sClient->geofencePause(geofence_id); +} +static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions) { + if (sClient) + sClient->geofenceResume(geofence_id, monitor_transitions); +} +static void loc_remove_geofence_area(int32_t geofence_id) { + if (sClient) + sClient->geofenceRemove(geofence_id); +} + +static const GpsGeofencingInterface sGpsGeofencingInterface = +{ + sizeof(GpsGeofencingInterface), + loc_geofence_init, + loc_add_geofence_area, + loc_pause_geofence, + loc_resume_geofence, + loc_remove_geofence_area +}; + +// Function exposed to gps hal +extern "C" const GpsGeofencingInterface* get_gps_geofence_interface() +{ + return &sGpsGeofencingInterface; +} diff --git a/core/Android.mk b/core/Android.mk index 319a02a8..53dcb6bd 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -6,7 +6,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core -LOCAL_MODULE_OWNER := qcom +LOCAL_MODULE_OWNER := qti LOCAL_MODULE_TAGS := optional @@ -37,8 +37,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libflp \ - $(TARGET_OUT_HEADERS)/libloc_pla + $(TARGET_OUT_HEADERS)/libloc_pla \ + $(TARGET_OUT_HEADERS)/liblocation_api LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1ae84823..a9858e22 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014,2016-2017 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 @@ -40,8 +40,116 @@ namespace loc_core { -loc_gps_cfg_s_type ContextBase::mGps_conf {0}; -loc_sap_cfg_s_type ContextBase::mSap_conf {0}; +loc_gps_cfg_s_type ContextBase::mGps_conf {}; +loc_sap_cfg_s_type ContextBase::mSap_conf {}; + +const loc_param_s_type ContextBase::mGps_conf_table[] = +{ + {"GPS_LOCK", &mGps_conf.GPS_LOCK, NULL, 'n'}, + {"SUPL_VER", &mGps_conf.SUPL_VER, NULL, 'n'}, + {"LPP_PROFILE", &mGps_conf.LPP_PROFILE, NULL, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, + {"LPPE_CP_TECHNOLOGY", &mGps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'}, + {"LPPE_UP_TECHNOLOGY", &mGps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'}, + {"AGPS_CERT_WRITABLE_MASK", &mGps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, + {"SUPL_MODE", &mGps_conf.SUPL_MODE, NULL, 'n'}, + {"SUPL_ES", &mGps_conf.SUPL_ES, NULL, 'n'}, + {"INTERMEDIATE_POS", &mGps_conf.INTERMEDIATE_POS, NULL, 'n'}, + {"ACCURACY_THRES", &mGps_conf.ACCURACY_THRES, NULL, 'n'}, + {"NMEA_PROVIDER", &mGps_conf.NMEA_PROVIDER, NULL, 'n'}, + {"CAPABILITIES", &mGps_conf.CAPABILITIES, NULL, 'n'}, + {"XTRA_VERSION_CHECK", &mGps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, + {"XTRA_SERVER_1", &mGps_conf.XTRA_SERVER_1, NULL, 's'}, + {"XTRA_SERVER_2", &mGps_conf.XTRA_SERVER_2, NULL, 's'}, + {"XTRA_SERVER_3", &mGps_conf.XTRA_SERVER_3, NULL, 's'}, + {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, + {"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'}, + {"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, +}; + +const loc_param_s_type ContextBase::mSap_conf_table[] = +{ + {"GYRO_BIAS_RANDOM_WALK", &mSap_conf.GYRO_BIAS_RANDOM_WALK, &mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, + {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, + {"SENSOR_CONTROL_MODE", &mSap_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, + {"SENSOR_USAGE", &mSap_conf.SENSOR_USAGE, NULL, 'n'}, + {"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, + {"SENSOR_PROVIDER", &mSap_conf.SENSOR_PROVIDER, NULL, 'n'} +}; + +void ContextBase::readConfig() +{ + /*Defaults for gps.conf*/ + mGps_conf.INTERMEDIATE_POS = 0; + mGps_conf.ACCURACY_THRES = 0; + mGps_conf.NMEA_PROVIDER = 0; + mGps_conf.GPS_LOCK = 0; + mGps_conf.SUPL_VER = 0x10000; + mGps_conf.SUPL_MODE = 0x3; + mGps_conf.SUPL_ES = 0; + mGps_conf.CAPABILITIES = 0x7; + /* LTE Positioning Profile configuration is disable by default*/ + mGps_conf.LPP_PROFILE = 0; + /*By default no positioning protocol is selected on A-GLONASS system*/ + mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; + /*XTRA version check is disabled by default*/ + mGps_conf.XTRA_VERSION_CHECK=0; + /*Use emergency PDN by default*/ + mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1; + /* By default no LPPe CP technology is enabled*/ + mGps_conf.LPPE_CP_TECHNOLOGY = 0; + /* By default no LPPe UP technology is enabled*/ + mGps_conf.LPPE_UP_TECHNOLOGY = 0; + + /*Defaults for sap.conf*/ + mSap_conf.GYRO_BIAS_RANDOM_WALK = 0; + mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; + mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; + mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; + mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; + mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + mSap_conf.SENSOR_USAGE = 0; /* Enabled */ + mSap_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 */ + mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + /* default provider is SSC */ + mSap_conf.SENSOR_PROVIDER = 1; + + /* None of the 10 slots for agps certificates are writable by default */ + mGps_conf.AGPS_CERT_WRITABLE_MASK = 0; + + /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ + mGps_conf.AGPS_CONFIG_INJECT = 1; + + const char* GPS_CONF_FILE = "/etc/gps.conf"; + const char* SAP_CONF_FILE = "/etc/sap.conf"; + UTIL_READ_CONF(GPS_CONF_FILE, mGps_conf_table); + UTIL_READ_CONF(SAP_CONF_FILE, mSap_conf_table); +} uint32_t ContextBase::getCarrierCapabilities() { #define carrierMSA (uint32_t)0x2 diff --git a/core/ContextBase.h b/core/ContextBase.h index 87d2acfa..83de9996 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, 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 @@ -34,6 +34,7 @@ #include #include #include +#include #define MAX_XTRA_SERVER_URL_LENGTH 256 @@ -105,6 +106,8 @@ class LocAdapterBase; class ContextBase { static LBSProxyBase* getLBSProxy(const char* libName); LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); + static const loc_param_s_type mGps_conf_table[]; + static const loc_param_s_type mSap_conf_table[]; protected: const LBSProxyBase* mLBSProxy; const MsgTask* mMsgTask; @@ -135,6 +138,7 @@ public: static loc_gps_cfg_s_type mGps_conf; static loc_sap_cfg_s_type mSap_conf; + void readConfig(); static uint32_t getCarrierCapabilities(); }; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 166fd910..27132b79 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2017The 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 @@ -50,6 +50,16 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, mLocApi->addAdapter(this); } +uint32_t LocAdapterBase::mSessionIdCounter(1); + +uint32_t LocAdapterBase::generateSessionId() +{ + if (++mSessionIdCounter == 0xFFFFFFFF) + mSessionIdCounter = 1; + + return mSessionIdCounter; +} + void LocAdapterBase::handleEngineUpEvent() { if (mLocAdapterProxyBase) { @@ -65,32 +75,31 @@ void LocAdapterBase::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)) { + reportPositionEvent(const UlpLocation& location, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask, + bool fromUlp) { + if (mLocAdapterProxyBase != NULL) { + mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, + (GpsLocationExtended&)locationExtended, + status, + loc_technology_mask); + } else { DEFAULT_IMPL() } } void LocAdapterBase:: - reportSv(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) + reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp) DEFAULT_IMPL() void LocAdapterBase:: - reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) + reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) DEFAULT_IMPL() void LocAdapterBase:: - reportSvPolynomial(GnssSvPolynomial &svPolynomial) + reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) DEFAULT_IMPL() void LocAdapterBase:: @@ -99,7 +108,7 @@ DEFAULT_IMPL() void LocAdapterBase:: - reportNmea(const char* nmea, int length) + reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) DEFAULT_IMPL() bool LocAdapterBase:: @@ -140,11 +149,11 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestNiNotify(LocGpsNiNotification ¬ify, const void* data) + requestNiNotifyEvent(GnssNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) void LocAdapterBase:: - reportGnssMeasurementData(LocGnssData &gnssMeasurementData) + reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify) DEFAULT_IMPL() bool LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index f3ec4890..824a3407 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014,2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2017 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 @@ -32,19 +32,39 @@ #include #include #include +#include +#include + +typedef struct LocationSessionKey { + LocationAPI* client; + uint32_t id; + inline LocationSessionKey(LocationAPI* _client, uint32_t _id) : + client(_client), id(_id) {} +} LocationSessionKey; +inline bool operator <(LocationSessionKey const& left, LocationSessionKey const& right) { + return left.id < right.id || (left.id == right.id && left.client < right.client); +} +inline bool operator ==(LocationSessionKey const& left, LocationSessionKey const& right) { + return left.id == right.id && left.client == right.client; +} +inline bool operator !=(LocationSessionKey const& left, LocationSessionKey const& right) { + return left.id != right.id || left.client != right.client; +} +typedef std::map LocationSessionMap; namespace loc_core { class LocAdapterProxyBase; class LocAdapterBase { +private: + static uint32_t mSessionIdCounter; 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) {} @@ -70,11 +90,19 @@ public: } inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) + loc_registration_mask_status status) { - mEvtMask = - isEnabled == LOC_REGISTRATION_MASK_ENABLED ? (mEvtMask|event):(mEvtMask&~event); - + switch(status) { + case (LOC_REGISTRATION_MASK_ENABLED): + mEvtMask = mEvtMask | event; + break; + case (LOC_REGISTRATION_MASK_DISABLED): + mEvtMask = mEvtMask &~ event; + break; + case (LOC_REGISTRATION_MASK_SET): + mEvtMask = event; + break; + } mLocApi->updateEvtMask(); } @@ -82,33 +110,33 @@ public: return mLocApi->isFeatureSupported(featureVal); } + uint32_t generateSessionId(); + // This will be overridden by the individual adapters // if necessary. - inline virtual void setUlpProxy(UlpProxyBase* ulp) { + inline virtual void setUlpProxyCommand(UlpProxyBase* ulp) { (void)ulp; } virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); - inline virtual void setPositionModeInt(LocPosMode& posMode) { + inline virtual void setPositionModeCommand(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(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); + virtual void startTrackingCommand() {} + virtual void stopTrackingCommand() {} + virtual void getZppCommand() {} + virtual void reportPositionEvent(const UlpLocation& location, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask, + bool fromUlp=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); + virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); + virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportStatus(LocGpsStatusValue 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(); @@ -119,11 +147,10 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual bool requestNiNotify(LocGpsNiNotification ¬ify, - const void* data); + virtual bool requestNiNotifyEvent(GnssNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } - virtual void reportGnssMeasurementData(LocGnssData &gnssMeasurementData); + virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); }; diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 82cba6b7..044f59bd 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014 The Linux Foundation. All rights reserved. +/* Copyright (c) 2014, 2016-2017 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 @@ -51,22 +51,25 @@ protected: mLocAdapterBase->updateEvtMask(event,isEnabled); } + inline uint32_t generateSessionId() { + return mLocAdapterBase->generateSessionId(); + } 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) { + inline virtual void reportPositionEvent(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; } }; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4cc8cb8d..3bbbf8f3 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014,2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2017 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 @@ -227,14 +227,13 @@ void LocApiBase::handleEngineDownEvent() TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent()); } -void LocApiBase::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, +void LocApiBase::reportPosition(UlpLocation& location, + GpsLocationExtended& locationExtended, 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 " + LOC_LOGD("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 " @@ -251,11 +250,8 @@ void LocApiBase::reportPosition(UlpLocation &location, 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) + mLocAdapters[i]->reportPositionEvent(location, locationExtended, + status, loc_technology_mask) ); } @@ -265,9 +261,7 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); } -void LocApiBase::reportSv(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) +void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", "QZSS", "BEIDOU", "GALILEO" }; @@ -276,27 +270,25 @@ void LocApiBase::reportSv(LocGnssSvStatus &svStatus, 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 < LOC_GNSS_MAX_SVS; i++) { - if (svStatus.gnss_sv_list[i].constellation > + svNotify.count); + for (int i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) { + if (svNotify.gnssSvs[i].type > sizeof(constellationString) / sizeof(constellationString[0]) - 1) { - svStatus.gnss_sv_list[i].constellation = 0; + svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN; } 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); + constellationString[svNotify.gnssSvs[i].type], + svNotify.gnssSvs[i].svId, + svNotify.gnssSvs[i].cN0Dbhz, + svNotify.gnssSvs[i].elevation, + svNotify.gnssSvs[i].azimuth, + svNotify.gnssSvs[i].gnssSvOptionsMask); } // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSv(svStatus, - locationExtended, - svExt) + mLocAdapters[i]->reportSvEvent(svNotify) ); } @@ -304,7 +296,7 @@ void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvMeasurement(svMeasurementSet) + mLocAdapters[i]->reportSvMeasurementEvent(svMeasurementSet) ); } @@ -312,7 +304,7 @@ void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) { // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvPolynomial(svPolynomial) + mLocAdapters[i]->reportSvPolynomialEvent(svPolynomial) ); } @@ -325,7 +317,7 @@ void LocApiBase::reportStatus(LocGpsStatusValue 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)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNmeaEvent(nmea, length)); } void LocApiBase::reportXtraServer(const char* url1, const char* url2, @@ -384,10 +376,10 @@ void LocApiBase::reportDataCallClosed() TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed()); } -void LocApiBase::requestNiNotify(LocGpsNiNotification ¬ify, const void* data) +void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data) { // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data)); } void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) @@ -406,10 +398,10 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGnssMeasurementData(LocGnssData &gnssMeasurementData) +void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurementsNotify) { // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurementsNotify)); } enum loc_api_adapter_err LocApiBase:: @@ -428,9 +420,9 @@ enum loc_api_adapter_err LocApiBase:: stopFix() DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - deleteAidingData(LocGpsAidingData f) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +LocationError LocApiBase:: + deleteAidingData(const GnssAidingData& data) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: enableData(int enable) @@ -469,31 +461,29 @@ enum loc_api_adapter_err LocApiBase:: setPositionMode(const LocPosMode& posMode) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: +LocationError LocApiBase:: setServer(const char* url, int len) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - setServer(unsigned int ip, int port, - LocServerType type) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +LocationError LocApiBase:: + setServer(unsigned int ip, int port, LocServerType type) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - informNiResponse(LocGpsUserResponseType userResponse, - const void* passThroughData) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +LocationError LocApiBase:: + informNiResponse(GnssNiResponse userResponse, const void* passThroughData) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - setSUPLVersion(uint32_t version) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +LocationError LocApiBase:: + setSUPLVersion(GnssConfigSuplVersion version) +DEFAULT_IMPL(LOCATION_ERROR_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) +LocationError LocApiBase:: + setLPPConfig(GnssConfigLppProfile profile) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: setSensorControlConfig(int sensorUsage, @@ -526,13 +516,17 @@ enum loc_api_adapter_err LocApiBase:: 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) +LocationError LocApiBase:: + setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP) - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +LocationError LocApiBase:: + setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +LocationError LocApiBase:: + setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: getWwanZppFix() @@ -573,9 +567,9 @@ void LocApiBase:: releaseDataServiceClient() DEFAULT_IMPL() -int LocApiBase:: - setGpsLock(LOC_GPS_LOCK_MASK lock) -DEFAULT_IMPL(-1) +LocationError LocApiBase:: + setGpsLock(GnssConfigGpsLock lock) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) void LocApiBase:: installAGpsCert(const LocDerEncodedCertificate* pData, @@ -587,9 +581,9 @@ 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) +LocationError LocApiBase:: + setXtraVersionCheck(uint32_t check) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) bool LocApiBase:: gnssConstellationConfig() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 9127a2ea..86610e72 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2017 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 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -102,22 +103,18 @@ public: inline void sendMsg(const LocMsg* msg) const { mMsgTask->sendMsg(msg); } - void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); // upward calls void handleEngineUpEvent(); void handleEngineDownEvent(); - void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, + void reportPosition(UlpLocation& location, + GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); + void reportSv(GnssSvNotification& svNotify); void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); void reportSvPolynomial(GnssSvPolynomial &svPolynomial); void reportStatus(LocGpsStatusValue status); @@ -132,9 +129,9 @@ public: void requestSuplES(int connHandle); void reportDataCallOpened(); void reportDataCallClosed(); - void requestNiNotify(LocGpsNiNotification ¬ify, const void* data); + void requestNiNotify(GnssNiNotification ¬ify, const void* data); void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGnssMeasurementData(LocGnssData &gnssMeasurementData); + void reportGnssMeasurementData(GnssMeasurementsNotification& measurementsNotify); void saveSupportedFeatureList(uint8_t *featureList); void reportWwanZppFix(LocGpsLocation &zppLoc); @@ -148,8 +145,8 @@ public: startFix(const LocPosMode& posMode); virtual enum loc_api_adapter_err stopFix(); - virtual enum loc_api_adapter_err - deleteAidingData(LocGpsAidingData f); + virtual LocationError + deleteAidingData(const GnssAidingData& data); virtual enum loc_api_adapter_err enableData(int enable); virtual enum loc_api_adapter_err @@ -168,19 +165,17 @@ public: atlCloseStatus(int handle, int is_succ); virtual enum loc_api_adapter_err setPositionMode(const LocPosMode& posMode); - virtual enum loc_api_adapter_err + virtual LocationError setServer(const char* url, int len); - virtual enum loc_api_adapter_err + virtual LocationError setServer(unsigned int ip, int port, LocServerType type); - virtual enum loc_api_adapter_err - informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData); - virtual enum loc_api_adapter_err - setSUPLVersion(uint32_t version); + virtual LocationError + informNiResponse(GnssNiResponse userResponse, const void* passThroughData); + virtual LocationError setSUPLVersion(GnssConfigSuplVersion version); virtual enum loc_api_adapter_err setNMEATypes (uint32_t typesMask); - virtual enum loc_api_adapter_err - setLPPConfig(uint32_t profile); + virtual LocationError setLPPConfig(GnssConfigLppProfile profile); virtual enum loc_api_adapter_err setSensorControlConfig(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err @@ -205,10 +200,10 @@ public: 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 LocationError + setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); + virtual LocationError setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP); + virtual LocationError setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP); virtual enum loc_api_adapter_err getWwanZppFix(); virtual enum loc_api_adapter_err @@ -238,15 +233,10 @@ public: 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); + virtual LocationError setGpsLock(GnssConfigGpsLock lock); /* Returns Current value of GPS Lock on success @@ -254,8 +244,7 @@ public: */ virtual int getGpsLock(void); - virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); - + virtual LocationError setXtraVersionCheck(uint32_t check); /* Check if the modem support the service */ diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 74b2903a..fd465e9d 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2017 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 @@ -44,8 +44,7 @@ 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_SATELLITE_REPORT | LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT | LOC_API_ADAPTER_BIT_IOCTL_REPORT | diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h index d30e9cc5..8863b66c 100644 --- a/core/UlpProxyBase.h +++ b/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, 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 @@ -30,7 +30,8 @@ #define ULP_PROXY_BASE_H #include -#include "fused_location_extended.h" +#include + namespace loc_core { class LocAdapterBase; @@ -51,24 +52,18 @@ public: return false; } - inline virtual bool reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, + inline virtual bool reportPosition(const UlpLocation &location, + const GpsLocationExtended &locationExtended, 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(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) { - (void)svStatus; - (void)locationExtended; - (void)svExt; + inline virtual bool reportSv(const GnssSvNotification& svNotify) { + (void)svNotify; return false; } inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { @@ -94,17 +89,21 @@ public: (void)capabilities; } - inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, - bool active) { - - (void)options; - (void)active; - return false; + inline virtual bool reportBatchingSession(const LocationOptions& options, bool active) + { + (void)options; + (void)active; + return false; } - inline virtual bool reportPositions(const FlpExtLocation* locations, - int32_t number_of_locations) { - (void)locations; - (void)number_of_locations; + inline virtual bool reportPositions(const UlpLocation* ulpLocations, + const GpsLocationExtended* extendedLocations, + const uint32_t* techMasks, + const size_t count) + { + (void)ulpLocations; + (void)extendedLocations; + (void)techMasks; + (void)count; return false; } inline virtual bool reportDeleteAidingData(LocGpsAidingData aidingData) diff --git a/core/gps_extended.h b/core/gps_extended.h index 5255da1a..dc6ad1eb 100644 --- a/core/gps_extended.h +++ b/core/gps_extended.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017 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 @@ -29,19 +29,21 @@ #ifndef GPS_EXTENDED_H #define GPS_EXTENDED_H -#include /** * @file * @brief C++ declarations for GPS types */ +#include +#if defined(USE_GLIB) || defined(OFF_TARGET) +#include +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#if defined(USE_GLIB) || defined(OFF_TARGET) -#include -#endif + struct LocPosMode { diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 3985e994..55fd03eb 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, 2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017 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 @@ -34,6 +34,7 @@ #include #include #include +#include #include /** @@ -88,7 +89,8 @@ extern "C" { enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, - LOC_REGISTRATION_MASK_DISABLED + LOC_REGISTRATION_MASK_DISABLED, + LOC_REGISTRATION_MASK_SET }; typedef enum { diff --git a/core/loc_core_log.h b/core/loc_core_log.h index 4fe8d3f2..2beb6873 100644 --- a/core/loc_core_log.h +++ b/core/loc_core_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2013, 2016-2017 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 @@ -30,14 +30,14 @@ #ifndef LOC_CORE_LOG_H #define LOC_CORE_LOG_H +#include +#include + #ifdef __cplusplus extern "C" { #endif -#include -#include - const char* loc_get_gps_status_name(LocGpsStatusValue gps_status); const char* loc_get_position_mode_name(LocGpsPositionMode mode); const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur); diff --git a/gnss/Android.mk b/gnss/Android.mk new file mode 100644 index 00000000..16d796cc --- /dev/null +++ b/gnss/Android.mk @@ -0,0 +1,43 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libgnss +LOCAL_MODULE_OWNER := qti + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libdl \ + liblog \ + libloc_core \ + libgps.utils + +LOCAL_SRC_FILES += \ + location_gnss.cpp \ + GnssAdapter.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + +ifeq ($(TARGET_BUILD_VARIANT),user) + LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER +endif + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libloc_pla \ + $(TARGET_OUT_HEADERS)/liblocation_api + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp new file mode 100644 index 00000000..1ddb41dc --- /dev/null +++ b/gnss/GnssAdapter.cpp @@ -0,0 +1,2880 @@ +/* Copyright (c) 2017, 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_TAG "LocSvc_GnssAdapter" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace loc_core; + +GnssAdapter::GnssAdapter() : + LocAdapterBase(0, + LocDualContext::getLocFgContext(NULL, + NULL, + LocDualContext::mLocationHalName, + false)), + mUlpProxy(new UlpProxyBase()), + mSuplMode(GNSS_SUPL_MODE_STANDALONE), + mUlpPositionMode(), + mGnssSvIdUsedInPosition(), + mGnssSvIdUsedInPosAvail(false), + mControlCallbacks(), + mPowerVoteId(0), + mNiData() +{ + LOC_LOGD("%s]: Constructor %p", __func__, this); + mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; + readConfigCommand(); + setConfigCommand(); + +} + +inline +GnssAdapter::~GnssAdapter() +{ + LOC_LOGD("%s]: Destructor", __func__); + delete mUlpProxy; +} + +void +GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks) +{ + struct MsgSetControlCallbacks : public LocMsg { + GnssAdapter& mAdapter; + const LocationControlCallbacks mControlCallbacks; + inline MsgSetControlCallbacks(GnssAdapter& adapter, + LocationControlCallbacks& controlCallbacks) : + LocMsg(), + mAdapter(adapter), + mControlCallbacks(controlCallbacks) {} + inline virtual void proc() const { + mAdapter.setControlCallbacks(mControlCallbacks); + } + }; + + sendMsg(new MsgSetControlCallbacks(*this, controlCallbacks)); +} + +void +GnssAdapter::convertOptions(LocPosMode& out, const LocationOptions& options) +{ + LocPosMode locPosMode = {}; + switch (options.mode) { + case GNSS_SUPL_MODE_MSB: + out.mode = LOC_POSITION_MODE_MS_BASED; + break; + case GNSS_SUPL_MODE_MSA: + out.mode = LOC_POSITION_MODE_MS_ASSISTED; + break; + default: + out.mode = LOC_POSITION_MODE_STANDALONE; + break; + } + out.share_position = true; + out.min_interval = options.minInterval; +} + +void +GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation, + const LocPosTechMask techMask) +{ + out.size = sizeof(Location); + if (LOC_GPS_LOCATION_HAS_LAT_LONG & locGpsLocation.flags) { + out.flags |= LOCATION_HAS_LAT_LONG_BIT; + out.latitude = locGpsLocation.latitude; + out.longitude = locGpsLocation.longitude; + } + if (LOC_GPS_LOCATION_HAS_ALTITUDE & locGpsLocation.flags) { + out.flags |= LOCATION_HAS_ALTITUDE_BIT; + out.altitude = locGpsLocation.altitude; + } + if (LOC_GPS_LOCATION_HAS_SPEED & locGpsLocation.flags) { + out.flags |= LOCATION_HAS_SPEED_BIT; + out.speed = locGpsLocation.speed; + } + if (LOC_GPS_LOCATION_HAS_BEARING & locGpsLocation.flags) { + out.flags |= LOCATION_HAS_BEARING_BIT; + out.bearing = locGpsLocation.bearing; + } + if (LOC_GPS_LOCATION_HAS_ACCURACY & locGpsLocation.flags) { + out.flags |= LOCATION_HAS_ACCURACY_BIT; + out.accuracy = locGpsLocation.accuracy; + } + out.timestamp = locGpsLocation.timestamp; + if (LOC_POS_TECH_MASK_SATELLITE & techMask) { + out.techMask |= LOCATION_TECHNOLOGY_GNSS_BIT; + } + if (LOC_POS_TECH_MASK_CELLID & techMask) { + out.techMask |= LOCATION_TECHNOLOGY_CELL_BIT; + } + if (LOC_POS_TECH_MASK_WIFI & techMask) { + out.techMask |= LOCATION_TECHNOLOGY_WIFI_BIT; + } + if (LOC_POS_TECH_MASK_SENSORS & techMask) { + out.techMask |= LOCATION_TECHNOLOGY_SENSORS_BIT; + } +} + +void +GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, + const GpsLocationExtended& locationExtended) +{ + out.size = sizeof(GnssLocationInfoNotification); + if (GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT; + out.altitudeMeanSeaLevel = locationExtended.altitudeMeanSeaLevel; + } + if (GPS_LOCATION_EXTENDED_HAS_DOP & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_DOP_BIT; + out.pdop = locationExtended.pdop; + out.hdop = locationExtended.hdop; + out.vdop = locationExtended.vdop; + } + if (GPS_LOCATION_EXTENDED_HAS_MAG_DEV & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT; + out.magneticDeviation = locationExtended.magneticDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_VERT_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_VER_ACCURACY_BIT; + out.verAccuracy = locationExtended.vert_unc; + } + if (GPS_LOCATION_EXTENDED_HAS_SPEED_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_SPEED_ACCURACY_BIT; + out.speedAccuracy = locationExtended.speed_unc; + } + if (GPS_LOCATION_EXTENDED_HAS_BEARING_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_BEARING_ACCURACY_BIT; + out.bearingAccuracy = locationExtended.bearing_unc; + } + if (GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT; + switch (locationExtended.horizontal_reliability) { + case LOC_RELIABILITY_VERY_LOW: + out.horReliability = LOCATION_RELIABILITY_VERY_LOW; + break; + case LOC_RELIABILITY_LOW: + out.horReliability = LOCATION_RELIABILITY_LOW; + break; + case LOC_RELIABILITY_MEDIUM: + out.horReliability = LOCATION_RELIABILITY_MEDIUM; + break; + case LOC_RELIABILITY_HIGH: + out.horReliability = LOCATION_RELIABILITY_HIGH; + break; + default: + out.horReliability = LOCATION_RELIABILITY_NOT_SET; + break; + } + } + if (GPS_LOCATION_EXTENDED_HAS_VERT_RELIABILITY & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_VER_RELIABILITY_BIT; + switch (locationExtended.vertical_reliability) { + case LOC_RELIABILITY_VERY_LOW: + out.verReliability = LOCATION_RELIABILITY_VERY_LOW; + break; + case LOC_RELIABILITY_LOW: + out.verReliability = LOCATION_RELIABILITY_LOW; + break; + case LOC_RELIABILITY_MEDIUM: + out.verReliability = LOCATION_RELIABILITY_MEDIUM; + break; + case LOC_RELIABILITY_HIGH: + out.verReliability = LOCATION_RELIABILITY_HIGH; + break; + default: + out.verReliability = LOCATION_RELIABILITY_NOT_SET; + break; + } + } + if (GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MAJOR & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT; + out.horUncEllipseSemiMajor = locationExtended.horUncEllipseSemiMajor; + } + if (GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT; + out.horUncEllipseSemiMinor = locationExtended.horUncEllipseSemiMinor; + } + if (GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT; + out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth; + } +} + +inline uint32_t +GnssAdapter::convertGpsLock(const GnssConfigGpsLock gpsLock) +{ + switch (gpsLock) { + case GNSS_CONFIG_GPS_LOCK_MO: + return 1; + case GNSS_CONFIG_GPS_LOCK_NI: + return 2; + case GNSS_CONFIG_GPS_LOCK_MO_AND_NI: + return 3; + case GNSS_CONFIG_GPS_LOCK_NONE: + default: + return 0; + } +} + +inline GnssConfigGpsLock +GnssAdapter::convertGpsLock(const uint32_t gpsLock) +{ + switch (gpsLock) { + case 1: + return GNSS_CONFIG_GPS_LOCK_MO; + case 2: + return GNSS_CONFIG_GPS_LOCK_NI; + case 3: + return GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + case 0: + default: + return GNSS_CONFIG_GPS_LOCK_NONE; + } +} + +inline uint32_t +GnssAdapter::convertSuplVersion(const GnssConfigSuplVersion suplVersion) +{ + switch (suplVersion) { + case GNSS_CONFIG_SUPL_VERSION_2_0_0: + return 0x00020000; + case GNSS_CONFIG_SUPL_VERSION_2_0_2: + return 0x00020002; + case GNSS_CONFIG_SUPL_VERSION_1_0_0: + default: + return 0x00010000; + } +} + +inline GnssConfigSuplVersion +GnssAdapter::convertSuplVersion(const uint32_t suplVersion) +{ + switch (suplVersion) { + case 0x00020000: + return GNSS_CONFIG_SUPL_VERSION_2_0_0; + case 0x00020002: + return GNSS_CONFIG_SUPL_VERSION_2_0_2; + case 0x00010000: + default: + return GNSS_CONFIG_SUPL_VERSION_1_0_0; + } +} + +inline uint32_t +GnssAdapter::convertLppProfile(const GnssConfigLppProfile lppProfile) +{ + switch (lppProfile) { + case GNSS_CONFIG_LPP_PROFILE_USER_PLANE: + return 1; + case GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE: + return 2; + case GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE: + return 3; + case GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE: + default: + return 0; + } +} + +inline GnssConfigLppProfile +GnssAdapter::convertLppProfile(const uint32_t lppProfile) +{ + switch (lppProfile) { + case 1: + return GNSS_CONFIG_LPP_PROFILE_USER_PLANE; + case 2: + return GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; + case 3: + return GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; + case 0: + default: + return GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; + } +} + +uint32_t +GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask) +{ + uint32_t mask = 0; + if (GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT & lppeControlPlaneMask) { + mask |= (1<<0); + } + if (GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT & lppeControlPlaneMask) { + mask |= (1<<1); + } + return mask; +} + +GnssConfigLppeControlPlaneMask +GnssAdapter::convertLppeCp(const uint32_t lppeControlPlaneMask) +{ + GnssConfigLppeControlPlaneMask mask = 0; + if ((1<<0) & lppeControlPlaneMask) { + mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT; + } + if ((1<<1) & lppeControlPlaneMask) { + mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT; + } + return mask; +} + + +uint32_t +GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) +{ + uint32_t mask = 0; + if (GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT & lppeUserPlaneMask) { + mask |= (1<<0); + } + if (GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT & lppeUserPlaneMask) { + mask |= (1<<1); + } + return mask; +} + +GnssConfigLppeUserPlaneMask +GnssAdapter::convertLppeUp(const uint32_t lppeUserPlaneMask) +{ + GnssConfigLppeUserPlaneMask mask = 0; + if ((1<<0) & lppeUserPlaneMask) { + mask |= GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT; + } + if ((1<<1) & lppeUserPlaneMask) { + mask |= GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT; + } + return mask; +} + +uint32_t +GnssAdapter::convertAGloProt(const GnssConfigAGlonassPositionProtocolMask aGloPositionProtocolMask) +{ + uint32_t mask = 0; + if (GNSS_CONFIG_RRC_CONTROL_PLANE_BIT & aGloPositionProtocolMask) { + mask |= (1<<0); + } + if (GNSS_CONFIG_RRLP_USER_PLANE_BIT & aGloPositionProtocolMask) { + mask |= (1<<1); + } + if (GNSS_CONFIG_LLP_USER_PLANE_BIT & aGloPositionProtocolMask) { + mask |= (1<<2); + } + if (GNSS_CONFIG_LLP_CONTROL_PLANE_BIT & aGloPositionProtocolMask) { + mask |= (1<<3); + } + return mask; +} + +uint32_t +GnssAdapter::convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl) +{ + switch (emergencyPdnForEmergencySupl) { + case GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES: + return 1; + case GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO: + default: + return 0; + } +} + +uint32_t +GnssAdapter::convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices) +{ + switch (suplEmergencyServices) { + case GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES: + return 1; + case GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO: + default: + return 0; + } +} + +uint32_t +GnssAdapter::convertSuplMode(const GnssConfigSuplModeMask suplModeMask) +{ + uint32_t mask = 0; + if (GNSS_CONFIG_SUPL_MODE_MSB & suplModeMask) { + mask |= (1<<0); + } + if (GNSS_CONFIG_SUPL_MODE_MSA & suplModeMask) { + mask |= (1<<1); + } + return mask; +} + +bool +GnssAdapter::resolveInAddress(const char* hostAddress, struct in_addr* inAddress) +{ + bool ret = true; + + struct hostent* hp; + hp = gethostbyname(hostAddress); + if (hp != NULL) { /* DNS OK */ + memcpy(inAddress, hp->h_addr_list[0], hp->h_length); + } else { + /* Try IP representation */ + if (inet_aton(hostAddress, inAddress) == 0) { + /* IP not valid */ + LOC_LOGE("%s]: DNS query on '%s' failed", __func__, hostAddress); + ret = false; + } + } + + return ret; +} + +void +GnssAdapter::readConfigCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgReadConfig : public LocMsg { + GnssAdapter* mAdapter; + ContextBase& mContext; + inline MsgReadConfig(GnssAdapter* adapter, + ContextBase& context) : + LocMsg(), + mAdapter(adapter), + mContext(context) {} + inline virtual void proc() const { + // reads config into mContext->mGps_conf + mContext.readConfig(); + mContext.requestUlp((LocAdapterBase*)mAdapter, mContext.getCarrierCapabilities()); + } + }; + + if (mContext != NULL) { + sendMsg(new MsgReadConfig(this, *mContext)); + } +} + +void +GnssAdapter::setConfigCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgSetConfig : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + inline MsgSetConfig(GnssAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + mApi.setSUPLVersion(mAdapter.convertSuplVersion(ContextBase::mGps_conf.SUPL_VER)); + mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE)); + mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT); + } + mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE, + ContextBase::mSap_conf.SENSOR_PROVIDER); + mApi.setLPPeProtocolCp( + mAdapter.convertLppeCp(ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY)); + mApi.setLPPeProtocolUp( + mAdapter.convertLppeUp(ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY)); + if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { + mApi.setNMEATypes(LOC_NMEA_ALL_SUPPORTED_MASK); + } + mApi.setXtraVersionCheck(ContextBase::mGps_conf.XTRA_VERSION_CHECK); + if (ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID || + ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + mApi.setSensorProperties( + ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, + ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK, + ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); + } + mApi.setSensorPerfControlConfig( + ContextBase::mSap_conf.SENSOR_CONTROL_MODE, + ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, + ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + ContextBase::mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK); + } + }; + + sendMsg(new MsgSetConfig(*this, *mLocApi)); +} + +uint32_t* +GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) +{ + // count the number of bits set + GnssConfigFlagsMask flagsCopy = config.flags; + size_t count = 0; + while (flagsCopy > 0) { + if (flagsCopy & 1) { + count++; + } + flagsCopy >>= 1; + } + std::string idsString = "["; + uint32_t* ids = NULL; + if (count > 0) { + ids = new uint32_t[count]; + for (size_t i=0; i < count; ++i) { + ids[i] = generateSessionId(); + IF_LOC_LOGD { + idsString += std::to_string(ids[i]) + " "; + } + } + } + idsString += "]"; + + LOC_LOGD("%s]: ids %s flags 0x%X", __func__, idsString.c_str(), config.flags); + + struct MsgGnssUpdateConfig : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + GnssConfig mConfig; + uint32_t* mIds; + size_t mCount; + inline MsgGnssUpdateConfig(GnssAdapter& adapter, + LocApiBase& api, + GnssConfig config, + uint32_t* ids, + size_t count) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mConfig(config), + mIds(ids), + mCount(count) {} + inline virtual ~MsgGnssUpdateConfig() + { + delete[] mIds; + } + inline virtual void proc() const { + //const size_t MAX_BITS_COUNT = 10; + //LocationError errs[MAX_BITS_COUNT] = {}; + LocationError* errs = new LocationError[mCount]; + LocationError err = LOCATION_ERROR_SUCCESS; + uint32_t index = 0; + + if (mConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + uint32_t newGpsLock = mAdapter.convertGpsLock(mConfig.gpsLock); + ContextBase::mGps_conf.GPS_LOCK = newGpsLock; + if (0 == mAdapter.getPowerVoteId()) { + err = mApi.setGpsLock(mConfig.gpsLock); + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion); + if (newSuplVersion != ContextBase::mGps_conf.SUPL_VER && + ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + ContextBase::mGps_conf.SUPL_VER = newSuplVersion; + err = mApi.setSUPLVersion(mConfig.suplVersion); + } else { + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { + if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + char serverUrl[MAX_URL_LEN] = {}; + uint32_t length = 0; + const char noHost[] = "NONE"; + if (NULL == mConfig.assistanceServer.hostName || + strncasecmp(noHost, + mConfig.assistanceServer.hostName, + sizeof(noHost)) == 0) { + } else { + length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", + mConfig.assistanceServer.hostName, + mConfig.assistanceServer.port); + } + + if (sizeof(serverUrl) > length) { + err = mApi.setServer(serverUrl, length); + } else { + err = LOCATION_ERROR_INVALID_PARAMETER; + } + } else { + err = LOCATION_ERROR_SUCCESS; + } + } else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) { + if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + struct in_addr addr; + if (!mAdapter.resolveInAddress(mConfig.assistanceServer.hostName, &addr)) { + LOC_LOGE("%s]: hostName %s cannot be resolved", + __func__, mConfig.assistanceServer.hostName); + err = LOCATION_ERROR_INVALID_PARAMETER; + } else { + unsigned int ip = htonl(addr.s_addr); + err = mApi.setServer(ip, mConfig.assistanceServer.port, + LOC_AGPS_CDMA_PDE_SERVER); + } + } else { + err = LOCATION_ERROR_SUCCESS; + } + } else { + LOC_LOGE("%s]: Not a valid gnss assistance type %u", + __func__, mConfig.assistanceServer.type); + err = LOCATION_ERROR_INVALID_PARAMETER; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile); + if (newLppProfile != ContextBase::mGps_conf.LPP_PROFILE && + ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + ContextBase::mGps_conf.LPP_PROFILE = newLppProfile; + err = mApi.setLPPConfig(mConfig.lppProfile); + } else { + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + uint32_t newLppeControlPlaneMask = + mAdapter.convertLppeCp(mConfig.lppeControlPlaneMask); + if (newLppeControlPlaneMask != ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY) { + ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY = newLppeControlPlaneMask; + err = mApi.setLPPeProtocolCp(mConfig.lppeControlPlaneMask); + } else { + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + uint32_t newLppeUserPlaneMask = + mAdapter.convertLppeUp(mConfig.lppeUserPlaneMask); + if (newLppeUserPlaneMask != ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY) { + ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY = newLppeUserPlaneMask; + err = mApi.setLPPeProtocolUp(mConfig.lppeUserPlaneMask); + } else { + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + uint32_t newAGloProtMask = + mAdapter.convertAGloProt(mConfig.aGlonassPositionProtocolMask); + if (newAGloProtMask != ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT && + ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = newAGloProtMask; + err = mApi.setAGLONASSProtocol(mConfig.aGlonassPositionProtocolMask); + } else { + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl); + if (newEP4ES != ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = newEP4ES; + } + err = LOCATION_ERROR_SUCCESS; + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices); + if (newSuplEs != ContextBase::mGps_conf.SUPL_ES) { + ContextBase::mGps_conf.SUPL_ES = newSuplEs; + } + err = LOCATION_ERROR_SUCCESS; + if (index < mCount) { + errs[index++] = err; + } + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask); + if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { + ContextBase::mGps_conf.SUPL_MODE = newSuplMode; + mAdapter.getUlpProxy()->setCapabilities( + ContextBase::getCarrierCapabilities()); + } + err = LOCATION_ERROR_SUCCESS; + if (index < mCount) { + errs[index++] = err; + } + } + + mAdapter.reportResponse(index, errs, mIds); + delete[] errs; + } + }; + + if (NULL != ids) { + sendMsg(new MsgGnssUpdateConfig(*this, *mLocApi, config, ids, count)); + } else { + LOC_LOGE("%s]: No GNSS config items to update", __func__); + } + + return ids; +} + +uint32_t +GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) +{ + uint32_t sessionId = generateSessionId(); + LOC_LOGD("%s]: client %p id %u", __func__, sessionId); + + struct MsgDeleteAidingData : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + uint32_t mSessionId; + GnssAidingData mData; + inline MsgDeleteAidingData(GnssAdapter& adapter, + LocApiBase& api, + uint32_t sessionId, + GnssAidingData& data) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mSessionId(sessionId), + mData(data) {} + inline virtual void proc() const { + LocationError err = LOCATION_ERROR_SUCCESS; + #ifdef TARGET_BUILD_VARIANT_USER + err = LOCATION_ERROR_NOT_SUPPORTED; + #endif + if (LOCATION_ERROR_SUCCESS == err) { + err = mApi.deleteAidingData(mData); + } + mAdapter.reportResponse(err, mSessionId); + } + }; + + sendMsg(new MsgDeleteAidingData(*this, *mLocApi, sessionId, data)); + return sessionId; +} + +void +GnssAdapter::injectLocationCommand(double latitude, double longitude, float accuracy) +{ + LOC_LOGD("%s]: latitude %8.4f longitude %8.4f accuracy %8.4f", + __func__, latitude, longitude, accuracy); + + struct MsgInjectLocation : public LocMsg { + LocApiBase& mApi; + ContextBase& mContext; + double mLatitude; + double mLongitude; + float mAccuracy; + inline MsgInjectLocation(LocApiBase& api, + ContextBase& context, + double latitude, + double longitude, + float accuracy) : + LocMsg(), + mApi(api), + mContext(context), + mLatitude(latitude), + mLongitude(longitude), + mAccuracy(accuracy) {} + inline virtual void proc() const { + if (!mContext.hasCPIExtendedCapabilities()) { + mApi.injectPosition(mLatitude, mLongitude, mAccuracy); + } + } + }; + + sendMsg(new MsgInjectLocation(*mLocApi, *mContext, latitude, longitude, accuracy)); +} + +void +GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty) +{ + LOC_LOGD("%s]: time %lld timeReference %lld uncertainty %d", + __func__, time, timeReference, uncertainty); + + struct MsgInjectTime : public LocMsg { + LocApiBase& mApi; + ContextBase& mContext; + int64_t mTime; + int64_t mTimeReference; + int32_t mUncertainty; + inline MsgInjectTime(LocApiBase& api, + ContextBase& context, + int64_t time, + int64_t timeReference, + int32_t uncertainty) : + LocMsg(), + mApi(api), + mContext(context), + mTime(time), + mTimeReference(timeReference), + mUncertainty(uncertainty) {} + inline virtual void proc() const { + mApi.setTime(mTime, mTimeReference, mUncertainty); + } + }; + + sendMsg(new MsgInjectTime(*mLocApi, *mContext, time, timeReference, uncertainty)); +} + +void +GnssAdapter::setUlpProxyCommand(UlpProxyBase* ulp) +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgSetUlpProxy : public LocMsg { + GnssAdapter& mAdapter; + UlpProxyBase* mUlp; + inline MsgSetUlpProxy(GnssAdapter& adapter, + UlpProxyBase* ulp) : + LocMsg(), + mAdapter(adapter), + mUlp(ulp) {} + inline virtual void proc() const { + mAdapter.setUlpProxy(mUlp); + } + }; + + sendMsg(new MsgSetUlpProxy(*this, ulp)); +} + +void +GnssAdapter::setUlpProxy(UlpProxyBase* ulp) +{ + if (ulp == mUlpProxy) { + //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]: ulp pointer is NULL", __func__); + ulp = new UlpProxyBase(); + } + + if (LOC_POSITION_MODE_INVALID != mUlpProxy->mPosMode.mode) { + // need to send this mode and start msg to ULP + ulp->sendFixMode(mUlpProxy->mPosMode); + } + + if (mUlpProxy->mFixSet) { + ulp->sendStartFix(); + } + + delete mUlpProxy; + mUlpProxy = ulp; +} + +void +GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + struct MsgAddClient : public LocMsg { + GnssAdapter& mAdapter; + LocationAPI* mClient; + const LocationCallbacks mCallbacks; + inline MsgAddClient(GnssAdapter& adapter, + LocationAPI* client, + const LocationCallbacks& callbacks) : + LocMsg(), + mAdapter(adapter), + mClient(client), + mCallbacks(callbacks) {} + inline virtual void proc() const { + mAdapter.saveClient(mClient, mCallbacks); + } + }; + + sendMsg(new MsgAddClient(*this, client, callbacks)); +} + +void +GnssAdapter::removeClientCommand(LocationAPI* client) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + struct MsgRemoveClient : public LocMsg { + GnssAdapter& mAdapter; + LocationAPI* mClient; + inline MsgRemoveClient(GnssAdapter& adapter, + LocationAPI* client) : + LocMsg(), + mAdapter(adapter), + mClient(client) {} + inline virtual void proc() const { + mAdapter.stopClientSessions(mClient); + mAdapter.eraseClient(mClient); + } + }; + + sendMsg(new MsgRemoveClient(*this, client)); +} + +void +GnssAdapter::stopClientSessions(LocationAPI* client) +{ + LOC_LOGD("%s]: client %p", __func__, client); + for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end();) { + if (client == it->first.client) { + LocationError err = stopTrackingMultiplex(it->first.client, it->first.id); + if (LOCATION_ERROR_SUCCESS == err) { + it = mTrackingSessions.erase(it); + continue; + } + } + ++it; // increment only when not erasing an iterator + } + +} + +void +GnssAdapter::updateClientsEventMask() +{ + LOC_API_ADAPTER_EVENT_MASK_T mask = 0; + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (it->second.trackingCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT; + } + if (it->second.gnssNiCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; + } + if (it->second.gnssSvCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_SATELLITE_REPORT; + } + if (it->second.gnssNmeaCb != nullptr && + NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { + mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; + } + if (it->second.gnssMeasurementsCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; + } + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); +} + +void +GnssAdapter::handleEngineUpEvent() +{ + struct MsgRestartSessions : public LocMsg { + GnssAdapter& mAdapter; + inline MsgRestartSessions(GnssAdapter& adapter) : + LocMsg(), + mAdapter(adapter) {} + virtual void proc() const { + mAdapter.restartSessions(); + } + }; + + setConfigCommand(); + sendMsg(new MsgRestartSessions(*this)); +} + +void +GnssAdapter::restartSessions() +{ + LOC_LOGD("%s]: ", __func__); + + if (mTrackingSessions.empty()) { + return; + } + + // get the LocationOptions that has the smallest interval, which should be the active one + LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time + for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { + if (0 == smallestIntervalOptions.size || //size of zero means we havent set it yet + it->second.minInterval < smallestIntervalOptions.minInterval) { + smallestIntervalOptions = it->second; + } + } + + startTracking(smallestIntervalOptions); +} + +void +GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgRequestCapabilities : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + inline MsgRequestCapabilities(GnssAdapter& adapter, + LocApiBase& api, + LocationAPI* client) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client) {} + inline virtual void proc() const { + LocationCallbacks callbacks = mAdapter.getClientCallbacks(mClient); + if (callbacks.capabilitiesCb == nullptr) { + LOC_LOGE("%s]: capabilitiesCb is NULL", __func__); + return; + } + + LocationCapabilitiesMask mask = {}; + // time based tracking always supported + mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; + if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)){ + mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | + LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; + } + if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; + } + // geofence always supported + mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; + if (mApi.gnssConstellationConfig()) { + mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; + } + uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities(); + if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) { + mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT; + } + if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { + mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; + } + + callbacks.capabilitiesCb(mask); + } + }; + + sendMsg(new MsgRequestCapabilities(*this, *mLocApi, client)); +} + +LocationCallbacks +GnssAdapter::getClientCallbacks(LocationAPI* client) +{ + LocationCallbacks callbacks = {}; + auto it = mClientData.find(client); + if (it != mClientData.end()) { + callbacks = it->second; + } + return callbacks; +} + +void +GnssAdapter::saveClient(LocationAPI* client, const LocationCallbacks& callbacks) +{ + mClientData[client] = callbacks; + updateClientsEventMask(); +} + +void +GnssAdapter::eraseClient(LocationAPI* client) +{ + auto it = mClientData.find(client); + if (it != mClientData.end()) { + mClientData.erase(it); + } + updateClientsEventMask(); +} + +bool +GnssAdapter::hasTrackingCallback(LocationAPI* client) +{ + auto it = mClientData.find(client); + return (it != mClientData.end() && it->second.trackingCb); +} + +bool +GnssAdapter::hasMeasurementsCallback(LocationAPI* client) +{ + auto it = mClientData.find(client); + return (it != mClientData.end() && it->second.gnssMeasurementsCb); +} + +bool +GnssAdapter::isTrackingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + return (mTrackingSessions.find(key) != mTrackingSessions.end()); +} + +void +GnssAdapter::saveTrackingSession(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options) +{ + LocationSessionKey key(client, sessionId); + mTrackingSessions[key] = options; +} + +void +GnssAdapter::eraseTrackingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + auto it = mTrackingSessions.find(key); + if (it != mTrackingSessions.end()) { + mTrackingSessions.erase(it); + } + +} + +void +GnssAdapter::reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId) +{ + LOC_LOGD("%s]: client %p id %u err %u", __func__, client, sessionId, err); + + auto it = mClientData.find(client); + if (it != mClientData.end() && + it->second.responseCb != nullptr) { + it->second.responseCb(err, sessionId); + } else { + LOC_LOGW("%s]: client %p id %u not found in data", __func__, client, sessionId); + } +} + +void +GnssAdapter::reportResponse(LocationError err, uint32_t sessionId) +{ + LOC_LOGD("%s]: id %u err %u", __func__, sessionId, err); + + if (mControlCallbacks.size > 0 && mControlCallbacks.responseCb != nullptr) { + mControlCallbacks.responseCb(err, sessionId); + } else { + LOC_LOGW("%s]: control client response callback not found", __func__); + } +} + +void +GnssAdapter::reportResponse(size_t count, LocationError* errs, uint32_t* ids) +{ + IF_LOC_LOGD { + std::string idsString = "["; + std::string errsString = "["; + if (NULL != ids && NULL != errs) { + for (size_t i=0; i < count; ++i) { + idsString += std::to_string(ids[i]) + " "; + errsString += std::to_string(errs[i]) + " "; + } + } + idsString += "]"; + errsString += "]"; + + LOC_LOGD("%s]: ids %s errs %s", + __func__, idsString.c_str(), errsString.c_str()); + } + + if (mControlCallbacks.size > 0 && mControlCallbacks.collectiveResponseCb != nullptr) { + mControlCallbacks.collectiveResponseCb(count, errs, ids); + } else { + LOC_LOGW("%s]: control client callback not found", __func__); + } +} + +uint32_t +GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) +{ + uint32_t sessionId = generateSessionId(); + LOC_LOGD("%s]: client %p id %u minInterval %u mode %u", + __func__, client, sessionId, options.minInterval, options.mode); + + struct MsgStartTracking : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + LocationOptions mOptions; + inline MsgStartTracking(GnssAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId, + LocationOptions options) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId), + mOptions(options) {} + inline virtual void proc() const { + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mAdapter.hasTrackingCallback(mClient) && + !mAdapter.hasMeasurementsCallback(mClient)) { + err = LOCATION_ERROR_CALLBACK_MISSING; + } else if (0 == mOptions.size) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } else { + // Api doesn't support multiple clients for time based tracking, so mutiplex + err = mAdapter.startTrackingMultiplex(mOptions); + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + } + } + mAdapter.reportResponse(mClient, err, mSessionId); + } + }; + + sendMsg(new MsgStartTracking(*this, *mLocApi, client, sessionId, options)); + return sessionId; + +} + +LocationError +GnssAdapter::startTrackingMultiplex(const LocationOptions& options) +{ + LocationError err = LOCATION_ERROR_SUCCESS; + bool updateTrackingSession = false; + + if (mTrackingSessions.empty()) { + err = startTracking(options); + } else { + // get the LocationOptions that has the smallest interval, which should be the active one + LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time + for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { + if (0 == smallestIntervalOptions.size || //size of zero means we havent set it yet + it->second.minInterval < smallestIntervalOptions.minInterval) { + smallestIntervalOptions = it->second; + } + } + // if new session's minInterval is smaller than any in other sessions + if (options.minInterval < smallestIntervalOptions.minInterval) { + // restart time based tracking with new options + err = startTracking(options); + } + } + + return err; +} + +LocationError +GnssAdapter::startTracking(const LocationOptions& options) +{ + LocationError err = LOCATION_ERROR_SUCCESS; + LocPosMode locPosMode = {}; + convertOptions(locPosMode, options); + if (!mUlpProxy->sendFixMode(locPosMode)) { + // do nothing + } + if (!mUlpProxy->sendStartFix()) { + loc_api_adapter_err apiErr = mLocApi->startFix(locPosMode); + if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { + err = LOCATION_ERROR_SUCCESS; + // save supl mode, which is used for NMEA generation + setSuplMode(options.mode); + } else { + err = LOCATION_ERROR_GENERAL_FAILURE; + } + } + + return err; +} + +void +GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) +{ + LOC_LOGD("%s]: min_interval %u mode %u", + __func__, locPosMode.min_interval, locPosMode.mode); + + struct MsgSetPositionMode : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + LocPosMode mLocPosMode; + inline MsgSetPositionMode(GnssAdapter& adapter, + LocApiBase& api, + LocPosMode& locPosMode) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mLocPosMode(locPosMode) {} + inline virtual void proc() const { + // saves the mode in adapter to be used when startTrackingCommand is called from ULP + mAdapter.setUlpPositionMode(mLocPosMode); + mApi.setPositionMode(mLocPosMode); + } + }; + + sendMsg(new MsgSetPositionMode(*this, *mLocApi, locPosMode)); +} + +void +GnssAdapter::startTrackingCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgStartTracking : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + inline MsgStartTracking(GnssAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + // we get this call from ULP, so just call LocApi without multiplexing because + // ulp would be doing the multiplexing for us if it is present + LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + mApi.startFix(ulpPositionMode); + // save supl mode, which is used for NMEA generation + mAdapter.setSuplMode((GnssSuplMode)ulpPositionMode.mode); + } + }; + + sendMsg(new MsgStartTracking(*this, *mLocApi)); +} + +void +GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, + LocationOptions& options) +{ + LOC_LOGD("%s]: client %p id %u minInterval %u mode %u", + __func__, client, id, options.minInterval, options.mode); + + struct MsgUpdateTracking : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + LocationOptions mOptions; + inline MsgUpdateTracking(GnssAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId, + LocationOptions options) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId), + mOptions(options) {} + inline virtual void proc() const { + if (mAdapter.isTrackingSession(mClient, mSessionId)) { + LocationError err = LOCATION_ERROR_SUCCESS; + if (0 == mOptions.size) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } else { + // Api doesn't support multiple clients for time based tracking, so mutiplex + err = mAdapter.startTrackingMultiplex(mOptions); + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + } + } + mAdapter.reportResponse(mClient, err, mSessionId); + } + // we do not reportResponse for the case where there is no existing tracking session + // for the client and id being used, since updateTrackingCommand can be sent to both + // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response + } + }; + + sendMsg(new MsgUpdateTracking(*this, *mLocApi, client, id, options)); +} + +void +GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) +{ + LOC_LOGD("%s]: client %p id %u", __func__, client, id); + + struct MsgStopTracking : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + inline MsgStopTracking(GnssAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId) {} + inline virtual void proc() const { + if (mAdapter.isTrackingSession(mClient, mSessionId)) { + LocationError err = LOCATION_ERROR_SUCCESS; + // Api doesn't support multiple clients for time based tracking, so mutiplex + err = mAdapter.stopTrackingMultiplex(mClient, mSessionId); + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.eraseTrackingSession(mClient, mSessionId); + } + mAdapter.reportResponse(mClient, err, mSessionId); + } + // we do not reportResponse for the case where there is no existing tracking session + // for the client and id being used, since stopTrackingCommand can be sent to both + // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response + + } + }; + + sendMsg(new MsgStopTracking(*this, *mLocApi, client, id)); +} + +LocationError +GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) +{ + LocationError err = LOCATION_ERROR_SUCCESS; + + if (1 == mTrackingSessions.size()) { + err = stopTracking(); + } else { + LocationSessionKey key(client, id); + + // get the session we are stopping + auto it = mTrackingSessions.find(key); + if (it != mTrackingSessions.end()) { + // find the next smallest interval, other than the session we are stopping + LocationOptions smallestIntervalOptions; // size will be zero until set for the first time + for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { + // if session is not the one we are stopping and either smallest interval is not set + // or there is a new smallest interval, then set the new smallest interval + if (it2->first != key && (0 == smallestIntervalOptions.size || + it2->second.minInterval < smallestIntervalOptions.minInterval)) { + smallestIntervalOptions = it2->second; + } + } + // if session we are stopping has smaller interval then next smallest + if (it->second.minInterval < smallestIntervalOptions.minInterval) { + // restart time based tracking with next smallest interval + err = startTracking(smallestIntervalOptions); + } + } + } + + return err; +} + +LocationError +GnssAdapter::stopTracking() +{ + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mUlpProxy->sendStopFix()) { + loc_api_adapter_err apiErr = mLocApi->stopFix(); + if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { + err = LOCATION_ERROR_SUCCESS; + } else { + err = LOCATION_ERROR_GENERAL_FAILURE; + } + } + + return err; +} + +void +GnssAdapter::stopTrackingCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgStopTracking : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + inline MsgStopTracking(GnssAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + // clear the position mode + LocPosMode mLocPosMode = {}; + mLocPosMode.mode = LOC_POSITION_MODE_INVALID; + mAdapter.setUlpPositionMode(mLocPosMode); + // don't need to multiplex because ULP will do that for us if it is present + mApi.stopFix(); + } + }; + + sendMsg(new MsgStopTracking(*this, *mLocApi)); +} + +void +GnssAdapter::getZppCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgGetZpp : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + inline MsgGetZpp(GnssAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + UlpLocation location = {}; + LocPosTechMask techMask = LOC_POS_TECH_MASK_DEFAULT; + GpsLocationExtended locationExtended = {}; + locationExtended.size = sizeof(locationExtended); + + mApi.getBestAvailableZppFix(location.gpsLocation, techMask); + //Mark the location source as from ZPP + location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; + location.position_source = ULP_LOCATION_IS_FROM_ZPP; + + mAdapter.getUlpProxy()->reportPosition(location, + locationExtended, + LOC_SESS_SUCCESS, + techMask); + } + }; + + sendMsg(new MsgGetZpp(*this, *mLocApi)); +} + +bool +GnssAdapter::hasNiNotifyCallback(LocationAPI* client) +{ + auto it = mClientData.find(client); + return (it != mClientData.end() && it->second.gnssNiCb); +} + +void +GnssAdapter::gnssNiResponseCommand(LocationAPI* client, + uint32_t id, + GnssNiResponse response) +{ + LOC_LOGD("%s]: client %p id %u response %u", __func__, client, id, response); + + struct MsgGnssNiResponse : public LocMsg { + GnssAdapter& mAdapter; + LocationAPI* mClient; + uint32_t mSessionId; + GnssNiResponse mResponse; + inline MsgGnssNiResponse(GnssAdapter& adapter, + LocationAPI* client, + uint32_t sessionId, + GnssNiResponse response) : + LocMsg(), + mAdapter(adapter), + mClient(client), + mSessionId(sessionId), + mResponse(response) {} + inline virtual void proc() const { + NiData& niData = mAdapter.getNiData(); + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mAdapter.hasNiNotifyCallback(mClient)) { + err = LOCATION_ERROR_ID_UNKNOWN; + } else { + NiSession* pSession = NULL; + if (mSessionId == niData.sessionEs.reqID && + NULL != niData.sessionEs.rawRequest) { + pSession = &niData.sessionEs; + // ignore any SUPL NI non-Es session if a SUPL NI ES is accepted + if (mResponse == GNSS_NI_RESPONSE_ACCEPT && + NULL != niData.session.rawRequest) { + pthread_mutex_lock(&niData.session.tLock); + niData.session.resp = GNSS_NI_RESPONSE_IGNORE; + niData.session.respRecvd = true; + pthread_cond_signal(&niData.session.tCond); + pthread_mutex_unlock(&niData.session.tLock); + } + } else if (mSessionId == niData.session.reqID && + NULL != niData.session.rawRequest) { + pSession = &niData.session; + } + + if (pSession) { + LOC_LOGI("%s]: gnssNiResponseCommand: send user mResponse %u for id %u", + __func__, mResponse, mSessionId); + pthread_mutex_lock(&pSession->tLock); + pSession->resp = mResponse; + pSession->respRecvd = true; + pthread_cond_signal(&pSession->tCond); + pthread_mutex_unlock(&pSession->tLock); + } else { + err = LOCATION_ERROR_ID_UNKNOWN; + LOC_LOGE("%s]: gnssNiResponseCommand: id %u not an active session", + __func__, mSessionId); + } + } + mAdapter.reportResponse(mClient, err, mSessionId); + } + }; + + sendMsg(new MsgGnssNiResponse(*this, client, id, response)); + +} + +void +GnssAdapter::gnssNiResponseCommand(GnssNiResponse response, void* rawRequest) +{ + LOC_LOGD("%s]: response %u", __func__, response); + + struct MsgGnssNiResponse : public LocMsg { + LocApiBase& mApi; + const GnssNiResponse mResponse; + const void* mPayload; + inline MsgGnssNiResponse(LocApiBase& api, + const GnssNiResponse response, + const void* rawRequest) : + LocMsg(), + mApi(api), + mResponse(response), + mPayload(rawRequest) {} + inline virtual ~MsgGnssNiResponse() { + // 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 { + mApi.informNiResponse(mResponse, mPayload); + } + }; + + sendMsg(new MsgGnssNiResponse(*mLocApi, response, rawRequest)); + +} + +uint32_t +GnssAdapter::enableCommand(LocationTechnologyType techType) +{ + uint32_t sessionId = generateSessionId(); + LOC_LOGD("%s]: id %u techType %u", __func__, sessionId, techType); + + struct MsgEnableGnss : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + ContextBase& mContext; + uint32_t mSessionId; + LocationTechnologyType mTechType; + inline MsgEnableGnss(GnssAdapter& adapter, + LocApiBase& api, + ContextBase& context, + uint32_t sessionId, + LocationTechnologyType techType) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mContext(context), + mSessionId(sessionId), + mTechType(techType) {} + inline virtual void proc() const { + LocationError err = LOCATION_ERROR_SUCCESS; + uint32_t powerVoteId = mAdapter.getPowerVoteId(); + if (mTechType != LOCATION_TECHNOLOGY_TYPE_GNSS) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } else if (powerVoteId > 0) { + err = LOCATION_ERROR_ALREADY_STARTED; + } else { + mContext.modemPowerVote(true); + mAdapter.setPowerVoteId(mSessionId); + mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); + } + mAdapter.reportResponse(err, mSessionId); + } + }; + + if (mContext != NULL) { + sendMsg(new MsgEnableGnss(*this, *mLocApi, *mContext, sessionId, techType)); + } else { + LOC_LOGE("%s]: Context is NULL", __func__); + } + + return sessionId; +} + +void +GnssAdapter::disableCommand(uint32_t id) +{ + LOC_LOGD("%s]: id %u", __func__, id); + + struct MsgDisableGnss : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + ContextBase& mContext; + uint32_t mSessionId; + inline MsgDisableGnss(GnssAdapter& adapter, + LocApiBase& api, + ContextBase& context, + uint32_t sessionId) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mContext(context), + mSessionId(sessionId) {} + inline virtual void proc() const { + LocationError err = LOCATION_ERROR_SUCCESS; + uint32_t powerVoteId = mAdapter.getPowerVoteId(); + if (powerVoteId != mSessionId) { + err = LOCATION_ERROR_ID_UNKNOWN; + } else { + mContext.modemPowerVote(false); + mAdapter.setPowerVoteId(0); + mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); + } + mAdapter.reportResponse(err, mSessionId); + } + }; + + if (mContext != NULL) { + sendMsg(new MsgDisableGnss(*this, *mLocApi, *mContext, id)); + } + +} + +void +GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask techMask, + bool fromUlp) +{ + LOC_LOGD("%s]: fromUlp %u status %u", __func__, fromUlp, status); + + // if this event is not called from ULP, then try to call into ULP and return if successfull + if (!fromUlp) { + if (mUlpProxy->reportPosition(ulpLocation, locationExtended, + status, techMask)) { + return; + } + } + + struct MsgReportPosition : public LocMsg { + GnssAdapter& mAdapter; + const UlpLocation mUlpLocation; + const GpsLocationExtended mLocationExtended; + loc_sess_status mStatus; + LocPosTechMask mTechMask; + inline MsgReportPosition(GnssAdapter& adapter, + const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + loc_sess_status status, + LocPosTechMask techMask) : + LocMsg(), + mAdapter(adapter), + mUlpLocation(ulpLocation), + mLocationExtended(locationExtended), + mStatus(status), + mTechMask(techMask) {} + inline virtual void proc() const { + mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); + } + }; + + sendMsg(new MsgReportPosition(*this, ulpLocation, locationExtended, status, techMask)); +} + +void +GnssAdapter::reportPosition(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask techMask) +{ + bool reported = false; + if (LOC_SESS_FAILURE == status) { + Location invalidLocation = {}; + invalidLocation.size = sizeof(Location); + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.trackingCb) { + it->second.trackingCb(invalidLocation); + } + } + 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 == status && + ((LOC_POS_TECH_MASK_SATELLITE | + LOC_POS_TECH_MASK_SENSORS | + LOC_POS_TECH_MASK_HYBRID) & + techMask)) || + (LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS && + !((ulpLocation.gpsLocation.flags & + LOC_GPS_LOCATION_HAS_ACCURACY) && + (ContextBase::mGps_conf.ACCURACY_THRES != 0) && + (ulpLocation.gpsLocation.accuracy > + ContextBase::mGps_conf.ACCURACY_THRES)))) { + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { + mGnssSvIdUsedInPosAvail = true; + mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; + } + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.trackingCb) { + Location location = {}; + convertLocation(location, ulpLocation.gpsLocation, techMask); + it->second.trackingCb(location); + } + if (nullptr != it->second.gnssLocationInfoCb) { + GnssLocationInfoNotification locationInfo = {}; + convertLocationInfo(locationInfo, locationExtended); + it->second.gnssLocationInfoCb(locationInfo); + } + } + reported = true; + } + + if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { + if (reported && status != LOC_SESS_FAILURE) { + generateNmea(ulpLocation, locationExtended); + } else { + generateNmeaBlank(); + } + } + + // Free the allocated memory for rawData + UlpLocation* gp = (UlpLocation*)&(ulpLocation); + if (gp != NULL && gp->rawData != NULL) + { + delete (char*)gp->rawData; + gp->rawData = NULL; + gp->rawDataSize = 0; + } +} + +void +GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, + bool fromUlp) +{ + LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); + + // if this event is not called from ULP, then try to call into ULP and return if successfull + if (!fromUlp) { + if (mUlpProxy->reportSv(svNotify)) { + return; + } + } + + struct MsgReportSv : public LocMsg { + GnssAdapter& mAdapter; + const GnssSvNotification mSvNotify; + inline MsgReportSv(GnssAdapter& adapter, + const GnssSvNotification& svNotify) : + LocMsg(), + mAdapter(adapter), + mSvNotify(svNotify) {} + inline virtual void proc() const { + mAdapter.reportSv((GnssSvNotification&)mSvNotify); + } + }; + + sendMsg(new MsgReportSv(*this, svNotify)); +} + +void +GnssAdapter::reportSv(GnssSvNotification& svNotify) +{ + if (mGnssSvIdUsedInPosAvail) { + int numSv = svNotify.count; + int16_t gnssSvId = 0; + int prnMin = 0; + uint64_t svUsedIdMask = 0; + for (int i=0; i < numSv; i++) { + gnssSvId = svNotify.gnssSvs[i].svId; + if (gnssSvId <= GPS_SV_PRN_MAX) { + svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; + prnMin = GPS_SV_PRN_MIN; + } else if ((gnssSvId >= GLO_SV_PRN_MIN) && (gnssSvId <= GLO_SV_PRN_MAX)) { + svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; + prnMin = GLO_SV_PRN_MIN; + } else if ((gnssSvId >= BDS_SV_PRN_MIN) && (gnssSvId <= BDS_SV_PRN_MAX)) { + svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; + prnMin = BDS_SV_PRN_MIN; + } else if ((gnssSvId >= GAL_SV_PRN_MIN) && (gnssSvId <= GAL_SV_PRN_MAX)) { + svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; + prnMin = GAL_SV_PRN_MIN; + } + + // 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 - prnMin))) { + svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; + } else { + svNotify.gnssSvs[i].gnssSvOptionsMask &= ~GNSS_SV_OPTIONS_USED_IN_FIX_BIT; + } + } + } + + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.gnssSvCb) { + it->second.gnssSvCb(svNotify); + } + } + + if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { + generateNmea(svNotify); + } + + mGnssSvIdUsedInPosAvail = false; +} + +void +GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) +{ + //LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); + + // if this event is not called from ULP, then try to call into ULP and return if successfull + if (!fromUlp) { + if (mUlpProxy->reportNmea(nmea, length)) { + return; + } + } + + struct MsgReportNmea : public LocMsg { + GnssAdapter& mAdapter; + const char* mNmea; + size_t mLength; + inline MsgReportNmea(GnssAdapter& adapter, + const char* nmea, + size_t length) : + LocMsg(), + mAdapter(adapter), + mNmea(new char[length]), + mLength(length) { + memcpy((void*)mNmea, (void*)nmea, length); + } + inline virtual ~MsgReportNmea() + { + delete[] mNmea; + } + inline virtual void proc() const { + mAdapter.reportNmea(mNmea, mLength); + } + }; + + sendMsg(new MsgReportNmea(*this, nmea, length)); +} + +void +GnssAdapter::reportNmea(const char* nmea, size_t length) +{ + GnssNmeaNotification nmeaNotification = {}; + nmeaNotification.size = sizeof(GnssNmeaNotification); + + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + nmeaNotification.timestamp = now; + nmeaNotification.nmea = nmea; + nmeaNotification.length = length; + + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.gnssNmeaCb) { + it->second.gnssNmeaCb(nmeaNotification); + } + } + +} + +bool +GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data) +{ + LOC_LOGI("%s]: notif_type: %d, timeout: %d, default_resp: %d" + "requestor_id: %s (encoding: %d) text: %s text (encoding: %d) extras: %s", + __func__, notify.type, notify.timeout, notify.timeoutResponse, + notify.requestor, notify.requestorEncoding, + notify.message, notify.messageEncoding, notify.extras); + + struct MsgReportNiNotify : public LocMsg { + GnssAdapter& mAdapter; + const GnssNiNotification mNotify; + const void* mData; + inline MsgReportNiNotify(GnssAdapter& adapter, + const GnssNiNotification& notify, + const void* data) : + LocMsg(), + mAdapter(adapter), + mNotify(notify), + mData(data) {} + inline virtual void proc() const { + mAdapter.requestNiNotify(mNotify, mData); + } + }; + + sendMsg(new MsgReportNiNotify(*this, notify, data)); + + return true; +} + +static void* niThreadProc(void *args) +{ + NiSession* pSession = (NiSession*)args; + int rc = 0; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + 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("%s]: time out set for abs time %ld with delay %d sec", + __func__, (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 = GNSS_NI_RESPONSE_NO_RESPONSE; + LOC_LOGD("%s]: time out after valting for specified time. Ret Val %d", + __func__, rc); + break; + } + } + LOC_LOGD("%s]: Java layer has sent us a user response and return value from " + "pthread_cond_timedwait = %d pSession->resp is %u", __func__, rc, pSession->resp); + pSession->respRecvd = false; /* Reset the user response flag for the next session*/ + + // 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() + GnssAdapter* adapter = pSession->adapter; + GnssNiResponse resp; + void* rawRequest = NULL; + bool sendResponse = false; + + if (NULL != pSession->rawRequest) { + if (pSession->resp != GNSS_NI_RESPONSE_IGNORE) { + resp = pSession->resp; + rawRequest = pSession->rawRequest; + sendResponse = true; + } else { + free(pSession->rawRequest); + } + pSession->rawRequest = NULL; + } + pthread_mutex_unlock(&pSession->tLock); + + pSession->respTimeLeft = 0; + pSession->reqID = 0; + + if (sendResponse) { + adapter->gnssNiResponseCommand(resp, rawRequest); + } + + return NULL; +} + +bool +GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data) +{ + NiSession* pSession = NULL; + gnssNiCallback gnssNiCb = nullptr; + + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.gnssNiCb) { + gnssNiCb = it->second.gnssNiCb; + break; + } + } + if (nullptr == gnssNiCb) { + EXIT_LOG(%s, "no clients with gnssNiCb."); + return false; + } + + if (notify.type == GNSS_NI_TYPE_EMERGENCY_SUPL) { + if (NULL != mNiData.sessionEs.rawRequest) { + LOC_LOGI("%s]: supl es NI in progress, new supl es NI ignored, type: %d", + __func__, notify.type); + if (NULL != data) { + free((void*)data); + } + } else { + pSession = &mNiData.sessionEs; + } + } else { + if (NULL != mNiData.session.rawRequest || + NULL != mNiData.sessionEs.rawRequest) { + LOC_LOGI("%s]: supl NI in progress, new supl NI ignored, type: %d", + __func__, notify.type); + if (NULL != data) { + free((void*)data); + } + } else { + pSession = &mNiData.session; + } + } + + if (pSession) { + /* Save request */ + pSession->rawRequest = (void*)data; + pSession->reqID = ++mNiData.reqIDCounter; + pSession->adapter = this; + + int sessionId = pSession->reqID; + + /* 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 + (notify.timeout != 0 ? notify.timeout : LOC_NI_NO_RESPONSE_TIME); + + int rc = 0; + rc = pthread_create(&pSession->thread, NULL, niThreadProc, pSession); + if (rc) { + LOC_LOGE("%s]: Loc NI thread is not created.", __func__); + } + rc = pthread_detach(pSession->thread); + if (rc) { + LOC_LOGE("%s]: Loc NI thread is not detached.", __func__); + } + + if (nullptr != gnssNiCb) { + gnssNiCb(sessionId, notify); + } + } + + return true; +} + +void +GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify) +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgReportGnssMeasurementData : public LocMsg { + GnssAdapter& mAdapter; + const GnssMeasurementsNotification mMeasurementsNotify; + inline MsgReportGnssMeasurementData(GnssAdapter& adapter, + const GnssMeasurementsNotification& measurementsNotify) : + LocMsg(), + mAdapter(adapter), + mMeasurementsNotify(measurementsNotify) {} + inline virtual void proc() const { + mAdapter.reportGnssMeasurementData(mMeasurementsNotify); + } + }; + + sendMsg(new MsgReportGnssMeasurementData(*this, measurementsNotify)); +} + +void +GnssAdapter::reportGnssMeasurementData(const GnssMeasurementsNotification& measurementsNotify) +{ + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.gnssMeasurementsCb) { + it->second.gnssMeasurementsCb(measurementsNotify); + } + } +} + +void +GnssAdapter::reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) +{ + LOC_LOGD("%s]: ", __func__); + + // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. + mUlpProxy->reportSvMeasurement(svMeasurementSet); +} + +void +GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) +{ + LOC_LOGD("%s]: ", __func__); + + // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. + mUlpProxy->reportSvPolynomial(svPolynomial); +} + +int +GnssAdapter::nmeaPutChecksum(char *nmea, size_t maxSize) +{ + uint8_t checksum = 0; + int length = 0; + + nmea++; //skip the $ + while (*nmea != '\0') { + checksum ^= *nmea++; + length++; + } + + // length now contains nmea sentence string length not including $ sign. + int checksumLength = snprintf(nmea,(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); +} + +void +GnssAdapter::generateNmea(const GnssSvNotification& svNotify) +{ + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + + // ------$GPGSV------ + NmeaSvMeta gpsSvMeta = + {GNSS_SV_TYPE_GPS, "GP", 0, 0}; + generateNmeaGSV(svNotify, gpsSvMeta, sentence, sizeof(sentence)); + + // ------$GLGSV------ + NmeaSvMeta gloSvMeta = + {GNSS_SV_TYPE_GLONASS, "GL", 0, GLONASS_SV_ID_OFFSET}; + generateNmeaGSV(svNotify, gloSvMeta, sentence, sizeof(sentence)); + + // ------$GAGSV------ + NmeaSvMeta galSvMeta = + {GNSS_SV_TYPE_GALILEO, "GA", 0, 0}; + generateNmeaGSV(svNotify, galSvMeta, sentence, sizeof(sentence)); +} + +void +GnssAdapter::generateNmea(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended) +{ + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + + time_t utcTime(ulpLocation.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); + if (NULL == pTm) { + LOC_LOGE("%s]: gmtime failed", __func__); + return; + } + + uint32_t svUsedCount = 0; + uint32_t count = 0; + bool isCombinedFix = (mGnssSvIdUsedInPosition.gps_sv_used_ids_mask ? 1 : 0) + + (mGnssSvIdUsedInPosition.glo_sv_used_ids_mask ? 1 : 0) + + (mGnssSvIdUsedInPosition.gal_sv_used_ids_mask ? 1 : 0) > 1; + NmeaSvMeta gnssSvMeta = + {GNSS_SV_TYPE_GPS, isCombinedFix ? "GN" : "GP", + mGnssSvIdUsedInPosition.gps_sv_used_ids_mask, 0}; + + // ---$GPGSA/$GNGSA--- + NmeaSvMeta gpsSvMeta = + {GNSS_SV_TYPE_GPS, isCombinedFix ? "GN" : "GP", + mGnssSvIdUsedInPosition.gps_sv_used_ids_mask, 0}; + count = generateNmeaGSA(locationExtended, gpsSvMeta, sentence, sizeof(sentence)); + if (count > 0) { + svUsedCount += count; + gnssSvMeta = gpsSvMeta; + } + + // ---$GLGSA/$GNGSA--- + NmeaSvMeta gloSvMeta = + {GNSS_SV_TYPE_GLONASS, isCombinedFix ? "GN" : "GL", + mGnssSvIdUsedInPosition.glo_sv_used_ids_mask, GLONASS_SV_ID_OFFSET}; + count = generateNmeaGSA(locationExtended, gloSvMeta, sentence, sizeof(sentence)); + if (count > 0) { + svUsedCount += count; + gnssSvMeta = gloSvMeta; + } + + // ---$GAGSA/$GNGSA--- + NmeaSvMeta galSvMeta = + {GNSS_SV_TYPE_GALILEO, isCombinedFix ? "GN" : "GA", + mGnssSvIdUsedInPosition.gal_sv_used_ids_mask, 0}; + count = generateNmeaGSA(locationExtended, galSvMeta, sentence, sizeof(sentence)); + if (count > 0) { + svUsedCount += count; + gnssSvMeta = galSvMeta; + } + + // ---$GPVTG/$GLVTG/$GAVTG/$GNVTG--- + generateNmeaVTG(ulpLocation, locationExtended, gnssSvMeta, + sentence, sizeof(sentence)); + + // ---$GPRMC/$GLRMC/$GARMC/$GNRMC--- + generateNmeaRMC(ulpLocation, locationExtended, gnssSvMeta, + *pTm, sentence, sizeof(sentence)); + + // ---$GPGGA/$GLGGA/$GAGGA/$GNGGA--- + generateNmeaGGA(ulpLocation, locationExtended, gnssSvMeta, + *pTm, svUsedCount, sentence, sizeof(sentence)); + +} + +void +GnssAdapter::generateNmeaBlank() +{ + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + int length = 0; + + strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + length = nmeaPutChecksum(sentence, sizeof(sentence)); + reportNmeaEvent(sentence, length); + + strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + length = nmeaPutChecksum(sentence, sizeof(sentence)); + reportNmeaEvent(sentence, length); + + strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); + length = nmeaPutChecksum(sentence, sizeof(sentence)); + reportNmeaEvent(sentence, length); + + strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); + length = nmeaPutChecksum(sentence, sizeof(sentence)); + reportNmeaEvent(sentence, length); + + strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); + length = nmeaPutChecksum(sentence, sizeof(sentence)); + reportNmeaEvent(sentence, length); +} + +void +GnssAdapter::generateNmeaGSV(const GnssSvNotification& svNotify, NmeaSvMeta& svMeta, + char* sentence, size_t size) +{ + if (!sentence || size == 0) { + LOC_LOGE("%s]: NMEA Error invalid argument.", __func__); + return; + } + + char* pMarker = sentence; + int lengthRemaining = size; + int length = 0; + int sentenceCount = 0; + int sentenceNumber = 1; + int svCount = 0; + int sv = 1; + + for (sv=1; sv <= svNotify.count; sv++) { + if (svMeta.svType == svNotify.gnssSvs[sv - 1].type) { + // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == + (svNotify.gnssSvs[sv - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { + svCount++; + } + } + } + + if (svCount == 0) { + // no svs in view, so just send a blank $--GSV sentence + snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", svMeta.talker); + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); + return; + } + + sv = 1; + sentenceNumber = 1; + sentenceCount = svCount / 4 + (svCount % 4 != 0); + + while (sentenceNumber <= sentenceCount) { + pMarker = sentence; + lengthRemaining = size; + + length = snprintf(pMarker, lengthRemaining, "$%sGSV,%d,%d,%02d", + svMeta.talker, sentenceCount, sentenceNumber, svCount); + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (int i=0; (sv <= svNotify.count) && (i < 4); sv++) { + if (svMeta.svType == svNotify.gnssSvs[sv - 1].type) { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svNotify.gnssSvs[sv - 1].svId, + (int)(0.5 + svNotify.gnssSvs[sv - 1].elevation), //float to int + (int)(0.5 + svNotify.gnssSvs[sv - 1].azimuth)); //float to int + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (svNotify.gnssSvs[sv - 1].cN0Dbhz > 0) { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svNotify.gnssSvs[sv - 1].cN0Dbhz)); //float to int + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + } + i++; + } + } + + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); + sentenceNumber++; + } //while +} + +uint8_t +GnssAdapter::generateNmeaGSA(const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, char* sentence, size_t size) +{ + if (!sentence || size == 0) { + LOC_LOGE("%s]: NMEA Error invalid arguments.", __func__); + return 0; + } + + char* pMarker = sentence; + int lengthRemaining = size; + int length = 0; + + uint8_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + + char fixType = '\0'; + + uint32_t svIdOffset = svMeta.svIdOffset; + uint32_t mask = svMeta.mask; + + for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) { + if (mask & 1) { + svUsedList[svUsedCount++] = i + svIdOffset; + } + mask = mask >> 1; + } + + if (svUsedCount == 0 && LOC_GNSS_CONSTELLATION_GPS != svMeta.svType) { + return 0; + } + + if (svUsedCount == 0) { + fixType = '1'; // no fix + } else if (svUsedCount <= 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 + // 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, "$%sGSA,A,%c,", svMeta.talker, fixType); + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__);; + return 0; + } + pMarker += length; + lengthRemaining -= length; + + // Add first 12 satellite IDs + for (uint8_t i = 0; i < 12; i++) { + if (i < svUsedCount) { + length = snprintf(pMarker, lengthRemaining, "%02d,", svUsedList[i]); + } else { + length = snprintf(pMarker, lengthRemaining, ","); + } + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return 0; + } + pMarker += length; + lengthRemaining -= length; + } + + // Add the position/horizontal/vertical DOP values + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", + locationExtended.pdop, + locationExtended.hdop, + locationExtended.vdop); + } else { + length = snprintf(pMarker, lengthRemaining, ",,"); + } + + /* Sentence is ready, add checksum and broadcast */ + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); + + return svUsedCount; +} + +void +GnssAdapter::generateNmeaVTG(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, char* sentence, size_t size) +{ + if (!sentence || size == 0) { + LOC_LOGE("%s]: NMEA Error invalid arguments.", __func__); + return; + } + + char* pMarker = sentence; + int lengthRemaining = size; + int length = 0; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) + { + float magTrack = ulpLocation.gpsLocation.bearing; + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) + { + float magTrack = ulpLocation.gpsLocation.bearing - locationExtended.magneticDeviation; + if (magTrack < 0.0) + magTrack += 360.0; + else if (magTrack > 360.0) + magTrack -= 360.0; + } + + length = snprintf(pMarker, lengthRemaining, "$%sVTG,%.1lf,T,%.1lf,M,", + svMeta.talker, ulpLocation.gpsLocation.bearing, magTrack); + } + else + { + length = snprintf(pMarker, lengthRemaining, "$%sVTG,,T,,M,", svMeta.talker); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) + { + float speedKnots = ulpLocation.gpsLocation.speed * (3600.0/1852.0); + float speedKmPerHour = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix + else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous + else + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential + + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); +} + +void +GnssAdapter::generateNmeaRMC(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, tm& utcTime, + char* sentence, size_t size) +{ + if (!sentence || size == 0) { + LOC_LOGE("NMEA Error invalid arguments."); + return; + } + + int utcYear = utcTime.tm_year % 100; // 2 digit year + int utcMonth = utcTime.tm_mon + 1; // tm_mon starts at zero + int utcDay = utcTime.tm_mday; + int utcHours = utcTime.tm_hour; + int utcMinutes = utcTime.tm_min; + int utcSeconds = utcTime.tm_sec; + int utcMSeconds = (ulpLocation.gpsLocation.timestamp)%1000; + + char* pMarker = sentence; + int lengthRemaining = size; + int length = 0; + + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , + svMeta.talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { + double latitude = ulpLocation.gpsLocation.latitude; + double longitude = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) { + float speedKnots = ulpLocation.gpsLocation.speed * (3600.0/1852.0); + length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); + } else { + length = snprintf(pMarker, lengthRemaining, ","); + } + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) { + length = snprintf(pMarker, lengthRemaining, "%.1lf,", ulpLocation.gpsLocation.bearing); + } else { + length = snprintf(pMarker, lengthRemaining, ","); + } + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) { + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix + } else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) { + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous + } else { + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential + } + + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); +} + +void +GnssAdapter::generateNmeaGGA(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, tm& utcTime, uint32_t svUsedCount, + char* sentence, size_t size) +{ + if (!sentence || size == 0) { + LOC_LOGE("NMEA Error invalid arguments."); + return; + } + + int utcYear = utcTime.tm_year % 100; // 2 digit year + int utcMonth = utcTime.tm_mon + 1; // tm_mon starts at zero + int utcDay = utcTime.tm_mday; + int utcHours = utcTime.tm_hour; + int utcMinutes = utcTime.tm_min; + int utcSeconds = utcTime.tm_sec; + int utcMSeconds = (ulpLocation.gpsLocation.timestamp)%1000; + + char* pMarker = sentence; + int lengthRemaining = size; + int length = 0; + + length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , + svMeta.talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { + double latitude = ulpLocation.gpsLocation.latitude; + double longitude = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + char gpsQuality; + if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) { + gpsQuality = '0'; // 0 means no fix + } else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) { + gpsQuality = '1'; // 1 means GPS fix + } else { + gpsQuality = '2'; // 2 means DGPS fix + } + + // Number of satellites in use, 00-12 + if (svUsedCount > MAX_SATELLITES_IN_USE) { + svUsedCount = MAX_SATELLITES_IN_USE; + } + + // Add the position/horizontal/vertical DOP values + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { + length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", + gpsQuality, svUsedCount, locationExtended.hdop); + } else { + length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", + gpsQuality, svUsedCount); + } + + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); + return; + } + pMarker += length; + lengthRemaining -= length; + + if ((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ALTITUDE) && + (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) { + length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", + ulpLocation.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); + } else { + length = snprintf(pMarker, lengthRemaining,",,,"); + } + + length = nmeaPutChecksum(sentence, size); + reportNmeaEvent(sentence, length); +} diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h new file mode 100644 index 00000000..5bd2a12e --- /dev/null +++ b/gnss/GnssAdapter.h @@ -0,0 +1,259 @@ +/* Copyright (c) 2017, 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 GNSS_ADAPTER_H +#define GNSS_ADAPTER_H + +#include +#include +#include +#include + +#define MAX_URL_LEN 256 +#define NMEA_SENTENCE_MAX_LENGTH 200 +#define GLONASS_SV_ID_OFFSET 64 +#define MAX_SATELLITES_IN_USE 12 +#define LOC_NI_NO_RESPONSE_TIME 20 +#define LOC_GPS_NI_RESPONSE_IGNORE 4 + +class GnssAdapter; + +typedef struct { + pthread_t thread; /* NI thread */ + uint32_t respTimeLeft; /* examine time for NI response */ + bool respRecvd; /* NI User reponse received or not from Java layer*/ + void* rawRequest; + uint32_t reqID; /* ID to check against response */ + GnssNiResponse resp; + pthread_cond_t tCond; + pthread_mutex_t tLock; + GnssAdapter* adapter; +} NiSession; +typedef struct { + NiSession session; /* SUPL NI Session */ + NiSession sessionEs; /* Emergency SUPL NI Session */ + uint32_t reqIDCounter; +} NiData; + +typedef enum { + NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA + NMEA_PROVIDER_MP // Modem Processor Provider of NMEA +} NmeaProviderType; +typedef struct { + GnssSvType svType; + const char* talker; + uint64_t mask; + uint32_t svIdOffset; +} NmeaSvMeta; + +using namespace loc_core; + +class GnssAdapter : public LocAdapterBase { + /* ==== ULP ============================================================================ */ + UlpProxyBase* mUlpProxy; + + /* ==== CLIENT ========================================================================= */ + typedef std::map ClientDataMap; + ClientDataMap mClientData; + + /* ==== TRACKING ======================================================================= */ + LocationSessionMap mTrackingSessions; + GnssSuplMode mSuplMode; + LocPosMode mUlpPositionMode; + GnssSvUsedInPosition mGnssSvIdUsedInPosition; + bool mGnssSvIdUsedInPosAvail; + + /* ==== CONTROL ======================================================================== */ + LocationControlCallbacks mControlCallbacks; + uint32_t mPowerVoteId; + + /* ==== NI ============================================================================= */ + NiData mNiData; + + /*==== CONVERSION ===================================================================*/ + static void convertOptions(LocPosMode& out, const LocationOptions& options); + static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation, + const LocPosTechMask techMask); + static void convertLocationInfo(GnssLocationInfoNotification& out, + const GpsLocationExtended& locationExtended); + +public: + + GnssAdapter(); + virtual ~GnssAdapter(); + + /* ==== SSR ============================================================================ */ + /* ======== EVENTS ====(Called from QMI Thread)========================================= */ + virtual void handleEngineUpEvent(); + /* ======== UTILITIES ================================================================== */ + void restartSessions(); + + /* ==== ULP ============================================================================ */ + /* ======== COMMANDS ====(Called from ULP Thread)==================================== */ + virtual void setUlpProxyCommand(UlpProxyBase* ulp); + /* ======== UTILITIES ================================================================== */ + void setUlpProxy(UlpProxyBase* ulp); + inline UlpProxyBase* getUlpProxy() { return mUlpProxy; } + + /* ==== CLIENT ========================================================================= */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); + void removeClientCommand(LocationAPI* client); + void requestCapabilitiesCommand(LocationAPI* client); + /* ======== UTILITIES ================================================================== */ + void saveClient(LocationAPI* client, const LocationCallbacks& callbacks); + void eraseClient(LocationAPI* client); + void updateClientsEventMask(); + void stopClientSessions(LocationAPI* client); + LocationCallbacks getClientCallbacks(LocationAPI* client); + + /* ==== TRACKING ======================================================================= */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + uint32_t startTrackingCommand(LocationAPI* client, LocationOptions& options); + void updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, LocationOptions& options); + void stopTrackingCommand(LocationAPI* client, uint32_t id); + /* ======================(Called from ULP Thread)======================================= */ + virtual void setPositionModeCommand(LocPosMode& locPosMode); + virtual void startTrackingCommand(); + virtual void stopTrackingCommand(); + virtual void getZppCommand(); + /* ======== RESPONSES ================================================================== */ + void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId); + /* ======== UTILITIES ================================================================== */ + bool hasTrackingCallback(LocationAPI* client); + bool hasMeasurementsCallback(LocationAPI* client); + bool isTrackingSession(LocationAPI* client, uint32_t sessionId); + void saveTrackingSession(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options); + void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); + void setUlpPositionMode(const LocPosMode& mode) { mUlpPositionMode = mode; } + LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } + void setSuplMode(GnssSuplMode mode) { mSuplMode = mode; } + LocationError startTrackingMultiplex(const LocationOptions& options); + LocationError startTracking(const LocationOptions& options); + LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id); + LocationError stopTracking(); + + /* ==== NI ============================================================================= */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void gnssNiResponseCommand(LocationAPI* client, uint32_t id, GnssNiResponse response); + /* ======================(Called from NI Thread)======================================== */ + void gnssNiResponseCommand(GnssNiResponse response, void* rawRequest); + /* ======== UTILITIES ================================================================== */ + bool hasNiNotifyCallback(LocationAPI* client); + NiData& getNiData() { return mNiData; } + + /* ==== CONTROL ======================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + uint32_t enableCommand(LocationTechnologyType techType); + void disableCommand(uint32_t id); + void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); + void readConfigCommand(); + void setConfigCommand(); + uint32_t* gnssUpdateConfigCommand(GnssConfig config); + uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + /* ======== RESPONSES ================================================================== */ + void reportResponse(LocationError err, uint32_t sessionId); + void reportResponse(size_t count, LocationError* errs, uint32_t* ids); + /* ======== UTILITIES ================================================================== */ + LocationControlCallbacks& getControlCallbacks() { return mControlCallbacks; } + void setControlCallbacks(const LocationControlCallbacks& controlCallbacks) + { mControlCallbacks = controlCallbacks; } + void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } + uint32_t getPowerVoteId() { return mPowerVoteId; } + bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); + + /* ==== REPORTS ======================================================================== */ + /* ======== EVENTS ====(Called from QMI/ULP Thread)===================================== */ + virtual void reportPositionEvent(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask techMask, + bool fromUlp=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); + virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); + virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); + virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); + virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); + /* ======== UTILITIES ================================================================= */ + void reportPosition(const UlpLocation &ulpLocation, + const GpsLocationExtended &locationExtended, + enum loc_sess_status status, + LocPosTechMask techMask); + void reportSv(GnssSvNotification& svNotify); + void reportNmea(const char* nmea, size_t length); + bool requestNiNotify(const GnssNiNotification& notify, const void* data); + void reportGnssMeasurementData(const GnssMeasurementsNotification& measurementsNotify); + + /*==== NMEA Generation =============================================================== */ + /*======== SVS ======================================================================= */ + void generateNmea(const GnssSvNotification& svNotify); + void generateNmeaGSV(const GnssSvNotification& svNotify, + NmeaSvMeta& svMeta, char* sentence, size_t size); + /*======== POSITION ================================================================== */ + void generateNmea(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended); + void generateNmeaBlank(); + uint8_t generateNmeaGSA(const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, char* sentence, size_t size); + void generateNmeaVTG(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, char* sentence, size_t size); + void generateNmeaRMC(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, tm& utcTime, char* sentence, size_t size); + void generateNmeaGGA(const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + NmeaSvMeta& svMeta, tm& utcTime, uint32_t svUsedCount, + char* sentence, size_t size); + /*======== UTILITIES ================================================================*/ + int nmeaPutChecksum(char *nmea, size_t maxSize); + + /*==== CONVERSION ===================================================================*/ + static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); + static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock); + static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion); + static GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); + static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile); + static GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); + static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl); + static uint32_t convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices); + static uint32_t convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask); + static GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); + static uint32_t convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask); + static GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); + static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask); + static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask); + + void injectLocationCommand(double latitude, double longitude, float accuracy); + void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); + +}; + +#endif //GNSS_ADAPTER_H diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp new file mode 100644 index 00000000..242e72e6 --- /dev/null +++ b/gnss/location_gnss.cpp @@ -0,0 +1,206 @@ +/* Copyright (c) 2017, 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 "GnssAdapter.h" +#include "location_interface.h" + +static GnssAdapter* gGnssAdapter = NULL; + +static void initialize(); +static void deinitialize(); + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks); +static void removeClient(LocationAPI* client); +static void requestCapabilities(LocationAPI* client); + +static uint32_t startTracking(LocationAPI* client, LocationOptions& options); +static void updateTrackingOptions(LocationAPI* client, uint32_t id, LocationOptions& options); +static void stopTracking(LocationAPI* client, uint32_t id); + +static void gnssNiResponse(LocationAPI* client, uint32_t id, GnssNiResponse response); +static uint32_t gnssDeleteAidingData(GnssAidingData& data); + +static void setControlCallbacks(LocationControlCallbacks& controlCallbacks); +static uint32_t enable(LocationTechnologyType techType); +static void disable(uint32_t id); +static uint32_t* gnssUpdateConfig(GnssConfig config); + +static void injectLocation(double latitude, double longitude, float accuracy); +static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty); + +static const GnssInterface gGnssInterface = { + sizeof(GnssInterface), + initialize, + deinitialize, + addClient, + removeClient, + requestCapabilities, + startTracking, + updateTrackingOptions, + stopTracking, + gnssNiResponse, + setControlCallbacks, + enable, + disable, + gnssUpdateConfig, + gnssDeleteAidingData, + injectLocation, + injectTime +}; + +#ifndef DEBUG_X86 +extern "C" const GnssInterface* getGnssInterface() +#else +const GnssInterface* getGnssInterface() +#endif // DEBUG_X86 +{ + return &gGnssInterface; +} + +static void initialize() +{ + if (NULL == gGnssAdapter) { + gGnssAdapter = new GnssAdapter(); + } +} + +static void deinitialize() +{ + if (NULL != gGnssAdapter) { + delete gGnssAdapter; + gGnssAdapter = NULL; + } +} + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->addClientCommand(client, callbacks); + } +} + +static void removeClient(LocationAPI* client) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->removeClientCommand(client); + } +} + +static void requestCapabilities(LocationAPI* client) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->requestCapabilitiesCommand(client); + } +} + +static uint32_t startTracking(LocationAPI* client, LocationOptions& options) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->startTrackingCommand(client, options); + } else { + return 0; + } +} + +static void updateTrackingOptions(LocationAPI* client, uint32_t id, LocationOptions& options) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->updateTrackingOptionsCommand(client, id, options); + } +} + +static void stopTracking(LocationAPI* client, uint32_t id) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->stopTrackingCommand(client, id); + } +} + +static void gnssNiResponse(LocationAPI* client, uint32_t id, GnssNiResponse response) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->gnssNiResponseCommand(client, id, response); + } +} + +static void setControlCallbacks(LocationControlCallbacks& controlCallbacks) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->setControlCallbacksCommand(controlCallbacks); + } +} + +static uint32_t enable(LocationTechnologyType techType) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->enableCommand(techType); + } else { + return 0; + } +} + +static void disable(uint32_t id) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->disableCommand(id); + } +} + +static uint32_t* gnssUpdateConfig(GnssConfig config) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->gnssUpdateConfigCommand(config); + } else { + return NULL; + } +} + +static uint32_t gnssDeleteAidingData(GnssAidingData& data) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->gnssDeleteAidingDataCommand(data); + } else { + return NULL; + } +} + +static void injectLocation(double latitude, double longitude, float accuracy) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->injectLocationCommand(latitude, longitude, accuracy); + } +} + +static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->injectTimeCommand(time, timeReference, uncertainty); + } +} + diff --git a/loc_api/Android.mk b/loc_api/Android.mk deleted file mode 100644 index 743b3860..00000000 --- a/loc_api/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) - -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)) - -endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/loc_api/Makefile.am b/loc_api/Makefile.am deleted file mode 100644 index 23ccc35e..00000000 --- a/loc_api/Makefile.am +++ /dev/null @@ -1,120 +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 \ - -std=c++11 - -AM_CPPFLAGS = \ - -std=c++11 - -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.cpp \ - 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 - -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 libloc_ds_api.la libloc_api_v02.la diff --git a/loc_api/libloc_api-rpc-50001/Android.mk b/loc_api/libloc_api-rpc-50001/Android.mk deleted file mode 100644 index 6c5d5339..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk deleted file mode 100644 index bb3d924b..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am deleted file mode 100644 index f5c51369..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h deleted file mode 100644 index b2b4e2ab..00000000 --- a/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 LocGpsNiEncodingType convertNiEncodingType(int loc_encoding); - static int NIEventFillVerfiyType(LocGpsNiNotification ¬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(LocGpsUtcTime 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(LocGpsAidingData f); - virtual enum loc_api_adapter_err - informNiResponse(LocGpsUserResponseType 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, LocAGpsType 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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h deleted file mode 100644 index 49a6d0be..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h deleted file mode 100644 index c483b4a1..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h deleted file mode 100644 index f0374280..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h deleted file mode 100644 index 6df33ae1..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h deleted file mode 100644 index 43208bda..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h deleted file mode 100644 index ba41d08b..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp deleted file mode 100644 index f0f84b50..00000000 --- a/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 LOC_GPS_POSITION_RECURRENCE_SINGLE: - fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; - break; - case LOC_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(LocGpsUtcTime 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(LocGpsUserResponseType 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 LOC_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 LOC_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 LOC_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(LocGpsAidingData 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 |= LOC_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 |= LOC_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 |= LOC_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 |= LOC_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 |= LOC_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 > LOC_GPS_MAX_SVS) - { - num_svs_max = LOC_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(LocGpsSvInfo); - 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(LOC_GPS_STATUS_ENGINE_ON); - LocApiBase::reportStatus(LOC_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(LOC_GPS_STATUS_SESSION_END); - LocApiBase::reportStatus(LOC_GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiBase::reportStatus(LOC_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, LocAGpsType 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 (LOC_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; - LocAGpsType 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 = LOC_AGPS_TYPE_SUPL; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_AGPS_TYPE_SUPL\n handle - %d", connHandle); - } else { - agps_type = LOC_AGPS_TYPE_WWAN_ANY; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_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, LOC_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) -{ - LocGpsNiNotification 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 = LOC_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= LOC_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 = LOC_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 = LOC_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(LocGpsNiNotification ¬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 = LOC_GPS_NI_RESPONSE_NORESP; - return 1; - case RPC_LOC_NI_USER_NOTIFY_ONLY: - notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY; - notif.default_response = LOC_GPS_NI_RESPONSE_NORESP; - return 1; - case RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP: - notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY; - notif.default_response = LOC_GPS_NI_RESPONSE_ACCEPT; - return 1; - case RPC_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP: - notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY; - notif.default_response = LOC_GPS_NI_RESPONSE_DENY; - return 1; - case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: - notif.notify_flags = LOC_GPS_NI_PRIVACY_OVERRIDE; - notif.default_response = LOC_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) - ); -} - -LocGpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) -{ - switch (loc_encoding) - { - case RPC_LOC_NI_SUPL_UTF8: - return LOC_GPS_ENC_SUPL_UTF8; - case RPC_LOC_NI_SUPL_UCS2: - return LOC_GPS_ENC_SUPL_UCS2; - case RPC_LOC_NI_SUPL_GSM_DEFAULT: - return LOC_GPS_ENC_SUPL_GSM_DEFAULT; - case RPC_LOC_NI_SS_LANGUAGE_UNSPEC: - return LOC_GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - default: - return LOC_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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c deleted file mode 100644 index 837ef113..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c deleted file mode 100644 index eb685fdf..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c deleted file mode 100644 index 8c12426b..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c deleted file mode 100644 index ae629d7c..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c deleted file mode 100644 index db5b291a..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk deleted file mode 100644 index c0987e6d..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am deleted file mode 100644 index 4ac8c8a4..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h deleted file mode 100644 index 87f2c377..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h deleted file mode 100644 index 8107de2a..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h deleted file mode 100644 index 6138432e..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h deleted file mode 100644 index 875c4f08..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c deleted file mode 100644 index 2ef5852e..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c deleted file mode 100644 index ad171dc4..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c deleted file mode 100644 index 3e39576b..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c deleted file mode 100644 index 21be8f43..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c deleted file mode 100644 index a0fdcabe..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c deleted file mode 100644 index b469eb0a..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr deleted file mode 100644 index 82dca569..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr deleted file mode 100644 index 4756c6c5..00000000 --- a/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/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr deleted file mode 100644 index e059c661..00000000 --- a/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/loc_api/libloc_api_50001/Android.mk b/loc_api/libloc_api_50001/Android.mk deleted file mode 100644 index c33bc915..00000000 --- a/loc_api/libloc_api_50001/Android.mk +++ /dev/null @@ -1,116 +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.cpp \ - 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 \ - hardware/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.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) -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 += \ - gps_interface.cpp \ - gps_converter.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/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp deleted file mode 100644 index c312a24e..00000000 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ /dev/null @@ -1,606 +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_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 - size_t len = strlen(buf); - while (--len >= 0 && isspace(buf[len])) { - buf[len] = '\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(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt){ - sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, - locationExtended, svExt)); -} - -void LocEngAdapter::reportSv(LocGnssSvStatus &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(LocGpsStatusValue status) -{ - sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); -} - -void LocEngAdapter::reportStatus(LocGpsStatusValue status) -{ - if (!mUlp->reportStatus(status)) { - mInternalAdapter->reportStatus(status); - } -} - -void LocInternalAdapter::reportNmea(const char* nmea, int length) -{ - sendMsg(new LocEngReportNmea(mLocEngAdapter->getOwner(), nmea, length)); -} - -inline void LocEngAdapter::reportNmea(const char* nmea, int length) -{ - if (!mUlp->reportNmea(nmea, length)) { - //Report it to HAL - mInternalAdapter->reportNmea(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, LocAGpsType 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(LocGpsNiNotification ¬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(LocGpsUtcTime 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(LocGnssData &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/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h deleted file mode 100644 index e341651d..00000000 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ /dev/null @@ -1,380 +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 - -#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(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportStatus(LocGpsStatusValue status); - virtual void setPositionModeInt(LocPosMode& posMode); - virtual void startFixInt(); - virtual void stopFixInt(); - virtual void getZppInt(); - virtual void setUlpProxy(UlpProxyBase* ulp); - virtual void reportNmea(const char* nmea, int length); -}; - -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; - LocGnssSystemInfo 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(LocGpsAidingData 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, LocAGpsType 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(LocGpsUserResponseType 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(bool isDueToSsr) - { - return mLocApi->initDataServiceClient(isDueToSsr); - } - inline virtual int openAndStartDataCall() - { - return mLocApi->openAndStartDataCall(); - } - inline virtual void stopDataCall() - { - mLocApi->stopDataCall(); - } - inline virtual void closeDataCall() - { - mLocApi->closeDataCall(); - } - inline virtual void releaseDataServiceClient() - { - mLocApi->releaseDataServiceClient(); - } - inline enum loc_api_adapter_err - getZpp(LocGpsLocation &zppLoc, LocPosTechMask &tech_mask) - { - return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); - } - enum loc_api_adapter_err setTime(LocGpsUtcTime time, - int64_t timeReference, - int uncertainty); - enum loc_api_adapter_err setXtraVersionCheck(int check); - inline virtual void installAGpsCert(const LocDerEncodedCertificate* 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(LocGnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - virtual void reportStatus(LocGpsStatusValue 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, LocAGpsType agps_type); - virtual bool releaseATL(int connHandle); - virtual bool requestNiNotify(LocGpsNiNotification ¬ify, const void* data); - virtual bool requestSuplES(int connHandle); - virtual bool reportDataCallOpened(); - virtual bool reportDataCallClosed(); - virtual void reportGnssMeasurementData(LocGnssData &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/loc_api/libloc_api_50001/Makefile.am b/loc_api/libloc_api_50001/Makefile.am deleted file mode 100644 index 4c1ccf7d..00000000 --- a/loc_api/libloc_api_50001/Makefile.am +++ /dev/null @@ -1,62 +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.cpp \ - 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 - -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 diff --git a/loc_api/libloc_api_50001/gps_converter.cpp b/loc_api/libloc_api_50001/gps_converter.cpp deleted file mode 100644 index 1ca23cf0..00000000 --- a/loc_api/libloc_api_50001/gps_converter.cpp +++ /dev/null @@ -1,255 +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 - -void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out) { - memset(&out, 0, sizeof(LocDerEncodedCertificate)); - out.length = in.length; - out.data = in.data; -} - -void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out) { - memset(&out, 0, sizeof(GpsLocation)); - out.size = sizeof(GpsLocation); - out.flags = (LocGpsLocationFlags)in.flags; - out.latitude = in.latitude; - out.longitude = in.longitude; - out.altitude = in.altitude; - out.speed = in.speed; - out.bearing = in.bearing; - out.accuracy = in.accuracy; - out.timestamp = Q2A_GpsUtcTime(in.timestamp); -} - -void Q2A_GpsSvInfo(const LocGpsSvInfo& in, GpsSvInfo& out) { - memset(&out, 0, sizeof(GpsSvInfo)); - out.size = sizeof(GpsSvInfo); - out.prn = in.prn; - out.snr = in.snr; - out.elevation = in.elevation; - out.azimuth = in.azimuth; -} - -void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out) { - memset(&out, 0, sizeof(GpsSvStatus)); - out.size = sizeof(GpsSvStatus); - out.num_svs = in.num_svs; - int len = LOC_GPS_MAX_SVS < GPS_MAX_SVS ? LOC_GPS_MAX_SVS : GPS_MAX_SVS; - for (int i = 0; i < len; i++) { - Q2A_GpsSvInfo(in.sv_list[i], out.sv_list[i]); - } - out.ephemeris_mask = in.ephemeris_mask; - out.almanac_mask = in.almanac_mask; - out.used_in_fix_mask = in.used_in_fix_mask; -} - -void Q2A_GnssSvInfo(const LocGnssSvInfo& in, GnssSvInfo& out) { - memset(&out, 0, sizeof(GnssSvInfo)); - out.size = sizeof(GnssSvInfo); - out.svid = in.svid; - out.constellation = (GnssConstellationType)in.constellation; - out.c_n0_dbhz = in.c_n0_dbhz; - out.elevation = in.elevation; - out.azimuth = in.azimuth; - out.flags = (GnssSvFlags)in.flags; -} - -void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out) { - memset(&out, 0, sizeof(GnssSvStatus)); - out.size = sizeof(GnssSvStatus); - out.num_svs = in.num_svs; - int len = LOC_GNSS_MAX_SVS < GNSS_MAX_SVS ? LOC_GNSS_MAX_SVS : GNSS_MAX_SVS; - for (int i = 0; i < len; i++) { - Q2A_GnssSvInfo(in.gnss_sv_list[i], out.gnss_sv_list[i]); - } -} - -void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out) { - memset(&out, 0, sizeof(GpsNiNotification)); - out.size = sizeof(GpsNiNotification); - out.notification_id = in.notification_id; - out.ni_type = (GpsNiType)in.ni_type; - out.notify_flags = (GpsNiNotifyFlags)in.notify_flags; - out.timeout = in.timeout; - out.default_response = (GpsUserResponseType)in.default_response; - int len = LOC_GPS_NI_SHORT_STRING_MAXLEN < GPS_NI_SHORT_STRING_MAXLEN - ? LOC_GPS_NI_SHORT_STRING_MAXLEN : GPS_NI_SHORT_STRING_MAXLEN; - for (int i = 0; i < len; i++) { - out.requestor_id[i] = in.requestor_id[i]; - } - len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN - ? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN; - for (int i = 0; i < len; i++) { - out.text[i] = in.text[i]; - } - out.requestor_id_encoding = (GpsNiEncodingType)in.requestor_id_encoding; - out.text_encoding = (GpsNiEncodingType)in.text_encoding; - len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN - ? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN; - for (int i = 0; i < len; i++) { - out.extras[i] = in.extras[i]; - } -} - -void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out) { - memset(&out, 0, sizeof(GpsStatus)); - out.size = sizeof(GpsStatus); - out.status = (GpsStatusValue)in.status; -} - -void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out) { - memset(&out, 0, sizeof(GnssSystemInfo)); - out.size = sizeof(GnssSystemInfo); - out.year_of_hw = in.year_of_hw; -} - -void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out) { - memset(&out, 0, sizeof(AGpsStatus)); - out.size = sizeof(AGpsStatus); - out.type = (AGpsType)in.type; - out.status = (AGpsStatusValue)in.status; - out.ipaddr = in.ipaddr; - memcpy(&out.addr, &in.addr, sizeof(sockaddr_storage)); -} - -void Q2A_GpsMeasurement(const LocGpsMeasurement& in, GpsMeasurement& out) { - memset(&out, 0, sizeof(GpsMeasurement)); - out.size = sizeof(GpsMeasurement); - out.flags = (GpsMeasurementFlags)in.flags; - out.prn = in.prn; - out.time_offset_ns = in.time_offset_ns; - out.state = (GpsMeasurementState)in.state; - out.received_gps_tow_ns = in.received_gps_tow_ns; - out.received_gps_tow_uncertainty_ns = in.received_gps_tow_uncertainty_ns; - out.c_n0_dbhz = in.c_n0_dbhz; - out.pseudorange_rate_mps = in.pseudorange_rate_mps; - out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps; - out.accumulated_delta_range_state = (GpsAccumulatedDeltaRangeState)in.accumulated_delta_range_state; - out.accumulated_delta_range_m = in.accumulated_delta_range_m; - out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m; - out.pseudorange_m = in.pseudorange_m; - out.pseudorange_uncertainty_m = in.pseudorange_uncertainty_m; - out.code_phase_chips = in.code_phase_chips; - out.code_phase_uncertainty_chips = in.code_phase_uncertainty_chips; - out.carrier_frequency_hz = in.carrier_frequency_hz; - out.carrier_cycles = in.carrier_cycles; - out.carrier_phase = in.carrier_phase; - out.carrier_phase_uncertainty = in.carrier_phase_uncertainty; - out.loss_of_lock = (GpsLossOfLock)in.loss_of_lock; - out.bit_number = in.bit_number; - out.time_from_last_bit_ms = in.time_from_last_bit_ms; - out.doppler_shift_hz = in.doppler_shift_hz; - out.doppler_shift_uncertainty_hz = in.doppler_shift_uncertainty_hz; - out.multipath_indicator = (GpsMultipathIndicator)in.multipath_indicator; - out.snr_db = in.snr_db; - out.elevation_deg = in.elevation_deg; - out.elevation_uncertainty_deg = in.elevation_uncertainty_deg; - out.azimuth_deg = in.azimuth_deg; - out.azimuth_uncertainty_deg = in.azimuth_uncertainty_deg; - out.used_in_fix = in.used_in_fix; -} - -void Q2A_GpsClock(const LocGpsClock& in, GpsClock& out) { - memset(&out, 0, sizeof(GpsClock)); - out.size = sizeof(GpsClock); - out.flags = (GpsClockFlags)in.flags; - out.leap_second = in.leap_second; - out.type = (GpsClockType)in.type; - out.time_ns = in.time_ns; - out.time_uncertainty_ns = in.time_uncertainty_ns; - out.full_bias_ns = in.full_bias_ns; - out.bias_ns = in.bias_ns; - out.bias_uncertainty_ns = in.bias_uncertainty_ns; - out.drift_nsps = in.drift_nsps; - out.drift_uncertainty_nsps = in.drift_uncertainty_nsps; -} - -void Q2A_GpsData(const LocGpsData& in, GpsData& out) { - memset(&out, 0, sizeof(GpsData)); - out.size = sizeof(GpsData); - out.measurement_count = in.measurement_count; - int len = LOC_GPS_MAX_MEASUREMENT < GPS_MAX_MEASUREMENT - ? LOC_GPS_MAX_MEASUREMENT : GPS_MAX_MEASUREMENT; - for (int i = 0; i < len; i++) { - Q2A_GpsMeasurement(in.measurements[i], out.measurements[i]); - } - Q2A_GpsClock(in.clock, out.clock); -} - -void Q2A_GnssMeasurement(const LocGnssMeasurement& in, GnssMeasurement& out) { - memset(&out, 0, sizeof(GnssMeasurement)); - out.size = sizeof(GnssMeasurement); - out.flags = (GpsMeasurementFlags)in.flags; - out.svid = in.svid; - out.constellation = (GnssConstellationType)in.constellation; - out.time_offset_ns = in.time_offset_ns; - out.state = (GnssMeasurementState)in.state; - out.received_sv_time_in_ns = in.received_sv_time_in_ns; - out.received_sv_time_uncertainty_in_ns = in.received_sv_time_uncertainty_in_ns; - out.c_n0_dbhz = in.c_n0_dbhz; - out.pseudorange_rate_mps = in.pseudorange_rate_mps; - out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps; - out.accumulated_delta_range_state = (GnssAccumulatedDeltaRangeState)in.accumulated_delta_range_state; - out.accumulated_delta_range_m = in.accumulated_delta_range_m; - out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m; - out.carrier_frequency_hz = in.carrier_frequency_hz; - out.carrier_cycles = in.carrier_cycles; - out.carrier_phase = in.carrier_phase; - out.carrier_phase_uncertainty = in.carrier_phase_uncertainty; - out.multipath_indicator = (GnssMultipathIndicator)in.multipath_indicator; - out.snr_db = in.snr_db; -} - -void Q2A_GnssClock(const LocGnssClock& in, GnssClock& out) { - memset(&out, 0, sizeof(GnssClock)); - out.size = sizeof(GnssClock); - out.flags = (GnssClockFlags)in.flags; - out.leap_second = in.leap_second; - out.time_ns = in.time_ns; - out.time_uncertainty_ns = in.time_uncertainty_ns; - out.full_bias_ns = in.full_bias_ns; - out.bias_ns = in.bias_ns; - out.bias_uncertainty_ns = in.bias_uncertainty_ns; - out.drift_nsps = in.drift_nsps; - out.drift_uncertainty_nsps = in.drift_uncertainty_nsps; - out.hw_clock_discontinuity_count = in.hw_clock_discontinuity_count; -} - -void Q2A_GnssData(const LocGnssData& in, GnssData& out) { - memset(&out, 0, sizeof(GnssData)); - out.size = sizeof(GnssData); - out.measurement_count = in.measurement_count; - int len = LOC_GNSS_MAX_MEASUREMENT < GNSS_MAX_MEASUREMENT - ? LOC_GNSS_MAX_MEASUREMENT : GNSS_MAX_MEASUREMENT; - for (int i = 0; i < len; i++) { - Q2A_GnssMeasurement(in.measurements[i], out.measurements[i]); - } - Q2A_GnssClock(in.clock, out.clock); -} diff --git a/loc_api/libloc_api_50001/gps_converter.h b/loc_api/libloc_api_50001/gps_converter.h deleted file mode 100644 index fa7c68a3..00000000 --- a/loc_api/libloc_api_50001/gps_converter.h +++ /dev/null @@ -1,69 +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. - * - */ - -#ifndef __GPS_CONVERTER_H__ -#define __GPS_CONVERTER_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include -#include - -#define A2Q_GpsAidingData(in) (LocGpsAidingData)in -#define A2Q_GpsUserResponseType(in) (LocGpsUserResponseType)in -#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in -#define A2Q_GpsUtcTime(in) (LocGpsUtcTime)in -#define A2Q_GpsPositionMode(in) (LocGpsPositionMode)in -#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in -#define A2Q_ApnIpType(in) (LocApnIpType)in -#define A2Q_AGpsType(in) (LocAGpsType)in -#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in - -#define Q2A_GpsUtcTime(in) (GpsUtcTime)in - -void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out); - -void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out); -void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out); -void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out); -void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out); -void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out); -void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out); -void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out); -void Q2A_GpsData(const LocGpsData& in, GpsData& out); -void Q2A_GnssData(const LocGnssData& in, GnssData& out); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif //__GPS_CONVERTER_H__ diff --git a/loc_api/libloc_api_50001/gps_interface.cpp b/loc_api/libloc_api_50001/gps_interface.cpp deleted file mode 100644 index 993874f7..00000000 --- a/loc_api/libloc_api_50001/gps_interface.cpp +++ /dev/null @@ -1,1196 +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. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "GpsInterface" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace loc_core; - -// All functions and variables should be static -// except gps_get_hardware_interface() and get_gps_interface() - -extern "C" const LocGpsInterface* loc_eng_gps_get_hardware_interface (); -extern "C" const LocGpsInterface* loc_eng_get_gps_interface(); - -/*=========================================================================== - Functions and variables for sGpsInterface -===========================================================================*/ -static const LocGpsInterface* pLocGpsInterface = NULL; - -static GpsCallbacks sGpsCallbacks; -static GpsCallbacks* pGpsCallbacks = NULL; - -static void local_gps_location_callback(LocGpsLocation* location); -static void local_gps_sv_status_callback(LocGpsSvStatus* sv_status); -static void local_gps_status_callback(LocGpsStatus* status); -static void local_gps_nmea_callback(LocGpsUtcTime timestamp, const char* nmea, int length); -static void local_gps_set_capabilities(uint32_t capabilities); -static void local_gps_acquire_wakelock(); -static void local_gps_release_wakelock(); -static pthread_t local_gps_create_thread(const char* name, void (*start)(void *), void* arg); -static void local_gps_request_utc_time(); -static void local_gnss_set_system_info(const LocGnssSystemInfo* info); -static void local_gnss_sv_status_callback(LocGnssSvStatus* sv_info); - -static LocGpsCallbacks sLocGpsCallbacks = { - sizeof(LocGpsCallbacks), - local_gps_location_callback, - local_gps_status_callback, - local_gps_sv_status_callback, - local_gps_nmea_callback, - local_gps_set_capabilities, - local_gps_acquire_wakelock, - local_gps_release_wakelock, - local_gps_create_thread, - local_gps_request_utc_time, - local_gnss_set_system_info, - local_gnss_sv_status_callback, -}; - -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); - -static const GpsInterface sGpsInterface = { - 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 -}; - -/*=========================================================================== - Functions and variables for sGpsXtraInterface -===========================================================================*/ -static const LocGpsXtraInterface* pLocGpsXtraInterface = NULL; - -static GpsXtraCallbacks sGpsXtraCallbacks; -static GpsXtraCallbacks* pGpsXtraCallbacks = NULL; - -static void local_gps_xtra_download_request(); -static pthread_t local_gps_xtra_create_thread(const char* name, void (*start)(void *), void* arg); - -static LocGpsXtraCallbacks sLocGpsXtraCallbacks = { - local_gps_xtra_download_request, - local_gps_xtra_create_thread -}; - -static int loc_xtra_init(GpsXtraCallbacks* callbacks); -static int loc_xtra_inject_data(char* data, int length); - -static const GpsXtraInterface sGpsXtraInterface = { - sizeof(GpsXtraInterface), - loc_xtra_init, - loc_xtra_inject_data -}; - -/*=========================================================================== - Functions and variables for sAGpsInterface -===========================================================================*/ -static const LocAGpsInterface* pLocAGpsInterface = NULL; - -static AGpsCallbacks sAGpsCallbacks; -static AGpsCallbacks* pAGpsCallbacks = NULL; - -static void local_agps_status_callback(LocAGpsStatus* status); -static pthread_t local_agps_create_thread(const char* name, void (*start)(void *), void* arg); - -static LocAGpsCallbacks sLocAGpsCallbacks = { - local_agps_status_callback, - local_agps_create_thread -}; - -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 sAGpsInterface = { - sizeof(AGpsInterface), - loc_agps_init, - loc_agps_open, - loc_agps_closed, - loc_agps_open_failed, - loc_agps_set_server, - loc_agps_open_with_apniptype -}; - -/*=========================================================================== - Functions and variables for SUPL sSuplCertificateInterface -===========================================================================*/ -static const LocSuplCertificateInterface* pLocSuplCertificateInterface = NULL; - -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 sSuplCertificateInterface = -{ - sizeof(SuplCertificateInterface), - loc_agps_install_certificates, - loc_agps_revoke_certificates -}; - -/*=========================================================================== - Functions and variables for sGpsNiInterface -===========================================================================*/ -static const LocGpsNiInterface* pLocGpsNiInterface = NULL; - -static GpsNiCallbacks sGpsNiCallbacks; -static GpsNiCallbacks* pGpsNiCallbacks = NULL; - -static void local_gps_ni_notify_callback(LocGpsNiNotification *notification); -static pthread_t local_gps_ni_create_thread(const char* name, void (*start)(void *), void* arg); - -static LocGpsNiCallbacks sLocGpsNiCallbacks = { - local_gps_ni_notify_callback, - local_gps_ni_create_thread -}; - -static void loc_ni_init(GpsNiCallbacks *callbacks); -static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); - -static const GpsNiInterface sGpsNiInterface = -{ - sizeof(GpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - -/*=========================================================================== - Functions and variables for sAGpsRilInterface -===========================================================================*/ -static const LocAGpsRilInterface* pLocAGpsRilInterface = NULL; - -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 sAGpsRilInterface = -{ - 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 -}; - -/*=========================================================================== - Functions and variables for sGpsGeofencingInterface -===========================================================================*/ -static const LocGpsGeofencingInterface* pLocGpsGeofencingInterface = NULL; - -static GpsGeofenceCallbacks sGpsGeofenceCallbacks; -static GpsGeofenceCallbacks* pGpsGeofenceCallbacks = NULL; - -static void local_gps_geofence_transition_callback(int32_t geofence_id, LocGpsLocation* location, - int32_t transition, LocGpsUtcTime timestamp); -static void local_gps_geofence_status_callback(int32_t status, LocGpsLocation* last_location); -static void local_gps_geofence_add_callback(int32_t geofence_id, int32_t status); -static void local_gps_geofence_remove_callback(int32_t geofence_id, int32_t status); -static void local_gps_geofence_pause_callback(int32_t geofence_id, int32_t status); -static void local_gps_geofence_resume_callback(int32_t geofence_id, int32_t status); -static pthread_t local_geofence_create_thread(const char* name, void (*start)(void *), void* arg); - -static LocGpsGeofenceCallbacks sLocGpsGeofenceCallbacks = -{ - local_gps_geofence_transition_callback, - local_gps_geofence_status_callback, - local_gps_geofence_add_callback, - local_gps_geofence_remove_callback, - local_gps_geofence_pause_callback, - local_gps_geofence_resume_callback, - local_geofence_create_thread -}; - -static void loc_geofence_init(GpsGeofenceCallbacks* callbacks); -static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, - double radius_meters, int last_transition, int monitor_transitions, - int notification_responsiveness_ms, int unknown_timer_ms); -static void loc_pause_geofence(int32_t geofence_id); -static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions); -static void loc_remove_geofence_area(int32_t geofence_id); - -static const GpsGeofencingInterface sGpsGeofencingInterface = -{ - sizeof(GpsGeofencingInterface), - loc_geofence_init, - loc_add_geofence_area, - loc_pause_geofence, - loc_resume_geofence, - loc_remove_geofence_area -}; - -/*=========================================================================== - Functions and variables for sGpsMeasurementInterface -===========================================================================*/ -static const LocGpsMeasurementInterface* pLocGpsMeasurementInterface = NULL; - -static GpsMeasurementCallbacks sGpsMeasurementCallbacks; -static GpsMeasurementCallbacks* pGpsMeasurementCallbacks = NULL; - -static void local_gps_measurement_callback(LocGpsData* data); -static void local_gnss_measurement_callback(LocGnssData* data); - -static LocGpsMeasurementCallbacks sLocGpsMeasurementCallbacks = -{ - sizeof(LocGpsMeasurementCallbacks), - local_gps_measurement_callback, - local_gnss_measurement_callback -}; - -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); -static void loc_gps_measurement_close(); - -static const GpsMeasurementInterface sGpsMeasurementInterface = -{ - sizeof(GpsMeasurementInterface), - loc_gps_measurement_init, - loc_gps_measurement_close -}; - -/*=========================================================================== - Functions and variables for sGnssConfigurationInterface -===========================================================================*/ -static const LocGnssConfigurationInterface* pLocGnssConfigurationInterface = NULL; - -static void loc_configuration_update(const char* config_data, int32_t length); - -static const GnssConfigurationInterface sGnssConfigurationInterface = -{ - sizeof(GnssConfigurationInterface), - loc_configuration_update -}; - - -/*=========================================================================== -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* retVal; - pLocGpsInterface = loc_eng_gps_get_hardware_interface(); - if (NULL != pLocGpsInterface) { - retVal = &sGpsInterface; - } else { - retVal = NULL; - } - EXIT_LOG(%p, retVal); - return retVal; -} - -// for gps.c -extern "C" const GpsInterface* get_gps_interface() -{ - pLocGpsInterface = loc_eng_get_gps_interface(); - return &sGpsInterface; -} - -/*=========================================================================== - Implementation of functions for sGpsInterface -===========================================================================*/ -static void local_gps_location_callback(LocGpsLocation* location) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->location_cb) { - GpsLocation loc; - GpsLocation* p_loc = NULL; - if (NULL != location) { - Q2A_GpsLocation(*location, loc); - p_loc = &loc; - } - // We are not sure whether NULL pointer is a legal - // parameter to the original callback functions or not. - // So we should forward NULL pointer at this layer. - pGpsCallbacks->location_cb(p_loc); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_sv_status_callback(LocGpsSvStatus* sv_status) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->sv_status_cb) { - CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs); - GpsSvStatus st; - GpsSvStatus* p_st = NULL; - if (NULL != sv_status) { - Q2A_GpsSvStatus(*sv_status, st); - p_st = &st; - } - pGpsCallbacks->sv_status_cb(p_st); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_status_callback(LocGpsStatus* status) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->status_cb) { - GpsStatus st; - GpsStatus* p_st = NULL; - if (NULL != status) { - Q2A_GpsStatus(*status, st); - p_st = &st; - } - pGpsCallbacks->status_cb(p_st); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_nmea_callback(LocGpsUtcTime timestamp, const char* nmea, int length) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->nmea_cb) { - pGpsCallbacks->nmea_cb(A2Q_GpsUtcTime(timestamp), nmea, length); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_set_capabilities(uint32_t capabilities) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->set_capabilities_cb) { - pGpsCallbacks->set_capabilities_cb(capabilities); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_acquire_wakelock() -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->acquire_wakelock_cb) { - pGpsCallbacks->acquire_wakelock_cb(); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_release_wakelock() -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->release_wakelock_cb) { - pGpsCallbacks->release_wakelock_cb(); - } - EXIT_LOG(%s, VOID_RET); -} - -static pthread_t local_gps_create_thread(const char* name, void (*start)(void *), void* arg) -{ - ENTRY_LOG(); - pthread_t retVal = -1; - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->create_thread_cb) { - retVal = pGpsCallbacks->create_thread_cb(name, start, arg); - } - EXIT_LOG(%d, (int)retVal); - return retVal; -} - -static void local_gps_request_utc_time() -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->request_utc_time_cb) { - pGpsCallbacks->request_utc_time_cb(); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gnss_set_system_info(const LocGnssSystemInfo* info) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->set_system_info_cb) { - GnssSystemInfo sysinfo; - GnssSystemInfo* p_sysinfo = NULL; - if (NULL != info) { - Q2A_GnssSystemInfo(*info, sysinfo); - p_sysinfo = &sysinfo; - } - pGpsCallbacks->set_system_info_cb(p_sysinfo); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gnss_sv_status_callback(LocGnssSvStatus* sv_info) -{ - ENTRY_LOG(); - if (NULL != pGpsCallbacks && NULL != pGpsCallbacks->gnss_sv_status_cb) { - GnssSvStatus info; - GnssSvStatus* p_info = NULL; - if (NULL != sv_info) { - Q2A_GnssSvStatus(*sv_info, info); - p_info - &info; - } - pGpsCallbacks->gnss_sv_status_cb(p_info); - } - EXIT_LOG(%s, VOID_RET); -} - -static int loc_init(GpsCallbacks* callbacks) -{ - ENTRY_LOG(); - - int retVal = -1; - LocGpsCallbacks* cbs = NULL; - if (NULL != callbacks) { - memcpy(&sGpsCallbacks, callbacks, sizeof(GpsCallbacks)); - pGpsCallbacks = &sGpsCallbacks; - cbs = &sLocGpsCallbacks; - } - - if(NULL != pLocGpsInterface && NULL != pLocGpsInterface->init) { - retVal = pLocGpsInterface->init(cbs); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_start() -{ - ENTRY_LOG(); - int retVal = -1; - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->start) { - retVal = pLocGpsInterface->start(); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_stop() -{ - ENTRY_LOG(); - int retVal = -1; - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->stop) { - retVal = pLocGpsInterface->stop(); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -static void loc_cleanup() -{ - ENTRY_LOG(); - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->cleanup) { - pLocGpsInterface->cleanup(); - } - pLocGpsInterface = NULL; - pGpsCallbacks = NULL; - EXIT_LOG(%s, VOID_RET); -} - -static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - ENTRY_LOG(); - int retVal = -1; - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->inject_time) { - retVal = pLocGpsInterface->inject_time(A2Q_GpsUtcTime(time), - timeReference, uncertainty); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_inject_location(double latitude, double longitude, float accuracy) -{ - ENTRY_LOG(); - int retVal = -1; - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->inject_location) { - retVal = pLocGpsInterface->inject_location(latitude, longitude, accuracy); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -static void loc_delete_aiding_data(GpsAidingData f) -{ - ENTRY_LOG(); - -#ifndef TARGET_BUILD_VARIANT_USER - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->delete_aiding_data) { - pLocGpsInterface->delete_aiding_data(A2Q_GpsAidingData(f)); - } -#endif - - EXIT_LOG(%s, VOID_RET); -} - -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 retVal = -1; - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->set_position_mode) { - retVal = pLocGpsInterface->set_position_mode(A2Q_GpsPositionMode(mode), - A2Q_GpsPositionRecurrence(recurrence), - min_interval, preferred_accuracy, preferred_time); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -const void* loc_get_extension(const char* name) -{ - ENTRY_LOG(); - const void* retVal = NULL; - - LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); - if (NULL != pLocGpsInterface && NULL != pLocGpsInterface->get_extension) { - if (strcmp(name, GPS_XTRA_INTERFACE) == 0) - { - pLocGpsXtraInterface = (const LocGpsXtraInterface*)pLocGpsInterface-> - get_extension(LOC_GPS_XTRA_INTERFACE); - if (NULL != pLocGpsXtraInterface) { - retVal = &sGpsXtraInterface; - } - } - else if (strcmp(name, AGPS_INTERFACE) == 0) - { - pLocAGpsInterface = (const LocAGpsInterface*)pLocGpsInterface-> - get_extension(LOC_AGPS_INTERFACE); - if (NULL != pLocAGpsInterface) { - retVal = &sAGpsInterface; - } - } - else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) - { - pLocSuplCertificateInterface = (const LocSuplCertificateInterface*)pLocGpsInterface-> - get_extension(LOC_SUPL_CERTIFICATE_INTERFACE); - if (NULL != pLocAGpsInterface) { - retVal = &sSuplCertificateInterface; - } - } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) - { - pLocGpsNiInterface = (const LocGpsNiInterface*)pLocGpsInterface-> - get_extension(LOC_GPS_NI_INTERFACE); - if (NULL != pLocGpsNiInterface) { - retVal = &sGpsNiInterface; - } - } - else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) - { - pLocAGpsRilInterface = (const LocAGpsRilInterface*)pLocGpsInterface-> - get_extension(LOC_AGPS_RIL_INTERFACE); - if (NULL != pLocAGpsRilInterface) { - retVal = &sAGpsRilInterface; - } - } - else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) - { - pLocGpsGeofencingInterface = (const LocGpsGeofencingInterface*)pLocGpsInterface-> - get_extension(LOC_GPS_GEOFENCING_INTERFACE); - if (NULL != pLocGpsGeofencingInterface) { - retVal = &sGpsGeofencingInterface; - } - } - else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) - { - pLocGpsMeasurementInterface = (const LocGpsMeasurementInterface*)pLocGpsInterface-> - get_extension(LOC_GPS_MEASUREMENT_INTERFACE); - if (NULL != pLocGpsMeasurementInterface) { - retVal = &sGpsMeasurementInterface; - } - } - else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) - { - pLocGnssConfigurationInterface = (const LocGnssConfigurationInterface*)pLocGpsInterface-> - get_extension(LOC_GNSS_CONFIGURATION_INTERFACE); - if (NULL != pLocGnssConfigurationInterface) { - retVal = &sGnssConfigurationInterface; - } - } - else - { - LOC_LOGE ("get_extension: Invalid interface passed in\n"); - } - } - EXIT_LOG(%p, retVal); - return retVal; -} - -/*=========================================================================== - Implementation of functions for sGpsXtraInterface -===========================================================================*/ -static void local_gps_xtra_download_request() -{ - ENTRY_LOG(); - if (NULL != pGpsXtraCallbacks && NULL != pGpsXtraCallbacks->download_request_cb) { - pGpsXtraCallbacks->download_request_cb(); - } - EXIT_LOG(%s, VOID_RET); -} - -static pthread_t local_gps_xtra_create_thread(const char* name, void (*start)(void *), void* arg) -{ - ENTRY_LOG(); - pthread_t retVal = -1; - if (NULL != pGpsXtraCallbacks && NULL != pGpsXtraCallbacks->create_thread_cb) { - retVal = pGpsXtraCallbacks->create_thread_cb(name, start, arg); - } - EXIT_LOG(%d, (int)retVal); - return retVal; -} - -static int loc_xtra_init(GpsXtraCallbacks* callbacks) -{ - ENTRY_LOG(); - - int retVal = -1; - LocGpsXtraCallbacks* cbs = NULL; - if (NULL != callbacks) - { - memcpy(&sGpsXtraCallbacks, callbacks, sizeof(GpsXtraCallbacks)); - pGpsXtraCallbacks = &sGpsXtraCallbacks; - cbs = &sLocGpsXtraCallbacks; - } - - if (NULL != pLocGpsXtraInterface && NULL != pLocGpsXtraInterface->init) { - retVal = pLocGpsXtraInterface->init(cbs); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - - -static int loc_xtra_inject_data(char* data, int length) -{ - ENTRY_LOG(); - int retVal = -1; - if (NULL != pLocGpsXtraInterface && NULL != pLocGpsXtraInterface->inject_xtra_data) { - retVal = pLocGpsXtraInterface->inject_xtra_data(data, length); - } - EXIT_LOG(%d, retVal); - return retVal; -} - -/*=========================================================================== - Implementation of functions for sAGpsInterface -===========================================================================*/ -static void local_agps_status_callback(LocAGpsStatus* status) -{ - ENTRY_LOG(); - if (NULL != pAGpsCallbacks && NULL != pAGpsCallbacks->status_cb) { - AGpsStatus st; - AGpsStatus* p_st = NULL; - if (NULL != status) - { - Q2A_AGpsStatus(*status, st); - p_st = &st; - } - pAGpsCallbacks->status_cb(p_st); - } - EXIT_LOG(%s, VOID_RET); -} - -static pthread_t local_agps_create_thread(const char* name, void (*start)(void *), void* arg) -{ - ENTRY_LOG(); - pthread_t retVal = -1; - if (NULL != pAGpsCallbacks && NULL != pAGpsCallbacks->create_thread_cb) { - retVal = pAGpsCallbacks->create_thread_cb(name, start, arg); - } - EXIT_LOG(%d, (int)retVal); - return retVal; -} - -static void loc_agps_init(AGpsCallbacks* callbacks) -{ - ENTRY_LOG(); - - LocAGpsCallbacks* cbs = NULL; - if (NULL != callbacks) - { - memcpy(&sAGpsCallbacks, callbacks, sizeof(AGpsCallbacks)); - pAGpsCallbacks = &sAGpsCallbacks; - cbs = &sLocAGpsCallbacks; - } - - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->init) { - pLocAGpsInterface->init(cbs); - } - - EXIT_LOG(%s, VOID_RET); -} - -static int loc_agps_open(const char* apn) -{ - ENTRY_LOG(); - - int retVal = -1; - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_open) { - retVal = pLocAGpsInterface->data_conn_open(apn); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_agps_closed() -{ - ENTRY_LOG(); - - int retVal = -1; - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_closed) { - retVal = pLocAGpsInterface->data_conn_closed(); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -int loc_agps_open_failed() -{ - ENTRY_LOG(); - - int retVal = -1; - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_failed) { - retVal = pLocAGpsInterface->data_conn_failed(); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_agps_set_server(AGpsType type, const char* hostname, int port) -{ - ENTRY_LOG(); - - int retVal = -1; - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->set_server) { - retVal = pLocAGpsInterface->set_server(A2Q_AGpsType(type), hostname, port); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) -{ - ENTRY_LOG(); - - int retVal = -1; - if (NULL != pLocAGpsInterface && NULL != pLocAGpsInterface->data_conn_open_with_apn_ip_type) { - retVal = pLocAGpsInterface->data_conn_open_with_apn_ip_type(apn, A2Q_ApnIpType(apnIpType)); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -/*=========================================================================== - Implementation of functions for sSuplCertificateInterface -===========================================================================*/ -static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, - size_t length) -{ - ENTRY_LOG(); - - int retVal = -1; - LocDerEncodedCertificate cert; - LocDerEncodedCertificate* p_cert = NULL; - if (NULL != certificates) { - A2Q_DerEncodedCertificate(*certificates, cert); - p_cert = &cert; - } - - if (NULL != pLocSuplCertificateInterface && - NULL != pLocSuplCertificateInterface->install_certificates) { - retVal = pLocSuplCertificateInterface->install_certificates(p_cert, length); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, - size_t length) -{ - ENTRY_LOG(); - LOC_LOGE("%s:%d] agps_revoke_certificates not supported", __func__, __LINE__); - int retVal = AGPS_CERTIFICATE_ERROR_GENERIC; - EXIT_LOG(%d, retVal); - return retVal; -} - -/*=========================================================================== - Implementation of functions for sGpsNiInterface -===========================================================================*/ -static void local_gps_ni_notify_callback(LocGpsNiNotification *notification) -{ - ENTRY_LOG(); - if (NULL != pGpsNiCallbacks && NULL != pGpsNiCallbacks->notify_cb) { - GpsNiNotification notify; - GpsNiNotification* p_notify = NULL; - if (NULL != notification) { - Q2A_GpsNiNotification(*notification, notify); - p_notify = ¬ify; - } - pGpsNiCallbacks->notify_cb(p_notify); - } - EXIT_LOG(%s, VOID_RET); -} - -static pthread_t local_gps_ni_create_thread(const char* name, void (*start)(void *), void* arg) -{ - ENTRY_LOG(); - pthread_t retVal = -1; - if (NULL != pGpsNiCallbacks && NULL != pGpsNiCallbacks->create_thread_cb) { - retVal = pGpsNiCallbacks->create_thread_cb(name, start, arg); - } - EXIT_LOG(%d, (int)retVal); - return retVal; -} - -void loc_ni_init(GpsNiCallbacks *callbacks) -{ - ENTRY_LOG(); - - LocGpsNiCallbacks* cbs = NULL; - if (NULL != callbacks) { - memcpy(&sGpsNiCallbacks, callbacks, sizeof(GpsNiCallbacks)); - pGpsNiCallbacks = &sGpsNiCallbacks; - cbs = &sLocGpsNiCallbacks; - } - - if(NULL != pLocGpsNiInterface && NULL != pLocGpsNiInterface->init) { - pLocGpsNiInterface->init(cbs); - } - - EXIT_LOG(%s, VOID_RET); -} - -void loc_ni_respond(int notif_id, GpsUserResponseType user_response) -{ - ENTRY_LOG(); - - if(NULL != pLocGpsNiInterface && NULL != pLocGpsNiInterface->respond) { - pLocGpsNiInterface->respond(notif_id, A2Q_GpsUserResponseType(user_response)); - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - Implementation of functions for sAGpsRilInterface -===========================================================================*/ -// Below stub functions are members of sAGpsRilInterface -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 available, const char* apn) -{ - ENTRY_LOG(); - - if (NULL != pLocAGpsRilInterface && - NULL != pLocAGpsRilInterface->update_network_availability) { - pLocAGpsRilInterface->update_network_availability(available, apn); - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - Implementation of functions for sGpsGeofencingInterface -===========================================================================*/ -static void local_gps_geofence_transition_callback(int32_t geofence_id, LocGpsLocation* location, - int32_t transition, LocGpsUtcTime timestamp) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_transition_callback) { - GpsLocation loc; - GpsLocation* p_loc = NULL; - if (NULL != location) - { - Q2A_GpsLocation(*location, loc); - p_loc = &loc; - } - pGpsGeofenceCallbacks->geofence_transition_callback(geofence_id, p_loc, transition, Q2A_GpsUtcTime(timestamp)); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_geofence_status_callback(int32_t status, LocGpsLocation* last_location) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_status_callback) { - GpsLocation loc; - GpsLocation* p_loc = NULL; - if (NULL != last_location) - { - Q2A_GpsLocation(*last_location, loc); - p_loc = &loc; - } - pGpsGeofenceCallbacks->geofence_status_callback(status, p_loc); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_geofence_add_callback(int32_t geofence_id, int32_t status) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_add_callback) { - pGpsGeofenceCallbacks->geofence_add_callback(geofence_id, status); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_geofence_remove_callback(int32_t geofence_id, int32_t status) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_remove_callback) { - pGpsGeofenceCallbacks->geofence_remove_callback(geofence_id, status); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_geofence_pause_callback(int32_t geofence_id, int32_t status) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_pause_callback) { - pGpsGeofenceCallbacks->geofence_pause_callback(geofence_id, status); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gps_geofence_resume_callback(int32_t geofence_id, int32_t status) -{ - ENTRY_LOG(); - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->geofence_resume_callback) { - pGpsGeofenceCallbacks->geofence_resume_callback(geofence_id, status); - } - EXIT_LOG(%s, VOID_RET); -} - -static pthread_t local_geofence_create_thread(const char* name, void (*start)(void *), void* arg) -{ - ENTRY_LOG(); - pthread_t retVal = -1; - if (NULL != pGpsGeofenceCallbacks && NULL != pGpsGeofenceCallbacks->create_thread_cb) { - retVal = pGpsGeofenceCallbacks->create_thread_cb(name, start, arg); - } - EXIT_LOG(%d, (int)retVal); - return retVal; -} - -static void loc_geofence_init(GpsGeofenceCallbacks* callbacks) -{ - ENTRY_LOG(); - if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->init) { - LocGpsGeofenceCallbacks* cbs = NULL; - if (NULL != callbacks) { - memcpy(&sGpsGeofenceCallbacks, callbacks, sizeof(GpsGeofenceCallbacks)); - pGpsGeofenceCallbacks = &sGpsGeofenceCallbacks; - cbs = &sLocGpsGeofenceCallbacks; - } - pLocGpsGeofencingInterface->init(cbs); - } - EXIT_LOG(%s, VOID_RET); -} - -static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, - double radius_meters, int last_transition, int monitor_transitions, - int notification_responsiveness_ms, int unknown_timer_ms) -{ - ENTRY_LOG(); - if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->add_geofence_area) { - pLocGpsGeofencingInterface->add_geofence_area(geofence_id, latitude, longitude, - radius_meters, last_transition, monitor_transitions, - notification_responsiveness_ms, unknown_timer_ms); - } - EXIT_LOG(%s, VOID_RET); -} - -static void loc_pause_geofence(int32_t geofence_id) -{ - ENTRY_LOG(); - if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->pause_geofence) { - pLocGpsGeofencingInterface->pause_geofence(geofence_id); - } - EXIT_LOG(%s, VOID_RET); -} - -static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions) -{ - ENTRY_LOG(); - if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->resume_geofence) { - pLocGpsGeofencingInterface->resume_geofence(geofence_id, monitor_transitions); - } - EXIT_LOG(%s, VOID_RET); -} - -static void loc_remove_geofence_area(int32_t geofence_id) -{ - ENTRY_LOG(); - if (NULL != pLocGpsGeofencingInterface && NULL != pLocGpsGeofencingInterface->remove_geofence_area) { - pLocGpsGeofencingInterface->remove_geofence_area(geofence_id); - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - Implementation of functions for sGpsMeasurementInterface -===========================================================================*/ -static void local_gps_measurement_callback(LocGpsData* data) -{ - ENTRY_LOG(); - if (NULL != pGpsMeasurementCallbacks && NULL != pGpsMeasurementCallbacks->measurement_callback) { - GpsData gps_data; - GpsData* p_gps_data = NULL; - if (NULL != data) - { - Q2A_GpsData(*data, gps_data); - p_gps_data = &gps_data; - } - pGpsMeasurementCallbacks->measurement_callback(p_gps_data); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_gnss_measurement_callback(LocGnssData* data) -{ - ENTRY_LOG(); - if (NULL != pGpsMeasurementCallbacks && NULL != pGpsMeasurementCallbacks->gnss_measurement_callback) { - GnssData gnss_data; - GnssData* p_gnss_data = NULL; - if (NULL != data) - { - Q2A_GnssData(*data, gnss_data); - p_gnss_data = &gnss_data; - } - pGpsMeasurementCallbacks->gnss_measurement_callback(p_gnss_data); - } - EXIT_LOG(%s, VOID_RET); -} - -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) -{ - ENTRY_LOG(); - - int retVal = -1; - LocGpsMeasurementCallbacks* cbs = NULL; - if (NULL != callbacks) - { - memcpy(&sGpsMeasurementCallbacks, callbacks, sizeof(GpsMeasurementCallbacks)); - pGpsMeasurementCallbacks = &sGpsMeasurementCallbacks; - cbs = &sLocGpsMeasurementCallbacks; - } - - if (NULL != pLocGpsMeasurementInterface && NULL != pLocGpsMeasurementInterface->init) { - pLocGpsMeasurementInterface->init(cbs); - } - - EXIT_LOG(%d, retVal); - return retVal; -} - -static void loc_gps_measurement_close() -{ - ENTRY_LOG(); - - if (NULL != pLocGpsMeasurementInterface && NULL != pLocGpsMeasurementInterface->close) { - pLocGpsMeasurementInterface->close(); - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - Implementation of functions for sGnssConfigurationInterface -===========================================================================*/ -static void loc_configuration_update(const char* config_data, int32_t length) -{ - ENTRY_LOG(); - - if (NULL != pLocGnssConfigurationInterface && - NULL != pLocGnssConfigurationInterface->configuration_update) { - pLocGnssConfigurationInterface->configuration_update(config_data, length); - } - - EXIT_LOG(%s, VOID_RET); -} - diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp deleted file mode 100644 index 8c021b39..00000000 --- a/loc_api/libloc_api_50001/loc.cpp +++ /dev/null @@ -1,1119 +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 - -using namespace loc_core; - -// All functions and variables should be static -// except loc_eng_gps_get_hardware_interface() and loc_eng_get_gps_interface() - -//Globals defns -static loc_gps_location_callback gps_loc_cb = NULL; -static loc_gps_sv_status_callback gps_sv_cb = NULL; - -static void local_loc_cb(UlpLocation* location, void* locExt); -static void local_sv_cb(LocGpsSvStatus* sv_status, void* svExt); - -static const LocGpsGeofencingInterface* get_geofence_interface(void); - -// Function declarations for sLocEngInterface -static int loc_init(LocGpsCallbacks* callbacks); -static int loc_start(); -static int loc_stop(); -static void loc_cleanup(); -static int loc_inject_time(LocGpsUtcTime time, int64_t timeReference, int uncertainty); -static int loc_inject_location(double latitude, double longitude, float accuracy); -static void loc_delete_aiding_data(LocGpsAidingData f); -static int loc_set_position_mode(LocGpsPositionMode mode, LocGpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); -static const void* loc_get_extension(const char* name); -static const LocGpsInterface sLocEngInterface = -{ - sizeof(LocGpsInterface), - 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(LocAGpsCallbacks* 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(LocAGpsType type, const char *hostname, int port); -static int loc_agps_open_with_apniptype( const char* apn, LocApnIpType apnIpType); - -static const LocAGpsInterface sLocEngAGpsInterface = -{ - sizeof(LocAGpsInterface), - 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(LocGpsXtraCallbacks* callbacks); -static int loc_xtra_inject_data(char* data, int length); - -static const LocGpsXtraInterface sLocEngXTRAInterface = -{ - sizeof(LocGpsXtraInterface), - loc_xtra_init, - loc_xtra_inject_data -}; - -static loc_gps_ni_notify_callback gps_ni_cb = NULL; -static void local_ni_cb(LocGpsNiNotification *notification, bool esEnalbed); - -static GpsNiExtCallbacks sGpsNiExtCallbacks = { - local_ni_cb -}; - -static void loc_ni_init(LocGpsNiCallbacks *callbacks); -static void loc_ni_respond(int notif_id, LocGpsUserResponseType user_response); - -static const LocGpsNiInterface sLocEngNiInterface = -{ - sizeof(LocGpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - -static int loc_gps_measurement_init(LocGpsMeasurementCallbacks* callbacks); -static void loc_gps_measurement_close(); - -static const LocGpsMeasurementInterface sLocEngGpsMeasurementInterface = -{ - sizeof(LocGpsMeasurementInterface), - loc_gps_measurement_init, - loc_gps_measurement_close -}; - -static void loc_agps_ril_init( LocAGpsRilCallbacks* callbacks ); -static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct); -static void loc_agps_ril_set_set_id(LocAGpsSetIDType 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 LocAGpsRilInterface sLocEngAGpsRilInterface = -{ - sizeof(LocAGpsRilInterface), - 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 LocDerEncodedCertificate* certificates, - size_t length); -static int loc_agps_revoke_certificates(const LocSha1CertificateFingerprint* fingerprints, - size_t length); - -static const LocSuplCertificateInterface sLocEngAGpsCertInterface = -{ - sizeof(LocSuplCertificateInterface), - loc_agps_install_certificates, - loc_agps_revoke_certificates -}; - -static void loc_configuration_update(const char* config_data, int32_t length); - -static const LocGnssConfigurationInterface sLocEngConfigInterface = -{ - sizeof(LocGnssConfigurationInterface), - loc_configuration_update -}; - -static loc_eng_data_s_type loc_afw_data; -static int gss_fd = -1; -static int sGnssType = GNSS_UNKNOWN; -/*=========================================================================== -FUNCTION loc_eng_gps_get_hardware_interface - -DESCRIPTION - Returns LocGpsInterface - if GPS is enabled. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -extern "C" const LocGpsInterface* loc_eng_gps_get_hardware_interface () -{ - ENTRY_LOG_CALLFLOW(); - const LocGpsInterface* 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; -} - -extern "C" const LocGpsInterface* loc_eng_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 &= ~(LOC_GPS_CAPABILITY_MSA | LOC_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 &= ~(LOC_GPS_CAPABILITY_MSA | LOC_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(LocGpsCallbacks* 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(LocGpsPositionMode mode, - LocGpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) -{ - ENTRY_LOG(); - int ret_val = -1; - LocPositionMode locMode; - switch (mode) { - case LOC_GPS_POSITION_MODE_MS_BASED: - locMode = LOC_POSITION_MODE_MS_BASED; - break; - case LOC_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(LocGpsUtcTime 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 LocGpsAidingData matches with - LOC API specification. - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_delete_aiding_data(LocGpsAidingData f) -{ - ENTRY_LOG(); - -#ifndef TARGET_BUILD_VARIANT_USER - loc_eng_delete_aiding_data(loc_afw_data, f); -#endif - - EXIT_LOG(%s, VOID_RET); -} - -static const LocGpsGeofencingInterface* get_geofence_interface(void) -{ - ENTRY_LOG(); - void *handle; - const char *error; - typedef const LocGpsGeofencingInterface* (*get_gps_geofence_interface_function) (void); - get_gps_geofence_interface_function get_gps_geofence_interface; - static const LocGpsGeofencingInterface* 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, "loc_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, LOC_GPS_XTRA_INTERFACE) == 0) - { - ret_val = &sLocEngXTRAInterface; - } - else if (strcmp(name, LOC_AGPS_INTERFACE) == 0) - { - ret_val = &sLocEngAGpsInterface; - } - else if (strcmp(name, LOC_GPS_NI_INTERFACE) == 0) - { - ret_val = &sLocEngNiInterface; - } - else if (strcmp(name, LOC_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, LOC_GPS_GEOFENCING_INTERFACE) == 0) - { - if ((gps_conf.CAPABILITIES | LOC_GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ - ret_val = get_geofence_interface(); - } - } - else if (strcmp(name, LOC_SUPL_CERTIFICATE_INTERFACE) == 0) - { - ret_val = &sLocEngAGpsCertInterface; - } - else if (strcmp(name, LOC_GNSS_CONFIGURATION_INTERFACE) == 0) - { - ret_val = &sLocEngConfigInterface; - } - else if (strcmp(name, LOC_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(LocAGpsCallbacks* 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(); - LocAGpsType agpsType = LOC_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, LocApnIpType apnIpType) -{ - ENTRY_LOG(); - LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL; - AGpsBearerType bearerType; - - switch (apnIpType) { - case LOC_APN_IP_IPV4: - bearerType = AGPS_APN_BEARER_IPV4; - break; - case LOC_APN_IP_IPV6: - bearerType = AGPS_APN_BEARER_IPV6; - break; - case LOC_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(); - LocAGpsType agpsType = LOC_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(); - LocAGpsType agpsType = LOC_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(LocAGpsType type, const char* hostname, int port) -{ - ENTRY_LOG(); - LocServerType serverType; - switch (type) { - case LOC_AGPS_TYPE_SUPL: - serverType = LOC_AGPS_SUPL_SERVER; - break; - case LOC_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(LocGpsXtraCallbacks* 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(LocGpsMeasurementCallbacks* 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(LocGpsNiCallbacks *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, LocGpsUserResponseType 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( LocAGpsRilCallbacks* callbacks ) {} -static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct) {} -static void loc_agps_ril_set_set_id(LocAGpsSetIDType 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 LocDerEncodedCertificate* 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 LocSha1CertificateFingerprint* fingerprints, - size_t length) -{ - ENTRY_LOG(); - LOC_LOGE("%s:%d] agps_revoke_certificates not supported", __func__, __LINE__); - int ret_val = LOC_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 &= ~(LOC_GPS_CAPABILITY_MSA | LOC_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(LocGpsSvStatus* 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(LocGpsNiNotification *notification, bool esEnalbed) -{ - if (NULL != gps_ni_cb) { - gps_ni_cb(notification); - } -} - diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h deleted file mode 100644 index 9edd8c0a..00000000 --- a/loc_api/libloc_api_50001/loc.h +++ /dev/null @@ -1,66 +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 - -#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/ - -typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); -typedef void (*loc_sv_status_cb_ext) (LocGpsSvStatus* sv_status, void* svExt); -typedef void* (*loc_ext_parser)(void* data); - -typedef struct { - loc_location_cb_ext location_cb; - loc_gps_status_callback status_cb; - loc_sv_status_cb_ext sv_status_cb; - loc_gps_nmea_callback nmea_cb; - loc_gps_set_capabilities set_capabilities_cb; - loc_gps_acquire_wakelock acquire_wakelock_cb; - loc_gps_release_wakelock release_wakelock_cb; - loc_gps_create_thread create_thread_cb; - loc_ext_parser location_ext_parser; - loc_ext_parser sv_ext_parser; - loc_gps_request_utc_time request_utc_time_cb; - loc_gnss_set_system_info set_system_info_cb; - loc_gnss_sv_status_callback gnss_sv_status_cb; -} LocCallbacks; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif //__LOC_H__ diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp deleted file mode 100644 index 28ddcf79..00000000 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ /dev/null @@ -1,3125 +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_dsclient_release(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, - LocGpsStatusValue status); -static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data, - LocGpsStatusValue status); -static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data, - int connHandle, LocAGpsType 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 != LOC_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, - LocGpsNiNotification ¬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 LocGpsUtcTime mTime; - const int64_t mTimeReference; - const int mUncertainty; - inline LocEngSetTime(LocEngAdapter* adapter, - LocGpsUtcTime 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 { - UlpProxyBase* mUlp; - - inline LocEngSuplMode(UlpProxyBase* ulp) : - LocMsg(), mUlp(ulp) - { - locallog(); - } - inline virtual void proc() const { - mUlp->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 & - LOC_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 - LOC_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, - LocGnssSvStatus &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) - { - LocGnssSvStatus gnssSvStatus; - memcpy(&gnssSvStatus,&mSvStatus,sizeof(LocGnssSvStatus)); - if (adapter->isGnssSvIdUsedInPosAvail()) - { - GnssSvUsedInPosition gnssSvIdUsedInPosition = - adapter->getGnssSvUsedListData(); - int numSv = gnssSvStatus.num_svs; - int16_t gnssSvId = 0; - int prnMin = 0; - uint64_t svUsedIdMask = 0; - for (int i=0; i < numSv; i++) - { - gnssSvId = gnssSvStatus.gnss_sv_list[i].svid; - if (gnssSvId <= GPS_SV_PRN_MAX) - { - svUsedIdMask = gnssSvIdUsedInPosition.gps_sv_used_ids_mask; - prnMin = GPS_SV_PRN_MIN; - } - else if ((gnssSvId >= GLO_SV_PRN_MIN) && (gnssSvId <= GLO_SV_PRN_MAX)) - { - svUsedIdMask = gnssSvIdUsedInPosition.glo_sv_used_ids_mask; - prnMin = GLO_SV_PRN_MIN; - } - else if ((gnssSvId >= BDS_SV_PRN_MIN) && (gnssSvId <= BDS_SV_PRN_MAX)) - { - svUsedIdMask = gnssSvIdUsedInPosition.bds_sv_used_ids_mask; - prnMin = BDS_SV_PRN_MIN; - } - else if ((gnssSvId >= GAL_SV_PRN_MIN) && (gnssSvId <= GAL_SV_PRN_MAX)) - { - svUsedIdMask = gnssSvIdUsedInPosition.gal_sv_used_ids_mask; - prnMin = GAL_SV_PRN_MIN; - } - - // 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 - prnMin))) - { - gnssSvStatus.gnss_sv_list[i].flags |= LOC_GNSS_SV_FLAGS_USED_IN_FIX; - } - else - { - gnssSvStatus.gnss_sv_list[i].flags &= ~LOC_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((LocGnssSvStatus*)&(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, - LocGpsStatusValue 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, - LOC_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 & LOC_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 LocGpsAidingData mType; - inline LocEngDelAidData(loc_eng_data_s_type* locEng, - LocGpsAidingData 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; - LocDerEncodedCertificate* mpData; - inline LocEngInstallAGpsCert(LocEngAdapter* adapter, - const LocDerEncodedCertificate* pData, - size_t numberOfCerts, - uint32_t slotBitMask) : - LocMsg(), mpAdapter(adapter), - mNumberOfCerts(numberOfCerts), mSlotBitMask(slotBitMask), - mpData(new LocDerEncodedCertificate[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(LocGnssSystemInfo); - if (mAdapter->gnssConstellationConfig()) { - LOC_LOGV("Modem supports GNSS measurements\n"); - gps_conf.CAPABILITIES |= LOC_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, - LocGnssData &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((LocGnssData*)&(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 < LOC_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 -- LOC_GPS_STATUS_NONE; - // loc_eng_data.fix_session_status -- LOC_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(LocGnssSystemInfo); - 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 & LOC_GPS_CAPABILITY_MSB) && - !(gps_conf.CAPABILITIES & LOC_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, LocGpsUtcTime 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 LocGpsAidingData 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, LocGpsAidingData 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, LocGpsStatusValue status) -{ - ENTRY_LOG(); - - if (loc_eng_data.status_cb) - { - LocGpsStatus 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 == LOC_GPS_REQUEST_AGPS_DATA_CONN) { - LOC_LOGD("dataCallCb LOC_GPS_REQUEST_AGPS_DATA_CONN\n"); - ret = locAdapter->openAndStartDataCall(); - } - else if(cbData->action == LOC_GPS_RELEASE_AGPS_DATA_CONN) { - LOC_LOGD("dataCallCb LOC_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_dsclient_release - -DESCRIPTION - Stop/Close/Release DS client when modem SSR happens. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_dsclient_release(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - int result = 1; - LocEngAdapter* adapter = loc_eng_data.adapter; - if (NULL != adapter && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) - { - // stop and close the ds client - adapter->stopDataCall(); - adapter->closeDataCall(); - adapter->releaseDataServiceClient(); - } - 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 != LOC_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 & LOC_GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & LOC_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, - LOC_AGPS_TYPE_WWAN_ANY, - false); - } - if (agpsCapable) { - if (NULL == locEng.agnss_nif) { - locEng.agnss_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)locEng.agps_status_cb, - LOC_AGPS_TYPE_SUPL, - false); - } - if (NULL == locEng.ds_nif && - gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL && - 0 == adapter->initDataServiceClient(false)) { - 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 LOC_AGPS_TYPE_INVALID: - case LOC_AGPS_TYPE_SUPL: { - stateMachine = locEng.agnss_nif; - break; - } - case LOC_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 LocDerEncodedCertificate* certificates, - size_t numberOfCerts) -{ - ENTRY_LOG_CALLFLOW(); - int ret_val = LOC_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 = LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS; - } else if (!adapter) { - LOC_LOGE("adapter is null!"); - ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC; - } else if (slotCount < numberOfCerts) { - LOC_LOGE("Not enough cert slots (%u) to install %u certs!", - slotCount, numberOfCerts); - ret_val = LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES; - } else { - for (int i=0; i < numberOfCerts; ++i) - { - if (certificates[i].length > LOC_AGPS_CERTIFICATE_MAX_LENGTH) { - LOC_LOGE("cert#(%u) length of %u is too big! greater than %u", - certificates[i].length, LOC_AGPS_CERTIFICATE_MAX_LENGTH); - ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC; - break; - } - } - - if (ret_val == LOC_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->getUlpProxy())); - } - // 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, LocGpsStatusValue status) -{ - ENTRY_LOG(); - // Switch from WAIT to MUTE, for "engine on" or "session begin" event - if (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_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 == LOC_GPS_STATUS_SESSION_END || status == LOC_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 != LOC_GPS_STATUS_NONE && - !(status == LOC_GPS_STATUS_SESSION_END && navigating) && - !(status == LOC_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 == LOC_GPS_STATUS_ENGINE_ON || status == LOC_GPS_STATUS_ENGINE_OFF) - { - loc_eng_data.engine_status = status; - } - - // Only keeps SESSION BEGIN/END in fix_session_status - if (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_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, LOC_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(); - - // reinitialize DS client in SSR mode - loc_eng_dsclient_release(loc_eng_data); - if (loc_eng_data.adapter->mSupportsAgpsRequests && - gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - loc_eng_data.adapter->initDataServiceClient(true); - } - 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, - LocGpsMeasurementCallbacks* callbacks) -{ - ENTRY_LOG_CALLFLOW(); - - STATE_CHECK((NULL == loc_eng_data.gnss_measurement_cb), - "gnss measurement already initialized", - return LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT); - STATE_CHECK((callbacks != NULL), - "callbacks can not be NULL", - return LOC_GPS_MEASUREMENT_ERROR_GENERIC); - STATE_CHECK(loc_eng_data.adapter, - "LocGpsInterface must be initialized first", - return LOC_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->loc_gnss_measurement_callback; - LOC_LOGD ("%s, event masks updated successfully", __func__); - - return LOC_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/loc_api/libloc_api_50001/loc_eng.h b/loc_api/libloc_api_50001/loc_eng.h deleted file mode 100644 index d78bef4c..00000000 --- a/loc_api/libloc_api_50001/loc_eng.h +++ /dev/null @@ -1,211 +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; - loc_gps_status_callback status_cb; - loc_sv_status_cb_ext sv_status_cb; - agps_status_extended agps_status_cb; - loc_gps_nmea_callback nmea_cb; - loc_ni_notify_callback ni_notify_cb; - loc_gps_set_capabilities set_capabilities_cb; - loc_gps_acquire_wakelock acquire_wakelock_cb; - loc_gps_release_wakelock release_wakelock_cb; - loc_gps_request_utc_time request_utc_time_cb; - loc_gnss_set_system_info set_system_info_cb; - loc_gnss_sv_status_callback gnss_sv_status_cb; - loc_gnss_measurement_callback gnss_measurement_cb; - boolean intermediateFix; - LocAGpsStatusValue 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 - LocGpsStatusValue engine_status; - LocGpsStatusValue fix_session_status; - - // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off - LocGpsAidingData 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; - uint32_t gal_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, - LocGpsUtcTime 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, - LocGpsAidingData 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 LocDerEncodedCertificate* 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, LocGpsUserResponseType user_response); -extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, - const LocGpsNiNotification *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, - LocGpsMeasurementCallbacks* 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/loc_api/libloc_api_50001/loc_eng_agps.cpp b/loc_api/libloc_api_50001/loc_eng_agps.cpp deleted file mode 100644 index 93260e3c..00000000 --- a/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 ? - LOC_AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, - (char*)mStateMachine->getAPN(), - mStateMachine->getBearer(), - type); - } - break; - case RSRC_GRANTED: - { - AGpsExtType type = mBackwardCompatibleMode ? - LOC_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(LOC_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(LOC_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(LOC_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(LOC_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(LOC_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(LOC_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((LocAGpsStatus *)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(LocAGpsStatusValue action) const -{ - Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ACTIVE); - linked_list_search(mSubscribers, (void**)&s, hasSubscriber, - (void*)¬ification, false); - - if ((NULL == s) == (LOC_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, LOC_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(LocAGpsStatusValue 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, LOC_AGPS_TYPE_SUPL); - break; - case RSRC_GRANTED: - mLocAdapter->atlOpenStatus(ID, 1, - NULL, - AGPS_APN_BEARER_INVALID, - LOC_AGPS_TYPE_INVALID); - break; - default: - LOC_LOGW("DSStateMachine :: informStatus - unknown status"); - } - return; -} diff --git a/loc_api/libloc_api_50001/loc_eng_agps.h b/loc_api/libloc_api_50001/loc_eng_agps.h deleted file mode 100644 index ff879f4b..00000000 --- a/loc_api/libloc_api_50001/loc_eng_agps.h +++ /dev/null @@ -1,434 +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 -#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; - LocAGpsStatusValue 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)(LocAGpsStatus* status); -public: - int requestRsrc(void *cb_data); - AGpsServicer() {} - AGpsServicer(void *cb_func) - { callbackAGps = (void(*)(LocAGpsStatus *))(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(LocAGpsStatusValue 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(LocAGpsStatusValue 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/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp deleted file mode 100644 index 5510fc5c..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn.h deleted file mode 100644 index 1d8c1428..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c deleted file mode 100644 index e947fa1d..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h deleted file mode 100644 index d685c87e..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c deleted file mode 100644 index cbc4ea64..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h deleted file mode 100644 index b2fa3a03..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp deleted file mode 100644 index 7fbe62ff..00000000 --- a/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 = LOC_AGPS_TYPE_SUPL; - break; - } - case IF_REQUEST_TYPE_WIFI: - { - LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_AGPS_TYPE_WIFI; - break; - } - case IF_REQUEST_TYPE_ANY: - { - LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_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 = LOC_AGPS_TYPE_SUPL; - break; - } - case IF_REQUEST_TYPE_WIFI: - { - LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = LOC_AGPS_TYPE_WIFI; - break; - } - case IF_REQUEST_TYPE_ANY: - { - LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = LOC_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/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h deleted file mode 100644 index f1a51c7a..00000000 --- a/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ /dev/null @@ -1,104 +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 -#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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c deleted file mode 100644 index b30f6d7a..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h deleted file mode 100644 index 89e598b5..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_log.cpp b/loc_api/libloc_api_50001/loc_eng_log.cpp deleted file mode 100644 index 3a34167a..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_msg.h b/loc_api/libloc_api_50001/loc_eng_msg.h deleted file mode 100644 index 6f335e6b..00000000 --- a/loc_api/libloc_api_50001/loc_eng_msg.h +++ /dev/null @@ -1,305 +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 - -#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 LocGnssSvStatus mSvStatus; - const GpsLocationExtended mLocationExtended; - const void* mSvExt; - LocEngReportSv(LocAdapterBase* adapter, - LocGnssSvStatus &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 LocGpsStatusValue mStatus; - LocEngReportStatus(LocAdapterBase* adapter, - LocGpsStatusValue 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 LocGpsNiNotification mNotify; - const void *mPayload; - LocEngRequestNi(void* locEng, - LocGpsNiNotification ¬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 LocGnssData mGnssData; - LocEngReportGnssMeasurement(void* locEng, - LocGnssData &gnssData); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_MSG_H */ diff --git a/loc_api/libloc_api_50001/loc_eng_ni.cpp b/loc_api/libloc_api_50001/loc_eng_ni.cpp deleted file mode 100644 index 3a7d8fb4..00000000 --- a/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 LocGpsUserResponseType mResponse; - const void *mPayload; - inline LocEngInformNiResponse(LocEngAdapter* adapter, - LocGpsUserResponseType 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 LocGpsNiNotification *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 == LOC_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 */ - ((LocGpsNiNotification*)notif)->notification_id = pSession->reqID; - - if (notif->notify_flags == LOC_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((LocGpsNiNotification*)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 = LOC_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 != LOC_GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("pSession->resp != LOC_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, LocGpsUserResponseType 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 == LOC_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 = LOC_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/loc_api/libloc_api_50001/loc_eng_ni.h b/loc_api/libloc_api_50001/loc_eng_ni.h deleted file mode 100644 index afb406fb..00000000 --- a/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 LOC_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 */ - LocGpsUserResponseType 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/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp deleted file mode 100644 index e7138b68..00000000 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ /dev/null @@ -1,1027 +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 - -#define GLONASS_SV_ID_OFFSET 64 -#define MAX_SATELLITES_IN_USE 12 -typedef struct loc_nmea_sv_meta_s -{ - char talker[3]; - LocGnssConstellationType svType; - uint32_t mask; - uint32_t svIdOffset; -} loc_nmea_sv_meta; - -/*=========================================================================== -FUNCTION loc_eng_nmea_sv_meta_init - -DESCRIPTION - Init loc_nmea_sv_meta passed in - -DEPENDENCIES - NONE - -RETURN VALUE - Pointer to loc_nmea_sv_meta - -SIDE EFFECTS - N/A - -===========================================================================*/ -static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data_p, - loc_nmea_sv_meta& sv_meta, LocGnssConstellationType svType, bool needCombine) -{ - if (!loc_eng_data_p) - return NULL; - - memset(&sv_meta, 0, sizeof(sv_meta)); - sv_meta.svType = svType; - sv_meta.talker[0] = 'G'; - - switch (svType) - { - case LOC_GNSS_CONSTELLATION_GPS: - sv_meta.talker[1] = 'P'; - sv_meta.mask = loc_eng_data_p->gps_used_mask; - break; - case LOC_GNSS_CONSTELLATION_GLONASS: - sv_meta.talker[1] = 'L'; - sv_meta.mask = loc_eng_data_p->glo_used_mask; - // GLONASS SV ids are from 65-96 - sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; - break; - case LOC_GNSS_CONSTELLATION_GALILEO: - sv_meta.talker[1] = 'A'; - sv_meta.mask = loc_eng_data_p->gal_used_mask; - break; - default: - LOC_LOGE("NMEA Error unknow constellation type: %d", svType); - return NULL; - } - if (needCombine && - (loc_eng_data_p->gps_used_mask ? 1 : 0) + - (loc_eng_data_p->glo_used_mask ? 1 : 0) + - (loc_eng_data_p->gal_used_mask ? 1 : 0) > 1) - { - // If GPS, GLONASS, Galileo etc. are combined - // to obtain the reported position solution, - // talker shall be set to GN, to indicate that - // the satellites are used in a combined solution - sv_meta.talker[1] = 'N'; - } - return &sv_meta; -} - -/*=========================================================================== -FUNCTION loc_eng_nmea_count_bits - -DESCRIPTION - Count how many bits are set in mask - -DEPENDENCIES - NONE - -RETURN VALUE - Bits number set in mask - -SIDE EFFECTS - N/A - -===========================================================================*/ -static uint32_t loc_eng_nmea_count_bits(uint32_t mask) -{ - uint32_t count = 0; - while (mask) - { - if (mask & 1) - count++; - mask = mask >> 1; - } - return count; -} - - -/*=========================================================================== -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_eng_data_p->adapter->getUlpProxy()->reportNmea(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_GSA - -DESCRIPTION - Generate NMEA GSA sentences generated based on position report - Currently below sentences are generated: - - $GPGSA : GPS DOP and active SVs - - $GLGSA : GLONASS DOP and active SVs - - $GAGSA : GALILEO DOP and active SVs - - $GNGSA : GNSS DOP and active SVs - -DEPENDENCIES - NONE - -RETURN VALUE - Number of SVs used - -SIDE EFFECTS - N/A - -===========================================================================*/ -uint32_t loc_eng_nmea_generate_GSA(loc_eng_data_s_type *loc_eng_data_p, - const GpsLocationExtended &locationExtended, - char* sentence, - int bufSize, - loc_nmea_sv_meta* sv_meta_p) -{ - if (!loc_eng_data_p || !sentence || bufSize <= 0 || !sv_meta_p) - { - LOC_LOGE("NMEA Error invalid arguments."); - return 0; - } - - char* pMarker = sentence; - int lengthRemaining = bufSize; - int length = 0; - - uint32_t svUsedCount = 0; - uint32_t svUsedList[32] = {0}; - - char fixType = '\0'; - - const char* talker = sv_meta_p->talker; - uint32_t svIdOffset = sv_meta_p->svIdOffset; - uint32_t mask = sv_meta_p->mask; - - for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) - { - if (mask & 1) - svUsedList[svUsedCount++] = i + svIdOffset; - mask = mask >> 1; - } - - if (svUsedCount == 0 && LOC_GNSS_CONSTELLATION_GPS != sv_meta_p->svType) - return 0; - - if (svUsedCount == 0) - fixType = '1'; // no fix - else if (svUsedCount <= 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 - // 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, "$%sGSA,A,%c,", talker, fixType); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return 0; - } - pMarker += length; - lengthRemaining -= length; - - // Add first 12 satellite IDs - for (uint8_t i = 0; i < 12; i++) - { - 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 0; - } - 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, bufSize); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - return svUsedCount; -} - -/*=========================================================================== -FUNCTION loc_eng_nmea_generate_GSV - -DESCRIPTION - Generate NMEA GSV sentences generated based on sv report - Currently below sentences are generated: - - $GPGSV: GPS Satellites in View - - $GNGSV: GLONASS Satellites in View - - $GAGSV: GALILEO Satellites in View - -DEPENDENCIES - NONE - -RETURN VALUE - NONE - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_nmea_generate_GSV(loc_eng_data_s_type *loc_eng_data_p, - const LocGnssSvStatus &svStatus, - char* sentence, - int bufSize, - loc_nmea_sv_meta* sv_meta_p) -{ - if (!loc_eng_data_p || !sentence || bufSize <= 0) - { - LOC_LOGE("NMEA Error invalid argument."); - return; - } - - char* pMarker = sentence; - int lengthRemaining = bufSize; - int length = 0; - int sentenceCount = 0; - int sentenceNumber = 1; - int svNumber = 1; - - const char* talker = sv_meta_p->talker; - uint32_t svIdOffset = sv_meta_p->svIdOffset; - uint32_t mask = sv_meta_p->mask; - uint32_t svCount = loc_eng_nmea_count_bits(mask); - - - if (svCount <= 0) - { - // no svs in view, so just send a blank $--GSV sentence - snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", talker); - length = loc_eng_nmea_put_checksum(sentence, bufSize); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - return; - } - - svNumber = 1; - sentenceNumber = 1; - sentenceCount = svCount / 4 + (svCount % 4 != 0); - - while (sentenceNumber <= sentenceCount) - { - pMarker = sentence; - lengthRemaining = bufSize; - - length = snprintf(pMarker, lengthRemaining, "$%sGSV,%d,%d,%02d", - talker, sentenceCount, sentenceNumber, svCount); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - for (int i=0; (svNumber <= svStatus.num_svs) && (i < 4); svNumber++) - { - if (sv_meta_p->svType == 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, bufSize); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - sentenceNumber++; - - } //while -} - -/*=========================================================================== -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 - - $GLGSA : GLONASS DOP and active SVs - - $GAGSA : GALILEO DOP and active SVs - - $GNGSA : GNSS DOP and active SVs - - $--VTG : Track made good and ground speed - - $--RMC : Recommended minimum navigation information - - $--GGA : 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) { - char talker[3] = {'G', 'P', '\0'}; - uint32_t svUsedCount = 0; - uint32_t count = 0; - loc_nmea_sv_meta sv_meta; - // ------------------- - // ---$GPGSA/$GNGSA--- - // ------------------- - - count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, true)); - if (count > 0) - { - svUsedCount += count; - talker[1] = sv_meta.talker[1]; - } - - // ------------------- - // ---$GLGSA/$GNGSA--- - // ------------------- - - count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, true)); - if (count > 0) - { - svUsedCount += count; - talker[1] = sv_meta.talker[1]; - } - - // ------------------- - // ---$GAGSA/$GNGSA--- - // ------------------- - - count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, true)); - if (count > 0) - { - svUsedCount += count; - talker[1] = sv_meta.talker[1]; - } - - // ------------------- - // ------$--VTG------- - // ------------------- - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - if (location.gpsLocation.flags & LOC_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, "$%sVTG,%.1lf,T,%.1lf,M,", talker, location.gpsLocation.bearing, magTrack); - } - else - { - length = snprintf(pMarker, lengthRemaining, "$%sVTG,,T,,M,", talker); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & LOC_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 & LOC_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); - - // ------------------- - // ------$--RMC------- - // ------------------- - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , - talker, 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 & LOC_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 & LOC_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 & LOC_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 & LOC_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); - - // ------------------- - // ------$--GGA------- - // ------------------- - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , - talker, 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 & LOC_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 & LOC_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 - - // Number of satellites in use, 00-12 - if (svUsedCount > MAX_SATELLITES_IN_USE) - svUsedCount = MAX_SATELLITES_IN_USE; - 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 & LOC_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); - - // clear the cache so they can't be used again - loc_eng_data_p->gps_used_mask = 0; - loc_eng_data_p->glo_used_mask = 0; - loc_eng_data_p->gal_used_mask = 0; - } - //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 LocGnssSvStatus &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; - - //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; - loc_eng_data_p->gal_used_mask = 0; - for(svNumber=1; svNumber <= svCount; svNumber++) { - if (LOC_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 (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) - { - loc_eng_data_p->gps_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); - } - } - else if (LOC_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 (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) - { - loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); - } - } - else if (LOC_GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation) - { - // cache the used in fix mask, as it will be needed to send $GAGSA - // during the position report - if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX)) - { - loc_eng_data_p->gal_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); - } - } - } - - loc_nmea_sv_meta sv_meta; - // ------------------ - // ------$GPGSV------ - // ------------------ - - loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, false)); - - // ------------------ - // ------$GLGSV------ - // ------------------ - - loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, false)); - - // ------------------ - // ------$GAGSV------ - // ------------------ - - loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, false)); - - - // 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/loc_api/libloc_api_50001/loc_eng_nmea.h b/loc_api/libloc_api_50001/loc_eng_nmea.h deleted file mode 100644 index 9480a6ad..00000000 --- a/loc_api/libloc_api_50001/loc_eng_nmea.h +++ /dev/null @@ -1,42 +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 - -#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 LocGnssSvStatus &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/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/loc_api/libloc_api_50001/loc_eng_xtra.cpp deleted file mode 100644 index b5bf4e76..00000000 --- a/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/loc_api/libloc_api_50001/loc_eng_xtra.h b/loc_api/libloc_api_50001/loc_eng_xtra.h deleted file mode 100644 index 41a006f9..00000000 --- a/loc_api/libloc_api_50001/loc_eng_xtra.h +++ /dev/null @@ -1,45 +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 - -// Module data -typedef struct -{ - // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; - loc_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/location/Android.mk b/location/Android.mk new file mode 100644 index 00000000..49a60d7d --- /dev/null +++ b/location/Android.mk @@ -0,0 +1,41 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := liblocation_api +LOCAL_MODULE_OWNER := qti + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + libdl \ + liblog + +LOCAL_SRC_FILES += \ + LocationAPI.cpp \ + LocationAPIClientBase.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_COPY_HEADERS_TO:= liblocation_api/ +LOCAL_COPY_HEADERS:= \ + LocationAPI.h \ + LocationAPIClientBase.h \ + location_interface.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp new file mode 100644 index 00000000..c800851c --- /dev/null +++ b/location/LocationAPI.cpp @@ -0,0 +1,675 @@ +/* Copyright (c) 2017 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_TAG "LocSvc_LocationAPI" + +#include +#include +#include +#include +#include + +typedef void* (getLocationInterface)(); +typedef std::map LocationClientMap; +typedef struct { + LocationClientMap clientData; + LocationControlAPI* controlAPI; + LocationControlCallbacks controlCallbacks; + GnssInterface* gnssInterface; + GeofenceInterface* geofenceInterface; + FlpInterface* flpInterface; +} LocationAPIData; +static LocationAPIData gData = {}; +static pthread_mutex_t gDataMutex = PTHREAD_MUTEX_INITIALIZER; +static bool gGnssLoadFailed = false; +static bool gFlpLoadFailed = false; +static bool gGeofenceLoadFailed = false; + +static bool needsGnssTrackingInfo(LocationCallbacks& locationCallbacks) +{ + return (locationCallbacks.gnssLocationInfoCb != nullptr || + locationCallbacks.gnssSvCb != nullptr || + locationCallbacks.gnssNmeaCb != nullptr || + locationCallbacks.gnssMeasurementsCb != nullptr); +} + +static bool isGnssClient(LocationCallbacks& locationCallbacks) +{ + return (locationCallbacks.gnssNiCb != nullptr || + locationCallbacks.trackingCb != nullptr || + locationCallbacks.gnssMeasurementsCb != nullptr); +} + +static bool isFlpClient(LocationCallbacks& locationCallbacks) +{ + return (locationCallbacks.trackingCb != nullptr || + locationCallbacks.batchingCb != nullptr); +} + +static bool isGeofenceClient(LocationCallbacks& locationCallbacks) +{ + return (locationCallbacks.geofenceBreachCb != nullptr || + locationCallbacks.geofenceStatusCb != nullptr); +} + +static void* loadLocationInterface(const char* library, const char* name) { + LOC_LOGD("%s]: loading %s::%s ...", __func__, library, name); + if (NULL == library || NULL == name) { + return NULL; + } + getLocationInterface* getter = NULL; + const char *error; + dlerror(); + void *handle = dlopen(library, RTLD_NOW); + if (NULL == handle || (error = dlerror()) != NULL) { + LOC_LOGW("dlopen for %s failed, error = %s", library, error); + } else { + getter = (getLocationInterface*)dlsym(handle, name); + if ((error = dlerror()) != NULL) { + LOC_LOGW("dlsym for %s::%s failed, error = %s", library, name, error); + getter = NULL; + } + } + + if (NULL == getter) { + return (void*)getter; + } else { + return (*getter)(); + } +} + +LocationAPI* +LocationAPI::createInstance(LocationCallbacks& locationCallbacks) +{ + if (nullptr == locationCallbacks.capabilitiesCb || + nullptr == locationCallbacks.responseCb || + nullptr == locationCallbacks.collectiveResponseCb) { + return NULL; + } + + LocationAPI* newLocationAPI = new LocationAPI(); + bool requestedCapabilities = false; + + pthread_mutex_lock(&gDataMutex); + + if (isGnssClient(locationCallbacks)) { + if (NULL == gData.gnssInterface && !gGnssLoadFailed) { + gData.gnssInterface = + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + if (NULL == gData.gnssInterface) { + gGnssLoadFailed = true; + LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); + } else { + gData.gnssInterface->initialize(); + } + } + if (NULL != gData.gnssInterface) { + gData.gnssInterface->addClient(newLocationAPI, locationCallbacks); + if (!requestedCapabilities) { + gData.gnssInterface->requestCapabilities(newLocationAPI); + requestedCapabilities = true; + } + } + } + + if (isFlpClient(locationCallbacks)) { + if (NULL == gData.flpInterface && !gFlpLoadFailed) { + gData.flpInterface = + (FlpInterface*)loadLocationInterface("libflp.so", "getFlpInterface"); + if (NULL == gData.flpInterface) { + gFlpLoadFailed = true; + LOC_LOGW("%s:%d]: No flp interface available", __func__, __LINE__); + } else { + gData.flpInterface->initialize(); + } + } + if (NULL != gData.flpInterface) { + gData.flpInterface->addClient(newLocationAPI, locationCallbacks); + if (!requestedCapabilities) { + gData.flpInterface->requestCapabilities(newLocationAPI); + requestedCapabilities = true; + } + } + } + + if (isGeofenceClient(locationCallbacks)) { + if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { + gData.geofenceInterface = + (GeofenceInterface*)loadLocationInterface("libgeofence.so", "getGeofenceInterface"); + if (NULL == gData.geofenceInterface) { + gGeofenceLoadFailed = true; + LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); + } else { + gData.geofenceInterface->initialize(); + } + } + if (NULL != gData.geofenceInterface) { + gData.geofenceInterface->addClient(newLocationAPI, locationCallbacks); + if (!requestedCapabilities) { + gData.geofenceInterface->requestCapabilities(newLocationAPI); + requestedCapabilities = true; + } + } + } + + gData.clientData[newLocationAPI] = locationCallbacks; + + pthread_mutex_unlock(&gDataMutex); + + return newLocationAPI; +} + +void +LocationAPI::destroy() +{ + delete this; +} + +LocationAPI::LocationAPI() +{ + LOC_LOGD("LOCATION API CONSTRUCTOR"); +} + +LocationAPI::~LocationAPI() +{ + LOC_LOGD("LOCATION API DESTRUCTOR"); + pthread_mutex_lock(&gDataMutex); + + auto it = gData.clientData.find(this); + if (it != gData.clientData.end()) { + size_t gnssClientCount = 0; + size_t flpClientCount = 0; + size_t geofenceClientCount = 0; + for (auto it2=gData.clientData.begin(); it2 != gData.clientData.end(); ++it2) { + if (isGnssClient(it2->second)) { + gnssClientCount++; + } + if (isFlpClient(it2->second)) { + flpClientCount++; + } + if (isGeofenceClient(it2->second)) { + geofenceClientCount++; + } + } + if (isGnssClient(it->second) && NULL != gData.gnssInterface) { + gData.gnssInterface->removeClient(it->first); + if (1 == gnssClientCount && NULL == gData.controlAPI) { + gData.gnssInterface->deinitialize(); + } + } + if (isFlpClient(it->second) && NULL != gData.flpInterface) { + gData.flpInterface->removeClient(it->first); + if (1 == flpClientCount) { + gData.flpInterface->deinitialize(); + } + } + if (isGeofenceClient(it->second) && NULL != gData.geofenceInterface) { + gData.geofenceInterface->removeClient(it->first); + if (1 == geofenceClientCount) { + gData.geofenceInterface->deinitialize(); + } + } + gData.clientData.erase(it); + } else { + LOC_LOGE("%s:%d]: Location API client %p not found in client data", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) +{ + if (nullptr == locationCallbacks.capabilitiesCb || + nullptr == locationCallbacks.responseCb || + nullptr == locationCallbacks.collectiveResponseCb) { + return; + } + + pthread_mutex_lock(&gDataMutex); + + if (isGnssClient(locationCallbacks)) { + if (NULL == gData.gnssInterface && !gGnssLoadFailed) { + gData.gnssInterface = + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + if (NULL == gData.gnssInterface) { + gGnssLoadFailed = true; + LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); + } else { + gData.gnssInterface->initialize(); + } + } + if (NULL != gData.gnssInterface) { + // either adds new Client or updates existing Client + gData.gnssInterface->addClient(this, locationCallbacks); + } + } + + if (isFlpClient(locationCallbacks)) { + if (NULL == gData.flpInterface && !gFlpLoadFailed) { + gData.flpInterface = + (FlpInterface*)loadLocationInterface("libflp.so", "getFlpInterface"); + if (NULL == gData.flpInterface) { + gFlpLoadFailed = true; + LOC_LOGW("%s:%d]: No flp interface available", __func__, __LINE__); + } else { + gData.flpInterface->initialize(); + } + } + if (NULL != gData.flpInterface) { + // either adds new Client or updates existing Client + gData.flpInterface->addClient(this, locationCallbacks); + } + } + + if (isGeofenceClient(locationCallbacks)) { + if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { + gData.geofenceInterface = + (GeofenceInterface*)loadLocationInterface("libgeofence.so", "getGeofenceInterface"); + if (NULL == gData.geofenceInterface) { + gGeofenceLoadFailed = true; + LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); + } else { + gData.geofenceInterface->initialize(); + } + } + if (NULL != gData.geofenceInterface) { + // either adds new Client or updates existing Client + gData.geofenceInterface->addClient(this, locationCallbacks); + } + } + + gData.clientData[this] = locationCallbacks; + + pthread_mutex_unlock(&gDataMutex); +} + +uint32_t +LocationAPI::startTracking(LocationOptions& locationOptions) +{ + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + auto it = gData.clientData.find(this); + if (it != gData.clientData.end()) { + if (gData.flpInterface != NULL && locationOptions.minDistance > 0) { + id = gData.flpInterface->startTracking(this, locationOptions); + } else if (gData.gnssInterface != NULL && needsGnssTrackingInfo(it->second)) { + id = gData.gnssInterface->startTracking(this, locationOptions); + } else if (gData.flpInterface != NULL) { + id = gData.flpInterface->startTracking(this, locationOptions); + } else if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->startTracking(this, locationOptions); + } else { + LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + } else { + LOC_LOGE("%s:%d]: Location API client %p not found in client data", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +void +LocationAPI::stopTracking(uint32_t id) +{ + pthread_mutex_lock(&gDataMutex); + + auto it = gData.clientData.find(this); + if (it != gData.clientData.end()) { + // we don't know if tracking was started on flp or gnss, so we call stop on both, where + // stopTracking call to the incorrect interface will fail without response back to client + if (gData.gnssInterface != NULL) { + gData.gnssInterface->stopTracking(this, id); + } + if (gData.flpInterface != NULL) { + gData.flpInterface->stopTracking(this, id); + } + if (gData.flpInterface != NULL && gData.gnssInterface != NULL) { + LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + } else { + LOC_LOGE("%s:%d]: Location API client %p not found in client data", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions) +{ + pthread_mutex_lock(&gDataMutex); + + auto it = gData.clientData.find(this); + if (it != gData.clientData.end()) { + // we don't know if tracking was started on flp or gnss, so we call update on both, where + // updateTracking call to the incorrect interface will fail without response back to client + if (gData.gnssInterface != NULL) { + gData.gnssInterface->updateTrackingOptions(this, id, locationOptions); + } + if (gData.flpInterface != NULL) { + gData.flpInterface->updateTrackingOptions(this, id, locationOptions); + } + if (gData.flpInterface != NULL && gData.gnssInterface != NULL) { + LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + } else { + LOC_LOGE("%s:%d]: Location API client %p not found in client data", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +uint32_t +LocationAPI::startBatching(LocationOptions& locationOptions) +{ + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.flpInterface != NULL) { + id = gData.flpInterface->startBatching(this, locationOptions); + } else { + LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +void +LocationAPI::stopBatching(uint32_t id) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.flpInterface != NULL) { + gData.flpInterface->stopBatching(this, id); + } else { + LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::updateBatchingOptions(uint32_t id, LocationOptions& locationOptions) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.flpInterface != NULL) { + gData.flpInterface->updateBatchingOptions(this, + id, + locationOptions); + } else { + LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::getBatchedLocations(uint32_t id, size_t count) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.flpInterface != NULL) { + gData.flpInterface->getBatchedLocations(this, id, count); + } else { + LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +uint32_t* +LocationAPI::addGeofences(size_t count, GeofenceOption* options, GeofenceInfo* info) +{ + uint32_t* ids = NULL; + pthread_mutex_lock(&gDataMutex); + + if (gData.geofenceInterface != NULL) { + ids = gData.geofenceInterface->addGeofences(this, count, options, info); + } else { + LOC_LOGE("%s:%d]: No geofence interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return ids; +} + +void +LocationAPI::removeGeofences(size_t count, uint32_t* ids) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.geofenceInterface != NULL) { + gData.geofenceInterface->removeGeofences(this, count, ids); + } else { + LOC_LOGE("%s:%d]: No geofence interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.geofenceInterface != NULL) { + gData.geofenceInterface->modifyGeofences(this, count, ids, options); + } else { + LOC_LOGE("%s:%d]: No geofence interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::pauseGeofences(size_t count, uint32_t* ids) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.geofenceInterface != NULL) { + gData.geofenceInterface->pauseGeofences(this, count, ids); + } else { + LOC_LOGE("%s:%d]: No geofence interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::resumeGeofences(size_t count, uint32_t* ids) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.geofenceInterface != NULL) { + gData.geofenceInterface->resumeGeofences(this, count, ids); + } else { + LOC_LOGE("%s:%d]: No geofence interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +void +LocationAPI::gnssNiResponse(uint32_t id, GnssNiResponse response) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + gData.gnssInterface->gnssNiResponse(this, id, response); + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +LocationControlAPI* +LocationControlAPI::createInstance(LocationControlCallbacks& locationControlCallbacks) +{ + LocationControlAPI* controlAPI = NULL; + pthread_mutex_lock(&gDataMutex); + + if (nullptr != locationControlCallbacks.responseCb && NULL == gData.controlAPI) { + if (NULL == gData.gnssInterface && !gGnssLoadFailed) { + gData.gnssInterface = + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + if (NULL == gData.gnssInterface) { + gGnssLoadFailed = true; + LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); + } else { + gData.gnssInterface->initialize(); + } + } + if (NULL != gData.gnssInterface) { + gData.controlAPI = new LocationControlAPI(); + gData.controlCallbacks = locationControlCallbacks; + gData.gnssInterface->setControlCallbacks(locationControlCallbacks); + controlAPI = gData.controlAPI; + } + } + + pthread_mutex_unlock(&gDataMutex); + return controlAPI; +} + +void +LocationControlAPI::destroy() +{ + delete this; +} + +LocationControlAPI::LocationControlAPI() +{ + LOC_LOGD("LOCATION CONTROL API CONSTRUCTOR"); +} + +LocationControlAPI::~LocationControlAPI() +{ + LOC_LOGD("LOCATION CONTROL API DESTRUCTOR"); + pthread_mutex_lock(&gDataMutex); + + size_t gnssClientCount = 0; + for (auto it=gData.clientData.begin(); it != gData.clientData.end(); ++it) { + if (isGnssClient(it->second)) { + gnssClientCount++; + } + } + if (gData.gnssInterface != NULL && 0 == gnssClientCount) { + //@todo: we might want to call gData.gnssInterface.disable before deinitialize? + gData.gnssInterface->deinitialize(); + } + gData.controlAPI = NULL; + + pthread_mutex_unlock(&gDataMutex); +} + +uint32_t +LocationControlAPI::enable(LocationTechnologyType techType) +{ + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->enable(techType); + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location Control API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +void +LocationControlAPI::disable(uint32_t id) +{ + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + gData.gnssInterface->disable(id); + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location Control API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); +} + +uint32_t* +LocationControlAPI::gnssUpdateConfig(GnssConfig config) +{ + uint32_t* ids = NULL; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + ids = gData.gnssInterface->gnssUpdateConfig(config); + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location Control API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return ids; +} + +uint32_t +LocationControlAPI::gnssDeleteAidingData(GnssAidingData& data) +{ + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->gnssDeleteAidingData(data); + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location Control API client %p ", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} diff --git a/location/LocationAPI.h b/location/LocationAPI.h new file mode 100644 index 00000000..cc15ddd3 --- /dev/null +++ b/location/LocationAPI.h @@ -0,0 +1,866 @@ +/* Copyright (c) 2017 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 LOCATION_H +#define LOCATION_H + +#include +#include + +#define GNSS_NI_REQUESTOR_MAX 256 +#define GNSS_NI_MESSAGE_ID_MAX 2048 +#define GNSS_SV_MAX 64 +#define GNSS_MEASUREMENTS_MAX 64 + +typedef enum { + LOCATION_ERROR_SUCCESS = 0, + LOCATION_ERROR_GENERAL_FAILURE, + LOCATION_ERROR_CALLBACK_MISSING, + LOCATION_ERROR_INVALID_PARAMETER, + LOCATION_ERROR_ID_EXISTS, + LOCATION_ERROR_ID_UNKNOWN, + LOCATION_ERROR_ALREADY_STARTED, + LOCATION_ERROR_GEOFENCES_AT_MAX, + LOCATION_ERROR_NOT_SUPPORTED +} LocationError; + +// Flags to indicate which values are valid in a Location +typedef uint16_t LocationFlagsMask; +typedef enum { + LOCATION_HAS_LAT_LONG_BIT = (1<<0), // location has valid latitude and longitude + LOCATION_HAS_ALTITUDE_BIT = (1<<1), // location has valid altitude + LOCATION_HAS_SPEED_BIT = (1<<2), // location has valid speed + LOCATION_HAS_BEARING_BIT = (1<<3), // location has valid bearing + LOCATION_HAS_ACCURACY_BIT = (1<<4), // location has valid accuracy +} LocationFlagsBits; + +typedef uint16_t LocationTechnologyMask; +typedef enum { + LOCATION_TECHNOLOGY_GNSS_BIT = (1<<0), // location was calculated using GNSS + LOCATION_TECHNOLOGY_CELL_BIT = (1<<1), // location was calculated using Cell + LOCATION_TECHNOLOGY_WIFI_BIT = (1<<2), // location was calculated using WiFi + LOCATION_TECHNOLOGY_SENSORS_BIT = (1<<3), // location was calculated using Sensors +} LocationTechnologyBits; + +typedef enum { + LOCATION_RELIABILITY_NOT_SET = 0, + LOCATION_RELIABILITY_VERY_LOW, + LOCATION_RELIABILITY_LOW, + LOCATION_RELIABILITY_MEDIUM, + LOCATION_RELIABILITY_HIGH, +} LocationReliability; + +typedef uint32_t GnssLocationInfoFlagMask; +typedef enum { + GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT = (1<<0), // valid altitude mean sea level + GNSS_LOCATION_INFO_DOP_BIT = (1<<1), // valid pdop, hdop, and vdop + GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT = (1<<2), // valid magnetic deviation + GNSS_LOCATION_INFO_VER_ACCURACY_BIT = (1<<3), // valid vertical accuracy + GNSS_LOCATION_INFO_SPEED_ACCURACY_BIT = (1<<4), // valid speed accuracy + GNSS_LOCATION_INFO_BEARING_ACCURACY_BIT = (1<<5), // valid bearing accuracy + GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT = (1<<6), // valid horizontal reliability + GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<7), // valid vertical reliability + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<8), // valid elipsode semi major + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<9), // valid elipsode semi minor + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<10),// valid accuracy elipsode azimuth +} GnssLocationInfoFlagBits; + +typedef enum { + GEOFENCE_BREACH_ENTER = 0, + GEOFENCE_BREACH_EXIT, + GEOFENCE_BREACH_DWELL_IN, + GEOFENCE_BREACH_DWELL_OUT, + GEOFENCE_BREACH_UNKNOWN, +} GeofenceBreachType; + +typedef uint16_t GeofenceBreachTypeMask; +typedef enum { + GEOFENCE_BREACH_ENTER_BIT = (1<<0), + GEOFENCE_BREACH_EXIT_BIT = (1<<1), + GEOFENCE_BREACH_DWELL_IN_BIT = (1<<2), + GEOFENCE_BREACH_DWELL_OUT_BIT = (1<<3), +} GeofenceBreachTypeBits; + +typedef enum { + GEOFENCE_STATUS_AVAILABILE_NO = 0, + GEOFENCE_STATUS_AVAILABILE_YES, +} GeofenceStatusAvailable; + +typedef uint32_t LocationCapabilitiesMask; +typedef enum { + // supports startTracking API with minInterval param + LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0), + // supports startBatching API with minInterval param + LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1), + // supports startTracking API with minDistance param + LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2), + // supports startBatching API with minDistance param + LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3), + // supports addGeofences API + LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4), + // supports GnssMeasurementsCallback + LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5), + // supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based) + LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6), + // supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted) + LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7), +} LocationCapabilitiesBits; + +typedef enum { + LOCATION_TECHNOLOGY_TYPE_GNSS = 0, +} LocationTechnologyType; + +// Configures how GPS is locked when GPS is disabled (through GnssDisable) +typedef enum { + GNSS_CONFIG_GPS_LOCK_NONE = 0, // gps is not locked when GPS is disabled (GnssDisable) + GNSS_CONFIG_GPS_LOCK_MO, // gps mobile originated (MO) is locked when GPS is disabled + GNSS_CONFIG_GPS_LOCK_NI, // gps network initiated (NI) is locked when GPS is disabled + GNSS_CONFIG_GPS_LOCK_MO_AND_NI,// gps MO and NI is locked when GPS is disabled +} GnssConfigGpsLock; + +// SUPL version +typedef enum { + GNSS_CONFIG_SUPL_VERSION_1_0_0 = 1, + GNSS_CONFIG_SUPL_VERSION_2_0_0, + GNSS_CONFIG_SUPL_VERSION_2_0_2, +} GnssConfigSuplVersion; + +// LTE Positioning Profile +typedef enum { + GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE = 0, // RRLP on LTE (Default) + GNSS_CONFIG_LPP_PROFILE_USER_PLANE, // LPP User Plane (UP) on LTE + GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE, // LPP_Control_Plane (CP) + GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE, // Both LPP UP and CP +} GnssConfigLppProfile; + +// Technology for LPPe Control Plane +typedef uint16_t GnssConfigLppeControlPlaneMask; +typedef enum { + GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT = (1<<0), // DBH + GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS +} GnssConfigLppeControlPlaneBits; + +// Technology for LPPe User Plane +typedef uint16_t GnssConfigLppeUserPlaneMask; +typedef enum { + GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT = (1<<0), // DBH + GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS +} GnssConfigLppeUserPlaneBits; + +// Positioning Protocol on A-GLONASS system +typedef uint16_t GnssConfigAGlonassPositionProtocolMask; +typedef enum { + GNSS_CONFIG_RRC_CONTROL_PLANE_BIT = (1<<0), // RRC Control Plane + GNSS_CONFIG_RRLP_USER_PLANE_BIT = (1<<1), // RRLP User Plane + GNSS_CONFIG_LLP_USER_PLANE_BIT = (1<<2), // LPP User Plane + GNSS_CONFIG_LLP_CONTROL_PLANE_BIT = (1<<3), // LPP Control Plane +} GnssConfigAGlonassPositionProtocolBits; + +typedef enum { + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO = 0, + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES, +} GnssConfigEmergencyPdnForEmergencySupl; + +typedef enum { + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO = 0, + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES, +} GnssConfigSuplEmergencyServices; + +typedef uint16_t GnssConfigSuplModeMask; +typedef enum { + GNSS_CONFIG_SUPL_MODE_MSB = (1<<0), + GNSS_CONFIG_SUPL_MODE_MSA = (1<<1), +} GnssConfigSuplModeBits; + +typedef uint32_t GnssConfigFlagsMask; +typedef enum { + GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT = (1<<0), + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT = (1<<1), + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT = (1<<2), + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT = (1<<3), + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT = (1<<4), + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT = (1<<5), + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT = (1<<6), + GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT = (1<<7), + GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), + GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), +} GnssConfigFlagsBits; + +typedef enum { + GNSS_NI_ENCODING_TYPE_NONE = 0, + GNSS_NI_ENCODING_TYPE_GSM_DEFAULT, + GNSS_NI_ENCODING_TYPE_UTF8, + GNSS_NI_ENCODING_TYPE_UCS2, +} GnssNiEncodingType; + +typedef enum { + GNSS_NI_TYPE_VOICE = 0, + GNSS_NI_TYPE_SUPL, + GNSS_NI_TYPE_CONTROL_PLANE, + GNSS_NI_TYPE_EMERGENCY_SUPL +} GnssNiType; + +typedef uint16_t GnssNiOptionsMask; +typedef enum { + GNSS_NI_OPTIONS_NOTIFICATION = (1<<0), + GNSS_NI_OPTIONS_VERIFICATION = (1<<1), + GNSS_NI_OPTIONS_PRIVACY_OVERRIDE = (1<<2), +} GnssNiOptionsBits; + +typedef enum { + GNSS_NI_RESPONSE_ACCEPT = 1, + GNSS_NI_RESPONSE_DENY, + GNSS_NI_RESPONSE_NO_RESPONSE, + GNSS_NI_RESPONSE_IGNORE, +} GnssNiResponse; + +typedef enum { + GNSS_SV_TYPE_UNKNOWN = 0, + GNSS_SV_TYPE_GPS, + GNSS_SV_TYPE_SBAS, + GNSS_SV_TYPE_GLONASS, + GNSS_SV_TYPE_QZSS, + GNSS_SV_TYPE_BEIDOU, + GNSS_SV_TYPE_GALILEO, +} GnssSvType; + +typedef uint16_t GnssSvOptionsMask; +typedef enum { + GNSS_SV_OPTIONS_HAS_EPHEMER_BIT = (1<<0), + GNSS_SV_OPTIONS_HAS_ALMANAC_BIT = (1<<1), + GNSS_SV_OPTIONS_USED_IN_FIX_BIT = (1<<2), +} GnssSvOptionsBits; + +typedef enum { + GNSS_ASSISTANCE_TYPE_SUPL = 0, + GNSS_ASSISTANCE_TYPE_C2K, +} GnssAssistanceType; + +typedef enum { + GNSS_SUPL_MODE_STANDALONE = 0, + GNSS_SUPL_MODE_MSB, + GNSS_SUPL_MODE_MSA, +} GnssSuplMode; + +typedef uint16_t GnssMeasurementsAdrStateMask; +typedef enum { + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT = (1<<0), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT = (1<<1), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT = (1<<2), +} GnssMeasurementsAdrStateBits; + +typedef uint32_t GnssMeasurementsDataFlagsMask; +typedef enum { + GNSS_MEASUREMENTS_DATA_SV_ID_BIT = (1<<0), + GNSS_MEASUREMENTS_DATA_SV_TYPE_BIT = (1<<1), + GNSS_MEASUREMENTS_DATA_STATE_BIT = (1<<2), + GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_BIT = (1<<3), + GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_UNCERTAINTY_BIT = (1<<4), + GNSS_MEASUREMENTS_DATA_CARRIER_TO_NOISE_BIT = (1<<5), + GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_BIT = (1<<6), + GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_UNCERTAINTY_BIT = (1<<7), + GNSS_MEASUREMENTS_DATA_ADR_STATE_BIT = (1<<8), + GNSS_MEASUREMENTS_DATA_ADR_BIT = (1<<9), + GNSS_MEASUREMENTS_DATA_ADR_UNCERTAINTY_BIT = (1<<10), + GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT = (1<<11), + GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT = (1<<12), + GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT = (1<<13), + GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT = (1<<14), + GNSS_MEASUREMENTS_DATA_MULTIPATH_INDICATOR_BIT = (1<<15), + GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT = (1<<16), +} GnssMeasurementsDataFlagsBits; + +typedef uint32_t GnssMeasurementsStateMask; +typedef enum { + GNSS_MEASUREMENTS_STATE_UNKNOWN_BIT = 0, + GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT = (1<<0), + GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT = (1<<1), + GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT = (1<<2), + GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT = (1<<3), + GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT = (1<<4), + GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT = (1<<5), + GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT = (1<<6), + GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT = (1<<7), + GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT = (1<<8), + GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT = (1<<9), + GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT = (1<<10), + GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT = (1<<11), + GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT = (1<<12), + GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT = (1<<13), +} GnssMeasurementsStateBits; + +typedef enum { + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_UNKNOWN = 0, + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT, + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT, +} GnssMeasurementsMultipathIndicator; + +typedef uint32_t GnssMeasurementsClockFlagsMask; +typedef enum { + GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT = (1<<0), + GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_BIT = (1<<1), + GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT = (1<<2), + GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT = (1<<3), + GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT = (1<<4), + GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT = (1<<5), + GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT = (1<<6), + GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT = (1<<7), + GNSS_MEASUREMENTS_CLOCK_FLAGS_HW_CLOCK_DISCONTINUITY_COUNT_BIT = (1<<8), +} GnssMeasurementsClockFlagsBits; + +typedef uint32_t GnssAidingDataSvMask; +typedef enum { + GNSS_AIDING_DATA_SV_EPHEMERIS = (1<<0), // ephemeris + GNSS_AIDING_DATA_SV_ALMANAC = (1<<1), // almanac + GNSS_AIDING_DATA_SV_HEALTH = (1<<2), // health + GNSS_AIDING_DATA_SV_DIRECTION = (1<<3), // direction + GNSS_AIDING_DATA_SV_STEER = (1<<4), // steer + GNSS_AIDING_DATA_SV_ALMANAC_CORR = (1<<5), // almanac correction + GNSS_AIDING_DATA_SV_BLACKLIST = (1<<6), // blacklist SVs + GNSS_AIDING_DATA_SV_SA_DATA = (1<<7), // sensitivity assistance data + GNSS_AIDING_DATA_SV_NO_EXIST = (1<<8), // SV does not exist + GNSS_AIDING_DATA_SV_IONOSPHERE = (1<<9), // ionosphere correction + GNSS_AIDING_DATA_SV_TIME = (1<<10),// reset satellite time +} GnssAidingDataSvBits; + +typedef uint32_t GnssAidingDataSvTypeMask; +typedef enum { + GNSS_AIDING_DATA_SV_TYPE_GPS = (1<<0), + GNSS_AIDING_DATA_SV_TYPE_GLONASS = (1<<1), + GNSS_AIDING_DATA_SV_TYPE_QZSS = (1<<2), + GNSS_AIDING_DATA_SV_TYPE_BEIDOU = (1<<3), + GNSS_AIDING_DATA_SV_TYPE_GALILEO = (1<<4), +} GnssAidingDataSvTypeBits; + +typedef struct { + GnssAidingDataSvMask svMask; // bitwise OR of GnssAidingDataSvBits + GnssAidingDataSvTypeMask svTypeMask; // bitwise OR of GnssAidingDataSvTypeBits +} GnssAidingDataSv; + +typedef uint32_t GnssAidingDataCommonMask; +typedef enum { + GNSS_AIDING_DATA_COMMON_POSITION = (1<<0), // position estimate + GNSS_AIDING_DATA_COMMON_TIME = (1<<1), // reset all clock values + GNSS_AIDING_DATA_COMMON_UTC = (1<<2), // UTC estimate + GNSS_AIDING_DATA_COMMON_RTI = (1<<3), // RTI + GNSS_AIDING_DATA_COMMON_FREQ_BIAS_EST = (1<<4), // frequency bias estimate + GNSS_AIDING_DATA_COMMON_CELLDB = (1<<5), // all celldb info +} GnssAidingDataCommonBits; + +typedef struct { + GnssAidingDataCommonMask mask; // bitwise OR of GnssAidingDataCommonBits +} GnssAidingDataCommon; + +typedef struct { + bool deleteAll; // if true, delete all aiding data and ignore other params + GnssAidingDataSv sv; // SV specific aiding data + GnssAidingDataCommon common; // common aiding data +} GnssAidingData; + +typedef struct { + size_t size; // set to sizeof(Location) + LocationFlagsMask flags; // bitwise OR of LocationFlagsBits to mark which params are valid + uint64_t timestamp; // UTC timestamp for location fix, milliseconds since January 1, 1970 + double latitude; // in degrees + double longitude; // in degrees + double altitude; // in meters above the WGS 84 reference ellipsoid + float speed; // in meters per second + float bearing; // in degrees; range [0, 360) + float accuracy; // in meters + LocationTechnologyMask techMask; +} Location; + +typedef struct { + size_t size; // set to sizeof(LocationOptions) + uint32_t minInterval; // in milliseconds + uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ + // gnssMeasurementsCallback may not be called + GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted +} LocationOptions; + +typedef struct { + size_t size; // set to sizeof(GeofenceOption) + GeofenceBreachTypeMask breachTypeMask; // bitwise OR of GeofenceBreachTypeBits + uint32_t responsiveness; // in milliseconds + uint32_t dwellTime; // in seconds +} GeofenceOption; + +typedef struct { + size_t size; // set to sizeof(GeofenceInfo) + double latitude; // in degrees + double longitude; // in degrees + double radius; // in meters +} GeofenceInfo; + +typedef struct { + size_t size; // set to sizeof(GeofenceBreachNotification) + size_t count; // number of ids in array + uint32_t* ids; // array of ids that have breached + Location location; // location associated with breach + GeofenceBreachType type; // type of breach + uint64_t timestamp; // timestamp of breach +} GeofenceBreachNotification; + +typedef struct { + size_t size; // set to sizeof(GeofenceBreachNotification) + GeofenceStatusAvailable available; // GEOFENCE_STATUS_AVAILABILE_NO/_YES + LocationTechnologyType techType; // GNSS +} GeofenceStatusNotification; + +typedef struct { + size_t size; // set to sizeof(GnssLocationInfo) + GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity + float altitudeMeanSeaLevel; // altitude wrt mean sea level + float pdop; // position dilusion of precision + float hdop; // horizontal dilusion of precision + float vdop; // vertical dilusion of precision + float magneticDeviation; // magnetic deviation + float verAccuracy; // vertical accuracy in meters + float speedAccuracy; // speed accuracy in meters/second + float bearingAccuracy; // bearing accuracy in degrees (0 to 359.999) + LocationReliability horReliability; // horizontal reliability + LocationReliability verReliability; // vertical reliability + float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis + float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis + float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth +} GnssLocationInfoNotification; + +typedef struct { + size_t size; // set to sizeof(GnssNiNotification) + GnssNiType type; // type of NI (Voice, SUPL, Control Plane) + GnssNiOptionsMask options; // bitwise OR of GnssNiOptionsBits + uint32_t timeout; // time (seconds) to wait for user input + GnssNiResponse timeoutResponse; // the response that should be sent when timeout expires + char requestor[GNSS_NI_REQUESTOR_MAX]; // the requestor that is making the request + GnssNiEncodingType requestorEncoding; // the encoding type for requestor + char message[GNSS_NI_MESSAGE_ID_MAX]; // the message to show user + GnssNiEncodingType messageEncoding; // the encoding type for message + char extras[GNSS_NI_MESSAGE_ID_MAX]; +} GnssNiNotification; + +typedef struct { + size_t size; // set to sizeof(GnssSv) + uint16_t svId; // Unique Identifier + GnssSvType type; // type of SV (GPS, SBAS, GLONASS, QZSS, BEIDOU, GALILEO) + float cN0Dbhz; // signal strength + float elevation; // elevation of SV (in degrees) + float azimuth; // azimuth of SV (in degrees) + GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits +} GnssSv; + +typedef struct { + size_t size; // set to sizeof(GnssConfigSetAssistanceServer) + GnssAssistanceType type; // SUPL or C2K + const char* hostName; // null terminated string + uint32_t port; // port of server +} GnssConfigSetAssistanceServer; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsData) + GnssMeasurementsDataFlagsMask flags; // bitwise OR of GnssMeasurementsDataFlagsBits + int16_t svId; + GnssSvType svType; + double timeOffsetNs; + GnssMeasurementsStateMask stateMask; // bitwise OR of GnssMeasurementsStateBits + int64_t receivedSvTimeNs; + int64_t receivedSvTimeUncertaintyNs; + double carrierToNoiseDbHz; + double pseudorangeRateMps; + double pseudorangeRateUncertaintyMps; + GnssMeasurementsAdrStateMask adrStateMask; // bitwise OR of GnssMeasurementsAdrStateBits + double adrMeters; + double adrUncertaintyMeters; + float carrierFrequencyHz; + int64_t carrierCycles; + double carrierPhase; + double carrierPhaseUncertainty; + GnssMeasurementsMultipathIndicator multipathIndicator; + double signalToNoiseRatioDb; +} GnssMeasurementsData; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsClock) + GnssMeasurementsClockFlagsMask flags; // bitwise OR of GnssMeasurementsClockFlagsBits + int16_t leapSecond; + int64_t timeNs; + double timeUncertaintyNs; + int64_t fullBiasNs; + double biasNs; + double biasUncertaintyNs; + double driftNsps; + double driftUncertaintyNsps; + uint32_t hwClockDiscontinuityCount; +} GnssMeasurementsClock; + +typedef struct { + size_t size; // set to sizeof(GnssSvNotification) + size_t count; // number of SVs in the GnssSv array + GnssSv gnssSvs[GNSS_SV_MAX]; // information on a number of SVs +} GnssSvNotification; + +typedef struct { + size_t size; // set to sizeof(GnssNmeaNotification) + uint64_t timestamp; // timestamp + const char* nmea; // nmea text + size_t length; // length of the nmea text +} GnssNmeaNotification; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsNotification) + size_t count; // number of items in GnssMeasurements array + GnssMeasurementsData measurements[GNSS_MEASUREMENTS_MAX]; + GnssMeasurementsClock clock; // clock +} GnssMeasurementsNotification; + +typedef struct { + size_t size; // set to sizeof(GnssConfig) + GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid + GnssConfigGpsLock gpsLock; + GnssConfigSuplVersion suplVersion; + GnssConfigSetAssistanceServer assistanceServer; + GnssConfigLppProfile lppProfile; + GnssConfigLppeControlPlaneMask lppeControlPlaneMask; + GnssConfigLppeUserPlaneMask lppeUserPlaneMask; + GnssConfigAGlonassPositionProtocolMask aGlonassPositionProtocolMask; + GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl; + GnssConfigSuplEmergencyServices suplEmergencyServices; + GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits +} GnssConfig; + +/* Provides the capabilities of the system + capabilities callback is called once soon after createInstance is called */ +typedef std::function capabilitiesCallback; + +/* Used by tracking, batching, and miscellanous APIs + responseCallback is called for every Tracking, Batching API, and Miscellanous API */ +typedef std::function responseCallback; + +/* Used by APIs that gets more than one LocationError in it's response + collectiveResponseCallback is called for every geofence API call. + ids array and LocationError array are only valid until collectiveResponseCallback returns. */ +typedef std::function collectiveResponseCallback; + +/* Used for startTracking API, optional can be NULL + trackingCallback is called when delivering a location in a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function trackingCallback; + +/* Used for startBatching API, optional can be NULL + batchingCallback is called when delivering locations in a batching session. + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function batchingCallback; + +/* Gives GNSS Location information, optional can be NULL + gnssLocationInfoCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssLocationInfoCallback; + +/* Used for addGeofences API, optional can be NULL + geofenceBreachCallback is called when any number of geofences have a state change */ +typedef std::function geofenceBreachCallback; + +/* Used for addGeofences API, optional can be NULL + geofenceStatusCallback is called when any number of geofences have a status change */ +typedef std::function geofenceStatusCallback; + +/* Network Initiated request, optional can be NULL + This callback should be responded to by calling gnssNiResponse */ +typedef std::function gnssNiCallback; + +/* Gives GNSS SV information, optional can be NULL + gnssSvCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssSvCallback; + +/* Gives GNSS NMEA data, optional can be NULL + gnssNmeaCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssNmeaCallback; + +/* Gives GNSS Measurements information, optional can be NULL + gnssMeasurementsCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssMeasurementsCallback; + +typedef struct { + size_t size; // set to sizeof(LocationCallbacks) + capabilitiesCallback capabilitiesCb; // mandatory + responseCallback responseCb; // mandatory + collectiveResponseCallback collectiveResponseCb; // mandatory + trackingCallback trackingCb; // optional + batchingCallback batchingCb; // optional + geofenceBreachCallback geofenceBreachCb; // optional + geofenceStatusCallback geofenceStatusCb; // optional + gnssLocationInfoCallback gnssLocationInfoCb; // optional + gnssNiCallback gnssNiCb; // optional + gnssSvCallback gnssSvCb; // optional + gnssNmeaCallback gnssNmeaCb; // optional + gnssMeasurementsCallback gnssMeasurementsCb; // optional +} LocationCallbacks; + +class LocationAPI +{ +private: + LocationAPI(); + ~LocationAPI(); + +public: + /* creates an instance to LocationAPI object. + Will return NULL if mandatory parameters are invalid or if the maximum number + of instances have been reached */ + static LocationAPI* createInstance(LocationCallbacks&); + + /* destroy/cleans up the instance, which should be called when LocationAPI object is + no longer needed. LocationAPI* returned from createInstance will no longer valid + after destroy is called */ + void destroy(); + + /* updates/changes the callbacks that will be called. + mandatory callbacks must be present for callbacks to be successfully updated + no return value */ + void updateCallbacks(LocationCallbacks&); + + /* ================================== TRACKING ================================== */ + + /* startTracking starts a tracking session, which returns a session id that will be + used by the other tracking APIs and also in the responseCallback to match command + with response. locations are reported on the trackingCallback passed in createInstance + periodically according to LocationOptions. + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successfully started + LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress + LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed in createInstance + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameter is invalid */ + uint32_t startTracking(LocationOptions&); // returns session id + + /* stopTracking stops a tracking session associated with id parameter. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ + void stopTracking(uint32_t id); + + /* updateTrackingOptions changes the LocationOptions of a tracking session associated with id + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ + void updateTrackingOptions(uint32_t id, LocationOptions&); + + /* ================================== BATCHING ================================== */ + + /* startBatching starts a batching session, which returns a session id that will be + used by the other batching APIs and also in the responseCallback to match command + with response. locations are reported on the batchingCallback passed in createInstance + periodically according to LocationOptions. A batching session starts tracking on + the low power processor and delivers them in batches by the batchingCallback when + the batch is full or when getBatchedLocations is called. This allows for the processor + that calls this API to sleep when the low power processor can batch locations in the + backgroup and wake up the processor calling the API only when the batch is full, thus + saving power + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_ALREADY_STARTED if a startBatching session is already in progress + LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance + LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid + LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ + uint32_t startBatching(LocationOptions&); // returns session id + + /* stopBatching stops a batching session associated with id parameter. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with batching session */ + void stopBatching(uint32_t id); + + /* updateBatchingOptions changes the LocationOptions of a batching session associated with id + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ + void updateBatchingOptions(uint32_t id, LocationOptions&); + + /* getBatchedLocations gets a number of locations that are currently stored/batched + on the low power processor, delivered by the batchingCallback passed in createInstance. + Location are then deleted from the batch stored on the low power processor. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful, will be followed by batchingCallback call + LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ + void getBatchedLocations(uint32_t id, size_t count); + + /* ================================== GEOFENCE ================================== */ + + /* addGeofences adds any number of geofences and returns an array of geofence ids that + will be used by the other geofence APIs and also in the collectiveResponseCallback to + match command with response. The geofenceBreachCallback will deliver the status of each + geofence according to the GeofenceOption for each. The geofence id array returned will + be valid until the collectiveResponseCallback is called and has returned. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_CALLBACK_MISSING if no geofenceBreachCallback + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + LOCATION_ERROR_NOT_SUPPORTED if geofence is not supported */ + uint32_t* addGeofences(size_t count, GeofenceOption*, GeofenceInfo*); // returns id array + + /* removeGeofences removes any number of geofences. Caller should delete ids array after + removeGeofences returneds. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + void removeGeofences(size_t count, uint32_t* ids); + + /* modifyGeofences modifies any number of geofences. Caller should delete ids array after + modifyGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid */ + void modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options); + + /* pauseGeofences pauses any number of geofences, which is similar to removeGeofences, + only that they can be resumed at any time. Caller should delete ids array after + pauseGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + void pauseGeofences(size_t count, uint32_t* ids); + + /* resumeGeofences resumes any number of geofences that are currently paused. Caller should + delete ids array after resumeGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + void resumeGeofences(size_t count, uint32_t* ids); + + /* ================================== GNSS ====================================== */ + + /* gnssNiResponse is called in response to a gnssNiCallback. + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters in GnssNiResponse are invalid + LOCATION_ERROR_ID_UNKNOWN if id does not match a gnssNiCallback */ + void gnssNiResponse(uint32_t id, GnssNiResponse response); +}; + +typedef struct { + size_t size; // set to sizeof(LocationControlCallbacks) + responseCallback responseCb; // mandatory + collectiveResponseCallback collectiveResponseCb; // mandatory +} LocationControlCallbacks; + +class LocationControlAPI +{ +private: + LocationControlAPI(); + ~LocationControlAPI(); + +public: + /* creates an instance to LocationControlAPI object. + Will return NULL if mandatory parameters are invalid or if the maximum number + of instances have been reached. Only once instance allowed */ + static LocationControlAPI* createInstance(LocationControlCallbacks&); + + /* destroy/cleans up the instance, which should be called when LocationControlAPI object is + no longer needed. LocationControlAPI* returned from createInstance will no longer valid + after destroy is called */ + void destroy(); + + /* enable will enable specific location technology to be used for calculation locations and + will effectively start a control session if call is successful, which returns a session id + that will be returned in responseCallback to match command with response. The session id is + also needed to call the disable command. + This effect is global for all clients of LocationAPI + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ALREADY_STARTED if an enable was already called for this techType + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ + uint32_t enable(LocationTechnologyType techType); + + /* disable will disable specific location technology to be used for calculation locations and + effectively ends the control session if call is successful. + id parameter is the session id that was returned in enable responseCallback for techType. + The session id is no longer valid after disable's responseCallback returns success. + This effect is global for all clients of LocationAPI + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id was not returned from responseCallback from enable + LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ + void disable(uint32_t id); + + /* gnssUpdateConfig updates the gnss specific configuration, which returns a session id array + with an id for each of the bits set in GnssConfig.flags, order from low bits to high bits. + The response for each config that is set will be returned in collectiveResponseCallback. + The session id array returned will be valid until the collectiveResponseCallback is called + and has returned. This effect is global for all clients of LocationAPI + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_INVALID_PARAMETER if any other parameters are invalid + LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ + uint32_t* gnssUpdateConfig(GnssConfig config); + + /* delete specific gnss aiding data for testing, which returns a session id + that will be returned in responseCallback to match command with response. + Only allowed in userdebug builds. This effect is global for all clients of LocationAPI + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */ + uint32_t gnssDeleteAidingData(GnssAidingData& data); +}; + +#endif /* LOCATION_H */ diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp new file mode 100644 index 00000000..3413d3ef --- /dev/null +++ b/location/LocationAPIClientBase.cpp @@ -0,0 +1,769 @@ +/* Copyright (c) 2017 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_APIClientBase" + +#include +#include +#include "LocationAPIClientBase.h" + +#define FLP_CONF_FILE "/etc/flp.conf" + +LocationAPIClientBase::LocationAPIClientBase() : + mTrackingCallback(nullptr), + mBatchingCallback(nullptr), + mGeofenceBreachCallback(nullptr), + mLocationAPI(nullptr), + mLocationControlAPI(nullptr), + mBatchSize(-1) +{ + + // use recursive mutex, in case callback come from the same thread + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mMutex, &attr); + + for (int i = 0; i < REQUEST_MAX; i++) { + mRequestQueues[i] = nullptr; + } + + memset(&mConfig, 0, sizeof(GnssConfig)); +} + +void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallbacks) +{ + if (locationCallbacks.geofenceBreachCb != nullptr) { + mGeofenceBreachCallback = locationCallbacks.geofenceBreachCb; + locationCallbacks.geofenceBreachCb = + [this](GeofenceBreachNotification geofenceBreachNotification) { + beforeGeofenceBreachCb(geofenceBreachNotification); + }; + } + + locationCallbacks.capabilitiesCb = + [this](LocationCapabilitiesMask capabilitiesMask) { + onCapabilitiesCb(capabilitiesMask); + }; + locationCallbacks.responseCb = [this](LocationError error, uint32_t id) { + onResponseCb(error, id); + }; + locationCallbacks.collectiveResponseCb = + [this](size_t count, LocationError* errors, uint32_t* ids) { + onCollectiveResponseCb(count, errors, ids); + }; + + if (mLocationAPI == nullptr ) { + mLocationAPI = LocationAPI::createInstance(locationCallbacks); + } else { + mLocationAPI->updateCallbacks(locationCallbacks); + } + + if (mLocationControlAPI == nullptr) { + LocationControlCallbacks locationControlCallbacks; + locationControlCallbacks.size = sizeof(LocationControlCallbacks); + + locationControlCallbacks.responseCb = + [this](LocationError error, uint32_t id) { + onCtrlResponseCb(error, id); + }; + locationControlCallbacks.collectiveResponseCb = + [this](size_t count, LocationError* errors, uint32_t* ids) { + onCtrlCollectiveResponseCb(count, errors, ids); + }; + + mLocationControlAPI = LocationControlAPI::createInstance(locationControlCallbacks); + } +} + +LocationAPIClientBase::~LocationAPIClientBase() +{ + if (mLocationAPI) { + mLocationAPI->destroy(); + mLocationAPI = nullptr; + } + if (mLocationControlAPI) { + mLocationControlAPI->destroy(); + mLocationControlAPI = nullptr; + } + + pthread_mutex_lock(&mMutex); + for (int i = 0; i < REQUEST_MAX; i++) { + if (mRequestQueues[i]) { + delete mRequestQueues[i]; + mRequestQueues[i] = nullptr; + } + } + pthread_mutex_unlock(&mMutex); + + pthread_mutex_destroy(&mMutex); +} + +uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + delete requests; + } + uint32_t session = mLocationAPI->startTracking(options); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + // onResponseCb might be called from other thread immediately after + // startTracking returns, so we are not going to unlock mutex + // until StartTrackingRequest is pushed into mRequestQueues[REQUEST_TRACKING] + requests = new RequestQueue(session); + requests->push(new StartTrackingRequest(*this)); + mRequestQueues[REQUEST_TRACKING] = requests; + pthread_mutex_unlock(&mMutex); + + retVal = LOCATION_ERROR_SUCCESS; + } + + return retVal; +} + +void LocationAPIClientBase::locAPIStopTracking() +{ + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + uint32_t session = -1; + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + session = requests->getSession(); + requests->push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(session); + } + pthread_mutex_unlock(&mMutex); + } +} + +void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options) +{ + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + uint32_t session = -1; + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + session = requests->getSession(); + requests->push(new UpdateTrackingOptionsRequest(*this)); + mLocationAPI->updateTrackingOptions(session, options); + } + pthread_mutex_unlock(&mMutex); + } +} + +int32_t LocationAPIClientBase::locAPIGetBatchSize() +{ + if (mBatchSize == -1) { + const loc_param_s_type flp_conf_param_table[] = + { + {"BATCH_SIZE", &mBatchSize, nullptr, 'n'}, + }; + UTIL_READ_CONF(FLP_CONF_FILE, flp_conf_param_table); + if (mBatchSize < 0) { + // set mBatchSize to 0 if we got an illegal value from config file + mBatchSize = 0; + } + } + return mBatchSize; +} + + +uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t sessionMode, + LocationOptions& options) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + + if (mSessionMap.find(id) != mSessionMap.end()) { + LOC_LOGE("%s:%d] session %d has already started.", __FUNCTION__, __LINE__, id); + retVal = LOCATION_ERROR_ALREADY_STARTED; + } else { + uint32_t trackingSession = 0; + uint32_t batchingSession = 0; + + if (sessionMode == SESSION_MODE_ON_FIX) { + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + delete requests; + } + trackingSession = mLocationAPI->startTracking(options); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); + requests = new RequestQueue(trackingSession); + requests->push(new StartTrackingRequest(*this)); + mRequestQueues[REQUEST_TRACKING] = requests; + } else if (sessionMode == SESSION_MODE_ON_FULL) { + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + delete requests; + } + batchingSession = mLocationAPI->startBatching(options); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); + requests = new RequestQueue(batchingSession); + requests->push(new StartBatchingRequest(*this)); + mRequestQueues[REQUEST_BATCHING] = requests; + } + + SessionEntity entity; + entity.id = id; + entity.trackingSession = trackingSession; + entity.batchingSession = batchingSession; + entity.sessionMode = sessionMode; + mSessionMap[id] = entity; + + retVal = LOCATION_ERROR_SUCCESS; + } + + pthread_mutex_unlock(&mMutex); + } + + return retVal; +} + +uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + + if (mSessionMap.find(id) != mSessionMap.end()) { + SessionEntity entity = mSessionMap[id]; + + uint32_t trackingSession = entity.trackingSession; + uint32_t batchingSession = entity.batchingSession; + uint32_t sMode = entity.sessionMode; + + mSessionMap.erase(id); + + if (sMode == SESSION_MODE_ON_FIX) { + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + requests->push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(trackingSession); + } + } else if (sMode == SESSION_MODE_ON_FULL) { + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + requests->push(new StopBatchingRequest(*this)); + mLocationAPI->stopBatching(batchingSession); + } + } + + retVal = LOCATION_ERROR_SUCCESS; + } else { + retVal = LOCATION_ERROR_ID_UNKNOWN; + LOC_LOGE("%s:%d] session %d is not exist.", __FUNCTION__, __LINE__, id); + } + + pthread_mutex_unlock(&mMutex); + } + return retVal; +} + +uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, + LocationOptions& options) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + + if (mSessionMap.find(id) != mSessionMap.end()) { + SessionEntity& entity = mSessionMap[id]; + + uint32_t trackingSession = entity.trackingSession; + uint32_t batchingSession = entity.batchingSession; + uint32_t sMode = entity.sessionMode; + + if (sessionMode == SESSION_MODE_ON_FIX) { + if (sMode == SESSION_MODE_ON_FIX) { + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + requests->push(new UpdateTrackingOptionsRequest(*this)); + mLocationAPI->updateTrackingOptions(trackingSession, options); + } + } else if (sMode == SESSION_MODE_ON_FULL) { + // stop batching + { + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + requests->push(new StopBatchingRequest(*this)); + mLocationAPI->stopBatching(batchingSession); + batchingSession = 0; + } + } + // start tracking + { + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + delete requests; + } + trackingSession = mLocationAPI->startTracking(options); + LOC_LOGI("%s:%d] start new session: %d", + __FUNCTION__, __LINE__, trackingSession); + requests = new RequestQueue(trackingSession); + requests->push(new StartTrackingRequest(*this)); + mRequestQueues[REQUEST_TRACKING] = requests; + } + } + } else if (sessionMode == SESSION_MODE_ON_FULL) { + if (sMode == SESSION_MODE_ON_FIX) { + // stop tracking + { + RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; + if (requests) { + requests->push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(trackingSession); + trackingSession = 0; + } + } + // start batching + { + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + delete requests; + } + batchingSession = mLocationAPI->startBatching(options); + LOC_LOGI("%s:%d] start new session: %d", + __FUNCTION__, __LINE__, batchingSession); + requests = new RequestQueue(batchingSession); + requests->push(new StartBatchingRequest(*this)); + mRequestQueues[REQUEST_BATCHING] = requests; + } + } else if (sMode == SESSION_MODE_ON_FULL) { + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + requests->push(new UpdateBatchingOptionsRequest(*this)); + mLocationAPI->updateBatchingOptions(batchingSession, options); + } + } + } + + entity.trackingSession = trackingSession; + entity.batchingSession = batchingSession; + entity.sessionMode = sessionMode; + + retVal = LOCATION_ERROR_SUCCESS; + } else { + retVal = LOCATION_ERROR_ID_UNKNOWN; + LOC_LOGE("%s:%d] session %d is not exist.", __FUNCTION__, __LINE__, id); + } + + pthread_mutex_unlock(&mMutex); + } + return retVal; +} + +void LocationAPIClientBase::locAPIGetBatchedLocations(size_t count) +{ + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + uint32_t session = -1; + RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; + if (requests) { + session = requests->getSession(); + requests->push(new GetBatchedLocationsRequest(*this)); + mLocationAPI->getBatchedLocations(session, count); + } + pthread_mutex_unlock(&mMutex); + } +} + +uint32_t LocationAPIClientBase::locAPIAddGeofences( + size_t count, uint32_t* ids, GeofenceOption* options, GeofenceInfo* data) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + delete requests; + } + uint32_t* sessions = mLocationAPI->addGeofences(count, options, data); + LOC_LOGI("%s:%d] start new sessions: %p", __FUNCTION__, __LINE__, sessions); + requests = new RequestQueue(-1); + requests->push(new AddGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE] = requests; + + for (size_t i = 0; i < count; i++) { + mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); + } + pthread_mutex_unlock(&mMutex); + + retVal = LOCATION_ERROR_SUCCESS; + } + + return retVal; +} + +void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) +{ + if (mLocationAPI) { + uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + for (size_t i = 0; i < count; i++) { + sessions[i] = mGeofenceBiDict.getSession(ids[i]); + } + requests->push(new RemoveGeofencesRequest(*this)); + mLocationAPI->removeGeofences(count, sessions); + } + pthread_mutex_unlock(&mMutex); + + free(sessions); + } +} + +void LocationAPIClientBase::locAPIModifyGeofences( + size_t count, uint32_t* ids, GeofenceOption* options) +{ + if (mLocationAPI) { + uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + for (size_t i = 0; i < count; i++) { + sessions[i] = mGeofenceBiDict.getSession(ids[i]); + mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); + } + requests->push(new ModifyGeofencesRequest(*this)); + mLocationAPI->modifyGeofences(count, sessions, options); + } + pthread_mutex_unlock(&mMutex); + + free(sessions); + } +} + +void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) +{ + if (mLocationAPI) { + uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + for (size_t i = 0; i < count; i++) { + sessions[i] = mGeofenceBiDict.getSession(ids[i]); + } + requests->push(new PauseGeofencesRequest(*this)); + mLocationAPI->pauseGeofences(count, sessions); + } + pthread_mutex_unlock(&mMutex); + + free(sessions); + } +} + +void LocationAPIClientBase::locAPIResumeGeofences( + size_t count, uint32_t* ids, GeofenceBreachTypeMask* mask) +{ + if (mLocationAPI) { + uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + for (size_t i = 0; i < count; i++) { + sessions[i] = mGeofenceBiDict.getSession(ids[i]); + if (mask) { + mGeofenceBiDict.set(ids[i], sessions[i], mask[i]); + } + } + requests->push(new ResumeGeofencesRequest(*this)); + mLocationAPI->resumeGeofences(count, sessions); + } + pthread_mutex_unlock(&mMutex); + + free(sessions); + } +} + +void LocationAPIClientBase::locAPIRemoveAllGeofences() +{ + if (mLocationAPI) { + std::vector sessionsVec = mGeofenceBiDict.getAllSessions(); + size_t count = sessionsVec.size(); + uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; + if (requests) { + for (size_t i = 0; i < count; i++) { + sessions[i] = sessionsVec[i]; + } + requests->push(new RemoveGeofencesRequest(*this)); + mLocationAPI->removeGeofences(count, sessions); + } + pthread_mutex_unlock(&mMutex); + + free(sessions); + } +} + +void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse response) +{ + uint32_t session = 0; + if (mLocationAPI) { + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_NIRESPONSE]; + if (requests) { + delete requests; + } + uint32_t session = id; + mLocationAPI->gnssNiResponse(id, response); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + requests = new RequestQueue(session); + requests->push(new GnssNiResponseRequest(*this)); + mRequestQueues[REQUEST_NIRESPONSE] = requests; + pthread_mutex_unlock(&mMutex); + } +} + +uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationControlAPI) { + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_DELETEAIDINGDATA]; + if (requests) { + delete requests; + } + uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + requests = new RequestQueue(session); + requests->push(new GnssDeleteAidingDataRequest(*this)); + mRequestQueues[REQUEST_DELETEAIDINGDATA] = requests; + pthread_mutex_unlock(&mMutex); + + retVal = LOCATION_ERROR_SUCCESS; + } + + return retVal; +} + +uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (mLocationControlAPI) { + pthread_mutex_lock(&mMutex); + RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; + if (requests) { + delete requests; + } + uint32_t session = mLocationControlAPI->enable(techType); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + requests = new RequestQueue(session); + requests->push(new EnableRequest(*this)); + mRequestQueues[REQUEST_CONTROL] = requests; + pthread_mutex_unlock(&mMutex); + + retVal = LOCATION_ERROR_SUCCESS; + } + + return retVal; +} + +void LocationAPIClientBase::locAPIDisable() +{ + if (mLocationControlAPI) { + pthread_mutex_lock(&mMutex); + uint32_t session = -1; + RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; + if (requests) { + session = requests->getSession(); + requests->push(new DisableRequest(*this)); + mLocationControlAPI->disable(session); + } + pthread_mutex_unlock(&mMutex); + } +} + +uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (memcmp(&mConfig, &config, sizeof(GnssConfig)) == 0) { + LOC_LOGE("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); + return retVal; + } + + if (mLocationControlAPI) { + pthread_mutex_lock(&mMutex); + + memcpy(&mConfig, &config, sizeof(GnssConfig)); + + uint32_t session = -1; + RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; + if (requests) { + session = requests->getSession(); + requests->push(new GnssUpdateConfigRequest(*this)); + uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); + LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); + } + pthread_mutex_unlock(&mMutex); + + retVal = LOCATION_ERROR_SUCCESS; + } + return retVal; +} + +void LocationAPIClientBase::beforeGeofenceBreachCb( + GeofenceBreachNotification geofenceBreachNotification) +{ + if (mGeofenceBreachCallback == nullptr) + return; + uint32_t* ids = (uint32_t*)malloc(sizeof(uint32_t) * geofenceBreachNotification.count); + uint32_t* backup = geofenceBreachNotification.ids; + size_t n = geofenceBreachNotification.count; + + size_t count = 0; + for (size_t i = 0; i < n; i++) { + uint32_t id = mGeofenceBiDict.getId(geofenceBreachNotification.ids[i]); + GeofenceBreachTypeMask type = mGeofenceBiDict.getType(geofenceBreachNotification.ids[i]); + if ((geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER && + (type & GEOFENCE_BREACH_ENTER_BIT)) || + (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT && + (type & GEOFENCE_BREACH_EXIT_BIT)) + ) { + ids[count] = id; + count++; + } + } + geofenceBreachNotification.count = count; + geofenceBreachNotification.ids = ids; + mGeofenceBreachCallback(geofenceBreachNotification); + + // restore ids + geofenceBreachNotification.ids = backup; + geofenceBreachNotification.count = n; + free(ids); +} + +void LocationAPIClientBase::onResponseCb(LocationError error, uint32_t id) +{ + if (error != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, error, id); + } else { + LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, error, id); + } + LocationAPIRequest* request = getRequestBySession(id); + if (request) { + request->onResponse(error); + delete request; + } +} + +void LocationAPIClientBase::onCollectiveResponseCb( + size_t count, LocationError* errors, uint32_t* ids) +{ + for (size_t i = 0; i < count; i++) { + if (errors[i] != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } else { + LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } + } + LocationAPIRequest* request = nullptr; + if (count > 0 && ids) + request = getRequestBySession(ids[0]); + if (!request) + request = getGeofencesRequest(); + if (request) { + request->onCollectiveResponse(count, errors, ids); + delete request; + } +} + +void LocationAPIClientBase::onCtrlResponseCb(LocationError error, uint32_t id) +{ + if (error != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, error, id); + } else { + LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, error, id); + } + LocationAPIRequest* request = getRequestBySession(id); + if (request) { + request->onResponse(error); + delete request; + } +} + +void LocationAPIClientBase::onCtrlCollectiveResponseCb( + size_t count, LocationError* errors, uint32_t* ids) +{ + for (size_t i = 0; i < count; i++) { + if (errors[i] != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } else { + LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } + } + LocationAPIRequest* request = nullptr; + if (count > 0 && ids) + request = getRequestBySession(ids[0]); + if (request) { + request->onCollectiveResponse(count, errors, ids); + delete request; + } +} + +LocationAPIClientBase::LocationAPIRequest* +LocationAPIClientBase::getRequestBySession(uint32_t session) +{ + pthread_mutex_lock(&mMutex); + LocationAPIRequest* request = nullptr; + for (int i = 0; i < REQUEST_MAX; i++) { + if (i != REQUEST_GEOFENCE && + mRequestQueues[i] && + mRequestQueues[i]->getSession() == session) { + request = mRequestQueues[i]->pop(); + break; + } + } + pthread_mutex_unlock(&mMutex); + return request; +} + +LocationAPIClientBase::LocationAPIRequest* +LocationAPIClientBase::getGeofencesRequest() +{ + pthread_mutex_lock(&mMutex); + LocationAPIRequest* request = nullptr; + if (mRequestQueues[REQUEST_GEOFENCE]) { + request = mRequestQueues[REQUEST_GEOFENCE]->pop(); + } + pthread_mutex_unlock(&mMutex); + return request; +} diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h new file mode 100644 index 00000000..8bbaa3dc --- /dev/null +++ b/location/LocationAPIClientBase.h @@ -0,0 +1,457 @@ +/* Copyright (c) 2017 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 LOCATION_API_CLINET_BASE_H +#define LOCATION_API_CLINET_BASE_H + +#include +#include +#include +#include +#include + +#include "LocationAPI.h" + +enum SESSION_MODE { + SESSION_MODE_NONE = 0, + SESSION_MODE_ON_FULL, + SESSION_MODE_ON_FIX, +}; + +enum REQUEST_TYPE { + REQUEST_TRACKING = 0, + REQUEST_BATCHING, + REQUEST_GEOFENCE, + REQUEST_NIRESPONSE, + REQUEST_DELETEAIDINGDATA, + REQUEST_CONTROL, + REQUEST_MAX, +}; + +class LocationAPIClientBase +{ +public: + LocationAPIClientBase(); + virtual ~LocationAPIClientBase(); + LocationAPIClientBase(const LocationAPIClientBase&) = delete; + LocationAPIClientBase& operator=(const LocationAPIClientBase&) = delete; + + void locAPISetCallbacks(LocationCallbacks& locationCallbacks); + + // LocationAPI + uint32_t locAPIStartTracking(LocationOptions& options); + void locAPIStopTracking(); + void locAPIUpdateTrackingOptions(LocationOptions& options); + + int32_t locAPIGetBatchSize(); + uint32_t locAPIStartSession(uint32_t id, uint32_t sessionMode, + LocationOptions& options); + uint32_t locAPIStopSession(uint32_t id); + uint32_t locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, + LocationOptions& options); + void locAPIGetBatchedLocations(size_t count); + + uint32_t locAPIAddGeofences(size_t count, uint32_t* ids, + GeofenceOption* options, GeofenceInfo* data); + void locAPIRemoveGeofences(size_t count, uint32_t* ids); + void locAPIModifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options); + void locAPIPauseGeofences(size_t count, uint32_t* ids); + void locAPIResumeGeofences(size_t count, uint32_t* ids, GeofenceBreachTypeMask* mask); + void locAPIRemoveAllGeofences(); + + void locAPIGnssNiResponse(uint32_t id, GnssNiResponse response); + uint32_t locAPIGnssDeleteAidingData(GnssAidingData& data); + + uint32_t locAPIEnable(LocationTechnologyType techType); + void locAPIDisable(); + uint32_t locAPIGnssUpdateConfig(GnssConfig config); + + // callbacks + void onResponseCb(LocationError error, uint32_t id); + void onCollectiveResponseCb(size_t count, LocationError* errors, uint32_t* ids); + + void onCtrlResponseCb(LocationError error, uint32_t id); + void onCtrlCollectiveResponseCb(size_t count, LocationError* errors, uint32_t* ids); + + void beforeGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification); + + inline virtual void onCapabilitiesCb(LocationCapabilitiesMask /*capabilitiesMask*/) {} + inline virtual void onGnssNmeaCb(GnssNmeaNotification /*gnssNmeaNotification*/) {} + inline virtual void onGnssMeasurementsCb( + GnssMeasurementsNotification /*gnssMeasurementsNotification*/) {} + + inline virtual void onTrackingCb(Location /*location*/) {} + inline virtual void onGnssSvCb(GnssSvNotification /*gnssSvNotification*/) {} + inline virtual void onStartTrackingCb(LocationError /*error*/) {} + inline virtual void onStopTrackingCb(LocationError /*error*/) {} + inline virtual void onUpdateTrackingOptionsCb(LocationError /*error*/) {} + + inline virtual void onGnssLocationInfoCb( + GnssLocationInfoNotification /*gnssLocationInfoNotification*/) {} + + inline virtual void onBatchingCb(size_t /*count*/, Location* /*location*/) {} + inline virtual void onStartBatchingCb(LocationError /*error*/) {} + inline virtual void onStopBatchingCb(LocationError /*error*/) {} + inline virtual void onUpdateBatchingOptionsCb(LocationError /*error*/) {} + inline virtual void onGetBatchedLocationsCb(LocationError /*error*/) {} + + inline virtual void onGeofenceBreachCb( + GeofenceBreachNotification /*geofenceBreachNotification*/) {} + inline virtual void onGeofenceStatusCb( + GeofenceStatusNotification /*geofenceStatusNotification*/) {} + inline virtual void onAddGeofencesCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + inline virtual void onRemoveGeofencesCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + inline virtual void onModifyGeofencesCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + inline virtual void onPauseGeofencesCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + inline virtual void onResumeGeofencesCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + + inline virtual void onGnssNiCb(uint32_t /*id*/, GnssNiNotification /*gnssNiNotification*/) {} + inline virtual void onGnssNiResponseCb(LocationError /*error*/) {} + inline virtual void onGnssDeleteAidingDataCb(LocationError /*error*/) {} + + inline virtual void onEnableCb(LocationError /*error*/) {} + inline virtual void onDisableCb(LocationError /*error*/) {} + inline virtual void onGnssUpdateConfigCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + +private: + // private inner classes + typedef struct { + uint32_t id; + uint32_t trackingSession; + uint32_t batchingSession; + uint32_t sessionMode; + } SessionEntity; + + class BiDict { + public: + BiDict() { + pthread_mutex_init(&mBiDictMutex, nullptr); + } + ~BiDict() { + pthread_mutex_destroy(&mBiDictMutex); + } + bool hasId(uint32_t id) { + pthread_mutex_lock(&mBiDictMutex); + bool ret = (mForwardMap.find(id) != mForwardMap.end()); + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + void set(uint32_t id, uint32_t session, uint32_t type) { + pthread_mutex_lock(&mBiDictMutex); + mForwardMap[id] = session; + mBackwardMap[session] = id; + mTypeMap[session] = type; + pthread_mutex_unlock(&mBiDictMutex); + } + void clear() { + pthread_mutex_lock(&mBiDictMutex); + mForwardMap.clear(); + mBackwardMap.clear(); + mTypeMap.clear(); + pthread_mutex_unlock(&mBiDictMutex); + } + void rmById(uint32_t id) { + pthread_mutex_lock(&mBiDictMutex); + mBackwardMap.erase(mForwardMap[id]); + mTypeMap.erase(mForwardMap[id]); + mForwardMap.erase(id); + pthread_mutex_unlock(&mBiDictMutex); + } + void rmBySession(uint32_t session) { + pthread_mutex_lock(&mBiDictMutex); + mForwardMap.erase(mBackwardMap[session]); + mBackwardMap.erase(session); + mTypeMap.erase(session); + pthread_mutex_unlock(&mBiDictMutex); + } + uint32_t getId(uint32_t session) { + pthread_mutex_lock(&mBiDictMutex); + uint32_t ret = mBackwardMap[session]; + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + uint32_t getSession(uint32_t id) { + pthread_mutex_lock(&mBiDictMutex); + uint32_t ret = mForwardMap[id]; + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + uint32_t getType(uint32_t session) { + pthread_mutex_lock(&mBiDictMutex); + uint32_t ret = mTypeMap[session]; + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + std::vector getAllSessions() { + std::vector ret; + pthread_mutex_lock(&mBiDictMutex); + for (auto it = mBackwardMap.begin(); it != mBackwardMap.end(); it++) { + ret.push_back(it->first); + } + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + private: + pthread_mutex_t mBiDictMutex; + // mForwarMap mapping id->session + std::map mForwardMap; + // mBackwardMap mapping session->id + std::map mBackwardMap; + // mTypeMap mapping session->type + std::map mTypeMap; + }; + + class LocationAPIRequest { + public: + LocationAPIRequest(LocationAPIClientBase& API) : mAPI(API) {} + virtual ~LocationAPIRequest() {} + virtual void onResponse(LocationError /*error*/) {}; + virtual void onCollectiveResponse( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {}; + LocationAPIClientBase& mAPI; + }; + + class StartTrackingRequest : public LocationAPIRequest { + public: + StartTrackingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onStartTrackingCb(error); + } + }; + + class StopTrackingRequest : public LocationAPIRequest { + public: + StopTrackingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onStopTrackingCb(error); + } + }; + + class UpdateTrackingOptionsRequest : public LocationAPIRequest { + public: + UpdateTrackingOptionsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onUpdateTrackingOptionsCb(error); + } + }; + + class StartBatchingRequest : public LocationAPIRequest { + public: + StartBatchingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onStartBatchingCb(error); + } + }; + + class StopBatchingRequest : public LocationAPIRequest { + public: + StopBatchingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onStopBatchingCb(error); + } + }; + + class UpdateBatchingOptionsRequest : public LocationAPIRequest { + public: + UpdateBatchingOptionsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onUpdateBatchingOptionsCb(error); + } + }; + + class GetBatchedLocationsRequest : public LocationAPIRequest { + public: + GetBatchedLocationsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onGetBatchedLocationsCb(error); + } + }; + + class AddGeofencesRequest : public LocationAPIRequest { + public: + AddGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); + } + mAPI.onAddGeofencesCb(count, errors, ids); + free(ids); + } + }; + + class RemoveGeofencesRequest : public LocationAPIRequest { + public: + RemoveGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); + mAPI.mGeofenceBiDict.rmBySession(sessions[i]); + } + mAPI.onRemoveGeofencesCb(count, errors, ids); + free(ids); + } + }; + + class ModifyGeofencesRequest : public LocationAPIRequest { + public: + ModifyGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); + } + mAPI.onModifyGeofencesCb(count, errors, ids); + free(ids); + } + }; + + class PauseGeofencesRequest : public LocationAPIRequest { + public: + PauseGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); + } + mAPI.onPauseGeofencesCb(count, errors, ids); + free(ids); + } + }; + + class ResumeGeofencesRequest : public LocationAPIRequest { + public: + ResumeGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); + } + mAPI.onResumeGeofencesCb(count, errors, ids); + free(ids); + } + }; + + class GnssNiResponseRequest : public LocationAPIRequest { + public: + GnssNiResponseRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onGnssNiResponseCb(error); + } + }; + + class GnssDeleteAidingDataRequest : public LocationAPIRequest { + public: + GnssDeleteAidingDataRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onGnssDeleteAidingDataCb(error); + } + }; + + class EnableRequest : public LocationAPIRequest { + public: + EnableRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onEnableCb(error); + } + }; + + class DisableRequest : public LocationAPIRequest { + public: + DisableRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onResponse(LocationError error) { + mAPI.onDisableCb(error); + } + }; + + class GnssUpdateConfigRequest : public LocationAPIRequest { + public: + GnssUpdateConfigRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* ids) { + mAPI.onGnssUpdateConfigCb(count, errors, ids); + } + }; + + class RequestQueue { + public: + RequestQueue(uint32_t session): mSession(session) { + } + ~RequestQueue() { + LocationAPIRequest* request = nullptr; + while (!mQueue.empty()) { + request = mQueue.front(); + mQueue.pop(); + delete request; + } + } + void push(LocationAPIRequest* request) { + mQueue.push(request); + } + LocationAPIRequest* pop() { + LocationAPIRequest* request = nullptr; + if (!mQueue.empty()) { + request = mQueue.front(); + mQueue.pop(); + } + return request; + } + uint32_t getSession() { return mSession; } + private: + uint32_t mSession; + std::queue mQueue; + }; + + LocationAPIRequest* getRequestBySession(uint32_t session); + LocationAPIRequest* getGeofencesRequest(); + +private: + pthread_mutex_t mMutex; + + trackingCallback mTrackingCallback; + batchingCallback mBatchingCallback; + geofenceBreachCallback mGeofenceBreachCallback; + + LocationAPI* mLocationAPI; + LocationControlAPI* mLocationControlAPI; + + BiDict mGeofenceBiDict; + RequestQueue* mRequestQueues[REQUEST_MAX]; + std::map mSessionMap; + int32_t mBatchSize; + + GnssConfig mConfig; +}; + +#endif /* LOCATION_API_CLINET_BASE_H */ diff --git a/location/location_interface.h b/location/location_interface.h new file mode 100644 index 00000000..b726931d --- /dev/null +++ b/location/location_interface.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2017 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 LOCATION_INTERFACE_H +#define LOCATION_INTERFACE_H + +#include + +struct GnssInterface { + size_t size; + void (*initialize)(void); + void (*deinitialize)(void); + void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); + void (*removeClient)(LocationAPI* client); + void (*requestCapabilities)(LocationAPI* client); + uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); + void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); + void (*stopTracking)(LocationAPI* client, uint32_t id); + void (*gnssNiResponse)(LocationAPI* client, uint32_t id, GnssNiResponse response); + void (*setControlCallbacks)(LocationControlCallbacks& controlCallbacks); + uint32_t (*enable)(LocationTechnologyType techType); + void (*disable)(uint32_t id); + uint32_t* (*gnssUpdateConfig)(GnssConfig config); + uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); + void (*injectLocation)(double latitude, double longitude, float accuracy); + void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); +}; + +struct FlpInterface { + size_t size; + void (*initialize)(void); + void (*deinitialize)(void); + void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); + void (*removeClient)(LocationAPI* client); + void (*requestCapabilities)(LocationAPI* client); + uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); + void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); + void (*stopTracking)(LocationAPI* client, uint32_t id); + uint32_t (*startBatching)(LocationAPI* client, LocationOptions&); + void (*stopBatching)(LocationAPI* client, uint32_t id); + void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, LocationOptions&); + void (*getBatchedLocations)(LocationAPI* client, uint32_t id, size_t count); + void (*getPowerStateChanges)(void* powerStateCb); +}; + +struct GeofenceInterface { + size_t size; + void (*initialize)(void); + void (*deinitialize)(void); + void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); + void (*removeClient)(LocationAPI* client); + void (*requestCapabilities)(LocationAPI* client); + uint32_t* (*addGeofences)(LocationAPI* client, size_t count, GeofenceOption*, GeofenceInfo*); + void (*removeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); + void (*modifyGeofences)(LocationAPI* client, size_t count, uint32_t* ids, + GeofenceOption* options); + void (*pauseGeofences)(LocationAPI* client, size_t count, uint32_t* ids); + void (*resumeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); +}; + +#endif /* LOCATION_INTERFACE_H */ diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 78a3fe00..21635115 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2013, 2015, 2017The 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 @@ -82,7 +82,6 @@ void MsgTask::prerun() { } 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) { diff --git a/utils/linked_list.c b/utils/linked_list.c index acec5b1f..33185d0b 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011, 2014, 2017 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 @@ -108,7 +108,6 @@ linked_list_err_type linked_list_destroy(void** list_data) ===========================================================================*/ 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__); @@ -160,7 +159,6 @@ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dea ===========================================================================*/ 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__); @@ -267,7 +265,6 @@ 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", diff --git a/utils/msg_q.c b/utils/msg_q.c index e412e781..10c4e485 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2012, 2014, 2017 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 @@ -241,8 +241,6 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) 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 ) From 52b413eb442e184a22d508f98af5e7f30e6952a5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 28 Feb 2017 16:45:59 -0800 Subject: [PATCH 445/945] hidl gnss hal 1.0 implementation Overwrites the default hidl gnss hal implementation to interface directly to LocationAPI CRs-fixed: 1112712 Change-Id: I3385911956c0c6c457202a8584b108046c587b36 --- android/AGnss.cpp | 66 ++ android/AGnss.h | 80 ++ android/Android.mk | 82 +- android/Gnss.cpp | 326 ++++++++ android/Gnss.h | 149 ++++ android/GnssAPIClient.cpp | 765 ------------------ android/GnssBatching.cpp | 129 +++ android/GnssBatching.h | 80 ++ android/GnssConfiguration.cpp | 148 ++++ android/GnssConfiguration.h | 71 ++ android/GnssGeofencing.cpp | 141 ++++ android/GnssGeofencing.h | 91 +++ android/GnssMeasurement.cpp | 99 +++ android/GnssMeasurement.h | 76 ++ android/GnssNi.cpp | 85 ++ android/GnssNi.h | 75 ++ .../android.hardware.gnss@1.0-service-qti.rc | 4 + android/loc.cpp | 380 --------- android/loc_geofence.cpp | 91 --- android/location_api/FlpAPIClient.cpp | 182 +++++ android/location_api/FlpAPIClient.h | 77 ++ .../{ => location_api}/GeofenceAPIClient.cpp | 159 ++-- .../{ => location_api}/GeofenceAPIClient.h | 28 +- android/location_api/GnssAPIClient.cpp | 406 ++++++++++ android/{ => location_api}/GnssAPIClient.h | 61 +- .../location_api/GnssMeasurementAPIClient.cpp | 278 +++++++ .../location_api/GnssMeasurementAPIClient.h | 81 ++ android/location_api/LocationUtil.cpp | 98 +++ .../{gps.c => location_api/LocationUtil.h} | 65 +- android/service.cpp | 31 + core/Android.mk | 1 + .../loc_pla/src/Android.mk | 6 +- 32 files changed, 2982 insertions(+), 1429 deletions(-) create mode 100644 android/AGnss.cpp create mode 100644 android/AGnss.h create mode 100644 android/Gnss.cpp create mode 100644 android/Gnss.h delete mode 100644 android/GnssAPIClient.cpp create mode 100644 android/GnssBatching.cpp create mode 100644 android/GnssBatching.h create mode 100644 android/GnssConfiguration.cpp create mode 100644 android/GnssConfiguration.h create mode 100644 android/GnssGeofencing.cpp create mode 100644 android/GnssGeofencing.h create mode 100644 android/GnssMeasurement.cpp create mode 100644 android/GnssMeasurement.h create mode 100644 android/GnssNi.cpp create mode 100644 android/GnssNi.h create mode 100644 android/android.hardware.gnss@1.0-service-qti.rc delete mode 100644 android/loc.cpp delete mode 100644 android/loc_geofence.cpp create mode 100644 android/location_api/FlpAPIClient.cpp create mode 100644 android/location_api/FlpAPIClient.h rename android/{ => location_api}/GeofenceAPIClient.cpp (56%) rename android/{ => location_api}/GeofenceAPIClient.h (78%) create mode 100644 android/location_api/GnssAPIClient.cpp rename android/{ => location_api}/GnssAPIClient.h (69%) create mode 100644 android/location_api/GnssMeasurementAPIClient.cpp create mode 100644 android/location_api/GnssMeasurementAPIClient.h create mode 100644 android/location_api/LocationUtil.cpp rename android/{gps.c => location_api/LocationUtil.h} (52%) create mode 100644 android/service.cpp diff --git a/android/AGnss.cpp b/android/AGnss.cpp new file mode 100644 index 00000000..3b40e604 --- /dev/null +++ b/android/AGnss.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_AGnssInterface" + +#include +#include "Gnss.h" +#include "AGnss.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { +} + +Return AGnss::setServer(IAGnssCallback::AGnssType type, + const hidl_string& hostname, + int32_t port) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + if (type == IAGnssCallback::AGnssType::TYPE_SUPL) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL; + } else if (type == IAGnssCallback::AGnssType::TYPE_C2K) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K; + } else { + LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast(type)); + return false; + } + config.assistanceServer.hostName = strdup(hostname.c_str()); + config.assistanceServer.port = port; + return mGnss->updateConfiguration(config); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/AGnss.h b/android/AGnss.h new file mode 100644 index 00000000..54775c16 --- /dev/null +++ b/android/AGnss.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H +#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IAGnss; +using ::android::hardware::gnss::V1_0::IAGnssCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct AGnss : public IAGnss { + AGnss(Gnss* gnss); + ~AGnss() = default; + /* + * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. + * These declarations were generated from IAGnss.hal. + */ + inline Return setCallback(const sp& /*callback*/) override { + return Void(); + } + + inline Return dataConnClosed() override { + return false; + } + + inline Return dataConnFailed() override { + return false; + } + + inline Return dataConnOpen(const hidl_string& /*apn*/, + IAGnss::ApnIpType /*apnIpType*/) override { + return false; + } + + Return setServer(IAGnssCallback::AGnssType type, + const hidl_string& hostname, int32_t port) override; + + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H diff --git a/android/Android.mk b/android/Android.mk index d36b4712..e359e88f 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,56 +1,76 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) - -LOCAL_MODULE := gps.$(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE) +LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti LOCAL_MODULE_OWNER := qti +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := \ + AGnss.cpp \ + Gnss.cpp \ + GnssBatching.cpp \ + GnssGeofencing.cpp \ + GnssMeasurement.cpp \ + GnssNi.cpp \ + GnssConfiguration.cpp \ -LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES += \ + location_api/LocationUtil.cpp \ + location_api/GnssAPIClient.cpp \ + location_api/GeofenceAPIClient.cpp \ + location_api/FlpAPIClient.cpp \ + location_api/GnssMeasurementAPIClient.cpp \ -## Libs +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libloc_pla \ + $(TARGET_OUT_HEADERS)/liblocation_api \ LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libutils \ + android.hardware.gnss@1.0 \ + +LOCAL_SHARED_LIBRARIES += \ libloc_core \ libgps.utils \ libdl \ libloc_pla \ liblocation_api \ -LOCAL_SRC_FILES += \ - gps.c \ - loc.cpp \ - loc_geofence.cpp \ - GnssAPIClient.cpp \ - GeofenceAPIClient.cpp \ +include $(BUILD_SHARED_LIBRARY) -LOCAL_CFLAGS += \ - -Wunused-parameter \ - -fno-short-enums \ - -D_ANDROID_ \ +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_MODULE_OWNER := qti +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc +LOCAL_SRC_FILES := \ + service.cpp \ -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:= \ + $(LOCAL_PATH)/location_api \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ $(TARGET_OUT_HEADERS)/libloc_pla \ $(TARGET_OUT_HEADERS)/liblocation_api \ -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_RELATIVE_PATH := hw -include $(BUILD_SHARED_LIBRARY) +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libcutils \ + libdl \ + libbase \ + libutils \ -endif # not BUILD_TINY_ANDROID +LOCAL_SHARED_LIBRARIES += \ + libhwbinder \ + libhidlbase \ + libhidltransport \ + android.hardware.gnss@1.0 \ + +include $(BUILD_EXECUTABLE) diff --git a/android/Gnss.cpp b/android/Gnss.cpp new file mode 100644 index 00000000..1412883a --- /dev/null +++ b/android/Gnss.cpp @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssInterface" + +#include +#include +#include "Gnss.h" +typedef void* (getLocationInterface)(); + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnss != nullptr) { + mGnss->stop(); + mGnss->cleanup(); + } +} + +Gnss::Gnss() { + ENTRY_LOG_CALLFLOW(); + // clear pending GnssConfig + memset(&mPendingConfig, 0, sizeof(GnssConfig)); + + mGnssDeathRecipient = new GnssDeathRecipient(this); +} + +Gnss::~Gnss() { + ENTRY_LOG_CALLFLOW(); + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +GnssAPIClient* Gnss::getApi() { + if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) { + mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); + if (mApi == nullptr) { + LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__); + return mApi; + } + + if (mPendingConfig.size == sizeof(GnssConfig)) { + // we have pending GnssConfig + mApi->gnssConfigurationUpdate(mPendingConfig); + // clear size to invalid mPendingConfig + mPendingConfig.size = 0; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + } + } + } + if (mApi == nullptr) { + LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__); + } + return mApi; +} + +GnssInterface* Gnss::getGnssInterface() { + static bool getGnssInterfaceFailed = false; + if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { + LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); + getLocationInterface* getter = NULL; + const char *error; + dlerror(); + void *handle = dlopen("libgnss.so", RTLD_NOW); + if (NULL == handle || (error = dlerror()) != NULL) { + LOC_LOGW("dlopen for libgnss.so failed, error = %s", error); + } else { + getter = (getLocationInterface*)dlsym(handle, "getGnssInterface"); + if ((error = dlerror()) != NULL) { + LOC_LOGW("dlsym for libgnss.so::getGnssInterface failed, error = %s", error); + getter = NULL; + } + } + + if (NULL == getter) { + getGnssInterfaceFailed = true; + } else { + mGnssInterface = (GnssInterface*)(*getter)(); + } + } + return mGnssInterface; +} + +Return Gnss::setCallback(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + } + mGnssCbIface = callback; + if (mGnssCbIface != nullptr) { + mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/); + } + + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + api->locAPIEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + } + return true; +} + +Return Gnss::setGnssNiCb(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + mGnssNiCbIface = callback; + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + } + return true; +} + +Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->locAPIGnssUpdateConfig(gnssConfig); + } else if (gnssConfig.flags != 0) { + // api is not ready yet, update mPendingConfig with gnssConfig + mPendingConfig.size = sizeof(GnssConfig); + + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + mPendingConfig.gpsLock = gnssConfig.gpsLock; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + mPendingConfig.suplVersion = gnssConfig.suplVersion; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + mPendingConfig.assistanceServer.hostName = + strdup(gnssConfig.assistanceServer.hostName); + } + mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + mPendingConfig.lppProfile = gnssConfig.lppProfile; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT; + mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT; + mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + mPendingConfig.suplModeMask = gnssConfig.suplModeMask; + } + } + return true; +} + +Return Gnss::start() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStart(); + } + return retVal; +} + +Return Gnss::stop() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStop(); + } + return retVal; +} + +Return Gnss::cleanup() { + ENTRY_LOG_CALLFLOW(); + + if (mApi != nullptr) { + mApi->locAPIDisable(); + } + + return Void(); +} + +Return Gnss::injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); + return true; + } else { + return false; + } +} + +Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, + int32_t uncertaintyMs) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); + return true; + } else { + return false; + } +} + +Return Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->gnssDeleteAidingData(aidingDataFlags); + } + return Void(); +} + +Return Gnss::setPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs); + } + return retVal; +} + +Return> Gnss::getExtensionAGnss() { + ENTRY_LOG_CALLFLOW(); + mAGnssIface = new AGnss(this); + return mAGnssIface; +} + +Return> Gnss::getExtensionGnssNi() { + ENTRY_LOG_CALLFLOW(); + mGnssNi = new GnssNi(this); + return mGnssNi; +} + +Return> Gnss::getExtensionGnssMeasurement() { + ENTRY_LOG_CALLFLOW(); + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} + +Return> Gnss::getExtensionGnssConfiguration() { + ENTRY_LOG_CALLFLOW(); + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} + +Return> Gnss::getExtensionGnssGeofencing() { + ENTRY_LOG_CALLFLOW(); + mGnssGeofencingIface = new GnssGeofencing(); + return mGnssGeofencingIface; +} + +Return> Gnss::getExtensionGnssBatching() { + mGnssBatching = new GnssBatching(); + return mGnssBatching; +} + +IGnss* HIDL_FETCH_IGnss(const char* hal) { + ENTRY_LOG_CALLFLOW(); + IGnss* iface = nullptr; + iface = new Gnss(); + if (iface == nullptr) { + LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal); + } + return iface; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/Gnss.h b/android/Gnss.h new file mode 100644 index 00000000..b338b08e --- /dev/null +++ b/android/Gnss.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss : public IGnss { + Gnss(); + ~Gnss(); + + // registerAsService will call interfaceChain to determine the version of service + /* comment this out until we know really how to manipulate hidl version + using interfaceChain_cb = std::function< + void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>; + virtual ::android::hardware::Return interfaceChain(interfaceChain_cb _hidl_cb) override { + _hidl_cb({ + "android.hardware.gnss@1.1::IGnss", + ::android::hidl::base::V1_0::IBase::descriptor, + }); + return ::android::hardware::Void(); + } + */ + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnss follow. + * These declarations were generated from Gnss.hal. + */ + Return setCallback(const sp& callback) override; + Return start() override; + Return stop() override; + Return cleanup() override; + Return injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) override; + Return injectTime(int64_t timeMs, + int64_t timeReferenceMs, + int32_t uncertaintyMs) override; + Return deleteAidingData(IGnss::GnssAidingData aidingDataFlags) override; + Return setPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) override; + Return> getExtensionAGnss() override; + Return> getExtensionGnssNi() override; + Return> getExtensionGnssMeasurement() override; + Return> getExtensionGnssConfiguration() override; + Return> getExtensionGnssGeofencing() override; + Return> getExtensionGnssBatching() override; + + inline Return> getExtensionAGnssRil() override { + return nullptr; + } + + inline Return> getExtensionGnssNavigationMessage() override { + return nullptr; + } + + inline Return> getExtensionXtra() override { + return nullptr; + } + + inline Return> getExtensionGnssDebug() override { + return nullptr; + } + + // These methods are not part of the IGnss base class. + GnssAPIClient* getApi(); + Return setGnssNiCb(const sp& niCb); + Return updateConfiguration(GnssConfig& gnssConfig); + GnssInterface* getGnssInterface(); + + private: + struct GnssDeathRecipient : hidl_death_recipient { + GnssDeathRecipient(sp gnss) : mGnss(gnss) { + } + ~GnssDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnss; + }; + + private: + sp mGnssDeathRecipient = nullptr; + + sp mAGnssIface = nullptr; + sp mGnssNi = nullptr; + sp mGnssMeasurement = nullptr; + sp mGnssConfig = nullptr; + sp mGnssGeofencingIface = nullptr; + sp mGnssBatching = nullptr; + + GnssAPIClient* mApi = nullptr; + sp mGnssCbIface = nullptr; + sp mGnssNiCbIface = nullptr; + GnssConfig mPendingConfig; + GnssInterface* mGnssInterface = nullptr; +}; + +extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H diff --git a/android/GnssAPIClient.cpp b/android/GnssAPIClient.cpp deleted file mode 100644 index 915a82e7..00000000 --- a/android/GnssAPIClient.cpp +++ /dev/null @@ -1,765 +0,0 @@ -/* Copyright (c) 2017, 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_GnssAPIClient" - -#include -#include - -#include "GnssAPIClient.h" - -static void convertGpsLocation(Location& in, GpsLocation& out); -static void convertGpsSvStatus(GnssSvNotification& in, GpsSvStatus& out); -static void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out); -static void convertGnssSvStatus(GnssSvNotification& in, GnssSvStatus& out); -static void convertGpsMeasurement(GnssMeasurementsData& in, GpsMeasurement& out); -static void convertGpsClock(GnssMeasurementsClock& in, GpsClock& out); -static void convertGpsData(GnssMeasurementsNotification& in, GpsData& out); -static void convertGnssClock(GnssMeasurementsClock& in, GnssClock& out); -static void convertGnssData(GnssMeasurementsNotification& in, GnssData& out); - -GnssAPIClient::GnssAPIClient(GpsCallbacks* gpsCb, - GpsNiCallbacks* niCb, - GpsMeasurementCallbacks* measurementCb) : - LocationAPIClientBase(), - mGpsCallbacks(nullptr), - mGpsNiCallbacks(nullptr), - mLocationCapabilitiesMask(0), - mGpsMeasurementCallbacks(nullptr) -{ - LOC_LOGD("%s]: (%p %p %p)", __func__, gpsCb, niCb, measurementCb); - pthread_mutex_init(&mLock, nullptr); - - // set default LocationOptions. - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = 1000; - mLocationOptions.minDistance = 0; - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; - - gnssUpdateCallbacks(gpsCb, niCb, measurementCb); -} - -GnssAPIClient::~GnssAPIClient() -{ - LOC_LOGD("%s]: ()", __func__); - pthread_mutex_destroy(&mLock); -} - -// for GpsInterface -void GnssAPIClient::gnssUpdateCallbacks(GpsCallbacks* gpsCb, - GpsNiCallbacks* niCb, - GpsMeasurementCallbacks* measurementCb) -{ - LOC_LOGD("%s]: (%p %p %p)", __func__, gpsCb, niCb, measurementCb); - - mGpsCallbacks = gpsCb; - mGpsNiCallbacks = niCb; - mGpsMeasurementCallbacks = measurementCb; - - LocationCallbacks locationCallbacks; - locationCallbacks.size = sizeof(LocationCallbacks); - - locationCallbacks.trackingCb = nullptr; - if (mGpsCallbacks && mGpsCallbacks->location_cb) { - locationCallbacks.trackingCb = [this](Location location) { - onTrackingCb(location); - }; - } - - locationCallbacks.batchingCb = nullptr; - locationCallbacks.geofenceBreachCb = nullptr; - locationCallbacks.geofenceStatusCb = nullptr; - locationCallbacks.gnssLocationInfoCb = nullptr; - - locationCallbacks.gnssNiCb = nullptr; - if (mGpsNiCallbacks && mGpsNiCallbacks->notify_cb) { - locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { - onGnssNiCb(id, gnssNiNotification); - }; - } - - locationCallbacks.gnssSvCb = nullptr; - if (mGpsCallbacks && mGpsCallbacks->sv_status_cb) { - locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { - onGnssSvCb(gnssSvNotification); - }; - } - - locationCallbacks.gnssNmeaCb = nullptr; - if (mGpsCallbacks && mGpsCallbacks->nmea_cb) { - locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { - onGnssNmeaCb(gnssNmeaNotification); - }; - } - - locationCallbacks.gnssMeasurementsCb = nullptr; - if (mGpsMeasurementCallbacks && - (mGpsMeasurementCallbacks->measurement_callback || - mGpsMeasurementCallbacks->gnss_measurement_callback)) { - locationCallbacks.gnssMeasurementsCb = - [this](GnssMeasurementsNotification gnssMeasurementsNotification) { - onGnssMeasurementsCb(gnssMeasurementsNotification); - }; - } - - locAPISetCallbacks(locationCallbacks); -} - -int GnssAPIClient::gnssStart() -{ - LOC_LOGD("%s]: ()", __func__); - int retVal = 0; - locAPIStartTracking(mLocationOptions); - return retVal; -} - -int GnssAPIClient::gnssStop() -{ - LOC_LOGD("%s]: ()", __func__); - int retVal = 0; - locAPIStopTracking(); - return retVal; -} - -void GnssAPIClient::gnssDeleteAidingData(GpsAidingData f) -{ - LOC_LOGD("%s]: (%02x)", __func__, f); - GnssAidingData data; - memset(&data, 0, sizeof (GnssAidingData)); - data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS | - GNSS_AIDING_DATA_SV_TYPE_GLONASS | - GNSS_AIDING_DATA_SV_TYPE_QZSS | - GNSS_AIDING_DATA_SV_TYPE_BEIDOU | - GNSS_AIDING_DATA_SV_TYPE_GALILEO; - - if (f == GPS_DELETE_ALL) - data.deleteAll = true; - else { - if (f & GPS_DELETE_EPHEMERIS) data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS; - if (f & GPS_DELETE_ALMANAC) data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC; - if (f & GPS_DELETE_POSITION) data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION; - if (f & GPS_DELETE_TIME) data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME; - if (f & GPS_DELETE_IONO) data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE; - if (f & GPS_DELETE_UTC) data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC; - if (f & GPS_DELETE_HEALTH) data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH; - if (f & GPS_DELETE_SVDIR) data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION; - if (f & GPS_DELETE_SVSTEER) data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER; - if (f & GPS_DELETE_SADATA) data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA; - if (f & GPS_DELETE_RTI) data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI; - if (f & GPS_DELETE_CELLDB_INFO) data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB; - } - locAPIGnssDeleteAidingData(data); -} - -int GnssAPIClient::gnssSetPositionMode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time) -{ - LOC_LOGD("%s]: (%d %d %d %d %d)", __func__, - mode, recurrence, min_interval, preferred_accuracy, preferred_time); - int retVal = 0; - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = min_interval; - mLocationOptions.minDistance = preferred_accuracy; - if (mode == GPS_POSITION_MODE_STANDALONE) - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; - else if (mode == GPS_POSITION_MODE_MS_BASED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSB; - else if (mode == GPS_POSITION_MODE_MS_ASSISTED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSA; - return retVal; -} - -// for AGpsInterface -void GnssAPIClient::gnssAgnssSetServer(AGpsType type, const char *hostname, int port) -{ - LOC_LOGD("%s]: (%d %s %d)", __func__, type, hostname, port); - GnssConfig data; - memset(&data, 0, sizeof(GnssConfig)); - data.size = sizeof(GnssConfig); - data.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; - - memset(&data.assistanceServer, 0, sizeof(GnssConfigSetAssistanceServer)); - data.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); - if (type == AGPS_TYPE_SUPL) - data.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL; - else if (type == AGPS_TYPE_C2K) - data.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K; - data.assistanceServer.hostName = hostname; - data.assistanceServer.port = port; - - locAPIGnssUpdateConfig(data); -} - -// for GpsNiInterface -void GnssAPIClient::gnssNiRespond(int notif_id, GpsUserResponseType user_response) -{ - LOC_LOGD("%s]: (%d %d)", __func__, notif_id, user_response); - GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; - if (user_response == GPS_NI_RESPONSE_ACCEPT) data = GNSS_NI_RESPONSE_ACCEPT; - else if (user_response == GPS_NI_RESPONSE_DENY) data = GNSS_NI_RESPONSE_DENY; - else if (user_response == GPS_NI_RESPONSE_NORESP) data = GNSS_NI_RESPONSE_NO_RESPONSE; - locAPIGnssNiResponse(notif_id, data); -} - -// for GpsMeasurementInterface -void GnssAPIClient::gnssMeasurementClose() { - LOC_LOGD("%s]: ()", __func__); - pthread_mutex_lock(&mLock); - mGpsMeasurementCallbacks = nullptr; - pthread_mutex_unlock(&mLock); -} - -// for GnssConfigurationInterface -void GnssAPIClient::gnssConfigurationUpdate(const char* config_data, int32_t length) -{ - LOC_LOGD("%s]: (%s %d)", __func__, config_data, length); - int n = 10; - uint8_t flags[n]; - memset(&flags, 0, sizeof(uint8_t) * n); - - GnssConfig data; - memset(&data, 0, sizeof(GnssConfig)); - data.size = sizeof(GnssConfig); - - const loc_param_s_type gnssConfTable[] = - { - {"GPS_LOCK", &data.gpsLock, flags+0, 'n'}, - {"SUPL_VER", &data.suplVersion, flags+1, 'n'}, - //{"ASSISTANCE_SERVER", &data.assistanceServer, nullptr, 's'}, - {"LPP_PROFILE", &data.lppProfile, flags+3, 'n'}, - {"LPPE_CP_TECHNOLOGY", &data.lppeControlPlaneMask, flags+4, 'n'}, - {"LPPE_UP_TECHNOLOGY", &data.lppeUserPlaneMask, flags+5, 'n'}, - {"A_GLONASS_POS_PROTOCOL_SELECT", &data.aGlonassPositionProtocolMask, flags+6, 'n'}, - {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL",&data.emergencyPdnForEmergencySupl, flags+7, 'n'}, - {"SUPL_ES", &data.suplEmergencyServices, flags+8, 'n'}, - {"SUPL_MODE", &data.suplModeMask, flags+9, 'n'}, - }; - UTIL_UPDATE_CONF(config_data, length, gnssConfTable); - - for (int i = 0; i < n; i++) { - if (flags[i] != 0) - data.flags |= (0x1 << i); - } - locAPIGnssUpdateConfig(data); -} - -// callbacks -void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) -{ - LOC_LOGD("%s]: (%02x)", __func__, capabilitiesMask); - mLocationCapabilitiesMask = capabilitiesMask; - if (mGpsCallbacks && mGpsCallbacks->set_capabilities_cb) { - uint32_t data = 0; - if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || - (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || - (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) || - (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) - data |= GPS_CAPABILITY_SCHEDULING; - if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) - data |= GPS_CAPABILITY_GEOFENCING; - if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) - data |= GPS_CAPABILITY_MEASUREMENTS; - if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) - data |= GPS_CAPABILITY_MSB; - if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) - data |= GPS_CAPABILITY_MSA; - mGpsCallbacks->set_capabilities_cb(data); - } - if (mGpsCallbacks && mGpsCallbacks->set_system_info_cb) { - GnssSystemInfo info; - info.size = sizeof(GnssSystemInfo); - info.year_of_hw = 2015; - if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { - info.year_of_hw = 2017; - } - LOC_LOGV("%s:%d] set_system_info_cb (%d)", __func__, __LINE__, info.year_of_hw); - mGpsCallbacks->set_system_info_cb(&info); - } -} - -void GnssAPIClient::onTrackingCb(Location location) -{ - LOC_LOGD("%s]: (flags: %02x)", __func__, location.flags); - if (mGpsCallbacks && mGpsCallbacks->location_cb) { - GpsLocation data; - convertGpsLocation(location, data); - mGpsCallbacks->location_cb(&data); - } -} - -void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) -{ - LOC_LOGD("%s]: (id: %d)", __func__, id); - if (mGpsNiCallbacks && mGpsNiCallbacks->notify_cb) { - GpsNiNotification data; - memset(&data, 0, sizeof(GpsNiNotification)); - data.size = sizeof(GpsNiNotification); - data.notification_id = id; - - if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE) - data.ni_type = GPS_NI_TYPE_VOICE; - else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL) - data.ni_type = GPS_NI_TYPE_UMTS_SUPL; - else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) - data.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; - // GNSS_NI_TYPE_EMERGENCY_SUPL not supported - - if (gnssNiNotification.options == GNSS_NI_OPTIONS_NOTIFICATION) - data.notify_flags = GPS_NI_NEED_NOTIFY; - else if (gnssNiNotification.options == GNSS_NI_OPTIONS_VERIFICATION) - data.notify_flags = GPS_NI_NEED_VERIFY; - else if (gnssNiNotification.options == GNSS_NI_OPTIONS_PRIVACY_OVERRIDE) - data.notify_flags = GPS_NI_PRIVACY_OVERRIDE; - - data.timeout = gnssNiNotification.timeout; - if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT) - data.default_response = GPS_NI_RESPONSE_ACCEPT; - else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY) - data.default_response = GPS_NI_RESPONSE_DENY; - else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE || - gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE) - data.default_response = GPS_NI_RESPONSE_NORESP; - - int len = GPS_NI_SHORT_STRING_MAXLEN < GNSS_NI_REQUESTOR_MAX - ? GPS_NI_SHORT_STRING_MAXLEN : GNSS_NI_REQUESTOR_MAX; - memcpy(data.requestor_id, gnssNiNotification.requestor, len); - - len = GPS_NI_LONG_STRING_MAXLEN < GNSS_NI_MESSAGE_ID_MAX - ? GPS_NI_LONG_STRING_MAXLEN : GNSS_NI_MESSAGE_ID_MAX; - memcpy(data.text, gnssNiNotification.message, len); - - if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE) - data.requestor_id_encoding = GPS_ENC_NONE; - else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) - data.requestor_id_encoding = GPS_ENC_SUPL_GSM_DEFAULT; - else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8) - data.requestor_id_encoding = GPS_ENC_SUPL_UTF8; - else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2) - data.requestor_id_encoding = GPS_ENC_SUPL_UCS2; - - if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE) - data.text_encoding = GPS_ENC_NONE; - else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) - data.text_encoding = GPS_ENC_SUPL_GSM_DEFAULT; - else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8) - data.text_encoding = GPS_ENC_SUPL_UTF8; - else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2) - data.text_encoding = GPS_ENC_SUPL_UCS2; - data.text_encoding = gnssNiNotification.messageEncoding; - - memcpy(data.extras, gnssNiNotification.extras, len); - - mGpsNiCallbacks->notify_cb(&data); - } -} - -void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) -{ - LOC_LOGD("%s]: (count: %zu)", __func__, gnssSvNotification.count); - if (mGpsCallbacks && mGpsCallbacks->sv_status_cb) { - GpsSvStatus data; - convertGpsSvStatus(gnssSvNotification, data); - mGpsCallbacks->sv_status_cb(&data); - } - if (mGpsCallbacks && mGpsCallbacks->gnss_sv_status_cb) { - GnssSvStatus data; - convertGnssSvStatus(gnssSvNotification, data); - mGpsCallbacks->gnss_sv_status_cb(&data); - } -} - -void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) -{ - if (mGpsCallbacks && mGpsCallbacks->nmea_cb) { - mGpsCallbacks->nmea_cb((GpsUtcTime)gnssNmeaNotification.timestamp, - gnssNmeaNotification.nmea, gnssNmeaNotification.length); - } -} - -void GnssAPIClient::onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) -{ - LOC_LOGD("%s]: (count: %zu)", __func__, gnssMeasurementsNotification.count); - // we don't need to lock the mutext - // if mGpsMeasurementCallbacks is set to nullptr - if (mGpsMeasurementCallbacks) { - pthread_mutex_lock(&mLock); - if (mGpsMeasurementCallbacks) { - if (mGpsMeasurementCallbacks->measurement_callback) { - GpsData data; - convertGpsData(gnssMeasurementsNotification, data); - mGpsMeasurementCallbacks->measurement_callback(&data); - } - if (mGpsMeasurementCallbacks->gnss_measurement_callback) { - GnssData data; - convertGnssData(gnssMeasurementsNotification, data); - mGpsMeasurementCallbacks->gnss_measurement_callback(&data); - } - } - pthread_mutex_unlock(&mLock); - } -} - -void GnssAPIClient::onStartTrackingCb(LocationError error) -{ - LOC_LOGD("%s]: (%d)", __func__, error); - if (error == LOCATION_ERROR_SUCCESS && mGpsCallbacks && mGpsCallbacks->status_cb) { - GpsStatus data; - data.size = sizeof(GpsStatus); - data.status = GPS_STATUS_ENGINE_ON; - mGpsCallbacks->status_cb(&data); - data.status = GPS_STATUS_SESSION_BEGIN; - mGpsCallbacks->status_cb(&data); - } -} - -void GnssAPIClient::onStopTrackingCb(LocationError error) -{ - LOC_LOGD("%s]: (%d)", __func__, error); - if (error == LOCATION_ERROR_SUCCESS && mGpsCallbacks && mGpsCallbacks->status_cb) { - GpsStatus data; - data.size = sizeof(GpsStatus); - data.status = GPS_STATUS_SESSION_END; - mGpsCallbacks->status_cb(&data); - data.status = GPS_STATUS_ENGINE_OFF; - mGpsCallbacks->status_cb(&data); - } -} - -static void convertGpsLocation(Location& in, GpsLocation& out) -{ - memset(&out, 0, sizeof(GpsLocation)); - out.size = sizeof(GpsLocation); - if (in.flags & LOCATION_HAS_LAT_LONG_BIT) - out.flags |= GPS_LOCATION_HAS_LAT_LONG; - if (in.flags & LOCATION_HAS_ALTITUDE_BIT) - out.flags |= GPS_LOCATION_HAS_ALTITUDE; - if (in.flags & LOCATION_HAS_SPEED_BIT) - out.flags |= GPS_LOCATION_HAS_SPEED; - if (in.flags & LOCATION_HAS_BEARING_BIT) - out.flags |= GPS_LOCATION_HAS_BEARING; - if (in.flags & LOCATION_HAS_ACCURACY_BIT) - out.flags |= GPS_LOCATION_HAS_ACCURACY; - out.latitude = in.latitude; - out.longitude = in.longitude; - out.altitude = in.altitude; - out.speed = in.speed; - out.bearing = in.bearing; - out.accuracy = in.accuracy; - out.timestamp = (GpsUtcTime)in.timestamp; -} - -static void convertGpsSvStatus(GnssSvNotification& in, GpsSvStatus& out) -{ - memset(&out, 0, sizeof(GpsSvStatus)); - out.size = sizeof(GpsSvStatus); - out.num_svs = in.count; - int len = GPS_MAX_SVS < GNSS_SV_MAX ? GPS_MAX_SVS : GNSS_SV_MAX; - for (int i = 0; i < len; i++) { - GpsSvInfo& info = out.sv_list[i]; - info.size = sizeof(GpsSvInfo); - info.prn = in.gnssSvs[i].svId; - info.snr = in.gnssSvs[i].cN0Dbhz; - info.elevation = in.gnssSvs[i].elevation; - info.azimuth = in.gnssSvs[i].azimuth; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) - out.ephemeris_mask |= 0x1 < i; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) - out.almanac_mask |= 0x1 < i; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) - out.used_in_fix_mask |= 0x1 < i; - } -} - -static void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) -{ - switch(in) { - case GNSS_SV_TYPE_GPS: - out = GNSS_CONSTELLATION_GPS; - break; - case GNSS_SV_TYPE_SBAS: - out = GNSS_CONSTELLATION_SBAS; - break; - case GNSS_SV_TYPE_GLONASS: - out = GNSS_CONSTELLATION_GLONASS; - break; - case GNSS_SV_TYPE_QZSS: - out = GNSS_CONSTELLATION_QZSS; - break; - case GNSS_SV_TYPE_BEIDOU: - out = GNSS_CONSTELLATION_BEIDOU; - break; - case GNSS_SV_TYPE_GALILEO: - out = GNSS_CONSTELLATION_GALILEO; - break; - default: - out = GNSS_CONSTELLATION_UNKNOWN; - break; - } -} - -static void convertGnssSvStatus(GnssSvNotification& in, GnssSvStatus& out) -{ - memset(&out, 0, sizeof(GnssSvStatus)); - out.size = sizeof(GnssSvStatus); - out.num_svs = in.count; - int len = GNSS_MAX_SVS < GNSS_SV_MAX ? GNSS_MAX_SVS : GNSS_SV_MAX; - for (int i = 0; i < len; i++) { - GnssSvInfo& info = out.gnss_sv_list[i]; - info.size = sizeof(GnssSvInfo); - info.svid = in.gnssSvs[i].svId; - convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); - info.c_n0_dbhz = in.gnssSvs[i].cN0Dbhz; - info.elevation = in.gnssSvs[i].elevation; - info.azimuth = in.gnssSvs[i].azimuth; - info.flags = GNSS_SV_FLAGS_NONE; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) - info.flags |= GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) - info.flags |= GNSS_SV_FLAGS_HAS_ALMANAC_DATA; - if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) - info.flags |= GNSS_SV_FLAGS_USED_IN_FIX; - } -} - -static void convertGpsMeasurement(GnssMeasurementsData& in, GpsMeasurement& out) -{ - memset(&out, 0, sizeof(GpsMeasurement)); - out.size = sizeof(GpsMeasurement); - if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) - out.flags |= GPS_MEASUREMENT_HAS_SNR; - if (in.flags & GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_BIT) - out.flags |= GPS_MEASUREMENT_HAS_PSEUDORANGE; - if (in.flags & GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_UNCERTAINTY_BIT) - out.flags |= GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) - out.flags |= GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) - out.flags |= GPS_MEASUREMENT_HAS_CARRIER_CYCLES; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) - out.flags |= GPS_MEASUREMENT_HAS_CARRIER_PHASE; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) - out.flags |= GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY; - out.prn = in.svId; - out.time_offset_ns = in.timeOffsetNs; - out.state = GNSS_MEASUREMENT_STATE_UNKNOWN; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) - out.state |= GPS_MEASUREMENT_STATE_CODE_LOCK; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) - out.state |= GPS_MEASUREMENT_STATE_BIT_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) - out.state |= GPS_MEASUREMENT_STATE_SUBFRAME_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) - out.state |= GPS_MEASUREMENT_STATE_TOW_DECODED; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) - out.state |= GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS; - out.received_gps_tow_ns = in.receivedSvTimeNs; - out.received_gps_tow_uncertainty_ns = in.receivedSvTimeUncertaintyNs; - out.c_n0_dbhz = in.carrierToNoiseDbHz; - out.pseudorange_rate_mps = in.pseudorangeRateMps; - out.pseudorange_rate_uncertainty_mps = in.pseudorangeRateUncertaintyMps; - out.accumulated_delta_range_state = GNSS_ADR_STATE_UNKNOWN; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) - out.accumulated_delta_range_state |= GPS_ADR_STATE_VALID; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) - out.accumulated_delta_range_state |= GPS_ADR_STATE_RESET; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) - out.accumulated_delta_range_state |= GPS_ADR_STATE_CYCLE_SLIP; - out.accumulated_delta_range_m = in.adrMeters; - out.accumulated_delta_range_uncertainty_m = in.adrUncertaintyMeters; - out.carrier_frequency_hz = in.carrierFrequencyHz; - out.carrier_cycles = in.carrierCycles; - out.carrier_phase = in.carrierPhase; - out.carrier_phase_uncertainty = in.carrierPhaseUncertainty; - out.loss_of_lock = GPS_LOSS_OF_LOCK_UNKNOWN; - out.multipath_indicator = GPS_MULTIPATH_INDICATOR_UNKNOWN; - if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) - out.multipath_indicator |= GPS_MULTIPATH_INDICATOR_DETECTED; - if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) - out.multipath_indicator |= GPS_MULTIPATH_INDICATOR_NOT_USED; - out.snr_db = in.signalToNoiseRatioDb; -} - -static void convertGpsClock(GnssMeasurementsClock& in, GpsClock& out) -{ - memset(&out, 0, sizeof(GpsClock)); - out.size = sizeof(GpsClock); - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) - out.flags |= GPS_CLOCK_HAS_LEAP_SECOND; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) - out.flags |= GPS_CLOCK_HAS_TIME_UNCERTAINTY; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) - out.flags |= GPS_CLOCK_HAS_FULL_BIAS; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) - out.flags |= GPS_CLOCK_HAS_BIAS; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) - out.flags |= GPS_CLOCK_HAS_BIAS_UNCERTAINTY; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) - out.flags |= GPS_CLOCK_HAS_DRIFT; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) - out.flags |= GPS_CLOCK_HAS_DRIFT_UNCERTAINTY; - out.leap_second = in.leapSecond; - out.type = GPS_CLOCK_TYPE_UNKNOWN; - out.time_ns = in.timeNs; - out.time_uncertainty_ns = in.timeUncertaintyNs; - out.full_bias_ns = in.fullBiasNs; - out.bias_ns = in.biasNs; - out.bias_uncertainty_ns = in.biasUncertaintyNs; - out.drift_nsps = in.driftNsps; - out.drift_uncertainty_nsps = in.driftUncertaintyNsps; -} - -static void convertGpsData(GnssMeasurementsNotification& in, GpsData& out) -{ - memset(&out, 0, sizeof(GpsData)); - out.size = sizeof(GpsData); - out.measurement_count = in.count; - int len = GPS_MAX_MEASUREMENT < GNSS_MEASUREMENTS_MAX - ? GPS_MAX_MEASUREMENT : GNSS_MEASUREMENTS_MAX; - for (int i = 0; i < len; i++) { - convertGpsMeasurement(in.measurements[i], out.measurements[i]); - } - convertGpsClock(in.clock, out.clock); -} - -static void convertGnssMeasurement(GnssMeasurementsData& in, GnssMeasurement& out) -{ - memset(&out, 0, sizeof(GnssMeasurement)); - out.size = sizeof(GnssMeasurement); - if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) - out.flags |= GNSS_MEASUREMENT_HAS_SNR; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) - out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) - out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_CYCLES; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) - out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_PHASE; - if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) - out.flags |= GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY; - out.svid = in.svId; - convertGnssConstellationType(in.svType, out.constellation); - out.time_offset_ns = in.timeOffsetNs; - out.state = GNSS_MEASUREMENT_STATE_UNKNOWN; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) - out.state |= GNSS_MEASUREMENT_STATE_CODE_LOCK; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_BIT_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) - out.state |= GNSS_MEASUREMENT_STATE_TOW_DECODED; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) - out.state |= GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_SYMBOL_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) - out.state |= GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) - out.state |= GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) - out.state |= GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC; - if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) - out.state |= GNSS_MEASUREMENT_STATE_SBAS_SYNC; - out.received_sv_time_in_ns = in.receivedSvTimeNs; - out.received_sv_time_uncertainty_in_ns = in.receivedSvTimeUncertaintyNs; - out.c_n0_dbhz = in.carrierToNoiseDbHz; - out.pseudorange_rate_mps = in.pseudorangeRateMps; - out.pseudorange_rate_uncertainty_mps = in.pseudorangeRateUncertaintyMps; - out.accumulated_delta_range_state = GNSS_ADR_STATE_UNKNOWN; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) - out.accumulated_delta_range_state |= GNSS_ADR_STATE_VALID; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) - out.accumulated_delta_range_state |= GNSS_ADR_STATE_RESET; - if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) - out.accumulated_delta_range_state |= GNSS_ADR_STATE_CYCLE_SLIP; - out.accumulated_delta_range_m = in.adrMeters; - out.accumulated_delta_range_uncertainty_m = in.adrUncertaintyMeters; - out.carrier_frequency_hz = in.carrierFrequencyHz; - out.carrier_cycles = in.carrierCycles; - out.carrier_phase = in.carrierPhase; - out.carrier_phase_uncertainty = in.carrierPhaseUncertainty; - out.multipath_indicator = GNSS_MULTIPATH_INDICATOR_UNKNOWN; - if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) - out.multipath_indicator |= GNSS_MULTIPATH_INDICATOR_PRESENT; - if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) - out.multipath_indicator |= GNSS_MULTIPATH_INDICATOR_NOT_PRESENT; - out.snr_db = in.signalToNoiseRatioDb; -} - -static void convertGnssClock(GnssMeasurementsClock& in, GnssClock& out) -{ - memset(&out, 0, sizeof(GnssClock)); - out.size = sizeof(GnssClock); - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) - out.flags |= GNSS_CLOCK_HAS_LEAP_SECOND; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) - out.flags |= GNSS_CLOCK_HAS_TIME_UNCERTAINTY; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) - out.flags |= GNSS_CLOCK_HAS_FULL_BIAS; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) - out.flags |= GNSS_CLOCK_HAS_BIAS; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) - out.flags |= GNSS_CLOCK_HAS_BIAS_UNCERTAINTY; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) - out.flags |= GNSS_CLOCK_HAS_DRIFT; - if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) - out.flags |= GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY; - out.leap_second = in.leapSecond; - out.time_ns = in.timeNs; - out.time_uncertainty_ns = in.timeUncertaintyNs; - out.full_bias_ns = in.fullBiasNs; - out.bias_ns = in.biasNs; - out.bias_uncertainty_ns = in.biasUncertaintyNs; - out.drift_nsps = in.driftNsps; - out.drift_uncertainty_nsps = in.driftUncertaintyNsps; - out.hw_clock_discontinuity_count = in.hwClockDiscontinuityCount; -} - -static void convertGnssData(GnssMeasurementsNotification& in, GnssData& out) -{ - memset(&out, 0, sizeof(GnssData)); - out.size = sizeof(GnssData); - out.measurement_count = in.count; - int len = GNSS_MAX_MEASUREMENT < GNSS_MEASUREMENTS_MAX - ? GNSS_MAX_MEASUREMENT : GNSS_MEASUREMENTS_MAX; - for (int i = 0; i < len; i++) { - convertGnssMeasurement(in.measurements[i], out.measurements[i]); - } - convertGnssClock(in.clock, out.clock); -} diff --git a/android/GnssBatching.cpp b/android/GnssBatching.cpp new file mode 100644 index 00000000..5eff8199 --- /dev/null +++ b/android/GnssBatching.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssBatchingInterface" + +#include +#include +#include "GnssBatching.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssBatching::GnssBatchingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssBatching != nullptr) { + mGnssBatching->stop(); + mGnssBatching->cleanup(); + } +} + +GnssBatching::GnssBatching() : mApi(nullptr) { + mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this); +} + +GnssBatching::~GnssBatching() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + + +// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. +Return GnssBatching::init(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__); + return false; + } + + mApi = new FlpAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + return false; + } + + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + mGnssBatchingCbIface = callback; + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/); + } + + return true; +} + +Return GnssBatching::getBatchSize() { + uint16_t ret = 0; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->flpGetBatchSize(); + } + return ret; +} + +Return GnssBatching::start(const IGnssBatching::Options& options) { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->flpStartSession(options); + } + return ret; +} + +Return GnssBatching::flush() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->flpFlushBatchedLocations(); + } + return Void(); +} + +Return GnssBatching::stop() { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->flpStopSession(); + } + return ret; +} + +Return GnssBatching::cleanup() { + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssBatching.h b/android/GnssBatching.h new file mode 100644 index 00000000..b46fae8e --- /dev/null +++ b/android/GnssBatching.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H + +#include +#include + + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hidl::base::V1_0::IBase; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +class FlpAPIClient; +struct GnssBatching : public IGnssBatching { + GnssBatching(); + ~GnssBatching(); + + // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. + Return init(const sp& callback) override; + Return getBatchSize() override; + Return start(const IGnssBatching::Options& options ) override; + Return flush() override; + Return stop() override; + Return cleanup() override; + + private: + struct GnssBatchingDeathRecipient : hidl_death_recipient { + GnssBatchingDeathRecipient(sp gnssBatching) : + mGnssBatching(gnssBatching) { + } + ~GnssBatchingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssBatching; + }; + + private: + sp mGnssBatchingDeathRecipient = nullptr; + sp mGnssBatchingCbIface = nullptr; + FlpAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp new file mode 100644 index 00000000..591a01a5 --- /dev/null +++ b/android/GnssConfiguration.cpp @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssConfigurationInterface" + +#include +#include "Gnss.h" +#include "GnssConfiguration.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { +} + +// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow. +Return GnssConfiguration::setSuplEs(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + config.suplEmergencyServices = static_cast(enabled); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplVersion(uint32_t version) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + config.suplVersion = static_cast(version); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplMode(uint8_t mode) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + config.suplModeMask = static_cast(mode); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setLppProfile(uint8_t lppProfile) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + config.lppProfile = static_cast(lppProfile); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + config.aGlonassPositionProtocolMask = + static_cast(protocol); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGpsLock(uint8_t lock) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + config.gpsLock = static_cast(lock); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + config.emergencyPdnForEmergencySupl = + static_cast(enabled); + + return mGnss->updateConfiguration(config); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssConfiguration.h b/android/GnssConfiguration.h new file mode 100644 index 00000000..f9ea4235 --- /dev/null +++ b/android/GnssConfiguration.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ + + /* Copyright (C) 2016 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. + */ + + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssConfiguration; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* + * Interface for passing GNSS configuration info from platform to HAL. + */ +struct Gnss; +struct GnssConfiguration : public IGnssConfiguration { + GnssConfiguration(Gnss* gnss); + ~GnssConfiguration() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. + * These declarations were generated from IGnssConfiguration.hal. + */ + Return setSuplVersion(uint32_t version) override; + Return setSuplMode(uint8_t mode) override; + Return setSuplEs(bool enabled) override; + Return setLppProfile(uint8_t lppProfile) override; + Return setGlonassPositioningProtocol(uint8_t protocol) override; + Return setEmergencySuplPdn(bool enable) override; + Return setGpsLock(uint8_t lock) override; + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H diff --git a/android/GnssGeofencing.cpp b/android/GnssGeofencing.cpp new file mode 100644 index 00000000..035a092f --- /dev/null +++ b/android/GnssGeofencing.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "GnssHal_GnssGeofencing" + +#include +#include +#include "GnssGeofencing.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssGeofencing != nullptr) { + mGnssGeofencing->removeAllGeofences(); + } +} + +GnssGeofencing::GnssGeofencing() : mApi(nullptr) { + mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this); +} + +GnssGeofencing::~GnssGeofencing() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. +Return GnssGeofencing::setCallback(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__); + return Void(); + } + + mApi = new GeofenceAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + } + + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient); + } + mGnssGeofencingCbIface = callback; + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssGeofencing::addGeofence( + int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceAdd( + geofenceId, + latitudeDegrees, + longitudeDegrees, + radiusMeters, + static_cast(lastTransition), + monitorTransitions, + notificationResponsivenessMs, + unknownTimerMs); + } + return Void(); +} + +Return GnssGeofencing::pauseGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofencePause(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceResume(geofenceId, monitorTransitions); + } + return Void(); +} + +Return GnssGeofencing::removeGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceRemove(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::removeAllGeofences() { + if (mApi == nullptr) { + LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__); + } else { + mApi->geofenceRemoveAll(); + } + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssGeofencing.h b/android/GnssGeofencing.h new file mode 100644 index 00000000..7af5f91c --- /dev/null +++ b/android/GnssGeofencing.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::IGnssGeofencing; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class GeofenceAPIClient; +struct GnssGeofencing : public IGnssGeofencing { + GnssGeofencing(); + ~GnssGeofencing(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. + * These declarations were generated from IGnssGeofencing.hal. + */ + Return setCallback(const sp& callback) override; + Return addGeofence(int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) override; + + Return pauseGeofence(int32_t geofenceId) override; + Return resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override; + Return removeGeofence(int32_t geofenceId) override; + + private: + // This method is not part of the IGnss base class. + // It is called by GnssGeofencingDeathRecipient to remove all geofences added so far. + Return removeAllGeofences(); + + private: + struct GnssGeofencingDeathRecipient : hidl_death_recipient { + GnssGeofencingDeathRecipient(sp gnssGeofencing) : + mGnssGeofencing(gnssGeofencing) { + } + ~GnssGeofencingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssGeofencing; + }; + + private: + sp mGnssGeofencingDeathRecipient = nullptr; + sp mGnssGeofencingCbIface = nullptr; + GeofenceAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H diff --git a/android/GnssMeasurement.cpp b/android/GnssMeasurement.cpp new file mode 100644 index 00000000..bc07265c --- /dev/null +++ b/android/GnssMeasurement.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssMeasurementInterface" + +#include +#include +#include "GnssMeasurement.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssMeasurement != nullptr) { + mGnssMeasurement->close(); + } +} + +GnssMeasurement::GnssMeasurement() { + mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this); + mApi = new GnssMeasurementAPIClient(); +} + +GnssMeasurement::~GnssMeasurement() { + if (mApi) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. +Return GnssMeasurement::setCallback( + const sp& callback) { + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface = callback; + mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/); + + return mApi->gnssMeasurementSetCallback(callback); +} + +Return GnssMeasurement::close() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return Void(); + } + + if (mGnssMeasurementCbIface != nullptr) { + mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface = nullptr; + } + mApi->gnssMeasurementClose(); + + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssMeasurement.h b/android/GnssMeasurement.h new file mode 100644 index 00000000..cd364c3a --- /dev/null +++ b/android/GnssMeasurement.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class GnssMeasurementAPIClient; +struct GnssMeasurement : public IGnssMeasurement { + GnssMeasurement(); + ~GnssMeasurement(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. + * These declarations were generated from IGnssMeasurement.hal. + */ + Return setCallback( + const sp& callback) override; + Return close() override; + + private: + struct GnssMeasurementDeathRecipient : hidl_death_recipient { + GnssMeasurementDeathRecipient(sp gnssMeasurement) : + mGnssMeasurement(gnssMeasurement) { + } + ~GnssMeasurementDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssMeasurement; + }; + + private: + sp mGnssMeasurementDeathRecipient = nullptr; + sp mGnssMeasurementCbIface = nullptr; + GnssMeasurementAPIClient* mApi; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H diff --git a/android/GnssNi.cpp b/android/GnssNi.cpp new file mode 100644 index 00000000..4437932a --- /dev/null +++ b/android/GnssNi.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssNiInterface" + +#include +#include "Gnss.h" +#include "GnssNi.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + // we do nothing here + // Gnss::GnssDeathRecipient will stop the session +} + +GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { + mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. +Return GnssNi::setCallback(const sp& callback) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + mGnss->setGnssNiCb(callback); + + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); + } + mGnssNiCbIface = callback; + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + GnssAPIClient* api = mGnss->getApi(); + if (api == nullptr) { + LOC_LOGE("%s]: api is nullptr", __FUNCTION__); + return Void(); + } + + api->gnssNiRespond(notifId, userResponse); + + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssNi.h b/android/GnssNi.h new file mode 100644 index 00000000..f6fe0bb4 --- /dev/null +++ b/android/GnssNi.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H +#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssNi; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct GnssNi : public IGnssNi { + GnssNi(Gnss* gnss); + ~GnssNi() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. + * These declarations were generated from IGnssNi.hal. + */ + Return setCallback(const sp& callback) override; + Return respond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) override; + + private: + struct GnssNiDeathRecipient : hidl_death_recipient { + GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { + } + ~GnssNiDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssNi; + }; + + private: + sp mGnssNiDeathRecipient = nullptr; + sp mGnssNiCbIface = nullptr; + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.0-service-qti.rc new file mode 100644 index 00000000..7ba64601 --- /dev/null +++ b/android/android.hardware.gnss@1.0-service-qti.rc @@ -0,0 +1,4 @@ +service gnss_service /system/bin/hw/android.hardware.gnss@1.0-service-qti + class main + user system + group system diff --git a/android/loc.cpp b/android/loc.cpp deleted file mode 100644 index 14d81263..00000000 --- a/android/loc.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/* Copyright (c) 2011-2017, 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 "GnssAPIClient.h" - -extern "C" const GpsGeofencingInterface* get_gps_geofence_interface(); - -static GnssAPIClient* sClient = nullptr; -static GpsCallbacks sGpsCallbacks; -static GpsCallbacks* pGpsCallbacks = nullptr; - -static GpsNiCallbacks sGpsNiCallbacks; -static GpsNiCallbacks* pGpsNiCallbacks = nullptr; - -static GpsMeasurementCallbacks sGpsMeasurementCallbacks; -static GpsMeasurementCallbacks* pGpsMeasurementCallbacks = nullptr; - -typedef struct { - bool pending; - AGpsType type; - char *hostname; - int port; -} AgnssServerPack; -static AgnssServerPack pendingAgnssServer = { - false, - AGPS_TYPE_SUPL, - nullptr, - 0 -}; - -typedef struct { - bool pending; - char* config_data; - int32_t length; -} ConfigurationPack; -static ConfigurationPack pendingConfiguration = { - false, - nullptr, - 0 -}; - -static GnssAPIClient* getClient() { - if (!sClient && - // in order to create a GnssClient to call gnssUpdateConfig, - // one of pGpsCallbacks and pGpsNiCallbacks should not be nullptr. - (pGpsCallbacks != nullptr || pGpsNiCallbacks != nullptr)) { - sClient = new GnssAPIClient(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); - if (sClient) { - sClient->locAPIEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); - if (pendingAgnssServer.pending && pendingAgnssServer.hostname) { - sClient->gnssAgnssSetServer(pendingAgnssServer.type, - pendingAgnssServer.hostname, - pendingAgnssServer.port); - pendingAgnssServer.pending = false; - free(pendingAgnssServer.hostname); - pendingAgnssServer.hostname = nullptr; - } - if (pendingConfiguration.pending && pendingConfiguration.config_data) { - sClient->gnssConfigurationUpdate(pendingConfiguration.config_data, - pendingConfiguration.length); - pendingConfiguration.pending = false; - free(pendingConfiguration.config_data); - pendingConfiguration.config_data = nullptr; - } - } - } - if (!sClient) { - LOC_LOGE("%s:%d] get GnssAPIClient failed", __func__, __LINE__); - } - return sClient; -} - -/*=========================================================================== - Functions and variables for sGpsInterface -===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) { - ENTRY_LOG_CALLFLOW(); - int retVal = -1; - if (callbacks) { - GnssAPIClient* client = getClient(); - // backup callbacks in case *callbacks is a stack variable - pGpsCallbacks = &sGpsCallbacks; - pGpsCallbacks->size = callbacks->size; - pGpsCallbacks->location_cb = callbacks->location_cb; - pGpsCallbacks->status_cb = callbacks->status_cb; - pGpsCallbacks->sv_status_cb = callbacks->sv_status_cb; - pGpsCallbacks->nmea_cb = callbacks->nmea_cb; - pGpsCallbacks->set_capabilities_cb = callbacks->set_capabilities_cb; - pGpsCallbacks->set_system_info_cb = callbacks->set_system_info_cb; - pGpsCallbacks->gnss_sv_status_cb = callbacks->gnss_sv_status_cb; - - // create MsgTask - pGpsCallbacks->create_thread_cb = callbacks->create_thread_cb; - loc_core::LocDualContext::getLocFgContext( - (LocThread::tCreate)pGpsCallbacks->create_thread_cb, - nullptr, loc_core::LocDualContext::mLocationHalName, false); - - // will never call these cbs - pGpsCallbacks->acquire_wakelock_cb = nullptr; - pGpsCallbacks->release_wakelock_cb = nullptr; - pGpsCallbacks->request_utc_time_cb = nullptr; - - // we can't create GnssAPIClient before GpsCallbacks or GpsNiCallbacks is set - if (client) { - client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); - } - - retVal = 0; - } - return retVal; -} -static int loc_start() { - ENTRY_LOG_CALLFLOW(); - int retVal = -1; - GnssAPIClient* client = getClient(); - if (client) - retVal = client->gnssStart(); - return retVal; -} -static int loc_stop() { - ENTRY_LOG_CALLFLOW(); - int retVal = -1; - GnssAPIClient* client = getClient(); - if (client) - retVal = client->gnssStop(); - return retVal; -} -static void loc_cleanup() { - ENTRY_LOG_CALLFLOW(); - if (sClient) { - sClient->locAPIDisable(); - } - pGpsCallbacks = nullptr; - pGpsNiCallbacks = nullptr; - pGpsMeasurementCallbacks = nullptr; - - pendingAgnssServer.pending = false; - if (pendingAgnssServer.hostname) { - free(pendingAgnssServer.hostname); - pendingAgnssServer.hostname = nullptr; - } - pendingConfiguration.pending = false; - if (pendingConfiguration.config_data) { - free(pendingConfiguration.config_data); - pendingConfiguration.config_data = nullptr; - } -} -static int loc_inject_time(GpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) { - return -1; -} -static int loc_inject_location(double /*latitude*/, double /*longitude*/, float /*accuracy*/) { - return -1; -} -static void loc_delete_aiding_data(GpsAidingData f) { - ENTRY_LOG_CALLFLOW(); - GnssAPIClient* client = getClient(); - if (client) - client->gnssDeleteAidingData(f); -} -static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time) { - ENTRY_LOG_CALLFLOW(); - int retVal = -1; - GnssAPIClient* client = getClient(); - if (client) - retVal = client->gnssSetPositionMode(mode, recurrence, - min_interval, preferred_accuracy, preferred_time); - return retVal; -} -static const void* loc_get_extension(const char* name); - -static const GpsInterface sGpsInterface = { - 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 -}; - -/*=========================================================================== - Functions and variables for sAGpsInterface -===========================================================================*/ -static void loc_agps_init(AGpsCallbacks* /*callbacks*/) { -} -static int loc_agps_open(const char* /*apn*/) { - return -1; -} -static int loc_agps_closed() { return -1; } -static int loc_agps_open_failed() { return -1; } -static int loc_agps_set_server(AGpsType type, const char *hostname, int port) { - GnssAPIClient* client = getClient(); - if (client) - client->gnssAgnssSetServer(type, hostname, port); - else { - // client is not ready yet - if (pendingAgnssServer.hostname) - free(pendingAgnssServer.hostname); - pendingAgnssServer.type = type; - pendingAgnssServer.hostname = strdup(hostname); - pendingAgnssServer.port = port; - pendingAgnssServer.pending = true; - } - return 0; -} -static int loc_agps_open_with_apniptype(const char* /*apn*/, ApnIpType /*apnIpType*/) { - return -1; -} - -static const AGpsInterface sAGpsInterface = { - sizeof(AGpsInterface), - loc_agps_init, - loc_agps_open, - loc_agps_closed, - loc_agps_open_failed, - loc_agps_set_server, - loc_agps_open_with_apniptype -}; - -/*=========================================================================== - Functions and variables for sGpsNiInterface -===========================================================================*/ -static void loc_ni_init(GpsNiCallbacks *callbacks) { - ENTRY_LOG_CALLFLOW(); - if (callbacks) { - GnssAPIClient* client = getClient(); - pGpsNiCallbacks = &sGpsNiCallbacks; - pGpsNiCallbacks->notify_cb = callbacks->notify_cb; - pGpsNiCallbacks->create_thread_cb = callbacks->create_thread_cb; - - if (client) { - client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); - } - } -} -static void loc_ni_respond(int notif_id, GpsUserResponseType user_response) { - ENTRY_LOG_CALLFLOW(); - GnssAPIClient* client = getClient(); - if (client) - client->gnssNiRespond(notif_id, user_response); -} - -static const GpsNiInterface sGpsNiInterface = -{ - sizeof(GpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - -/*=========================================================================== - Functions and variables for sGpsMeasurementInterface -===========================================================================*/ -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) { - ENTRY_LOG_CALLFLOW(); - int retVal = -1; - if (callbacks) { - GnssAPIClient* client = getClient(); - pGpsMeasurementCallbacks = &sGpsMeasurementCallbacks; - pGpsMeasurementCallbacks->size = sizeof(GpsMeasurementCallbacks); - pGpsMeasurementCallbacks->measurement_callback = callbacks->measurement_callback; - pGpsMeasurementCallbacks->gnss_measurement_callback = callbacks->gnss_measurement_callback; - - if (client) { - client->gnssUpdateCallbacks(pGpsCallbacks, pGpsNiCallbacks, pGpsMeasurementCallbacks); - } - - retVal = 0; - } - return retVal; -} -static void loc_gps_measurement_close() { - ENTRY_LOG_CALLFLOW(); - GnssAPIClient* client = getClient(); - if (client) - client->gnssMeasurementClose(); -} - -static const GpsMeasurementInterface sGpsMeasurementInterface = -{ - sizeof(GpsMeasurementInterface), - loc_gps_measurement_init, - loc_gps_measurement_close -}; - -/*=========================================================================== - Functions and variables for sGnssConfigurationInterface -===========================================================================*/ -static void loc_configuration_update(const char* config_data, int32_t length) { - ENTRY_LOG_CALLFLOW(); - GnssAPIClient* client = getClient(); - if (client) - client->gnssConfigurationUpdate(config_data, length); - else { - // client is not ready yet - if (pendingConfiguration.config_data) - free(pendingConfiguration.config_data); - pendingConfiguration.config_data = strdup(config_data); - pendingConfiguration.length = length; - pendingConfiguration.pending = true; - } -} - -static const GnssConfigurationInterface sGnssConfigurationInterface = -{ - sizeof(GnssConfigurationInterface), - loc_configuration_update -}; - -// Function exposed to gps hal -extern "C" const GpsInterface* get_gps_interface() -{ - unsigned int target = loc_get_target(); - int gnssType = getTargetGnssType(target); - if (gnssType == GNSS_NONE){ - LOC_LOGE("%s:%d] No GNSS HW on this target. Returning nullptr", __func__, __LINE__); - return nullptr; - } - return &sGpsInterface; -} - -const void* loc_get_extension(const char* name) -{ - const void* retVal = nullptr; - - LOC_LOGD("%s:%d] For Interface = %s\n", __func__, __LINE__, name); - if (strcmp(name, AGPS_INTERFACE) == 0) { - retVal = &sAGpsInterface; - } else if (strcmp(name, GPS_NI_INTERFACE) == 0) { - retVal = &sGpsNiInterface; - } else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) { - retVal = get_gps_geofence_interface(); - } else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) { - retVal = &sGpsMeasurementInterface; - } else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) { - retVal = &sGnssConfigurationInterface; - } - - if (!retVal) { - LOC_LOGE ("%s:%d] %s is not supported", __func__, __LINE__, name); - } - return retVal; -} diff --git a/android/loc_geofence.cpp b/android/loc_geofence.cpp deleted file mode 100644 index 91a4be82..00000000 --- a/android/loc_geofence.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (c) 2017, 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_geofence" - -#include -#include - -static GeofenceAPIClient* sClient = nullptr; - -/*=========================================================================== - Functions and variables for sGpsGeofencingInterface -===========================================================================*/ -static GpsGeofenceCallbacks sGpsGeofenceCbs; - -static void loc_geofence_init(GpsGeofenceCallbacks* callbacks) { - if (callbacks && !sClient) { - sGpsGeofenceCbs.geofence_transition_callback = callbacks->geofence_transition_callback; - sGpsGeofenceCbs.geofence_status_callback = callbacks->geofence_status_callback; - sGpsGeofenceCbs.geofence_add_callback = callbacks->geofence_add_callback; - sGpsGeofenceCbs.geofence_remove_callback = callbacks->geofence_remove_callback; - sGpsGeofenceCbs.geofence_pause_callback = callbacks->geofence_pause_callback; - sGpsGeofenceCbs.geofence_resume_callback = callbacks->geofence_resume_callback; - sGpsGeofenceCbs.create_thread_cb = callbacks->create_thread_cb; - - sClient = new GeofenceAPIClient(&sGpsGeofenceCbs); - } -} -static void loc_add_geofence_area(int32_t geofence_id, double latitude, double longitude, - double radius_meters, int last_transition, int monitor_transitions, - int notification_responsiveness_ms, int unknown_timer_ms) { - if (sClient) - sClient->geofenceAdd(geofence_id, latitude, longitude, - radius_meters, last_transition, monitor_transitions, - notification_responsiveness_ms, unknown_timer_ms); -} -static void loc_pause_geofence(int32_t geofence_id) { - if (sClient) - sClient->geofencePause(geofence_id); -} -static void loc_resume_geofence(int32_t geofence_id, int monitor_transitions) { - if (sClient) - sClient->geofenceResume(geofence_id, monitor_transitions); -} -static void loc_remove_geofence_area(int32_t geofence_id) { - if (sClient) - sClient->geofenceRemove(geofence_id); -} - -static const GpsGeofencingInterface sGpsGeofencingInterface = -{ - sizeof(GpsGeofencingInterface), - loc_geofence_init, - loc_add_geofence_area, - loc_pause_geofence, - loc_resume_geofence, - loc_remove_geofence_area -}; - -// Function exposed to gps hal -extern "C" const GpsGeofencingInterface* get_gps_geofence_interface() -{ - return &sGpsGeofencingInterface; -} diff --git a/android/location_api/FlpAPIClient.cpp b/android/location_api/FlpAPIClient.cpp new file mode 100644 index 00000000..2fb8caa4 --- /dev/null +++ b/android/location_api/FlpAPIClient.cpp @@ -0,0 +1,182 @@ +/* Copyright (c) 2017, 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_FlpAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "FlpAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask); + +FlpAPIClient::FlpAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssBatchingCbIface(callback), + mDefaultId(42), + mLocationCapabilitiesMask(0) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + LocationCallbacks locationCallbacks; + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + if (mGnssBatchingCbIface != nullptr) { + locationCallbacks.batchingCb = [this](size_t count, Location* location) { + onBatchingCb(count, location); + }; + } + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +FlpAPIClient::~FlpAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +int FlpAPIClient::flpGetBatchSize() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + return locAPIGetBatchSize(); +} + +int FlpAPIClient::flpStartSession(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int FlpAPIClient::flpUpdateSessionOptions(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int FlpAPIClient::flpStopSession() +{ + LOC_LOGD("%s]: ", __FUNCTION__); + int retVal = -1; + if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +void FlpAPIClient::flpGetBatchedLocation(int last_n_locations) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations); + locAPIGetBatchedLocations(last_n_locations); +} + +void FlpAPIClient::flpFlushBatchedLocations() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + locAPIGetBatchedLocations(SIZE_MAX); +} + +void FlpAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; +} + +void FlpAPIClient::onBatchingCb(size_t count, Location* location) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); + if (mGnssBatchingCbIface != nullptr && count > 0) { + hidl_vec locationVec; + locationVec.resize(count); + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i]); + } + mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + } +} + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask) +{ + memset(&out, 0, sizeof(LocationOptions)); + out.size = sizeof(LocationOptions); + out.minInterval = (uint32_t)(in.periodNanos / 1000000L); + out.minDistance = 0; + out.mode = GNSS_SUPL_MODE_STANDALONE; + if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + out.mode = GNSS_SUPL_MODE_MSA; + if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + out.mode = GNSS_SUPL_MODE_MSB; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/location_api/FlpAPIClient.h b/android/location_api/FlpAPIClient.h new file mode 100644 index 00000000..9f9be1e3 --- /dev/null +++ b/android/location_api/FlpAPIClient.h @@ -0,0 +1,77 @@ +/* Copyright (c) 2017, 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 FLP_API_CLINET_H +#define FLP_API_CLINET_H + +#include +#include +#include + +#include + +#define FLP_CONF_FILE "/etc/flp.conf" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +class FlpAPIClient : public LocationAPIClientBase +{ +public: + FlpAPIClient(const sp& callback); + ~FlpAPIClient(); + int flpGetBatchSize(); + int flpStartSession(const IGnssBatching::Options& options); + int flpUpdateSessionOptions(const IGnssBatching::Options& options); + int flpStopSession(); + void flpGetBatchedLocation(int last_n_locations); + void flpFlushBatchedLocations(); + + inline LocationCapabilitiesMask flpGetCapabilities() { return mLocationCapabilitiesMask; } + + // callbacks + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onBatchingCb(size_t count, Location* location) final; + +private: + sp mGnssBatchingCbIface; + uint32_t mDefaultId; + int mBatchSize; + LocationCapabilitiesMask mLocationCapabilitiesMask; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // FLP_API_CLINET_H diff --git a/android/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp similarity index 56% rename from android/GeofenceAPIClient.cpp rename to android/location_api/GeofenceAPIClient.cpp index aeb4fd5e..5be1cff2 100644 --- a/android/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -33,36 +33,21 @@ #include #include +#include "LocationUtil.h" #include "GeofenceAPIClient.h" -static void convertGpsLocation(Location& in, GpsLocation& out) -{ - memset(&out, 0, sizeof(GpsLocation)); - out.size = sizeof(GpsLocation); - if (in.flags & LOCATION_HAS_LAT_LONG_BIT) - out.flags |= GPS_LOCATION_HAS_LAT_LONG; - if (in.flags & LOCATION_HAS_ALTITUDE_BIT) - out.flags |= GPS_LOCATION_HAS_ALTITUDE; - if (in.flags & LOCATION_HAS_SPEED_BIT) - out.flags |= GPS_LOCATION_HAS_SPEED; - if (in.flags & LOCATION_HAS_BEARING_BIT) - out.flags |= GPS_LOCATION_HAS_BEARING; - if (in.flags & LOCATION_HAS_ACCURACY_BIT) - out.flags |= GPS_LOCATION_HAS_ACCURACY; - out.latitude = in.latitude; - out.longitude = in.longitude; - out.altitude = in.altitude; - out.speed = in.speed; - out.bearing = in.bearing; - out.accuracy = in.accuracy; - out.timestamp = (GpsUtcTime)in.timestamp; -} +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { -GeofenceAPIClient::GeofenceAPIClient(GpsGeofenceCallbacks* cbs) : + +GeofenceAPIClient::GeofenceAPIClient(const sp& callback) : LocationAPIClientBase(), - mGpsGeofenceCallbacks(cbs) + mGnssGeofencingCbIface(callback) { - LOC_LOGD("%s]: (%p)", __func__, cbs); + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); LocationCallbacks locationCallbacks; locationCallbacks.size = sizeof(LocationCallbacks); @@ -71,15 +56,12 @@ GeofenceAPIClient::GeofenceAPIClient(GpsGeofenceCallbacks* cbs) : locationCallbacks.batchingCb = nullptr; locationCallbacks.geofenceBreachCb = nullptr; - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_transition_callback) { + if (mGnssGeofencingCbIface != nullptr) { locationCallbacks.geofenceBreachCb = [this](GeofenceBreachNotification geofenceBreachNotification) { onGeofenceBreachCb(geofenceBreachNotification); }; - } - locationCallbacks.geofenceStatusCb = nullptr; - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_status_callback) { locationCallbacks.geofenceStatusCb = [this](GeofenceStatusNotification geofenceStatusNotification) { onGeofenceStatusCb(geofenceStatusNotification); @@ -96,19 +78,19 @@ GeofenceAPIClient::GeofenceAPIClient(GpsGeofenceCallbacks* cbs) : } void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude, - double radius_meters, int last_transition, int monitor_transitions, - int notification_responsiveness_ms, int unknown_timer_ms) + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms) { - LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __func__, + LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__, geofence_id, latitude, longitude, radius_meters, last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms); GeofenceOption options; memset(&options, 0, sizeof(GeofenceOption)); options.size = sizeof(GeofenceOption); - if (monitor_transitions & GPS_GEOFENCE_ENTERED) + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT; - if (monitor_transitions & GPS_GEOFENCE_EXITED) + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT; options.responsiveness = notification_responsiveness_ms; @@ -123,120 +105,141 @@ void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, doubl void GeofenceAPIClient::geofencePause(uint32_t geofence_id) { - LOC_LOGD("%s]: (%d)", __func__, geofence_id); + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); locAPIPauseGeofences(1, &geofence_id); } -void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int monitor_transitions) +void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions) { - LOC_LOGD("%s]: (%d %d)", __func__, geofence_id, monitor_transitions); + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions); GeofenceBreachTypeMask mask = 0; - if (monitor_transitions & GPS_GEOFENCE_ENTERED) + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) mask |= GEOFENCE_BREACH_ENTER_BIT; - if (monitor_transitions & GPS_GEOFENCE_EXITED) + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) mask |= GEOFENCE_BREACH_EXIT_BIT; locAPIResumeGeofences(1, &geofence_id, &mask); } void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id) { - LOC_LOGD("%s]: (%d)", __func__, geofence_id); + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); locAPIRemoveGeofences(1, &geofence_id); } +void GeofenceAPIClient::geofenceRemoveAll() +{ + LOC_LOGD("%s]", __FUNCTION__); + // TODO locAPIRemoveAllGeofences(); +} + // callbacks void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) { - LOC_LOGD("%s]: (%zu)", __func__, geofenceBreachNotification.count); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_transition_callback) { + LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count); + if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < geofenceBreachNotification.count; i++) { - GpsLocation location; - convertGpsLocation(geofenceBreachNotification.location, location); + GnssLocation gnssLocation; + convertGnssLocation(geofenceBreachNotification.location, gnssLocation); - uint32_t transition; + IGnssGeofenceCallback::GeofenceTransition transition; if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER) - transition = GPS_GEOFENCE_ENTERED; + transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED; else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT) - transition = GPS_GEOFENCE_EXITED; + transition = IGnssGeofenceCallback::GeofenceTransition::EXITED; else { // continue with other breach if transition is // nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED continue; } - GpsUtcTime time = geofenceBreachNotification.timestamp; - mGpsGeofenceCallbacks->geofence_transition_callback(geofenceBreachNotification.ids[i], - &location, transition, time); + mGnssGeofencingCbIface->gnssGeofenceTransitionCb( + geofenceBreachNotification.ids[i], gnssLocation, transition, + static_cast(geofenceBreachNotification.timestamp)); } } } void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) { - LOC_LOGD("%s]: (%d)", __func__, geofenceStatusNotification.available); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_status_callback) { - int32_t status = GPS_GEOFENCE_UNAVAILABLE; + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available); + if (mGnssGeofencingCbIface != nullptr) { + IGnssGeofenceCallback::GeofenceAvailability status = + IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE; if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) { - status = GPS_GEOFENCE_AVAILABLE; + status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE; } - mGpsGeofenceCallbacks->geofence_status_callback(status, nullptr); + GnssLocation gnssLocation; + memset(&gnssLocation, 0, sizeof(GnssLocation)); + mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation); } } void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) { - LOC_LOGD("%s]: (%zu)", __func__, count); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_add_callback) { + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < count; i++) { - int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; if (errors[i] == LOCATION_ERROR_SUCCESS) - status = GPS_GEOFENCE_OPERATION_SUCCESS; - mGpsGeofenceCallbacks->geofence_add_callback(ids[i], status); + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_EXISTS) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS; + mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status); } } } void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) { - LOC_LOGD("%s]: (%zu)", __func__, count); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_remove_callback) { + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < count; i++) { - int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; if (errors[i] == LOCATION_ERROR_SUCCESS) - status = GPS_GEOFENCE_OPERATION_SUCCESS; + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) - status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; - mGpsGeofenceCallbacks->geofence_remove_callback(ids[i], status); + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status); } } } void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) { - LOC_LOGD("%s]: (%zu)", __func__, count); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_pause_callback) { + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < count; i++) { - int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; if (errors[i] == LOCATION_ERROR_SUCCESS) - status = GPS_GEOFENCE_OPERATION_SUCCESS; + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) - status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; - mGpsGeofenceCallbacks->geofence_pause_callback(ids[i], status); + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status); } } } void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) { - LOC_LOGD("%s]: (%zu)", __func__, count); - if (mGpsGeofenceCallbacks && mGpsGeofenceCallbacks->geofence_resume_callback) { + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < count; i++) { - int32_t status = GPS_GEOFENCE_ERROR_GENERIC; + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; if (errors[i] == LOCATION_ERROR_SUCCESS) - status = GPS_GEOFENCE_OPERATION_SUCCESS; + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) - status = GPS_GEOFENCE_ERROR_ID_UNKNOWN; - mGpsGeofenceCallbacks->geofence_resume_callback(ids[i], status); + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status); } } } + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GeofenceAPIClient.h b/android/location_api/GeofenceAPIClient.h similarity index 78% rename from android/GeofenceAPIClient.h rename to android/location_api/GeofenceAPIClient.h index e99d6ba2..f779bcbc 100644 --- a/android/GeofenceAPIClient.h +++ b/android/location_api/GeofenceAPIClient.h @@ -30,21 +30,31 @@ #ifndef GEOFENCE_API_CLINET_H #define GEOFENCE_API_CLINET_H -#include + +#include #include +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::sp; + class GeofenceAPIClient : public LocationAPIClientBase { public: - GeofenceAPIClient(GpsGeofenceCallbacks* cbs); + GeofenceAPIClient(const sp& callback); virtual ~GeofenceAPIClient() = default; void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, - double radius_meters, int last_transition, int monitor_transitions, - int notification_responsiveness_ms, int unknown_timer_ms); + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms); void geofencePause(uint32_t geofence_id); - void geofenceResume(uint32_t geofence_id, int monitor_transitions); + void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions); void geofenceRemove(uint32_t geofence_id); + void geofenceRemoveAll(); // callbacks void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final; @@ -55,6 +65,12 @@ public: void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; private: - GpsGeofenceCallbacks* mGpsGeofenceCallbacks; + sp mGnssGeofencingCbIface; }; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android #endif // GEOFENCE_API_CLINET_H diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp new file mode 100644 index 00000000..b4f04065 --- /dev/null +++ b/android/location_api/GnssAPIClient.cpp @@ -0,0 +1,406 @@ +/* Copyright (c) 2017, 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_GnssAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "GnssAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); + +GnssAPIClient::GnssAPIClient(const sp& gpsCb, + const sp& niCb) : + LocationAPIClientBase(), + mGnssCbIface(nullptr), + mGnssNiCbIface(nullptr), + mLocationCapabilitiesMask(0) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + // set default LocationOptions. + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = 1000; + mLocationOptions.minDistance = 0; + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + + gnssUpdateCallbacks(gpsCb, niCb); +} + +GnssAPIClient::~GnssAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +// for GpsInterface +void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + mGnssCbIface = gpsCb; + mGnssNiCbIface = niCb; + + LocationCallbacks locationCallbacks; + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.trackingCb = [this](Location location) { + onTrackingCb(location); + }; + } + + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + + locationCallbacks.gnssNiCb = nullptr; + if (mGnssNiCbIface != nullptr) { + locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { + onGnssNiCb(id, gnssNiNotification); + }; + } + + locationCallbacks.gnssSvCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { + onGnssSvCb(gnssSvNotification); + }; + } + + locationCallbacks.gnssNmeaCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { + onGnssNmeaCb(gnssNmeaNotification); + }; + } + + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +bool GnssAPIClient::gnssStart() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStartTracking(mLocationOptions); + return retVal; +} + +bool GnssAPIClient::gnssStop() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStopTracking(); + return retVal; +} + +void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) +{ + LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags); + GnssAidingData data; + memset(&data, 0, sizeof (GnssAidingData)); + data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS | + GNSS_AIDING_DATA_SV_TYPE_GLONASS | + GNSS_AIDING_DATA_SV_TYPE_QZSS | + GNSS_AIDING_DATA_SV_TYPE_BEIDOU | + GNSS_AIDING_DATA_SV_TYPE_GALILEO; + + if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) + data.deleteAll = true; + else { + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS) + data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC) + data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION) + data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME) + data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO) + data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC) + data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH) + data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR) + data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER) + data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA) + data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI) + data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO) + data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB; + } + locAPIGnssDeleteAidingData(data); +} + +bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) +{ + LOC_LOGD("%s]: (%d %d %d %d %d)", __FUNCTION__, + (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, preferredTimeMs); + bool retVal = true; + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = minIntervalMs; + mLocationOptions.minDistance = preferredAccuracyMeters; + if (mode == IGnss::GnssPositionMode::STANDALONE) + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + else if (mode == IGnss::GnssPositionMode::MS_BASED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + return retVal; +} + +// for GpsNiInterface +void GnssAPIClient::gnssNiRespond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); + GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; + if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT) + data = GNSS_NI_RESPONSE_ACCEPT; + else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY) + data = GNSS_NI_RESPONSE_DENY; + else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) + data = GNSS_NI_RESPONSE_NO_RESPONSE; + locAPIGnssNiResponse(notifId, data); +} + +// for GnssConfigurationInterface +void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags); + locAPIGnssUpdateConfig(gnssConfig); +} + +// callbacks +void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; + if (mGnssCbIface != nullptr) { + uint32_t data = 0; + if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) + data |= IGnssCallback::Capabilities::SCHEDULING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) + data |= IGnssCallback::Capabilities::GEOFENCING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) + data |= IGnssCallback::Capabilities::MEASUREMENTS; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + data |= IGnssCallback::Capabilities::MSB; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + data |= IGnssCallback::Capabilities::MSA; + mGnssCbIface->gnssSetCapabilitesCb(data); + } + if (mGnssCbIface != nullptr) { + IGnssCallback::GnssSystemInfo gnssInfo; + gnssInfo.yearOfHw = 2015; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + gnssInfo.yearOfHw = 2017; + } + LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); + mGnssCbIface->gnssSetSystemInfoCb(gnssInfo); + } +} + +void GnssAPIClient::onTrackingCb(Location location) +{ + LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); + if (mGnssCbIface != nullptr) { + GnssLocation gnssLocation; + convertGnssLocation(location, gnssLocation); + mGnssCbIface->gnssLocationCb(gnssLocation); + } +} + +void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) +{ + LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id); + + if (mGnssNiCbIface == nullptr) { + LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__); + return; + } + + IGnssNiCallback::GnssNiNotification notificationGnss; + + notificationGnss.notificationId = id; + + if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL; + else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE; + // GNSS_NI_TYPE_EMERGENCY_SUPL not supported + + if (gnssNiNotification.options == GNSS_NI_OPTIONS_NOTIFICATION) + notificationGnss.notifyFlags = + static_cast(IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY); + else if (gnssNiNotification.options == GNSS_NI_OPTIONS_VERIFICATION) + notificationGnss.notifyFlags = + static_cast(IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY); + else if (gnssNiNotification.options == GNSS_NI_OPTIONS_PRIVACY_OVERRIDE) + notificationGnss.notifyFlags = + static_cast(IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE); + + notificationGnss.timeoutSec = gnssNiNotification.timeout; + + if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE || + gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP; + + notificationGnss.requestorId = gnssNiNotification.requestor; + + notificationGnss.notificationMessage = gnssNiNotification.message; + + if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + mGnssNiCbIface->niNotifyCb(notificationGnss); +} + +void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); + if (mGnssCbIface != nullptr) { + IGnssCallback::GnssSvStatus svStatus; + convertGnssSvStatus(gnssSvNotification, svStatus); + mGnssCbIface->gnssSvStatusCb(svStatus); + } +} + +void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) +{ + if (mGnssCbIface != nullptr) { + android::hardware::hidl_string nmeaString; + nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); + mGnssCbIface->gnssNmeaCb(static_cast(gnssNmeaNotification.timestamp), + nmeaString); + } +} + +void GnssAPIClient::onStartTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { + mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + } +} + +void GnssAPIClient::onStopTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { + mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + } +} + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out) +{ + memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); + out.numSvs = in.count; + if (out.numSvs > static_cast(GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many satellites %zd. Clamps to %d.", + __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT); + out.numSvs = static_cast(GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.numSvs; i++) { + IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; + info.svid = in.gnssSvs[i].svId; + convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); + info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; + info.elevationDegrees = in.gnssSvs[i].elevation; + info.azimuthDegrees = in.gnssSvs[i].azimuth; + info.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/GnssAPIClient.h b/android/location_api/GnssAPIClient.h similarity index 69% rename from android/GnssAPIClient.h rename to android/location_api/GnssAPIClient.h index 77bfa527..1809c09d 100644 --- a/android/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -30,42 +30,46 @@ #ifndef GNSS_API_CLINET_H #define GNSS_API_CLINET_H -#include +#include +#include +#include #include +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::sp; + class GnssAPIClient : public LocationAPIClientBase { public: - GnssAPIClient(GpsCallbacks* gpsCb, - GpsNiCallbacks* niCb, - GpsMeasurementCallbacks* measurementCb); + GnssAPIClient(const sp& gpsCb, + const sp& niCb); virtual ~GnssAPIClient(); GnssAPIClient(const GnssAPIClient&) = delete; GnssAPIClient& operator=(const GnssAPIClient&) = delete; // for GpsInterface - void gnssUpdateCallbacks(GpsCallbacks* gpsCb, - GpsNiCallbacks* niCb, - GpsMeasurementCallbacks* measurementCb); - int gnssStart(); - int gnssStop(); - void gnssDeleteAidingData(GpsAidingData f); - int gnssSetPositionMode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); - - // for AGpsInterface - void gnssAgnssSetServer(AGpsType type, const char *hostname, int port); + void gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb); + bool gnssStart(); + bool gnssStop(); + void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags); + bool gnssSetPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs); // for GpsNiInterface - void gnssNiRespond(int notif_id, GpsUserResponseType user_response); - - // for GpsMeasurementInterface - void gnssMeasurementClose(); + void gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse); // for GnssConfigurationInterface - void gnssConfigurationUpdate(const char* config_data, int32_t length); + void gnssConfigurationUpdate(const GnssConfig& gnssConfig); inline LocationCapabilitiesMask gnssGetCapabilities() const { return mLocationCapabilitiesMask; @@ -77,21 +81,22 @@ public: void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final; void onGnssSvCb(GnssSvNotification gnssSvNotification) final; void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final; - void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; void onStartTrackingCb(LocationError error) final; void onStopTrackingCb(LocationError error) final; private: - pthread_mutex_t mLock; - - GpsCallbacks* mGpsCallbacks; - GpsNiCallbacks* mGpsNiCallbacks; + sp mGnssCbIface; + sp mGnssNiCbIface; LocationCapabilitiesMask mLocationCapabilitiesMask; - GpsMeasurementCallbacks* mGpsMeasurementCallbacks; - LocationOptions mLocationOptions; }; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android #endif // GNSS_API_CLINET_H diff --git a/android/location_api/GnssMeasurementAPIClient.cpp b/android/location_api/GnssMeasurementAPIClient.cpp new file mode 100644 index 00000000..32016251 --- /dev/null +++ b/android/location_api/GnssMeasurementAPIClient.cpp @@ -0,0 +1,278 @@ +/* Copyright (c) 2017, 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_GnssMeasurementAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "GnssMeasurementAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +static void convertGnssData(GnssMeasurementsNotification& in, + IGnssMeasurementCallback::GnssData& out); +static void convertGnssMeasurement(GnssMeasurementsData& in, + IGnssMeasurementCallback::GnssMeasurement& out); +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); + +GnssMeasurementAPIClient::GnssMeasurementAPIClient() : + mGnssMeasurementCbIface(nullptr), + mLocationCapabilitiesMask(0) +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + pthread_mutex_init(&mLock, nullptr); + pthread_cond_init (&mCond, nullptr); + + // set default LocationOptions. + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = 1000; + mLocationOptions.minDistance = 0; + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; +} + +GnssMeasurementAPIClient::~GnssMeasurementAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + pthread_cond_destroy(&mCond); + pthread_mutex_destroy(&mLock); +} + +// for GpsInterface +Return +GnssMeasurementAPIClient::gnssMeasurementSetCallback(const sp& callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + mGnssMeasurementCbIface = callback; + + LocationCallbacks locationCallbacks; + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + + locationCallbacks.gnssMeasurementsCb = nullptr; + if (mGnssMeasurementCbIface != nullptr) { + locationCallbacks.gnssMeasurementsCb = + [this](GnssMeasurementsNotification gnssMeasurementsNotification) { + onGnssMeasurementsCb(gnssMeasurementsNotification); + }; + } + + locAPISetCallbacks(locationCallbacks); + + while (!mLocationCapabilitiesMask) { + LOC_LOGD("%s]: wait for capabilities...", __FUNCTION__); + pthread_mutex_lock(&mLock); + pthread_cond_wait(&mCond, &mLock); + pthread_mutex_unlock(&mLock); + } + if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + mLocationOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + LOC_LOGD("%s]: start tracking session", __FUNCTION__); + locAPIStartTracking(mLocationOptions); + + return IGnssMeasurement::GnssMeasurementStatus::SUCCESS; +} + +// for GpsMeasurementInterface +void GnssMeasurementAPIClient::gnssMeasurementClose() { + LOC_LOGD("%s]: ()", __FUNCTION__); + pthread_mutex_lock(&mLock); + mGnssMeasurementCbIface = nullptr; + pthread_mutex_unlock(&mLock); +} + +// callbacks +void GnssMeasurementAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; + pthread_mutex_lock(&mLock); + pthread_cond_signal(&mCond); + pthread_mutex_unlock(&mLock); +} + +void GnssMeasurementAPIClient::onGnssMeasurementsCb( + GnssMeasurementsNotification gnssMeasurementsNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssMeasurementsNotification.count); + // we don't need to lock the mutext + // if mGnssMeasurementCbIface is set to nullptr + if (mGnssMeasurementCbIface != nullptr) { + pthread_mutex_lock(&mLock); + if (mGnssMeasurementCbIface != nullptr) { + IGnssMeasurementCallback::GnssData gnssData; + convertGnssData(gnssMeasurementsNotification, gnssData); + mGnssMeasurementCbIface->GnssMeasurementCb(gnssData); + } + pthread_mutex_unlock(&mLock); + } +} + +static void convertGnssMeasurement(GnssMeasurementsData& in, + IGnssMeasurementCallback::GnssMeasurement& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement)); + if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY; + out.svid = in.svId; + convertGnssConstellationType(in.svType, out.constellation); + out.timeOffsetNs = in.timeOffsetNs; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC; + out.receivedSvTimeInNs = in.receivedSvTimeNs; + out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs; + out.cN0DbHz = in.carrierToNoiseDbHz; + out.pseudorangeRateMps = in.pseudorangeRateMps; + out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + out.accumulatedDeltaRangeM = in.adrMeters; + out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters; + out.carrierFrequencyHz = in.carrierFrequencyHz; + out.carrierCycles = in.carrierCycles; + out.carrierPhase = in.carrierPhase; + out.carrierPhaseUncertainty = in.carrierPhaseUncertainty; + uint8_t indicator = + static_cast(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN); + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT; + out.multipathIndicator = + static_cast(indicator); + out.snrDb = in.signalToNoiseRatioDb; +} + +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock)); + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY; + out.leapSecond = in.leapSecond; + out.timeNs = in.timeNs; + out.timeUncertaintyNs = in.timeUncertaintyNs; + out.fullBiasNs = in.fullBiasNs; + out.biasNs = in.biasNs; + out.biasUncertaintyNs = in.biasUncertaintyNs; + out.driftNsps = in.driftNsps; + out.driftUncertaintyNsps = in.driftUncertaintyNsps; + out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount; +} + +static void convertGnssData(GnssMeasurementsNotification& in, + IGnssMeasurementCallback::GnssData& out) +{ + out.measurementCount = in.count; + if (out.measurementCount > static_cast(GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many measurement %zd. Clamps to %d.", + __FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT); + out.measurementCount = static_cast(GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.measurementCount; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i]); + } + convertGnssClock(in.clock, out.clock); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/location_api/GnssMeasurementAPIClient.h b/android/location_api/GnssMeasurementAPIClient.h new file mode 100644 index 00000000..02fe89ae --- /dev/null +++ b/android/location_api/GnssMeasurementAPIClient.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2017, 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 GNSS_MEASUREMENT_API_CLINET_H +#define GNSS_MEASUREMENT_API_CLINET_H + + +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::sp; + +class GnssMeasurementAPIClient : public LocationAPIClientBase +{ +public: + GnssMeasurementAPIClient(); + virtual ~GnssMeasurementAPIClient(); + GnssMeasurementAPIClient(const GnssMeasurementAPIClient&) = delete; + GnssMeasurementAPIClient& operator=(const GnssMeasurementAPIClient&) = delete; + + // for GpsMeasurementInterface + Return gnssMeasurementSetCallback( + const sp& callback); + void gnssMeasurementClose(); + + // callbacks we are interested in + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; + +private: + pthread_mutex_t mLock; + pthread_cond_t mCond; + + sp mGnssMeasurementCbIface; + + LocationCapabilitiesMask mLocationCapabilitiesMask; + + LocationOptions mLocationOptions; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // GNSS_MEASUREMENT_API_CLINET_H diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp new file mode 100644 index 00000000..dbafe5d3 --- /dev/null +++ b/android/location_api/LocationUtil.cpp @@ -0,0 +1,98 @@ +/* Copyright (c) 2017, 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 + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void convertGnssLocation(Location& in, GnssLocation& out) +{ + memset(&out, 0, sizeof(GnssLocation)); + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG; + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE; + if (in.flags & LOCATION_HAS_SPEED_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED; + if (in.flags & LOCATION_HAS_BEARING_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING; + if (in.flags & LOCATION_HAS_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY; + //out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; + //out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; + //out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; + } + out.latitudeDegrees = in.latitude; + out.longitudeDegrees = in.longitude; + out.altitudeMeters = in.altitude; + out.speedMetersPerSec = in.speed; + out.bearingDegrees = in.bearing; + out.horizontalAccuracyMeters = in.accuracy; + //out.verticalAccuracyMeters = in.accuracy; + //out.speedAccuracyMetersPerSecond = in.accuracy; + //out.bearingAccuracyDegrees = in.accuracy; + out.timestamp = static_cast(in.timestamp); +} + +void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) +{ + switch(in) { + case GNSS_SV_TYPE_GPS: + out = GnssConstellationType::UNKNOWN; + break; + case GNSS_SV_TYPE_SBAS: + out = GnssConstellationType::SBAS; + break; + case GNSS_SV_TYPE_GLONASS: + out = GnssConstellationType::GLONASS; + break; + case GNSS_SV_TYPE_QZSS: + out = GnssConstellationType::QZSS; + break; + case GNSS_SV_TYPE_BEIDOU: + out = GnssConstellationType::BEIDOU; + break; + case GNSS_SV_TYPE_GALILEO: + out = GnssConstellationType::GALILEO; + break; + default: + out = GnssConstellationType::UNKNOWN; + break; + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/gps.c b/android/location_api/LocationUtil.h similarity index 52% rename from android/gps.c rename to android/location_api/LocationUtil.h index a7248551..de098b11 100644 --- a/android/gps.c +++ b/android/location_api/LocationUtil.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015-2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 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 @@ -9,7 +9,7 @@ * 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 + * * 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. * @@ -27,51 +27,24 @@ * */ -#include +#ifndef LOCATION_UTIL_H +#define LOCATION_UTIL_H -#include -#include +#include +#include -#define UNUSED(...) (void)(__VA_ARGS__) +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { -extern const GpsInterface* get_gps_interface(); +void convertGnssLocation(Location& in, GnssLocation& out); +void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out); -const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev) -{ - UNUSED(dev); - return get_gps_interface(); -} - -static int open_gps(const struct hw_module_t* module, char const* name, - struct hw_device_t** device) -{ - UNUSED(name); - 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, -}; +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // LOCATION_UTIL_H diff --git a/android/service.cpp b/android/service.cpp new file mode 100644 index 00000000..bfa0d884 --- /dev/null +++ b/android/service.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "android.hardware.gnss@1.0-service-qti" + +#include +#include + +using android::hardware::gnss::V1_0::IGnss; +using android::hardware::defaultPassthroughServiceImplementation; + +int main() { + return defaultPassthroughServiceImplementation("gnss"); +} diff --git a/core/Android.mk b/core/Android.mk index 53dcb6bd..b260b1dc 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -17,6 +17,7 @@ LOCAL_CFLAGS += -DPDK_FEATURE_SET endif LOCAL_SHARED_LIBRARIES := \ + liblog \ libutils \ libcutils \ libgps.utils \ diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index f3cedd5b..ad07197b 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -11,7 +11,8 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ liblog \ - libloc_stub + libloc_stub \ + libandroid_runtime LOCAL_SRC_FILES += \ platform_lib_android_runtime.cpp \ @@ -26,9 +27,6 @@ LOCAL_CFLAGS += \ -D_ANDROID_ \ -std=c++11 - -LOCAL_LDFLAGS += -Wl,--export-dynamic - ## Includes LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/../include \ From 5fecc1979b38724fb54d824ddadc61ba35475743 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 3 Feb 2017 00:46:48 +0530 Subject: [PATCH 446/945] Adding ATL call flow to new Loc API interface Re-designed the ATL call flow, to fit along with updated Location API. Change-Id: If22e672d1c233c55b6b52107be7169b3036d9a3e CRs-fixed: 1112712 --- android/AGnss.cpp | 65 +++ android/AGnss.h | 22 +- gnss/Agps.cpp | 963 ++++++++++++++++++++++++++++++++++ gnss/Agps.h | 446 ++++++++++++++++ gnss/Android.mk | 3 +- gnss/GnssAdapter.cpp | 335 +++++++++++- gnss/GnssAdapter.h | 20 + gnss/location_gnss.cpp | 37 +- location/location_interface.h | 4 + 9 files changed, 1879 insertions(+), 16 deletions(-) create mode 100644 gnss/Agps.cpp create mode 100644 gnss/Agps.h diff --git a/android/AGnss.cpp b/android/AGnss.cpp index 3b40e604..c497ed49 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -23,6 +23,7 @@ #include #include "Gnss.h" #include "AGnss.h" +#include namespace android { namespace hardware { @@ -30,9 +31,73 @@ namespace gnss { namespace V1_0 { namespace implementation { +sp AGnss::sAGnssCbIface = nullptr; + AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { } +void AGnss::agnssStatusIpV4Cb(IAGnssCallback::AGnssStatusIpV4 status){ + + sAGnssCbIface->agnssStatusIpV4Cb(status); +} + +Return AGnss::setCallback(const sp& callback) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return Void(); + } + + // Save the interface + sAGnssCbIface = callback; + + mGnss->getGnssInterface()->agpsInit((void*)agnssStatusIpV4Cb); + return Void(); +} + +Return AGnss::dataConnClosed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL); + return true; +} + +Return AGnss::dataConnFailed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL); + return true; +} + +Return AGnss::dataConnOpen(const hidl_string& apn, + IAGnss::ApnIpType apnIpType) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + /* Validate */ + if(apn.empty()){ + LOC_LOGE("Invalid APN"); + return false; + } + + LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str()); + + mGnss->getGnssInterface()->agpsDataConnOpen( + LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)apnIpType); + return true; +} + Return AGnss::setServer(IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) { diff --git a/android/AGnss.h b/android/AGnss.h index 54775c16..f4216b04 100644 --- a/android/AGnss.h +++ b/android/AGnss.h @@ -40,35 +40,31 @@ using ::android::sp; struct Gnss; struct AGnss : public IAGnss { + AGnss(Gnss* gnss); ~AGnss() = default; /* * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. * These declarations were generated from IAGnss.hal. */ - inline Return setCallback(const sp& /*callback*/) override { - return Void(); - } + Return setCallback(const sp& callback) override; - inline Return dataConnClosed() override { - return false; - } + Return dataConnClosed() override; - inline Return dataConnFailed() override { - return false; - } + Return dataConnFailed() override; - inline Return dataConnOpen(const hidl_string& /*apn*/, - IAGnss::ApnIpType /*apnIpType*/) override { - return false; - } + Return dataConnOpen(const hidl_string& apn, + IAGnss::ApnIpType apnIpType) override; Return setServer(IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) override; + /* Data call setup callback passed down to GNSS HAL implementation */ + static void agnssStatusIpV4Cb(IAGnssCallback::AGnssStatusIpV4 status); private: Gnss* mGnss = nullptr; + static sp sAGnssCbIface; }; } // namespace implementation diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp new file mode 100644 index 00000000..aacd9da3 --- /dev/null +++ b/gnss/Agps.cpp @@ -0,0 +1,963 @@ +/* Copyright (c) 2012-2017, 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_TAG "LocSvc_Agps" + +#include +#include +#include +#include + +/* -------------------------------------------------------------------- + * AGPS State Machine Methods + * -------------------------------------------------------------------*/ +void AgpsStateMachine::processAgpsEvent(AgpsEvent event){ + + LOC_LOGD("processAgpsEvent(): SM %p, Event %d, State %d", + this, event, mState); + + switch (event){ + + case AGPS_EVENT_SUBSCRIBE: + processAgpsEventSubscribe(); + break; + + case AGPS_EVENT_UNSUBSCRIBE: + processAgpsEventUnsubscribe(); + break; + + case AGPS_EVENT_GRANTED: + processAgpsEventGranted(); + break; + + case AGPS_EVENT_RELEASED: + processAgpsEventReleased(); + break; + + case AGPS_EVENT_DENIED: + processAgpsEventDenied(); + break; + + default: + LOC_LOGE("Invalid Loc Agps Event"); + } +} + +void AgpsStateMachine::processAgpsEventSubscribe(){ + + switch (mState){ + + case AGPS_STATE_RELEASED: + /* Add subscriber to list + * No notifications until we get RSRC_GRANTED */ + addSubscriber(mCurrentSubscriber); + + /* Send data request + * The if condition below 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(requestOrReleaseDataConn(true) == 0){ + // If data request successful, move to pending state + transitionState(AGPS_STATE_PENDING); + } + break; + + case AGPS_STATE_PENDING: + /* Already requested for data connection, + * do nothing until we get RSRC_GRANTED event; + * Just add this subscriber to the list, for notifications */ + addSubscriber(mCurrentSubscriber); + break; + + case AGPS_STATE_ACQUIRED: + /* We already have the data connection setup, + * Notify current subscriber with GRANTED event, + * And add it to the subscriber list for further notifications. */ + notifyEventToSubscriber(AGPS_EVENT_GRANTED, mCurrentSubscriber, false); + addSubscriber(mCurrentSubscriber); + break; + + case AGPS_STATE_RELEASING: + addSubscriber(mCurrentSubscriber); + break; + + default: + LOC_LOGE("Invalid state: %d", mState); + } +} + +void AgpsStateMachine::processAgpsEventUnsubscribe(){ + + switch (mState){ + + case AGPS_STATE_RELEASED: + notifyEventToSubscriber( + AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, false); + break; + + case AGPS_STATE_PENDING: + case AGPS_STATE_ACQUIRED: + /* If the subscriber wishes to wait for connection close, + * before being removed from list, move to inactive state + * and notify */ + if(mCurrentSubscriber->mWaitForCloseComplete){ + mCurrentSubscriber->mIsInactive = true; + notifyEventToSubscriber( + AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, false); + } + else{ + /* Notify only current subscriber and then delete it from + * subscriberList */ + notifyEventToSubscriber( + AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, true); + } + + /* If no subscribers in list, release data connection */ + if(mSubscriberList.empty()){ + transitionState(AGPS_STATE_RELEASED); + requestOrReleaseDataConn(false); + } + /* Some subscribers in list, but all inactive; + * Release data connection */ + else if(!anyActiveSubscribers()){ + transitionState(AGPS_STATE_RELEASING); + requestOrReleaseDataConn(false); + } + break; + + case AGPS_STATE_RELEASING: + /* If the subscriber wishes to wait for connection close, + * before being removed from list, move to inactive state + * and notify */ + if(mCurrentSubscriber->mWaitForCloseComplete){ + mCurrentSubscriber->mIsInactive = true; + notifyEventToSubscriber( + AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, false); + } + else{ + /* Notify only current subscriber and then delete it from + * subscriberList */ + notifyEventToSubscriber( + AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, true); + } + + /* If no subscribers in list, just move the state. + * Request for releasing data connection should already have been + * sent */ + if(mSubscriberList.empty()){ + transitionState(AGPS_STATE_RELEASED); + } + break; + + default: + LOC_LOGE("Invalid state: %d", mState); + } +} + +void AgpsStateMachine::processAgpsEventGranted(){ + + switch (mState){ + + case AGPS_STATE_RELEASED: + case AGPS_STATE_ACQUIRED: + case AGPS_STATE_RELEASING: + LOC_LOGE("Unexpected event GRANTED in state %d", mState); + break; + + case AGPS_STATE_PENDING: + // Move to acquired state + transitionState(AGPS_STATE_ACQUIRED); + notifyAllSubscribers( + AGPS_EVENT_GRANTED, false, + AGPS_NOTIFICATION_TYPE_FOR_ACTIVE_SUBSCRIBERS); + break; + + default: + LOC_LOGE("Invalid state: %d", mState); + } +} + +void AgpsStateMachine::processAgpsEventReleased(){ + + switch (mState){ + + case AGPS_STATE_RELEASED: + LOC_LOGE("Unexpected event RELEASED in state %d", mState); + break; + + case AGPS_STATE_ACQUIRED: + /* Force release received */ + LOC_LOGW("Force RELEASED event in ACQUIRED state"); + transitionState(AGPS_STATE_RELEASED); + notifyAllSubscribers( + AGPS_EVENT_RELEASED, true, + AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS); + break; + + case AGPS_STATE_RELEASING: + /* Notify all inactive subscribers about the event */ + notifyAllSubscribers( + AGPS_EVENT_RELEASED, true, + AGPS_NOTIFICATION_TYPE_FOR_INACTIVE_SUBSCRIBERS); + + /* If we have active subscribers now, they must be waiting for + * data conn setup */ + if(anyActiveSubscribers()){ + transitionState(AGPS_STATE_PENDING); + requestOrReleaseDataConn(true); + } + /* No active subscribers, move to released state */ + else{ + transitionState(AGPS_STATE_RELEASED); + } + break; + + case AGPS_STATE_PENDING: + /* NOOP */ + break; + + default: + LOC_LOGE("Invalid state: %d", mState); + } +} + +void AgpsStateMachine::processAgpsEventDenied(){ + + switch (mState){ + + case AGPS_STATE_RELEASED: + LOC_LOGE("Unexpected event DENIED in state %d", mState); + break; + + case AGPS_STATE_ACQUIRED: + /* NOOP */ + break; + + case AGPS_STATE_RELEASING: + /* Notify all inactive subscribers about the event */ + notifyAllSubscribers( + AGPS_EVENT_RELEASED, true, + AGPS_NOTIFICATION_TYPE_FOR_INACTIVE_SUBSCRIBERS); + + /* If we have active subscribers now, they must be waiting for + * data conn setup */ + if(anyActiveSubscribers()){ + transitionState(AGPS_STATE_PENDING); + requestOrReleaseDataConn(true); + } + /* No active subscribers, move to released state */ + else{ + transitionState(AGPS_STATE_RELEASED); + } + break; + + case AGPS_STATE_PENDING: + transitionState(AGPS_STATE_RELEASED); + notifyAllSubscribers( + AGPS_EVENT_DENIED, true, + AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS); + break; + + default: + LOC_LOGE("Invalid state: %d", mState); + } +} + +/* Request or Release data connection + * bool request : + * true = Request data connection + * false = Release data connection */ +int AgpsStateMachine::requestOrReleaseDataConn(bool request){ + + AgpsFrameworkInterface::AGnssStatusIpV4 nifRequest; + memset(&nifRequest, 0, sizeof(nifRequest)); + + nifRequest.type = (AgpsFrameworkInterface::AGnssType)mAgpsType; + + if(request){ + LOC_LOGD("AGPS Data Conn Request"); + nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) + LOC_GPS_REQUEST_AGPS_DATA_CONN; + } + else{ + LOC_LOGD("AGPS Data Conn Release"); + nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) + LOC_GPS_RELEASE_AGPS_DATA_CONN; + } + + mAgpsManager->mFrameworkStatusV4Cb(nifRequest); + return 0; +} + +void AgpsStateMachine::notifyAllSubscribers( + AgpsEvent event, bool deleteSubscriberPostNotify, + AgpsNotificationType notificationType){ + + LOC_LOGD("notifyAllSubscribers(): " + "SM %p, Event %d Delete %d Notification Type %d", + this, event, deleteSubscriberPostNotify, notificationType); + + std::list::const_iterator it = mSubscriberList.begin(); + while ( it != mSubscriberList.end() ){ + + AgpsSubscriber* subscriber = *it; + + if(notificationType == AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS || + (notificationType == AGPS_NOTIFICATION_TYPE_FOR_INACTIVE_SUBSCRIBERS && + subscriber->mIsInactive) || + (notificationType == AGPS_NOTIFICATION_TYPE_FOR_ACTIVE_SUBSCRIBERS && + !subscriber->mIsInactive)) { + + /* Deleting via this call would require another traversal + * through subscriber list, inefficient; hence pass in false*/ + notifyEventToSubscriber(event, subscriber, false); + + if(deleteSubscriberPostNotify){ + it = mSubscriberList.erase(it); + delete subscriber; + } else{ + it++; + } + } else{ + it++; + } + } +} + +void AgpsStateMachine::notifyEventToSubscriber( + AgpsEvent event, AgpsSubscriber* subscriberToNotify, + bool deleteSubscriberPostNotify) { + + LOC_LOGD("notifyEventToSubscriber(): " + "SM %p, Event %d Subscriber %p Delete %d", + this, event, subscriberToNotify, deleteSubscriberPostNotify); + + switch (event){ + + case AGPS_EVENT_GRANTED: + mAgpsManager->mAtlOpenStatusCb( + subscriberToNotify->mConnHandle, 1, getAPN(), + getBearer(), mAgpsType); + break; + + case AGPS_EVENT_DENIED: + mAgpsManager->mAtlOpenStatusCb( + subscriberToNotify->mConnHandle, 0, getAPN(), + getBearer(), mAgpsType); + break; + + case AGPS_EVENT_UNSUBSCRIBE: + case AGPS_EVENT_RELEASED: + mAgpsManager->mAtlCloseStatusCb(subscriberToNotify->mConnHandle, 1); + break; + + default: + LOC_LOGE("Invalid event %d", event); + } + + /* Search this subscriber in list and delete */ + if (deleteSubscriberPostNotify) { + deleteSubscriber(subscriberToNotify); + } +} + +void AgpsStateMachine::transitionState(AgpsState newState){ + + LOC_LOGD("transitionState(): SM %p, old %d, new %d", + this, mState, newState); + + mState = newState; + + // notify state transitions to all subscribers ? +} + +void AgpsStateMachine::addSubscriber(AgpsSubscriber* subscriberToAdd){ + + LOC_LOGD("addSubscriber(): SM %p, Subscriber %p", + this, subscriberToAdd); + + // Check if subscriber is already present in the current list + // If not, then add + std::list::const_iterator it = mSubscriberList.begin(); + for(; it != mSubscriberList.end(); it++){ + AgpsSubscriber* subscriber = *it; + if(subscriber->equals(subscriberToAdd)){ + LOC_LOGE("Subscriber already in list"); + return; + } + } + + AgpsSubscriber* cloned = subscriberToAdd->clone(); + LOC_LOGD("addSubscriber(): cloned subscriber: %p", cloned); + mSubscriberList.push_back(cloned); +} + +void AgpsStateMachine::deleteSubscriber(AgpsSubscriber* subscriberToDelete){ + + LOC_LOGD("deleteSubscriber(): SM %p, Subscriber %p", + this, subscriberToDelete); + + std::list::const_iterator it = mSubscriberList.begin(); + while ( it != mSubscriberList.end() ) { + + AgpsSubscriber* subscriber = *it; + if(subscriber && subscriber->equals(subscriberToDelete)){ + + it = mSubscriberList.erase(it); + delete subscriber; + }else{ + it++; + } + } +} + +bool AgpsStateMachine::anyActiveSubscribers(){ + + std::list::const_iterator it = mSubscriberList.begin(); + for(; it != mSubscriberList.end(); it++){ + AgpsSubscriber* subscriber = *it; + if(!subscriber->mIsInactive){ + return true; + } + } + return false; +} + +void AgpsStateMachine::setAPN(char* apn, unsigned int len){ + + if (NULL != mAPN) { + delete mAPN; + } + + if(apn == NULL || len <= 0){ + LOC_LOGD("Invalid apn len (%d) or null apn", len); + mAPN = NULL; + mAPNLen = 0; + } + + if (NULL != apn) { + mAPN = new char[len+1]; + memcpy(mAPN, apn, len); + mAPN[len] = '\0'; + mAPNLen = len; + } +} + +AgpsSubscriber* AgpsStateMachine::getSubscriber(int connHandle){ + + /* Go over the subscriber list */ + std::list::const_iterator it = mSubscriberList.begin(); + for(; it != mSubscriberList.end(); it++){ + AgpsSubscriber* subscriber = *it; + if(subscriber->mConnHandle == connHandle){ + return subscriber; + } + } + + /* Not found, return NULL */ + return NULL; +} + +AgpsSubscriber* AgpsStateMachine::getFirstSubscriber(bool isInactive){ + + /* Go over the subscriber list */ + std::list::const_iterator it = mSubscriberList.begin(); + for(; it != mSubscriberList.end(); it++){ + AgpsSubscriber* subscriber = *it; + if(subscriber->mIsInactive == isInactive){ + return subscriber; + } + } + + /* Not found, return NULL */ + return NULL; +} + +void AgpsStateMachine::dropAllSubscribers(){ + + LOC_LOGD("dropAllSubscribers(): SM %p", this); + + /* Go over the subscriber list */ + std::list::const_iterator it = mSubscriberList.begin(); + while ( it != mSubscriberList.end() ){ + AgpsSubscriber* subscriber = *it; + it = mSubscriberList.erase(it); + delete subscriber; + } +} + +/* -------------------------------------------------------------------- + * DS State Machine Methods + * -------------------------------------------------------------------*/ +const int DSStateMachine::MAX_START_DATA_CALL_RETRIES = 4; +const int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500; + +/* Overridden method + * DS SM needs to handle one scenario differently */ +void DSStateMachine::processAgpsEvent(AgpsEvent event){ + + LOC_LOGD("DSStateMachine::processAgpsEvent() %d", event); + + /* DS Client call setup APIs don't return failure/closure separately. + * Hence we receive RELEASED event in both cases. + * If we are in pending, we should consider RELEASED as DENIED */ + if(event == AGPS_EVENT_RELEASED && mState == AGPS_STATE_PENDING){ + + LOC_LOGD("Translating RELEASED to DENIED event"); + event = AGPS_EVENT_DENIED; + } + + /* Redirect process to base class */ + AgpsStateMachine::processAgpsEvent(event); +} + +/* Timer Callback + * For the retry timer started in case of DS Client call setup failure */ +void delay_callback(void *callbackData, int result) +{ + LOC_LOGD("delay_callback(): cbData %p", callbackData); + + (void)result; + + if(callbackData == NULL) { + LOC_LOGE("delay_callback(): NULL argument received !"); + return; + } + DSStateMachine* dsStateMachine = (DSStateMachine *)callbackData; + dsStateMachine->retryCallback(); +} + +/* Invoked from Timer Callback + * For the retry timer started in case of DS Client call setup failure */ +void DSStateMachine :: retryCallback() +{ + LOC_LOGD("DSStateMachine::retryCallback()"); + + /* Request SUPL ES + * There must be at least one active subscriber in list */ + AgpsSubscriber* subscriber = getFirstSubscriber(false); + if(subscriber == NULL) { + + LOC_LOGE("No active subscriber for DS Client call setup"); + return; + } + + /* Send message to retry */ + mAgpsManager->mSendMsgToAdapterQueueFn( + new AgpsMsgRequestATL( + mAgpsManager, subscriber->mConnHandle, + LOC_AGPS_TYPE_SUPL_ES)); +} + +/* Overridden method + * Request or Release data connection + * bool request : + * true = Request data connection + * false = Release data connection */ +int DSStateMachine::requestOrReleaseDataConn(bool request){ + + LOC_LOGD("DSStateMachine::requestOrReleaseDataConn(): " + "request %d", request); + + /* Release data connection required ? */ + if(!request && mAgpsManager->mDSClientStopDataCallFn){ + + mAgpsManager->mDSClientStopDataCallFn(); + LOC_LOGD("DS Client release data call request sent !"); + return 0; + } + + /* Setup data connection request + * There must be at least one active subscriber in list */ + AgpsSubscriber* subscriber = getFirstSubscriber(false); + if(subscriber == NULL) { + + LOC_LOGE("No active subscriber for DS Client call setup"); + return -1; + } + + /* DS Client Fn registered ? */ + if(!mAgpsManager->mDSClientOpenAndStartDataCallFn){ + + LOC_LOGE("DS Client start fn not registered, fallback to SUPL ATL"); + notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); + return -1; + } + + /* Setup the call */ + int ret = mAgpsManager->mDSClientOpenAndStartDataCallFn(); + + /* Check if data call start failed */ + switch (ret) { + + case LOC_API_ADAPTER_ERR_ENGINE_BUSY: + LOC_LOGE("DS Client open call failed, err: %d", ret); + mRetries++; + if(mRetries > MAX_START_DATA_CALL_RETRIES) { + + LOC_LOGE("DS Client call retries exhausted, " + "falling back to normal SUPL ATL"); + notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); + } + /* Retry DS Client call setup after some delay */ + else if(loc_timer_start( + DATA_CALL_RETRY_DELAY_MSEC, delay_callback, this)) { + LOC_LOGE("Error: Could not start delay thread\n"); + return -1; + } + break; + + case LOC_API_ADAPTER_ERR_UNSUPPORTED: + LOC_LOGE("No emergency profile found. Fall back to normal SUPL ATL"); + notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); + break; + + case LOC_API_ADAPTER_ERR_SUCCESS: + LOC_LOGD("Request to start data call sent"); + break; + + default: + LOC_LOGE("Unrecognized return value: %d", ret); + } + + return ret; +} + +void DSStateMachine::notifyEventToSubscriber( + AgpsEvent event, AgpsSubscriber* subscriberToNotify, + bool deleteSubscriberPostNotify) { + + LOC_LOGD("DSStateMachine::notifyEventToSubscriber"); + + switch (event){ + + case AGPS_EVENT_GRANTED: + mAgpsManager->mAtlOpenStatusCb( + subscriberToNotify->mConnHandle, 1, NULL, + AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES); + break; + + case AGPS_EVENT_DENIED: + /* Now try with regular SUPL + * We need to send request via message queue */ + mRetries = 0; + mAgpsManager->mSendMsgToAdapterQueueFn( + new AgpsMsgRequestATL( + mAgpsManager, subscriberToNotify->mConnHandle, + LOC_AGPS_TYPE_SUPL)); + break; + + case AGPS_EVENT_UNSUBSCRIBE: + mAgpsManager->mAtlCloseStatusCb(subscriberToNotify->mConnHandle, 1); + break; + + case AGPS_EVENT_RELEASED: + mAgpsManager->mDSClientCloseDataCallFn(); + break; + + default: + LOC_LOGE("Invalid event %d", event); + } + + /* Search this subscriber in list and delete */ + if (deleteSubscriberPostNotify) { + deleteSubscriber(subscriberToNotify); + } +} + +/* -------------------------------------------------------------------- + * Loc AGPS Manager Methods + * -------------------------------------------------------------------*/ + +/* CREATE AGPS STATE MACHINES + * Must be invoked in Msg Handler context */ +void AgpsManager::createAgpsStateMachines() { + + LOC_LOGD("AgpsManager::createAgpsStateMachines"); + + bool agpsCapable = + ((loc_core::ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA) || + (loc_core::ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB)); + + if (NULL == mInternetNif) { + mInternetNif = new AgpsStateMachine(this, LOC_AGPS_TYPE_WWAN_ANY); + LOC_LOGD("Internet NIF: %p", mInternetNif); + } + if (agpsCapable) { + if (NULL == mAgnssNif) { + mAgnssNif = new AgpsStateMachine(this, LOC_AGPS_TYPE_SUPL); + LOC_LOGD("AGNSS NIF: %p", mAgnssNif); + } + if (NULL == mDsNif && + loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL){ + + if(!mDSClientInitFn){ + + LOC_LOGE("DS Client Init Fn not registered !"); + return; + } + if(mDSClientInitFn(false) != 0){ + + LOC_LOGE("Failed to init data service client"); + return; + } + mDsNif = new DSStateMachine(this); + LOC_LOGD("DS NIF: %p", mDsNif); + } + } +} + +AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { + + LOC_LOGD("AgpsManager::getAgpsStateMachine(): agpsType %d", agpsType); + + switch (agpsType) { + + case LOC_AGPS_TYPE_INVALID: + case LOC_AGPS_TYPE_SUPL: + if(mAgnssNif == NULL){ + LOC_LOGE("NULL AGNSS NIF !"); + } + return mAgnssNif; + + case LOC_AGPS_TYPE_SUPL_ES: + if (loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + if (mDsNif == NULL) { + createAgpsStateMachines(); + } + return mDsNif; + } else { + return mAgnssNif; + } + + default: + return mInternetNif; + } + + LOC_LOGE("No SM found !"); + return NULL; +} + +void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ + + LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d", + connHandle, agpsType); + + AgpsStateMachine* sm = getAgpsStateMachine(agpsType); + + if(sm == NULL){ + + LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); + mAtlOpenStatusCb( + connHandle, 0, NULL, AGPS_APN_BEARER_INVALID, agpsType); + return; + } + + /* Invoke AGPS SM processing */ + AgpsSubscriber subscriber(connHandle); + sm->setCurrentSubscriber(&subscriber); + + /* If DS State Machine, wait for close complete */ + if(agpsType == LOC_AGPS_TYPE_SUPL_ES){ + subscriber.mWaitForCloseComplete = true; + } + + /* Send subscriber event */ + sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE); +} + +void AgpsManager::releaseATL(int connHandle){ + + LOC_LOGD("AgpsManager::releaseATL(): connHandle %d", connHandle); + + /* First find the subscriber with specified handle. + * We need to search in all state machines. */ + AgpsStateMachine* sm = NULL; + AgpsSubscriber* subscriber = NULL; + + if (mAgnssNif && + (subscriber = mAgnssNif->getSubscriber(connHandle)) != NULL) { + sm = mAgnssNif; + } + else if (mInternetNif && + (subscriber = mInternetNif->getSubscriber(connHandle)) != NULL) { + sm = mInternetNif; + } + else if (mDsNif && + (subscriber = mDsNif->getSubscriber(connHandle)) != NULL) { + sm = mDsNif; + } + + if(sm == NULL){ + LOC_LOGE("Subscriber with connHandle %d not found in any SM", + connHandle); + mAtlCloseStatusCb(connHandle, 0); + return; + } + + /* Now send unsubscribe event */ + sm->setCurrentSubscriber(subscriber); + sm->processAgpsEvent(AGPS_EVENT_UNSUBSCRIBE); +} + +void AgpsManager::reportDataCallOpened(){ + + LOC_LOGD("AgpsManager::reportDataCallOpened"); + + if (mDsNif) { + mDsNif->processAgpsEvent(AGPS_EVENT_GRANTED); + } +} + +void AgpsManager::reportDataCallClosed(){ + + LOC_LOGD("AgpsManager::reportDataCallClosed"); + + if (mDsNif) { + mDsNif->processAgpsEvent(AGPS_EVENT_RELEASED); + } +} + +void AgpsManager::reportAtlOpenSuccess( + AGpsExtType agpsType, char* apnName, int apnLen, + LocApnIpType ipType){ + + LOC_LOGD("AgpsManager::reportAtlOpenSuccess(): " + "AgpsType %d, APN [%s], Len %d, IPType %d", + agpsType, apnName, apnLen, ipType); + + /* Find the state machine instance */ + AgpsStateMachine* sm = getAgpsStateMachine(agpsType); + + /* Convert LocApnIpType sent by framework to AGpsBearerType */ + AGpsBearerType bearerType; + switch (ipType) { + case LOC_APN_IP_IPV4: + bearerType = AGPS_APN_BEARER_IPV4; + break; + case LOC_APN_IP_IPV6: + bearerType = AGPS_APN_BEARER_IPV6; + break; + case LOC_APN_IP_IPV4V6: + bearerType = AGPS_APN_BEARER_IPV4V6; + break; + default: + bearerType = AGPS_APN_BEARER_IPV4; + break; + } + + /* Set bearer and apn info in state machine instance */ + sm->setBearer(bearerType); + sm->setAPN(apnName, apnLen); + + /* Send GRANTED event to state machine */ + sm->processAgpsEvent(AGPS_EVENT_GRANTED); +} + +void AgpsManager::reportAtlOpenFailed(AGpsExtType agpsType){ + + LOC_LOGD("AgpsManager::reportAtlOpenFailed(): AgpsType %d", agpsType); + + /* Fetch SM and send DENIED event */ + AgpsStateMachine* sm = getAgpsStateMachine(agpsType); + sm->processAgpsEvent(AGPS_EVENT_DENIED); +} + +void AgpsManager::reportAtlClosed(AGpsExtType agpsType){ + + LOC_LOGD("AgpsManager::reportAtlClosed(): AgpsType %d", agpsType); + + /* Fetch SM and send RELEASED event */ + AgpsStateMachine* sm = getAgpsStateMachine(agpsType); + sm->processAgpsEvent(AGPS_EVENT_RELEASED); +} + +void AgpsManager::handleModemSSR(){ + + LOC_LOGD("AgpsManager::handleModemSSR"); + + /* Drop subscribers from all state machines */ + if (mAgnssNif){ + mAgnssNif->dropAllSubscribers(); + } + if (mInternetNif){ + mInternetNif->dropAllSubscribers(); + } + if(mDsNif){ + mDsNif->dropAllSubscribers(); + } + + // reinitialize DS client in SSR mode + if(loc_core::ContextBase::mGps_conf. + USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL){ + + mDSClientStopDataCallFn(); + mDSClientCloseDataCallFn(); + mDSClientReleaseFn(); + + mDSClientInitFn(true); + } +} + +AGpsBearerType AgpsUtils::ipTypeToBearerType(LocApnIpType ipType) { + + switch (ipType) { + + case LOC_APN_IP_IPV4: + return AGPS_APN_BEARER_IPV4; + + case LOC_APN_IP_IPV6: + return AGPS_APN_BEARER_IPV6; + + case LOC_APN_IP_IPV4V6: + return AGPS_APN_BEARER_IPV4V6; + + default: + return AGPS_APN_BEARER_IPV4; + } +} + +LocApnIpType AgpsUtils::bearerTypeToIpType(AGpsBearerType bearerType){ + + switch (bearerType) { + + case AGPS_APN_BEARER_IPV4: + return LOC_APN_IP_IPV4; + + case AGPS_APN_BEARER_IPV6: + return LOC_APN_IP_IPV6; + + case AGPS_APN_BEARER_IPV4V6: + return LOC_APN_IP_IPV4V6; + + default: + return LOC_APN_IP_IPV4; + } +} diff --git a/gnss/Agps.h b/gnss/Agps.h new file mode 100644 index 00000000..1e95a42c --- /dev/null +++ b/gnss/Agps.h @@ -0,0 +1,446 @@ +/* Copyright (c) 2012-2017, 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 AGPS_H +#define AGPS_H + +#include +#include +#include +#include +#include + +/* ATL callback function pointers + * Passed in by Adapter to AgpsManager */ +typedef std::function AgpsAtlOpenStatusCb; + +typedef std::function AgpsAtlCloseStatusCb; + +/* DS Client control APIs + * Passed in by Adapter to AgpsManager */ +typedef std::function AgpsDSClientInitFn; +typedef std::function AgpsDSClientOpenAndStartDataCallFn; +typedef std::function AgpsDSClientStopDataCallFn; +typedef std::function AgpsDSClientCloseDataCallFn; +typedef std::function AgpsDSClientReleaseFn; + +/* Post message to adapter's message queue */ +typedef std::function SendMsgToAdapterMsgQueueFn; + +/* AGPS States */ +typedef enum { + AGPS_STATE_INVALID = 0, + AGPS_STATE_RELEASED, + AGPS_STATE_PENDING, + AGPS_STATE_ACQUIRED, + AGPS_STATE_RELEASING +} AgpsState; + +typedef enum { + AGPS_EVENT_INVALID = 0, + AGPS_EVENT_SUBSCRIBE, + AGPS_EVENT_UNSUBSCRIBE, + AGPS_EVENT_GRANTED, + AGPS_EVENT_RELEASED, + AGPS_EVENT_DENIED +} AgpsEvent; + +/* Notification Types sent to subscribers */ +typedef enum { + AGPS_NOTIFICATION_TYPE_INVALID = 0, + + /* Meant for all subscribers, either active or inactive */ + AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS, + + /* Meant for only inactive subscribers */ + AGPS_NOTIFICATION_TYPE_FOR_INACTIVE_SUBSCRIBERS, + + /* Meant for only active subscribers */ + AGPS_NOTIFICATION_TYPE_FOR_ACTIVE_SUBSCRIBERS +} AgpsNotificationType; + +/* Framework AGNSS interface + * This interface is defined in IAGnssCallback provided by + * Android Framework. + * Must be kept in sync with that interface. */ +namespace AgpsFrameworkInterface { + + /** AGNSS type **/ + enum AGnssType : uint8_t { + TYPE_SUPL = 1, + TYPE_C2K = 2 + }; + + enum AGnssStatusValue : uint8_t { + /** GNSS requests data connection for AGNSS. */ + REQUEST_AGNSS_DATA_CONN = 1, + /** GNSS releases the AGNSS data connection. */ + RELEASE_AGNSS_DATA_CONN = 2, + /** AGNSS data connection initiated */ + AGNSS_DATA_CONNECTED = 3, + /** AGNSS data connection completed */ + AGNSS_DATA_CONN_DONE = 4, + /** AGNSS data connection failed */ + AGNSS_DATA_CONN_FAILED = 5 + }; + + /* + * Represents the status of AGNSS augmented to support IPv4. + */ + struct AGnssStatusIpV4 { + AGnssType type; + AGnssStatusValue status; + /* + * 32-bit IPv4 address. + */ + unsigned int ipV4Addr; + }; + + /* + * Represents the status of AGNSS augmented to support IPv6. + */ + struct AGnssStatusIpV6 { + AGnssType type; + AGnssStatusValue status; + /* + * 128-bit IPv6 address. + */ + unsigned char ipV6Addr[16]; + }; + + /* + * Callback with AGNSS(IpV4) status information. + * + * @param status Will be of type AGnssStatusIpV4. + */ + typedef void (*AgnssStatusIpV4Cb)(AGnssStatusIpV4 status); + + /* + * Callback with AGNSS(IpV6) status information. + * + * @param status Will be of type AGnssStatusIpV6. + */ + typedef void (*AgnssStatusIpV6Cb)(AGnssStatusIpV6 status); +} + +/* Classes in this header */ +class AgpsSubscriber; +class AgpsManager; +class AgpsStateMachine; +class DSStateMachine; + + +/* SUBSCRIBER + * Each Subscriber instance corresponds to one AGPS request, + * received by the AGPS state machine */ +class AgpsSubscriber { + +public: + int mConnHandle; + + /* Does this subscriber wait for data call close complete, + * before being notified ATL close ? + * While waiting for data call close, subscriber will be in + * inactive state. */ + bool mWaitForCloseComplete; + bool mIsInactive; + + inline AgpsSubscriber(int connHandle) : + mConnHandle(connHandle), mWaitForCloseComplete(false), + mIsInactive(false) {} + inline virtual ~AgpsSubscriber() {} + + inline virtual bool equals(const AgpsSubscriber *s) const + { return (mConnHandle == s->mConnHandle); } + + inline virtual AgpsSubscriber* clone() + { return new AgpsSubscriber(mConnHandle); } +}; + +/* AGPS STATE MACHINE */ +class AgpsStateMachine { +protected: + /* AGPS Manager instance, from where this state machine is created */ + AgpsManager* mAgpsManager; + + /* List of all subscribers for this State Machine. + * Once a subscriber is notified for ATL open/close status, + * it is deleted */ + std::list mSubscriberList; + + /* Current subscriber, whose request this State Machine is + * currently processing */ + AgpsSubscriber* mCurrentSubscriber; + + /* Current state for this state machine */ + AgpsState mState; + +private: + /* AGPS Type for this state machine + LOC_AGPS_TYPE_ANY 0 + LOC_AGPS_TYPE_SUPL 1 + LOC_AGPS_TYPE_WWAN_ANY 3 + LOC_AGPS_TYPE_SUPL_ES 5 */ + AGpsExtType mAgpsType; + + /* APN and IP Type info for AGPS Call */ + char* mAPN; + unsigned int mAPNLen; + AGpsBearerType mBearer; + +public: + /* CONSTRUCTOR */ + AgpsStateMachine(AgpsManager* agpsManager, AGpsExtType agpsType): + mAgpsManager(agpsManager), mSubscriberList(), + mCurrentSubscriber(NULL), mState(AGPS_STATE_RELEASED), + mAgpsType(agpsType), mAPN(NULL), mAPNLen(0), + mBearer(AGPS_APN_BEARER_INVALID) {}; + + virtual ~AgpsStateMachine() { if(NULL != mAPN) delete[] mAPN; }; + + /* Getter/Setter methods */ + void setAPN(char* apn, unsigned int len); + inline char* getAPN() const { return (char*)mAPN; } + inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline AGpsBearerType getBearer() const { return mBearer; } + inline AGpsExtType getType() const { return mAgpsType; } + inline void setCurrentSubscriber(AgpsSubscriber* subscriber) + { mCurrentSubscriber = subscriber; } + + /* Fetch subscriber with specified handle */ + AgpsSubscriber* getSubscriber(int connHandle); + + /* Fetch first active or inactive subscriber in list + * isInactive = true : fetch first inactive subscriber + * isInactive = false : fetch first active subscriber */ + AgpsSubscriber* getFirstSubscriber(bool isInactive); + + /* Process LOC AGPS Event being passed in + * onRsrcEvent */ + virtual void processAgpsEvent(AgpsEvent event); + + /* Drop all subscribers, in case of Modem SSR */ + void dropAllSubscribers(); + +protected: + /* Remove the specified subscriber from list if present. + * Also delete the subscriber instance. */ + void deleteSubscriber(AgpsSubscriber* subscriber); + +private: + /* Send call setup request to framework + * sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN) + * sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN) */ + virtual int requestOrReleaseDataConn(bool request); + + /* Individual event processing methods */ + void processAgpsEventSubscribe(); + void processAgpsEventUnsubscribe(); + void processAgpsEventGranted(); + void processAgpsEventReleased(); + void processAgpsEventDenied(); + + /* Clone the passed in subscriber and add to the subscriber list + * if not already present */ + void addSubscriber(AgpsSubscriber* subscriber); + + /* Notify subscribers about AGPS events */ + void notifyAllSubscribers( + AgpsEvent event, bool deleteSubscriberPostNotify, + AgpsNotificationType notificationType); + virtual void notifyEventToSubscriber( + AgpsEvent event, AgpsSubscriber* subscriber, + bool deleteSubscriberPostNotify); + + /* Do we have any subscribers in active state */ + bool anyActiveSubscribers(); + + /* Transition state */ + void transitionState(AgpsState newState); +}; + +/* DS STATE MACHINE */ +class DSStateMachine : public AgpsStateMachine { + +private: + static const int MAX_START_DATA_CALL_RETRIES; + static const int DATA_CALL_RETRY_DELAY_MSEC; + + int mRetries; + +public: + /* CONSTRUCTOR */ + DSStateMachine(AgpsManager* agpsManager): + AgpsStateMachine(agpsManager, LOC_AGPS_TYPE_SUPL_ES), mRetries(0) {} + + /* Overridden method + * DS SM needs to handle one event differently */ + void processAgpsEvent(AgpsEvent event); + + /* Retry callback, used in case call failure */ + void retryCallback(); + +private: + /* Overridden method, different functionality for DS SM + * Send call setup request to framework + * sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN) + * sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN) */ + int requestOrReleaseDataConn(bool request); + + /* Overridden method, different functionality for DS SM */ + void notifyEventToSubscriber( + AgpsEvent event, AgpsSubscriber* subscriber, + bool deleteSubscriberPostNotify); +}; + +/* LOC AGPS MANAGER */ +class AgpsManager { + + friend class AgpsStateMachine; + friend class DSStateMachine; + +public: + /* CONSTRUCTOR */ + AgpsManager(): + mFrameworkStatusV4Cb(NULL), + mAtlOpenStatusCb(), mAtlCloseStatusCb(), + mDSClientInitFn(), mDSClientOpenAndStartDataCallFn(), + mDSClientStopDataCallFn(), mDSClientCloseDataCallFn(), mDSClientReleaseFn(), + mSendMsgToAdapterQueueFn(), + mAgnssNif(NULL), mInternetNif(NULL), mDsNif(NULL) {} + + /* Register callbacks */ + void registerCallbacks( + AgpsFrameworkInterface::AgnssStatusIpV4Cb + frameworkStatusV4Cb, + + AgpsAtlOpenStatusCb atlOpenStatusCb, + AgpsAtlCloseStatusCb atlCloseStatusCb, + + AgpsDSClientInitFn dsClientInitFn, + AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn, + AgpsDSClientStopDataCallFn dsClientStopDataCallFn, + AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, + AgpsDSClientReleaseFn dsClientReleaseFn, + + SendMsgToAdapterMsgQueueFn sendMsgToAdapterQueueFn ){ + + mFrameworkStatusV4Cb = frameworkStatusV4Cb; + + mAtlOpenStatusCb = atlOpenStatusCb; + mAtlCloseStatusCb = atlCloseStatusCb; + + mDSClientInitFn = dsClientInitFn; + mDSClientOpenAndStartDataCallFn = dsClientOpenAndStartDataCallFn; + mDSClientStopDataCallFn = dsClientStopDataCallFn; + mDSClientCloseDataCallFn = dsClientCloseDataCallFn; + mDSClientReleaseFn = dsClientReleaseFn; + + mSendMsgToAdapterQueueFn = sendMsgToAdapterQueueFn; + } + + /* Create all AGPS state machines */ + void createAgpsStateMachines(); + + /* Process incoming ATL requests */ + void requestATL(int connHandle, AGpsExtType agpsType); + void releaseATL(int connHandle); + + /* Process incoming DS Client data call events */ + void reportDataCallOpened(); + void reportDataCallClosed(); + + /* Process incoming framework data call events */ + void reportAtlOpenSuccess( + AGpsExtType agpsType, char* apnName, int apnLen, + LocApnIpType ipType); + void reportAtlOpenFailed(AGpsExtType agpsType); + void reportAtlClosed(AGpsExtType agpsType); + + /* Handle Modem SSR */ + void handleModemSSR(); + +protected: + AgpsFrameworkInterface::AgnssStatusIpV4Cb mFrameworkStatusV4Cb; + + AgpsAtlOpenStatusCb mAtlOpenStatusCb; + AgpsAtlCloseStatusCb mAtlCloseStatusCb; + + AgpsDSClientInitFn mDSClientInitFn; + AgpsDSClientOpenAndStartDataCallFn mDSClientOpenAndStartDataCallFn; + AgpsDSClientStopDataCallFn mDSClientStopDataCallFn; + AgpsDSClientCloseDataCallFn mDSClientCloseDataCallFn; + AgpsDSClientReleaseFn mDSClientReleaseFn; + + SendMsgToAdapterMsgQueueFn mSendMsgToAdapterQueueFn; + + AgpsStateMachine* mAgnssNif; + AgpsStateMachine* mInternetNif; + AgpsStateMachine* mDsNif; + +private: + /* Fetch state machine for handling request ATL call */ + AgpsStateMachine* getAgpsStateMachine(AGpsExtType agpsType); +}; + +/* Request SUPL/INTERNET/SUPL_ES ATL + * This LocMsg is defined in this header since it has to be used from more + * than one place, other Agps LocMsg are restricted to GnssAdapter and + * declared inline */ +struct AgpsMsgRequestATL: public LocMsg { + + AgpsManager* mAgpsManager; + int mConnHandle; + AGpsExtType mAgpsType; + + inline AgpsMsgRequestATL(AgpsManager* agpsManager, int connHandle, + AGpsExtType agpsType) : + LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle), mAgpsType( + agpsType) { + + LOC_LOGV("AgpsMsgRequestATL"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgRequestATL::proc()"); + mAgpsManager->requestATL(mConnHandle, mAgpsType); + } +}; + +namespace AgpsUtils { + +AGpsBearerType ipTypeToBearerType(LocApnIpType ipType); +LocApnIpType bearerTypeToIpType(AGpsBearerType bearerType); + +} + +#endif /* AGPS_H */ diff --git a/gnss/Android.mk b/gnss/Android.mk index 16d796cc..1f0a549d 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -20,7 +20,8 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_SRC_FILES += \ location_gnss.cpp \ - GnssAdapter.cpp + GnssAdapter.cpp \ + Agps.cpp LOCAL_CFLAGS += \ -fno-short-enums \ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 1ddb41dc..3a6ae550 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -39,6 +39,7 @@ #include #include #include +#include using namespace loc_core; @@ -55,7 +56,8 @@ GnssAdapter::GnssAdapter() : mGnssSvIdUsedInPosAvail(false), mControlCallbacks(), mPowerVoteId(0), - mNiData() + mNiData(), + mAgpsManager() { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -2878,3 +2880,334 @@ GnssAdapter::generateNmeaGGA(const UlpLocation& ulpLocation, length = nmeaPutChecksum(sentence, size); reportNmeaEvent(sentence, length); } + +/* INIT LOC AGPS MANAGER */ +void GnssAdapter::initAgpsCommand(void* statusV4Cb){ + + LOC_LOGI("GnssAdapter::initAgpsCommand"); + + /* Set ATL open/close callbacks */ + AgpsAtlOpenStatusCb atlOpenStatusCb = + [this](int handle, int isSuccess, char* apn, + AGpsBearerType bearerType, AGpsExtType agpsType) { + + mLocApi->atlOpenStatus( + handle, isSuccess, apn, bearerType, agpsType); + }; + AgpsAtlCloseStatusCb atlCloseStatusCb = + [this](int handle, int isSuccess) { + + mLocApi->atlCloseStatus(handle, isSuccess); + }; + + /* Register DS Client APIs */ + AgpsDSClientInitFn dsClientInitFn = + [this](bool isDueToSSR) { + + return mLocApi->initDataServiceClient(isDueToSSR); + }; + + AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn = + [this] { + + return mLocApi->openAndStartDataCall(); + }; + + AgpsDSClientStopDataCallFn dsClientStopDataCallFn = + [this] { + + mLocApi->stopDataCall(); + }; + + AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn = + [this] { + + mLocApi->closeDataCall(); + }; + + AgpsDSClientReleaseFn dsClientReleaseFn = + [this] { + + mLocApi->releaseDataServiceClient(); + }; + + /* Send Msg function */ + SendMsgToAdapterMsgQueueFn sendMsgFn = + [this](LocMsg* msg) { + + sendMsg(msg); + }; + + /* Message to initialize AGPS module */ + struct AgpsMsgInit: public LocMsg { + + AgpsManager* mAgpsManager; + + AgpsFrameworkInterface::AgnssStatusIpV4Cb mFrameworkStatusV4Cb; + + AgpsAtlOpenStatusCb mAtlOpenStatusCb; + AgpsAtlCloseStatusCb mAtlCloseStatusCb; + + AgpsDSClientInitFn mDSClientInitFn; + AgpsDSClientOpenAndStartDataCallFn mDSClientOpenAndStartDataCallFn; + AgpsDSClientStopDataCallFn mDSClientStopDataCallFn; + AgpsDSClientCloseDataCallFn mDSClientCloseDataCallFn; + AgpsDSClientReleaseFn mDSClientReleaseFn; + + SendMsgToAdapterMsgQueueFn mSendMsgFn; + + inline AgpsMsgInit(AgpsManager* agpsManager, + AgpsFrameworkInterface::AgnssStatusIpV4Cb frameworkStatusV4Cb, + AgpsAtlOpenStatusCb atlOpenStatusCb, + AgpsAtlCloseStatusCb atlCloseStatusCb, + AgpsDSClientInitFn dsClientInitFn, + AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn, + AgpsDSClientStopDataCallFn dsClientStopDataCallFn, + AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, + AgpsDSClientReleaseFn dsClientReleaseFn, + SendMsgToAdapterMsgQueueFn sendMsgFn) : + LocMsg(), mAgpsManager(agpsManager), mFrameworkStatusV4Cb( + frameworkStatusV4Cb), mAtlOpenStatusCb(atlOpenStatusCb), mAtlCloseStatusCb( + atlCloseStatusCb), mDSClientInitFn(dsClientInitFn), mDSClientOpenAndStartDataCallFn( + dsClientOpenAndStartDataCallFn), mDSClientStopDataCallFn( + dsClientStopDataCallFn), mDSClientCloseDataCallFn( + dsClientCloseDataCallFn), mDSClientReleaseFn( + dsClientReleaseFn), mSendMsgFn(sendMsgFn) { + + LOC_LOGV("AgpsMsgInit"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgInit::proc()"); + + mAgpsManager->registerCallbacks(mFrameworkStatusV4Cb, mAtlOpenStatusCb, + mAtlCloseStatusCb, mDSClientInitFn, + mDSClientOpenAndStartDataCallFn, mDSClientStopDataCallFn, + mDSClientCloseDataCallFn, mDSClientReleaseFn, mSendMsgFn); + + mAgpsManager->createAgpsStateMachines(); + } + }; + + /* Send message to initialize AGPS Manager */ + sendMsg(new AgpsMsgInit( + &mAgpsManager, + (AgpsFrameworkInterface::AgnssStatusIpV4Cb)statusV4Cb, + atlOpenStatusCb, atlCloseStatusCb, + dsClientInitFn, dsClientOpenAndStartDataCallFn, + dsClientStopDataCallFn, dsClientCloseDataCallFn, + dsClientReleaseFn, + sendMsgFn)); +} + +/* GnssAdapter::requestATL + * Method triggered in QMI thread as part of handling below message: + * eQMI_LOC_SERVER_REQUEST_OPEN_V02 + * Triggers the AGPS state machine to setup AGPS call for below WWAN types: + * eQMI_LOC_WWAN_TYPE_INTERNET_V02 + * eQMI_LOC_WWAN_TYPE_AGNSS_V02 */ +bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType){ + + LOC_LOGI("GnssAdapter::requestATL"); + + sendMsg( new AgpsMsgRequestATL( + &mAgpsManager, connHandle, (AGpsExtType)agpsType)); + + return true; +} + +/* GnssAdapter::requestSuplES + * Method triggered in QMI thread as part of handling below message: + * eQMI_LOC_SERVER_REQUEST_OPEN_V02 + * Triggers the AGPS state machine to setup AGPS call for below WWAN types: + * eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 */ +bool GnssAdapter::requestSuplES(int connHandle){ + + LOC_LOGI("GnssAdapter::requestSuplES"); + + sendMsg( new AgpsMsgRequestATL( + &mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES)); + + return true; +} + +/* GnssAdapter::releaseATL + * Method triggered in QMI thread as part of handling below message: + * eQMI_LOC_SERVER_REQUEST_CLOSE_V02 + * Triggers teardown of an existing AGPS call */ +bool GnssAdapter::releaseATL(int connHandle){ + + LOC_LOGI("GnssAdapter::releaseATL"); + + /* Release SUPL/INTERNET/SUPL_ES ATL */ + struct AgpsMsgReleaseATL: public LocMsg { + + AgpsManager* mAgpsManager; + int mConnHandle; + + inline AgpsMsgReleaseATL(AgpsManager* agpsManager, int connHandle) : + LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle) { + + LOC_LOGV("AgpsMsgReleaseATL"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgReleaseATL::proc()"); + mAgpsManager->releaseATL(mConnHandle); + } + }; + + sendMsg( new AgpsMsgReleaseATL(&mAgpsManager, connHandle)); + + return true; +} + +/* GnssAdapter::reportDataCallOpened + * DS Client data call opened successfully. + * Send message to AGPS Manager to handle. */ +bool GnssAdapter::reportDataCallOpened(){ + + LOC_LOGI("GnssAdapter::reportDataCallOpened"); + + struct AgpsMsgSuplEsOpened: public LocMsg { + + AgpsManager* mAgpsManager; + + inline AgpsMsgSuplEsOpened(AgpsManager* agpsManager) : + LocMsg(), mAgpsManager(agpsManager) { + + LOC_LOGV("AgpsMsgSuplEsOpened"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgSuplEsOpened::proc()"); + mAgpsManager->reportDataCallOpened(); + } + }; + + sendMsg( new AgpsMsgSuplEsOpened(&mAgpsManager)); + + return true; +} + +/* GnssAdapter::reportDataCallClosed + * DS Client data call closed. + * Send message to AGPS Manager to handle. */ +bool GnssAdapter::reportDataCallClosed(){ + + LOC_LOGI("GnssAdapter::reportDataCallClosed"); + + struct AgpsMsgSuplEsClosed: public LocMsg { + + AgpsManager* mAgpsManager; + + inline AgpsMsgSuplEsClosed(AgpsManager* agpsManager) : + LocMsg(), mAgpsManager(agpsManager) { + + LOC_LOGV("AgpsMsgSuplEsClosed"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgSuplEsClosed::proc()"); + mAgpsManager->reportDataCallClosed(); + } + }; + + sendMsg( new AgpsMsgSuplEsClosed(&mAgpsManager)); + + return true; +} + +void GnssAdapter::dataConnOpenCommand( + AGpsExtType agpsType, + const char* apnName, int apnLen, LocApnIpType ipType){ + + LOC_LOGI("GnssAdapter::frameworkDataConnOpen"); + + struct AgpsMsgAtlOpenSuccess: public LocMsg { + + AgpsManager* mAgpsManager; + AGpsExtType mAgpsType; + char* mApnName; + int mApnLen; + LocApnIpType mIpType; + + inline AgpsMsgAtlOpenSuccess(AgpsManager* agpsManager, AGpsExtType agpsType, + const char* apnName, int apnLen, LocApnIpType ipType) : + LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName( + new char[apnLen + 1]), mApnLen(apnLen), mIpType(ipType) { + + LOC_LOGV("AgpsMsgAtlOpenSuccess"); + memcpy(mApnName, apnName, apnLen); + mApnName[apnLen] = 0; + } + + inline ~AgpsMsgAtlOpenSuccess() { + delete[] mApnName; + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgAtlOpenSuccess::proc()"); + mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, + mIpType); + } + }; + + sendMsg( new AgpsMsgAtlOpenSuccess( + &mAgpsManager, (AGpsExtType)agpsType, apnName, apnLen, ipType)); +} + +void GnssAdapter::dataConnClosedCommand(AGpsExtType agpsType){ + + LOC_LOGI("GnssAdapter::frameworkDataConnClosed"); + + struct AgpsMsgAtlClosed: public LocMsg { + + AgpsManager* mAgpsManager; + AGpsExtType mAgpsType; + + inline AgpsMsgAtlClosed(AgpsManager* agpsManager, AGpsExtType agpsType) : + LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType) { + + LOC_LOGV("AgpsMsgAtlClosed"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgAtlClosed::proc()"); + mAgpsManager->reportAtlClosed(mAgpsType); + } + }; + + sendMsg( new AgpsMsgAtlClosed(&mAgpsManager, (AGpsExtType)agpsType)); +} + +void GnssAdapter::dataConnFailedCommand(AGpsExtType agpsType){ + + LOC_LOGI("GnssAdapter::frameworkDataConnFailed"); + + struct AgpsMsgAtlOpenFailed: public LocMsg { + + AgpsManager* mAgpsManager; + AGpsExtType mAgpsType; + + inline AgpsMsgAtlOpenFailed(AgpsManager* agpsManager, AGpsExtType agpsType) : + LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType) { + + LOC_LOGV("AgpsMsgAtlOpenFailed"); + } + + inline virtual void proc() const { + + LOC_LOGV("AgpsMsgAtlOpenFailed::proc()"); + mAgpsManager->reportAtlOpenFailed(mAgpsType); + } + }; + + sendMsg( new AgpsMsgAtlOpenFailed(&mAgpsManager, (AGpsExtType)agpsType)); +} diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 5bd2a12e..f5a53004 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -33,6 +33,7 @@ #include #include #include +#include #define MAX_URL_LEN 256 #define NMEA_SENTENCE_MAX_LENGTH 200 @@ -95,6 +96,10 @@ class GnssAdapter : public LocAdapterBase { /* ==== NI ============================================================================= */ NiData mNiData; + /* ==== AGPS ========================================================*/ + // This must be initialized via initAgps() + AgpsManager mAgpsManager; + /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation, @@ -177,6 +182,14 @@ public: void setConfigCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + + void initAgpsCommand(void* statusV4Cb); + void dataConnOpenCommand( + AGpsExtType agpsType, + const char* apnName, int apnLen, LocApnIpType ipType); + void dataConnClosedCommand(AGpsExtType agpsType); + void dataConnFailedCommand(AGpsExtType agpsType); + /* ======== RESPONSES ================================================================== */ void reportResponse(LocationError err, uint32_t sessionId); void reportResponse(size_t count, LocationError* errs, uint32_t* ids); @@ -201,6 +214,13 @@ public: virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); + + virtual bool requestATL(int connHandle, LocAGpsType agps_type); + virtual bool releaseATL(int connHandle); + virtual bool requestSuplES(int connHandle); + virtual bool reportDataCallOpened(); + virtual bool reportDataCallClosed(); + /* ======== UTILITIES ================================================================= */ void reportPosition(const UlpLocation &ulpLocation, const GpsLocationExtended &locationExtended, diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 242e72e6..0995f4b2 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -54,6 +54,11 @@ static uint32_t* gnssUpdateConfig(GnssConfig config); static void injectLocation(double latitude, double longitude, float accuracy); static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty); +static void agpsInit(void* statusV4Cb); +static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnLen, int ipType); +static void agpsDataConnClosed(AGpsExtType agpsType); +static void agpsDataConnFailed(AGpsExtType agpsType); + static const GnssInterface gGnssInterface = { sizeof(GnssInterface), initialize, @@ -71,7 +76,11 @@ static const GnssInterface gGnssInterface = { gnssUpdateConfig, gnssDeleteAidingData, injectLocation, - injectTime + injectTime, + agpsInit, + agpsDataConnOpen, + agpsDataConnClosed, + agpsDataConnFailed }; #ifndef DEBUG_X86 @@ -204,3 +213,29 @@ static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty) } } +static void agpsInit(void* statusV4Cb) { + + if (NULL != gGnssAdapter) { + gGnssAdapter->initAgpsCommand(statusV4Cb); + } +} +static void agpsDataConnOpen( + AGpsExtType agpsType, const char* apnName, int apnLen, int ipType) { + + if (NULL != gGnssAdapter) { + gGnssAdapter->dataConnOpenCommand( + agpsType, apnName, apnLen, ipType); + } +} +static void agpsDataConnClosed(AGpsExtType agpsType) { + + if (NULL != gGnssAdapter) { + gGnssAdapter->dataConnClosedCommand(agpsType); + } +} +static void agpsDataConnFailed(AGpsExtType agpsType) { + + if (NULL != gGnssAdapter) { + gGnssAdapter->dataConnFailedCommand(agpsType); + } +} diff --git a/location/location_interface.h b/location/location_interface.h index b726931d..b084b656 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -49,6 +49,10 @@ struct GnssInterface { uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); void (*injectLocation)(double latitude, double longitude, float accuracy); void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); + void (*agpsInit)(void* statusV4Cb); + void (*agpsDataConnOpen)(short agpsType, const char* apnName, int apnLen, int ipType); + void (*agpsDataConnClosed)(short agpsType); + void (*agpsDataConnFailed)(short agpsType); }; struct FlpInterface { From 545f52f6b5ce7cb5673fc714d4bd78a1200b11aa Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 23 Feb 2017 18:13:20 +0800 Subject: [PATCH 447/945] Rename FlpAPIClient and GnssMeasurementAPIClient FlpAPIClient renamed to BatchingAPIClient GnssMeasurementAPIClient renamed to MeasurementAPIClient Change-Id: Ic0fae37fd1d798796cb918ddcf141913c6cc3c6e CRs-fixed: 1112712 --- android/Android.mk | 4 +-- android/GnssBatching.cpp | 12 ++++---- android/GnssBatching.h | 4 +-- android/GnssMeasurement.cpp | 8 +++--- android/GnssMeasurement.h | 4 +-- ...FlpAPIClient.cpp => BatchingAPIClient.cpp} | 24 ++++++++-------- .../{FlpAPIClient.h => BatchingAPIClient.h} | 28 +++++++++---------- ...APIClient.cpp => MeasurementAPIClient.cpp} | 16 +++++------ ...mentAPIClient.h => MeasurementAPIClient.h} | 20 ++++++------- location/LocationAPIClientBase.cpp | 6 ++-- 10 files changed, 62 insertions(+), 64 deletions(-) rename android/location_api/{FlpAPIClient.cpp => BatchingAPIClient.cpp} (88%) rename android/location_api/{FlpAPIClient.h => BatchingAPIClient.h} (78%) rename android/location_api/{GnssMeasurementAPIClient.cpp => MeasurementAPIClient.cpp} (96%) rename android/location_api/{GnssMeasurementAPIClient.h => MeasurementAPIClient.h} (83%) diff --git a/android/Android.mk b/android/Android.mk index e359e88f..b493f5e7 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -17,8 +17,8 @@ LOCAL_SRC_FILES += \ location_api/LocationUtil.cpp \ location_api/GnssAPIClient.cpp \ location_api/GeofenceAPIClient.cpp \ - location_api/FlpAPIClient.cpp \ - location_api/GnssMeasurementAPIClient.cpp \ + location_api/BatchingAPIClient.cpp \ + location_api/MeasurementAPIClient.cpp \ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/location_api \ diff --git a/android/GnssBatching.cpp b/android/GnssBatching.cpp index 5eff8199..a78989cd 100644 --- a/android/GnssBatching.cpp +++ b/android/GnssBatching.cpp @@ -21,7 +21,7 @@ #define LOG_TAG "LocSvc_GnssBatchingInterface" #include -#include +#include #include "GnssBatching.h" namespace android { @@ -59,7 +59,7 @@ Return GnssBatching::init(const sp& callback) { return false; } - mApi = new FlpAPIClient(callback); + mApi = new BatchingAPIClient(callback); if (mApi == nullptr) { LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); return false; @@ -81,7 +81,7 @@ Return GnssBatching::getBatchSize() { if (mApi == nullptr) { LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); } else { - ret = mApi->flpGetBatchSize(); + ret = mApi->getBatchSize(); } return ret; } @@ -91,7 +91,7 @@ Return GnssBatching::start(const IGnssBatching::Options& options) { if (mApi == nullptr) { LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); } else { - ret = mApi->flpStartSession(options); + ret = mApi->startSession(options); } return ret; } @@ -100,7 +100,7 @@ Return GnssBatching::flush() { if (mApi == nullptr) { LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); } else { - mApi->flpFlushBatchedLocations(); + mApi->flushBatchedLocations(); } return Void(); } @@ -110,7 +110,7 @@ Return GnssBatching::stop() { if (mApi == nullptr) { LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); } else { - ret = mApi->flpStopSession(); + ret = mApi->stopSession(); } return ret; } diff --git a/android/GnssBatching.h b/android/GnssBatching.h index b46fae8e..de5d5c37 100644 --- a/android/GnssBatching.h +++ b/android/GnssBatching.h @@ -42,7 +42,7 @@ using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; -class FlpAPIClient; +class BatchingAPIClient; struct GnssBatching : public IGnssBatching { GnssBatching(); ~GnssBatching(); @@ -68,7 +68,7 @@ struct GnssBatching : public IGnssBatching { private: sp mGnssBatchingDeathRecipient = nullptr; sp mGnssBatchingCbIface = nullptr; - FlpAPIClient* mApi = nullptr; + BatchingAPIClient* mApi = nullptr; }; } // namespace implementation diff --git a/android/GnssMeasurement.cpp b/android/GnssMeasurement.cpp index bc07265c..8cbfabdf 100644 --- a/android/GnssMeasurement.cpp +++ b/android/GnssMeasurement.cpp @@ -21,7 +21,7 @@ #define LOG_TAG "LocSvc_GnssMeasurementInterface" #include -#include +#include #include "GnssMeasurement.h" namespace android { @@ -41,7 +41,7 @@ void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( GnssMeasurement::GnssMeasurement() { mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this); - mApi = new GnssMeasurementAPIClient(); + mApi = new MeasurementAPIClient(); } GnssMeasurement::~GnssMeasurement() { @@ -74,7 +74,7 @@ Return GnssMeasurement::setCallback( mGnssMeasurementCbIface = callback; mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/); - return mApi->gnssMeasurementSetCallback(callback); + return mApi->measurementSetCallback(callback); } Return GnssMeasurement::close() { @@ -87,7 +87,7 @@ Return GnssMeasurement::close() { mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); mGnssMeasurementCbIface = nullptr; } - mApi->gnssMeasurementClose(); + mApi->measurementClose(); return Void(); } diff --git a/android/GnssMeasurement.h b/android/GnssMeasurement.h index cd364c3a..5073169f 100644 --- a/android/GnssMeasurement.h +++ b/android/GnssMeasurement.h @@ -38,7 +38,7 @@ using ::android::hardware::hidl_vec; using ::android::hardware::hidl_string; using ::android::sp; -class GnssMeasurementAPIClient; +class MeasurementAPIClient; struct GnssMeasurement : public IGnssMeasurement { GnssMeasurement(); ~GnssMeasurement(); @@ -64,7 +64,7 @@ struct GnssMeasurement : public IGnssMeasurement { private: sp mGnssMeasurementDeathRecipient = nullptr; sp mGnssMeasurementCbIface = nullptr; - GnssMeasurementAPIClient* mApi; + MeasurementAPIClient* mApi; }; } // namespace implementation diff --git a/android/location_api/FlpAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp similarity index 88% rename from android/location_api/FlpAPIClient.cpp rename to android/location_api/BatchingAPIClient.cpp index 2fb8caa4..6022fbfa 100644 --- a/android/location_api/FlpAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -28,13 +28,13 @@ */ #define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_FlpAPIClient" +#define LOG_TAG "LocSvc_BatchingAPIClient" #include #include #include "LocationUtil.h" -#include "FlpAPIClient.h" +#include "BatchingAPIClient.h" namespace android { namespace hardware { @@ -45,7 +45,7 @@ namespace implementation { static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, LocationCapabilitiesMask mask); -FlpAPIClient::FlpAPIClient(const sp& callback) : +BatchingAPIClient::BatchingAPIClient(const sp& callback) : LocationAPIClientBase(), mGnssBatchingCbIface(callback), mDefaultId(42), @@ -74,18 +74,18 @@ FlpAPIClient::FlpAPIClient(const sp& callback) : locAPISetCallbacks(locationCallbacks); } -FlpAPIClient::~FlpAPIClient() +BatchingAPIClient::~BatchingAPIClient() { LOC_LOGD("%s]: ()", __FUNCTION__); } -int FlpAPIClient::flpGetBatchSize() +int BatchingAPIClient::getBatchSize() { LOC_LOGD("%s]: ()", __FUNCTION__); return locAPIGetBatchSize(); } -int FlpAPIClient::flpStartSession(const IGnssBatching::Options& opts) +int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) { LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, static_cast(opts.periodNanos), static_cast(opts.flags)); @@ -102,7 +102,7 @@ int FlpAPIClient::flpStartSession(const IGnssBatching::Options& opts) return retVal; } -int FlpAPIClient::flpUpdateSessionOptions(const IGnssBatching::Options& opts) +int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts) { LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, static_cast(opts.periodNanos), static_cast(opts.flags)); @@ -120,7 +120,7 @@ int FlpAPIClient::flpUpdateSessionOptions(const IGnssBatching::Options& opts) return retVal; } -int FlpAPIClient::flpStopSession() +int BatchingAPIClient::stopSession() { LOC_LOGD("%s]: ", __FUNCTION__); int retVal = -1; @@ -130,25 +130,25 @@ int FlpAPIClient::flpStopSession() return retVal; } -void FlpAPIClient::flpGetBatchedLocation(int last_n_locations) +void BatchingAPIClient::getBatchedLocation(int last_n_locations) { LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations); locAPIGetBatchedLocations(last_n_locations); } -void FlpAPIClient::flpFlushBatchedLocations() +void BatchingAPIClient::flushBatchedLocations() { LOC_LOGD("%s]: ()", __FUNCTION__); locAPIGetBatchedLocations(SIZE_MAX); } -void FlpAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) { LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); mLocationCapabilitiesMask = capabilitiesMask; } -void FlpAPIClient::onBatchingCb(size_t count, Location* location) +void BatchingAPIClient::onBatchingCb(size_t count, Location* location) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); if (mGnssBatchingCbIface != nullptr && count > 0) { diff --git a/android/location_api/FlpAPIClient.h b/android/location_api/BatchingAPIClient.h similarity index 78% rename from android/location_api/FlpAPIClient.h rename to android/location_api/BatchingAPIClient.h index 9f9be1e3..a34c211e 100644 --- a/android/location_api/FlpAPIClient.h +++ b/android/location_api/BatchingAPIClient.h @@ -27,8 +27,8 @@ * */ -#ifndef FLP_API_CLINET_H -#define FLP_API_CLINET_H +#ifndef BATCHING_API_CLINET_H +#define BATCHING_API_CLINET_H #include #include @@ -36,27 +36,25 @@ #include -#define FLP_CONF_FILE "/etc/flp.conf" - namespace android { namespace hardware { namespace gnss { namespace V1_0 { namespace implementation { -class FlpAPIClient : public LocationAPIClientBase +class BatchingAPIClient : public LocationAPIClientBase { public: - FlpAPIClient(const sp& callback); - ~FlpAPIClient(); - int flpGetBatchSize(); - int flpStartSession(const IGnssBatching::Options& options); - int flpUpdateSessionOptions(const IGnssBatching::Options& options); - int flpStopSession(); - void flpGetBatchedLocation(int last_n_locations); - void flpFlushBatchedLocations(); + BatchingAPIClient(const sp& callback); + ~BatchingAPIClient(); + int getBatchSize(); + int startSession(const IGnssBatching::Options& options); + int updateSessionOptions(const IGnssBatching::Options& options); + int stopSession(); + void getBatchedLocation(int last_n_locations); + void flushBatchedLocations(); - inline LocationCapabilitiesMask flpGetCapabilities() { return mLocationCapabilitiesMask; } + inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; } // callbacks void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; @@ -74,4 +72,4 @@ private: } // namespace gnss } // namespace hardware } // namespace android -#endif // FLP_API_CLINET_H +#endif // BATCHING_API_CLINET_H diff --git a/android/location_api/GnssMeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp similarity index 96% rename from android/location_api/GnssMeasurementAPIClient.cpp rename to android/location_api/MeasurementAPIClient.cpp index 32016251..30e7b40a 100644 --- a/android/location_api/GnssMeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -28,13 +28,13 @@ */ #define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_GnssMeasurementAPIClient" +#define LOG_TAG "LocSvc_MeasurementAPIClient" #include #include #include "LocationUtil.h" -#include "GnssMeasurementAPIClient.h" +#include "MeasurementAPIClient.h" namespace android { namespace hardware { @@ -48,7 +48,7 @@ static void convertGnssMeasurement(GnssMeasurementsData& in, IGnssMeasurementCallback::GnssMeasurement& out); static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); -GnssMeasurementAPIClient::GnssMeasurementAPIClient() : +MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), mLocationCapabilitiesMask(0) { @@ -64,7 +64,7 @@ GnssMeasurementAPIClient::GnssMeasurementAPIClient() : mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; } -GnssMeasurementAPIClient::~GnssMeasurementAPIClient() +MeasurementAPIClient::~MeasurementAPIClient() { LOC_LOGD("%s]: ()", __FUNCTION__); pthread_cond_destroy(&mCond); @@ -73,7 +73,7 @@ GnssMeasurementAPIClient::~GnssMeasurementAPIClient() // for GpsInterface Return -GnssMeasurementAPIClient::gnssMeasurementSetCallback(const sp& callback) +MeasurementAPIClient::measurementSetCallback(const sp& callback) { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); @@ -118,7 +118,7 @@ GnssMeasurementAPIClient::gnssMeasurementSetCallback(const sp @@ -45,18 +45,18 @@ namespace implementation { using ::android::hardware::gnss::V1_0::IGnssMeasurement; using ::android::sp; -class GnssMeasurementAPIClient : public LocationAPIClientBase +class MeasurementAPIClient : public LocationAPIClientBase { public: - GnssMeasurementAPIClient(); - virtual ~GnssMeasurementAPIClient(); - GnssMeasurementAPIClient(const GnssMeasurementAPIClient&) = delete; - GnssMeasurementAPIClient& operator=(const GnssMeasurementAPIClient&) = delete; + MeasurementAPIClient(); + virtual ~MeasurementAPIClient(); + MeasurementAPIClient(const MeasurementAPIClient&) = delete; + MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete; // for GpsMeasurementInterface - Return gnssMeasurementSetCallback( + Return measurementSetCallback( const sp& callback); - void gnssMeasurementClose(); + void measurementClose(); // callbacks we are interested in void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; @@ -78,4 +78,4 @@ private: } // namespace gnss } // namespace hardware } // namespace android -#endif // GNSS_MEASUREMENT_API_CLINET_H +#endif // MEASUREMENT_API_CLINET_H diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 3413d3ef..da56440b 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -33,7 +33,7 @@ #include #include "LocationAPIClientBase.h" -#define FLP_CONF_FILE "/etc/flp.conf" +#define BATCHING_CONF_FILE "/etc/flp.conf" LocationAPIClientBase::LocationAPIClientBase() : mTrackingCallback(nullptr), @@ -183,11 +183,11 @@ void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options int32_t LocationAPIClientBase::locAPIGetBatchSize() { if (mBatchSize == -1) { - const loc_param_s_type flp_conf_param_table[] = + const loc_param_s_type batching_conf_param_table[] = { {"BATCH_SIZE", &mBatchSize, nullptr, 'n'}, }; - UTIL_READ_CONF(FLP_CONF_FILE, flp_conf_param_table); + UTIL_READ_CONF(BATCHING_CONF_FILE, batching_conf_param_table); if (mBatchSize < 0) { // set mBatchSize to 0 if we got an illegal value from config file mBatchSize = 0; From 681388fa8dd3f1ff9c8b788ac20e90a16fd5b62d Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Fri, 10 Mar 2017 17:20:57 +0530 Subject: [PATCH 448/945] Enable Measurement and poly for QDR for automotive usecase We need to enable Measurement and polynomial reports and need to send it to QDR Core for it to compute fix and report back DR fix, hence need to enable them in automotive QDR use case Change-Id: I8ad29402ded424bbc5a4fd9f6cab74fa7b09f86b CRs-Fixed: 2017935 --- gnss/GnssAdapter.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 3a6ae550..e37a9923 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1007,6 +1007,18 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; } } + + /* + ** For Automotive use cases we need to enable MEASUREMENT and POLY + ** when QDR is enabled + */ + if(1 == ContextBase::mGps_conf.EXTERNAL_DR_ENABLED) { + mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; + mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; + + LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } From 4d84d3669cb15828fa39645e37661f216aac2d1a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 Nov 2016 17:56:59 -0800 Subject: [PATCH 449/945] getprogname is not defined in glibc need to remove get_process_name as it is removed from libcutil. Call getprogname is available in libc but not LE glibc. Implementing a simple call wrapper. Change-Id: I68244b9f7fcbc290222b074f80da03330315ea29 CRs-Fixed: 1080605 --- .../loc_pla/include/platform_lib_gettid.h | 4 ++++ .../loc_pla/src/platform_lib_gettid.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h index 9956937c..340c3c5b 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h @@ -34,6 +34,10 @@ #ifdef __cplusplus extern "C" { #endif +#ifdef USE_GLIB +const char* getprogname(); +#endif /* USE_GLIB */ + pid_t platform_lib_abstraction_gettid(); #ifdef __cplusplus } diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp index 86863273..1b7aa32b 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp @@ -30,6 +30,12 @@ #ifdef USE_GLIB #include + +#include +const char* getprogname() { + return program_invocation_short_name; +} + #else #include #endif /* USE_GLIB */ From 3fb8076a5e35247960050b4b113296b6ddc5c2be Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 18 Nov 2016 16:43:55 -0800 Subject: [PATCH 450/945] fixing a race condition on MsgTask::destroy() when MsgTask::destroy() happens, msg_q_unblock() triggers the running thread to come out from blocking state. A race condition may happen such that that thread may complete first, causing msgTask obj to be already deleted. A next allocation may change the value at MsgTask::mThread. Then when control comes back to destroy(), it may try to check mThread and call delete on it to crash the program. mThread is a heap obj, so it is possible to delete it after the hosting msgTask obj is deleted. We just have to keep its value on the stack before calling msg_q_unblock(). Change-Id: If15884815eea05fbfa523ec92aa300ed21ef897c CR-Fixed: 1091530 --- utils/MsgTask.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 21635115..a0dc57f9 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -62,9 +62,9 @@ MsgTask::~MsgTask() { } void MsgTask::destroy() { + LocThread* thread = mThread; msg_q_unblock((void*)mQ); - if (mThread) { - LocThread* thread = mThread; + if (thread) { mThread = NULL; delete thread; } else { From babc8a9f7c48fc00b7b396f3b2d0b008d17d7708 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Sat, 27 Aug 2016 12:22:17 +0530 Subject: [PATCH 451/945] set default supl config to MSB Default SUPL config bit was set to both MSA and MSB (0x3), which is causing single shot request to map to MSA mode always. Modem is not reporting any position fix for MSA case. Change-Id: I8a75f9970a0443c9cb22f73a631f85240fcc4519 CRs-Fixed: 1098896 --- core/ContextBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index a9858e22..fbc8232d 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -96,7 +96,7 @@ void ContextBase::readConfig() mGps_conf.NMEA_PROVIDER = 0; mGps_conf.GPS_LOCK = 0; mGps_conf.SUPL_VER = 0x10000; - mGps_conf.SUPL_MODE = 0x3; + mGps_conf.SUPL_MODE = 0x1; mGps_conf.SUPL_ES = 0; mGps_conf.CAPABILITIES = 0x7; /* LTE Positioning Profile configuration is disable by default*/ From 1d2ac2023defa51557a6dede208ff90376f13933 Mon Sep 17 00:00:00 2001 From: haohuang Date: Thu, 8 Dec 2016 19:54:15 +0800 Subject: [PATCH 452/945] Add tech_mask in UlpLocation to support report NLP position source to Android Framework. Change-Id: I3811e03dddb721b64b5fa4330996087f6c17efec --- core/gps_extended_c.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55fd03eb..6b62849b 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -87,6 +87,17 @@ extern "C" { #define LOC_AGPS_CERTIFICATE_MAX_LENGTH 2000 #define LOC_AGPS_CERTIFICATE_MAX_SLOTS 10 +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) + enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, LOC_REGISTRATION_MASK_DISABLED, @@ -104,6 +115,7 @@ typedef struct { LocGpsLocation gpsLocation; /* Provider indicator for HYBRID or GPS */ uint16_t position_source; + LocPosTechMask tech_mask; /*allows HAL to pass additional information related to the location */ int rawDataSize; /* in # of bytes */ void * rawData; @@ -343,17 +355,6 @@ enum loc_sess_status { 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 */ From da20b1512965f7ec25b114f27b2fc8ad8ae069ed Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Wed, 14 Dec 2016 12:33:07 +0530 Subject: [PATCH 453/945] Update the device node to check for MDM systems To identify the target as MDM, we need to check for "/target" node mdm targets instead of "/dev/mdm". Change-Id: Ibb53acfd06a0a586f2cdca784f475d0a45718581 CRs-Fixed: 1101185 --- utils/loc_target.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 10168610..53a8985e 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -198,7 +198,7 @@ unsigned int loc_get_target(void) 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 + static const char mdm[] = "/target"; // mdm target we are using char rd_hw_platform[LINE_LEN]; char rd_id[LINE_LEN]; From ff37310f1775e1745767486fb3194e92104cce77 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 20 Dec 2016 17:46:40 +0530 Subject: [PATCH 454/945] Fix issue of incorrect set of used_in_fix flag Due to incorrect check for SVID for GNSS systems in location engine ReportSv function, incorrect used_in_fix flag was set. Modify the condition check to be based on the constellation system ID, to set the used_in_fix flag. Change-Id: Ic74583257c2925361dc68a9865cd80271167bf0c CRs-Fixed: 1102862 --- gnss/GnssAdapter.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e37a9923..6cce9d1d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1923,27 +1923,30 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) if (mGnssSvIdUsedInPosAvail) { int numSv = svNotify.count; int16_t gnssSvId = 0; - int prnMin = 0; uint64_t svUsedIdMask = 0; for (int i=0; i < numSv; i++) { gnssSvId = svNotify.gnssSvs[i].svId; - if (gnssSvId <= GPS_SV_PRN_MAX) { - svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; - prnMin = GPS_SV_PRN_MIN; - } else if ((gnssSvId >= GLO_SV_PRN_MIN) && (gnssSvId <= GLO_SV_PRN_MAX)) { - svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; - prnMin = GLO_SV_PRN_MIN; - } else if ((gnssSvId >= BDS_SV_PRN_MIN) && (gnssSvId <= BDS_SV_PRN_MAX)) { - svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; - prnMin = BDS_SV_PRN_MIN; - } else if ((gnssSvId >= GAL_SV_PRN_MIN) && (gnssSvId <= GAL_SV_PRN_MAX)) { - svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; - prnMin = GAL_SV_PRN_MIN; + switch (svNotify.gnssSvs[i].type) { + case GNSS_SV_TYPE_GPS: + svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; + break; + case GNSS_SV_TYPE_GLONASS: + svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; + break; + case GNSS_SV_TYPE_BEIDOU: + svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; + break; + case GNSS_SV_TYPE_GALILEO: + svUsedIdMask = mGnssSvIdUsedInPosition.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 - prnMin))) { + if (svUsedIdMask & (1 << (gnssSvId - 1))) { svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; } else { svNotify.gnssSvs[i].gnssSvOptionsMask &= ~GNSS_SV_OPTIONS_USED_IN_FIX_BIT; From 54aa95888bccde5a352c06e4e460d431cf8f13a2 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 28 Dec 2016 16:44:58 +0530 Subject: [PATCH 455/945] Updating ro.baseband target property value Updating target derivation logic based on ro.baseband property. There are new values which must be considered in the target derivation logic. Change-Id: I2e81ab00c107247dcb8f1a919136bb61b482e73c CRs-Fixed: 1105916 --- utils/loc_target.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 10168610..6f550191 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -52,6 +52,9 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" +#define STR_SDC "sdc" // alternative string for APQ targets +#define STR_MSM "msm" +#define STR_SDM "sdm" // alternative string for MSM targets #define STR_APQ_NO_WGR "baseband_apq_nowgr" #define STR_AUTO "auto" #define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') @@ -238,7 +241,8 @@ unsigned int loc_get_target(void) goto detected; } - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) || + !memcmp(baseband, STR_SDC, LENGTH(STR_SDC)) ){ if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) @@ -257,11 +261,17 @@ unsigned int loc_get_target(void) 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 if ( !memcmp(baseband, STR_MSM, LENGTH(STR_MSM)) || + !memcmp(baseband, STR_SDM, LENGTH(STR_SDM)) ) + gTarget = TARGET_DEFAULT; + else gTarget = TARGET_UNKNOWN; } From d35e7c34eb970084bad1d6f42a8cf31fbaeca35f Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Mon, 19 Dec 2016 11:23:28 +0530 Subject: [PATCH 456/945] Add comments for automitive configuration param and meas status Add comments for automotive configuration parameters and to masurement status mask Change-Id: Ia5e16e3044fa15ce15d6ce3c3534898cbd61ef03 CRs-Fixed: 1102724 --- core/gps_extended_c.h | 6 ++++-- etc/gps.conf | 44 +++++++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55fd03eb..4a356b71 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -876,8 +876,10 @@ typedef struct */ uint64_t measurementStatus; /**< Bitmask indicating SV measurement status. - Valid bitmasks: \n - @MASK() + Valid bitmasks: \n + If any MSB bit in 0xFFC0000000000000 DONT_USE is set, the measurement + must not be used by the client. + @MASK() */ uint16_t CNo; /**< Carrier to Noise ratio \n diff --git a/etc/gps.conf b/etc/gps.conf index 4b48558f..cc667924 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -138,43 +138,63 @@ LPPE_UP_TECHNOLOGY = 0 # 0: disable # 1: enable AGPS_CONFIG_INJECT = 1 + +################################################## +# GNSS settings for automotive use cases +# Configurations in following section are +# specific to automotive use cases, others +# please do not change, keep the default values +################################################## + # AP Coarse Timestamp Uncertainty ################################################## # default : 10 -# or as per clock uncertainty of product +# AP time stamp uncertainty, until GNSS receiver +# is able to acquire better timing information AP_TIMESTAMP_UNCERTAINTY = 10 -##################################### -# GNSS PPS settings -##################################### -#AP DR engine availability status -# 0 : NO AP DR (default) -# 1 : AP DR enabled +################################################## +# QDR engine availability status +################################################## +# 0 : NO QDR (default) +# 1 : QDR enabled +# This settings enables QDR Configuration for +# automotive use case, if enabled then +# DR_AP_Service needs to be enabled in izat.conf #EXTERNAL_DR_ENABLED = 0 ##################################### -#DR_SYNC Pulse Availability +# DR_SYNC Pulse Availability ##################################### # 0 : DR_SYNC pulse not available (default) # 1 : DR_SYNC pulse available +# This configuration enables the driver to make use +# of PPS events generated by DR_SYNC pulse +# Standard Linux PPS driver needs to be enabled DR_SYNC_ENABLED = 0 ##################################### -#PPS Device name +# PPS Device name ##################################### PPS_DEVICENAME = /dev/pps0 ##################################### -#AP Clock Accuracy +# AP Clock Accuracy ##################################### +# Quality of APPS processor clock (in PPM). +# Value specified is used for calculation of +# APPS time stamp uncertainty AP_CLOCK_PPM = 100 ##################################### -#MAX ms difference to detect missing pulse +# MAX ms difference to detect missing pulse ##################################### +# Specifies time threshold in ms to validate any missing PPS pulses MISSING_PULSE_TIME_DELTA = 900 ##################################### -#Propagation time uncertainty +# Propagation time uncertainty ##################################### +# This settings enables time uncertainty propagation +# logic incase of missing PPS pulse PROPAGATION_TIME_UNCERTAINTY = 1 From 5253a74c6b3efb7456c4422aec4b5af55ddc8807 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 9 Jan 2017 18:53:54 -0800 Subject: [PATCH 457/945] possible NULL pointer dereference it appears some of the MsgTask msgs might fail to create, ending up with a NULL pointer, in which case when it gets received, dereferencing a NULL pointer will happen, causing crash. Change-Id: I5a4295b4fba9c8383754e2abe6558782b1b83143 CRs-Fixed: 1106034 --- utils/MsgTask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 21635115..84f38c84 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -73,7 +73,11 @@ void MsgTask::destroy() { } void MsgTask::sendMsg(const LocMsg* msg) const { - msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); + if (msg) { + msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); + } else { + LOC_LOGE("%s: msg is NULL", __func__); + } } void MsgTask::prerun() { From 9e44ec3ce2e897c13012d6415297bdfdcfc5a10e Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Tue, 3 Jan 2017 22:21:57 +0530 Subject: [PATCH 458/945] force undefined symbols to treat as errors added necessary flags in Makefiles to treat undefined symbols to get caught at compile time. Change-Id: I77068b0d61ad432aa227c01b6229d82651ab8862 --- core/Makefile.am | 4 ++-- utils/Makefile.am | 4 ++-- utils/platform_lib_abstractions/loc_pla/src/Makefile.am | 4 ++-- utils/platform_lib_abstractions/loc_stub/src/Makefile.am | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/Makefile.am b/core/Makefile.am index b3d833f6..0a9d3e2a 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -33,11 +33,11 @@ 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_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif diff --git a/utils/Makefile.am b/utils/Makefile.am index f816565b..b121dc85 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -41,11 +41,11 @@ 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_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am index 6ee0be70..d82aa55b 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -27,11 +27,11 @@ libloc_pla_la_SOURCES = \ 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_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_pla_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif diff --git a/utils/platform_lib_abstractions/loc_stub/src/Makefile.am b/utils/platform_lib_abstractions/loc_stub/src/Makefile.am index 8bda7113..ba823a24 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/Makefile.am +++ b/utils/platform_lib_abstractions/loc_stub/src/Makefile.am @@ -26,11 +26,11 @@ 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_LDFLAGS = -lstdc++ -Wl,-z,defs -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_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_stub_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif From b6928aae360784b2737c931e4486347934ceee14 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 15 Mar 2017 11:10:24 -0700 Subject: [PATCH 459/945] Send capabilities callback for each init Added sending the capabilities to hal clients on every init, instead of only on the first init. This is needed for the cases when the hal client crashes and is trying to reinit. Bug: 36182606 Change-Id: I9055d2319f1dc407b6de9627b4e66eb89f8ce9d1 CRs-fixed: 2019987 --- android/Gnss.cpp | 1 + android/location_api/GnssAPIClient.cpp | 12 +++++++++++- android/location_api/GnssAPIClient.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 1412883a..1d5a04e9 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -121,6 +121,7 @@ Return Gnss::setCallback(const sp& callback) { if (api != nullptr) { api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); api->locAPIEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->requestCapabilities(); } return true; } diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index b4f04065..4cb3f7df 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -49,7 +49,8 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb, LocationAPIClientBase(), mGnssCbIface(nullptr), mGnssNiCbIface(nullptr), - mLocationCapabilitiesMask(0) + mLocationCapabilitiesMask(0), + mLocationCapabilitiesCached(false) { LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); @@ -218,11 +219,20 @@ void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig) locAPIGnssUpdateConfig(gnssConfig); } +void GnssAPIClient::requestCapabilities() { + // only send capablities if it's already cached, otherwise the first time LocationAPI + // is initialized, capabilities will be sent by LocationAPI + if (mLocationCapabilitiesCached) { + onCapabilitiesCb(mLocationCapabilitiesMask); + } +} + // callbacks void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) { LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); mLocationCapabilitiesMask = capabilitiesMask; + mLocationCapabilitiesCached = true; if (mGnssCbIface != nullptr) { uint32_t data = 0; if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || diff --git a/android/location_api/GnssAPIClient.h b/android/location_api/GnssAPIClient.h index 1809c09d..d447157a 100644 --- a/android/location_api/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -74,6 +74,7 @@ public: inline LocationCapabilitiesMask gnssGetCapabilities() const { return mLocationCapabilitiesMask; } + void requestCapabilities(); // callbacks we are interested in void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; @@ -90,6 +91,7 @@ private: sp mGnssNiCbIface; LocationCapabilitiesMask mLocationCapabilitiesMask; + bool mLocationCapabilitiesCached; LocationOptions mLocationOptions; }; From b37098920fc32a6f2d3e1143f56b7265a6f63f5f Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 22 Dec 2016 01:17:04 +0530 Subject: [PATCH 460/945] Moving conf files to /vendor/etc Moving all vendor specific conf files to /vendor/etc instead of current /etc folder CRs-Fixed: 1099981 Change-Id: I4495d8527941959be0847c4722ea8b68ee6c87ee --- core/ContextBase.cpp | 6 ++-- core/loc_gps.h | 2 +- etc/Android.mk | 2 +- .../loc_pla/include/platform_lib_macros.h | 12 +++++++ .../loc_pla/src/platform_lib_log_util.cpp | 36 +++++++++++++++++++ 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index a9858e22..565f70c2 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -145,10 +145,8 @@ void ContextBase::readConfig() /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ mGps_conf.AGPS_CONFIG_INJECT = 1; - const char* GPS_CONF_FILE = "/etc/gps.conf"; - const char* SAP_CONF_FILE = "/etc/sap.conf"; - UTIL_READ_CONF(GPS_CONF_FILE, mGps_conf_table); - UTIL_READ_CONF(SAP_CONF_FILE, mSap_conf_table); + UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); + UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); } uint32_t ContextBase::getCarrierCapabilities() { diff --git a/core/loc_gps.h b/core/loc_gps.h index cdb1af67..2e495b82 100644 --- a/core/loc_gps.h +++ b/core/loc_gps.h @@ -2187,7 +2187,7 @@ typedef struct { * Deliver GNSS configuration contents to HAL. * Parameters: * config_data - a pointer to a char array which holds what usually is expected from - file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + file(/vendor/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. * length - total number of UTF8 characters in configuraiton data. * * IMPORTANT: diff --git a/etc/Android.mk b/etc/Android.mk index 025d3f74..d9eb0e10 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -5,7 +5,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := gps.conf LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index c712122e..d0795eb6 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -66,6 +66,18 @@ extern "C" { #endif /* USE_GLIB */ + +// Below are the location conf file paths +extern const char LOC_PATH_GPS_CONF[]; +extern const char LOC_PATH_IZAT_CONF[]; +extern const char LOC_PATH_FLP_CONF[]; +extern const char LOC_PATH_LOWI_CONF[]; +extern const char LOC_PATH_SAP_CONF[]; +extern const char LOC_PATH_APDR_CONF[]; +extern const char LOC_PATH_XTWIFI_CONF[]; +extern const char LOC_PATH_QUIPC_CONF[]; + + #ifdef __cplusplus } #endif /*__cplusplus */ diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp index ef23201a..3cb51a30 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -26,6 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "platform_lib_log_util.h" +#include "platform_lib_macros.h" char * get_timestamp(char *str, unsigned long buf_size) { @@ -40,3 +41,38 @@ char * get_timestamp(char *str, unsigned long buf_size) return str; } +// Below are the location conf file paths +#ifdef __ANDROID__ + +#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" + +#else + +#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" + +#endif // __ANDROID__ + +// Reference below arrays wherever needed to avoid duplicating +// same conf path string over and again in location code. +const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; +const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; +const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; +const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; +const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; +const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; +const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; +const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; From 592b3f557edac9a1e25a8a22306573ee7f530ee9 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 14 Mar 2017 11:13:23 -0700 Subject: [PATCH 461/945] SystemStatus - initial release Add GNSS SystemStatus component to handle debug NMEA messages from mpss. This component handles GNSS debug info sent through debug NMEA and then stores it in its cache and pass it to clients per requests. Also debug NMEA is turned on by default. Change-Id: Ia11a124ff43d27568f544a3a4742dd7a846869fe CRs-Fixed: 1099152 --- core/Android.mk | 6 +- core/LocDualContext.cpp | 12 + core/LocDualContext.h | 6 +- core/Makefile.am | 6 +- core/SystemStatus.cpp | 1425 +++++++++++++++++++++++++++++++++++++++ core/SystemStatus.h | 275 ++++++++ core/gps_extended_c.h | 7 +- gnss/GnssAdapter.cpp | 24 +- 8 files changed, 1749 insertions(+), 12 deletions(-) create mode 100644 core/SystemStatus.cpp create mode 100644 core/SystemStatus.h diff --git a/core/Android.mk b/core/Android.mk index b260b1dc..b8e25a96 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -30,7 +30,8 @@ LOCAL_SRC_FILES += \ LocAdapterBase.cpp \ ContextBase.cpp \ LocDualContext.cpp \ - loc_core_log.cpp + loc_core_log.cpp \ + SystemStatus.cpp LOCAL_CFLAGS += \ -fno-short-enums \ @@ -53,7 +54,8 @@ LOCAL_COPY_HEADERS:= \ gps_extended_c.h \ gps_extended.h \ loc_core_log.h \ - LocAdapterProxyBase.h + LocAdapterProxyBase.h \ + SystemStatus.h include $(BUILD_SHARED_LIBRARY) diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index fd465e9d..c6a88962 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -35,6 +35,7 @@ #include #include #include +#include namespace loc_core { @@ -56,6 +57,7 @@ const MsgTask* LocDualContext::mMsgTask = NULL; ContextBase* LocDualContext::mFgContext = NULL; ContextBase* LocDualContext::mBgContext = NULL; ContextBase* LocDualContext::mInjectContext = NULL; +SystemStatus* LocDualContext::mSystemStatus = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; #ifndef USE_GLIB @@ -147,4 +149,14 @@ LocDualContext::LocDualContext(const MsgTask* msgTask, { } +SystemStatus* LocDualContext::getSystemStatus(void) +{ + pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); + if (NULL == mSystemStatus) { + mSystemStatus = new SystemStatus(); + } + pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + return mSystemStatus; +} + } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index ce77a1aa..76421525 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2017 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 @@ -36,6 +36,8 @@ namespace loc_core { +class SystemStatus; + class LocDualContext : public ContextBase { static const MsgTask* mMsgTask; static ContextBase* mFgContext; @@ -45,6 +47,7 @@ class LocDualContext : public ContextBase { const char* name, bool joinable = true); static const MsgTask* getMsgTask(const char* name, bool joinable = true); static pthread_mutex_t mGetLocContextMutex; + static SystemStatus* mSystemStatus; protected: LocDualContext(const MsgTask* msgTask, @@ -69,6 +72,7 @@ public: } static void injectFeatureConfig(ContextBase *context); + static SystemStatus* getSystemStatus(void); }; } diff --git a/core/Makefile.am b/core/Makefile.am index b3d833f6..6a4f3534 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -16,14 +16,16 @@ libloc_core_la_h_sources = \ gps_extended_c.h \ gps_extended.h \ loc_core_log.h \ - LocAdapterProxyBase.h + LocAdapterProxyBase.h \ + SystemStatus.h libloc_core_la_c_sources = \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ LocDualContext.cpp \ - loc_core_log.cpp + loc_core_log.cpp \ + SystemStatus.cpp library_includedir = $(pkgincludedir)/core diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp new file mode 100644 index 00000000..592344bd --- /dev/null +++ b/core/SystemStatus.cpp @@ -0,0 +1,1425 @@ +/* Copyright (c) 2017, 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_TAG "LocSvc_SystemStatus" + +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core +{ + +/****************************************************************************** + SystemStatusNmeaBase - base class for all NMEA parsers +******************************************************************************/ +class SystemStatusNmeaBase +{ +protected: + std::vector mField; + timespec setUtcTime(std::string sutctime); + +public: + static const uint32_t NMEA_MINSIZE = 6; + static const uint32_t NMEA_MAXSIZE = 256; + + SystemStatusNmeaBase(const char *str_in, uint32_t len_in) + { + // check size and talker + if (len_in > NMEA_MAXSIZE || len_in < NMEA_MINSIZE || (str_in[0] != '$')) { + return; + } + + std::string parser(str_in); + std::string::size_type index = 0; + + // verify checksum field + index = parser.find("*"); + if (index == std::string::npos) { + return; + } + parser[index] = ','; + + // tokenize parser + while (1) { + std::string str; + index = parser.find(","); + if (index == std::string::npos) { + break; + } + str = parser.substr(0, index); + parser = parser.substr(index + 1); + mField.push_back(str); + } + } + + virtual ~SystemStatusNmeaBase() { } +}; + +timespec SystemStatusNmeaBase::setUtcTime(std::string sutctime) +{ + timespec ts = { 0ULL, 0ULL }; + uint64_t utctime_ns = atof(sutctime.c_str()) * 1000000000ULL; + ts.tv_nsec = utctime_ns % 1000000000ULL; + uint64_t utctime_s = utctime_ns / 1000000000ULL; + + uint64_t hour = utctime_s / 10000ULL; + uint64_t min = (utctime_s / 100LL) % 100ULL; + uint64_t sec = utctime_s % 100ULL; + ts.tv_sec = hour * 3600ULL + min * 60ULL + sec; + + timeval tv; + gettimeofday(&tv, NULL); + ts.tv_sec += (uint64_t(tv.tv_sec / (24ULL * 60ULL * 60ULL))) * (24ULL * 60ULL * 60ULL); + return ts; +} + +/****************************************************************************** + SystemStatusPQWM1 +******************************************************************************/ +class SystemStatusPQWM1 +{ +public: + timespec mUtcTime; + uint16_t mGpsWeek; // x1 + uint32_t mGpsTowMs; // x2 + uint8_t mTimeValid; // x3 + uint8_t mTimeSource; // x4 + int32_t mTimeUnc; // x5 + int32_t mClockFreqBias; // x6 + int32_t mClockFreqBiasUnc; // x7 + uint8_t mXoState; // x8 + int32_t mPgaGain; // x9 + uint32_t mGpsBpAmpI; // xA + uint32_t mGpsBpAmpQ; // xB + uint32_t mAdcI; // xC + uint32_t mAdcQ; // xD + uint32_t mJammerGps; // xE + uint32_t mJammerGlo; // xF + uint32_t mJammerBds; // x10 + uint32_t mJammerGal; // x11 + uint32_t mRecErrorRecovery; // x12 +}; + +// parser +class SystemStatusPQWM1parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eGpsWeek = 1, + eGpsTowMs = 2, + eTimeValid = 3, + eTimeSource = 4, + eTimeUnc = 5, + eClockFreqBias = 6, + eClockFreqBiasUnc = 7, + eXoState = 8, + ePgaGain = 9, + eGpsBpAmpI = 10, + eGpsBpAmpQ = 11, + eAdcI = 12, + eAdcQ = 13, + eJammerGps = 14, + eJammerGlo = 15, + eJammerBds = 16, + eJammerGal = 17, + eRecErrorRecovery = 18, + eMax = eRecErrorRecovery + }; + SystemStatusPQWM1 mM1; + +public: + inline uint16_t getGpsWeek() { return mM1.mGpsWeek; } + inline uint32_t getGpsTowMs() { return mM1.mGpsTowMs; } + inline uint8_t getTimeValid() { return mM1.mTimeValid; } + inline uint8_t getTimeSource() { return mM1.mTimeSource; } + inline int32_t getTimeUnc() { return mM1.mTimeUnc; } + inline int32_t getClockFreqBias() { return mM1.mClockFreqBias; } + inline int32_t getClockFreqBiasUnc() { return mM1.mClockFreqBiasUnc; } + inline uint8_t getXoState() { return mM1.mXoState;} + inline int32_t getPgaGain() { return mM1.mPgaGain; } + inline uint32_t getGpsBpAmpI() { return mM1.mGpsBpAmpI; } + inline uint32_t getGpsBpAmpQ() { return mM1.mGpsBpAmpQ; } + inline uint32_t getAdcI() { return mM1.mAdcI; } + inline uint32_t getAdcQ() { return mM1.mAdcQ; } + inline uint32_t getJammerGps() { return mM1.mJammerGps; } + inline uint32_t getJammerGlo() { return mM1.mJammerGlo; } + inline uint32_t getJammerBds() { return mM1.mJammerBds; } + inline uint32_t getJammerGal() { return mM1.mJammerGal; } + inline uint32_t getRecErrorRecovery() { return mM1.mRecErrorRecovery; } + + SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mM1, 0, sizeof(mM1)); + + timeval tv; + gettimeofday(&tv, NULL); + mM1.mUtcTime.tv_sec = tv.tv_sec; + mM1.mUtcTime.tv_nsec = tv.tv_usec * 1000UL; + mM1.mGpsWeek = atoi(mField[eGpsWeek].c_str()); + mM1.mGpsTowMs = atoi(mField[eGpsTowMs].c_str()); + mM1.mTimeValid = atoi(mField[eTimeValid].c_str()); + mM1.mTimeSource = atoi(mField[eTimeSource].c_str()); + mM1.mTimeUnc = atoi(mField[eTimeUnc].c_str()); + mM1.mClockFreqBias = atoi(mField[eClockFreqBias].c_str()); + mM1.mClockFreqBiasUnc = atoi(mField[eClockFreqBiasUnc].c_str()); + mM1.mXoState = atoi(mField[eXoState].c_str()); + mM1.mPgaGain = atoi(mField[ePgaGain].c_str()); + mM1.mGpsBpAmpI = atoi(mField[eGpsBpAmpI].c_str()); + mM1.mGpsBpAmpQ = atoi(mField[eGpsBpAmpQ].c_str()); + mM1.mAdcI = atoi(mField[eAdcI].c_str()); + mM1.mAdcQ = atoi(mField[eAdcQ].c_str()); + mM1.mJammerGps = atoi(mField[eJammerGps].c_str()); + mM1.mJammerGlo = atoi(mField[eJammerGlo].c_str()); + mM1.mJammerBds = atoi(mField[eJammerBds].c_str()); + mM1.mJammerGal = atoi(mField[eJammerGal].c_str()); + mM1.mRecErrorRecovery = atoi(mField[eRecErrorRecovery].c_str()); + } + + inline SystemStatusPQWM1& get() { return mM1;} //getparser +}; + +/****************************************************************************** + SystemStatusPQWP1 +******************************************************************************/ +class SystemStatusPQWP1 +{ +public: + timespec mUtcTime; + uint8_t mEpiValidity; // x4 + float mEpiLat; // x5 + float mEpiLon; // x6 + float mEpiAlt; // x7 + float mEpiHepe; // x8 + float mEpiAltUnc; // x9 + uint8_t mEpiSrc; // x10 +}; + +class SystemStatusPQWP1parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eEpiValidity = 2, + eEpiLat = 3, + eEpiLon = 4, + eEpiAlt = 5, + eEpiHepe = 6, + eEpiAltUnc = 7, + eEpiSrc = 8, + eMax = eEpiSrc + }; + SystemStatusPQWP1 mP1; + +public: + inline timespec getUtcTime() { return mP1.mUtcTime; } + inline uint8_t getEpiValidity() { return mP1.mEpiValidity; } + inline float getEpiLat() { return mP1.mEpiLat; } + inline float getEpiLon() { return mP1.mEpiLon; } + inline float getEpiAlt() { return mP1.mEpiAlt; } + inline float getEpiHepe() { return mP1.mEpiHepe; } + inline float getEpiAltUnc() { return mP1.mEpiAltUnc; } + inline uint8_t getEpiSrc() { return mP1.mEpiSrc; } + + SystemStatusPQWP1parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP1, 0, sizeof(mP1)); + mP1.mUtcTime = setUtcTime(mField[eUtcTime]); + mP1.mEpiValidity = strtol(mField[eEpiValidity].c_str(), NULL, 16); + mP1.mEpiLat = atof(mField[eEpiLat].c_str()); + mP1.mEpiLon = atof(mField[eEpiLon].c_str()); + mP1.mEpiAlt = atof(mField[eEpiAlt].c_str()); + mP1.mEpiHepe = atoi(mField[eEpiHepe].c_str()); + mP1.mEpiAltUnc = atof(mField[eEpiAltUnc].c_str()); + mP1.mEpiSrc = atoi(mField[eEpiSrc].c_str()); + } + + inline SystemStatusPQWP1& get() { return mP1;} +}; + +/****************************************************************************** + SystemStatusPQWP2 +******************************************************************************/ +class SystemStatusPQWP2 +{ +public: + timespec mUtcTime; + float mBestLat; // x4 + float mBestLon; // x5 + float mBestAlt; // x6 + float mBestHepe; // x7 + float mBestAltUnc; // x8 +}; + +class SystemStatusPQWP2parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eBestLat = 2, + eBestLon = 3, + eBestAlt = 4, + eBestHepe = 5, + eBestAltUnc = 6, + eMax = eBestAltUnc + }; + SystemStatusPQWP2 mP2; + +public: + inline float getBestLat() { return mP2.mBestLat; } + inline float getBestLon() { return mP2.mBestLon; } + inline float getBestAlt() { return mP2.mBestAlt; } + inline float getBestHepe() { return mP2.mBestHepe; } + inline float getBestAltUnc() { return mP2.mBestAltUnc; } + + SystemStatusPQWP2parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP2, 0, sizeof(mP2)); + mP2.mUtcTime = setUtcTime(mField[eUtcTime]); + mP2.mBestLat = atof(mField[eBestLat].c_str()); + mP2.mBestLon = atof(mField[eBestLon].c_str()); + mP2.mBestAlt = atof(mField[eBestAlt].c_str()); + mP2.mBestHepe = atof(mField[eBestHepe].c_str()); + mP2.mBestAltUnc = atof(mField[eBestAltUnc].c_str()); + } + + inline SystemStatusPQWP2& get() { return mP2;} +}; + +/****************************************************************************** + SystemStatusPQWP3 +******************************************************************************/ +class SystemStatusPQWP3 +{ +public: + timespec mUtcTime; + uint8_t mXtraValidMask; + uint32_t mGpsXtraAge; + uint32_t mGloXtraAge; + uint32_t mBdsXtraAge; + uint32_t mGalXtraAge; + uint32_t mQzssXtraAge; + uint32_t mGpsXtraValid; + uint32_t mGloXtraValid; + uint64_t mBdsXtraValid; + uint64_t mGalXtraValid; + uint8_t mQzssXtraValid; +}; + +class SystemStatusPQWP3parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eXtraValidMask = 2, + eGpsXtraAge = 3, + eGloXtraAge = 4, + eBdsXtraAge = 5, + eGalXtraAge = 6, + eQzssXtraAge = 7, + eGpsXtraValid = 8, + eGloXtraValid = 9, + eBdsXtraValid = 10, + eGalXtraValid = 11, + eQzssXtraValid = 12, + eMax = eQzssXtraValid + }; + SystemStatusPQWP3 mP3; + +public: + inline uint8_t getXtraValid() { return mP3.mXtraValidMask; } + inline uint32_t getGpsXtraAge() { return mP3.mGpsXtraAge; } + inline uint32_t getGloXtraAge() { return mP3.mGloXtraAge; } + inline uint32_t getBdsXtraAge() { return mP3.mBdsXtraAge; } + inline uint32_t getGalXtraAge() { return mP3.mGalXtraAge; } + inline uint32_t getQzssXtraAge() { return mP3.mQzssXtraAge; } + inline uint32_t getGpsXtraValid() { return mP3.mGpsXtraValid; } + inline uint32_t getGloXtraValid() { return mP3.mGloXtraValid; } + inline uint64_t getBdsXtraValid() { return mP3.mBdsXtraValid; } + inline uint64_t getGalXtraValid() { return mP3.mGalXtraValid; } + inline uint8_t getQzssXtraValid() { return mP3.mQzssXtraValid; } + + SystemStatusPQWP3parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP3, 0, sizeof(mP3)); + mP3.mUtcTime = setUtcTime(mField[eUtcTime]); + mP3.mXtraValidMask = strtol(mField[eXtraValidMask].c_str(), NULL, 16); + mP3.mGpsXtraAge = atoi(mField[eGpsXtraAge].c_str()); + mP3.mGloXtraAge = atoi(mField[eGloXtraAge].c_str()); + mP3.mBdsXtraAge = atoi(mField[eBdsXtraAge].c_str()); + mP3.mGalXtraAge = atoi(mField[eGalXtraAge].c_str()); + mP3.mQzssXtraAge = atoi(mField[eQzssXtraAge].c_str()); + mP3.mGpsXtraValid = strtol(mField[eGpsXtraValid].c_str(), NULL, 16); + mP3.mGloXtraValid = strtol(mField[eGloXtraValid].c_str(), NULL, 16); + mP3.mBdsXtraValid = strtol(mField[eBdsXtraValid].c_str(), NULL, 16); + mP3.mGalXtraValid = strtol(mField[eGalXtraValid].c_str(), NULL, 16); + mP3.mQzssXtraValid = strtol(mField[eQzssXtraValid].c_str(), NULL, 16); + } + + inline SystemStatusPQWP3& get() { return mP3;} +}; + +/****************************************************************************** + SystemStatusPQWP4 +******************************************************************************/ +class SystemStatusPQWP4 +{ +public: + timespec mUtcTime; + uint32_t mGpsEpheValid; + uint32_t mGloEpheValid; + uint64_t mBdsEpheValid; + uint64_t mGalEpheValid; + uint8_t mQzssEpheValid; +}; + +class SystemStatusPQWP4parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eGpsEpheValid = 2, + eGloEpheValid = 3, + eBdsEpheValid = 4, + eGalEpheValid = 5, + eQzssEpheValid = 6, + eMax = eQzssEpheValid + }; + SystemStatusPQWP4 mP4; + +public: + inline uint32_t getGpsEpheValid() { return mP4.mGpsEpheValid; } + inline uint32_t getGloEpheValid() { return mP4.mGloEpheValid; } + inline uint64_t getBdsEpheValid() { return mP4.mBdsEpheValid; } + inline uint64_t getGalEpheValid() { return mP4.mGalEpheValid; } + inline uint8_t getQzssEpheValid() { return mP4.mQzssEpheValid; } + + SystemStatusPQWP4parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP4, 0, sizeof(mP4)); + mP4.mUtcTime = setUtcTime(mField[eUtcTime]); + mP4.mGpsEpheValid = strtol(mField[eGpsEpheValid].c_str(), NULL, 16); + mP4.mGloEpheValid = strtol(mField[eGloEpheValid].c_str(), NULL, 16); + mP4.mBdsEpheValid = strtol(mField[eBdsEpheValid].c_str(), NULL, 16); + mP4.mGalEpheValid = strtol(mField[eGalEpheValid].c_str(), NULL, 16); + mP4.mQzssEpheValid = strtol(mField[eQzssEpheValid].c_str(), NULL, 16); + } + + inline SystemStatusPQWP4& get() { return mP4;} +}; + +/****************************************************************************** + SystemStatusPQWP5 +******************************************************************************/ +class SystemStatusPQWP5 +{ +public: + timespec mUtcTime; + uint32_t mGpsUnknownMask; + uint32_t mGloUnknownMask; + uint64_t mBdsUnknownMask; + uint64_t mGalUnknownMask; + uint8_t mQzssUnknownMask; + uint32_t mGpsGoodMask; + uint32_t mGloGoodMask; + uint64_t mBdsGoodMask; + uint64_t mGalGoodMask; + uint8_t mQzssGoodMask; + uint32_t mGpsBadMask; + uint32_t mGloBadMask; + uint64_t mBdsBadMask; + uint64_t mGalBadMask; + uint8_t mQzssBadMask; +}; + +class SystemStatusPQWP5parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eGpsUnknownMask = 2, + eGloUnknownMask = 3, + eBdsUnknownMask = 4, + eGalUnknownMask = 5, + eQzssUnknownMask = 6, + eGpsGoodMask = 7, + eGloGoodMask = 8, + eBdsGoodMask = 9, + eGalGoodMask = 10, + eQzssGoodMask = 11, + eGpsBadMask = 12, + eGloBadMask = 13, + eBdsBadMask = 14, + eGalBadMask = 15, + eQzssBadMask = 16, + eMax = eQzssBadMask + }; + SystemStatusPQWP5 mP5; + +public: + inline uint32_t getGpsUnknownMask() { return mP5.mGpsUnknownMask; } + inline uint32_t getGloUnknownMask() { return mP5.mGloUnknownMask; } + inline uint64_t getBdsUnknownMask() { return mP5.mBdsUnknownMask; } + inline uint64_t getGalUnknownMask() { return mP5.mGalUnknownMask; } + inline uint8_t getQzssUnknownMask() { return mP5.mQzssUnknownMask; } + inline uint32_t getGpsGoodMask() { return mP5.mGpsGoodMask; } + inline uint32_t getGloGoodMask() { return mP5.mGloGoodMask; } + inline uint64_t getBdsGoodMask() { return mP5.mBdsGoodMask; } + inline uint64_t getGalGoodMask() { return mP5.mGalGoodMask; } + inline uint8_t getQzssGoodMask() { return mP5.mQzssGoodMask; } + inline uint32_t getGpsBadMask() { return mP5.mGpsBadMask; } + inline uint32_t getGloBadMask() { return mP5.mGloBadMask; } + inline uint64_t getBdsBadMask() { return mP5.mBdsBadMask; } + inline uint64_t getGalBadMask() { return mP5.mGalBadMask; } + inline uint8_t getQzssBadMask() { return mP5.mQzssBadMask; } + + SystemStatusPQWP5parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP5, 0, sizeof(mP5)); + mP5.mUtcTime = setUtcTime(mField[eUtcTime]); + mP5.mGpsUnknownMask = strtol(mField[eGpsUnknownMask].c_str(), NULL, 16); + mP5.mGloUnknownMask = strtol(mField[eGloUnknownMask].c_str(), NULL, 16); + mP5.mBdsUnknownMask = strtol(mField[eBdsUnknownMask].c_str(), NULL, 16); + mP5.mGalUnknownMask = strtol(mField[eGalUnknownMask].c_str(), NULL, 16); + mP5.mQzssUnknownMask = strtol(mField[eQzssUnknownMask].c_str(), NULL, 16); + mP5.mGpsGoodMask = strtol(mField[eGpsGoodMask].c_str(), NULL, 16); + mP5.mGloGoodMask = strtol(mField[eGloGoodMask].c_str(), NULL, 16); + mP5.mBdsGoodMask = strtol(mField[eBdsGoodMask].c_str(), NULL, 16); + mP5.mGalGoodMask = strtol(mField[eGalGoodMask].c_str(), NULL, 16); + mP5.mQzssGoodMask = strtol(mField[eQzssGoodMask].c_str(), NULL, 16); + mP5.mGpsBadMask = strtol(mField[eGpsBadMask].c_str(), NULL, 16); + mP5.mGloBadMask = strtol(mField[eGloBadMask].c_str(), NULL, 16); + mP5.mBdsBadMask = strtol(mField[eBdsBadMask].c_str(), NULL, 16); + mP5.mGalBadMask = strtol(mField[eGalBadMask].c_str(), NULL, 16); + mP5.mQzssBadMask = strtol(mField[eQzssBadMask].c_str(), NULL, 16); + } + + inline SystemStatusPQWP5& get() { return mP5;} +}; + +/****************************************************************************** + SystemStatusPQWP6parser +******************************************************************************/ +class SystemStatusPQWP6 +{ +public: + timespec mUtcTime; + uint32_t mFixInfoMask; +}; + +class SystemStatusPQWP6parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eFixInfoMask = 2, + eMax = eFixInfoMask + }; + SystemStatusPQWP6 mP6; + +public: + inline uint32_t getFixInfoMask() { return mP6.mFixInfoMask; } + + SystemStatusPQWP6parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mP6, 0, sizeof(mP6)); + mP6.mUtcTime = setUtcTime(mField[eUtcTime]); + mP6.mFixInfoMask = strtol(mField[eFixInfoMask].c_str(), NULL, 16); + } + + inline SystemStatusPQWP6& get() { return mP6;} +}; + +/****************************************************************************** + SystemStatusPQWS1parser +******************************************************************************/ +class SystemStatusPQWS1 +{ +public: + timespec mUtcTime; + uint32_t mFixInfoMask; + uint32_t mHepeLimit; +}; + +class SystemStatusPQWS1parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eFixInfoMask = 2, + eHepeLimit = 3, + eMax = eHepeLimit + }; + SystemStatusPQWS1 mS1; + +public: + inline uint16_t getFixInfoMask() { return mS1.mFixInfoMask; } + inline uint32_t getHepeLimit() { return mS1.mHepeLimit; } + + SystemStatusPQWS1parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + return; + } + memset(&mS1, 0, sizeof(mS1)); + mS1.mUtcTime = setUtcTime(mField[eUtcTime]); + mS1.mFixInfoMask = atoi(mField[eFixInfoMask].c_str()); + mS1.mHepeLimit = atoi(mField[eHepeLimit].c_str()); + } + + inline SystemStatusPQWS1& get() { return mS1;} +}; + +/****************************************************************************** + SystemStatusTimeAndClock +******************************************************************************/ +SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mGpsWeek(nmea.mGpsWeek), + mGpsTowMs(nmea.mGpsTowMs), + mTimeValid(nmea.mTimeValid), + mTimeSource(nmea.mTimeSource), + mTimeUnc(nmea.mTimeUnc), + mClockFreqBias(nmea.mClockFreqBias), + mClockFreqBiasUnc(nmea.mClockFreqBiasUnc) +{ +} + +bool SystemStatusTimeAndClock::equals(SystemStatusTimeAndClock& peer) +{ + if ((mGpsWeek != peer.mGpsWeek) || + (mGpsTowMs != peer.mGpsTowMs) || + (mTimeValid != peer.mTimeValid) || + (mTimeSource != peer.mTimeSource) || + (mTimeUnc != peer.mTimeUnc) || + (mClockFreqBias != peer.mClockFreqBias) || + (mClockFreqBiasUnc != peer.mClockFreqBiasUnc)) { + return false; + } + return true; +} + +void SystemStatusTimeAndClock::dump() +{ + LOC_LOGV("TimeAndClock: u=%ld:%ld g=%d:%d v=%d s=%d u=%d b=%d bu=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mGpsWeek, + mGpsTowMs, + mTimeValid, + mTimeSource, + mTimeUnc, + mClockFreqBias, + mClockFreqBiasUnc); + return; +} + +/****************************************************************************** + SystemStatusXoState +******************************************************************************/ +SystemStatusXoState::SystemStatusXoState(const SystemStatusPQWM1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mXoState(nmea.mXoState) +{ +} + +bool SystemStatusXoState::equals(SystemStatusXoState& peer) +{ + if (mXoState != peer.mXoState) { + return false; + } + return true; +} + +void SystemStatusXoState::dump() +{ + LOC_LOGV("XoState: u=%ld:%ld x=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mXoState); + return; +} + +/****************************************************************************** + SystemStatusRfAndParams +******************************************************************************/ +SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mPgaGain(nmea.mPgaGain), + mGpsBpAmpI(nmea.mGpsBpAmpI), + mGpsBpAmpQ(nmea.mGpsBpAmpQ), + mAdcI(nmea.mAdcI), + mAdcQ(nmea.mAdcQ), + mJammerGps(nmea.mJammerGps), + mJammerGlo(nmea.mJammerGlo), + mJammerBds(nmea.mJammerBds), + mJammerGal(nmea.mJammerGal) +{ +} + +bool SystemStatusRfAndParams::equals(SystemStatusRfAndParams& peer) +{ + if ((mPgaGain != peer.mPgaGain) || + (mGpsBpAmpI != peer.mGpsBpAmpI) || + (mGpsBpAmpQ != peer.mGpsBpAmpQ) || + (mAdcI != peer.mAdcI) || + (mAdcQ != peer.mAdcQ) || + (mJammerGps != peer.mJammerGps) || + (mJammerGlo != peer.mJammerGlo) || + (mJammerBds != peer.mJammerBds) || + (mJammerGal != peer.mJammerGal)) { + return false; + } + return true; +} + +void SystemStatusRfAndParams::dump() +{ + LOC_LOGV("RfAndParams: u=%ld:%ld p=%d bi=%d bq=%d ai=%d aq=%d gp=%d gl=%d bd=%d ga=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mPgaGain, + mGpsBpAmpI, + mGpsBpAmpQ, + mAdcI, + mAdcQ, + mJammerGps, + mJammerGlo, + mJammerBds, + mJammerGal); + return; +} + +/****************************************************************************** + SystemStatusErrRecovery +******************************************************************************/ +SystemStatusErrRecovery::SystemStatusErrRecovery(const SystemStatusPQWM1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mRecErrorRecovery(nmea.mRecErrorRecovery) +{ +} + +bool SystemStatusErrRecovery::equals(SystemStatusErrRecovery& peer) +{ + if (mRecErrorRecovery != peer.mRecErrorRecovery) { + return false; + } + return true; +} + +void SystemStatusErrRecovery::dump() +{ + LOC_LOGV("ErrRecovery: u=%ld:%ld e=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mRecErrorRecovery); + return; +} + +/****************************************************************************** + SystemStatusInjectedPosition +******************************************************************************/ +SystemStatusInjectedPosition::SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mEpiValidity(nmea.mEpiValidity), + mEpiLat(nmea.mEpiLat), + mEpiLon(nmea.mEpiLon), + mEpiAlt(nmea.mEpiAlt), + mEpiHepe(nmea.mEpiHepe), + mEpiAltUnc(nmea.mEpiAltUnc), + mEpiSrc(nmea.mEpiSrc) +{ +} + +bool SystemStatusInjectedPosition::equals(SystemStatusInjectedPosition& peer) +{ + if ((mEpiValidity != peer.mEpiValidity) || + (mEpiLat != peer.mEpiLat) || + (mEpiLon != peer.mEpiLon) || + (mEpiAlt != peer.mEpiAlt) || + (mEpiHepe != peer.mEpiHepe) || + (mEpiAltUnc != peer.mEpiAltUnc) || + (mEpiSrc != peer.mEpiSrc)) { + return false; + } + return true; +} + +void SystemStatusInjectedPosition::dump() +{ + LOC_LOGV("InjectedPosition: u=%ld:%ld v=%x la=%f lo=%f al=%f he=%f au=%f es=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mEpiValidity, + mEpiLat, + mEpiLon, + mEpiAlt, + mEpiHepe, + mEpiAltUnc, + mEpiSrc); + return; +} + +/****************************************************************************** + SystemStatusBestPosition +******************************************************************************/ +SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mBestLat(nmea.mBestLat), + mBestLon(nmea.mBestLon), + mBestAlt(nmea.mBestAlt), + mBestHepe(nmea.mBestHepe), + mBestAltUnc(nmea.mBestAltUnc) +{ +} + +bool SystemStatusBestPosition::equals(SystemStatusBestPosition& peer) +{ + if ((mBestLat != peer.mBestLat) || + (mBestLon != peer.mBestLon) || + (mBestAlt != peer.mBestAlt) || + (mBestHepe != peer.mBestHepe) || + (mBestAltUnc != peer.mBestAltUnc)) { + return false; + } + return true; +} + +void SystemStatusBestPosition::dump() +{ + LOC_LOGV("BestPosition: u=%ld:%ld la=%f lo=%f al=%f he=%f au=%f", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mBestLat, + mBestLon, + mBestAlt, + mBestHepe, + mBestAltUnc); + return; +} + +/****************************************************************************** + SystemStatusXtra +******************************************************************************/ +SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mXtraValidMask(nmea.mXtraValidMask), + mGpsXtraAge(nmea.mGpsXtraAge), + mGloXtraAge(nmea.mGloXtraAge), + mBdsXtraAge(nmea.mBdsXtraAge), + mGalXtraAge(nmea.mGalXtraAge), + mQzssXtraAge(nmea.mQzssXtraAge), + mGpsXtraValid(nmea.mGpsXtraValid), + mGloXtraValid(nmea.mGloXtraValid), + mBdsXtraValid(nmea.mBdsXtraValid), + mGalXtraValid(nmea.mGalXtraValid), + mQzssXtraValid(nmea.mQzssXtraValid) +{ +} + +bool SystemStatusXtra::equals(SystemStatusXtra& peer) +{ + if ((mXtraValidMask != peer.mXtraValidMask) || + (mGpsXtraAge != peer.mGpsXtraAge) || + (mGloXtraAge != peer.mGloXtraAge) || + (mBdsXtraAge != peer.mBdsXtraAge) || + (mGalXtraAge != peer.mGalXtraAge) || + (mQzssXtraAge != peer.mQzssXtraAge) || + (mGpsXtraValid != peer.mGpsXtraValid) || + (mGloXtraValid != peer.mGloXtraValid) || + (mBdsXtraValid != peer.mBdsXtraValid) || + (mGalXtraValid != peer.mGalXtraValid) || + (mQzssXtraValid != peer.mQzssXtraValid)) { + return false; + } + return true; +} + +void SystemStatusXtra::dump() +{ + LOC_LOGV("SystemStatusXtra: u=%ld:%ld m=%x a=%d:%d:%d:%d:%d v=%x:%x:%x:%x:%x", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mXtraValidMask, + mGpsXtraAge, + mGloXtraAge, + mBdsXtraAge, + mGalXtraAge, + mQzssXtraAge, + mGpsXtraValid, + mGloXtraValid, + mBdsXtraValid, + mGalXtraValid, + mQzssXtraValid); + return; +} + +/****************************************************************************** + SystemStatusEphemeris +******************************************************************************/ +SystemStatusEphemeris::SystemStatusEphemeris(const SystemStatusPQWP4& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mGpsEpheValid(nmea.mGpsEpheValid), + mGloEpheValid(nmea.mGloEpheValid), + mBdsEpheValid(nmea.mBdsEpheValid), + mGalEpheValid(nmea.mGalEpheValid), + mQzssEpheValid(nmea.mQzssEpheValid) +{ +} + +bool SystemStatusEphemeris::equals(SystemStatusEphemeris& peer) +{ + if ((mGpsEpheValid != peer.mGpsEpheValid) || + (mGloEpheValid != peer.mGloEpheValid) || + (mBdsEpheValid != peer.mBdsEpheValid) || + (mGalEpheValid != peer.mGalEpheValid) || + (mQzssEpheValid != peer.mQzssEpheValid)) { + return false; + } + return true; +} + +void SystemStatusEphemeris::dump() +{ + LOC_LOGV("Ephemeris: u=%ld:%ld ev=%x:%x:%x:%x:%x", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mGpsEpheValid, + mGloEpheValid, + mBdsEpheValid, + mGalEpheValid, + mQzssEpheValid); + return; +} + +/****************************************************************************** + SystemStatusSvHealth +******************************************************************************/ +SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mGpsUnknownMask(nmea.mGpsUnknownMask), + mGloUnknownMask(nmea.mGloUnknownMask), + mBdsUnknownMask(nmea.mBdsUnknownMask), + mGalUnknownMask(nmea.mGalUnknownMask), + mQzssUnknownMask(nmea.mQzssUnknownMask), + mGpsGoodMask(nmea.mGpsGoodMask), + mGloGoodMask(nmea.mGloGoodMask), + mBdsGoodMask(nmea.mBdsGoodMask), + mGalGoodMask(nmea.mGalGoodMask), + mQzssGoodMask(nmea.mQzssGoodMask), + mGpsBadMask(nmea.mGpsBadMask), + mGloBadMask(nmea.mGloBadMask), + mBdsBadMask(nmea.mBdsBadMask), + mGalBadMask(nmea.mGalBadMask), + mQzssBadMask(nmea.mQzssBadMask) +{ +} + +bool SystemStatusSvHealth::equals(SystemStatusSvHealth& peer) +{ + if ((mGpsUnknownMask != peer.mGpsUnknownMask) || + (mGloUnknownMask != peer.mGloUnknownMask) || + (mBdsUnknownMask != peer.mBdsUnknownMask) || + (mGalUnknownMask != peer.mGalUnknownMask) || + (mQzssUnknownMask != peer.mQzssUnknownMask) || + (mGpsGoodMask != peer.mGpsGoodMask) || + (mGloGoodMask != peer.mGloGoodMask) || + (mBdsGoodMask != peer.mBdsGoodMask) || + (mGalGoodMask != peer.mGalGoodMask) || + (mQzssGoodMask != peer.mQzssGoodMask) || + (mGpsBadMask != peer.mGpsBadMask) || + (mGloBadMask != peer.mGloBadMask) || + (mBdsBadMask != peer.mBdsBadMask) || + (mGalBadMask != peer.mGalBadMask) || + (mQzssBadMask != peer.mQzssBadMask)) { + return false; + } + return true; +} + +void SystemStatusSvHealth::dump() +{ + LOC_LOGV("SvHealth: u=%ld:%ld u=%x:%x:%x:%x:%x g=%x:%x:%x:%x:%x b=%x:%x:%x:%x:%x", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mGpsUnknownMask, + mGloUnknownMask, + mBdsUnknownMask, + mGalUnknownMask, + mQzssUnknownMask, + mGpsGoodMask, + mGloGoodMask, + mBdsGoodMask, + mGalGoodMask, + mQzssGoodMask, + mGpsBadMask, + mGloBadMask, + mBdsBadMask, + mGalBadMask, + mQzssBadMask); + return; +} + +/****************************************************************************** + SystemStatusPdr +******************************************************************************/ +SystemStatusPdr::SystemStatusPdr(const SystemStatusPQWP6& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mFixInfoMask(nmea.mFixInfoMask) +{ +} + +bool SystemStatusPdr::equals(SystemStatusPdr& peer) +{ + if (mFixInfoMask != peer.mFixInfoMask) { + return false; + } + return true; +} + +void SystemStatusPdr::dump() +{ + LOC_LOGV("Pdr: u=%ld:%ld m=%x", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mFixInfoMask); + return; +} + +/****************************************************************************** + SystemStatusPositionFailure +******************************************************************************/ +SystemStatusPositionFailure::SystemStatusPositionFailure(const SystemStatusPQWS1& nmea) : + SystemStatusItemBase(nmea.mUtcTime), + mFixInfoMask(nmea.mFixInfoMask), + mHepeLimit(nmea.mHepeLimit) +{ +} + +bool SystemStatusPositionFailure::equals(SystemStatusPositionFailure& peer) +{ + if ((mFixInfoMask != peer.mFixInfoMask) || + (mHepeLimit != peer.mHepeLimit)) { + return false; + } + return true; +} + +void SystemStatusPositionFailure::dump() +{ + LOC_LOGV("PositionFailure: u=%ld:%ld m=%d h=%d", + mUtcTime.tv_sec, mUtcTime.tv_nsec, + mFixInfoMask, + mHepeLimit); + return; +} + +/****************************************************************************** + SystemStatus +******************************************************************************/ +pthread_mutex_t SystemStatus::mMutexSystemStatus = PTHREAD_MUTEX_INITIALIZER; + +SystemStatus::SystemStatus() +{ + mCache.mTimeAndClock.clear(); + mCache.mXoState.clear(); + mCache.mRfAndParams.clear(); + mCache.mErrRecovery.clear(); + + mCache.mInjectedPosition.clear(); + mCache.mBestPosition.clear(); + mCache.mXtra.clear(); + mCache.mEphemeris.clear(); + mCache.mSvHealth.clear(); + mCache.mPdr.clear(); + mCache.mPositionFailure.clear(); +} + +/****************************************************************************** + SystemStatus - M1 functions +******************************************************************************/ +bool SystemStatus::setTimeAndCLock(const SystemStatusPQWM1& nmea) +{ + SystemStatusTimeAndClock s(nmea); + if (mCache.mTimeAndClock.empty() || !mCache.mTimeAndClock.back().equals(s)) { + mCache.mTimeAndClock.push_back(s); + if (mCache.mTimeAndClock.size() > maxTimeAndClock) { + mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin()); + } + } + return true; +} + +bool SystemStatus::setXoState(const SystemStatusPQWM1& nmea) +{ + SystemStatusXoState s(nmea); + if (mCache.mXoState.empty() || !mCache.mXoState.back().equals(s)) { + mCache.mXoState.push_back(s); + if (mCache.mXoState.size() > maxXoState) { + mCache.mXoState.erase(mCache.mXoState.begin()); + } + } + return true; +} + +bool SystemStatus::setRfAndParams(const SystemStatusPQWM1& nmea) +{ + SystemStatusRfAndParams s(nmea); + if (mCache.mRfAndParams.empty() || !mCache.mRfAndParams.back().equals(s)) { + mCache.mRfAndParams.push_back(s); + if (mCache.mRfAndParams.size() > maxRfAndParams) { + mCache.mRfAndParams.erase(mCache.mRfAndParams.begin()); + } + } + return true; +} + +bool SystemStatus::setErrRecovery(const SystemStatusPQWM1& nmea) +{ + SystemStatusErrRecovery s(nmea); + if (mCache.mErrRecovery.empty() || !mCache.mErrRecovery.back().equals(s)) { + mCache.mErrRecovery.push_back(s); + if (mCache.mErrRecovery.size() > maxErrRecovery) { + mCache.mErrRecovery.erase(mCache.mErrRecovery.begin()); + } + } + return true; +} + +/****************************************************************************** + SystemStatus - Px functions +******************************************************************************/ +bool SystemStatus::setInjectedPosition(const SystemStatusPQWP1& nmea) +{ + SystemStatusInjectedPosition s(nmea); + if (mCache.mInjectedPosition.empty() || !mCache.mInjectedPosition.back().equals(s)) { + mCache.mInjectedPosition.push_back(s); + if (mCache.mInjectedPosition.size() > maxInjectedPosition) { + mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin()); + } + } + return true; +} + +bool SystemStatus::setBestPosition(const SystemStatusPQWP2& nmea) +{ + SystemStatusBestPosition s(nmea); + if (mCache.mBestPosition.empty() || !mCache.mBestPosition.back().equals(s)) { + mCache.mBestPosition.push_back(s); + if (mCache.mBestPosition.size() > maxBestPosition) { + mCache.mBestPosition.erase(mCache.mBestPosition.begin()); + } + } + return true; +} + +bool SystemStatus::setXtra(const SystemStatusPQWP3& nmea) +{ + SystemStatusXtra s(nmea); + if (mCache.mXtra.empty() || !mCache.mXtra.back().equals(s)) { + mCache.mXtra.push_back(s); + if (mCache.mXtra.size() > maxXtra) { + mCache.mXtra.erase(mCache.mXtra.begin()); + } + } + return true; +} + +bool SystemStatus::setEphemeris(const SystemStatusPQWP4& nmea) +{ + SystemStatusEphemeris s(nmea); + if (mCache.mEphemeris.empty() || !mCache.mEphemeris.back().equals(s)) { + mCache.mEphemeris.push_back(s); + if (mCache.mEphemeris.size() > maxEphemeris) { + mCache.mEphemeris.erase(mCache.mEphemeris.begin()); + } + } + return true; +} + +bool SystemStatus::setSvHealth(const SystemStatusPQWP5& nmea) +{ + SystemStatusSvHealth s(nmea); + if (mCache.mSvHealth.empty() || !mCache.mSvHealth.back().equals(s)) { + mCache.mSvHealth.push_back(s); + if (mCache.mSvHealth.size() > maxSvHealth) { + mCache.mSvHealth.erase(mCache.mSvHealth.begin()); + } + } + return true; +} + +bool SystemStatus::setPdr(const SystemStatusPQWP6& nmea) +{ + SystemStatusPdr s(nmea); + if (mCache.mPdr.empty() || !mCache.mPdr.back().equals(s)) { + mCache.mPdr.push_back(s); + if (mCache.mPdr.size() > maxPdr) { + mCache.mPdr.erase(mCache.mPdr.begin()); + } + } + return true; +} + +/****************************************************************************** + SystemStatus - Sx functions +******************************************************************************/ +bool SystemStatus::setPositionFailure(const SystemStatusPQWS1& nmea) +{ + SystemStatusPositionFailure s(nmea); + if (mCache.mPositionFailure.empty() || !mCache.mPositionFailure.back().equals(s)) { + mCache.mPositionFailure.push_back(s); + if (mCache.mPositionFailure.size() > maxPositionFailure) { + mCache.mPositionFailure.erase(mCache.mPositionFailure.begin()); + } + } + return true; +} + +/****************************************************************************** +@brief API to set report data into internal buffer + +@param[In] data pointer to the NMEA string +@param[In] len length of the NMEA string + +@return true when successfully done +******************************************************************************/ +static uint32_t cnt = 0; +static uint32_t cnt_m1 = 0; +static uint32_t cnt_p1 = 0; +static uint32_t cnt_p2 = 0; +static uint32_t cnt_p3 = 0; +static uint32_t cnt_p4 = 0; +static uint32_t cnt_p5 = 0; +static uint32_t cnt_p6 = 0; +static uint32_t cnt_s1 = 0; + +bool SystemStatus::setNmeaString(const char *data, uint32_t len) +{ + bool ret = false; + if (NULL == data + || (len < SystemStatusNmeaBase::NMEA_MINSIZE) + || (len > SystemStatusNmeaBase::NMEA_MAXSIZE)) { + return false; + } + + char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 }; + strncpy(buf, data, len); + LOC_LOGI("setNmeaString-0320a: len=%d str=%d nmea=%s", len, strlen(data), buf); + + pthread_mutex_lock(&mMutexSystemStatus); + + // parse the received nmea strings here + if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) { + SystemStatusPQWM1 s = SystemStatusPQWM1parser(buf, len).get(); + ret = setTimeAndCLock(s); + ret |= setXoState(s); + ret |= setRfAndParams(s); + ret |= setErrRecovery(s); + cnt_m1++; + } + else if (0 == strncmp(data, "$PQWP1", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setInjectedPosition(SystemStatusPQWP1parser(buf, len).get()); + cnt_p1++; + } + else if (0 == strncmp(data, "$PQWP2", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setBestPosition(SystemStatusPQWP2parser(buf, len).get()); + cnt_p2++; + } + else if (0 == strncmp(data, "$PQWP3", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setXtra(SystemStatusPQWP3parser(buf, len).get()); + cnt_p3++; + } + else if (0 == strncmp(data, "$PQWP4", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setEphemeris(SystemStatusPQWP4parser(buf, len).get()); + cnt_p4++; + } + else if (0 == strncmp(data, "$PQWP5", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setSvHealth(SystemStatusPQWP5parser(buf, len).get()); + cnt_p5++; + } + else if (0 == strncmp(data, "$PQWP6", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setPdr(SystemStatusPQWP6parser(buf, len).get()); + cnt_p6++; + } + else if (0 == strncmp(data, "$PQWS1", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setPositionFailure(SystemStatusPQWS1parser(buf, len).get()); + cnt_s1++; + } + else { + // do nothing + } + cnt++; + LOC_LOGV("setNmeaString: cnt=%d M:%d 1:%d 2:%d 3:%d 4:%d 5:%d 6:%d S:%d", + cnt, + cnt_m1, + cnt_p1, + cnt_p2, + cnt_p3, + cnt_p4, + cnt_p5, + cnt_p6, + cnt_s1); + + pthread_mutex_unlock(&mMutexSystemStatus); + return ret; +} + +/****************************************************************************** +@brief API to get report data into a given buffer + +@param[In] reference to report buffer +@param[In] bool flag to identify latest only or entire buffer + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) const +{ + pthread_mutex_lock(&mMutexSystemStatus); + + if (isLatestOnly) { + // push back only the latest report and return it + report.mTimeAndClock.clear(); + if (mCache.mTimeAndClock.size() >= 1) { + report.mTimeAndClock.push_back(mCache.mTimeAndClock.back()); + report.mTimeAndClock.back().dump(); + } + report.mXoState.clear(); + if (mCache.mXoState.size() >= 1) { + report.mXoState.push_back(mCache.mXoState.back()); + report.mXoState.back().dump(); + } + report.mRfAndParams.clear(); + if (mCache.mRfAndParams.size() >= 1) { + report.mRfAndParams.push_back(mCache.mRfAndParams.back()); + report.mRfAndParams.back().dump(); + } + report.mErrRecovery.clear(); + if (mCache.mErrRecovery.size() >= 1) { + report.mErrRecovery.push_back(mCache.mErrRecovery.back()); + report.mErrRecovery.back().dump(); + } + + report.mInjectedPosition.clear(); + if (mCache.mInjectedPosition.size() >= 1) { + report.mInjectedPosition.push_back(mCache.mInjectedPosition.back()); + report.mInjectedPosition.back().dump(); + } + report.mBestPosition.clear(); + if (mCache.mBestPosition.size() >= 1) { + report.mBestPosition.push_back(mCache.mBestPosition.back()); + report.mBestPosition.back().dump(); + } + report.mXtra.clear(); + if (mCache.mXtra.size() >= 1) { + report.mXtra.push_back(mCache.mXtra.back()); + report.mXtra.back().dump(); + } + report.mEphemeris.clear(); + if (mCache.mEphemeris.size() >= 1) { + report.mEphemeris.push_back(mCache.mEphemeris.back()); + report.mEphemeris.back().dump(); + } + report.mSvHealth.clear(); + if (mCache.mSvHealth.size() >= 1) { + report.mSvHealth.push_back(mCache.mSvHealth.back()); + report.mSvHealth.back().dump(); + } + report.mPdr.clear(); + if (mCache.mPdr.size() >= 1) { + report.mPdr.push_back(mCache.mPdr.back()); + report.mPdr.back().dump(); + } + report.mPositionFailure.clear(); + if (mCache.mPositionFailure.size() >= 1) { + report.mPositionFailure.push_back(mCache.mPositionFailure.back()); + report.mPositionFailure.back().dump(); + } + } + else { + // copy entire reports and return them + report.mTimeAndClock.clear(); + report.mXoState.clear(); + report.mRfAndParams.clear(); + report.mErrRecovery.clear(); + + report.mInjectedPosition.clear(); + report.mBestPosition.clear(); + report.mXtra.clear(); + report.mEphemeris.clear(); + report.mSvHealth.clear(); + report.mPdr.clear(); + report.mPositionFailure.clear(); + report = mCache; + } + + pthread_mutex_unlock(&mMutexSystemStatus); + return true; +} + +} // namespace loc_core + diff --git a/core/SystemStatus.h b/core/SystemStatus.h new file mode 100644 index 00000000..95f82da5 --- /dev/null +++ b/core/SystemStatus.h @@ -0,0 +1,275 @@ +/* Copyright (c) 2017, 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 __SYSTEM_STATUS__ +#define __SYSTEM_STATUS__ + +#include + +namespace loc_core +{ + +/****************************************************************************** + SystemStatus report data structure +******************************************************************************/ +class SystemStatusItemBase +{ +public: + timespec mUtcTime; + SystemStatusItemBase(timespec utctime) : mUtcTime(utctime) { }; + virtual ~SystemStatusItemBase() { }; + virtual void dump(void) { }; +}; + +class SystemStatusPQWM1; +class SystemStatusTimeAndClock : public SystemStatusItemBase +{ +public: + uint16_t mGpsWeek; + uint32_t mGpsTowMs; + uint8_t mTimeValid; + uint8_t mTimeSource; + int32_t mTimeUnc; + int32_t mClockFreqBias; + int32_t mClockFreqBiasUnc; + SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); + bool equals(SystemStatusTimeAndClock& peer); + void dump(void); +}; + +class SystemStatusXoState : public SystemStatusItemBase +{ +public: + uint8_t mXoState; + SystemStatusXoState(const SystemStatusPQWM1& nmea); + bool equals(SystemStatusXoState& peer); + void dump(void); +}; + +class SystemStatusRfAndParams : public SystemStatusItemBase +{ +public: + int32_t mPgaGain; + uint32_t mGpsBpAmpI; + uint32_t mGpsBpAmpQ; + uint32_t mAdcI; + uint32_t mAdcQ; + uint32_t mJammerGps; + uint32_t mJammerGlo; + uint32_t mJammerBds; + uint32_t mJammerGal; + SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); + bool equals(SystemStatusRfAndParams& peer); + void dump(void); +}; + +class SystemStatusErrRecovery : public SystemStatusItemBase +{ +public: + uint32_t mRecErrorRecovery; + SystemStatusErrRecovery(const SystemStatusPQWM1& nmea); + bool equals(SystemStatusErrRecovery& peer); + void dump(void); +}; + +class SystemStatusPQWP1; +class SystemStatusInjectedPosition : public SystemStatusItemBase +{ +public: + uint8_t mEpiValidity; + float mEpiLat; + float mEpiLon; + float mEpiAlt; + float mEpiHepe; + float mEpiAltUnc; + uint8_t mEpiSrc; + SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea); + bool equals(SystemStatusInjectedPosition& peer); + void dump(void); +}; + +class SystemStatusPQWP2; +class SystemStatusBestPosition : public SystemStatusItemBase +{ +public: + float mBestLat; + float mBestLon; + float mBestAlt; + float mBestHepe; + float mBestAltUnc; + SystemStatusBestPosition(const SystemStatusPQWP2& nmea); + bool equals(SystemStatusBestPosition& peer); + void dump(void); +}; + +class SystemStatusPQWP3; +class SystemStatusXtra : public SystemStatusItemBase +{ +public: + uint8_t mXtraValidMask; + uint32_t mGpsXtraAge; + uint32_t mGloXtraAge; + uint32_t mBdsXtraAge; + uint32_t mGalXtraAge; + uint32_t mQzssXtraAge; + uint32_t mGpsXtraValid; + uint32_t mGloXtraValid; + uint64_t mBdsXtraValid; + uint64_t mGalXtraValid; + uint8_t mQzssXtraValid; + SystemStatusXtra(const SystemStatusPQWP3& nmea); + bool equals(SystemStatusXtra& peer); + void dump(void); +}; + +class SystemStatusPQWP4; +class SystemStatusEphemeris : public SystemStatusItemBase +{ +public: + uint32_t mGpsEpheValid; + uint32_t mGloEpheValid; + uint64_t mBdsEpheValid; + uint64_t mGalEpheValid; + uint8_t mQzssEpheValid; + SystemStatusEphemeris(const SystemStatusPQWP4& nmea); + bool equals(SystemStatusEphemeris& peer); + void dump(void); +}; + +class SystemStatusPQWP5; +class SystemStatusSvHealth : public SystemStatusItemBase +{ +public: + uint32_t mGpsUnknownMask; + uint32_t mGloUnknownMask; + uint64_t mBdsUnknownMask; + uint64_t mGalUnknownMask; + uint8_t mQzssUnknownMask; + uint32_t mGpsGoodMask; + uint32_t mGloGoodMask; + uint64_t mBdsGoodMask; + uint64_t mGalGoodMask; + uint8_t mQzssGoodMask; + uint32_t mGpsBadMask; + uint32_t mGloBadMask; + uint64_t mBdsBadMask; + uint64_t mGalBadMask; + uint8_t mQzssBadMask; + SystemStatusSvHealth(const SystemStatusPQWP5& nmea); + bool equals(SystemStatusSvHealth& peer); + void dump(void); +}; + +class SystemStatusPQWP6; +class SystemStatusPdr : public SystemStatusItemBase +{ +public: + uint32_t mFixInfoMask; + SystemStatusPdr(const SystemStatusPQWP6& nmea); + bool equals(SystemStatusPdr& peer); + void dump(void); +}; + +class SystemStatusPQWS1; +class SystemStatusPositionFailure : public SystemStatusItemBase +{ +public: + uint32_t mFixInfoMask; + uint32_t mHepeLimit; + SystemStatusPositionFailure(const SystemStatusPQWS1& nmea); + bool equals(SystemStatusPositionFailure& peer); + void dump(void); +}; + +/****************************************************************************** + SystemStatusReports +******************************************************************************/ +class SystemStatusReports +{ +public: + std::vector mTimeAndClock; + std::vector mXoState; + std::vector mRfAndParams; + std::vector mErrRecovery; + + std::vector mInjectedPosition; + std::vector mBestPosition; + std::vector mXtra; + std::vector mEphemeris; + std::vector mSvHealth; + std::vector mPdr; + std::vector mPositionFailure; +}; + +/****************************************************************************** + SystemStatus +******************************************************************************/ +class SystemStatus +{ + static pthread_mutex_t mMutexSystemStatus; + + static const uint32_t maxTimeAndClock = 5; + static const uint32_t maxXoState = 5; + static const uint32_t maxRfAndParams = 5; + static const uint32_t maxErrRecovery = 5; + + static const uint32_t maxInjectedPosition = 5; + static const uint32_t maxBestPosition = 5; + static const uint32_t maxXtra = 5; + static const uint32_t maxEphemeris = 5; + static const uint32_t maxSvHealth = 5; + static const uint32_t maxPdr = 5; + static const uint32_t maxPositionFailure = 5; + + SystemStatusReports mCache; + + bool setTimeAndCLock(const SystemStatusPQWM1& nmea); + bool setXoState(const SystemStatusPQWM1& nmea); + bool setRfAndParams(const SystemStatusPQWM1& nmea); + bool setErrRecovery(const SystemStatusPQWM1& nmea); + + bool setInjectedPosition(const SystemStatusPQWP1& nmea); + bool setBestPosition(const SystemStatusPQWP2& nmea); + bool setXtra(const SystemStatusPQWP3& nmea); + bool setEphemeris(const SystemStatusPQWP4& nmea); + bool setSvHealth(const SystemStatusPQWP5& nmea); + bool setPdr(const SystemStatusPQWP6& nmea); + bool setPositionFailure(const SystemStatusPQWS1& nmea); + +public: + SystemStatus(); + ~SystemStatus() { } + + bool setNmeaString(const char *data, uint32_t len); + bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; +}; + +} // namespace loc_core + +#endif //__SYSTEM_STATUS__ + diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55fd03eb..965a2e6a 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -373,14 +373,15 @@ typedef uint32_t NmeaSentenceTypesMask; #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_MASK_DEBUG_V02 ((NmeaSentenceTypesMask)0x00020000) /**< Enable DEBUG 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 ) - - + LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 | \ + LOC_NMEA_MASK_DEBUG_V02 ) typedef enum { LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e37a9923..5240a542 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -40,6 +40,7 @@ #include #include #include +#include using namespace loc_core; @@ -509,9 +510,16 @@ GnssAdapter::setConfigCommand() mAdapter.convertLppeCp(ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY)); mApi.setLPPeProtocolUp( mAdapter.convertLppeUp(ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY)); + + // set nmea mask type + uint32_t mask = 0; if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { - mApi.setNMEATypes(LOC_NMEA_ALL_SUPPORTED_MASK); + mask = LOC_NMEA_ALL_SUPPORTED_MASK; + } else { + mask = LOC_NMEA_MASK_DEBUG_V02; } + mApi.setNMEATypes(mask); + mApi.setXtraVersionCheck(ContextBase::mGps_conf.XTRA_VERSION_CHECK); if (ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID || ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || @@ -999,8 +1007,7 @@ GnssAdapter::updateClientsEventMask() if (it->second.gnssSvCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_SATELLITE_REPORT; } - if (it->second.gnssNmeaCb != nullptr && - NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { + if (it->second.gnssNmeaCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; } if (it->second.gnssMeasurementsCb != nullptr) { @@ -1994,7 +2001,16 @@ GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) delete[] mNmea; } inline virtual void proc() const { - mAdapter.reportNmea(mNmea, mLength); + // extract bug report info - this returns true if consumed by systemstatus + bool ret = false; + SystemStatus* s = LocDualContext::getSystemStatus(); + if (nullptr != s) { + ret = s->setNmeaString(mNmea, mLength); + } + if (false == ret) { + // forward NMEA message to upper layer + mAdapter.reportNmea(mNmea, mLength); + } } }; From a5d69e1757ca1f90bc9bc708203211b8ae2c5e3a Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 16 Mar 2017 14:15:27 +0800 Subject: [PATCH 462/945] Enable LOGV for LocSvc_LocApiBase Define LOG_NDEBUG 0 to enable verbose log messages in LocApiBase.cpp CRs-fixed: 2018892 Change-Id: Ie3f5efaa728d863b8fd0ab268700e807b232dab3 --- core/LocApiBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3bbbf8f3..0036d887 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 //Define to enable LOGV #define LOG_TAG "LocSvc_LocApiBase" #include From 13888ddfd28dbf3bad9a3286f0188269b4bf93d7 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Thu, 5 Jan 2017 16:50:40 +0530 Subject: [PATCH 463/945] update NMEA logic with SBAS corrections Change-Id: Ibb4233cbcb6d223e507105c05a40136ea7924e75 CRs-Fixed: 1108696 --- core/gps_extended_c.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 55fd03eb..6289bd29 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -266,6 +266,18 @@ typedef uint16_t GpsLocationExtendedFlags; #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 +/** GpsLocationExtended has valid navSolutionMask */ +#define GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK 0x2000 + +typedef uint32_t LocNavSolutionMask; +/* Bitmask to specify whether SBAS ionospheric correction is used */ +#define LOC_NAV_MASK_SBAS_CORRECTION_IONO ((LocNavSolutionMask)0x0001) +/* Bitmask to specify whether SBAS fast correction is used */ +#define LOC_NAV_MASK_SBAS_CORRECTION_FAST ((LocNavSolutionMask)0x0002) +/**< Bitmask to specify whether SBAS long-tem correction is used */ +#define LOC_NAV_MASK_SBAS_CORRECTION_LONG ((LocNavSolutionMask)0x0004) +/**< Bitmask to specify whether SBAS integrity information is used */ +#define LOC_NAV_MASK_SBAS_INTEGRITY ((LocNavSolutionMask)0x0008) /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 @@ -277,6 +289,17 @@ typedef uint16_t GpsLocationExtendedFlags; #define GAL_SV_PRN_MIN 301 #define GAL_SV_PRN_MAX 336 +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) + typedef enum { LOC_RELIABILITY_NOT_SET = 0, LOC_RELIABILITY_VERY_LOW = 1, @@ -335,6 +358,10 @@ typedef struct { Gnss_ApTimeStampStructType timeStamp; /** Gnss sv used in position data */ GnssSvUsedInPosition gnss_sv_used_ids; + /** Nav solution mask to indicate sbas corrections */ + LocNavSolutionMask navSolutionMask; + /** Position technology used in computing this fix */ + LocPosTechMask tech_mask; } GpsLocationExtended; enum loc_sess_status { @@ -343,17 +370,6 @@ enum loc_sess_status { 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 */ From 4ff6da4a8ac818026999b21b37d1fb97a67f21c0 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 21 Mar 2017 17:16:49 -0700 Subject: [PATCH 464/945] SystemStatus - Add BugReport support Add BugReport support in SystemStatus. It exposes getReport interface to GnssDebug via GnssAdapter. GnssDebug generates Gnss' BugReport information upon a request tiggered by Android framework. Change-Id: I681777da10c860ea15ee65b7860a5ce61a7798db CRs-Fixed: 2016125 --- android/Android.mk | 1 + android/Gnss.cpp | 6 ++ android/Gnss.h | 6 +- android/GnssDebug.cpp | 117 ++++++++++++++++++++++++++++++++ android/GnssDebug.h | 59 ++++++++++++++++ core/SystemStatus.cpp | 65 +++++++++++++++++- core/SystemStatus.h | 31 +++++++++ gnss/GnssAdapter.cpp | 124 +++++++++++++++++++++++++++++++++- gnss/GnssAdapter.h | 7 ++ gnss/location_gnss.cpp | 11 ++- location/LocationAPI.h | 30 ++++++++ location/location_interface.h | 1 + 12 files changed, 452 insertions(+), 6 deletions(-) create mode 100644 android/GnssDebug.cpp create mode 100644 android/GnssDebug.h diff --git a/android/Android.mk b/android/Android.mk index b493f5e7..000cd59a 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -12,6 +12,7 @@ LOCAL_SRC_FILES := \ GnssMeasurement.cpp \ GnssNi.cpp \ GnssConfiguration.cpp \ + GnssDebug.cpp \ LOCAL_SRC_FILES += \ location_api/LocationUtil.cpp \ diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 1412883a..ce02eddb 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -309,6 +309,12 @@ Return> Gnss::getExtensionGnssBatching() { return mGnssBatching; } +Return> Gnss::getExtensionGnssDebug() { + ENTRY_LOG_CALLFLOW(); + mGnssDebug = new GnssDebug(this); + return mGnssDebug; +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/Gnss.h b/android/Gnss.h index b338b08e..99c5e40b 100644 --- a/android/Gnss.h +++ b/android/Gnss.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -102,9 +103,7 @@ struct Gnss : public IGnss { return nullptr; } - inline Return> getExtensionGnssDebug() override { - return nullptr; - } + Return> getExtensionGnssDebug() override; // These methods are not part of the IGnss base class. GnssAPIClient* getApi(); @@ -130,6 +129,7 @@ struct Gnss : public IGnss { sp mGnssConfig = nullptr; sp mGnssGeofencingIface = nullptr; sp mGnssBatching = nullptr; + sp mGnssDebug = nullptr; GnssAPIClient* mApi = nullptr; sp mGnssCbIface = nullptr; diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp new file mode 100644 index 00000000..3ab94d30 --- /dev/null +++ b/android/GnssDebug.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssDebugInterface" + +#include +#include +#include "Gnss.h" +#include "GnssDebug.h" +#include "LocationUtil.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_vec; + +GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) +{ +} + +/* + * This methods requests position, time and satellite ephemeris debug information + * from the HAL. + * + * @return void +*/ +Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) +{ + LOC_LOGI("GnssDebug - 0317a"); + + DebugData data = { }; + + if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){ + LOC_LOGE("GnssDebug - Null GNSS interface"); + _hidl_cb(data); + return Void(); + } + + // get debug report snapshot via hal interface + GnssDebugReport reports = { }; + mGnss->getGnssInterface()->getDebugReport(reports); + + // location block + data.position.valid = true; + data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; + data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; + data.position.altitudeMeters = reports.mLocation.mLocation.altitude; + data.position.speedMetersPerSec = (double)(reports.mLocation.mLocation.speed); + data.position.bearingDegrees = (double)(reports.mLocation.mLocation.bearing); + data.position.horizontalAccuracyMeters = (double)(reports.mLocation.mLocation.accuracy); + data.position.verticalAccuracyMeters = reports.mLocation.verticalAccuracyMeters; + data.position.speedAccuracyMetersPerSecond = reports.mLocation.speedAccuracyMetersPerSecond; + data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; + + LOC_LOGV("GnssDebug - lat=%f lon=%f", data.position.latitudeDegrees, data.position.longitudeDegrees); + + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mLocation.timestamp / 1000ULL; + tv_report.tv_usec = (reports.mLocation.mLocation.timestamp % 1000ULL) * 1000ULL; + gettimeofday(&tv_now, NULL); + data.position.ageSeconds = + (tv_now.tv_sec - tv_report.tv_sec) + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + + LOC_LOGV("GnssDebug - time now=%lld:%lld", tv_now.tv_sec, tv_now.tv_usec); + LOC_LOGV("GnssDebug - time rep=%lld:%lld", tv_report.tv_sec, tv_report.tv_usec); + LOC_LOGV("GnssDebug - age=%f", data.position.ageSeconds); + + // time block + data.time.valid = true; + data.time.timeEstimate = reports.mTime.timeEstimate; + data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; + + LOC_LOGV("GnssDebug - timeestimate=%lld", data.time.timeEstimate); + + // satellite data block + SatelliteData s = { }; + std::vector s_array = { }; + + for (uint32_t i=0; i +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssDebug; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* Interface for GNSS Debug support. */ +struct Gnss; +struct GnssDebug : public IGnssDebug { + GnssDebug(Gnss* gnss); + ~GnssDebug() {}; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. + * These declarations were generated from IGnssDebug.hal. + */ + Return getDebugData(getDebugData_cb _hidl_cb) override; + +private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 592344bd..7791410e 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1078,6 +1078,29 @@ void SystemStatusPositionFailure::dump() return; } +/****************************************************************************** + SystemStatusLocation +******************************************************************************/ +bool SystemStatusLocation::equals(SystemStatusLocation& peer) +{ + if ((mLocation.gpsLocation.latitude != peer.mLocation.gpsLocation.latitude) || + (mLocation.gpsLocation.longitude != peer.mLocation.gpsLocation.longitude) || + (mLocation.gpsLocation.altitude != peer.mLocation.gpsLocation.altitude)) { + return false; + } + return true; +} + +void SystemStatusLocation::dump() +{ + LOC_LOGV("Location: lat=%f lon=%f alt=%f spd=%f", + mLocation.gpsLocation.latitude, + mLocation.gpsLocation.longitude, + mLocation.gpsLocation.altitude, + mLocation.gpsLocation.speed); + return; +} + /****************************************************************************** SystemStatus ******************************************************************************/ @@ -1085,6 +1108,8 @@ pthread_mutex_t SystemStatus::mMutexSystemStatus = PTHREAD_MUTEX_INITIALIZER; SystemStatus::SystemStatus() { + mCache.mLocation.clear(); + mCache.mTimeAndClock.clear(); mCache.mXoState.clear(); mCache.mRfAndParams.clear(); @@ -1269,7 +1294,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 }; strncpy(buf, data, len); - LOC_LOGI("setNmeaString-0320a: len=%d str=%d nmea=%s", len, strlen(data), buf); + LOC_LOGI("setNmeaString-0321a: nmea=%s", buf); pthread_mutex_lock(&mMutexSystemStatus); @@ -1329,6 +1354,36 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) return ret; } +/****************************************************************************** +@brief API to set report position data into internal buffer + +@param[In] UlpLocation + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::eventPosition(const UlpLocation& location, + const GpsLocationExtended& locationEx) +{ + timespec ts; + ts.tv_sec = location.gpsLocation.timestamp / 1000ULL; + ts.tv_nsec = (location.gpsLocation.timestamp % 1000ULL) * 1000000ULL; + SystemStatusLocation s(location, locationEx, ts); + if ((mCache.mLocation.empty()) || !mCache.mLocation.back().equals(s)) { + mCache.mLocation.push_back(s); + if (mCache.mLocation.size() > maxLocation) { + mCache.mLocation.erase(mCache.mLocation.begin()); + } + + LOC_LOGV("eventPosition - lat=%f lon=%f alt=%f speed=%f", + s.mLocation.gpsLocation.latitude, + s.mLocation.gpsLocation.longitude, + s.mLocation.gpsLocation.altitude, + s.mLocation.gpsLocation.speed); + + } + return true; +} + /****************************************************************************** @brief API to get report data into a given buffer @@ -1343,6 +1398,12 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con if (isLatestOnly) { // push back only the latest report and return it + report.mLocation.clear(); + if (mCache.mLocation.size() >= 1) { + report.mLocation.push_back(mCache.mLocation.back()); + report.mLocation.back().dump(); + } + report.mTimeAndClock.clear(); if (mCache.mTimeAndClock.size() >= 1) { report.mTimeAndClock.push_back(mCache.mTimeAndClock.back()); @@ -1402,6 +1463,8 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con } else { // copy entire reports and return them + report.mLocation.clear(); + report.mTimeAndClock.clear(); report.mXoState.clear(); report.mRfAndParams.clear(); diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 95f82da5..208c669b 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -29,7 +29,16 @@ #ifndef __SYSTEM_STATUS__ #define __SYSTEM_STATUS__ +#include #include +#include + +#define GPS_MIN (1) +#define SBAS_MIN (33) +#define GLO_MIN (65) +#define BDS_MIN (201) +#define QZSS_MIN (193) +#define GAL_MIN (301) namespace loc_core { @@ -46,6 +55,21 @@ public: virtual void dump(void) { }; }; +class SystemStatusLocation : public SystemStatusItemBase +{ +public: + UlpLocation mLocation; + GpsLocationExtended mLocationEx; + SystemStatusLocation(const UlpLocation& location, + const GpsLocationExtended& locationEx, + const timespec& ts) : + SystemStatusItemBase(ts), + mLocation(location), + mLocationEx(locationEx){ }; + bool equals(SystemStatusLocation& peer); + void dump(void); +}; + class SystemStatusPQWM1; class SystemStatusTimeAndClock : public SystemStatusItemBase { @@ -212,6 +236,8 @@ public: class SystemStatusReports { public: + std::vector mLocation; + std::vector mTimeAndClock; std::vector mXoState; std::vector mRfAndParams; @@ -233,6 +259,8 @@ class SystemStatus { static pthread_mutex_t mMutexSystemStatus; + static const uint32_t maxLocation = 5; + static const uint32_t maxTimeAndClock = 5; static const uint32_t maxXoState = 5; static const uint32_t maxRfAndParams = 5; @@ -248,6 +276,8 @@ class SystemStatus SystemStatusReports mCache; + bool setLocation(const UlpLocation& location); + bool setTimeAndCLock(const SystemStatusPQWM1& nmea); bool setXoState(const SystemStatusPQWM1& nmea); bool setRfAndParams(const SystemStatusPQWM1& nmea); @@ -265,6 +295,7 @@ public: SystemStatus(); ~SystemStatus() { } + bool eventPosition(const UlpLocation& location,const GpsLocationExtended& locationEx); bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; }; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5240a542..855b1af8 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1813,6 +1813,11 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, mStatus(status), mTechMask(techMask) {} inline virtual void proc() const { + // extract bug report info - this returns true if consumed by systemstatus + SystemStatus* s = LocDualContext::getSystemStatus(); + if (nullptr != s) { + s->eventPosition(mUlpLocation, mLocationExtended); + } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); } }; @@ -1974,7 +1979,6 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) void GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) { - //LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); // if this event is not called from ULP, then try to call into ULP and return if successfull if (!fromUlp) { @@ -3239,3 +3243,121 @@ void GnssAdapter::dataConnFailedCommand(AGpsExtType agpsType){ sendMsg( new AgpsMsgAtlOpenFailed(&mAgpsManager, (AGpsExtType)agpsType)); } + +void GnssAdapter::convertSatelliteInfo(std::vector& out, + const GnssSvType& in_constellation, + const SystemStatusReports& in) +{ + GnssDebugSatelliteInfo s = {}; + uint64_t mask = 0ULL; + float age = 0.0; + uint32_t svid_min = 0; + uint32_t mask_size = 0; + + switch (in_constellation) { + case GNSS_SV_TYPE_GPS: + svid_min = GPS_MIN; + mask_size = 32; + break; + case GNSS_SV_TYPE_GLONASS: + svid_min = GLO_MIN; + mask_size = 32; + break; + case GNSS_SV_TYPE_BEIDOU: + svid_min = BDS_MIN; + mask_size = 64; + break; + case GNSS_SV_TYPE_QZSS: + svid_min = QZSS_MIN; + mask_size = 32; + break; + case GNSS_SV_TYPE_GALILEO: + svid_min = GAL_MIN; + mask_size = 64; + break; + default: + return; + } + + if(!in.mEphemeris.empty()) { + mask = in.mEphemeris.back().mGpsEpheValid; + if(!in.mXtra.empty()) { + age = (float)(in.mXtra.back().mGpsXtraAge); + } + else { + age = 0.0; + } + + for(uint32_t i=0; igetReport(reports, true); + + r.size = sizeof(r); + + // location block + r.mLocation.size = sizeof(r.mLocation); + if(!reports.mLocation.empty()) { + r.mLocation.mLocation.latitude = reports.mLocation.back().mLocation.gpsLocation.latitude; + r.mLocation.mLocation.longitude = reports.mLocation.back().mLocation.gpsLocation.longitude; + r.mLocation.mLocation.altitude = reports.mLocation.back().mLocation.gpsLocation.altitude; + r.mLocation.mLocation.speed = (double)(reports.mLocation.back().mLocation.gpsLocation.speed); + r.mLocation.mLocation.bearing = (double)(reports.mLocation.back().mLocation.gpsLocation.bearing); + r.mLocation.mLocation.accuracy = (double)(reports.mLocation.back().mLocation.gpsLocation.accuracy); + + r.mLocation.verticalAccuracyMeters = reports.mLocation.back().mLocationEx.vert_unc; + r.mLocation.speedAccuracyMetersPerSecond = reports.mLocation.back().mLocationEx.speed_unc; + r.mLocation.bearingAccuracyDegrees = reports.mLocation.back().mLocationEx.bearing_unc; + } + else if(!reports.mBestPosition.empty()) { + r.mLocation.mLocation.latitude = (double)(reports.mBestPosition.back().mBestLat); + r.mLocation.mLocation.longitude = (double)(reports.mBestPosition.back().mBestLon); + r.mLocation.mLocation.altitude = reports.mBestPosition.back().mBestAlt; + } + LOC_LOGV("getDebugReport - lat=%f lon=%f alt=%f speed=%f", + r.mLocation.mLocation.latitude, + r.mLocation.mLocation.longitude, + r.mLocation.mLocation.altitude, + r.mLocation.mLocation.speed); + + // time block + if(!reports.mBestPosition.empty()) { + r.mTime.size = sizeof(r.mTime); + r.mTime.timeEstimate = reports.mBestPosition.back().mUtcTime.tv_sec; + r.mTime.timeUncertaintyNs = (float)(reports.mTimeAndClock.back().mTimeUnc); + } + LOC_LOGV("getDebugReport - timeestimate=%lld", r.mTime.timeEstimate); + + // satellite info block + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GPS, reports); + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GLONASS, reports); + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_BEIDOU, reports); + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_QZSS, reports); + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GALILEO, reports); + LOC_LOGV("getDebugReport - satellite=%d", r.mSatelliteInfo.size()); + + return true; +} + diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index f5a53004..626b87ff 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -34,6 +34,7 @@ #include #include #include +#include #define MAX_URL_LEN 256 #define NMEA_SENTENCE_MAX_LENGTH 200 @@ -255,6 +256,9 @@ public: /*======== UTILITIES ================================================================*/ int nmeaPutChecksum(char *nmea, size_t maxSize); + /*======== GNSSDEBUG ================================================================*/ + bool getDebugReport(GnssDebugReport& report); + /*==== CONVERSION ===================================================================*/ static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock); @@ -270,6 +274,9 @@ public: static GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask); static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask); + static void convertSatelliteInfo(std::vector& out, + const GnssSvType& in_constellation, + const SystemStatusReports& in); void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 0995f4b2..018b7f71 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -58,6 +58,7 @@ static void agpsInit(void* statusV4Cb); static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnLen, int ipType); static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); +static void getDebugReport(GnssDebugReport& report); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -80,7 +81,8 @@ static const GnssInterface gGnssInterface = { agpsInit, agpsDataConnOpen, agpsDataConnClosed, - agpsDataConnFailed + agpsDataConnFailed, + getDebugReport, }; #ifndef DEBUG_X86 @@ -239,3 +241,10 @@ static void agpsDataConnFailed(AGpsExtType agpsType) { gGnssAdapter->dataConnFailedCommand(agpsType); } } + +static void getDebugReport(GnssDebugReport& report) { + + if (NULL != gGnssAdapter) { + gGnssAdapter->getDebugReport(report); + } +} diff --git a/location/LocationAPI.h b/location/LocationAPI.h index cc15ddd3..6c718f7b 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -29,6 +29,7 @@ #ifndef LOCATION_H #define LOCATION_H +#include #include #include @@ -553,6 +554,35 @@ typedef struct { GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits } GnssConfig; +typedef struct { + size_t size; // set to sizeof + Location mLocation; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; +} GnssDebugLocation; + +typedef struct { + size_t size; // set to sizeof + int64_t timeEstimate; + float timeUncertaintyNs; +} GnssDebugTime; + +typedef struct { + size_t size; // set to sizeof + uint32_t svid; + GnssSvType constellation; + uint32_t ephemerisType; + float ephemerisAgeSeconds; +} GnssDebugSatelliteInfo; + +typedef struct { + size_t size; // set to sizeof + GnssDebugLocation mLocation; + GnssDebugTime mTime; + std::vector mSatelliteInfo; +} GnssDebugReport; + /* Provides the capabilities of the system capabilities callback is called once soon after createInstance is called */ typedef std::function Date: Fri, 17 Mar 2017 10:51:28 -0700 Subject: [PATCH 465/945] Addition of vertical/speed/bearing accuracy feilds Fill in the new feilds of vertical/speed/bearing accuracy into hidl structure CRs-fixed: 2021399 Change-Id: I409e2559e671e65c307758ee273c64f98f650c11 --- android/location_api/LocationUtil.cpp | 18 ++++++++------- gnss/GnssAdapter.cpp | 27 +++++++++++----------- gnss/GnssAdapter.h | 1 + location/LocationAPI.h | 32 +++++++++++++-------------- 4 files changed, 41 insertions(+), 37 deletions(-) diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp index dbafe5d3..d7823758 100644 --- a/android/location_api/LocationUtil.cpp +++ b/android/location_api/LocationUtil.cpp @@ -46,21 +46,23 @@ void convertGnssLocation(Location& in, GnssLocation& out) out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED; if (in.flags & LOCATION_HAS_BEARING_BIT) out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING; - if (in.flags & LOCATION_HAS_ACCURACY_BIT) { + if (in.flags & LOCATION_HAS_ACCURACY_BIT) out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY; - //out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; - //out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; - //out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; - } + if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; + if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; + if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; out.latitudeDegrees = in.latitude; out.longitudeDegrees = in.longitude; out.altitudeMeters = in.altitude; out.speedMetersPerSec = in.speed; out.bearingDegrees = in.bearing; out.horizontalAccuracyMeters = in.accuracy; - //out.verticalAccuracyMeters = in.accuracy; - //out.speedAccuracyMetersPerSecond = in.accuracy; - //out.bearingAccuracyDegrees = in.accuracy; + out.verticalAccuracyMeters = in.verticalAccuracy; + out.speedAccuracyMetersPerSecond = in.speedAccuracy; + out.bearingAccuracyDegrees = in.bearingAccuracy; out.timestamp = static_cast(in.timestamp); } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 6cce9d1d..0c309d29 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -113,6 +113,7 @@ GnssAdapter::convertOptions(LocPosMode& out, const LocationOptions& options) void GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation, + const GpsLocationExtended& locationExtended, const LocPosTechMask techMask) { out.size = sizeof(Location); @@ -137,6 +138,18 @@ GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation out.flags |= LOCATION_HAS_ACCURACY_BIT; out.accuracy = locGpsLocation.accuracy; } + if (GPS_LOCATION_EXTENDED_HAS_VERT_UNC & locationExtended.flags) { + out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; + out.verticalAccuracy = locationExtended.vert_unc; + } + if (GPS_LOCATION_EXTENDED_HAS_SPEED_UNC & locationExtended.flags) { + out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT; + out.speedAccuracy = locationExtended.speed_unc; + } + if (GPS_LOCATION_EXTENDED_HAS_BEARING_UNC & locationExtended.flags) { + out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; + out.bearingAccuracy = locationExtended.bearing_unc; + } out.timestamp = locGpsLocation.timestamp; if (LOC_POS_TECH_MASK_SATELLITE & techMask) { out.techMask |= LOCATION_TECHNOLOGY_GNSS_BIT; @@ -171,18 +184,6 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT; out.magneticDeviation = locationExtended.magneticDeviation; } - if (GPS_LOCATION_EXTENDED_HAS_VERT_UNC & locationExtended.flags) { - out.flags |= GNSS_LOCATION_INFO_VER_ACCURACY_BIT; - out.verAccuracy = locationExtended.vert_unc; - } - if (GPS_LOCATION_EXTENDED_HAS_SPEED_UNC & locationExtended.flags) { - out.flags |= GNSS_LOCATION_INFO_SPEED_ACCURACY_BIT; - out.speedAccuracy = locationExtended.speed_unc; - } - if (GPS_LOCATION_EXTENDED_HAS_BEARING_UNC & locationExtended.flags) { - out.flags |= GNSS_LOCATION_INFO_BEARING_ACCURACY_BIT; - out.bearingAccuracy = locationExtended.bearing_unc; - } if (GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT; switch (locationExtended.horizontal_reliability) { @@ -1858,7 +1859,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { if (nullptr != it->second.trackingCb) { Location location = {}; - convertLocation(location, ulpLocation.gpsLocation, techMask); + convertLocation(location, ulpLocation.gpsLocation, locationExtended, techMask); it->second.trackingCb(location); } if (nullptr != it->second.gnssLocationInfoCb) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index f5a53004..24af4f68 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -103,6 +103,7 @@ class GnssAdapter : public LocAdapterBase { /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation, + const GpsLocationExtended& locationExtended, const LocPosTechMask techMask); static void convertLocationInfo(GnssLocationInfoNotification& out, const GpsLocationExtended& locationExtended); diff --git a/location/LocationAPI.h b/location/LocationAPI.h index cc15ddd3..579aa422 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -52,11 +52,14 @@ typedef enum { // Flags to indicate which values are valid in a Location typedef uint16_t LocationFlagsMask; typedef enum { - LOCATION_HAS_LAT_LONG_BIT = (1<<0), // location has valid latitude and longitude - LOCATION_HAS_ALTITUDE_BIT = (1<<1), // location has valid altitude - LOCATION_HAS_SPEED_BIT = (1<<2), // location has valid speed - LOCATION_HAS_BEARING_BIT = (1<<3), // location has valid bearing - LOCATION_HAS_ACCURACY_BIT = (1<<4), // location has valid accuracy + LOCATION_HAS_LAT_LONG_BIT = (1<<0), // location has valid latitude and longitude + LOCATION_HAS_ALTITUDE_BIT = (1<<1), // location has valid altitude + LOCATION_HAS_SPEED_BIT = (1<<2), // location has valid speed + LOCATION_HAS_BEARING_BIT = (1<<3), // location has valid bearing + LOCATION_HAS_ACCURACY_BIT = (1<<4), // location has valid accuracy + LOCATION_HAS_VERTICAL_ACCURACY_BIT = (1<<5), // location has valid vertical accuracy + LOCATION_HAS_SPEED_ACCURACY_BIT = (1<<6), // location has valid speed accuracy + LOCATION_HAS_BEARING_ACCURACY_BIT = (1<<7), // location has valid bearing accuracy } LocationFlagsBits; typedef uint16_t LocationTechnologyMask; @@ -80,14 +83,11 @@ typedef enum { GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT = (1<<0), // valid altitude mean sea level GNSS_LOCATION_INFO_DOP_BIT = (1<<1), // valid pdop, hdop, and vdop GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT = (1<<2), // valid magnetic deviation - GNSS_LOCATION_INFO_VER_ACCURACY_BIT = (1<<3), // valid vertical accuracy - GNSS_LOCATION_INFO_SPEED_ACCURACY_BIT = (1<<4), // valid speed accuracy - GNSS_LOCATION_INFO_BEARING_ACCURACY_BIT = (1<<5), // valid bearing accuracy - GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT = (1<<6), // valid horizontal reliability - GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<7), // valid vertical reliability - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<8), // valid elipsode semi major - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<9), // valid elipsode semi minor - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<10),// valid accuracy elipsode azimuth + GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT = (1<<3), // valid horizontal reliability + GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<4), // valid vertical reliability + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7),// valid accuracy elipsode azimuth } GnssLocationInfoFlagBits; typedef enum { @@ -393,6 +393,9 @@ typedef struct { float speed; // in meters per second float bearing; // in degrees; range [0, 360) float accuracy; // in meters + float verticalAccuracy; // in meters + float speedAccuracy; // in meters/second + float bearingAccuracy; // in degrees (0 to 359.999) LocationTechnologyMask techMask; } Location; @@ -441,9 +444,6 @@ typedef struct { float hdop; // horizontal dilusion of precision float vdop; // vertical dilusion of precision float magneticDeviation; // magnetic deviation - float verAccuracy; // vertical accuracy in meters - float speedAccuracy; // speed accuracy in meters/second - float bearingAccuracy; // bearing accuracy in degrees (0 to 359.999) LocationReliability horReliability; // horizontal reliability LocationReliability verReliability; // vertical reliability float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis From 2e87b20579e0f5e910102a971e4f84935e8b682c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 20 Mar 2017 15:04:36 -0700 Subject: [PATCH 466/945] Check Null on call to LocationAPI::addGeofence We need to handle the case where addGeofence returns Null, which can happen on error conditions, like when dlopen/dlsym libgeofence.so fails Bug: 36407968 CRs-fixed: 2022286 Change-Id: Ib612d92b77cf5532ad19154c57ee0545674d88f9 --- android/location_api/GeofenceAPIClient.cpp | 5 ++++- location/LocationAPIClientBase.cpp | 17 +++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp index 5be1cff2..ee4bfc38 100644 --- a/android/location_api/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -100,7 +100,10 @@ void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, doubl data.longitude = longitude; data.radius = radius_meters; - locAPIAddGeofences(1, &geofence_id, &options, &data); + LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data); + if (LOCATION_ERROR_SUCCESS != err) { + onAddGeofencesCb(1, &err, &geofence_id); + } } void GeofenceAPIClient::geofencePause(uint32_t geofence_id) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index da56440b..6ced55a0 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -409,17 +409,18 @@ uint32_t LocationAPIClientBase::locAPIAddGeofences( delete requests; } uint32_t* sessions = mLocationAPI->addGeofences(count, options, data); - LOC_LOGI("%s:%d] start new sessions: %p", __FUNCTION__, __LINE__, sessions); - requests = new RequestQueue(-1); - requests->push(new AddGeofencesRequest(*this)); - mRequestQueues[REQUEST_GEOFENCE] = requests; + if (sessions) { + LOC_LOGI("%s:%d] start new sessions: %p", __FUNCTION__, __LINE__, sessions); + requests = new RequestQueue(-1); + requests->push(new AddGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE] = requests; - for (size_t i = 0; i < count; i++) { - mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); + for (size_t i = 0; i < count; i++) { + mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); + } + retVal = LOCATION_ERROR_SUCCESS; } pthread_mutex_unlock(&mMutex); - - retVal = LOCATION_ERROR_SUCCESS; } return retVal; From 3ad14ba82768ca4e2d86908377e7288d42b6fe78 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 22 Mar 2017 10:03:19 -0700 Subject: [PATCH 467/945] Added support for AGC Added support for AGC (automatic gain control) CRs-fixed: 2023324 Change-Id: I6d6da23aab66da14bfa594077beda15194bdbeba --- android/location_api/MeasurementAPIClient.cpp | 3 ++ core/SystemStatus.cpp | 38 +++++++++++++++++-- core/SystemStatus.h | 4 ++ location/LocationAPI.h | 2 + 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 30e7b40a..8e6f48c6 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -166,6 +166,8 @@ static void convertGnssMeasurement(GnssMeasurementsData& in, out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE; if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL; out.svid = in.svId; convertGnssConstellationType(in.svType, out.constellation); out.timeOffsetNs = in.timeOffsetNs; @@ -226,6 +228,7 @@ static void convertGnssMeasurement(GnssMeasurementsData& in, out.multipathIndicator = static_cast(indicator); out.snrDb = in.signalToNoiseRatioDb; + out.agcLevelDb = in.agcLevelDb; } static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 7791410e..a7f282df 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -128,6 +128,10 @@ public: uint32_t mJammerBds; // x10 uint32_t mJammerGal; // x11 uint32_t mRecErrorRecovery; // x12 + double mAgcGps; // x13 + double mAgcGlo; // x14 + double mAgcBds; // x15 + double mAgcGal; // x16 }; // parser @@ -155,6 +159,10 @@ private: eJammerBds = 16, eJammerGal = 17, eRecErrorRecovery = 18, + eAgcGps = 19, + eAgcGlo = 20, + eAgcBds = 21, + eAgcGal = 22, eMax = eRecErrorRecovery }; SystemStatusPQWM1 mM1; @@ -177,6 +185,10 @@ public: inline uint32_t getJammerGlo() { return mM1.mJammerGlo; } inline uint32_t getJammerBds() { return mM1.mJammerBds; } inline uint32_t getJammerGal() { return mM1.mJammerGal; } + inline uint32_t getAgcGps() { return mM1.mAgcGps; } + inline uint32_t getAgcGlo() { return mM1.mAgcGlo; } + inline uint32_t getAgcBds() { return mM1.mAgcBds; } + inline uint32_t getAgcGal() { return mM1.mAgcGal; } inline uint32_t getRecErrorRecovery() { return mM1.mRecErrorRecovery; } SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) @@ -209,6 +221,10 @@ public: mM1.mJammerBds = atoi(mField[eJammerBds].c_str()); mM1.mJammerGal = atoi(mField[eJammerGal].c_str()); mM1.mRecErrorRecovery = atoi(mField[eRecErrorRecovery].c_str()); + mM1.mAgcGps = atof(mField[eAgcGps].c_str()); + mM1.mAgcGlo = atof(mField[eAgcGlo].c_str()); + mM1.mAgcBds = atof(mField[eAgcBds].c_str()); + mM1.mAgcGal = atof(mField[eAgcGal].c_str()); } inline SystemStatusPQWM1& get() { return mM1;} //getparser @@ -725,7 +741,11 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea) mJammerGps(nmea.mJammerGps), mJammerGlo(nmea.mJammerGlo), mJammerBds(nmea.mJammerBds), - mJammerGal(nmea.mJammerGal) + mJammerGal(nmea.mJammerGal), + mAgcGps(nmea.mAgcGps), + mAgcGlo(nmea.mAgcGlo), + mAgcBds(nmea.mAgcBds), + mAgcGal(nmea.mAgcGal) { } @@ -739,7 +759,11 @@ bool SystemStatusRfAndParams::equals(SystemStatusRfAndParams& peer) (mJammerGps != peer.mJammerGps) || (mJammerGlo != peer.mJammerGlo) || (mJammerBds != peer.mJammerBds) || - (mJammerGal != peer.mJammerGal)) { + (mJammerGal != peer.mJammerGal) || + (mAgcGps != peer.mAgcGps) || + (mAgcGlo != peer.mAgcGlo) || + (mAgcBds != peer.mAgcBds) || + (mAgcGal != peer.mAgcGal)) { return false; } return true; @@ -747,7 +771,9 @@ bool SystemStatusRfAndParams::equals(SystemStatusRfAndParams& peer) void SystemStatusRfAndParams::dump() { - LOC_LOGV("RfAndParams: u=%ld:%ld p=%d bi=%d bq=%d ai=%d aq=%d gp=%d gl=%d bd=%d ga=%d", + LOC_LOGV("RfAndParams: u=%ld:%ld p=%d bi=%d bq=%d ai=%d aq=%d " + "jgp=%d jgl=%d jbd=%d jga=%d " + "agp=%lf agl=%lf abd=%lf aga=%lf", mUtcTime.tv_sec, mUtcTime.tv_nsec, mPgaGain, mGpsBpAmpI, @@ -757,7 +783,11 @@ void SystemStatusRfAndParams::dump() mJammerGps, mJammerGlo, mJammerBds, - mJammerGal); + mJammerGal, + mAgcGps, + mAgcGlo, + mAgcBds, + mAgcGal); return; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 208c669b..f001f610 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -107,6 +107,10 @@ public: uint32_t mJammerGlo; uint32_t mJammerBds; uint32_t mJammerGal; + double mAgcGps; + double mAgcGlo; + double mAgcBds; + double mAgcGal; SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); bool equals(SystemStatusRfAndParams& peer); void dump(void); diff --git a/location/LocationAPI.h b/location/LocationAPI.h index 6c718f7b..509baeff 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -295,6 +295,7 @@ typedef enum { GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT = (1<<14), GNSS_MEASUREMENTS_DATA_MULTIPATH_INDICATOR_BIT = (1<<15), GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT = (1<<16), + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT = (1<<17), } GnssMeasurementsDataFlagsBits; typedef uint32_t GnssMeasurementsStateMask; @@ -503,6 +504,7 @@ typedef struct { double carrierPhaseUncertainty; GnssMeasurementsMultipathIndicator multipathIndicator; double signalToNoiseRatioDb; + double agcLevelDb; } GnssMeasurementsData; typedef struct { From bbbca84aa62855e4d8616d9f4925d41a3af691ce Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 9 Jan 2017 19:17:20 -0800 Subject: [PATCH 468/945] LOC logging macro changes The current logging macro always uses LOGE, which is confusing to external developer looking at our logs. Also changed LOC_LOGx definition to follow the same syntax as that of LOC_LOGX. Bug: 29499503 Change-Id: I803233a9d0b241bf9aeb2ee0d4bd2e7cc52ed75b CRs-Fixed: 1113702 --- utils/log_util.h | 68 +++++++------------ .../loc_pla/include/platform_lib_log_util.h | 68 +++++++------------ 2 files changed, 46 insertions(+), 90 deletions(-) diff --git a/utils/log_util.h b/utils/log_util.h index d27c800d..7eb338a5 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -99,46 +99,24 @@ extern char* get_timestamp(char* str, unsigned long buf_size); 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__); } +#define LOC_LOGE(...) IF_LOC_LOGE { ALOGE(__VA_ARGS__); } +#define LOC_LOGW(...) IF_LOC_LOGW { ALOGW(__VA_ARGS__); } +#define LOC_LOGI(...) IF_LOC_LOGI { ALOGI(__VA_ARGS__); } +#define LOC_LOGD(...) IF_LOC_LOGD { ALOGD(__VA_ARGS__); } +#define LOC_LOGV(...) IF_LOC_LOGV { ALOGV(__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__) +#define LOC_LOGE(...) ALOGE(__VA_ARGS__) +#define LOC_LOGW(...) ALOGW(__VA_ARGS__) +#define LOC_LOGI(...) ALOGI(__VA_ARGS__) +#define LOC_LOGD(...) ALOGD(__VA_ARGS__) +#define LOC_LOGV(...) ALOGV(__VA_ARGS__) #endif /* DEBUG_DMN_LOC_API */ @@ -159,32 +137,32 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } 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 LOC_LOG_HEAD(fmt) "%s:%d] " fmt +#define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __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 ENTRY_LOG() LOG_V(ENTRY_TAG, __FUNCTION__, %s, "") +#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL) #define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \ + LOG_E(EXIT_ERROR_TAG, __FUNCTION__, SPEC, VAL); \ } else { \ - LOG_V(EXIT_TAG, __func__, SPEC, VAL); \ + LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL); \ } // Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") +#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %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) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL) +// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") +#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL) // Used for logging callflow to Android Framework #define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index 5989c643..26d3c29a 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -98,46 +98,24 @@ char* get_timestamp(char* str, unsigned long buf_size); 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__); } +#define LOC_LOGE(...) IF_LOC_LOGE { ALOGE(__VA_ARGS__); } +#define LOC_LOGW(...) IF_LOC_LOGW { ALOGW(__VA_ARGS__); } +#define LOC_LOGI(...) IF_LOC_LOGI { ALOGI(__VA_ARGS__); } +#define LOC_LOGD(...) IF_LOC_LOGD { ALOGD(__VA_ARGS__); } +#define LOC_LOGV(...) IF_LOC_LOGV { ALOGV(__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__) +#define LOC_LOGE(...) ALOGE(__VA_ARGS__) +#define LOC_LOGW(...) ALOGW(__VA_ARGS__) +#define LOC_LOGI(...) ALOGI(__VA_ARGS__) +#define LOC_LOGD(...) ALOGD(__VA_ARGS__) +#define LOC_LOGV(...) ALOGV(__VA_ARGS__) #endif /* DEBUG_DMN_LOC_API */ @@ -158,32 +136,32 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } 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 LOC_LOG_HEAD(fmt) "%s:%d] " fmt +#define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __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 ENTRY_LOG() LOG_V(ENTRY_TAG, __FUNCTION__, %s, "") +#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL) #define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \ + LOG_E(EXIT_ERROR_TAG, __FUNCTION__, SPEC, VAL); \ } else { \ - LOG_V(EXIT_TAG, __func__, SPEC, VAL); \ + LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL); \ } // Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") +#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %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) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL) +// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") +#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL) // Used for logging callflow to Android Framework #define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) From acf1cba02df7a3b10161b95628fcdf9f88d67e14 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Thu, 23 Mar 2017 17:15:04 +0530 Subject: [PATCH 469/945] nmea: call the right function for reporting AP generated NMEA When AP generates NMEA, we need call the right function to forward the sentence to Adapter and then to framework. Change-Id: I537c19f900b7d72ec38dc29b789329c52c0b2811 CRs-Fixed: 2023810 --- gnss/GnssAdapter.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 66211714..952af9c0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2043,7 +2043,6 @@ GnssAdapter::reportNmea(const char* nmea, size_t length) it->second.gnssNmeaCb(nmeaNotification); } } - } bool @@ -2374,23 +2373,23 @@ GnssAdapter::generateNmeaBlank() strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); } void @@ -2425,7 +2424,7 @@ GnssAdapter::generateNmeaGSV(const GnssSvNotification& svNotify, NmeaSvMeta& svM // no svs in view, so just send a blank $--GSV sentence snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", svMeta.talker); length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); return; } @@ -2477,7 +2476,7 @@ GnssAdapter::generateNmeaGSV(const GnssSvNotification& svNotify, NmeaSvMeta& svM } length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); sentenceNumber++; } //while } @@ -2567,7 +2566,7 @@ GnssAdapter::generateNmeaGSA(const GpsLocationExtended& locationExtended, /* Sentence is ready, add checksum and broadcast */ length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); return svUsedCount; } @@ -2642,7 +2641,7 @@ GnssAdapter::generateNmeaVTG(const UlpLocation& ulpLocation, length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); } void @@ -2786,7 +2785,7 @@ GnssAdapter::generateNmeaRMC(const UlpLocation& ulpLocation, } length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); } void @@ -2914,7 +2913,7 @@ GnssAdapter::generateNmeaGGA(const UlpLocation& ulpLocation, } length = nmeaPutChecksum(sentence, size); - reportNmeaEvent(sentence, length); + reportNmea(sentence, length); } /* INIT LOC AGPS MANAGER */ From 4fc5a782cf9899ff7d80f59ca4e77cd9002adc9d Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 28 Mar 2017 12:00:07 +0800 Subject: [PATCH 470/945] correct the conversion of ConstellationType map GNSS_SV_TYPE_GPS to GnssConstellationType::GPS Bug: 36644020 CRs-fixed: 2025520 Change-Id: I28fe4b5aff17495f50b0ae7fb0465bbd82a66627 --- android/location_api/LocationUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp index d7823758..4ebc9143 100644 --- a/android/location_api/LocationUtil.cpp +++ b/android/location_api/LocationUtil.cpp @@ -70,7 +70,7 @@ void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) { switch(in) { case GNSS_SV_TYPE_GPS: - out = GnssConstellationType::UNKNOWN; + out = GnssConstellationType::GPS; break; case GNSS_SV_TYPE_SBAS: out = GnssConstellationType::SBAS; From 06e6d68aee14fcc39d577ec44de4c99cd785a2f3 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 23 Dec 2016 10:42:44 +0530 Subject: [PATCH 471/945] move nmea generation logic inside utils NMEA generation logic needs to be reused across the interface boundaries. Moved this logic inside utils. Change-Id: Icb5c6fbc38b178c5edea468d26286e21749bfbfb CRs-Fixed: 1098734 --- Makefile.am | 2 +- configure.ac | 4 + core/Android.mk | 3 - core/Makefile.am | 8 +- gnss/GnssAdapter.cpp | 687 +-------------------- gnss/GnssAdapter.h | 26 - gnss/location_gnss.cpp | 2 +- loc-hal.pc.in | 2 +- utils/Android.mk | 12 +- utils/Makefile.am | 25 +- utils/configure.ac | 59 ++ utils/gps-utils.pc.in | 10 + {core => utils}/gps_extended.h | 0 {core => utils}/gps_extended_c.h | 0 {core => utils}/loc_gps.h | 0 utils/loc_nmea.cpp | 991 +++++++++++++++++++++++++++++++ utils/loc_nmea.h | 46 ++ 17 files changed, 1157 insertions(+), 720 deletions(-) create mode 100644 utils/configure.ac create mode 100644 utils/gps-utils.pc.in rename {core => utils}/gps_extended.h (100%) rename {core => utils}/gps_extended_c.h (100%) rename {core => utils}/loc_gps.h (100%) create mode 100644 utils/loc_nmea.cpp create mode 100644 utils/loc_nmea.h diff --git a/Makefile.am b/Makefile.am index 3b4b595b..7bc06b1c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = utils core loc_api +SUBDIRS = core loc_api pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = loc-hal.pc diff --git a/configure.ac b/configure.ac index 4d14c4fc..cf991c6b 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,10 @@ PKG_CHECK_MODULES([LOCPLA], [loc-pla]) AC_SUBST([LOCPLA_CFLAGS]) AC_SUBST([LOCPLA_LIBS]) +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + AC_ARG_WITH([core_includes], AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], [Specify the location of the core headers]), diff --git a/core/Android.mk b/core/Android.mk index b8e25a96..badae1ac 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -50,9 +50,6 @@ LOCAL_COPY_HEADERS:= \ LocDualContext.h \ LBSProxyBase.h \ UlpProxyBase.h \ - loc_gps.h \ - gps_extended_c.h \ - gps_extended.h \ loc_core_log.h \ LocAdapterProxyBase.h \ SystemStatus.h diff --git a/core/Makefile.am b/core/Makefile.am index ccbff94c..61abac47 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,7 +1,8 @@ AM_CFLAGS = -I./ \ -I../utils \ $(LOCPLA_CFLAGS) \ - -I$(WORKSPACE)/gps-noship/flp \ + $(GPSUTILS_CFLAGS) \ + -I$(WORKSPACE)/gps-noship/flp \ -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums @@ -12,9 +13,6 @@ libloc_core_la_h_sources = \ LocDualContext.h \ LBSProxyBase.h \ UlpProxyBase.h \ - loc_gps.h \ - gps_extended_c.h \ - gps_extended.h \ loc_core_log.h \ LocAdapterProxyBase.h \ SystemStatus.h @@ -43,7 +41,7 @@ libloc_core_la_LDFLAGS = -Wl,-z,defs -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 +libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) $(GPSUTILS_LIBS) #Create and Install libraries lib_LTLIBRARIES = libloc_core.la diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 952af9c0..1c195c2c 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -42,6 +42,10 @@ #include #include +#include +#include +#include + using namespace loc_core; GnssAdapter::GnssAdapter() : @@ -51,7 +55,6 @@ GnssAdapter::GnssAdapter() : LocDualContext::mLocationHalName, false)), mUlpProxy(new UlpProxyBase()), - mSuplMode(GNSS_SUPL_MODE_STANDALONE), mUlpPositionMode(), mGnssSvIdUsedInPosition(), mGnssSvIdUsedInPosAvail(false), @@ -786,7 +789,7 @@ uint32_t GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) { uint32_t sessionId = generateSessionId(); - LOC_LOGD("%s]: client %p id %u", __func__, sessionId); + LOC_LOGD("%s]: id %u", __func__, sessionId); struct MsgDeleteAidingData : public LocMsg { GnssAdapter& mAdapter; @@ -855,7 +858,7 @@ void GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty) { LOC_LOGD("%s]: time %lld timeReference %lld uncertainty %d", - __func__, time, timeReference, uncertainty); + __func__, (long long)time, (long long)timeReference, uncertainty); struct MsgInjectTime : public LocMsg { LocApiBase& mApi; @@ -1328,8 +1331,6 @@ GnssAdapter::startTracking(const LocationOptions& options) loc_api_adapter_err apiErr = mLocApi->startFix(locPosMode); if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { err = LOCATION_ERROR_SUCCESS; - // save supl mode, which is used for NMEA generation - setSuplMode(options.mode); } else { err = LOCATION_ERROR_GENERAL_FAILURE; } @@ -1383,8 +1384,6 @@ GnssAdapter::startTrackingCommand() // ulp would be doing the multiplexing for us if it is present LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); mApi.startFix(ulpPositionMode); - // save supl mode, which is used for NMEA generation - mAdapter.setSuplMode((GnssSuplMode)ulpPositionMode.mode); } }; @@ -1884,10 +1883,11 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, } if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { - if (reported && status != LOC_SESS_FAILURE) { - generateNmea(ulpLocation, locationExtended); - } else { - generateNmeaBlank(); + uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE); + std::vector nmeaArraystr; + loc_nmea_generate_pos(ulpLocation, locationExtended, generate_nmea, nmeaArraystr); + for (auto sentence : nmeaArraystr) { + reportNmea(sentence.c_str(), sentence.length()); } } @@ -1974,7 +1974,11 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) } if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { - generateNmea(svNotify); + std::vector nmeaArraystr; + loc_nmea_generate_sv(svNotify, nmeaArraystr); + for (auto sentence : nmeaArraystr) { + reportNmea(sentence.c_str(), sentence.length()); + } } mGnssSvIdUsedInPosAvail = false; @@ -2257,665 +2261,6 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) mUlpProxy->reportSvPolynomial(svPolynomial); } -int -GnssAdapter::nmeaPutChecksum(char *nmea, size_t maxSize) -{ - uint8_t checksum = 0; - int length = 0; - - nmea++; //skip the $ - while (*nmea != '\0') { - checksum ^= *nmea++; - length++; - } - - // length now contains nmea sentence string length not including $ sign. - int checksumLength = snprintf(nmea,(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); -} - -void -GnssAdapter::generateNmea(const GnssSvNotification& svNotify) -{ - char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - - // ------$GPGSV------ - NmeaSvMeta gpsSvMeta = - {GNSS_SV_TYPE_GPS, "GP", 0, 0}; - generateNmeaGSV(svNotify, gpsSvMeta, sentence, sizeof(sentence)); - - // ------$GLGSV------ - NmeaSvMeta gloSvMeta = - {GNSS_SV_TYPE_GLONASS, "GL", 0, GLONASS_SV_ID_OFFSET}; - generateNmeaGSV(svNotify, gloSvMeta, sentence, sizeof(sentence)); - - // ------$GAGSV------ - NmeaSvMeta galSvMeta = - {GNSS_SV_TYPE_GALILEO, "GA", 0, 0}; - generateNmeaGSV(svNotify, galSvMeta, sentence, sizeof(sentence)); -} - -void -GnssAdapter::generateNmea(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended) -{ - - char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - - time_t utcTime(ulpLocation.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); - if (NULL == pTm) { - LOC_LOGE("%s]: gmtime failed", __func__); - return; - } - - uint32_t svUsedCount = 0; - uint32_t count = 0; - bool isCombinedFix = (mGnssSvIdUsedInPosition.gps_sv_used_ids_mask ? 1 : 0) + - (mGnssSvIdUsedInPosition.glo_sv_used_ids_mask ? 1 : 0) + - (mGnssSvIdUsedInPosition.gal_sv_used_ids_mask ? 1 : 0) > 1; - NmeaSvMeta gnssSvMeta = - {GNSS_SV_TYPE_GPS, isCombinedFix ? "GN" : "GP", - mGnssSvIdUsedInPosition.gps_sv_used_ids_mask, 0}; - - // ---$GPGSA/$GNGSA--- - NmeaSvMeta gpsSvMeta = - {GNSS_SV_TYPE_GPS, isCombinedFix ? "GN" : "GP", - mGnssSvIdUsedInPosition.gps_sv_used_ids_mask, 0}; - count = generateNmeaGSA(locationExtended, gpsSvMeta, sentence, sizeof(sentence)); - if (count > 0) { - svUsedCount += count; - gnssSvMeta = gpsSvMeta; - } - - // ---$GLGSA/$GNGSA--- - NmeaSvMeta gloSvMeta = - {GNSS_SV_TYPE_GLONASS, isCombinedFix ? "GN" : "GL", - mGnssSvIdUsedInPosition.glo_sv_used_ids_mask, GLONASS_SV_ID_OFFSET}; - count = generateNmeaGSA(locationExtended, gloSvMeta, sentence, sizeof(sentence)); - if (count > 0) { - svUsedCount += count; - gnssSvMeta = gloSvMeta; - } - - // ---$GAGSA/$GNGSA--- - NmeaSvMeta galSvMeta = - {GNSS_SV_TYPE_GALILEO, isCombinedFix ? "GN" : "GA", - mGnssSvIdUsedInPosition.gal_sv_used_ids_mask, 0}; - count = generateNmeaGSA(locationExtended, galSvMeta, sentence, sizeof(sentence)); - if (count > 0) { - svUsedCount += count; - gnssSvMeta = galSvMeta; - } - - // ---$GPVTG/$GLVTG/$GAVTG/$GNVTG--- - generateNmeaVTG(ulpLocation, locationExtended, gnssSvMeta, - sentence, sizeof(sentence)); - - // ---$GPRMC/$GLRMC/$GARMC/$GNRMC--- - generateNmeaRMC(ulpLocation, locationExtended, gnssSvMeta, - *pTm, sentence, sizeof(sentence)); - - // ---$GPGGA/$GLGGA/$GAGGA/$GNGGA--- - generateNmeaGGA(ulpLocation, locationExtended, gnssSvMeta, - *pTm, svUsedCount, sentence, sizeof(sentence)); - -} - -void -GnssAdapter::generateNmeaBlank() -{ - char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - int length = 0; - - strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); - length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmea(sentence, length); - - strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); - length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmea(sentence, length); - - strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); - length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmea(sentence, length); - - strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); - length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmea(sentence, length); - - strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); - length = nmeaPutChecksum(sentence, sizeof(sentence)); - reportNmea(sentence, length); -} - -void -GnssAdapter::generateNmeaGSV(const GnssSvNotification& svNotify, NmeaSvMeta& svMeta, - char* sentence, size_t size) -{ - if (!sentence || size == 0) { - LOC_LOGE("%s]: NMEA Error invalid argument.", __func__); - return; - } - - char* pMarker = sentence; - int lengthRemaining = size; - int length = 0; - int sentenceCount = 0; - int sentenceNumber = 1; - int svCount = 0; - int sv = 1; - - for (sv=1; sv <= svNotify.count; sv++) { - if (svMeta.svType == svNotify.gnssSvs[sv - 1].type) { - // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == - (svNotify.gnssSvs[sv - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - svCount++; - } - } - } - - if (svCount == 0) { - // no svs in view, so just send a blank $--GSV sentence - snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", svMeta.talker); - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); - return; - } - - sv = 1; - sentenceNumber = 1; - sentenceCount = svCount / 4 + (svCount % 4 != 0); - - while (sentenceNumber <= sentenceCount) { - pMarker = sentence; - lengthRemaining = size; - - length = snprintf(pMarker, lengthRemaining, "$%sGSV,%d,%d,%02d", - svMeta.talker, sentenceCount, sentenceNumber, svCount); - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - for (int i=0; (sv <= svNotify.count) && (i < 4); sv++) { - if (svMeta.svType == svNotify.gnssSvs[sv - 1].type) { - length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svNotify.gnssSvs[sv - 1].svId, - (int)(0.5 + svNotify.gnssSvs[sv - 1].elevation), //float to int - (int)(0.5 + svNotify.gnssSvs[sv - 1].azimuth)); //float to int - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (svNotify.gnssSvs[sv - 1].cN0Dbhz > 0) { - length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svNotify.gnssSvs[sv - 1].cN0Dbhz)); //float to int - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - } - i++; - } - } - - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); - sentenceNumber++; - } //while -} - -uint8_t -GnssAdapter::generateNmeaGSA(const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, char* sentence, size_t size) -{ - if (!sentence || size == 0) { - LOC_LOGE("%s]: NMEA Error invalid arguments.", __func__); - return 0; - } - - char* pMarker = sentence; - int lengthRemaining = size; - int length = 0; - - uint8_t svUsedCount = 0; - uint32_t svUsedList[32] = {0}; - - char fixType = '\0'; - - uint32_t svIdOffset = svMeta.svIdOffset; - uint32_t mask = svMeta.mask; - - for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) { - if (mask & 1) { - svUsedList[svUsedCount++] = i + svIdOffset; - } - mask = mask >> 1; - } - - if (svUsedCount == 0 && LOC_GNSS_CONSTELLATION_GPS != svMeta.svType) { - return 0; - } - - if (svUsedCount == 0) { - fixType = '1'; // no fix - } else if (svUsedCount <= 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 - // 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, "$%sGSA,A,%c,", svMeta.talker, fixType); - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__);; - return 0; - } - pMarker += length; - lengthRemaining -= length; - - // Add first 12 satellite IDs - for (uint8_t i = 0; i < 12; i++) { - if (i < svUsedCount) { - length = snprintf(pMarker, lengthRemaining, "%02d,", svUsedList[i]); - } else { - length = snprintf(pMarker, lengthRemaining, ","); - } - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return 0; - } - pMarker += length; - lengthRemaining -= length; - } - - // Add the position/horizontal/vertical DOP values - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", - locationExtended.pdop, - locationExtended.hdop, - locationExtended.vdop); - } else { - length = snprintf(pMarker, lengthRemaining, ",,"); - } - - /* Sentence is ready, add checksum and broadcast */ - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); - - return svUsedCount; -} - -void -GnssAdapter::generateNmeaVTG(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, char* sentence, size_t size) -{ - if (!sentence || size == 0) { - LOC_LOGE("%s]: NMEA Error invalid arguments.", __func__); - return; - } - - char* pMarker = sentence; - int lengthRemaining = size; - int length = 0; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) - { - float magTrack = ulpLocation.gpsLocation.bearing; - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) - { - float magTrack = ulpLocation.gpsLocation.bearing - locationExtended.magneticDeviation; - if (magTrack < 0.0) - magTrack += 360.0; - else if (magTrack > 360.0) - magTrack -= 360.0; - } - - length = snprintf(pMarker, lengthRemaining, "$%sVTG,%.1lf,T,%.1lf,M,", - svMeta.talker, ulpLocation.gpsLocation.bearing, magTrack); - } - else - { - length = snprintf(pMarker, lengthRemaining, "$%sVTG,,T,,M,", svMeta.talker); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) - { - float speedKnots = ulpLocation.gpsLocation.speed * (3600.0/1852.0); - float speedKmPerHour = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix - else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous - else - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential - - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); -} - -void -GnssAdapter::generateNmeaRMC(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, tm& utcTime, - char* sentence, size_t size) -{ - if (!sentence || size == 0) { - LOC_LOGE("NMEA Error invalid arguments."); - return; - } - - int utcYear = utcTime.tm_year % 100; // 2 digit year - int utcMonth = utcTime.tm_mon + 1; // tm_mon starts at zero - int utcDay = utcTime.tm_mday; - int utcHours = utcTime.tm_hour; - int utcMinutes = utcTime.tm_min; - int utcSeconds = utcTime.tm_sec; - int utcMSeconds = (ulpLocation.gpsLocation.timestamp)%1000; - - char* pMarker = sentence; - int lengthRemaining = size; - int length = 0; - - length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , - svMeta.talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { - double latitude = ulpLocation.gpsLocation.latitude; - double longitude = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED) { - float speedKnots = ulpLocation.gpsLocation.speed * (3600.0/1852.0); - length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); - } else { - length = snprintf(pMarker, lengthRemaining, ","); - } - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING) { - length = snprintf(pMarker, lengthRemaining, "%.1lf,", ulpLocation.gpsLocation.bearing); - } else { - length = snprintf(pMarker, lengthRemaining, ","); - } - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) { - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix - } else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) { - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous - } else { - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential - } - - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); -} - -void -GnssAdapter::generateNmeaGGA(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, tm& utcTime, uint32_t svUsedCount, - char* sentence, size_t size) -{ - if (!sentence || size == 0) { - LOC_LOGE("NMEA Error invalid arguments."); - return; - } - - int utcYear = utcTime.tm_year % 100; // 2 digit year - int utcMonth = utcTime.tm_mon + 1; // tm_mon starts at zero - int utcDay = utcTime.tm_mday; - int utcHours = utcTime.tm_hour; - int utcMinutes = utcTime.tm_min; - int utcSeconds = utcTime.tm_sec; - int utcMSeconds = (ulpLocation.gpsLocation.timestamp)%1000; - - char* pMarker = sentence; - int lengthRemaining = size; - int length = 0; - - length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , - svMeta.talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { - double latitude = ulpLocation.gpsLocation.latitude; - double longitude = ulpLocation.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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - char gpsQuality; - if (!(ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) { - gpsQuality = '0'; // 0 means no fix - } else if (GNSS_SUPL_MODE_STANDALONE == mSuplMode) { - gpsQuality = '1'; // 1 means GPS fix - } else { - gpsQuality = '2'; // 2 means DGPS fix - } - - // Number of satellites in use, 00-12 - if (svUsedCount > MAX_SATELLITES_IN_USE) { - svUsedCount = MAX_SATELLITES_IN_USE; - } - - // Add the position/horizontal/vertical DOP values - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { - length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", - gpsQuality, svUsedCount, locationExtended.hdop); - } else { - length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", - gpsQuality, svUsedCount); - } - - if (length < 0 || length >= lengthRemaining) { - LOC_LOGE("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - 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("%s:%d]: NMEA Error in string formatting", __func__, __LINE__); - return; - } - pMarker += length; - lengthRemaining -= length; - - if ((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ALTITUDE) && - (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) { - length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", - ulpLocation.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); - } else { - length = snprintf(pMarker, lengthRemaining,",,,"); - } - - length = nmeaPutChecksum(sentence, size); - reportNmea(sentence, length); -} - /* INIT LOC AGPS MANAGER */ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 46afc06a..429bcb33 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -85,7 +85,6 @@ class GnssAdapter : public LocAdapterBase { /* ==== TRACKING ======================================================================= */ LocationSessionMap mTrackingSessions; - GnssSuplMode mSuplMode; LocPosMode mUlpPositionMode; GnssSvUsedInPosition mGnssSvIdUsedInPosition; bool mGnssSvIdUsedInPosAvail; @@ -160,7 +159,6 @@ public: void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); void setUlpPositionMode(const LocPosMode& mode) { mUlpPositionMode = mode; } LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } - void setSuplMode(GnssSuplMode mode) { mSuplMode = mode; } LocationError startTrackingMultiplex(const LocationOptions& options); LocationError startTracking(const LocationOptions& options); LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id); @@ -233,30 +231,6 @@ public: bool requestNiNotify(const GnssNiNotification& notify, const void* data); void reportGnssMeasurementData(const GnssMeasurementsNotification& measurementsNotify); - /*==== NMEA Generation =============================================================== */ - /*======== SVS ======================================================================= */ - void generateNmea(const GnssSvNotification& svNotify); - void generateNmeaGSV(const GnssSvNotification& svNotify, - NmeaSvMeta& svMeta, char* sentence, size_t size); - /*======== POSITION ================================================================== */ - void generateNmea(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended); - void generateNmeaBlank(); - uint8_t generateNmeaGSA(const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, char* sentence, size_t size); - void generateNmeaVTG(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, char* sentence, size_t size); - void generateNmeaRMC(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, tm& utcTime, char* sentence, size_t size); - void generateNmeaGGA(const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - NmeaSvMeta& svMeta, tm& utcTime, uint32_t svUsedCount, - char* sentence, size_t size); - /*======== UTILITIES ================================================================*/ - int nmeaPutChecksum(char *nmea, size_t maxSize); - /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 018b7f71..0f905fd7 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -197,7 +197,7 @@ static uint32_t gnssDeleteAidingData(GnssAidingData& data) if (NULL != gGnssAdapter) { return gGnssAdapter->gnssDeleteAidingDataCommand(data); } else { - return NULL; + return 0; } } diff --git a/loc-hal.pc.in b/loc-hal.pc.in index 92e83414..c6ece745 100644 --- a/loc-hal.pc.in +++ b/loc-hal.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: loc-hal Description: QTI GPS Loc HAL Version: @VERSION -Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_so -lloc_ds_api -lloc_api_v02 +Libs: -L${libdir} -lloc_core -lloc_eng_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/utils/Android.mk b/utils/Android.mk index 45f3c25a..6a441f0f 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -25,7 +25,8 @@ LOCAL_SRC_FILES += \ LocTimer.cpp \ LocThread.cpp \ MsgTask.cpp \ - loc_misc_utils.cpp + loc_misc_utils.cpp \ + loc_nmea.cpp # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true LOCAL_CFLAGS += \ @@ -40,7 +41,8 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/libloc_pla + $(TARGET_OUT_HEADERS)/libloc_pla \ + $(TARGET_OUT_HEADERS)/liblocation_api \ LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -56,7 +58,11 @@ LOCAL_COPY_HEADERS:= \ loc_target.h \ loc_timer.h \ LocSharedLock.h \ - loc_misc_utils.h + loc_misc_utils.h \ + loc_nmea.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_gps.h LOCAL_MODULE := libgps.utils diff --git a/utils/Makefile.am b/utils/Makefile.am index b121dc85..14c3e482 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,10 +1,8 @@ AM_CFLAGS = -Wundef \ - -MD \ - -Wno-trigraphs \ - -g -O0 \ - -fno-inline \ - -fno-short-enums \ - -fpic \ + -I./ \ + $(LOCPLA_CFLAGS) + +AM_CPPFLAGS = -Wundef \ -I./ \ $(LOCPLA_CFLAGS) @@ -19,7 +17,11 @@ libgps_utils_so_la_h_sources = \ LocHeap.h \ LocThread.h \ LocTimer.h \ - loc_misc_utils.h + loc_misc_utils.h \ + loc_nmea.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_gps.h libgps_utils_so_la_c_sources = \ linked_list.c \ @@ -31,9 +33,9 @@ libgps_utils_so_la_c_sources = \ LocTimer.cpp \ LocThread.cpp \ MsgTask.cpp \ - loc_misc_utils.cpp + loc_misc_utils.cpp \ + loc_nmea.cpp -library_includedir = $(pkgincludedir)/utils library_include_HEADERS = $(libgps_utils_so_la_h_sources) @@ -53,3 +55,8 @@ libgps_utils_so_la_LIBADD = -lcutils -lstdc++ -llog $(LOCPLA_LIBS) #Create and Install libraries lib_LTLIBRARIES = libgps_utils_so.la +library_includedir = $(pkgincludedir) +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = gps-utils.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/configure.ac b/utils/configure.ac new file mode 100644 index 00000000..a7ab9b40 --- /dev/null +++ b/utils/configure.ac @@ -0,0 +1,59 @@ +# configure.ac -- Autoconf script for gps gps-utils +# +# Process this file with autoconf to produce a configure script + +# Requires autoconf tool later than 2.61 +AC_PREREQ(2.61) +# Initialize the gps gps-utils package version 1.0.0 +AC_INIT([gps-utils],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 + +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 \ + gps-utils.pc + ]) + +AC_OUTPUT diff --git a/utils/gps-utils.pc.in b/utils/gps-utils.pc.in new file mode 100644 index 00000000..3ed3d903 --- /dev/null +++ b/utils/gps-utils.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gps-utils +Description: QTI GPS Location utils +Version: @VERSION +Libs: -L${libdir} -lgps_utils_so +Cflags: -I${includedir}/gps-utils diff --git a/core/gps_extended.h b/utils/gps_extended.h similarity index 100% rename from core/gps_extended.h rename to utils/gps_extended.h diff --git a/core/gps_extended_c.h b/utils/gps_extended_c.h similarity index 100% rename from core/gps_extended_c.h rename to utils/gps_extended_c.h diff --git a/core/loc_gps.h b/utils/loc_gps.h similarity index 100% rename from core/loc_gps.h rename to utils/loc_gps.h diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp new file mode 100644 index 00000000..79325627 --- /dev/null +++ b/utils/loc_nmea.cpp @@ -0,0 +1,991 @@ +/* Copyright (c) 2012-2017, 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_nmea" +#include +#include +#include + +#define GLONASS_SV_ID_OFFSET 64 +#define MAX_SATELLITES_IN_USE 12 +typedef struct loc_nmea_sv_meta_s +{ + char talker[3]; + LocGnssConstellationType svType; + uint32_t mask; + uint32_t svIdOffset; +} loc_nmea_sv_meta; + +typedef struct loc_sv_cache_info_s +{ + uint32_t gps_used_mask; + uint32_t glo_used_mask; + uint32_t gal_used_mask; +} loc_sv_cache_info; + +static loc_sv_cache_info sv_cache_info; + +/*=========================================================================== +FUNCTION loc_nmea_sv_meta_init + +DESCRIPTION + Init loc_nmea_sv_meta passed in + +DEPENDENCIES + NONE + +RETURN VALUE + Pointer to loc_nmea_sv_meta + +SIDE EFFECTS + N/A + +===========================================================================*/ +static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, + GnssSvType svType, + bool needCombine) +{ + memset(&sv_meta, 0, sizeof(sv_meta)); + sv_meta.svType = svType; + sv_meta.talker[0] = 'G'; + + switch (svType) + { + case GNSS_SV_TYPE_GPS: + sv_meta.talker[1] = 'P'; + sv_meta.mask = sv_cache_info.gps_used_mask; + break; + case GNSS_SV_TYPE_GLONASS: + sv_meta.talker[1] = 'L'; + sv_meta.mask = sv_cache_info.glo_used_mask; + // GLONASS SV ids are from 65-96 + sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; + break; + case GNSS_SV_TYPE_GALILEO: + sv_meta.talker[1] = 'A'; + sv_meta.mask = sv_cache_info.gal_used_mask; + break; + default: + LOC_LOGE("NMEA Error unknow constellation type: %d", svType); + return NULL; + } + if (needCombine && + (sv_cache_info.gps_used_mask ? 1 : 0) + + (sv_cache_info.glo_used_mask ? 1 : 0) + + (sv_cache_info.gal_used_mask ? 1 : 0) > 1) + { + // If GPS, GLONASS, Galileo etc. are combined + // to obtain the reported position solution, + // talker shall be set to GN, to indicate that + // the satellites are used in a combined solution + sv_meta.talker[1] = 'N'; + } + return &sv_meta; +} + +/*=========================================================================== +FUNCTION loc_nmea_count_bits + +DESCRIPTION + Count how many bits are set in mask + +DEPENDENCIES + NONE + +RETURN VALUE + Bits number set in mask + +SIDE EFFECTS + N/A + +===========================================================================*/ +static uint32_t loc_nmea_count_bits(uint32_t mask) +{ + uint32_t count = 0; + while (mask) + { + if (mask & 1) + count++; + mask = mask >> 1; + } + return count; +} + + +/*=========================================================================== +FUNCTION loc_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 + +===========================================================================*/ +static int loc_nmea_put_checksum(char *pNmea, int maxSize) +{ + uint8_t checksum = 0; + int length = 0; + if(NULL == pNmea) + return 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_nmea_generate_GSA + +DESCRIPTION + Generate NMEA GSA sentences generated based on position report + Currently below sentences are generated: + - $GPGSA : GPS DOP and active SVs + - $GLGSA : GLONASS DOP and active SVs + - $GAGSA : GALILEO DOP and active SVs + - $GNGSA : GNSS DOP and active SVs + +DEPENDENCIES + NONE + +RETURN VALUE + Number of SVs used + +SIDE EFFECTS + N/A + +===========================================================================*/ +static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtended, + char* sentence, + int bufSize, + loc_nmea_sv_meta* sv_meta_p, + std::vector &nmeaArraystr) +{ + if (!sentence || bufSize <= 0 || !sv_meta_p) + { + LOC_LOGE("NMEA Error invalid arguments."); + return 0; + } + + char* pMarker = sentence; + int lengthRemaining = bufSize; + int length = 0; + + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + + char fixType = '\0'; + + const char* talker = sv_meta_p->talker; + uint32_t svIdOffset = sv_meta_p->svIdOffset; + uint32_t mask = sv_meta_p->mask; + + for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) + { + if (mask & 1) + svUsedList[svUsedCount++] = i + svIdOffset; + mask = mask >> 1; + } + + if (svUsedCount == 0 && GNSS_SV_TYPE_GPS != sv_meta_p->svType) + return 0; + + if (svUsedCount == 0) + fixType = '1'; // no fix + else if (svUsedCount <= 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 + // 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, "$%sGSA,A,%c,", talker, fixType); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return 0; + } + pMarker += length; + lengthRemaining -= length; + + // Add first 12 satellite IDs + for (uint8_t i = 0; i < 12; i++) + { + 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 0; + } + pMarker += length; + lengthRemaining -= length; + } + + // Add the position/horizontal/vertical DOP values + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) + { + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", + locationExtended.pdop, + locationExtended.hdop, + locationExtended.vdop); + } + else + { // no dop + length = snprintf(pMarker, lengthRemaining, ",,"); + } + + /* Sentence is ready, add checksum and broadcast */ + length = loc_nmea_put_checksum(sentence, bufSize); + nmeaArraystr.push_back(sentence); + + return svUsedCount; +} + +/*=========================================================================== +FUNCTION loc_nmea_generate_GSV + +DESCRIPTION + Generate NMEA GSV sentences generated based on sv report + Currently below sentences are generated: + - $GPGSV: GPS Satellites in View + - $GNGSV: GLONASS Satellites in View + - $GAGSV: GALILEO Satellites in View + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, + char* sentence, + int bufSize, + loc_nmea_sv_meta* sv_meta_p, + std::vector &nmeaArraystr) +{ + if (!sentence || bufSize <= 0) + { + LOC_LOGE("NMEA Error invalid argument."); + return; + } + + char* pMarker = sentence; + int lengthRemaining = bufSize; + int length = 0; + int sentenceCount = 0; + int sentenceNumber = 1; + size_t svNumber = 1; + + const char* talker = sv_meta_p->talker; + uint32_t svIdOffset = sv_meta_p->svIdOffset; + uint32_t mask = sv_meta_p->mask; + uint32_t svCount = loc_nmea_count_bits(mask); + + + if (svCount <= 0) + { + // no svs in view, so just send a blank $--GSV sentence + snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", talker); + length = loc_nmea_put_checksum(sentence, bufSize); + nmeaArraystr.push_back(sentence); + return; + } + + svNumber = 1; + sentenceNumber = 1; + sentenceCount = svCount / 4 + (svCount % 4 != 0); + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = bufSize; + + length = snprintf(pMarker, lengthRemaining, "$%sGSV,%d,%d,%02d", + talker, sentenceCount, sentenceNumber, svCount); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (int i=0; (svNumber <= svNotify.count) && (i < 4); svNumber++) + { + if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type) + { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svNotify.gnssSvs[svNumber - 1].svId, + (int)(0.5 + svNotify.gnssSvs[svNumber - 1].elevation), //float to int + (int)(0.5 + svNotify.gnssSvs[svNumber - 1].azimuth)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (svNotify.gnssSvs[svNumber - 1].cN0Dbhz > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svNotify.gnssSvs[svNumber - 1].cN0Dbhz)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + + i++; + } + + } + + length = loc_nmea_put_checksum(sentence, bufSize); + nmeaArraystr.push_back(sentence); + sentenceNumber++; + + } //while +} + +/*=========================================================================== +FUNCTION loc_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 + - $GLGSA : GLONASS DOP and active SVs + - $GAGSA : GALILEO DOP and active SVs + - $GNGSA : GNSS DOP and active SVs + - $--VTG : Track made good and ground speed + - $--RMC : Recommended minimum navigation information + - $--GGA : Time, position and fix related data + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_nmea_generate_pos(const UlpLocation &location, + const GpsLocationExtended &locationExtended, + unsigned char generate_nmea, + std::vector &nmeaArraystr) +{ + 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) { + char talker[3] = {'G', 'P', '\0'}; + uint32_t svUsedCount = 0; + uint32_t count = 0; + loc_nmea_sv_meta sv_meta; + // ------------------- + // ---$GPGSA/$GNGSA--- + // ------------------- + + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, true), nmeaArraystr); + if (count > 0) + { + svUsedCount += count; + talker[1] = sv_meta.talker[1]; + } + + // ------------------- + // ---$GLGSA/$GNGSA--- + // ------------------- + + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, true), nmeaArraystr); + if (count > 0) + { + svUsedCount += count; + talker[1] = sv_meta.talker[1]; + } + + // ------------------- + // ---$GAGSA/$GNGSA--- + // ------------------- + + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, true), nmeaArraystr); + if (count > 0) + { + svUsedCount += count; + talker[1] = sv_meta.talker[1]; + } + + // ------------------- + // ------$--VTG------- + // ------------------- + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + if (location.gpsLocation.flags & LOC_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, "$%sVTG,%.1lf,T,%.1lf,M,", talker, location.gpsLocation.bearing, magTrack); + } + else + { + length = snprintf(pMarker, lengthRemaining, "$%sVTG,,T,,M,", talker); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & LOC_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 & LOC_GPS_LOCATION_HAS_LAT_LONG)) + // N means no fix + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); + else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) + // D means differential + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + // E means estimated (dead reckoning) + length = snprintf(pMarker, lengthRemaining, "%c", 'E'); + else // A means autonomous + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); + + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + // ------------------- + // ------$--RMC------- + // ------------------- + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , + talker, 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 & LOC_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 & LOC_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 & LOC_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 & LOC_GPS_LOCATION_HAS_LAT_LONG)) + // N means no fix + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); + else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) + // D means differential + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + // E means estimated (dead reckoning) + length = snprintf(pMarker, lengthRemaining, "%c", 'E'); + else // A means autonomous + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); + + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + // ------------------- + // ------$--GGA------- + // ------------------- + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , + talker, 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 & LOC_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 & LOC_GPS_LOCATION_HAS_LAT_LONG)) + gpsQuality = '0'; // 0 means no fix + else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) + gpsQuality = '2'; // 2 means DGPS fix + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + gpsQuality = '6'; // 6 means estimated (dead reckoning) + else + gpsQuality = '1'; // 1 means GPS fix + + // Number of satellites in use, 00-12 + if (svUsedCount > MAX_SATELLITES_IN_USE) + svUsedCount = MAX_SATELLITES_IN_USE; + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) + { + length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", + gpsQuality, svUsedCount, locationExtended.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 & LOC_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_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + // clear the cache so they can't be used again + sv_cache_info.gps_used_mask = 0; + sv_cache_info.glo_used_mask = 0; + sv_cache_info.gal_used_mask = 0; + } + //Send blank NMEA reports for non-final fixes + else { + strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + + strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + } + + EXIT_LOG(%d, 0); +} + + + +/*=========================================================================== +FUNCTION loc_nmea_generate_sv + +DESCRIPTION + Generate NMEA sentences generated based on sv report + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_nmea_generate_sv(const GnssSvNotification &svNotify, + std::vector &nmeaArraystr) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + int svCount = svNotify.count; + int sentenceCount = 0; + int sentenceNumber = 1; + int svNumber = 1; + + //Count GPS SVs for saparating GPS from GLONASS and throw others + + sv_cache_info.gps_used_mask = 0; + sv_cache_info.glo_used_mask = 0; + sv_cache_info.gal_used_mask = 0; + for(svNumber=1; svNumber <= svCount; svNumber++) { + if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $GPGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.gps_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + } + else if (GNSS_SV_TYPE_GLONASS == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $GNGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.glo_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + } + else if (GNSS_SV_TYPE_GALILEO == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $GAGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.gal_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + } + } + + loc_nmea_sv_meta sv_meta; + // ------------------ + // ------$GPGSV------ + // ------------------ + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, false), nmeaArraystr); + + // ------------------ + // ------$GLGSV------ + // ------------------ + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, false), nmeaArraystr); + + // ------------------ + // ------$GAGSV------ + // ------------------ + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, false), nmeaArraystr); + + EXIT_LOG(%d, 0); +} diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h new file mode 100644 index 00000000..92f997ea --- /dev/null +++ b/utils/loc_nmea.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2012-2013, 2015-2017 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 +#include +#define NMEA_SENTENCE_MAX_LENGTH 200 + +void loc_nmea_generate_sv(const GnssSvNotification &svNotify, + std::vector &nmeaArraystr); + +void loc_nmea_generate_pos(const UlpLocation &location, + const GpsLocationExtended &locationExtended, + unsigned char generate_nmea, + std::vector &nmeaArraystr); + +#endif // LOC_ENG_NMEA_H From 59fce4feb5b2812feecc5d744efacce11558d487 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 29 Mar 2017 15:37:28 +0800 Subject: [PATCH 472/945] Convert GnssConfig parameters to enum Convert parameters to enum values instead of static_cast CRs-Fixed: 2025873 Change-Id: Ief9cf31bee9b9772350d5191cdd45853f0f42131 --- android/GnssConfiguration.cpp | 90 +++++++++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 8 deletions(-) diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index 591a01a5..a35be736 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -44,7 +44,9 @@ Return GnssConfiguration::setSuplEs(bool enabled) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; - config.suplEmergencyServices = static_cast(enabled); + config.suplEmergencyServices = (enabled ? + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES : + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO); return mGnss->updateConfiguration(config); } @@ -59,7 +61,21 @@ Return GnssConfiguration::setSuplVersion(uint32_t version) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; - config.suplVersion = static_cast(version); + switch (version) { + case 0x00020002: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; + break; + case 0x00020000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0; + break; + case 0x00010000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0; + break; + default: + LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version); + return false; + break; + } return mGnss->updateConfiguration(config); } @@ -74,7 +90,18 @@ Return GnssConfiguration::setSuplMode(uint8_t mode) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; - config.suplModeMask = static_cast(mode); + switch (mode) { + case 1: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB; + break; + case 2: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA; + break; + default: + LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode); + return false; + break; + } return mGnss->updateConfiguration(config); } @@ -89,7 +116,24 @@ Return GnssConfiguration::setLppProfile(uint8_t lppProfile) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; - config.lppProfile = static_cast(lppProfile); + switch (lppProfile) { + case 0: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; + break; + case 1: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE; + break; + case 2: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; + break; + case 3: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; + break; + default: + LOC_LOGE("%s]: invalid lppProfile: %d.", __FUNCTION__, lppProfile); + return false; + break; + } return mGnss->updateConfiguration(config); } @@ -103,9 +147,20 @@ Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) GnssConfig config; memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; - config.aGlonassPositionProtocolMask = - static_cast(protocol); + if (protocol & (1<<0)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT; + } + if (protocol & (1<<1)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT; + } + if (protocol & (1<<2)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT; + } + if (protocol & (1<<3)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT; + } return mGnss->updateConfiguration(config); } @@ -120,6 +175,24 @@ Return GnssConfiguration::setGpsLock(uint8_t lock) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + switch (lock) { + case 0: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + break; + case 1: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; + break; + case 2: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; + break; + case 3: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + break; + default: + LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); + return false; + break; + } config.gpsLock = static_cast(lock); return mGnss->updateConfiguration(config); @@ -135,8 +208,9 @@ Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; - config.emergencyPdnForEmergencySupl = - static_cast(enabled); + config.emergencyPdnForEmergencySupl = (enabled ? + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES : + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO); return mGnss->updateConfiguration(config); } From ce66a81a3d23519f1fe44e0371d00048b2e2e40b Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 7 Mar 2017 13:37:46 +0800 Subject: [PATCH 473/945] Fix nmea sentence generation method of --GSV Generate --GSV sentences from SVs in view instead of generate them from SVs used in fix Change-Id: I1de113e86b987b6ea01b50d800e5e13e7277baff CRs-Fixed: 2015049 --- utils/loc_nmea.cpp | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 79325627..3ce67920 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -110,35 +110,6 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, return &sv_meta; } -/*=========================================================================== -FUNCTION loc_nmea_count_bits - -DESCRIPTION - Count how many bits are set in mask - -DEPENDENCIES - NONE - -RETURN VALUE - Bits number set in mask - -SIDE EFFECTS - N/A - -===========================================================================*/ -static uint32_t loc_nmea_count_bits(uint32_t mask) -{ - uint32_t count = 0; - while (mask) - { - if (mask & 1) - count++; - mask = mask >> 1; - } - return count; -} - - /*=========================================================================== FUNCTION loc_nmea_put_checksum @@ -337,8 +308,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, const char* talker = sv_meta_p->talker; uint32_t svIdOffset = sv_meta_p->svIdOffset; - uint32_t mask = sv_meta_p->mask; - uint32_t svCount = loc_nmea_count_bits(mask); + int svCount = svNotify.count; if (svCount <= 0) @@ -370,12 +340,12 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, pMarker += length; lengthRemaining -= length; - for (int i=0; (svNumber <= svNotify.count) && (i < 4); svNumber++) + for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) { if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type) { length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svNotify.gnssSvs[svNumber - 1].svId, + svNotify.gnssSvs[svNumber - 1].svId + svIdOffset, (int)(0.5 + svNotify.gnssSvs[svNumber - 1].elevation), //float to int (int)(0.5 + svNotify.gnssSvs[svNumber - 1].azimuth)); //float to int From e581b62977fd6c6ecd3a21649849b41ff90fd691 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 11 Nov 2016 00:25:45 +0530 Subject: [PATCH 474/945] HLOS implementation for E911 LPPe BT/UBP feature HLOS implementation for feature - E911 LPPe BT/UBP for SUPL and LPP CP. Change-Id: I6ec7a3ff8aaf91383832753af2d0e406938c3884 CRs-Fixed: 1088449 --- etc/gps.conf | 8 ++++++-- utils/gps_extended_c.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 828cf689..3ea9aabd 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -118,14 +118,18 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 ################################################## # 0x1: DBH for LPPe CP # 0x2: WLAN AP Measurements for LPPe CP -LPPE_CP_TECHNOLOGY = 0 +# 0x4: SRN AP measurement for CP +# 0x8: Sensor Barometer Measurement LPPe CP +LPPE_CP_TECHNOLOGY = 4 ################################################## # Select technology for LPPe User Plane ################################################## # 0x1: DBH for LPPe UP # 0x2: WLAN AP Measurements for LPPe UP -LPPE_UP_TECHNOLOGY = 0 +# 0x4: SRN AP measurement for UP +# 0x8: Sensor Barometer Measurement LPPe UP +LPPE_UP_TECHNOLOGY = 4 ################################################## # AGPS_CONFIG_INJECT diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 14337689..067b23e5 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -480,6 +480,7 @@ enum loc_api_adapter_event_index { 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_REQUEST_SRN_DATA, // request srn data from AP LOC_API_ADAPTER_EVENT_MAX }; @@ -512,6 +513,8 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT (1< Date: Wed, 8 Mar 2017 15:36:23 +0800 Subject: [PATCH 475/945] Fix svCount in --GSV nmea sentence Calculate sv count for each kind of constellation. Change-Id: If0ffa7f07245ea8b1a5bcc9933f6244f0598c575 CRs-Fixed: 2015049 --- utils/loc_nmea.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 3ce67920..dee98dbe 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -40,6 +40,7 @@ typedef struct loc_nmea_sv_meta_s char talker[3]; LocGnssConstellationType svType; uint32_t mask; + uint32_t svCount; uint32_t svIdOffset; } loc_nmea_sv_meta; @@ -48,6 +49,12 @@ typedef struct loc_sv_cache_info_s uint32_t gps_used_mask; uint32_t glo_used_mask; uint32_t gal_used_mask; + uint32_t gps_count; + uint32_t glo_count; + uint32_t gal_count; + float hdop; + float pdop; + float vdop; } loc_sv_cache_info; static loc_sv_cache_info sv_cache_info; @@ -81,16 +88,19 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, case GNSS_SV_TYPE_GPS: sv_meta.talker[1] = 'P'; sv_meta.mask = sv_cache_info.gps_used_mask; + sv_meta.svCount = sv_cache_info.gps_count; break; case GNSS_SV_TYPE_GLONASS: sv_meta.talker[1] = 'L'; sv_meta.mask = sv_cache_info.glo_used_mask; + sv_meta.svCount = sv_cache_info.glo_count; // GLONASS SV ids are from 65-96 sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; break; case GNSS_SV_TYPE_GALILEO: sv_meta.talker[1] = 'A'; sv_meta.mask = sv_cache_info.gal_used_mask; + sv_meta.svCount = sv_cache_info.gal_count; break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svType); @@ -308,8 +318,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, const char* talker = sv_meta_p->talker; uint32_t svIdOffset = sv_meta_p->svIdOffset; - int svCount = svNotify.count; - + int svCount = sv_meta_p->svCount; if (svCount <= 0) { @@ -340,7 +349,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, pMarker += length; lengthRemaining -= length; - for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) + for (int i=0; (svNumber <= svNotify.count) && (i < 4); svNumber++) { if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type) { @@ -899,6 +908,10 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, sv_cache_info.gps_used_mask = 0; sv_cache_info.glo_used_mask = 0; sv_cache_info.gal_used_mask = 0; + + sv_cache_info.gps_count = 0; + sv_cache_info.glo_count = 0; + sv_cache_info.gal_count = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) { @@ -910,6 +923,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gps_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } + sv_cache_info.gps_count++; } else if (GNSS_SV_TYPE_GLONASS == svNotify.gnssSvs[svNumber - 1].type) { @@ -921,6 +935,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.glo_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } + sv_cache_info.glo_count++; } else if (GNSS_SV_TYPE_GALILEO == svNotify.gnssSvs[svNumber - 1].type) { @@ -932,6 +947,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gal_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } + sv_cache_info.gal_count++; } } From edac52fa39ad76d7e2d58329982fb583393ddef1 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 10 Feb 2017 13:52:11 +0530 Subject: [PATCH 476/945] added new ulp type for raw gnss data raw gnss daa type is added to address the gnss raw fixes to remote clients Change-Id: I5ebc4a8f10bd52de4e59e29dcf28d6375df02d73 CRs-Fixed: 2007050 --- utils/gps_extended_c.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 067b23e5..5e246ff2 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -77,6 +77,13 @@ extern "C" { #define ULP_LOCATION_IS_FROM_PIP 0x0040 /** Position is from external DR solution*/ #define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 +/** Raw GNSS position fixes */ +#define ULP_LOCATION_IS_FROM_GNSS_RAW 0X0100 + +/** SVinfo source is GNSS/DR */ +#define ULP_SVINFO_IS_FROM_GNSS 0x0001 +/** Raw SVinfo from GNSS */ +#define ULP_SVINFO_IS_FROM_GNSS_RAW 0x0002 #define ULP_MIN_INTERVAL_INVALID 0xffffffff #define ULP_MAX_NMEA_STRING_SIZE 201 From 8b98a565a5d42377205abed7852843aed2b03b74 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 24 Mar 2017 17:39:20 -0700 Subject: [PATCH 477/945] Do not send debug NMEA to ulp Checking in GnssAdapter::reportNmeaEvent to see if the incoming nmea is debug, in which case we do not route that to ULP. Debug NMEA is only for SystemStatus consumption. Change-Id: Ifb60b9a643ad6aeb732fcaf5a68f868cb55cd88a CRs-Fixed: 2027134 --- core/SystemStatus.cpp | 15 +++++++-------- gnss/GnssAdapter.cpp | 4 ++-- utils/loc_nmea.h | 8 ++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index a7f282df..3310b8bb 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include namespace loc_core @@ -48,14 +49,10 @@ protected: std::vector mField; timespec setUtcTime(std::string sutctime); -public: - static const uint32_t NMEA_MINSIZE = 6; - static const uint32_t NMEA_MAXSIZE = 256; - SystemStatusNmeaBase(const char *str_in, uint32_t len_in) { // check size and talker - if (len_in > NMEA_MAXSIZE || len_in < NMEA_MINSIZE || (str_in[0] != '$')) { + if (!loc_nmea_is_debug(str_in, len_in)) { return; } @@ -83,6 +80,10 @@ public: } virtual ~SystemStatusNmeaBase() { } + +public: + static const uint32_t NMEA_MINSIZE = DEBUG_NMEA_MINSIZE; + static const uint32_t NMEA_MAXSIZE = DEBUG_NMEA_MAXSIZE; }; timespec SystemStatusNmeaBase::setUtcTime(std::string sutctime) @@ -1316,9 +1317,7 @@ static uint32_t cnt_s1 = 0; bool SystemStatus::setNmeaString(const char *data, uint32_t len) { bool ret = false; - if (NULL == data - || (len < SystemStatusNmeaBase::NMEA_MINSIZE) - || (len > SystemStatusNmeaBase::NMEA_MAXSIZE)) { + if (!loc_nmea_is_debug(data, len)) { return false; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 1c195c2c..377a0781 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -1987,9 +1988,8 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) void GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) { - // if this event is not called from ULP, then try to call into ULP and return if successfull - if (!fromUlp) { + if (!fromUlp && !loc_nmea_is_debug(nmea, length)) { if (mUlpProxy->reportNmea(nmea, length)) { return; } diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h index 92f997ea..d182e419 100644 --- a/utils/loc_nmea.h +++ b/utils/loc_nmea.h @@ -43,4 +43,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, unsigned char generate_nmea, std::vector &nmeaArraystr); +#define DEBUG_NMEA_MINSIZE 6 +#define DEBUG_NMEA_MAXSIZE 256 +inline bool loc_nmea_is_debug(const char* nmea, int length) { + return ((nullptr != nmea) && + (length >= DEBUG_NMEA_MINSIZE) && (length <= DEBUG_NMEA_MAXSIZE) && + (nmea[0] == '$') && (nmea[1] == 'P') && (nmea[2] == 'Q') && (nmea[3] == 'W')); +} + #endif // LOC_ENG_NMEA_H From 36f8446032cb3376116317a82b048bf7f7f3b659 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 31 Mar 2017 18:00:01 -0700 Subject: [PATCH 478/945] Fix NI Request Event GnssAdatper::requestNiNotifyEvent function is not overriding LocAdatperBase::requestNiNotigyEvent because of slightly different parameters Change-Id: Ib3e6b562c437e47fba2a086d47c887f2efce7637 CRs-fixed: 2027710 --- core/LocAdapterBase.cpp | 2 +- core/LocAdapterBase.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 27132b79..aca59093 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -149,7 +149,7 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestNiNotifyEvent(GnssNiNotification ¬ify, const void* data) + requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data) DEFAULT_IMPL(false) void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 824a3407..5c471fd5 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -147,7 +147,7 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual bool requestNiNotifyEvent(GnssNiNotification ¬ify, const void* data); + virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); From 909d752d60c2563f658688408c5c8e1644cb84c1 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 6 Apr 2017 15:56:54 +0800 Subject: [PATCH 479/945] Send ENGINE_OFF when stop tracking fix typo in function onStopTrackingCb, send ENGINE_OFF instead of ENGINE_ON Change-Id: I0e4a73f25283cf172caeaa74e3bc385020b660ff CRs-fixed: 2025876 --- android/location_api/GnssAPIClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 4cb3f7df..a31de5de 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -379,7 +379,7 @@ void GnssAPIClient::onStopTrackingCb(LocationError error) LOC_LOGD("%s]: (%d)", __FUNCTION__, error); if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); - mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); } } From d48c19e8f0719d6b7b81a91b8e0d1a335fa0e2fb Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 4 Apr 2017 11:43:41 -0700 Subject: [PATCH 480/945] Fix GnssDebug with new AOSP changes New AOSP changes have modified GnssDebug HIDL API, so changes are needed to fix compilation Change-Id: Ia1543a8475ac9366131e58b138577f37e91f0592 --- android/GnssDebug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 3ab94d30..d7a53676 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -82,7 +82,6 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) LOC_LOGV("GnssDebug - age=%f", data.position.ageSeconds); // time block - data.time.valid = true; data.time.timeEstimate = reports.mTime.timeEstimate; data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; @@ -96,7 +95,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) memset(&s, 0, sizeof(s)); s.svid = reports.mSatelliteInfo[i].svid; convertGnssConstellationType(reports.mSatelliteInfo[i].constellation, s.constellation); - s.ephemerisType = SatelliteEphemerisType::UNKNOWN; + s.ephemerisType = SatelliteEphemerisType::NOT_AVAILABLE; s.ephemerisAgeSeconds = reports.mSatelliteInfo[i].ephemerisAgeSeconds; s_array.push_back(s); } From 2b7f0b434d7eb61a38510a98ffc6af409d672d0b Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 7 Apr 2017 10:45:53 +0530 Subject: [PATCH 481/945] fix crash issue while deleting adapters crash was observed while deleting gnss, flp and geofence adapters. solution is not to delete the Adapter in the deinitialize function Change-Id: Ia260dd6f2c532111b82b621a3640d6ef834bb671 CRs-Fixed: 2030458 --- location/LocationAPI.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index c800851c..3086adc1 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -201,37 +201,14 @@ LocationAPI::~LocationAPI() auto it = gData.clientData.find(this); if (it != gData.clientData.end()) { - size_t gnssClientCount = 0; - size_t flpClientCount = 0; - size_t geofenceClientCount = 0; - for (auto it2=gData.clientData.begin(); it2 != gData.clientData.end(); ++it2) { - if (isGnssClient(it2->second)) { - gnssClientCount++; - } - if (isFlpClient(it2->second)) { - flpClientCount++; - } - if (isGeofenceClient(it2->second)) { - geofenceClientCount++; - } - } if (isGnssClient(it->second) && NULL != gData.gnssInterface) { gData.gnssInterface->removeClient(it->first); - if (1 == gnssClientCount && NULL == gData.controlAPI) { - gData.gnssInterface->deinitialize(); - } } if (isFlpClient(it->second) && NULL != gData.flpInterface) { gData.flpInterface->removeClient(it->first); - if (1 == flpClientCount) { - gData.flpInterface->deinitialize(); - } } if (isGeofenceClient(it->second) && NULL != gData.geofenceInterface) { gData.geofenceInterface->removeClient(it->first); - if (1 == geofenceClientCount) { - gData.geofenceInterface->deinitialize(); - } } gData.clientData.erase(it); } else { @@ -593,16 +570,6 @@ LocationControlAPI::~LocationControlAPI() LOC_LOGD("LOCATION CONTROL API DESTRUCTOR"); pthread_mutex_lock(&gDataMutex); - size_t gnssClientCount = 0; - for (auto it=gData.clientData.begin(); it != gData.clientData.end(); ++it) { - if (isGnssClient(it->second)) { - gnssClientCount++; - } - } - if (gData.gnssInterface != NULL && 0 == gnssClientCount) { - //@todo: we might want to call gData.gnssInterface.disable before deinitialize? - gData.gnssInterface->deinitialize(); - } gData.controlAPI = NULL; pthread_mutex_unlock(&gDataMutex); From bbc6601d7f95dd59a99599494b61ff2cd40b7a82 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 10 Apr 2017 21:42:33 -0700 Subject: [PATCH 482/945] ulp proxy set capabilities race condition It is possible that when GnssAdapter first sets capabilities on ulp proxy, it is just a dummy. So it is necessary to do this when there is a new ulp proxy project received. Change-Id: Iee033bd780c132f7bcc2d98b5b2091ce9c9a2410 CRs-Fixed: 2032088 --- gnss/GnssAdapter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 377a0781..bdc25404 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -901,6 +901,9 @@ GnssAdapter::setUlpProxyCommand(UlpProxyBase* ulp) mUlp(ulp) {} inline virtual void proc() const { mAdapter.setUlpProxy(mUlp); + if (mUlp) { + mUlp->setCapabilities(ContextBase::getCarrierCapabilities()); + } } }; From f7a8f2cded84e523eab7219bec3d25c325d95690 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Mon, 10 Apr 2017 16:16:46 -0700 Subject: [PATCH 483/945] SystemStatus - Add reported UTC timestamp in report Add reported UTC timestamp field in systemstatus' report data structure. It indicates the system UTC time when the information was last received from provider such as modem. Change-Id: I31beb64958c980242ea65fb9a602e18985ad17e1 CRs-Fixed: 2012926 --- core/SystemStatus.cpp | 103 ++++++++++++++---------------------------- core/SystemStatus.h | 16 +++++-- 2 files changed, 46 insertions(+), 73 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 3310b8bb..1adeb66a 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -47,7 +47,6 @@ class SystemStatusNmeaBase { protected: std::vector mField; - timespec setUtcTime(std::string sutctime); SystemStatusNmeaBase(const char *str_in, uint32_t len_in) { @@ -86,31 +85,12 @@ public: static const uint32_t NMEA_MAXSIZE = DEBUG_NMEA_MAXSIZE; }; -timespec SystemStatusNmeaBase::setUtcTime(std::string sutctime) -{ - timespec ts = { 0ULL, 0ULL }; - uint64_t utctime_ns = atof(sutctime.c_str()) * 1000000000ULL; - ts.tv_nsec = utctime_ns % 1000000000ULL; - uint64_t utctime_s = utctime_ns / 1000000000ULL; - - uint64_t hour = utctime_s / 10000ULL; - uint64_t min = (utctime_s / 100LL) % 100ULL; - uint64_t sec = utctime_s % 100ULL; - ts.tv_sec = hour * 3600ULL + min * 60ULL + sec; - - timeval tv; - gettimeofday(&tv, NULL); - ts.tv_sec += (uint64_t(tv.tv_sec / (24ULL * 60ULL * 60ULL))) * (24ULL * 60ULL * 60ULL); - return ts; -} - /****************************************************************************** SystemStatusPQWM1 ******************************************************************************/ class SystemStatusPQWM1 { public: - timespec mUtcTime; uint16_t mGpsWeek; // x1 uint32_t mGpsTowMs; // x2 uint8_t mTimeValid; // x3 @@ -199,11 +179,6 @@ public: return; } memset(&mM1, 0, sizeof(mM1)); - - timeval tv; - gettimeofday(&tv, NULL); - mM1.mUtcTime.tv_sec = tv.tv_sec; - mM1.mUtcTime.tv_nsec = tv.tv_usec * 1000UL; mM1.mGpsWeek = atoi(mField[eGpsWeek].c_str()); mM1.mGpsTowMs = atoi(mField[eGpsTowMs].c_str()); mM1.mTimeValid = atoi(mField[eTimeValid].c_str()); @@ -237,7 +212,6 @@ public: class SystemStatusPQWP1 { public: - timespec mUtcTime; uint8_t mEpiValidity; // x4 float mEpiLat; // x5 float mEpiLon; // x6 @@ -266,7 +240,6 @@ private: SystemStatusPQWP1 mP1; public: - inline timespec getUtcTime() { return mP1.mUtcTime; } inline uint8_t getEpiValidity() { return mP1.mEpiValidity; } inline float getEpiLat() { return mP1.mEpiLat; } inline float getEpiLon() { return mP1.mEpiLon; } @@ -282,7 +255,6 @@ public: return; } memset(&mP1, 0, sizeof(mP1)); - mP1.mUtcTime = setUtcTime(mField[eUtcTime]); mP1.mEpiValidity = strtol(mField[eEpiValidity].c_str(), NULL, 16); mP1.mEpiLat = atof(mField[eEpiLat].c_str()); mP1.mEpiLon = atof(mField[eEpiLon].c_str()); @@ -301,7 +273,6 @@ public: class SystemStatusPQWP2 { public: - timespec mUtcTime; float mBestLat; // x4 float mBestLon; // x5 float mBestAlt; // x6 @@ -339,7 +310,6 @@ public: return; } memset(&mP2, 0, sizeof(mP2)); - mP2.mUtcTime = setUtcTime(mField[eUtcTime]); mP2.mBestLat = atof(mField[eBestLat].c_str()); mP2.mBestLon = atof(mField[eBestLon].c_str()); mP2.mBestAlt = atof(mField[eBestAlt].c_str()); @@ -356,7 +326,6 @@ public: class SystemStatusPQWP3 { public: - timespec mUtcTime; uint8_t mXtraValidMask; uint32_t mGpsXtraAge; uint32_t mGloXtraAge; @@ -412,7 +381,6 @@ public: return; } memset(&mP3, 0, sizeof(mP3)); - mP3.mUtcTime = setUtcTime(mField[eUtcTime]); mP3.mXtraValidMask = strtol(mField[eXtraValidMask].c_str(), NULL, 16); mP3.mGpsXtraAge = atoi(mField[eGpsXtraAge].c_str()); mP3.mGloXtraAge = atoi(mField[eGloXtraAge].c_str()); @@ -435,7 +403,6 @@ public: class SystemStatusPQWP4 { public: - timespec mUtcTime; uint32_t mGpsEpheValid; uint32_t mGloEpheValid; uint64_t mBdsEpheValid; @@ -473,7 +440,6 @@ public: return; } memset(&mP4, 0, sizeof(mP4)); - mP4.mUtcTime = setUtcTime(mField[eUtcTime]); mP4.mGpsEpheValid = strtol(mField[eGpsEpheValid].c_str(), NULL, 16); mP4.mGloEpheValid = strtol(mField[eGloEpheValid].c_str(), NULL, 16); mP4.mBdsEpheValid = strtol(mField[eBdsEpheValid].c_str(), NULL, 16); @@ -490,7 +456,6 @@ public: class SystemStatusPQWP5 { public: - timespec mUtcTime; uint32_t mGpsUnknownMask; uint32_t mGloUnknownMask; uint64_t mBdsUnknownMask; @@ -558,7 +523,6 @@ public: return; } memset(&mP5, 0, sizeof(mP5)); - mP5.mUtcTime = setUtcTime(mField[eUtcTime]); mP5.mGpsUnknownMask = strtol(mField[eGpsUnknownMask].c_str(), NULL, 16); mP5.mGloUnknownMask = strtol(mField[eGloUnknownMask].c_str(), NULL, 16); mP5.mBdsUnknownMask = strtol(mField[eBdsUnknownMask].c_str(), NULL, 16); @@ -585,7 +549,6 @@ public: class SystemStatusPQWP6 { public: - timespec mUtcTime; uint32_t mFixInfoMask; }; @@ -611,7 +574,6 @@ public: return; } memset(&mP6, 0, sizeof(mP6)); - mP6.mUtcTime = setUtcTime(mField[eUtcTime]); mP6.mFixInfoMask = strtol(mField[eFixInfoMask].c_str(), NULL, 16); } @@ -624,7 +586,6 @@ public: class SystemStatusPQWS1 { public: - timespec mUtcTime; uint32_t mFixInfoMask; uint32_t mHepeLimit; }; @@ -653,7 +614,6 @@ public: return; } memset(&mS1, 0, sizeof(mS1)); - mS1.mUtcTime = setUtcTime(mField[eUtcTime]); mS1.mFixInfoMask = atoi(mField[eFixInfoMask].c_str()); mS1.mHepeLimit = atoi(mField[eHepeLimit].c_str()); } @@ -665,7 +625,6 @@ public: SystemStatusTimeAndClock ******************************************************************************/ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mGpsWeek(nmea.mGpsWeek), mGpsTowMs(nmea.mGpsTowMs), mTimeValid(nmea.mTimeValid), @@ -708,7 +667,6 @@ void SystemStatusTimeAndClock::dump() SystemStatusXoState ******************************************************************************/ SystemStatusXoState::SystemStatusXoState(const SystemStatusPQWM1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mXoState(nmea.mXoState) { } @@ -733,7 +691,6 @@ void SystemStatusXoState::dump() SystemStatusRfAndParams ******************************************************************************/ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mPgaGain(nmea.mPgaGain), mGpsBpAmpI(nmea.mGpsBpAmpI), mGpsBpAmpQ(nmea.mGpsBpAmpQ), @@ -796,7 +753,6 @@ void SystemStatusRfAndParams::dump() SystemStatusErrRecovery ******************************************************************************/ SystemStatusErrRecovery::SystemStatusErrRecovery(const SystemStatusPQWM1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mRecErrorRecovery(nmea.mRecErrorRecovery) { } @@ -821,7 +777,6 @@ void SystemStatusErrRecovery::dump() SystemStatusInjectedPosition ******************************************************************************/ SystemStatusInjectedPosition::SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mEpiValidity(nmea.mEpiValidity), mEpiLat(nmea.mEpiLat), mEpiLon(nmea.mEpiLon), @@ -864,7 +819,6 @@ void SystemStatusInjectedPosition::dump() SystemStatusBestPosition ******************************************************************************/ SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mBestLat(nmea.mBestLat), mBestLon(nmea.mBestLon), mBestAlt(nmea.mBestAlt), @@ -901,7 +855,6 @@ void SystemStatusBestPosition::dump() SystemStatusXtra ******************************************************************************/ SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mXtraValidMask(nmea.mXtraValidMask), mGpsXtraAge(nmea.mGpsXtraAge), mGloXtraAge(nmea.mGloXtraAge), @@ -956,7 +909,6 @@ void SystemStatusXtra::dump() SystemStatusEphemeris ******************************************************************************/ SystemStatusEphemeris::SystemStatusEphemeris(const SystemStatusPQWP4& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mGpsEpheValid(nmea.mGpsEpheValid), mGloEpheValid(nmea.mGloEpheValid), mBdsEpheValid(nmea.mBdsEpheValid), @@ -993,7 +945,6 @@ void SystemStatusEphemeris::dump() SystemStatusSvHealth ******************************************************************************/ SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mGpsUnknownMask(nmea.mGpsUnknownMask), mGloUnknownMask(nmea.mGloUnknownMask), mBdsUnknownMask(nmea.mBdsUnknownMask), @@ -1060,7 +1011,6 @@ void SystemStatusSvHealth::dump() SystemStatusPdr ******************************************************************************/ SystemStatusPdr::SystemStatusPdr(const SystemStatusPQWP6& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mFixInfoMask(nmea.mFixInfoMask) { } @@ -1085,7 +1035,6 @@ void SystemStatusPdr::dump() SystemStatusPositionFailure ******************************************************************************/ SystemStatusPositionFailure::SystemStatusPositionFailure(const SystemStatusPQWS1& nmea) : - SystemStatusItemBase(nmea.mUtcTime), mFixInfoMask(nmea.mFixInfoMask), mHepeLimit(nmea.mHepeLimit) { @@ -1161,7 +1110,9 @@ SystemStatus::SystemStatus() bool SystemStatus::setTimeAndCLock(const SystemStatusPQWM1& nmea) { SystemStatusTimeAndClock s(nmea); - if (mCache.mTimeAndClock.empty() || !mCache.mTimeAndClock.back().equals(s)) { + if (!mCache.mTimeAndClock.empty() && mCache.mTimeAndClock.back().equals(s)) { + mCache.mTimeAndClock.back().mUtcReported = s.mUtcReported; + } else { mCache.mTimeAndClock.push_back(s); if (mCache.mTimeAndClock.size() > maxTimeAndClock) { mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin()); @@ -1173,7 +1124,9 @@ bool SystemStatus::setTimeAndCLock(const SystemStatusPQWM1& nmea) bool SystemStatus::setXoState(const SystemStatusPQWM1& nmea) { SystemStatusXoState s(nmea); - if (mCache.mXoState.empty() || !mCache.mXoState.back().equals(s)) { + if (!mCache.mXoState.empty() && mCache.mXoState.back().equals(s)) { + mCache.mXoState.back().mUtcReported = s.mUtcReported; + } else { mCache.mXoState.push_back(s); if (mCache.mXoState.size() > maxXoState) { mCache.mXoState.erase(mCache.mXoState.begin()); @@ -1185,7 +1138,9 @@ bool SystemStatus::setXoState(const SystemStatusPQWM1& nmea) bool SystemStatus::setRfAndParams(const SystemStatusPQWM1& nmea) { SystemStatusRfAndParams s(nmea); - if (mCache.mRfAndParams.empty() || !mCache.mRfAndParams.back().equals(s)) { + if (!mCache.mRfAndParams.empty() && mCache.mRfAndParams.back().equals(s)) { + mCache.mRfAndParams.back().mUtcReported = s.mUtcReported; + } else { mCache.mRfAndParams.push_back(s); if (mCache.mRfAndParams.size() > maxRfAndParams) { mCache.mRfAndParams.erase(mCache.mRfAndParams.begin()); @@ -1197,7 +1152,9 @@ bool SystemStatus::setRfAndParams(const SystemStatusPQWM1& nmea) bool SystemStatus::setErrRecovery(const SystemStatusPQWM1& nmea) { SystemStatusErrRecovery s(nmea); - if (mCache.mErrRecovery.empty() || !mCache.mErrRecovery.back().equals(s)) { + if (!mCache.mErrRecovery.empty() && mCache.mErrRecovery.back().equals(s)) { + mCache.mErrRecovery.back().mUtcReported = s.mUtcReported; + } else { mCache.mErrRecovery.push_back(s); if (mCache.mErrRecovery.size() > maxErrRecovery) { mCache.mErrRecovery.erase(mCache.mErrRecovery.begin()); @@ -1212,7 +1169,9 @@ bool SystemStatus::setErrRecovery(const SystemStatusPQWM1& nmea) bool SystemStatus::setInjectedPosition(const SystemStatusPQWP1& nmea) { SystemStatusInjectedPosition s(nmea); - if (mCache.mInjectedPosition.empty() || !mCache.mInjectedPosition.back().equals(s)) { + if (!mCache.mInjectedPosition.empty() && mCache.mInjectedPosition.back().equals(s)) { + mCache.mInjectedPosition.back().mUtcReported = s.mUtcReported; + } else { mCache.mInjectedPosition.push_back(s); if (mCache.mInjectedPosition.size() > maxInjectedPosition) { mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin()); @@ -1224,7 +1183,9 @@ bool SystemStatus::setInjectedPosition(const SystemStatusPQWP1& nmea) bool SystemStatus::setBestPosition(const SystemStatusPQWP2& nmea) { SystemStatusBestPosition s(nmea); - if (mCache.mBestPosition.empty() || !mCache.mBestPosition.back().equals(s)) { + if (!mCache.mBestPosition.empty() && mCache.mBestPosition.back().equals(s)) { + mCache.mBestPosition.back().mUtcReported = s.mUtcReported; + } else { mCache.mBestPosition.push_back(s); if (mCache.mBestPosition.size() > maxBestPosition) { mCache.mBestPosition.erase(mCache.mBestPosition.begin()); @@ -1236,7 +1197,9 @@ bool SystemStatus::setBestPosition(const SystemStatusPQWP2& nmea) bool SystemStatus::setXtra(const SystemStatusPQWP3& nmea) { SystemStatusXtra s(nmea); - if (mCache.mXtra.empty() || !mCache.mXtra.back().equals(s)) { + if (!mCache.mXtra.empty() && mCache.mXtra.back().equals(s)) { + mCache.mXtra.back().mUtcReported = s.mUtcReported; + } else { mCache.mXtra.push_back(s); if (mCache.mXtra.size() > maxXtra) { mCache.mXtra.erase(mCache.mXtra.begin()); @@ -1248,7 +1211,9 @@ bool SystemStatus::setXtra(const SystemStatusPQWP3& nmea) bool SystemStatus::setEphemeris(const SystemStatusPQWP4& nmea) { SystemStatusEphemeris s(nmea); - if (mCache.mEphemeris.empty() || !mCache.mEphemeris.back().equals(s)) { + if (!mCache.mEphemeris.empty() && mCache.mEphemeris.back().equals(s)) { + mCache.mEphemeris.back().mUtcReported = s.mUtcReported; + } else { mCache.mEphemeris.push_back(s); if (mCache.mEphemeris.size() > maxEphemeris) { mCache.mEphemeris.erase(mCache.mEphemeris.begin()); @@ -1260,7 +1225,9 @@ bool SystemStatus::setEphemeris(const SystemStatusPQWP4& nmea) bool SystemStatus::setSvHealth(const SystemStatusPQWP5& nmea) { SystemStatusSvHealth s(nmea); - if (mCache.mSvHealth.empty() || !mCache.mSvHealth.back().equals(s)) { + if (!mCache.mSvHealth.empty() && mCache.mSvHealth.back().equals(s)) { + mCache.mSvHealth.back().mUtcReported = s.mUtcReported; + } else { mCache.mSvHealth.push_back(s); if (mCache.mSvHealth.size() > maxSvHealth) { mCache.mSvHealth.erase(mCache.mSvHealth.begin()); @@ -1272,7 +1239,9 @@ bool SystemStatus::setSvHealth(const SystemStatusPQWP5& nmea) bool SystemStatus::setPdr(const SystemStatusPQWP6& nmea) { SystemStatusPdr s(nmea); - if (mCache.mPdr.empty() || !mCache.mPdr.back().equals(s)) { + if (!mCache.mPdr.empty() && mCache.mPdr.back().equals(s)) { + mCache.mPdr.back().mUtcReported = s.mUtcReported; + } else { mCache.mPdr.push_back(s); if (mCache.mPdr.size() > maxPdr) { mCache.mPdr.erase(mCache.mPdr.begin()); @@ -1287,7 +1256,9 @@ bool SystemStatus::setPdr(const SystemStatusPQWP6& nmea) bool SystemStatus::setPositionFailure(const SystemStatusPQWS1& nmea) { SystemStatusPositionFailure s(nmea); - if (mCache.mPositionFailure.empty() || !mCache.mPositionFailure.back().equals(s)) { + if (!mCache.mPositionFailure.empty() && mCache.mPositionFailure.back().equals(s)) { + mCache.mPositionFailure.back().mUtcReported = s.mUtcReported; + } else { mCache.mPositionFailure.push_back(s); if (mCache.mPositionFailure.size() > maxPositionFailure) { mCache.mPositionFailure.erase(mCache.mPositionFailure.begin()); @@ -1322,8 +1293,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) } char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 }; - strncpy(buf, data, len); - LOC_LOGI("setNmeaString-0321a: nmea=%s", buf); + strlcpy(buf, data, sizeof(buf)); pthread_mutex_lock(&mMutexSystemStatus); @@ -1393,10 +1363,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) bool SystemStatus::eventPosition(const UlpLocation& location, const GpsLocationExtended& locationEx) { - timespec ts; - ts.tv_sec = location.gpsLocation.timestamp / 1000ULL; - ts.tv_nsec = (location.gpsLocation.timestamp % 1000ULL) * 1000000ULL; - SystemStatusLocation s(location, locationEx, ts); + SystemStatusLocation s(location, locationEx); if ((mCache.mLocation.empty()) || !mCache.mLocation.back().equals(s)) { mCache.mLocation.push_back(s); if (mCache.mLocation.size() > maxLocation) { diff --git a/core/SystemStatus.h b/core/SystemStatus.h index f001f610..e8cb197b 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -49,8 +49,16 @@ namespace loc_core class SystemStatusItemBase { public: - timespec mUtcTime; - SystemStatusItemBase(timespec utctime) : mUtcTime(utctime) { }; + timespec mUtcTime; // UTC timestamp when this info was last updated + timespec mUtcReported; // UTC timestamp when this info was reported + + SystemStatusItemBase() { + timeval tv; + gettimeofday(&tv, NULL); + mUtcTime.tv_sec = tv.tv_sec; + mUtcTime.tv_nsec = tv.tv_usec *1000ULL; + mUtcReported = mUtcTime; + }; virtual ~SystemStatusItemBase() { }; virtual void dump(void) { }; }; @@ -61,9 +69,7 @@ public: UlpLocation mLocation; GpsLocationExtended mLocationEx; SystemStatusLocation(const UlpLocation& location, - const GpsLocationExtended& locationEx, - const timespec& ts) : - SystemStatusItemBase(ts), + const GpsLocationExtended& locationEx) : mLocation(location), mLocationEx(locationEx){ }; bool equals(SystemStatusLocation& peer); From 3b9f65652b1ffd7d4c121b5898b8d20cf78c120a Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Wed, 12 Apr 2017 14:04:29 -0700 Subject: [PATCH 484/945] Fix crash at gnss bugreport caused by empty report Adding an empty check for gnss time information before generating a gnss bugreport to avoid null object access. Bug: 37259715 Change-Id: Ic507acbcc8b5949c4304ad76a3032add5893d099 CRs-Fixed: 2032932 --- gnss/GnssAdapter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 377a0781..77c48548 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2691,10 +2691,12 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) r.mLocation.mLocation.speed); // time block + r.mTime.size = sizeof(r.mTime); if(!reports.mBestPosition.empty()) { - r.mTime.size = sizeof(r.mTime); - r.mTime.timeEstimate = reports.mBestPosition.back().mUtcTime.tv_sec; - r.mTime.timeUncertaintyNs = (float)(reports.mTimeAndClock.back().mTimeUnc); + r.mTime.timeEstimate = reports.mBestPosition.back().mUtcTime.tv_sec; + } + if(!reports.mTimeAndClock.empty()) { + r.mTime.timeUncertaintyNs = (float)(reports.mTimeAndClock.back().mTimeUnc); } LOC_LOGV("getDebugReport - timeestimate=%lld", r.mTime.timeEstimate); From 9e232dda61858489c92bbeba338b0272d8fcda63 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 21 Mar 2017 17:06:09 -0700 Subject: [PATCH 485/945] Remove owner of gps hal modules Owner does not need to be specified for this project. Change-Id: I918a767ed3b83e134c5e63ded5b25070b3399ac8 --- android/Android.mk | 2 -- core/Android.mk | 2 -- gnss/Android.mk | 2 -- location/Android.mk | 2 -- 4 files changed, 8 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index 000cd59a..8c647658 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -2,7 +2,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti -LOCAL_MODULE_OWNER := qti LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ AGnss.cpp \ @@ -47,7 +46,6 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti -LOCAL_MODULE_OWNER := qti LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc LOCAL_SRC_FILES := \ diff --git a/core/Android.mk b/core/Android.mk index badae1ac..3051a92b 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -6,8 +6,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core -LOCAL_MODULE_OWNER := qti - LOCAL_MODULE_TAGS := optional ifeq ($(TARGET_DEVICE),apq8026_lw) diff --git a/gnss/Android.mk b/gnss/Android.mk index 1f0a549d..9103894c 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -6,8 +6,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgnss -LOCAL_MODULE_OWNER := qti - LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ diff --git a/location/Android.mk b/location/Android.mk index 49a60d7d..bdd3e6b8 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -6,8 +6,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := liblocation_api -LOCAL_MODULE_OWNER := qti - LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ From 891005e20c0d8eed1ed4c9738540b82fdfdabe06 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 22 Mar 2017 13:18:38 -0700 Subject: [PATCH 486/945] Move gnss hal to vendor partition gnss hal is moved to vendor partition for binerization enablement CRs-fixed: 2020778 Change-Id: I8de91d0418ef4b9a1c778c45fe02d27d42c46c97 --- android/Android.mk | 3 +++ android/android.hardware.gnss@1.0-service-qti.rc | 6 +++--- core/Android.mk | 2 ++ gnss/Android.mk | 2 ++ location/Android.mk | 2 ++ utils/Android.mk | 3 ++- utils/platform_lib_abstractions/loc_pla/src/Android.mk | 3 ++- utils/platform_lib_abstractions/loc_stub/src/Android.mk | 3 ++- 8 files changed, 18 insertions(+), 6 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index 8c647658..a9b0d4bc 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -2,6 +2,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ AGnss.cpp \ @@ -46,6 +48,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc LOCAL_SRC_FILES := \ diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.0-service-qti.rc index 7ba64601..8c54231f 100644 --- a/android/android.hardware.gnss@1.0-service-qti.rc +++ b/android/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ -service gnss_service /system/bin/hw/android.hardware.gnss@1.0-service-qti +service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class main - user system - group system + user gps + group system gps inet diff --git a/core/Android.mk b/core/Android.mk index 3051a92b..313ee25d 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -6,6 +6,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional ifeq ($(TARGET_DEVICE),apq8026_lw) diff --git a/gnss/Android.mk b/gnss/Android.mk index 9103894c..ea362087 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -6,6 +6,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgnss +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ diff --git a/location/Android.mk b/location/Android.mk index bdd3e6b8..6d2c9fa8 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -6,6 +6,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := liblocation_api +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ diff --git a/utils/Android.mk b/utils/Android.mk index 6a441f0f..ef1e5e16 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -65,7 +65,8 @@ LOCAL_COPY_HEADERS:= \ loc_gps.h LOCAL_MODULE := libgps.utils - +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index ad07197b..0bcddcba 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -45,7 +45,8 @@ LOCAL_COPY_HEADERS:= \ ../include/platform_lib_time.h LOCAL_MODULE := libloc_pla - +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk index e69b012e..e899ca38 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -41,7 +41,8 @@ LOCAL_COPY_HEADERS:= \ ../include/loc_stub_time.h LOCAL_MODULE := libloc_stub - +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false From 9a957ef66e3bef10db02b13e8b184a0c15005cf7 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 11 Apr 2017 12:03:09 -0700 Subject: [PATCH 487/945] Move gnss hal to default instance gnss hal must use the default instance instead of gnss instance for binderization CRs-fixed: 2020778 Change-Id: I96c203751891728542f06bede3d1ee8282c7878b --- android/service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/service.cpp b/android/service.cpp index bfa0d884..5779e67e 100644 --- a/android/service.cpp +++ b/android/service.cpp @@ -27,5 +27,5 @@ using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - return defaultPassthroughServiceImplementation("gnss"); + return defaultPassthroughServiceImplementation(); } From 488aa4f196da4a48e2fd3aa4039dd58469c927c6 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Thu, 20 Apr 2017 18:14:11 -0700 Subject: [PATCH 488/945] connectity events for XC2.0 daemonize send connectity events to XTRA client via local socket. Change-Id: Icb9f04eca61a0f41d9628d95e458bc7f7be56c50 CRs-fixed: 2023484 --- android/AGnssRil.cpp | 127 +++++++++++++++++++++++++++++++++++++++++++ android/AGnssRil.h | 83 ++++++++++++++++++++++++++++ android/Android.mk | 1 + android/Gnss.cpp | 5 ++ android/Gnss.h | 6 +- 5 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 android/AGnssRil.cpp create mode 100644 android/AGnssRil.h diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp new file mode 100644 index 00000000..0cf79a32 --- /dev/null +++ b/android/AGnssRil.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc__AGnssRilInterface" + +#include +#include +#include +#include +#include +#include +#include +#include "Gnss.h" +#include "AGnssRil.h" +typedef void* (getLocationInterface)(); + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +static bool sendConnectionEvent(const bool connected, const uint8_t type); + +AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) { + ENTRY_LOG_CALLFLOW(); +} + +AGnssRil::~AGnssRil() { + ENTRY_LOG_CALLFLOW(); +} + +Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool roaming) { + ENTRY_LOG_CALLFLOW(); + + // for XTRA + sendConnectionEvent(connected, (uint8_t)type); + + return true; +} + +// for XTRA +static inline int createSocket() { + int socketFd = -1; + + if ((socketFd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + LOC_LOGe("create socket error. reason:%s", strerror(errno)); + + } else { + const char* socketPath = "/data/misc/location/xtra/socket_hal_xtra"; + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); + + if (::connect(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("cannot connect to XTRA. reason:%s", strerror(errno)); + if (::close(socketFd)) { + LOC_LOGe("close socket error. reason:%s", strerror(errno)); + } + socketFd = -1; + } + } + + return socketFd; +} + +static inline void closeSocket(const int socketFd) { + if (socketFd >= 0) { + if(::close(socketFd)) { + LOC_LOGe("close socket error. reason:%s", strerror(errno)); + } + } +} + +static inline bool sendConnectionEvent(const bool connected, const uint8_t type) { + int socketFd = createSocket(); + if (socketFd < 0) { + LOC_LOGe("XTRA unreachable. sending failed."); + return false; + } + + std::stringstream ss; + ss << "connection"; + ss << " " << (connected ? "1" : "0"); + ss << " " << (int)type; + ss << "\n"; // append seperator + + const std::string& data = ss.str(); + int remain = data.length(); + ssize_t sent = 0; + + while (remain > 0 && + (sent = ::send(socketFd, data.c_str() + (data.length() - remain), + remain, MSG_NOSIGNAL)) > 0) { + remain -= sent; + } + + if (sent < 0) { + LOC_LOGe("sending error. reason:%s", strerror(errno)); + } + + closeSocket(socketFd); + + return (remain == 0); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/AGnssRil.h b/android/AGnssRil.h new file mode 100644 index 00000000..61216d8f --- /dev/null +++ b/android/AGnssRil.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ +#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IAGnssRil; +using ::android::hardware::gnss::V1_0::IAGnssRilCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +/* + * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface + * allows the GNSS chipset to request radio interface layer information from Android platform. + * Examples of such information are reference location, unique subscriber ID, phone number string + * and network availability changes. Also contains wrapper methods to allow methods from + * IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL. + */ +struct AGnssRil : public IAGnssRil { + AGnssRil(Gnss* gnss); + ~AGnssRil(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow. + * These declarations were generated from IAGnssRil.hal. + */ + Return setCallback(const sp& /*callback*/) override { + return Void(); + } + Return setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override { + return Void(); + } + Return setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override { + return false; + } + Return updateNetworkAvailability(bool /*available*/, + const hidl_string& /*apn*/) override { + return false; + } + Return updateNetworkState(bool connected, NetworkType type, bool roaming) override; + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ diff --git a/android/Android.mk b/android/Android.mk index a9b0d4bc..e3c3d500 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -14,6 +14,7 @@ LOCAL_SRC_FILES := \ GnssNi.cpp \ GnssConfiguration.cpp \ GnssDebug.cpp \ + AGnssRil.cpp LOCAL_SRC_FILES += \ location_api/LocationUtil.cpp \ diff --git a/android/Gnss.cpp b/android/Gnss.cpp index d17077cc..9a362f0a 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -316,6 +316,11 @@ Return> Gnss::getExtensionGnssDebug() { return mGnssDebug; } +Return> Gnss::getExtensionAGnssRil() { + mGnssRil = new AGnssRil(this); + return mGnssRil; +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/Gnss.h b/android/Gnss.h index 99c5e40b..e4589d60 100644 --- a/android/Gnss.h +++ b/android/Gnss.h @@ -22,6 +22,7 @@ #define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H #include +#include #include #include #include @@ -91,9 +92,7 @@ struct Gnss : public IGnss { Return> getExtensionGnssGeofencing() override; Return> getExtensionGnssBatching() override; - inline Return> getExtensionAGnssRil() override { - return nullptr; - } + Return> getExtensionAGnssRil() override; inline Return> getExtensionGnssNavigationMessage() override { return nullptr; @@ -130,6 +129,7 @@ struct Gnss : public IGnss { sp mGnssGeofencingIface = nullptr; sp mGnssBatching = nullptr; sp mGnssDebug = nullptr; + sp mGnssRil = nullptr; GnssAPIClient* mApi = nullptr; sp mGnssCbIface = nullptr; From 19f6501f0311a07eb1a57fd18d627fde5a716e4b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 25 Apr 2017 18:31:34 -0700 Subject: [PATCH 489/945] Add group radio to gnss hal process Needed for dsi connection for supl es Bug: 37409476 CRs-fixed: 2037256 Change-Id: Ieb84ab29349021e2ea07d6baf07a6c8a37c183cf --- android/android.hardware.gnss@1.0-service-qti.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.0-service-qti.rc index 8c54231f..05f805ff 100644 --- a/android/android.hardware.gnss@1.0-service-qti.rc +++ b/android/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class main user gps - group system gps inet + group system gps inet radio From 3eef3d7a6c2ecf63cd29e595260824804abae4a8 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 27 Apr 2017 13:46:09 -0700 Subject: [PATCH 490/945] SystemStatus - Add ephemeris detail info in Gnss Debug interface Add ephemeris detail info in Gnss Debug interface. This new info also comes up in NMEA stings. Requires a new QMI_LOC interface that supports extended NMEA string TLV. Change-Id: I5dc566fb210c06a443ed6c27e064377851ce83a5 CRs-Fixed: 2024594 --- android/GnssDebug.cpp | 98 ++++++++---- android/location_api/LocationUtil.cpp | 53 ++++++ android/location_api/LocationUtil.h | 4 + core/SystemStatus.cpp | 161 ++++++++++++++++--- core/SystemStatus.h | 43 ++++- gnss/GnssAdapter.cpp | 222 +++++++++++++++++++------- location/LocationAPI.h | 30 +++- utils/loc_nmea.h | 2 +- 8 files changed, 500 insertions(+), 113 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index d7a53676..e6f59df2 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -30,6 +30,9 @@ namespace implementation { using ::android::hardware::hidl_vec; +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800ULL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns + GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) { } @@ -42,7 +45,7 @@ GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) */ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) { - LOC_LOGI("GnssDebug - 0317a"); + LOC_LOGI("GnssDebug - 0426a"); DebugData data = { }; @@ -57,35 +60,57 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) mGnss->getGnssInterface()->getDebugReport(reports); // location block - data.position.valid = true; - data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; - data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; - data.position.altitudeMeters = reports.mLocation.mLocation.altitude; - data.position.speedMetersPerSec = (double)(reports.mLocation.mLocation.speed); - data.position.bearingDegrees = (double)(reports.mLocation.mLocation.bearing); - data.position.horizontalAccuracyMeters = (double)(reports.mLocation.mLocation.accuracy); - data.position.verticalAccuracyMeters = reports.mLocation.verticalAccuracyMeters; - data.position.speedAccuracyMetersPerSecond = reports.mLocation.speedAccuracyMetersPerSecond; - data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; + if (reports.mLocation.mValid) { + data.position.valid = true; + data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; + data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; + data.position.altitudeMeters = reports.mLocation.mLocation.altitude; - LOC_LOGV("GnssDebug - lat=%f lon=%f", data.position.latitudeDegrees, data.position.longitudeDegrees); + data.position.speedMetersPerSec = + (double)(reports.mLocation.mLocation.speed); + data.position.bearingDegrees = + (double)(reports.mLocation.mLocation.bearing); + data.position.horizontalAccuracyMeters = + (double)(reports.mLocation.mLocation.accuracy); + data.position.verticalAccuracyMeters = + reports.mLocation.verticalAccuracyMeters; + data.position.speedAccuracyMetersPerSecond = + reports.mLocation.speedAccuracyMetersPerSecond; + data.position.bearingAccuracyDegrees = + reports.mLocation.bearingAccuracyDegrees; + LOC_LOGI("GnssDebug - lat=%f lon=%f", + data.position.latitudeDegrees, data.position.longitudeDegrees); - timeval tv_now, tv_report; - tv_report.tv_sec = reports.mLocation.mLocation.timestamp / 1000ULL; - tv_report.tv_usec = (reports.mLocation.mLocation.timestamp % 1000ULL) * 1000ULL; - gettimeofday(&tv_now, NULL); - data.position.ageSeconds = - (tv_now.tv_sec - tv_report.tv_sec) + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mLocation.timestamp / 1000ULL; + tv_report.tv_usec = + (reports.mLocation.mLocation.timestamp % 1000ULL) * 1000ULL; + gettimeofday(&tv_now, NULL); + data.position.ageSeconds = + (tv_now.tv_sec - tv_report.tv_sec) + + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; - LOC_LOGV("GnssDebug - time now=%lld:%lld", tv_now.tv_sec, tv_now.tv_usec); - LOC_LOGV("GnssDebug - time rep=%lld:%lld", tv_report.tv_sec, tv_report.tv_usec); - LOC_LOGV("GnssDebug - age=%f", data.position.ageSeconds); + LOC_LOGI("GnssDebug - time now=%lld:%lld", tv_now.tv_sec, tv_now.tv_usec); + LOC_LOGI("GnssDebug - time rep=%lld:%lld",tv_report.tv_sec, tv_report.tv_usec); + LOC_LOGI("GnssDebug - age=%f", data.position.ageSeconds); + } + else { + data.position.valid = false; + } // time block - data.time.timeEstimate = reports.mTime.timeEstimate; - data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; - - LOC_LOGV("GnssDebug - timeestimate=%lld", data.time.timeEstimate); + if (reports.mTime.mValid) { + data.time.timeEstimate = reports.mTime.timeEstimate; + data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; + data.time.frequencyUncertaintyNsPerSec = + reports.mTime.frequencyUncertaintyNsPerSec; + } + else { + data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; + data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC); + data.time.frequencyUncertaintyNsPerSec = 0; + } + LOC_LOGI("GnssDebug - timeestimate=%lld", data.time.timeEstimate); // satellite data block SatelliteData s = { }; @@ -94,18 +119,31 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) for (uint32_t i=0; i #include +#include namespace android { namespace hardware { @@ -41,6 +42,9 @@ namespace implementation { void convertGnssLocation(Location& in, GnssLocation& out); void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out); +void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); +void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); +void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); } // namespace implementation } // namespace V1_0 diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 1adeb66a..12f97ddc 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -113,6 +113,8 @@ public: double mAgcGlo; // x14 double mAgcBds; // x15 double mAgcGal; // x16 + int32_t mLeapSeconds;// x17 + int32_t mLeapSecUnc; // x18 }; // parser @@ -144,7 +146,9 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, - eMax = eRecErrorRecovery + eLeapSeconds = 23, + eLeapSecUnc = 24, + eMax }; SystemStatusPQWM1 mM1; @@ -171,11 +175,14 @@ public: inline uint32_t getAgcBds() { return mM1.mAgcBds; } inline uint32_t getAgcGal() { return mM1.mAgcGal; } inline uint32_t getRecErrorRecovery() { return mM1.mRecErrorRecovery; } + inline int32_t getLeapSeconds(){ return mM1.mLeapSeconds; } + inline int32_t getLeapSecUnc() { return mM1.mLeapSecUnc; } SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) { if (mField.size() < eMax) { + LOC_LOGE("PQWM1parser - invalid size=%d", mField.size()); return; } memset(&mM1, 0, sizeof(mM1)); @@ -201,6 +208,8 @@ public: mM1.mAgcGlo = atof(mField[eAgcGlo].c_str()); mM1.mAgcBds = atof(mField[eAgcBds].c_str()); mM1.mAgcGal = atof(mField[eAgcGal].c_str()); + mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); + mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); } inline SystemStatusPQWM1& get() { return mM1;} //getparser @@ -235,7 +244,7 @@ private: eEpiHepe = 6, eEpiAltUnc = 7, eEpiSrc = 8, - eMax = eEpiSrc + eMax }; SystemStatusPQWP1 mP1; @@ -292,7 +301,7 @@ private: eBestAlt = 4, eBestHepe = 5, eBestAltUnc = 6, - eMax = eBestAltUnc + eMax }; SystemStatusPQWP2 mP2; @@ -357,7 +366,7 @@ private: eBdsXtraValid = 10, eGalXtraValid = 11, eQzssXtraValid = 12, - eMax = eQzssXtraValid + eMax }; SystemStatusPQWP3 mP3; @@ -422,7 +431,7 @@ private: eBdsEpheValid = 4, eGalEpheValid = 5, eQzssEpheValid = 6, - eMax = eQzssEpheValid + eMax }; SystemStatusPQWP4 mP4; @@ -495,7 +504,7 @@ private: eBdsBadMask = 14, eGalBadMask = 15, eQzssBadMask = 16, - eMax = eQzssBadMask + eMax }; SystemStatusPQWP5 mP5; @@ -560,7 +569,7 @@ private: eTalker = 0, eUtcTime = 1, eFixInfoMask = 2, - eMax = eFixInfoMask + eMax }; SystemStatusPQWP6 mP6; @@ -580,6 +589,44 @@ public: inline SystemStatusPQWP6& get() { return mP6;} }; +/****************************************************************************** + SystemStatusPQWP7parser +******************************************************************************/ +class SystemStatusPQWP7 +{ +public: + SystemStatusNav mNav[SV_ALL_NUM]; +}; + +class SystemStatusPQWP7parser : public SystemStatusNmeaBase +{ +private: + enum + { + eTalker = 0, + eUtcTime = 1, + eMax = 2 + SV_ALL_NUM*3 + }; + SystemStatusPQWP7 mP7; + +public: + SystemStatusPQWP7parser(const char *str_in, uint32_t len_in) + : SystemStatusNmeaBase(str_in, len_in) + { + if (mField.size() < eMax) { + LOC_LOGE("PQWP7parser - invalid size=%d", mField.size()); + return; + } + for (uint32_t i=0; i maxNavData) { + mCache.mNavData.erase(mCache.mNavData.begin()); + } + } + return true; +} + /****************************************************************************** SystemStatus - Sx functions ******************************************************************************/ @@ -1283,6 +1385,7 @@ static uint32_t cnt_p3 = 0; static uint32_t cnt_p4 = 0; static uint32_t cnt_p5 = 0; static uint32_t cnt_p6 = 0; +static uint32_t cnt_p7 = 0; static uint32_t cnt_s1 = 0; bool SystemStatus::setNmeaString(const char *data, uint32_t len) @@ -1293,7 +1396,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) } char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 }; - strlcpy(buf, data, sizeof(buf)); + strlcpy(buf, data, (len < strlen(data))? len : strlen(data)); pthread_mutex_lock(&mMutexSystemStatus); @@ -1330,6 +1433,10 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) ret = setPdr(SystemStatusPQWP6parser(buf, len).get()); cnt_p6++; } + else if (0 == strncmp(data, "$PQWP7", SystemStatusNmeaBase::NMEA_MINSIZE)) { + ret = setNavData(SystemStatusPQWP7parser(buf, len).get()); + cnt_p7++; + } else if (0 == strncmp(data, "$PQWS1", SystemStatusNmeaBase::NMEA_MINSIZE)) { ret = setPositionFailure(SystemStatusPQWS1parser(buf, len).get()); cnt_s1++; @@ -1338,7 +1445,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) // do nothing } cnt++; - LOC_LOGV("setNmeaString: cnt=%d M:%d 1:%d 2:%d 3:%d 4:%d 5:%d 6:%d S:%d", + LOC_LOGV("setNmeaString: cnt=%d M:%d 1:%d 2:%d 3:%d 4:%d 5:%d 6:%d 7:%d S:%d", cnt, cnt_m1, cnt_p1, @@ -1347,6 +1454,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) cnt_p4, cnt_p5, cnt_p6, + cnt_p7, cnt_s1); pthread_mutex_unlock(&mMutexSystemStatus); @@ -1364,19 +1472,20 @@ bool SystemStatus::eventPosition(const UlpLocation& location, const GpsLocationExtended& locationEx) { SystemStatusLocation s(location, locationEx); - if ((mCache.mLocation.empty()) || !mCache.mLocation.back().equals(s)) { + if (!mCache.mLocation.empty() && mCache.mLocation.back().equals(s)) { + mCache.mLocation.back().mUtcReported = s.mUtcReported; + } + else { mCache.mLocation.push_back(s); if (mCache.mLocation.size() > maxLocation) { mCache.mLocation.erase(mCache.mLocation.begin()); } - - LOC_LOGV("eventPosition - lat=%f lon=%f alt=%f speed=%f", - s.mLocation.gpsLocation.latitude, - s.mLocation.gpsLocation.longitude, - s.mLocation.gpsLocation.altitude, - s.mLocation.gpsLocation.speed); - } + LOC_LOGV("eventPosition - lat=%f lon=%f alt=%f speed=%f", + s.mLocation.gpsLocation.latitude, + s.mLocation.gpsLocation.longitude, + s.mLocation.gpsLocation.altitude, + s.mLocation.gpsLocation.speed); return true; } @@ -1451,6 +1560,12 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con report.mPdr.push_back(mCache.mPdr.back()); report.mPdr.back().dump(); } + report.mNavData.clear(); + if (mCache.mNavData.size() >= 1) { + report.mNavData.push_back(mCache.mNavData.back()); + report.mNavData.back().dump(); + } + report.mPositionFailure.clear(); if (mCache.mPositionFailure.size() >= 1) { report.mPositionFailure.push_back(mCache.mPositionFailure.back()); @@ -1472,6 +1587,8 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con report.mEphemeris.clear(); report.mSvHealth.clear(); report.mPdr.clear(); + report.mNavData.clear(); + report.mPositionFailure.clear(); report = mCache; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index e8cb197b..a3b38d34 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -33,12 +33,20 @@ #include #include -#define GPS_MIN (1) +#define GPS_MIN (1) //1-32 #define SBAS_MIN (33) -#define GLO_MIN (65) -#define BDS_MIN (201) -#define QZSS_MIN (193) -#define GAL_MIN (301) +#define GLO_MIN (65) //65-88 +#define QZSS_MIN (193) //193-197 +#define BDS_MIN (201) //201-237 +#define GAL_MIN (301) //301-336 + +#define GPS_NUM (32) +#define SBAS_NUM (32) +#define GLO_NUM (24) +#define QZSS_NUM (5) +#define BDS_NUM (37) +#define GAL_NUM (36) +#define SV_ALL_NUM (GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM) //=134 namespace loc_core { @@ -87,6 +95,8 @@ public: int32_t mTimeUnc; int32_t mClockFreqBias; int32_t mClockFreqBiasUnc; + int32_t mLeapSeconds; + int32_t mLeapSecUnc; SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); bool equals(SystemStatusTimeAndClock& peer); void dump(void); @@ -229,6 +239,23 @@ public: void dump(void); }; +class SystemStatusPQWP7; +struct SystemStatusNav +{ + GnssEphemerisType mType; + GnssEphemerisSource mSource; + int32_t mAgeSec; +}; + +class SystemStatusNavData : public SystemStatusItemBase +{ +public: + SystemStatusNav mNav[SV_ALL_NUM]; + SystemStatusNavData(const SystemStatusPQWP7& nmea); + bool equals(SystemStatusNavData& peer); + void dump(void); +}; + class SystemStatusPQWS1; class SystemStatusPositionFailure : public SystemStatusItemBase { @@ -259,6 +286,8 @@ public: std::vector mEphemeris; std::vector mSvHealth; std::vector mPdr; + std::vector mNavData; + std::vector mPositionFailure; }; @@ -282,6 +311,8 @@ class SystemStatus static const uint32_t maxEphemeris = 5; static const uint32_t maxSvHealth = 5; static const uint32_t maxPdr = 5; + static const uint32_t maxNavData = 5; + static const uint32_t maxPositionFailure = 5; SystemStatusReports mCache; @@ -299,6 +330,8 @@ class SystemStatus bool setEphemeris(const SystemStatusPQWP4& nmea); bool setSvHealth(const SystemStatusPQWP5& nmea); bool setPdr(const SystemStatusPQWP6& nmea); + bool setNavData(const SystemStatusPQWP7& nmea); + bool setPositionFailure(const SystemStatusPQWS1& nmea); public: diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 992ced85..125f24f7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2596,59 +2596,135 @@ void GnssAdapter::dataConnFailedCommand(AGpsExtType agpsType){ } void GnssAdapter::convertSatelliteInfo(std::vector& out, - const GnssSvType& in_constellation, - const SystemStatusReports& in) + const GnssSvType& in_constellation, + const SystemStatusReports& in) { - GnssDebugSatelliteInfo s = {}; - uint64_t mask = 0ULL; - float age = 0.0; + uint64_t sv_mask = 0ULL; uint32_t svid_min = 0; - uint32_t mask_size = 0; + uint32_t svid_num = 0; + uint32_t svid_idx = 0; + uint64_t eph_health_good_mask = 0ULL; + uint64_t eph_health_bad_mask = 0ULL; + uint64_t server_perdiction_available_mask = 0ULL; + float server_perdiction_age = 0.0f; + + // set constellationi based parameters switch (in_constellation) { case GNSS_SV_TYPE_GPS: svid_min = GPS_MIN; - mask_size = 32; + svid_num = GPS_NUM; + svid_idx = 0; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mGpsGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mGpsBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mGpsXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mGpsXtraAge); + } break; case GNSS_SV_TYPE_GLONASS: svid_min = GLO_MIN; - mask_size = 32; - break; - case GNSS_SV_TYPE_BEIDOU: - svid_min = BDS_MIN; - mask_size = 64; + svid_num = GLO_NUM; + svid_idx = GPS_NUM; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mGloGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mGloBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mGloXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mGloXtraAge); + } break; case GNSS_SV_TYPE_QZSS: svid_min = QZSS_MIN; - mask_size = 32; + svid_num = QZSS_NUM; + svid_idx = GPS_NUM+GLO_NUM; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mQzssGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mQzssBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mQzssXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mQzssXtraAge); + } + break; + case GNSS_SV_TYPE_BEIDOU: + svid_min = BDS_MIN; + svid_num = BDS_NUM; + svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mBdsGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mBdsBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mBdsXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mBdsXtraAge); + } break; case GNSS_SV_TYPE_GALILEO: svid_min = GAL_MIN; - mask_size = 64; + svid_num = GAL_NUM; + svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mGalGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mGalBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mGalXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mGalXtraAge); + } break; default: return; } - if(!in.mEphemeris.empty()) { - mask = in.mEphemeris.back().mGpsEpheValid; - if(!in.mXtra.empty()) { - age = (float)(in.mXtra.back().mGpsXtraAge); + // extract each sv info from systemstatus report + for(uint32_t i=0; i &nmeaArraystr); #define DEBUG_NMEA_MINSIZE 6 -#define DEBUG_NMEA_MAXSIZE 256 +#define DEBUG_NMEA_MAXSIZE 4096 inline bool loc_nmea_is_debug(const char* nmea, int length) { return ((nullptr != nmea) && (length >= DEBUG_NMEA_MINSIZE) && (length <= DEBUG_NMEA_MAXSIZE) && From 9c212abde185516543afa9b77329d6b8cba0cad0 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 4 Apr 2017 15:38:19 -0700 Subject: [PATCH 491/945] Add vertical uncertainity field Add vertical uncertainity field to LocGpsLocation and report whenever possible. CRs-Fixed: 2028902 Change-Id: I2610b0eaf527b516e7a1cac958b82795f535cc06 --- utils/loc_gps.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/loc_gps.h b/utils/loc_gps.h index 2e495b82..e3f21826 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -98,6 +98,8 @@ typedef uint16_t LocGpsLocationFlags; #define LOC_GPS_LOCATION_HAS_BEARING 0x0008 /** LocGpsLocation has valid accuracy. */ #define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010 +/** LocGpsLocation has valid vertical uncertainity */ +#define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0020 /** Flags for the loc_gps_set_capabilities callback. */ @@ -545,6 +547,8 @@ typedef struct { float bearing; /** Represents expected accuracy in meters. */ float accuracy; + /** Represents the expected vertical uncertainity in meters*/ + float vertUncertainity; /** Timestamp for the location fix. */ LocGpsUtcTime timestamp; } LocGpsLocation; From c553418ce7c6447fa7f08c27dfe0b76b6d9cbeec Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 28 Apr 2017 17:25:06 +0800 Subject: [PATCH 492/945] Re-enable delete_aiding_data for user build Allow delete aiding data request from HAL API for user build. Change-Id: Icfafe07b4217e482e4ca402b9a1da5ca70e1ff01 CRs-fixed: 2034718 --- gnss/GnssAdapter.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 992ced85..f12bdeee 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -808,12 +808,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) mData(data) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; - #ifdef TARGET_BUILD_VARIANT_USER - err = LOCATION_ERROR_NOT_SUPPORTED; - #endif - if (LOCATION_ERROR_SUCCESS == err) { - err = mApi.deleteAidingData(mData); - } + err = mApi.deleteAidingData(mData); mAdapter.reportResponse(err, mSessionId); } }; From 86ad4f8f4411b979ede22300fa89fd840fece142 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 28 Apr 2017 18:24:07 +0800 Subject: [PATCH 493/945] Enable LOGV for gps directory Define LOG_NDEBUG 0 to enable VERBOSE log messages in hardware/qcom/gps Change-Id: I954cad757f13d6bac99b7a06625daa0ace84a17e CRs-fixed: 2025673 --- android/location_api/BatchingAPIClient.cpp | 2 +- android/location_api/GeofenceAPIClient.cpp | 2 +- android/location_api/GnssAPIClient.cpp | 2 +- android/location_api/MeasurementAPIClient.cpp | 2 +- core/ContextBase.cpp | 2 +- core/LocAdapterBase.cpp | 2 +- core/LocDualContext.cpp | 2 +- core/loc_core_log.cpp | 2 +- location/LocationAPIClientBase.cpp | 2 +- utils/MsgTask.cpp | 2 +- utils/loc_cfg.cpp | 2 +- utils/loc_log.cpp | 2 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_nmea.cpp | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 6022fbfa..21fe2c62 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_BatchingAPIClient" #include diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp index ee4bfc38..420cdeb3 100644 --- a/android/location_api/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_GeofenceApiClient" #include diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index a31de5de..c76f74df 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_GnssAPIClient" #include diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 8e6f48c6..0f998a07 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_MeasurementAPIClient" #include diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 849a7d3a..8af48fc7 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_CtxBase" #include diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index aca59093..7cb4086b 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_LocAdapterBase" #include diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index c6a88962..90eacff8 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_DualCtx" #include diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 620d1b0a..ae5948d5 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_core_log" #include diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 6ced55a0..a160adc0 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" #include diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 636dd4cd..80abeecd 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_MsgTask" #include diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 926781a6..d2364f69 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_utils_cfg" #include diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index f6b54f91..23b28944 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #include #include diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index dfe19a2d..5d669916 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -32,7 +32,7 @@ #include #include -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_misc_utils" int loc_util_split_string(char *raw_string, char **split_strings_ptr, diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index dee98dbe..e288af46 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -27,7 +27,7 @@ * */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_nmea" #include #include From 08efa3c6c2359de9d50941421df79e74db7f4f40 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 28 Apr 2017 16:21:53 -0700 Subject: [PATCH 494/945] Add handling of GNSS NI TYPE EMERGENCY Network Initiated type emergency was not being handled because it was missing from gnss hal api. Hardcoded value until it is added in gnss hal api. Change-Id: If0e538c3083e351bf642765eae88404ce6e0ae1b CRs-fixed: 2037093 --- android/location_api/GnssAPIClient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index a31de5de..99b801e9 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -280,7 +280,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio return; } - IGnssNiCallback::GnssNiNotification notificationGnss; + IGnssNiCallback::GnssNiNotification notificationGnss = {}; notificationGnss.notificationId = id; @@ -290,7 +290,9 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL; else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE; - // GNSS_NI_TYPE_EMERGENCY_SUPL not supported + else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL) + notificationGnss.niType = + static_cast(4/*hardcode until IGnssNiCallback adds value*/); if (gnssNiNotification.options == GNSS_NI_OPTIONS_NOTIFICATION) notificationGnss.notifyFlags = From 514f373338a6515e277acbee4e26b68d34cd7396 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 28 Apr 2017 16:26:40 -0700 Subject: [PATCH 495/945] Registering event mask on AGPS Init Registering Server Connection event mask with Modem when AGPS Init is recevied from framework. Change-Id: I70ee1bef79d23ada44f13d71378a4fb64d69ce84 CRs-Fixed: 2033863 --- gnss/GnssAdapter.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 992ced85..36890c27 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2338,6 +2338,7 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ AgpsDSClientReleaseFn mDSClientReleaseFn; SendMsgToAdapterMsgQueueFn mSendMsgFn; + GnssAdapter& mAdapter; inline AgpsMsgInit(AgpsManager* agpsManager, AgpsFrameworkInterface::AgnssStatusIpV4Cb frameworkStatusV4Cb, @@ -2348,14 +2349,16 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ AgpsDSClientStopDataCallFn dsClientStopDataCallFn, AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, AgpsDSClientReleaseFn dsClientReleaseFn, - SendMsgToAdapterMsgQueueFn sendMsgFn) : + SendMsgToAdapterMsgQueueFn sendMsgFn, + GnssAdapter& adapter) : LocMsg(), mAgpsManager(agpsManager), mFrameworkStatusV4Cb( frameworkStatusV4Cb), mAtlOpenStatusCb(atlOpenStatusCb), mAtlCloseStatusCb( atlCloseStatusCb), mDSClientInitFn(dsClientInitFn), mDSClientOpenAndStartDataCallFn( dsClientOpenAndStartDataCallFn), mDSClientStopDataCallFn( dsClientStopDataCallFn), mDSClientCloseDataCallFn( dsClientCloseDataCallFn), mDSClientReleaseFn( - dsClientReleaseFn), mSendMsgFn(sendMsgFn) { + dsClientReleaseFn), mSendMsgFn(sendMsgFn), + mAdapter(adapter) { LOC_LOGV("AgpsMsgInit"); } @@ -2370,6 +2373,10 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ mDSClientCloseDataCallFn, mDSClientReleaseFn, mSendMsgFn); mAgpsManager->createAgpsStateMachines(); + + /* Register for AGPS event mask */ + mAdapter.updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, + LOC_REGISTRATION_MASK_ENABLED); } }; @@ -2381,7 +2388,8 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ dsClientInitFn, dsClientOpenAndStartDataCallFn, dsClientStopDataCallFn, dsClientCloseDataCallFn, dsClientReleaseFn, - sendMsgFn)); + sendMsgFn, + *this)); } /* GnssAdapter::requestATL From 222094ce77cc7a711f6e5af57bbd9fef473ae6ec Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 28 Apr 2017 16:31:43 -0700 Subject: [PATCH 496/945] Prevent print of uninitialized string If uninitialized string gets printed, this can cause a crash. Bug: 37218688 CRs-fixed: 2032144 Change-Id: I7c34b6f84f414410c52fc59f73053892060b0874 --- android/Gnss.cpp | 2 +- location/LocationAPI.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 9a362f0a..9b2e7ddc 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -85,7 +85,7 @@ GnssInterface* Gnss::getGnssInterface() { if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen("libgnss.so", RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) { diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 3086adc1..60a46fe5 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -82,7 +82,7 @@ static void* loadLocationInterface(const char* library, const char* name) { return NULL; } getLocationInterface* getter = NULL; - const char *error; + const char *error = NULL; dlerror(); void *handle = dlopen(library, RTLD_NOW); if (NULL == handle || (error = dlerror()) != NULL) { From 477ff7eae555f9b6a0c7a03e66659ed0ea10a31e Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Mon, 1 May 2017 10:14:30 -0700 Subject: [PATCH 497/945] remove inet group inet group shouldn't be with gps hal daemon. this change removed it. Change-Id: Ibc8faa20d7778c30ae0c640fdcceee28bae123e2 CRs-fixed: 2040891 --- android/android.hardware.gnss@1.0-service-qti.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.0-service-qti.rc index 05f805ff..d4d40fa0 100644 --- a/android/android.hardware.gnss@1.0-service-qti.rc +++ b/android/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class main user gps - group system gps inet radio + group system gps radio From d09bd9face1c9f1c8b398f49deaeecc3db0d038f Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 31 Mar 2017 16:31:54 +0530 Subject: [PATCH 498/945] add pos tech mask and sv source info Change-Id: I069a4564da7b96e29e5305b126cd88db0c426bc4 CRs-Fixed: 2028470 --- utils/gps_extended_c.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 5e246ff2..b4d14b88 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -80,10 +80,11 @@ extern "C" { /** Raw GNSS position fixes */ #define ULP_LOCATION_IS_FROM_GNSS_RAW 0X0100 +typedef uint32_t LocSvInfoSource; /** SVinfo source is GNSS/DR */ -#define ULP_SVINFO_IS_FROM_GNSS 0x0001 +#define ULP_SVINFO_IS_FROM_GNSS ((LocSvInfoSource)0x0001) /** Raw SVinfo from GNSS */ -#define ULP_SVINFO_IS_FROM_GNSS_RAW 0x0002 +#define ULP_SVINFO_IS_FROM_DR ((LocSvInfoSource)0x0002) #define ULP_MIN_INTERVAL_INVALID 0xffffffff #define ULP_MAX_NMEA_STRING_SIZE 201 @@ -287,6 +288,8 @@ typedef uint16_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA 0x1000 /** GpsLocationExtended has valid navSolutionMask */ #define GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK 0x2000 +/** GpsLocationExtended has valid LocPosTechMask */ +#define GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK 0x4000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ From 997b6b55abd2461aeda54a8f274ed774be812181 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Mon, 8 May 2017 15:37:22 +0800 Subject: [PATCH 499/945] GnssBatching::init handle multiple invoking Release mApi if mApi is not null and return true. Change-Id: I996bd94fca83f93fa47a9dcf282ebf4610071288 CRs-fixed: 2043876 --- android/GnssBatching.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/GnssBatching.cpp b/android/GnssBatching.cpp index a78989cd..6ffadc95 100644 --- a/android/GnssBatching.cpp +++ b/android/GnssBatching.cpp @@ -55,8 +55,9 @@ GnssBatching::~GnssBatching() { // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. Return GnssBatching::init(const sp& callback) { if (mApi != nullptr) { - LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__); - return false; + LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__); + delete mApi; + mApi = nullptr; } mApi = new BatchingAPIClient(callback); From 604d87414393cd07fb7341a8fdb4802b8de390be Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 4 May 2017 14:43:52 -0700 Subject: [PATCH 500/945] Fix for buffer overrun crash at copying nmea string Add zero clearing of allocated nmea buffer to ensure the nmea string is null terminated. Change-Id: Ie36010a7d3eca16dabb3067ae891a94e4b63b10c CRs-Fixed: 2041933 --- core/SystemStatus.cpp | 2 +- gnss/GnssAdapter.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 12f97ddc..f4f07f27 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1396,7 +1396,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) } char buf[SystemStatusNmeaBase::NMEA_MAXSIZE + 1] = { 0 }; - strlcpy(buf, data, (len < strlen(data))? len : strlen(data)); + strlcpy(buf, data, sizeof(buf)); pthread_mutex_lock(&mMutexSystemStatus); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9652656f..fc7d55e5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2002,9 +2002,9 @@ GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) size_t length) : LocMsg(), mAdapter(adapter), - mNmea(new char[length]), + mNmea(new char[length+1]), mLength(length) { - memcpy((void*)mNmea, (void*)nmea, length); + strlcpy((char*)mNmea, nmea, length+1); } inline virtual ~MsgReportNmea() { From 1e0be88b948f3460b3b030a080f3083a1f893db7 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 9 May 2017 15:36:10 +0800 Subject: [PATCH 501/945] Maintain a uniq RequestQueue for Geofencing Maintain a RequestQueue for Geofencing per LocationAPIClientBase instance. The RequestQueue must be released when LocationAPIClientBase is destroyed. Change-Id: Icceccdaae67883f8848dd2a95389b938058c5e5d CRs-fixed: 2044463 --- location/LocationAPIClientBase.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index a160adc0..5078313b 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -34,6 +34,7 @@ #include "LocationAPIClientBase.h" #define BATCHING_CONF_FILE "/etc/flp.conf" +#define GEOFENCE_SESSION_ID -1 LocationAPIClientBase::LocationAPIClientBase() : mTrackingCallback(nullptr), @@ -405,15 +406,16 @@ uint32_t LocationAPIClientBase::locAPIAddGeofences( if (mLocationAPI) { pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { - delete requests; + if (!requests) { + // Create a new RequestQueue for Geofenceing if we've not had one. + // The RequestQueue will be released when LocationAPIClientBase is released. + requests = new RequestQueue(GEOFENCE_SESSION_ID); + mRequestQueues[REQUEST_GEOFENCE] = requests; } uint32_t* sessions = mLocationAPI->addGeofences(count, options, data); if (sessions) { LOC_LOGI("%s:%d] start new sessions: %p", __FUNCTION__, __LINE__, sessions); - requests = new RequestQueue(-1); requests->push(new AddGeofencesRequest(*this)); - mRequestQueues[REQUEST_GEOFENCE] = requests; for (size_t i = 0; i < count; i++) { mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); From f354bdfa6263b7ddda347f0373310a44d703659c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 May 2017 16:47:00 -0700 Subject: [PATCH 502/945] Stop Gnss measurements session when closed Gnss measurements session that is started to collect Gnss measurements needs to be stoped when closed. Also remove the ability for an MSA tracking session to be started when Gnss measurments is started because MSA tracking is power hungry and it wouldn't provide measurements either Change-Id: I9b20f73bd412fc68d96dad2dc38399c144922ea0 CRs-fixed: 2039306 --- android/location_api/MeasurementAPIClient.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 8e6f48c6..074fbeb9 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -109,8 +109,8 @@ MeasurementAPIClient::measurementSetCallback(const sp& } if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) mLocationOptions.mode = GNSS_SUPL_MODE_MSB; - else if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) - mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + else + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; LOC_LOGD("%s]: start tracking session", __FUNCTION__); locAPIStartTracking(mLocationOptions); @@ -123,6 +123,7 @@ void MeasurementAPIClient::measurementClose() { pthread_mutex_lock(&mLock); mGnssMeasurementCbIface = nullptr; pthread_mutex_unlock(&mLock); + locAPIStopTracking(); } // callbacks From 4c265534bbcc386298c0fcb6d362243cea6ad934 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 May 2017 16:49:03 -0700 Subject: [PATCH 503/945] Check the return value of HIDL Callbacks GNSS HAL needs to check the return value of HIDL Callbacks to avoid crashing when things go wrong. Bug: 37987256 Change-Id: I4a5e33f7f4d85c887bc91fa71336a78151c3ce3b CRs-fixed: 2044206 --- android/location_api/BatchingAPIClient.cpp | 6 +- android/location_api/GeofenceAPIClient.cpp | 36 ++++++++++-- android/location_api/GnssAPIClient.cpp | 56 +++++++++++++++---- android/location_api/MeasurementAPIClient.cpp | 6 +- 4 files changed, 86 insertions(+), 18 deletions(-) diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 6022fbfa..73255926 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -157,7 +157,11 @@ void BatchingAPIClient::onBatchingCb(size_t count, Location* location) for (size_t i = 0; i < count; i++) { convertGnssLocation(location[i], locationVec[i]); } - mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s", + __func__, r.description().c_str()); + } } } diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp index ee4bfc38..65bd6629 100644 --- a/android/location_api/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -155,9 +155,13 @@ void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBr continue; } - mGnssGeofencingCbIface->gnssGeofenceTransitionCb( + auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb( geofenceBreachNotification.ids[i], gnssLocation, transition, static_cast(geofenceBreachNotification.timestamp)); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s", + __func__, r.description().c_str()); + } } } } @@ -173,7 +177,11 @@ void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceSt } GnssLocation gnssLocation; memset(&gnssLocation, 0, sizeof(GnssLocation)); - mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation); + auto r = mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s", + __func__, r.description().c_str()); + } } } @@ -188,7 +196,11 @@ void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, ui status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_EXISTS) status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS; - mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status); + auto r = mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s", + __func__, r.description().c_str()); + } } } } @@ -204,7 +216,11 @@ void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; - mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status); + auto r = mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s", + __func__, r.description().c_str()); + } } } } @@ -220,7 +236,11 @@ void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; - mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status); + auto r = mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s", + __func__, r.description().c_str()); + } } } } @@ -236,7 +256,11 @@ void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; - mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status); + auto r = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s", + __func__, r.description().c_str()); + } } } } diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 99b801e9..9fff6954 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -248,7 +248,11 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) data |= IGnssCallback::Capabilities::MSB; if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) data |= IGnssCallback::Capabilities::MSA; - mGnssCbIface->gnssSetCapabilitesCb(data); + auto r = mGnssCbIface->gnssSetCapabilitesCb(data); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", + __func__, r.description().c_str()); + } } if (mGnssCbIface != nullptr) { IGnssCallback::GnssSystemInfo gnssInfo; @@ -257,7 +261,11 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) gnssInfo.yearOfHw = 2017; } LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); - mGnssCbIface->gnssSetSystemInfoCb(gnssInfo); + auto r = mGnssCbIface->gnssSetSystemInfoCb(gnssInfo); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", + __func__, r.description().c_str()); + } } } @@ -267,7 +275,11 @@ void GnssAPIClient::onTrackingCb(Location location) if (mGnssCbIface != nullptr) { GnssLocation gnssLocation; convertGnssLocation(location, gnssLocation); - mGnssCbIface->gnssLocationCb(gnssLocation); + auto r = mGnssCbIface->gnssLocationCb(gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationCb description=%s", + __func__, r.description().c_str()); + } } } @@ -353,7 +365,11 @@ void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) if (mGnssCbIface != nullptr) { IGnssCallback::GnssSvStatus svStatus; convertGnssSvStatus(gnssSvNotification, svStatus); - mGnssCbIface->gnssSvStatusCb(svStatus); + auto r = mGnssCbIface->gnssSvStatusCb(svStatus); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSvStatusCb description=%s", + __func__, r.description().c_str()); + } } } @@ -362,8 +378,12 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) if (mGnssCbIface != nullptr) { android::hardware::hidl_string nmeaString; nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); - mGnssCbIface->gnssNmeaCb(static_cast(gnssNmeaNotification.timestamp), - nmeaString); + auto r = mGnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%u description=%s", __func__, + gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); + } } } @@ -371,8 +391,16 @@ void GnssAPIClient::onStartTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { - mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); - mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + auto r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", + __func__, r.description().c_str()); + } + r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", + __func__, r.description().c_str()); + } } } @@ -380,8 +408,16 @@ void GnssAPIClient::onStopTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { - mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); - mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + auto r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", + __func__, r.description().c_str()); + } + r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", + __func__, r.description().c_str()); + } } } diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 8e6f48c6..ea1171b0 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -146,7 +146,11 @@ void MeasurementAPIClient::onGnssMeasurementsCb( if (mGnssMeasurementCbIface != nullptr) { IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); - mGnssMeasurementCbIface->GnssMeasurementCb(gnssData); + auto r = mGnssMeasurementCbIface->GnssMeasurementCb(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from GnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } } pthread_mutex_unlock(&mLock); } From c804609595e8d0e157f7dc61234d3db8079bf43b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 May 2017 16:49:38 -0700 Subject: [PATCH 504/945] Allow SUPL_MODE of Standalone only SUPL_MODE being set to standlaone only is valid and needs to be accepted by HAL. Bug: 37947277 Change-Id: Ib9d0073c304305f0fafaea1940ce292450eaa9f7 CRs-fixed: 2044643 --- android/GnssConfiguration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index a35be736..6bb02c1e 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -91,6 +91,9 @@ Return GnssConfiguration::setSuplMode(uint8_t mode) { config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; switch (mode) { + case 0: + config.suplModeMask = 0; // STANDALONE ONLY + break; case 1: config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB; break; From d9f26fc543c5e59c33210473211da206cd7a020c Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Wed, 10 May 2017 13:52:34 +0800 Subject: [PATCH 505/945] Decouple position inject request from assist data Add LOC_API_ADAPTER_BIT_POSITION_INJECTION_REQUEST mask bit to decouple from LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST. Change-Id: I4c2f8439dca9ea3b4d56a3cd00da88e4488717bf CRs-fixed: 2044870 --- utils/gps_extended_c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b4d14b88..946993cc 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -491,6 +491,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REQUEST_TIMEZONE, // Timezone injection request LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT, // Geofence dwell report LOC_API_ADAPTER_REQUEST_SRN_DATA, // request srn data from AP + LOC_API_ADAPTER_REQUEST_POSITION_INJECTION, // Position injection request LOC_API_ADAPTER_EVENT_MAX }; @@ -524,6 +525,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REQUEST_TIMEZONE (1< Date: Thu, 18 May 2017 10:31:58 -0700 Subject: [PATCH 506/945] Move location files from /data/ to /data/vendor/ Runtime files and sockets used by location modules are moved to vendor partiion from /data/misc/location to /data/vendor/location. Change-Id: I7b092059b3061def2a1f2d0cd9bffb7ed7aededd CRs-fixed: 2046657 --- android/AGnssRil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index 0cf79a32..b19f55f5 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -64,7 +64,7 @@ static inline int createSocket() { LOC_LOGe("create socket error. reason:%s", strerror(errno)); } else { - const char* socketPath = "/data/misc/location/xtra/socket_hal_xtra"; + const char* socketPath = "/data/vendor/location/xtra/socket_hal_xtra"; struct sockaddr_un addr = { .sun_family = AF_UNIX }; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); From e3d70314b0001d54c4ad45e489ef905ffab65da5 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 18 May 2017 11:00:17 -0700 Subject: [PATCH 507/945] Fix for incorrect SVids and timestamps in bugreport Fix SVids and timestamps shown in adb bugreport to align with Android standard. Change-Id: Ib166b09f1d63f7a93d53798dbb188fec0d77e88a CRs-Fixed: 2042937 --- android/GnssDebug.cpp | 19 ++++--------------- core/SystemStatus.cpp | 3 ++- gnss/GnssAdapter.cpp | 24 +++++++++++++----------- location/LocationAPI.h | 8 ++++++++ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index e6f59df2..ff467d3b 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -30,7 +30,7 @@ namespace implementation { using ::android::hardware::hidl_vec; -#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800ULL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT #define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) @@ -45,7 +45,7 @@ GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) */ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) { - LOC_LOGI("GnssDebug - 0426a"); + LOC_LOGD("%s]: ", __func__); DebugData data = { }; @@ -78,21 +78,14 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) reports.mLocation.speedAccuracyMetersPerSecond; data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; - LOC_LOGI("GnssDebug - lat=%f lon=%f", - data.position.latitudeDegrees, data.position.longitudeDegrees); timeval tv_now, tv_report; - tv_report.tv_sec = reports.mLocation.mLocation.timestamp / 1000ULL; - tv_report.tv_usec = - (reports.mLocation.mLocation.timestamp % 1000ULL) * 1000ULL; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; gettimeofday(&tv_now, NULL); data.position.ageSeconds = (tv_now.tv_sec - tv_report.tv_sec) + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; - - LOC_LOGI("GnssDebug - time now=%lld:%lld", tv_now.tv_sec, tv_now.tv_usec); - LOC_LOGI("GnssDebug - time rep=%lld:%lld",tv_report.tv_sec, tv_report.tv_usec); - LOC_LOGI("GnssDebug - age=%f", data.position.ageSeconds); } else { data.position.valid = false; @@ -110,7 +103,6 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC); data.time.frequencyUncertaintyNsPerSec = 0; } - LOC_LOGI("GnssDebug - timeestimate=%lld", data.time.timeEstimate); // satellite data block SatelliteData s = { }; @@ -138,12 +130,9 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) s_array.push_back(s); } data.satelliteDataArray = s_array; - LOC_LOGI("GnssDebug - satellite=%d", data.satelliteDataArray.size()); // callback HIDL with collected debug data _hidl_cb(data); - - LOC_LOGI("GnssDebug - done"); return Void(); } diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index f4f07f27..80406f62 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -181,11 +181,12 @@ public: SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) { + memset(&mM1, 0, sizeof(mM1)); if (mField.size() < eMax) { LOC_LOGE("PQWM1parser - invalid size=%d", mField.size()); + mM1.mTimeValid = 0; return; } - memset(&mM1, 0, sizeof(mM1)); mM1.mGpsWeek = atoi(mField[eGpsWeek].c_str()); mM1.mGpsTowMs = atoi(mField[eGpsTowMs].c_str()); mM1.mTimeValid = atoi(mField[eTimeValid].c_str()); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fc7d55e5..d36496e9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1814,7 +1814,7 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = LocDualContext::getSystemStatus(); - if (nullptr != s) { + if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); @@ -2615,7 +2615,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, // set constellationi based parameters switch (in_constellation) { case GNSS_SV_TYPE_GPS: - svid_min = GPS_MIN; + svid_min = GNSS_BUGREPORT_GPS_MIN; svid_num = GPS_NUM; svid_idx = 0; if (!in.mSvHealth.empty()) { @@ -2628,7 +2628,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, } break; case GNSS_SV_TYPE_GLONASS: - svid_min = GLO_MIN; + svid_min = GNSS_BUGREPORT_GLO_MIN; svid_num = GLO_NUM; svid_idx = GPS_NUM; if (!in.mSvHealth.empty()) { @@ -2641,7 +2641,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, } break; case GNSS_SV_TYPE_QZSS: - svid_min = QZSS_MIN; + svid_min = GNSS_BUGREPORT_QZSS_MIN; svid_num = QZSS_NUM; svid_idx = GPS_NUM+GLO_NUM; if (!in.mSvHealth.empty()) { @@ -2654,7 +2654,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, } break; case GNSS_SV_TYPE_BEIDOU: - svid_min = BDS_MIN; + svid_min = GNSS_BUGREPORT_BDS_MIN; svid_num = BDS_NUM; svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM; if (!in.mSvHealth.empty()) { @@ -2667,7 +2667,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, } break; case GNSS_SV_TYPE_GALILEO: - svid_min = GAL_MIN; + svid_min = GNSS_BUGREPORT_GAL_MIN; svid_num = GAL_NUM; svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM; if (!in.mSvHealth.empty()) { @@ -2771,8 +2771,8 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) r.mLocation.bearingAccuracyDegrees = reports.mLocation.back().mLocationEx.bearing_unc; - r.mLocation.mLocation.timestamp = - reports.mLocation.back().mLocation.gpsLocation.timestamp; + r.mLocation.mUtcReported = + reports.mLocation.back().mUtcReported; } else if(!reports.mBestPosition.empty()) { r.mLocation.mValid = true; @@ -2801,11 +2801,11 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) // time block r.mTime.size = sizeof(r.mTime); - if(!reports.mTimeAndClock.empty()) { + if(!reports.mTimeAndClock.empty() && reports.mTimeAndClock.back().mTimeValid) { r.mTime.mValid = true; r.mTime.timeEstimate = (((int64_t)(reports.mTimeAndClock.back().mGpsWeek)*7 + - GNSS_UTC_TIME_OFFSET)*24*60*60 + + GNSS_UTC_TIME_OFFSET)*24*60*60 - (int64_t)(reports.mTimeAndClock.back().mLeapSeconds))*1000ULL + (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); @@ -2814,7 +2814,9 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) reports.mTimeAndClock.back().mLeapSecUnc)*1000); r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); - LOC_LOGV("getDebugReport - timeestimate=%ld", r.mTime.timeEstimate); + LOC_LOGV("getDebugReport - timeestimate=%ld unc=%f frequnc=%f", + r.mTime.timeEstimate, + r.mTime.timeUncertaintyNs, r.mTime.frequencyUncertaintyNsPerSec); } else { r.mTime.mValid = false; diff --git a/location/LocationAPI.h b/location/LocationAPI.h index 88b15542..88ce5f1d 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -39,6 +39,13 @@ #define GNSS_MEASUREMENTS_MAX 64 #define GNSS_UTC_TIME_OFFSET (3657) +#define GNSS_BUGREPORT_GPS_MIN (1) +#define GNSS_BUGREPORT_SBAS_MIN (120) +#define GNSS_BUGREPORT_GLO_MIN (1) +#define GNSS_BUGREPORT_QZSS_MIN (193) +#define GNSS_BUGREPORT_BDS_MIN (1) +#define GNSS_BUGREPORT_GAL_MIN (1) + typedef enum { LOCATION_ERROR_SUCCESS = 0, LOCATION_ERROR_GENERAL_FAILURE, @@ -584,6 +591,7 @@ typedef struct { double verticalAccuracyMeters; double speedAccuracyMetersPerSecond; double bearingAccuracyDegrees; + timespec mUtcReported; } GnssDebugLocation; typedef struct { From d9a166a70fd892b311018fd7919cc97dc0447467 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sun, 7 May 2017 12:51:25 +0530 Subject: [PATCH 508/945] Remove SV used_in_fix flag setting on SV report. Remove SV used_in_fix flag setting based on EPH / ALM / SNR info during SV report. The SVs should not be used_in_fix when there is no fix. Change-Id: Iaed8ade8073446023348017ba133efcd7445a331 CRs-Fixed: 2043724 --- gnss/GnssAdapter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fc7d55e5..e12614de 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1960,8 +1960,6 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) // flag, else clear the USED_IN_FIX flag. if (svUsedIdMask & (1 << (gnssSvId - 1))) { svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; - } else { - svNotify.gnssSvs[i].gnssSvOptionsMask &= ~GNSS_SV_OPTIONS_USED_IN_FIX_BIT; } } } From b29778eac03901f616e2adda009bb68a42a376a9 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 23 May 2017 14:32:22 +0800 Subject: [PATCH 509/945] Fix intermittant crashes in location Deleting memory without setting it to null can cause the memory to still be non-null and be interpreted as valid. Also check if the entry is in the map using find instead of assuming it is in the map. Bug: 62033719 62033834 62033690 62033563 62032790 CRs-fixed: 2050837 Change-Id: I2534de2d6157be86ac95cfe6615e4c0019ee48fd --- location/LocationAPIClientBase.cpp | 198 ++++++++++++++++++----------- location/LocationAPIClientBase.h | 18 ++- 2 files changed, 141 insertions(+), 75 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 5078313b..58f7fcb2 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -60,6 +60,8 @@ LocationAPIClientBase::LocationAPIClientBase() : void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallbacks) { + pthread_mutex_lock(&mMutex); + if (locationCallbacks.geofenceBreachCb != nullptr) { mGeofenceBreachCallback = locationCallbacks.geofenceBreachCb; locationCallbacks.geofenceBreachCb = @@ -101,10 +103,14 @@ void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallba mLocationControlAPI = LocationControlAPI::createInstance(locationControlCallbacks); } + + pthread_mutex_unlock(&mMutex); } LocationAPIClientBase::~LocationAPIClientBase() { + pthread_mutex_lock(&mMutex); + if (mLocationAPI) { mLocationAPI->destroy(); mLocationAPI = nullptr; @@ -114,7 +120,6 @@ LocationAPIClientBase::~LocationAPIClientBase() mLocationControlAPI = nullptr; } - pthread_mutex_lock(&mMutex); for (int i = 0; i < REQUEST_MAX; i++) { if (mRequestQueues[i]) { delete mRequestQueues[i]; @@ -129,11 +134,12 @@ LocationAPIClientBase::~LocationAPIClientBase() uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; + requests = nullptr; } uint32_t session = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); @@ -143,42 +149,46 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) requests = new RequestQueue(session); requests->push(new StartTrackingRequest(*this)); mRequestQueues[REQUEST_TRACKING] = requests; - pthread_mutex_unlock(&mMutex); retVal = LOCATION_ERROR_SUCCESS; } + pthread_mutex_unlock(&mMutex); return retVal; } void LocationAPIClientBase::locAPIStopTracking() { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); - uint32_t session = -1; + uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { session = requests->getSession(); - requests->push(new StopTrackingRequest(*this)); - mLocationAPI->stopTracking(session); + if (session > 0) { + requests->push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(session); + } } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); - uint32_t session = -1; + uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { session = requests->getSession(); - requests->push(new UpdateTrackingOptionsRequest(*this)); - mLocationAPI->updateTrackingOptions(session, options); + if (session > 0) { + requests->push(new UpdateTrackingOptionsRequest(*this)); + mLocationAPI->updateTrackingOptions(session, options); + } } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); } int32_t LocationAPIClientBase::locAPIGetBatchSize() @@ -202,8 +212,8 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session LocationOptions& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); if (mSessionMap.find(id) != mSessionMap.end()) { LOC_LOGE("%s:%d] session %d has already started.", __FUNCTION__, __LINE__, id); @@ -216,6 +226,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; + requests = nullptr; } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); @@ -226,6 +237,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; if (requests) { delete requests; + requests = nullptr; } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); @@ -244,8 +256,8 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session retVal = LOCATION_ERROR_SUCCESS; } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); return retVal; } @@ -253,8 +265,8 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); if (mSessionMap.find(id) != mSessionMap.end()) { SessionEntity entity = mSessionMap[id]; @@ -285,8 +297,8 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) LOC_LOGE("%s:%d] session %d is not exist.", __FUNCTION__, __LINE__, id); } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); return retVal; } @@ -294,8 +306,8 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t LocationOptions& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); if (mSessionMap.find(id) != mSessionMap.end()) { SessionEntity& entity = mSessionMap[id]; @@ -326,6 +338,7 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; + requests = nullptr; } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", @@ -351,6 +364,7 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; if (requests) { delete requests; + requests = nullptr; } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", @@ -379,32 +393,34 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t LOC_LOGE("%s:%d] session %d is not exist.", __FUNCTION__, __LINE__, id); } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); return retVal; } void LocationAPIClientBase::locAPIGetBatchedLocations(size_t count) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); - uint32_t session = -1; + uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; if (requests) { session = requests->getSession(); - requests->push(new GetBatchedLocationsRequest(*this)); - mLocationAPI->getBatchedLocations(session, count); + if (session > 0) { + requests->push(new GetBatchedLocationsRequest(*this)); + mLocationAPI->getBatchedLocations(session, count); + } } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); } uint32_t LocationAPIClientBase::locAPIAddGeofences( size_t count, uint32_t* ids, GeofenceOption* options, GeofenceInfo* data) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (!requests) { // Create a new RequestQueue for Geofenceing if we've not had one. @@ -422,128 +438,158 @@ uint32_t LocationAPIClientBase::locAPIAddGeofences( } retVal = LOCATION_ERROR_SUCCESS; } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); return retVal; } void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (requests) { + size_t j = 0; for (size_t i = 0; i < count; i++) { - sessions[i] = mGeofenceBiDict.getSession(ids[i]); + sessions[j] = mGeofenceBiDict.getSession(ids[i]); + if (sessions[j] > 0) { + j++; + } + } + if (j > 0) { + requests->push(new RemoveGeofencesRequest(*this)); + mLocationAPI->removeGeofences(j, sessions); } - requests->push(new RemoveGeofencesRequest(*this)); - mLocationAPI->removeGeofences(count, sessions); } - pthread_mutex_unlock(&mMutex); free(sessions); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIModifyGeofences( size_t count, uint32_t* ids, GeofenceOption* options) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (requests) { + size_t j = 0; for (size_t i = 0; i < count; i++) { - sessions[i] = mGeofenceBiDict.getSession(ids[i]); - mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); + sessions[j] = mGeofenceBiDict.getSession(ids[i]); + if (sessions[j] > 0) { + mGeofenceBiDict.set(ids[i], sessions[j], options[i].breachTypeMask); + j++; + } + } + if (j > 0) { + requests->push(new ModifyGeofencesRequest(*this)); + mLocationAPI->modifyGeofences(j, sessions, options); } - requests->push(new ModifyGeofencesRequest(*this)); - mLocationAPI->modifyGeofences(count, sessions, options); } - pthread_mutex_unlock(&mMutex); free(sessions); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (requests) { + size_t j = 0; for (size_t i = 0; i < count; i++) { - sessions[i] = mGeofenceBiDict.getSession(ids[i]); + sessions[j] = mGeofenceBiDict.getSession(ids[i]); + if (sessions[j] > 0) { + j++; + } + } + if (j > 0) { + requests->push(new PauseGeofencesRequest(*this)); + mLocationAPI->pauseGeofences(j, sessions); } - requests->push(new PauseGeofencesRequest(*this)); - mLocationAPI->pauseGeofences(count, sessions); } - pthread_mutex_unlock(&mMutex); free(sessions); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIResumeGeofences( size_t count, uint32_t* ids, GeofenceBreachTypeMask* mask) { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (requests) { + size_t j = 0; for (size_t i = 0; i < count; i++) { - sessions[i] = mGeofenceBiDict.getSession(ids[i]); - if (mask) { - mGeofenceBiDict.set(ids[i], sessions[i], mask[i]); + sessions[j] = mGeofenceBiDict.getSession(ids[i]); + if (sessions[j] > 0) { + if (mask) { + mGeofenceBiDict.set(ids[i], sessions[j], mask[i]); + } + j++; } } - requests->push(new ResumeGeofencesRequest(*this)); - mLocationAPI->resumeGeofences(count, sessions); + if (j > 0) { + requests->push(new ResumeGeofencesRequest(*this)); + mLocationAPI->resumeGeofences(j, sessions); + } } - pthread_mutex_unlock(&mMutex); free(sessions); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIRemoveAllGeofences() { + pthread_mutex_lock(&mMutex); if (mLocationAPI) { std::vector sessionsVec = mGeofenceBiDict.getAllSessions(); size_t count = sessionsVec.size(); uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; if (requests) { + size_t j = 0; for (size_t i = 0; i < count; i++) { - sessions[i] = sessionsVec[i]; + sessions[j] = sessionsVec[i]; + if (sessions[j] > 0) { + j++; + } + } + if (j > 0) { + requests->push(new RemoveGeofencesRequest(*this)); + mLocationAPI->removeGeofences(j, sessions); } - requests->push(new RemoveGeofencesRequest(*this)); - mLocationAPI->removeGeofences(count, sessions); } - pthread_mutex_unlock(&mMutex); free(sessions); } + pthread_mutex_unlock(&mMutex); } void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse response) { - uint32_t session = 0; + pthread_mutex_lock(&mMutex); if (mLocationAPI) { - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_NIRESPONSE]; if (requests) { delete requests; + requests = nullptr; } uint32_t session = id; mLocationAPI->gnssNiResponse(id, response); @@ -551,28 +597,29 @@ void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse res requests = new RequestQueue(session); requests->push(new GnssNiResponseRequest(*this)); mRequestQueues[REQUEST_NIRESPONSE] = requests; - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); } uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_DELETEAIDINGDATA]; if (requests) { delete requests; + requests = nullptr; } uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); requests = new RequestQueue(session); requests->push(new GnssDeleteAidingDataRequest(*this)); mRequestQueues[REQUEST_DELETEAIDINGDATA] = requests; - pthread_mutex_unlock(&mMutex); retVal = LOCATION_ERROR_SUCCESS; } + pthread_mutex_unlock(&mMutex); return retVal; } @@ -580,38 +627,41 @@ uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - pthread_mutex_lock(&mMutex); RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; if (requests) { delete requests; + requests = nullptr; } uint32_t session = mLocationControlAPI->enable(techType); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); requests = new RequestQueue(session); requests->push(new EnableRequest(*this)); mRequestQueues[REQUEST_CONTROL] = requests; - pthread_mutex_unlock(&mMutex); retVal = LOCATION_ERROR_SUCCESS; } + pthread_mutex_unlock(&mMutex); return retVal; } void LocationAPIClientBase::locAPIDisable() { + pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - pthread_mutex_lock(&mMutex); - uint32_t session = -1; + uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; if (requests) { session = requests->getSession(); - requests->push(new DisableRequest(*this)); - mLocationControlAPI->disable(session); + if (session > 0) { + requests->push(new DisableRequest(*this)); + mLocationControlAPI->disable(session); + } } - pthread_mutex_unlock(&mMutex); } + pthread_mutex_unlock(&mMutex); } uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) @@ -622,23 +672,25 @@ uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) return retVal; } + pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - pthread_mutex_lock(&mMutex); memcpy(&mConfig, &config, sizeof(GnssConfig)); - uint32_t session = -1; + uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; if (requests) { session = requests->getSession(); - requests->push(new GnssUpdateConfigRequest(*this)); - uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); - LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); + if (session > 0) { + requests->push(new GnssUpdateConfigRequest(*this)); + uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); + LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); + } } - pthread_mutex_unlock(&mMutex); retVal = LOCATION_ERROR_SUCCESS; } + pthread_mutex_unlock(&mMutex); return retVal; } @@ -655,6 +707,8 @@ void LocationAPIClientBase::beforeGeofenceBreachCb( for (size_t i = 0; i < n; i++) { uint32_t id = mGeofenceBiDict.getId(geofenceBreachNotification.ids[i]); GeofenceBreachTypeMask type = mGeofenceBiDict.getType(geofenceBreachNotification.ids[i]); + // if type == 0, we will not head into the fllowing block anyway. + // so we don't need to check id and type if ((geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER && (type & GEOFENCE_BREACH_ENTER_BIT)) || (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT && diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 8bbaa3dc..832dca8e 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -197,19 +197,31 @@ private: } uint32_t getId(uint32_t session) { pthread_mutex_lock(&mBiDictMutex); - uint32_t ret = mBackwardMap[session]; + uint32_t ret = 0; + auto it = mBackwardMap.find(session); + if (it != mBackwardMap.end()) { + ret = it->second; + } pthread_mutex_unlock(&mBiDictMutex); return ret; } uint32_t getSession(uint32_t id) { pthread_mutex_lock(&mBiDictMutex); - uint32_t ret = mForwardMap[id]; + uint32_t ret = 0; + auto it = mForwardMap.find(id); + if (it != mForwardMap.end()) { + ret = it->second; + } pthread_mutex_unlock(&mBiDictMutex); return ret; } uint32_t getType(uint32_t session) { pthread_mutex_lock(&mBiDictMutex); - uint32_t ret = mTypeMap[session]; + uint32_t ret = 0; + auto it = mTypeMap.find(session); + if (it != mTypeMap.end()) { + ret = it->second; + } pthread_mutex_unlock(&mBiDictMutex); return ret; } From 566238aab11b7573b2964d8b1a7d7438dc9871df Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 16 May 2017 16:38:07 -0700 Subject: [PATCH 510/945] Remove libandroid_runtime for treble compliance CRs-fixed: 2048138 Change-Id: Idc9a3f045c6c44dea6c527ec8c6bf23e9d0a9518 --- .../include/platform_lib_android_runtime.h | 45 ------------------- .../loc_pla/include/platform_lib_includes.h | 1 - .../loc_pla/src/Android.mk | 5 +-- .../src/platform_lib_android_runtime.cpp | 40 ----------------- 4 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h deleted file mode 100644 index 9a954f08..00000000 --- a/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/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h index 47c37df8..ebb71197 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h @@ -29,7 +29,6 @@ #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" diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index 0bcddcba..7d321efa 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -11,11 +11,9 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ liblog \ - libloc_stub \ - libandroid_runtime + libloc_stub LOCAL_SRC_FILES += \ - platform_lib_android_runtime.cpp \ platform_lib_gettid.cpp \ platform_lib_log_util.cpp \ platform_lib_property_service.cpp \ @@ -35,7 +33,6 @@ LOCAL_C_INCLUDES:= \ 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 \ diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp deleted file mode 100644 index 090af13b..00000000 --- a/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); -} From d640d06213665b73e95343a6e4f03ad5b2f0e99e Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 13 Apr 2017 21:57:25 +0800 Subject: [PATCH 511/945] HIDL Extension Prevent building of android.hardware.gnss@1.0-service-qti if non-PDK build. CRs-fixed: 2040636 Change-Id: Ic6ee787d7fca93f649cd1f2bbd7be46cdefc809f --- android/Android.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/android/Android.mk b/android/Android.mk index e3c3d500..d3e33ab2 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -47,6 +47,14 @@ LOCAL_SHARED_LIBRARIES += \ include $(BUILD_SHARED_LIBRARY) +BUILD_GNSS_HIDL_SERVICE := true +ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) +ifneq ($(LW_FEATURE_SET),true) +BUILD_GNSS_HIDL_SERVICE := false +endif # LW_FEATURE_SET +endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET + +ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) @@ -77,3 +85,4 @@ LOCAL_SHARED_LIBRARIES += \ android.hardware.gnss@1.0 \ include $(BUILD_EXECUTABLE) +endif # BUILD_GNSS_HIDL_SERVICE From 5969d0b2da4d0168286c359ac6a8a6b4c6495333 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 5 May 2017 17:29:09 +0530 Subject: [PATCH 512/945] Provide correct SV used_in_fix flag for QZSS Mark QZSS SV used_in_fix based on the most recent position report Change-Id: I166087fb62de45e1013ab29c01df3abfba7af12b CRs-Fixed: 2043300 --- core/LocApiBase.cpp | 5 +++-- gnss/GnssAdapter.cpp | 3 +++ utils/gps_extended_c.h | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 0036d887..2dcd4cd1 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -237,7 +237,7 @@ void LocApiBase::reportPosition(UlpLocation& location, "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)", + "SV used in fix (gps/glo/bds/gal/qzss) : (%x/%x/%x/%x/%x)", location.gpsLocation.flags, location.position_source, location.gpsLocation.latitude, location.gpsLocation.longitude, location.gpsLocation.altitude, location.gpsLocation.speed, @@ -247,7 +247,8 @@ void LocApiBase::reportPosition(UlpLocation& location, 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); + locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask, + locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask); // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPositionEvent(location, locationExtended, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 00b56b9d..2117c733 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1951,6 +1951,9 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SV_TYPE_GALILEO: svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; break; + case GNSS_SV_TYPE_QZSS: + svUsedIdMask = mGnssSvIdUsedInPosition.qzss_sv_used_ids_mask; + break; default: svUsedIdMask = 0; break; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b4d14b88..97292e40 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -306,6 +306,8 @@ typedef uint32_t LocNavSolutionMask; #define GPS_SV_PRN_MAX 32 #define GLO_SV_PRN_MIN 65 #define GLO_SV_PRN_MAX 96 +#define QZSS_SV_PRN_MIN 193 +#define QZSS_SV_PRN_MAX 197 #define BDS_SV_PRN_MIN 201 #define BDS_SV_PRN_MAX 235 #define GAL_SV_PRN_MIN 301 @@ -342,6 +344,7 @@ typedef struct { uint64_t glo_sv_used_ids_mask; uint64_t gal_sv_used_ids_mask; uint64_t bds_sv_used_ids_mask; + uint64_t qzss_sv_used_ids_mask; } GnssSvUsedInPosition; /** Represents gps location extended. */ From 0029fafd92d25e884f11e316e9b1b29a6a537cf9 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 24 Apr 2017 18:13:05 +0530 Subject: [PATCH 513/945] Add support for generating NMEA sentences for QZSS. Change-Id: Ib1350fceeabcb2dc67812641b1f967b1b240cefd CRs-Fixed: 2036931 --- utils/loc_nmea.cpp | 95 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 5 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index e288af46..5a15863e 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -35,6 +35,15 @@ #define GLONASS_SV_ID_OFFSET 64 #define MAX_SATELLITES_IN_USE 12 + +// GNSS system id according to NMEA spec +#define SYSTEM_ID_GPS 1 +#define SYSTEM_ID_GLONASS 2 +#define SYSTEM_ID_GALILEO 3 +// Extended systems +#define SYSTEM_ID_BEIDOU 4 +#define SYSTEM_ID_QZSS 5 + typedef struct loc_nmea_sv_meta_s { char talker[3]; @@ -42,6 +51,7 @@ typedef struct loc_nmea_sv_meta_s uint32_t mask; uint32_t svCount; uint32_t svIdOffset; + uint32_t systemId; } loc_nmea_sv_meta; typedef struct loc_sv_cache_info_s @@ -49,9 +59,11 @@ typedef struct loc_sv_cache_info_s uint32_t gps_used_mask; uint32_t glo_used_mask; uint32_t gal_used_mask; + uint32_t qzss_used_mask; uint32_t gps_count; uint32_t glo_count; uint32_t gal_count; + uint32_t qzss_count; float hdop; float pdop; float vdop; @@ -81,26 +93,39 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, { memset(&sv_meta, 0, sizeof(sv_meta)); sv_meta.svType = svType; - sv_meta.talker[0] = 'G'; switch (svType) { case GNSS_SV_TYPE_GPS: + sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'P'; sv_meta.mask = sv_cache_info.gps_used_mask; sv_meta.svCount = sv_cache_info.gps_count; + sv_meta.systemId = SYSTEM_ID_GPS; break; case GNSS_SV_TYPE_GLONASS: + sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'L'; sv_meta.mask = sv_cache_info.glo_used_mask; sv_meta.svCount = sv_cache_info.glo_count; // GLONASS SV ids are from 65-96 sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; + sv_meta.systemId = SYSTEM_ID_GLONASS; break; case GNSS_SV_TYPE_GALILEO: + sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'A'; sv_meta.mask = sv_cache_info.gal_used_mask; sv_meta.svCount = sv_cache_info.gal_count; + sv_meta.systemId = SYSTEM_ID_GALILEO; + break; + case GNSS_SV_TYPE_QZSS: + sv_meta.talker[0] = 'P'; + sv_meta.talker[1] = 'Q'; + sv_meta.mask = sv_cache_info.qzss_used_mask; + sv_meta.svCount = sv_cache_info.qzss_count; + // QZSS SV ids are from 193-197. So keep svIdOffset 0 + sv_meta.systemId = SYSTEM_ID_QZSS; break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svType); @@ -109,12 +134,14 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, if (needCombine && (sv_cache_info.gps_used_mask ? 1 : 0) + (sv_cache_info.glo_used_mask ? 1 : 0) + - (sv_cache_info.gal_used_mask ? 1 : 0) > 1) + (sv_cache_info.gal_used_mask ? 1 : 0) + + (sv_cache_info.qzss_used_mask ? 1 : 0) > 1) { - // If GPS, GLONASS, Galileo etc. are combined + // If GPS, GLONASS, Galileo, QZSS etc. are combined // to obtain the reported position solution, // talker shall be set to GN, to indicate that // the satellites are used in a combined solution + sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'N'; } return &sv_meta; @@ -260,15 +287,22 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende // Add the position/horizontal/vertical DOP values if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f,", locationExtended.pdop, locationExtended.hdop, locationExtended.vdop); } else { // no dop - length = snprintf(pMarker, lengthRemaining, ",,"); + length = snprintf(pMarker, lengthRemaining, ",,,"); } + pMarker += length; + lengthRemaining -= length; + + // system id + length = snprintf(pMarker, lengthRemaining, "%d", sv_meta_p->systemId); + pMarker += length; + lengthRemaining -= length; /* Sentence is ready, add checksum and broadcast */ length = loc_nmea_put_checksum(sentence, bufSize); @@ -385,6 +419,15 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } + // The following entries are specific to QZSS and BDS + if (sv_meta_p->svType == GNSS_SV_TYPE_QZSS) + { + // last one is System id and second last is Signal Id which is always zero + length = snprintf(pMarker, lengthRemaining,",%d,%d",0,sv_meta_p->systemId); + pMarker += length; + lengthRemaining -= length; + } + length = loc_nmea_put_checksum(sentence, bufSize); nmeaArraystr.push_back(sentence); sentenceNumber++; @@ -455,6 +498,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (count > 0) { svUsedCount += count; + talker[0] = sv_meta.talker[0]; talker[1] = sv_meta.talker[1]; } @@ -467,6 +511,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (count > 0) { svUsedCount += count; + talker[0] = sv_meta.talker[0]; talker[1] = sv_meta.talker[1]; } @@ -479,9 +524,22 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (count > 0) { svUsedCount += count; + talker[0] = sv_meta.talker[0]; talker[1] = sv_meta.talker[1]; } + // ------------------- + // ---$PQGSA/$GNGSA--- + // ------------------- + + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + if (count > 0) + { + svUsedCount += count; + // talker should be default "GP". If GPS, GLO etc is used, it should be "GN" + } + // ------------------- // ------$--VTG------- // ------------------- @@ -844,6 +902,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, sv_cache_info.gps_used_mask = 0; sv_cache_info.glo_used_mask = 0; sv_cache_info.gal_used_mask = 0; + sv_cache_info.qzss_used_mask = 0; } //Send blank NMEA reports for non-final fixes else { @@ -855,6 +914,10 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$PQGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); @@ -908,10 +971,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, sv_cache_info.gps_used_mask = 0; sv_cache_info.glo_used_mask = 0; sv_cache_info.gal_used_mask = 0; + sv_cache_info.qzss_used_mask = 0; sv_cache_info.gps_count = 0; sv_cache_info.glo_count = 0; sv_cache_info.gal_count = 0; + sv_cache_info.qzss_count = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) { @@ -949,6 +1014,19 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, } sv_cache_info.gal_count++; } + else if (GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $PQGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.qzss_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + sv_cache_info.qzss_count++; + } + } loc_nmea_sv_meta sv_meta; @@ -973,5 +1051,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, false), nmeaArraystr); + // ------------------ + // ------$PQGSV------ + // ------------------ + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + EXIT_LOG(%d, 0); } From 0d01cc0b5b88a521e11596c87af4480235d52440 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 18 May 2017 16:51:41 +0530 Subject: [PATCH 514/945] Add support for generating NMEA sentences for BDS. Change-Id: I77ccaac3da4d79ed6d43d1a4e59e4d438ba3d2f3 CRs-Fixed: 2047785 --- utils/loc_nmea.cpp | 64 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 5a15863e..eb193cc5 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -60,10 +60,12 @@ typedef struct loc_sv_cache_info_s uint32_t glo_used_mask; uint32_t gal_used_mask; uint32_t qzss_used_mask; + uint32_t bds_used_mask; uint32_t gps_count; uint32_t glo_count; uint32_t gal_count; uint32_t qzss_count; + uint32_t bds_count; float hdop; float pdop; float vdop; @@ -127,6 +129,14 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, // QZSS SV ids are from 193-197. So keep svIdOffset 0 sv_meta.systemId = SYSTEM_ID_QZSS; break; + case GNSS_SV_TYPE_BEIDOU: + sv_meta.talker[0] = 'P'; + sv_meta.talker[1] = 'Q'; + sv_meta.mask = sv_cache_info.bds_used_mask; + sv_meta.svCount = sv_cache_info.bds_count; + // BDS SV ids are from 201-235. So keep svIdOffset 0 + sv_meta.systemId = SYSTEM_ID_BEIDOU; + break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svType); return NULL; @@ -135,9 +145,10 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, (sv_cache_info.gps_used_mask ? 1 : 0) + (sv_cache_info.glo_used_mask ? 1 : 0) + (sv_cache_info.gal_used_mask ? 1 : 0) + - (sv_cache_info.qzss_used_mask ? 1 : 0) > 1) + (sv_cache_info.qzss_used_mask ? 1 : 0) + + (sv_cache_info.bds_used_mask ? 1 : 0) > 1) { - // If GPS, GLONASS, Galileo, QZSS etc. are combined + // If GPS, GLONASS, Galileo, QZSS, BDS etc. are combined // to obtain the reported position solution, // talker shall be set to GN, to indicate that // the satellites are used in a combined solution @@ -420,7 +431,8 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } // The following entries are specific to QZSS and BDS - if (sv_meta_p->svType == GNSS_SV_TYPE_QZSS) + if ((sv_meta_p->svType == GNSS_SV_TYPE_QZSS) || + (sv_meta_p->svType == GNSS_SV_TYPE_BEIDOU)) { // last one is System id and second last is Signal Id which is always zero length = snprintf(pMarker, lengthRemaining,",%d,%d",0,sv_meta_p->systemId); @@ -528,9 +540,9 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } - // ------------------- - // ---$PQGSA/$GNGSA--- - // ------------------- + // -------------------------- + // ---$PQGSA/$GNGSA (QZSS)--- + // -------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); @@ -540,6 +552,17 @@ void loc_nmea_generate_pos(const UlpLocation &location, // talker should be default "GP". If GPS, GLO etc is used, it should be "GN" } + // ---------------------------- + // ---$PQGSA/$GNGSA (BEIDOU)--- + // ---------------------------- + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + if (count > 0) + { + svUsedCount += count; + // talker should be default "GP". If GPS, GLO etc is used, it should be "GN" + } + // ------------------- // ------$--VTG------- // ------------------- @@ -903,6 +926,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, sv_cache_info.glo_used_mask = 0; sv_cache_info.gal_used_mask = 0; sv_cache_info.qzss_used_mask = 0; + sv_cache_info.bds_used_mask = 0; } //Send blank NMEA reports for non-final fixes else { @@ -972,11 +996,13 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, sv_cache_info.glo_used_mask = 0; sv_cache_info.gal_used_mask = 0; sv_cache_info.qzss_used_mask = 0; + sv_cache_info.bds_used_mask = 0; sv_cache_info.gps_count = 0; sv_cache_info.glo_count = 0; sv_cache_info.gal_count = 0; sv_cache_info.qzss_count = 0; + sv_cache_info.bds_count = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) { @@ -1026,7 +1052,18 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, } sv_cache_info.qzss_count++; } - + else if (GNSS_SV_TYPE_BEIDOU == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $PQGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.bds_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + sv_cache_info.bds_count++; + } } loc_nmea_sv_meta sv_meta; @@ -1051,12 +1088,19 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, false), nmeaArraystr); - // ------------------ - // ------$PQGSV------ - // ------------------ + // ------------------------- + // ------$PQGSV (QZSS)------ + // ------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + // --------------------------- + // ------$PQGSV (BEIDOU)------ + // --------------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + EXIT_LOG(%d, 0); } From 876db406414d985d41d582f1ec4ad97b7c5a8313 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 28 Apr 2017 15:31:33 +0530 Subject: [PATCH 515/945] Updating AgpsSubscriber constructor Updating AgpsSubscriber constructor to ensure clone operation copies the entire state Change-Id: Id016994efd8cb1140af8d5ee05eace95922f246b CRs-Fixed: 2039863 --- gnss/Agps.cpp | 6 ++++-- gnss/Agps.h | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index aacd9da3..dcb9ad22 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -654,7 +654,9 @@ void DSStateMachine::notifyEventToSubscriber( AgpsEvent event, AgpsSubscriber* subscriberToNotify, bool deleteSubscriberPostNotify) { - LOC_LOGD("DSStateMachine::notifyEventToSubscriber"); + LOC_LOGD("DSStateMachine::notifyEventToSubscriber(): " + "SM %p, Event %d Subscriber %p Delete %d", + this, event, subscriberToNotify, deleteSubscriberPostNotify); switch (event){ @@ -781,7 +783,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ } /* Invoke AGPS SM processing */ - AgpsSubscriber subscriber(connHandle); + AgpsSubscriber subscriber(connHandle, false, false); sm->setCurrentSubscriber(&subscriber); /* If DS State Machine, wait for close complete */ diff --git a/gnss/Agps.h b/gnss/Agps.h index 1e95a42c..d3fc3628 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -173,16 +173,19 @@ public: bool mWaitForCloseComplete; bool mIsInactive; - inline AgpsSubscriber(int connHandle) : - mConnHandle(connHandle), mWaitForCloseComplete(false), - mIsInactive(false) {} + inline AgpsSubscriber( + int connHandle, bool waitForCloseComplete, bool isInactive) : + mConnHandle(connHandle), + mWaitForCloseComplete(waitForCloseComplete), + mIsInactive(isInactive) {} inline virtual ~AgpsSubscriber() {} inline virtual bool equals(const AgpsSubscriber *s) const { return (mConnHandle == s->mConnHandle); } inline virtual AgpsSubscriber* clone() - { return new AgpsSubscriber(mConnHandle); } + { return new AgpsSubscriber( + mConnHandle, mWaitForCloseComplete, mIsInactive); } }; /* AGPS STATE MACHINE */ From 1f3ac891ae0aee10a2415da7539d58e239cacf92 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 31 May 2017 16:22:16 +0800 Subject: [PATCH 516/945] Make updateConfig functional before gnss is enabled locAPIGnssUpdateConfig and locAPIEnable/Disable will use different request queues Change-Id: I8c5456ebc4c221ff0e536ad488259b21e5607e03 CRs-Fixed: 2054316 --- location/LocationAPIClientBase.cpp | 87 +++++++++++++++--------------- location/LocationAPIClientBase.h | 3 +- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 58f7fcb2..141f5ebf 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -42,7 +42,8 @@ LocationAPIClientBase::LocationAPIClientBase() : mGeofenceBreachCallback(nullptr), mLocationAPI(nullptr), mLocationControlAPI(nullptr), - mBatchSize(-1) + mBatchSize(-1), + mEnabled(false) { // use recursive mutex, in case callback come from the same thread @@ -139,7 +140,7 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_TRACKING] = nullptr; } uint32_t session = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); @@ -226,7 +227,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_TRACKING] = nullptr; } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); @@ -237,7 +238,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_BATCHING] = nullptr; } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); @@ -338,7 +339,7 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_TRACKING] = nullptr; } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", @@ -364,7 +365,7 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_BATCHING] = nullptr; } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", @@ -589,7 +590,7 @@ void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse res RequestQueue* requests = mRequestQueues[REQUEST_NIRESPONSE]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_NIRESPONSE] = nullptr; } uint32_t session = id; mLocationAPI->gnssNiResponse(id, response); @@ -609,7 +610,7 @@ uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) RequestQueue* requests = mRequestQueues[REQUEST_DELETEAIDINGDATA]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_DELETEAIDINGDATA] = nullptr; } uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); @@ -628,19 +629,24 @@ uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); - if (mLocationControlAPI) { + if (mEnabled) { + // just return success if already enabled + retVal = LOCATION_ERROR_SUCCESS; + } else if (mLocationControlAPI) { RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; if (requests) { delete requests; - requests = nullptr; + mRequestQueues[REQUEST_CONTROL] = nullptr; } uint32_t session = mLocationControlAPI->enable(techType); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); requests = new RequestQueue(session); - requests->push(new EnableRequest(*this)); mRequestQueues[REQUEST_CONTROL] = requests; - - retVal = LOCATION_ERROR_SUCCESS; + if (requests) { + requests->push(new EnableRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; + mEnabled = true; + } } pthread_mutex_unlock(&mMutex); @@ -650,7 +656,7 @@ uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) void LocationAPIClientBase::locAPIDisable() { pthread_mutex_lock(&mMutex); - if (mLocationControlAPI) { + if (mEnabled && mLocationControlAPI) { uint32_t session = 0; RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; if (requests) { @@ -658,6 +664,7 @@ void LocationAPIClientBase::locAPIDisable() if (session > 0) { requests->push(new DisableRequest(*this)); mLocationControlAPI->disable(session); + mEnabled = false; } } } @@ -668,7 +675,8 @@ uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; if (memcmp(&mConfig, &config, sizeof(GnssConfig)) == 0) { - LOC_LOGE("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); + LOC_LOGV("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); + retVal = LOCATION_ERROR_SUCCESS; return retVal; } @@ -678,17 +686,17 @@ uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) memcpy(&mConfig, &config, sizeof(GnssConfig)); uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; - if (requests) { - session = requests->getSession(); - if (session > 0) { - requests->push(new GnssUpdateConfigRequest(*this)); - uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); - LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); - } + RequestQueue* requests = mRequestQueues[REQUEST_CONFIG]; + uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); + LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); + if (!requests && idArray != nullptr) { + requests = new RequestQueue(idArray[0]); + mRequestQueues[REQUEST_CONFIG] = requests; + } + if (requests) { + requests->push(new GnssUpdateConfigRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; } - - retVal = LOCATION_ERROR_SUCCESS; } pthread_mutex_unlock(&mMutex); return retVal; @@ -753,10 +761,11 @@ void LocationAPIClientBase::onCollectiveResponseCb( } } LocationAPIRequest* request = nullptr; - if (count > 0 && ids) - request = getRequestBySession(ids[0]); - if (!request) - request = getGeofencesRequest(); + pthread_mutex_lock(&mMutex); + if (mRequestQueues[REQUEST_GEOFENCE] != nullptr) { + request = mRequestQueues[REQUEST_GEOFENCE]->pop(); + } + pthread_mutex_unlock(&mMutex); if (request) { request->onCollectiveResponse(count, errors, ids); delete request; @@ -788,8 +797,11 @@ void LocationAPIClientBase::onCtrlCollectiveResponseCb( } } LocationAPIRequest* request = nullptr; - if (count > 0 && ids) - request = getRequestBySession(ids[0]); + pthread_mutex_lock(&mMutex); + if (mRequestQueues[REQUEST_CONFIG] != nullptr) { + request = mRequestQueues[REQUEST_CONFIG]->pop(); + } + pthread_mutex_unlock(&mMutex); if (request) { request->onCollectiveResponse(count, errors, ids); delete request; @@ -803,6 +815,7 @@ LocationAPIClientBase::getRequestBySession(uint32_t session) LocationAPIRequest* request = nullptr; for (int i = 0; i < REQUEST_MAX; i++) { if (i != REQUEST_GEOFENCE && + i != REQUEST_CONFIG && mRequestQueues[i] && mRequestQueues[i]->getSession() == session) { request = mRequestQueues[i]->pop(); @@ -812,15 +825,3 @@ LocationAPIClientBase::getRequestBySession(uint32_t session) pthread_mutex_unlock(&mMutex); return request; } - -LocationAPIClientBase::LocationAPIRequest* -LocationAPIClientBase::getGeofencesRequest() -{ - pthread_mutex_lock(&mMutex); - LocationAPIRequest* request = nullptr; - if (mRequestQueues[REQUEST_GEOFENCE]) { - request = mRequestQueues[REQUEST_GEOFENCE]->pop(); - } - pthread_mutex_unlock(&mMutex); - return request; -} diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 832dca8e..0805d7c9 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -50,6 +50,7 @@ enum REQUEST_TYPE { REQUEST_NIRESPONSE, REQUEST_DELETEAIDINGDATA, REQUEST_CONTROL, + REQUEST_CONFIG, REQUEST_MAX, }; @@ -446,7 +447,6 @@ private: }; LocationAPIRequest* getRequestBySession(uint32_t session); - LocationAPIRequest* getGeofencesRequest(); private: pthread_mutex_t mMutex; @@ -462,6 +462,7 @@ private: RequestQueue* mRequestQueues[REQUEST_MAX]; std::map mSessionMap; int32_t mBatchSize; + bool mEnabled; GnssConfig mConfig; }; From 58d74dc1bddc9933c63c3877a934658f9788bc54 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 6 Jun 2017 10:04:43 -0700 Subject: [PATCH 517/945] Add set default report API in systemstatus Add an API to set default report data cached in systemstatus. Call this API when delete all aiding data is requested, so that bugreport has all default values. Bug: 62068956 Change-Id: I76d661c6a89a1644aef2a8f47253ce9cc0d727fb CRs-Fixed: 2054705 --- core/SystemStatus.cpp | 72 +++++++++++++++++++++++++ core/SystemStatus.h | 123 +++++++++++++++++++++++++++++++++++++----- gnss/GnssAdapter.cpp | 4 +- 3 files changed, 183 insertions(+), 16 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 80406f62..939005d0 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -873,6 +873,7 @@ void SystemStatusInjectedPosition::dump() SystemStatusBestPosition ******************************************************************************/ SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea) : + mValid(true), mBestLat(nmea.mBestLat), mBestLon(nmea.mBestLon), mBestAlt(nmea.mBestAlt), @@ -1598,5 +1599,76 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con return true; } +/****************************************************************************** +@brief API to set default report data + +@param[In] none + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::setDefaultReport(void) +{ + pthread_mutex_lock(&mMutexSystemStatus); + + mCache.mLocation.push_back(SystemStatusLocation()); + if (mCache.mLocation.size() > maxLocation) { + mCache.mLocation.erase(mCache.mLocation.begin()); + } + + mCache.mTimeAndClock.push_back(SystemStatusTimeAndClock()); + if (mCache.mTimeAndClock.size() > maxTimeAndClock) { + mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin()); + } + mCache.mXoState.push_back(SystemStatusXoState()); + if (mCache.mXoState.size() > maxXoState) { + mCache.mXoState.erase(mCache.mXoState.begin()); + } + mCache.mRfAndParams.push_back(SystemStatusRfAndParams()); + if (mCache.mRfAndParams.size() > maxRfAndParams) { + mCache.mRfAndParams.erase(mCache.mRfAndParams.begin()); + } + mCache.mErrRecovery.push_back(SystemStatusErrRecovery()); + if (mCache.mErrRecovery.size() > maxErrRecovery) { + mCache.mErrRecovery.erase(mCache.mErrRecovery.begin()); + } + + mCache.mInjectedPosition.push_back(SystemStatusInjectedPosition()); + if (mCache.mInjectedPosition.size() > maxInjectedPosition) { + mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin()); + } + mCache.mBestPosition.push_back(SystemStatusBestPosition()); + if (mCache.mBestPosition.size() > maxBestPosition) { + mCache.mBestPosition.erase(mCache.mBestPosition.begin()); + } + mCache.mXtra.push_back(SystemStatusXtra()); + if (mCache.mXtra.size() > maxXtra) { + mCache.mXtra.erase(mCache.mXtra.begin()); + } + mCache.mEphemeris.push_back(SystemStatusEphemeris()); + if (mCache.mEphemeris.size() > maxEphemeris) { + mCache.mEphemeris.erase(mCache.mEphemeris.begin()); + } + mCache.mSvHealth.push_back(SystemStatusSvHealth()); + if (mCache.mSvHealth.size() > maxSvHealth) { + mCache.mSvHealth.erase(mCache.mSvHealth.begin()); + } + mCache.mPdr.push_back(SystemStatusPdr()); + if (mCache.mPdr.size() > maxPdr) { + mCache.mPdr.erase(mCache.mPdr.begin()); + } + mCache.mNavData.push_back(SystemStatusNavData()); + if (mCache.mNavData.size() > maxNavData) { + mCache.mNavData.erase(mCache.mNavData.begin()); + } + + mCache.mPositionFailure.push_back(SystemStatusPositionFailure()); + if (mCache.mPositionFailure.size() > maxPositionFailure) { + mCache.mPositionFailure.erase(mCache.mPositionFailure.begin()); + } + + pthread_mutex_unlock(&mMutexSystemStatus); + return true; +} + } // namespace loc_core diff --git a/core/SystemStatus.h b/core/SystemStatus.h index a3b38d34..78fc6f8f 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -74,12 +74,16 @@ public: class SystemStatusLocation : public SystemStatusItemBase { public: + bool mValid; UlpLocation mLocation; GpsLocationExtended mLocationEx; - SystemStatusLocation(const UlpLocation& location, + inline SystemStatusLocation() : + mValid(false) {} + inline SystemStatusLocation(const UlpLocation& location, const GpsLocationExtended& locationEx) : + mValid(true), mLocation(location), - mLocationEx(locationEx){ }; + mLocationEx(locationEx) { } bool equals(SystemStatusLocation& peer); void dump(void); }; @@ -97,7 +101,17 @@ public: int32_t mClockFreqBiasUnc; int32_t mLeapSeconds; int32_t mLeapSecUnc; - SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); + inline SystemStatusTimeAndClock() : + mGpsWeek(0), + mGpsTowMs(0), + mTimeValid(0), + mTimeSource(0), + mTimeUnc(0), + mClockFreqBias(0), + mClockFreqBiasUnc(0), + mLeapSeconds(0), + mLeapSecUnc(0) {} + inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); bool equals(SystemStatusTimeAndClock& peer); void dump(void); }; @@ -106,7 +120,9 @@ class SystemStatusXoState : public SystemStatusItemBase { public: uint8_t mXoState; - SystemStatusXoState(const SystemStatusPQWM1& nmea); + inline SystemStatusXoState() : + mXoState(0) {} + inline SystemStatusXoState(const SystemStatusPQWM1& nmea); bool equals(SystemStatusXoState& peer); void dump(void); }; @@ -127,7 +143,21 @@ public: double mAgcGlo; double mAgcBds; double mAgcGal; - SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); + inline SystemStatusRfAndParams() : + mPgaGain(0), + mGpsBpAmpI(0), + mGpsBpAmpQ(0), + mAdcI(0), + mAdcQ(0), + mJammerGps(0), + mJammerGlo(0), + mJammerBds(0), + mJammerGal(0), + mAgcGps(0), + mAgcGlo(0), + mAgcBds(0), + mAgcGal(0) {} + inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); bool equals(SystemStatusRfAndParams& peer); void dump(void); }; @@ -136,7 +166,9 @@ class SystemStatusErrRecovery : public SystemStatusItemBase { public: uint32_t mRecErrorRecovery; - SystemStatusErrRecovery(const SystemStatusPQWM1& nmea); + inline SystemStatusErrRecovery() : + mRecErrorRecovery(0) {}; + inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea); bool equals(SystemStatusErrRecovery& peer); void dump(void); }; @@ -152,7 +184,15 @@ public: float mEpiHepe; float mEpiAltUnc; uint8_t mEpiSrc; - SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea); + inline SystemStatusInjectedPosition() : + mEpiValidity(0), + mEpiLat(0), + mEpiLon(0), + mEpiAlt(0), + mEpiHepe(0), + mEpiAltUnc(0), + mEpiSrc(0) {} + inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea); bool equals(SystemStatusInjectedPosition& peer); void dump(void); }; @@ -161,12 +201,20 @@ class SystemStatusPQWP2; class SystemStatusBestPosition : public SystemStatusItemBase { public: + bool mValid; float mBestLat; float mBestLon; float mBestAlt; float mBestHepe; float mBestAltUnc; - SystemStatusBestPosition(const SystemStatusPQWP2& nmea); + inline SystemStatusBestPosition() : + mValid(false), + mBestLat(0), + mBestLon(0), + mBestAlt(0), + mBestHepe(0), + mBestAltUnc(0) {} + inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea); bool equals(SystemStatusBestPosition& peer); void dump(void); }; @@ -186,7 +234,19 @@ public: uint64_t mBdsXtraValid; uint64_t mGalXtraValid; uint8_t mQzssXtraValid; - SystemStatusXtra(const SystemStatusPQWP3& nmea); + inline SystemStatusXtra() : + mXtraValidMask(0), + mGpsXtraAge(0), + mGloXtraAge(0), + mBdsXtraAge(0), + mGalXtraAge(0), + mQzssXtraAge(0), + mGpsXtraValid(0), + mGloXtraValid(0), + mBdsXtraValid(0ULL), + mGalXtraValid(0ULL), + mQzssXtraValid(0) {} + inline SystemStatusXtra(const SystemStatusPQWP3& nmea); bool equals(SystemStatusXtra& peer); void dump(void); }; @@ -200,7 +260,13 @@ public: uint64_t mBdsEpheValid; uint64_t mGalEpheValid; uint8_t mQzssEpheValid; - SystemStatusEphemeris(const SystemStatusPQWP4& nmea); + inline SystemStatusEphemeris() : + mGpsEpheValid(0), + mGloEpheValid(0), + mBdsEpheValid(0ULL), + mGalEpheValid(0ULL), + mQzssEpheValid(0) {} + inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea); bool equals(SystemStatusEphemeris& peer); void dump(void); }; @@ -224,7 +290,23 @@ public: uint64_t mBdsBadMask; uint64_t mGalBadMask; uint8_t mQzssBadMask; - SystemStatusSvHealth(const SystemStatusPQWP5& nmea); + inline SystemStatusSvHealth() : + mGpsUnknownMask(0), + mGloUnknownMask(0), + mBdsUnknownMask(0ULL), + mGalUnknownMask(0ULL), + mQzssUnknownMask(0), + mGpsGoodMask(0), + mGloGoodMask(0), + mBdsGoodMask(0ULL), + mGalGoodMask(0ULL), + mQzssGoodMask(0), + mGpsBadMask(0), + mGloBadMask(0), + mBdsBadMask(0ULL), + mGalBadMask(0ULL), + mQzssBadMask(0) {} + inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea); bool equals(SystemStatusSvHealth& peer); void dump(void); }; @@ -234,7 +316,9 @@ class SystemStatusPdr : public SystemStatusItemBase { public: uint32_t mFixInfoMask; - SystemStatusPdr(const SystemStatusPQWP6& nmea); + inline SystemStatusPdr() : + mFixInfoMask(0) {} + inline SystemStatusPdr(const SystemStatusPQWP6& nmea); bool equals(SystemStatusPdr& peer); void dump(void); }; @@ -251,7 +335,14 @@ class SystemStatusNavData : public SystemStatusItemBase { public: SystemStatusNav mNav[SV_ALL_NUM]; - SystemStatusNavData(const SystemStatusPQWP7& nmea); + inline SystemStatusNavData() { + for (uint32_t i=0; i Date: Wed, 22 Mar 2017 11:04:49 +0800 Subject: [PATCH 518/945] Disable LPPe feature on SDM660 CRM build Set the LPPE_UP_TECHNOLOGY and LPPE_CP_TECHNOLOGY as 0 in gps.conf to disable LPPe feature as default. Change-Id: I656cbf1ee9456189fd0ddbcbf7b70cc74a75656e CRs-fixed: 2015517 --- etc/gps.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 3ea9aabd..1027d76b 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -120,7 +120,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe CP # 0x4: SRN AP measurement for CP # 0x8: Sensor Barometer Measurement LPPe CP -LPPE_CP_TECHNOLOGY = 4 +LPPE_CP_TECHNOLOGY = 0 ################################################## # Select technology for LPPe User Plane @@ -129,7 +129,7 @@ LPPE_CP_TECHNOLOGY = 4 # 0x2: WLAN AP Measurements for LPPe UP # 0x4: SRN AP measurement for UP # 0x8: Sensor Barometer Measurement LPPe UP -LPPE_UP_TECHNOLOGY = 4 +LPPE_UP_TECHNOLOGY = 0 ################################################## # AGPS_CONFIG_INJECT From 7b1d6ec5aaac458dbf83b7ee5c21261005865ce0 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 6 Jun 2017 15:11:02 +0800 Subject: [PATCH 519/945] Update the latest LocationOptions to LocationAPI Call locAPIUpdateTrackingOptions in gnssSetPositionMode. Update tracking options should update the tracking sessions so that the smallest interval options are set. Change-Id: I24cefe4fb711a160d0a72ab7592d8e673ea2dd97 CRs-fixed: 2048231 --- android/location_api/GnssAPIClient.cpp | 1 + gnss/GnssAdapter.cpp | 44 ++++++++++++++++++++++++-- gnss/GnssAdapter.h | 2 ++ location/LocationAPI.cpp | 4 +-- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index e0e90c03..c9405978 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -194,6 +194,7 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, mLocationOptions.mode = GNSS_SUPL_MODE_MSB; else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + locAPIUpdateTrackingOptions(mLocationOptions); return retVal; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 2117c733..3ab9254e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1294,7 +1294,6 @@ LocationError GnssAdapter::startTrackingMultiplex(const LocationOptions& options) { LocationError err = LOCATION_ERROR_SUCCESS; - bool updateTrackingSession = false; if (mTrackingSessions.empty()) { err = startTracking(options); @@ -1420,7 +1419,7 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, err = LOCATION_ERROR_INVALID_PARAMETER; } else { // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.startTrackingMultiplex(mOptions); + err = mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); if (LOCATION_ERROR_SUCCESS == err) { mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); } @@ -1436,6 +1435,45 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, sendMsg(new MsgUpdateTracking(*this, *mLocApi, client, id, options)); } +LocationError +GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, + const LocationOptions& options) +{ + LocationError err = LOCATION_ERROR_SUCCESS; + + if (1 == mTrackingSessions.size()) { + err = startTracking(options); + } else { + LocationSessionKey key(client, id); + + // get the session we are updating + auto it = mTrackingSessions.find(key); + if (it != mTrackingSessions.end()) { + // find the smallest interval, other than the session we are updating + LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time + for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { + // if session is not the one we are updating and either smallest interval is not set + // or there is a new smallest interval, then set the new smallest interval + if (it2->first != key && (0 == smallestIntervalOptions.size || + it2->second.minInterval < smallestIntervalOptions.minInterval)) { + smallestIntervalOptions = it2->second; + } + } + // if session we are updating has smaller interval then next smallest + if (options.minInterval < smallestIntervalOptions.minInterval) { + // restart time based tracking with the newly updated interval + err = startTracking(options); + // else if the session we are updating used to be the smallest + } else if (it->second.minInterval < smallestIntervalOptions.minInterval) { + // restart time based tracking with the next smallest + err = startTracking(smallestIntervalOptions); + } + } + } + + return err; +} + void GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) { @@ -1489,7 +1527,7 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) auto it = mTrackingSessions.find(key); if (it != mTrackingSessions.end()) { // find the next smallest interval, other than the session we are stopping - LocationOptions smallestIntervalOptions; // size will be zero until set for the first time + LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { // if session is not the one we are stopping and either smallest interval is not set // or there is a new smallest interval, then set the new smallest interval diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 429bcb33..3d27e424 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -163,6 +163,8 @@ public: LocationError startTracking(const LocationOptions& options); LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id); LocationError stopTracking(); + LocationError updateTrackingMultiplex(LocationAPI* client, uint32_t id, + const LocationOptions& options); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 60a46fe5..ed3cc6b6 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -330,7 +330,7 @@ LocationAPI::stopTracking(uint32_t id) if (gData.flpInterface != NULL) { gData.flpInterface->stopTracking(this, id); } - if (gData.flpInterface != NULL && gData.gnssInterface != NULL) { + if (gData.flpInterface == NULL && gData.gnssInterface == NULL) { LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", __func__, __LINE__, this); } @@ -357,7 +357,7 @@ LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions if (gData.flpInterface != NULL) { gData.flpInterface->updateTrackingOptions(this, id, locationOptions); } - if (gData.flpInterface != NULL && gData.gnssInterface != NULL) { + if (gData.flpInterface == NULL && gData.gnssInterface == NULL) { LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", __func__, __LINE__, this); } From 36c11432857ba531ec26a43365809ebf7eefb8b0 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 6 Jun 2017 10:54:39 -0700 Subject: [PATCH 520/945] Post SSR restarting tracking should bypass ULP When sub system restart occurs, restarting gps tracking should be sent directly to Loc API instad of going through ULP. Change-Id: I6309eeee3670b3d7fa484f74f96ea9a2848f7bb1 CRs-fixed: 2056783 --- gnss/GnssAdapter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 2117c733..ea0c2270 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1067,7 +1067,9 @@ GnssAdapter::restartSessions() } } - startTracking(smallestIntervalOptions); + LocPosMode locPosMode = {}; + convertOptions(locPosMode, smallestIntervalOptions); + mLocApi->startFix(locPosMode); } void From 38af28c322524f09a10be6eda721020f745950dd Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 7 Jun 2017 18:24:40 -0700 Subject: [PATCH 521/945] Fixed crash when timerfd_create failed Implemented graceful fallback when timerfd_create is failing for CLOCK_BOOTTIME_ALARM Change-Id: I6561be840f37a985104a2766fc4b521d237da3b2 CRs-fixed: 2051787 --- utils/LocTimer.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 4de6b40b..c08bd354 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -183,7 +183,7 @@ class LocTimerDelegate : public LocRankable { : 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); + LocTimerDelegate(LocTimer& client, struct timespec& futureTime, LocTimerContainer* container); void destroyLocked(); // LocRankable virtual method virtual int ranks(LocRankable& rankable); @@ -472,11 +472,13 @@ bool LocTimerPollTask::run() { /***************************LocTimerDelegate methods***************************/ inline -LocTimerDelegate::LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire) +LocTimerDelegate::LocTimerDelegate(LocTimer& client, + struct timespec& futureTime, + LocTimerContainer* container) : mClient(&client), mLock(mClient->mLock->share()), mFutureTime(futureTime), - mContainer(LocTimerContainer::get(wakeOnExpire)) { + mContainer(container) { // adding the timer into the container mContainer->add(*this); } @@ -556,8 +558,13 @@ bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { 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 + + LocTimerContainer* container; + container = LocTimerContainer::get(wakeOnExpire); + if (NULL != container) { + mTimer = new LocTimerDelegate(*this, futureTime, container); + // if mTimer is non 0, success should be 0; or vice versa + } success = (NULL != mTimer); } mLock->unlock(); From fc5c5f6625695a525b0e1322f7148262fbbb3589 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 27 Apr 2017 17:00:28 -0700 Subject: [PATCH 522/945] Fix config updates for some LocatoinAPI bit masks Fix SUPL mode, GPS lock, and GNSS Ni options to be treated like bit masks instead of values. Rename some enums of bit masks with _BIT as convention. Change-Id: I036b682ca3472159304ef569ff67d28dc94f644e CRs-fixed: 2039308 --- android/GnssConfiguration.cpp | 8 ++-- android/location_api/GnssAPIClient.cpp | 49 +++++++++++------------ gnss/GnssAdapter.cpp | 4 +- location/LocationAPI.h | 54 +++++++++++++------------- 4 files changed, 57 insertions(+), 58 deletions(-) diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index 6bb02c1e..51ee8926 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -95,10 +95,13 @@ Return GnssConfiguration::setSuplMode(uint8_t mode) { config.suplModeMask = 0; // STANDALONE ONLY break; case 1: - config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB; + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT; break; case 2: - config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA; + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT; + break; + case 3: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT; break; default: LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode); @@ -196,7 +199,6 @@ Return GnssConfiguration::setGpsLock(uint8_t lock) { return false; break; } - config.gpsLock = static_cast(lock); return mGnss->updateConfiguration(config); } diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index e0e90c03..0e86c00c 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -140,39 +140,39 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags); GnssAidingData data; memset(&data, 0, sizeof (GnssAidingData)); - data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS | - GNSS_AIDING_DATA_SV_TYPE_GLONASS | - GNSS_AIDING_DATA_SV_TYPE_QZSS | - GNSS_AIDING_DATA_SV_TYPE_BEIDOU | - GNSS_AIDING_DATA_SV_TYPE_GALILEO; + data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT | + GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT | + GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | + GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) data.deleteAll = true; else { if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS) - data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS; + data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC) - data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC; + data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION) - data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION; + data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME) - data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME; + data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO) - data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE; + data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC) - data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC; + data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH) - data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH; + data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR) - data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION; + data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER) - data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER; + data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA) - data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA; + data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI) - data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI; + data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT; if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO) - data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB; + data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT; } locAPIGnssDeleteAidingData(data); } @@ -306,15 +306,12 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.niType = static_cast(4/*hardcode until IGnssNiCallback adds value*/); - if (gnssNiNotification.options == GNSS_NI_OPTIONS_NOTIFICATION) - notificationGnss.notifyFlags = - static_cast(IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY); - else if (gnssNiNotification.options == GNSS_NI_OPTIONS_VERIFICATION) - notificationGnss.notifyFlags = - static_cast(IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY); - else if (gnssNiNotification.options == GNSS_NI_OPTIONS_PRIVACY_OVERRIDE) - notificationGnss.notifyFlags = - static_cast(IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE); + if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY; + else if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY; + else if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE; notificationGnss.timeoutSec = gnssNiNotification.timeout; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 2117c733..f22b863d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -435,10 +435,10 @@ uint32_t GnssAdapter::convertSuplMode(const GnssConfigSuplModeMask suplModeMask) { uint32_t mask = 0; - if (GNSS_CONFIG_SUPL_MODE_MSB & suplModeMask) { + if (GNSS_CONFIG_SUPL_MODE_MSB_BIT & suplModeMask) { mask |= (1<<0); } - if (GNSS_CONFIG_SUPL_MODE_MSA & suplModeMask) { + if (GNSS_CONFIG_SUPL_MODE_MSA_BIT & suplModeMask) { mask |= (1<<1); } return mask; diff --git a/location/LocationAPI.h b/location/LocationAPI.h index 88ce5f1d..d128d5eb 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -202,8 +202,8 @@ typedef enum { typedef uint16_t GnssConfigSuplModeMask; typedef enum { - GNSS_CONFIG_SUPL_MODE_MSB = (1<<0), - GNSS_CONFIG_SUPL_MODE_MSA = (1<<1), + GNSS_CONFIG_SUPL_MODE_MSB_BIT = (1<<0), + GNSS_CONFIG_SUPL_MODE_MSA_BIT = (1<<1), } GnssConfigSuplModeBits; typedef uint32_t GnssConfigFlagsMask; @@ -236,9 +236,9 @@ typedef enum { typedef uint16_t GnssNiOptionsMask; typedef enum { - GNSS_NI_OPTIONS_NOTIFICATION = (1<<0), - GNSS_NI_OPTIONS_VERIFICATION = (1<<1), - GNSS_NI_OPTIONS_PRIVACY_OVERRIDE = (1<<2), + GNSS_NI_OPTIONS_NOTIFICATION_BIT = (1<<0), + GNSS_NI_OPTIONS_VERIFICATION_BIT = (1<<1), + GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT = (1<<2), } GnssNiOptionsBits; typedef enum { @@ -366,26 +366,26 @@ typedef enum { typedef uint32_t GnssAidingDataSvMask; typedef enum { - GNSS_AIDING_DATA_SV_EPHEMERIS = (1<<0), // ephemeris - GNSS_AIDING_DATA_SV_ALMANAC = (1<<1), // almanac - GNSS_AIDING_DATA_SV_HEALTH = (1<<2), // health - GNSS_AIDING_DATA_SV_DIRECTION = (1<<3), // direction - GNSS_AIDING_DATA_SV_STEER = (1<<4), // steer - GNSS_AIDING_DATA_SV_ALMANAC_CORR = (1<<5), // almanac correction - GNSS_AIDING_DATA_SV_BLACKLIST = (1<<6), // blacklist SVs - GNSS_AIDING_DATA_SV_SA_DATA = (1<<7), // sensitivity assistance data - GNSS_AIDING_DATA_SV_NO_EXIST = (1<<8), // SV does not exist - GNSS_AIDING_DATA_SV_IONOSPHERE = (1<<9), // ionosphere correction - GNSS_AIDING_DATA_SV_TIME = (1<<10),// reset satellite time + GNSS_AIDING_DATA_SV_EPHEMERIS_BIT = (1<<0), // ephemeris + GNSS_AIDING_DATA_SV_ALMANAC_BIT = (1<<1), // almanac + GNSS_AIDING_DATA_SV_HEALTH_BIT = (1<<2), // health + GNSS_AIDING_DATA_SV_DIRECTION_BIT = (1<<3), // direction + GNSS_AIDING_DATA_SV_STEER_BIT = (1<<4), // steer + GNSS_AIDING_DATA_SV_ALMANAC_CORR_BIT = (1<<5), // almanac correction + GNSS_AIDING_DATA_SV_BLACKLIST_BIT = (1<<6), // blacklist SVs + GNSS_AIDING_DATA_SV_SA_DATA_BIT = (1<<7), // sensitivity assistance data + GNSS_AIDING_DATA_SV_NO_EXIST_BIT = (1<<8), // SV does not exist + GNSS_AIDING_DATA_SV_IONOSPHERE_BIT = (1<<9), // ionosphere correction + GNSS_AIDING_DATA_SV_TIME_BIT = (1<<10),// reset satellite time } GnssAidingDataSvBits; typedef uint32_t GnssAidingDataSvTypeMask; typedef enum { - GNSS_AIDING_DATA_SV_TYPE_GPS = (1<<0), - GNSS_AIDING_DATA_SV_TYPE_GLONASS = (1<<1), - GNSS_AIDING_DATA_SV_TYPE_QZSS = (1<<2), - GNSS_AIDING_DATA_SV_TYPE_BEIDOU = (1<<3), - GNSS_AIDING_DATA_SV_TYPE_GALILEO = (1<<4), + GNSS_AIDING_DATA_SV_TYPE_GPS_BIT = (1<<0), + GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT = (1<<1), + GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT = (1<<2), + GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT = (1<<3), + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), } GnssAidingDataSvTypeBits; typedef struct { @@ -395,12 +395,12 @@ typedef struct { typedef uint32_t GnssAidingDataCommonMask; typedef enum { - GNSS_AIDING_DATA_COMMON_POSITION = (1<<0), // position estimate - GNSS_AIDING_DATA_COMMON_TIME = (1<<1), // reset all clock values - GNSS_AIDING_DATA_COMMON_UTC = (1<<2), // UTC estimate - GNSS_AIDING_DATA_COMMON_RTI = (1<<3), // RTI - GNSS_AIDING_DATA_COMMON_FREQ_BIAS_EST = (1<<4), // frequency bias estimate - GNSS_AIDING_DATA_COMMON_CELLDB = (1<<5), // all celldb info + GNSS_AIDING_DATA_COMMON_POSITION_BIT = (1<<0), // position estimate + GNSS_AIDING_DATA_COMMON_TIME_BIT = (1<<1), // reset all clock values + GNSS_AIDING_DATA_COMMON_UTC_BIT = (1<<2), // UTC estimate + GNSS_AIDING_DATA_COMMON_RTI_BIT = (1<<3), // RTI + GNSS_AIDING_DATA_COMMON_FREQ_BIAS_EST_BIT = (1<<4), // frequency bias estimate + GNSS_AIDING_DATA_COMMON_CELLDB_BIT = (1<<5), // all celldb info } GnssAidingDataCommonBits; typedef struct { From 5fc6fa657cf9eedbf435408c77b94f28f4df3412 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 9 Jun 2017 13:15:14 -0700 Subject: [PATCH 523/945] Fix NI for Notify and Verify being true CRs-fixed: 2059175 Bug: 62049857 Change-Id: I6c4717ddbd72f15972e5d4bd8897b528fbe2c2b4 --- android/location_api/GnssAPIClient.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 0e86c00c..02580b79 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -303,14 +303,13 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE; else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL) - notificationGnss.niType = - static_cast(4/*hardcode until IGnssNiCallback adds value*/); + notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL; if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT) notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY; - else if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT) + if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT) notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY; - else if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT) + if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT) notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE; notificationGnss.timeoutSec = gnssNiNotification.timeout; From a0075bdb8ecdc860ba55f69d226273234570aabe Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 15 Jun 2017 19:43:52 +0530 Subject: [PATCH 524/945] Remove fix made to set session status as failure in LocApi. Instead of sending session status as failure in LocApiV02 in case of both latitude/longitude 0 and horizontal reliability not set, for sending Blank NMEA sentences, the condition check for the same is done in before requesting to send nmea sentence. Change-Id: I359d136a8da9d9fe233e599eb2cba71e4509b270 CRs-Fixed: 2058269 --- gnss/GnssAdapter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5ddbda93..75584e4a 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1922,7 +1922,12 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, } if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { - uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE); + /*Only BlankNMEA sentence needs to be processed and sent, if both lat, long is 0 & + horReliability is not set. */ + bool blank_fix = ((0 == ulpLocation.gpsLocation.latitude) && + (0 == ulpLocation.gpsLocation.longitude) && + (LOC_RELIABILITY_NOT_SET == locationExtended.horizontal_reliability)); + uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE && !blank_fix); std::vector nmeaArraystr; loc_nmea_generate_pos(ulpLocation, locationExtended, generate_nmea, nmeaArraystr); for (auto sentence : nmeaArraystr) { From 15830de3b68087a03386566271b058dc9c655912 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 19 Jun 2017 17:54:28 +0530 Subject: [PATCH 525/945] Adding priority flag for NI and AGPS callbacks Adding priority flags while registering NI handling callback and AGPS handling callback. To ensure that both NI and AGPS are always handled by our stack instead of Android Framework stack. CRs-Fixed: 2059476 Change-Id: I585328491a7f5d9099287924a03d7710f4e5fda9 --- android/AGnss.cpp | 6 +++++- android/location_api/BatchingAPIClient.cpp | 1 + android/location_api/GeofenceAPIClient.cpp | 1 + android/location_api/GnssAPIClient.cpp | 9 ++++++++- android/location_api/MeasurementAPIClient.cpp | 1 + gnss/GnssAdapter.cpp | 17 ++++++++++++++--- gnss/GnssAdapter.h | 3 ++- gnss/location_gnss.cpp | 6 +++--- location/location_interface.h | 3 ++- utils/gps_extended_c.h | 11 +++++++++++ 10 files changed, 48 insertions(+), 10 deletions(-) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index c497ed49..b5f76bbe 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -51,7 +51,11 @@ Return AGnss::setCallback(const sp& callback) { // Save the interface sAGnssCbIface = callback; - mGnss->getGnssInterface()->agpsInit((void*)agnssStatusIpV4Cb); + AgpsCbInfo cbInfo = {}; + cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; + cbInfo.cbPriority = AGPS_CB_PRIORITY_LOW; + + mGnss->getGnssInterface()->agpsInit(cbInfo); return Void(); } diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 2f3e8bd2..4c2c5f05 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -54,6 +54,7 @@ BatchingAPIClient::BatchingAPIClient(const sp& callback) LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); locationCallbacks.size = sizeof(LocationCallbacks); locationCallbacks.trackingCb = nullptr; diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp index 7bd3bd42..61671771 100644 --- a/android/location_api/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -50,6 +50,7 @@ GeofenceAPIClient::GeofenceAPIClient(const sp& callback) LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); locationCallbacks.size = sizeof(LocationCallbacks); locationCallbacks.trackingCb = nullptr; diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index c9405978..8d686c0f 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -35,6 +35,7 @@ #include "LocationUtil.h" #include "GnssAPIClient.h" +#include namespace android { namespace hardware { @@ -79,6 +80,7 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, mGnssNiCbIface = niCb; LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); locationCallbacks.size = sizeof(LocationCallbacks); locationCallbacks.trackingCb = nullptr; @@ -94,7 +96,12 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, locationCallbacks.gnssLocationInfoCb = nullptr; locationCallbacks.gnssNiCb = nullptr; - if (mGnssNiCbIface != nullptr) { + loc_core::ContextBase* context = + loc_core::LocDualContext::getLocFgContext( + NULL, NULL, + loc_core::LocDualContext::mLocationHalName, false); + if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { + LOC_LOGD("Registering NI CB"); locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { onGnssNiCb(id, gnssNiNotification); }; diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 468c77a9..e3ae9ad3 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -80,6 +80,7 @@ MeasurementAPIClient::measurementSetCallback(const sp& mGnssMeasurementCbIface = callback; LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); locationCallbacks.size = sizeof(LocationCallbacks); locationCallbacks.trackingCb = nullptr; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5ddbda93..c07a47a4 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -62,7 +62,8 @@ GnssAdapter::GnssAdapter() : mControlCallbacks(), mPowerVoteId(0), mNiData(), - mAgpsManager() + mAgpsManager(), + mAgpsCbInfo() { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -2301,7 +2302,7 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) } /* INIT LOC AGPS MANAGER */ -void GnssAdapter::initAgpsCommand(void* statusV4Cb){ +void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ LOC_LOGI("GnssAdapter::initAgpsCommand"); @@ -2416,10 +2417,20 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ } }; + if (mAgpsCbInfo.cbPriority > cbInfo.cbPriority) { + LOC_LOGI("Higher priority AGPS CB already registered (%d > %d) !", + mAgpsCbInfo.cbPriority, cbInfo.cbPriority); + return; + } else { + mAgpsCbInfo = cbInfo; + LOC_LOGI("Registering AGPS CB 0x%x with priority %d", + mAgpsCbInfo.statusV4Cb, mAgpsCbInfo.cbPriority); + } + /* Send message to initialize AGPS Manager */ sendMsg(new AgpsMsgInit( &mAgpsManager, - (AgpsFrameworkInterface::AgnssStatusIpV4Cb)statusV4Cb, + (AgpsFrameworkInterface::AgnssStatusIpV4Cb)cbInfo.statusV4Cb, atlOpenStatusCb, atlCloseStatusCb, dsClientInitFn, dsClientOpenAndStartDataCallFn, dsClientStopDataCallFn, dsClientCloseDataCallFn, diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3d27e424..3b300474 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -99,6 +99,7 @@ class GnssAdapter : public LocAdapterBase { /* ==== AGPS ========================================================*/ // This must be initialized via initAgps() AgpsManager mAgpsManager; + AgpsCbInfo mAgpsCbInfo; /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); @@ -185,7 +186,7 @@ public: uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); - void initAgpsCommand(void* statusV4Cb); + void initAgpsCommand(const AgpsCbInfo& cbInfo); void dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, LocApnIpType ipType); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 0f905fd7..0cd8e8d2 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -54,7 +54,7 @@ static uint32_t* gnssUpdateConfig(GnssConfig config); static void injectLocation(double latitude, double longitude, float accuracy); static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty); -static void agpsInit(void* statusV4Cb); +static void agpsInit(const AgpsCbInfo& cbInfo); static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnLen, int ipType); static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); @@ -215,10 +215,10 @@ static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty) } } -static void agpsInit(void* statusV4Cb) { +static void agpsInit(const AgpsCbInfo& cbInfo) { if (NULL != gGnssAdapter) { - gGnssAdapter->initAgpsCommand(statusV4Cb); + gGnssAdapter->initAgpsCommand(cbInfo); } } static void agpsDataConnOpen( diff --git a/location/location_interface.h b/location/location_interface.h index 86febd31..c93f135c 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -30,6 +30,7 @@ #define LOCATION_INTERFACE_H #include +#include struct GnssInterface { size_t size; @@ -49,7 +50,7 @@ struct GnssInterface { uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); void (*injectLocation)(double latitude, double longitude, float accuracy); void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); - void (*agpsInit)(void* statusV4Cb); + void (*agpsInit)(const AgpsCbInfo& cbInfo); void (*agpsDataConnOpen)(short agpsType, const char* apnName, int apnLen, int ipType); void (*agpsDataConnClosed)(short agpsType); void (*agpsDataConnFailed)(short agpsType); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 40e87fb4..b8acead2 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -160,6 +160,17 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 1 #define AGPS_APN_BEARER_IPV4V6 2 +typedef enum { + AGPS_CB_PRIORITY_LOW = 1, + AGPS_CB_PRIORITY_MED = 2, + AGPS_CB_PRIORITY_HIGH = 3 +} AgpsCbPriority; + +typedef struct { + void* statusV4Cb; + AgpsCbPriority cbPriority; +} AgpsCbInfo; + /** GPS extended callback structure. */ typedef struct { /** set to sizeof(LocGpsCallbacks) */ From a2cafde5bda030a2b82a07ca7d4f07d0cbf5110c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 20 Jun 2017 15:09:19 -0700 Subject: [PATCH 526/945] Fixed loc_get_target() and removed 1530 support it is a stale feature, been disconnected for years. Also tightend up loc_get_target(), as it currently doesn't get produce a result, but also return -1, which would cause the next call and every call going through the entire function every time it is called. Change-Id: I348d99f690eb8973730112d5edeb870b2be2c6c8 CRs-Fixed: 2062169 --- utils/loc_log.cpp | 1 - utils/loc_target.cpp | 115 ++++++++----------------------------------- utils/loc_target.h | 2 - 3 files changed, 20 insertions(+), 98 deletions(-) diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 23b28944..9fad9e6e 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -109,7 +109,6 @@ static const loc_name_val_s_type target_name[] = NAME_VAL(GNSS_MSM), NAME_VAL(GNSS_GSS), NAME_VAL(GNSS_MDM), - NAME_VAL(GNSS_QCA1530), NAME_VAL(GNSS_AUTO), NAME_VAL(GNSS_UNKNOWN) }; diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 7e475eb0..cf429321 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -61,12 +61,6 @@ #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; @@ -92,63 +86,6 @@ static int read_a_line(const char * file_path, char * line, int line_size) 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) @@ -209,11 +146,6 @@ unsigned int loc_get_target(void) 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)) { @@ -242,42 +174,35 @@ unsigned int loc_get_target(void) } if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) || - !memcmp(baseband, STR_SDC, LENGTH(STR_SDC)) ){ + !memcmp(baseband, STR_SDC, LENGTH(STR_SDC)) ) { 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 if ( !memcmp(baseband, STR_MSM, LENGTH(STR_MSM)) || - !memcmp(baseband, STR_SDM, LENGTH(STR_SDM)) ) - gTarget = TARGET_DEFAULT; - - else - gTarget = TARGET_UNKNOWN; + } 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)]))) && + !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 if ( !memcmp(baseband, STR_MSM, LENGTH(STR_MSM)) || + !memcmp(baseband, STR_SDM, LENGTH(STR_SDM)) ) { + gTarget = TARGET_DEFAULT; + } else { + gTarget = TARGET_UNKNOWN; } detected: - LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); + LOC_LOGW("HAL: %s returned %d", __FUNCTION__, gTarget); return gTarget; } diff --git a/utils/loc_target.h b/utils/loc_target.h index 69395db7..47a67d91 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -34,7 +34,6 @@ #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) @@ -69,7 +68,6 @@ typedef enum { GNSS_MSM, GNSS_GSS, GNSS_MDM, - GNSS_QCA1530, GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; From c0a300ca3aa72e91a03487d5c516854ea5d758cf Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 13 Jun 2017 15:26:57 +0800 Subject: [PATCH 527/945] Reset RequestQueue instead of delete it. Change the type of mRequestQueue from 'array of pointers' to 'array of instances'. So we can reuse them. CRs-fixed: 2050837 Change-Id: I362319ece38cf10ee7ae2278a89249ce97e2f0a5 --- location/LocationAPIClientBase.cpp | 334 +++++++++++++---------------- location/LocationAPIClientBase.h | 18 +- 2 files changed, 162 insertions(+), 190 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 141f5ebf..dcf19715 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -26,19 +26,18 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define LOG_NDEBUG 0 +#define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" #include #include #include "LocationAPIClientBase.h" -#define BATCHING_CONF_FILE "/etc/flp.conf" -#define GEOFENCE_SESSION_ID -1 +#define FLP_CONF_FILE "/etc/flp.conf" +#define GEOFENCE_SESSION_ID 0xFFFFFFFF +#define CONFIG_SESSION_ID 0xFFFFFFFF LocationAPIClientBase::LocationAPIClientBase() : - mTrackingCallback(nullptr), - mBatchingCallback(nullptr), mGeofenceBreachCallback(nullptr), mLocationAPI(nullptr), mLocationControlAPI(nullptr), @@ -53,7 +52,7 @@ LocationAPIClientBase::LocationAPIClientBase() : pthread_mutex_init(&mMutex, &attr); for (int i = 0; i < REQUEST_MAX; i++) { - mRequestQueues[i] = nullptr; + mRequestQueues[i].reset(0); } memset(&mConfig, 0, sizeof(GnssConfig)); @@ -112,6 +111,8 @@ LocationAPIClientBase::~LocationAPIClientBase() { pthread_mutex_lock(&mMutex); + mGeofenceBreachCallback = nullptr; + if (mLocationAPI) { mLocationAPI->destroy(); mLocationAPI = nullptr; @@ -122,11 +123,9 @@ LocationAPIClientBase::~LocationAPIClientBase() } for (int i = 0; i < REQUEST_MAX; i++) { - if (mRequestQueues[i]) { - delete mRequestQueues[i]; - mRequestQueues[i] = nullptr; - } + mRequestQueues[i].reset(0); } + pthread_mutex_unlock(&mMutex); pthread_mutex_destroy(&mMutex); @@ -137,19 +136,14 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationAPI) { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_TRACKING] = nullptr; - } uint32_t session = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); // onResponseCb might be called from other thread immediately after // startTracking returns, so we are not going to unlock mutex // until StartTrackingRequest is pushed into mRequestQueues[REQUEST_TRACKING] - requests = new RequestQueue(session); - requests->push(new StartTrackingRequest(*this)); - mRequestQueues[REQUEST_TRACKING] = requests; + mRequestQueues[REQUEST_TRACKING].reset(session); + mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; } @@ -163,13 +157,12 @@ void LocationAPIClientBase::locAPIStopTracking() pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - session = requests->getSession(); - if (session > 0) { - requests->push(new StopTrackingRequest(*this)); - mLocationAPI->stopTracking(session); - } + session = mRequestQueues[REQUEST_TRACKING].getSession(); + if (session > 0) { + mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(session); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } pthread_mutex_unlock(&mMutex); @@ -180,13 +173,12 @@ void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - session = requests->getSession(); - if (session > 0) { - requests->push(new UpdateTrackingOptionsRequest(*this)); - mLocationAPI->updateTrackingOptions(session, options); - } + session = mRequestQueues[REQUEST_TRACKING].getSession(); + if (session > 0) { + mRequestQueues[REQUEST_TRACKING].push(new UpdateTrackingOptionsRequest(*this)); + mLocationAPI->updateTrackingOptions(session, options); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } pthread_mutex_unlock(&mMutex); @@ -195,11 +187,11 @@ void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options int32_t LocationAPIClientBase::locAPIGetBatchSize() { if (mBatchSize == -1) { - const loc_param_s_type batching_conf_param_table[] = + const loc_param_s_type flp_conf_param_table[] = { {"BATCH_SIZE", &mBatchSize, nullptr, 'n'}, }; - UTIL_READ_CONF(BATCHING_CONF_FILE, batching_conf_param_table); + UTIL_READ_CONF(FLP_CONF_FILE, flp_conf_param_table); if (mBatchSize < 0) { // set mBatchSize to 0 if we got an illegal value from config file mBatchSize = 0; @@ -224,27 +216,15 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session uint32_t batchingSession = 0; if (sessionMode == SESSION_MODE_ON_FIX) { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_TRACKING] = nullptr; - } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); - requests = new RequestQueue(trackingSession); - requests->push(new StartTrackingRequest(*this)); - mRequestQueues[REQUEST_TRACKING] = requests; + mRequestQueues[REQUEST_TRACKING].reset(trackingSession); + mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); } else if (sessionMode == SESSION_MODE_ON_FULL) { - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_BATCHING] = nullptr; - } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); - requests = new RequestQueue(batchingSession); - requests->push(new StartBatchingRequest(*this)); - mRequestQueues[REQUEST_BATCHING] = requests; + mRequestQueues[REQUEST_BATCHING].reset(batchingSession); + mRequestQueues[REQUEST_BATCHING].push(new StartBatchingRequest(*this)); } SessionEntity entity; @@ -279,16 +259,20 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) mSessionMap.erase(id); if (sMode == SESSION_MODE_ON_FIX) { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - requests->push(new StopTrackingRequest(*this)); + if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { + mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); mLocationAPI->stopTracking(trackingSession); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_TRACKING].getSession()); } } else if (sMode == SESSION_MODE_ON_FULL) { - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - requests->push(new StopBatchingRequest(*this)); + if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { + mRequestQueues[REQUEST_BATCHING].push(new StopBatchingRequest(*this)); mLocationAPI->stopBatching(batchingSession); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_BATCHING].getSession()); } } @@ -319,67 +303,63 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t if (sessionMode == SESSION_MODE_ON_FIX) { if (sMode == SESSION_MODE_ON_FIX) { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - requests->push(new UpdateTrackingOptionsRequest(*this)); + if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { + mRequestQueues[REQUEST_TRACKING].push(new UpdateTrackingOptionsRequest(*this)); mLocationAPI->updateTrackingOptions(trackingSession, options); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_TRACKING].getSession()); } } else if (sMode == SESSION_MODE_ON_FULL) { // stop batching { - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - requests->push(new StopBatchingRequest(*this)); + if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { + mRequestQueues[REQUEST_BATCHING].push(new StopBatchingRequest(*this)); mLocationAPI->stopBatching(batchingSession); batchingSession = 0; + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_BATCHING].getSession()); } } // start tracking { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_TRACKING] = nullptr; - } trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); - requests = new RequestQueue(trackingSession); - requests->push(new StartTrackingRequest(*this)); - mRequestQueues[REQUEST_TRACKING] = requests; + mRequestQueues[REQUEST_TRACKING].reset(trackingSession); + mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); } } } else if (sessionMode == SESSION_MODE_ON_FULL) { if (sMode == SESSION_MODE_ON_FIX) { // stop tracking { - RequestQueue* requests = mRequestQueues[REQUEST_TRACKING]; - if (requests) { - requests->push(new StopTrackingRequest(*this)); + if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { + mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); mLocationAPI->stopTracking(trackingSession); trackingSession = 0; + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_TRACKING].getSession()); } } // start batching { - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_BATCHING] = nullptr; - } batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); - requests = new RequestQueue(batchingSession); - requests->push(new StartBatchingRequest(*this)); - mRequestQueues[REQUEST_BATCHING] = requests; + mRequestQueues[REQUEST_BATCHING].reset(batchingSession); + mRequestQueues[REQUEST_BATCHING].push(new StartBatchingRequest(*this)); } } else if (sMode == SESSION_MODE_ON_FULL) { - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - requests->push(new UpdateBatchingOptionsRequest(*this)); + if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { + mRequestQueues[REQUEST_BATCHING].push( + new UpdateBatchingOptionsRequest(*this)); mLocationAPI->updateBatchingOptions(batchingSession, options); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_BATCHING].getSession()); } } } @@ -404,13 +384,12 @@ void LocationAPIClientBase::locAPIGetBatchedLocations(size_t count) pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_BATCHING]; - if (requests) { - session = requests->getSession(); - if (session > 0) { - requests->push(new GetBatchedLocationsRequest(*this)); - mLocationAPI->getBatchedLocations(session, count); - } + session = mRequestQueues[REQUEST_BATCHING].getSession(); + if (session > 0) { + mRequestQueues[REQUEST_BATCHING].push(new GetBatchedLocationsRequest(*this)); + mLocationAPI->getBatchedLocations(session, count); + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } pthread_mutex_unlock(&mMutex); @@ -422,17 +401,13 @@ uint32_t LocationAPIClientBase::locAPIAddGeofences( uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationAPI) { - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (!requests) { - // Create a new RequestQueue for Geofenceing if we've not had one. - // The RequestQueue will be released when LocationAPIClientBase is released. - requests = new RequestQueue(GEOFENCE_SESSION_ID); - mRequestQueues[REQUEST_GEOFENCE] = requests; + if (mRequestQueues[REQUEST_GEOFENCE].getSession() != GEOFENCE_SESSION_ID) { + mRequestQueues[REQUEST_GEOFENCE].reset(GEOFENCE_SESSION_ID); } uint32_t* sessions = mLocationAPI->addGeofences(count, options, data); if (sessions) { LOC_LOGI("%s:%d] start new sessions: %p", __FUNCTION__, __LINE__, sessions); - requests->push(new AddGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new AddGeofencesRequest(*this)); for (size_t i = 0; i < count; i++) { mGeofenceBiDict.set(ids[i], sessions[i], options[i].breachTypeMask); @@ -451,8 +426,7 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); @@ -461,9 +435,12 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) } } if (j > 0) { - requests->push(new RemoveGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this)); mLocationAPI->removeGeofences(j, sessions); } + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_GEOFENCE].getSession()); } free(sessions); @@ -478,8 +455,7 @@ void LocationAPIClientBase::locAPIModifyGeofences( if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); @@ -489,9 +465,12 @@ void LocationAPIClientBase::locAPIModifyGeofences( } } if (j > 0) { - requests->push(new ModifyGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new ModifyGeofencesRequest(*this)); mLocationAPI->modifyGeofences(j, sessions, options); } + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_GEOFENCE].getSession()); } free(sessions); @@ -505,8 +484,7 @@ void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); @@ -515,9 +493,12 @@ void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) } } if (j > 0) { - requests->push(new PauseGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new PauseGeofencesRequest(*this)); mLocationAPI->pauseGeofences(j, sessions); } + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_GEOFENCE].getSession()); } free(sessions); @@ -532,8 +513,7 @@ void LocationAPIClientBase::locAPIResumeGeofences( if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); @@ -545,9 +525,12 @@ void LocationAPIClientBase::locAPIResumeGeofences( } } if (j > 0) { - requests->push(new ResumeGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new ResumeGeofencesRequest(*this)); mLocationAPI->resumeGeofences(j, sessions); } + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_GEOFENCE].getSession()); } free(sessions); @@ -563,8 +546,7 @@ void LocationAPIClientBase::locAPIRemoveAllGeofences() size_t count = sessionsVec.size(); uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - RequestQueue* requests = mRequestQueues[REQUEST_GEOFENCE]; - if (requests) { + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; for (size_t i = 0; i < count; i++) { sessions[j] = sessionsVec[i]; @@ -573,9 +555,12 @@ void LocationAPIClientBase::locAPIRemoveAllGeofences() } } if (j > 0) { - requests->push(new RemoveGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this)); mLocationAPI->removeGeofences(j, sessions); } + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, + mRequestQueues[REQUEST_GEOFENCE].getSession()); } free(sessions); @@ -587,17 +572,11 @@ void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse res { pthread_mutex_lock(&mMutex); if (mLocationAPI) { - RequestQueue* requests = mRequestQueues[REQUEST_NIRESPONSE]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_NIRESPONSE] = nullptr; - } uint32_t session = id; mLocationAPI->gnssNiResponse(id, response); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - requests = new RequestQueue(session); - requests->push(new GnssNiResponseRequest(*this)); - mRequestQueues[REQUEST_NIRESPONSE] = requests; + mRequestQueues[REQUEST_NIRESPONSE].reset(session); + mRequestQueues[REQUEST_NIRESPONSE].push(new GnssNiResponseRequest(*this)); } pthread_mutex_unlock(&mMutex); } @@ -607,16 +586,10 @@ uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - RequestQueue* requests = mRequestQueues[REQUEST_DELETEAIDINGDATA]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_DELETEAIDINGDATA] = nullptr; - } uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - requests = new RequestQueue(session); - requests->push(new GnssDeleteAidingDataRequest(*this)); - mRequestQueues[REQUEST_DELETEAIDINGDATA] = requests; + mRequestQueues[REQUEST_DELETEAIDINGDATA].reset(session); + mRequestQueues[REQUEST_DELETEAIDINGDATA].push(new GnssDeleteAidingDataRequest(*this)); retVal = LOCATION_ERROR_SUCCESS; } @@ -633,20 +606,12 @@ uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) // just return success if already enabled retVal = LOCATION_ERROR_SUCCESS; } else if (mLocationControlAPI) { - RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; - if (requests) { - delete requests; - mRequestQueues[REQUEST_CONTROL] = nullptr; - } uint32_t session = mLocationControlAPI->enable(techType); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - requests = new RequestQueue(session); - mRequestQueues[REQUEST_CONTROL] = requests; - if (requests) { - requests->push(new EnableRequest(*this)); - retVal = LOCATION_ERROR_SUCCESS; - mEnabled = true; - } + mRequestQueues[REQUEST_CONTROL].reset(session); + mRequestQueues[REQUEST_CONTROL].push(new EnableRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; + mEnabled = true; } pthread_mutex_unlock(&mMutex); @@ -658,14 +623,13 @@ void LocationAPIClientBase::locAPIDisable() pthread_mutex_lock(&mMutex); if (mEnabled && mLocationControlAPI) { uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_CONTROL]; - if (requests) { - session = requests->getSession(); - if (session > 0) { - requests->push(new DisableRequest(*this)); - mLocationControlAPI->disable(session); - mEnabled = false; - } + session = mRequestQueues[REQUEST_CONTROL].getSession(); + if (session > 0) { + mRequestQueues[REQUEST_CONTROL].push(new DisableRequest(*this)); + mLocationControlAPI->disable(session); + mEnabled = false; + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } pthread_mutex_unlock(&mMutex); @@ -686,15 +650,13 @@ uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) memcpy(&mConfig, &config, sizeof(GnssConfig)); uint32_t session = 0; - RequestQueue* requests = mRequestQueues[REQUEST_CONFIG]; uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); - if (!requests && idArray != nullptr) { - requests = new RequestQueue(idArray[0]); - mRequestQueues[REQUEST_CONFIG] = requests; - } - if (requests) { - requests->push(new GnssUpdateConfigRequest(*this)); + if (idArray != nullptr) { + if (mRequestQueues[REQUEST_CONFIG].getSession() != CONFIG_SESSION_ID) { + mRequestQueues[REQUEST_CONFIG].reset(CONFIG_SESSION_ID); + } + mRequestQueues[REQUEST_CONFIG].push(new GnssUpdateConfigRequest(*this)); retVal = LOCATION_ERROR_SUCCESS; } } @@ -705,30 +667,39 @@ uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) void LocationAPIClientBase::beforeGeofenceBreachCb( GeofenceBreachNotification geofenceBreachNotification) { - if (mGeofenceBreachCallback == nullptr) - return; uint32_t* ids = (uint32_t*)malloc(sizeof(uint32_t) * geofenceBreachNotification.count); uint32_t* backup = geofenceBreachNotification.ids; size_t n = geofenceBreachNotification.count; + geofenceBreachCallback genfenceCallback = nullptr; - size_t count = 0; - for (size_t i = 0; i < n; i++) { - uint32_t id = mGeofenceBiDict.getId(geofenceBreachNotification.ids[i]); - GeofenceBreachTypeMask type = mGeofenceBiDict.getType(geofenceBreachNotification.ids[i]); - // if type == 0, we will not head into the fllowing block anyway. - // so we don't need to check id and type - if ((geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER && - (type & GEOFENCE_BREACH_ENTER_BIT)) || - (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT && - (type & GEOFENCE_BREACH_EXIT_BIT)) - ) { - ids[count] = id; - count++; + pthread_mutex_lock(&mMutex); + if (mGeofenceBreachCallback != nullptr) { + size_t count = 0; + for (size_t i = 0; i < n; i++) { + uint32_t id = mGeofenceBiDict.getId(geofenceBreachNotification.ids[i]); + GeofenceBreachTypeMask type = + mGeofenceBiDict.getType(geofenceBreachNotification.ids[i]); + // if type == 0, we will not head into the fllowing block anyway. + // so we don't need to check id and type + if ((geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER && + (type & GEOFENCE_BREACH_ENTER_BIT)) || + (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT && + (type & GEOFENCE_BREACH_EXIT_BIT)) + ) { + ids[count] = id; + count++; + } } + geofenceBreachNotification.count = count; + geofenceBreachNotification.ids = ids; + + genfenceCallback = mGeofenceBreachCallback; + } + pthread_mutex_unlock(&mMutex); + + if (genfenceCallback != nullptr) { + genfenceCallback(geofenceBreachNotification); } - geofenceBreachNotification.count = count; - geofenceBreachNotification.ids = ids; - mGeofenceBreachCallback(geofenceBreachNotification); // restore ids geofenceBreachNotification.ids = backup; @@ -762,8 +733,8 @@ void LocationAPIClientBase::onCollectiveResponseCb( } LocationAPIRequest* request = nullptr; pthread_mutex_lock(&mMutex); - if (mRequestQueues[REQUEST_GEOFENCE] != nullptr) { - request = mRequestQueues[REQUEST_GEOFENCE]->pop(); + if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { + request = mRequestQueues[REQUEST_GEOFENCE].pop(); } pthread_mutex_unlock(&mMutex); if (request) { @@ -798,8 +769,8 @@ void LocationAPIClientBase::onCtrlCollectiveResponseCb( } LocationAPIRequest* request = nullptr; pthread_mutex_lock(&mMutex); - if (mRequestQueues[REQUEST_CONFIG] != nullptr) { - request = mRequestQueues[REQUEST_CONFIG]->pop(); + if (mRequestQueues[REQUEST_CONFIG].getSession() == CONFIG_SESSION_ID) { + request = mRequestQueues[REQUEST_CONFIG].pop(); } pthread_mutex_unlock(&mMutex); if (request) { @@ -816,9 +787,8 @@ LocationAPIClientBase::getRequestBySession(uint32_t session) for (int i = 0; i < REQUEST_MAX; i++) { if (i != REQUEST_GEOFENCE && i != REQUEST_CONFIG && - mRequestQueues[i] && - mRequestQueues[i]->getSession() == session) { - request = mRequestQueues[i]->pop(); + mRequestQueues[i].getSession() == session) { + request = mRequestQueues[i].pop(); break; } } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 0805d7c9..144f99c4 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -159,7 +159,7 @@ private: BiDict() { pthread_mutex_init(&mBiDictMutex, nullptr); } - ~BiDict() { + virtual ~BiDict() { pthread_mutex_destroy(&mBiDictMutex); } bool hasId(uint32_t id) { @@ -249,9 +249,9 @@ private: public: LocationAPIRequest(LocationAPIClientBase& API) : mAPI(API) {} virtual ~LocationAPIRequest() {} - virtual void onResponse(LocationError /*error*/) {}; + virtual void onResponse(LocationError /*error*/) {} virtual void onCollectiveResponse( - size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {}; + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} LocationAPIClientBase& mAPI; }; @@ -419,15 +419,19 @@ private: class RequestQueue { public: - RequestQueue(uint32_t session): mSession(session) { + RequestQueue(): mSession(0) { } - ~RequestQueue() { + virtual ~RequestQueue() { + reset(0); + } + void reset(uint32_t session) { LocationAPIRequest* request = nullptr; while (!mQueue.empty()) { request = mQueue.front(); mQueue.pop(); delete request; } + mSession = session; } void push(LocationAPIRequest* request) { mQueue.push(request); @@ -451,15 +455,13 @@ private: private: pthread_mutex_t mMutex; - trackingCallback mTrackingCallback; - batchingCallback mBatchingCallback; geofenceBreachCallback mGeofenceBreachCallback; LocationAPI* mLocationAPI; LocationControlAPI* mLocationControlAPI; + RequestQueue mRequestQueues[REQUEST_MAX]; BiDict mGeofenceBiDict; - RequestQueue* mRequestQueues[REQUEST_MAX]; std::map mSessionMap; int32_t mBatchSize; bool mEnabled; From 1a128bd7cdcaecd2ba0528dd4e5fa396f3e49662 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 21 Jun 2017 17:46:23 +0800 Subject: [PATCH 528/945] Split control apis to a separate class Move control apis to LocationAPIControlClient. There should be only one instance of it per process. Change-Id: I5969e6b3ad45f3fc5bfe4f4cd543a077c540c3ea CRs-Fixed: 2064389 --- android/AGnssRil.cpp | 2 +- android/Gnss.cpp | 6 +- android/location_api/GnssAPIClient.cpp | 104 +++++--- android/location_api/GnssAPIClient.h | 7 +- location/LocationAPIClientBase.cpp | 335 ++++++++++++++----------- location/LocationAPIClientBase.h | 261 ++++++++++--------- 6 files changed, 413 insertions(+), 302 deletions(-) diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index b19f55f5..ec3dd761 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -47,7 +47,7 @@ AGnssRil::~AGnssRil() { ENTRY_LOG_CALLFLOW(); } -Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool roaming) { +Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { ENTRY_LOG_CALLFLOW(); // for XTRA diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 9b2e7ddc..e3fd64ee 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -120,7 +120,7 @@ Return Gnss::setCallback(const sp& callback) { GnssAPIClient* api = getApi(); if (api != nullptr) { api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); - api->locAPIEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); api->requestCapabilities(); } return true; @@ -140,7 +140,7 @@ Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { ENTRY_LOG_CALLFLOW(); GnssAPIClient* api = getApi(); if (api) { - api->locAPIGnssUpdateConfig(gnssConfig); + api->gnssConfigurationUpdate(gnssConfig); } else if (gnssConfig.flags != 0) { // api is not ready yet, update mPendingConfig with gnssConfig mPendingConfig.size = sizeof(GnssConfig); @@ -220,7 +220,7 @@ Return Gnss::cleanup() { ENTRY_LOG_CALLFLOW(); if (mApi != nullptr) { - mApi->locAPIDisable(); + mApi->gnssDisable(); } return Void(); diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 852edfb3..af2998de 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -50,6 +50,7 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb, LocationAPIClientBase(), mGnssCbIface(nullptr), mGnssNiCbIface(nullptr), + mControlClient(new LocationAPIControlClient()), mLocationCapabilitiesMask(0), mLocationCapabilitiesCached(false) { @@ -68,6 +69,10 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb, GnssAPIClient::~GnssAPIClient() { LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient) { + delete mControlClient; + mControlClient = nullptr; + } } // for GpsInterface @@ -142,9 +147,56 @@ bool GnssAPIClient::gnssStop() return retVal; } +bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) +{ + LOC_LOGD("%s]: (%d %d %d %d %d)", __FUNCTION__, + (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, preferredTimeMs); + bool retVal = true; + memset(&mLocationOptions, 0, sizeof(LocationOptions)); + mLocationOptions.size = sizeof(LocationOptions); + mLocationOptions.minInterval = minIntervalMs; + mLocationOptions.minDistance = preferredAccuracyMeters; + if (mode == IGnss::GnssPositionMode::STANDALONE) + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + else if (mode == IGnss::GnssPositionMode::MS_BASED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) + mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + else { + LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, mode); + retVal = false; + } + return retVal; +} + +// for GpsNiInterface +void GnssAPIClient::gnssNiRespond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); + GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; + if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT) + data = GNSS_NI_RESPONSE_ACCEPT; + else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY) + data = GNSS_NI_RESPONSE_DENY; + else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) + data = GNSS_NI_RESPONSE_NO_RESPONSE; + else { + LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, userResponse); + return; + } + locAPIGnssNiResponse(notifId, data); +} + +// these apis using LocationAPIControlClient void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) { LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags); + if (mControlClient == nullptr) { + return; + } GnssAidingData data; memset(&data, 0, sizeof (GnssAidingData)); data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT | @@ -181,50 +233,34 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO) data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT; } - locAPIGnssDeleteAidingData(data); + mControlClient->locAPIGnssDeleteAidingData(data); } -bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, - IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, - uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) +void GnssAPIClient::gnssEnable(LocationTechnologyType techType) { - LOC_LOGD("%s]: (%d %d %d %d %d)", __FUNCTION__, - (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, preferredTimeMs); - bool retVal = true; - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = minIntervalMs; - mLocationOptions.minDistance = preferredAccuracyMeters; - if (mode == IGnss::GnssPositionMode::STANDALONE) - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; - else if (mode == IGnss::GnssPositionMode::MS_BASED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSB; - else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSA; - locAPIUpdateTrackingOptions(mLocationOptions); - return retVal; + LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIEnable(techType); } -// for GpsNiInterface -void GnssAPIClient::gnssNiRespond(int32_t notifId, - IGnssNiCallback::GnssUserResponseType userResponse) +void GnssAPIClient::gnssDisable() { - LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); - GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; - if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT) - data = GNSS_NI_RESPONSE_ACCEPT; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY) - data = GNSS_NI_RESPONSE_DENY; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) - data = GNSS_NI_RESPONSE_NO_RESPONSE; - locAPIGnssNiResponse(notifId, data); + LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIDisable(); } -// for GnssConfigurationInterface void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig) { LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags); - locAPIGnssUpdateConfig(gnssConfig); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIGnssUpdateConfig(gnssConfig); } void GnssAPIClient::requestCapabilities() { @@ -385,7 +421,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) auto r = mGnssCbIface->gnssNmeaCb( static_cast(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%u description=%s", __func__, + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); } } diff --git a/android/location_api/GnssAPIClient.h b/android/location_api/GnssAPIClient.h index d447157a..295a9e9b 100644 --- a/android/location_api/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -58,7 +58,6 @@ public: const sp& niCb); bool gnssStart(); bool gnssStop(); - void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags); bool gnssSetPositionMode(IGnss::GnssPositionMode mode, IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, @@ -68,7 +67,10 @@ public: // for GpsNiInterface void gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse); - // for GnssConfigurationInterface + // these apis using LocationAPIControlClient + void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags); + void gnssEnable(LocationTechnologyType techType); + void gnssDisable(); void gnssConfigurationUpdate(const GnssConfig& gnssConfig); inline LocationCapabilitiesMask gnssGetCapabilities() const { @@ -90,6 +92,7 @@ private: sp mGnssCbIface; sp mGnssNiCbIface; + LocationAPIControlClient* mControlClient; LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index dcf19715..bf1a8ad1 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -37,12 +37,192 @@ #define GEOFENCE_SESSION_ID 0xFFFFFFFF #define CONFIG_SESSION_ID 0xFFFFFFFF +// LocationAPIControlClient +LocationAPIControlClient::LocationAPIControlClient() : + mEnabled(false) +{ + pthread_mutex_init(&mMutex, nullptr); + + for (int i = 0; i < CTRL_REQUEST_MAX; i++) { + mRequestQueues[i].reset(0); + } + + memset(&mConfig, 0, sizeof(GnssConfig)); + + LocationControlCallbacks locationControlCallbacks; + locationControlCallbacks.size = sizeof(LocationControlCallbacks); + + locationControlCallbacks.responseCb = + [this](LocationError error, uint32_t id) { + onCtrlResponseCb(error, id); + }; + locationControlCallbacks.collectiveResponseCb = + [this](size_t count, LocationError* errors, uint32_t* ids) { + onCtrlCollectiveResponseCb(count, errors, ids); + }; + + mLocationControlAPI = LocationControlAPI::createInstance(locationControlCallbacks); +} + +LocationAPIControlClient::~LocationAPIControlClient() +{ + pthread_mutex_lock(&mMutex); + + if (mLocationControlAPI) { + mLocationControlAPI->destroy(); + mLocationControlAPI = nullptr; + } + + for (int i = 0; i < CTRL_REQUEST_MAX; i++) { + mRequestQueues[i].reset(0); + } + + pthread_mutex_unlock(&mMutex); + + pthread_mutex_destroy(&mMutex); +} + +uint32_t LocationAPIControlClient::locAPIGnssDeleteAidingData(GnssAidingData& data) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); + if (mLocationControlAPI) { + uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + mRequestQueues[CTRL_REQUEST_DELETEAIDINGDATA].reset(session); + mRequestQueues[CTRL_REQUEST_DELETEAIDINGDATA].push(new GnssDeleteAidingDataRequest(*this)); + + retVal = LOCATION_ERROR_SUCCESS; + } + pthread_mutex_unlock(&mMutex); + + return retVal; +} + +uint32_t LocationAPIControlClient::locAPIEnable(LocationTechnologyType techType) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + pthread_mutex_lock(&mMutex); + if (mEnabled) { + // just return success if already enabled + retVal = LOCATION_ERROR_SUCCESS; + } else if (mLocationControlAPI) { + uint32_t session = mLocationControlAPI->enable(techType); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + mRequestQueues[CTRL_REQUEST_CONTROL].reset(session); + mRequestQueues[CTRL_REQUEST_CONTROL].push(new EnableRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; + mEnabled = true; + } else { + LOC_LOGE("%s:%d] failed.", __FUNCTION__, __LINE__); + } + pthread_mutex_unlock(&mMutex); + + return retVal; +} + +void LocationAPIControlClient::locAPIDisable() +{ + pthread_mutex_lock(&mMutex); + if (mEnabled && mLocationControlAPI) { + uint32_t session = 0; + session = mRequestQueues[CTRL_REQUEST_CONTROL].getSession(); + if (session > 0) { + mRequestQueues[CTRL_REQUEST_CONTROL].push(new DisableRequest(*this)); + mLocationControlAPI->disable(session); + mEnabled = false; + } else { + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); + } + } + pthread_mutex_unlock(&mMutex); +} + +uint32_t LocationAPIControlClient::locAPIGnssUpdateConfig(GnssConfig config) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; + if (memcmp(&mConfig, &config, sizeof(GnssConfig)) == 0) { + LOC_LOGV("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); + retVal = LOCATION_ERROR_SUCCESS; + return retVal; + } + + pthread_mutex_lock(&mMutex); + if (mLocationControlAPI) { + + memcpy(&mConfig, &config, sizeof(GnssConfig)); + + uint32_t session = 0; + uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); + LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); + if (idArray != nullptr) { + if (mRequestQueues[CTRL_REQUEST_CONFIG].getSession() != CONFIG_SESSION_ID) { + mRequestQueues[CTRL_REQUEST_CONFIG].reset(CONFIG_SESSION_ID); + } + mRequestQueues[CTRL_REQUEST_CONFIG].push(new GnssUpdateConfigRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; + } + } + pthread_mutex_unlock(&mMutex); + return retVal; +} + +void LocationAPIControlClient::onCtrlResponseCb(LocationError error, uint32_t id) +{ + if (error != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, error, id); + } else { + LOC_LOGV("%s:%d] SUCCESS: %d id: %d", __FUNCTION__, __LINE__, error, id); + } + LocationAPIRequest* request = getRequestBySession(id); + if (request) { + request->onResponse(error); + delete request; + } +} + +void LocationAPIControlClient::onCtrlCollectiveResponseCb( + size_t count, LocationError* errors, uint32_t* ids) +{ + for (size_t i = 0; i < count; i++) { + if (errors[i] != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } else { + LOC_LOGV("%s:%d] SUCCESS: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + } + } + LocationAPIRequest* request = nullptr; + pthread_mutex_lock(&mMutex); + if (mRequestQueues[CTRL_REQUEST_CONFIG].getSession() == CONFIG_SESSION_ID) { + request = mRequestQueues[CTRL_REQUEST_CONFIG].pop(); + } + pthread_mutex_unlock(&mMutex); + if (request) { + request->onCollectiveResponse(count, errors, ids); + delete request; + } +} + +LocationAPIRequest* LocationAPIControlClient::getRequestBySession(uint32_t session) +{ + pthread_mutex_lock(&mMutex); + LocationAPIRequest* request = nullptr; + for (int i = 0; i < CTRL_REQUEST_MAX; i++) { + if (i != CTRL_REQUEST_CONFIG && + mRequestQueues[i].getSession() == session) { + request = mRequestQueues[i].pop(); + break; + } + } + pthread_mutex_unlock(&mMutex); + return request; +} + +// LocationAPIClientBase LocationAPIClientBase::LocationAPIClientBase() : mGeofenceBreachCallback(nullptr), mLocationAPI(nullptr), - mLocationControlAPI(nullptr), - mBatchSize(-1), - mEnabled(false) + mBatchSize(-1) { // use recursive mutex, in case callback come from the same thread @@ -54,8 +234,6 @@ LocationAPIClientBase::LocationAPIClientBase() : for (int i = 0; i < REQUEST_MAX; i++) { mRequestQueues[i].reset(0); } - - memset(&mConfig, 0, sizeof(GnssConfig)); } void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallbacks) @@ -88,22 +266,6 @@ void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallba mLocationAPI->updateCallbacks(locationCallbacks); } - if (mLocationControlAPI == nullptr) { - LocationControlCallbacks locationControlCallbacks; - locationControlCallbacks.size = sizeof(LocationControlCallbacks); - - locationControlCallbacks.responseCb = - [this](LocationError error, uint32_t id) { - onCtrlResponseCb(error, id); - }; - locationControlCallbacks.collectiveResponseCb = - [this](size_t count, LocationError* errors, uint32_t* ids) { - onCtrlCollectiveResponseCb(count, errors, ids); - }; - - mLocationControlAPI = LocationControlAPI::createInstance(locationControlCallbacks); - } - pthread_mutex_unlock(&mMutex); } @@ -117,10 +279,6 @@ LocationAPIClientBase::~LocationAPIClientBase() mLocationAPI->destroy(); mLocationAPI = nullptr; } - if (mLocationControlAPI) { - mLocationControlAPI->destroy(); - mLocationControlAPI = nullptr; - } for (int i = 0; i < REQUEST_MAX; i++) { mRequestQueues[i].reset(0); @@ -581,89 +739,6 @@ void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse res pthread_mutex_unlock(&mMutex); } -uint32_t LocationAPIClientBase::locAPIGnssDeleteAidingData(GnssAidingData& data) -{ - uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; - pthread_mutex_lock(&mMutex); - if (mLocationControlAPI) { - uint32_t session = mLocationControlAPI->gnssDeleteAidingData(data); - LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - mRequestQueues[REQUEST_DELETEAIDINGDATA].reset(session); - mRequestQueues[REQUEST_DELETEAIDINGDATA].push(new GnssDeleteAidingDataRequest(*this)); - - retVal = LOCATION_ERROR_SUCCESS; - } - pthread_mutex_unlock(&mMutex); - - return retVal; -} - -uint32_t LocationAPIClientBase::locAPIEnable(LocationTechnologyType techType) -{ - uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; - pthread_mutex_lock(&mMutex); - if (mEnabled) { - // just return success if already enabled - retVal = LOCATION_ERROR_SUCCESS; - } else if (mLocationControlAPI) { - uint32_t session = mLocationControlAPI->enable(techType); - LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - mRequestQueues[REQUEST_CONTROL].reset(session); - mRequestQueues[REQUEST_CONTROL].push(new EnableRequest(*this)); - retVal = LOCATION_ERROR_SUCCESS; - mEnabled = true; - } - pthread_mutex_unlock(&mMutex); - - return retVal; -} - -void LocationAPIClientBase::locAPIDisable() -{ - pthread_mutex_lock(&mMutex); - if (mEnabled && mLocationControlAPI) { - uint32_t session = 0; - session = mRequestQueues[REQUEST_CONTROL].getSession(); - if (session > 0) { - mRequestQueues[REQUEST_CONTROL].push(new DisableRequest(*this)); - mLocationControlAPI->disable(session); - mEnabled = false; - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); - } - } - pthread_mutex_unlock(&mMutex); -} - -uint32_t LocationAPIClientBase::locAPIGnssUpdateConfig(GnssConfig config) -{ - uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; - if (memcmp(&mConfig, &config, sizeof(GnssConfig)) == 0) { - LOC_LOGV("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); - retVal = LOCATION_ERROR_SUCCESS; - return retVal; - } - - pthread_mutex_lock(&mMutex); - if (mLocationControlAPI) { - - memcpy(&mConfig, &config, sizeof(GnssConfig)); - - uint32_t session = 0; - uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); - LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); - if (idArray != nullptr) { - if (mRequestQueues[REQUEST_CONFIG].getSession() != CONFIG_SESSION_ID) { - mRequestQueues[REQUEST_CONFIG].reset(CONFIG_SESSION_ID); - } - mRequestQueues[REQUEST_CONFIG].push(new GnssUpdateConfigRequest(*this)); - retVal = LOCATION_ERROR_SUCCESS; - } - } - pthread_mutex_unlock(&mMutex); - return retVal; -} - void LocationAPIClientBase::beforeGeofenceBreachCb( GeofenceBreachNotification geofenceBreachNotification) { @@ -712,7 +787,7 @@ void LocationAPIClientBase::onResponseCb(LocationError error, uint32_t id) if (error != LOCATION_ERROR_SUCCESS) { LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, error, id); } else { - LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, error, id); + LOC_LOGV("%s:%d] SUCCESS: %d id: %d", __FUNCTION__, __LINE__, error, id); } LocationAPIRequest* request = getRequestBySession(id); if (request) { @@ -728,7 +803,7 @@ void LocationAPIClientBase::onCollectiveResponseCb( if (errors[i] != LOCATION_ERROR_SUCCESS) { LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); } else { - LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); + LOC_LOGV("%s:%d] SUCCESS: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); } } LocationAPIRequest* request = nullptr; @@ -743,50 +818,12 @@ void LocationAPIClientBase::onCollectiveResponseCb( } } -void LocationAPIClientBase::onCtrlResponseCb(LocationError error, uint32_t id) -{ - if (error != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, error, id); - } else { - LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, error, id); - } - LocationAPIRequest* request = getRequestBySession(id); - if (request) { - request->onResponse(error); - delete request; - } -} - -void LocationAPIClientBase::onCtrlCollectiveResponseCb( - size_t count, LocationError* errors, uint32_t* ids) -{ - for (size_t i = 0; i < count; i++) { - if (errors[i] != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s:%d] ERROR: %d ID: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); - } else { - LOC_LOGV("%s:%d] error: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); - } - } - LocationAPIRequest* request = nullptr; - pthread_mutex_lock(&mMutex); - if (mRequestQueues[REQUEST_CONFIG].getSession() == CONFIG_SESSION_ID) { - request = mRequestQueues[REQUEST_CONFIG].pop(); - } - pthread_mutex_unlock(&mMutex); - if (request) { - request->onCollectiveResponse(count, errors, ids); - delete request; - } -} - -LocationAPIClientBase::LocationAPIRequest* -LocationAPIClientBase::getRequestBySession(uint32_t session) +LocationAPIRequest* LocationAPIClientBase::getRequestBySession(uint32_t session) { pthread_mutex_lock(&mMutex); LocationAPIRequest* request = nullptr; for (int i = 0; i < REQUEST_MAX; i++) { if (i != REQUEST_GEOFENCE && - i != REQUEST_CONFIG && mRequestQueues[i].getSession() == session) { request = mRequestQueues[i].pop(); break; diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 144f99c4..354e51ff 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -48,14 +48,130 @@ enum REQUEST_TYPE { REQUEST_BATCHING, REQUEST_GEOFENCE, REQUEST_NIRESPONSE, - REQUEST_DELETEAIDINGDATA, - REQUEST_CONTROL, - REQUEST_CONFIG, REQUEST_MAX, }; -class LocationAPIClientBase -{ +enum CTRL_REQUEST_TYPE { + CTRL_REQUEST_DELETEAIDINGDATA = 0, + CTRL_REQUEST_CONTROL, + CTRL_REQUEST_CONFIG, + CTRL_REQUEST_MAX, +}; + +class LocationAPIClientBase; + +class LocationAPIRequest { +public: + LocationAPIRequest() {} + virtual ~LocationAPIRequest() {} + virtual void onResponse(LocationError /*error*/) {} + virtual void onCollectiveResponse( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} +}; + +class RequestQueue { +public: + RequestQueue(): mSession(0) { + } + virtual ~RequestQueue() { + reset(0); + } + void reset(uint32_t session) { + LocationAPIRequest* request = nullptr; + while (!mQueue.empty()) { + request = mQueue.front(); + mQueue.pop(); + delete request; + } + mSession = session; + } + void push(LocationAPIRequest* request) { + mQueue.push(request); + } + LocationAPIRequest* pop() { + LocationAPIRequest* request = nullptr; + if (!mQueue.empty()) { + request = mQueue.front(); + mQueue.pop(); + } + return request; + } + uint32_t getSession() { return mSession; } +private: + uint32_t mSession; + std::queue mQueue; +}; + +class LocationAPIControlClient { +public: + LocationAPIControlClient(); + virtual ~LocationAPIControlClient(); + LocationAPIControlClient(const LocationAPIControlClient&) = delete; + LocationAPIControlClient& operator=(const LocationAPIControlClient&) = delete; + + LocationAPIRequest* getRequestBySession(uint32_t session); + + // LocationControlAPI + uint32_t locAPIGnssDeleteAidingData(GnssAidingData& data); + uint32_t locAPIEnable(LocationTechnologyType techType); + void locAPIDisable(); + uint32_t locAPIGnssUpdateConfig(GnssConfig config); + + // callbacks + void onCtrlResponseCb(LocationError error, uint32_t id); + void onCtrlCollectiveResponseCb(size_t count, LocationError* errors, uint32_t* ids); + + inline virtual void onGnssDeleteAidingDataCb(LocationError /*error*/) {} + inline virtual void onEnableCb(LocationError /*error*/) {} + inline virtual void onDisableCb(LocationError /*error*/) {} + inline virtual void onGnssUpdateConfigCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + + class GnssDeleteAidingDataRequest : public LocationAPIRequest { + public: + GnssDeleteAidingDataRequest(LocationAPIControlClient& API) : mAPI(API) {} + inline void onResponse(LocationError error) { + mAPI.onGnssDeleteAidingDataCb(error); + } + LocationAPIControlClient& mAPI; + }; + + class EnableRequest : public LocationAPIRequest { + public: + EnableRequest(LocationAPIControlClient& API) : mAPI(API) {} + inline void onResponse(LocationError error) { + mAPI.onEnableCb(error); + } + LocationAPIControlClient& mAPI; + }; + + class DisableRequest : public LocationAPIRequest { + public: + DisableRequest(LocationAPIControlClient& API) : mAPI(API) {} + inline void onResponse(LocationError error) { + mAPI.onDisableCb(error); + } + LocationAPIControlClient& mAPI; + }; + + class GnssUpdateConfigRequest : public LocationAPIRequest { + public: + GnssUpdateConfigRequest(LocationAPIControlClient& API) : mAPI(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* ids) { + mAPI.onGnssUpdateConfigCb(count, errors, ids); + } + LocationAPIControlClient& mAPI; + }; + +private: + pthread_mutex_t mMutex; + LocationControlAPI* mLocationControlAPI; + RequestQueue mRequestQueues[CTRL_REQUEST_MAX]; + bool mEnabled; + GnssConfig mConfig; +}; + +class LocationAPIClientBase { public: LocationAPIClientBase(); virtual ~LocationAPIClientBase(); @@ -63,6 +179,7 @@ public: LocationAPIClientBase& operator=(const LocationAPIClientBase&) = delete; void locAPISetCallbacks(LocationCallbacks& locationCallbacks); + LocationAPIRequest* getRequestBySession(uint32_t session); // LocationAPI uint32_t locAPIStartTracking(LocationOptions& options); @@ -86,19 +203,11 @@ public: void locAPIRemoveAllGeofences(); void locAPIGnssNiResponse(uint32_t id, GnssNiResponse response); - uint32_t locAPIGnssDeleteAidingData(GnssAidingData& data); - - uint32_t locAPIEnable(LocationTechnologyType techType); - void locAPIDisable(); - uint32_t locAPIGnssUpdateConfig(GnssConfig config); // callbacks void onResponseCb(LocationError error, uint32_t id); void onCollectiveResponseCb(size_t count, LocationError* errors, uint32_t* ids); - void onCtrlResponseCb(LocationError error, uint32_t id); - void onCtrlCollectiveResponseCb(size_t count, LocationError* errors, uint32_t* ids); - void beforeGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification); inline virtual void onCapabilitiesCb(LocationCapabilitiesMask /*capabilitiesMask*/) {} @@ -138,12 +247,6 @@ public: inline virtual void onGnssNiCb(uint32_t /*id*/, GnssNiNotification /*gnssNiNotification*/) {} inline virtual void onGnssNiResponseCb(LocationError /*error*/) {} - inline virtual void onGnssDeleteAidingDataCb(LocationError /*error*/) {} - - inline virtual void onEnableCb(LocationError /*error*/) {} - inline virtual void onDisableCb(LocationError /*error*/) {} - inline virtual void onGnssUpdateConfigCb( - size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} private: // private inner classes @@ -245,75 +348,72 @@ private: std::map mTypeMap; }; - class LocationAPIRequest { - public: - LocationAPIRequest(LocationAPIClientBase& API) : mAPI(API) {} - virtual ~LocationAPIRequest() {} - virtual void onResponse(LocationError /*error*/) {} - virtual void onCollectiveResponse( - size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} - LocationAPIClientBase& mAPI; - }; - class StartTrackingRequest : public LocationAPIRequest { public: - StartTrackingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + StartTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onStartTrackingCb(error); } + LocationAPIClientBase& mAPI; }; class StopTrackingRequest : public LocationAPIRequest { public: - StopTrackingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + StopTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onStopTrackingCb(error); } + LocationAPIClientBase& mAPI; }; class UpdateTrackingOptionsRequest : public LocationAPIRequest { public: - UpdateTrackingOptionsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + UpdateTrackingOptionsRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onUpdateTrackingOptionsCb(error); } + LocationAPIClientBase& mAPI; }; class StartBatchingRequest : public LocationAPIRequest { public: - StartBatchingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + StartBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onStartBatchingCb(error); } + LocationAPIClientBase& mAPI; }; class StopBatchingRequest : public LocationAPIRequest { public: - StopBatchingRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + StopBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onStopBatchingCb(error); } + LocationAPIClientBase& mAPI; }; class UpdateBatchingOptionsRequest : public LocationAPIRequest { public: - UpdateBatchingOptionsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + UpdateBatchingOptionsRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onUpdateBatchingOptionsCb(error); } + LocationAPIClientBase& mAPI; }; class GetBatchedLocationsRequest : public LocationAPIRequest { public: - GetBatchedLocationsRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + GetBatchedLocationsRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onGetBatchedLocationsCb(error); } + LocationAPIClientBase& mAPI; }; class AddGeofencesRequest : public LocationAPIRequest { public: - AddGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + AddGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); for (size_t i = 0; i < count; i++) { @@ -322,11 +422,12 @@ private: mAPI.onAddGeofencesCb(count, errors, ids); free(ids); } + LocationAPIClientBase& mAPI; }; class RemoveGeofencesRequest : public LocationAPIRequest { public: - RemoveGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + RemoveGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); for (size_t i = 0; i < count; i++) { @@ -336,11 +437,12 @@ private: mAPI.onRemoveGeofencesCb(count, errors, ids); free(ids); } + LocationAPIClientBase& mAPI; }; class ModifyGeofencesRequest : public LocationAPIRequest { public: - ModifyGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + ModifyGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); for (size_t i = 0; i < count; i++) { @@ -349,11 +451,12 @@ private: mAPI.onModifyGeofencesCb(count, errors, ids); free(ids); } + LocationAPIClientBase& mAPI; }; class PauseGeofencesRequest : public LocationAPIRequest { public: - PauseGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + PauseGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); for (size_t i = 0; i < count; i++) { @@ -362,11 +465,12 @@ private: mAPI.onPauseGeofencesCb(count, errors, ids); free(ids); } + LocationAPIClientBase& mAPI; }; class ResumeGeofencesRequest : public LocationAPIRequest { public: - ResumeGeofencesRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + ResumeGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); for (size_t i = 0; i < count; i++) { @@ -375,98 +479,29 @@ private: mAPI.onResumeGeofencesCb(count, errors, ids); free(ids); } + LocationAPIClientBase& mAPI; }; class GnssNiResponseRequest : public LocationAPIRequest { public: - GnssNiResponseRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} + GnssNiResponseRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onResponse(LocationError error) { mAPI.onGnssNiResponseCb(error); } + LocationAPIClientBase& mAPI; }; - class GnssDeleteAidingDataRequest : public LocationAPIRequest { - public: - GnssDeleteAidingDataRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} - inline void onResponse(LocationError error) { - mAPI.onGnssDeleteAidingDataCb(error); - } - }; - - class EnableRequest : public LocationAPIRequest { - public: - EnableRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} - inline void onResponse(LocationError error) { - mAPI.onEnableCb(error); - } - }; - - class DisableRequest : public LocationAPIRequest { - public: - DisableRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} - inline void onResponse(LocationError error) { - mAPI.onDisableCb(error); - } - }; - - class GnssUpdateConfigRequest : public LocationAPIRequest { - public: - GnssUpdateConfigRequest(LocationAPIClientBase& API) : LocationAPIRequest(API) {} - inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* ids) { - mAPI.onGnssUpdateConfigCb(count, errors, ids); - } - }; - - class RequestQueue { - public: - RequestQueue(): mSession(0) { - } - virtual ~RequestQueue() { - reset(0); - } - void reset(uint32_t session) { - LocationAPIRequest* request = nullptr; - while (!mQueue.empty()) { - request = mQueue.front(); - mQueue.pop(); - delete request; - } - mSession = session; - } - void push(LocationAPIRequest* request) { - mQueue.push(request); - } - LocationAPIRequest* pop() { - LocationAPIRequest* request = nullptr; - if (!mQueue.empty()) { - request = mQueue.front(); - mQueue.pop(); - } - return request; - } - uint32_t getSession() { return mSession; } - private: - uint32_t mSession; - std::queue mQueue; - }; - - LocationAPIRequest* getRequestBySession(uint32_t session); - private: pthread_mutex_t mMutex; geofenceBreachCallback mGeofenceBreachCallback; LocationAPI* mLocationAPI; - LocationControlAPI* mLocationControlAPI; RequestQueue mRequestQueues[REQUEST_MAX]; BiDict mGeofenceBiDict; std::map mSessionMap; int32_t mBatchSize; - bool mEnabled; - - GnssConfig mConfig; }; #endif /* LOCATION_API_CLINET_BASE_H */ From dc29f91ec62c028866c595a1eae622ab04b42f2b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 26 Jun 2017 17:59:41 -0700 Subject: [PATCH 529/945] Removing header copying to out folder Replace copying header files to out folder for use by other modules to instead build headers into separate libraries that end with _headers that can be used by other modules. Change-Id: I073967cd34e5c79110895908a4eef1b7d17bf9ea CRs-fixed: 2068129 --- android/Android.mk | 22 +++++++------ core/Android.mk | 25 ++++++--------- gnss/Android.mk | 10 +++--- location/Android.mk | 15 +++++---- utils/Android.mk | 31 +++++-------------- .../loc_pla/src/Android.mk | 23 ++++++-------- .../loc_stub/src/Android.mk | 15 ++++----- 7 files changed, 57 insertions(+), 84 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index d3e33ab2..58d30f0d 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -24,11 +24,12 @@ LOCAL_SRC_FILES += \ location_api/MeasurementAPIClient.cpp \ LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/location_api \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libloc_pla \ - $(TARGET_OUT_HEADERS)/liblocation_api \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers LOCAL_SHARED_LIBRARIES := \ liblog \ @@ -64,11 +65,12 @@ LOCAL_SRC_FILES := \ service.cpp \ LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/location_api \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libloc_pla \ - $(TARGET_OUT_HEADERS)/liblocation_api \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers LOCAL_SHARED_LIBRARIES := \ diff --git a/core/Android.mk b/core/Android.mk index 313ee25d..cc993334 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -37,24 +37,17 @@ LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_pla \ - $(TARGET_OUT_HEADERS)/liblocation_api - -LOCAL_COPY_HEADERS_TO:= libloc_core/ -LOCAL_COPY_HEADERS:= \ - LocApiBase.h \ - LocAdapterBase.h \ - ContextBase.h \ - LocDualContext.h \ - LBSProxyBase.h \ - UlpProxyBase.h \ - loc_core_log.h \ - LocAdapterProxyBase.h \ - SystemStatus.h +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_pla_headers \ + liblocation_api_headers include $(BUILD_SHARED_LIBRARY) +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_core_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +include $(BUILD_HEADER_LIBRARY) + endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/gnss/Android.mk b/gnss/Android.mk index ea362087..9585b73b 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -30,11 +30,11 @@ ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER endif -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libloc_pla \ - $(TARGET_OUT_HEADERS)/liblocation_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers LOCAL_PRELINK_MODULE := false diff --git a/location/Android.mk b/location/Android.mk index 6d2c9fa8..ad66aff9 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -24,18 +24,17 @@ LOCAL_SRC_FILES += \ LOCAL_CFLAGS += \ -fno-short-enums -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils - -LOCAL_COPY_HEADERS_TO:= liblocation_api/ -LOCAL_COPY_HEADERS:= \ - LocationAPI.h \ - LocationAPIClientBase.h \ - location_interface.h +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) +include $(CLEAR_VARS) +LOCAL_MODULE := liblocation_api_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +include $(BUILD_HEADER_LIBRARY) + endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/Android.mk b/utils/Android.mk index ef1e5e16..eeef2237 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -40,29 +40,9 @@ endif LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/libloc_pla \ - $(TARGET_OUT_HEADERS)/liblocation_api \ - -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 \ - loc_nmea.h \ - gps_extended_c.h \ - gps_extended.h \ - loc_gps.h +LOCAL_HEADER_LIBRARIES := \ + libloc_pla_headers \ + liblocation_api_headers LOCAL_MODULE := libgps.utils LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib @@ -73,6 +53,11 @@ LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) +include $(CLEAR_VARS) +LOCAL_MODULE := libgps.utils_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +include $(BUILD_HEADER_LIBRARY) + include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, platform_lib_abstractions)) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index 7d321efa..98f25b3f 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -27,19 +27,10 @@ LOCAL_CFLAGS += \ ## 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_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_PATH)/../include +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_stub_headers LOCAL_MODULE := libloc_pla LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib @@ -49,5 +40,11 @@ LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_pla_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include +include $(BUILD_HEADER_LIBRARY) + endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk index e899ca38..041ba643 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -31,15 +31,6 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic 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_PATH_32 := $(TARGET_OUT_VENDOR)/lib LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 @@ -48,5 +39,11 @@ LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_stub_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include +include $(BUILD_HEADER_LIBRARY) + endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE From 226e404a8c254f656753efc0c2cf5c639504f13b Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 29 Jun 2017 14:17:00 +0800 Subject: [PATCH 530/945] Correct the comment for loc_param_s_type struct Change the comment for param_type member of loc_param_s_type struct: 'f' for float --> 'f' for double Change-Id: Ibf9c6bec624bd3900c4b96100c359ed7350becc6 CRs-fixed: 2068995 --- utils/loc_cfg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 9045e1d5..0a0f1009 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -56,10 +56,10 @@ typedef struct { const char *param_name; void *param_ptr; - uint8_t *param_set; /* was this value set by config file? */ + uint8_t *param_set; /* indicate value set by config file */ char param_type; /* 'n' for number, 's' for string, - 'f' for float */ + 'f' for double */ } loc_param_s_type; /*============================================================================= From 8cf201ae2ad75a5292e322f12daec5b5ba6d029b Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 3 Jul 2017 17:07:37 +0530 Subject: [PATCH 531/945] Adding KW warning fixes Change-Id: I03a09abdfc4224d59d3ddb467d0314e644fe4fe0 CRs-Fixed: 2062522 --- gnss/GnssAdapter.cpp | 4 ++-- location/LocationAPIClientBase.cpp | 32 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 3d5f7d2c..d08f8c2d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1096,7 +1096,7 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) return; } - LocationCapabilitiesMask mask = {}; + LocationCapabilitiesMask mask = 0; // time based tracking always supported mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)){ @@ -2741,7 +2741,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, } // extract each sv info from systemstatus report - for(uint32_t i=0; i sessionsVec = mGeofenceBiDict.getAllSessions(); size_t count = sessionsVec.size(); uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); + if (sessions == NULL) { + LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + return; + } if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; @@ -747,6 +772,13 @@ void LocationAPIClientBase::beforeGeofenceBreachCb( size_t n = geofenceBreachNotification.count; geofenceBreachCallback genfenceCallback = nullptr; + if (ids == NULL) { + LOC_LOGE("%s:%d] Failed to alloc %d bytes", + __FUNCTION__, __LINE__, + sizeof(uint32_t) * geofenceBreachNotification.count); + return; + } + pthread_mutex_lock(&mMutex); if (mGeofenceBreachCallback != nullptr) { size_t count = 0; From f708deaec64dcd9adc9a566119e336f9730953f0 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Tue, 23 May 2017 15:31:02 +0530 Subject: [PATCH 532/945] gps time population from GNSS v2v needs gps time population in izat remote apis Change-Id: Ibe340a3f834ebe27c552bd1ffe2f20d3b9f50450 CRs-Fixed: 2050993 --- utils/gps_extended_c.h | 56 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b8acead2..1119c78a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -270,7 +270,7 @@ typedef enum loc_position_mode_type { #define GPS_DEFAULT_FIX_INTERVAL_MS 1000 /** Flags to indicate which values are valid in a GpsLocationExtended. */ -typedef uint16_t GpsLocationExtendedFlags; +typedef uint32_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 /** GpsLocationExtended has valid altitude mean sea level. */ @@ -301,6 +301,12 @@ typedef uint16_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK 0x2000 /** GpsLocationExtended has valid LocPosTechMask */ #define GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK 0x4000 +/** GpsLocationExtended has valid LocSvInfoSource */ +#define GPS_LOCATION_EXTENDED_HAS_SV_SOURCE_INFO 0x8000 +/** GpsLocationExtended has valid position dynamics data */ +#define GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA 0x10000 +/** GpsLocationExtended has GPS Time */ +#define GPS_LOCATION_EXTENDED_HAS_GPS_TIME 0x20000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -312,6 +318,18 @@ typedef uint32_t LocNavSolutionMask; /**< Bitmask to specify whether SBAS integrity information is used */ #define LOC_NAV_MASK_SBAS_INTEGRITY ((LocNavSolutionMask)0x0008) +typedef uint32_t LocPosDataMask; +/* Bitmask to specify whether Navigation data has Forward Acceleration */ +#define LOC_NAV_DATA_HAS_LONG_ACCEL ((LocPosDataMask)0x0001) +/* Bitmask to specify whether Navigation data has Sideward Acceleration */ +#define LOC_NAV_DATA_HAS_LAT_ACCEL ((LocPosDataMask)0x0002) +/* Bitmask to specify whether Navigation data has Vertical Acceleration */ +#define LOC_NAV_DATA_HAS_VERT_ACCEL ((LocPosDataMask)0x0004) +/* Bitmask to specify whether Navigation data has Heading Rate */ +#define LOC_NAV_DATA_HAS_YAW_RATE ((LocPosDataMask)0x0008) +/* Bitmask to specify whether Navigation data has Body pitch */ +#define LOC_NAV_DATA_HAS_PITCH ((LocPosDataMask)0x0010) + /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 #define GPS_SV_PRN_MAX 32 @@ -358,12 +376,40 @@ typedef struct { uint64_t qzss_sv_used_ids_mask; } GnssSvUsedInPosition; +/* Body Frame parameters */ +typedef struct { + /** Contains Body frame LocPosDataMask bits. */ + uint32_t bodyFrameDatamask; + /* Forward Acceleration in body frame (m/s2)*/ + float longAccel; + /* Sideward Acceleration in body frame (m/s2)*/ + float latAccel; + /* Vertical Acceleration in body frame (m/s2)*/ + float vertAccel; + /* Heading Rate (Radians/second) */ + float yawRate; + /* Body pitch (Radians) */ + float pitch; +}LocPositionDynamics; + +/* GPS Time structure */ +typedef struct { + + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Units: Weeks */ + uint16_t gpsWeek; + + /**< Amount of time into the current GPS week. \n + - Units: Milliseconds */ + uint32_t gpsTimeOfWeekMs; +}GPSTimeStruct; + /** Represents gps location extended. */ typedef struct { /** set to sizeof(GpsLocationExtended) */ size_t size; /** Contains GpsLocationExtendedFlags bits. */ - uint16_t flags; + uint32_t flags; /** Contains the Altitude wrt mean sea level */ float altitudeMeanSeaLevel; /** Contains Position Dilusion of Precision. */ @@ -398,6 +444,12 @@ typedef struct { LocNavSolutionMask navSolutionMask; /** Position technology used in computing this fix */ LocPosTechMask tech_mask; + /** SV Info source used in computing this fix */ + LocSvInfoSource sv_source; + /** Body Frame Dynamics: 4wayAcceleration and pitch set with validity */ + LocPositionDynamics bodyFrameData; + /** GPS Time */ + GPSTimeStruct gpsTime; } GpsLocationExtended; enum loc_sess_status { From ea013420db89f701ae6c1a9a5c3cb5fb372a8a8f Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Wed, 28 Jun 2017 11:12:07 +0530 Subject: [PATCH 533/945] Add QZSS constellation in Gnss_LocSvSystemEnumType Add QZSS support in Loc SV constellation structure. Change-Id: I58a989faa8ad4027d9f83fabccd700fa55333ce6 CRs-Fixed: 2053513 --- utils/gps_extended_c.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 1119c78a..3a1df09d 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -706,8 +706,10 @@ typedef enum /**< COMPASS satellite. */ GNSS_LOC_SV_SYSTEM_GLONASS = 5, /**< GLONASS satellite. */ - GNSS_LOC_SV_SYSTEM_BDS = 6 + GNSS_LOC_SV_SYSTEM_BDS = 6, /**< BDS satellite. */ + GNSS_LOC_SV_SYSTEM_QZSS = 7 + /**< QZSS satellite. */ } Gnss_LocSvSystemEnumType; typedef enum From ba171737ab0ad44608ac7ccd342ed7fc9b36fa0c Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 6 Jul 2017 17:02:50 +0800 Subject: [PATCH 534/945] Update the latest LocationOptions Restore unintentionally removed code. Call locAPIUpdateTrackingOptions in gnssSetPositionMode. Change-Id: I35a84c92de6a4b3df16d779fbb79601212d61119 CRs-fixed: 2071240 --- android/location_api/GnssAPIClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index af2998de..f12cd627 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -168,6 +168,7 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, mode); retVal = false; } + locAPIUpdateTrackingOptions(mLocationOptions); return retVal; } From a4a26b43ebe1c057ff9fe354666e2cde8ee048e2 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 3 Jul 2017 17:22:28 +0530 Subject: [PATCH 535/945] Fix failure in CTS testcase GnssStatusTest GnssStatusTest test case is expecting to QZSS SV id as it is (193 <= X <= 200) for this test case. Change-Id: I8ba234fb02be7c09b8273238c0842d4826a12424 CRs-Fixed: 2070493 --- gnss/GnssAdapter.cpp | 65 ++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d08f8c2d..68730f0a 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1978,38 +1978,51 @@ GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, void GnssAdapter::reportSv(GnssSvNotification& svNotify) { - if (mGnssSvIdUsedInPosAvail) { - int numSv = svNotify.count; - int16_t gnssSvId = 0; - uint64_t svUsedIdMask = 0; - for (int i=0; i < numSv; i++) { - gnssSvId = svNotify.gnssSvs[i].svId; - switch (svNotify.gnssSvs[i].type) { - case GNSS_SV_TYPE_GPS: + int numSv = svNotify.count; + int16_t gnssSvId = 0; + uint64_t svUsedIdMask = 0; + for (int i=0; i < numSv; i++) { + svUsedIdMask = 0; + gnssSvId = svNotify.gnssSvs[i].svId; + switch (svNotify.gnssSvs[i].type) { + case GNSS_SV_TYPE_GPS: + if (mGnssSvIdUsedInPosAvail) { svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; - break; - case GNSS_SV_TYPE_GLONASS: + } + break; + case GNSS_SV_TYPE_GLONASS: + if (mGnssSvIdUsedInPosAvail) { svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; - break; - case GNSS_SV_TYPE_BEIDOU: + } + break; + case GNSS_SV_TYPE_BEIDOU: + if (mGnssSvIdUsedInPosAvail) { svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; - break; - case GNSS_SV_TYPE_GALILEO: + } + break; + case GNSS_SV_TYPE_GALILEO: + if (mGnssSvIdUsedInPosAvail) { svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; - break; - case GNSS_SV_TYPE_QZSS: + } + break; + case GNSS_SV_TYPE_QZSS: + if (mGnssSvIdUsedInPosAvail) { svUsedIdMask = mGnssSvIdUsedInPosition.qzss_sv_used_ids_mask; - break; - default: - svUsedIdMask = 0; - break; - } + } + // QZSS SV id's need to reported as it is to framework, since + // framework expects it as it is. See GnssStatus.java. + // SV id passed to here by LocApi is 1-based. + svNotify.gnssSvs[i].svId += (QZSS_SV_PRN_MIN - 1); + 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))) { - svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; - } + // 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))) { + svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; } } From 4971373d94024b7571dfea11dffd89f46cf6aefb Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 7 Jul 2017 15:33:52 -0700 Subject: [PATCH 536/945] Disable set debug NMEA bit when unsupported Avoid setting debug NMEA bit of QMI_LOC_SET_ NMEA_TYPES_REQ message when the feature is unsupported. Change-Id: I999654f627eac68042597ee51aff81e8588bfa9b CRs-Fixed: 2072961 --- gnss/GnssAdapter.cpp | 15 ++++++++++----- gnss/GnssAdapter.h | 1 + utils/gps_extended_c.h | 9 +++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d08f8c2d..975656bd 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -61,6 +61,7 @@ GnssAdapter::GnssAdapter() : mGnssSvIdUsedInPosAvail(false), mControlCallbacks(), mPowerVoteId(0), + mNmeaMask(0), mNiData(), mAgpsManager(), mAgpsCbInfo() @@ -520,11 +521,15 @@ GnssAdapter::setConfigCommand() // set nmea mask type uint32_t mask = 0; if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { - mask = LOC_NMEA_ALL_SUPPORTED_MASK; - } else { - mask = LOC_NMEA_MASK_DEBUG_V02; + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; } - mApi.setNMEATypes(mask); + if (mApi.isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } + if (mask != 0) { + mApi.setNMEATypes(mask); + } + mAdapter.mNmeaMask= mask; mApi.setXtraVersionCheck(ContextBase::mGps_conf.XTRA_VERSION_CHECK); if (ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID || @@ -1011,7 +1016,7 @@ GnssAdapter::updateClientsEventMask() if (it->second.gnssSvCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_SATELLITE_REPORT; } - if (it->second.gnssNmeaCb != nullptr) { + if ((it->second.gnssNmeaCb != nullptr) && (mNmeaMask)) { mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; } if (it->second.gnssMeasurementsCb != nullptr) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3b300474..c07fa2b5 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -92,6 +92,7 @@ class GnssAdapter : public LocAdapterBase { /* ==== CONTROL ======================================================================== */ LocationControlCallbacks mControlCallbacks; uint32_t mPowerVoteId; + uint32_t mNmeaMask; /* ==== NI ============================================================================= */ NiData mNiData; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b8acead2..66dcc4dd 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -114,7 +114,8 @@ enum loc_registration_mask_status { 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_WIFI_AP_DATA_INJECT_2_V02, /**< Support Wifi AP data inject version 2 feature */ + LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02 /**< Support debug NMEA feature */ } loc_supported_feature_enum; typedef struct { @@ -427,13 +428,13 @@ typedef uint32_t NmeaSentenceTypesMask; #define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**< Enable PQGSV type */ #define LOC_NMEA_MASK_DEBUG_V02 ((NmeaSentenceTypesMask)0x00020000) /**< Enable DEBUG type */ -#define LOC_NMEA_ALL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \ +// all bitmasks of general supported NMEA sentenses - debug is not part of this +#define LOC_NMEA_ALL_GENERAL_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 | \ - LOC_NMEA_MASK_DEBUG_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, From 9c2acb7847b04715917950e7d61815012e4b83ee Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 7 Jul 2017 15:00:10 -0700 Subject: [PATCH 537/945] Fix incorrect sv id offset for bugreport Fixed incorrect sv id offset for adb bugreport. Ephemeris type, source and age information of BDS, GAL and QZSS reported through PQWPE7 NMEA are incorrectly mapped to adb bugreport. Bug: 63178209 Change-Id: I9f4b7942adadda8949e040ee59bed9c027e080c2 CRs-Fixed: 2073107 --- gnss/GnssAdapter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d08f8c2d..9beb66d9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2700,7 +2700,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, case GNSS_SV_TYPE_QZSS: svid_min = GNSS_BUGREPORT_QZSS_MIN; svid_num = QZSS_NUM; - svid_idx = GPS_NUM+GLO_NUM; + svid_idx = GPS_NUM+GLO_NUM+BDS_NUM+GAL_NUM; if (!in.mSvHealth.empty()) { eph_health_good_mask = in.mSvHealth.back().mQzssGoodMask; eph_health_bad_mask = in.mSvHealth.back().mQzssBadMask; @@ -2713,7 +2713,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, case GNSS_SV_TYPE_BEIDOU: svid_min = GNSS_BUGREPORT_BDS_MIN; svid_num = BDS_NUM; - svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM; + svid_idx = GPS_NUM+GLO_NUM; if (!in.mSvHealth.empty()) { eph_health_good_mask = in.mSvHealth.back().mBdsGoodMask; eph_health_bad_mask = in.mSvHealth.back().mBdsBadMask; @@ -2726,7 +2726,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, case GNSS_SV_TYPE_GALILEO: svid_min = GNSS_BUGREPORT_GAL_MIN; svid_num = GAL_NUM; - svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM; + svid_idx = GPS_NUM+GLO_NUM+BDS_NUM; if (!in.mSvHealth.empty()) { eph_health_good_mask = in.mSvHealth.back().mGalGoodMask; eph_health_bad_mask = in.mSvHealth.back().mGalBadMask; From be7f077122deebc468cf609cb5739a845ce7beec Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 3 Jul 2017 18:46:41 -0700 Subject: [PATCH 538/945] Fix to report bearing and speed accuracy 1. Validity bit for vertical uncertainity was conflicting with the validity bit of location source, hence had to change the bit. 2. Modify ZPP API to report speed and bearing accuracy. CRs-Fixed:2064017 Change-Id: I8b09ecab3d67557ad7c2451fee71dbc0e1f14371 --- core/LocApiBase.cpp | 4 +++- core/LocApiBase.h | 3 ++- gnss/GnssAdapter.cpp | 3 ++- utils/loc_gps.h | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 2dcd4cd1..2a0d2050 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -541,10 +541,12 @@ enum loc_api_adapter_err LocApiBase:: } enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask) + getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, + LocPosTechMask & tech_mask) { memset(&zppLoc, 0, sizeof(zppLoc)); memset(&tech_mask, 0, sizeof(tech_mask)); + memset(&locationExtended, 0, sizeof (locationExtended)); DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) } diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 86610e72..aa09be53 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -209,7 +209,8 @@ public: virtual enum loc_api_adapter_err getBestAvailableZppFix(LocGpsLocation & zppLoc); virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask); + getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, + LocPosTechMask & tech_mask); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 31e992b0..25577ce9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1616,7 +1616,8 @@ GnssAdapter::getZppCommand() GpsLocationExtended locationExtended = {}; locationExtended.size = sizeof(locationExtended); - mApi.getBestAvailableZppFix(location.gpsLocation, techMask); + mApi.getBestAvailableZppFix(location.gpsLocation, locationExtended, + techMask); //Mark the location source as from ZPP location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; location.position_source = ULP_LOCATION_IS_FROM_ZPP; diff --git a/utils/loc_gps.h b/utils/loc_gps.h index e3f21826..77ebe54a 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -99,7 +99,7 @@ typedef uint16_t LocGpsLocationFlags; /** LocGpsLocation has valid accuracy. */ #define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010 /** LocGpsLocation has valid vertical uncertainity */ -#define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0020 +#define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0040 /** Flags for the loc_gps_set_capabilities callback. */ @@ -541,7 +541,7 @@ typedef struct { * Represents altitude in meters above the WGS 84 reference ellipsoid. */ double altitude; - /** Represents speed in meters per second. */ + /** Represents horizontal speed in meters per second. */ float speed; /** Represents heading in degrees. */ float bearing; From 1bd0de5d87278a63b0b7a9b956e02ddfa1eeea47 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 14 Jul 2017 11:22:57 -0700 Subject: [PATCH 539/945] Fix yearOfHw as 2016 pre ES SUPL concurrency Add capability bit for Nmea Debug, which is a marker for modem support of concurrent emergency supl session and normal gps session. CRs-fixed: 2068217 Change-Id: Iea1ee7b56bfdd28643928edf0475cf21257de64c --- android/location_api/GnssAPIClient.cpp | 7 +++++-- gnss/GnssAdapter.cpp | 3 +++ location/LocationAPI.h | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index f12cd627..52705762 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -301,9 +301,12 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) } if (mGnssCbIface != nullptr) { IGnssCallback::GnssSystemInfo gnssInfo; - gnssInfo.yearOfHw = 2015; - if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { gnssInfo.yearOfHw = 2017; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + gnssInfo.yearOfHw = 2016; + } else { + gnssInfo.yearOfHw = 2015; } LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); auto r = mGnssCbIface->gnssSetSystemInfoCb(gnssInfo); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 31e992b0..e3269cf8 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1123,6 +1123,9 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; } + if (mApi.isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; + } callbacks.capabilitiesCb(mask); } diff --git a/location/LocationAPI.h b/location/LocationAPI.h index d128d5eb..bda68794 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -138,6 +138,8 @@ typedef enum { LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6), // supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted) LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7), + // supports debug nmea sentences in the debugNmeaCallback + LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8), } LocationCapabilitiesBits; typedef enum { From ea051709cd1640da9ff3f6a7b2378fd21d1d56cb Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Tue, 20 Jun 2017 22:18:19 +0530 Subject: [PATCH 540/945] Fix 2.9-rel compilation issues on LE Change-Id: I35b8da213e8830456c8652802941a418748bd5e9 CRs-Fixed: 2067662 --- Makefile.am | 2 +- configure.ac | 4 +- core/Makefile.am | 4 +- gnss/Makefile.am | 98 +++++++++++++++++++ loc-hal.pc.in | 4 +- location/Android.mk | 1 + location/LocationAPI.cpp | 2 +- location/LocationAPIClientBase.cpp | 2 +- location/Makefile.am | 39 ++++++++ utils/Makefile.am | 2 + .../loc_pla/src/Makefile.am | 2 - 11 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 gnss/Makefile.am create mode 100644 location/Makefile.am diff --git a/Makefile.am b/Makefile.am index 7bc06b1c..f64790e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = core loc_api +SUBDIRS = core location gnss pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = loc-hal.pc diff --git a/configure.ac b/configure.ac index cf991c6b..ec41c86f 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,9 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ - utils/Makefile \ core/Makefile \ - loc_api/Makefile \ + location/Makefile \ + gnss/Makefile \ loc-hal.pc \ ]) diff --git a/core/Makefile.am b/core/Makefile.am index 61abac47..5d52c40e 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,10 +1,12 @@ AM_CFLAGS = -I./ \ -I../utils \ + -I../location \ $(LOCPLA_CFLAGS) \ $(GPSUTILS_CFLAGS) \ -I$(WORKSPACE)/gps-noship/flp \ -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums + -fno-short-enums \ + -std=c++11 libloc_core_la_h_sources = \ LocApiBase.h \ diff --git a/gnss/Makefile.am b/gnss/Makefile.am new file mode 100644 index 00000000..69f7c762 --- /dev/null +++ b/gnss/Makefile.am @@ -0,0 +1,98 @@ +AM_CFLAGS = \ + $(LOCPLA_CFLAGS) \ + $(LOCHAL_CFLAGS) \ + -I./ \ + -I../utils \ + -I../core \ + -I../location \ + -std=c++11 + +libgnss_la_SOURCES = \ + location_gnss.cpp \ + GnssAdapter.cpp \ + Agps.cpp + +if USE_GLIB +libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgnss_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -avoid-version +libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libgnss_la_CFLAGS = $(AM_CFLAGS) +libgnss_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libgnss_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS) + + +#Create and Install libraries +#lib_LTLIBRARIES = libgnss.la + +#library_includedir = $(pkgincludedir) +#pkgconfigdir = $(libdir)/pkgconfig +#pkgconfig_DATA = location-api.pc +#EXTRA_DIST = $(pkgconfig_DATA) + + +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++ -Wl,-z,defs -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++ -Wl,-z,defs -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 $(GPSUTILS_LIBS) $(LOCPLA_LIBS) \ +$(GPSUTILS_LIBS) + +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++ -g -Wl,-z,defs -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++ -Wl,-z,defs -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 libloc_ds_api.la + +library_include_HEADERS = \ + $(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 = libgnss.la libloc_ds_api.la libloc_api_v02.la diff --git a/loc-hal.pc.in b/loc-hal.pc.in index c6ece745..64750db5 100644 --- a/loc-hal.pc.in +++ b/loc-hal.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: loc-hal Description: QTI GPS Loc HAL Version: @VERSION -Libs: -L${libdir} -lloc_core -lloc_eng_so -lloc_ds_api -lloc_api_v02 -Cflags: -I${includedir} -I${includedir}/loc-hal/utils -I${includedir}/loc-hal/core -I${includedir}/loc-hal +Libs: -L${libdir} -lloc_core -llocation_api -lgnss -lloc_ds_api -lloc_api_v02 +Cflags: -I${includedir} -I${includedir}/loc-hal -I${includedir}/loc-hal/location -I${includedir}/loc-hal/gnss -I${includedir}/loc-hal/core diff --git a/location/Android.mk b/location/Android.mk index ad66aff9..728bdb45 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -25,6 +25,7 @@ LOCAL_CFLAGS += \ -fno-short-enums LOCAL_HEADER_LIBRARIES := \ + libloc_pla_headers \ libgps.utils_headers LOCAL_PRELINK_MODULE := false diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index ed3cc6b6..09fa7e12 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 56ac9cc3..d8fda333 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -29,7 +29,7 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" -#include +#include #include #include "LocationAPIClientBase.h" diff --git a/location/Makefile.am b/location/Makefile.am new file mode 100644 index 00000000..d5203097 --- /dev/null +++ b/location/Makefile.am @@ -0,0 +1,39 @@ +AM_CFLAGS = \ + $(LOCPLA_CFLAGS) \ + $(LOCHAL_CFLAGS) \ + -I./ \ + -I../utils \ + -std=c++11 + +liblocation_api_la_SOURCES = \ + LocationAPI.cpp \ + LocationAPIClientBase.cpp + +if USE_GLIB +liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +liblocation_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +liblocation_api_la_CFLAGS = $(AM_CFLAGS) +liblocation_api_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS) + +library_include_HEADERS = \ + LocationAPI.h \ + LocationAPIClientBase.h \ + location_interface.h + +#Create and Install libraries +lib_LTLIBRARIES = liblocation_api.la + +library_includedir = $(pkgincludedir) +#pkgconfigdir = $(libdir)/pkgconfig +#pkgconfig_DATA = location-api.pc +#EXTRA_DIST = $(pkgconfig_DATA) + + + + diff --git a/utils/Makefile.am b/utils/Makefile.am index 14c3e482..33a87dab 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,9 +1,11 @@ AM_CFLAGS = -Wundef \ -I./ \ + -std=c++11 \ $(LOCPLA_CFLAGS) AM_CPPFLAGS = -Wundef \ -I./ \ + -std=c++11 \ $(LOCPLA_CFLAGS) libgps_utils_so_la_h_sources = \ diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am index d82aa55b..30c4b4cc 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -5,7 +5,6 @@ AM_CFLAGS = \ -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 \ @@ -18,7 +17,6 @@ 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 \ From 2df685d3ec307cd24900b856529fe6a7fe9c7818 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 20 Jul 2017 17:02:26 +0800 Subject: [PATCH 541/945] Support multiple sessions Start more than one sessions by calling locAPIStartSession multiple times Change-Id: I1625faaab0f69fcb2700b6dbd695f59061c6a88d CRs-fixed: 2079631 --- location/LocationAPIClientBase.cpp | 154 ++++++++++++++--------------- location/LocationAPIClientBase.h | 82 ++++++++++----- 2 files changed, 130 insertions(+), 106 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 56ac9cc3..b89b68cb 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -176,7 +176,7 @@ void LocationAPIControlClient::onCtrlResponseCb(LocationError error, uint32_t id } LocationAPIRequest* request = getRequestBySession(id); if (request) { - request->onResponse(error); + request->onResponse(error, id); delete request; } } @@ -366,7 +366,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session pthread_mutex_lock(&mMutex); if (mLocationAPI) { - if (mSessionMap.find(id) != mSessionMap.end()) { + if (mSessionBiDict.hasId(id)) { LOC_LOGE("%s:%d] session %d has already started.", __FUNCTION__, __LINE__, id); retVal = LOCATION_ERROR_ALREADY_STARTED; } else { @@ -376,21 +376,22 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session if (sessionMode == SESSION_MODE_ON_FIX) { trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); - mRequestQueues[REQUEST_TRACKING].reset(trackingSession); - mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); + mRequestQueues[REQUEST_SESSION].push(new StartTrackingRequest(*this)); } else if (sessionMode == SESSION_MODE_ON_FULL) { batchingSession = mLocationAPI->startBatching(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); - mRequestQueues[REQUEST_BATCHING].reset(batchingSession); - mRequestQueues[REQUEST_BATCHING].push(new StartBatchingRequest(*this)); + mRequestQueues[REQUEST_SESSION].setSession(batchingSession); + mRequestQueues[REQUEST_SESSION].push(new StartBatchingRequest(*this)); } + uint32_t session = + (sessionMode == SESSION_MODE_ON_FULL) ? batchingSession : trackingSession; SessionEntity entity; entity.id = id; entity.trackingSession = trackingSession; entity.batchingSession = batchingSession; entity.sessionMode = sessionMode; - mSessionMap[id] = entity; + mSessionBiDict.set(id, session, entity); retVal = LOCATION_ERROR_SUCCESS; } @@ -407,31 +408,21 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) pthread_mutex_lock(&mMutex); if (mLocationAPI) { - if (mSessionMap.find(id) != mSessionMap.end()) { - SessionEntity entity = mSessionMap[id]; + if (mSessionBiDict.hasId(id)) { + SessionEntity entity = mSessionBiDict.getExtById(id); uint32_t trackingSession = entity.trackingSession; uint32_t batchingSession = entity.batchingSession; uint32_t sMode = entity.sessionMode; - mSessionMap.erase(id); - if (sMode == SESSION_MODE_ON_FIX) { - if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { - mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); - mLocationAPI->stopTracking(trackingSession); - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_TRACKING].getSession()); - } + mRequestQueues[REQUEST_SESSION].push(new StopTrackingRequest(*this)); + mLocationAPI->stopTracking(trackingSession); } else if (sMode == SESSION_MODE_ON_FULL) { - if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { - mRequestQueues[REQUEST_BATCHING].push(new StopBatchingRequest(*this)); - mLocationAPI->stopBatching(batchingSession); - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_BATCHING].getSession()); - } + mRequestQueues[REQUEST_SESSION].push(new StopBatchingRequest(*this)); + mLocationAPI->stopBatching(batchingSession); + } else { + LOC_LOGE("%s:%d] unknown mode %d.", __FUNCTION__, __LINE__, sMode); } retVal = LOCATION_ERROR_SUCCESS; @@ -452,79 +443,68 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t pthread_mutex_lock(&mMutex); if (mLocationAPI) { - if (mSessionMap.find(id) != mSessionMap.end()) { - SessionEntity& entity = mSessionMap[id]; + if (mSessionBiDict.hasId(id)) { + SessionEntity entity = mSessionBiDict.getExtById(id); uint32_t trackingSession = entity.trackingSession; uint32_t batchingSession = entity.batchingSession; uint32_t sMode = entity.sessionMode; if (sessionMode == SESSION_MODE_ON_FIX) { + // we only add an UpdateTrackingOptionsRequest to mRequestQueues[REQUEST_SESSION], + // even if this update request will stop batching and then start tracking. + mRequestQueues[REQUEST_SESSION].push(new UpdateTrackingOptionsRequest(*this)); if (sMode == SESSION_MODE_ON_FIX) { - if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { - mRequestQueues[REQUEST_TRACKING].push(new UpdateTrackingOptionsRequest(*this)); - mLocationAPI->updateTrackingOptions(trackingSession, options); - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_TRACKING].getSession()); - } + mLocationAPI->updateTrackingOptions(trackingSession, options); } else if (sMode == SESSION_MODE_ON_FULL) { // stop batching - { - if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { - mRequestQueues[REQUEST_BATCHING].push(new StopBatchingRequest(*this)); - mLocationAPI->stopBatching(batchingSession); - batchingSession = 0; - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_BATCHING].getSession()); - } - } + // batchingSession will be removed from mSessionBiDict soon, + // so we don't need to add a new request to mRequestQueues[REQUEST_SESSION]. + mLocationAPI->stopBatching(batchingSession); + batchingSession = 0; + mRequestQueues[REQUEST_SESSION].setSession(batchingSession); + // start tracking - { - trackingSession = mLocationAPI->startTracking(options); - LOC_LOGI("%s:%d] start new session: %d", - __FUNCTION__, __LINE__, trackingSession); - mRequestQueues[REQUEST_TRACKING].reset(trackingSession); - mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); - } + trackingSession = mLocationAPI->startTracking(options); + LOC_LOGI("%s:%d] start new session: %d", + __FUNCTION__, __LINE__, trackingSession); + } else { + LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); } } else if (sessionMode == SESSION_MODE_ON_FULL) { + // we only add an UpdateBatchingOptionsRequest to mRequestQueues[REQUEST_SESSION], + // even if this update request will stop tracking and then start batching. + mRequestQueues[REQUEST_SESSION].push(new UpdateBatchingOptionsRequest(*this)); if (sMode == SESSION_MODE_ON_FIX) { // stop tracking - { - if (mRequestQueues[REQUEST_TRACKING].getSession() == trackingSession) { - mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); - mLocationAPI->stopTracking(trackingSession); - trackingSession = 0; - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_TRACKING].getSession()); - } - } + // trackingSession will be removed from mSessionBiDict soon, + // so we don't need to add a new request to mRequestQueues[REQUEST_SESSION]. + mLocationAPI->stopTracking(trackingSession); + trackingSession = 0; + // start batching - { - batchingSession = mLocationAPI->startBatching(options); - LOC_LOGI("%s:%d] start new session: %d", - __FUNCTION__, __LINE__, batchingSession); - mRequestQueues[REQUEST_BATCHING].reset(batchingSession); - mRequestQueues[REQUEST_BATCHING].push(new StartBatchingRequest(*this)); - } + batchingSession = mLocationAPI->startBatching(options); + LOC_LOGI("%s:%d] start new session: %d", + __FUNCTION__, __LINE__, batchingSession); + mRequestQueues[REQUEST_SESSION].setSession(batchingSession); } else if (sMode == SESSION_MODE_ON_FULL) { - if (mRequestQueues[REQUEST_BATCHING].getSession() == batchingSession) { - mRequestQueues[REQUEST_BATCHING].push( - new UpdateBatchingOptionsRequest(*this)); - mLocationAPI->updateBatchingOptions(batchingSession, options); - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_BATCHING].getSession()); - } + mLocationAPI->updateBatchingOptions(batchingSession, options); + } else { + LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); } + + } else { + LOC_LOGE("%s:%d] unknown mode %d.", __FUNCTION__, __LINE__, sessionMode); } + uint32_t session = + (sessionMode == SESSION_MODE_ON_FULL) ? batchingSession : trackingSession; entity.trackingSession = trackingSession; entity.batchingSession = batchingSession; entity.sessionMode = sessionMode; + // remove the old values from mSessionBiDict before we add a new one. + mSessionBiDict.rmById(id); + mSessionBiDict.set(id, session, entity); retVal = LOCATION_ERROR_SUCCESS; } else { @@ -542,9 +522,9 @@ void LocationAPIClientBase::locAPIGetBatchedLocations(size_t count) pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t session = 0; - session = mRequestQueues[REQUEST_BATCHING].getSession(); + session = mRequestQueues[REQUEST_SESSION].getSession(); if (session > 0) { - mRequestQueues[REQUEST_BATCHING].push(new GetBatchedLocationsRequest(*this)); + mRequestQueues[REQUEST_SESSION].push(new GetBatchedLocationsRequest(*this)); mLocationAPI->getBatchedLocations(session, count); } else { LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); @@ -785,7 +765,7 @@ void LocationAPIClientBase::beforeGeofenceBreachCb( for (size_t i = 0; i < n; i++) { uint32_t id = mGeofenceBiDict.getId(geofenceBreachNotification.ids[i]); GeofenceBreachTypeMask type = - mGeofenceBiDict.getType(geofenceBreachNotification.ids[i]); + mGeofenceBiDict.getExtBySession(geofenceBreachNotification.ids[i]); // if type == 0, we will not head into the fllowing block anyway. // so we don't need to check id and type if ((geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER && @@ -823,7 +803,7 @@ void LocationAPIClientBase::onResponseCb(LocationError error, uint32_t id) } LocationAPIRequest* request = getRequestBySession(id); if (request) { - request->onResponse(error); + request->onResponse(error, id); delete request; } } @@ -850,17 +830,31 @@ void LocationAPIClientBase::onCollectiveResponseCb( } } +void LocationAPIClientBase::removeSession(uint32_t session) { + if (mSessionBiDict.hasSession(session)) { + mSessionBiDict.rmBySession(session); + } +} + LocationAPIRequest* LocationAPIClientBase::getRequestBySession(uint32_t session) { pthread_mutex_lock(&mMutex); LocationAPIRequest* request = nullptr; for (int i = 0; i < REQUEST_MAX; i++) { if (i != REQUEST_GEOFENCE && + i != REQUEST_SESSION && mRequestQueues[i].getSession() == session) { request = mRequestQueues[i].pop(); break; } } + if (request == nullptr) { + // Can't find a request with correct session, + // try to find it from mSessionBiDict + if (mSessionBiDict.hasSession(session)) { + request = mRequestQueues[REQUEST_SESSION].pop(); + } + } pthread_mutex_unlock(&mMutex); return request; } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 354e51ff..19d585ad 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -45,7 +45,7 @@ enum SESSION_MODE { enum REQUEST_TYPE { REQUEST_TRACKING = 0, - REQUEST_BATCHING, + REQUEST_SESSION, REQUEST_GEOFENCE, REQUEST_NIRESPONSE, REQUEST_MAX, @@ -64,7 +64,7 @@ class LocationAPIRequest { public: LocationAPIRequest() {} virtual ~LocationAPIRequest() {} - virtual void onResponse(LocationError /*error*/) {} + virtual void onResponse(LocationError /*error*/, uint32_t /*id*/) {} virtual void onCollectiveResponse( size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} }; @@ -76,6 +76,7 @@ public: virtual ~RequestQueue() { reset(0); } + void inline setSession(uint32_t session) { mSession = session; } void reset(uint32_t session) { LocationAPIRequest* request = nullptr; while (!mQueue.empty()) { @@ -130,7 +131,7 @@ public: class GnssDeleteAidingDataRequest : public LocationAPIRequest { public: GnssDeleteAidingDataRequest(LocationAPIControlClient& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onGnssDeleteAidingDataCb(error); } LocationAPIControlClient& mAPI; @@ -139,7 +140,7 @@ public: class EnableRequest : public LocationAPIRequest { public: EnableRequest(LocationAPIControlClient& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onEnableCb(error); } LocationAPIControlClient& mAPI; @@ -148,7 +149,7 @@ public: class DisableRequest : public LocationAPIRequest { public: DisableRequest(LocationAPIControlClient& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onDisableCb(error); } LocationAPIControlClient& mAPI; @@ -179,6 +180,7 @@ public: LocationAPIClientBase& operator=(const LocationAPIClientBase&) = delete; void locAPISetCallbacks(LocationCallbacks& locationCallbacks); + void removeSession(uint32_t session); LocationAPIRequest* getRequestBySession(uint32_t session); // LocationAPI @@ -257,6 +259,7 @@ private: uint32_t sessionMode; } SessionEntity; + template class BiDict { public: BiDict() { @@ -271,24 +274,30 @@ private: pthread_mutex_unlock(&mBiDictMutex); return ret; } - void set(uint32_t id, uint32_t session, uint32_t type) { + bool hasSession(uint32_t session) { + pthread_mutex_lock(&mBiDictMutex); + bool ret = (mBackwardMap.find(session) != mBackwardMap.end()); + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + void set(uint32_t id, uint32_t session, T& ext) { pthread_mutex_lock(&mBiDictMutex); mForwardMap[id] = session; mBackwardMap[session] = id; - mTypeMap[session] = type; + mExtMap[session] = ext; pthread_mutex_unlock(&mBiDictMutex); } void clear() { pthread_mutex_lock(&mBiDictMutex); mForwardMap.clear(); mBackwardMap.clear(); - mTypeMap.clear(); + mExtMap.clear(); pthread_mutex_unlock(&mBiDictMutex); } void rmById(uint32_t id) { pthread_mutex_lock(&mBiDictMutex); mBackwardMap.erase(mForwardMap[id]); - mTypeMap.erase(mForwardMap[id]); + mExtMap.erase(mForwardMap[id]); mForwardMap.erase(id); pthread_mutex_unlock(&mBiDictMutex); } @@ -296,7 +305,7 @@ private: pthread_mutex_lock(&mBiDictMutex); mForwardMap.erase(mBackwardMap[session]); mBackwardMap.erase(session); - mTypeMap.erase(session); + mExtMap.erase(session); pthread_mutex_unlock(&mBiDictMutex); } uint32_t getId(uint32_t session) { @@ -319,11 +328,26 @@ private: pthread_mutex_unlock(&mBiDictMutex); return ret; } - uint32_t getType(uint32_t session) { + T getExtById(uint32_t id) { pthread_mutex_lock(&mBiDictMutex); - uint32_t ret = 0; - auto it = mTypeMap.find(session); - if (it != mTypeMap.end()) { + T ret; + memset(&ret, 0, sizeof(T)); + uint32_t session = mForwardMap[id]; + if (session > 0) { + auto it = mExtMap.find(session); + if (it != mExtMap.end()) { + ret = it->second; + } + } + pthread_mutex_unlock(&mBiDictMutex); + return ret; + } + T getExtBySession(uint32_t session) { + pthread_mutex_lock(&mBiDictMutex); + T ret; + memset(&ret, 0, sizeof(T)); + auto it = mExtMap.find(session); + if (it != mExtMap.end()) { ret = it->second; } pthread_mutex_unlock(&mBiDictMutex); @@ -344,14 +368,14 @@ private: std::map mForwardMap; // mBackwardMap mapping session->id std::map mBackwardMap; - // mTypeMap mapping session->type - std::map mTypeMap; + // mExtMap mapping session->ext + std::map mExtMap; }; class StartTrackingRequest : public LocationAPIRequest { public: StartTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onStartTrackingCb(error); } LocationAPIClientBase& mAPI; @@ -360,8 +384,11 @@ private: class StopTrackingRequest : public LocationAPIRequest { public: StopTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t id) { mAPI.onStopTrackingCb(error); + if (error == LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } } LocationAPIClientBase& mAPI; }; @@ -369,7 +396,7 @@ private: class UpdateTrackingOptionsRequest : public LocationAPIRequest { public: UpdateTrackingOptionsRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onUpdateTrackingOptionsCb(error); } LocationAPIClientBase& mAPI; @@ -378,7 +405,7 @@ private: class StartBatchingRequest : public LocationAPIRequest { public: StartBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onStartBatchingCb(error); } LocationAPIClientBase& mAPI; @@ -387,8 +414,11 @@ private: class StopBatchingRequest : public LocationAPIRequest { public: StopBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t id) { mAPI.onStopBatchingCb(error); + if (error == LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } } LocationAPIClientBase& mAPI; }; @@ -396,7 +426,7 @@ private: class UpdateBatchingOptionsRequest : public LocationAPIRequest { public: UpdateBatchingOptionsRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onUpdateBatchingOptionsCb(error); } LocationAPIClientBase& mAPI; @@ -405,7 +435,7 @@ private: class GetBatchedLocationsRequest : public LocationAPIRequest { public: GetBatchedLocationsRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onGetBatchedLocationsCb(error); } LocationAPIClientBase& mAPI; @@ -485,7 +515,7 @@ private: class GnssNiResponseRequest : public LocationAPIRequest { public: GnssNiResponseRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error) { + inline void onResponse(LocationError error, uint32_t /*id*/) { mAPI.onGnssNiResponseCb(error); } LocationAPIClientBase& mAPI; @@ -499,8 +529,8 @@ private: LocationAPI* mLocationAPI; RequestQueue mRequestQueues[REQUEST_MAX]; - BiDict mGeofenceBiDict; - std::map mSessionMap; + BiDict mGeofenceBiDict; + BiDict mSessionBiDict; int32_t mBatchSize; }; From 686a5c54b0fdd8a642a55f0d2085aeec99763209 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 2 May 2017 14:29:46 -0700 Subject: [PATCH 542/945] Location API for Outdoor Trip Batching Add / Modify Location API for Outdoor Trip Batching feature. Introduce a batch mode to differentiate between routine and outdoor trip mode. CRs-Fixed: 2041674 Change-Id: Ia8b2d34457b29c4fe754ab24287a6984ab9a96f5 --- android/location_api/BatchingAPIClient.cpp | 16 ++-- android/location_api/BatchingAPIClient.h | 2 +- gnss/GnssAdapter.cpp | 4 + location/LocationAPI.cpp | 10 ++- location/LocationAPI.h | 37 ++++++++- location/LocationAPIClientBase.cpp | 93 +++++++++++++++++----- location/LocationAPIClientBase.h | 11 ++- location/location_interface.h | 5 +- utils/gps_extended_c.h | 3 + 9 files changed, 145 insertions(+), 36 deletions(-) diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 4c2c5f05..0b66d383 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -36,6 +36,9 @@ #include "LocationUtil.h" #include "BatchingAPIClient.h" +#include "limits.h" + + namespace android { namespace hardware { namespace gnss { @@ -48,7 +51,7 @@ static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions BatchingAPIClient::BatchingAPIClient(const sp& callback) : LocationAPIClientBase(), mGnssBatchingCbIface(callback), - mDefaultId(42), + mDefaultId(UINT_MAX), mLocationCapabilitiesMask(0) { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); @@ -60,8 +63,9 @@ BatchingAPIClient::BatchingAPIClient(const sp& callback) locationCallbacks.trackingCb = nullptr; locationCallbacks.batchingCb = nullptr; if (mGnssBatchingCbIface != nullptr) { - locationCallbacks.batchingCb = [this](size_t count, Location* location) { - onBatchingCb(count, location); + locationCallbacks.batchingCb = [this](size_t count, Location* location, + BatchingOptions batchOptions) { + onBatchingCb(count, location, batchOptions); }; } locationCallbacks.geofenceBreachCb = nullptr; @@ -134,13 +138,13 @@ int BatchingAPIClient::stopSession() void BatchingAPIClient::getBatchedLocation(int last_n_locations) { LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations); - locAPIGetBatchedLocations(last_n_locations); + locAPIGetBatchedLocations(mDefaultId, last_n_locations); } void BatchingAPIClient::flushBatchedLocations() { LOC_LOGD("%s]: ()", __FUNCTION__); - locAPIGetBatchedLocations(SIZE_MAX); + locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); } void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) @@ -149,7 +153,7 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa mLocationCapabilitiesMask = capabilitiesMask; } -void BatchingAPIClient::onBatchingCb(size_t count, Location* location) +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); if (mGnssBatchingCbIface != nullptr && count > 0) { diff --git a/android/location_api/BatchingAPIClient.h b/android/location_api/BatchingAPIClient.h index a34c211e..c951a83c 100644 --- a/android/location_api/BatchingAPIClient.h +++ b/android/location_api/BatchingAPIClient.h @@ -58,7 +58,7 @@ public: // callbacks void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; - void onBatchingCb(size_t count, Location* location) final; + void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; private: sp mGnssBatchingCbIface; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e3269cf8..399e0ae5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1111,6 +1111,10 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; } + if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { + mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; + } + // geofence always supported mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; if (mApi.gnssConstellationConfig()) { diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index ed3cc6b6..a977f703 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -370,13 +370,13 @@ LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions } uint32_t -LocationAPI::startBatching(LocationOptions& locationOptions) +LocationAPI::startBatching(LocationOptions& locationOptions, BatchingOptions &batchingOptions) { uint32_t id = 0; pthread_mutex_lock(&gDataMutex); if (gData.flpInterface != NULL) { - id = gData.flpInterface->startBatching(this, locationOptions); + id = gData.flpInterface->startBatching(this, locationOptions, batchingOptions); } else { LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", __func__, __LINE__, this); @@ -402,14 +402,16 @@ LocationAPI::stopBatching(uint32_t id) } void -LocationAPI::updateBatchingOptions(uint32_t id, LocationOptions& locationOptions) +LocationAPI::updateBatchingOptions(uint32_t id, + LocationOptions& locationOptions, BatchingOptions& batchOptions) { pthread_mutex_lock(&gDataMutex); if (gData.flpInterface != NULL) { gData.flpInterface->updateBatchingOptions(this, id, - locationOptions); + locationOptions, + batchOptions); } else { LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", __func__, __LINE__, this); diff --git a/location/LocationAPI.h b/location/LocationAPI.h index bda68794..bc519273 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -32,6 +32,7 @@ #include #include #include +#include #define GNSS_NI_REQUESTOR_MAX 256 #define GNSS_NI_MESSAGE_ID_MAX 2048 @@ -140,6 +141,8 @@ typedef enum { LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7), // supports debug nmea sentences in the debugNmeaCallback LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8), + // support outdoor trip batching + LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9) } LocationCapabilitiesBits; typedef enum { @@ -298,6 +301,17 @@ typedef enum { GNSS_SUPL_MODE_MSA, } GnssSuplMode; +typedef enum { + BATCHING_MODE_ROUTINE = 0, + BATCHING_MODE_TRIP +} BatchingMode; + +typedef enum { + BATCHING_STATUS_TRIP_COMPLETED = 0, + BATCHING_STATUS_POSITION_AVAILABE, + BATCHING_STATUS_POSITION_UNAVAILABLE +} BatchingStatus; + typedef uint16_t GnssMeasurementsAdrStateMask; typedef enum { GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, @@ -439,6 +453,16 @@ typedef struct { GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted } LocationOptions; +typedef struct { + size_t size; + BatchingMode batchingMode; +} BatchingOptions; + +typedef struct { + size_t size; + BatchingStatus batchingStatus; +} BatchingStatusInfo; + typedef struct { size_t size; // set to sizeof(GeofenceOption) GeofenceBreachTypeMask breachTypeMask; // bitwise OR of GeofenceBreachTypeBits @@ -657,9 +681,15 @@ typedef std::function batchingCallback; +typedef std::function & listOfCompletedTrips +)> batchingStatusCallback; + /* Gives GNSS Location information, optional can be NULL gnssLocationInfoCallback is called only during a tracking session broadcasted to all clients, no matter if a session has started by client */ @@ -721,6 +751,7 @@ typedef struct { gnssSvCallback gnssSvCb; // optional gnssNmeaCallback gnssNmeaCb; // optional gnssMeasurementsCallback gnssMeasurementsCb; // optional + batchingStatusCallback batchingStatusCb; // optional } LocationCallbacks; class LocationAPI @@ -788,7 +819,7 @@ public: LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ - uint32_t startBatching(LocationOptions&); // returns session id + uint32_t startBatching(LocationOptions&, BatchingOptions&); // returns session id /* stopBatching stops a batching session associated with id parameter. responseCallback returns: @@ -801,7 +832,7 @@ public: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ - void updateBatchingOptions(uint32_t id, LocationOptions&); + void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&); /* getBatchedLocations gets a number of locations that are currently stored/batched on the low power processor, delivered by the batchingCallback passed in createInstance. diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index b89b68cb..4d501199 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -221,6 +221,7 @@ LocationAPIRequest* LocationAPIControlClient::getRequestBySession(uint32_t sessi // LocationAPIClientBase LocationAPIClientBase::LocationAPIClientBase() : mGeofenceBreachCallback(nullptr), + mBatchingStatusCallback(nullptr), mLocationAPI(nullptr), mBatchSize(-1) { @@ -260,6 +261,14 @@ void LocationAPIClientBase::locAPISetCallbacks(LocationCallbacks& locationCallba onCollectiveResponseCb(count, errors, ids); }; + if (locationCallbacks.batchingStatusCb != nullptr) { + mBatchingStatusCallback = locationCallbacks.batchingStatusCb; + locationCallbacks.batchingStatusCb = + [this](BatchingStatusInfo batchStatus, std::list & tripCompletedList) { + beforeBatchingStatusCb(batchStatus, tripCompletedList); + }; + } + if (mLocationAPI == nullptr ) { mLocationAPI = LocationAPI::createInstance(locationCallbacks); } else { @@ -360,7 +369,7 @@ int32_t LocationAPIClientBase::locAPIGetBatchSize() uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t sessionMode, - LocationOptions& options) + LocationOptions& locationOptions) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); @@ -374,18 +383,29 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session uint32_t batchingSession = 0; if (sessionMode == SESSION_MODE_ON_FIX) { - trackingSession = mLocationAPI->startTracking(options); + trackingSession = mLocationAPI->startTracking(locationOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); mRequestQueues[REQUEST_SESSION].push(new StartTrackingRequest(*this)); - } else if (sessionMode == SESSION_MODE_ON_FULL) { - batchingSession = mLocationAPI->startBatching(options); + } else if ((sessionMode == SESSION_MODE_ON_FULL) || + (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + // Fill in the batch mode + BatchingOptions batchOptions = {}; + batchOptions.size = sizeof(BatchingOptions); + batchOptions.batchingMode = BATCHING_MODE_ROUTINE; + if (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) { + batchOptions.batchingMode = BATCHING_MODE_TRIP; + } + + batchingSession = mLocationAPI->startBatching(locationOptions, batchOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); mRequestQueues[REQUEST_SESSION].setSession(batchingSession); mRequestQueues[REQUEST_SESSION].push(new StartBatchingRequest(*this)); } - uint32_t session = - (sessionMode == SESSION_MODE_ON_FULL) ? batchingSession : trackingSession; + uint32_t session = ((sessionMode == SESSION_MODE_ON_FULL || + (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) ? + batchingSession : trackingSession); + SessionEntity entity; entity.id = id; entity.trackingSession = trackingSession; @@ -418,7 +438,8 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) if (sMode == SESSION_MODE_ON_FIX) { mRequestQueues[REQUEST_SESSION].push(new StopTrackingRequest(*this)); mLocationAPI->stopTracking(trackingSession); - } else if (sMode == SESSION_MODE_ON_FULL) { + } else if ((sMode == SESSION_MODE_ON_FULL) || + (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { mRequestQueues[REQUEST_SESSION].push(new StopBatchingRequest(*this)); mLocationAPI->stopBatching(batchingSession); } else { @@ -456,7 +477,8 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t mRequestQueues[REQUEST_SESSION].push(new UpdateTrackingOptionsRequest(*this)); if (sMode == SESSION_MODE_ON_FIX) { mLocationAPI->updateTrackingOptions(trackingSession, options); - } else if (sMode == SESSION_MODE_ON_FULL) { + } else if ((sMode == SESSION_MODE_ON_FULL) || + (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { // stop batching // batchingSession will be removed from mSessionBiDict soon, // so we don't need to add a new request to mRequestQueues[REQUEST_SESSION]. @@ -471,10 +493,18 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t } else { LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); } - } else if (sessionMode == SESSION_MODE_ON_FULL) { + } else if ((sessionMode == SESSION_MODE_ON_FULL) || + (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) { // we only add an UpdateBatchingOptionsRequest to mRequestQueues[REQUEST_SESSION], // even if this update request will stop tracking and then start batching. mRequestQueues[REQUEST_SESSION].push(new UpdateBatchingOptionsRequest(*this)); + BatchingOptions batchOptions = {}; + batchOptions.size = sizeof(BatchingOptions); + batchOptions.batchingMode = BATCHING_MODE_ROUTINE; + if (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) { + batchOptions.batchingMode = BATCHING_MODE_TRIP; + } + if (sMode == SESSION_MODE_ON_FIX) { // stop tracking // trackingSession will be removed from mSessionBiDict soon, @@ -483,12 +513,13 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t trackingSession = 0; // start batching - batchingSession = mLocationAPI->startBatching(options); + batchingSession = mLocationAPI->startBatching(options, batchOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); mRequestQueues[REQUEST_SESSION].setSession(batchingSession); - } else if (sMode == SESSION_MODE_ON_FULL) { - mLocationAPI->updateBatchingOptions(batchingSession, options); + } else if ((sMode == SESSION_MODE_ON_FULL) || + (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + mLocationAPI->updateBatchingOptions(batchingSession, options, batchOptions); } else { LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); } @@ -497,8 +528,10 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t LOC_LOGE("%s:%d] unknown mode %d.", __FUNCTION__, __LINE__, sessionMode); } - uint32_t session = - (sessionMode == SESSION_MODE_ON_FULL) ? batchingSession : trackingSession; + uint32_t session = ((sessionMode == SESSION_MODE_ON_FULL) || + (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) ? + batchingSession : trackingSession); + entity.trackingSession = trackingSession; entity.batchingSession = batchingSession; entity.sessionMode = sessionMode; @@ -511,22 +544,23 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t retVal = LOCATION_ERROR_ID_UNKNOWN; LOC_LOGE("%s:%d] session %d is not exist.", __FUNCTION__, __LINE__, id); } - } pthread_mutex_unlock(&mMutex); return retVal; } -void LocationAPIClientBase::locAPIGetBatchedLocations(size_t count) +void LocationAPIClientBase::locAPIGetBatchedLocations(uint32_t id, size_t count) { pthread_mutex_lock(&mMutex); if (mLocationAPI) { uint32_t session = 0; session = mRequestQueues[REQUEST_SESSION].getSession(); if (session > 0) { + SessionEntity entity = mSessionBiDict.getExtById(id); + uint32_t batchingSession = entity.batchingSession; mRequestQueues[REQUEST_SESSION].push(new GetBatchedLocationsRequest(*this)); - mLocationAPI->getBatchedLocations(session, count); - } else { + mLocationAPI->getBatchedLocations(batchingSession, count); + } else { LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } @@ -794,6 +828,29 @@ void LocationAPIClientBase::beforeGeofenceBreachCb( free(ids); } +void LocationAPIClientBase::beforeBatchingStatusCb(BatchingStatusInfo batchStatus, + std::list & tripCompletedList) { + + // map the trip ids to the client ids + std::list tripCompletedClientIdList; + tripCompletedClientIdList.clear(); + + if (batchStatus.batchingStatus == BATCHING_STATUS_TRIP_COMPLETED) { + for (auto itt = tripCompletedList.begin(); itt != tripCompletedList.end(); itt++) { + if (mSessionBiDict.hasSession(*itt)) { + SessionEntity sessEntity = mSessionBiDict.getExtBySession(*itt); + + if (sessEntity.sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) { + tripCompletedClientIdList.push_back(sessEntity.id); + mSessionBiDict.rmBySession(*itt); + } + } + } + } + + mBatchingStatusCallback(batchStatus, tripCompletedClientIdList); +} + void LocationAPIClientBase::onResponseCb(LocationError error, uint32_t id) { if (error != LOCATION_ERROR_SUCCESS) { diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 19d585ad..dca6f1a4 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -41,6 +41,7 @@ enum SESSION_MODE { SESSION_MODE_NONE = 0, SESSION_MODE_ON_FULL, SESSION_MODE_ON_FIX, + SESSION_MODE_ON_TRIP_COMPLETED }; enum REQUEST_TYPE { @@ -194,7 +195,7 @@ public: uint32_t locAPIStopSession(uint32_t id); uint32_t locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, LocationOptions& options); - void locAPIGetBatchedLocations(size_t count); + void locAPIGetBatchedLocations(uint32_t id, size_t count); uint32_t locAPIAddGeofences(size_t count, uint32_t* ids, GeofenceOption* options, GeofenceInfo* data); @@ -226,7 +227,12 @@ public: inline virtual void onGnssLocationInfoCb( GnssLocationInfoNotification /*gnssLocationInfoNotification*/) {} - inline virtual void onBatchingCb(size_t /*count*/, Location* /*location*/) {} + inline virtual void onBatchingCb(size_t /*count*/, Location* /*location*/, + BatchingOptions /*batchingOptions*/) {} + inline virtual void onBatchingStatusCb(BatchingStatusInfo /*batchingStatus*/, + std::list &/*listOfCompletedTrips*/) {} + void beforeBatchingStatusCb(BatchingStatusInfo batchStatus, + std::list & tripCompletedList); inline virtual void onStartBatchingCb(LocationError /*error*/) {} inline virtual void onStopBatchingCb(LocationError /*error*/) {} inline virtual void onUpdateBatchingOptionsCb(LocationError /*error*/) {} @@ -525,6 +531,7 @@ private: pthread_mutex_t mMutex; geofenceBreachCallback mGeofenceBreachCallback; + batchingStatusCallback mBatchingStatusCallback; LocationAPI* mLocationAPI; diff --git a/location/location_interface.h b/location/location_interface.h index c93f135c..d7948827 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -67,9 +67,10 @@ struct FlpInterface { uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); void (*stopTracking)(LocationAPI* client, uint32_t id); - uint32_t (*startBatching)(LocationAPI* client, LocationOptions&); + uint32_t (*startBatching)(LocationAPI* client, LocationOptions&, BatchingOptions&); void (*stopBatching)(LocationAPI* client, uint32_t id); - void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, LocationOptions&); + void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, LocationOptions&, + BatchingOptions&); void (*getBatchedLocations)(LocationAPI* client, uint32_t id, size_t count); void (*getPowerStateChanges)(void* powerStateCb); }; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index decea5da..a6a8d5d2 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -559,6 +559,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT, // Geofence dwell report LOC_API_ADAPTER_REQUEST_SRN_DATA, // request srn data from AP LOC_API_ADAPTER_REQUEST_POSITION_INJECTION, // Position injection request + LOC_API_ADAPTER_BATCH_STATUS, // batch status LOC_API_ADAPTER_EVENT_MAX }; @@ -593,6 +594,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REPORT_GENFENCE_DWELL (1< Date: Wed, 26 Jul 2017 18:57:48 +0530 Subject: [PATCH 543/945] Updating error print in AGPS state machine Minor update to print error message in AGPS state machine only when valid. CRs-Fixed: 2083361 Change-Id: Id8436d21a61b58ee8b5e83814225cbd34d0ea0d4 --- gnss/Agps.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index dcb9ad22..22582d47 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -209,7 +209,10 @@ void AgpsStateMachine::processAgpsEventReleased(){ switch (mState){ case AGPS_STATE_RELEASED: - LOC_LOGE("Unexpected event RELEASED in state %d", mState); + /* Subscriber list should be empty if we are in released state */ + if (!mSubscriberList.empty()) { + LOC_LOGE("Unexpected event RELEASED in RELEASED state"); + } break; case AGPS_STATE_ACQUIRED: From 2481cf3f820518f5721b21fafbce5a90e43cc67f Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 27 Jul 2017 17:20:24 +0530 Subject: [PATCH 544/945] KW Warning Fixes CRs-Fixed: 2082072 Change-Id: I1189acd521d4e4cea3b8a9545a5486f29caaa0fe --- location/LocationAPIClientBase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 4d501199..f8a05aa7 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -600,6 +600,7 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) if (sessions == NULL) { LOC_LOGE("%s:%d] Failed to allocate %d bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + pthread_mutex_unlock(&mMutex); return; } @@ -634,6 +635,7 @@ void LocationAPIClientBase::locAPIModifyGeofences( if (sessions == NULL) { LOC_LOGE("%s:%d] Failed to allocate %d bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + pthread_mutex_unlock(&mMutex); return; } @@ -668,6 +670,7 @@ void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) if (sessions == NULL) { LOC_LOGE("%s:%d] Failed to allocate %d bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + pthread_mutex_unlock(&mMutex); return; } @@ -702,6 +705,7 @@ void LocationAPIClientBase::locAPIResumeGeofences( if (sessions == NULL) { LOC_LOGE("%s:%d] Failed to allocate %d bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + pthread_mutex_unlock(&mMutex); return; } @@ -740,6 +744,7 @@ void LocationAPIClientBase::locAPIRemoveAllGeofences() if (sessions == NULL) { LOC_LOGE("%s:%d] Failed to allocate %d bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); + pthread_mutex_unlock(&mMutex); return; } From c1da12aa2ee46d736fdce10351d1fa7c69f75824 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 27 Jul 2017 10:44:54 -0700 Subject: [PATCH 545/945] Prevent gps stuck on if multiple starts are called If framework happens to call start of session multiple times without calling stop first, it can cause a session to get stuck on without any way to stop it CRs-fixed: 2083756 Change-Id: Ic871d870ca67c9465438f8494e381bfbcb85a830 --- location/LocationAPIClientBase.cpp | 24 +++++++++++++++--------- location/LocationAPIClientBase.h | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 465b76d6..1175770e 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -223,7 +223,8 @@ LocationAPIClientBase::LocationAPIClientBase() : mGeofenceBreachCallback(nullptr), mBatchingStatusCallback(nullptr), mLocationAPI(nullptr), - mBatchSize(-1) + mBatchSize(-1), + mTracking(false) { // use recursive mutex, in case callback come from the same thread @@ -303,14 +304,18 @@ uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationAPI) { - uint32_t session = mLocationAPI->startTracking(options); - LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); - // onResponseCb might be called from other thread immediately after - // startTracking returns, so we are not going to unlock mutex - // until StartTrackingRequest is pushed into mRequestQueues[REQUEST_TRACKING] - mRequestQueues[REQUEST_TRACKING].reset(session); - mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); - + if (mTracking) { + LOC_LOGW("%s:%d] Existing tracking session present", __FUNCTION__, __LINE__); + } else { + uint32_t session = mLocationAPI->startTracking(options); + LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, session); + // onResponseCb might be called from other thread immediately after + // startTracking returns, so we are not going to unlock mutex + // until StartTrackingRequest is pushed into mRequestQueues[REQUEST_TRACKING] + mRequestQueues[REQUEST_TRACKING].reset(session); + mRequestQueues[REQUEST_TRACKING].push(new StartTrackingRequest(*this)); + mTracking = true; + } retVal = LOCATION_ERROR_SUCCESS; } @@ -328,6 +333,7 @@ void LocationAPIClientBase::locAPIStopTracking() if (session > 0) { mRequestQueues[REQUEST_TRACKING].push(new StopTrackingRequest(*this)); mLocationAPI->stopTracking(session); + mTracking = false; } else { LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index dca6f1a4..a8560548 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -539,6 +539,7 @@ private: BiDict mGeofenceBiDict; BiDict mSessionBiDict; int32_t mBatchSize; + bool mTracking; }; #endif /* LOCATION_API_CLINET_BASE_H */ From 9ae216a6c0ce289bcc5a4bda3485dcb593ea357f Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 19 Jul 2017 15:30:35 -0700 Subject: [PATCH 546/945] Update capabilites when suplmode changes Location capabilities can change when suplmode is updated, but we need to send the capabilites callback to all clients with the new capabilities when suplmode changes. Change-Id: Ib7c9b5ef13259fe9305b3efbb03db3433ed26675 CRs-Fixed: 2079414 --- gnss/GnssAdapter.cpp | 83 ++++++++++++++++++++++++++------------------ gnss/GnssAdapter.h | 2 ++ 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 399e0ae5..0b557def 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -771,6 +771,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) ContextBase::mGps_conf.SUPL_MODE = newSuplMode; mAdapter.getUlpProxy()->setCapabilities( ContextBase::getCarrierCapabilities()); + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { @@ -1085,14 +1086,11 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) struct MsgRequestCapabilities : public LocMsg { GnssAdapter& mAdapter; - LocApiBase& mApi; LocationAPI* mClient; inline MsgRequestCapabilities(GnssAdapter& adapter, - LocApiBase& api, LocationAPI* client) : LocMsg(), mAdapter(adapter), - mApi(api), mClient(client) {} inline virtual void proc() const { LocationCallbacks callbacks = mAdapter.getClientCallbacks(mClient); @@ -1101,41 +1099,58 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) return; } - LocationCapabilitiesMask mask = 0; - // time based tracking always supported - mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; - if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)){ - mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | - LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; - } - if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { - mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; - } - if (mApi.isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { - mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; - } - - // geofence always supported - mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; - if (mApi.gnssConstellationConfig()) { - mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; - } - uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities(); - if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) { - mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT; - } - if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { - mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; - } - if (mApi.isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { - mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; - } - + LocationCapabilitiesMask mask = mAdapter.getCapabilities(); callbacks.capabilitiesCb(mask); } }; - sendMsg(new MsgRequestCapabilities(*this, *mLocApi, client)); + sendMsg(new MsgRequestCapabilities(*this, client)); +} + +LocationCapabilitiesMask +GnssAdapter::getCapabilities() +{ + LocationCapabilitiesMask mask = 0; + uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities(); + // time based tracking always supported + mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; + // geofence always supported + mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; + if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) { + mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT; + } + if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { + mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; + } + if (mLocApi == nullptr) + return mask; + if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { + mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | + LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; + } + if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; + } + if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { + mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; + } + if (mLocApi->gnssConstellationConfig()) { + mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; + } + if (mLocApi->isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; + } + return mask; +} + +void +GnssAdapter::broadcastCapabilities(LocationCapabilitiesMask mask) +{ + for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.capabilitiesCb) { + it->second.capabilitiesCb(mask); + } + } } LocationCallbacks diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index c07fa2b5..2db97589 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -139,6 +139,8 @@ public: void updateClientsEventMask(); void stopClientSessions(LocationAPI* client); LocationCallbacks getClientCallbacks(LocationAPI* client); + LocationCapabilitiesMask getCapabilities(); + void broadcastCapabilities(LocationCapabilitiesMask); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ From 4c9c7839892c4272c30dcf3288bbe4d52649bced Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Mon, 3 Jul 2017 21:00:31 +0800 Subject: [PATCH 547/945] Clean up compiler warning message CRs-Fixed: 2070597 Change-Id: Ic57f5211a4e4b9112888435d54df7a361bcb6767 --- android/Android.mk | 2 + android/location_api/GnssAPIClient.cpp | 4 +- core/Android.mk | 2 + core/LocAdapterBase.cpp | 28 ++-- core/LocApiBase.cpp | 122 +++++++++--------- core/SystemStatus.cpp | 14 +- core/loc_core_log.cpp | 2 +- gnss/Android.mk | 2 + gnss/GnssAdapter.cpp | 7 +- location/Android.mk | 1 + location/LocationAPIClientBase.cpp | 13 +- utils/Android.mk | 2 + utils/LocThread.cpp | 4 +- utils/LocTimer.cpp | 6 +- utils/loc_misc_utils.cpp | 4 +- utils/msg_q.c | 6 +- .../elapsed_millis_since_boot.cpp | 2 +- .../loc_pla/src/Android.mk | 20 ++- .../src/platform_lib_property_service.cpp | 4 +- .../loc_stub/src/Android.mk | 2 +- .../loc_stub/src/loc_stub_android_runtime.cpp | 2 +- .../src/loc_stub_property_service.cpp | 2 +- .../loc_stub/src/loc_stub_sched_policy.cpp | 2 +- .../loc_stub/src/loc_stub_time.cpp | 2 +- 24 files changed, 146 insertions(+), 109 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index 58d30f0d..03ea1f3c 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -46,6 +46,7 @@ LOCAL_SHARED_LIBRARIES += \ libloc_pla \ liblocation_api \ +LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) BUILD_GNSS_HIDL_SERVICE := true @@ -86,5 +87,6 @@ LOCAL_SHARED_LIBRARIES += \ libhidltransport \ android.hardware.gnss@1.0 \ +LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 52705762..0cccb27a 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -165,7 +165,7 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) mLocationOptions.mode = GNSS_SUPL_MODE_MSA; else { - LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, mode); + LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode); retVal = false; } locAPIUpdateTrackingOptions(mLocationOptions); @@ -185,7 +185,7 @@ void GnssAPIClient::gnssNiRespond(int32_t notifId, else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) data = GNSS_NI_RESPONSE_NO_RESPONSE; else { - LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, userResponse); + LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, (int)userResponse); return; } locAPIGnssNiResponse(notifId, data); diff --git a/core/Android.mk b/core/Android.mk index cc993334..ee07c190 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -42,6 +42,8 @@ LOCAL_HEADER_LIBRARIES := \ libloc_pla_headers \ liblocation_api_headers +LOCAL_CFLAGS += $(GNSS_CFLAGS) + include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 7cb4086b..9d89c4b5 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromUlp) { + bool /*fromUlp*/) { if (mLocAdapterProxyBase != NULL) { mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, (GpsLocationExtended&)locationExtended, @@ -91,29 +91,29 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp) + reportSvEvent(const GnssSvNotification& /*svNotify*/, bool /*fromUlp*/) DEFAULT_IMPL() void LocAdapterBase:: - reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) + reportSvMeasurementEvent(GnssSvMeasurementSet &/*svMeasurementSet*/) DEFAULT_IMPL() void LocAdapterBase:: - reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) + reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/) DEFAULT_IMPL() void LocAdapterBase:: - reportStatus(LocGpsStatusValue status) + reportStatus(LocGpsStatusValue /*status*/) DEFAULT_IMPL() void LocAdapterBase:: - reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) + reportNmeaEvent(const char* /*nmea*/, size_t /*length*/, bool /*fromUlp*/) DEFAULT_IMPL() bool LocAdapterBase:: - reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength) + reportXtraServer(const char* /*url1*/, const char* /*url2*/, + const char* /*url3*/, const int /*maxlength*/) DEFAULT_IMPL(false) bool LocAdapterBase:: @@ -129,15 +129,15 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestATL(int connHandle, LocAGpsType agps_type) + requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/) DEFAULT_IMPL(false) bool LocAdapterBase:: - releaseATL(int connHandle) + releaseATL(int /*connHandle*/) DEFAULT_IMPL(false) bool LocAdapterBase:: - requestSuplES(int connHandle) + requestSuplES(int /*connHandle*/) DEFAULT_IMPL(false) bool LocAdapterBase:: @@ -149,15 +149,15 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data) + requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/) DEFAULT_IMPL(false) void LocAdapterBase:: - reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify) + reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurementsNotify*/) DEFAULT_IMPL() bool LocAdapterBase:: - reportWwanZppFix(LocGpsLocation &zppLoc) + reportWwanZppFix(LocGpsLocation &/*zppLoc*/) DEFAULT_IMPL(false) } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 2dcd4cd1..6cc00b13 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -30,6 +30,7 @@ #define LOG_TAG "LocSvc_LocApiBase" #include +#include #include #include #include @@ -96,10 +97,10 @@ struct LocSsrMsg : public LocMsg { mLocApi->close(); mLocApi->open(mLocApi->getEvtMask()); } - inline void locallog() { + inline void locallog() const { LOC_LOGV("LocSsrMsg"); } - inline virtual void log() { + inline virtual void log() const { locallog(); } }; @@ -116,11 +117,11 @@ struct LocOpenMsg : public LocMsg { inline virtual void proc() const { mLocApi->open(mMask); } - inline void locallog() { + inline void locallog() const { LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", __func__, __LINE__, mMask); } - inline virtual void log() { + inline virtual void log() const { locallog(); } }; @@ -128,8 +129,8 @@ struct LocOpenMsg : public LocMsg { LocApiBase::LocApiBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : - mExcludedMask(excludedMask), mMsgTask(msgTask), - mMask(0), mSupportedMsg(0), mContext(context) + mMsgTask(msgTask), mContext(context), mSupportedMsg(0), + mMask(0), mExcludedMask(excludedMask) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported)); @@ -235,9 +236,10 @@ void LocApiBase::reportPosition(UlpLocation& location, // print the location info before delivering LOC_LOGD("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 " + "timestamp: %" PRId64 "\n rawDataSize: %d\n rawData: %p\n " "Session status: %d\n Technology mask: %u\n " - "SV used in fix (gps/glo/bds/gal/qzss) : (%x/%x/%x/%x/%x)", + "SV used in fix (gps/glo/bds/gal/qzss) : \ + (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")", location.gpsLocation.flags, location.position_source, location.gpsLocation.latitude, location.gpsLocation.longitude, location.gpsLocation.altitude, location.gpsLocation.speed, @@ -268,16 +270,16 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) "QZSS", "BEIDOU", "GALILEO" }; // print the SV info before delivering - LOC_LOGV("num sv: %d\n" + LOC_LOGV("num sv: %zu\n" " sv: constellation svid cN0" " elevation azimuth flags", svNotify.count); - for (int i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) { + for (size_t i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) { if (svNotify.gnssSvs[i].type > sizeof(constellationString) / sizeof(constellationString[0]) - 1) { svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN; } - LOC_LOGV(" %03d: %*s %02d %f %f %f 0x%02X", + LOC_LOGV(" %03zu: %*s %02d %f %f %f 0x%02X", i, 13, constellationString[svNotify.gnssSvs[i].type], @@ -406,7 +408,7 @@ void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measure } enum loc_api_adapter_err LocApiBase:: - open(LOC_API_ADAPTER_EVENT_MASK_T mask) + open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -414,7 +416,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - startFix(const LocPosMode& posMode) + startFix(const LocPosMode& /*posMode*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -422,27 +424,27 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - deleteAidingData(const GnssAidingData& data) + deleteAidingData(const GnssAidingData& /*data*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - enableData(int enable) + enableData(int /*enable*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setAPN(char* apn, int len) + 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) + injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty) + setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setXtraData(char* data, int length) + setXtraData(char* /*data*/, int /*length*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -450,83 +452,83 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsBearerType bear, LocAGpsType agpsType) + atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, + AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - atlCloseStatus(int handle, int is_succ) + atlCloseStatus(int /*handle*/, int /*is_succ*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setPositionMode(const LocPosMode& posMode) + setPositionMode(const LocPosMode& /*posMode*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setServer(const char* url, int len) + setServer(const char* /*url*/, int /*len*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setServer(unsigned int ip, int port, LocServerType type) + setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - informNiResponse(GnssNiResponse userResponse, const void* passThroughData) + informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setSUPLVersion(GnssConfigSuplVersion version) + setSUPLVersion(GnssConfigSuplVersion /*version*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setNMEATypes (uint32_t typesMask) + setNMEATypes (uint32_t /*typesMask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setLPPConfig(GnssConfigLppProfile profile) + setLPPConfig(GnssConfigLppProfile /*profile*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage, - int sensorProvider) + 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) + 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) + 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) LocationError LocApiBase:: - setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol) + setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP) + setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP) + setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: @@ -549,7 +551,7 @@ enum loc_api_adapter_err LocApiBase:: } int LocApiBase:: - initDataServiceClient(bool isDueToSsr) + initDataServiceClient(bool /*isDueToSsr*/) DEFAULT_IMPL(-1) int LocApiBase:: @@ -569,13 +571,13 @@ void LocApiBase:: DEFAULT_IMPL() LocationError LocApiBase:: - setGpsLock(GnssConfigGpsLock lock) + setGpsLock(GnssConfigGpsLock /*lock*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) void LocApiBase:: - installAGpsCert(const LocDerEncodedCertificate* pData, - size_t length, - uint32_t slotBitMask) + installAGpsCert(const LocDerEncodedCertificate* /*pData*/, + size_t /*length*/, + uint32_t /*slotBitMask*/) DEFAULT_IMPL() int LocApiBase:: @@ -583,7 +585,7 @@ int LocApiBase:: DEFAULT_IMPL(-1) LocationError LocApiBase:: - setXtraVersionCheck(uint32_t check) + setXtraVersionCheck(uint32_t /*check*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) bool LocApiBase:: diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 939005d0..50cb4edb 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -28,6 +28,7 @@ */ #define LOG_TAG "LocSvc_SystemStatus" +#include #include #include #include @@ -183,7 +184,7 @@ public: { memset(&mM1, 0, sizeof(mM1)); if (mField.size() < eMax) { - LOC_LOGE("PQWM1parser - invalid size=%d", mField.size()); + LOC_LOGE("PQWM1parser - invalid size=%zu", mField.size()); mM1.mTimeValid = 0; return; } @@ -615,7 +616,7 @@ public: : SystemStatusNmeaBase(str_in, len_in) { if (mField.size() < eMax) { - LOC_LOGE("PQWP7parser - invalid size=%d", mField.size()); + LOC_LOGE("PQWP7parser - invalid size=%zu", mField.size()); return; } for (uint32_t i=0; i #include #include #include @@ -2453,7 +2454,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ return; } else { mAgpsCbInfo = cbInfo; - LOC_LOGI("Registering AGPS CB 0x%x with priority %d", + LOC_LOGI("Registering AGPS CB %p with priority %d", mAgpsCbInfo.statusV4Cb, mAgpsCbInfo.cbPriority); } @@ -2896,7 +2897,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) reports.mTimeAndClock.back().mLeapSecUnc)*1000); r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); - LOC_LOGV("getDebugReport - timeestimate=%ld unc=%f frequnc=%f", + LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f", r.mTime.timeEstimate, r.mTime.timeUncertaintyNs, r.mTime.frequencyUncertaintyNsPerSec); } @@ -2910,7 +2911,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_QZSS, reports); convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_BEIDOU, reports); convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GALILEO, reports); - LOC_LOGV("getDebugReport - satellite=%lu", r.mSatelliteInfo.size()); + LOC_LOGV("getDebugReport - satellite=%zu", r.mSatelliteInfo.size()); return true; } diff --git a/location/Android.mk b/location/Android.mk index 728bdb45..6ac8e361 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -30,6 +30,7 @@ LOCAL_HEADER_LIBRARIES := \ LOCAL_PRELINK_MODULE := false +LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index d8eae3f7..02bd3dda 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -30,6 +30,7 @@ #define LOG_TAG "LocSvc_APIClientBase" #include +#include #include #include "LocationAPIClientBase.h" @@ -598,7 +599,7 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); pthread_mutex_unlock(&mMutex); return; @@ -633,7 +634,7 @@ void LocationAPIClientBase::locAPIModifyGeofences( if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); pthread_mutex_unlock(&mMutex); return; @@ -668,7 +669,7 @@ void LocationAPIClientBase::locAPIPauseGeofences(size_t count, uint32_t* ids) if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); pthread_mutex_unlock(&mMutex); return; @@ -703,7 +704,7 @@ void LocationAPIClientBase::locAPIResumeGeofences( if (mLocationAPI) { uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); pthread_mutex_unlock(&mMutex); return; @@ -742,7 +743,7 @@ void LocationAPIClientBase::locAPIRemoveAllGeofences() size_t count = sessionsVec.size(); uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %d bytes !", + LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", __FUNCTION__, __LINE__, sizeof(uint32_t) * count); pthread_mutex_unlock(&mMutex); return; @@ -792,7 +793,7 @@ void LocationAPIClientBase::beforeGeofenceBreachCb( geofenceBreachCallback genfenceCallback = nullptr; if (ids == NULL) { - LOC_LOGE("%s:%d] Failed to alloc %d bytes", + LOC_LOGE("%s:%d] Failed to alloc %zu bytes", __FUNCTION__, __LINE__, sizeof(uint32_t) * geofenceBreachNotification.count); return; diff --git a/utils/Android.mk b/utils/Android.mk index eeef2237..3f3b83a1 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -51,6 +51,8 @@ LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false +LOCAL_CFLAGS += $(GNSS_CFLAGS) + include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index 685841e7..d112f616 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -65,7 +65,7 @@ public: // 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), + mRunnable(runnable), mJoinable(joinable), mThandle((pthread_t)NULL), mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) { // set up thread name, if nothing is passed in @@ -79,7 +79,7 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, mThandle = creator(threadName, threadMain, this); } else if (pthread_create(&mThandle, NULL, threadMain, this)) { // pthread_create() failed - mThandle = NULL; + mThandle = (pthread_t)NULL; } if (mThandle) { diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index c08bd354..5b653eb2 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -283,7 +283,8 @@ void LocTimerContainer::updateSoonestTime(LocTimerDelegate* priorTop) { // check if top has changed if (curTop != priorTop) { - struct itimerspec delay = {0}; + struct itimerspec delay; + memset(&delay, 0, sizeof(struct itimerspec)); bool toSetTime = false; // if tree is empty now, we remove poll and disarm timer if (!curTop) { @@ -374,7 +375,8 @@ void LocTimerContainer::expire() { } }; - struct itimerspec delay = {0}; + struct itimerspec delay; + memset(&delay, 0, sizeof(struct itimerspec)); timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); mPollTask->removePoll(*this); mMsgTask->sendMsg(new MsgTimerExpire(*this)); diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index 5d669916..fd3ee6b0 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -26,14 +26,14 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_misc_utils" #include #include #include #include #include -#define LOG_NDEBUG 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) diff --git a/utils/msg_q.c b/utils/msg_q.c index 10c4e485..e8b4ffe2 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -198,7 +198,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) 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); + LOC_LOGV("%s: Sending message with handle = %p\n", __FUNCTION__, msg_obj); if( p_msg_q->unblocked ) { @@ -214,7 +214,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Finished Sending message with handle = %p\n", __FUNCTION__, msg_obj); return rv; } @@ -260,7 +260,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGV("%s: Received message %p rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp index e8cb93a9..6c183a80 100644 --- a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp @@ -30,7 +30,7 @@ #include #include "platform_lib_time.h" -int64_t systemTime(int clock) +int64_t systemTime(int /*clock*/) { struct timeval t; t.tv_sec = t.tv_usec = 0; diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk index 98f25b3f..ab137175 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -1,3 +1,21 @@ +GNSS_CFLAGS := \ + -Werror \ + -Wno-error=unused-parameter \ + -Wno-error=format \ + -Wno-error=macro-redefined \ + -Wno-error=reorder \ + -Wno-error=missing-braces \ + -Wno-error=self-assign \ + -Wno-error=enum-conversion \ + -Wno-error=logical-op-parentheses \ + -Wno-error=null-arithmetic \ + -Wno-error=null-conversion \ + -Wno-error=parentheses-equality \ + -Wno-error=undefined-bool-conversion \ + -Wno-error=tautological-compare \ + -Wno-error=switch \ + -Wno-error=date-time + ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifneq ($(BUILD_TINY_ANDROID),true) #Compile this library only for builds with the latest modem image @@ -38,7 +56,7 @@ LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false - +LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp index 1cc63abb..dccdebcf 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp @@ -25,14 +25,14 @@ * 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 */ +#include "platform_lib_property_service.h" + 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/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk index 041ba643..08697cb5 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ b/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -37,7 +37,7 @@ LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false - +LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp index 1db69b24..068df4ef 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp @@ -30,7 +30,7 @@ namespace android { -pthread_t AndroidRuntime::createJavaThread(const char* name, +pthread_t AndroidRuntime::createJavaThread(const char* /*name*/, void (*start)(void *), void* arg) { pthread_t threadId = 0; diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp index f9d9e3ef..907ab02c 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp @@ -30,7 +30,7 @@ #include #include -int property_get(const char *key, char * value, const char *default_value) +int property_get(const char *key, char * value, const char */*default_value*/) { /* This will disable gps interface value[0] = '1'; diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp index 781be295..5e26245e 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp @@ -44,7 +44,7 @@ SIDE EFFECTS N/A ===========================================================================*/ -int set_sched_policy(int tid, SchedPolicy policy) +int set_sched_policy(int /*tid*/, SchedPolicy /*policy*/) { return 0; } diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp index 499cf008..48149a6c 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp @@ -31,7 +31,7 @@ #include #include -int64_t systemTime(int clock) +int64_t systemTime(int /*clock*/) { struct timeval t; t.tv_sec = t.tv_usec = 0; From 45c1850f21c56bd0a6e605271b35f1af88306555 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Fri, 4 Aug 2017 12:57:04 +0800 Subject: [PATCH 548/945] Ignore invalid location Do not report invalid locatin to HAL. Generate empty NEMA when status is LOC_SESS_FAILURE. Bug: 64286361 CRs-Fixed: 2087261 Change-Id: Id5c47052eef5cae951c020fa8061e2c761c1152d --- gnss/GnssAdapter.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 72011ad7..677a020d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1900,17 +1900,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, LocPosTechMask techMask) { bool reported = false; - if (LOC_SESS_FAILURE == status) { - Location invalidLocation = {}; - invalidLocation.size = sizeof(Location); - for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { - if (nullptr != it->second.trackingCb) { - it->second.trackingCb(invalidLocation); - } - } - reported = true; - } - // what's in the else if is... (line by line) + // what's in the 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 @@ -1920,7 +1910,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, // 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 == status && + if ((LOC_SESS_SUCCESS == status && ((LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID) & From e83b68d39b1ae2f30001ebd44fa60d5f4508015c Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 9 Aug 2017 16:15:04 +0800 Subject: [PATCH 549/945] Clear Location structure before convertion Set all members of Location to zero by default CRs-Fixed: 2087799 Change-Id: I01f7c96ff54a58f5f7ee812cd78b6fcccece4f02 --- gnss/GnssAdapter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 0b557def..174d8af0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -123,6 +123,7 @@ GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation const GpsLocationExtended& locationExtended, const LocPosTechMask techMask) { + memset(&out, 0, sizeof(Location)); out.size = sizeof(Location); if (LOC_GPS_LOCATION_HAS_LAT_LONG & locGpsLocation.flags) { out.flags |= LOCATION_HAS_LAT_LONG_BIT; From 54d6a878fd762775a713e26b17cb2819039a050d Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 8 Aug 2017 14:48:13 -0700 Subject: [PATCH 550/945] Fix potential deadlock in measurements report If Gnss Measurements callback is called at the same time as Gnss Measurements close is called, this will cause dead lock. Remove using mutex in this case and instead use a simple bool to know whether or not to call into a the callback. Bug: 63909793 Change-Id: I98d2be5ebd2ee0f36e4d2e31d20a74585089fe31 CRs-fixed: 2089716 --- android/location_api/MeasurementAPIClient.cpp | 54 +++++-------------- android/location_api/MeasurementAPIClient.h | 8 +-- 2 files changed, 13 insertions(+), 49 deletions(-) diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index e3ae9ad3..dd7ceac5 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -50,25 +50,14 @@ static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), - mLocationCapabilitiesMask(0) + mTracking(false) { LOC_LOGD("%s]: ()", __FUNCTION__); - pthread_mutex_init(&mLock, nullptr); - pthread_cond_init (&mCond, nullptr); - - // set default LocationOptions. - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = 1000; - mLocationOptions.minDistance = 0; - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; } MeasurementAPIClient::~MeasurementAPIClient() { LOC_LOGD("%s]: ()", __FUNCTION__); - pthread_cond_destroy(&mCond); - pthread_mutex_destroy(&mLock); } // for GpsInterface @@ -101,19 +90,14 @@ MeasurementAPIClient::measurementSetCallback(const sp& } locAPISetCallbacks(locationCallbacks); - - while (!mLocationCapabilitiesMask) { - LOC_LOGD("%s]: wait for capabilities...", __FUNCTION__); - pthread_mutex_lock(&mLock); - pthread_cond_wait(&mCond, &mLock); - pthread_mutex_unlock(&mLock); - } - if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) - mLocationOptions.mode = GNSS_SUPL_MODE_MSB; - else - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + LocationOptions options; + memset(&options, 0, sizeof(LocationOptions)); + options.size = sizeof(LocationOptions); + options.minInterval = 1000; + options.mode = GNSS_SUPL_MODE_STANDALONE; + mTracking = true; LOC_LOGD("%s]: start tracking session", __FUNCTION__); - locAPIStartTracking(mLocationOptions); + locAPIStartTracking(options); return IGnssMeasurement::GnssMeasurementStatus::SUCCESS; } @@ -121,30 +105,17 @@ MeasurementAPIClient::measurementSetCallback(const sp& // for GpsMeasurementInterface void MeasurementAPIClient::measurementClose() { LOC_LOGD("%s]: ()", __FUNCTION__); - pthread_mutex_lock(&mLock); - mGnssMeasurementCbIface = nullptr; - pthread_mutex_unlock(&mLock); + mTracking = false; locAPIStopTracking(); } // callbacks -void MeasurementAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) -{ - LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); - mLocationCapabilitiesMask = capabilitiesMask; - pthread_mutex_lock(&mLock); - pthread_cond_signal(&mCond); - pthread_mutex_unlock(&mLock); -} - void MeasurementAPIClient::onGnssMeasurementsCb( GnssMeasurementsNotification gnssMeasurementsNotification) { - LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssMeasurementsNotification.count); - // we don't need to lock the mutext - // if mGnssMeasurementCbIface is set to nullptr - if (mGnssMeasurementCbIface != nullptr) { - pthread_mutex_lock(&mLock); + LOC_LOGD("%s]: (count: %zu active: %zu)", + __FUNCTION__, gnssMeasurementsNotification.count, mTracking); + if (mTracking) { if (mGnssMeasurementCbIface != nullptr) { IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); @@ -154,7 +125,6 @@ void MeasurementAPIClient::onGnssMeasurementsCb( __func__, r.description().c_str()); } } - pthread_mutex_unlock(&mLock); } } diff --git a/android/location_api/MeasurementAPIClient.h b/android/location_api/MeasurementAPIClient.h index e2021926..422564d4 100644 --- a/android/location_api/MeasurementAPIClient.h +++ b/android/location_api/MeasurementAPIClient.h @@ -59,18 +59,12 @@ public: void measurementClose(); // callbacks we are interested in - void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; private: - pthread_mutex_t mLock; - pthread_cond_t mCond; - sp mGnssMeasurementCbIface; - LocationCapabilitiesMask mLocationCapabilitiesMask; - - LocationOptions mLocationOptions; + bool mTracking; }; } // namespace implementation From 44ceafb32d6f70088e7171fa3ead7c5bdd21a79a Mon Sep 17 00:00:00 2001 From: Remil Ram Date: Mon, 7 Aug 2017 16:21:50 -0700 Subject: [PATCH 551/945] adding the necessary gps.utils cflags and -l flags Change-Id: Idca694fe0cf640c5bf255fa11ff206d6927d67be --- gnss/Makefile.am | 7 ++++--- location/Makefile.am | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 69f7c762..3afdcd7a 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -38,6 +38,7 @@ libloc_ds_api_CFLAGS = \ $(QMIF_CFLAGS) \ $(QMI_CFLAGS) \ $(DATA_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api libloc_ds_api_la_SOURCES = \ @@ -55,11 +56,11 @@ 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 $(GPSUTILS_LIBS) $(LOCPLA_LIBS) \ -$(GPSUTILS_LIBS) +libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices -ldsi_netctrl $(GPSUTILS_LIBS) $(LOCPLA_LIBS) libloc_api_v02_CFLAGS = \ $(QMIF_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api \ -I$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02 @@ -81,7 +82,7 @@ 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 libloc_ds_api.la +libloc_api_v02_la_LIBADD = -lstdc++ -lqmi_cci -lqmi_common_so $(QMIF_LIBS) $(GPSUTILS_LIBS) $(LOCPLA_LIBS) ../core/libloc_core.la libloc_ds_api.la library_include_HEADERS = \ $(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.h \ diff --git a/location/Makefile.am b/location/Makefile.am index d5203097..d1d0131e 100644 --- a/location/Makefile.am +++ b/location/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = \ $(LOCPLA_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ $(LOCHAL_CFLAGS) \ -I./ \ -I../utils \ @@ -19,7 +20,7 @@ liblocation_api_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS) +liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(GPSUTILS_LIBS) $(LOCHAL_LIBS) library_include_HEADERS = \ LocationAPI.h \ From db3101c207f101a19a078916f2146b4b38f8a7e2 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 9 Aug 2017 18:40:51 -0700 Subject: [PATCH 552/945] move getAgcInformation and setDefaultReport into GnssAdapter They are currently in LocApiv02, which is incorrect. SystemStatus shouldn't be referenced at this layer. And both of these two calls are specific to GnssAdapter use cases too. Change-Id: I7098e3963be163199a833a8fb6b12a100405f71e CRs-Fixed: 2090442 --- core/LocAdapterBase.cpp | 3 +- core/LocAdapterBase.h | 3 +- core/LocApiBase.cpp | 5 ++- core/LocApiBase.h | 2 +- gnss/GnssAdapter.cpp | 83 ++++++++++++++++++++++++++++++++++++----- gnss/GnssAdapter.h | 7 +++- 6 files changed, 87 insertions(+), 16 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 9d89c4b5..3943819f 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -153,7 +153,8 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) void LocAdapterBase:: - reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurementsNotify*/) + reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurements*/, + int /*msInWeek*/) DEFAULT_IMPL() bool LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 5c471fd5..e7beca83 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -150,7 +150,8 @@ public: virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } - virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); + virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, + int msInWeek); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); }; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 6cc00b13..303d03a4 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -401,10 +401,11 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurementsNotify) +void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurements, + int msInWeek) { // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurementsNotify)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurements, msInWeek)); } enum loc_api_adapter_err LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 86610e72..f2fcd9d0 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -131,7 +131,7 @@ public: void reportDataCallClosed(); void requestNiNotify(GnssNiNotification ¬ify, const void* data); void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGnssMeasurementData(GnssMeasurementsNotification& measurementsNotify); + void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); void saveSupportedFeatureList(uint8_t *featureList); void reportWwanZppFix(LocGpsLocation &zppLoc); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 677a020d..ef3657d5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -818,6 +818,10 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) LocationError err = LOCATION_ERROR_SUCCESS; err = mApi.deleteAidingData(mData); mAdapter.reportResponse(err, mSessionId); + SystemStatus* s = LocDualContext::getSystemStatus(); + if ((nullptr != s) && (mData.deleteAll)) { + s->setDefaultReport(); + } } }; @@ -2289,32 +2293,38 @@ GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data) } void -GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify) +GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, + int msInWeek) { LOC_LOGD("%s]: ", __func__); struct MsgReportGnssMeasurementData : public LocMsg { GnssAdapter& mAdapter; - const GnssMeasurementsNotification mMeasurementsNotify; + GnssMeasurementsNotification mMeasurementsNotify; inline MsgReportGnssMeasurementData(GnssAdapter& adapter, - const GnssMeasurementsNotification& measurementsNotify) : - LocMsg(), - mAdapter(adapter), - mMeasurementsNotify(measurementsNotify) {} + const GnssMeasurementsNotification& measurements, + int msInWeek) : + LocMsg(), + mAdapter(adapter), + mMeasurementsNotify(measurements) { + if (-1 != msInWeek) { + getAgcInformation(mMeasurementsNotify, msInWeek); + } + } inline virtual void proc() const { mAdapter.reportGnssMeasurementData(mMeasurementsNotify); } }; - sendMsg(new MsgReportGnssMeasurementData(*this, measurementsNotify)); + sendMsg(new MsgReportGnssMeasurementData(*this, measurements, msInWeek)); } void -GnssAdapter::reportGnssMeasurementData(const GnssMeasurementsNotification& measurementsNotify) +GnssAdapter::reportGnssMeasurementData(const GnssMeasurementsNotification& measurements) { for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { if (nullptr != it->second.gnssMeasurementsCb) { - it->second.gnssMeasurementsCb(measurementsNotify); + it->second.gnssMeasurementsCb(measurements); } } } @@ -2921,3 +2931,58 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) return true; } +/* get AGC information from system status and fill it */ +void +GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek) +{ + SystemStatus* systemstatus = LocDualContext::getSystemStatus(); + + if (nullptr != systemstatus) { + SystemStatusReports reports = {}; + systemstatus->getReport(reports, true); + + if ((!reports.mRfAndParams.empty()) && (!reports.mTimeAndClock.empty()) && + reports.mTimeAndClock.back().mTimeValid && + (abs(msInWeek - (int)reports.mTimeAndClock.back().mGpsTowMs) < 2000)) { + + for (size_t i = 0; i < measurements.count; i++) { + switch (measurements.measurements[i].svType) { + case GNSS_SV_TYPE_GPS: + measurements.measurements[i].agcLevelDb = + reports.mRfAndParams.back().mAgcGps; + measurements.measurements[i].flags |= + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; + break; + + case GNSS_SV_TYPE_GALILEO: + measurements.measurements[i].agcLevelDb = + reports.mRfAndParams.back().mAgcGal; + measurements.measurements[i].flags |= + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; + break; + + case GNSS_SV_TYPE_GLONASS: + measurements.measurements[i].agcLevelDb = + reports.mRfAndParams.back().mAgcGlo; + measurements.measurements[i].flags |= + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; + break; + + case GNSS_SV_TYPE_BEIDOU: + measurements.measurements[i].agcLevelDb = + reports.mRfAndParams.back().mAgcBds; + measurements.measurements[i].flags |= + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; + break; + + case GNSS_SV_TYPE_QZSS: + case GNSS_SV_TYPE_SBAS: + case GNSS_SV_TYPE_UNKNOWN: + default: + break; + } + } + } + } +} + diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 2db97589..6e12d7ca 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -217,7 +217,8 @@ public: virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); - virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurementsNotify); + virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, + int msInWeek); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); @@ -235,10 +236,12 @@ public: void reportSv(GnssSvNotification& svNotify); void reportNmea(const char* nmea, size_t length); bool requestNiNotify(const GnssNiNotification& notify, const void* data); - void reportGnssMeasurementData(const GnssMeasurementsNotification& measurementsNotify); + void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); + /* get AGC information from system status and fill it */ + static void getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek); /*==== CONVERSION ===================================================================*/ static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); From ee2d6658cbfc916cc01c450f4a3d497ad193b60f Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 11 Aug 2017 15:13:38 +0530 Subject: [PATCH 553/945] Add DataItemObserver interface in SystemStatus Add DataItemObserver interface in SystemStatus so that clients can subscribe dataitem events from SystemStatus. Also moving DateItem and its observer, subscription classes into HAL Simplify DataItem class implementation. Change-Id: I7b2c3fc9dcf67dd6132bbcccda874e3f7ed6fa94 CRs-Fixed: 2041019 2072896 --- core/Android.mk | 16 +- core/LocDualContext.cpp | 12 - core/LocDualContext.h | 4 - core/Makefile.am | 12 + core/SystemStatus.cpp | 42 +- core/SystemStatus.h | 24 +- core/SystemStatusOsObserver.cpp | 646 ++++++++++++++++++++++ core/SystemStatusOsObserver.h | 333 +++++++++++ core/data-items/DataItemId.h | 73 +++ core/data-items/DataItemsFactoryProxy.cpp | 99 ++++ core/data-items/DataItemsFactoryProxy.h | 55 ++ core/data-items/IDataItemCore.h | 82 +++ core/data-items/common/ClientIndex.cpp | 171 ++++++ core/data-items/common/ClientIndex.h | 70 +++ core/data-items/common/DataItemIndex.cpp | 202 +++++++ core/data-items/common/DataItemIndex.h | 70 +++ core/data-items/common/IClientIndex.h | 83 +++ core/data-items/common/IDataItemIndex.h | 94 ++++ core/data-items/common/IndexFactory.cpp | 64 +++ core/data-items/common/IndexFactory.h | 48 ++ core/observer/IDataItemObserver.h | 76 +++ core/observer/IDataItemSubscription.h | 129 +++++ core/observer/IFrameworkActionReq.h | 83 +++ core/observer/IOsObserver.h | 103 ++++ gnss/GnssAdapter.cpp | 23 +- gnss/GnssAdapter.h | 14 +- 26 files changed, 2589 insertions(+), 39 deletions(-) create mode 100644 core/SystemStatusOsObserver.cpp create mode 100644 core/SystemStatusOsObserver.h create mode 100644 core/data-items/DataItemId.h create mode 100644 core/data-items/DataItemsFactoryProxy.cpp create mode 100644 core/data-items/DataItemsFactoryProxy.h create mode 100644 core/data-items/IDataItemCore.h create mode 100644 core/data-items/common/ClientIndex.cpp create mode 100644 core/data-items/common/ClientIndex.h create mode 100644 core/data-items/common/DataItemIndex.cpp create mode 100644 core/data-items/common/DataItemIndex.h create mode 100644 core/data-items/common/IClientIndex.h create mode 100644 core/data-items/common/IDataItemIndex.h create mode 100644 core/data-items/common/IndexFactory.cpp create mode 100644 core/data-items/common/IndexFactory.h create mode 100644 core/observer/IDataItemObserver.h create mode 100644 core/observer/IDataItemSubscription.h create mode 100644 core/observer/IFrameworkActionReq.h create mode 100644 core/observer/IOsObserver.h diff --git a/core/Android.mk b/core/Android.mk index ee07c190..dba0b0a3 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -31,12 +31,22 @@ LOCAL_SRC_FILES += \ ContextBase.cpp \ LocDualContext.cpp \ loc_core_log.cpp \ + data-items/DataItemsFactoryProxy.cpp \ + data-items/common/ClientIndex.cpp \ + data-items/common/DataItemIndex.cpp \ + data-items/common/IndexFactory.cpp \ + SystemStatusOsObserver.cpp \ SystemStatus.cpp LOCAL_CFLAGS += \ -fno-short-enums \ -D_ANDROID_ +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/data-items \ + $(LOCAL_PATH)/data-items/common \ + $(LOCAL_PATH)/observer \ + LOCAL_HEADER_LIBRARIES := \ libgps.utils_headers \ libloc_pla_headers \ @@ -48,7 +58,11 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core_headers -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/data-items \ + $(LOCAL_PATH)/data-items/common \ + $(LOCAL_PATH)/observer include $(BUILD_HEADER_LIBRARY) endif # not BUILD_TINY_ANDROID diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 90eacff8..fd3450df 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -35,7 +35,6 @@ #include #include #include -#include namespace loc_core { @@ -57,7 +56,6 @@ const MsgTask* LocDualContext::mMsgTask = NULL; ContextBase* LocDualContext::mFgContext = NULL; ContextBase* LocDualContext::mBgContext = NULL; ContextBase* LocDualContext::mInjectContext = NULL; -SystemStatus* LocDualContext::mSystemStatus = NULL; // the name must be shorter than 15 chars const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; #ifndef USE_GLIB @@ -149,14 +147,4 @@ LocDualContext::LocDualContext(const MsgTask* msgTask, { } -SystemStatus* LocDualContext::getSystemStatus(void) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - if (NULL == mSystemStatus) { - mSystemStatus = new SystemStatus(); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - return mSystemStatus; -} - } diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 76421525..3b3ce2cf 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -36,8 +36,6 @@ namespace loc_core { -class SystemStatus; - class LocDualContext : public ContextBase { static const MsgTask* mMsgTask; static ContextBase* mFgContext; @@ -47,7 +45,6 @@ class LocDualContext : public ContextBase { const char* name, bool joinable = true); static const MsgTask* getMsgTask(const char* name, bool joinable = true); static pthread_mutex_t mGetLocContextMutex; - static SystemStatus* mSystemStatus; protected: LocDualContext(const MsgTask* msgTask, @@ -72,7 +69,6 @@ public: } static void injectFeatureConfig(ContextBase *context); - static SystemStatus* getSystemStatus(void); }; } diff --git a/core/Makefile.am b/core/Makefile.am index 5d52c40e..568880c6 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -17,6 +17,13 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ loc_core_log.h \ LocAdapterProxyBase.h \ + data-items/DataItemId.h \ + data-items/IDataItemCore.h \ + observer/IDataItemObserver.h \ + observer/IDataItemSubscription.h \ + observer/IFrameworkActionReq.h \ + observer/IOsObserver.h \ + SystemStatusOsObserver.h \ SystemStatus.h libloc_core_la_c_sources = \ @@ -25,6 +32,11 @@ libloc_core_la_c_sources = \ ContextBase.cpp \ LocDualContext.cpp \ loc_core_log.cpp \ + data-items/DataItemsFactoryProxy.cpp \ + data-items/common/ClientIndex.cpp \ + data-items/common/DataItemIndex.cpp \ + data-items/common/IndexFactory.cpp \ + SystemStatusOsObserver.cpp \ SystemStatus.cpp library_includedir = $(pkgincludedir)/core diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 50cb4edb..dc036048 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -35,8 +35,10 @@ #include #include #include +#include #include #include +#include namespace loc_core { @@ -1176,10 +1178,44 @@ void SystemStatusLocation::dump() /****************************************************************************** SystemStatus ******************************************************************************/ -pthread_mutex_t SystemStatus::mMutexSystemStatus = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t SystemStatus::mMutexSystemStatus = PTHREAD_MUTEX_INITIALIZER; +SystemStatus* SystemStatus::mInstance = NULL; -SystemStatus::SystemStatus() +SystemStatus* SystemStatus::getInstance(const MsgTask* msgTask) { + pthread_mutex_lock(&mMutexSystemStatus); + + if (!mInstance) { + // Instantiating for the first time. msgTask should not be NULL + if (msgTask == NULL) { + LOC_LOGE("SystemStatus: msgTask is NULL!!"); + pthread_mutex_unlock(&mMutexSystemStatus); + return NULL; + } + mInstance = new (nothrow) SystemStatus(msgTask); + LOC_LOGD("SystemStatus::getInstance:%p. Msgtask:%p", mInstance, msgTask); + } + + pthread_mutex_unlock(&mMutexSystemStatus); + return mInstance; +} + +void SystemStatus::destroyInstance() +{ + delete mInstance; + mInstance = NULL; +} + +IOsObserver* SystemStatus::getOsObserver() +{ + return &mSysStatusObsvr; +} + +SystemStatus::SystemStatus(const MsgTask* msgTask) : + mSysStatusObsvr(msgTask) +{ + int result = 0; + ENTRY_LOG (); mCache.mLocation.clear(); mCache.mTimeAndClock.clear(); @@ -1196,6 +1232,8 @@ SystemStatus::SystemStatus() mCache.mNavData.clear(); mCache.mPositionFailure.clear(); + + EXIT_LOG_WITH_ERROR ("%d",result); } /****************************************************************************** diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 78fc6f8f..8cf75b5c 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -30,7 +30,13 @@ #define __SYSTEM_STATUS__ #include +#include #include +#include +#include +#include +#include + #include #define GPS_MIN (1) //1-32 @@ -390,7 +396,16 @@ public: ******************************************************************************/ class SystemStatus { - static pthread_mutex_t mMutexSystemStatus; +private: + static SystemStatus *mInstance; + SystemStatusOsObserver mSysStatusObsvr; + // ctor + SystemStatus(const MsgTask* msgTask); + // dtor + inline ~SystemStatus() {} + + // Data members + static pthread_mutex_t mMutexSystemStatus; static const uint32_t maxLocation = 5; @@ -429,9 +444,12 @@ class SystemStatus bool setPositionFailure(const SystemStatusPQWS1& nmea); public: - SystemStatus(); - ~SystemStatus() { } + // Static methods + static SystemStatus* getInstance(const MsgTask* msgTask); + static void destroyInstance(); + IOsObserver* getOsObserver(); + // Helpers bool eventPosition(const UlpLocation& location,const GpsLocationExtended& locationEx); bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp new file mode 100644 index 00000000..e327f93a --- /dev/null +++ b/core/SystemStatusOsObserver.cpp @@ -0,0 +1,646 @@ +/* Copyright (c) 2015-2017, 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_TAG "LocSvc_SystemStatusOsObserver" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +namespace loc_core +{ +#define BREAK_IF_ZERO(ERR,X) if(0==(X)) {result = (ERR); break;} +#define BREAK_IF_NON_ZERO(ERR,X) if(0!=(X)) {result = (ERR); break;} + +SystemStatusOsObserver::SystemStatusOsObserver(const MsgTask* msgTask) : + mAddress ("SystemStatusOsObserver"), + mClientIndex(IndexFactory :: createClientIndex ()), + mDataItemIndex(IndexFactory :: createDataItemIndex ()) +{ + int result = -1; + ENTRY_LOG (); + do { + BREAK_IF_ZERO (1, mClientIndex); + BREAK_IF_ZERO (2, mDataItemIndex); + mContext.mMsgTask = msgTask; + result = 0; + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +SystemStatusOsObserver :: ~SystemStatusOsObserver () +{ + // Close data-item library handle + DataItemsFactoryProxy::closeDataItemLibraryHandle(); + + // Destroy cache + map :: iterator citer = mDataItemCache.begin (); + for (; citer != mDataItemCache.end (); ++citer) { + if (citer->second != NULL) { delete citer->second; } + } + mDataItemCache.clear (); + delete mClientIndex; + delete mDataItemIndex; + mClientIndex = NULL; + mDataItemIndex = NULL; +} + +/****************************************************************************** + Message proc +******************************************************************************/ +void SystemStatusOsObserver :: HandleSubscribeReq :: proc () const { + + int result = 0; + ENTRY_LOG (); + do { + if (mDataItemList.empty ()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + result = 0; + break; + } + //mDataItemList.sort (); + // Handle First Response + list pendingFirstResponseList; + this->mParent->mClientIndex->add (this->mClient, mDataItemList, pendingFirstResponseList); + + // Do not send first response for only pendingFirstResponseList, + // instead send for all the data items (present in the cache) that + // have been subscribed for each time. + this->mParent->sendFirstResponse (mDataItemList, this->mClient); + + list yetToSubscribeDataItemsList; + this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); + // Send subscription list to framework + if (!yetToSubscribeDataItemsList.empty ()) { + this->mParent->mContext.mSubscriptionObj->subscribe + ( + yetToSubscribeDataItemsList, + this->mParent + ); + LOC_LOGD ("Subscribe Request sent to framework for the following data items"); + this->mParent->logMe (yetToSubscribeDataItemsList); + } + + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); + return; +} + +void SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + if (mDataItemList.empty ()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + result = 0; + break; + } + //mDataItemList.sort (); + list currentlySubscribedList; + this->mParent->mClientIndex->getSubscribedList (this->mClient, currentlySubscribedList); + list removeDataItemList; + set_difference (currentlySubscribedList.begin (), currentlySubscribedList.end (), + mDataItemList.begin (), mDataItemList.end (), + inserter (removeDataItemList,removeDataItemList.begin ())); + // Handle First Response + list pendingFirstResponseList; + this->mParent->mClientIndex->add (this->mClient, mDataItemList, pendingFirstResponseList); + // Send First Response + this->mParent->sendFirstResponse (pendingFirstResponseList, this->mClient); + + list yetToSubscribeDataItemsList; + this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); + // Send subscription list to framework + if (!yetToSubscribeDataItemsList.empty ()) { + this->mParent->mContext.mSubscriptionObj->subscribe + ( + yetToSubscribeDataItemsList, + this->mParent + ); + LOC_LOGD ("Subscribe Request sent to framework for the following data items"); + this->mParent->logMe (yetToSubscribeDataItemsList); + } + + list unsubscribeList; + list unused; + this->mParent->mClientIndex->remove (this->mClient, removeDataItemList, unused); + + if (!this->mParent->mClientIndex->isSubscribedClient (this->mClient)) { + this->mParent->mDataItemIndex->remove (list (1,this->mClient), unsubscribeList); + } + if (!unsubscribeList.empty ()) { + // Send unsubscribe to framework + this->mParent->mContext.mSubscriptionObj->unsubscribe + ( + unsubscribeList, + this->mParent + ); + LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); + this->mParent->logMe (unsubscribeList); + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: HandleRequestData :: proc () const { + int result = 0; + ENTRY_LOG (); + + do { + if (mDataItemList.empty ()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + result = 0; + break; + } + //mDataItemList.sort (); + list yetToSubscribeDataItemsList; + this->mParent->mClientIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); + this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); + // Send subscription list to framework + if (!mDataItemList.empty ()) { + this->mParent->mContext.mSubscriptionObj->requestData + ( + mDataItemList, + this->mParent + ); + LOC_LOGD ("Subscribe Request sent to framework for the following data items"); + this->mParent->logMe (yetToSubscribeDataItemsList); + } + + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: HandleUnsubscribeReq :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + if (mDataItemList.empty ()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + result = 0; + break; + } + //mDataItemList.sort (); + list unsubscribeList; + list unused; + this->mParent->mClientIndex->remove (this->mClient, mDataItemList, unused); + + list :: const_iterator it = mDataItemList.begin (); + for (; it != mDataItemList.end (); ++it) { + list clientListSubs; + list clientListOut; + this->mParent->mDataItemIndex->remove ((*it), + list (1,this->mClient), clientListOut); + // check if there are any other subscribed client for this data item id + this->mParent->mDataItemIndex->getListOfSubscribedClients ( (*it), clientListSubs); + if (clientListSubs.empty()) + { + LOC_LOGD ("Client list subscribed is empty for dataitem - %d",(*it)); + unsubscribeList.push_back((*it)); + } + } + if (!unsubscribeList.empty ()) { + // Send unsubscribe to framework + this->mParent->mContext.mSubscriptionObj->unsubscribe + ( + unsubscribeList, + this->mParent + ); + LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); + this->mParent->logMe (unsubscribeList); + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: HandleUnsubscribeAllReq :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + list clients (1, this->mClient); + list unsubscribeList; + BREAK_IF_NON_ZERO (2, this->mParent->mClientIndex->remove (this->mClient)); + + + this->mParent->mDataItemIndex->remove (clients, unsubscribeList); + if (!unsubscribeList.empty ()) { + // Send unsubscribe to framework + this->mParent->mContext.mSubscriptionObj->unsubscribe + ( + unsubscribeList, + this->mParent + ); + LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); + this->mParent->logMe (unsubscribeList); + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: HandleNotify :: getListOfClients + (const list & dlist, list & clients ) const { + + list :: const_iterator it = dlist.begin (); + for (; it != dlist.end (); ++it) { + list clientList; + this->mParent->mDataItemIndex->getListOfSubscribedClients ( (*it), clientList); + list :: iterator citer = clientList.begin (); + for (; citer != clientList.end (); ++citer) { + clients.push_back (*citer); + } + clientList.clear (); + } + // remove duplicates + clients.unique (); +} + +void SystemStatusOsObserver :: HandleNotify :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + // Update Cache with received data items and prepare + // list of data items to be sent. + list :: const_iterator it = mDList.begin (); + list dataItemIdsToBeSent; + for (; it != mDList.end (); ++it) { + bool dataItemUpdated = false; + this->mParent->updateCache (*it, dataItemUpdated); + if (dataItemUpdated) { + dataItemIdsToBeSent.push_back ( (*it)->getId ()); + } + } + + list clientList; + this->getListOfClients (dataItemIdsToBeSent, clientList); + list :: iterator citer = clientList.begin (); + // Send data item to all subscribed clients + LOC_LOGD ("LocTech-Label :: SystemStatusOsObserver :: Data Items Out"); + for (; citer != clientList.end (); ++citer) { + do { + list dataItemIdsSubscribedByThisClient; + list dataItemIdsToBeSentForThisClient; + this->mParent->mClientIndex->getSubscribedList (*citer, dataItemIdsSubscribedByThisClient); + dataItemIdsSubscribedByThisClient.sort (); + dataItemIdsToBeSent.sort (); + set_intersection (dataItemIdsToBeSent.begin (), + dataItemIdsToBeSent.end (), + dataItemIdsSubscribedByThisClient.begin (), + dataItemIdsSubscribedByThisClient.end (), + inserter (dataItemIdsToBeSentForThisClient, + dataItemIdsToBeSentForThisClient.begin ())); + BREAK_IF_NON_ZERO (4,this->mParent->sendCachedDataItems (dataItemIdsToBeSentForThisClient, *citer)); + dataItemIdsSubscribedByThisClient.clear (); + dataItemIdsToBeSentForThisClient.clear (); + } while (0); + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); +} + +void SystemStatusOsObserver :: HandleTurnOn :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + // Send action turn on to framework + this->mParent->mContext.mFrameworkActionReqObj->turnOn(mDataItemId, mTimeOut); + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); +} + +void SystemStatusOsObserver :: HandleTurnOff :: proc () const { + int result = 0; + ENTRY_LOG (); + do { + // Send action turn off to framework + this->mParent->mContext.mFrameworkActionReqObj->turnOff(mDataItemId); + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); +} + +/****************************************************************************** + IDataItemSubscription Overrides +******************************************************************************/ +void SystemStatusOsObserver :: subscribe (const list & l, IDataItemObserver * client) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mSubscriptionObj != NULL) { + HandleSubscribeReq * msg = new (nothrow) HandleSubscribeReq (this, l, client); + mContext.mMsgTask->sendMsg (msg); + } + else { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: updateSubscription (const list & l, IDataItemObserver * client) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mSubscriptionObj != NULL) { + mContext.mMsgTask->sendMsg (new (nothrow) HandleUpdateSubscriptionReq (this, l, client)); + } + else { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: requestData (const list & l, IDataItemObserver * client) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mSubscriptionObj != NULL) { + mContext.mMsgTask->sendMsg (new (nothrow) HandleRequestData (this, l, client)); + } + else { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: unsubscribe (const list & l, IDataItemObserver * client) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mSubscriptionObj != NULL) { + mContext.mMsgTask->sendMsg (new (nothrow) HandleUnsubscribeReq (this, l, client)); + } + else { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +void SystemStatusOsObserver :: unsubscribeAll (IDataItemObserver * client) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mSubscriptionObj != NULL) { + mContext.mMsgTask->sendMsg (new (nothrow) HandleUnsubscribeAllReq (this, client)); + } + else { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d",result); +} + +/****************************************************************************** + IDataItemObserver Overrides +******************************************************************************/ +void SystemStatusOsObserver::getName(string & name) { + name = mAddress; +} + +void SystemStatusOsObserver::notify(const std::list & dlist) { + int result = 0; + ENTRY_LOG (); + do { + list :: const_iterator it = dlist.begin (); + list dataItemList; + list ids; + LOC_LOGD("LocTech-Label :: SystemStatusOsObserver :: Data Items In"); + for (; it != dlist.end (); ++it) { + if (*it != NULL) { + string dv; + (*it)->stringify(dv); + LOC_LOGD("LocTech-Value :: Data Item Value: %s", dv.c_str ()); + IDataItemCore * dataitem = DataItemsFactoryProxy::createNewDataItem((*it)->getId()); + BREAK_IF_ZERO (2, dataitem); + // Copy contents into the newly created data item + dataitem->copy(*it); + dataItemList.push_back(dataitem); + ids.push_back((*it)->getId()); + } + } + mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify (this, dataItemList)); + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); +} + +/****************************************************************************** + IFrameworkActionReq Overrides +******************************************************************************/ +void SystemStatusOsObserver :: turnOn (DataItemId dit, int timeOut) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mFrameworkActionReqObj != NULL) { + // Check if data item exists in mActiveRequestCount + map :: iterator citer = mActiveRequestCount.find (dit); + if (citer == mActiveRequestCount.end ()) { + // Data item not found in map + // Add reference count as 1 and add dataitem to map + pair cpair (dit, 1); + mActiveRequestCount.insert (cpair); + LOC_LOGD("Sending turnOn request"); + // Send action turn on to framework + mContext.mMsgTask->sendMsg (new (nothrow) HandleTurnOn (this, dit, timeOut)); + } else { + // Found in map, update reference count + citer->second++; + LOC_LOGD("HandleTurnOn - Data item:%d Num_refs:%d",dit,citer->second); + } + } + else { + LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + + EXIT_LOG_WITH_ERROR ("%d", result); +} + +void SystemStatusOsObserver :: turnOff (DataItemId dit) { + int result = 0; + ENTRY_LOG (); + do { + if (mContext.mFrameworkActionReqObj != NULL) { + // Check if data item exists in mActiveRequestCount + map :: iterator citer = mActiveRequestCount.find (dit); + if (citer != mActiveRequestCount.end ()) { + citer->second--; + LOC_LOGD("HandleTurnOff - Data item:%d Remaining Num_refs:%d",dit,citer->second); + + if(citer->second == 0) { + LOC_LOGD("Sending turnOff request"); + // if this was last reference, remove item from map and turn off module + mActiveRequestCount.erase(citer); + // Send action turn off to framework + mContext.mMsgTask->sendMsg (new (nothrow) HandleTurnOff (this, dit)); + } + } else { + // Not found in map + LOC_LOGD ("Data item id %d not found in FrameworkModuleMap",dit); + } + } + else { + LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); + result = 1; + } + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); +} + +/****************************************************************************** + Helpers +******************************************************************************/ +void SystemStatusOsObserver :: logMe (const list & l) { + list :: const_iterator it = l.begin (); + for (;it != l.end (); ++it) { + LOC_LOGD ("DataItem %d",*it); + } +} + +int SystemStatusOsObserver :: sendFirstResponse (const list & l, IDataItemObserver * to) { + int result = 0; + ENTRY_LOG (); + do { + if (l.empty ()) { + LOC_LOGV("list is empty. Nothing to do. Exiting"); + result = 0; + break; + } + + string clientName; + to->getName (clientName); + LOC_LOGD ("First response sent for the following data items To Client: %s", clientName.c_str()); + + list dataItems; + list :: const_iterator diditer = l.begin (); + for (; diditer != l.end (); ++diditer) { + map :: const_iterator citer = mDataItemCache.find (*diditer); + if (citer != mDataItemCache.end ()) { + string dv; + IDataItemCore * di = citer->second; + di->stringify (dv); + LOC_LOGD ("LocTech-Value :: Data Item: %s", dv.c_str ()); + dataItems.push_back (citer->second); + } + } + if (dataItems.empty ()) { + LOC_LOGV("No items to notify. Nothing to do. Exiting"); + result = 0; + break; + } + + // Notify Client + to->notify (dataItems); + + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); + return result; +} + +int SystemStatusOsObserver :: sendCachedDataItems (const list & l, IDataItemObserver * to) { + int result = 0; + ENTRY_LOG (); + do { + list dataItems; + list :: const_iterator it = l.begin (); + string clientName; + to->getName (clientName); + LOC_LOGD ("LocTech-Value :: To Client: %s", clientName.c_str ()); + for (; it != l.end (); ++it) { + string dv; + IDataItemCore * di = this->mDataItemCache [ (*it) ]; + di->stringify (dv); + LOC_LOGI("LocTech-Value :: Data Item: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_back (di); + } + + to->notify (dataItems); + + } while (0); + EXIT_LOG_WITH_ERROR ("%d", result); + return result; +} + +int SystemStatusOsObserver :: updateCache (IDataItemCore * d, bool &dataItemUpdated) { + int result = 0; + ENTRY_LOG (); + do { + BREAK_IF_ZERO (1, d); + // Check if data item exists in cache + map :: iterator citer = mDataItemCache.find (d->getId ()); + if (citer == mDataItemCache.end ()) { + // New data item; not found in cache + IDataItemCore * dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); + BREAK_IF_ZERO (2, dataitem); + // Copy the contents of the data item + dataitem->copy (d); + pair cpair (d->getId (), dataitem); + // Insert in mDataItemCache + mDataItemCache.insert (cpair); + dataItemUpdated = true; + } else { + // Found in cache; Update cache if necessary + BREAK_IF_NON_ZERO(3, citer->second->copy (d, &dataItemUpdated)); + } + + if (dataItemUpdated) { + LOC_LOGV("DataItem:%d updated:%d", d->getId (), dataItemUpdated); + } + } while (0); + + EXIT_LOG_WITH_ERROR ("%d", result); + return result; +} + +} // namespace loc_core + diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h new file mode 100644 index 00000000..8e42d211 --- /dev/null +++ b/core/SystemStatusOsObserver.h @@ -0,0 +1,333 @@ +/* Copyright (c) 2015-2017, 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 __SYSTEM_STATUS_OSOBSERVER__ +#define __SYSTEM_STATUS_OSOBSERVER__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core +{ + +/****************************************************************************** + SystemStatusOsObserver +******************************************************************************/ +// Forward Declarations +class IDataItemCore; + +template +class IClientIndex; + +template +class IDataItemIndex; + +struct SystemContext { + IDataItemSubscription *mSubscriptionObj; + IFrameworkActionReq *mFrameworkActionReqObj; + const MsgTask *mMsgTask; + + inline SystemContext() : + mSubscriptionObj(NULL), + mFrameworkActionReqObj(NULL), + mMsgTask(NULL) {} +}; + +// Clients wanting to get data from OS/Framework would need to +// subscribe with OSObserver using IDataItemSubscription interface. +// Such clients would need to implement IDataItemObserver interface +// to receive data when it becomes available. +class SystemStatusOsObserver : public IOsObserver { + +public: + // ctor + SystemStatusOsObserver(const MsgTask* msgTask); + + // dtor + ~SystemStatusOsObserver(); + + // To set the subscription object + inline void setSubscriptionObj(IDataItemSubscription *subscriptionObj) { + mContext.mSubscriptionObj = subscriptionObj; + }; + + // To set the framework action request object + inline void setFrameworkActionReqObj(IFrameworkActionReq *frameworkActionReqObj) { + mContext.mFrameworkActionReqObj = frameworkActionReqObj; + } + + // IDataItemObserver Overrides + virtual void getName (string & name); + virtual void notify (const std::list & dlist); + + // IDataItemSubscription Overrides + virtual void subscribe (const std :: list & l, IDataItemObserver * client); + virtual void updateSubscription + ( + const std :: list & l, + IDataItemObserver * client + ); + virtual void requestData + ( + const std :: list & l, + IDataItemObserver * client + ); + virtual void unsubscribe (const std :: list & l, IDataItemObserver * client); + virtual void unsubscribeAll (IDataItemObserver * client); + + // IFrameworkActionReq Overrides + virtual void turnOn (DataItemId dit, int timeOut = 0); + virtual void turnOff (DataItemId dit); + +private: + + SystemContext mContext; + const string mAddress; + IClientIndex *mClientIndex; + IDataItemIndex *mDataItemIndex; + map < DataItemId, IDataItemCore * > mDataItemCache; + map < DataItemId, int > mActiveRequestCount; + + // Nested types + // Messages + struct HandleMsgBase : public LocMsg { + HandleMsgBase (SystemStatusOsObserver * parent); + virtual ~HandleMsgBase (); + // Data members + SystemStatusOsObserver * mParent; + }; + + // Helpers + int sendFirstResponse + ( + const list & l, + IDataItemObserver * to + ); + + int sendCachedDataItems + ( + const list & l, + IDataItemObserver * to + ); + + int updateCache (IDataItemCore * d, bool &dataItemUpdated); + void logMe (const list & l); + + // Messages + struct HandleClientMsg : public LocMsg { + HandleClientMsg (SystemStatusOsObserver * parent, IDataItemObserver * client); + virtual ~HandleClientMsg (); + // Data Members + SystemStatusOsObserver * mParent; + IDataItemObserver * mClient; + }; + + struct HandleSubscribeReq : public HandleClientMsg { + HandleSubscribeReq (SystemStatusOsObserver * parent, + const list & l, + IDataItemObserver * client); + virtual ~HandleSubscribeReq (); + void proc () const; + // Data members + const list mDataItemList; + }; + + struct HandleUpdateSubscriptionReq : public HandleClientMsg { + HandleUpdateSubscriptionReq (SystemStatusOsObserver * parent, + const list & l, + IDataItemObserver * client); + virtual ~HandleUpdateSubscriptionReq (); + void proc () const; + // Data members + const list mDataItemList; + }; + + struct HandleRequestData : public HandleClientMsg { + HandleRequestData (SystemStatusOsObserver * parent, + const list & l, + IDataItemObserver * client); + virtual ~HandleRequestData (); + void proc () const; + const list mDataItemList; + }; + + struct HandleUnsubscribeReq : public HandleClientMsg { + HandleUnsubscribeReq (SystemStatusOsObserver * parent, + const list & l, + IDataItemObserver * client); + virtual ~HandleUnsubscribeReq (); + void proc () const; + // Data members + const list mDataItemList; + }; + + struct HandleUnsubscribeAllReq : public HandleClientMsg { + HandleUnsubscribeAllReq + ( + SystemStatusOsObserver * parent, + IDataItemObserver * client + ); + virtual ~HandleUnsubscribeAllReq (); + void proc () const; + }; + + struct HandleNotify : public HandleMsgBase { + HandleNotify (SystemStatusOsObserver * parent, list dlist); + virtual ~HandleNotify (); + void getListOfClients + ( + const list & dlist, + list & clients + ) const; + void proc () const; + // Data members + list mDList; + }; + + struct HandleTurnOn : public HandleMsgBase { + HandleTurnOn (SystemStatusOsObserver * parent, + const DataItemId dit, + const int timeOut); + virtual ~HandleTurnOn (); + void proc () const; + // Data members + DataItemId mDataItemId; + int mTimeOut; + }; + + struct HandleTurnOff : public HandleMsgBase { + HandleTurnOff (SystemStatusOsObserver * parent,const DataItemId dit); + virtual ~HandleTurnOff (); + void proc () const; + // Data members + DataItemId mDataItemId; + }; + +}; + + +/****************************************************************************** + Messages +******************************************************************************/ +// Ctors +inline SystemStatusOsObserver :: HandleMsgBase :: HandleMsgBase (SystemStatusOsObserver * parent) +: +mParent (parent) +{} + +inline SystemStatusOsObserver :: HandleClientMsg :: HandleClientMsg +( + SystemStatusOsObserver * parent, + IDataItemObserver * client +) +: +mParent (parent), +mClient (client) +{} + +inline SystemStatusOsObserver :: HandleSubscribeReq :: HandleSubscribeReq + (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) +: +HandleClientMsg (parent, client), mDataItemList (l) +{} + +inline SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: HandleUpdateSubscriptionReq + (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) +: +HandleClientMsg (parent, client), mDataItemList (l) +{} + +inline SystemStatusOsObserver :: HandleRequestData :: HandleRequestData + (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) +: +HandleClientMsg (parent, client), mDataItemList (l) +{} + +inline SystemStatusOsObserver :: HandleUnsubscribeReq :: HandleUnsubscribeReq + (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) +: +HandleClientMsg (parent, client), mDataItemList (l) +{} + +inline SystemStatusOsObserver :: HandleUnsubscribeAllReq :: HandleUnsubscribeAllReq + (SystemStatusOsObserver * parent, IDataItemObserver * client) +: +HandleClientMsg (parent, client) +{} + +inline SystemStatusOsObserver :: HandleNotify :: HandleNotify + (SystemStatusOsObserver * parent, list dlist) +: +HandleMsgBase (parent), mDList (dlist) +{} + +inline SystemStatusOsObserver :: HandleTurnOn :: HandleTurnOn + (SystemStatusOsObserver * parent, const DataItemId dit,const int timeOut) +: +HandleMsgBase (parent), mDataItemId (dit), mTimeOut (timeOut) +{} + +inline SystemStatusOsObserver :: HandleTurnOff :: HandleTurnOff + (SystemStatusOsObserver * parent, const DataItemId dit) +: +HandleMsgBase (parent), mDataItemId (dit) +{} + +// Dtors +inline SystemStatusOsObserver :: HandleMsgBase :: ~HandleMsgBase () {} +inline SystemStatusOsObserver :: HandleClientMsg :: ~HandleClientMsg () {} +inline SystemStatusOsObserver :: HandleSubscribeReq :: ~HandleSubscribeReq () {} +inline SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: ~HandleUpdateSubscriptionReq() {} +inline SystemStatusOsObserver :: HandleRequestData :: ~HandleRequestData() {} +inline SystemStatusOsObserver :: HandleUnsubscribeReq :: ~HandleUnsubscribeReq () {} +inline SystemStatusOsObserver :: HandleUnsubscribeAllReq :: ~HandleUnsubscribeAllReq () {} + +inline SystemStatusOsObserver :: HandleNotify :: ~HandleNotify () { + list :: iterator it = mDList.begin (); + for (; it != mDList.end (); ++it) { + delete *it; + *it = NULL; + } +} + +inline SystemStatusOsObserver :: HandleTurnOn :: ~HandleTurnOn () {} +inline SystemStatusOsObserver :: HandleTurnOff :: ~HandleTurnOff () {} + + +} // namespace loc_core + +#endif //__SYSTEM_STATUS__ + diff --git a/core/data-items/DataItemId.h b/core/data-items/DataItemId.h new file mode 100644 index 00000000..1bf132aa --- /dev/null +++ b/core/data-items/DataItemId.h @@ -0,0 +1,73 @@ +/* Copyright (c) 2015-2017 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 __DATAITEMID_H__ +#define __DATAITEMID_H__ + +/** + * Enumeration of Data Item types + * When add/remove/update changes are made to Data Items, this file needs to be updated + * accordingly + */ +typedef enum e_DataItemId { + INVALID_DATA_ITEM_ID = -1, + // 0 - 4 + AIRPLANEMODE_DATA_ITEM_ID, + ENH_DATA_ITEM_ID, + GPSSTATE_DATA_ITEM_ID, + NLPSTATUS_DATA_ITEM_ID, + WIFIHARDWARESTATE_DATA_ITEM_ID, + // 5 - 9 + NETWORKINFO_DATA_ITEM_ID, + RILVERSION_DATA_ITEM_ID, + RILSERVICEINFO_DATA_ITEM_ID, + RILCELLINFO_DATA_ITEM_ID, + SERVICESTATUS_DATA_ITEM_ID, + // 10 - 14 + MODEL_DATA_ITEM_ID, + MANUFACTURER_DATA_ITEM_ID, + VOICECALL_DATA_ITEM, + ASSISTED_GPS_DATA_ITEM_ID, + SCREEN_STATE_DATA_ITEM_ID, + // 15 - 19 + POWER_CONNECTED_STATE_DATA_ITEM_ID, + TIMEZONE_CHANGE_DATA_ITEM_ID, + TIME_CHANGE_DATA_ITEM_ID, + WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID, + SHUTDOWN_STATE_DATA_ITEM_ID, + // 20 - 24 + TAC_DATA_ITEM_ID, + MCCMNC_DATA_ITEM_ID, + BTLE_SCAN_DATA_ITEM_ID, + BT_SCAN_DATA_ITEM_ID, + OEM_GTP_UPLOAD_TRIGGER_READY_ITEM_ID, + MAX_DATA_ITEM_ID +} DataItemId; + +#endif // #ifndef __DATAITEMID_H__ diff --git a/core/data-items/DataItemsFactoryProxy.cpp b/core/data-items/DataItemsFactoryProxy.cpp new file mode 100644 index 00000000..130eecf9 --- /dev/null +++ b/core/data-items/DataItemsFactoryProxy.cpp @@ -0,0 +1,99 @@ +/* Copyright (c) 2017, 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_TAG "DataItemsFactoryProxy" + +#include +#include +#include +#include +#include + +namespace loc_core +{ +void* DataItemsFactoryProxy::dataItemLibHandle = NULL; +get_concrete_data_item_fn* DataItemsFactoryProxy::getConcreteDIFunc = NULL; + +IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id) +{ + IDataItemCore *mydi = nullptr; + + if (NULL != getConcreteDIFunc) { + mydi = (*getConcreteDIFunc)(id); + } + else { + // first call to this function, symbol not yet loaded + if (NULL == dataItemLibHandle) { + LOC_LOGD("Loaded library %s",DATA_ITEMS_LIB_NAME); + dataItemLibHandle = dlopen(DATA_ITEMS_LIB_NAME, RTLD_NOW); + if (NULL == dataItemLibHandle) { + // dlopen failed. + const char * err = dlerror(); + if (NULL == err) + { + err = "Unknown"; + } + LOC_LOGE("%s:%d]: failed to load library %s; error=%s", + __func__, __LINE__, DATA_ITEMS_LIB_NAME, err); + } + } + + // load sym - if dlopen handle is obtained and symbol is not yet obtained + if (NULL != dataItemLibHandle) { + getConcreteDIFunc = (get_concrete_data_item_fn * ) + dlsym(dataItemLibHandle, DATA_ITEMS_GET_CONCRETE_DI); + if (NULL != getConcreteDIFunc) { + LOC_LOGD("Loaded function %s : %x",DATA_ITEMS_GET_CONCRETE_DI,getConcreteDIFunc); + mydi = (*getConcreteDIFunc)(id); + } + else { + // dlysm failed. + const char * err = dlerror(); + if (NULL == err) + { + err = "Unknown"; + } + LOC_LOGE("%s:%d]: failed to find symbol %s; error=%s", + __func__, __LINE__, DATA_ITEMS_GET_CONCRETE_DI, err); + } + } + } + return mydi; +} + +void DataItemsFactoryProxy::closeDataItemLibraryHandle() +{ + if (NULL != dataItemLibHandle) { + dlclose(dataItemLibHandle); + dataItemLibHandle = NULL; + } +} + +} // namespace loc_core + + diff --git a/core/data-items/DataItemsFactoryProxy.h b/core/data-items/DataItemsFactoryProxy.h new file mode 100644 index 00000000..cfd447df --- /dev/null +++ b/core/data-items/DataItemsFactoryProxy.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2017, 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 __DATAITEMFACTORYBASE__ +#define __DATAITEMFACTORYBASE__ + +#include +#include + +namespace loc_core +{ + +#define DATA_ITEMS_LIB_NAME "libdataitems.so" +#define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem" + +typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId); + +class DataItemsFactoryProxy { +public: + static IDataItemCore* createNewDataItem(DataItemId id); + static void closeDataItemLibraryHandle(); + static void *dataItemLibHandle; + static get_concrete_data_item_fn *getConcreteDIFunc; +}; + +} // namespace loc_core + +#endif //__DATAITEMFACTORYBASE__ + diff --git a/core/data-items/IDataItemCore.h b/core/data-items/IDataItemCore.h new file mode 100644 index 00000000..6084c929 --- /dev/null +++ b/core/data-items/IDataItemCore.h @@ -0,0 +1,82 @@ +/* Copyright (c) 2015, 2017 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 __IDATAITEMCORE_H__ +#define __IDATAITEMCORE_H__ + +#include +#include + +namespace loc_core { + +using namespace std; + +/** + * @brief IDataItemCore interface. + * @details IDataItemCore interface. + * + */ +class IDataItemCore { +public: + /** + * @brief Gets Data item id. + * @details Gets Data item id. + * @return Data item id. + */ + virtual DataItemId getId () = 0; + + /** + * @brief Stringify. + * @details Stringify. + * + * @param valueStr Reference to string. + */ + virtual void stringify (string & valueStr) = 0; + + /** + * @brief copy. + * @details copy. + * + * @param src Where to copy from. + * @param dataItemCopied Boolean flag indicated whether or not copied. + * + * @return Zero for success or non zero for failure. + */ + virtual int32_t copy (IDataItemCore * src, bool *dataItemCopied = nullptr) = 0; + + /** + * @brief Destructor. + * @details Destructor. + */ + virtual ~IDataItemCore () {} +}; + +} // namespace loc_core + +#endif // __IDATAITEMCORE_H__ diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp new file mode 100644 index 00000000..ffb5e1d4 --- /dev/null +++ b/core/data-items/common/ClientIndex.cpp @@ -0,0 +1,171 @@ +/* Copyright (c) 2015, 2017 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 + +using namespace std; +using namespace loc_core; + +template +inline ClientIndex :: ClientIndex () {} + +template +inline ClientIndex :: ~ClientIndex () {} + +template +bool ClientIndex :: isSubscribedClient (CT client) { + bool result = false; + ENTRY_LOG (); + typename map < CT, list > :: iterator it = + mDataItemsPerClientMap.find (client); + if (it != mDataItemsPerClientMap.end ()) { + result = true; + } + EXIT_LOG_WITH_ERROR ("%d",result); + return result; +} + +template +void ClientIndex :: getSubscribedList (CT client, list & out) { + ENTRY_LOG (); + typename map < CT, list > :: iterator it = + mDataItemsPerClientMap.find (client); + if (it != mDataItemsPerClientMap.end ()) { + out = it->second; + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +int ClientIndex :: remove (CT client) { + int result = 0; + ENTRY_LOG (); + mDataItemsPerClientMap.erase (client); + EXIT_LOG_WITH_ERROR ("%d",result); + return result; +} + +template +void ClientIndex :: remove (const list & r, list & out) { + ENTRY_LOG (); + typename map < CT, list > :: iterator dicIter = + mDataItemsPerClientMap.begin (); + while (dicIter != mDataItemsPerClientMap.end()) { + typename list :: const_iterator it = r.begin (); + for (; it != r.end (); ++it) { + typename list :: iterator iter = + find (dicIter->second.begin (), dicIter->second.end (), *it); + if (iter != dicIter->second.end ()) { + dicIter->second.erase (iter); + } + } + if (dicIter->second.empty ()) { + out.push_back (dicIter->first); + // Post-increment operator increases the iterator but returns the + // prevous one that will be invalidated by erase() + mDataItemsPerClientMap.erase (dicIter++); + } else { + ++dicIter; + } + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +void ClientIndex :: remove +( + CT client, + const list & r, + list & out +) +{ + ENTRY_LOG (); + typename map < CT, list > :: iterator dicIter = + mDataItemsPerClientMap.find (client); + if (dicIter != mDataItemsPerClientMap.end ()) { + set_intersection (dicIter->second.begin (), dicIter->second.end (), + r.begin (), r.end (), + inserter (out,out.begin ())); + if (!out.empty ()) { + typename list :: iterator it = out.begin (); + for (; it != out.end (); ++it) { + dicIter->second.erase (find (dicIter->second.begin (), + dicIter->second.end (), + *it)); + } + } + if (dicIter->second.empty ()) { + mDataItemsPerClientMap.erase (dicIter); + EXIT_LOG_WITH_ERROR ("%d",0); + } + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +void ClientIndex :: add +( + CT client, + const list & l, + list & out +) +{ + ENTRY_LOG (); + list difference; + typename map < CT, list > :: iterator dicIter = + mDataItemsPerClientMap.find (client); + if (dicIter != mDataItemsPerClientMap.end ()) { + set_difference (l.begin (), l.end (), + dicIter->second.begin (), dicIter->second.end (), + inserter (difference,difference.begin ())); + if (!difference.empty ()) { + difference.sort (); + out = difference; + dicIter->second.merge (difference); + dicIter->second.unique (); + } + } else { + out = l; + pair < CT, list > dicnpair (client, out); + mDataItemsPerClientMap.insert (dicnpair); + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +// Explicit instantiation must occur in same namespace where class is defined +namespace loc_core +{ + template class ClientIndex ; + template class ClientIndex ; +} diff --git a/core/data-items/common/ClientIndex.h b/core/data-items/common/ClientIndex.h new file mode 100644 index 00000000..feccb059 --- /dev/null +++ b/core/data-items/common/ClientIndex.h @@ -0,0 +1,70 @@ +/* Copyright (c) 2015, 2017 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 __CLIENTINDEX_H__ +#define __CLIENTINDEX_H__ + +#include +#include +#include + +using loc_core::IClientIndex; + +namespace loc_core +{ + +template + +class ClientIndex : public IClientIndex { + +public: + + ClientIndex (); + + ~ClientIndex (); + + bool isSubscribedClient (CT client); + + void getSubscribedList (CT client, std :: list & out); + + int remove (CT client); + + void remove (const std :: list & r, std :: list & out); + + void remove (CT client, const std :: list & r, std :: list & out); + + void add (CT client, const std :: list & l, std :: list & out); + +private: + //Data members + std :: map < CT , std :: list > mDataItemsPerClientMap; +}; + +} // namespace loc_core + +#endif // #ifndef __CLIENTINDEX_H__ diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp new file mode 100644 index 00000000..7869b434 --- /dev/null +++ b/core/data-items/common/DataItemIndex.cpp @@ -0,0 +1,202 @@ +/* Copyright (c) 2015, 2017 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 + +using namespace std; +using namespace loc_core; + +template +inline DataItemIndex :: DataItemIndex () {} + +template +inline DataItemIndex :: ~DataItemIndex () {} + +template +void DataItemIndex :: getListOfSubscribedClients + ( + DIT id, + list & out +) +{ + typename map < DIT, list > :: iterator cdiIter = + mClientsPerDataItemMap.find (id); + if (cdiIter != mClientsPerDataItemMap.end ()) { + out = cdiIter->second; + } +} + + +template +int DataItemIndex :: remove (DIT id) { + int result = 0; + ENTRY_LOG (); + mClientsPerDataItemMap.erase (id); + EXIT_LOG_WITH_ERROR ("%d",result); + return result; +} + +template +void DataItemIndex :: remove (const list & r, list & out) { + ENTRY_LOG (); + typename map < DIT, list > :: iterator cdiIter = + mClientsPerDataItemMap.begin (); + while (cdiIter != mClientsPerDataItemMap.end()) { + typename list :: const_iterator it = r.begin (); + for (; it != r.end (); ++it) { + typename list :: iterator iter = + find + ( + cdiIter->second.begin (), + cdiIter->second.end (), + *it + ); + if (iter != cdiIter->second.end ()) { + cdiIter->second.erase (iter); + } + } + + if (cdiIter->second.empty ()) { + out.push_back (cdiIter->first); + // Post-increment operator increases the iterator but returns the + // prevous one that will be invalidated by erase() + mClientsPerDataItemMap.erase (cdiIter++); + } else { + ++cdiIter; + } + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +void DataItemIndex :: remove +( + DIT id, + const list & r, + list & out +) +{ + ENTRY_LOG (); + + typename map < DIT, list > :: iterator cdiIter = + mClientsPerDataItemMap.find (id); + if (cdiIter != mClientsPerDataItemMap.end ()) { + set_intersection (cdiIter->second.begin (), cdiIter->second.end (), + r.begin (), r.end (), + inserter (out, out.begin ())); + if (!out.empty ()) { + typename list :: iterator it = out.begin (); + for (; it != out.end (); ++it) { + cdiIter->second.erase (find (cdiIter->second.begin (), + cdiIter->second.end (), + *it)); + } + } + if (cdiIter->second.empty ()) { + mClientsPerDataItemMap.erase (cdiIter); + EXIT_LOG_WITH_ERROR ("%d",0); + } + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +void DataItemIndex :: add +( + DIT id, + const list & l, + list & out +) +{ + ENTRY_LOG (); + list difference; + typename map < DIT, list > :: iterator cdiIter = + mClientsPerDataItemMap.find (id); + if (cdiIter != mClientsPerDataItemMap.end ()) { + set_difference (l.begin (), l.end (), + cdiIter->second.begin (), cdiIter->second.end (), + inserter (difference, difference.begin ())); + if (!difference.empty ()) { + difference.sort (); + out = difference; + cdiIter->second.merge (difference); + } + } else { + out = l; + pair < DIT, list > cndipair (id, out); + mClientsPerDataItemMap.insert (cndipair); + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +template +void DataItemIndex :: add +( + CT client, + const list & l, + list & out +) +{ + ENTRY_LOG (); + typename map < DIT, list > :: iterator cdiIter; + typename list :: const_iterator it = l.begin (); + for (; it != l.end (); ++it) { + cdiIter = mClientsPerDataItemMap.find (*it); + if (cdiIter == mClientsPerDataItemMap.end ()) { + out.push_back (*it); + pair < DIT, list > cndiPair (*it, list (1, client)); + mClientsPerDataItemMap.insert (cndiPair); + } else { + typename list :: iterator clientIter = + find + ( + cdiIter->second.begin (), + cdiIter->second.end (), + client + ); + if (clientIter == cdiIter->second.end()) { + cdiIter->second.push_back (client); + } + } + } + EXIT_LOG_WITH_ERROR ("%d",0); +} + +// Explicit instantiation must occur in same namespace where class is defined +namespace loc_core +{ + template class DataItemIndex ; + template class DataItemIndex ; +} diff --git a/core/data-items/common/DataItemIndex.h b/core/data-items/common/DataItemIndex.h new file mode 100644 index 00000000..d72e89eb --- /dev/null +++ b/core/data-items/common/DataItemIndex.h @@ -0,0 +1,70 @@ +/* Copyright (c) 2015, 2017 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 __DATAITEMINDEX_H__ +#define __DATAITEMINDEX_H__ + +#include +#include +#include + +using loc_core::IDataItemIndex; + +namespace loc_core +{ + +template + +class DataItemIndex : public IDataItemIndex { + +public: + + DataItemIndex (); + + ~DataItemIndex (); + + void getListOfSubscribedClients (DIT id, std :: list & out); + + int remove (DIT id); + + void remove (const std :: list & r, std :: list & out); + + void remove (DIT id, const std :: list & r, std :: list & out); + + void add (DIT id, const std :: list & l, std :: list & out); + + void add (CT client, const std :: list & l, std :: list & out); + +private: + std :: map < DIT, std :: list > mClientsPerDataItemMap; +}; + +} // namespace loc_core + +#endif // #ifndef __DATAITEMINDEX_H__ diff --git a/core/data-items/common/IClientIndex.h b/core/data-items/common/IClientIndex.h new file mode 100644 index 00000000..0272e7b9 --- /dev/null +++ b/core/data-items/common/IClientIndex.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2015, 2017 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 __ICLIENTINDEX_H__ +#define __ICLIENTINDEX_H__ + +#include + +namespace loc_core +{ + +template + +class IClientIndex { +public: + + // Checks if client is subscribed + virtual bool isSubscribedClient (CT client) = 0; + + // gets subscription list + virtual void getSubscribedList (CT client, std :: list & out) = 0; + + // removes an entry + virtual int remove (CT client) = 0; + + // removes std :: list of data items and returns a list of clients + // removed if any. + virtual void remove + ( + const std :: list & r, + std :: list & out + ) = 0; + + // removes list of data items indexed by client and returns list + // of data items removed if any. + virtual void remove + ( + CT client, + const std :: list & r, + std :: list & out + ) = 0; + + // adds/modifies entry in map and returns new data items added. + virtual void add + ( + CT client, + const std :: list & l, + std :: list & out + ) = 0; + + // dtor + virtual ~IClientIndex () {} +}; + +} // namespace loc_core + +#endif // #ifndef __ICLIENTINDEX_H__ diff --git a/core/data-items/common/IDataItemIndex.h b/core/data-items/common/IDataItemIndex.h new file mode 100644 index 00000000..91855826 --- /dev/null +++ b/core/data-items/common/IDataItemIndex.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2015, 2017 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 __IDATAITEMINDEX_H__ +#define __IDATAITEMINDEX_H__ + +#include + +namespace loc_core +{ + +template + +class IDataItemIndex { + +public: + + // gets std :: list of subscribed clients + virtual void getListOfSubscribedClients + ( + DIT id, + std :: list & out + ) = 0; + + // removes an entry from + virtual int remove (DIT id) = 0; + + // removes list of clients and returns a list of data items + // removed if any. + virtual void remove + ( + const std :: list & r, + std :: list & out + ) = 0; + + // removes list of clients indexed by data item and returns list of + // clients removed if any. + virtual void remove + ( + DIT id, + const std :: list & r, + std :: list & out + ) = 0; + + // adds/modifies entry and returns new clients added + virtual void add + ( + DIT id, + const std :: list & l, + std :: list & out + ) = 0; + + // adds/modifies entry and returns yet to subscribe list of data items + virtual void add + ( + CT client, + const std :: list & l, + std :: list & out + ) = 0; + + // dtor + virtual ~IDataItemIndex () {} +}; + +} // namespace loc_core + +#endif // #ifndef __IDATAITEMINDEX_H__ + diff --git a/core/data-items/common/IndexFactory.cpp b/core/data-items/common/IndexFactory.cpp new file mode 100644 index 00000000..cf494752 --- /dev/null +++ b/core/data-items/common/IndexFactory.cpp @@ -0,0 +1,64 @@ +/* Copyright (c) 2015, 2017 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 + +using namespace std; +using loc_core::IClientIndex; +using loc_core::IDataItemIndex; +using loc_core::IDataItemObserver; +using namespace loc_core; + +template +inline IClientIndex * IndexFactory :: createClientIndex +() +{ + return new (nothrow) ClientIndex (); +} + +template +inline IDataItemIndex * IndexFactory :: createDataItemIndex +() +{ + return new (nothrow) DataItemIndex (); +} + +// Explicit instantiation must occur in same namespace where class is defined +namespace loc_core +{ + template class IndexFactory ; + template class IndexFactory ; +} diff --git a/core/data-items/common/IndexFactory.h b/core/data-items/common/IndexFactory.h new file mode 100644 index 00000000..9a2070e9 --- /dev/null +++ b/core/data-items/common/IndexFactory.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2015, 2017 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 __INDEXFACTORY_H__ +#define __INDEXFACTORY_H__ + +#include +#include + +namespace loc_core +{ +template +class IndexFactory { + +public: + static IClientIndex * createClientIndex (); + static IDataItemIndex * createDataItemIndex (); +}; + +} // namespace loc_core + +#endif // #ifndef __INDEXFACTORY_H__ diff --git a/core/observer/IDataItemObserver.h b/core/observer/IDataItemObserver.h new file mode 100644 index 00000000..7954d853 --- /dev/null +++ b/core/observer/IDataItemObserver.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2015, 2017 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 __IDATAITEMOBSERVER_H__ +#define __IDATAITEMOBSERVER_H__ + +#include +#include + +using namespace std; + +namespace loc_core +{ +class IDataItemCore; + +/** + * @brief IDataItemObserver interface + * @details IDataItemObserver interface; + * In OS dependent code this type serves as a handle to an OS independent instance of this interface. + */ +class IDataItemObserver { + +public: + + /** + * @brief Gets name of Data Item Observer + * @details Gets name of Data Item Observer + * + * @param name reference to name of Data Item Observer + */ + virtual void getName (string & name) = 0; + + /** + * @brief Notify updated values of Data Items + * @details Notifys updated values of Data items + * + * @param dlist List of updated data items + */ + virtual void notify (const std :: list & dlist) = 0; + + /** + * @brief Destructor + * @details Destructor + */ + virtual ~IDataItemObserver () {} +}; + +} // namespace loc_core + +#endif // #ifndef __IDATAITEMOBSERVER_H__ diff --git a/core/observer/IDataItemSubscription.h b/core/observer/IDataItemSubscription.h new file mode 100644 index 00000000..7e8b8c8d --- /dev/null +++ b/core/observer/IDataItemSubscription.h @@ -0,0 +1,129 @@ +/* Copyright (c) 2015, 2017 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 __IDATAITEMSUBSCRIPTION_H__ +#define __IDATAITEMSUBSCRIPTION_H__ + +#include +#include + +namespace loc_core +{ +class IDataItemObserver; + +/** + * @brief IDataItemSubscription interface + * @details IDataItemSubscription interface; + * Defines an interface for operations such as subscribe, + * unsubscribe data items by their IDs. + * Must be implemented by OS dependent code. + */ +class IDataItemSubscription { + +public: + /** + * @brief Subscribe for data items by their IDs + * @details Subscribe for data items by their IDs; + * An IDataItemObserver implementer invokes this method to subscribe + * for a list of DataItems by passing in their Ids. + * A symbolic invocation of this method in the following order + * subscribe ( {1,2,3}, &obj), subscribe ( {2,3,4,5}, &obj) + * where the numbers enclosed in braces indicate a list of data item Ids + * will cause this class implementer to update its subscription list for + * &obj to only contain the following Data Item Ids 1,2,3,4,5. + * + * @param l List of DataItemId + * @param o Pointer to an instance of IDataItemObserver + */ + virtual void subscribe (const std :: list & l, IDataItemObserver * o = NULL) = 0; + + /** + * @brief Update subscription for Data items + * @details Update subscription for Data items; + * An IDataItemObserver implementer invokes this method to update their + * subscription for a list of DataItems by passing in their Ids + * A symbolic invocation of this method in the following order + * updateSubscription ( {1,2,3}, &obj),updateSubscription ( {2,3,4,5}, &obj) + * where the numbers enclosed in braces indicate a list of data item Ids + * will cause this class implementer to update its subscription list for + * &obj to only contain the following Data Item Ids 2,3,4,5. + * Note that this method may or may not be called. + * + * @param l List of DataItemId + * @param o Pointer to an instance of IDataItemObserver + */ + virtual void updateSubscription (const std :: list & l, IDataItemObserver * o = NULL) = 0; + + /** + * @brief Request Data + * @details Request Data + * + * @param l List of DataItemId + * @param o Pointer to an instance of IDataItemObserver + */ + virtual void requestData (const std :: list & l, IDataItemObserver * o = NULL) = 0; + + /** + * @brief Unsubscribe Data items + * @details Unsubscrbe Data items; + * An IDataItemObserver implementer invokes this method to unsubscribe their + * subscription for a list of DataItems by passing in their Ids + * Suppose this class implementor has a currently active subscription list + * containing 1,2,3,4,5,6,7 for &obj then a symbolic invocation of this + * method in the following order + * unsubscribe ( {1,2,3}, &obj), unsubscribe ( {1,2,3,4}, &obj), + * unsubscribe ( {7}, &obj) + * where the numbers enclosed in braces indicate a list of data item Ids + * will cause this class implementer to update its subscription list for + * &obj to only contain the following data item id 5,6. + * + * @param l List of DataItemId + * @param o Pointer to an instance of IDataItemObserver + */ + virtual void unsubscribe (const std :: list & l, IDataItemObserver * o = NULL) = 0; + + /** + * @brief Unsubscribe all data items + * @details Unsubscribe all data items + * + * @param o Pointer to an instance of IDataItemObserver + */ + virtual void unsubscribeAll (IDataItemObserver * o = NULL) = 0; + + /** + * @brief Destructor + * @details Destructor + */ + virtual ~IDataItemSubscription () {} +}; + +} // namespace loc_core + +#endif // #ifndef __IDATAITEMSUBSCRIPTION_H__ + diff --git a/core/observer/IFrameworkActionReq.h b/core/observer/IFrameworkActionReq.h new file mode 100644 index 00000000..c7b3ebdc --- /dev/null +++ b/core/observer/IFrameworkActionReq.h @@ -0,0 +1,83 @@ +/* Copyright (c) 2017 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 __IFRAMEWORKACTIONREQ_H__ +#define __IFRAMEWORKACTIONREQ_H__ + +#include + +namespace loc_core +{ + +/** + * @brief IFrameworkActionReq interface + * @details IFrameworkActionReq interface; + * Defines an interface for operations such as turnOn, turnOff a + * framework module described by the data item. Framework module + * could be bluetooth, wifi etc. + * Must be implemented by OS dependent code. + * + */ +class IFrameworkActionReq { + +public: + /** + * @brief Turn on the framework module described by the data item. + * @details Turn on the framework module described by the data item; + * An IFrameworkActionReq implementer invokes this method to + * turn on the framework module described by the data item. + * Framework module could be bluetooth, wifi etc. + * + * @param dit DataItemId + * @param timeout Timeout after which to turn off the framework module. + */ + virtual void turnOn (DataItemId dit, int timeOut = 0) = 0; + + /** + * @brief Turn off the framework module described by the data item. + * @details Turn off the framework module described by the data item; + * An IFrameworkActionReq implementer invokes this method to + * turn off the framework module described by the data item. + * Framework module could be bluetooth, wifi etc. + * + * @param dit DataItemId + */ + virtual void turnOff (DataItemId dit) = 0; + + /** + * @brief Destructor + * @details Destructor + */ + virtual ~IFrameworkActionReq () {} +}; + +} // namespace loc_core + +#endif // #ifndef __IFRAMEWORKACTIONREQ_H__ + diff --git a/core/observer/IOsObserver.h b/core/observer/IOsObserver.h new file mode 100644 index 00000000..3db8a85e --- /dev/null +++ b/core/observer/IOsObserver.h @@ -0,0 +1,103 @@ +/* Copyright (c) 2017, 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 __IOSOBSERVER_H__ +#define __IOSOBSERVER_H__ + +#include +#include +#include +#include +#include + +using namespace std; + +namespace loc_core +{ + +/** + * @brief IOsObserver interface + * @details IOsObserver interface; + * In OS dependent code this type serves as a handle to + * an OS independent instance of this interface. + */ +class IOsObserver : + public IDataItemObserver, + public IDataItemSubscription, + public IFrameworkActionReq { + +public: + + // To set the subscription object + virtual void setSubscriptionObj(IDataItemSubscription *subscriptionObj) = 0; + + // To set the framework action request object + virtual void setFrameworkActionReqObj(IFrameworkActionReq *frameworkActionReqObj) = 0; + + // IDataItemObserver Overrides + inline virtual void getName (string & /*name*/) {} + inline virtual void notify (const std::list & /*dlist*/) {} + + // IDataItemSubscription Overrides + inline virtual void subscribe + ( + const std :: list & /*l*/, + IDataItemObserver * /*client*/ + ){} + inline virtual void updateSubscription + ( + const std :: list & /*l*/, + IDataItemObserver * /*client*/ + ){} + inline virtual void requestData + ( + const std :: list & /*l*/, + IDataItemObserver * /*client*/ + ){} + inline virtual void unsubscribe + ( + const std :: list & /*l*/, + IDataItemObserver * /*client*/ + ){} + inline virtual void unsubscribeAll (IDataItemObserver * /*client*/){} + + // IFrameworkActionReq Overrides + inline virtual void turnOn (DataItemId /*dit*/, int /*timeOut*/){} + inline virtual void turnOff (DataItemId /*dit*/) {} + + /** + * @brief Destructor + * @details Destructor + */ + virtual ~IOsObserver () {} +}; + +} // namespace loc_core + +#endif // #ifndef __IOSOBSERVER_H__ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ef3657d5..11d0436c 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -65,20 +65,13 @@ GnssAdapter::GnssAdapter() : mNmeaMask(0), mNiData(), mAgpsManager(), - mAgpsCbInfo() + mAgpsCbInfo(), + mSystemStatus(SystemStatus::getInstance(mMsgTask)) { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; readConfigCommand(); setConfigCommand(); - -} - -inline -GnssAdapter::~GnssAdapter() -{ - LOC_LOGD("%s]: Destructor", __func__); - delete mUlpProxy; } void @@ -818,7 +811,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) LocationError err = LOCATION_ERROR_SUCCESS; err = mApi.deleteAidingData(mData); mAdapter.reportResponse(err, mSessionId); - SystemStatus* s = LocDualContext::getSystemStatus(); + SystemStatus* s = mAdapter.getSystemStatus(); if ((nullptr != s) && (mData.deleteAll)) { s->setDefaultReport(); } @@ -1886,7 +1879,7 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, mTechMask(techMask) {} inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus - SystemStatus* s = LocDualContext::getSystemStatus(); + SystemStatus* s = mAdapter.getSystemStatus(); if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ s->eventPosition(mUlpLocation, mLocationExtended); } @@ -2095,7 +2088,7 @@ GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus bool ret = false; - SystemStatus* s = LocDualContext::getSystemStatus(); + SystemStatus* s = mAdapter.getSystemStatus(); if (nullptr != s) { ret = s->setNmeaString(mNmea, mLength); } @@ -2308,7 +2301,7 @@ GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& mAdapter(adapter), mMeasurementsNotify(measurements) { if (-1 != msInWeek) { - getAgcInformation(mMeasurementsNotify, msInWeek); + mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek); } } inline virtual void proc() const { @@ -2835,7 +2828,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) { LOC_LOGD("%s]: ", __func__); - SystemStatus* systemstatus = LocDualContext::getSystemStatus(); + SystemStatus* systemstatus = getSystemStatus(); if (nullptr == systemstatus) { return false; } @@ -2935,7 +2928,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) void GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek) { - SystemStatus* systemstatus = LocDualContext::getSystemStatus(); + SystemStatus* systemstatus = getSystemStatus(); if (nullptr != systemstatus) { SystemStatusReports reports = {}; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 6e12d7ca..1282a6ea 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -75,6 +75,10 @@ typedef struct { using namespace loc_core; +namespace loc_core { + class SystemStatus; +} + class GnssAdapter : public LocAdapterBase { /* ==== ULP ============================================================================ */ UlpProxyBase* mUlpProxy; @@ -102,6 +106,9 @@ class GnssAdapter : public LocAdapterBase { AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; + /* === SystemStatus ===================================================================== */ + SystemStatus* mSystemStatus; + /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation, @@ -113,7 +120,7 @@ class GnssAdapter : public LocAdapterBase { public: GnssAdapter(); - virtual ~GnssAdapter(); + virtual inline ~GnssAdapter() { delete mUlpProxy; } /* ==== SSR ============================================================================ */ /* ======== EVENTS ====(Called from QMI Thread)========================================= */ @@ -241,7 +248,10 @@ public: /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); /* get AGC information from system status and fill it */ - static void getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek); + void getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek); + + /*==== SYSTEM STATUS ================================================================*/ + inline SystemStatus* getSystemStatus(void) { return mSystemStatus; } /*==== CONVERSION ===================================================================*/ static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); From bb1d7ec1a28bd83fc580ef8bbcf545f7277c3bab Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sun, 13 Aug 2017 01:39:36 +0530 Subject: [PATCH 554/945] Passing correct LPPe parameters Passing correct LPPe parameters to modem for SRN AP measurement and Sensor Baro measurements. Change-Id: Id56f9bf050df82444a8698cad7cda85b4e9fbe78 CRs-Fixed: 2092158 --- gnss/GnssAdapter.cpp | 24 ++++++++++++++++++++++++ location/LocationAPI.h | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 6c9e212b..810ee4d0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -342,6 +342,12 @@ GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlane if (GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT & lppeControlPlaneMask) { mask |= (1<<1); } + if (GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT & lppeControlPlaneMask) { + mask |= (1<<2); + } + if (GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT & lppeControlPlaneMask) { + mask |= (1<<3); + } return mask; } @@ -355,6 +361,12 @@ GnssAdapter::convertLppeCp(const uint32_t lppeControlPlaneMask) if ((1<<1) & lppeControlPlaneMask) { mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT; } + if ((1<<2) & lppeControlPlaneMask) { + mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT; + } + if ((1<<3) & lppeControlPlaneMask) { + mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; + } return mask; } @@ -369,6 +381,12 @@ GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) if (GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT & lppeUserPlaneMask) { mask |= (1<<1); } + if (GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT & lppeUserPlaneMask) { + mask |= (1<<2); + } + if (GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT & lppeUserPlaneMask) { + mask |= (1<<3); + } return mask; } @@ -382,6 +400,12 @@ GnssAdapter::convertLppeUp(const uint32_t lppeUserPlaneMask) if ((1<<1) & lppeUserPlaneMask) { mask |= GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT; } + if ((1<<2) & lppeUserPlaneMask) { + mask |= GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT; + } + if ((1<<3) & lppeUserPlaneMask) { + mask |= GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; + } return mask; } diff --git a/location/LocationAPI.h b/location/LocationAPI.h index bc519273..f5cc75af 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -177,6 +177,9 @@ typedef uint16_t GnssConfigLppeControlPlaneMask; typedef enum { GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT = (1<<0), // DBH GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), + // SENSOR_BARO_MEASUREMENTS } GnssConfigLppeControlPlaneBits; // Technology for LPPe User Plane @@ -184,6 +187,9 @@ typedef uint16_t GnssConfigLppeUserPlaneMask; typedef enum { GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT = (1<<0), // DBH GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), + // SENSOR_BARO_MEASUREMENTS } GnssConfigLppeUserPlaneBits; // Positioning Protocol on A-GLONASS system From 1b6695633f82f1905cdbf159249862ac5f19c28a Mon Sep 17 00:00:00 2001 From: Vamana Murthi Date: Wed, 5 Jul 2017 00:39:06 +0530 Subject: [PATCH 555/945] XC 2.5 : additional changes Add the XTRAsystemstatus observer to pass the HAL init info to XTRA-Client CRs-Fixed: 2093274 Change-Id: I893da1470d4fedafbc7545806ea97667acdf60d3 --- android/AGnssRil.cpp | 70 +--------------- gnss/Android.mk | 3 +- gnss/GnssAdapter.cpp | 4 + gnss/GnssAdapter.h | 6 ++ gnss/XtraSystemStatusObserver.cpp | 127 ++++++++++++++++++++++++++++++ gnss/XtraSystemStatusObserver.h | 54 +++++++++++++ gnss/location_gnss.cpp | 8 ++ location/location_interface.h | 1 + 8 files changed, 205 insertions(+), 68 deletions(-) create mode 100644 gnss/XtraSystemStatusObserver.cpp create mode 100644 gnss/XtraSystemStatusObserver.h diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index ec3dd761..bd4bb373 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -37,7 +37,6 @@ namespace gnss { namespace V1_0 { namespace implementation { -static bool sendConnectionEvent(const bool connected, const uint8_t type); AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) { ENTRY_LOG_CALLFLOW(); @@ -51,75 +50,12 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool ENTRY_LOG_CALLFLOW(); // for XTRA - sendConnectionEvent(connected, (uint8_t)type); - + if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { + mGnss->getGnssInterface()->updateConnectionStatus(connected, (uint8_t)type); + } return true; } -// for XTRA -static inline int createSocket() { - int socketFd = -1; - - if ((socketFd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - LOC_LOGe("create socket error. reason:%s", strerror(errno)); - - } else { - const char* socketPath = "/data/vendor/location/xtra/socket_hal_xtra"; - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); - - if (::connect(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot connect to XTRA. reason:%s", strerror(errno)); - if (::close(socketFd)) { - LOC_LOGe("close socket error. reason:%s", strerror(errno)); - } - socketFd = -1; - } - } - - return socketFd; -} - -static inline void closeSocket(const int socketFd) { - if (socketFd >= 0) { - if(::close(socketFd)) { - LOC_LOGe("close socket error. reason:%s", strerror(errno)); - } - } -} - -static inline bool sendConnectionEvent(const bool connected, const uint8_t type) { - int socketFd = createSocket(); - if (socketFd < 0) { - LOC_LOGe("XTRA unreachable. sending failed."); - return false; - } - - std::stringstream ss; - ss << "connection"; - ss << " " << (connected ? "1" : "0"); - ss << " " << (int)type; - ss << "\n"; // append seperator - - const std::string& data = ss.str(); - int remain = data.length(); - ssize_t sent = 0; - - while (remain > 0 && - (sent = ::send(socketFd, data.c_str() + (data.length() - remain), - remain, MSG_NOSIGNAL)) > 0) { - remain -= sent; - } - - if (sent < 0) { - LOC_LOGe("sending error. reason:%s", strerror(errno)); - } - - closeSocket(socketFd); - - return (remain == 0); -} - } // namespace implementation } // namespace V1_0 } // namespace gnss diff --git a/gnss/Android.mk b/gnss/Android.mk index fe898627..4d738bd3 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -21,7 +21,8 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_SRC_FILES += \ location_gnss.cpp \ GnssAdapter.cpp \ - Agps.cpp + Agps.cpp \ + XtraSystemStatusObserver.cpp LOCAL_CFLAGS += \ -fno-short-enums \ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 6c9e212b..99991fc2 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1791,6 +1791,8 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) mContext.modemPowerVote(true); mAdapter.setPowerVoteId(mSessionId); mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); + mAdapter.mXtraObserver.updateLockStatus( + mAdapter.convertGpsLock(GNSS_CONFIG_GPS_LOCK_NONE)); } mAdapter.reportResponse(err, mSessionId); } @@ -1833,6 +1835,8 @@ GnssAdapter::disableCommand(uint32_t id) mContext.modemPowerVote(false); mAdapter.setPowerVoteId(0); mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); + mAdapter.mXtraObserver.updateLockStatus( + mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); } mAdapter.reportResponse(err, mSessionId); } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1282a6ea..46ba34fd 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -35,6 +35,7 @@ #include #include #include +#include #define MAX_URL_LEN 256 #define NMEA_SENTENCE_MAX_LENGTH 200 @@ -105,6 +106,7 @@ class GnssAdapter : public LocAdapterBase { // This must be initialized via initAgps() AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; + XtraSystemStatusObserver mXtraObserver; /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; @@ -275,6 +277,10 @@ public: void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); + inline void updateConnectionStatusCommand(bool connected, uint8_t type) { + mXtraObserver.updateConnectionStatus(connected, type); + } + }; #endif //GNSS_ADAPTER_H diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp new file mode 100644 index 00000000..58a8522d --- /dev/null +++ b/gnss/XtraSystemStatusObserver.cpp @@ -0,0 +1,127 @@ +/* Copyright (c) 2017, 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_TAG "LocSvc_XtraSystemStatusObs" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace loc_core; + +#define XTRA_HAL_SOCKET_NAME "/data/vendor/location/xtra/socket_hal_xtra" + +bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { + std::stringstream ss; + ss << "gpslock"; + ss << " " << lock; + ss << "\n"; // append seperator + return ( sendEvent(ss) ); +} + +bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, uint8_t type) { + std::stringstream ss; + ss << "connection"; + ss << " " << (connected ? "1" : "0"); + ss << " " << (int)type; + ss << "\n"; // append seperator + return ( sendEvent(ss) ); +} + +bool XtraSystemStatusObserver::sendEvent(std::stringstream& event) { + int socketFd = createSocket(); + if (socketFd < 0) { + LOC_LOGe("XTRA unreachable. sending failed."); + return false; + } + + const std::string& data = event.str(); + int remain = data.length(); + ssize_t sent = 0; + + while (remain > 0 && + (sent = ::send(socketFd, data.c_str() + (data.length() - remain), + remain, MSG_NOSIGNAL)) > 0) { + remain -= sent; + } + + if (sent < 0) { + LOC_LOGe("sending error. reason:%s", strerror(errno)); + } + + closeSocket(socketFd); + + return (remain == 0); +} + + +int XtraSystemStatusObserver::createSocket() { + int socketFd = -1; + + if ((socketFd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + LOC_LOGe("create socket error. reason:%s", strerror(errno)); + + } else { + const char* socketPath = XTRA_HAL_SOCKET_NAME ; + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); + + if (::connect(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("cannot connect to XTRA. reason:%s", strerror(errno)); + if (::close(socketFd)) { + LOC_LOGe("close socket error. reason:%s", strerror(errno)); + } + socketFd = -1; + } + } + + return socketFd; +} + +void XtraSystemStatusObserver::closeSocket(const int socketFd) { + if (socketFd >= 0) { + if(::close(socketFd)) { + LOC_LOGe("close socket error. reason:%s", strerror(errno)); + } + } +} diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h new file mode 100644 index 00000000..e49f17b7 --- /dev/null +++ b/gnss/XtraSystemStatusObserver.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2017, 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 XTRA_SYSTEM_STATUS_OBS_H +#define XTRA_SYSTEM_STATUS_OBS_H + +#include + + +class XtraSystemStatusObserver { +public : + // constructor & destructor + XtraSystemStatusObserver() { + } + + virtual ~XtraSystemStatusObserver() { + } + + bool updateLockStatus(uint32_t lock); + bool updateConnectionStatus(bool connected, uint8_t type); + +private: + int createSocket(); + void closeSocket(const int32_t socketFd); + bool sendEvent(std::stringstream& event); + +}; + +#endif diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 0cd8e8d2..a99d8efb 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -59,6 +59,7 @@ static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnL static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); +static void updateConnectionStatus(bool connected, uint8_t type); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -83,6 +84,7 @@ static const GnssInterface gGnssInterface = { agpsDataConnClosed, agpsDataConnFailed, getDebugReport, + updateConnectionStatus, }; #ifndef DEBUG_X86 @@ -248,3 +250,9 @@ static void getDebugReport(GnssDebugReport& report) { gGnssAdapter->getDebugReport(report); } } + +static void updateConnectionStatus(bool connected, uint8_t type) { + if (NULL != gGnssAdapter) { + gGnssAdapter->updateConnectionStatusCommand(connected, type); + } +} \ No newline at end of file diff --git a/location/location_interface.h b/location/location_interface.h index d7948827..9a71fffc 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -55,6 +55,7 @@ struct GnssInterface { void (*agpsDataConnClosed)(short agpsType); void (*agpsDataConnFailed)(short agpsType); void (*getDebugReport)(GnssDebugReport& report); + void (*updateConnectionStatus)(bool connected, uint8_t type); }; struct FlpInterface { From 28bbab632ac629600bfe1c85bd82429b24d9caf4 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 10 Aug 2017 14:12:42 +0530 Subject: [PATCH 556/945] Adding change to wait for close complete in ATL ATL Close response should not be sent if client has wait for close complete flag set to true. Change-Id: I61164508e532cd8c65dff13387122c9d2c08af54 CRs-Fixed: 2089888 --- gnss/Agps.cpp | 121 ++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 63 deletions(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 22582d47..436351cd 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -42,7 +42,7 @@ void AgpsStateMachine::processAgpsEvent(AgpsEvent event){ LOC_LOGD("processAgpsEvent(): SM %p, Event %d, State %d", this, event, mState); - switch (event){ + switch (event) { case AGPS_EVENT_SUBSCRIBE: processAgpsEventSubscribe(); @@ -71,7 +71,7 @@ void AgpsStateMachine::processAgpsEvent(AgpsEvent event){ void AgpsStateMachine::processAgpsEventSubscribe(){ - switch (mState){ + switch (mState) { case AGPS_STATE_RELEASED: /* Add subscriber to list @@ -83,7 +83,7 @@ void AgpsStateMachine::processAgpsEventSubscribe(){ * fails for DS State Machine, we want to retry in released state. * for Agps State Machine, sendRsrcRequest() will always return * success. */ - if(requestOrReleaseDataConn(true) == 0){ + if (requestOrReleaseDataConn(true) == 0) { // If data request successful, move to pending state transitionState(AGPS_STATE_PENDING); } @@ -115,7 +115,7 @@ void AgpsStateMachine::processAgpsEventSubscribe(){ void AgpsStateMachine::processAgpsEventUnsubscribe(){ - switch (mState){ + switch (mState) { case AGPS_STATE_RELEASED: notifyEventToSubscriber( @@ -127,12 +127,10 @@ void AgpsStateMachine::processAgpsEventUnsubscribe(){ /* If the subscriber wishes to wait for connection close, * before being removed from list, move to inactive state * and notify */ - if(mCurrentSubscriber->mWaitForCloseComplete){ + if (mCurrentSubscriber->mWaitForCloseComplete) { mCurrentSubscriber->mIsInactive = true; - notifyEventToSubscriber( - AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, false); } - else{ + else { /* Notify only current subscriber and then delete it from * subscriberList */ notifyEventToSubscriber( @@ -140,13 +138,13 @@ void AgpsStateMachine::processAgpsEventUnsubscribe(){ } /* If no subscribers in list, release data connection */ - if(mSubscriberList.empty()){ + if (mSubscriberList.empty()) { transitionState(AGPS_STATE_RELEASED); requestOrReleaseDataConn(false); } /* Some subscribers in list, but all inactive; * Release data connection */ - else if(!anyActiveSubscribers()){ + else if(!anyActiveSubscribers()) { transitionState(AGPS_STATE_RELEASING); requestOrReleaseDataConn(false); } @@ -156,12 +154,10 @@ void AgpsStateMachine::processAgpsEventUnsubscribe(){ /* If the subscriber wishes to wait for connection close, * before being removed from list, move to inactive state * and notify */ - if(mCurrentSubscriber->mWaitForCloseComplete){ + if (mCurrentSubscriber->mWaitForCloseComplete) { mCurrentSubscriber->mIsInactive = true; - notifyEventToSubscriber( - AGPS_EVENT_UNSUBSCRIBE, mCurrentSubscriber, false); } - else{ + else { /* Notify only current subscriber and then delete it from * subscriberList */ notifyEventToSubscriber( @@ -171,7 +167,7 @@ void AgpsStateMachine::processAgpsEventUnsubscribe(){ /* If no subscribers in list, just move the state. * Request for releasing data connection should already have been * sent */ - if(mSubscriberList.empty()){ + if (mSubscriberList.empty()) { transitionState(AGPS_STATE_RELEASED); } break; @@ -183,7 +179,7 @@ void AgpsStateMachine::processAgpsEventUnsubscribe(){ void AgpsStateMachine::processAgpsEventGranted(){ - switch (mState){ + switch (mState) { case AGPS_STATE_RELEASED: case AGPS_STATE_ACQUIRED: @@ -206,7 +202,7 @@ void AgpsStateMachine::processAgpsEventGranted(){ void AgpsStateMachine::processAgpsEventReleased(){ - switch (mState){ + switch (mState) { case AGPS_STATE_RELEASED: /* Subscriber list should be empty if we are in released state */ @@ -232,12 +228,12 @@ void AgpsStateMachine::processAgpsEventReleased(){ /* If we have active subscribers now, they must be waiting for * data conn setup */ - if(anyActiveSubscribers()){ + if (anyActiveSubscribers()) { transitionState(AGPS_STATE_PENDING); requestOrReleaseDataConn(true); } /* No active subscribers, move to released state */ - else{ + else { transitionState(AGPS_STATE_RELEASED); } break; @@ -253,7 +249,7 @@ void AgpsStateMachine::processAgpsEventReleased(){ void AgpsStateMachine::processAgpsEventDenied(){ - switch (mState){ + switch (mState) { case AGPS_STATE_RELEASED: LOC_LOGE("Unexpected event DENIED in state %d", mState); @@ -271,12 +267,12 @@ void AgpsStateMachine::processAgpsEventDenied(){ /* If we have active subscribers now, they must be waiting for * data conn setup */ - if(anyActiveSubscribers()){ + if (anyActiveSubscribers()) { transitionState(AGPS_STATE_PENDING); requestOrReleaseDataConn(true); } /* No active subscribers, move to released state */ - else{ + else { transitionState(AGPS_STATE_RELEASED); } break; @@ -304,12 +300,11 @@ int AgpsStateMachine::requestOrReleaseDataConn(bool request){ nifRequest.type = (AgpsFrameworkInterface::AGnssType)mAgpsType; - if(request){ + if (request) { LOC_LOGD("AGPS Data Conn Request"); nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) LOC_GPS_REQUEST_AGPS_DATA_CONN; - } - else{ + } else { LOC_LOGD("AGPS Data Conn Release"); nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) LOC_GPS_RELEASE_AGPS_DATA_CONN; @@ -328,11 +323,11 @@ void AgpsStateMachine::notifyAllSubscribers( this, event, deleteSubscriberPostNotify, notificationType); std::list::const_iterator it = mSubscriberList.begin(); - while ( it != mSubscriberList.end() ){ + while ( it != mSubscriberList.end() ) { AgpsSubscriber* subscriber = *it; - if(notificationType == AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS || + if (notificationType == AGPS_NOTIFICATION_TYPE_FOR_ALL_SUBSCRIBERS || (notificationType == AGPS_NOTIFICATION_TYPE_FOR_INACTIVE_SUBSCRIBERS && subscriber->mIsInactive) || (notificationType == AGPS_NOTIFICATION_TYPE_FOR_ACTIVE_SUBSCRIBERS && @@ -342,13 +337,13 @@ void AgpsStateMachine::notifyAllSubscribers( * through subscriber list, inefficient; hence pass in false*/ notifyEventToSubscriber(event, subscriber, false); - if(deleteSubscriberPostNotify){ + if (deleteSubscriberPostNotify) { it = mSubscriberList.erase(it); delete subscriber; - } else{ + } else { it++; } - } else{ + } else { it++; } } @@ -362,7 +357,7 @@ void AgpsStateMachine::notifyEventToSubscriber( "SM %p, Event %d Subscriber %p Delete %d", this, event, subscriberToNotify, deleteSubscriberPostNotify); - switch (event){ + switch (event) { case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( @@ -409,9 +404,9 @@ void AgpsStateMachine::addSubscriber(AgpsSubscriber* subscriberToAdd){ // Check if subscriber is already present in the current list // If not, then add std::list::const_iterator it = mSubscriberList.begin(); - for(; it != mSubscriberList.end(); it++){ + for (; it != mSubscriberList.end(); it++) { AgpsSubscriber* subscriber = *it; - if(subscriber->equals(subscriberToAdd)){ + if (subscriber->equals(subscriberToAdd)) { LOC_LOGE("Subscriber already in list"); return; } @@ -431,11 +426,11 @@ void AgpsStateMachine::deleteSubscriber(AgpsSubscriber* subscriberToDelete){ while ( it != mSubscriberList.end() ) { AgpsSubscriber* subscriber = *it; - if(subscriber && subscriber->equals(subscriberToDelete)){ + if (subscriber && subscriber->equals(subscriberToDelete)) { it = mSubscriberList.erase(it); delete subscriber; - }else{ + } else { it++; } } @@ -444,9 +439,9 @@ void AgpsStateMachine::deleteSubscriber(AgpsSubscriber* subscriberToDelete){ bool AgpsStateMachine::anyActiveSubscribers(){ std::list::const_iterator it = mSubscriberList.begin(); - for(; it != mSubscriberList.end(); it++){ + for (; it != mSubscriberList.end(); it++) { AgpsSubscriber* subscriber = *it; - if(!subscriber->mIsInactive){ + if (!subscriber->mIsInactive) { return true; } } @@ -459,7 +454,7 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){ delete mAPN; } - if(apn == NULL || len <= 0){ + if (apn == NULL || len <= 0) { LOC_LOGD("Invalid apn len (%d) or null apn", len); mAPN = NULL; mAPNLen = 0; @@ -477,9 +472,9 @@ AgpsSubscriber* AgpsStateMachine::getSubscriber(int connHandle){ /* Go over the subscriber list */ std::list::const_iterator it = mSubscriberList.begin(); - for(; it != mSubscriberList.end(); it++){ + for (; it != mSubscriberList.end(); it++) { AgpsSubscriber* subscriber = *it; - if(subscriber->mConnHandle == connHandle){ + if (subscriber->mConnHandle == connHandle) { return subscriber; } } @@ -492,9 +487,9 @@ AgpsSubscriber* AgpsStateMachine::getFirstSubscriber(bool isInactive){ /* Go over the subscriber list */ std::list::const_iterator it = mSubscriberList.begin(); - for(; it != mSubscriberList.end(); it++){ + for (; it != mSubscriberList.end(); it++) { AgpsSubscriber* subscriber = *it; - if(subscriber->mIsInactive == isInactive){ + if(subscriber->mIsInactive == isInactive) { return subscriber; } } @@ -509,7 +504,7 @@ void AgpsStateMachine::dropAllSubscribers(){ /* Go over the subscriber list */ std::list::const_iterator it = mSubscriberList.begin(); - while ( it != mSubscriberList.end() ){ + while ( it != mSubscriberList.end() ) { AgpsSubscriber* subscriber = *it; it = mSubscriberList.erase(it); delete subscriber; @@ -524,14 +519,14 @@ const int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500; /* Overridden method * DS SM needs to handle one scenario differently */ -void DSStateMachine::processAgpsEvent(AgpsEvent event){ +void DSStateMachine::processAgpsEvent(AgpsEvent event) { LOC_LOGD("DSStateMachine::processAgpsEvent() %d", event); /* DS Client call setup APIs don't return failure/closure separately. * Hence we receive RELEASED event in both cases. * If we are in pending, we should consider RELEASED as DENIED */ - if(event == AGPS_EVENT_RELEASED && mState == AGPS_STATE_PENDING){ + if (event == AGPS_EVENT_RELEASED && mState == AGPS_STATE_PENDING) { LOC_LOGD("Translating RELEASED to DENIED event"); event = AGPS_EVENT_DENIED; @@ -549,7 +544,7 @@ void delay_callback(void *callbackData, int result) (void)result; - if(callbackData == NULL) { + if (callbackData == NULL) { LOC_LOGE("delay_callback(): NULL argument received !"); return; } @@ -566,7 +561,7 @@ void DSStateMachine :: retryCallback() /* Request SUPL ES * There must be at least one active subscriber in list */ AgpsSubscriber* subscriber = getFirstSubscriber(false); - if(subscriber == NULL) { + if (subscriber == NULL) { LOC_LOGE("No active subscriber for DS Client call setup"); return; @@ -590,7 +585,7 @@ int DSStateMachine::requestOrReleaseDataConn(bool request){ "request %d", request); /* Release data connection required ? */ - if(!request && mAgpsManager->mDSClientStopDataCallFn){ + if (!request && mAgpsManager->mDSClientStopDataCallFn) { mAgpsManager->mDSClientStopDataCallFn(); LOC_LOGD("DS Client release data call request sent !"); @@ -600,14 +595,14 @@ int DSStateMachine::requestOrReleaseDataConn(bool request){ /* Setup data connection request * There must be at least one active subscriber in list */ AgpsSubscriber* subscriber = getFirstSubscriber(false); - if(subscriber == NULL) { + if (subscriber == NULL) { LOC_LOGE("No active subscriber for DS Client call setup"); return -1; } /* DS Client Fn registered ? */ - if(!mAgpsManager->mDSClientOpenAndStartDataCallFn){ + if (!mAgpsManager->mDSClientOpenAndStartDataCallFn) { LOC_LOGE("DS Client start fn not registered, fallback to SUPL ATL"); notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); @@ -623,7 +618,7 @@ int DSStateMachine::requestOrReleaseDataConn(bool request){ case LOC_API_ADAPTER_ERR_ENGINE_BUSY: LOC_LOGE("DS Client open call failed, err: %d", ret); mRetries++; - if(mRetries > MAX_START_DATA_CALL_RETRIES) { + if (mRetries > MAX_START_DATA_CALL_RETRIES) { LOC_LOGE("DS Client call retries exhausted, " "falling back to normal SUPL ATL"); @@ -661,7 +656,7 @@ void DSStateMachine::notifyEventToSubscriber( "SM %p, Event %d Subscriber %p Delete %d", this, event, subscriberToNotify, deleteSubscriberPostNotify); - switch (event){ + switch (event) { case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( @@ -721,14 +716,14 @@ void AgpsManager::createAgpsStateMachines() { LOC_LOGD("AGNSS NIF: %p", mAgnssNif); } if (NULL == mDsNif && - loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL){ + loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { if(!mDSClientInitFn){ LOC_LOGE("DS Client Init Fn not registered !"); return; } - if(mDSClientInitFn(false) != 0){ + if (mDSClientInitFn(false) != 0) { LOC_LOGE("Failed to init data service client"); return; @@ -747,7 +742,7 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { case LOC_AGPS_TYPE_INVALID: case LOC_AGPS_TYPE_SUPL: - if(mAgnssNif == NULL){ + if (mAgnssNif == NULL) { LOC_LOGE("NULL AGNSS NIF !"); } return mAgnssNif; @@ -777,7 +772,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ AgpsStateMachine* sm = getAgpsStateMachine(agpsType); - if(sm == NULL){ + if (sm == NULL) { LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); mAtlOpenStatusCb( @@ -790,7 +785,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ sm->setCurrentSubscriber(&subscriber); /* If DS State Machine, wait for close complete */ - if(agpsType == LOC_AGPS_TYPE_SUPL_ES){ + if (agpsType == LOC_AGPS_TYPE_SUPL_ES) { subscriber.mWaitForCloseComplete = true; } @@ -820,7 +815,7 @@ void AgpsManager::releaseATL(int connHandle){ sm = mDsNif; } - if(sm == NULL){ + if (sm == NULL) { LOC_LOGE("Subscriber with connHandle %d not found in any SM", connHandle); mAtlCloseStatusCb(connHandle, 0); @@ -909,19 +904,19 @@ void AgpsManager::handleModemSSR(){ LOC_LOGD("AgpsManager::handleModemSSR"); /* Drop subscribers from all state machines */ - if (mAgnssNif){ + if (mAgnssNif) { mAgnssNif->dropAllSubscribers(); } - if (mInternetNif){ + if (mInternetNif) { mInternetNif->dropAllSubscribers(); } - if(mDsNif){ + if (mDsNif) { mDsNif->dropAllSubscribers(); } // reinitialize DS client in SSR mode - if(loc_core::ContextBase::mGps_conf. - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL){ + if (loc_core::ContextBase::mGps_conf. + USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { mDSClientStopDataCallFn(); mDSClientCloseDataCallFn(); From def65a6ea0cc7f9bd89935695dfd3d6aba246cbd Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 24 Jul 2017 15:50:13 +0530 Subject: [PATCH 557/945] Changes in LE for DataItemObserver changes Fix compilation errors in LE for changes in adding DataItemObserver interface in SystemStatus. Change-Id: I7f2987672818d9f4ff9db801b55ade6fcdfd9a7d CRs-Fixed: 2081242 --- core/Makefile.am | 3 +++ gnss/Makefile.am | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/Makefile.am b/core/Makefile.am index 568880c6..42586686 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,6 +1,9 @@ AM_CFLAGS = -I./ \ -I../utils \ -I../location \ + -I./data-items \ + -I./data-items/common \ + -I./observer \ $(LOCPLA_CFLAGS) \ $(GPSUTILS_CFLAGS) \ -I$(WORKSPACE)/gps-noship/flp \ diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 3afdcd7a..2365e4c1 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -4,12 +4,15 @@ AM_CFLAGS = \ -I./ \ -I../utils \ -I../core \ + -I../core/data-items \ + -I../core/observer \ -I../location \ -std=c++11 libgnss_la_SOURCES = \ location_gnss.cpp \ GnssAdapter.cpp \ + XtraSystemStatusObserver.cpp \ Agps.cpp if USE_GLIB From a763825b97c98c634027f6ea65250c56a2131491 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 22 Aug 2017 10:56:00 -0700 Subject: [PATCH 558/945] Incorrect location info observed in Gnss bugreport Fixed missing conversion from radian to degree for latitude and longitude values when generated from PQWP2 debug NMEA info. Bug: 64808400 Change-Id: I30c65f309c2cd209090cc45d9da1764d05a85c7b CRs-Fixed: 2095295 --- gnss/GnssAdapter.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7e638ad7..edbb0933 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -48,6 +48,8 @@ #include #include +#define RAD2DEG (180.0 / M_PI) + using namespace loc_core; GnssAdapter::GnssAdapter() : @@ -2897,16 +2899,12 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) } else if(!reports.mBestPosition.empty() && reports.mBestPosition.back().mValid) { r.mLocation.mValid = true; - r.mLocation.mLocation.latitude = - (double)(reports.mBestPosition.back().mBestLat); + r.mLocation.mLocation.latitude = + (double)(reports.mBestPosition.back().mBestLat) * RAD2DEG; r.mLocation.mLocation.longitude = - (double)(reports.mBestPosition.back().mBestLon); - r.mLocation.mLocation.altitude = - reports.mBestPosition.back().mBestAlt; - - r.mLocation.mLocation.timestamp = - reports.mBestPosition.back().mUtcReported.tv_sec * 1000ULL + - reports.mBestPosition.back().mUtcReported.tv_nsec / 1000000ULL; + (double)(reports.mBestPosition.back().mBestLon) * RAD2DEG; + r.mLocation.mLocation.altitude = reports.mBestPosition.back().mBestAlt; + r.mLocation.mUtcReported = reports.mBestPosition.back().mUtcReported; } else { r.mLocation.mValid = false; From d91d77633d321d50359082cd0b144f8da6235a20 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 29 Aug 2017 09:59:39 +0800 Subject: [PATCH 559/945] KW issues for agps module Check for null pointer before dereference in Agps.cpp Change-Id: Idd1e7950572c8a45e5c7d7da0f5caee35583b53c CRs-Fixed: 2100353 --- gnss/Agps.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 436351cd..ace639b9 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -462,9 +462,11 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){ if (NULL != apn) { mAPN = new char[len+1]; - memcpy(mAPN, apn, len); - mAPN[len] = '\0'; - mAPNLen = len; + if (NULL != mAPN) { + memcpy(mAPN, apn, len); + mAPN[len] = '\0'; + mAPNLen = len; + } } } From 2a9654103b32b86b0894f21505ddb522aa829da9 Mon Sep 17 00:00:00 2001 From: Srivastava Date: Tue, 21 Feb 2017 00:59:46 +0530 Subject: [PATCH 560/945] Integrating AGPS call flow with LocNetIface Using LocNetIface AGPS capability in case client doesn't provide status callback to setup data call. Also adding below APN and IP Type config parameters to gps.conf : INTERNET_APN INTERNET_IP_TYPE SUPL_APN SUPL_IP_TYPE CRs-Fixed: 2005565 Change-Id: If52963ed50625db379c958586813850746eb2c4e --- etc/gps.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index 1027d76b..d30461e6 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -205,3 +205,17 @@ MISSING_PULSE_TIME_DELTA = 900 # This settings enables time uncertainty propagation # logic incase of missing PPS pulse PROPAGATION_TIME_UNCERTAINTY = 1 + +####################################### +# APN / IP Type Configuration +# APN and IP Type to use for setting +# up WWAN call. +# Use below values for IP Type: +# v4 = 4 +# v6 = 6 +# v4v6 = 10 +####################################### +# INTERNET_APN = abc.xyz +# INTERNET_IP_TYPE = 4 +# SUPL_APN = abc.xyz +# SUPL_IP_TYPE = 4 From cd3027e3a646612e77d0d0026393e38404f53deb Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 22 Aug 2017 09:41:23 +0800 Subject: [PATCH 561/945] Filter the configs sent to modem on change basis Filter setServer, setPositionMode and startTracking commands sent to modem unless change happens and optimize out modem traffic hence. Change-Id: I389af9c11784848045d2d3d5d3c799675a4b24be CRs-Fixed: 2093253 --- gnss/GnssAdapter.cpp | 40 ++++++++++++++++++++++++++-------------- gnss/GnssAdapter.h | 7 +++++-- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index edbb0933..d4ffcb25 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -44,9 +44,7 @@ #include #include -#include #include -#include #define RAD2DEG (180.0 / M_PI) @@ -68,7 +66,8 @@ GnssAdapter::GnssAdapter() : mNiData(), mAgpsManager(), mAgpsCbInfo(), - mSystemStatus(SystemStatus::getInstance(mMsgTask)) + mSystemStatus(SystemStatus::getInstance(mMsgTask)), + mServerUrl("") { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -636,8 +635,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) delete[] mIds; } inline virtual void proc() const { - //const size_t MAX_BITS_COUNT = 10; - //LocationError errs[MAX_BITS_COUNT] = {}; LocationError* errs = new LocationError[mCount]; LocationError err = LOCATION_ERROR_SUCCESS; uint32_t index = 0; @@ -669,30 +666,33 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { char serverUrl[MAX_URL_LEN] = {}; - uint32_t length = 0; + int32_t length = 0; const char noHost[] = "NONE"; if (NULL == mConfig.assistanceServer.hostName || strncasecmp(noHost, mConfig.assistanceServer.hostName, sizeof(noHost)) == 0) { + err = LOCATION_ERROR_INVALID_PARAMETER; } else { length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", mConfig.assistanceServer.hostName, mConfig.assistanceServer.port); } - if (sizeof(serverUrl) > length) { + if (length > 0 && strncasecmp(mAdapter.getServerUrl().c_str(), + serverUrl, sizeof(serverUrl)) != 0) { + mAdapter.setServerUrl(serverUrl); err = mApi.setServer(serverUrl, length); - } else { - err = LOCATION_ERROR_INVALID_PARAMETER; } + } else { err = LOCATION_ERROR_SUCCESS; } } else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) { if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { struct in_addr addr; - if (!mAdapter.resolveInAddress(mConfig.assistanceServer.hostName, &addr)) { + if (!mAdapter.resolveInAddress(mConfig.assistanceServer.hostName, + &addr)) { LOC_LOGE("%s]: hostName %s cannot be resolved", __func__, mConfig.assistanceServer.hostName); err = LOCATION_ERROR_INVALID_PARAMETER; @@ -1246,6 +1246,15 @@ GnssAdapter::eraseTrackingSession(LocationAPI* client, uint32_t sessionId) } +bool GnssAdapter::setUlpPositionMode(const LocPosMode& mode) { + if (!mUlpPositionMode.equals(mode)) { + mUlpPositionMode = mode; + return true; + } else { + return false; + } +} + void GnssAdapter::reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId) { @@ -1411,8 +1420,9 @@ GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) mLocPosMode(locPosMode) {} inline virtual void proc() const { // saves the mode in adapter to be used when startTrackingCommand is called from ULP - mAdapter.setUlpPositionMode(mLocPosMode); - mApi.setPositionMode(mLocPosMode); + if (mAdapter.setUlpPositionMode(mLocPosMode)) { + mApi.setPositionMode(mLocPosMode); + } } }; @@ -1435,8 +1445,10 @@ GnssAdapter::startTrackingCommand() inline virtual void proc() const { // we get this call from ULP, so just call LocApi without multiplexing because // ulp would be doing the multiplexing for us if it is present - LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); - mApi.startFix(ulpPositionMode); + if (!mAdapter.isInSession()) { + LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + mApi.startFix(ulpPositionMode); + } } }; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 46ba34fd..3cb2c64b 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -110,6 +110,7 @@ class GnssAdapter : public LocAdapterBase { /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; + std::string mServerUrl; /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); @@ -170,7 +171,7 @@ public: void saveTrackingSession(LocationAPI* client, uint32_t sessionId, const LocationOptions& options); void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); - void setUlpPositionMode(const LocPosMode& mode) { mUlpPositionMode = mode; } + bool setUlpPositionMode(const LocPosMode& mode); LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } LocationError startTrackingMultiplex(const LocationOptions& options); LocationError startTracking(const LocationOptions& options); @@ -215,7 +216,7 @@ public: void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } uint32_t getPowerVoteId() { return mPowerVoteId; } bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); - + virtual bool isInSession() { return !mTrackingSessions.empty(); } /* ==== REPORTS ======================================================================== */ /* ======== EVENTS ====(Called from QMI/ULP Thread)===================================== */ virtual void reportPositionEvent(const UlpLocation& ulpLocation, @@ -254,6 +255,8 @@ public: /*==== SYSTEM STATUS ================================================================*/ inline SystemStatus* getSystemStatus(void) { return mSystemStatus; } + std::string& getServerUrl(void) { return mServerUrl; } + void setServerUrl(const char* server) { mServerUrl.assign(server); } /*==== CONVERSION ===================================================================*/ static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); From e0f49cdede64d24e0063c8d20b8e2af7a87721b6 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 5 Sep 2017 11:59:34 +0800 Subject: [PATCH 562/945] Check status before decide report position or not Check if inaccuracy exceeds our tolerance only when status is LOC_POS_TECH_MASK_SATELLITE Change-Id: If45f2d8f5347f5b8a7df944dfa5b8071f6c2380a CRs-Fixed: 2104827 --- gnss/GnssAdapter.cpp | 52 ++++++++++++++++++++++++-------------------- gnss/GnssAdapter.h | 2 ++ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index edbb0933..df7ea354 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1922,34 +1922,41 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, sendMsg(new MsgReportPosition(*this, ulpLocation, locationExtended, status, techMask)); } +bool +GnssAdapter::needReport(const UlpLocation& ulpLocation, + enum loc_sess_status status, + LocPosTechMask techMask) { + bool reported = false; + if (LOC_SESS_SUCCESS == status) { + // this is a final fix + LocPosTechMask mask = + LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID; + // it is a Satellite fix or a sensor fix + reported = (mask & techMask); + } else if (LOC_SESS_INTERMEDIATE == status && + LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS) { + // this is a intermediate fix and we accepte intermediate + + // it is NOT the case that + // there is inaccuracy; and + // we care about inaccuracy; and + // the inaccuracy exceeds our tolerance + reported = !((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ACCURACY) && + (ContextBase::mGps_conf.ACCURACY_THRES != 0) && + (ulpLocation.gpsLocation.accuracy > ContextBase::mGps_conf.ACCURACY_THRES)); + } + + return reported; +} + void GnssAdapter::reportPosition(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask) { - bool reported = false; - // what's in the 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 - if ((LOC_SESS_SUCCESS == status && - ((LOC_POS_TECH_MASK_SATELLITE | - LOC_POS_TECH_MASK_SENSORS | - LOC_POS_TECH_MASK_HYBRID) & - techMask)) || - (LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS && - !((ulpLocation.gpsLocation.flags & - LOC_GPS_LOCATION_HAS_ACCURACY) && - (ContextBase::mGps_conf.ACCURACY_THRES != 0) && - (ulpLocation.gpsLocation.accuracy > - ContextBase::mGps_conf.ACCURACY_THRES)))) { + bool reported = needReport(ulpLocation, status, techMask); + if (reported) { if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { mGnssSvIdUsedInPosAvail = true; mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; @@ -1966,7 +1973,6 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, it->second.gnssLocationInfoCb(locationInfo); } } - reported = true; } if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 46ba34fd..08207a42 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -238,6 +238,8 @@ public: virtual bool reportDataCallClosed(); /* ======== UTILITIES ================================================================= */ + bool needReport(const UlpLocation& ulpLocation, + enum loc_sess_status status, LocPosTechMask techMask); void reportPosition(const UlpLocation &ulpLocation, const GpsLocationExtended &locationExtended, enum loc_sess_status status, From ff8b31761cff3098444c41c8daa7baa6dff92ccd Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 11 Aug 2017 17:36:10 +0530 Subject: [PATCH 563/945] Integrate XtraSysStatObs with SystemStatusObserver Use SystemStatusObserver to subscribe for dataitems in XtraSystemStatusObserver. Change-Id: Ib1828b9025c9c5bb5194a36014249472ed3f6f9e CRs-Fixed: 2093290 --- core/SystemStatus.cpp | 74 ++- core/SystemStatus.h | 182 ++++++ core/SystemStatusOsObserver.cpp | 1007 ++++++++++++++--------------- core/SystemStatusOsObserver.h | 292 ++------- gnss/GnssAdapter.cpp | 3 +- gnss/GnssAdapter.h | 6 +- gnss/XtraSystemStatusObserver.cpp | 121 +++- gnss/XtraSystemStatusObserver.h | 31 +- gnss/location_gnss.cpp | 2 +- 9 files changed, 921 insertions(+), 797 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index dc036048..52d28c7a 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -1212,7 +1213,8 @@ IOsObserver* SystemStatus::getOsObserver() } SystemStatus::SystemStatus(const MsgTask* msgTask) : - mSysStatusObsvr(msgTask) + mSysStatusObsvr(msgTask), + mConnected(false) { int result = 0; ENTRY_LOG (); @@ -1413,6 +1415,28 @@ bool SystemStatus::setPositionFailure(const SystemStatusPQWS1& nmea) return true; } +/****************************************************************************** + SystemStatus - storing dataitems +******************************************************************************/ +bool SystemStatus::setNetworkInfo(IDataItemCore* dataitem) +{ + SystemStatusNetworkInfo* data = reinterpret_cast(dataitem); + SystemStatusNetworkInfo s(data->mType,data->mTypeName,data->mSubTypeName, + data->mAvailable,data->mConnected,data->mRoaming); + s.dump(); + mConnected = data->mConnected; + + if (!mCache.mNetworkInfo.empty() && mCache.mNetworkInfo.back().equals(s)) { + mCache.mNetworkInfo.back().mUtcReported = s.mUtcReported; + } else { + mCache.mNetworkInfo.push_back(s); + if (mCache.mNetworkInfo.size() > maxNetworkInfo) { + mCache.mNetworkInfo.erase(mCache.mNetworkInfo.begin()); + } + } + return true; +} + /****************************************************************************** @brief API to set report data into internal buffer @@ -1533,6 +1557,26 @@ bool SystemStatus::eventPosition(const UlpLocation& location, return true; } +/****************************************************************************** +@brief API to set report DataItem event into internal buffer + +@param[In] DataItem + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) +{ + pthread_mutex_lock(&mMutexSystemStatus); + switch(dataitem->getId()) + { + case NETWORKINFO_DATA_ITEM_ID: + setNetworkInfo(dataitem); + break; + } + pthread_mutex_unlock(&mMutexSystemStatus); + return true; +} + /****************************************************************************** @brief API to get report data into a given buffer @@ -1712,5 +1756,33 @@ bool SystemStatus::setDefaultReport(void) return true; } +/****************************************************************************** +@brief API to handle connection status update event from GnssRil + +@param[In] Connection status + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::eventConnectionStatus(bool connected, uint8_t type) +{ + if (connected != mConnected) { + mConnected = connected; + + // send networkinof dataitem to systemstatus observer clients + SystemStatusNetworkInfo s(type, "", "", false, connected, false); + IDataItemCore *networkinfo = + DataItemsFactoryProxy::createNewDataItem(NETWORKINFO_DATA_ITEM_ID); + if (nullptr == networkinfo) { + LOC_LOGE("Unable to create dataitemd"); + return false; + } + networkinfo->copy(&s); + list dl(0); + dl.push_back(networkinfo); + mSysStatusObsvr.notify(dl); + } + return true; +} + } // namespace loc_core diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 8cf75b5c..5dc2d9ff 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -367,19 +368,183 @@ public: void dump(void); }; +/****************************************************************************** + SystemStatus report data structure - from DataItem observer +******************************************************************************/ +class SystemStatusGpsState : public SystemStatusItemBase, public IDataItemCore +{ +public: + inline SystemStatusGpsState() : + mEnabled(false) {} + inline SystemStatusGpsState(bool enabled) : + mEnabled(enabled) {} + + bool mEnabled; + + inline bool equals(SystemStatusGpsState& peer) { + return (mEnabled == peer.mEnabled); + } + inline void dump(void) { + LOC_LOGD("GpsState: state=%u", mEnabled); + } + inline DataItemId getId() { + return GPSSTATE_DATA_ITEM_ID; + } + inline void stringify(string& valueStr) { + valueStr.clear(); + valueStr += "GpsState: enabled="; + valueStr += to_string(mEnabled); + } + inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { + SystemStatusGpsState* gpsstate = static_cast(src); + mEnabled = gpsstate->mEnabled; + if (dataItemCopied) { + *dataItemCopied = true; + } + return 1; + } +}; + +class SystemStatusNetworkInfo : public SystemStatusItemBase, public IDataItemCore +{ +public: + inline SystemStatusNetworkInfo() : + mType(0), + mTypeName(""), + mSubTypeName(""), + mAvailable(false), + mConnected(false), + mRoaming(false) {} + inline SystemStatusNetworkInfo( + uint32_t type, + std::string typeName, + std::string subTypeName, + bool available, + bool connected, + bool roaming) : + mType(type), + mTypeName(typeName), + mSubTypeName(subTypeName), + mAvailable(available), + mConnected(connected), + mRoaming(roaming) {} + + uint32_t mType; + std::string mTypeName; + std::string mSubTypeName; + bool mAvailable; + bool mConnected; + bool mRoaming; + + inline bool equals(SystemStatusNetworkInfo& peer) { + if ((mType != peer.mType) || + (mTypeName != peer.mTypeName) || + (mSubTypeName != peer.mSubTypeName) || + (mAvailable != peer.mAvailable) || + (mConnected != peer.mConnected) || + (mRoaming != peer.mRoaming)) { + return false; + } + return true; + } + inline void dump(void) { + LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); + } + inline DataItemId getId() { + return NETWORKINFO_DATA_ITEM_ID; + } + inline void stringify(string& /*valueStr*/) { } + inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { + SystemStatusNetworkInfo* networkinfo = static_cast(src); + mType = networkinfo->mType; + mTypeName = networkinfo->mTypeName; + mSubTypeName = networkinfo->mSubTypeName; + mAvailable = networkinfo->mAvailable; + mConnected = networkinfo->mConnected; + mRoaming = networkinfo->mRoaming; + if (dataItemCopied) { + *dataItemCopied = true; + } + return 1; + } +}; + +class SystemStatusTac : public SystemStatusItemBase, public IDataItemCore +{ +public: + inline SystemStatusTac() : + mValue("") {} + inline SystemStatusTac(std::string value) : + mValue(value) {} + + std::string mValue; + + inline bool equals(SystemStatusTac& peer) { + return (mValue == peer.mValue); + } + inline void dump(void) { + LOC_LOGD("Tac: value=%s", mValue.c_str()); + } + inline DataItemId getId() { + return TAC_DATA_ITEM_ID; + } + inline void stringify(string& /*valueStr*/) { } + inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { + SystemStatusTac* tac = static_cast(src); + mValue = tac->mValue; + if (dataItemCopied) { + *dataItemCopied = true; + } + return 1; + } +}; + +class SystemStatusMccMnc : public SystemStatusItemBase, public IDataItemCore +{ +public: + inline SystemStatusMccMnc() : + mValue("") {} + inline SystemStatusMccMnc(std::string value) : + mValue(value) {} + + std::string mValue; + + inline bool equals(SystemStatusMccMnc& peer) { + return (mValue == peer.mValue); + } + inline void dump(void) { + LOC_LOGD("TacMccMnc value=%s", mValue.c_str()); + } + inline DataItemId getId() { + return MCCMNC_DATA_ITEM_ID; + } + inline void stringify(string& /*valueStr*/) { } + inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { + SystemStatusMccMnc* mccmnc = static_cast(src); + mValue = mccmnc->mValue; + if (dataItemCopied) { + *dataItemCopied = true; + } + return 1; + } +}; + /****************************************************************************** SystemStatusReports ******************************************************************************/ class SystemStatusReports { public: + // from QMI_LOC indication std::vector mLocation; + // from ME debug NMEA std::vector mTimeAndClock; std::vector mXoState; std::vector mRfAndParams; std::vector mErrRecovery; + // from PE debug NMEA std::vector mInjectedPosition; std::vector mBestPosition; std::vector mXtra; @@ -388,7 +553,14 @@ public: std::vector mPdr; std::vector mNavData; + // from SM debug NMEA std::vector mPositionFailure; + + // from dataitems observer + std::vector mGpsState; + std::vector mNetworkInfo; + std::vector mTac; + std::vector mMccMnc; }; /****************************************************************************** @@ -424,7 +596,13 @@ private: static const uint32_t maxPositionFailure = 5; + static const uint32_t maxGpsState = 5; + static const uint32_t maxNetworkInfo = 5; + static const uint32_t maxTac = 5; + static const uint32_t maxMccMnc = 5; + SystemStatusReports mCache; + bool mConnected; bool setLocation(const UlpLocation& location); @@ -443,6 +621,8 @@ private: bool setPositionFailure(const SystemStatusPQWS1& nmea); + bool setNetworkInfo(IDataItemCore* dataitem); + public: // Static methods static SystemStatus* getInstance(const MsgTask* msgTask); @@ -451,9 +631,11 @@ public: // Helpers bool eventPosition(const UlpLocation& location,const GpsLocationExtended& locationEx); + bool eventDataItemNotify(IDataItemCore* dataitem); bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; bool setDefaultReport(void); + bool eventConnectionStatus(bool connected, uint8_t type); }; } // namespace loc_core diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index e327f93a..319f1d7a 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -28,618 +28,565 @@ */ #define LOG_TAG "LocSvc_SystemStatusOsObserver" -#include -#include -#include -#include -#include -#include -#include #include - -#include +#include #include - -#include #include #include #include #include - #include -#include - namespace loc_core { -#define BREAK_IF_ZERO(ERR,X) if(0==(X)) {result = (ERR); break;} -#define BREAK_IF_NON_ZERO(ERR,X) if(0!=(X)) {result = (ERR); break;} - SystemStatusOsObserver::SystemStatusOsObserver(const MsgTask* msgTask) : - mAddress ("SystemStatusOsObserver"), - mClientIndex(IndexFactory :: createClientIndex ()), - mDataItemIndex(IndexFactory :: createDataItemIndex ()) + mAddress("SystemStatusOsObserver"), + mClientIndex(IndexFactory :: createClientIndex()), + mDataItemIndex(IndexFactory :: createDataItemIndex()) { - int result = -1; - ENTRY_LOG (); - do { - BREAK_IF_ZERO (1, mClientIndex); - BREAK_IF_ZERO (2, mDataItemIndex); - mContext.mMsgTask = msgTask; - result = 0; - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); + mContext.mMsgTask = msgTask; } -SystemStatusOsObserver :: ~SystemStatusOsObserver () +SystemStatusOsObserver::~SystemStatusOsObserver() { // Close data-item library handle DataItemsFactoryProxy::closeDataItemLibraryHandle(); // Destroy cache - map :: iterator citer = mDataItemCache.begin (); - for (; citer != mDataItemCache.end (); ++citer) { - if (citer->second != NULL) { delete citer->second; } + for (auto each : mDataItemCache) { + if (nullptr != each.second) { + delete each.second; + } } - mDataItemCache.clear (); + + mDataItemCache.clear(); delete mClientIndex; delete mDataItemIndex; - mClientIndex = NULL; - mDataItemIndex = NULL; } -/****************************************************************************** - Message proc -******************************************************************************/ -void SystemStatusOsObserver :: HandleSubscribeReq :: proc () const { +void SystemStatusOsObserver::setSubscriptionObj(IDataItemSubscription* subscriptionObj) +{ + mContext.mSubscriptionObj = subscriptionObj; - int result = 0; - ENTRY_LOG (); - do { - if (mDataItemList.empty ()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - result = 0; - break; - } - //mDataItemList.sort (); - // Handle First Response - list pendingFirstResponseList; - this->mParent->mClientIndex->add (this->mClient, mDataItemList, pendingFirstResponseList); + LOC_LOGD("Request cache size - Subscribe:%zu RequestData:%zu", + mSubscribeReqCache.size(), mReqDataCache.size()); - // Do not send first response for only pendingFirstResponseList, - // instead send for all the data items (present in the cache) that - // have been subscribed for each time. - this->mParent->sendFirstResponse (mDataItemList, this->mClient); - - list yetToSubscribeDataItemsList; - this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty ()) { - this->mParent->mContext.mSubscriptionObj->subscribe - ( - yetToSubscribeDataItemsList, - this->mParent - ); - LOC_LOGD ("Subscribe Request sent to framework for the following data items"); - this->mParent->logMe (yetToSubscribeDataItemsList); - } - - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); - return; + // we have received the subscription object. process cached requests + // process - subscribe request cache + for (auto each : mSubscribeReqCache) { + subscribe(each.second, each.first); + } + // process - requestData request cache + for (auto each : mReqDataCache) { + requestData(each.second, each.first); + } } -void SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - if (mDataItemList.empty ()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - result = 0; - break; +// Helper to cache requests subscribe and requestData till subscription obj is obtained +void SystemStatusOsObserver::cacheObserverRequest(ObserverReqCache& reqCache, + const list& l, IDataItemObserver* client) +{ + ObserverReqCache::iterator dicIter = reqCache.find(client); + if (dicIter != reqCache.end()) { + // found + list difference(0); + set_difference(l.begin(), l.end(), + dicIter->second.begin(), dicIter->second.end(), + inserter(difference, difference.begin())); + if (!difference.empty()) { + difference.sort(); + dicIter->second.merge(difference); + dicIter->second.unique(); } - //mDataItemList.sort (); - list currentlySubscribedList; - this->mParent->mClientIndex->getSubscribedList (this->mClient, currentlySubscribedList); - list removeDataItemList; - set_difference (currentlySubscribedList.begin (), currentlySubscribedList.end (), - mDataItemList.begin (), mDataItemList.end (), - inserter (removeDataItemList,removeDataItemList.begin ())); - // Handle First Response - list pendingFirstResponseList; - this->mParent->mClientIndex->add (this->mClient, mDataItemList, pendingFirstResponseList); - // Send First Response - this->mParent->sendFirstResponse (pendingFirstResponseList, this->mClient); - - list yetToSubscribeDataItemsList; - this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty ()) { - this->mParent->mContext.mSubscriptionObj->subscribe - ( - yetToSubscribeDataItemsList, - this->mParent - ); - LOC_LOGD ("Subscribe Request sent to framework for the following data items"); - this->mParent->logMe (yetToSubscribeDataItemsList); - } - - list unsubscribeList; - list unused; - this->mParent->mClientIndex->remove (this->mClient, removeDataItemList, unused); - - if (!this->mParent->mClientIndex->isSubscribedClient (this->mClient)) { - this->mParent->mDataItemIndex->remove (list (1,this->mClient), unsubscribeList); - } - if (!unsubscribeList.empty ()) { - // Send unsubscribe to framework - this->mParent->mContext.mSubscriptionObj->unsubscribe - ( - unsubscribeList, - this->mParent - ); - LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); - this->mParent->logMe (unsubscribeList); - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); -} - -void SystemStatusOsObserver :: HandleRequestData :: proc () const { - int result = 0; - ENTRY_LOG (); - - do { - if (mDataItemList.empty ()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - result = 0; - break; - } - //mDataItemList.sort (); - list yetToSubscribeDataItemsList; - this->mParent->mClientIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); - this->mParent->mDataItemIndex->add (this->mClient, mDataItemList, yetToSubscribeDataItemsList); - // Send subscription list to framework - if (!mDataItemList.empty ()) { - this->mParent->mContext.mSubscriptionObj->requestData - ( - mDataItemList, - this->mParent - ); - LOC_LOGD ("Subscribe Request sent to framework for the following data items"); - this->mParent->logMe (yetToSubscribeDataItemsList); - } - - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); -} - -void SystemStatusOsObserver :: HandleUnsubscribeReq :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - if (mDataItemList.empty ()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - result = 0; - break; - } - //mDataItemList.sort (); - list unsubscribeList; - list unused; - this->mParent->mClientIndex->remove (this->mClient, mDataItemList, unused); - - list :: const_iterator it = mDataItemList.begin (); - for (; it != mDataItemList.end (); ++it) { - list clientListSubs; - list clientListOut; - this->mParent->mDataItemIndex->remove ((*it), - list (1,this->mClient), clientListOut); - // check if there are any other subscribed client for this data item id - this->mParent->mDataItemIndex->getListOfSubscribedClients ( (*it), clientListSubs); - if (clientListSubs.empty()) - { - LOC_LOGD ("Client list subscribed is empty for dataitem - %d",(*it)); - unsubscribeList.push_back((*it)); - } - } - if (!unsubscribeList.empty ()) { - // Send unsubscribe to framework - this->mParent->mContext.mSubscriptionObj->unsubscribe - ( - unsubscribeList, - this->mParent - ); - LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); - this->mParent->logMe (unsubscribeList); - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); -} - -void SystemStatusOsObserver :: HandleUnsubscribeAllReq :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - list clients (1, this->mClient); - list unsubscribeList; - BREAK_IF_NON_ZERO (2, this->mParent->mClientIndex->remove (this->mClient)); - - - this->mParent->mDataItemIndex->remove (clients, unsubscribeList); - if (!unsubscribeList.empty ()) { - // Send unsubscribe to framework - this->mParent->mContext.mSubscriptionObj->unsubscribe - ( - unsubscribeList, - this->mParent - ); - LOC_LOGD ("Unsubscribe Request sent to framework for the following data items"); - this->mParent->logMe (unsubscribeList); - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); -} - -void SystemStatusOsObserver :: HandleNotify :: getListOfClients - (const list & dlist, list & clients ) const { - - list :: const_iterator it = dlist.begin (); - for (; it != dlist.end (); ++it) { - list clientList; - this->mParent->mDataItemIndex->getListOfSubscribedClients ( (*it), clientList); - list :: iterator citer = clientList.begin (); - for (; citer != clientList.end (); ++citer) { - clients.push_back (*citer); - } - clientList.clear (); - } - // remove duplicates - clients.unique (); -} - -void SystemStatusOsObserver :: HandleNotify :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - // Update Cache with received data items and prepare - // list of data items to be sent. - list :: const_iterator it = mDList.begin (); - list dataItemIdsToBeSent; - for (; it != mDList.end (); ++it) { - bool dataItemUpdated = false; - this->mParent->updateCache (*it, dataItemUpdated); - if (dataItemUpdated) { - dataItemIdsToBeSent.push_back ( (*it)->getId ()); - } - } - - list clientList; - this->getListOfClients (dataItemIdsToBeSent, clientList); - list :: iterator citer = clientList.begin (); - // Send data item to all subscribed clients - LOC_LOGD ("LocTech-Label :: SystemStatusOsObserver :: Data Items Out"); - for (; citer != clientList.end (); ++citer) { - do { - list dataItemIdsSubscribedByThisClient; - list dataItemIdsToBeSentForThisClient; - this->mParent->mClientIndex->getSubscribedList (*citer, dataItemIdsSubscribedByThisClient); - dataItemIdsSubscribedByThisClient.sort (); - dataItemIdsToBeSent.sort (); - set_intersection (dataItemIdsToBeSent.begin (), - dataItemIdsToBeSent.end (), - dataItemIdsSubscribedByThisClient.begin (), - dataItemIdsSubscribedByThisClient.end (), - inserter (dataItemIdsToBeSentForThisClient, - dataItemIdsToBeSentForThisClient.begin ())); - BREAK_IF_NON_ZERO (4,this->mParent->sendCachedDataItems (dataItemIdsToBeSentForThisClient, *citer)); - dataItemIdsSubscribedByThisClient.clear (); - dataItemIdsToBeSentForThisClient.clear (); - } while (0); - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); -} - -void SystemStatusOsObserver :: HandleTurnOn :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - // Send action turn on to framework - this->mParent->mContext.mFrameworkActionReqObj->turnOn(mDataItemId, mTimeOut); - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); -} - -void SystemStatusOsObserver :: HandleTurnOff :: proc () const { - int result = 0; - ENTRY_LOG (); - do { - // Send action turn off to framework - this->mParent->mContext.mFrameworkActionReqObj->turnOff(mDataItemId); - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); + } + else { + // not found + reqCache[client] = l; + } } /****************************************************************************** IDataItemSubscription Overrides ******************************************************************************/ -void SystemStatusOsObserver :: subscribe (const list & l, IDataItemObserver * client) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mSubscriptionObj != NULL) { - HandleSubscribeReq * msg = new (nothrow) HandleSubscribeReq (this, l, client); - mContext.mMsgTask->sendMsg (msg); +void SystemStatusOsObserver::subscribe( + const list& l, IDataItemObserver* client) +{ + if (nullptr == mContext.mSubscriptionObj) { + LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); + cacheObserverRequest(mSubscribeReqCache, l, client); + return; + } + + struct HandleSubscribeReq : public LocMsg { + HandleSubscribeReq(SystemStatusOsObserver* parent, + const list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), mDataItemList(l) {} + virtual ~HandleSubscribeReq() {} + void proc() const { + + if (mDataItemList.empty()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + return; + } + + // Handle First Response + list pendingFirstResponseList(0); + mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); + + // Do not send first response for only pendingFirstResponseList, + // instead send for all the data items (present in the cache) that + // have been subscribed for each time. + mParent->sendFirstResponse(mDataItemList, mClient); + + list yetToSubscribeDataItemsList(0); + mParent->mDataItemIndex->add(mClient, mDataItemList, yetToSubscribeDataItemsList); + + // Send subscription list to framework + if (!yetToSubscribeDataItemsList.empty()) { + mParent->mContext.mSubscriptionObj->subscribe(yetToSubscribeDataItemsList, mParent); + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(yetToSubscribeDataItemsList); + } } - else { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); + SystemStatusOsObserver* mParent; + IDataItemObserver* mClient; + const list mDataItemList; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleSubscribeReq(this, l, client)); } -void SystemStatusOsObserver :: updateSubscription (const list & l, IDataItemObserver * client) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mSubscriptionObj != NULL) { - mContext.mMsgTask->sendMsg (new (nothrow) HandleUpdateSubscriptionReq (this, l, client)); +void SystemStatusOsObserver::updateSubscription( + const list& l, IDataItemObserver* client) +{ + if (nullptr == mContext.mSubscriptionObj) { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + return; + } + + struct HandleUpdateSubscriptionReq : public LocMsg { + HandleUpdateSubscriptionReq(SystemStatusOsObserver* parent, + const list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), mDataItemList(l) {} + virtual ~HandleUpdateSubscriptionReq() {} + void proc() const { + if (mDataItemList.empty()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + return; + } + + list currentlySubscribedList(0); + mParent->mClientIndex->getSubscribedList(mClient, currentlySubscribedList); + + list removeDataItemList(0); + set_difference(currentlySubscribedList.begin(), currentlySubscribedList.end(), + mDataItemList.begin(), mDataItemList.end(), + inserter(removeDataItemList,removeDataItemList.begin())); + + // Handle First Response + list pendingFirstResponseList(0); + mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); + + // Send First Response + mParent->sendFirstResponse(pendingFirstResponseList, mClient); + + list yetToSubscribeDataItemsList(0); + mParent->mDataItemIndex->add( + mClient, mDataItemList, yetToSubscribeDataItemsList); + + // Send subscription list to framework + if (!yetToSubscribeDataItemsList.empty()) { + mParent->mContext.mSubscriptionObj->subscribe( + yetToSubscribeDataItemsList, mParent); + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(yetToSubscribeDataItemsList); + } + + list unsubscribeList(0); + list unused(0); + mParent->mClientIndex->remove(mClient, removeDataItemList, unused); + + if (!mParent->mClientIndex->isSubscribedClient(mClient)) { + mParent->mDataItemIndex->remove( + list (1,mClient), unsubscribeList); + } + if (!unsubscribeList.empty()) { + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + LOC_LOGD("Unsubscribe Request sent to framework for the following"); + mParent->logMe(unsubscribeList); + } } - else { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); + SystemStatusOsObserver* mParent; + IDataItemObserver* mClient; + const list mDataItemList; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleUpdateSubscriptionReq(this, l, client)); } -void SystemStatusOsObserver :: requestData (const list & l, IDataItemObserver * client) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mSubscriptionObj != NULL) { - mContext.mMsgTask->sendMsg (new (nothrow) HandleRequestData (this, l, client)); - } - else { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); +void SystemStatusOsObserver::requestData( + const list& l, IDataItemObserver* client) +{ + if (nullptr == mContext.mSubscriptionObj) { + LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); + cacheObserverRequest(mReqDataCache, l, client); + return; + } - EXIT_LOG_WITH_ERROR ("%d",result); + struct HandleRequestData : public LocMsg { + HandleRequestData(SystemStatusOsObserver* parent, + const list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), mDataItemList(l) {} + virtual ~HandleRequestData() {} + void proc() const { + if (mDataItemList.empty()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + return; + } + + list yetToSubscribeDataItemsList(0); + mParent->mClientIndex->add( + mClient, mDataItemList, yetToSubscribeDataItemsList); + mParent->mDataItemIndex->add( + mClient, mDataItemList, yetToSubscribeDataItemsList); + + // Send subscription list to framework + if (!mDataItemList.empty()) { + mParent->mContext.mSubscriptionObj->requestData(mDataItemList, mParent); + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(yetToSubscribeDataItemsList); + } + } + SystemStatusOsObserver* mParent; + IDataItemObserver* mClient; + const list mDataItemList; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleRequestData(this, l, client)); } -void SystemStatusOsObserver :: unsubscribe (const list & l, IDataItemObserver * client) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mSubscriptionObj != NULL) { - mContext.mMsgTask->sendMsg (new (nothrow) HandleUnsubscribeReq (this, l, client)); +void SystemStatusOsObserver::unsubscribe( + const list& l, IDataItemObserver* client) +{ + if (nullptr == mContext.mSubscriptionObj) { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + return; + } + struct HandleUnsubscribeReq : public LocMsg { + HandleUnsubscribeReq(SystemStatusOsObserver* parent, + const list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), mDataItemList(l) {} + virtual ~HandleUnsubscribeReq() {} + void proc() const { + if (mDataItemList.empty()) { + LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); + return; + } + + list unsubscribeList(0); + list unused(0); + mParent->mClientIndex->remove(mClient, mDataItemList, unused); + + for (auto each : mDataItemList) { + list clientListSubs(0); + list clientListOut(0); + mParent->mDataItemIndex->remove( + each, list (1,mClient), clientListOut); + // check if there are any other subscribed client for this data item id + mParent->mDataItemIndex->getListOfSubscribedClients(each, clientListSubs); + if (clientListSubs.empty()) + { + LOC_LOGD("Client list subscribed is empty for dataitem - %d", each); + unsubscribeList.push_back(each); + } + } + + if (!unsubscribeList.empty()) { + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); + mParent->logMe(unsubscribeList); + } } - else { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); + SystemStatusOsObserver* mParent; + IDataItemObserver* mClient; + const list mDataItemList; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeReq(this, l, client)); } -void SystemStatusOsObserver :: unsubscribeAll (IDataItemObserver * client) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mSubscriptionObj != NULL) { - mContext.mMsgTask->sendMsg (new (nothrow) HandleUnsubscribeAllReq (this, client)); +void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) +{ + if (nullptr == mContext.mSubscriptionObj) { + LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); + return; + } + + struct HandleUnsubscribeAllReq : public LocMsg { + HandleUnsubscribeAllReq(SystemStatusOsObserver* parent, + IDataItemObserver* client) : + mParent(parent), mClient(client) {} + virtual ~HandleUnsubscribeAllReq() {} + void proc() const { + list clients(1, mClient); + list unsubscribeList(0); + if(0 == mParent->mClientIndex->remove(mClient)) { + return; + } + mParent->mDataItemIndex->remove(clients, unsubscribeList); + + if (!unsubscribeList.empty()) { + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); + mParent->logMe(unsubscribeList); + } } - else { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d",result); + SystemStatusOsObserver* mParent; + IDataItemObserver* mClient; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeAllReq(this, client)); } /****************************************************************************** IDataItemObserver Overrides ******************************************************************************/ -void SystemStatusOsObserver::getName(string & name) { - name = mAddress; -} +void SystemStatusOsObserver::notify(const list& dlist) +{ + list dataItemList(0); -void SystemStatusOsObserver::notify(const std::list & dlist) { - int result = 0; - ENTRY_LOG (); - do { - list :: const_iterator it = dlist.begin (); - list dataItemList; - list ids; - LOC_LOGD("LocTech-Label :: SystemStatusOsObserver :: Data Items In"); - for (; it != dlist.end (); ++it) { - if (*it != NULL) { - string dv; - (*it)->stringify(dv); - LOC_LOGD("LocTech-Value :: Data Item Value: %s", dv.c_str ()); - IDataItemCore * dataitem = DataItemsFactoryProxy::createNewDataItem((*it)->getId()); - BREAK_IF_ZERO (2, dataitem); - // Copy contents into the newly created data item - dataitem->copy(*it); - dataItemList.push_back(dataitem); - ids.push_back((*it)->getId()); + for (auto each : dlist) { + string dv; + each->stringify(dv); + LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); + + IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); + if (nullptr == di) { + LOC_LOGE("Unable to create dataitem:%d", each->getId()); + return; + } + + // Copy contents into the newly created data item + di->copy(each); + dataItemList.push_back(di); + // Request systemstatus to record this dataitem in its cache + SystemStatus* systemstatus = SystemStatus::getInstance(mContext.mMsgTask); + if(nullptr != systemstatus) { + systemstatus->eventDataItemNotify(di); + } + } + + struct HandleNotify : public LocMsg { + HandleNotify(SystemStatusOsObserver* parent, const list& l) : + mParent(parent), mDList(l) {} + virtual ~HandleNotify() { + for (auto each : mDList) { + delete each; } } - mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify (this, dataItemList)); - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); + void proc() const { + // Update Cache with received data items and prepare + // list of data items to be sent. + list dataItemIdsToBeSent(0); + for (auto item : mDList) { + bool dataItemUpdated = false; + mParent->updateCache(item, dataItemUpdated); + if (dataItemUpdated) { + dataItemIdsToBeSent.push_back(item->getId()); + } + } + + // Send data item to all subscribed clients + list clientList(0); + for (auto each : dataItemIdsToBeSent) { + list clients(0); + mParent->mDataItemIndex->getListOfSubscribedClients(each, clients); + for (auto each_cient: clients) { + clientList.push_back(each_cient); + } + } + clientList.unique(); + + for (auto client : clientList) { + list dataItemIdsSubscribedByThisClient(0); + list dataItemIdsToBeSentForThisClient(0); + mParent->mClientIndex->getSubscribedList( + client, dataItemIdsSubscribedByThisClient); + dataItemIdsSubscribedByThisClient.sort(); + dataItemIdsToBeSent.sort(); + + set_intersection(dataItemIdsToBeSent.begin(), + dataItemIdsToBeSent.end(), + dataItemIdsSubscribedByThisClient.begin(), + dataItemIdsSubscribedByThisClient.end(), + inserter(dataItemIdsToBeSentForThisClient, + dataItemIdsToBeSentForThisClient.begin())); + + mParent->sendCachedDataItems(dataItemIdsToBeSentForThisClient, client); + dataItemIdsSubscribedByThisClient.clear(); + dataItemIdsToBeSentForThisClient.clear(); + } + } + SystemStatusOsObserver* mParent; + const list mDList; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify(this, dataItemList)); } /****************************************************************************** IFrameworkActionReq Overrides ******************************************************************************/ -void SystemStatusOsObserver :: turnOn (DataItemId dit, int timeOut) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mFrameworkActionReqObj != NULL) { - // Check if data item exists in mActiveRequestCount - map :: iterator citer = mActiveRequestCount.find (dit); - if (citer == mActiveRequestCount.end ()) { - // Data item not found in map - // Add reference count as 1 and add dataitem to map - pair cpair (dit, 1); - mActiveRequestCount.insert (cpair); - LOC_LOGD("Sending turnOn request"); - // Send action turn on to framework - mContext.mMsgTask->sendMsg (new (nothrow) HandleTurnOn (this, dit, timeOut)); - } else { - // Found in map, update reference count - citer->second++; - LOC_LOGD("HandleTurnOn - Data item:%d Num_refs:%d",dit,citer->second); - } - } - else { - LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); +void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut) +{ + if (nullptr == mContext.mFrameworkActionReqObj) { + LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); + return; + } - EXIT_LOG_WITH_ERROR ("%d", result); + // Check if data item exists in mActiveRequestCount + map::iterator citer = mActiveRequestCount.find(dit); + if (citer == mActiveRequestCount.end()) { + // Data item not found in map + // Add reference count as 1 and add dataitem to map + pair cpair(dit, 1); + mActiveRequestCount.insert(cpair); + LOC_LOGD("Sending turnOn request"); + + // Send action turn on to framework + struct HandleTurnOnMsg : public LocMsg { + HandleTurnOnMsg(IFrameworkActionReq* framework, + DataItemId dit, int timeOut) : + mFrameworkActionReqObj(framework), mDataItemId(dit), mTimeOut(timeOut) {} + virtual ~HandleTurnOnMsg() {} + void proc() const { + mFrameworkActionReqObj->turnOn(mDataItemId, mTimeOut); + } + IFrameworkActionReq* mFrameworkActionReqObj; + DataItemId mDataItemId; + int mTimeOut; + }; + mContext.mMsgTask->sendMsg(new (nothrow) HandleTurnOnMsg(this, dit, timeOut)); + } + else { + // Found in map, update reference count + citer->second++; + LOC_LOGD("turnOn - Data item:%d Num_refs:%d", dit, citer->second); + } } -void SystemStatusOsObserver :: turnOff (DataItemId dit) { - int result = 0; - ENTRY_LOG (); - do { - if (mContext.mFrameworkActionReqObj != NULL) { - // Check if data item exists in mActiveRequestCount - map :: iterator citer = mActiveRequestCount.find (dit); - if (citer != mActiveRequestCount.end ()) { - citer->second--; - LOC_LOGD("HandleTurnOff - Data item:%d Remaining Num_refs:%d",dit,citer->second); +void SystemStatusOsObserver::turnOff(DataItemId dit) +{ + if (nullptr == mContext.mFrameworkActionReqObj) { + LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); + return; + } - if(citer->second == 0) { - LOC_LOGD("Sending turnOff request"); - // if this was last reference, remove item from map and turn off module - mActiveRequestCount.erase(citer); - // Send action turn off to framework - mContext.mMsgTask->sendMsg (new (nothrow) HandleTurnOff (this, dit)); + // Check if data item exists in mActiveRequestCount + map::iterator citer = mActiveRequestCount.find(dit); + if (citer != mActiveRequestCount.end()) { + // found + citer->second--; + LOC_LOGD("turnOff - Data item:%d Remaining:%d", dit, citer->second); + if(citer->second == 0) { + // if this was last reference, remove item from map and turn off module + mActiveRequestCount.erase(citer); + + // Send action turn off to framework + struct HandleTurnOffMsg : public LocMsg { + HandleTurnOffMsg(IFrameworkActionReq* framework, DataItemId dit) : + mFrameworkActionReqObj(framework), mDataItemId(dit) {} + virtual ~HandleTurnOffMsg() {} + void proc() const { + mFrameworkActionReqObj->turnOff(mDataItemId); } - } else { - // Not found in map - LOC_LOGD ("Data item id %d not found in FrameworkModuleMap",dit); - } + IFrameworkActionReq* mFrameworkActionReqObj; + DataItemId mDataItemId; + }; + mContext.mMsgTask->sendMsg( + new (nothrow) HandleTurnOffMsg(mContext.mFrameworkActionReqObj, dit)); } - else { - LOC_LOGE("%s:%d]: Framework action request object is NULL", __func__, __LINE__); - result = 1; - } - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); + } } /****************************************************************************** Helpers ******************************************************************************/ -void SystemStatusOsObserver :: logMe (const list & l) { - list :: const_iterator it = l.begin (); - for (;it != l.end (); ++it) { - LOC_LOGD ("DataItem %d",*it); +void SystemStatusOsObserver::sendFirstResponse( + const list& l, IDataItemObserver* to) +{ + if (l.empty()) { + LOC_LOGV("list is empty. Nothing to do. Exiting"); + return; } -} -int SystemStatusOsObserver :: sendFirstResponse (const list & l, IDataItemObserver * to) { - int result = 0; - ENTRY_LOG (); - do { - if (l.empty ()) { - LOC_LOGV("list is empty. Nothing to do. Exiting"); - result = 0; - break; - } + string clientName; + to->getName(clientName); + list dataItems(0); - string clientName; - to->getName (clientName); - LOC_LOGD ("First response sent for the following data items To Client: %s", clientName.c_str()); - - list dataItems; - list :: const_iterator diditer = l.begin (); - for (; diditer != l.end (); ++diditer) { - map :: const_iterator citer = mDataItemCache.find (*diditer); - if (citer != mDataItemCache.end ()) { - string dv; - IDataItemCore * di = citer->second; - di->stringify (dv); - LOC_LOGD ("LocTech-Value :: Data Item: %s", dv.c_str ()); - dataItems.push_back (citer->second); - } - } - if (dataItems.empty ()) { - LOC_LOGV("No items to notify. Nothing to do. Exiting"); - result = 0; - break; - } - - // Notify Client - to->notify (dataItems); - - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); - return result; -} - -int SystemStatusOsObserver :: sendCachedDataItems (const list & l, IDataItemObserver * to) { - int result = 0; - ENTRY_LOG (); - do { - list dataItems; - list :: const_iterator it = l.begin (); - string clientName; - to->getName (clientName); - LOC_LOGD ("LocTech-Value :: To Client: %s", clientName.c_str ()); - for (; it != l.end (); ++it) { + for (auto each : l) { + map::const_iterator citer = mDataItemCache.find(each); + if (citer != mDataItemCache.end()) { string dv; - IDataItemCore * di = this->mDataItemCache [ (*it) ]; - di->stringify (dv); - LOC_LOGI("LocTech-Value :: Data Item: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back (di); + citer->second->stringify(dv); + LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_back(citer->second); } - - to->notify (dataItems); - - } while (0); - EXIT_LOG_WITH_ERROR ("%d", result); - return result; + } + if (dataItems.empty()) { + LOC_LOGV("No items to notify. Nothing to do. Exiting"); + return; + } + to->notify(dataItems); } -int SystemStatusOsObserver :: updateCache (IDataItemCore * d, bool &dataItemUpdated) { - int result = 0; - ENTRY_LOG (); - do { - BREAK_IF_ZERO (1, d); - // Check if data item exists in cache - map :: iterator citer = mDataItemCache.find (d->getId ()); - if (citer == mDataItemCache.end ()) { - // New data item; not found in cache - IDataItemCore * dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); - BREAK_IF_ZERO (2, dataitem); - // Copy the contents of the data item - dataitem->copy (d); - pair cpair (d->getId (), dataitem); - // Insert in mDataItemCache - mDataItemCache.insert (cpair); - dataItemUpdated = true; - } else { - // Found in cache; Update cache if necessary - BREAK_IF_NON_ZERO(3, citer->second->copy (d, &dataItemUpdated)); +void SystemStatusOsObserver::sendCachedDataItems( + const list& l, IDataItemObserver* to) +{ + string clientName; + to->getName(clientName); + list dataItems(0); + + for (auto each : l) { + string dv; + IDataItemCore* di = mDataItemCache[each]; + di->stringify(dv); + LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_back(di); + } + to->notify(dataItems); +} + +void SystemStatusOsObserver::updateCache(IDataItemCore* d, bool& dataItemUpdated) +{ + if (nullptr == d) { + return; + } + + // Check if data item exists in cache + map::iterator citer = + mDataItemCache.find(d->getId()); + if (citer == mDataItemCache.end()) { + // New data item; not found in cache + IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); + if (nullptr == dataitem) { + return; } - if (dataItemUpdated) { - LOC_LOGV("DataItem:%d updated:%d", d->getId (), dataItemUpdated); + // Copy the contents of the data item + dataitem->copy(d); + pair cpair(d->getId(), dataitem); + // Insert in mDataItemCache + mDataItemCache.insert(cpair); + dataItemUpdated = true; + } + else { + // Found in cache; Update cache if necessary + if(0 == citer->second->copy(d, &dataItemUpdated)) { + return; } - } while (0); + } - EXIT_LOG_WITH_ERROR ("%d", result); - return result; + if (dataItemUpdated) { + LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); + } } } // namespace loc_core diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 8e42d211..985e5c99 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -29,36 +29,34 @@ #ifndef __SYSTEM_STATUS_OSOBSERVER__ #define __SYSTEM_STATUS_OSOBSERVER__ -#include +#include #include #include #include #include #include -#include -#include + #include +#include #include +#include namespace loc_core { - /****************************************************************************** SystemStatusOsObserver ******************************************************************************/ +using namespace std; + // Forward Declarations class IDataItemCore; - -template -class IClientIndex; - -template -class IDataItemIndex; +template class IClientIndex; +template class IDataItemIndex; struct SystemContext { - IDataItemSubscription *mSubscriptionObj; - IFrameworkActionReq *mFrameworkActionReqObj; - const MsgTask *mMsgTask; + IDataItemSubscription* mSubscriptionObj; + IFrameworkActionReq* mFrameworkActionReqObj; + const MsgTask* mMsgTask; inline SystemContext() : mSubscriptionObj(NULL), @@ -66,6 +64,8 @@ struct SystemContext { mMsgTask(NULL) {} }; +typedef map> ObserverReqCache; + // Clients wanting to get data from OS/Framework would need to // subscribe with OSObserver using IDataItemSubscription interface. // Such clients would need to implement IDataItemObserver interface @@ -80,252 +80,54 @@ public: ~SystemStatusOsObserver(); // To set the subscription object - inline void setSubscriptionObj(IDataItemSubscription *subscriptionObj) { - mContext.mSubscriptionObj = subscriptionObj; - }; + virtual void setSubscriptionObj(IDataItemSubscription* subscriptionObj); // To set the framework action request object - inline void setFrameworkActionReqObj(IFrameworkActionReq *frameworkActionReqObj) { + inline void setFrameworkActionReqObj(IFrameworkActionReq* frameworkActionReqObj) { mContext.mFrameworkActionReqObj = frameworkActionReqObj; } - // IDataItemObserver Overrides - virtual void getName (string & name); - virtual void notify (const std::list & dlist); - // IDataItemSubscription Overrides - virtual void subscribe (const std :: list & l, IDataItemObserver * client); - virtual void updateSubscription - ( - const std :: list & l, - IDataItemObserver * client - ); - virtual void requestData - ( - const std :: list & l, - IDataItemObserver * client - ); - virtual void unsubscribe (const std :: list & l, IDataItemObserver * client); - virtual void unsubscribeAll (IDataItemObserver * client); + virtual void subscribe(const list& l, IDataItemObserver* client); + virtual void updateSubscription(const list& l, IDataItemObserver* client); + virtual void requestData(const list& l, IDataItemObserver* client); + virtual void unsubscribe(const list& l, IDataItemObserver* client); + virtual void unsubscribeAll(IDataItemObserver* client); + + // IDataItemObserver Overrides + virtual void notify(const list& dlist); + inline virtual void getName(string& name) { + name = mAddress; + } // IFrameworkActionReq Overrides - virtual void turnOn (DataItemId dit, int timeOut = 0); - virtual void turnOff (DataItemId dit); + virtual void turnOn(DataItemId dit, int timeOut = 0); + virtual void turnOff(DataItemId dit); private: + SystemContext mContext; + const string mAddress; + IClientIndex* mClientIndex; + IDataItemIndex* mDataItemIndex; + map mDataItemCache; + map mActiveRequestCount; - SystemContext mContext; - const string mAddress; - IClientIndex *mClientIndex; - IDataItemIndex *mDataItemIndex; - map < DataItemId, IDataItemCore * > mDataItemCache; - map < DataItemId, int > mActiveRequestCount; - - // Nested types - // Messages - struct HandleMsgBase : public LocMsg { - HandleMsgBase (SystemStatusOsObserver * parent); - virtual ~HandleMsgBase (); - // Data members - SystemStatusOsObserver * mParent; - }; + // Cache the subscribe and requestData till subscription obj is obtained + ObserverReqCache mSubscribeReqCache; + ObserverReqCache mReqDataCache; + void cacheObserverRequest(ObserverReqCache& reqCache, + const list& l, IDataItemObserver* client); // Helpers - int sendFirstResponse - ( - const list & l, - IDataItemObserver * to - ); - - int sendCachedDataItems - ( - const list & l, - IDataItemObserver * to - ); - - int updateCache (IDataItemCore * d, bool &dataItemUpdated); - void logMe (const list & l); - - // Messages - struct HandleClientMsg : public LocMsg { - HandleClientMsg (SystemStatusOsObserver * parent, IDataItemObserver * client); - virtual ~HandleClientMsg (); - // Data Members - SystemStatusOsObserver * mParent; - IDataItemObserver * mClient; - }; - - struct HandleSubscribeReq : public HandleClientMsg { - HandleSubscribeReq (SystemStatusOsObserver * parent, - const list & l, - IDataItemObserver * client); - virtual ~HandleSubscribeReq (); - void proc () const; - // Data members - const list mDataItemList; - }; - - struct HandleUpdateSubscriptionReq : public HandleClientMsg { - HandleUpdateSubscriptionReq (SystemStatusOsObserver * parent, - const list & l, - IDataItemObserver * client); - virtual ~HandleUpdateSubscriptionReq (); - void proc () const; - // Data members - const list mDataItemList; - }; - - struct HandleRequestData : public HandleClientMsg { - HandleRequestData (SystemStatusOsObserver * parent, - const list & l, - IDataItemObserver * client); - virtual ~HandleRequestData (); - void proc () const; - const list mDataItemList; - }; - - struct HandleUnsubscribeReq : public HandleClientMsg { - HandleUnsubscribeReq (SystemStatusOsObserver * parent, - const list & l, - IDataItemObserver * client); - virtual ~HandleUnsubscribeReq (); - void proc () const; - // Data members - const list mDataItemList; - }; - - struct HandleUnsubscribeAllReq : public HandleClientMsg { - HandleUnsubscribeAllReq - ( - SystemStatusOsObserver * parent, - IDataItemObserver * client - ); - virtual ~HandleUnsubscribeAllReq (); - void proc () const; - }; - - struct HandleNotify : public HandleMsgBase { - HandleNotify (SystemStatusOsObserver * parent, list dlist); - virtual ~HandleNotify (); - void getListOfClients - ( - const list & dlist, - list & clients - ) const; - void proc () const; - // Data members - list mDList; - }; - - struct HandleTurnOn : public HandleMsgBase { - HandleTurnOn (SystemStatusOsObserver * parent, - const DataItemId dit, - const int timeOut); - virtual ~HandleTurnOn (); - void proc () const; - // Data members - DataItemId mDataItemId; - int mTimeOut; - }; - - struct HandleTurnOff : public HandleMsgBase { - HandleTurnOff (SystemStatusOsObserver * parent,const DataItemId dit); - virtual ~HandleTurnOff (); - void proc () const; - // Data members - DataItemId mDataItemId; - }; - -}; - - -/****************************************************************************** - Messages -******************************************************************************/ -// Ctors -inline SystemStatusOsObserver :: HandleMsgBase :: HandleMsgBase (SystemStatusOsObserver * parent) -: -mParent (parent) -{} - -inline SystemStatusOsObserver :: HandleClientMsg :: HandleClientMsg -( - SystemStatusOsObserver * parent, - IDataItemObserver * client -) -: -mParent (parent), -mClient (client) -{} - -inline SystemStatusOsObserver :: HandleSubscribeReq :: HandleSubscribeReq - (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) -: -HandleClientMsg (parent, client), mDataItemList (l) -{} - -inline SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: HandleUpdateSubscriptionReq - (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) -: -HandleClientMsg (parent, client), mDataItemList (l) -{} - -inline SystemStatusOsObserver :: HandleRequestData :: HandleRequestData - (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) -: -HandleClientMsg (parent, client), mDataItemList (l) -{} - -inline SystemStatusOsObserver :: HandleUnsubscribeReq :: HandleUnsubscribeReq - (SystemStatusOsObserver * parent, const list & l, IDataItemObserver * client) -: -HandleClientMsg (parent, client), mDataItemList (l) -{} - -inline SystemStatusOsObserver :: HandleUnsubscribeAllReq :: HandleUnsubscribeAllReq - (SystemStatusOsObserver * parent, IDataItemObserver * client) -: -HandleClientMsg (parent, client) -{} - -inline SystemStatusOsObserver :: HandleNotify :: HandleNotify - (SystemStatusOsObserver * parent, list dlist) -: -HandleMsgBase (parent), mDList (dlist) -{} - -inline SystemStatusOsObserver :: HandleTurnOn :: HandleTurnOn - (SystemStatusOsObserver * parent, const DataItemId dit,const int timeOut) -: -HandleMsgBase (parent), mDataItemId (dit), mTimeOut (timeOut) -{} - -inline SystemStatusOsObserver :: HandleTurnOff :: HandleTurnOff - (SystemStatusOsObserver * parent, const DataItemId dit) -: -HandleMsgBase (parent), mDataItemId (dit) -{} - -// Dtors -inline SystemStatusOsObserver :: HandleMsgBase :: ~HandleMsgBase () {} -inline SystemStatusOsObserver :: HandleClientMsg :: ~HandleClientMsg () {} -inline SystemStatusOsObserver :: HandleSubscribeReq :: ~HandleSubscribeReq () {} -inline SystemStatusOsObserver :: HandleUpdateSubscriptionReq :: ~HandleUpdateSubscriptionReq() {} -inline SystemStatusOsObserver :: HandleRequestData :: ~HandleRequestData() {} -inline SystemStatusOsObserver :: HandleUnsubscribeReq :: ~HandleUnsubscribeReq () {} -inline SystemStatusOsObserver :: HandleUnsubscribeAllReq :: ~HandleUnsubscribeAllReq () {} - -inline SystemStatusOsObserver :: HandleNotify :: ~HandleNotify () { - list :: iterator it = mDList.begin (); - for (; it != mDList.end (); ++it) { - delete *it; - *it = NULL; + void sendFirstResponse(const list& l, IDataItemObserver* to); + void sendCachedDataItems(const list& l, IDataItemObserver* to); + void updateCache(IDataItemCore* d, bool& dataItemUpdated); + inline void logMe(const list& l) { + for (auto id : l) { + LOC_LOGD("DataItem %d", id); + } } -} - -inline SystemStatusOsObserver :: HandleTurnOn :: ~HandleTurnOn () {} -inline SystemStatusOsObserver :: HandleTurnOff :: ~HandleTurnOff () {} - +}; } // namespace loc_core diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d4ffcb25..809e27d9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -67,7 +67,8 @@ GnssAdapter::GnssAdapter() : mAgpsManager(), mAgpsCbInfo(), mSystemStatus(SystemStatus::getInstance(mMsgTask)), - mServerUrl("") + mServerUrl(""), + mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3cb2c64b..fb50f285 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -106,11 +106,11 @@ class GnssAdapter : public LocAdapterBase { // This must be initialized via initAgps() AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; - XtraSystemStatusObserver mXtraObserver; /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; std::string mServerUrl; + XtraSystemStatusObserver mXtraObserver; /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); @@ -280,10 +280,6 @@ public: void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); - inline void updateConnectionStatusCommand(bool connected, uint8_t type) { - mXtraObserver.updateConnectionStatus(connected, type); - } - }; #endif //GNSS_ADAPTER_H diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 58a8522d..ce08f648 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -45,40 +45,55 @@ #include #include #include +#include +#include -using namespace std; using namespace loc_core; #define XTRA_HAL_SOCKET_NAME "/data/vendor/location/xtra/socket_hal_xtra" bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { - std::stringstream ss; + stringstream ss; ss << "gpslock"; ss << " " << lock; ss << "\n"; // append seperator return ( sendEvent(ss) ); } -bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, uint8_t type) { - std::stringstream ss; +bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, uint32_t type) { + stringstream ss; ss << "connection"; ss << " " << (connected ? "1" : "0"); ss << " " << (int)type; ss << "\n"; // append seperator return ( sendEvent(ss) ); } +bool XtraSystemStatusObserver::updateTac(const string& tac) { + stringstream ss; + ss << "tac"; + ss << " " << tac.c_str(); + ss << "\n"; // append seperator + return ( sendEvent(ss) ); +} -bool XtraSystemStatusObserver::sendEvent(std::stringstream& event) { +bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { + stringstream ss; + ss << "mncmcc"; + ss << " " << mccmnc.c_str(); + ss << "\n"; // append seperator + return ( sendEvent(ss) ); +} + +bool XtraSystemStatusObserver::sendEvent(const stringstream& event) { int socketFd = createSocket(); if (socketFd < 0) { LOC_LOGe("XTRA unreachable. sending failed."); return false; } - const std::string& data = event.str(); + const string& data = event.str(); int remain = data.length(); ssize_t sent = 0; - while (remain > 0 && (sent = ::send(socketFd, data.c_str() + (data.length() - remain), remain, MSG_NOSIGNAL)) > 0) { @@ -125,3 +140,95 @@ void XtraSystemStatusObserver::closeSocket(const int socketFd) { } } } + +void XtraSystemStatusObserver::subscribe(bool yes) +{ + // Subscription data list + list subItemIdList; + subItemIdList.push_back(NETWORKINFO_DATA_ITEM_ID); + subItemIdList.push_back(MCCMNC_DATA_ITEM_ID); + + if (yes) { + mSystemStatusObsrvr->subscribe(subItemIdList, this); + + list reqItemIdList; + reqItemIdList.push_back(TAC_DATA_ITEM_ID); + + mSystemStatusObsrvr->requestData(reqItemIdList, this); + + } else { + mSystemStatusObsrvr->unsubscribe(subItemIdList, this); + } +} + +// IDataItemObserver overrides +void XtraSystemStatusObserver::getName(string& name) +{ + name = "XtraSystemStatusObserver"; +} + +void XtraSystemStatusObserver::notify(const list& dlist) +{ + struct handleOsObserverUpdateMsg : public LocMsg { + XtraSystemStatusObserver* mXtraSysStatObj; + list mDataItemList; + + inline handleOsObserverUpdateMsg(XtraSystemStatusObserver* xtraSysStatObs, + const list& dataItemList) : + mXtraSysStatObj(xtraSysStatObs) { + for (auto eachItem : dataItemList) { + IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem( + eachItem->getId()); + if (NULL == dataitem) { + break; + } + // Copy the contents of the data item + dataitem->copy(eachItem); + + mDataItemList.push_back(dataitem); + } + } + + inline ~handleOsObserverUpdateMsg() { + for (auto each : mDataItemList) { + delete each; + } + } + + inline void proc() const { + for (auto each : mDataItemList) { + switch (each->getId()) + { + case NETWORKINFO_DATA_ITEM_ID: + { + SystemStatusNetworkInfo* networkInfo = + reinterpret_cast(each); + mXtraSysStatObj->updateConnectionStatus(networkInfo->mConnected, + networkInfo->mType); + } + break; + + case TAC_DATA_ITEM_ID: + { + SystemStatusTac* tac = reinterpret_cast(each); + mXtraSysStatObj->updateTac(tac->mValue); + } + break; + + case MCCMNC_DATA_ITEM_ID: + { + SystemStatusMccMnc* mccmnc = reinterpret_cast(each); + mXtraSysStatObj->updateMccMnc(mccmnc->mValue); + } + break; + + default: + break; + } + } + } + }; + mMsgTask->sendMsg(new (nothrow) handleOsObserverUpdateMsg(this, dlist)); +} + + diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index e49f17b7..42f49b53 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -29,25 +29,42 @@ #ifndef XTRA_SYSTEM_STATUS_OBS_H #define XTRA_SYSTEM_STATUS_OBS_H -#include +#include +#include + +using namespace std; +using loc_core::IOsObserver; +using loc_core::IDataItemObserver; +using loc_core::IDataItemCore; -class XtraSystemStatusObserver { +class XtraSystemStatusObserver : public IDataItemObserver { public : // constructor & destructor - XtraSystemStatusObserver() { + inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): + mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask) { + subscribe(true); } + inline XtraSystemStatusObserver() {}; + inline virtual ~XtraSystemStatusObserver() { subscribe(false); } - virtual ~XtraSystemStatusObserver() { - } + // IDataItemObserver overrides + inline virtual void getName(string& name); + virtual void notify(const list& dlist); bool updateLockStatus(uint32_t lock); - bool updateConnectionStatus(bool connected, uint8_t type); + bool updateConnectionStatus(bool connected, uint32_t type); + bool updateTac(const string& tac); + bool updateMccMnc(const string& mccmnc); + inline const MsgTask* getMsgTask() { return mMsgTask; } + void subscribe(bool yes); private: int createSocket(); void closeSocket(const int32_t socketFd); - bool sendEvent(std::stringstream& event); + bool sendEvent(const stringstream& event); + IOsObserver* mSystemStatusObsrvr; + const MsgTask* mMsgTask; }; diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index a99d8efb..19399dea 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -253,6 +253,6 @@ static void getDebugReport(GnssDebugReport& report) { static void updateConnectionStatus(bool connected, uint8_t type) { if (NULL != gGnssAdapter) { - gGnssAdapter->updateConnectionStatusCommand(connected, type); + gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); } } \ No newline at end of file From f0d7fe810f46662ae3d876b7b47540c24211be2b Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 4 Sep 2017 11:55:13 +0530 Subject: [PATCH 564/945] Xtra client interfacing with LocNetIface in LE Interfacing LocnetIface with Xtra client for wwan/supl call setup and teardown. - XtraSystemStatusObserver must listen to connect/teardown wwan call requests from xtra-daemon on the HAL side socket. This request is then processed by libloc_net_iface module on LE. - Caching the connect and disconnect backhaul requests received before framework action request object is obtained. Change-Id: I7cb6751efc64b27726b5d28be9a3df7b1bfb3d76 CRs-Fixed: 2092215 --- core/Makefile.am | 1 + core/SystemStatusOsObserver.cpp | 62 ++++++++++++++ core/SystemStatusOsObserver.h | 14 ++++ core/observer/IFrameworkActionReq.h | 18 ++++ core/observer/IOsObserver.h | 4 + gnss/XtraSystemStatusObserver.cpp | 124 ++++++++++++++++++++++++++++ gnss/XtraSystemStatusObserver.h | 67 +++++++++++++++ 7 files changed, 290 insertions(+) diff --git a/core/Makefile.am b/core/Makefile.am index 42586686..92aaded0 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = -I./ \ -I../utils \ + -I../gnss \ -I../location \ -I./data-items \ -I./data-items/common \ diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 319f1d7a..dc08a76e 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -41,6 +41,9 @@ namespace loc_core { SystemStatusOsObserver::SystemStatusOsObserver(const MsgTask* msgTask) : mAddress("SystemStatusOsObserver"), +#ifdef USE_GLIB + mBackHaulConnectReqCount(0), +#endif mClientIndex(IndexFactory :: createClientIndex()), mDataItemIndex(IndexFactory :: createDataItemIndex()) { @@ -506,6 +509,65 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } } +#ifdef USE_GLIB +bool SystemStatusOsObserver::connectBackhaul() +{ + bool result = false; + + if (mContext.mFrameworkActionReqObj != NULL) { + struct HandleConnectBackhaul : public LocMsg { + HandleConnectBackhaul(IFrameworkActionReq* fwkActReq) : + mFwkActionReqObj(fwkActReq) {} + virtual ~HandleConnectBackhaul() {} + void proc() const { + LOC_LOGD("HandleConnectBackhaul"); + mFwkActionReqObj->connectBackhaul(); + } + IFrameworkActionReq* mFwkActionReqObj; + }; + mContext.mMsgTask->sendMsg( + new (nothrow) HandleConnectBackhaul(mContext.mFrameworkActionReqObj)); + result = true; + } + else { + ++mBackHaulConnectReqCount; + LOC_LOGE("Framework action request object is NULL.Caching connect request: %d", + mBackHaulConnectReqCount); + result = false; + } + return result; + +} + +bool SystemStatusOsObserver::disconnectBackhaul() +{ + bool result = false; + + if (mContext.mFrameworkActionReqObj != NULL) { + struct HandleDisconnectBackhaul : public LocMsg { + HandleDisconnectBackhaul(IFrameworkActionReq* fwkActReq) : + mFwkActionReqObj(fwkActReq) {} + virtual ~HandleDisconnectBackhaul() {} + void proc() const { + LOC_LOGD("HandleDisconnectBackhaul"); + mFwkActionReqObj->disconnectBackhaul(); + } + IFrameworkActionReq* mFwkActionReqObj; + }; + mContext.mMsgTask->sendMsg( + new (nothrow) HandleDisconnectBackhaul(mContext.mFrameworkActionReqObj)); + } + else { + if (mBackHaulConnectReqCount > 0) { + --mBackHaulConnectReqCount; + } + LOC_LOGE("Framework action request object is NULL.Caching disconnect request: %d", + mBackHaulConnectReqCount); + result = false; + } + return result; +} +#endif /****************************************************************************** Helpers ******************************************************************************/ diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 985e5c99..6892f226 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -85,6 +85,12 @@ public: // To set the framework action request object inline void setFrameworkActionReqObj(IFrameworkActionReq* frameworkActionReqObj) { mContext.mFrameworkActionReqObj = frameworkActionReqObj; +#ifdef USE_GLIB + if (mBackHaulConnectReqCount > 0) { + connectBackhaul(); + mBackHaulConnectReqCount = 0; + } +#endif } // IDataItemSubscription Overrides @@ -103,6 +109,10 @@ public: // IFrameworkActionReq Overrides virtual void turnOn(DataItemId dit, int timeOut = 0); virtual void turnOff(DataItemId dit); +#ifdef USE_GLIB + virtual bool connectBackhaul(); + virtual bool disconnectBackhaul(); +#endif private: SystemContext mContext; @@ -117,6 +127,10 @@ private: ObserverReqCache mReqDataCache; void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); +#ifdef USE_GLIB + // Cache the framework action request for connect/disconnect + int mBackHaulConnectReqCount; +#endif // Helpers void sendFirstResponse(const list& l, IDataItemObserver* to); diff --git a/core/observer/IFrameworkActionReq.h b/core/observer/IFrameworkActionReq.h index c7b3ebdc..4be947ff 100644 --- a/core/observer/IFrameworkActionReq.h +++ b/core/observer/IFrameworkActionReq.h @@ -70,6 +70,24 @@ public: */ virtual void turnOff (DataItemId dit) = 0; +#ifdef USE_GLIB + /** + * @brief Setup WWAN backhaul + * @details Setup WWAN backhaul + * + * @param None + */ + virtual bool connectBackhaul() = 0; + + /** + * @brief Disconnects the WWANbackhaul + * @details Disconnects the WWANbackhaul, only if it was setup by us + * + * @param None + */ + virtual bool disconnectBackhaul() = 0; +#endif + /** * @brief Destructor * @details Destructor diff --git a/core/observer/IOsObserver.h b/core/observer/IOsObserver.h index 3db8a85e..40d76717 100644 --- a/core/observer/IOsObserver.h +++ b/core/observer/IOsObserver.h @@ -90,6 +90,10 @@ public: // IFrameworkActionReq Overrides inline virtual void turnOn (DataItemId /*dit*/, int /*timeOut*/){} inline virtual void turnOff (DataItemId /*dit*/) {} +#ifdef USE_GLIB + inline virtual bool connectBackhaul() {} + inline virtual bool disconnectBackhaul() {} +#endif /** * @brief Destructor diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index ce08f648..ac402207 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -231,4 +231,128 @@ void XtraSystemStatusObserver::notify(const list& dlist) mMsgTask->sendMsg(new (nothrow) handleOsObserverUpdateMsg(this, dlist)); } +#ifdef USE_GLIB +bool XtraSystemStatusObserver::connectBackhaul() +{ + return mSystemStatusObsrvr->connectBackhaul(); +} +bool XtraSystemStatusObserver::disconnectBackhaul() +{ + return mSystemStatusObsrvr->disconnectBackhaul(); +} + +// XtraHalListenerSocket class +// TBD - this will be removed once bidirectional socket changes in +// xtra-daemon will be implemented +void XtraHalListenerSocket::receiveData(const int socketFd) { + string data; + array buf; + const char* bin_msg_conn_backhaul = "connectBackhaul"; + const char* bin_msg_disconn_backhaul = "disconnectBackhaul"; + + while (true) { + ssize_t len = recv(socketFd, buf.data(), buf.size(), 0); + if (len > 0) { + LOC_LOGd("received %lu bytes", len); + data.append(buf.data(), len); + + size_t pos = data.find("\n"); + if (pos == string::npos) { + continue; + } + + if (!strncmp(data.c_str(), bin_msg_conn_backhaul, + sizeof(bin_msg_conn_backhaul) - 1)) { + mSystemStatusObsrvr->connectBackhaul(); + } else if (!strncmp(data.c_str(), bin_msg_disconn_backhaul, + sizeof(bin_msg_disconn_backhaul) - 1)) { + mSystemStatusObsrvr->disconnectBackhaul(); + } + else { + LOC_LOGw("unknown event: %s", data.c_str()); + } + break; + + } else { + LOC_LOGd("XtraHalListenerSocket connection broken."); + break; + } + } +} + +void XtraHalListenerSocket::startListenerThread() { + mThread = new (std::nothrow) LocThread(); + if (!mThread) { + LOC_LOGe("create thread failed"); + } + mRunning = true; + if (!mThread->start("XtraHalListenerSocketThread", this, true)) { + delete mThread; + mThread = NULL; + } + + LOC_LOGd("Create listener socket in XtraHalListenerSocket"); + // create socket + int socketFd; + if ((socketFd = ::socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + LOC_LOGe("create socket error. reason:%s", strerror(errno)); + return; + } + + const char* socketPath = "/data/vendor/location/xtra/socket_xtra_locnetiface"; + unlink(socketPath); + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); + + umask(0157); + + if (::bind(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("bind socket error. reason:%s", strerror(errno)); + return; + } + + // set up connection + if (::listen(socketFd, 5/*backlog*/) < 0) { + LOC_LOGe("cannot bind socket. reason:%s", strerror(errno)); + return; + } + mSocketFd = socketFd; + +} + +bool XtraHalListenerSocket::run() { + // infinite while loop till mRunning is false when stopListenXtraDaemon + // is called + while (mRunning) { + int clientFd = -1; + LOC_LOGd("XtraHalListenerSocket - waiting for msg..."); + if ( (clientFd = ::accept(mSocketFd, NULL, NULL)) < 0) { + LOC_LOGe("connection error. reason:%s", strerror(errno)); + } else { + LOC_LOGd("XtraHalListenerSocket - receiving data ..."); + receiveData(clientFd); + if (::close(clientFd)) { + LOC_LOGe("close connection fail."); + } + clientFd = -1; + } + } + + // return false once we reach there + return false; +} + +void XtraHalListenerSocket::stopListenXtraDaemon() { + if (mSocketFd >= 0) { + if (::close(mSocketFd)) { + LOC_LOGe("close hal connection fail."); + } + mSocketFd = -1; + } + mRunning = false; + mThread->stop(); +} + +#endif diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 42f49b53..6a001d9f 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -31,17 +31,72 @@ #include #include +#ifdef USE_GLIB +#include +#endif using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; +#ifdef USE_GLIB +// XtraHalListenerSocket class +// listener socket for getting msgs from xtra-daemon in LE for invoking +// LocNetIface functions +// TBD - this will be removed once bidirectional socket changes in +// xtra-daemon will be implemented +class XtraHalListenerSocket: public LocRunnable { +public : + // constructor & destructor + XtraHalListenerSocket(IOsObserver* sysStatObs) : + mThread(NULL), + mRunning(false) { + mSystemStatusObsrvr = sysStatObs; + mRunning = true; + // create listener socket in a thread + startListenerThread(); + } + XtraHalListenerSocket() {} + inline virtual ~XtraHalListenerSocket() { + if (mThread) { + stopListenXtraDaemon(); + delete mThread; + mThread = NULL; + } + } + + // 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() + inline virtual void prerun() {} + + // The method to be run after thread loop (conditionally repeatedly) + // calls run() + inline virtual void postrun() {} + +private: + IOsObserver* mSystemStatusObsrvr; + int mSocketFd; + LocThread* mThread; + bool mRunning; + void startListenerThread(); + void stopListenXtraDaemon(); + void receiveData(const int socketFd); +}; +#endif class XtraSystemStatusObserver : public IDataItemObserver { public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): +#ifdef USE_GLIB + mHalListenerSocket(sysStatObs), +#endif mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask) { subscribe(true); } @@ -52,6 +107,12 @@ public : inline virtual void getName(string& name); virtual void notify(const list& dlist); +#ifdef USE_GLIB + // IFrameworkActionReq functions reqd + virtual bool connectBackhaul(); + virtual bool disconnectBackhaul(); +#endif + bool updateLockStatus(uint32_t lock); bool updateConnectionStatus(bool connected, uint32_t type); bool updateTac(const string& tac); @@ -65,6 +126,12 @@ private: bool sendEvent(const stringstream& event); IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; +#ifdef USE_GLIB + // XtraHalListenerSocket class + // TBD - this will be removed once bidirectional socket changes in + // xtra-daemon will be implemented + XtraHalListenerSocket mHalListenerSocket; +#endif }; From 4d8fc57928cf6a5acfdcd666b4ee25a586cb2bc1 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 4 Aug 2017 11:20:16 -0700 Subject: [PATCH 565/945] Fix unable to clear existing event bitmasks Fix for an issue updateEvtMask call chain is unable to clear existing event bitmasks stored in LocApiV02. Change-Id: Id34e2d92a506e7300f3d9b3ec74a80a1f6822787 CRs-Fixed: 2085379 --- core/LocApiBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index e0845de2..070b2ae5 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -164,7 +164,7 @@ void LocApiBase::addAdapter(LocAdapterBase* adapter) if (mLocAdapters[i] == NULL) { mLocAdapters[i] = adapter; mMsgTask->sendMsg(new LocOpenMsg(this, - (adapter->getEvtMask()))); + mMask | adapter->getEvtMask())); break; } } From 40284224df2adc2bcf9ac4a96031352038daa82d Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 5 Sep 2017 17:52:32 +0530 Subject: [PATCH 566/945] Transition of base DataConcreteType class to HAL Transition of base DataConcreteType class to HAL, so that modules in HAL can access the members of DataItem class. Change-Id: Ib3b60992cf35a52b601117d5d18761d759f31b86 CRs-Fixed: 2104384 --- core/Makefile.am | 1 + core/SystemStatus.cpp | 3 +- core/data-items/DataItemConcreteTypesBase.h | 446 ++++++++++++++++++++ gnss/XtraSystemStatusObserver.cpp | 11 +- 4 files changed, 456 insertions(+), 5 deletions(-) create mode 100644 core/data-items/DataItemConcreteTypesBase.h diff --git a/core/Makefile.am b/core/Makefile.am index 92aaded0..81ef2ee7 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -23,6 +23,7 @@ libloc_core_la_h_sources = \ LocAdapterProxyBase.h \ data-items/DataItemId.h \ data-items/IDataItemCore.h \ + data-items/DataItemConcreteTypesBase.h \ observer/IDataItemObserver.h \ observer/IDataItemSubscription.h \ observer/IFrameworkActionReq.h \ diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 52d28c7a..c83a7d00 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -40,6 +40,7 @@ #include #include #include +#include namespace loc_core { @@ -1420,7 +1421,7 @@ bool SystemStatus::setPositionFailure(const SystemStatusPQWS1& nmea) ******************************************************************************/ bool SystemStatus::setNetworkInfo(IDataItemCore* dataitem) { - SystemStatusNetworkInfo* data = reinterpret_cast(dataitem); + NetworkInfoDataItemBase* data = reinterpret_cast(dataitem); SystemStatusNetworkInfo s(data->mType,data->mTypeName,data->mSubTypeName, data->mAvailable,data->mConnected,data->mRoaming); s.dump(); diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h new file mode 100644 index 00000000..74722d06 --- /dev/null +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -0,0 +1,446 @@ +/* Copyright (c) 2015-2017, 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 __DATAITEMCONCRETEBASETYPES__ +#define __DATAITEMCONCRETEBASETYPES__ + +#include +#include +#include +#include + +#define MAC_ADDRESS_LENGTH 6 +// MAC address length in bytes +// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02 +#define SRN_MAC_ADDRESS_LENGTH 6 +#define WIFI_SUPPLICANT_DEFAULT_STATE 0 + +namespace loc_core +{ +using namespace std; + +class AirplaneModeDataItemBase : public IDataItemCore { +public: + AirplaneModeDataItemBase(bool mode): + mMode(mode), + mId(AIRPLANEMODE_DATA_ITEM_ID) {} + virtual ~AirplaneModeDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mMode; + +protected: + DataItemId mId; +}; + +class ENHDataItemBase : public IDataItemCore { +public: + ENHDataItemBase(bool enabled) : + mEnabled(enabled), + mId(ENH_DATA_ITEM_ID) {} + virtual ~ENHDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mEnabled; +protected: + DataItemId mId; +}; + +class GPSStateDataItemBase : public IDataItemCore { +public: + GPSStateDataItemBase(bool enabled) : + mEnabled(enabled), + mId(GPSSTATE_DATA_ITEM_ID) {} + virtual ~GPSStateDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mEnabled; +protected: + DataItemId mId; +}; + +class NLPStatusDataItemBase : public IDataItemCore { +public: + NLPStatusDataItemBase(bool enabled) : + mEnabled(enabled), + mId(NLPSTATUS_DATA_ITEM_ID) {} + virtual ~NLPStatusDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mEnabled; +protected: + DataItemId mId; +}; + +class WifiHardwareStateDataItemBase : public IDataItemCore { +public: + WifiHardwareStateDataItemBase(bool enabled) : + mEnabled(enabled), + mId(WIFIHARDWARESTATE_DATA_ITEM_ID) {} + virtual ~WifiHardwareStateDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mEnabled; +protected: + DataItemId mId; +}; + +class ScreenStateDataItemBase : public IDataItemCore { +public: + ScreenStateDataItemBase(bool state) : + mState(state), + mId(SCREEN_STATE_DATA_ITEM_ID) {} + virtual ~ScreenStateDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mState; +protected: + DataItemId mId; +}; + +class PowerConnectStateDataItemBase : public IDataItemCore { +public: + PowerConnectStateDataItemBase(bool state) : + mState(state), + mId(POWER_CONNECTED_STATE_DATA_ITEM_ID) {} + virtual ~PowerConnectStateDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mState; +protected: + DataItemId mId; +}; + +class TimeZoneChangeDataItemBase : public IDataItemCore { +public: + TimeZoneChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) : + mCurrTimeMillis (currTimeMillis), + mRawOffsetTZ (rawOffset), + mDstOffsetTZ (dstOffset), + mId(TIMEZONE_CHANGE_DATA_ITEM_ID) {} + virtual ~TimeZoneChangeDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + int64_t mCurrTimeMillis; + int32_t mRawOffsetTZ; + int32_t mDstOffsetTZ; +protected: + DataItemId mId; +}; + +class TimeChangeDataItemBase : public IDataItemCore { +public: + TimeChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) : + mCurrTimeMillis (currTimeMillis), + mRawOffsetTZ (rawOffset), + mDstOffsetTZ (dstOffset), + mId(TIME_CHANGE_DATA_ITEM_ID) {} + virtual ~TimeChangeDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + int64_t mCurrTimeMillis; + int32_t mRawOffsetTZ; + int32_t mDstOffsetTZ; +protected: + DataItemId mId; +}; + +class ShutdownStateDataItemBase : public IDataItemCore { +public: + ShutdownStateDataItemBase(bool state) : + mState (state), + mId(SHUTDOWN_STATE_DATA_ITEM_ID) {} + virtual ~ShutdownStateDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mState; +protected: + DataItemId mId; +}; + +class AssistedGpsDataItemBase : public IDataItemCore { +public: + AssistedGpsDataItemBase(bool enabled) : + mEnabled(enabled), + mId(ASSISTED_GPS_DATA_ITEM_ID) {} + virtual ~AssistedGpsDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + bool mEnabled; +protected: + DataItemId mId; +}; + +class NetworkInfoDataItemBase : public IDataItemCore { +public: + NetworkInfoDataItemBase( + int32_t type, string typeName, string subTypeName, + bool available, bool connected, bool roaming ): + mType(type), + mTypeName(typeName), + mSubTypeName(subTypeName), + mAvailable(available), + mConnected(connected), + mRoaming(roaming), + mId(NETWORKINFO_DATA_ITEM_ID) {} + virtual ~NetworkInfoDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + int32_t mType; + string mTypeName; + string mSubTypeName; + bool mAvailable; + bool mConnected; + bool mRoaming; +protected: + DataItemId mId; + +}; + +class ServiceStatusDataItemBase : public IDataItemCore { +public: + ServiceStatusDataItemBase(int32_t serviceState) : + mServiceState (serviceState), + mId(SERVICESTATUS_DATA_ITEM_ID) {} + virtual ~ServiceStatusDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + int32_t mServiceState; +protected: + DataItemId mId; +}; + +class ModelDataItemBase : public IDataItemCore { +public: + ModelDataItemBase(const string & name) : + mModel (name), + mId(MODEL_DATA_ITEM_ID) {} + virtual ~ModelDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + string mModel; +protected: + DataItemId mId; +}; + +class ManufacturerDataItemBase : public IDataItemCore { +public: + ManufacturerDataItemBase(const string & name) : + mManufacturer (name), + mId(MANUFACTURER_DATA_ITEM_ID) {} + virtual ~ManufacturerDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + string mManufacturer; +protected: + DataItemId mId; +}; + +class RilServiceInfoDataItemBase : public IDataItemCore { +public: + RilServiceInfoDataItemBase() : + mId(RILSERVICEINFO_DATA_ITEM_ID) {} + virtual ~RilServiceInfoDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +protected: + DataItemId mId; +}; + +class RilCellInfoDataItemBase : public IDataItemCore { +public: + RilCellInfoDataItemBase() : + mId(RILCELLINFO_DATA_ITEM_ID) {} + virtual ~RilCellInfoDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +protected: + DataItemId mId; +}; + +class WifiSupplicantStatusDataItemBase : public IDataItemCore { +public: + WifiSupplicantStatusDataItemBase() : + mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE), + mApMacAddressValid(false), + mWifiApSsidValid(false), + mId(WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID) { + memset (&mApMacAddress, 0, sizeof (mApMacAddress)); + mWifiApSsid.clear(); + } + virtual ~WifiSupplicantStatusDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + // Data members + typedef enum WifiSupplicantState { + DISCONNECTED, + INTERFACE_DISABLED, + INACTIVE, + SCANNING, + AUTHENTICATING, + ASSOCIATING, + ASSOCIATED, + FOUR_WAY_HANDSHAKE, + GROUP_HANDSHAKE, + COMPLETED, + DORMANT, + UNINITIALIZED, + INVALID + } WifiSupplicantState; + /* Represents whether access point attach state*/ + WifiSupplicantState mState; + /* Represents info on whether ap mac address is valid */ + bool mApMacAddressValid; + /* Represents mac address of the wifi access point*/ + uint8_t mApMacAddress[MAC_ADDRESS_LENGTH]; + /* Represents info on whether ap SSID is valid */ + bool mWifiApSsidValid; + /* Represents Wifi SSID string*/ + string mWifiApSsid; +protected: + DataItemId mId; +}; + +class TacDataItemBase : public IDataItemCore { +public: + TacDataItemBase(const string & name) : + mValue (name), + mId(TAC_DATA_ITEM_ID) {} + virtual ~TacDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + string mValue; +protected: + DataItemId mId; +}; + +class MccmncDataItemBase : public IDataItemCore { +public: + MccmncDataItemBase(const string & name) : + mValue (name), + mId(MCCMNC_DATA_ITEM_ID) {} + virtual ~MccmncDataItemBase() {} + inline virtual DataItemId getId() { return mId; } + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +// Data members + string mValue; +protected: + DataItemId mId; +}; + +class SrnDeviceScanDetailsDataItemBase : public IDataItemCore { +public: + SrnDeviceScanDetailsDataItemBase (DataItemId Id) : + mValidSrnData(false), + mApSrnRssi(-1), + mApSrnTimestamp(0), + mRequestTimestamp(0), + mReceiveTimestamp(0), + mErrorCause(-1), + mId(Id) {} + virtual ~SrnDeviceScanDetailsDataItemBase () {} + inline virtual DataItemId getId() { return mId; } + // Data members common to all SRN tech types + /* Represents info on whether SRN data is valid (no error)*/ + bool mValidSrnData; + /* SRN device RSSI reported */ + int32_t mApSrnRssi; + /* MAC adress of SRN device */ + uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH]; + /* UTC timestamp at which the scan was requested.for this SRN device*/ + int64_t mApSrnTimestamp; + /* UTC timestamp at which the scan was started. */ + int64_t mRequestTimestamp; + /* UTC timestamp at which the scan was received.*/ + int64_t mReceiveTimestamp; + /* Reason for the error/failure if SRN details are not valid */ + int32_t mErrorCause; +protected: + DataItemId mId; +}; + +class BtDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase { + +public: + BtDeviceScanDetailsDataItemBase() : + SrnDeviceScanDetailsDataItemBase(BT_SCAN_DATA_ITEM_ID) {} + virtual ~BtDeviceScanDetailsDataItemBase() {} + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +}; + +class BtLeDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase { + +public: + BtLeDeviceScanDetailsDataItemBase() : + SrnDeviceScanDetailsDataItemBase(BTLE_SCAN_DATA_ITEM_ID) {} + virtual ~BtLeDeviceScanDetailsDataItemBase() {} + virtual void stringify(string& /*valueStr*/) {} + virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} +}; + +} // namespace loc_core + +#endif //__DATAITEMCONCRETEBASETYPES__ diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index ac402207..bbbc19ae 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -47,6 +47,7 @@ #include #include #include +#include using namespace loc_core; @@ -201,8 +202,8 @@ void XtraSystemStatusObserver::notify(const list& dlist) { case NETWORKINFO_DATA_ITEM_ID: { - SystemStatusNetworkInfo* networkInfo = - reinterpret_cast(each); + NetworkInfoDataItemBase* networkInfo = + static_cast(each); mXtraSysStatObj->updateConnectionStatus(networkInfo->mConnected, networkInfo->mType); } @@ -210,14 +211,16 @@ void XtraSystemStatusObserver::notify(const list& dlist) case TAC_DATA_ITEM_ID: { - SystemStatusTac* tac = reinterpret_cast(each); + TacDataItemBase* tac = + static_cast(each); mXtraSysStatObj->updateTac(tac->mValue); } break; case MCCMNC_DATA_ITEM_ID: { - SystemStatusMccMnc* mccmnc = reinterpret_cast(each); + MccmncDataItemBase* mccmnc = + static_cast(each); mXtraSysStatObj->updateMccMnc(mccmnc->mValue); } break; From f69296ba9eef3ba687887acf04c7c29eedbb342d Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 29 Aug 2017 17:49:40 +0800 Subject: [PATCH 567/945] Init default agps status callback in GnssAdapter Call LocNetIfaceAgps_getStatusCb implemented in libloc_net_iface.so, use the return function as default agps status callback. Change-Id: I4d966a888e312c2d0fb1a6c9e30752294876e500 CRs-Fixed: 2064002 --- android/AGnss.cpp | 58 ++++++++++++++++-- android/AGnss.h | 3 +- gnss/Agps.cpp | 72 +++------------------- gnss/Agps.h | 74 ++-------------------- gnss/GnssAdapter.cpp | 112 +++++++++++++++++++++++++++++++--- gnss/GnssAdapter.h | 8 ++- gnss/location_gnss.cpp | 4 +- location/location_interface.h | 6 +- utils/gps_extended_c.h | 54 ++++++++++++++-- utils/loc_gps.h | 2 +- 10 files changed, 231 insertions(+), 162 deletions(-) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index b5f76bbe..e76671c6 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -23,7 +23,6 @@ #include #include "Gnss.h" #include "AGnss.h" -#include namespace android { namespace hardware { @@ -36,9 +35,44 @@ sp AGnss::sAGnssCbIface = nullptr; AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { } -void AGnss::agnssStatusIpV4Cb(IAGnssCallback::AGnssStatusIpV4 status){ +void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ + IAGnssCallback::AGnssStatusIpV4 st = {}; - sAGnssCbIface->agnssStatusIpV4Cb(status); + switch (status.type) { + case LOC_AGPS_TYPE_SUPL: + st.type = IAGnssCallback::AGnssType::TYPE_SUPL; + break; + case LOC_AGPS_TYPE_C2K: + st.type = IAGnssCallback::AGnssType::TYPE_C2K; + break; + default: + LOC_LOGE("invalid type: %d", status.type); + return; + } + + switch (status.status) { + case LOC_GPS_REQUEST_AGPS_DATA_CONN: + st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN; + break; + case LOC_GPS_RELEASE_AGPS_DATA_CONN: + st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN; + break; + case LOC_GPS_AGPS_DATA_CONNECTED: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED; + break; + case LOC_GPS_AGPS_DATA_CONN_DONE: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE; + break; + case LOC_GPS_AGPS_DATA_CONN_FAILED: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED; + break; + default: + LOC_LOGE("invalid status: %d", status.status); + return; + } + st.ipV4Addr = status.ipV4Addr; + + sAGnssCbIface->agnssStatusIpV4Cb(st); } Return AGnss::setCallback(const sp& callback) { @@ -97,8 +131,24 @@ Return AGnss::dataConnOpen(const hidl_string& apn, LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str()); + AGpsBearerType bearerType; + switch (apnIpType) { + case IAGnss::ApnIpType::IPV4: + bearerType = AGPS_APN_BEARER_IPV4; + break; + case IAGnss::ApnIpType::IPV6: + bearerType = AGPS_APN_BEARER_IPV6; + break; + case IAGnss::ApnIpType::IPV4V6: + bearerType = AGPS_APN_BEARER_IPV4V6; + break; + default: + bearerType = AGPS_APN_BEARER_IPV4; + break; + } + mGnss->getGnssInterface()->agpsDataConnOpen( - LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)apnIpType); + LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType); return true; } diff --git a/android/AGnss.h b/android/AGnss.h index f4216b04..a3f4a87b 100644 --- a/android/AGnss.h +++ b/android/AGnss.h @@ -23,6 +23,7 @@ #include #include +#include namespace android { namespace hardware { @@ -60,7 +61,7 @@ struct AGnss : public IAGnss { const hidl_string& hostname, int32_t port) override; /* Data call setup callback passed down to GNSS HAL implementation */ - static void agnssStatusIpV4Cb(IAGnssCallback::AGnssStatusIpV4 status); + static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); private: Gnss* mGnss = nullptr; diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index ace639b9..6675aed7 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -295,19 +295,18 @@ void AgpsStateMachine::processAgpsEventDenied(){ * false = Release data connection */ int AgpsStateMachine::requestOrReleaseDataConn(bool request){ - AgpsFrameworkInterface::AGnssStatusIpV4 nifRequest; + AGnssExtStatusIpV4 nifRequest; memset(&nifRequest, 0, sizeof(nifRequest)); - nifRequest.type = (AgpsFrameworkInterface::AGnssType)mAgpsType; + nifRequest.type = mAgpsType; if (request) { LOC_LOGD("AGPS Data Conn Request"); - nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) - LOC_GPS_REQUEST_AGPS_DATA_CONN; - } else { + nifRequest.status = LOC_GPS_REQUEST_AGPS_DATA_CONN; + } + else{ LOC_LOGD("AGPS Data Conn Release"); - nifRequest.status = (AgpsFrameworkInterface::AGnssStatusValue) - LOC_GPS_RELEASE_AGPS_DATA_CONN; + nifRequest.status = LOC_GPS_RELEASE_AGPS_DATA_CONN; } mAgpsManager->mFrameworkStatusV4Cb(nifRequest); @@ -849,32 +848,15 @@ void AgpsManager::reportDataCallClosed(){ void AgpsManager::reportAtlOpenSuccess( AGpsExtType agpsType, char* apnName, int apnLen, - LocApnIpType ipType){ + AGpsBearerType bearerType){ LOC_LOGD("AgpsManager::reportAtlOpenSuccess(): " - "AgpsType %d, APN [%s], Len %d, IPType %d", - agpsType, apnName, apnLen, ipType); + "AgpsType %d, APN [%s], Len %d, BearerType %d", + agpsType, apnName, apnLen, bearerType); /* Find the state machine instance */ AgpsStateMachine* sm = getAgpsStateMachine(agpsType); - /* Convert LocApnIpType sent by framework to AGpsBearerType */ - AGpsBearerType bearerType; - switch (ipType) { - case LOC_APN_IP_IPV4: - bearerType = AGPS_APN_BEARER_IPV4; - break; - case LOC_APN_IP_IPV6: - bearerType = AGPS_APN_BEARER_IPV6; - break; - case LOC_APN_IP_IPV4V6: - bearerType = AGPS_APN_BEARER_IPV4V6; - break; - default: - bearerType = AGPS_APN_BEARER_IPV4; - break; - } - /* Set bearer and apn info in state machine instance */ sm->setBearer(bearerType); sm->setAPN(apnName, apnLen); @@ -927,39 +909,3 @@ void AgpsManager::handleModemSSR(){ mDSClientInitFn(true); } } - -AGpsBearerType AgpsUtils::ipTypeToBearerType(LocApnIpType ipType) { - - switch (ipType) { - - case LOC_APN_IP_IPV4: - return AGPS_APN_BEARER_IPV4; - - case LOC_APN_IP_IPV6: - return AGPS_APN_BEARER_IPV6; - - case LOC_APN_IP_IPV4V6: - return AGPS_APN_BEARER_IPV4V6; - - default: - return AGPS_APN_BEARER_IPV4; - } -} - -LocApnIpType AgpsUtils::bearerTypeToIpType(AGpsBearerType bearerType){ - - switch (bearerType) { - - case AGPS_APN_BEARER_IPV4: - return LOC_APN_IP_IPV4; - - case AGPS_APN_BEARER_IPV6: - return LOC_APN_IP_IPV6; - - case AGPS_APN_BEARER_IPV4V6: - return LOC_APN_IP_IPV4V6; - - default: - return LOC_APN_IP_IPV4; - } -} diff --git a/gnss/Agps.h b/gnss/Agps.h index d3fc3628..2f89c8c3 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -87,70 +87,6 @@ typedef enum { AGPS_NOTIFICATION_TYPE_FOR_ACTIVE_SUBSCRIBERS } AgpsNotificationType; -/* Framework AGNSS interface - * This interface is defined in IAGnssCallback provided by - * Android Framework. - * Must be kept in sync with that interface. */ -namespace AgpsFrameworkInterface { - - /** AGNSS type **/ - enum AGnssType : uint8_t { - TYPE_SUPL = 1, - TYPE_C2K = 2 - }; - - enum AGnssStatusValue : uint8_t { - /** GNSS requests data connection for AGNSS. */ - REQUEST_AGNSS_DATA_CONN = 1, - /** GNSS releases the AGNSS data connection. */ - RELEASE_AGNSS_DATA_CONN = 2, - /** AGNSS data connection initiated */ - AGNSS_DATA_CONNECTED = 3, - /** AGNSS data connection completed */ - AGNSS_DATA_CONN_DONE = 4, - /** AGNSS data connection failed */ - AGNSS_DATA_CONN_FAILED = 5 - }; - - /* - * Represents the status of AGNSS augmented to support IPv4. - */ - struct AGnssStatusIpV4 { - AGnssType type; - AGnssStatusValue status; - /* - * 32-bit IPv4 address. - */ - unsigned int ipV4Addr; - }; - - /* - * Represents the status of AGNSS augmented to support IPv6. - */ - struct AGnssStatusIpV6 { - AGnssType type; - AGnssStatusValue status; - /* - * 128-bit IPv6 address. - */ - unsigned char ipV6Addr[16]; - }; - - /* - * Callback with AGNSS(IpV4) status information. - * - * @param status Will be of type AGnssStatusIpV4. - */ - typedef void (*AgnssStatusIpV4Cb)(AGnssStatusIpV4 status); - - /* - * Callback with AGNSS(IpV6) status information. - * - * @param status Will be of type AGnssStatusIpV6. - */ - typedef void (*AgnssStatusIpV6Cb)(AGnssStatusIpV6 status); -} - /* Classes in this header */ class AgpsSubscriber; class AgpsManager; @@ -342,8 +278,7 @@ public: /* Register callbacks */ void registerCallbacks( - AgpsFrameworkInterface::AgnssStatusIpV4Cb - frameworkStatusV4Cb, + AgnssStatusIpV4Cb frameworkStatusV4Cb, AgpsAtlOpenStatusCb atlOpenStatusCb, AgpsAtlCloseStatusCb atlCloseStatusCb, @@ -382,9 +317,8 @@ public: void reportDataCallClosed(); /* Process incoming framework data call events */ - void reportAtlOpenSuccess( - AGpsExtType agpsType, char* apnName, int apnLen, - LocApnIpType ipType); + void reportAtlOpenSuccess(AGpsExtType agpsType, char* apnName, int apnLen, + AGpsBearerType bearerType); void reportAtlOpenFailed(AGpsExtType agpsType); void reportAtlClosed(AGpsExtType agpsType); @@ -392,7 +326,7 @@ public: void handleModemSSR(); protected: - AgpsFrameworkInterface::AgnssStatusIpV4Cb mFrameworkStatusV4Cb; + AgnssStatusIpV4Cb mFrameworkStatusV4Cb; AgpsAtlOpenStatusCb mAtlOpenStatusCb; AgpsAtlCloseStatusCb mAtlCloseStatusCb; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ee9f8410..88f57e8d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -50,6 +50,14 @@ using namespace loc_core; +/* Method to fetch status cb from loc_net_iface library */ +typedef AgpsCbInfo& (*LocAgpsGetAgpsCbInfo)(LocAgpsOpenResultCb openResultCb, + LocAgpsCloseResultCb closeResultCb, void* userDataPtr); + +static void agpsOpenResultCb (bool isSuccess, AGpsExtType agpsType, const char* apn, + AGpsBearerType bearerType, void* userDataPtr); +static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userDataPtr); + GnssAdapter::GnssAdapter() : LocAdapterBase(0, LocDualContext::getLocFgContext(NULL, @@ -74,6 +82,7 @@ GnssAdapter::GnssAdapter() : mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; readConfigCommand(); setConfigCommand(); + initDefaultAgpsCommand(); } void @@ -2391,6 +2400,57 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) mUlpProxy->reportSvPolynomial(svPolynomial); } +void GnssAdapter::initDefaultAgps() { + LOC_LOGD("%s]: ", __func__); + + LocationCapabilitiesMask mask = getCapabilities(); + if (!(mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) && + !(mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)) { + LOC_LOGI("%s]: Target does not support MSB and MSA.", __func__); + return; + } + + void *handle = nullptr; + if ((handle = dlopen("libloc_net_iface.so", RTLD_NOW)) == nullptr) { + LOC_LOGE("%s]: libloc_net_iface.so not found !", __func__); + return; + } + + LocAgpsGetAgpsCbInfo getAgpsCbInfo = (LocAgpsGetAgpsCbInfo) + dlsym(handle, "LocNetIfaceAgps_getAgpsCbInfo"); + if (getAgpsCbInfo == nullptr) { + LOC_LOGE("%s]: Failed to get method LocNetIfaceAgps_getStatusCb", __func__); + return; + } + + AgpsCbInfo& cbInfo = getAgpsCbInfo(agpsOpenResultCb, agpsCloseResultCb, this); + + if (cbInfo.statusV4Cb == nullptr) { + LOC_LOGE("%s]: statusV4Cb is nullptr!", __func__); + return; + } + + initAgpsCommand(cbInfo); +} + +void GnssAdapter::initDefaultAgpsCommand() { + LOC_LOGD("%s]: ", __func__); + + struct MsgInitDefaultAgps : public LocMsg { + GnssAdapter& mAdapter; + inline MsgInitDefaultAgps(GnssAdapter& adapter) : + LocMsg(), + mAdapter(adapter) { + LOC_LOGV("MsgInitDefaultAgps"); + } + inline virtual void proc() const { + mAdapter.initDefaultAgps(); + } + }; + + sendMsg(new MsgInitDefaultAgps(*this)); +} + /* INIT LOC AGPS MANAGER */ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ @@ -2453,7 +2513,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ AgpsManager* mAgpsManager; - AgpsFrameworkInterface::AgnssStatusIpV4Cb mFrameworkStatusV4Cb; + AgnssStatusIpV4Cb mFrameworkStatusV4Cb; AgpsAtlOpenStatusCb mAtlOpenStatusCb; AgpsAtlCloseStatusCb mAtlCloseStatusCb; @@ -2468,7 +2528,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ GnssAdapter& mAdapter; inline AgpsMsgInit(AgpsManager* agpsManager, - AgpsFrameworkInterface::AgnssStatusIpV4Cb frameworkStatusV4Cb, + AgnssStatusIpV4Cb frameworkStatusV4Cb, AgpsAtlOpenStatusCb atlOpenStatusCb, AgpsAtlCloseStatusCb atlCloseStatusCb, AgpsDSClientInitFn dsClientInitFn, @@ -2520,7 +2580,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ /* Send message to initialize AGPS Manager */ sendMsg(new AgpsMsgInit( &mAgpsManager, - (AgpsFrameworkInterface::AgnssStatusIpV4Cb)cbInfo.statusV4Cb, + (AgnssStatusIpV4Cb)cbInfo.statusV4Cb, atlOpenStatusCb, atlCloseStatusCb, dsClientInitFn, dsClientOpenAndStartDataCallFn, dsClientStopDataCallFn, dsClientCloseDataCallFn, @@ -2652,7 +2712,7 @@ bool GnssAdapter::reportDataCallClosed(){ void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, - const char* apnName, int apnLen, LocApnIpType ipType){ + const char* apnName, int apnLen, AGpsBearerType bearerType){ LOC_LOGI("GnssAdapter::frameworkDataConnOpen"); @@ -2662,12 +2722,12 @@ void GnssAdapter::dataConnOpenCommand( AGpsExtType mAgpsType; char* mApnName; int mApnLen; - LocApnIpType mIpType; + AGpsBearerType mBearerType; inline AgpsMsgAtlOpenSuccess(AgpsManager* agpsManager, AGpsExtType agpsType, - const char* apnName, int apnLen, LocApnIpType ipType) : + const char* apnName, int apnLen, AGpsBearerType bearerType) : LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName( - new char[apnLen + 1]), mApnLen(apnLen), mIpType(ipType) { + new char[apnLen + 1]), mApnLen(apnLen), mBearerType(bearerType) { LOC_LOGV("AgpsMsgAtlOpenSuccess"); memcpy(mApnName, apnName, apnLen); @@ -2681,13 +2741,12 @@ void GnssAdapter::dataConnOpenCommand( inline virtual void proc() const { LOC_LOGV("AgpsMsgAtlOpenSuccess::proc()"); - mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, - mIpType); + mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, mBearerType); } }; sendMsg( new AgpsMsgAtlOpenSuccess( - &mAgpsManager, (AGpsExtType)agpsType, apnName, apnLen, ipType)); + &mAgpsManager, agpsType, apnName, apnLen, bearerType)); } void GnssAdapter::dataConnClosedCommand(AGpsExtType agpsType){ @@ -3026,3 +3085,36 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m } } +/* Callbacks registered with loc_net_iface library */ +static void agpsOpenResultCb (bool isSuccess, AGpsExtType agpsType, const char* apn, + AGpsBearerType bearerType, void* userDataPtr) { + LOC_LOGD("%s]: ", __func__); + if (userDataPtr == nullptr) { + LOC_LOGE("%s]: userDataPtr is nullptr.", __func__); + return; + } + if (apn == nullptr) { + LOC_LOGE("%s]: apn is nullptr.", __func__); + return; + } + GnssAdapter* adapter = (GnssAdapter*)userDataPtr; + if (isSuccess) { + adapter->dataConnOpenCommand(agpsType, apn, strlen(apn), bearerType); + } else { + adapter->dataConnFailedCommand(agpsType); + } +} + +static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userDataPtr) { + LOC_LOGD("%s]: ", __func__); + if (userDataPtr == nullptr) { + LOC_LOGE("%s]: userDataPtr is nullptr.", __func__); + return; + } + GnssAdapter* adapter = (GnssAdapter*)userDataPtr; + if (isSuccess) { + adapter->dataConnClosedCommand(agpsType); + } else { + adapter->dataConnFailedCommand(agpsType); + } +} diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index fb151076..ed66de03 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -199,10 +199,10 @@ public: uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + void initDefaultAgpsCommand(); void initAgpsCommand(const AgpsCbInfo& cbInfo); - void dataConnOpenCommand( - AGpsExtType agpsType, - const char* apnName, int apnLen, LocApnIpType ipType); + void dataConnOpenCommand(AGpsExtType agpsType, + const char* apnName, int apnLen, AGpsBearerType bearerType); void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); @@ -217,6 +217,8 @@ public: uint32_t getPowerVoteId() { return mPowerVoteId; } bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); virtual bool isInSession() { return !mTrackingSessions.empty(); } + void initDefaultAgps(); + /* ==== REPORTS ======================================================================== */ /* ======== EVENTS ====(Called from QMI/ULP Thread)===================================== */ virtual void reportPositionEvent(const UlpLocation& ulpLocation, diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 19399dea..b5623e13 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -228,7 +228,7 @@ static void agpsDataConnOpen( if (NULL != gGnssAdapter) { gGnssAdapter->dataConnOpenCommand( - agpsType, apnName, apnLen, ipType); + agpsType, apnName, apnLen, (AGpsBearerType)ipType); } } static void agpsDataConnClosed(AGpsExtType agpsType) { @@ -255,4 +255,4 @@ static void updateConnectionStatus(bool connected, uint8_t type) { if (NULL != gGnssAdapter) { gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); } -} \ No newline at end of file +} diff --git a/location/location_interface.h b/location/location_interface.h index 9a71fffc..33ec29e9 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -51,9 +51,9 @@ struct GnssInterface { void (*injectLocation)(double latitude, double longitude, float accuracy); void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); void (*agpsInit)(const AgpsCbInfo& cbInfo); - void (*agpsDataConnOpen)(short agpsType, const char* apnName, int apnLen, int ipType); - void (*agpsDataConnClosed)(short agpsType); - void (*agpsDataConnFailed)(short agpsType); + void (*agpsDataConnOpen)(AGpsExtType agpsType, const char* apnName, int apnLen, int ipType); + void (*agpsDataConnClosed)(AGpsExtType agpsType); + void (*agpsDataConnFailed)(AGpsExtType agpsType); void (*getDebugReport)(GnssDebugReport& report); void (*updateConnectionStatus)(bool connected, uint8_t type); }; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index a6a8d5d2..f87a9425 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -143,7 +143,7 @@ typedef struct { /** AGPS type */ -typedef int16_t AGpsExtType; +typedef int8_t AGpsExtType; #define LOC_AGPS_TYPE_INVALID -1 #define LOC_AGPS_TYPE_ANY 0 #define LOC_AGPS_TYPE_SUPL 1 @@ -156,10 +156,10 @@ typedef int16_t AGpsExtType; #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 +#define AGPS_APN_BEARER_INVALID 0 +#define AGPS_APN_BEARER_IPV4 1 +#define AGPS_APN_BEARER_IPV6 2 +#define AGPS_APN_BEARER_IPV4V6 3 typedef enum { AGPS_CB_PRIORITY_LOW = 1, @@ -1238,6 +1238,50 @@ typedef struct Gnss_Srn_MacAddr_Type macAddrType; /* SRN AP MAC Address type */ } GnssSrnDataReq; +/* + * Represents the status of AGNSS augmented to support IPv4. + */ +struct AGnssExtStatusIpV4 { + AGpsExtType type; + LocAGpsStatusValue status; + /* + * 32-bit IPv4 address. + */ + uint32_t ipV4Addr; +}; + +/* + * Represents the status of AGNSS augmented to support IPv6. + */ +struct AGnssExtStatusIpV6 { + AGpsExtType type; + LocAGpsStatusValue status; + /* + * 128-bit IPv6 address. + */ + uint8_t ipV6Addr[16]; +}; + +/* + * Callback with AGNSS(IpV4) status information. + * + * @param status Will be of type AGnssExtStatusIpV4. + */ +typedef void (*AgnssStatusIpV4Cb)(AGnssExtStatusIpV4 status); + +/* + * Callback with AGNSS(IpV6) status information. + * + * @param status Will be of type AGnssExtStatusIpV6. + */ +typedef void (*AgnssStatusIpV6Cb)(AGnssExtStatusIpV6 status); + +/* Constructs for interaction with loc_net_iface library */ +typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const char* apn, + AGpsBearerType bearerType, void* userDataPtr); + +typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); + #ifdef __cplusplus } diff --git a/utils/loc_gps.h b/utils/loc_gps.h index 77ebe54a..5e915a32 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -208,7 +208,7 @@ typedef int LocGpsNiEncodingType; #define LOC_GPS_ENC_UNKNOWN -1 /** AGPS status event values. */ -typedef uint16_t LocAGpsStatusValue; +typedef uint8_t LocAGpsStatusValue; /** GPS requests data connection for AGPS. */ #define LOC_GPS_REQUEST_AGPS_DATA_CONN 1 /** GPS releases the AGPS data connection. */ From 0ebaba253fa0a53bfe6c165073d5e17e66c99e8a Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 18 Sep 2017 14:41:35 +0530 Subject: [PATCH 568/945] Set SUPL_HOST to modem on GnssAdapter init. On init of GnssAdapter, SUPL_HOST and SUPL_PORT are set to modem if the configs are set in gps.conf. Change-Id: I079879adf31022cfbf0098da8dba3bb86feed069 CRs-Fixed: 2110547 --- core/ContextBase.cpp | 4 ++++ core/ContextBase.h | 5 +++- gnss/GnssAdapter.cpp | 55 +++++++++++++++++++++++++------------------- gnss/GnssAdapter.h | 1 + 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 8af48fc7..05a0ad31 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -65,6 +65,8 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, {"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'}, {"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, + {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'}, + {"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -98,6 +100,8 @@ void ContextBase::readConfig() mGps_conf.SUPL_VER = 0x10000; mGps_conf.SUPL_MODE = 0x1; mGps_conf.SUPL_ES = 0; + mGps_conf.SUPL_HOST[0] = 0; + mGps_conf.SUPL_PORT = 0; mGps_conf.CAPABILITIES = 0x7; /* LTE Positioning Profile configuration is disable by default*/ mGps_conf.LPP_PROFILE = 0; diff --git a/core/ContextBase.h b/core/ContextBase.h index 83de9996..dc64b6ab 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -36,7 +36,8 @@ #include #include -#define MAX_XTRA_SERVER_URL_LENGTH 256 +#define MAX_XTRA_SERVER_URL_LENGTH (256) +#define MAX_SUPL_SERVER_URL_LENGTH (256) /* GPS.conf support */ /* NOTE: the implementaiton of the parser casts number @@ -64,6 +65,8 @@ typedef struct loc_gps_cfg_s uint32_t LPPE_CP_TECHNOLOGY; uint32_t LPPE_UP_TECHNOLOGY; uint32_t EXTERNAL_DR_ENABLED; + char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; + uint32_t SUPL_PORT; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ee9f8410..63f0eff7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -513,6 +513,33 @@ GnssAdapter::readConfigCommand() } } +LocationError +GnssAdapter::setSuplHostServer(const char* server, int port) +{ + LocationError locErr = LOCATION_ERROR_SUCCESS; + if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { + char serverUrl[MAX_URL_LEN] = {}; + int32_t length = 0; + const char noHost[] = "NONE"; + if ((NULL == server) || (server[0] == 0) || (port == 0) || + (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { + locErr = LOCATION_ERROR_INVALID_PARAMETER; + } else { + length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", server, port); + if (length > 0 && strncasecmp(getServerUrl().c_str(), + serverUrl, sizeof(serverUrl)) != 0) { + setServerUrl(serverUrl); + locErr = mLocApi->setServer(serverUrl, length); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", + __func__, serverUrl); + } + } + } + } + return locErr; +} + void GnssAdapter::setConfigCommand() { @@ -532,6 +559,8 @@ GnssAdapter::setConfigCommand() mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE)); mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT); } + mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, + ContextBase::mGps_conf.SUPL_PORT); mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE, ContextBase::mSap_conf.SENSOR_PROVIDER); mApi.setLPPeProtocolCp( @@ -665,30 +694,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { - if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - char serverUrl[MAX_URL_LEN] = {}; - int32_t length = 0; - const char noHost[] = "NONE"; - if (NULL == mConfig.assistanceServer.hostName || - strncasecmp(noHost, - mConfig.assistanceServer.hostName, - sizeof(noHost)) == 0) { - err = LOCATION_ERROR_INVALID_PARAMETER; - } else { - length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", - mConfig.assistanceServer.hostName, - mConfig.assistanceServer.port); - } - - if (length > 0 && strncasecmp(mAdapter.getServerUrl().c_str(), - serverUrl, sizeof(serverUrl)) != 0) { - mAdapter.setServerUrl(serverUrl); - err = mApi.setServer(serverUrl, length); - } - - } else { - err = LOCATION_ERROR_SUCCESS; - } + err = mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, + mConfig.assistanceServer.port); } else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) { if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { struct in_addr addr; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index fb151076..0d9031ac 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -151,6 +151,7 @@ public: LocationCallbacks getClientCallbacks(LocationAPI* client); LocationCapabilitiesMask getCapabilities(); void broadcastCapabilities(LocationCapabilitiesMask); + LocationError setSuplHostServer(const char* server, int port); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ From fb4bbe52f462aeb16b7a6d8acde2300801a4321a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 7 Sep 2017 20:15:26 -0700 Subject: [PATCH 569/945] fixing conn disconnect handling from GnssLocationProvider The "type" needs to maintain as signed, in case some value may come across as negative, even though the storage size may vary, from 8-bit to 32-bit, for example. Bug: 65164961 Change-Id: Ieb3fb4b6f8415444bbe192a7875093f86a9c3068 CRs-Fixed: 2106350 --- android/AGnssRil.cpp | 2 +- core/SystemStatus.cpp | 2 +- core/SystemStatus.h | 6 +++--- gnss/XtraSystemStatusObserver.cpp | 4 ++-- gnss/XtraSystemStatusObserver.h | 2 +- gnss/location_gnss.cpp | 4 ++-- location/location_interface.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index bd4bb373..54bd8a1c 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -51,7 +51,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool // for XTRA if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { - mGnss->getGnssInterface()->updateConnectionStatus(connected, (uint8_t)type); + mGnss->getGnssInterface()->updateConnectionStatus(connected, (int8_t)type); } return true; } diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index c83a7d00..836cf7e4 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1764,7 +1764,7 @@ bool SystemStatus::setDefaultReport(void) @return true when successfully done ******************************************************************************/ -bool SystemStatus::eventConnectionStatus(bool connected, uint8_t type) +bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { if (connected != mConnected) { mConnected = connected; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 5dc2d9ff..664296b0 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -416,7 +416,7 @@ public: mConnected(false), mRoaming(false) {} inline SystemStatusNetworkInfo( - uint32_t type, + int32_t type, std::string typeName, std::string subTypeName, bool available, @@ -429,7 +429,7 @@ public: mConnected(connected), mRoaming(roaming) {} - uint32_t mType; + int32_t mType; std::string mTypeName; std::string mSubTypeName; bool mAvailable; @@ -635,7 +635,7 @@ public: bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; bool setDefaultReport(void); - bool eventConnectionStatus(bool connected, uint8_t type); + bool eventConnectionStatus(bool connected, int8_t type); }; } // namespace loc_core diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index bbbc19ae..acce6b56 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -61,11 +61,11 @@ bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { return ( sendEvent(ss) ); } -bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, uint32_t type) { +bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, int32_t type) { stringstream ss; ss << "connection"; ss << " " << (connected ? "1" : "0"); - ss << " " << (int)type; + ss << " " << type; ss << "\n"; // append seperator return ( sendEvent(ss) ); } diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 6a001d9f..fb16dc9f 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -114,7 +114,7 @@ public : #endif bool updateLockStatus(uint32_t lock); - bool updateConnectionStatus(bool connected, uint32_t type); + bool updateConnectionStatus(bool connected, int32_t type); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); inline const MsgTask* getMsgTask() { return mMsgTask; } diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index b5623e13..1a6dab7b 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -59,7 +59,7 @@ static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnL static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); -static void updateConnectionStatus(bool connected, uint8_t type); +static void updateConnectionStatus(bool connected, int8_t type); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -251,7 +251,7 @@ static void getDebugReport(GnssDebugReport& report) { } } -static void updateConnectionStatus(bool connected, uint8_t type) { +static void updateConnectionStatus(bool connected, int8_t type) { if (NULL != gGnssAdapter) { gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); } diff --git a/location/location_interface.h b/location/location_interface.h index 33ec29e9..24116029 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -55,7 +55,7 @@ struct GnssInterface { void (*agpsDataConnClosed)(AGpsExtType agpsType); void (*agpsDataConnFailed)(AGpsExtType agpsType); void (*getDebugReport)(GnssDebugReport& report); - void (*updateConnectionStatus)(bool connected, uint8_t type); + void (*updateConnectionStatus)(bool connected, int8_t type); }; struct FlpInterface { From 220b5cb5819185b907f97b68e5a31e8e9011ed5a Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 20 Sep 2017 19:33:18 +0530 Subject: [PATCH 570/945] Adding fix to send SUPL_ES ATL Close complete Sending ATL Close complete for both Unsubscribe and Released event. CRs-Fixed: 2113762 Change-Id: Id684a05aa6d2b8636efb8af3d967146bd1718994 --- gnss/Agps.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 6675aed7..72ce2934 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -681,6 +681,7 @@ void DSStateMachine::notifyEventToSubscriber( case AGPS_EVENT_RELEASED: mAgpsManager->mDSClientCloseDataCallFn(); + mAgpsManager->mAtlCloseStatusCb(subscriberToNotify->mConnHandle, 1); break; default: From fe17363801963612a590674562a6489db9865bd0 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 14 Sep 2017 15:04:24 -0700 Subject: [PATCH 571/945] Add support more bp amplitude in systemstatus Add support of glo/bds/gal baseband processor amplitude in systemstatus. These values will be added in PQWM1 debug NMEA messasge. Change-Id: If880bdfa81b41a82bb133bda8a0b33862f3eade5 CRs-Fixed: 2091024 --- core/SystemStatus.cpp | 40 ++++++++++++++++++++++++++++++++++++++-- core/SystemStatus.h | 14 +++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 836cf7e4..275c9deb 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -120,6 +120,12 @@ public: double mAgcGal; // x16 int32_t mLeapSeconds;// x17 int32_t mLeapSecUnc; // x18 + uint32_t mGloBpAmpI; // x19 + uint32_t mGloBpAmpQ; // x1A + uint32_t mBdsBpAmpI; // x1B + uint32_t mBdsBpAmpQ; // x1C + uint32_t mGalBpAmpI; // x1D + uint32_t mGalBpAmpQ; // x1E }; // parser @@ -153,6 +159,12 @@ private: eAgcGal = 22, eLeapSeconds = 23, eLeapSecUnc = 24, + eGloBpAmpI = 25, + eGloBpAmpQ = 26, + eBdsBpAmpI = 27, + eBdsBpAmpQ = 28, + eGalBpAmpI = 29, + eGalBpAmpQ = 30, eMax }; SystemStatusPQWM1 mM1; @@ -182,6 +194,12 @@ public: inline uint32_t getRecErrorRecovery() { return mM1.mRecErrorRecovery; } inline int32_t getLeapSeconds(){ return mM1.mLeapSeconds; } inline int32_t getLeapSecUnc() { return mM1.mLeapSecUnc; } + inline uint32_t getGloBpAmpI() { return mM1.mGloBpAmpI; } + inline uint32_t getGloBpAmpQ() { return mM1.mGloBpAmpQ; } + inline uint32_t getBdsBpAmpI() { return mM1.mBdsBpAmpI; } + inline uint32_t getBdsBpAmpQ() { return mM1.mBdsBpAmpQ; } + inline uint32_t getGalBpAmpI() { return mM1.mGalBpAmpI; } + inline uint32_t getGalBpAmpQ() { return mM1.mGalBpAmpQ; } SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) @@ -216,6 +234,12 @@ public: mM1.mAgcGal = atof(mField[eAgcGal].c_str()); mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); + mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str()); + mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str()); + mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str()); + mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str()); + mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); + mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); } inline SystemStatusPQWM1& get() { return mM1;} //getparser @@ -762,7 +786,13 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea) mAgcGps(nmea.mAgcGps), mAgcGlo(nmea.mAgcGlo), mAgcBds(nmea.mAgcBds), - mAgcGal(nmea.mAgcGal) + mAgcGal(nmea.mAgcGal), + mGloBpAmpI(nmea.mGloBpAmpI), + mGloBpAmpQ(nmea.mGloBpAmpQ), + mBdsBpAmpI(nmea.mBdsBpAmpI), + mBdsBpAmpQ(nmea.mBdsBpAmpQ), + mGalBpAmpI(nmea.mGalBpAmpI), + mGalBpAmpQ(nmea.mGalBpAmpQ) { } @@ -780,7 +810,13 @@ bool SystemStatusRfAndParams::equals(SystemStatusRfAndParams& peer) (mAgcGps != peer.mAgcGps) || (mAgcGlo != peer.mAgcGlo) || (mAgcBds != peer.mAgcBds) || - (mAgcGal != peer.mAgcGal)) { + (mAgcGal != peer.mAgcGal) || + (mGloBpAmpI != peer.mGloBpAmpI) || + (mGloBpAmpQ != peer.mGloBpAmpQ) || + (mBdsBpAmpI != peer.mBdsBpAmpI) || + (mBdsBpAmpQ != peer.mBdsBpAmpQ) || + (mGalBpAmpI != peer.mGalBpAmpI) || + (mGalBpAmpQ != peer.mGalBpAmpQ)) { return false; } return true; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 664296b0..9ee85d3f 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -150,6 +150,12 @@ public: double mAgcGlo; double mAgcBds; double mAgcGal; + uint32_t mGloBpAmpI; + uint32_t mGloBpAmpQ; + uint32_t mBdsBpAmpI; + uint32_t mBdsBpAmpQ; + uint32_t mGalBpAmpI; + uint32_t mGalBpAmpQ; inline SystemStatusRfAndParams() : mPgaGain(0), mGpsBpAmpI(0), @@ -163,7 +169,13 @@ public: mAgcGps(0), mAgcGlo(0), mAgcBds(0), - mAgcGal(0) {} + mAgcGal(0), + mGloBpAmpI(0), + mGloBpAmpQ(0), + mBdsBpAmpI(0), + mBdsBpAmpQ(0), + mGalBpAmpI(0), + mGalBpAmpQ(0) {} inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); bool equals(SystemStatusRfAndParams& peer); void dump(void); From c7642dca5f4bc58329341fa40102027ff422be71 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 22 Sep 2017 17:28:58 -0700 Subject: [PATCH 572/945] locAPIRemoveGeofences now notify the result inmediately locAPIRemoveGeofences is no longer waiting for the request response, instead it will always notify his callbacks with LOCATION_ERROR_SUCCESS if the provided id is found, or LOCATION_ERROR_ID_UNKNOWN if not. Change-Id: I602ad43bee894e85fde1e80210e6477b628e4a39 CRs-fixed: 2099450 --- location/LocationAPIClientBase.cpp | 44 ++++++++---------------------- location/LocationAPIClientBase.h | 8 +----- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 070c585f..4aa1ccbb 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -613,12 +613,22 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { size_t j = 0; + uint32_t id_cb; + LocationError err; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); + id_cb = ids[i]; if (sessions[j] > 0) { + mGeofenceBiDict.rmBySession(sessions[j]); + err = LOCATION_ERROR_SUCCESS; + onRemoveGeofencesCb(1, &err, &id_cb); j++; + } else { + err = LOCATION_ERROR_ID_UNKNOWN; + onRemoveGeofencesCb(1, &err, &id_cb); } } + if (j > 0) { mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this)); mLocationAPI->removeGeofences(j, sessions); @@ -743,38 +753,8 @@ void LocationAPIClientBase::locAPIResumeGeofences( void LocationAPIClientBase::locAPIRemoveAllGeofences() { - pthread_mutex_lock(&mMutex); - if (mLocationAPI) { - std::vector sessionsVec = mGeofenceBiDict.getAllSessions(); - size_t count = sessionsVec.size(); - uint32_t* sessions = (uint32_t*)malloc(sizeof(uint32_t) * count); - if (sessions == NULL) { - LOC_LOGE("%s:%d] Failed to allocate %zu bytes !", - __FUNCTION__, __LINE__, sizeof(uint32_t) * count); - pthread_mutex_unlock(&mMutex); - return; - } - - if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { - size_t j = 0; - for (size_t i = 0; i < count; i++) { - sessions[j] = sessionsVec[i]; - if (sessions[j] > 0) { - j++; - } - } - if (j > 0) { - mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this)); - mLocationAPI->removeGeofences(j, sessions); - } - } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, - mRequestQueues[REQUEST_GEOFENCE].getSession()); - } - - free(sessions); - } - pthread_mutex_unlock(&mMutex); + std::vector sessionsVec = mGeofenceBiDict.getAllSessions(); + locAPIRemoveGeofences(sessionsVec.size(), &sessionsVec[0]); } void LocationAPIClientBase::locAPIGnssNiResponse(uint32_t id, GnssNiResponse response) diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index a8560548..78c8fa61 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -465,13 +465,7 @@ private: public: RemoveGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { - uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); - for (size_t i = 0; i < count; i++) { - ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); - mAPI.mGeofenceBiDict.rmBySession(sessions[i]); - } - mAPI.onRemoveGeofencesCb(count, errors, ids); - free(ids); + // No need to handle collectiveResponse, cbs already notified } LocationAPIClientBase& mAPI; }; From 7b37deedff072e85e9a5c0535ea72d4edea7375c Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 20 Sep 2017 14:13:05 +0530 Subject: [PATCH 573/945] KW Warning fixes Adding fixes for null reference errors. Change-Id: Ie62bd93860baef2670c164ae7a5d148440308213 CRs-Fixed: 2113171 --- gnss/GnssAdapter.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 44a93855..0d122491 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -641,6 +641,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) uint32_t* ids = NULL; if (count > 0) { ids = new uint32_t[count]; + if (ids == nullptr) { + LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + return nullptr; + } for (size_t i=0; i < count; ++i) { ids[i] = generateSessionId(); IF_LOC_LOGD { @@ -678,6 +682,11 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) LocationError err = LOCATION_ERROR_SUCCESS; uint32_t index = 0; + if (errs == nullptr) { + LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + return; + } + if (mConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { uint32_t newGpsLock = mAdapter.convertGpsLock(mConfig.gpsLock); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; @@ -2146,6 +2155,10 @@ GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) mAdapter(adapter), mNmea(new char[length+1]), mLength(length) { + if (mNmea == nullptr) { + LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + return; + } strlcpy((char*)mNmea, nmea, length+1); } inline virtual ~MsgReportNmea() @@ -2737,6 +2750,10 @@ void GnssAdapter::dataConnOpenCommand( new char[apnLen + 1]), mApnLen(apnLen), mBearerType(bearerType) { LOC_LOGV("AgpsMsgAtlOpenSuccess"); + if (mApnName == nullptr) { + LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + return; + } memcpy(mApnName, apnName, apnLen); mApnName[apnLen] = 0; } From 39526894cfaafab8b9fc6714956c4f6df0bcc329 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 18 Sep 2017 16:12:46 -0700 Subject: [PATCH 574/945] AGPS Init must complete in one message call If AGPS initialization is split across multiple messages on the msgTask, it causes other other commands to seep in before the initialization can complete. To avoid this the initialization must be completed in one message. Also includes some cleanup on AGPS initializations. CRs-Fixed: 2111399 Change-Id: Id61ceeb12d5781764b42ff9d1868884537ca8d90 --- core/LocApiBase.cpp | 2 +- gnss/Agps.h | 17 ++-- gnss/GnssAdapter.cpp | 220 ++++++++++++++++++------------------------- gnss/GnssAdapter.h | 1 + 4 files changed, 100 insertions(+), 140 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 070b2ae5..4bc38e2e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -208,7 +208,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + open(getEvtMask()); } void LocApiBase::handleEngineUpEvent() diff --git a/gnss/Agps.h b/gnss/Agps.h index 2f89c8c3..862769a1 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -277,34 +277,29 @@ public: mAgnssNif(NULL), mInternetNif(NULL), mDsNif(NULL) {} /* Register callbacks */ - void registerCallbacks( - AgnssStatusIpV4Cb frameworkStatusV4Cb, - - AgpsAtlOpenStatusCb atlOpenStatusCb, + inline void registerATLCallbacks(AgpsAtlOpenStatusCb atlOpenStatusCb, AgpsAtlCloseStatusCb atlCloseStatusCb, - AgpsDSClientInitFn dsClientInitFn, AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn, AgpsDSClientStopDataCallFn dsClientStopDataCallFn, AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, AgpsDSClientReleaseFn dsClientReleaseFn, - - SendMsgToAdapterMsgQueueFn sendMsgToAdapterQueueFn ){ - - mFrameworkStatusV4Cb = frameworkStatusV4Cb; + SendMsgToAdapterMsgQueueFn sendMsgToAdapterQueueFn) { mAtlOpenStatusCb = atlOpenStatusCb; mAtlCloseStatusCb = atlCloseStatusCb; - mDSClientInitFn = dsClientInitFn; mDSClientOpenAndStartDataCallFn = dsClientOpenAndStartDataCallFn; mDSClientStopDataCallFn = dsClientStopDataCallFn; mDSClientCloseDataCallFn = dsClientCloseDataCallFn; mDSClientReleaseFn = dsClientReleaseFn; - mSendMsgToAdapterQueueFn = sendMsgToAdapterQueueFn; } + inline void registerFrameworkStatusCallback(AgnssStatusIpV4Cb frameworkStatusV4Cb) { + mFrameworkStatusV4Cb = frameworkStatusV4Cb; + } + /* Create all AGPS state machines */ void createAgpsStateMachines(); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 0d122491..404f19b7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -80,6 +80,62 @@ GnssAdapter::GnssAdapter() : { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; + + /* Set ATL open/close callbacks */ + AgpsAtlOpenStatusCb atlOpenStatusCb = + [this](int handle, int isSuccess, char* apn, + AGpsBearerType bearerType, AGpsExtType agpsType) { + + mLocApi->atlOpenStatus( + handle, isSuccess, apn, bearerType, agpsType); + }; + AgpsAtlCloseStatusCb atlCloseStatusCb = + [this](int handle, int isSuccess) { + + mLocApi->atlCloseStatus(handle, isSuccess); + }; + + /* Register DS Client APIs */ + AgpsDSClientInitFn dsClientInitFn = + [this](bool isDueToSSR) { + + return mLocApi->initDataServiceClient(isDueToSSR); + }; + + AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn = + [this] { + + return mLocApi->openAndStartDataCall(); + }; + + AgpsDSClientStopDataCallFn dsClientStopDataCallFn = + [this] { + + mLocApi->stopDataCall(); + }; + + AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn = + [this] { + + mLocApi->closeDataCall(); + }; + + AgpsDSClientReleaseFn dsClientReleaseFn = + [this] { + + mLocApi->releaseDataServiceClient(); + }; + + /* Send Msg function */ + SendMsgToAdapterMsgQueueFn sendMsgFn = + [this](LocMsg* msg) { + + sendMsg(msg); + }; + mAgpsManager.registerATLCallbacks(atlOpenStatusCb, atlCloseStatusCb, + dsClientInitFn, dsClientOpenAndStartDataCallFn, dsClientStopDataCallFn, + dsClientCloseDataCallFn, dsClientReleaseFn, sendMsgFn); + readConfigCommand(); setConfigCommand(); initDefaultAgpsCommand(); @@ -1087,6 +1143,10 @@ GnssAdapter::updateClientsEventMask() LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); } + if (mAgpsCbInfo.statusV4Cb != NULL) { + mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } @@ -2423,16 +2483,9 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) void GnssAdapter::initDefaultAgps() { LOC_LOGD("%s]: ", __func__); - LocationCapabilitiesMask mask = getCapabilities(); - if (!(mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) && - !(mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)) { - LOC_LOGI("%s]: Target does not support MSB and MSA.", __func__); - return; - } - void *handle = nullptr; if ((handle = dlopen("libloc_net_iface.so", RTLD_NOW)) == nullptr) { - LOC_LOGE("%s]: libloc_net_iface.so not found !", __func__); + LOC_LOGD("%s]: libloc_net_iface.so not found !", __func__); return; } @@ -2450,7 +2503,7 @@ void GnssAdapter::initDefaultAgps() { return; } - initAgpsCommand(cbInfo); + initAgps(cbInfo); } void GnssAdapter::initDefaultAgpsCommand() { @@ -2461,7 +2514,6 @@ void GnssAdapter::initDefaultAgpsCommand() { inline MsgInitDefaultAgps(GnssAdapter& adapter) : LocMsg(), mAdapter(adapter) { - LOC_LOGV("MsgInitDefaultAgps"); } inline virtual void proc() const { mAdapter.initDefaultAgps(); @@ -2472,141 +2524,53 @@ void GnssAdapter::initDefaultAgpsCommand() { } /* INIT LOC AGPS MANAGER */ + +void GnssAdapter::initAgps(const AgpsCbInfo& cbInfo) { + LOC_LOGD("%s]: mAgpsCbInfo.cbPriority - %d; cbInfo.cbPriority - %d", + __func__, mAgpsCbInfo.cbPriority, cbInfo.cbPriority) + + if (!((ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB) || + (ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA))) { + return; + } + + if (mAgpsCbInfo.cbPriority > cbInfo.cbPriority) { + return; + } else { + mAgpsCbInfo = cbInfo; + + mAgpsManager.registerFrameworkStatusCallback((AgnssStatusIpV4Cb)cbInfo.statusV4Cb); + + mAgpsManager.createAgpsStateMachines(); + + /* Register for AGPS event mask */ + updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, + LOC_REGISTRATION_MASK_ENABLED); + } +} + void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ - LOC_LOGI("GnssAdapter::initAgpsCommand"); - /* Set ATL open/close callbacks */ - AgpsAtlOpenStatusCb atlOpenStatusCb = - [this](int handle, int isSuccess, char* apn, - AGpsBearerType bearerType, AGpsExtType agpsType) { - - mLocApi->atlOpenStatus( - handle, isSuccess, apn, bearerType, agpsType); - }; - AgpsAtlCloseStatusCb atlCloseStatusCb = - [this](int handle, int isSuccess) { - - mLocApi->atlCloseStatus(handle, isSuccess); - }; - - /* Register DS Client APIs */ - AgpsDSClientInitFn dsClientInitFn = - [this](bool isDueToSSR) { - - return mLocApi->initDataServiceClient(isDueToSSR); - }; - - AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn = - [this] { - - return mLocApi->openAndStartDataCall(); - }; - - AgpsDSClientStopDataCallFn dsClientStopDataCallFn = - [this] { - - mLocApi->stopDataCall(); - }; - - AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn = - [this] { - - mLocApi->closeDataCall(); - }; - - AgpsDSClientReleaseFn dsClientReleaseFn = - [this] { - - mLocApi->releaseDataServiceClient(); - }; - - /* Send Msg function */ - SendMsgToAdapterMsgQueueFn sendMsgFn = - [this](LocMsg* msg) { - - sendMsg(msg); - }; - /* Message to initialize AGPS module */ struct AgpsMsgInit: public LocMsg { - - AgpsManager* mAgpsManager; - - AgnssStatusIpV4Cb mFrameworkStatusV4Cb; - - AgpsAtlOpenStatusCb mAtlOpenStatusCb; - AgpsAtlCloseStatusCb mAtlCloseStatusCb; - - AgpsDSClientInitFn mDSClientInitFn; - AgpsDSClientOpenAndStartDataCallFn mDSClientOpenAndStartDataCallFn; - AgpsDSClientStopDataCallFn mDSClientStopDataCallFn; - AgpsDSClientCloseDataCallFn mDSClientCloseDataCallFn; - AgpsDSClientReleaseFn mDSClientReleaseFn; - - SendMsgToAdapterMsgQueueFn mSendMsgFn; + const AgpsCbInfo& mCbInfo; GnssAdapter& mAdapter; - inline AgpsMsgInit(AgpsManager* agpsManager, - AgnssStatusIpV4Cb frameworkStatusV4Cb, - AgpsAtlOpenStatusCb atlOpenStatusCb, - AgpsAtlCloseStatusCb atlCloseStatusCb, - AgpsDSClientInitFn dsClientInitFn, - AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn, - AgpsDSClientStopDataCallFn dsClientStopDataCallFn, - AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, - AgpsDSClientReleaseFn dsClientReleaseFn, - SendMsgToAdapterMsgQueueFn sendMsgFn, + inline AgpsMsgInit(const AgpsCbInfo& cbInfo, GnssAdapter& adapter) : - LocMsg(), mAgpsManager(agpsManager), mFrameworkStatusV4Cb( - frameworkStatusV4Cb), mAtlOpenStatusCb(atlOpenStatusCb), mAtlCloseStatusCb( - atlCloseStatusCb), mDSClientInitFn(dsClientInitFn), mDSClientOpenAndStartDataCallFn( - dsClientOpenAndStartDataCallFn), mDSClientStopDataCallFn( - dsClientStopDataCallFn), mDSClientCloseDataCallFn( - dsClientCloseDataCallFn), mDSClientReleaseFn( - dsClientReleaseFn), mSendMsgFn(sendMsgFn), - mAdapter(adapter) { - + LocMsg(), mCbInfo(cbInfo), mAdapter(adapter) { LOC_LOGV("AgpsMsgInit"); } inline virtual void proc() const { - LOC_LOGV("AgpsMsgInit::proc()"); - - mAgpsManager->registerCallbacks(mFrameworkStatusV4Cb, mAtlOpenStatusCb, - mAtlCloseStatusCb, mDSClientInitFn, - mDSClientOpenAndStartDataCallFn, mDSClientStopDataCallFn, - mDSClientCloseDataCallFn, mDSClientReleaseFn, mSendMsgFn); - - mAgpsManager->createAgpsStateMachines(); - - /* Register for AGPS event mask */ - mAdapter.updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, - LOC_REGISTRATION_MASK_ENABLED); + mAdapter.initAgps(mCbInfo); } }; - if (mAgpsCbInfo.cbPriority > cbInfo.cbPriority) { - LOC_LOGI("Higher priority AGPS CB already registered (%d > %d) !", - mAgpsCbInfo.cbPriority, cbInfo.cbPriority); - return; - } else { - mAgpsCbInfo = cbInfo; - LOC_LOGI("Registering AGPS CB %p with priority %d", - mAgpsCbInfo.statusV4Cb, mAgpsCbInfo.cbPriority); - } - /* Send message to initialize AGPS Manager */ - sendMsg(new AgpsMsgInit( - &mAgpsManager, - (AgnssStatusIpV4Cb)cbInfo.statusV4Cb, - atlOpenStatusCb, atlCloseStatusCb, - dsClientInitFn, dsClientOpenAndStartDataCallFn, - dsClientStopDataCallFn, dsClientCloseDataCallFn, - dsClientReleaseFn, - sendMsgFn, - *this)); + sendMsg(new AgpsMsgInit(cbInfo, *this)); } /* GnssAdapter::requestATL diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b60ca299..9fa216f8 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -106,6 +106,7 @@ class GnssAdapter : public LocAdapterBase { // This must be initialized via initAgps() AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; + void initAgps(const AgpsCbInfo& cbInfo); /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; From a5c7e2c53da6919499fa29d9bcd77a0b80be16e1 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Thu, 21 Sep 2017 14:24:50 +0530 Subject: [PATCH 575/945] extended gdop parameters in interface files updated interface files with extended gdop parameters. Change-Id: Ie31311125e66d26dab4f564be7120fae374b9d2c CRs-Fixed: 2062856 --- utils/gps_extended_c.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index f87a9425..7929a5a6 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -308,6 +308,8 @@ typedef uint32_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA 0x10000 /** GpsLocationExtended has GPS Time */ #define GPS_LOCATION_EXTENDED_HAS_GPS_TIME 0x20000 +/** GpsLocationExtended has Extended Dilution of Precision */ +#define GPS_LOCATION_EXTENDED_HAS_EXT_DOP 0x40000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -393,6 +395,29 @@ typedef struct { float pitch; }LocPositionDynamics; +typedef struct { + + /** Position dilution of precision. + Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + float PDOP; + + /** Horizontal dilution of precision. + Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + float HDOP; + + /** Vertical dilution of precision. + Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + float VDOP; + + /** geometric dilution of precision. + Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + float GDOP; + + /** time dilution of precision. + Range: 1 (highest accuracy) to 50 (lowest accuracy) */ + float TDOP; +}LocExtDOP; + /* GPS Time structure */ typedef struct { @@ -451,6 +476,8 @@ typedef struct { LocPositionDynamics bodyFrameData; /** GPS Time */ GPSTimeStruct gpsTime; + /** Dilution of precision associated with this position*/ + LocExtDOP extDOP; } GpsLocationExtended; enum loc_sess_status { From b0982b4476d852410658b307afdeacccd26fb981 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Wed, 23 Aug 2017 17:36:20 -0700 Subject: [PATCH 576/945] add HAL socket this patch contains the following changes: 1. added header and implemenation files of socket util apis in libgps.utils; 2. updated XtraSystemStatusObserver to use the new apis; 3. added HAL socket and new thread to listen to it. Change-Id: If1f6b4b4d6ea2d03640f68e96f0286300404f42b CRs-fixed: 2108635 --- gnss/XtraSystemStatusObserver.cpp | 75 ++--------- gnss/XtraSystemStatusObserver.h | 19 ++- utils/Android.mk | 3 +- utils/LocIpc.cpp | 203 ++++++++++++++++++++++++++++++ utils/LocIpc.h | 88 +++++++++++++ utils/gps_extended_c.h | 3 + 6 files changed, 322 insertions(+), 69 deletions(-) create mode 100644 utils/LocIpc.cpp create mode 100644 utils/LocIpc.h diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index acce6b56..3c08cf34 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -51,14 +51,16 @@ using namespace loc_core; -#define XTRA_HAL_SOCKET_NAME "/data/vendor/location/xtra/socket_hal_xtra" +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "LocSvc_XSSO" bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { stringstream ss; ss << "gpslock"; ss << " " << lock; - ss << "\n"; // append seperator - return ( sendEvent(ss) ); + return ( send(LOC_IPC_XTRA, ss.str()) ); } bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, int32_t type) { @@ -66,79 +68,28 @@ bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, int32_t ty ss << "connection"; ss << " " << (connected ? "1" : "0"); ss << " " << type; - ss << "\n"; // append seperator - return ( sendEvent(ss) ); + return ( send(LOC_IPC_XTRA, ss.str()) ); } bool XtraSystemStatusObserver::updateTac(const string& tac) { stringstream ss; ss << "tac"; ss << " " << tac.c_str(); - ss << "\n"; // append seperator - return ( sendEvent(ss) ); + return ( send(LOC_IPC_XTRA, ss.str()) ); } bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { stringstream ss; ss << "mncmcc"; ss << " " << mccmnc.c_str(); - ss << "\n"; // append seperator - return ( sendEvent(ss) ); + return ( send(LOC_IPC_XTRA, ss.str()) ); } -bool XtraSystemStatusObserver::sendEvent(const stringstream& event) { - int socketFd = createSocket(); - if (socketFd < 0) { - LOC_LOGe("XTRA unreachable. sending failed."); - return false; - } +void XtraSystemStatusObserver::onReceive(const std::string& data) { + if (!strncmp(data.c_str(), "ping", sizeof("ping") - 1)) { + LOC_LOGd("ping received"); - const string& data = event.str(); - int remain = data.length(); - ssize_t sent = 0; - while (remain > 0 && - (sent = ::send(socketFd, data.c_str() + (data.length() - remain), - remain, MSG_NOSIGNAL)) > 0) { - remain -= sent; - } - - if (sent < 0) { - LOC_LOGe("sending error. reason:%s", strerror(errno)); - } - - closeSocket(socketFd); - - return (remain == 0); -} - - -int XtraSystemStatusObserver::createSocket() { - int socketFd = -1; - - if ((socketFd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - LOC_LOGe("create socket error. reason:%s", strerror(errno)); - - } else { - const char* socketPath = XTRA_HAL_SOCKET_NAME ; - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); - - if (::connect(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot connect to XTRA. reason:%s", strerror(errno)); - if (::close(socketFd)) { - LOC_LOGe("close socket error. reason:%s", strerror(errno)); - } - socketFd = -1; - } - } - - return socketFd; -} - -void XtraSystemStatusObserver::closeSocket(const int socketFd) { - if (socketFd >= 0) { - if(::close(socketFd)) { - LOC_LOGe("close socket error. reason:%s", strerror(errno)); - } + } else { + LOC_LOGw("unknown event: %s", data.c_str()); } } diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index fb16dc9f..f8d3edde 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -34,11 +34,13 @@ #ifdef USE_GLIB #include #endif +#include using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; +using loc_util::LocIpc; #ifdef USE_GLIB // XtraHalListenerSocket class @@ -90,7 +92,7 @@ private: }; #endif -class XtraSystemStatusObserver : public IDataItemObserver { +class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): @@ -99,9 +101,15 @@ public : #endif mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask) { subscribe(true); + startListeningNonBlocking(LOC_IPC_HAL); + } + inline XtraSystemStatusObserver() { + startListeningNonBlocking(LOC_IPC_HAL); + }; + inline virtual ~XtraSystemStatusObserver() { + subscribe(false); + stopListening(); } - inline XtraSystemStatusObserver() {}; - inline virtual ~XtraSystemStatusObserver() { subscribe(false); } // IDataItemObserver overrides inline virtual void getName(string& name); @@ -120,10 +128,9 @@ public : inline const MsgTask* getMsgTask() { return mMsgTask; } void subscribe(bool yes); + void onReceive(const std::string& data) override; + private: - int createSocket(); - void closeSocket(const int32_t socketFd); - bool sendEvent(const stringstream& event); IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; #ifdef USE_GLIB diff --git a/utils/Android.mk b/utils/Android.mk index 3f3b83a1..1352076c 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -26,7 +26,8 @@ LOCAL_SRC_FILES += \ LocThread.cpp \ MsgTask.cpp \ loc_misc_utils.cpp \ - loc_nmea.cpp + loc_nmea.cpp \ + LocIpc.cpp # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true LOCAL_CFLAGS += \ diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp new file mode 100644 index 00000000..38889d0f --- /dev/null +++ b/utils/LocIpc.cpp @@ -0,0 +1,203 @@ +/* Copyright (c) 2017 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 +#include "gps_extended_c.h" +#include "LocIpc.h" + +namespace loc_util { + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "LocSvc_LocIpc" + +#define LOC_MSG_BUF_LEN 1024 +#define LOC_MSG_HEAD "$MSGLEN$" + +class LocIpcRunnable : public LocRunnable { +public: + LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) + : mLocIpc(locIpc), mIpcName(ipcName) {} + bool run() override { + if (!mLocIpc.startListeningBlocking(mIpcName)) { + LOC_LOGe("listen to socket failed"); + } + + return false; + } +private: + LocIpc& mLocIpc; + const std::string mIpcName; +}; + +bool LocIpc::startListeningNonBlocking(const std::string& name) { + mRunnable.reset(new LocIpcRunnable(*this, name)); + std::string threadName("LocIpc-"); + threadName.append(name); + return mThread.start(threadName.c_str(), mRunnable.get()); +} + +bool LocIpc::startListeningBlocking(const std::string& name) { + int fd = socket(AF_UNIX, SOCK_DGRAM, 0); + if (fd < 0) { + LOC_LOGe("create socket error. reason:%s", strerror(errno)); + return false; + } + + if ((unlink(name.c_str()) < 0) && (errno != ENOENT)) { + LOC_LOGw("unlink socket error. reason:%s", strerror(errno)); + } + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", name.c_str()); + + umask(0157); + + if (::bind(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("bind socket error. reason:%s", strerror(errno)); + ::close(fd); + fd = -1; + return false; + } + + mIpcFd = fd; + + ssize_t nBytes = 0; + std::vector buf(LOC_MSG_BUF_LEN); + while ((nBytes = ::recvfrom(mIpcFd, buf.data(), buf.size(), 0, NULL, NULL)) >= 0) { + if (nBytes == 0) { + continue; + } + + std::string msg; + if (strncmp(buf.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { + // short message + msg.append(buf.data(), nBytes); + onReceive(msg); + + } else { + // long message + size_t msgLen = 0; + sscanf(buf.data(), LOC_MSG_HEAD"%zu", &msgLen); + while (msg.length() < msgLen && + (nBytes = recvfrom(mIpcFd, buf.data(), buf.size(), 0, NULL, NULL)) >= 0) { + msg.append(buf.data(), nBytes); + } + + if (nBytes >= 0) { + onReceive(msg); + } else { + break; + } + } + } + + if (mStopRequested) { + mStopRequested = false; + return true; + + } else { + LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); + (void)::close(mIpcFd); + mIpcFd = -1; + return false; + } +} + +void LocIpc::stopListening() { + mStopRequested = true; + + if (mIpcFd >= 0) { + if (::close(mIpcFd)) { + LOC_LOGe("cannot close socket:%s", strerror(errno)); + } + mIpcFd = -1; + } +} + +bool LocIpc::send(const char name[], const std::string& data) { + int fd = ::socket(AF_UNIX, SOCK_DGRAM, 0); + if (fd < 0) { + LOC_LOGe("create socket error. reason:%s", strerror(errno)); + return false; + } + + struct sockaddr_un addr = { .sun_family = AF_UNIX }; + snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", name); + + bool result = true; + if (data.length() <= LOC_MSG_BUF_LEN) { + if (::sendto(fd, data.c_str(), data.length(), 0, + (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + result = false; + } + } else { + std::string head = LOC_MSG_HEAD; + head.append(std::to_string(data.length())); + if (::sendto(fd, head.c_str(), head.length(), 0, + (struct sockaddr*)&addr, sizeof(addr)) < 0) { + LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + result = false; + } else { + size_t sentBytes = 0; + while(sentBytes < data.length()) { + size_t partLen = data.length() - sentBytes; + if (partLen > LOC_MSG_BUF_LEN) { + partLen = LOC_MSG_BUF_LEN; + } + ssize_t rv = ::sendto(fd, data.c_str() + sentBytes, partLen, 0, + (struct sockaddr*)&addr, sizeof(addr)); + if (rv < 0) { + LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + result = false; + break; + } + sentBytes += rv; + } + } + } + + (void)::close(fd); + return result; +} + +} diff --git a/utils/LocIpc.h b/utils/LocIpc.h new file mode 100644 index 00000000..258fd42e --- /dev/null +++ b/utils/LocIpc.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2017 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_SOCKET__ +#define __LOC_SOCKET__ + +#include +#include +#include + +namespace loc_util { + +class LocIpc { +public: + inline LocIpc() : mIpcFd(-1), mStopRequested(false), mRunnable(nullptr) {} + inline virtual ~LocIpc() { stopListening(); } + + // Listen for new messages in current thread. Calling this funciton will + // block current thread. The listening can be stopped by calling stopListening(). + // + // Argument name is the path of the unix local socket to be listened. + // The function will return true on success, and false on failure. + bool startListeningBlocking(const std::string& name); + + // Create a new LocThread and listen for new messages in it. + // Calling this function will return immediately and won't block current thread. + // The listening can be stopped by calling stopListening(). + // + // Argument name is the path of the unix local socket to be be listened. + // The function will return true on success, and false on failure. + bool startListeningNonBlocking(const std::string& name); + + // Stop listening to new messages. + void stopListening(); + + // Callback function for receiving incoming messages. + // Override this function in your derived class to process incoming messages. + // For each received message, this callback function will be called once. + // This callback function will be called in the calling thread of startListeningBlocking + // or in the new LocThread created by startListeningNonBlocking. + // + // Argument data contains the received message. You need to parse it. + virtual void onReceive(const std::string& /*data*/) {} + + // Send out a message. + // Call this function to send a message in argument data to socket in argument name. + // + // Argument name contains the name of the target unix socket. data contains the + // message to be sent out. Convert your message to a string before calling this function. + // The function will return true on success, and false on failure. + bool send(const char name[], const std::string& data); + +private: + int mIpcFd; + bool mStopRequested; + LocThread mThread; + std::unique_ptr mRunnable; +}; + +} + +#endif //__LOC_SOCKET__ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 7929a5a6..a24e7848 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1309,6 +1309,9 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); +/* Shared resources of LocIpc */ +#define LOC_IPC_HAL "/data/vendor/location/socket_hal" +#define LOC_IPC_XTRA "/data/vendor/location/xtra/socket_xtra" #ifdef __cplusplus } From 35804b91311b84741ef05969665fa2416c6f4111 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Mon, 21 Aug 2017 17:46:44 -0700 Subject: [PATCH 577/945] new apis for control xtra throttle added register and unregister apis of a callback that listens to XTRA client throttle enablement commands. Change-Id: Id50e7311516593018113203b5dfa700f0fdc037b CRs-fixed: 2092629 --- gnss/GnssAdapter.cpp | 20 ++++++++++++++++++++ gnss/GnssAdapter.h | 1 + gnss/XtraSystemStatusObserver.cpp | 15 +++++++++++---- gnss/XtraSystemStatusObserver.h | 1 + gnss/location_gnss.cpp | 9 +++++++++ location/location_interface.h | 1 + 6 files changed, 43 insertions(+), 4 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 404f19b7..4d543690 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -931,6 +931,26 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) return sessionId; } +void +GnssAdapter::gnssUpdateXtraThrottleCommand(const bool enabled) +{ + LOC_LOGD("%s] enabled:%d", __func__, enabled); + + struct UpdateXtraThrottleMsg : public LocMsg { + GnssAdapter& mAdapter; + const bool mEnabled; + inline UpdateXtraThrottleMsg(GnssAdapter& adapter, const bool enabled) : + LocMsg(), + mAdapter(adapter), + mEnabled(enabled) {} + inline virtual void proc() const { + mAdapter.mXtraObserver.updateXtraThrottle(mEnabled); + } + }; + + sendMsg(new UpdateXtraThrottleMsg(*this, enabled)); +} + void GnssAdapter::injectLocationCommand(double latitude, double longitude, float accuracy) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9fa216f8..99ce5c9a 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -200,6 +200,7 @@ public: void setConfigCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + void gnssUpdateXtraThrottleCommand(const bool enabled); void initDefaultAgpsCommand(); void initAgpsCommand(const AgpsCbInfo& cbInfo); diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 3c08cf34..fe4129c3 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -84,6 +84,13 @@ bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { return ( send(LOC_IPC_XTRA, ss.str()) ); } +bool XtraSystemStatusObserver::updateXtraThrottle(const bool enabled) { + stringstream ss; + ss << "xtrathrottle"; + ss << " " << (enabled ? 1 : 0); + return ( send(LOC_IPC_XTRA, ss.str()) ); +} + void XtraSystemStatusObserver::onReceive(const std::string& data) { if (!strncmp(data.c_str(), "ping", sizeof("ping") - 1)) { LOC_LOGd("ping received"); @@ -121,11 +128,11 @@ void XtraSystemStatusObserver::getName(string& name) void XtraSystemStatusObserver::notify(const list& dlist) { - struct handleOsObserverUpdateMsg : public LocMsg { + struct HandleOsObserverUpdateMsg : public LocMsg { XtraSystemStatusObserver* mXtraSysStatObj; list mDataItemList; - inline handleOsObserverUpdateMsg(XtraSystemStatusObserver* xtraSysStatObs, + inline HandleOsObserverUpdateMsg(XtraSystemStatusObserver* xtraSysStatObs, const list& dataItemList) : mXtraSysStatObj(xtraSysStatObs) { for (auto eachItem : dataItemList) { @@ -141,7 +148,7 @@ void XtraSystemStatusObserver::notify(const list& dlist) } } - inline ~handleOsObserverUpdateMsg() { + inline ~HandleOsObserverUpdateMsg() { for (auto each : mDataItemList) { delete each; } @@ -182,7 +189,7 @@ void XtraSystemStatusObserver::notify(const list& dlist) } } }; - mMsgTask->sendMsg(new (nothrow) handleOsObserverUpdateMsg(this, dlist)); + mMsgTask->sendMsg(new (nothrow) HandleOsObserverUpdateMsg(this, dlist)); } #ifdef USE_GLIB diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index f8d3edde..20d369ce 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -125,6 +125,7 @@ public : bool updateConnectionStatus(bool connected, int32_t type); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); + bool updateXtraThrottle(const bool enabled); inline const MsgTask* getMsgTask() { return mMsgTask; } void subscribe(bool yes); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 1a6dab7b..3e989c97 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -45,6 +45,7 @@ static void stopTracking(LocationAPI* client, uint32_t id); static void gnssNiResponse(LocationAPI* client, uint32_t id, GnssNiResponse response); static uint32_t gnssDeleteAidingData(GnssAidingData& data); +static void gnssUpdateXtraThrottle(const bool enabled); static void setControlCallbacks(LocationControlCallbacks& controlCallbacks); static uint32_t enable(LocationTechnologyType techType); @@ -77,6 +78,7 @@ static const GnssInterface gGnssInterface = { disable, gnssUpdateConfig, gnssDeleteAidingData, + gnssUpdateXtraThrottle, injectLocation, injectTime, agpsInit, @@ -203,6 +205,13 @@ static uint32_t gnssDeleteAidingData(GnssAidingData& data) } } +static void gnssUpdateXtraThrottle(const bool enabled) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->gnssUpdateXtraThrottleCommand(enabled); + } +} + static void injectLocation(double latitude, double longitude, float accuracy) { if (NULL != gGnssAdapter) { diff --git a/location/location_interface.h b/location/location_interface.h index 24116029..27589f71 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -48,6 +48,7 @@ struct GnssInterface { void (*disable)(uint32_t id); uint32_t* (*gnssUpdateConfig)(GnssConfig config); uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); + void (*gnssUpdateXtraThrottle)(const bool enabled); void (*injectLocation)(double latitude, double longitude, float accuracy); void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); void (*agpsInit)(const AgpsCbInfo& cbInfo); From e22e04dbe2d24fddfcd19c432c5f033b5deee189 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sat, 7 Oct 2017 15:19:19 +0530 Subject: [PATCH 578/945] Fix compilation errors in xtra-daemon for LE. Fix compilation errors in xtra-daemon in LE for changes made as part of adding biway IPC communication changes. New files created are added as part of LE Makefile. Change-Id: Ic0f0d60dd85eea38bb47753aea4fccfb3070d64c CRs-Fixed: 2122852 --- utils/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/Makefile.am b/utils/Makefile.am index 33a87dab..b8c4c52d 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -19,6 +19,7 @@ libgps_utils_so_la_h_sources = \ LocHeap.h \ LocThread.h \ LocTimer.h \ + LocIpc.h \ loc_misc_utils.h \ loc_nmea.h \ gps_extended_c.h \ @@ -34,6 +35,7 @@ libgps_utils_so_la_c_sources = \ LocHeap.cpp \ LocTimer.cpp \ LocThread.cpp \ + LocIpc.cpp \ MsgTask.cpp \ loc_misc_utils.cpp \ loc_nmea.cpp From f5f0f29c13570eec19ae03f6888bc12759d9dac2 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 26 Sep 2017 15:19:18 -0700 Subject: [PATCH 579/945] Add storing dataitem in systemstatus report SystemStatus stores incoming dataitem events received from osagent into its internal systemstatus report cache. Change-Id: I129c633b45abfc04c9d9bbbd558db5f6e93c1672 CRs-Fixed: 2093347 --- android/AGnssRil.cpp | 32 +- core/SystemStatus.cpp | 686 +++++++++----------- core/SystemStatus.h | 455 ++++++++----- core/SystemStatusOsObserver.cpp | 12 +- core/SystemStatusOsObserver.h | 6 +- core/data-items/DataItemConcreteTypesBase.h | 15 + 6 files changed, 638 insertions(+), 568 deletions(-) diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index 54bd8a1c..d790bae9 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -29,6 +29,8 @@ #include #include "Gnss.h" #include "AGnssRil.h" +#include + typedef void* (getLocationInterface)(); namespace android { @@ -51,7 +53,35 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool // for XTRA if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { - mGnss->getGnssInterface()->updateConnectionStatus(connected, (int8_t)type); + int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + switch(type) + { + case IAGnssRil::NetworkType::MOBILE: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + break; + case IAGnssRil::NetworkType::WIFI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + break; + case IAGnssRil::NetworkType::MMS: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS; + break; + case IAGnssRil::NetworkType::SUPL: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL; + break; + case IAGnssRil::NetworkType::DUN: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN; + break; + case IAGnssRil::NetworkType::HIPRI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI; + break; + case IAGnssRil::NetworkType::WIMAX: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; + break; + default: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + break; + } + mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); } return true; } diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 275c9deb..8954a719 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -714,7 +714,7 @@ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea { } -bool SystemStatusTimeAndClock::equals(SystemStatusTimeAndClock& peer) +bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer) { if ((mGpsWeek != peer.mGpsWeek) || (mGpsTowMs != peer.mGpsTowMs) || @@ -754,7 +754,7 @@ SystemStatusXoState::SystemStatusXoState(const SystemStatusPQWM1& nmea) : { } -bool SystemStatusXoState::equals(SystemStatusXoState& peer) +bool SystemStatusXoState::equals(const SystemStatusXoState& peer) { if (mXoState != peer.mXoState) { return false; @@ -796,7 +796,7 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea) { } -bool SystemStatusRfAndParams::equals(SystemStatusRfAndParams& peer) +bool SystemStatusRfAndParams::equals(const SystemStatusRfAndParams& peer) { if ((mPgaGain != peer.mPgaGain) || (mGpsBpAmpI != peer.mGpsBpAmpI) || @@ -852,7 +852,7 @@ SystemStatusErrRecovery::SystemStatusErrRecovery(const SystemStatusPQWM1& nmea) { } -bool SystemStatusErrRecovery::equals(SystemStatusErrRecovery& peer) +bool SystemStatusErrRecovery::equals(const SystemStatusErrRecovery& peer) { if (mRecErrorRecovery != peer.mRecErrorRecovery) { return false; @@ -882,7 +882,7 @@ SystemStatusInjectedPosition::SystemStatusInjectedPosition(const SystemStatusPQW { } -bool SystemStatusInjectedPosition::equals(SystemStatusInjectedPosition& peer) +bool SystemStatusInjectedPosition::equals(const SystemStatusInjectedPosition& peer) { if ((mEpiValidity != peer.mEpiValidity) || (mEpiLat != peer.mEpiLat) || @@ -923,7 +923,7 @@ SystemStatusBestPosition::SystemStatusBestPosition(const SystemStatusPQWP2& nmea { } -bool SystemStatusBestPosition::equals(SystemStatusBestPosition& peer) +bool SystemStatusBestPosition::equals(const SystemStatusBestPosition& peer) { if ((mBestLat != peer.mBestLat) || (mBestLon != peer.mBestLon) || @@ -965,7 +965,7 @@ SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) : { } -bool SystemStatusXtra::equals(SystemStatusXtra& peer) +bool SystemStatusXtra::equals(const SystemStatusXtra& peer) { if ((mXtraValidMask != peer.mXtraValidMask) || (mGpsXtraAge != peer.mGpsXtraAge) || @@ -1013,7 +1013,7 @@ SystemStatusEphemeris::SystemStatusEphemeris(const SystemStatusPQWP4& nmea) : { } -bool SystemStatusEphemeris::equals(SystemStatusEphemeris& peer) +bool SystemStatusEphemeris::equals(const SystemStatusEphemeris& peer) { if ((mGpsEpheValid != peer.mGpsEpheValid) || (mGloEpheValid != peer.mGloEpheValid) || @@ -1059,7 +1059,7 @@ SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) : { } -bool SystemStatusSvHealth::equals(SystemStatusSvHealth& peer) +bool SystemStatusSvHealth::equals(const SystemStatusSvHealth& peer) { if ((mGpsUnknownMask != peer.mGpsUnknownMask) || (mGloUnknownMask != peer.mGloUnknownMask) || @@ -1114,7 +1114,7 @@ SystemStatusPdr::SystemStatusPdr(const SystemStatusPQWP6& nmea) : { } -bool SystemStatusPdr::equals(SystemStatusPdr& peer) +bool SystemStatusPdr::equals(const SystemStatusPdr& peer) { if (mFixInfoMask != peer.mFixInfoMask) { return false; @@ -1140,7 +1140,7 @@ SystemStatusNavData::SystemStatusNavData(const SystemStatusPQWP7& nmea) } } -bool SystemStatusNavData::equals(SystemStatusNavData& peer) +bool SystemStatusNavData::equals(const SystemStatusNavData& peer) { for (uint32_t i=0; i maxTimeAndClock) { - mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin()); - } - } - return true; -} - -bool SystemStatus::setXoState(const SystemStatusPQWM1& nmea) -{ - SystemStatusXoState s(nmea); - if (!mCache.mXoState.empty() && mCache.mXoState.back().equals(s)) { - mCache.mXoState.back().mUtcReported = s.mUtcReported; - } else { - mCache.mXoState.push_back(s); - if (mCache.mXoState.size() > maxXoState) { - mCache.mXoState.erase(mCache.mXoState.begin()); - } - } - return true; -} - -bool SystemStatus::setRfAndParams(const SystemStatusPQWM1& nmea) -{ - SystemStatusRfAndParams s(nmea); - if (!mCache.mRfAndParams.empty() && mCache.mRfAndParams.back().equals(s)) { - mCache.mRfAndParams.back().mUtcReported = s.mUtcReported; - } else { - mCache.mRfAndParams.push_back(s); - if (mCache.mRfAndParams.size() > maxRfAndParams) { - mCache.mRfAndParams.erase(mCache.mRfAndParams.begin()); - } - } - return true; -} - -bool SystemStatus::setErrRecovery(const SystemStatusPQWM1& nmea) -{ - SystemStatusErrRecovery s(nmea); - if (!mCache.mErrRecovery.empty() && mCache.mErrRecovery.back().equals(s)) { - mCache.mErrRecovery.back().mUtcReported = s.mUtcReported; - } else { - mCache.mErrRecovery.push_back(s); - if (mCache.mErrRecovery.size() > maxErrRecovery) { - mCache.mErrRecovery.erase(mCache.mErrRecovery.begin()); - } - } - return true; -} - -/****************************************************************************** - SystemStatus - Px functions -******************************************************************************/ -bool SystemStatus::setInjectedPosition(const SystemStatusPQWP1& nmea) -{ - SystemStatusInjectedPosition s(nmea); - if (!mCache.mInjectedPosition.empty() && mCache.mInjectedPosition.back().equals(s)) { - mCache.mInjectedPosition.back().mUtcReported = s.mUtcReported; - } else { - mCache.mInjectedPosition.push_back(s); - if (mCache.mInjectedPosition.size() > maxInjectedPosition) { - mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin()); - } - } - return true; -} - -bool SystemStatus::setBestPosition(const SystemStatusPQWP2& nmea) -{ - SystemStatusBestPosition s(nmea); - if (!mCache.mBestPosition.empty() && mCache.mBestPosition.back().equals(s)) { - mCache.mBestPosition.back().mUtcReported = s.mUtcReported; - } else { - mCache.mBestPosition.push_back(s); - if (mCache.mBestPosition.size() > maxBestPosition) { - mCache.mBestPosition.erase(mCache.mBestPosition.begin()); - } - } - return true; -} - -bool SystemStatus::setXtra(const SystemStatusPQWP3& nmea) -{ - SystemStatusXtra s(nmea); - if (!mCache.mXtra.empty() && mCache.mXtra.back().equals(s)) { - mCache.mXtra.back().mUtcReported = s.mUtcReported; - } else { - mCache.mXtra.push_back(s); - if (mCache.mXtra.size() > maxXtra) { - mCache.mXtra.erase(mCache.mXtra.begin()); - } - } - return true; -} - -bool SystemStatus::setEphemeris(const SystemStatusPQWP4& nmea) -{ - SystemStatusEphemeris s(nmea); - if (!mCache.mEphemeris.empty() && mCache.mEphemeris.back().equals(s)) { - mCache.mEphemeris.back().mUtcReported = s.mUtcReported; - } else { - mCache.mEphemeris.push_back(s); - if (mCache.mEphemeris.size() > maxEphemeris) { - mCache.mEphemeris.erase(mCache.mEphemeris.begin()); - } - } - return true; -} - -bool SystemStatus::setSvHealth(const SystemStatusPQWP5& nmea) -{ - SystemStatusSvHealth s(nmea); - if (!mCache.mSvHealth.empty() && mCache.mSvHealth.back().equals(s)) { - mCache.mSvHealth.back().mUtcReported = s.mUtcReported; - } else { - mCache.mSvHealth.push_back(s); - if (mCache.mSvHealth.size() > maxSvHealth) { - mCache.mSvHealth.erase(mCache.mSvHealth.begin()); - } - } - return true; -} - -bool SystemStatus::setPdr(const SystemStatusPQWP6& nmea) -{ - SystemStatusPdr s(nmea); - if (!mCache.mPdr.empty() && mCache.mPdr.back().equals(s)) { - mCache.mPdr.back().mUtcReported = s.mUtcReported; - } else { - mCache.mPdr.push_back(s); - if (mCache.mPdr.size() > maxPdr) { - mCache.mPdr.erase(mCache.mPdr.begin()); - } - } - return true; -} - -bool SystemStatus::setNavData(const SystemStatusPQWP7& nmea) -{ - SystemStatusNavData s(nmea); - if (!mCache.mNavData.empty() && mCache.mNavData.back().equals(s)) { - mCache.mNavData.back().mUtcReported = s.mUtcReported; - } else { - mCache.mNavData.push_back(s); - if (mCache.mNavData.size() > maxNavData) { - mCache.mNavData.erase(mCache.mNavData.begin()); - } - } - return true; -} - -/****************************************************************************** - SystemStatus - Sx functions -******************************************************************************/ -bool SystemStatus::setPositionFailure(const SystemStatusPQWS1& nmea) -{ - SystemStatusPositionFailure s(nmea); - if (!mCache.mPositionFailure.empty() && mCache.mPositionFailure.back().equals(s)) { - mCache.mPositionFailure.back().mUtcReported = s.mUtcReported; - } else { - mCache.mPositionFailure.push_back(s); - if (mCache.mPositionFailure.size() > maxPositionFailure) { - mCache.mPositionFailure.erase(mCache.mPositionFailure.begin()); - } - } - return true; -} - /****************************************************************************** SystemStatus - storing dataitems ******************************************************************************/ -bool SystemStatus::setNetworkInfo(IDataItemCore* dataitem) +bool SystemStatus::setNetworkInfo(const SystemStatusNetworkInfo& s) { - NetworkInfoDataItemBase* data = reinterpret_cast(dataitem); - SystemStatusNetworkInfo s(data->mType,data->mTypeName,data->mSubTypeName, - data->mAvailable,data->mConnected,data->mRoaming); - s.dump(); - mConnected = data->mConnected; + mConnected = s.mConnected; + SystemStatusNetworkInfo sout = s; + sout.mType = s.getType(); + return setIteminReport(mCache.mNetworkInfo, sout); +} - if (!mCache.mNetworkInfo.empty() && mCache.mNetworkInfo.back().equals(s)) { - mCache.mNetworkInfo.back().mUtcReported = s.mUtcReported; - } else { - mCache.mNetworkInfo.push_back(s); - if (mCache.mNetworkInfo.size() > maxNetworkInfo) { - mCache.mNetworkInfo.erase(mCache.mNetworkInfo.begin()); - } +template +bool SystemStatus::setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s) +{ + if (!report.empty() && report.back().equals(s)) { + // there is no change - just update reported timestamp + report.back().mUtcReported = s.mUtcReported; + return false; + } + + // first event or updated + report.push_back(s); + if (report.size() > s.maxItem) { + report.erase(report.begin()); } return true; } +template +void SystemStatus::setDefaultIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s) +{ + report.push_back(s); + if (report.size() > s.maxItem) { + report.erase(report.begin()); + } +} + +template +void SystemStatus::getIteminReport(TYPE_REPORT& reportout, const TYPE_ITEM& c) const +{ + reportout.clear(); + if (c.size() >= 1) { + reportout.push_back(c.back()); + reportout.back().dump(); + } +} + /****************************************************************************** @brief API to set report data into internal buffer @@ -1482,17 +1353,6 @@ bool SystemStatus::setNetworkInfo(IDataItemCore* dataitem) @return true when successfully done ******************************************************************************/ -static uint32_t cnt = 0; -static uint32_t cnt_m1 = 0; -static uint32_t cnt_p1 = 0; -static uint32_t cnt_p2 = 0; -static uint32_t cnt_p3 = 0; -static uint32_t cnt_p4 = 0; -static uint32_t cnt_p5 = 0; -static uint32_t cnt_p6 = 0; -static uint32_t cnt_p7 = 0; -static uint32_t cnt_s1 = 0; - bool SystemStatus::setNmeaString(const char *data, uint32_t len) { bool ret = false; @@ -1508,59 +1368,46 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) // parse the received nmea strings here if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) { SystemStatusPQWM1 s = SystemStatusPQWM1parser(buf, len).get(); - ret = setTimeAndCLock(s); - ret |= setXoState(s); - ret |= setRfAndParams(s); - ret |= setErrRecovery(s); - cnt_m1++; + ret |= setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s)); + ret |= setIteminReport(mCache.mXoState, SystemStatusXoState(s)); + ret |= setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s)); + ret |= setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s)); } else if (0 == strncmp(data, "$PQWP1", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setInjectedPosition(SystemStatusPQWP1parser(buf, len).get()); - cnt_p1++; + ret = setIteminReport(mCache.mInjectedPosition, + SystemStatusInjectedPosition(SystemStatusPQWP1parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP2", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setBestPosition(SystemStatusPQWP2parser(buf, len).get()); - cnt_p2++; + ret = setIteminReport(mCache.mBestPosition, + SystemStatusBestPosition(SystemStatusPQWP2parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP3", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setXtra(SystemStatusPQWP3parser(buf, len).get()); - cnt_p3++; + ret = setIteminReport(mCache.mXtra, + SystemStatusXtra(SystemStatusPQWP3parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP4", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setEphemeris(SystemStatusPQWP4parser(buf, len).get()); - cnt_p4++; + ret = setIteminReport(mCache.mEphemeris, + SystemStatusEphemeris(SystemStatusPQWP4parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP5", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setSvHealth(SystemStatusPQWP5parser(buf, len).get()); - cnt_p5++; + ret = setIteminReport(mCache.mSvHealth, + SystemStatusSvHealth(SystemStatusPQWP5parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP6", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setPdr(SystemStatusPQWP6parser(buf, len).get()); - cnt_p6++; + ret = setIteminReport(mCache.mPdr, + SystemStatusPdr(SystemStatusPQWP6parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP7", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setNavData(SystemStatusPQWP7parser(buf, len).get()); - cnt_p7++; + ret = setIteminReport(mCache.mNavData, + SystemStatusNavData(SystemStatusPQWP7parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWS1", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setPositionFailure(SystemStatusPQWS1parser(buf, len).get()); - cnt_s1++; + ret = setIteminReport(mCache.mPositionFailure, + SystemStatusPositionFailure(SystemStatusPQWS1parser(buf, len).get())); } else { // do nothing } - cnt++; - LOC_LOGV("setNmeaString: cnt=%d M:%d 1:%d 2:%d 3:%d 4:%d 5:%d 6:%d 7:%d S:%d", - cnt, - cnt_m1, - cnt_p1, - cnt_p2, - cnt_p3, - cnt_p4, - cnt_p5, - cnt_p6, - cnt_p7, - cnt_s1); pthread_mutex_unlock(&mMutexSystemStatus); return ret; @@ -1576,22 +1423,18 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) bool SystemStatus::eventPosition(const UlpLocation& location, const GpsLocationExtended& locationEx) { - SystemStatusLocation s(location, locationEx); - if (!mCache.mLocation.empty() && mCache.mLocation.back().equals(s)) { - mCache.mLocation.back().mUtcReported = s.mUtcReported; - } - else { - mCache.mLocation.push_back(s); - if (mCache.mLocation.size() > maxLocation) { - mCache.mLocation.erase(mCache.mLocation.begin()); - } - } + bool ret = false; + pthread_mutex_lock(&mMutexSystemStatus); + + ret = setIteminReport(mCache.mLocation, SystemStatusLocation(location, locationEx)); LOC_LOGV("eventPosition - lat=%f lon=%f alt=%f speed=%f", - s.mLocation.gpsLocation.latitude, - s.mLocation.gpsLocation.longitude, - s.mLocation.gpsLocation.altitude, - s.mLocation.gpsLocation.speed); - return true; + location.gpsLocation.latitude, + location.gpsLocation.longitude, + location.gpsLocation.altitude, + location.gpsLocation.speed); + + pthread_mutex_unlock(&mMutexSystemStatus); + return ret; } /****************************************************************************** @@ -1599,19 +1442,108 @@ bool SystemStatus::eventPosition(const UlpLocation& location, @param[In] DataItem -@return true when successfully done +@return true when info is updatated ******************************************************************************/ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) { + bool ret = false; pthread_mutex_lock(&mMutexSystemStatus); switch(dataitem->getId()) { + case AIRPLANEMODE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mAirplaneMode, + *(static_cast(dataitem))); + break; + case ENH_DATA_ITEM_ID: + ret = setIteminReport(mCache.mENH, + *(static_cast(dataitem))); + break; + case GPSSTATE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mGPSState, + *(static_cast(dataitem))); + break; + case NLPSTATUS_DATA_ITEM_ID: + ret = setIteminReport(mCache.mNLPStatus, + *(static_cast(dataitem))); + break; + case WIFIHARDWARESTATE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mWifiHardwareState, + *(static_cast(dataitem))); + break; case NETWORKINFO_DATA_ITEM_ID: - setNetworkInfo(dataitem); + // need special handling for this item to map emums + ret = setNetworkInfo( + *(static_cast(dataitem))); + break; + case RILSERVICEINFO_DATA_ITEM_ID: + ret = setIteminReport(mCache.mRilServiceInfo, + *(static_cast(dataitem))); + break; + case RILCELLINFO_DATA_ITEM_ID: + ret = setIteminReport(mCache.mRilCellInfo, + *(static_cast(dataitem))); + break; + case SERVICESTATUS_DATA_ITEM_ID: + ret = setIteminReport(mCache.mServiceStatus, + *(static_cast(dataitem))); + break; + case MODEL_DATA_ITEM_ID: + ret = setIteminReport(mCache.mModel, + *(static_cast(dataitem))); + break; + case MANUFACTURER_DATA_ITEM_ID: + ret = setIteminReport(mCache.mManufacturer, + *(static_cast(dataitem))); + break; + case ASSISTED_GPS_DATA_ITEM_ID: + ret = setIteminReport(mCache.mAssistedGps, + *(static_cast(dataitem))); + break; + case SCREEN_STATE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mScreenState, + *(static_cast(dataitem))); + break; + case POWER_CONNECTED_STATE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mPowerConnectState, + *(static_cast(dataitem))); + break; + case TIMEZONE_CHANGE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mTimeZoneChange, + *(static_cast(dataitem))); + break; + case TIME_CHANGE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mTimeChange, + *(static_cast(dataitem))); + break; + case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID: + ret = setIteminReport(mCache.mWifiSupplicantStatus, + *(static_cast(dataitem))); + break; + case SHUTDOWN_STATE_DATA_ITEM_ID: + ret = setIteminReport(mCache.mShutdownState, + *(static_cast(dataitem))); + break; + case TAC_DATA_ITEM_ID: + ret = setIteminReport(mCache.mTac, + *(static_cast(dataitem))); + break; + case MCCMNC_DATA_ITEM_ID: + ret = setIteminReport(mCache.mMccMnc, + *(static_cast(dataitem))); + break; + case BTLE_SCAN_DATA_ITEM_ID: + ret = setIteminReport(mCache.mBtDeviceScanDetail, + *(static_cast(dataitem))); + break; + case BT_SCAN_DATA_ITEM_ID: + ret = setIteminReport(mCache.mBtLeDeviceScanDetail, + *(static_cast(dataitem))); + break; + default: break; } pthread_mutex_unlock(&mMutexSystemStatus); - return true; + return ret; } /****************************************************************************** @@ -1628,74 +1560,45 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con if (isLatestOnly) { // push back only the latest report and return it - report.mLocation.clear(); - if (mCache.mLocation.size() >= 1) { - report.mLocation.push_back(mCache.mLocation.back()); - report.mLocation.back().dump(); - } + getIteminReport(report.mLocation, mCache.mLocation); - report.mTimeAndClock.clear(); - if (mCache.mTimeAndClock.size() >= 1) { - report.mTimeAndClock.push_back(mCache.mTimeAndClock.back()); - report.mTimeAndClock.back().dump(); - } - report.mXoState.clear(); - if (mCache.mXoState.size() >= 1) { - report.mXoState.push_back(mCache.mXoState.back()); - report.mXoState.back().dump(); - } - report.mRfAndParams.clear(); - if (mCache.mRfAndParams.size() >= 1) { - report.mRfAndParams.push_back(mCache.mRfAndParams.back()); - report.mRfAndParams.back().dump(); - } - report.mErrRecovery.clear(); - if (mCache.mErrRecovery.size() >= 1) { - report.mErrRecovery.push_back(mCache.mErrRecovery.back()); - report.mErrRecovery.back().dump(); - } + getIteminReport(report.mTimeAndClock, mCache.mTimeAndClock); + getIteminReport(report.mXoState, mCache.mXoState); + getIteminReport(report.mRfAndParams, mCache.mRfAndParams); + getIteminReport(report.mErrRecovery, mCache.mErrRecovery); - report.mInjectedPosition.clear(); - if (mCache.mInjectedPosition.size() >= 1) { - report.mInjectedPosition.push_back(mCache.mInjectedPosition.back()); - report.mInjectedPosition.back().dump(); - } - report.mBestPosition.clear(); - if (mCache.mBestPosition.size() >= 1) { - report.mBestPosition.push_back(mCache.mBestPosition.back()); - report.mBestPosition.back().dump(); - } - report.mXtra.clear(); - if (mCache.mXtra.size() >= 1) { - report.mXtra.push_back(mCache.mXtra.back()); - report.mXtra.back().dump(); - } - report.mEphemeris.clear(); - if (mCache.mEphemeris.size() >= 1) { - report.mEphemeris.push_back(mCache.mEphemeris.back()); - report.mEphemeris.back().dump(); - } - report.mSvHealth.clear(); - if (mCache.mSvHealth.size() >= 1) { - report.mSvHealth.push_back(mCache.mSvHealth.back()); - report.mSvHealth.back().dump(); - } - report.mPdr.clear(); - if (mCache.mPdr.size() >= 1) { - report.mPdr.push_back(mCache.mPdr.back()); - report.mPdr.back().dump(); - } - report.mNavData.clear(); - if (mCache.mNavData.size() >= 1) { - report.mNavData.push_back(mCache.mNavData.back()); - report.mNavData.back().dump(); - } + getIteminReport(report.mInjectedPosition, mCache.mInjectedPosition); + getIteminReport(report.mBestPosition, mCache.mBestPosition); + getIteminReport(report.mXtra, mCache.mXtra); + getIteminReport(report.mEphemeris, mCache.mEphemeris); + getIteminReport(report.mSvHealth, mCache.mSvHealth); + getIteminReport(report.mPdr, mCache.mPdr); + getIteminReport(report.mNavData, mCache.mNavData); - report.mPositionFailure.clear(); - if (mCache.mPositionFailure.size() >= 1) { - report.mPositionFailure.push_back(mCache.mPositionFailure.back()); - report.mPositionFailure.back().dump(); - } + getIteminReport(report.mPositionFailure, mCache.mPositionFailure); + + getIteminReport(report.mAirplaneMode, mCache.mAirplaneMode); + getIteminReport(report.mENH, mCache.mENH); + getIteminReport(report.mGPSState, mCache.mGPSState); + getIteminReport(report.mNLPStatus, mCache.mNLPStatus); + getIteminReport(report.mWifiHardwareState, mCache.mWifiHardwareState); + getIteminReport(report.mNetworkInfo, mCache.mNetworkInfo); + getIteminReport(report.mRilServiceInfo, mCache.mRilServiceInfo); + getIteminReport(report.mRilCellInfo, mCache.mRilCellInfo); + getIteminReport(report.mServiceStatus, mCache.mServiceStatus); + getIteminReport(report.mModel, mCache.mModel); + getIteminReport(report.mManufacturer, mCache.mManufacturer); + getIteminReport(report.mAssistedGps, mCache.mAssistedGps); + getIteminReport(report.mScreenState, mCache.mScreenState); + getIteminReport(report.mPowerConnectState, mCache.mPowerConnectState); + getIteminReport(report.mTimeZoneChange, mCache.mTimeZoneChange); + getIteminReport(report.mTimeChange, mCache.mTimeChange); + getIteminReport(report.mWifiSupplicantStatus, mCache.mWifiSupplicantStatus); + getIteminReport(report.mShutdownState, mCache.mShutdownState); + getIteminReport(report.mTac, mCache.mTac); + getIteminReport(report.mMccMnc, mCache.mMccMnc); + getIteminReport(report.mBtDeviceScanDetail, mCache.mBtDeviceScanDetail); + getIteminReport(report.mBtLeDeviceScanDetail, mCache.mBtLeDeviceScanDetail); } else { // copy entire reports and return them @@ -1715,6 +1618,30 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con report.mNavData.clear(); report.mPositionFailure.clear(); + + report.mAirplaneMode.clear(); + report.mENH.clear(); + report.mGPSState.clear(); + report.mNLPStatus.clear(); + report.mWifiHardwareState.clear(); + report.mNetworkInfo.clear(); + report.mRilServiceInfo.clear(); + report.mRilCellInfo.clear(); + report.mServiceStatus.clear(); + report.mModel.clear(); + report.mManufacturer.clear(); + report.mAssistedGps.clear(); + report.mScreenState.clear(); + report.mPowerConnectState.clear(); + report.mTimeZoneChange.clear(); + report.mTimeChange.clear(); + report.mWifiSupplicantStatus.clear(); + report.mShutdownState.clear(); + report.mTac.clear(); + report.mMccMnc.clear(); + report.mBtDeviceScanDetail.clear(); + report.mBtLeDeviceScanDetail.clear(); + report = mCache; } @@ -1733,61 +1660,45 @@ bool SystemStatus::setDefaultReport(void) { pthread_mutex_lock(&mMutexSystemStatus); - mCache.mLocation.push_back(SystemStatusLocation()); - if (mCache.mLocation.size() > maxLocation) { - mCache.mLocation.erase(mCache.mLocation.begin()); - } + setDefaultIteminReport(mCache.mLocation, SystemStatusLocation()); - mCache.mTimeAndClock.push_back(SystemStatusTimeAndClock()); - if (mCache.mTimeAndClock.size() > maxTimeAndClock) { - mCache.mTimeAndClock.erase(mCache.mTimeAndClock.begin()); - } - mCache.mXoState.push_back(SystemStatusXoState()); - if (mCache.mXoState.size() > maxXoState) { - mCache.mXoState.erase(mCache.mXoState.begin()); - } - mCache.mRfAndParams.push_back(SystemStatusRfAndParams()); - if (mCache.mRfAndParams.size() > maxRfAndParams) { - mCache.mRfAndParams.erase(mCache.mRfAndParams.begin()); - } - mCache.mErrRecovery.push_back(SystemStatusErrRecovery()); - if (mCache.mErrRecovery.size() > maxErrRecovery) { - mCache.mErrRecovery.erase(mCache.mErrRecovery.begin()); - } + setDefaultIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock()); + setDefaultIteminReport(mCache.mXoState, SystemStatusXoState()); + setDefaultIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams()); + setDefaultIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery()); - mCache.mInjectedPosition.push_back(SystemStatusInjectedPosition()); - if (mCache.mInjectedPosition.size() > maxInjectedPosition) { - mCache.mInjectedPosition.erase(mCache.mInjectedPosition.begin()); - } - mCache.mBestPosition.push_back(SystemStatusBestPosition()); - if (mCache.mBestPosition.size() > maxBestPosition) { - mCache.mBestPosition.erase(mCache.mBestPosition.begin()); - } - mCache.mXtra.push_back(SystemStatusXtra()); - if (mCache.mXtra.size() > maxXtra) { - mCache.mXtra.erase(mCache.mXtra.begin()); - } - mCache.mEphemeris.push_back(SystemStatusEphemeris()); - if (mCache.mEphemeris.size() > maxEphemeris) { - mCache.mEphemeris.erase(mCache.mEphemeris.begin()); - } - mCache.mSvHealth.push_back(SystemStatusSvHealth()); - if (mCache.mSvHealth.size() > maxSvHealth) { - mCache.mSvHealth.erase(mCache.mSvHealth.begin()); - } - mCache.mPdr.push_back(SystemStatusPdr()); - if (mCache.mPdr.size() > maxPdr) { - mCache.mPdr.erase(mCache.mPdr.begin()); - } - mCache.mNavData.push_back(SystemStatusNavData()); - if (mCache.mNavData.size() > maxNavData) { - mCache.mNavData.erase(mCache.mNavData.begin()); - } + setDefaultIteminReport(mCache.mInjectedPosition, SystemStatusInjectedPosition()); + setDefaultIteminReport(mCache.mBestPosition, SystemStatusBestPosition()); + setDefaultIteminReport(mCache.mXtra, SystemStatusXtra()); + setDefaultIteminReport(mCache.mEphemeris, SystemStatusEphemeris()); + setDefaultIteminReport(mCache.mSvHealth, SystemStatusSvHealth()); + setDefaultIteminReport(mCache.mPdr, SystemStatusPdr()); + setDefaultIteminReport(mCache.mNavData, SystemStatusNavData()); - mCache.mPositionFailure.push_back(SystemStatusPositionFailure()); - if (mCache.mPositionFailure.size() > maxPositionFailure) { - mCache.mPositionFailure.erase(mCache.mPositionFailure.begin()); - } + setDefaultIteminReport(mCache.mPositionFailure, SystemStatusPositionFailure()); + + setDefaultIteminReport(mCache.mAirplaneMode, SystemStatusAirplaneMode()); + setDefaultIteminReport(mCache.mENH, SystemStatusENH()); + setDefaultIteminReport(mCache.mGPSState, SystemStatusGpsState()); + setDefaultIteminReport(mCache.mNLPStatus, SystemStatusNLPStatus()); + setDefaultIteminReport(mCache.mWifiHardwareState, SystemStatusWifiHardwareState()); + setDefaultIteminReport(mCache.mNetworkInfo, SystemStatusNetworkInfo()); + setDefaultIteminReport(mCache.mRilServiceInfo, SystemStatusServiceInfo()); + setDefaultIteminReport(mCache.mRilCellInfo, SystemStatusRilCellInfo()); + setDefaultIteminReport(mCache.mServiceStatus, SystemStatusServiceStatus()); + setDefaultIteminReport(mCache.mModel, SystemStatusModel()); + setDefaultIteminReport(mCache.mManufacturer, SystemStatusManufacturer()); + setDefaultIteminReport(mCache.mAssistedGps, SystemStatusAssistedGps()); + setDefaultIteminReport(mCache.mScreenState, SystemStatusScreenState()); + setDefaultIteminReport(mCache.mPowerConnectState, SystemStatusPowerConnectState()); + setDefaultIteminReport(mCache.mTimeZoneChange, SystemStatusTimeZoneChange()); + setDefaultIteminReport(mCache.mTimeChange, SystemStatusTimeChange()); + setDefaultIteminReport(mCache.mWifiSupplicantStatus, SystemStatusWifiSupplicantStatus()); + setDefaultIteminReport(mCache.mShutdownState, SystemStatusShutdownState()); + setDefaultIteminReport(mCache.mTac, SystemStatusTac()); + setDefaultIteminReport(mCache.mMccMnc, SystemStatusMccMnc()); + setDefaultIteminReport(mCache.mBtDeviceScanDetail, SystemStatusBtDeviceScanDetail()); + setDefaultIteminReport(mCache.mBtLeDeviceScanDetail, SystemStatusBtleDeviceScanDetail()); pthread_mutex_unlock(&mMutexSystemStatus); return true; @@ -1807,15 +1718,8 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) // send networkinof dataitem to systemstatus observer clients SystemStatusNetworkInfo s(type, "", "", false, connected, false); - IDataItemCore *networkinfo = - DataItemsFactoryProxy::createNewDataItem(NETWORKINFO_DATA_ITEM_ID); - if (nullptr == networkinfo) { - LOC_LOGE("Unable to create dataitemd"); - return false; - } - networkinfo->copy(&s); list dl(0); - dl.push_back(networkinfo); + dl.push_back(&s); mSysStatusObsvr.notify(dl); } return true; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 9ee85d3f..0c9b4b9d 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,7 @@ class SystemStatusItemBase public: timespec mUtcTime; // UTC timestamp when this info was last updated timespec mUtcReported; // UTC timestamp when this info was reported + static const uint32_t maxItem = 5; SystemStatusItemBase() { timeval tv; @@ -91,7 +93,7 @@ public: mValid(true), mLocation(location), mLocationEx(locationEx) { } - bool equals(SystemStatusLocation& peer); + bool equals(const SystemStatusLocation& peer); void dump(void); }; @@ -119,7 +121,7 @@ public: mLeapSeconds(0), mLeapSecUnc(0) {} inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); - bool equals(SystemStatusTimeAndClock& peer); + bool equals(const SystemStatusTimeAndClock& peer); void dump(void); }; @@ -130,7 +132,7 @@ public: inline SystemStatusXoState() : mXoState(0) {} inline SystemStatusXoState(const SystemStatusPQWM1& nmea); - bool equals(SystemStatusXoState& peer); + bool equals(const SystemStatusXoState& peer); void dump(void); }; @@ -177,7 +179,7 @@ public: mGalBpAmpI(0), mGalBpAmpQ(0) {} inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); - bool equals(SystemStatusRfAndParams& peer); + bool equals(const SystemStatusRfAndParams& peer); void dump(void); }; @@ -188,7 +190,7 @@ public: inline SystemStatusErrRecovery() : mRecErrorRecovery(0) {}; inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea); - bool equals(SystemStatusErrRecovery& peer); + bool equals(const SystemStatusErrRecovery& peer); void dump(void); }; @@ -212,7 +214,7 @@ public: mEpiAltUnc(0), mEpiSrc(0) {} inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea); - bool equals(SystemStatusInjectedPosition& peer); + bool equals(const SystemStatusInjectedPosition& peer); void dump(void); }; @@ -234,7 +236,7 @@ public: mBestHepe(0), mBestAltUnc(0) {} inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea); - bool equals(SystemStatusBestPosition& peer); + bool equals(const SystemStatusBestPosition& peer); void dump(void); }; @@ -266,7 +268,7 @@ public: mGalXtraValid(0ULL), mQzssXtraValid(0) {} inline SystemStatusXtra(const SystemStatusPQWP3& nmea); - bool equals(SystemStatusXtra& peer); + bool equals(const SystemStatusXtra& peer); void dump(void); }; @@ -286,7 +288,7 @@ public: mGalEpheValid(0ULL), mQzssEpheValid(0) {} inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea); - bool equals(SystemStatusEphemeris& peer); + bool equals(const SystemStatusEphemeris& peer); void dump(void); }; @@ -326,7 +328,7 @@ public: mGalBadMask(0ULL), mQzssBadMask(0) {} inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea); - bool equals(SystemStatusSvHealth& peer); + bool equals(const SystemStatusSvHealth& peer); void dump(void); }; @@ -338,7 +340,7 @@ public: inline SystemStatusPdr() : mFixInfoMask(0) {} inline SystemStatusPdr(const SystemStatusPQWP6& nmea); - bool equals(SystemStatusPdr& peer); + bool equals(const SystemStatusPdr& peer); void dump(void); }; @@ -362,7 +364,7 @@ public: } } inline SystemStatusNavData(const SystemStatusPQWP7& nmea); - bool equals(SystemStatusNavData& peer); + bool equals(const SystemStatusNavData& peer); void dump(void); }; @@ -376,168 +378,294 @@ public: mFixInfoMask(0), mHepeLimit(0) {} inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea); - bool equals(SystemStatusPositionFailure& peer); + bool equals(const SystemStatusPositionFailure& peer); void dump(void); }; /****************************************************************************** SystemStatus report data structure - from DataItem observer ******************************************************************************/ -class SystemStatusGpsState : public SystemStatusItemBase, public IDataItemCore +class SystemStatusAirplaneMode : public SystemStatusItemBase, + public AirplaneModeDataItemBase { public: - inline SystemStatusGpsState() : - mEnabled(false) {} - inline SystemStatusGpsState(bool enabled) : - mEnabled(enabled) {} + inline SystemStatusAirplaneMode(bool mode=false) : + AirplaneModeDataItemBase(mode) {} + inline bool equals(const SystemStatusAirplaneMode& peer) { + return (mMode == peer.mMode); + } +}; - bool mEnabled; - - inline bool equals(SystemStatusGpsState& peer) { +class SystemStatusENH : public SystemStatusItemBase, + public ENHDataItemBase +{ +public: + inline SystemStatusENH(bool enabled=false) : + ENHDataItemBase(enabled) {} + inline bool equals(const SystemStatusENH& peer) { return (mEnabled == peer.mEnabled); } - inline void dump(void) { +}; + +class SystemStatusGpsState : public SystemStatusItemBase, + public GPSStateDataItemBase +{ +public: + inline SystemStatusGpsState(bool enabled=false) : + GPSStateDataItemBase(enabled) {} + inline bool equals(const SystemStatusGpsState& peer) { + return (mEnabled == peer.mEnabled); + } + inline void dump(void) override { LOC_LOGD("GpsState: state=%u", mEnabled); } - inline DataItemId getId() { - return GPSSTATE_DATA_ITEM_ID; - } - inline void stringify(string& valueStr) { - valueStr.clear(); - valueStr += "GpsState: enabled="; - valueStr += to_string(mEnabled); - } - inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { - SystemStatusGpsState* gpsstate = static_cast(src); - mEnabled = gpsstate->mEnabled; - if (dataItemCopied) { - *dataItemCopied = true; - } - return 1; +}; + +class SystemStatusNLPStatus : public SystemStatusItemBase, + public NLPStatusDataItemBase +{ +public: + inline SystemStatusNLPStatus(bool enabled=false) : + NLPStatusDataItemBase(enabled) {} + inline bool equals(const SystemStatusNLPStatus& peer) { + return (mEnabled == peer.mEnabled); } }; -class SystemStatusNetworkInfo : public SystemStatusItemBase, public IDataItemCore +class SystemStatusWifiHardwareState : public SystemStatusItemBase, + public WifiHardwareStateDataItemBase +{ +public: + inline SystemStatusWifiHardwareState(bool enabled=false) : + WifiHardwareStateDataItemBase(enabled) {} + inline bool equals(const SystemStatusWifiHardwareState& peer) { + return (mEnabled == peer.mEnabled); + } +}; + +class SystemStatusNetworkInfo : public SystemStatusItemBase, + public NetworkInfoDataItemBase { public: - inline SystemStatusNetworkInfo() : - mType(0), - mTypeName(""), - mSubTypeName(""), - mAvailable(false), - mConnected(false), - mRoaming(false) {} inline SystemStatusNetworkInfo( - int32_t type, - std::string typeName, - std::string subTypeName, - bool available, - bool connected, - bool roaming) : - mType(type), - mTypeName(typeName), - mSubTypeName(subTypeName), - mAvailable(available), - mConnected(connected), - mRoaming(roaming) {} - - int32_t mType; - std::string mTypeName; - std::string mSubTypeName; - bool mAvailable; - bool mConnected; - bool mRoaming; - - inline bool equals(SystemStatusNetworkInfo& peer) { - if ((mType != peer.mType) || - (mTypeName != peer.mTypeName) || - (mSubTypeName != peer.mSubTypeName) || - (mAvailable != peer.mAvailable) || - (mConnected != peer.mConnected) || - (mRoaming != peer.mRoaming)) { + int32_t type=0, + std::string typeName="", + string subTypeName="", + bool available=false, + bool connected=false, + bool roaming=false) : + NetworkInfoDataItemBase( + type, + typeName, + subTypeName, + available, + connected, + roaming) {} + inline bool equals(const SystemStatusNetworkInfo& peer) { + if ((mType == peer.mType) && + (mTypeName == peer.mTypeName) && + (mSubTypeName == peer.mSubTypeName) && + (mAvailable == peer.mAvailable) && + (mConnected == peer.mConnected) && + (mRoaming == peer.mRoaming)) { + return true; + } return false; } - return true; - } - inline void dump(void) { + inline void dump(void) override { LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); } - inline DataItemId getId() { - return NETWORKINFO_DATA_ITEM_ID; - } - inline void stringify(string& /*valueStr*/) { } - inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { - SystemStatusNetworkInfo* networkinfo = static_cast(src); - mType = networkinfo->mType; - mTypeName = networkinfo->mTypeName; - mSubTypeName = networkinfo->mSubTypeName; - mAvailable = networkinfo->mAvailable; - mConnected = networkinfo->mConnected; - mRoaming = networkinfo->mRoaming; - if (dataItemCopied) { - *dataItemCopied = true; - } - return 1; - } }; -class SystemStatusTac : public SystemStatusItemBase, public IDataItemCore +class SystemStatusServiceInfo : public SystemStatusItemBase, + public RilServiceInfoDataItemBase { public: - inline SystemStatusTac() : - mValue("") {} - inline SystemStatusTac(std::string value) : - mValue(value) {} + inline SystemStatusServiceInfo() : + RilServiceInfoDataItemBase() {} + inline bool equals(const SystemStatusServiceInfo& /*peer*/) { + return true; + } +}; - std::string mValue; +class SystemStatusRilCellInfo : public SystemStatusItemBase, + public RilCellInfoDataItemBase +{ +public: + inline SystemStatusRilCellInfo() : + RilCellInfoDataItemBase() {} + inline bool equals(const SystemStatusRilCellInfo& /*peer*/) { + return true; + } +}; - inline bool equals(SystemStatusTac& peer) { +class SystemStatusServiceStatus : public SystemStatusItemBase, + public ServiceStatusDataItemBase +{ +public: + inline SystemStatusServiceStatus(int32_t mServiceState=0) : + ServiceStatusDataItemBase(mServiceState) {} + inline bool equals(const SystemStatusServiceStatus& peer) { + return (mServiceState == peer.mServiceState); + } +}; + +class SystemStatusModel : public SystemStatusItemBase, + public ModelDataItemBase +{ +public: + inline SystemStatusModel(string name="") : + ModelDataItemBase(name) {} + inline bool equals(const SystemStatusModel& peer) { + return (mModel == peer.mModel); + } +}; + +class SystemStatusManufacturer : public SystemStatusItemBase, + public ManufacturerDataItemBase +{ +public: + inline SystemStatusManufacturer(string name="") : + ManufacturerDataItemBase(name) {} + inline bool equals(const SystemStatusManufacturer& peer) { + return (mManufacturer == peer.mManufacturer); + } +}; + +class SystemStatusAssistedGps : public SystemStatusItemBase, + public AssistedGpsDataItemBase +{ +public: + inline SystemStatusAssistedGps(bool enabled=false) : + AssistedGpsDataItemBase(enabled) {} + inline bool equals(const SystemStatusAssistedGps& peer) { + return (mEnabled == peer.mEnabled); + } +}; + +class SystemStatusScreenState : public SystemStatusItemBase, + public ScreenStateDataItemBase +{ +public: + inline SystemStatusScreenState(bool state=false) : + ScreenStateDataItemBase(state) {} + inline bool equals(const SystemStatusScreenState& peer) { + return (mState == peer.mState); + } +}; + +class SystemStatusPowerConnectState : public SystemStatusItemBase, + public PowerConnectStateDataItemBase +{ +public: + inline SystemStatusPowerConnectState(bool state=false) : + PowerConnectStateDataItemBase(state) {} + inline bool equals(const SystemStatusPowerConnectState& peer) { + return (mState == peer.mState); + } +}; + +class SystemStatusTimeZoneChange : public SystemStatusItemBase, + public TimeZoneChangeDataItemBase +{ +public: + inline SystemStatusTimeZoneChange( + int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) : + TimeZoneChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {} + inline bool equals(const SystemStatusTimeZoneChange& peer) { + return ((mCurrTimeMillis == peer.mCurrTimeMillis) && + (mRawOffsetTZ == peer.mRawOffsetTZ) && + (mDstOffsetTZ == peer.mDstOffsetTZ)); + } +}; + +class SystemStatusTimeChange : public SystemStatusItemBase, + public TimeChangeDataItemBase +{ +public: + inline SystemStatusTimeChange( + int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) : + TimeChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {} + inline bool equals(const SystemStatusTimeChange& peer) { + return ((mCurrTimeMillis == peer.mCurrTimeMillis) && + (mRawOffsetTZ == peer.mRawOffsetTZ) && + (mDstOffsetTZ == peer.mDstOffsetTZ)); + } +}; + +class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase, + public WifiSupplicantStatusDataItemBase +{ +public: + inline SystemStatusWifiSupplicantStatus() : + WifiSupplicantStatusDataItemBase() {} + inline bool equals(const SystemStatusWifiSupplicantStatus& peer) { + return ((mState == peer.mState) && + (mApMacAddressValid == peer.mApMacAddressValid) && + (mWifiApSsidValid == peer.mWifiApSsidValid) && + (mWifiApSsid == peer.mWifiApSsid)); + } +}; + +class SystemStatusShutdownState : public SystemStatusItemBase, + public ShutdownStateDataItemBase +{ +public: + inline SystemStatusShutdownState(bool state=false) : + ShutdownStateDataItemBase(state) {} + inline bool equals(const SystemStatusShutdownState& peer) { + return (mState == peer.mState); + } +}; + +class SystemStatusTac : public SystemStatusItemBase, + public TacDataItemBase +{ +public: + inline SystemStatusTac(std::string value="") : + TacDataItemBase(value) {} + + inline bool equals(const SystemStatusTac& peer) { return (mValue == peer.mValue); } inline void dump(void) { LOC_LOGD("Tac: value=%s", mValue.c_str()); } - inline DataItemId getId() { - return TAC_DATA_ITEM_ID; - } - inline void stringify(string& /*valueStr*/) { } - inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { - SystemStatusTac* tac = static_cast(src); - mValue = tac->mValue; - if (dataItemCopied) { - *dataItemCopied = true; - } - return 1; - } }; -class SystemStatusMccMnc : public SystemStatusItemBase, public IDataItemCore +class SystemStatusMccMnc : public SystemStatusItemBase, + public MccmncDataItemBase { public: - inline SystemStatusMccMnc() : - mValue("") {} - inline SystemStatusMccMnc(std::string value) : - mValue(value) {} - - std::string mValue; - - inline bool equals(SystemStatusMccMnc& peer) { + inline SystemStatusMccMnc(std::string value="") : + MccmncDataItemBase(value) {} + inline bool equals(const SystemStatusMccMnc& peer) { return (mValue == peer.mValue); } inline void dump(void) { LOC_LOGD("TacMccMnc value=%s", mValue.c_str()); } - inline DataItemId getId() { - return MCCMNC_DATA_ITEM_ID; +}; + +class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase, + public BtDeviceScanDetailsDataItemBase +{ +public: + inline SystemStatusBtDeviceScanDetail() : + BtDeviceScanDetailsDataItemBase() {} + inline bool equals(const SystemStatusBtDeviceScanDetail& /*peer*/) { + return true; } - inline void stringify(string& /*valueStr*/) { } - inline int32_t copy(IDataItemCore* src, bool* dataItemCopied = nullptr) { - SystemStatusMccMnc* mccmnc = static_cast(src); - mValue = mccmnc->mValue; - if (dataItemCopied) { - *dataItemCopied = true; - } - return 1; +}; + +class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase, + public BtLeDeviceScanDetailsDataItemBase +{ +public: + inline SystemStatusBtleDeviceScanDetail() : + BtLeDeviceScanDetailsDataItemBase() {} + inline bool equals(const SystemStatusBtleDeviceScanDetail& /*peer*/) { + return true; } }; @@ -569,10 +697,28 @@ public: std::vector mPositionFailure; // from dataitems observer - std::vector mGpsState; + std::vector mAirplaneMode; + std::vector mENH; + std::vector mGPSState; + std::vector mNLPStatus; + std::vector mWifiHardwareState; std::vector mNetworkInfo; + std::vector mRilServiceInfo; + std::vector mRilCellInfo; + std::vector mServiceStatus; + std::vector mModel; + std::vector mManufacturer; + std::vector mAssistedGps; + std::vector mScreenState; + std::vector mPowerConnectState; + std::vector mTimeZoneChange; + std::vector mTimeChange; + std::vector mWifiSupplicantStatus; + std::vector mShutdownState; std::vector mTac; std::vector mMccMnc; + std::vector mBtDeviceScanDetail; + std::vector mBtLeDeviceScanDetail; }; /****************************************************************************** @@ -590,50 +736,21 @@ private: // Data members static pthread_mutex_t mMutexSystemStatus; - - static const uint32_t maxLocation = 5; - - static const uint32_t maxTimeAndClock = 5; - static const uint32_t maxXoState = 5; - static const uint32_t maxRfAndParams = 5; - static const uint32_t maxErrRecovery = 5; - - static const uint32_t maxInjectedPosition = 5; - static const uint32_t maxBestPosition = 5; - static const uint32_t maxXtra = 5; - static const uint32_t maxEphemeris = 5; - static const uint32_t maxSvHealth = 5; - static const uint32_t maxPdr = 5; - static const uint32_t maxNavData = 5; - - static const uint32_t maxPositionFailure = 5; - - static const uint32_t maxGpsState = 5; - static const uint32_t maxNetworkInfo = 5; - static const uint32_t maxTac = 5; - static const uint32_t maxMccMnc = 5; - SystemStatusReports mCache; bool mConnected; - bool setLocation(const UlpLocation& location); + // set dataitem derived item in report cache + bool setNetworkInfo(const SystemStatusNetworkInfo& s); - bool setTimeAndCLock(const SystemStatusPQWM1& nmea); - bool setXoState(const SystemStatusPQWM1& nmea); - bool setRfAndParams(const SystemStatusPQWM1& nmea); - bool setErrRecovery(const SystemStatusPQWM1& nmea); + template + bool setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); - bool setInjectedPosition(const SystemStatusPQWP1& nmea); - bool setBestPosition(const SystemStatusPQWP2& nmea); - bool setXtra(const SystemStatusPQWP3& nmea); - bool setEphemeris(const SystemStatusPQWP4& nmea); - bool setSvHealth(const SystemStatusPQWP5& nmea); - bool setPdr(const SystemStatusPQWP6& nmea); - bool setNavData(const SystemStatusPQWP7& nmea); + // set default dataitem derived item in report cache + template + void setDefaultIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); - bool setPositionFailure(const SystemStatusPQWS1& nmea); - - bool setNetworkInfo(IDataItemCore* dataitem); + template + void getIteminReport(TYPE_REPORT& reportout, const TYPE_ITEM& c) const; public: // Static methods diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index dc08a76e..2fdd19f1 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -39,7 +39,9 @@ namespace loc_core { -SystemStatusOsObserver::SystemStatusOsObserver(const MsgTask* msgTask) : +SystemStatusOsObserver::SystemStatusOsObserver( + SystemStatus* systemstatus, const MsgTask* msgTask) : + mSystemStatus(systemstatus), mAddress("SystemStatusOsObserver"), #ifdef USE_GLIB mBackHaulConnectReqCount(0), @@ -369,11 +371,11 @@ void SystemStatusOsObserver::notify(const list& dlist) // Copy contents into the newly created data item di->copy(each); - dataItemList.push_back(di); + // Request systemstatus to record this dataitem in its cache - SystemStatus* systemstatus = SystemStatus::getInstance(mContext.mMsgTask); - if(nullptr != systemstatus) { - systemstatus->eventDataItemNotify(di); + if (mSystemStatus->eventDataItemNotify(di)) { + // add this dataitem if updated from last one + dataItemList.push_back(di); } } diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 6892f226..33e668d2 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -70,12 +70,13 @@ typedef map> ObserverReqCache; // subscribe with OSObserver using IDataItemSubscription interface. // Such clients would need to implement IDataItemObserver interface // to receive data when it becomes available. +class SystemStatus; class SystemStatusOsObserver : public IOsObserver { public: // ctor - SystemStatusOsObserver(const MsgTask* msgTask); - + SystemStatusOsObserver( + SystemStatus* systemstatus, const MsgTask* msgTask); // dtor ~SystemStatusOsObserver(); @@ -115,6 +116,7 @@ public: #endif private: + SystemStatus* mSystemStatus; SystemContext mContext; const string mAddress; IClientIndex* mClientIndex; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 74722d06..df3bf9a9 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -235,6 +235,21 @@ public: inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + enum NetworkType { + TYPE_UNKNOWN, + TYPE_MOBILE, + TYPE_WIFI, + TYPE_ETHERNET, + TYPE_BLUETOOTH, + TYPE_MMS, + TYPE_SUPL, + TYPE_DUN, + TYPE_HIPRI, + TYPE_WIMAX + }; + inline virtual NetworkType getType(void) const { + return (NetworkType)mType; + } // Data members int32_t mType; string mTypeName; From de6898af20c1341fc8c4886a936279b791f0d772 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 9 Oct 2017 11:42:11 -0700 Subject: [PATCH 580/945] Fix crash in AgpsManager when accessing invalid pointer Crash was happening because a local structure was being passed over by reference to the MsgTask, as a result data was being read and saved from the reference when the local structure was already out of scope. CRs-Fixed: 2124083 Change-Id: Ifb24652d5b665a47b8ae88f43dd86876274a28cf --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 404f19b7..a04be995 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2554,7 +2554,7 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ /* Message to initialize AGPS module */ struct AgpsMsgInit: public LocMsg { - const AgpsCbInfo& mCbInfo; + const AgpsCbInfo mCbInfo; GnssAdapter& mAdapter; inline AgpsMsgInit(const AgpsCbInfo& cbInfo, From 34ce2a68730afc925438ba191514db7b10432821 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 3 Oct 2017 14:38:42 -0700 Subject: [PATCH 581/945] Fix support for batching without batch full event Additional fixes: -fix issue where if StartTracking or StartBatching fails at QMI LOC layer, then the session is stuck and Tracking or Batching cannot be stoped or started again. -fix getBatchedLocation API to return an error if the id given is not valid, as caller will not get a response callback in this case. CRs-fixed 2118838 Change-Id: I389fc862836450f0081f6394c971b33614373841 --- location/LocationAPI.h | 5 ++- location/LocationAPIClientBase.cpp | 66 +++++++++++++++--------------- location/LocationAPIClientBase.h | 12 ++++-- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/location/LocationAPI.h b/location/LocationAPI.h index f5cc75af..530b1b08 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -308,8 +308,9 @@ typedef enum { } GnssSuplMode; typedef enum { - BATCHING_MODE_ROUTINE = 0, - BATCHING_MODE_TRIP + BATCHING_MODE_ROUTINE = 0, // positions are reported when batched positions memory is full + BATCHING_MODE_TRIP, // positions are reported when a certain distance is covered + BATCHING_MODE_NO_AUTO_REPORT // no report of positions automatically, instead queried on demand } BatchingMode; typedef enum { diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 4aa1ccbb..50b4b83d 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -393,14 +393,20 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session trackingSession = mLocationAPI->startTracking(locationOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); mRequestQueues[REQUEST_SESSION].push(new StartTrackingRequest(*this)); - } else if ((sessionMode == SESSION_MODE_ON_FULL) || - (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + } else { // Fill in the batch mode BatchingOptions batchOptions = {}; batchOptions.size = sizeof(BatchingOptions); - batchOptions.batchingMode = BATCHING_MODE_ROUTINE; - if (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) { + switch (sessionMode) { + case SESSION_MODE_ON_FULL: + batchOptions.batchingMode = BATCHING_MODE_ROUTINE; + break; + case SESSION_MODE_ON_TRIP_COMPLETED: batchOptions.batchingMode = BATCHING_MODE_TRIP; + break; + default: + batchOptions.batchingMode = BATCHING_MODE_NO_AUTO_REPORT; + break; } batchingSession = mLocationAPI->startBatching(locationOptions, batchOptions); @@ -409,8 +415,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session mRequestQueues[REQUEST_SESSION].push(new StartBatchingRequest(*this)); } - uint32_t session = ((sessionMode == SESSION_MODE_ON_FULL || - (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) ? + uint32_t session = ((sessionMode != SESSION_MODE_ON_FIX) ? batchingSession : trackingSession); SessionEntity entity; @@ -445,12 +450,9 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) if (sMode == SESSION_MODE_ON_FIX) { mRequestQueues[REQUEST_SESSION].push(new StopTrackingRequest(*this)); mLocationAPI->stopTracking(trackingSession); - } else if ((sMode == SESSION_MODE_ON_FULL) || - (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + } else { mRequestQueues[REQUEST_SESSION].push(new StopBatchingRequest(*this)); mLocationAPI->stopBatching(batchingSession); - } else { - LOC_LOGE("%s:%d] unknown mode %d.", __FUNCTION__, __LINE__, sMode); } retVal = LOCATION_ERROR_SUCCESS; @@ -484,8 +486,7 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t mRequestQueues[REQUEST_SESSION].push(new UpdateTrackingOptionsRequest(*this)); if (sMode == SESSION_MODE_ON_FIX) { mLocationAPI->updateTrackingOptions(trackingSession, options); - } else if ((sMode == SESSION_MODE_ON_FULL) || - (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + } else { // stop batching // batchingSession will be removed from mSessionBiDict soon, // so we don't need to add a new request to mRequestQueues[REQUEST_SESSION]. @@ -497,19 +498,23 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); - } else { - LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); } - } else if ((sessionMode == SESSION_MODE_ON_FULL) || - (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED)) { + } else { // we only add an UpdateBatchingOptionsRequest to mRequestQueues[REQUEST_SESSION], // even if this update request will stop tracking and then start batching. mRequestQueues[REQUEST_SESSION].push(new UpdateBatchingOptionsRequest(*this)); BatchingOptions batchOptions = {}; batchOptions.size = sizeof(BatchingOptions); - batchOptions.batchingMode = BATCHING_MODE_ROUTINE; - if (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) { - batchOptions.batchingMode = BATCHING_MODE_TRIP; + switch (sessionMode) { + case SESSION_MODE_ON_FULL: + batchOptions.batchingMode = BATCHING_MODE_ROUTINE; + break; + case SESSION_MODE_ON_TRIP_COMPLETED: + batchOptions.batchingMode = BATCHING_MODE_TRIP; + break; + default: + batchOptions.batchingMode = BATCHING_MODE_NO_AUTO_REPORT; + break; } if (sMode == SESSION_MODE_ON_FIX) { @@ -524,19 +529,13 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); mRequestQueues[REQUEST_SESSION].setSession(batchingSession); - } else if ((sMode == SESSION_MODE_ON_FULL) || - (sMode == SESSION_MODE_ON_TRIP_COMPLETED)) { - mLocationAPI->updateBatchingOptions(batchingSession, options, batchOptions); } else { - LOC_LOGE("%s:%d] unknown mode %d", __FUNCTION__, __LINE__, sMode); + mLocationAPI->updateBatchingOptions(batchingSession, options, batchOptions); } - } else { - LOC_LOGE("%s:%d] unknown mode %d.", __FUNCTION__, __LINE__, sessionMode); } - uint32_t session = ((sessionMode == SESSION_MODE_ON_FULL) || - (sessionMode == SESSION_MODE_ON_TRIP_COMPLETED) ? + uint32_t session = ((sessionMode != SESSION_MODE_ON_FIX) ? batchingSession : trackingSession); entity.trackingSession = trackingSession; @@ -556,22 +555,25 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t return retVal; } -void LocationAPIClientBase::locAPIGetBatchedLocations(uint32_t id, size_t count) +uint32_t LocationAPIClientBase::locAPIGetBatchedLocations(uint32_t id, size_t count) { + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationAPI) { - uint32_t session = 0; - session = mRequestQueues[REQUEST_SESSION].getSession(); - if (session > 0) { + if (mSessionBiDict.hasId(id)) { SessionEntity entity = mSessionBiDict.getExtById(id); uint32_t batchingSession = entity.batchingSession; mRequestQueues[REQUEST_SESSION].push(new GetBatchedLocationsRequest(*this)); mLocationAPI->getBatchedLocations(batchingSession, count); + retVal = LOCATION_ERROR_SUCCESS; } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); + retVal = LOCATION_ERROR_ID_UNKNOWN; + LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, id); } } pthread_mutex_unlock(&mMutex); + + return retVal; } uint32_t LocationAPIClientBase::locAPIAddGeofences( diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 78c8fa61..c6ea05ca 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -195,7 +195,7 @@ public: uint32_t locAPIStopSession(uint32_t id); uint32_t locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, LocationOptions& options); - void locAPIGetBatchedLocations(uint32_t id, size_t count); + uint32_t locAPIGetBatchedLocations(uint32_t id, size_t count); uint32_t locAPIAddGeofences(size_t count, uint32_t* ids, GeofenceOption* options, GeofenceInfo* data); @@ -381,7 +381,10 @@ private: class StartTrackingRequest : public LocationAPIRequest { public: StartTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error, uint32_t /*id*/) { + inline void onResponse(LocationError error, uint32_t id) { + if (error != LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } mAPI.onStartTrackingCb(error); } LocationAPIClientBase& mAPI; @@ -411,7 +414,10 @@ private: class StartBatchingRequest : public LocationAPIRequest { public: StartBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error, uint32_t /*id*/) { + inline void onResponse(LocationError error, uint32_t id) { + if (error != LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } mAPI.onStartBatchingCb(error); } LocationAPIClientBase& mAPI; From 273e268978263b803ff82b5281240fcbc3261061 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 12 Sep 2017 15:57:22 -0700 Subject: [PATCH 582/945] Add battery level observer added data item id and BatteryLevelDataItemBase type Change-Id: I7e33b476c787587d0372ec67bd61fa5efe6eef41 CRs-Fixed: 2125054 --- core/data-items/DataItemConcreteTypesBase.h | 18 +++++++++++++++--- core/data-items/DataItemId.h | 8 +++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 74722d06..244a46fd 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -378,7 +378,7 @@ protected: class MccmncDataItemBase : public IDataItemCore { public: MccmncDataItemBase(const string & name) : - mValue (name), + mValue(name), mId(MCCMNC_DATA_ITEM_ID) {} virtual ~MccmncDataItemBase() {} inline virtual DataItemId getId() { return mId; } @@ -392,7 +392,7 @@ protected: class SrnDeviceScanDetailsDataItemBase : public IDataItemCore { public: - SrnDeviceScanDetailsDataItemBase (DataItemId Id) : + SrnDeviceScanDetailsDataItemBase(DataItemId Id) : mValidSrnData(false), mApSrnRssi(-1), mApSrnTimestamp(0), @@ -400,7 +400,7 @@ public: mReceiveTimestamp(0), mErrorCause(-1), mId(Id) {} - virtual ~SrnDeviceScanDetailsDataItemBase () {} + virtual ~SrnDeviceScanDetailsDataItemBase() {} inline virtual DataItemId getId() { return mId; } // Data members common to all SRN tech types /* Represents info on whether SRN data is valid (no error)*/ @@ -441,6 +441,18 @@ public: virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} }; +class BatteryLevelDataItemBase : public IDataItemCore { +public: + inline BatteryLevelDataItemBase(uint8_t batteryPct) : + mBatteryPct(batteryPct), mId(BATTERY_LEVEL_DATA_ITEM_ID) {} + inline ~BatteryLevelDataItemBase() {} + inline virtual DataItemId getId() { return mId; } +// Data members + uint8_t mBatteryPct; +protected: + DataItemId mId; +}; + } // namespace loc_core #endif //__DATAITEMCONCRETEBASETYPES__ diff --git a/core/data-items/DataItemId.h b/core/data-items/DataItemId.h index 1bf132aa..1661be6c 100644 --- a/core/data-items/DataItemId.h +++ b/core/data-items/DataItemId.h @@ -67,7 +67,13 @@ typedef enum e_DataItemId { BTLE_SCAN_DATA_ITEM_ID, BT_SCAN_DATA_ITEM_ID, OEM_GTP_UPLOAD_TRIGGER_READY_ITEM_ID, - MAX_DATA_ITEM_ID + + MAX_DATA_ITEM_ID, + + // 26 - + BATTERY_LEVEL_DATA_ITEM_ID, + + MAX_DATA_ITEM_ID_1_1, } DataItemId; #endif // #ifndef __DATAITEMID_H__ From 5f583c63753f2edb9cbb8a5497e08007ce4ad397 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 14 Sep 2017 22:50:42 +0530 Subject: [PATCH 583/945] Enable logcat logging for location modules in LE Add support for logcat logging for location modules in LE, by adding appropriate flags -llog to LDFLAGS. Update logging macros to use ALOG* so that logs can be outputed using standard logcat adb commands. Change-Id: I94b5a1e9f0b4ec78a55e7189002e0f674ef174d2 CRs-Fixed: 2117669 --- utils/Makefile.am | 4 +++- utils/log_util.h | 10 +++++----- .../loc_pla/include/platform_lib_log_util.h | 12 ++++++------ .../loc_pla/include/platform_lib_macros.h | 10 +++++++--- .../platform_lib_abstractions/loc_pla/loc-pla.pc.in | 2 +- .../loc_pla/src/Makefile.am | 1 + 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/utils/Makefile.am b/utils/Makefile.am index b8c4c52d..506309c3 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = -Wundef \ -I./ \ + -I$(WORKSPACE)/system/core/include \ -std=c++11 \ $(LOCPLA_CFLAGS) @@ -24,7 +25,8 @@ libgps_utils_so_la_h_sources = \ loc_nmea.h \ gps_extended_c.h \ gps_extended.h \ - loc_gps.h + loc_gps.h \ + log_util.h libgps_utils_so_la_c_sources = \ linked_list.c \ diff --git a/utils/log_util.h b/utils/log_util.h index 7eb338a5..d5884b75 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -30,12 +30,12 @@ #ifndef __LOG_UTIL_H__ #define __LOG_UTIL_H__ -#ifndef USE_GLIB +#if defined (USE_ANDROID_LOGGING) || defined (ANDROID) +// Android and LE targets with logcat support #include -#endif /* USE_GLIB */ - -#ifdef USE_GLIB +#elif defined (USE_GLIB) +// LE targets with no logcat support #include #include #include @@ -45,7 +45,7 @@ #endif // LOG_TAG -#endif /* USE_GLIB */ +#endif /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ #ifdef __cplusplus extern "C" diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h index 26d3c29a..08a9585c 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h @@ -30,11 +30,6 @@ #define __PLATFORM_LIB_LOG_UTIL_H__ #include "platform_lib_macros.h" - -#ifndef USE_GLIB -#include -#else - #include #include #include @@ -46,6 +41,11 @@ #define LOG_TAG "GPS_UTILS" #endif /* LOG_TAG */ +#if defined (USE_ANDROID_LOGGING) || defined (ANDROID) +// Android and LE targets with logcat support +#include +#else +// LE targets without logcat support #ifdef __cplusplus extern "C" { @@ -169,6 +169,6 @@ char* get_timestamp(char* str, unsigned long buf_size); } #endif -#endif /* USE_GLIB */ +#endif /* else of #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ #endif /* __PLATFORM_LIB_LOG_UTIL_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index d0795eb6..b896b942 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -33,19 +33,23 @@ extern "C" { #endif -#ifdef USE_GLIB #include #include #include -#ifndef OFF_TARGET + +#ifdef USE_GLIB #include +#ifndef OFF_TARGET #define strlcat g_strlcat #define strlcpy g_strlcpy #else #define strlcat strncat #define strlcpy strncpy #endif +#endif /* USE_GLIB */ +#if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) +// LE targets with no logcat support #define TS_PRINTF(format, x...) \ { \ struct timeval tv; \ @@ -64,7 +68,7 @@ extern "C" { #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 */ +#endif /* #if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) */ // Below are the location conf file paths diff --git a/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in index 1aad2f47..9ec510d1 100644 --- a/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in +++ b/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in @@ -7,4 +7,4 @@ Name: loc-pla Description: QTI GPS Location Platform Library Abstractions Version: @VERSION@ Libs: -L${libdir} -lloc_pla -Cflags: -I${includedir}/loc-pla +Cflags: -I${includedir}/loc-pla -I${includedir}/gps-utils diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am index 30c4b4cc..ac7f8a04 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = \ $(LOCSTUB_CFLAGS) \ + -I$(WORKSPACE)/hardware/qcom/gps/utils/ \ -I../include \ -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums From 57640c9f33972bd9e527953d90e81c4363cdc45e Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 16 Oct 2017 19:55:47 +0530 Subject: [PATCH 584/945] Checking HIDL callback return value Change-Id: I937f155b80d54396f86fb44d731bc592ae49411e CRs-Fixed: 2120892 --- android/AGnss.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index e76671c6..6213a083 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -72,7 +72,10 @@ void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ } st.ipV4Addr = status.ipV4Addr; - sAGnssCbIface->agnssStatusIpV4Cb(st); + auto r = sAGnssCbIface->agnssStatusIpV4Cb(st); + if (!r.isOk()) { + LOC_LOGE("Error invoking AGNSS status cb %s", r.description().c_str()); + } } Return AGnss::setCallback(const sp& callback) { From 63c4d2f67b37d49704cd464b23060267199a824e Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 20 Oct 2017 13:26:11 -0700 Subject: [PATCH 585/945] locAPIRemoveGeofences roolback to async result notification locAPIRemoveGeofences is rolled back to async result notification, using the RemoveGeofencesRequest, but using a new temporal bidict of sessions & ids, to avoid a previous race condition using the wrong id when removing and adding a geofence. Change-Id: Icd85373b82e620ea4059431f0c3d13c95f99ca3c CRs-fixed: 2132679 --- location/LocationAPIClientBase.cpp | 18 ++++++++---------- location/LocationAPIClientBase.h | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 12 deletions(-) mode change 100644 => 100755 location/LocationAPIClientBase.cpp diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp old mode 100644 new mode 100755 index 50b4b83d..5a50c2db --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -614,26 +614,24 @@ void LocationAPIClientBase::locAPIRemoveGeofences(size_t count, uint32_t* ids) } if (mRequestQueues[REQUEST_GEOFENCE].getSession() == GEOFENCE_SESSION_ID) { + BiDict* removedGeofenceBiDict = + new BiDict(); size_t j = 0; - uint32_t id_cb; - LocationError err; for (size_t i = 0; i < count; i++) { sessions[j] = mGeofenceBiDict.getSession(ids[i]); - id_cb = ids[i]; if (sessions[j] > 0) { + GeofenceBreachTypeMask type = mGeofenceBiDict.getExtBySession(sessions[j]); mGeofenceBiDict.rmBySession(sessions[j]); - err = LOCATION_ERROR_SUCCESS; - onRemoveGeofencesCb(1, &err, &id_cb); + removedGeofenceBiDict->set(ids[i], sessions[j], type); j++; - } else { - err = LOCATION_ERROR_ID_UNKNOWN; - onRemoveGeofencesCb(1, &err, &id_cb); } } - if (j > 0) { - mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this)); + mRequestQueues[REQUEST_GEOFENCE].push(new RemoveGeofencesRequest(*this, + removedGeofenceBiDict)); mLocationAPI->removeGeofences(j, sessions); + } else { + delete(removedGeofenceBiDict); } } else { LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index c6ea05ca..99c7c873 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -36,6 +36,7 @@ #include #include "LocationAPI.h" +#include "platform_lib_log_util.h" enum SESSION_MODE { SESSION_MODE_NONE = 0, @@ -469,11 +470,24 @@ private: class RemoveGeofencesRequest : public LocationAPIRequest { public: - RemoveGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} + RemoveGeofencesRequest(LocationAPIClientBase& API, + BiDict* removedGeofenceBiDict) : + mAPI(API), mRemovedGeofenceBiDict(removedGeofenceBiDict) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { - // No need to handle collectiveResponse, cbs already notified + if (nullptr != mRemovedGeofenceBiDict) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mRemovedGeofenceBiDict->getId(sessions[i]); + } + mAPI.onRemoveGeofencesCb(count, errors, ids); + free(ids); + delete(mRemovedGeofenceBiDict); + } else { + LOC_LOGE("%s:%d] Unable to access removed geofences data.", __FUNCTION__, __LINE__); + } } LocationAPIClientBase& mAPI; + BiDict* mRemovedGeofenceBiDict; }; class ModifyGeofencesRequest : public LocationAPIRequest { From 0107dbe7d31e6da024e89a5e743bf3382dcd0ed3 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 27 Oct 2017 00:32:42 +0530 Subject: [PATCH 586/945] Invoking HIDL callback via local variable Copying HIDL callback member variable to a local variable before invoking. This is to avoid possible race conditions with the callback getting updated during invocation. Change-Id: Ida9658f4cffafc64754c0cd26541b731cb328155 CRs-Fixed: 2114085 --- android/location_api/GnssAPIClient.cpp | 49 ++++++++++++++++---------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 0cccb27a..2745f56e 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -278,7 +278,9 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); mLocationCapabilitiesMask = capabilitiesMask; mLocationCapabilitiesCached = true; - if (mGnssCbIface != nullptr) { + sp gnssCbIface = mGnssCbIface; + + if (gnssCbIface != nullptr) { uint32_t data = 0; if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || @@ -293,13 +295,13 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) data |= IGnssCallback::Capabilities::MSB; if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) data |= IGnssCallback::Capabilities::MSA; - auto r = mGnssCbIface->gnssSetCapabilitesCb(data); + auto r = gnssCbIface->gnssSetCapabilitesCb(data); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", __func__, r.description().c_str()); } } - if (mGnssCbIface != nullptr) { + if (gnssCbIface != nullptr) { IGnssCallback::GnssSystemInfo gnssInfo; if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { gnssInfo.yearOfHw = 2017; @@ -309,7 +311,7 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) gnssInfo.yearOfHw = 2015; } LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); - auto r = mGnssCbIface->gnssSetSystemInfoCb(gnssInfo); + auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", __func__, r.description().c_str()); @@ -320,10 +322,12 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) void GnssAPIClient::onTrackingCb(Location location) { LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); - if (mGnssCbIface != nullptr) { + sp gnssCbIface = mGnssCbIface; + + if (gnssCbIface != nullptr) { GnssLocation gnssLocation; convertGnssLocation(location, gnssLocation); - auto r = mGnssCbIface->gnssLocationCb(gnssLocation); + auto r = gnssCbIface->gnssLocationCb(gnssLocation); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssLocationCb description=%s", __func__, r.description().c_str()); @@ -334,8 +338,9 @@ void GnssAPIClient::onTrackingCb(Location location) void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) { LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id); + sp gnssNiCbIface = mGnssNiCbIface; - if (mGnssNiCbIface == nullptr) { + if (gnssNiCbIface == nullptr) { LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__); return; } @@ -400,16 +405,18 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.notificationIdEncoding = IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; - mGnssNiCbIface->niNotifyCb(notificationGnss); + gnssNiCbIface->niNotifyCb(notificationGnss); } void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); - if (mGnssCbIface != nullptr) { + sp gnssCbIface = mGnssCbIface; + + if (gnssCbIface != nullptr) { IGnssCallback::GnssSvStatus svStatus; convertGnssSvStatus(gnssSvNotification, svStatus); - auto r = mGnssCbIface->gnssSvStatusCb(svStatus); + auto r = gnssCbIface->gnssSvStatusCb(svStatus); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssSvStatusCb description=%s", __func__, r.description().c_str()); @@ -419,10 +426,12 @@ void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) { - if (mGnssCbIface != nullptr) { + sp gnssCbIface = mGnssCbIface; + + if (gnssCbIface != nullptr) { android::hardware::hidl_string nmeaString; nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); - auto r = mGnssCbIface->gnssNmeaCb( + auto r = gnssCbIface->gnssNmeaCb( static_cast(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, @@ -434,13 +443,15 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) void GnssAPIClient::onStartTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); - if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { - auto r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + sp gnssCbIface = mGnssCbIface; + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", __func__, r.description().c_str()); } - r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", __func__, r.description().c_str()); @@ -451,13 +462,15 @@ void GnssAPIClient::onStartTrackingCb(LocationError error) void GnssAPIClient::onStopTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); - if (error == LOCATION_ERROR_SUCCESS && mGnssCbIface != nullptr) { - auto r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + sp gnssCbIface = mGnssCbIface; + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", __func__, r.description().c_str()); } - r = mGnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", __func__, r.description().c_str()); From 6ccaa83f60d0014b1c6414ef380a7d3a456a678b Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 3 Nov 2017 10:30:01 +0530 Subject: [PATCH 587/945] GetBatchedLocations is unsupported for Live Fix. Return ERROR_NOT_SUPPORTED from LocationAPIClientBase when GetBatchedLocations is invoked by a Live fix session id, which has session mode of SESSION_MODE_ON_FIX. Change-Id: Ifc57d4d4b16288ed5ac7432da92cf39bfe989416 CRs-Fixed: 2137513 --- location/LocationAPIClientBase.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) mode change 100755 => 100644 location/LocationAPIClientBase.cpp diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp old mode 100755 new mode 100644 index 5a50c2db..bb51238f --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -562,10 +562,16 @@ uint32_t LocationAPIClientBase::locAPIGetBatchedLocations(uint32_t id, size_t co if (mLocationAPI) { if (mSessionBiDict.hasId(id)) { SessionEntity entity = mSessionBiDict.getExtById(id); - uint32_t batchingSession = entity.batchingSession; - mRequestQueues[REQUEST_SESSION].push(new GetBatchedLocationsRequest(*this)); - mLocationAPI->getBatchedLocations(batchingSession, count); - retVal = LOCATION_ERROR_SUCCESS; + if (entity.sessionMode != SESSION_MODE_ON_FIX) { + uint32_t batchingSession = entity.batchingSession; + mRequestQueues[REQUEST_SESSION].push(new GetBatchedLocationsRequest(*this)); + mLocationAPI->getBatchedLocations(batchingSession, count); + retVal = LOCATION_ERROR_SUCCESS; + } else { + LOC_LOGE("%s:%d] Unsupported for session id: %d, mode is SESSION_MODE_ON_FIX", + __FUNCTION__, __LINE__, id); + retVal = LOCATION_ERROR_NOT_SUPPORTED; + } } else { retVal = LOCATION_ERROR_ID_UNKNOWN; LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, id); From 08cbff337d373d55d09e120e8a77fcfb7378ee3a Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 24 Oct 2017 18:05:52 +0800 Subject: [PATCH 588/945] Adjust NMEA sentence to comply with v4.1 1. Add Navigational status to $--RMC sentence 2. Add Signal ID to $--GSV sentence Change-Id: I5ae26bed8dcca577ee661a4129858a8482d172a6 CRs-fixed: 2109692 --- utils/loc_nmea.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index eb193cc5..92f3df18 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -51,6 +51,7 @@ typedef struct loc_nmea_sv_meta_s uint32_t mask; uint32_t svCount; uint32_t svIdOffset; + uint32_t signalId; uint32_t systemId; } loc_nmea_sv_meta; @@ -103,6 +104,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.talker[1] = 'P'; sv_meta.mask = sv_cache_info.gps_used_mask; sv_meta.svCount = sv_cache_info.gps_count; + sv_meta.signalId = 1; sv_meta.systemId = SYSTEM_ID_GPS; break; case GNSS_SV_TYPE_GLONASS: @@ -112,6 +114,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.svCount = sv_cache_info.glo_count; // GLONASS SV ids are from 65-96 sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; + sv_meta.signalId = 1; sv_meta.systemId = SYSTEM_ID_GLONASS; break; case GNSS_SV_TYPE_GALILEO: @@ -119,6 +122,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.talker[1] = 'A'; sv_meta.mask = sv_cache_info.gal_used_mask; sv_meta.svCount = sv_cache_info.gal_count; + sv_meta.signalId = 7; sv_meta.systemId = SYSTEM_ID_GALILEO; break; case GNSS_SV_TYPE_QZSS: @@ -127,6 +131,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.mask = sv_cache_info.qzss_used_mask; sv_meta.svCount = sv_cache_info.qzss_count; // QZSS SV ids are from 193-197. So keep svIdOffset 0 + sv_meta.signalId = 0; sv_meta.systemId = SYSTEM_ID_QZSS; break; case GNSS_SV_TYPE_BEIDOU: @@ -135,6 +140,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.mask = sv_cache_info.bds_used_mask; sv_meta.svCount = sv_cache_info.bds_count; // BDS SV ids are from 201-235. So keep svIdOffset 0 + sv_meta.signalId = 0; sv_meta.systemId = SYSTEM_ID_BEIDOU; break; default: @@ -260,13 +266,14 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende 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 + // Format: $--GSA,a,x,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,p.p,h.h,v.v,s*cc // 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 + // s : GNSS System Id // cc : Checksum value length = snprintf(pMarker, lengthRemaining, "$%sGSA,A,%c,", talker, fixType); @@ -329,7 +336,7 @@ DESCRIPTION Generate NMEA GSV sentences generated based on sv report Currently below sentences are generated: - $GPGSV: GPS Satellites in View - - $GNGSV: GLONASS Satellites in View + - $GLGSV: GLONASS Satellites in View - $GAGSV: GALILEO Satellites in View DEPENDENCIES @@ -368,7 +375,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, if (svCount <= 0) { // no svs in view, so just send a blank $--GSV sentence - snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,", talker); + snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,%d", talker, sv_meta_p->signalId); length = loc_nmea_put_checksum(sentence, bufSize); nmeaArraystr.push_back(sentence); return; @@ -430,15 +437,10 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } - // The following entries are specific to QZSS and BDS - if ((sv_meta_p->svType == GNSS_SV_TYPE_QZSS) || - (sv_meta_p->svType == GNSS_SV_TYPE_BEIDOU)) - { - // last one is System id and second last is Signal Id which is always zero - length = snprintf(pMarker, lengthRemaining,",%d,%d",0,sv_meta_p->systemId); - pMarker += length; - lengthRemaining -= length; - } + // append signalId + length = snprintf(pMarker, lengthRemaining,",%d",sv_meta_p->signalId); + pMarker += length; + lengthRemaining -= length; length = loc_nmea_put_checksum(sentence, bufSize); nmeaArraystr.push_back(sentence); @@ -639,7 +641,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , + // hardcode Navigation Status field to 'V' + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A,V" , talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) From ccd6716531c6b0cc7582d1363c955516d2680bfe Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 9 Nov 2017 17:33:34 +0800 Subject: [PATCH 589/945] Fix $--RMC sentence Navigational status should be the last element Change-Id: Ifb201fe95de74e3419e7fe55c55657b41818c64d CRs-fixed: 2140835 --- utils/loc_nmea.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 92f3df18..6d34b512 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -641,8 +641,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker = sentence; lengthRemaining = sizeof(sentence); - // hardcode Navigation Status field to 'V' - length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A,V" , + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) @@ -790,6 +789,14 @@ void loc_nmea_generate_pos(const UlpLocation &location, else // A means autonomous length = snprintf(pMarker, lengthRemaining, "%c", 'A'); + pMarker += length; + lengthRemaining -= length; + + // hardcode Navigation Status field to 'V' + length = snprintf(pMarker, lengthRemaining, ",%c", 'V'); + pMarker += length; + lengthRemaining -= length; + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); @@ -949,7 +956,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); + strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N,V", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); From e21e18a836018dc1ba276e40e44b7d33e5c21040 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Fri, 27 Oct 2017 11:36:13 -0700 Subject: [PATCH 590/945] HAL handshake with XTRA send XSSO state on XTRA request; send XTRA the init event on XSSO start. Change-Id: Ic1833dc85b7b29259069335bbce26d388ca83d32 CRs-fixed: 2074685 --- gnss/XtraSystemStatusObserver.cpp | 210 ++++++++++++------------------ gnss/XtraSystemStatusObserver.h | 94 ++++--------- 2 files changed, 106 insertions(+), 198 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index fe4129c3..7f5288b6 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -57,6 +57,12 @@ using namespace loc_core; #define LOG_TAG "LocSvc_XSSO" bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { + mGpsLock = lock; + + if (!mReqStatusReceived) { + return true; + } + stringstream ss; ss << "gpslock"; ss << " " << lock; @@ -64,13 +70,34 @@ bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { } bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, int32_t type) { + if (connected) { + mConnections.insert(type); + } else { + if (-1 == type) { // -1 for disconnecting all connections + mConnections.clear(); + } else { + mConnections.erase(type); + } + } + + if (!mReqStatusReceived) { + return true; + } + stringstream ss; ss << "connection"; ss << " " << (connected ? "1" : "0"); ss << " " << type; return ( send(LOC_IPC_XTRA, ss.str()) ); } + bool XtraSystemStatusObserver::updateTac(const string& tac) { + mTac = tac; + + if (!mReqStatusReceived) { + return true; + } + stringstream ss; ss << "tac"; ss << " " << tac.c_str(); @@ -78,6 +105,12 @@ bool XtraSystemStatusObserver::updateTac(const string& tac) { } bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { + mMccmnc = mccmnc; + + if (!mReqStatusReceived) { + return true; + } + stringstream ss; ss << "mncmcc"; ss << " " << mccmnc.c_str(); @@ -85,16 +118,67 @@ bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { } bool XtraSystemStatusObserver::updateXtraThrottle(const bool enabled) { + mXtraThrottle = enabled; + + if (!mReqStatusReceived) { + return true; + } + stringstream ss; ss << "xtrathrottle"; ss << " " << (enabled ? 1 : 0); return ( send(LOC_IPC_XTRA, ss.str()) ); } +static inline ostream& operator<<(ostream& os, CONNECTIONS& data) { + for (auto elem : data) { + os << elem << ' '; + } + return os; +} + +inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdated) { + mReqStatusReceived = true; + + if (xtraStatusUpdated) { + return true; + } + + stringstream ss; + + ss << "respondStatus" << endl; + (mGpsLock == -1 ? ss : ss << mGpsLock) << endl << mConnections << endl + << mTac << endl << mMccmnc; + + return ( send(LOC_IPC_XTRA, ss.str()) ); +} + void XtraSystemStatusObserver::onReceive(const std::string& data) { if (!strncmp(data.c_str(), "ping", sizeof("ping") - 1)) { LOC_LOGd("ping received"); +#ifdef USE_GLIB + } else if (!strncmp(data.c_str(), "connectBackhaul", sizeof("connectBackhaul") - 1)) { + mSystemStatusObsrvr->connectBackhaul(); + + } else if (!strncmp(data.c_str(), "disconnectBackhaul", sizeof("disconnectBackhaul") - 1)) { + mSystemStatusObsrvr->disconnectBackhaul(); +#endif + + } else if (!strncmp(data.c_str(), "requestStatus", sizeof("requestStatus") - 1)) { + int32_t xtraStatusUpdated = 0; + sscanf(data.c_str(), "%*s %d", &xtraStatusUpdated); + + struct HandleStatusRequestMsg : public LocMsg { + XtraSystemStatusObserver& mXSSO; + int32_t mXtraStatusUpdated; + inline HandleStatusRequestMsg(XtraSystemStatusObserver& xsso, + int32_t xtraStatusUpdated) : + mXSSO(xsso), mXtraStatusUpdated(xtraStatusUpdated) {} + inline void proc() const override { mXSSO.onStatusRequested(mXtraStatusUpdated); } + }; + mMsgTask->sendMsg(new (nothrow) HandleStatusRequestMsg(*this, xtraStatusUpdated)); + } else { LOC_LOGw("unknown event: %s", data.c_str()); } @@ -191,129 +275,3 @@ void XtraSystemStatusObserver::notify(const list& dlist) }; mMsgTask->sendMsg(new (nothrow) HandleOsObserverUpdateMsg(this, dlist)); } - -#ifdef USE_GLIB -bool XtraSystemStatusObserver::connectBackhaul() -{ - return mSystemStatusObsrvr->connectBackhaul(); -} - -bool XtraSystemStatusObserver::disconnectBackhaul() -{ - return mSystemStatusObsrvr->disconnectBackhaul(); -} - -// XtraHalListenerSocket class -// TBD - this will be removed once bidirectional socket changes in -// xtra-daemon will be implemented -void XtraHalListenerSocket::receiveData(const int socketFd) { - string data; - array buf; - const char* bin_msg_conn_backhaul = "connectBackhaul"; - const char* bin_msg_disconn_backhaul = "disconnectBackhaul"; - - while (true) { - ssize_t len = recv(socketFd, buf.data(), buf.size(), 0); - if (len > 0) { - LOC_LOGd("received %lu bytes", len); - data.append(buf.data(), len); - - size_t pos = data.find("\n"); - if (pos == string::npos) { - continue; - } - - if (!strncmp(data.c_str(), bin_msg_conn_backhaul, - sizeof(bin_msg_conn_backhaul) - 1)) { - mSystemStatusObsrvr->connectBackhaul(); - } else if (!strncmp(data.c_str(), bin_msg_disconn_backhaul, - sizeof(bin_msg_disconn_backhaul) - 1)) { - mSystemStatusObsrvr->disconnectBackhaul(); - } - else { - LOC_LOGw("unknown event: %s", data.c_str()); - } - break; - - } else { - LOC_LOGd("XtraHalListenerSocket connection broken."); - break; - } - } -} - -void XtraHalListenerSocket::startListenerThread() { - mThread = new (std::nothrow) LocThread(); - if (!mThread) { - LOC_LOGe("create thread failed"); - } - mRunning = true; - if (!mThread->start("XtraHalListenerSocketThread", this, true)) { - delete mThread; - mThread = NULL; - } - - LOC_LOGd("Create listener socket in XtraHalListenerSocket"); - // create socket - int socketFd; - if ((socketFd = ::socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - LOC_LOGe("create socket error. reason:%s", strerror(errno)); - return; - } - - const char* socketPath = "/data/vendor/location/xtra/socket_xtra_locnetiface"; - unlink(socketPath); - - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socketPath); - - umask(0157); - - if (::bind(socketFd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("bind socket error. reason:%s", strerror(errno)); - return; - } - - // set up connection - if (::listen(socketFd, 5/*backlog*/) < 0) { - LOC_LOGe("cannot bind socket. reason:%s", strerror(errno)); - return; - } - mSocketFd = socketFd; - -} - -bool XtraHalListenerSocket::run() { - // infinite while loop till mRunning is false when stopListenXtraDaemon - // is called - while (mRunning) { - int clientFd = -1; - LOC_LOGd("XtraHalListenerSocket - waiting for msg..."); - if ( (clientFd = ::accept(mSocketFd, NULL, NULL)) < 0) { - LOC_LOGe("connection error. reason:%s", strerror(errno)); - } else { - LOC_LOGd("XtraHalListenerSocket - receiving data ..."); - receiveData(clientFd); - if (::close(clientFd)) { - LOC_LOGe("close connection fail."); - } - clientFd = -1; - } - } - - // return false once we reach there - return false; -} - -void XtraHalListenerSocket::stopListenXtraDaemon() { - if (mSocketFd >= 0) { - if (::close(mSocketFd)) { - LOC_LOGe("close hal connection fail."); - } - mSocketFd = -1; - } - mRunning = false; - mThread->stop(); -} - -#endif diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 20d369ce..5a79060a 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -31,81 +31,27 @@ #include #include -#ifdef USE_GLIB -#include -#endif #include +#include +#include using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; using loc_util::LocIpc; - -#ifdef USE_GLIB -// XtraHalListenerSocket class -// listener socket for getting msgs from xtra-daemon in LE for invoking -// LocNetIface functions -// TBD - this will be removed once bidirectional socket changes in -// xtra-daemon will be implemented -class XtraHalListenerSocket: public LocRunnable { -public : - // constructor & destructor - XtraHalListenerSocket(IOsObserver* sysStatObs) : - mThread(NULL), - mRunning(false) { - mSystemStatusObsrvr = sysStatObs; - mRunning = true; - // create listener socket in a thread - startListenerThread(); - } - XtraHalListenerSocket() {} - inline virtual ~XtraHalListenerSocket() { - if (mThread) { - stopListenXtraDaemon(); - delete mThread; - mThread = NULL; - } - } - - // 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() - inline virtual void prerun() {} - - // The method to be run after thread loop (conditionally repeatedly) - // calls run() - inline virtual void postrun() {} - -private: - IOsObserver* mSystemStatusObsrvr; - int mSocketFd; - LocThread* mThread; - bool mRunning; - void startListenerThread(); - void stopListenXtraDaemon(); - void receiveData(const int socketFd); -}; -#endif +using CONNECTIONS = set; class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): -#ifdef USE_GLIB - mHalListenerSocket(sysStatObs), -#endif - mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask) { + mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), + mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); + mDelayLocTimer.start(100 /*.1 sec*/, false); } - inline XtraSystemStatusObserver() { - startListeningNonBlocking(LOC_IPC_HAL); - }; inline virtual ~XtraSystemStatusObserver() { subscribe(false); stopListening(); @@ -115,12 +61,6 @@ public : inline virtual void getName(string& name); virtual void notify(const list& dlist); -#ifdef USE_GLIB - // IFrameworkActionReq functions reqd - virtual bool connectBackhaul(); - virtual bool disconnectBackhaul(); -#endif - bool updateLockStatus(uint32_t lock); bool updateConnectionStatus(bool connected, int32_t type); bool updateTac(const string& tac); @@ -134,13 +74,23 @@ public : private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; -#ifdef USE_GLIB - // XtraHalListenerSocket class - // TBD - this will be removed once bidirectional socket changes in - // xtra-daemon will be implemented - XtraHalListenerSocket mHalListenerSocket; -#endif + int32_t mGpsLock; + CONNECTIONS mConnections; + string mTac; + string mMccmnc; + bool mXtraThrottle; + bool mReqStatusReceived; + class DelayLocTimer : public LocTimer { + XtraSystemStatusObserver& mXSSO; + public: + DelayLocTimer(XtraSystemStatusObserver& xsso) : mXSSO(xsso) {} + void timeOutCallback() override { + mXSSO.send(LOC_IPC_XTRA, "halinit"); + } + } mDelayLocTimer; + + bool onStatusRequested(int32_t xtraStatusUpdated); }; #endif From 104f1fee14e5783e397b417d6e6f2f6aa964b88f Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Wed, 15 Nov 2017 09:22:57 -0800 Subject: [PATCH 591/945] Location Utils - Improve send method of LocIpc Change LocIpc::send() method implementation from regular member to static, since it does not modify any of its class member variables. Sender code should be able to call this method without creating an instance. Change-Id: I9d08404c3fae615fd20531904241bf2e246fa592 CRs-Fixed: 2143522 --- utils/LocIpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 258fd42e..11181197 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -74,7 +74,7 @@ public: // Argument name contains the name of the target unix socket. data contains the // message to be sent out. Convert your message to a string before calling this function. // The function will return true on success, and false on failure. - bool send(const char name[], const std::string& data); + static bool send(const char name[], const std::string& data); private: int mIpcFd; From 9fe73f379ae1678bb1b0c321bc48f0941e278b55 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 21 Nov 2017 12:17:26 +0800 Subject: [PATCH 592/945] Check ret value for HIDL callback method Judge ret value for niNotifyCb to check HIDL return status Change-Id: I0cde3716a971941260f2fb12c9e5927bc8c8d548 CRs-fixed: 2147437 --- android/location_api/GnssAPIClient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 2745f56e..4d0ca3b1 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -405,7 +405,11 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.notificationIdEncoding = IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; - gnssNiCbIface->niNotifyCb(notificationGnss); + auto r = gnssNiCbIface->niNotifyCb(notificationGnss); + if (!r.isOk()) { + LOC_LOGE("%s] Error from niNotifyCb description=%s", + __func__, r.description().c_str()); + } } void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) From e78767907457464820b999c5a401636bac80b7de Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 17 Oct 2017 11:10:06 -0700 Subject: [PATCH 593/945] Record the first connection status notification Keep record of whether connection status was reported and report it in the response status CRs-Fixed: 2126610 Change-Id: I284f53c71f1131a73eed0adaf00b66f04e4100ac --- gnss/XtraSystemStatusObserver.cpp | 4 +++- gnss/XtraSystemStatusObserver.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 7f5288b6..810e4dd8 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -70,6 +70,8 @@ bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { } bool XtraSystemStatusObserver::updateConnectionStatus(bool connected, int32_t type) { + mIsConnectivityStatusKnown = true; + if (connected) { mConnections.insert(type); } else { @@ -148,7 +150,7 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate ss << "respondStatus" << endl; (mGpsLock == -1 ? ss : ss << mGpsLock) << endl << mConnections << endl - << mTac << endl << mMccmnc; + << mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown; return ( send(LOC_IPC_XTRA, ss.str()) ); } diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 5a79060a..706a35bc 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -47,7 +47,8 @@ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this) { + mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this), + mIsConnectivityStatusKnown (false) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); @@ -80,6 +81,7 @@ private: string mMccmnc; bool mXtraThrottle; bool mReqStatusReceived; + bool mIsConnectivityStatusKnown; class DelayLocTimer : public LocTimer { XtraSystemStatusObserver& mXSSO; From edcf00043593e125ccc798a70fb6ce2c9318444b Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 5 Dec 2017 16:59:41 +0800 Subject: [PATCH 594/945] Replace wall time Replace gettimeofday with clock_gettime CRs-fixed: 2144315 Change-Id: Ie8472d2aedcd0e63b86cc5ff100ce9bb28fd670c --- android/GnssDebug.cpp | 10 ++++------ core/SystemStatus.h | 6 +++--- gnss/GnssAdapter.cpp | 12 ++++++------ utils/loc_log.cpp | 13 ++++++------- .../elapsed_millis_since_boot.cpp | 9 +++++---- .../loc_pla/include/platform_lib_macros.h | 7 +++---- .../loc_pla/src/platform_lib_log_util.cpp | 7 +++---- .../loc_stub/src/loc_stub_time.cpp | 8 ++++---- 8 files changed, 34 insertions(+), 38 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index ff467d3b..3d2b8bda 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -79,13 +79,11 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; - timeval tv_now, tv_report; - tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; - tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; - gettimeofday(&tv_now, NULL); + struct timespec tv_now; + clock_gettime(CLOCK_MONOTONIC, &tv_now); data.position.ageSeconds = - (tv_now.tv_sec - tv_report.tv_sec) + - (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + (tv_now.tv_sec - reports.mLocation.mUtcReported.tv_sec) + + (float)((tv_now.tv_nsec - reports.mLocation.mUtcReported.tv_nsec)) / 1000000000LL; } else { data.position.valid = false; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 0c9b4b9d..4f53c0ba 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -70,10 +70,10 @@ public: static const uint32_t maxItem = 5; SystemStatusItemBase() { - timeval tv; - gettimeofday(&tv, NULL); + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); mUtcTime.tv_sec = tv.tv_sec; - mUtcTime.tv_nsec = tv.tv_usec *1000ULL; + mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; virtual ~SystemStatusItemBase() { }; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7e4c8199..0dd773e2 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2268,9 +2268,9 @@ GnssAdapter::reportNmea(const char* nmea, size_t length) GnssNmeaNotification nmeaNotification = {}; nmeaNotification.size = sizeof(GnssNmeaNotification); - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); + int64_t now = tv.tv_sec * 1000LL + tv.tv_nsec / 1000000LL; nmeaNotification.timestamp = now; nmeaNotification.nmea = nmea; nmeaNotification.length = length; @@ -2317,14 +2317,14 @@ static void* niThreadProc(void *args) NiSession* pSession = (NiSession*)args; int rc = 0; /* return code from pthread calls */ - struct timeval present_time; + struct timespec present_time; struct timespec expire_time; pthread_mutex_lock(&pSession->tLock); /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); + clock_gettime(CLOCK_MONOTONIC, &present_time); expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; - expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_nsec = present_time.tv_nsec; LOC_LOGD("%s]: time out set for abs time %ld with delay %d sec", __func__, (long)expire_time.tv_sec, pSession->respTimeLeft); diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 9fad9e6e..ca78f155 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -165,15 +165,15 @@ RETURN VALUE ===========================================================================*/ char *loc_get_time(char *time_string, size_t buf_size) { - struct timeval now; /* sec and usec */ + struct timespec now; /* sec and usec */ struct tm now_tm; /* broken-down time */ char hms_string[80]; /* HH:MM:SS */ - gettimeofday(&now, NULL); + clock_gettime(CLOCK_MONOTONIC, &now); 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)); + snprintf(time_string, buf_size, "%s.%03d", hms_string, (int) (now.tv_nsec / 1000000LL)); return time_string; } @@ -224,14 +224,13 @@ SIDE EFFECTS ===========================================================================*/ char * get_timestamp(char *str, unsigned long buf_size) { - struct timeval tv; - struct timezone tz; + struct timespec tv; int hh, mm, ss; - gettimeofday(&tv, &tz); + clock_gettime(CLOCK_MONOTONIC, &tv); 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); + snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_nsec / 1000); return str; } diff --git a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp index 6c183a80..4b35f51f 100644 --- a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp @@ -28,14 +28,15 @@ #include #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; + struct timespec t; + t.tv_sec = t.tv_nsec = 0; + clock_gettime(CLOCK_MONOTONIC, &t); + return t.tv_sec*1000000LL + t.tv_nsec/1000LL; } diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index b896b942..39e33dcc 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -52,14 +52,13 @@ extern "C" { // LE targets with no logcat support #define TS_PRINTF(format, x...) \ { \ - struct timeval tv; \ - struct timezone tz; \ + struct timespec tv; \ int hh, mm, ss; \ - gettimeofday(&tv, &tz); \ + clock_gettime(CLOCK_MONOTONIC, &tv); \ 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); \ + fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_nsec/1000, ##x); \ } #define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x) diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp index 3cb51a30..fb4f2fe0 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -30,14 +30,13 @@ char * get_timestamp(char *str, unsigned long buf_size) { - struct timeval tv; - struct timezone tz; + struct timespec tv; int hh, mm, ss; - gettimeofday(&tv, &tz); + clock_gettime(CLOCK_MONOTONIC, &tv); 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); + snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_nsec / 1000); return str; } diff --git a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp index 48149a6c..0db41cab 100644 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp @@ -33,10 +33,10 @@ 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; + struct timespec t; + t.tv_sec = t.tv_nsec = 0; + clock_gettime(CLOCK_MONOTONIC, &t); + return t.tv_sec*1000000LL + t.tv_nsec/1000LL; } int64_t elapsedMicrosSinceBoot() From 53a1aa5ed5894f5bf5c0bc5119c8509a03ab686d Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 8 Dec 2017 18:18:03 -0800 Subject: [PATCH 595/945] Fixed incorrect casting for SystemStatus::setNetworkInfo call An incorrect casting at SystemStatus::eventDataItemNotify was causing a heap overflow when trying to cast NetworkInfoDataItem into SystemStatusNetworkInfo, that is bigger. Change-Id: I3fbd88a1daf210c3c687a6f49ad868968a6efd96 CRs-fixed: 2137958 --- core/SystemStatus.cpp | 100 +++++++++++++++++++++--------------------- core/SystemStatus.h | 55 ++++++++++++++++++++--- 2 files changed, 100 insertions(+), 55 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 8954a719..9e8f1e17 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1301,12 +1301,11 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) : /****************************************************************************** SystemStatus - storing dataitems ******************************************************************************/ -bool SystemStatus::setNetworkInfo(const SystemStatusNetworkInfo& s) +template +bool SystemStatus::setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s) { - mConnected = s.mConnected; - SystemStatusNetworkInfo sout = s; - sout.mType = s.getType(); - return setIteminReport(mCache.mNetworkInfo, sout); + TYPE_SYSTEMSTATUS_ITEM sout(s); + return setIteminReport(report, sout); } template @@ -1451,93 +1450,94 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) switch(dataitem->getId()) { case AIRPLANEMODE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mAirplaneMode, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mAirplaneMode, + *(static_cast(dataitem))); break; case ENH_DATA_ITEM_ID: - ret = setIteminReport(mCache.mENH, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mENH, + *(static_cast(dataitem))); break; case GPSSTATE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mGPSState, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mGPSState, + *(static_cast(dataitem))); break; case NLPSTATUS_DATA_ITEM_ID: - ret = setIteminReport(mCache.mNLPStatus, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mNLPStatus, + *(static_cast(dataitem))); break; case WIFIHARDWARESTATE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mWifiHardwareState, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mWifiHardwareState, + *(static_cast(dataitem))); break; case NETWORKINFO_DATA_ITEM_ID: - // need special handling for this item to map emums - ret = setNetworkInfo( - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mNetworkInfo, + *(static_cast(dataitem))); break; case RILSERVICEINFO_DATA_ITEM_ID: - ret = setIteminReport(mCache.mRilServiceInfo, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mRilServiceInfo, + *(static_cast(dataitem))); break; case RILCELLINFO_DATA_ITEM_ID: - ret = setIteminReport(mCache.mRilCellInfo, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mRilCellInfo, + *(static_cast(dataitem))); break; case SERVICESTATUS_DATA_ITEM_ID: - ret = setIteminReport(mCache.mServiceStatus, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mServiceStatus, + *(static_cast(dataitem))); break; case MODEL_DATA_ITEM_ID: - ret = setIteminReport(mCache.mModel, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mModel, + *(static_cast(dataitem))); break; case MANUFACTURER_DATA_ITEM_ID: - ret = setIteminReport(mCache.mManufacturer, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mManufacturer, + *(static_cast(dataitem))); break; case ASSISTED_GPS_DATA_ITEM_ID: - ret = setIteminReport(mCache.mAssistedGps, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mAssistedGps, + *(static_cast(dataitem))); break; case SCREEN_STATE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mScreenState, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mScreenState, + *(static_cast(dataitem))); break; case POWER_CONNECTED_STATE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mPowerConnectState, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mPowerConnectState, + *(static_cast(dataitem))); break; case TIMEZONE_CHANGE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mTimeZoneChange, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mTimeZoneChange, + *(static_cast(dataitem))); break; case TIME_CHANGE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mTimeChange, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mTimeChange, + *(static_cast(dataitem))); break; case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID: - ret = setIteminReport(mCache.mWifiSupplicantStatus, - *(static_cast(dataitem))); + ret = setItemBaseinReport( + mCache.mWifiSupplicantStatus, + *(static_cast(dataitem))); break; case SHUTDOWN_STATE_DATA_ITEM_ID: - ret = setIteminReport(mCache.mShutdownState, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mShutdownState, + *(static_cast(dataitem))); break; case TAC_DATA_ITEM_ID: - ret = setIteminReport(mCache.mTac, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mTac, + *(static_cast(dataitem))); break; case MCCMNC_DATA_ITEM_ID: - ret = setIteminReport(mCache.mMccMnc, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mMccMnc, + *(static_cast(dataitem))); break; case BTLE_SCAN_DATA_ITEM_ID: - ret = setIteminReport(mCache.mBtDeviceScanDetail, - *(static_cast(dataitem))); + ret = setItemBaseinReport(mCache.mBtDeviceScanDetail, + *(static_cast(dataitem))); break; case BT_SCAN_DATA_ITEM_ID: - ret = setIteminReport(mCache.mBtLeDeviceScanDetail, - *(static_cast(dataitem))); + ret = setItemBaseinReport( + mCache.mBtLeDeviceScanDetail, + *(static_cast(dataitem))); break; default: break; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 0c9b4b9d..ae6c3e1d 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -391,6 +391,8 @@ class SystemStatusAirplaneMode : public SystemStatusItemBase, public: inline SystemStatusAirplaneMode(bool mode=false) : AirplaneModeDataItemBase(mode) {} + inline SystemStatusAirplaneMode(const AirplaneModeDataItemBase& itemBase) : + AirplaneModeDataItemBase(itemBase) {} inline bool equals(const SystemStatusAirplaneMode& peer) { return (mMode == peer.mMode); } @@ -402,6 +404,8 @@ class SystemStatusENH : public SystemStatusItemBase, public: inline SystemStatusENH(bool enabled=false) : ENHDataItemBase(enabled) {} + inline SystemStatusENH(const ENHDataItemBase& itemBase) : + ENHDataItemBase(itemBase) {} inline bool equals(const SystemStatusENH& peer) { return (mEnabled == peer.mEnabled); } @@ -413,6 +417,8 @@ class SystemStatusGpsState : public SystemStatusItemBase, public: inline SystemStatusGpsState(bool enabled=false) : GPSStateDataItemBase(enabled) {} + inline SystemStatusGpsState(const GPSStateDataItemBase& itemBase) : + GPSStateDataItemBase(itemBase) {} inline bool equals(const SystemStatusGpsState& peer) { return (mEnabled == peer.mEnabled); } @@ -427,6 +433,8 @@ class SystemStatusNLPStatus : public SystemStatusItemBase, public: inline SystemStatusNLPStatus(bool enabled=false) : NLPStatusDataItemBase(enabled) {} + inline SystemStatusNLPStatus(const NLPStatusDataItemBase& itemBase) : + NLPStatusDataItemBase(itemBase) {} inline bool equals(const SystemStatusNLPStatus& peer) { return (mEnabled == peer.mEnabled); } @@ -438,6 +446,8 @@ class SystemStatusWifiHardwareState : public SystemStatusItemBase, public: inline SystemStatusWifiHardwareState(bool enabled=false) : WifiHardwareStateDataItemBase(enabled) {} + inline SystemStatusWifiHardwareState(const WifiHardwareStateDataItemBase& itemBase) : + WifiHardwareStateDataItemBase(itemBase) {} inline bool equals(const SystemStatusWifiHardwareState& peer) { return (mEnabled == peer.mEnabled); } @@ -461,6 +471,10 @@ public: available, connected, roaming) {} + inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) : + NetworkInfoDataItemBase(itemBase) { + mType = itemBase.getType(); + } inline bool equals(const SystemStatusNetworkInfo& peer) { if ((mType == peer.mType) && (mTypeName == peer.mTypeName) && @@ -470,8 +484,8 @@ public: (mRoaming == peer.mRoaming)) { return true; } - return false; - } + return false; + } inline void dump(void) override { LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); } @@ -483,6 +497,8 @@ class SystemStatusServiceInfo : public SystemStatusItemBase, public: inline SystemStatusServiceInfo() : RilServiceInfoDataItemBase() {} + inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) : + RilServiceInfoDataItemBase(itemBase) {} inline bool equals(const SystemStatusServiceInfo& /*peer*/) { return true; } @@ -494,6 +510,8 @@ class SystemStatusRilCellInfo : public SystemStatusItemBase, public: inline SystemStatusRilCellInfo() : RilCellInfoDataItemBase() {} + inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) : + RilCellInfoDataItemBase(itemBase) {} inline bool equals(const SystemStatusRilCellInfo& /*peer*/) { return true; } @@ -505,6 +523,8 @@ class SystemStatusServiceStatus : public SystemStatusItemBase, public: inline SystemStatusServiceStatus(int32_t mServiceState=0) : ServiceStatusDataItemBase(mServiceState) {} + inline SystemStatusServiceStatus(const ServiceStatusDataItemBase& itemBase) : + ServiceStatusDataItemBase(itemBase) {} inline bool equals(const SystemStatusServiceStatus& peer) { return (mServiceState == peer.mServiceState); } @@ -516,6 +536,8 @@ class SystemStatusModel : public SystemStatusItemBase, public: inline SystemStatusModel(string name="") : ModelDataItemBase(name) {} + inline SystemStatusModel(const ModelDataItemBase& itemBase) : + ModelDataItemBase(itemBase) {} inline bool equals(const SystemStatusModel& peer) { return (mModel == peer.mModel); } @@ -527,6 +549,8 @@ class SystemStatusManufacturer : public SystemStatusItemBase, public: inline SystemStatusManufacturer(string name="") : ManufacturerDataItemBase(name) {} + inline SystemStatusManufacturer(const ManufacturerDataItemBase& itemBase) : + ManufacturerDataItemBase(itemBase) {} inline bool equals(const SystemStatusManufacturer& peer) { return (mManufacturer == peer.mManufacturer); } @@ -538,6 +562,8 @@ class SystemStatusAssistedGps : public SystemStatusItemBase, public: inline SystemStatusAssistedGps(bool enabled=false) : AssistedGpsDataItemBase(enabled) {} + inline SystemStatusAssistedGps(const AssistedGpsDataItemBase& itemBase) : + AssistedGpsDataItemBase(itemBase) {} inline bool equals(const SystemStatusAssistedGps& peer) { return (mEnabled == peer.mEnabled); } @@ -549,6 +575,8 @@ class SystemStatusScreenState : public SystemStatusItemBase, public: inline SystemStatusScreenState(bool state=false) : ScreenStateDataItemBase(state) {} + inline SystemStatusScreenState(const ScreenStateDataItemBase& itemBase) : + ScreenStateDataItemBase(itemBase) {} inline bool equals(const SystemStatusScreenState& peer) { return (mState == peer.mState); } @@ -560,6 +588,8 @@ class SystemStatusPowerConnectState : public SystemStatusItemBase, public: inline SystemStatusPowerConnectState(bool state=false) : PowerConnectStateDataItemBase(state) {} + inline SystemStatusPowerConnectState(const PowerConnectStateDataItemBase& itemBase) : + PowerConnectStateDataItemBase(itemBase) {} inline bool equals(const SystemStatusPowerConnectState& peer) { return (mState == peer.mState); } @@ -572,6 +602,8 @@ public: inline SystemStatusTimeZoneChange( int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) : TimeZoneChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {} + inline SystemStatusTimeZoneChange(const TimeZoneChangeDataItemBase& itemBase) : + TimeZoneChangeDataItemBase(itemBase) {} inline bool equals(const SystemStatusTimeZoneChange& peer) { return ((mCurrTimeMillis == peer.mCurrTimeMillis) && (mRawOffsetTZ == peer.mRawOffsetTZ) && @@ -586,6 +618,8 @@ public: inline SystemStatusTimeChange( int64_t currTimeMillis=0ULL, int32_t rawOffset=0, int32_t dstOffset=0) : TimeChangeDataItemBase(currTimeMillis, rawOffset, dstOffset) {} + inline SystemStatusTimeChange(const TimeChangeDataItemBase& itemBase) : + TimeChangeDataItemBase(itemBase) {} inline bool equals(const SystemStatusTimeChange& peer) { return ((mCurrTimeMillis == peer.mCurrTimeMillis) && (mRawOffsetTZ == peer.mRawOffsetTZ) && @@ -599,6 +633,8 @@ class SystemStatusWifiSupplicantStatus : public SystemStatusItemBase, public: inline SystemStatusWifiSupplicantStatus() : WifiSupplicantStatusDataItemBase() {} + inline SystemStatusWifiSupplicantStatus(const WifiSupplicantStatusDataItemBase& itemBase) : + WifiSupplicantStatusDataItemBase(itemBase) {} inline bool equals(const SystemStatusWifiSupplicantStatus& peer) { return ((mState == peer.mState) && (mApMacAddressValid == peer.mApMacAddressValid) && @@ -613,6 +649,8 @@ class SystemStatusShutdownState : public SystemStatusItemBase, public: inline SystemStatusShutdownState(bool state=false) : ShutdownStateDataItemBase(state) {} + inline SystemStatusShutdownState(const ShutdownStateDataItemBase& itemBase) : + ShutdownStateDataItemBase(itemBase) {} inline bool equals(const SystemStatusShutdownState& peer) { return (mState == peer.mState); } @@ -624,7 +662,8 @@ class SystemStatusTac : public SystemStatusItemBase, public: inline SystemStatusTac(std::string value="") : TacDataItemBase(value) {} - + inline SystemStatusTac(const TacDataItemBase& itemBase) : + TacDataItemBase(itemBase) {} inline bool equals(const SystemStatusTac& peer) { return (mValue == peer.mValue); } @@ -639,6 +678,8 @@ class SystemStatusMccMnc : public SystemStatusItemBase, public: inline SystemStatusMccMnc(std::string value="") : MccmncDataItemBase(value) {} + inline SystemStatusMccMnc(const MccmncDataItemBase& itemBase) : + MccmncDataItemBase(itemBase) {} inline bool equals(const SystemStatusMccMnc& peer) { return (mValue == peer.mValue); } @@ -653,6 +694,8 @@ class SystemStatusBtDeviceScanDetail : public SystemStatusItemBase, public: inline SystemStatusBtDeviceScanDetail() : BtDeviceScanDetailsDataItemBase() {} + inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItemBase& itemBase) : + BtDeviceScanDetailsDataItemBase(itemBase) {} inline bool equals(const SystemStatusBtDeviceScanDetail& /*peer*/) { return true; } @@ -664,6 +707,8 @@ class SystemStatusBtleDeviceScanDetail : public SystemStatusItemBase, public: inline SystemStatusBtleDeviceScanDetail() : BtLeDeviceScanDetailsDataItemBase() {} + inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItemBase& itemBase) : + BtLeDeviceScanDetailsDataItemBase(itemBase) {} inline bool equals(const SystemStatusBtleDeviceScanDetail& /*peer*/) { return true; } @@ -739,8 +784,8 @@ private: SystemStatusReports mCache; bool mConnected; - // set dataitem derived item in report cache - bool setNetworkInfo(const SystemStatusNetworkInfo& s); + template + bool setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s); template bool setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); From f3f7a4bf41487215ffb3eacb5cfff096b2577bf4 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 12 Dec 2017 16:58:55 -0800 Subject: [PATCH 596/945] Fix incorrect cast to avoid integer overflow Fix incorrect cast in converting time uncertainty from integer based source to float. Change-Id: Ibb75eb1a2d925a7e7ce13275f09a618f241c31bf CRs-Fixed: 2157401 --- gnss/GnssAdapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7e4c8199..8ae382f5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3015,8 +3015,8 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); r.mTime.timeUncertaintyNs = - (float)((reports.mTimeAndClock.back().mTimeUnc + - reports.mTimeAndClock.back().mLeapSecUnc)*1000); + ((float)(reports.mTimeAndClock.back().mTimeUnc) + + (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f", From 99e0f1142873f203999646212c573373ab76c65d Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 17 Nov 2017 13:47:12 -0800 Subject: [PATCH 597/945] Location Utils - LocIpc class enhancement Add LocIpcSender class and add an overloaded send method in LocIpc class that takes binary data block. Change-Id: I102f23fe8bf378c3bed5cac0086aa9773c62727b CRs-Fixed: 2144883 --- utils/LocIpc.cpp | 64 +++++++++++++++++++++++++++++++----------------- utils/LocIpc.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 23 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 38889d0f..0ee156ee 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -49,7 +49,7 @@ namespace loc_util { #endif #define LOG_TAG "LocSvc_LocIpc" -#define LOC_MSG_BUF_LEN 1024 +#define LOC_MSG_BUF_LEN 8192 #define LOC_MSG_HEAD "$MSGLEN$" class LocIpcRunnable : public LocRunnable { @@ -101,28 +101,32 @@ bool LocIpc::startListeningBlocking(const std::string& name) { mIpcFd = fd; ssize_t nBytes = 0; - std::vector buf(LOC_MSG_BUF_LEN); - while ((nBytes = ::recvfrom(mIpcFd, buf.data(), buf.size(), 0, NULL, NULL)) >= 0) { - if (nBytes == 0) { + std::string msg = ""; + while (1) { + msg.resize(LOC_MSG_BUF_LEN); + nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); + if (nBytes < 0) { + break; + } else if (nBytes == 0) { continue; } - std::string msg; - if (strncmp(buf.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { // short message - msg.append(buf.data(), nBytes); + msg.resize(nBytes); onReceive(msg); - } else { // long message size_t msgLen = 0; - sscanf(buf.data(), LOC_MSG_HEAD"%zu", &msgLen); - while (msg.length() < msgLen && - (nBytes = recvfrom(mIpcFd, buf.data(), buf.size(), 0, NULL, NULL)) >= 0) { - msg.append(buf.data(), nBytes); + sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); + msg.resize(msgLen); + size_t msgLenReceived = 0; + while ((msgLenReceived < msgLen) && (nBytes > 0)) { + nBytes = recvfrom(mIpcFd, (void*)&(msg[msgLenReceived]), + msg.size() - msgLenReceived, 0, NULL, NULL); + msgLenReceived += nBytes; } - - if (nBytes >= 0) { + if (nBytes > 0) { onReceive(msg); } else { break; @@ -154,7 +158,13 @@ void LocIpc::stopListening() { } bool LocIpc::send(const char name[], const std::string& data) { - int fd = ::socket(AF_UNIX, SOCK_DGRAM, 0); + return send(name, (const uint8_t*)data.c_str(), data.length()); +} + +bool LocIpc::send(const char name[], const uint8_t data[], uint32_t length) { + + bool result = true; + int fd = ::socket(AF_UNIX, SOCK_DGRAM, 0); if (fd < 0) { LOC_LOGe("create socket error. reason:%s", strerror(errno)); return false; @@ -163,28 +173,38 @@ bool LocIpc::send(const char name[], const std::string& data) { struct sockaddr_un addr = { .sun_family = AF_UNIX }; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", name); + result = sendData(fd, addr, data, length); + + (void)::close(fd); + return result; +} + + +bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uint32_t length) { + bool result = true; - if (data.length() <= LOC_MSG_BUF_LEN) { - if (::sendto(fd, data.c_str(), data.length(), 0, + + if (length <= LOC_MSG_BUF_LEN) { + if (::sendto(fd, data, length, 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) { LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); result = false; } } else { std::string head = LOC_MSG_HEAD; - head.append(std::to_string(data.length())); + head.append(std::to_string(length)); if (::sendto(fd, head.c_str(), head.length(), 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) { LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); result = false; } else { size_t sentBytes = 0; - while(sentBytes < data.length()) { - size_t partLen = data.length() - sentBytes; + while(sentBytes < length) { + size_t partLen = length - sentBytes; if (partLen > LOC_MSG_BUF_LEN) { partLen = LOC_MSG_BUF_LEN; } - ssize_t rv = ::sendto(fd, data.c_str() + sentBytes, partLen, 0, + ssize_t rv = ::sendto(fd, data + sentBytes, partLen, 0, (struct sockaddr*)&addr, sizeof(addr)); if (rv < 0) { LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); @@ -195,8 +215,6 @@ bool LocIpc::send(const char name[], const std::string& data) { } } } - - (void)::close(fd); return result; } diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 11181197..8bc13b7d 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -32,11 +32,18 @@ #include #include +#include +#include +#include +#include #include namespace loc_util { +class LocIpcSender; + class LocIpc { +friend LocIpcSender; public: inline LocIpc() : mIpcFd(-1), mStopRequested(false), mRunnable(nullptr) {} inline virtual ~LocIpc() { stopListening(); } @@ -75,14 +82,69 @@ public: // message to be sent out. Convert your message to a string before calling this function. // The function will return true on success, and false on failure. static bool send(const char name[], const std::string& data); + static bool send(const char name[], const uint8_t data[], uint32_t length); private: + static bool sendData(int fd, const sockaddr_un& addr, + const uint8_t data[], uint32_t length); + int mIpcFd; bool mStopRequested; LocThread mThread; std::unique_ptr mRunnable; }; +class LocIpcSender { +public: + // Constructor of LocIpcSender class + // + // Argument destSocket contains the full path name of destination socket. + // This class hides generated fd and destination address object from user. + inline LocIpcSender(const char* destSocket): + LocIpcSender(std::make_shared(::socket(AF_UNIX, SOCK_DGRAM, 0)), destSocket) { + if (-1 == *mSocket) { + mSocket = nullptr; + } + } + + // Replicate a new LocIpcSender object with new destination socket. + inline LocIpcSender* replicate(const char* destSocket) { + return (nullptr == mSocket) ? nullptr : new LocIpcSender(mSocket, destSocket); + } + + inline ~LocIpcSender() { + if (nullptr != mSocket && mSocket.unique()) { + ::close(*mSocket); + } + } + + // Send out a message. + // Call this function to send a message + // + // Argument data and length contains the message to be sent out. + // Return true when succeeded + inline bool send(const uint8_t data[], uint32_t length) { + bool rtv = false; + if (nullptr != mSocket && nullptr != data) { + ssize_t rv = LocIpc::sendData(*mSocket, mDestAddr, data, length); + rtv = (rv == (int)length); + } + return rtv; + } + +private: + std::shared_ptr mSocket; + struct sockaddr_un mDestAddr; + + inline LocIpcSender( + const std::shared_ptr& mySocket, const char* destSocket) : mSocket(mySocket) { + if ((nullptr != mSocket) && (-1 != *mSocket) && (nullptr != destSocket)) { + mDestAddr.sun_family = AF_UNIX; + snprintf(mDestAddr.sun_path, sizeof(mDestAddr.sun_path), "%s", destSocket); + } + } +}; + } #endif //__LOC_SOCKET__ From 03bc75f2984c4e9cbe45004f700df8916c298c9c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 15 Dec 2017 18:53:25 -0800 Subject: [PATCH 598/945] fixing the location api level race condition on callbacks At the layer right under HIDL impl, where the callback objs are received from HIDL and used by HAL layer, there is race condition volnerability which could yield using a incompletely copied sp obj. Added mutex protection. Change-Id: I611db590d1fadbe43c74db71a1ea906dbe067c6d CRs-Fixed: 2144976 --- android/location_api/GnssAPIClient.cpp | 31 ++++++++++++++----- android/location_api/GnssAPIClient.h | 5 ++- android/location_api/MeasurementAPIClient.cpp | 10 ++++-- android/location_api/MeasurementAPIClient.h | 4 +-- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 4d0ca3b1..996bbeea 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -81,8 +81,10 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, { LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + mMutex.lock(); mGnssCbIface = gpsCb; mGnssNiCbIface = niCb; + mMutex.unlock(); LocationCallbacks locationCallbacks; memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); @@ -278,7 +280,10 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); mLocationCapabilitiesMask = capabilitiesMask; mLocationCapabilitiesCached = true; - sp gnssCbIface = mGnssCbIface; + + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (gnssCbIface != nullptr) { uint32_t data = 0; @@ -322,7 +327,9 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) void GnssAPIClient::onTrackingCb(Location location) { LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); - sp gnssCbIface = mGnssCbIface; + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (gnssCbIface != nullptr) { GnssLocation gnssLocation; @@ -338,7 +345,9 @@ void GnssAPIClient::onTrackingCb(Location location) void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) { LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id); - sp gnssNiCbIface = mGnssNiCbIface; + mMutex.lock(); + auto gnssNiCbIface(mGnssNiCbIface); + mMutex.unlock(); if (gnssNiCbIface == nullptr) { LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__); @@ -415,7 +424,9 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); - sp gnssCbIface = mGnssCbIface; + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (gnssCbIface != nullptr) { IGnssCallback::GnssSvStatus svStatus; @@ -430,7 +441,9 @@ void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) { - sp gnssCbIface = mGnssCbIface; + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (gnssCbIface != nullptr) { android::hardware::hidl_string nmeaString; @@ -447,7 +460,9 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) void GnssAPIClient::onStartTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); - sp gnssCbIface = mGnssCbIface; + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); @@ -466,7 +481,9 @@ void GnssAPIClient::onStartTrackingCb(LocationError error) void GnssAPIClient::onStopTrackingCb(LocationError error) { LOC_LOGD("%s]: (%d)", __FUNCTION__, error); - sp gnssCbIface = mGnssCbIface; + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); diff --git a/android/location_api/GnssAPIClient.h b/android/location_api/GnssAPIClient.h index 295a9e9b..b5cffb1e 100644 --- a/android/location_api/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -30,7 +30,7 @@ #ifndef GNSS_API_CLINET_H #define GNSS_API_CLINET_H - +#include #include #include #include @@ -91,11 +91,10 @@ public: private: sp mGnssCbIface; sp mGnssNiCbIface; - + std::mutex mMutex; LocationAPIControlClient* mControlClient; LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; - LocationOptions mLocationOptions; }; diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index dd7ceac5..731c7eda 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -66,7 +66,9 @@ MeasurementAPIClient::measurementSetCallback(const sp& { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + mMutex.lock(); mGnssMeasurementCbIface = callback; + mMutex.unlock(); LocationCallbacks locationCallbacks; memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); @@ -116,10 +118,14 @@ void MeasurementAPIClient::onGnssMeasurementsCb( LOC_LOGD("%s]: (count: %zu active: %zu)", __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { - if (mGnssMeasurementCbIface != nullptr) { + mMutex.lock(); + auto gnssMeasurementCbIface(mGnssMeasurementCbIface); + mMutex.unlock(); + + if (gnssMeasurementCbIface != nullptr) { IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); - auto r = mGnssMeasurementCbIface->GnssMeasurementCb(gnssData); + auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); if (!r.isOk()) { LOC_LOGE("%s] Error from GnssMeasurementCb description=%s", __func__, r.description().c_str()); diff --git a/android/location_api/MeasurementAPIClient.h b/android/location_api/MeasurementAPIClient.h index 422564d4..8de13264 100644 --- a/android/location_api/MeasurementAPIClient.h +++ b/android/location_api/MeasurementAPIClient.h @@ -30,7 +30,7 @@ #ifndef MEASUREMENT_API_CLINET_H #define MEASUREMENT_API_CLINET_H - +#include #include #include #include @@ -63,7 +63,7 @@ public: private: sp mGnssMeasurementCbIface; - + std::mutex mMutex; bool mTracking; }; From 13c41211a7bf48ebf29612f24ce71954f59b1f35 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 18 Dec 2017 21:45:42 -0800 Subject: [PATCH 599/945] debug nmea should not sent to upper layer Debug nmea is a way HAL gets GNSS engine debug information from modem. It is provided to developers in the for bugreoprt. Those NMEAs should be discarded once information is extracted out. But by mistake, they are sent to GnssLocationProvider. They will be in the unknown format to apps, and they may get truncated too. Dhanged the condition so these debug nmeas get discarded before they can possibly passed on to GnssLocaitonProvider. Change-Id: I1a8400201e734a37e730321f6c6e5707c71bd3f0 CRs-Fixed: 2160866 --- core/SystemStatus.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 9e8f1e17..8dd7e615 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1350,11 +1350,10 @@ void SystemStatus::getIteminReport(TYPE_REPORT& reportout, const TYPE_ITEM& c) c @param[In] data pointer to the NMEA string @param[In] len length of the NMEA string -@return true when successfully done +@return true when the NMEA is consumed by the method. ******************************************************************************/ bool SystemStatus::setNmeaString(const char *data, uint32_t len) { - bool ret = false; if (!loc_nmea_is_debug(data, len)) { return false; } @@ -1365,43 +1364,43 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) pthread_mutex_lock(&mMutexSystemStatus); // parse the received nmea strings here - if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) { + if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) { SystemStatusPQWM1 s = SystemStatusPQWM1parser(buf, len).get(); - ret |= setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s)); - ret |= setIteminReport(mCache.mXoState, SystemStatusXoState(s)); - ret |= setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s)); - ret |= setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s)); + setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s)); + setIteminReport(mCache.mXoState, SystemStatusXoState(s)); + setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s)); + setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s)); } else if (0 == strncmp(data, "$PQWP1", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mInjectedPosition, + setIteminReport(mCache.mInjectedPosition, SystemStatusInjectedPosition(SystemStatusPQWP1parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP2", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mBestPosition, + setIteminReport(mCache.mBestPosition, SystemStatusBestPosition(SystemStatusPQWP2parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP3", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mXtra, + setIteminReport(mCache.mXtra, SystemStatusXtra(SystemStatusPQWP3parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP4", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mEphemeris, + setIteminReport(mCache.mEphemeris, SystemStatusEphemeris(SystemStatusPQWP4parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP5", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mSvHealth, + setIteminReport(mCache.mSvHealth, SystemStatusSvHealth(SystemStatusPQWP5parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP6", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mPdr, + setIteminReport(mCache.mPdr, SystemStatusPdr(SystemStatusPQWP6parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWP7", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mNavData, + setIteminReport(mCache.mNavData, SystemStatusNavData(SystemStatusPQWP7parser(buf, len).get())); } else if (0 == strncmp(data, "$PQWS1", SystemStatusNmeaBase::NMEA_MINSIZE)) { - ret = setIteminReport(mCache.mPositionFailure, + setIteminReport(mCache.mPositionFailure, SystemStatusPositionFailure(SystemStatusPQWS1parser(buf, len).get())); } else { @@ -1409,7 +1408,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len) } pthread_mutex_unlock(&mMutexSystemStatus); - return ret; + return true; } /****************************************************************************** From 57a5b186c529aa99e365d7a4c781bda3e39e1ee8 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 21 Dec 2017 20:03:40 +0800 Subject: [PATCH 600/945] Remove system status reset upon delete aiding data Delete aiding data command would trigger default gnss engine state set. Rename setDeafultReport with setDefaultGnssEngineStates and remove system settings reset in it. Change-Id: I7b5dffe3191b24e9f5bb6d887705fca34ed94013 CRs-fixed: 2151350 --- core/SystemStatus.cpp | 25 +------------------------ core/SystemStatus.h | 2 +- gnss/GnssAdapter.cpp | 2 +- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 9e8f1e17..4d0c7ede 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1656,7 +1656,7 @@ bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) con @return true when successfully done ******************************************************************************/ -bool SystemStatus::setDefaultReport(void) +bool SystemStatus::setDefaultGnssEngineStates(void) { pthread_mutex_lock(&mMutexSystemStatus); @@ -1677,29 +1677,6 @@ bool SystemStatus::setDefaultReport(void) setDefaultIteminReport(mCache.mPositionFailure, SystemStatusPositionFailure()); - setDefaultIteminReport(mCache.mAirplaneMode, SystemStatusAirplaneMode()); - setDefaultIteminReport(mCache.mENH, SystemStatusENH()); - setDefaultIteminReport(mCache.mGPSState, SystemStatusGpsState()); - setDefaultIteminReport(mCache.mNLPStatus, SystemStatusNLPStatus()); - setDefaultIteminReport(mCache.mWifiHardwareState, SystemStatusWifiHardwareState()); - setDefaultIteminReport(mCache.mNetworkInfo, SystemStatusNetworkInfo()); - setDefaultIteminReport(mCache.mRilServiceInfo, SystemStatusServiceInfo()); - setDefaultIteminReport(mCache.mRilCellInfo, SystemStatusRilCellInfo()); - setDefaultIteminReport(mCache.mServiceStatus, SystemStatusServiceStatus()); - setDefaultIteminReport(mCache.mModel, SystemStatusModel()); - setDefaultIteminReport(mCache.mManufacturer, SystemStatusManufacturer()); - setDefaultIteminReport(mCache.mAssistedGps, SystemStatusAssistedGps()); - setDefaultIteminReport(mCache.mScreenState, SystemStatusScreenState()); - setDefaultIteminReport(mCache.mPowerConnectState, SystemStatusPowerConnectState()); - setDefaultIteminReport(mCache.mTimeZoneChange, SystemStatusTimeZoneChange()); - setDefaultIteminReport(mCache.mTimeChange, SystemStatusTimeChange()); - setDefaultIteminReport(mCache.mWifiSupplicantStatus, SystemStatusWifiSupplicantStatus()); - setDefaultIteminReport(mCache.mShutdownState, SystemStatusShutdownState()); - setDefaultIteminReport(mCache.mTac, SystemStatusTac()); - setDefaultIteminReport(mCache.mMccMnc, SystemStatusMccMnc()); - setDefaultIteminReport(mCache.mBtDeviceScanDetail, SystemStatusBtDeviceScanDetail()); - setDefaultIteminReport(mCache.mBtLeDeviceScanDetail, SystemStatusBtleDeviceScanDetail()); - pthread_mutex_unlock(&mMutexSystemStatus); return true; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index e4d06dab..7e3309df 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -808,7 +808,7 @@ public: bool eventDataItemNotify(IDataItemCore* dataitem); bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; - bool setDefaultReport(void); + bool setDefaultGnssEngineStates(void); bool eventConnectionStatus(bool connected, int8_t type); }; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 2ba131e5..c1e55ad1 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -922,7 +922,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) mAdapter.reportResponse(err, mSessionId); SystemStatus* s = mAdapter.getSystemStatus(); if ((nullptr != s) && (mData.deleteAll)) { - s->setDefaultReport(); + s->setDefaultGnssEngineStates(); } } }; From 65e3760d6d7cd5c7e3a8dccd6e2b5f8b5b357ef7 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 19 Oct 2017 15:29:12 -0700 Subject: [PATCH 601/945] Added FDCL reg mask bit and feature support bit Also change the reg mask to 64 bit since we now have more than 32 possible bits. CRs-fixed: 2129134 Change-Id: I006f5fffac3d9dd2d96ca82d84f49bde96bc0f55 --- utils/gps_extended_c.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index a24e7848..afe47ccc 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -115,7 +115,9 @@ enum loc_registration_mask_status { 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_DEBUG_NMEA_V02 /**< Support debug NMEA feature */ + LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02, /**< Support debug NMEA feature */ + LOC_SUPPORTED_FEATURE_GNSS_ONLY_POSITION_REPORT, /**< Support GNSS Only position reports */ + LOC_SUPPORTED_FEATURE_FDCL /**< Support FDCL */ } loc_supported_feature_enum; typedef struct { @@ -586,7 +588,8 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT, // Geofence dwell report LOC_API_ADAPTER_REQUEST_SRN_DATA, // request srn data from AP LOC_API_ADAPTER_REQUEST_POSITION_INJECTION, // Position injection request - LOC_API_ADAPTER_BATCH_STATUS, // batch status + LOC_API_ADAPTER_BATCH_STATUS, // batch status + LOC_API_ADAPTER_FDCL_SERVICE_REQ, // FDCL service request LOC_API_ADAPTER_EVENT_MAX }; @@ -622,9 +625,10 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REQUEST_SRN_DATA (1< Date: Wed, 10 Jan 2018 16:34:18 +0530 Subject: [PATCH 602/945] Changing GNSS HAL service class to hal Changing GNSS HAL service class from main to hal Change-Id: I72250b1645981b0ec5a5a8faf3fe16dafb51646a CRs-Fixed: 2164972 --- android/android.hardware.gnss@1.0-service-qti.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.0-service-qti.rc index d4d40fa0..b5da6f97 100644 --- a/android/android.hardware.gnss@1.0-service-qti.rc +++ b/android/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti - class main + class hal user gps group system gps radio From 02862b85778d1b4686561a7c7183f62b862316ec Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 10 Jan 2018 00:36:54 +0530 Subject: [PATCH 603/945] Allow SUPL server NONE config Clear SUPL server on Modem if configured as NONE in HLOS config. CRs-Fixed: 2164682 Change-Id: If104550fddaa64be43e446f8691cab60b1541013 --- gnss/GnssAdapter.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index c1e55ad1..c2a353f3 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -584,21 +584,27 @@ GnssAdapter::setSuplHostServer(const char* server, int port) LocationError locErr = LOCATION_ERROR_SUCCESS; if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { char serverUrl[MAX_URL_LEN] = {}; - int32_t length = 0; + int32_t length = -1; const char noHost[] = "NONE"; - if ((NULL == server) || (server[0] == 0) || (port == 0) || + + locErr = LOCATION_ERROR_INVALID_PARAMETER; + + if ((NULL == server) || (server[0] == 0) || (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { - locErr = LOCATION_ERROR_INVALID_PARAMETER; - } else { + serverUrl[0] = NULL; + length = 0; + mServerUrl.clear(); + } else if (port > 0) { length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", server, port); - if (length > 0 && strncasecmp(getServerUrl().c_str(), - serverUrl, sizeof(serverUrl)) != 0) { - setServerUrl(serverUrl); - locErr = mLocApi->setServer(serverUrl, length); - if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", - __func__, serverUrl); - } + } + + if (length >= 0 && strncasecmp(getServerUrl().c_str(), + serverUrl, sizeof(serverUrl)) != 0) { + setServerUrl(serverUrl); + locErr = mLocApi->setServer(serverUrl, length); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", + __func__, serverUrl); } } } From 52f5cfe9d7d9a6c4a2c7f047bd01cd85ed25d2d9 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Thu, 11 Jan 2018 15:25:27 +0800 Subject: [PATCH 604/945] init condition with attr CLOCK_MONOTONIC Use MONOTONIC time to keep consistence with pthread_cond_timedwait. CRs-fixed: 2169171 Change-Id: I25f308ff343e2f9f938275a572fbff35b659e782 --- gnss/GnssAdapter.cpp | 13 ++++++++++--- utils/loc_log.cpp | 13 +++++++------ .../loc_pla/include/platform_lib_macros.h | 7 ++++--- .../loc_pla/src/platform_lib_log_util.cpp | 7 ++++--- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index c1e55ad1..d30094d2 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -81,6 +81,13 @@ GnssAdapter::GnssAdapter() : LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; + pthread_condattr_t condAttr; + pthread_condattr_init(&condAttr); + pthread_condattr_setclock(&condAttr, CLOCK_MONOTONIC); + pthread_cond_init(&mNiData.session.tCond, &condAttr); + pthread_cond_init(&mNiData.sessionEs.tCond, &condAttr); + pthread_condattr_destroy(&condAttr); + /* Set ATL open/close callbacks */ AgpsAtlOpenStatusCb atlOpenStatusCb = [this](int handle, int isSuccess, char* apn, @@ -2268,9 +2275,9 @@ GnssAdapter::reportNmea(const char* nmea, size_t length) GnssNmeaNotification nmeaNotification = {}; nmeaNotification.size = sizeof(GnssNmeaNotification); - struct timespec tv; - clock_gettime(CLOCK_MONOTONIC, &tv); - int64_t now = tv.tv_sec * 1000LL + tv.tv_nsec / 1000000LL; + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; nmeaNotification.timestamp = now; nmeaNotification.nmea = nmea; nmeaNotification.length = length; diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index ca78f155..9fad9e6e 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -165,15 +165,15 @@ RETURN VALUE ===========================================================================*/ char *loc_get_time(char *time_string, size_t buf_size) { - struct timespec now; /* sec and usec */ + struct timeval now; /* sec and usec */ struct tm now_tm; /* broken-down time */ char hms_string[80]; /* HH:MM:SS */ - clock_gettime(CLOCK_MONOTONIC, &now); + 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_nsec / 1000000LL)); + snprintf(time_string, buf_size, "%s.%03d", hms_string, (int) (now.tv_usec / 1000)); return time_string; } @@ -224,13 +224,14 @@ SIDE EFFECTS ===========================================================================*/ char * get_timestamp(char *str, unsigned long buf_size) { - struct timespec tv; + struct timeval tv; + struct timezone tz; int hh, mm, ss; - clock_gettime(CLOCK_MONOTONIC, &tv); + 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_nsec / 1000); + snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); return str; } diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index 39e33dcc..9a806bf4 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -52,13 +52,14 @@ extern "C" { // LE targets with no logcat support #define TS_PRINTF(format, x...) \ { \ - struct timespec tv; \ + struct timeval tv; \ + struct timezone tz; \ int hh, mm, ss; \ - clock_gettime(CLOCK_MONOTONIC, &tv); \ + 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_nsec/1000, ##x); \ + 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) diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp index fb4f2fe0..3cb51a30 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -30,13 +30,14 @@ char * get_timestamp(char *str, unsigned long buf_size) { - struct timespec tv; + struct timeval tv; + struct timezone tz; int hh, mm, ss; - clock_gettime(CLOCK_MONOTONIC, &tv); + 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_nsec / 1000); + snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); return str; } From 4cac1baf97d8b5e953cdcc55a3ec9bc26052e52c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 15 Jan 2018 10:18:49 -0800 Subject: [PATCH 605/945] LocIpc: enhance startListeningNoBlocking with ready callback For startListeningNoBlocking, for callers that need to know when the socket is actually being created and ready to receive message, this change allows callback to be invoked when socket is ready. Change-Id: Ie7c6eb1a3966371d84fc98109f07805ac7d4e3a1 CRs-fixed: 2169568 --- gnss/XtraSystemStatusObserver.h | 1 + utils/LocIpc.cpp | 6 +++++- utils/LocIpc.h | 25 +++++++++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 706a35bc..6bf3f58e 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -70,6 +70,7 @@ public : inline const MsgTask* getMsgTask() { return mMsgTask; } void subscribe(bool yes); +protected: void onReceive(const std::string& data) override; private: diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 0ee156ee..1df15465 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018 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 @@ -76,6 +76,7 @@ bool LocIpc::startListeningNonBlocking(const std::string& name) { } bool LocIpc::startListeningBlocking(const std::string& name) { + int fd = socket(AF_UNIX, SOCK_DGRAM, 0); if (fd < 0) { LOC_LOGe("create socket error. reason:%s", strerror(errno)); @@ -100,6 +101,9 @@ bool LocIpc::startListeningBlocking(const std::string& name) { mIpcFd = fd; + // inform that the socket is ready to receive message + onListenerReady(); + ssize_t nBytes = 0; std::string msg = ""; while (1) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 8bc13b7d..738d4fbd 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018 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 @@ -66,15 +66,6 @@ public: // Stop listening to new messages. void stopListening(); - // Callback function for receiving incoming messages. - // Override this function in your derived class to process incoming messages. - // For each received message, this callback function will be called once. - // This callback function will be called in the calling thread of startListeningBlocking - // or in the new LocThread created by startListeningNonBlocking. - // - // Argument data contains the received message. You need to parse it. - virtual void onReceive(const std::string& /*data*/) {} - // Send out a message. // Call this function to send a message in argument data to socket in argument name. // @@ -84,6 +75,20 @@ public: static bool send(const char name[], const std::string& data); static bool send(const char name[], const uint8_t data[], uint32_t length); +protected: + // Callback function for receiving incoming messages. + // Override this function in your derived class to process incoming messages. + // For each received message, this callback function will be called once. + // This callback function will be called in the calling thread of startListeningBlocking + // or in the new LocThread created by startListeningNonBlocking. + // + // Argument data contains the received message. You need to parse it. + inline virtual void onReceive(const std::string& /*data*/) {} + + // LocIpc client can overwrite this function to get notification + // when the socket for LocIpc is ready to receive messages. + inline virtual void onListenerReady() {} + private: static bool sendData(int fd, const sockaddr_un& addr, const uint8_t data[], uint32_t length); From 61de97e13003a5dea9917cb6e943ecd8e142b05b Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 12 Sep 2016 17:20:55 -0700 Subject: [PATCH 606/945] LE clean up separated utils, core, ds and loc-api-v02 from loc-hal into their own independent packages; simplified loc-pla; moved pla to the root of project; removed loc-stub. Change-Id: I373f02f9306646addf55ae90d71c4ba8e3741d09 CRs-Fixed: 2172544 --- Makefile.am | 2 +- android/Android.mk | 1 - configure.ac | 34 ++-- core/Android.mk | 3 +- core/ContextBase.cpp | 2 +- core/LocAdapterBase.cpp | 2 +- core/LocApiBase.cpp | 2 +- core/LocApiBase.h | 2 +- core/LocDualContext.cpp | 2 +- core/Makefile.am | 19 +- core/SystemStatus.cpp | 4 +- core/SystemStatus.h | 5 +- core/SystemStatusOsObserver.h | 3 +- .../loc_stub => core}/configure.ac | 41 +++-- core/data-items/DataItemsFactoryProxy.cpp | 3 +- core/data-items/common/ClientIndex.cpp | 3 +- core/data-items/common/DataItemIndex.cpp | 3 +- core/loc-core.pc.in | 10 + core/loc_core_log.cpp | 3 +- gnss/Agps.cpp | 2 +- gnss/Agps.h | 3 +- gnss/Makefile.am | 85 +-------- loc-hal.pc.in | 4 +- location/LocationAPI.cpp | 3 +- location/LocationAPIClientBase.cpp | 3 +- location/LocationAPIClientBase.h | 3 +- location/Makefile.am | 22 +-- .../loc_pla => location}/configure.ac | 39 +++- location/location-api.pc.in | 10 + pla/Android.mk | 30 +++ .../android/loc_pla.h | 26 ++- .../oe/loc_pla.h | 37 +++- utils/Android.mk | 5 +- utils/LocIpc.cpp | 3 +- utils/LocThread.cpp | 2 +- utils/LocTimer.cpp | 4 +- utils/LocTimer.h | 2 +- utils/Makefile.am | 42 +++-- utils/MsgTask.cpp | 5 +- utils/configure.ac | 29 ++- utils/gps-utils.pc.in | 2 +- utils/linked_list.c | 7 +- utils/loc_cfg.cpp | 15 +- utils/loc_cfg.h | 11 ++ utils/loc_log.cpp | 3 +- utils/loc_misc_utils.cpp | 2 +- utils/loc_nmea.cpp | 3 +- utils/loc_target.cpp | 5 +- utils/loc_timer.h | 3 +- utils/log_util.h | 5 +- utils/msg_q.c | 8 +- utils/platform_lib_abstractions/Android.mk | 5 - .../elapsed_millis_since_boot.cpp | 47 ----- .../loc_pla/Android.mk | 5 - .../loc_pla/Makefile.am | 10 - .../loc_pla/include/platform_lib_gettid.h | 45 ----- .../loc_pla/include/platform_lib_includes.h | 39 ---- .../loc_pla/include/platform_lib_log_util.h | 174 ------------------ .../loc_pla/include/platform_lib_macros.h | 89 --------- .../include/platform_lib_sched_policy.h | 46 ----- .../loc_pla/include/platform_lib_time.h | 36 ---- .../loc_pla/loc-pla.pc.in | 10 - .../loc_pla/src/Android.mk | 68 ------- .../loc_pla/src/Makefile.am | 40 ---- .../loc_pla/src/platform_lib_gettid.cpp | 46 ----- .../loc_pla/src/platform_lib_log_util.cpp | 78 -------- .../src/platform_lib_property_service.cpp | 39 ---- .../loc_pla/src/platform_lib_sched_policy.cpp | 41 ----- .../loc_pla/src/platform_lib_time.cpp | 59 ------ .../loc_stub/Android.mk | 5 - .../loc_stub/Makefile.am | 9 - .../include/loc_stub_android_runtime.h | 45 ----- .../include/loc_stub_property_service.h | 42 ----- .../loc_stub/include/loc_stub_sched_policy.h | 64 ------- .../loc_stub/include/loc_stub_time.h | 46 ----- .../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 | 55 ------ 83 files changed, 339 insertions(+), 1640 deletions(-) rename {utils/platform_lib_abstractions/loc_stub => core}/configure.ac (60%) create mode 100644 core/loc-core.pc.in rename {utils/platform_lib_abstractions/loc_pla => location}/configure.ac (59%) create mode 100644 location/location-api.pc.in create mode 100644 pla/Android.mk rename utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h => pla/android/loc_pla.h (69%) rename utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h => pla/oe/loc_pla.h (65%) delete mode 100644 utils/platform_lib_abstractions/Android.mk delete mode 100644 utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_pla/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h delete mode 100644 utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp delete mode 100644 utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_stub/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h delete mode 100644 utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/Android.mk delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/Makefile.am delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp delete mode 100644 utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp diff --git a/Makefile.am b/Makefile.am index f64790e0..cd4a7313 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = core location gnss +SUBDIRS = gnss pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = loc-hal.pc diff --git a/android/Android.mk b/android/Android.mk index 03ea1f3c..46e23884 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -43,7 +43,6 @@ LOCAL_SHARED_LIBRARIES += \ libloc_core \ libgps.utils \ libdl \ - libloc_pla \ liblocation_api \ LOCAL_CFLAGS += $(GNSS_CFLAGS) diff --git a/configure.ac b/configure.ac index ec41c86f..0ab8e68e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ 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]) +AC_CONFIG_SRCDIR([Makefile.am]) # defines some macros variable to be included by source AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -29,26 +29,14 @@ 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]) - PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) AC_SUBST([GPSUTILS_CFLAGS]) AC_SUBST([GPSUTILS_LIBS]) +PKG_CHECK_MODULES([LOCCORE], [loc-core]) +AC_SUBST([LOCCORE_CFLAGS]) +AC_SUBST([LOCCORE_LIBS]) + AC_ARG_WITH([core_includes], AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], [Specify the location of the core headers]), @@ -59,6 +47,16 @@ if test "x$with_core_includes" != "xno"; then CPPFLAGS="${CPPFLAGS} -I${core_incdir}" fi +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + AC_SUBST([CPPFLAGS]) AC_ARG_WITH([glib], @@ -82,8 +80,6 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ - core/Makefile \ - location/Makefile \ gnss/Makefile \ loc-hal.pc \ ]) diff --git a/core/Android.mk b/core/Android.mk index dba0b0a3..1374b6c0 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -22,8 +22,7 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libgps.utils \ libdl \ - liblog \ - libloc_pla + liblog LOCAL_SRC_FILES += \ LocApiBase.cpp \ diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 05a0ad31..35e65854 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 3943819f..f3c999c2 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4bc38e2e..95768425 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f66bfe1f..25d95b2a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace loc_core { class ContextBase; diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index fd3450df..180d9dca 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace loc_core { diff --git a/core/Makefile.am b/core/Makefile.am index 81ef2ee7..dc540e9c 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -1,12 +1,11 @@ +ACLOCAL_AMFLAGS = -I m4 + AM_CFLAGS = -I./ \ - -I../utils \ - -I../gnss \ - -I../location \ - -I./data-items \ - -I./data-items/common \ - -I./observer \ $(LOCPLA_CFLAGS) \ $(GPSUTILS_CFLAGS) \ + -I./data-items/ \ + -I./data-items/common \ + -I./observer \ -I$(WORKSPACE)/gps-noship/flp \ -D__func__=__PRETTY_FUNCTION__ \ -fno-short-enums \ @@ -44,7 +43,7 @@ libloc_core_la_c_sources = \ SystemStatusOsObserver.cpp \ SystemStatus.cpp -library_includedir = $(pkgincludedir)/core +library_includedir = $(pkgincludedir) library_include_HEADERS = $(libloc_core_la_h_sources) @@ -60,7 +59,11 @@ libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) $(GPSUTILS_LIBS) +libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) #Create and Install libraries lib_LTLIBRARIES = libloc_core.la + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = loc-core.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 47923d65..6eb99683 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 7e3309df..9500264d 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -30,9 +30,10 @@ #define __SYSTEM_STATUS__ #include -#include +#include #include -#include +#include +#include #include #include #include diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 33e668d2..930ddc12 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -39,7 +39,8 @@ #include #include #include -#include +#include +#include namespace loc_core { diff --git a/utils/platform_lib_abstractions/loc_stub/configure.ac b/core/configure.ac similarity index 60% rename from utils/platform_lib_abstractions/loc_stub/configure.ac rename to core/configure.ac index 8900f040..ea0a128d 100644 --- a/utils/platform_lib_abstractions/loc_stub/configure.ac +++ b/core/configure.ac @@ -1,17 +1,17 @@ -# configure.ac -- Autoconf script for gps loc-stub +# configure.ac -- Autoconf script for gps loc-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 loc-stub package version 1.0.0 -AC_INIT([loc-stub],1.0.0) +# Initialize the gps loc-hal package version 1.0.0 +AC_INIT([loc-core],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]) +AC_CONFIG_SRCDIR([loc-core.pc.in]) # defines some macros variable to be included by source AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -29,16 +29,32 @@ 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) +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) -if test "x$with_hardware_include" != "xno"; then - CPPFLAGS="${CPPFLAGS} -I${hardware_incdir}" +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_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) + AC_ARG_WITH([glib], AC_HELP_STRING([--with-glib], [enable glib, building HLOS systems which use glib])) @@ -60,8 +76,7 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ - src/Makefile \ - loc-stub.pc + loc-core.pc \ ]) AC_OUTPUT diff --git a/core/data-items/DataItemsFactoryProxy.cpp b/core/data-items/DataItemsFactoryProxy.cpp index 130eecf9..d5e41503 100644 --- a/core/data-items/DataItemsFactoryProxy.cpp +++ b/core/data-items/DataItemsFactoryProxy.cpp @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include namespace loc_core { diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp index ffb5e1d4..d4bd11e5 100644 --- a/core/data-items/common/ClientIndex.cpp +++ b/core/data-items/common/ClientIndex.cpp @@ -29,7 +29,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp index 7869b434..462bf748 100644 --- a/core/data-items/common/DataItemIndex.cpp +++ b/core/data-items/common/DataItemIndex.cpp @@ -31,7 +31,8 @@ #include #include #include -#include +#include +#include #include #include diff --git a/core/loc-core.pc.in b/core/loc-core.pc.in new file mode 100644 index 00000000..76b514ce --- /dev/null +++ b/core/loc-core.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: loc-core +Description: QTI GPS Loc Core +Version: @VERSION@ +Libs: -L${libdir} -lloc_core +Cflags: -I${includedir}/loc-core diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 5a627dd9..37045ad4 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -30,9 +30,10 @@ #define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_core_log" +#include #include #include -#include +#include void LocPosMode::logv() const { diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 72ce2934..6ce0c345 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_Agps" #include -#include +#include #include #include diff --git a/gnss/Agps.h b/gnss/Agps.h index 862769a1..703a4750 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include /* ATL callback function pointers * Passed in by Adapter to AgpsManager */ diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 2365e4c1..c818cae7 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -1,11 +1,11 @@ AM_CFLAGS = \ $(LOCPLA_CFLAGS) \ $(LOCHAL_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ + $(LOCCORE_CFLAGS) \ -I./ \ -I../utils \ - -I../core \ - -I../core/data-items \ - -I../core/observer \ + -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ -I../location \ -std=c++11 @@ -17,86 +17,15 @@ libgnss_la_SOURCES = \ if USE_GLIB libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgnss_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -avoid-version +libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -avoid-version libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ else libgnss_la_CFLAGS = $(AM_CFLAGS) -libgnss_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libgnss_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(LOCHAL_LIBS) - +libgnss_la_LIBADD = -lstdc++ $(GPSUTILS_LIBS) $(LOCCORE_LIBS) #Create and Install libraries -#lib_LTLIBRARIES = libgnss.la - -#library_includedir = $(pkgincludedir) -#pkgconfigdir = $(libdir)/pkgconfig -#pkgconfig_DATA = location-api.pc -#EXTRA_DIST = $(pkgconfig_DATA) - - -libloc_ds_api_CFLAGS = \ - $(QMIF_CFLAGS) \ - $(QMI_CFLAGS) \ - $(DATA_CFLAGS) \ - $(GPSUTILS_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++ -Wl,-z,defs -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++ -Wl,-z,defs -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 $(GPSUTILS_LIBS) $(LOCPLA_LIBS) - -libloc_api_v02_CFLAGS = \ - $(QMIF_CFLAGS) \ - $(GPSUTILS_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++ -g -Wl,-z,defs -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++ -Wl,-z,defs -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) $(GPSUTILS_LIBS) $(LOCPLA_LIBS) ../core/libloc_core.la libloc_ds_api.la - -library_include_HEADERS = \ - $(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 = libgnss.la libloc_ds_api.la libloc_api_v02.la +lib_LTLIBRARIES = libgnss.la diff --git a/loc-hal.pc.in b/loc-hal.pc.in index 64750db5..22d174b9 100644 --- a/loc-hal.pc.in +++ b/loc-hal.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: loc-hal Description: QTI GPS Loc HAL Version: @VERSION -Libs: -L${libdir} -lloc_core -llocation_api -lgnss -lloc_ds_api -lloc_api_v02 -Cflags: -I${includedir} -I${includedir}/loc-hal -I${includedir}/loc-hal/location -I${includedir}/loc-hal/gnss -I${includedir}/loc-hal/core +Libs: -L${libdir} -lgnss +Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 21d2de0f..0111a9c0 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -29,7 +29,8 @@ #include #include -#include +#include +#include #include #include diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index bb51238f..e53a6b8c 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -29,7 +29,8 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" -#include +#include +#include #include #include #include "LocationAPIClientBase.h" diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 99c7c873..4bd1466b 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -36,7 +36,8 @@ #include #include "LocationAPI.h" -#include "platform_lib_log_util.h" +#include +#include enum SESSION_MODE { SESSION_MODE_NONE = 0, diff --git a/location/Makefile.am b/location/Makefile.am index d1d0131e..3688cc86 100644 --- a/location/Makefile.am +++ b/location/Makefile.am @@ -1,9 +1,10 @@ +ACLOCAL_AMFLAGS = -I m4 + AM_CFLAGS = \ - $(LOCPLA_CFLAGS) \ - $(GPSUTILS_CFLAGS) \ - $(LOCHAL_CFLAGS) \ -I./ \ -I../utils \ + $(LOCPLA_CFLAGS) \ + $(GPSUTILS_CFLAGS) \ -std=c++11 liblocation_api_la_SOURCES = \ @@ -12,15 +13,15 @@ liblocation_api_la_SOURCES = \ if USE_GLIB liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -liblocation_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ else liblocation_api_la_CFLAGS = $(AM_CFLAGS) -liblocation_api_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -liblocation_api_la_LIBADD = -lstdc++ $(LOCPLA_LIBS) $(GPSUTILS_LIBS) $(LOCHAL_LIBS) +liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) library_include_HEADERS = \ LocationAPI.h \ @@ -31,10 +32,7 @@ library_include_HEADERS = \ lib_LTLIBRARIES = liblocation_api.la library_includedir = $(pkgincludedir) -#pkgconfigdir = $(libdir)/pkgconfig -#pkgconfig_DATA = location-api.pc -#EXTRA_DIST = $(pkgconfig_DATA) - - - +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = location-api.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/platform_lib_abstractions/loc_pla/configure.ac b/location/configure.ac similarity index 59% rename from utils/platform_lib_abstractions/loc_pla/configure.ac rename to location/configure.ac index a8b892b5..6391d65d 100644 --- a/utils/platform_lib_abstractions/loc_pla/configure.ac +++ b/location/configure.ac @@ -1,17 +1,17 @@ -# configure.ac -- Autoconf script for gps loc-pla +# configure.ac -- Autoconf script for gps location-api-iface # # 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) +# Initialize the gps location-api-iface package version 1.0.0 +AC_INIT([location-api-iface],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]) +AC_CONFIG_SRCDIR([location-api.pc.in]) # defines some macros variable to be included by source AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -29,9 +29,31 @@ 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]) +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + +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_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [Specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x${with_locpla_includes}" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) AC_ARG_WITH([glib], AC_HELP_STRING([--with-glib], @@ -54,8 +76,7 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") AC_CONFIG_FILES([ \ Makefile \ - src/Makefile \ - loc-pla.pc \ + location-api.pc \ ]) AC_OUTPUT diff --git a/location/location-api.pc.in b/location/location-api.pc.in new file mode 100644 index 00000000..c7b146ab --- /dev/null +++ b/location/location-api.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: location-api +Description: Location API +Version: @VERSION +Libs: -L${libdir} -llocation_api +Cflags: -I${includedir}/location-api diff --git a/pla/Android.mk b/pla/Android.mk new file mode 100644 index 00000000..ce062bb5 --- /dev/null +++ b/pla/Android.mk @@ -0,0 +1,30 @@ +GNSS_CFLAGS := \ + -Werror \ + -Wno-error=unused-parameter \ + -Wno-error=format \ + -Wno-error=macro-redefined \ + -Wno-error=reorder \ + -Wno-error=missing-braces \ + -Wno-error=self-assign \ + -Wno-error=enum-conversion \ + -Wno-error=logical-op-parentheses \ + -Wno-error=null-arithmetic \ + -Wno-error=null-conversion \ + -Wno-error=parentheses-equality \ + -Wno-error=undefined-bool-conversion \ + -Wno-error=tautological-compare \ + -Wno-error=switch \ + -Wno-error=date-time + +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := libloc_pla_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android +include $(BUILD_HEADER_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h b/pla/android/loc_pla.h similarity index 69% rename from utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h rename to pla/android/loc_pla.h index 677bc81a..9caae737 100644 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h +++ b/pla/android/loc_pla.h @@ -26,19 +26,33 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __LOC_STUB_GETTID_H__ -#define __LOC_STUB_GETTID_H__ +#ifndef __LOC_PLA__ +#define __LOC_PLA__ -#include +#ifdef __cplusplus +#include +#define uptimeMillis android::uptimeMillis +#endif #ifdef __cplusplus extern "C" { #endif -pid_t gettid(void); +#include +#include +#include + +#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" #ifdef __cplusplus } -#endif +#endif /*__cplusplus */ -#endif /* __LOC_STUB_GETTID_H__ */ +#endif /* __LOC_PLA__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h b/pla/oe/loc_pla.h similarity index 65% rename from utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h rename to pla/oe/loc_pla.h index ed2041f9..3ca1964a 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h +++ b/pla/oe/loc_pla.h @@ -26,19 +26,42 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __PLATFORM_LIB_PROPERTY_SERVICE_H__ -#define __PLATFORM_LIB_PROPERTY_SERVICE_H__ +#ifndef __LOC_PLA__ +#define __LOC_PLA__ #ifdef __cplusplus +#include +#define uptimeMillis android::uptimeMillis + extern "C" { #endif -#ifndef PROPERTY_VALUE_MAX -#define PROPERTY_VALUE_MAX 92 + +#include +#include +#include +#include +#include +#include +#ifndef OFF_TARGET +#include +#define strlcat g_strlcat +#define strlcpy g_strlcpy +#else +#define strlcat strncat +#define strlcpy strncpy #endif -int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value); + +#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /*__cplusplus */ -#endif /* __PLATFORM_LIB_PROPERTY_SERVICE_H__ */ +#endif /* __LOC_PLA__ */ diff --git a/utils/Android.mk b/utils/Android.mk index 1352076c..9607aaa1 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -11,8 +11,7 @@ include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog \ - libloc_pla + liblog LOCAL_SRC_FILES += \ loc_log.cpp \ @@ -20,7 +19,6 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - platform_lib_abstractions/elapsed_millis_since_boot.cpp \ LocHeap.cpp \ LocTimer.cpp \ LocThread.cpp \ @@ -61,6 +59,5 @@ LOCAL_MODULE := libgps.utils_headers LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) include $(BUILD_HEADER_LIBRARY) -include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, platform_lib_abstractions)) endif # not BUILD_TINY_ANDROID endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 1df15465..26a20765 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -36,7 +36,8 @@ #include #include #include -#include +#include +#include #include #include #include "gps_extended_c.h" diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index d112f616..c1052cb0 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include class LocThreadDelegate { LocRunnable* mRunnable; diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 5b653eb2..93775d06 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -27,13 +27,15 @@ * */ +#include #include #include #include #include -#include #include #include +#include +#include #include #include #include diff --git a/utils/LocTimer.h b/utils/LocTimer.h index c6a63620..abc7f645 100644 --- a/utils/LocTimer.h +++ b/utils/LocTimer.h @@ -31,7 +31,7 @@ #define __LOC_TIMER_CPP_H__ #include -#include +#include // opaque class to provide service implementation. class LocTimerDelegate; diff --git a/utils/Makefile.am b/utils/Makefile.am index 506309c3..3801fdd4 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,15 +1,17 @@ +ACLOCAL_AMFLAGS = -I m4 + AM_CFLAGS = -Wundef \ - -I./ \ - -I$(WORKSPACE)/system/core/include \ - -std=c++11 \ - $(LOCPLA_CFLAGS) - -AM_CPPFLAGS = -Wundef \ + -MD \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ -I./ \ -std=c++11 \ $(LOCPLA_CFLAGS) -libgps_utils_so_la_h_sources = \ +libgps_utils_la_h_sources = \ msg_q.h \ linked_list.h \ loc_cfg.h \ @@ -28,7 +30,7 @@ libgps_utils_so_la_h_sources = \ loc_gps.h \ log_util.h -libgps_utils_so_la_c_sources = \ +libgps_utils_la_c_sources = \ linked_list.c \ msg_q.c \ loc_cfg.cpp \ @@ -42,27 +44,27 @@ libgps_utils_so_la_c_sources = \ loc_misc_utils.cpp \ loc_nmea.cpp +library_includedir = $(pkgincludedir) -library_include_HEADERS = $(libgps_utils_so_la_h_sources) +library_include_HEADERS = $(libgps_utils_la_h_sources) -libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) +libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) if USE_GLIB -libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgps_utils_so_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ else -libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) -libgps_utils_so_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +libgps_utils_la_CFLAGS = $(AM_CFLAGS) +libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 +libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libgps_utils_so_la_LIBADD = -lcutils -lstdc++ -llog $(LOCPLA_LIBS) +libgps_utils_la_LIBADD = $(CUTILS_LIBS) #Create and Install libraries -lib_LTLIBRARIES = libgps_utils_so.la -library_includedir = $(pkgincludedir) -pkgconfigdir = $(libdir)/pkgconfig +lib_LTLIBRARIES = libgps_utils.la +pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gps-utils.pc EXTRA_DIST = $(pkgconfig_DATA) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index 80abeecd..eaead5cf 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -32,8 +32,9 @@ #include #include #include +#include #include -#include +#include static void LocMsgDestroy(void* msg) { delete (LocMsg*)msg; @@ -82,7 +83,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const { 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); + set_sched_policy(gettid(), SP_FOREGROUND); } bool MsgTask::run() { diff --git a/utils/configure.ac b/utils/configure.ac index a7ab9b40..639f8c47 100644 --- a/utils/configure.ac +++ b/utils/configure.ac @@ -28,9 +28,32 @@ AC_PROG_LN_S AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG -PKG_CHECK_MODULES([LOCPLA], [loc-pla]) -AC_SUBST([LOCPLA_CFLAGS]) -AC_SUBST([LOCPLA_LIBS]) +# Checks for libraries. +PKG_CHECK_MODULES([CUTILS], [libcutils]) +AC_SUBST([CUTILS_CFLAGS]) +AC_SUBST([CUTILS_LIBS]) + +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_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") +fi + +AC_SUBST([CPPFLAGS]) AC_ARG_WITH([glib], AC_HELP_STRING([--with-glib], diff --git a/utils/gps-utils.pc.in b/utils/gps-utils.pc.in index 3ed3d903..a988731a 100644 --- a/utils/gps-utils.pc.in +++ b/utils/gps-utils.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: gps-utils Description: QTI GPS Location utils Version: @VERSION -Libs: -L${libdir} -lgps_utils_so +Libs: -L${libdir} -lgps_utils Cflags: -I${includedir}/gps-utils diff --git a/utils/linked_list.c b/utils/linked_list.c index 33185d0b..02e1463b 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -26,14 +26,15 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LOG_TAG "LocSvc_utils_ll" + #include "linked_list.h" #include #include - -#define LOG_TAG "LocSvc_utils_ll" -#include #include #include +#include +#include typedef struct list_element { struct list_element* next; diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d2364f69..9fb993f8 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -38,12 +38,12 @@ #include #include #include -#include +#include #include #ifdef USE_GLIB #include #endif -#include "platform_lib_includes.h" +#include "log_util.h" /*============================================================================= * @@ -71,6 +71,17 @@ typedef struct loc_param_v_type double param_double_value; }loc_param_v_type; +// Reference below arrays wherever needed to avoid duplicating +// same conf path string over and again in location code. +const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; +const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; +const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; +const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; +const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; +const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; +const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; +const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; + /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 0a0f1009..b3613cff 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -84,6 +84,17 @@ 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); + +// Below are the location conf file paths +extern const char LOC_PATH_GPS_CONF[]; +extern const char LOC_PATH_IZAT_CONF[]; +extern const char LOC_PATH_FLP_CONF[]; +extern const char LOC_PATH_LOWI_CONF[]; +extern const char LOC_PATH_SAP_CONF[]; +extern const char LOC_PATH_APDR_CONF[]; +extern const char LOC_PATH_XTWIFI_CONF[]; +extern const char LOC_PATH_QUIPC_CONF[]; + #ifdef __cplusplus } #endif diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 9fad9e6e..ab289981 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -32,9 +32,10 @@ #include #include #include +#include "log_util.h" #include "loc_log.h" #include "msg_q.h" -#include +#include #define BUFFER_SIZE 120 diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index fd3ee6b0..b7c84061 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_misc_utils" #include #include -#include +#include #include #include diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 6d34b512..7fe043c4 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -31,7 +31,8 @@ #define LOG_TAG "LocSvc_nmea" #include #include -#include +#include +#include #define GLONASS_SV_ID_OFFSET 64 #define MAX_SATELLITES_IN_USE 12 diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index cf429321..d31f8874 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -27,6 +27,7 @@ * */ +#include #include #include #include @@ -34,10 +35,10 @@ #include #include #include -#include +#include #include "loc_target.h" #include "loc_log.h" -#include +#include #define APQ8064_ID_1 "109" #define APQ8064_ID_2 "153" diff --git a/utils/loc_timer.h b/utils/loc_timer.h index 25fd1790..fff0c46e 100644 --- a/utils/loc_timer.h +++ b/utils/loc_timer.h @@ -34,7 +34,8 @@ extern "C" { #endif /* __cplusplus */ #include -#include +#include +#include /* user_data: client context pointer, passthrough. Originally received from calling client when loc_timer_start() is called. diff --git a/utils/log_util.h b/utils/log_util.h index d5884b75..460d6e7e 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -37,13 +37,14 @@ #elif defined (USE_GLIB) // LE targets with no logcat support #include +#include #include #include +#include #ifndef LOG_TAG #define LOG_TAG "GPS_UTILS" - -#endif // LOG_TAG +#endif /* LOG_TAG */ #endif /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ diff --git a/utils/msg_q.c b/utils/msg_q.c index e8b4ffe2..76c14789 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -26,14 +26,14 @@ * 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 +#include +#include +#include "linked_list.h" +#include "msg_q.h" typedef struct msg_q { void* msg_list; /* Linked list to store information */ diff --git a/utils/platform_lib_abstractions/Android.mk b/utils/platform_lib_abstractions/Android.mk deleted file mode 100644 index b923a4c9..00000000 --- a/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/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp deleted file mode 100644 index 4b35f51f..00000000 --- a/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ /dev/null @@ -1,47 +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 -#include "platform_lib_time.h" - -int64_t systemTime(int /*clock*/) -{ - struct timespec t; - t.tv_sec = t.tv_nsec = 0; - clock_gettime(CLOCK_MONOTONIC, &t); - return t.tv_sec*1000000LL + t.tv_nsec/1000LL; -} - - -int64_t elapsedMillisSinceBoot() -{ - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; -} diff --git a/utils/platform_lib_abstractions/loc_pla/Android.mk b/utils/platform_lib_abstractions/loc_pla/Android.mk deleted file mode 100644 index b923a4c9..00000000 --- a/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/utils/platform_lib_abstractions/loc_pla/Makefile.am b/utils/platform_lib_abstractions/loc_pla/Makefile.am deleted file mode 100644 index 8996763e..00000000 --- a/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/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h deleted file mode 100644 index 340c3c5b..00000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.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_GETTID_H__ -#define __PLATFORM_LIB_GETTID_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif -#ifdef USE_GLIB -const char* getprogname(); -#endif /* USE_GLIB */ - -pid_t platform_lib_abstraction_gettid(); -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* __PLATFORM_LIB_GETTID_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h deleted file mode 100644 index ebb71197..00000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h +++ /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. - */ - -#ifndef __PLATFORM_LIB_INCLUDES_H__ -#define __PLATFORM_LIB_INCLUDES_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/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h deleted file mode 100644 index 08a9585c..00000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ /dev/null @@ -1,174 +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" -#include -#include -#include -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "GPS_UTILS" -#endif /* LOG_TAG */ - -#if defined (USE_ANDROID_LOGGING) || defined (ANDROID) -// Android and LE targets with logcat support -#include -#else -// LE targets without logcat support -#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(__VA_ARGS__); } -#define LOC_LOGW(...) IF_LOC_LOGW { ALOGW(__VA_ARGS__); } -#define LOC_LOGI(...) IF_LOC_LOGI { ALOGI(__VA_ARGS__); } -#define LOC_LOGD(...) IF_LOC_LOGD { ALOGD(__VA_ARGS__); } -#define LOC_LOGV(...) IF_LOC_LOGV { ALOGV(__VA_ARGS__); } - -#else /* DEBUG_DMN_LOC_API */ - -#define LOC_LOGE(...) ALOGE(__VA_ARGS__) -#define LOC_LOGW(...) ALOGW(__VA_ARGS__) -#define LOC_LOGI(...) ALOGI(__VA_ARGS__) -#define LOC_LOGD(...) ALOGD(__VA_ARGS__) -#define LOC_LOGV(...) ALOGV(__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(fmt) "%s:%d] " fmt -#define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __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, __FUNCTION__, %s, "") -#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL) -#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ - if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __FUNCTION__, SPEC, VAL); \ - } else { \ - LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL); \ - } - - -// Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __FUNCTION__, %s, "") -// Used for logging callflow to Modem -#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL) -// Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") -#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, 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 /* else of #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ - -#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h deleted file mode 100644 index 9a806bf4..00000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ /dev/null @@ -1,89 +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 - -#include -#include -#include - -#ifdef USE_GLIB -#include -#ifndef OFF_TARGET -#define strlcat g_strlcat -#define strlcpy g_strlcpy -#else -#define strlcat strncat -#define strlcpy strncpy -#endif -#endif /* USE_GLIB */ - -#if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) -// LE targets with no logcat support -#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 /* #if defined (USE_GLIB) && !defined (USE_ANDROID_LOGGING) */ - - -// Below are the location conf file paths -extern const char LOC_PATH_GPS_CONF[]; -extern const char LOC_PATH_IZAT_CONF[]; -extern const char LOC_PATH_FLP_CONF[]; -extern const char LOC_PATH_LOWI_CONF[]; -extern const char LOC_PATH_SAP_CONF[]; -extern const char LOC_PATH_APDR_CONF[]; -extern const char LOC_PATH_XTWIFI_CONF[]; -extern const char LOC_PATH_QUIPC_CONF[]; - - -#ifdef __cplusplus -} -#endif /*__cplusplus */ - -#endif /* __PLATFORM_LIB_MACROS_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h deleted file mode 100644 index d10f1513..00000000 --- a/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/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h deleted file mode 100644 index ae25ae60..00000000 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ /dev/null @@ -1,36 +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(); -int64_t platform_lib_abstraction_elapsed_micros_since_boot(); - -#endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in deleted file mode 100644 index 9ec510d1..00000000 --- a/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 -I${includedir}/gps-utils diff --git a/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/utils/platform_lib_abstractions/loc_pla/src/Android.mk deleted file mode 100644 index ab137175..00000000 --- a/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ /dev/null @@ -1,68 +0,0 @@ -GNSS_CFLAGS := \ - -Werror \ - -Wno-error=unused-parameter \ - -Wno-error=format \ - -Wno-error=macro-redefined \ - -Wno-error=reorder \ - -Wno-error=missing-braces \ - -Wno-error=self-assign \ - -Wno-error=enum-conversion \ - -Wno-error=logical-op-parentheses \ - -Wno-error=null-arithmetic \ - -Wno-error=null-conversion \ - -Wno-error=parentheses-equality \ - -Wno-error=undefined-bool-conversion \ - -Wno-error=tautological-compare \ - -Wno-error=switch \ - -Wno-error=date-time - -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -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_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 - -## Includes -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../include -LOCAL_HEADER_LIBRARIES := \ - libgps.utils_headers \ - libloc_stub_headers - -LOCAL_MODULE := libloc_pla -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libloc_pla_headers -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include -include $(BUILD_HEADER_LIBRARY) - -endif # not BUILD_TINY_ANDROID -endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/utils/platform_lib_abstractions/loc_pla/src/Makefile.am deleted file mode 100644 index ac7f8a04..00000000 --- a/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -AM_CFLAGS = \ - $(LOCSTUB_CFLAGS) \ - -I$(WORKSPACE)/hardware/qcom/gps/utils/ \ - -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -h_sources = \ - ../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_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++ -Wl,-z,defs -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 = -Wl,-z,defs -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/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp deleted file mode 100644 index 1b7aa32b..00000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.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 "platform_lib_gettid.h" - -#ifdef USE_GLIB -#include - -#include -const char* getprogname() { - return program_invocation_short_name; -} - -#else -#include -#endif /* USE_GLIB */ - -pid_t platform_lib_abstraction_gettid() -{ - return gettid(); -} diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp deleted file mode 100644 index 3cb51a30..00000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ /dev/null @@ -1,78 +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" -#include "platform_lib_macros.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; -} - -// Below are the location conf file paths -#ifdef __ANDROID__ - -#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" -#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" -#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" -#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" -#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" -#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" -#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" -#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" - -#else - -#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" -#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" -#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" -#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" -#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" -#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" -#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" -#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" - -#endif // __ANDROID__ - -// Reference below arrays wherever needed to avoid duplicating -// same conf path string over and again in location code. -const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; -const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; -const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; -const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; -const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; -const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; -const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; -const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp deleted file mode 100644 index dccdebcf..00000000 --- a/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. - */ -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -#include "platform_lib_property_service.h" - -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/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp deleted file mode 100644 index ba6b3505..00000000 --- a/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/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp deleted file mode 100644 index 3dcd4d3e..00000000 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp +++ /dev/null @@ -1,59 +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 -#include - -#endif /* USE_GLIB */ - -int64_t platform_lib_abstraction_elapsed_millis_since_boot() -{ -#ifdef USE_GLIB - - return elapsedMillisSinceBoot(); - -#else - - //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; - return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME))/1000; -#endif -} -int64_t platform_lib_abstraction_elapsed_micros_since_boot() -{ -#ifdef USE_GLIB - return elapsedMicrosSinceBoot(); - -#else - //return android::nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); - return nanoseconds_to_microseconds(systemTime(SYSTEM_TIME_BOOTTIME)); -#endif -} diff --git a/utils/platform_lib_abstractions/loc_stub/Android.mk b/utils/platform_lib_abstractions/loc_stub/Android.mk deleted file mode 100644 index b923a4c9..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/Makefile.am b/utils/platform_lib_abstractions/loc_stub/Makefile.am deleted file mode 100644 index d81e363a..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h deleted file mode 100644 index c8764eea..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h deleted file mode 100644 index 3677cdf6..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h deleted file mode 100644 index a42b117b..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h deleted file mode 100644 index f00a49bb..00000000 --- a/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.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 __LOC_STUB_TIME_H__ -#define __LOC_STUB_TIME_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); -int64_t elapsedMicrosSinceBoot(); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_TIME_H__ */ diff --git a/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in b/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in deleted file mode 100644 index c2ae764b..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/utils/platform_lib_abstractions/loc_stub/src/Android.mk deleted file mode 100644 index 08697cb5..00000000 --- a/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) -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_MODULE := libloc_stub -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libloc_stub_headers -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include -include $(BUILD_HEADER_LIBRARY) - -endif # not BUILD_TINY_ANDROID -endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/utils/platform_lib_abstractions/loc_stub/src/Makefile.am b/utils/platform_lib_abstractions/loc_stub/src/Makefile.am deleted file mode 100644 index ba823a24..00000000 --- a/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++ -Wl,-z,defs -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 = -Wl,-z,defs -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/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp deleted file mode 100644 index 068df4ef..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp deleted file mode 100644 index 55ef48a1..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp deleted file mode 100644 index 907ab02c..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp deleted file mode 100644 index 5e26245e..00000000 --- a/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/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp deleted file mode 100644 index 0db41cab..00000000 --- a/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ /dev/null @@ -1,55 +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 -#include - -int64_t systemTime(int /*clock*/) -{ - struct timespec t; - t.tv_sec = t.tv_nsec = 0; - clock_gettime(CLOCK_MONOTONIC, &t); - return t.tv_sec*1000000LL + t.tv_nsec/1000LL; -} - -int64_t elapsedMicrosSinceBoot() -{ - struct timespec ts; - int64_t time_ms = 0; - clock_gettime(CLOCK_BOOTTIME, &ts); - time_ms += (ts.tv_sec * 1000000000LL); /* Seconds to nanoseconds */ - time_ms += ts.tv_nsec; /* Add Nanoseconds */ - return time_ms; -} - -int64_t elapsedMillisSinceBoot() -{ - return (int64_t) (elapsedMicrosSinceBoot() /1000000LL); -} From e8fbefa5d2caf4976a9777e76c535131d98e8f14 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 17 Jan 2018 21:09:24 +0530 Subject: [PATCH 607/945] Updating logic to send empty SUPL server URL CRs-Fixed: 2164682 Change-Id: I70e68d380e8daff5d568e0e49c3ea90064154b00 --- gnss/GnssAdapter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index bda75e9c..db4696f5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -75,7 +75,7 @@ GnssAdapter::GnssAdapter() : mAgpsManager(), mAgpsCbInfo(), mSystemStatus(SystemStatus::getInstance(mMsgTask)), - mServerUrl(""), + mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) { LOC_LOGD("%s]: Constructor %p", __func__, this); @@ -600,7 +600,6 @@ GnssAdapter::setSuplHostServer(const char* server, int port) (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { serverUrl[0] = NULL; length = 0; - mServerUrl.clear(); } else if (port > 0) { length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", server, port); } From 6e98d17e6a67d8ba1b74bf1f91010f150d796c1b Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 9 Jan 2018 11:24:55 +0800 Subject: [PATCH 608/945] Move GNSS_CFLAGS to build/ to be fully included GNSS_CFLAGS included in pla module cannot be included by all the modules. Define it in build/target_specific_features.mk to make it included by the whole project. Change-Id: Ib13c43a65ecd14a7a97050dd80b4dce6aa8ad339 CRs-fixed: 2168176 --- Android.mk | 1 + build/target_specific_features.mk | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 build/target_specific_features.mk diff --git a/Android.mk b/Android.mk index e2c5a56f..23b2a666 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,6 @@ ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) +include $(LOCAL_PATH)/build/target_specific_features.mk include $(call all-makefiles-under,$(LOCAL_PATH)) endif diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk new file mode 100644 index 00000000..943e2310 --- /dev/null +++ b/build/target_specific_features.mk @@ -0,0 +1,17 @@ +GNSS_CFLAGS := \ + -Werror \ + -Wno-error=unused-parameter \ + -Wno-error=format \ + -Wno-error=macro-redefined \ + -Wno-error=reorder \ + -Wno-error=missing-braces \ + -Wno-error=self-assign \ + -Wno-error=enum-conversion \ + -Wno-error=logical-op-parentheses \ + -Wno-error=null-arithmetic \ + -Wno-error=null-conversion \ + -Wno-error=parentheses-equality \ + -Wno-error=undefined-bool-conversion \ + -Wno-error=tautological-compare \ + -Wno-error=switch \ + -Wno-error=date-time From 9d1b106156af687cf124164a63d091443d445d5f Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 22 Jan 2018 14:27:08 -0800 Subject: [PATCH 609/945] GPS cfg: add routines to parse process info Make routine to parse process info defined in conf file a util routine so it can be shared among modules Change-Id: I934c7346aee377eeebf4cdf4738bcfcc943840e1 CRs-fixed: 2174890 --- utils/loc_cfg.cpp | 730 +++++++++++++++++++++++++++++++++++++++++++++- utils/loc_cfg.h | 40 ++- 2 files changed, 768 insertions(+), 2 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 9fb993f8..fd38c8a9 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2015, 2018 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 @@ -37,8 +37,11 @@ #include #include #include +#include +#include #include #include +#include #include #ifdef USE_GLIB #include @@ -409,3 +412,728 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta /* Initialize logging mechanism with parsed data */ loc_logger_init(DEBUG_LEVEL, TIMESTAMP); } + +/*============================================================================= + * + * Define and Structures for Parsing Location Process Configuration File + * + *============================================================================*/ +#define MAX_NUM_STRINGS 20 + +//We can have 8 masks for now +#define CONFIG_MASK_TARGET_ALL 0X01 +#define CONFIG_MASK_TARGET_FOUND 0X02 +#define CONFIG_MASK_TARGET_CHECK 0X03 +#define CONFIG_MASK_BASEBAND_ALL 0X04 +#define CONFIG_MASK_BASEBAND_FOUND 0X08 +#define CONFIG_MASK_BASEBAND_CHECK 0x0c +#define CONFIG_MASK_AUTOPLATFORM_ALL 0x10 +#define CONFIG_MASK_AUTOPLATFORM_FOUND 0x20 +#define CONFIG_MASK_AUTOPLATFORM_CHECK 0x30 + +#define LOC_FEATURE_MASK_GTP_WIFI_BASIC 0x01 +#define LOC_FEATURE_MASK_GTP_WIFI_PREMIUM 0X02 +#define LOC_FEATURE_MASK_GTP_CELL_BASIC 0X04 +#define LOC_FEATURE_MASK_GTP_CELL_PREMIUM 0X08 +#define LOC_FEATURE_MASK_GTP_AP_CELL_BASIC LOC_FEATURE_MASK_GTP_CELL_BASIC +#define LOC_FEATURE_MASK_GTP_AP_CELL_PREMIUM LOC_FEATURE_MASK_GTP_CELL_PREMIUM +#define LOC_FEATURE_MASK_SAP_BASIC 0x40 +#define LOC_FEATURE_MASK_SAP_PREMIUM 0X80 +#define LOC_FEATURE_MASK_GTP_WAA_BASIC 0X100 +#define LOC_FEATURE_MASK_GTP_WAA_PREMIUM 0x200 +#define LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC 0X400 +#define LOC_FEATURE_MASK_GTP_MODEM_CELL_PREMIUM 0X800 +#define LOC_FEATURE_MASK_ODCPI 0x1000 +#define LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT 0x2000 +#define LOC_FEATURE_MASK_SUPL_WIFI 0x4000 +#define LOC_FEATURE_MASK_WIFI_SUPPLICANT_INFO 0x8000 + +typedef struct { + char proc_name[LOC_MAX_PARAM_STRING]; + char proc_argument[LOC_MAX_PARAM_STRING]; + char proc_status[LOC_MAX_PARAM_STRING]; + char group_list[LOC_MAX_PARAM_STRING]; + unsigned int premium_feature; + unsigned int loc_feature_mask; + char platform_list[LOC_MAX_PARAM_STRING]; + char baseband[LOC_MAX_PARAM_STRING]; + char lean_targets[LOC_MAX_PARAM_STRING]; + unsigned int sglte_target; + char feature_gtp_cell_proc[LOC_MAX_PARAM_STRING]; + char feature_gtp_waa[LOC_MAX_PARAM_STRING]; + char feature_gtp_cell[LOC_MAX_PARAM_STRING]; + char feature_gtp_wifi[LOC_MAX_PARAM_STRING]; + char feature_sap[LOC_MAX_PARAM_STRING]; + char feature_odcpi[LOC_MAX_PARAM_STRING]; + char feature_free_wifi_scan_inject[LOC_MAX_PARAM_STRING]; + char feature_supl_wifi[LOC_MAX_PARAM_STRING]; + char feature_wifi_supplicant_info[LOC_MAX_PARAM_STRING]; + char auto_platform[LOC_MAX_PARAM_STRING]; +} loc_launcher_conf; + +/* process configuration parameters */ +static loc_launcher_conf conf; + +/* gps.conf Parameter spec table */ +static const loc_param_s_type gps_conf_parameter_table[] = { + {"SGLTE_TARGET", &conf.sglte_target, NULL, 'n'}, +}; + +/* location feature conf, e.g.: izat.conf feature mode table*/ +static const loc_param_s_type loc_feature_conf_table[] = { + {"GTP_CELL_PROC", &conf.feature_gtp_cell_proc, NULL, 's'}, + {"GTP_CELL", &conf.feature_gtp_cell, NULL, 's'}, + {"GTP_WIFI", &conf.feature_gtp_wifi, NULL, 's'}, + {"GTP_WAA", &conf.feature_gtp_waa, NULL, 's'}, + {"SAP", &conf.feature_sap, NULL, 's'}, + {"ODCPI", &conf.feature_odcpi, NULL, 's'}, + {"FREE_WIFI_SCAN_INJECT", &conf.feature_free_wifi_scan_inject, NULL, 's'}, + {"SUPL_WIFI", &conf.feature_supl_wifi, NULL, 's'}, + {"WIFI_SUPPLICANT_INFO", &conf.feature_wifi_supplicant_info, NULL, 's'}, +}; + +/* location process conf, e.g.: izat.conf Parameter spec table */ +static const loc_param_s_type loc_process_conf_parameter_table[] = { + {"PROCESS_NAME", &conf.proc_name, NULL, 's'}, + {"PROCESS_ARGUMENT", &conf.proc_argument, NULL, 's'}, + {"PROCESS_STATE", &conf.proc_status, NULL, 's'}, + {"PROCESS_GROUPS", &conf.group_list, NULL, 's'}, + {"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'}, + {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, + {"PLATFORMS", &conf.platform_list, NULL, 's'}, + {"BASEBAND", &conf.baseband, NULL, 's'}, + {"LEAN_TARGETS", &conf.lean_targets, NULL, 's'}, + {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, +}; + +/*=========================================================================== +FUNCTION loc_read_process_conf + +DESCRIPTION + Parse the specified conf file and return info for the processes defined. + The format of the file should conform with izat.conf. + +PARAMETERS: + conf_file_name: configuration file to read + process_count_ptr: pointer to store number of processes defined in the conf file. + process_info_table_ptr: pointer to store the process info table. + +DEPENDENCIES + The file must be in izat.conf format. + +RETURN VALUE + 0: success + none-zero: failure + +SIDE EFFECTS + N/A + +NOTES: + On success, memory pointed by (*process_info_table_ptr) must be freed. +===========================================================================*/ +int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, + loc_process_info_s_type** process_info_table_ptr) { + loc_process_info_s_type *child_proc = nullptr; + volatile int i=0; + unsigned int j=0; + gid_t gid_list[LOC_PROCESS_MAX_NUM_GROUPS]; + char *split_strings[MAX_NUM_STRINGS]; + int name_length=0, group_list_length=0, platform_length=0, baseband_length=0, ngroups=0, ret=0; + int auto_platform_length = 0; + int group_index=0, nstrings=0, status_length=0; + FILE* conf_fp = nullptr; + char platform_name[PROPERTY_VALUE_MAX], baseband_name[PROPERTY_VALUE_MAX]; + char autoplatform_name[PROPERTY_VALUE_MAX]; + int lean_target=0; + unsigned int loc_service_mask=0; + char config_mask = 0; + unsigned char proc_list_length=0; + int gtp_cell_ap_enabled = 0; + char arg_gtp_waa[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; + char arg_gtp_ap_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; + char arg_gtp_modem_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; + char arg_gtp_wifi[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; + char arg_sap[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; + char arg_disabled[LOC_PROCESS_MAX_ARG_STR_LENGTH] = LOC_FEATURE_MODE_DISABLED; + char arg_basic[LOC_PROCESS_MAX_ARG_STR_LENGTH] = LOC_FEATURE_MODE_BASIC; + char arg_premium[LOC_PROCESS_MAX_ARG_STR_LENGTH] = LOC_FEATURE_MODE_PREMIUM; + + if (process_count_ptr == NULL || process_info_table_ptr == NULL) { + return -1; + } + + //Read gps.conf and fill parameter table + UTIL_READ_CONF(LOC_PATH_GPS_CONF, gps_conf_parameter_table); + + //Form argument strings + strlcat(arg_gtp_waa, LOC_FEATURE_GTP_WAA, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); + strlcat(arg_gtp_ap_cell, LOC_FEATURE_GTP_AP_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); + strlcat(arg_gtp_modem_cell, LOC_FEATURE_GTP_MODEM_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); + strlcat(arg_gtp_wifi, LOC_FEATURE_GTP_WIFI, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); + strlcat(arg_sap, LOC_FEATURE_SAP, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); + + //Get platform name from ro.board.platform property + loc_get_platform_name(platform_name, sizeof(platform_name)); + //Get baseband name from ro.baseband property + loc_get_target_baseband(baseband_name, sizeof(baseband_name)); + lean_target = loc_identify_lean_target(); + LOC_LOGD("%s:%d]: lean target:%d", __func__, __LINE__, lean_target); + //Identify if this is an automotive platform + loc_get_auto_platform_name(autoplatform_name,sizeof(autoplatform_name)); + + UTIL_READ_CONF(conf_file_name, loc_feature_conf_table); + + //Set service mask for GTP_WIFI + if(strcmp(conf.feature_gtp_wifi, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: GTP WIFI DISABLED", __func__, __LINE__); + } + else if(strcmp(conf.feature_gtp_wifi, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting GTP WIFI to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_WIFI_BASIC; + } + //conf file has a garbage value + else { + LOC_LOGE("%s:%d]: Unrecognized value for GTP WIFI Mode."\ + " Setting GTP WIFI to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_WIFI_BASIC; + } + + //Set service mask for GTP_CELL + //Using a temp variable here to indicate wheter GTP cell is + //enabled on the AP or modem. This variable will be used in + //further checks below. An alternative was to compare the + //string again in each place which would've been more expensive + if(strcmp(conf.feature_gtp_cell_proc, "AP") == 0) { + gtp_cell_ap_enabled = 1; + } + + if(strcmp(conf.feature_gtp_cell, "PREMIUM") == 0) { + LOC_LOGE("%s:%d]: Error: location feature GTP CELL does not support PREMIUM mode" \ + " available modes are BASIC and DISABLED. Starting feature in BASIC mode", + __func__, __LINE__); + if(gtp_cell_ap_enabled) { + loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; + } + else { + loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; + } + } + else if(strcmp(conf.feature_gtp_cell, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting GTP CELL to mode: BASIC", __func__, __LINE__); + if(gtp_cell_ap_enabled) { + loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; + } + else { + loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; + } + } + else if(strcmp(conf.feature_gtp_cell, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: GTP CELL DISABLED", __func__, __LINE__); + } + //conf file has a garbage value + else { + LOC_LOGE("%s:%d]: Unrecognized value for GTP CELL Mode." \ + " Setting GTP CELL to default mode: BASIC", __func__, __LINE__); + if(gtp_cell_ap_enabled) { + loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; + } + else { + loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; + } + } + + //Set service mask for GTP_WAA + if(strcmp(conf.feature_gtp_waa, "PREMIUM") == 0) { + LOC_LOGE("%s:%d]: Error: location feature GTP WAA does not support PREMIUM mode" \ + " available modes are BASIC and DISABLED. Starting feature in BASIC mode", + __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC; + } + else if(strcmp(conf.feature_gtp_waa, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting GTP WAA to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC; + } + else if(strcmp(conf.feature_gtp_waa, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__); + } + //conf file has a garbage value + else { + LOC_LOGE("%s:%d]: Unrecognized value for GTP WAA Mode."\ + " Setting GTP WAA to default mode: DISABLED", __func__, __LINE__); + } + + //Set service mask for SAP + if(strcmp(conf.feature_sap, "PREMIUM") == 0) { + LOC_LOGD("%s:%d]: Setting SAP to mode: PREMIUM", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_SAP_PREMIUM; + } + else if(strcmp(conf.feature_sap, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting SAP to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_SAP_BASIC; + } + else if(strcmp(conf.feature_sap, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: Setting SAP to mode: DISABLED", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Unrecognized value for SAP Mode."\ + " Setting SAP to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_SAP_BASIC; + } + + // Set service mask for ODCPI + if(strcmp(conf.feature_odcpi, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting ODCPI to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_ODCPI; + } + else if(strcmp(conf.feature_odcpi, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: Setting ODCPI to mode: DISABLED", __func__, __LINE__); + } + else if(strcmp(conf.feature_odcpi, "PREMIUM") == 0) { + LOC_LOGD("%s:%d]: Unrecognized value for ODCPI mode."\ + "Setting ODCPI to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_ODCPI; + } + + // Set service mask for FREE_WIFI_SCAN_INJECT + if(strcmp(conf.feature_free_wifi_scan_inject, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting FREE_WIFI_SCAN_INJECT to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT; + } + else if(strcmp(conf.feature_free_wifi_scan_inject, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: Setting FREE_WIFI_SCAN_INJECT to mode: DISABLED", __func__, __LINE__); + } + else if(strcmp(conf.feature_free_wifi_scan_inject, "PREMIUM") == 0) { + LOC_LOGD("%s:%d]: Unrecognized value for FREE_WIFI_SCAN_INJECT mode."\ + "Setting FREE_WIFI_SCAN_INJECT to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT; + } + + // Set service mask for SUPL_WIFI + if(strcmp(conf.feature_supl_wifi, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting SUPL_WIFI to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_SUPL_WIFI; + } + else if(strcmp(conf.feature_supl_wifi, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: Setting SUPL_WIFI to mode: DISABLED", __func__, __LINE__); + } + else if(strcmp(conf.feature_supl_wifi, "PREMIUM") == 0) { + LOC_LOGD("%s:%d]: Unrecognized value for SUPL_WIFI mode."\ + "Setting SUPL_WIFI to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_SUPL_WIFI; + } + + // Set service mask for WIFI_SUPPLICANT_INFO + if(strcmp(conf.feature_wifi_supplicant_info, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting WIFI_SUPPLICANT_INFO to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_WIFI_SUPPLICANT_INFO; + } + else if(strcmp(conf.feature_wifi_supplicant_info, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: Setting WIFI_SUPPLICANT_INFO to mode: DISABLED", __func__, __LINE__); + } + else if(strcmp(conf.feature_wifi_supplicant_info, "PREMIUM") == 0) { + LOC_LOGD("%s:%d]: Unrecognized value for WIFI_SUPPLICANT_INFO mode."\ + "Setting LOC_FEATURE_MASK_WIFI_SUPPLICANT_INFO to default mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_WIFI_SUPPLICANT_INFO; + } + + LOC_LOGD("%s:%d]: loc_service_mask: %x\n", __func__, __LINE__, loc_service_mask); + + if((conf_fp = fopen(conf_file_name, "r")) == NULL) { + LOC_LOGE("%s:%d]: Error opening %s %s\n", __func__, + __LINE__, conf_file_name, strerror(errno)); + ret = -1; + goto err; + } + + //Parse through the file to find out how many processes are to be launched + proc_list_length = 0; + do { + conf.proc_name[0] = 0; + //Here note that the 3rd parameter is passed as 1. + //This is so that only the first parameter in the table which is "PROCESS_NAME" + //is read. We do not want to read the entire block of parameters at this time + //since we are only counting the number of processes to launch. + //Therefore, only counting the occurrences of PROCESS_NAME parameter + //should suffice + if(loc_read_conf_r(conf_fp, loc_process_conf_parameter_table, 1)) { + LOC_LOGE("%s:%d]: Unable to read conf file. Failing\n", __func__, __LINE__); + ret = -1; + goto err; + } + name_length=(int)strlen(conf.proc_name); + if(name_length) { + proc_list_length++; + LOC_LOGD("Process name:%s", conf.proc_name); + } + } while(name_length); + LOC_LOGD("Process cnt = %d", proc_list_length); + + child_proc = (loc_process_info_s_type *)calloc(proc_list_length, sizeof(loc_process_info_s_type)); + if(child_proc == NULL) { + LOC_LOGE("%s:%d]: ERROR: Malloc returned NULL\n", __func__, __LINE__); + ret = -1; + goto err; + } + + //Move file descriptor to the beginning of the file + //so that the parameters can be read + rewind(conf_fp); + + for(j=0; j LOC_MAX_PARAM_STRING) { + LOC_LOGE("%s:%d]: i: %d; Length of name parameter too long. Max length: %d", + __func__, __LINE__, i, LOC_MAX_PARAM_STRING); + continue; + } + strlcpy(child_proc[j].name[0], conf.proc_name, sizeof (child_proc[j].name[0])); + + child_proc[j].num_groups = 0; + ngroups = loc_util_split_string(conf.group_list, split_strings, MAX_NUM_STRINGS, ' '); +#ifdef __ANDROID__ + for(i=0; ipw_gid; + child_proc[j].num_groups++; + LOC_LOGD("%s:%d]:Group %s = %d matches child_group: %d\n", + __func__, __LINE__, split_strings[i], + pwd->pw_gid,child_proc[j].group_list[i]); + } + } +#endif + nstrings = loc_util_split_string(conf.platform_list, split_strings, MAX_NUM_STRINGS, ' '); + if(strcmp("all", split_strings[0]) == 0) { + if (nstrings == 1 || (nstrings == 2 && (strcmp("exclude", split_strings[1]) == 0))) { + LOC_LOGD("%s:%d]: Enabled for all targets\n", __func__, __LINE__); + config_mask |= CONFIG_MASK_TARGET_ALL; + } + else if (nstrings > 2 && (strcmp("exclude", split_strings[1]) == 0)) { + config_mask |= CONFIG_MASK_TARGET_FOUND; + for (i=2; i 2 && (strcmp("exclude", split_strings[1]) == 0)) { + config_mask |= CONFIG_MASK_BASEBAND_FOUND; + for (i=2; i #include +#include +#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 LOC_FEATURE_MODE_DISABLED "DISABLED" +#define LOC_FEATURE_MODE_BASIC "BASIC" +#define LOC_FEATURE_MODE_PREMIUM "PREMIUM" + +#define LOC_FEATURE_GTP_AP_CELL "gtp-ap-cell" +#define LOC_FEATURE_GTP_MODEM_CELL "gtp-modem-cell" +#define LOC_FEATURE_GTP_CELL_ENH "gtp-cell-enh" +#define LOC_FEATURE_GTP_WIFI "gtp-wifi" +#define LOC_FEATURE_GTP_WAA "gtp-waa" +#define LOC_FEATURE_SAP "sap" + +#define LOC_PROCESS_MAX_NUM_GROUPS 20 +#define LOC_PROCESS_MAX_NUM_ARGS 25 +#define LOC_PROCESS_MAX_ARG_STR_LENGTH 32 + #define UTIL_UPDATE_CONF(conf_data, len, config_table) \ loc_update_conf((conf_data), (len), (config_table), \ sizeof(config_table) / sizeof(config_table[0])) @@ -62,6 +80,23 @@ typedef struct 'f' for double */ } loc_param_s_type; +typedef enum { + ENABLED, + RUNNING, + DISABLED, + DISABLED_FROM_CONF +} loc_process_e_status; + +typedef struct { + loc_process_e_status proc_status; + pid_t proc_id; + char name[2][LOC_MAX_PARAM_STRING]; + gid_t group_list[LOC_PROCESS_MAX_NUM_GROUPS]; + unsigned char num_groups; + char args[LOC_PROCESS_MAX_NUM_ARGS][LOC_PROCESS_MAX_ARG_STR_LENGTH]; + char argumentString[LOC_MAX_PARAM_STRING]; +} loc_process_info_s_type; + /*============================================================================= * * MODULE EXTERNAL DATA @@ -95,6 +130,9 @@ extern const char LOC_PATH_APDR_CONF[]; extern const char LOC_PATH_XTWIFI_CONF[]; extern const char LOC_PATH_QUIPC_CONF[]; +int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, + loc_process_info_s_type** process_info_table_ptr); + #ifdef __cplusplus } #endif From ec59dd2aaedbc26091064f5ee8191444cb5bf04d Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 25 Jan 2018 10:56:31 -0800 Subject: [PATCH 610/945] fix: LocIpcSender returns incorrect result LocIpcSender::send() doesn't return correct boolean result code. It always returns false even it is successfully sent. Change-Id: I74d85501f5d097dc1ede4dea5b2d9c9d752affda CRs-Fixed: 2179096 --- utils/LocIpc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 738d4fbd..8598a327 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -131,8 +131,7 @@ public: inline bool send(const uint8_t data[], uint32_t length) { bool rtv = false; if (nullptr != mSocket && nullptr != data) { - ssize_t rv = LocIpc::sendData(*mSocket, mDestAddr, data, length); - rtv = (rv == (int)length); + rtv = LocIpc::sendData(*mSocket, mDestAddr, data, length); } return rtv; } From 5b2f22434981dfa456c5a64f7fd105d7ee7df2ba Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 29 Jan 2018 14:32:06 +0530 Subject: [PATCH 611/945] GPS: integrate GNSS engine hub with Gnss Adapter Integrate GNSS engine hub with Gnss Adapter using dynamically loadable .so file. Change-Id: I0420a17628db96447c01b8821e54782f7d992aec CRs-fixed: 2165862 --- core/EngineHubProxyBase.h | 109 +++++++++++++++++++++++++ core/Makefile.am | 1 + gnss/GnssAdapter.cpp | 164 ++++++++++++++++++++++++++++++++++++-- gnss/GnssAdapter.h | 9 ++- 4 files changed, 275 insertions(+), 8 deletions(-) create mode 100644 core/EngineHubProxyBase.h diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h new file mode 100644 index 00000000..c17b2c29 --- /dev/null +++ b/core/EngineHubProxyBase.h @@ -0,0 +1,109 @@ +/* Copyright (c) 2018, 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 ENGINE_HUB_PROXY_BASE_H +#define ENGINE_HUB_PROXY_BASE_H + +namespace loc_core { + +class EngineHubProxyBase { +public: + inline EngineHubProxyBase() { + } + inline virtual ~EngineHubProxyBase() {} + + // gnss session related functions + inline virtual bool gnssStartFix() { + LOC_LOGD("%s]: empty called ", __func__); + return false; + } + + inline virtual bool gnssStopFix() { + return false; + } + + inline virtual bool gnssSetFixMode(const LocPosMode ¶ms) { + (void) params; + return false; + } + + inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) { + (void) aidingData; + return false; + } + + // GNSS reports + inline virtual bool gnssReportPosition(const UlpLocation &location, + const GpsLocationExtended &locationExtended, + enum loc_sess_status status) { + (void) location; + (void) locationExtended; + (void) status; + return false; + } + + inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) { + (void) svNotify; + return false; + } + + inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) { + (void) svMeasurementSet; + return false; + } + + inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) { + (void) svPolynomial; + return false; + } + + inline virtual bool gnssReportNmea(const char* nmea) { + (void) nmea; + return false; + } +}; + +typedef std::function + GnssAdapterReportPositionEventCb; + +typedef std::function + GnssAdapterReportSvEventCb; + +// potential parameters: message queue: MsgTask * msgTask; +// callback function to report back dr and ppe position and sv report +typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, + GnssAdapterReportPositionEventCb positionEventCb, + GnssAdapterReportSvEventCb svEventCb); + +} // namespace loc_core + +#endif // ENGINE_HUB_PROXY_BASE_H diff --git a/core/Makefile.am b/core/Makefile.am index dc540e9c..78ae76b0 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -20,6 +20,7 @@ libloc_core_la_h_sources = \ UlpProxyBase.h \ loc_core_log.h \ LocAdapterProxyBase.h \ + EngineHubProxyBase.h \ data-items/DataItemId.h \ data-items/IDataItemCore.h \ data-items/DataItemConcreteTypesBase.h \ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index db4696f5..098c8aa0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -47,6 +47,7 @@ #include #define RAD2DEG (180.0 / M_PI) +#define PROCESS_NAME_ENGINE_SERVICE "engine-service" using namespace loc_core; @@ -65,6 +66,7 @@ GnssAdapter::GnssAdapter() : LocDualContext::mLocationHalName, false)), mUlpProxy(new UlpProxyBase()), + mEngHubProxy(new EngineHubProxyBase()), mUlpPositionMode(), mGnssSvIdUsedInPosition(), mGnssSvIdUsedInPosAvail(false), @@ -146,6 +148,7 @@ GnssAdapter::GnssAdapter() : readConfigCommand(); setConfigCommand(); initDefaultAgpsCommand(); + initEngHubProxyCommand(); } void @@ -936,6 +939,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) if ((nullptr != s) && (mData.deleteAll)) { s->setDefaultGnssEngineStates(); } + mAdapter.mEngHubProxy->gnssDeleteAidingData(mData); } }; @@ -1166,9 +1170,12 @@ GnssAdapter::updateClientsEventMask() /* ** For Automotive use cases we need to enable MEASUREMENT and POLY - ** when QDR is enabled + ** when QDR is enabled (e.g.: either enabled via conf file or + ** engine hub is loaded successfully). + ** Note: this need to be called from msg queue thread. */ - if(1 == ContextBase::mGps_conf.EXTERNAL_DR_ENABLED) { + if((1 == ContextBase::mGps_conf.EXTERNAL_DR_ENABLED) || + (true == initEngHubProxy())) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; @@ -1219,6 +1226,11 @@ GnssAdapter::restartSessions() LocPosMode locPosMode = {}; convertOptions(locPosMode, smallestIntervalOptions); + + // inform engine hub of the fix mode and start session + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); + mLocApi->startFix(locPosMode); } @@ -1508,6 +1520,10 @@ GnssAdapter::startTracking(const LocationOptions& options) // do nothing } if (!mUlpProxy->sendStartFix()) { + // inform engine hub that GNSS session is about to start + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); + loc_api_adapter_err apiErr = mLocApi->startFix(locPosMode); if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { err = LOCATION_ERROR_SUCCESS; @@ -1539,6 +1555,7 @@ GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) inline virtual void proc() const { // saves the mode in adapter to be used when startTrackingCommand is called from ULP if (mAdapter.setUlpPositionMode(mLocPosMode)) { + mAdapter.mEngHubProxy->gnssSetFixMode(mLocPosMode); mApi.setPositionMode(mLocPosMode); } } @@ -1563,8 +1580,15 @@ GnssAdapter::startTrackingCommand() inline virtual void proc() const { // we get this call from ULP, so just call LocApi without multiplexing because // ulp would be doing the multiplexing for us if it is present - if (!mAdapter.isInSession()) { - LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + + // TBD: once CR 2165853 is fixed, move below codes + // to inside condition of if (!mAdapter.isInSession()) + // + // inform engine hub of the fix mode and start session + mAdapter.mEngHubProxy->gnssSetFixMode(ulpPositionMode); + mAdapter.mEngHubProxy->gnssStartFix(); + if (!mAdapter.isInSession()) { mApi.startFix(ulpPositionMode); } } @@ -1737,6 +1761,9 @@ GnssAdapter::stopTracking() { LocationError err = LOCATION_ERROR_SUCCESS; if (!mUlpProxy->sendStopFix()) { + // inform engine hub that GNSS session has stopped + mEngHubProxy->gnssStopFix(); + loc_api_adapter_err apiErr = mLocApi->stopFix(); if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { err = LOCATION_ERROR_SUCCESS; @@ -1762,6 +1789,9 @@ GnssAdapter::stopTrackingCommand() mAdapter(adapter), mApi(api) {} inline virtual void proc() const { + // inform engine hub that GNSS session has stopped + mAdapter.mEngHubProxy->gnssStopFix(); + // clear the position mode LocPosMode mLocPosMode = {}; mLocPosMode.mode = LOC_POSITION_MODE_INVALID; @@ -2014,8 +2044,12 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, { LOC_LOGD("%s]: fromUlp %u status %u", __func__, fromUlp, status); - // if this event is not called from ULP, then try to call into ULP and return if successfull + // if this event is called from QMI LOC API, then try to call into ULP and return if successfull + // if the position is called from ULP or engine hub, then send it out directly if (!fromUlp) { + // report QMI position to engine hub, and engine hub will be + // distributing it to the registered plugins + mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); if (mUlpProxy->reportPosition(ulpLocation, locationExtended, status, techMask)) { return; @@ -2137,6 +2171,9 @@ GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, // if this event is not called from ULP, then try to call into ULP and return if successfull if (!fromUlp) { + // report QMI SV report to eng hub + mEngHubProxy->gnssReportSv(svNotify); + if (mUlpProxy->reportSv(svNotify)) { return; } @@ -2231,6 +2268,7 @@ GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) { // if this event is not called from ULP, then try to call into ULP and return if successfull if (!fromUlp && !loc_nmea_is_debug(nmea, length)) { + mEngHubProxy->gnssReportNmea(nmea); if (mUlpProxy->reportNmea(nmea, length)) { return; } @@ -2501,6 +2539,7 @@ GnssAdapter::reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. mUlpProxy->reportSvMeasurement(svMeasurementSet); + mEngHubProxy->gnssReportSvMeasurement(svMeasurementSet); } void @@ -2510,6 +2549,8 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. mUlpProxy->reportSvPolynomial(svPolynomial); + + mEngHubProxy->gnssReportSvPolynomial(svPolynomial); } void GnssAdapter::initDefaultAgps() { @@ -3138,3 +3179,114 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD adapter->dataConnFailedCommand(agpsType); } } + +/* ==== Eng Hub Proxy ================================================================= */ +/* ======== UTILITIES ================================================================= */ +void +GnssAdapter::initEngHubProxyCommand() { + LOC_LOGD("%s]: ", __func__); + + struct MsgInitEngHubProxy : public LocMsg { + GnssAdapter* mAdapter; + inline MsgInitEngHubProxy(GnssAdapter* adapter) : + LocMsg(), + mAdapter(adapter) {} + inline virtual void proc() const { + mAdapter->initEngHubProxy(); + } + }; + + sendMsg(new MsgInitEngHubProxy(this)); +} + +bool +GnssAdapter::initEngHubProxy() { + static bool firstTime = true; + static bool engHubLoadSuccessful = false; + + const char *error = nullptr; + unsigned int processListLength = 0; + loc_process_info_s_type* processInfoList = nullptr; + + do { + // load eng hub only once + if (firstTime == false) { + break; + } + + int rc = loc_read_process_conf(LOC_PATH_IZAT_CONF, &processListLength, + &processInfoList); + if (rc != 0) { + LOC_LOGE("%s]: failed to parse conf file", __func__); + break; + } + + bool pluginDaemonEnabled = false; + // go over the conf table to see whether any plugin daemon is enabled + for (unsigned int i = 0; i < processListLength; i++) { + if ((strncmp(processInfoList[i].name[0], PROCESS_NAME_ENGINE_SERVICE, + strlen(PROCESS_NAME_ENGINE_SERVICE)) == 0) && + (processInfoList[i].proc_status == ENABLED)) { + pluginDaemonEnabled = true; + break; + } + } + + // no plugin daemon is enabled for this platform, no need to load eng hub .so + if (pluginDaemonEnabled == false) { + break; + } + + // load the engine hub .so, if the .so is not present + // all EngHubProxyBase calls will turn into no-op. + void *handle = nullptr; + if ((handle = dlopen("libloc_eng_hub.so", RTLD_NOW)) == nullptr) { + if ((error = dlerror()) != nullptr) { + LOC_LOGE("%s]: libloc_eng_hub.so not found %s !", __func__, error); + } + break; + } + + // prepare the callback functions + // callback function for engine hub to report back position event + GnssAdapterReportPositionEventCb reportPositionEventCb = + [this](const UlpLocation& ulpLocation, + const GpsLocationExtended& locationExtended, + enum loc_sess_status status, + LocPosTechMask techMask, + bool fromUlp) { + // report from engine hub on behalf of PPE will be treated as fromUlp + reportPositionEvent(ulpLocation, locationExtended, status, techMask, fromUlp); + }; + + // callback function for engine hub to report back sv event + GnssAdapterReportSvEventCb reportSvEventCb = + [this](const GnssSvNotification& svNotify, bool fromUlp) { + reportSvEvent(svNotify, fromUlp); + }; + + getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); + if(getter != nullptr) { + EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, reportPositionEventCb, + reportSvEventCb); + if (hubProxy != nullptr) { + mEngHubProxy = hubProxy; + engHubLoadSuccessful = true; + } + } + else { + LOC_LOGD("%s]: entered, did not find function", __func__); + } + } while (0); + + if (processInfoList != nullptr) { + free (processInfoList); + processInfoList = nullptr; + } + + LOC_LOGD("%s]: first time initialization %d, returned %d", + __func__, firstTime, engHubLoadSuccessful); + + firstTime = false; + return engHubLoadSuccessful; +} diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 99ce5c9a..cf871ba3 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -84,6 +85,9 @@ class GnssAdapter : public LocAdapterBase { /* ==== ULP ============================================================================ */ UlpProxyBase* mUlpProxy; + /* ==== Engine Hub ===================================================================== */ + EngineHubProxyBase* mEngHubProxy; + /* ==== CLIENT ========================================================================= */ typedef std::map ClientDataMap; ClientDataMap mClientData; @@ -198,6 +202,7 @@ public: void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); void readConfigCommand(); void setConfigCommand(); + void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); void gnssUpdateXtraThrottleCommand(const bool enabled); @@ -221,6 +226,7 @@ public: bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); virtual bool isInSession() { return !mTrackingSessions.empty(); } void initDefaultAgps(); + bool initEngHubProxy(); /* ==== REPORTS ======================================================================== */ /* ======== EVENTS ====(Called from QMI/ULP Thread)===================================== */ @@ -286,7 +292,6 @@ public: void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); - }; #endif //GNSS_ADAPTER_H From 946f536641d97d7e17041290daf3f1d7daa7be93 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 2 Feb 2018 20:15:03 +0530 Subject: [PATCH 612/945] Fix compilation issues as a result of LE cleanup Change-Id: I1f7bb8c3bb4d912c7a743d5807dd7790f1973afd CRs-fixed: 2181265 --- gnss/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/Makefile.am b/gnss/Makefile.am index c818cae7..7ee60892 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -25,7 +25,7 @@ libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libgnss_la_LIBADD = -lstdc++ $(GPSUTILS_LIBS) $(LOCCORE_LIBS) +libgnss_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) $(LOCCORE_LIBS) #Create and Install libraries lib_LTLIBRARIES = libgnss.la From bb529c50e9a91f0bdb73d4a8a36e55155002a73e Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 19 Jan 2018 17:32:08 +0530 Subject: [PATCH 613/945] Moving location sockets from /data to /dev Keeping sockets in /data/vendor/location prevents unmounting of /data partition after build load. CRs-Fixed: 2174503 Change-Id: Ib1b9f07bb25368ac7d1a32536e58c52dd2b2ad4e --- utils/gps_extended_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index afe47ccc..e29b2a84 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1314,8 +1314,8 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); /* Shared resources of LocIpc */ -#define LOC_IPC_HAL "/data/vendor/location/socket_hal" -#define LOC_IPC_XTRA "/data/vendor/location/xtra/socket_xtra" +#define LOC_IPC_HAL "/dev/socket/location/socket_hal" +#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" #ifdef __cplusplus } From af34b8d1ac48db485f78d832b4d263473d18dde9 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Wed, 10 Jan 2018 13:58:17 +0800 Subject: [PATCH 614/945] Enhance LocationAPI structs to hold full position Match the output of izat_remote_api clients with LocationAPI clients. Fill GnssLocationInfoNotification with missing fields from GpsLocationExtended and Location structure. And allow one single callback to report complete position info. Meanwhile, remove fields from UlpLocation that are no longer used. CRs-fixed: 2169738 Change-Id: Ib5bd3dd9c065c4b3d6cad32b23167546ad950d06 --- core/LocApiBase.cpp | 5 +- gnss/GnssAdapter.cpp | 101 ++++++++++++++------ gnss/GnssAdapter.h | 2 +- location/LocationAPI.h | 205 ++++++++++++++++++++++++++++++++++++++++- utils/gps_extended_c.h | 26 ------ 5 files changed, 279 insertions(+), 60 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 95768425..8aef94b3 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -236,7 +236,7 @@ void LocApiBase::reportPosition(UlpLocation& location, // print the location info before delivering LOC_LOGD("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: %" PRId64 "\n rawDataSize: %d\n rawData: %p\n " + "timestamp: %" PRId64 "\n" "Session status: %d\n Technology mask: %u\n " "SV used in fix (gps/glo/bds/gal/qzss) : \ (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")", @@ -244,8 +244,7 @@ void LocApiBase::reportPosition(UlpLocation& location, 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, + location.gpsLocation.timestamp, 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, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 098c8aa0..a57d1a40 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -190,32 +190,32 @@ GnssAdapter::convertOptions(LocPosMode& out, const LocationOptions& options) } void -GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation, +GnssAdapter::convertLocation(Location& out, const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, const LocPosTechMask techMask) { memset(&out, 0, sizeof(Location)); out.size = sizeof(Location); - if (LOC_GPS_LOCATION_HAS_LAT_LONG & locGpsLocation.flags) { + if (LOC_GPS_LOCATION_HAS_LAT_LONG & ulpLocation.gpsLocation.flags) { out.flags |= LOCATION_HAS_LAT_LONG_BIT; - out.latitude = locGpsLocation.latitude; - out.longitude = locGpsLocation.longitude; + out.latitude = ulpLocation.gpsLocation.latitude; + out.longitude = ulpLocation.gpsLocation.longitude; } - if (LOC_GPS_LOCATION_HAS_ALTITUDE & locGpsLocation.flags) { + if (LOC_GPS_LOCATION_HAS_ALTITUDE & ulpLocation.gpsLocation.flags) { out.flags |= LOCATION_HAS_ALTITUDE_BIT; - out.altitude = locGpsLocation.altitude; + out.altitude = ulpLocation.gpsLocation.altitude; } - if (LOC_GPS_LOCATION_HAS_SPEED & locGpsLocation.flags) { + if (LOC_GPS_LOCATION_HAS_SPEED & ulpLocation.gpsLocation.flags) { out.flags |= LOCATION_HAS_SPEED_BIT; - out.speed = locGpsLocation.speed; + out.speed = ulpLocation.gpsLocation.speed; } - if (LOC_GPS_LOCATION_HAS_BEARING & locGpsLocation.flags) { + if (LOC_GPS_LOCATION_HAS_BEARING & ulpLocation.gpsLocation.flags) { out.flags |= LOCATION_HAS_BEARING_BIT; - out.bearing = locGpsLocation.bearing; + out.bearing = ulpLocation.gpsLocation.bearing; } - if (LOC_GPS_LOCATION_HAS_ACCURACY & locGpsLocation.flags) { + if (LOC_GPS_LOCATION_HAS_ACCURACY & ulpLocation.gpsLocation.flags) { out.flags |= LOCATION_HAS_ACCURACY_BIT; - out.accuracy = locGpsLocation.accuracy; + out.accuracy = ulpLocation.gpsLocation.accuracy; } if (GPS_LOCATION_EXTENDED_HAS_VERT_UNC & locationExtended.flags) { out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; @@ -229,7 +229,7 @@ GnssAdapter::convertLocation(Location& out, const LocGpsLocation& locGpsLocation out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; out.bearingAccuracy = locationExtended.bearing_unc; } - out.timestamp = locGpsLocation.timestamp; + out.timestamp = ulpLocation.gpsLocation.timestamp; if (LOC_POS_TECH_MASK_SATELLITE & techMask) { out.techMask |= LOCATION_TECHNOLOGY_GNSS_BIT; } @@ -259,6 +259,11 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.hdop = locationExtended.hdop; out.vdop = locationExtended.vdop; } + if (GPS_LOCATION_EXTENDED_HAS_EXT_DOP & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EXT_DOP_BIT; + out.gdop = locationExtended.extDOP.GDOP; + out.tdop = locationExtended.extDOP.TDOP; + } if (GPS_LOCATION_EXTENDED_HAS_MAG_DEV & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT; out.magneticDeviation = locationExtended.magneticDeviation; @@ -315,6 +320,53 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT; out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth; } + if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT; + out.svUsedInPosition.gpsSvUsedIdsMask = + locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask; + out.svUsedInPosition.gloSvUsedIdsMask = + locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask; + out.svUsedInPosition.galSvUsedIdsMask = + locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask; + out.svUsedInPosition.bdsSvUsedIdsMask = + locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; + out.svUsedInPosition.qzssSvUsedIdsMask = + locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + } + if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT; + out.navSolutionMask = locationExtended.navSolutionMask; + } + if (GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK; + out.posTechMask = locationExtended.tech_mask; + } + if (GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA; + if (locationExtended.bodyFrameData.bodyFrameDatamask & + LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT) { + out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT; + } + if (locationExtended.bodyFrameData.bodyFrameDatamask & + LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT) { + out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT; + } + if (locationExtended.bodyFrameData.bodyFrameDatamask & + LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT) { + out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT; + } + if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_YAW_RATE_BIT) { + out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_YAW_RATE_BIT; + } + if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_PITCH_BIT) { + out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_PITCH_BIT; + } + out.bodyFrameData.longAccel = locationExtended.bodyFrameData.longAccel; + out.bodyFrameData.latAccel = locationExtended.bodyFrameData.latAccel; + out.bodyFrameData.vertAccel = locationExtended.bodyFrameData.vertAccel; + out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate; + out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch; + } } inline uint32_t @@ -1151,7 +1203,7 @@ GnssAdapter::updateClientsEventMask() { LOC_API_ADAPTER_EVENT_MASK_T mask = 0; for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { - if (it->second.trackingCb != nullptr) { + if (it->second.trackingCb != nullptr || it->second.gnssLocationInfoCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT; } if (it->second.gnssNiCb != nullptr) { @@ -1340,7 +1392,7 @@ bool GnssAdapter::hasTrackingCallback(LocationAPI* client) { auto it = mClientData.find(client); - return (it != mClientData.end() && it->second.trackingCb); + return (it != mClientData.end() && (it->second.trackingCb || it->second.gnssLocationInfoCb)); } bool @@ -2126,15 +2178,15 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; } for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { - if (nullptr != it->second.trackingCb) { - Location location = {}; - convertLocation(location, ulpLocation.gpsLocation, locationExtended, techMask); - it->second.trackingCb(location); - } if (nullptr != it->second.gnssLocationInfoCb) { GnssLocationInfoNotification locationInfo = {}; convertLocationInfo(locationInfo, locationExtended); + convertLocation(locationInfo.location, ulpLocation, locationExtended, techMask); it->second.gnssLocationInfoCb(locationInfo); + } else if (nullptr != it->second.trackingCb) { + Location location = {}; + convertLocation(location, ulpLocation, locationExtended, techMask); + it->second.trackingCb(location); } } } @@ -2152,15 +2204,6 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, reportNmea(sentence.c_str(), sentence.length()); } } - - // Free the allocated memory for rawData - UlpLocation* gp = (UlpLocation*)&(ulpLocation); - if (gp != NULL && gp->rawData != NULL) - { - delete (char*)gp->rawData; - gp->rawData = NULL; - gp->rawDataSize = 0; - } } void diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index cf871ba3..e047f75b 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -119,7 +119,7 @@ class GnssAdapter : public LocAdapterBase { /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); - static void convertLocation(Location& out, const LocGpsLocation& locGpsLocation, + static void convertLocation(Location& out, const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, const LocPosTechMask techMask); static void convertLocationInfo(GnssLocationInfoNotification& out, diff --git a/location/LocationAPI.h b/location/LocationAPI.h index 530b1b08..ce478d23 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -88,6 +88,40 @@ typedef enum { LOCATION_RELIABILITY_HIGH, } LocationReliability; +typedef uint32_t GnssLocationNavSolutionMask; +typedef enum { + LOCATION_SBAS_CORRECTION_IONO_BIT = (1<<0), // SBAS ionospheric correction is used + LOCATION_SBAS_CORRECTION_FAST_BIT = (1<<1), // SBAS fast correction is used + LOCATION_SBAS_CORRECTION_LONG_BIT = (1<<2), // SBAS long-tem correction is used + LOCATION_SBAS_INTEGRITY_BIT = (1<<3), // SBAS integrity information is used + LOCATION_NAV_CORRECTION_DGNSS_BIT = (1<<4), // Position Report is DGNSS corrected + LOCATION_NAV_CORRECTION_RTK_BIT = (1<<5), // Position Report is RTK corrected + LOCATION_NAV_CORRECTION_PPP_BIT = (1<<6) // Position Report is PPP corrected +} GnssLocationNavSolutionBits; + +typedef uint32_t GnssLocationPosTechMask; +typedef enum { + LOCATION_POS_TECH_DEFAULT_BIT = 0, + LOCATION_POS_TECH_SATELLITE_BIT = (1<<0), + LOCATION_POS_TECH_CELLID_BIT = (1<<1), + LOCATION_POS_TECH_WIFI_BIT = (1<<2), + LOCATION_POS_TECH_SENSORS_BIT = (1<<3), + LOCATION_POS_TECH_REFERENCE_LOCATION_BIT = (1<<4), + LOCATION_POS_TECH_INJECTED_COARSE_POSITION_BIT = (1<<5), + LOCATION_POS_TECH_AFLT_BIT = (1<<6), + LOCATION_POS_TECH_HYBRID_BIT = (1<<7), + LOCATION_POS_TECH_PPE_BIT = (1<<8) +} GnssLocationPosTechBits; + +typedef uint32_t GnssLocationPosDataMask; +typedef enum { + LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT = (1<<0), // Navigation data has Forward Acceleration + LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT = (1<<1), // Navigation data has Sideward Acceleration + LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT = (1<<2), // Navigation data has Vertical Acceleration + LOCATION_NAV_DATA_HAS_YAW_RATE_BIT = (1<<3), // Navigation data has Heading Rate + LOCATION_NAV_DATA_HAS_PITCH_BIT = (1<<4) // Navigation data has Body pitch +} GnssLocationPosDataBits; + typedef uint32_t GnssLocationInfoFlagMask; typedef enum { GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT = (1<<0), // valid altitude mean sea level @@ -97,7 +131,14 @@ typedef enum { GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<4), // valid vertical reliability GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7),// valid accuracy elipsode azimuth + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7), // valid accuracy elipsode azimuth + GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT = (1<<8), // valid gnss sv used in pos data + GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT = (1<<9), // valid navSolutionMask + GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask + GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource + GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data + GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time + GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop } GnssLocationInfoFlagBits; typedef enum { @@ -411,6 +452,45 @@ typedef enum { GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), } GnssAidingDataSvTypeBits; +typedef enum +{ + GNSS_LOC_SV_SYSTEM_GPS = 1, + /**< GPS satellite. */ + GNSS_LOC_SV_SYSTEM_GALILEO = 2, + /**< GALILEO satellite. */ + GNSS_LOC_SV_SYSTEM_SBAS = 3, + /**< SBAS satellite. */ + GNSS_LOC_SV_SYSTEM_COMPASS = 4, + /**< COMPASS satellite. */ + GNSS_LOC_SV_SYSTEM_GLONASS = 5, + /**< GLONASS satellite. */ + GNSS_LOC_SV_SYSTEM_BDS = 6, + /**< BDS satellite. */ + GNSS_LOC_SV_SYSTEM_QZSS = 7 + /**< QZSS satellite. */ +} Gnss_LocSvSystemEnumType; + +typedef uint32_t GnssSystemTimeStructTypeFlags; +typedef enum { + GNSS_SYSTEM_TIME_WEEK_VALID = (1 << 0), + GNSS_SYSTEM_TIME_WEEK_MS_VALID = (1 << 1), + GNSS_SYSTEM_CLK_TIME_BIAS_VALID = (1 << 2), + GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID = (1 << 3), + GNSS_SYSTEM_REF_FCOUNT_VALID = (1 << 4), + GNSS_SYSTEM_NUM_CLOCK_RESETS_VALID = (1 << 5) +} GnssSystemTimeTypeBits; + +typedef uint32_t GnssGloTimeStructTypeFlags; +typedef enum { + GNSS_CLO_DAYS_VALID = (1 << 0), + GNSS_GLOS_MSEC_VALID = (1 << 1), + GNSS_GLO_CLK_TIME_BIAS_VALID = (1 << 2), + GNSS_GLO_CLK_TIME_BIAS_UNC_VALID = (1 << 3), + GNSS_GLO_REF_FCOUNT_VALID = (1 << 4), + GNSS_GLO_NUM_CLOCK_RESETS_VALID = (1 << 5), + GNSS_GLO_FOUR_YEAR_VALID = (1 << 6) +} GnssGloTimeTypeBits; + typedef struct { GnssAidingDataSvMask svMask; // bitwise OR of GnssAidingDataSvBits GnssAidingDataSvTypeMask svTypeMask; // bitwise OR of GnssAidingDataSvTypeBits @@ -499,6 +579,114 @@ typedef struct { LocationTechnologyType techType; // GNSS } GeofenceStatusNotification; +typedef struct { + uint64_t gpsSvUsedIdsMask; + uint64_t gloSvUsedIdsMask; + uint64_t galSvUsedIdsMask; + uint64_t bdsSvUsedIdsMask; + uint64_t qzssSvUsedIdsMask; +} GnssLocationSvUsedInPosition; + +/** @struct + Body Frame parameters +*/ +typedef struct { + GnssLocationPosDataMask bodyFrameDataMask; // Contains Body frame LocPosDataMask bits + float longAccel; // Forward Acceleration in body frame (m/s2) + float latAccel; // Sideward Acceleration in body frame (m/s2) + float vertAccel; // Vertical Acceleration in body frame (m/s2) + float yawRate; // Heading Rate (Radians/second) + float pitch; // Body pitch (Radians) +} GnssLocationPositionDynamics; + +typedef struct { + /** Validity mask for below fields */ + GnssSystemTimeStructTypeFlags validityMask; + /** Extended week number at reference tick. + Unit: Week. + Set to 65535 if week number is unknown. + For GPS: + Calculated from midnight, Jan. 6, 1980. + OTA decoded 10 bit GPS week is extended to map between: + [NV6264 to (NV6264 + 1023)]. + NV6264: Minimum GPS week number configuration. + Default value of NV6264: 1738 + For BDS: + Calculated from 00:00:00 on January 1, 2006 of Coordinated Universal Time (UTC). + For GAL: + Calculated from 00:00 UT on Sunday August 22, 1999 (midnight between August 21 and August 22). + */ + uint16_t systemWeek; + /** Time in to the current week at reference tick. + Unit: Millisecond. Range: 0 to 604799999. + Check for systemClkTimeUncMs before use */ + uint32_t systemMsec; + /** System clock time bias (sub-millisecond) + Units: Millisecond + Note: System time (TOW Millisecond) = systemMsec - systemClkTimeBias. + Check for systemClkTimeUncMs before use. */ + float systemClkTimeBias; + /** Single sided maximum time bias uncertainty + Units: Millisecond */ + float systemClkTimeUncMs; + /** FCount (free running HW timer) value. Don't use for relative time purpose + due to possible discontinuities. + Unit: Millisecond */ + uint32_t refFCount; + /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ + uint32_t numClockResets; +} GnssSystemTimeStructType; + +typedef struct { + /** GLONASS day number in four years. Refer to GLONASS ICD. + Applicable only for GLONASS and shall be ignored for other constellations. + If unknown shall be set to 65535 */ + uint16_t gloDays; + /** Validity mask for below fields */ + GnssGloTimeStructTypeFlags validityMask; + /** GLONASS time of day in Millisecond. Refer to GLONASS ICD. + Units: Millisecond + Check for gloClkTimeUncMs before use */ + uint32_t gloMsec; + /** GLONASS clock time bias (sub-millisecond) + Units: Millisecond + Note: GLO time (TOD Millisecond) = gloMsec - gloClkTimeBias. + Check for gloClkTimeUncMs before use. */ + float gloClkTimeBias; + /** Single sided maximum time bias uncertainty + Units: Millisecond */ + float gloClkTimeUncMs; + /** FCount (free running HW timer) value. Don't use for relative time purpose + due to possible discontinuities. + Unit: Millisecond */ + uint32_t refFCount; + /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ + uint32_t numClockResets; + /** GLONASS four year number from 1996. Refer to GLONASS ICD. + Applicable only for GLONASS and shall be ignored for other constellations. + If unknown shall be set to 255 */ + uint8_t gloFourYear; +} GnssGloTimeStructType; + +typedef union { + GnssSystemTimeStructType gpsSystemTime; + GnssSystemTimeStructType galSystemTime; + GnssSystemTimeStructType bdsSystemTime; + GnssSystemTimeStructType qzssSystemTime; + GnssGloTimeStructType gloSytemTime; +} SystemTimeStructUnion; + /** Time applicability of PVT report */ +typedef struct { + /** Specifies GNSS system time reported. Mandatory field */ + Gnss_LocSvSystemEnumType gnssSystemTimeSrc; + /** Reporting of GPS system time is recommended. + If GPS time is unknown & other satellite system time is known, + it should be reported. + Mandatory field + */ + SystemTimeStructUnion u; +} GnssSystemTime; + typedef struct { size_t size; // set to sizeof(GnssLocationInfo) GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity @@ -506,12 +694,27 @@ typedef struct { float pdop; // position dilusion of precision float hdop; // horizontal dilusion of precision float vdop; // vertical dilusion of precision + float gdop; // geometric dilution of precision + float tdop; // time dilution of precision float magneticDeviation; // magnetic deviation LocationReliability horReliability; // horizontal reliability LocationReliability verReliability; // vertical reliability float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth + float northVelocity; // North Velocity.Unit: Meters/sec + float eastVelocity; // East Velocity + float upVelocity; + float northVelocityStdDeviation; + float eastVelocityStdDeviation; + float upVelocityStdDeviation; + GnssLocationSvUsedInPosition svUsedInPosition;// Gnss sv used in position data + GnssLocationNavSolutionMask navSolutionMask; // Nav solution mask to indicate sbas corrections + GnssLocationPosTechMask posTechMask; // Position technology used in computing this fix + GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and + // pitch set with validity + GnssSystemTime gnssSystemTime; // GNSS System Time + Location location; } GnssLocationInfoNotification; typedef struct { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index e29b2a84..bd528d9e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -127,13 +127,6 @@ typedef struct { /* Provider indicator for HYBRID or GPS */ uint16_t position_source; LocPosTechMask tech_mask; - /*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; typedef struct { @@ -728,25 +721,6 @@ enum ulp_gnss_sv_poly_valid_flags{ #define ULP_GNSS_SV_POLY_BIT_VELO_COEFF (1< Date: Thu, 15 Feb 2018 18:49:42 -0800 Subject: [PATCH 615/945] fixing LE hy11 build define ALOGx for HY11 build, which doesn't have liblog Change-Id: I151d451997f71179e4c4bba3946d7fd52e1f345f CRs-Fixed: 2190714 --- utils/log_util.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/utils/log_util.h b/utils/log_util.h index 460d6e7e..2fc04e2c 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -39,13 +39,32 @@ #include #include #include +#include #include -#include #ifndef LOG_TAG #define LOG_TAG "GPS_UTILS" #endif /* LOG_TAG */ +// LE targets with no logcat support +#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 /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ #ifdef __cplusplus From 453ea463522ef8a8f6f0a0e8233f16b5477d742e Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 20 Oct 2017 15:26:33 +0530 Subject: [PATCH 616/945] configuration to ignore PPS pulse at start and after long outage First PPS pulse is impacting on AP time uncertanity in QDR. Made necessary changes to ignore first few PPS pulses at startup and after long gnss RF outage. These parameters are controlled through IGNORE_PPS_PULSE_COUNT and GNSS_OUTAGE_DURATION in gps.cof. Change-Id: I19c7495d281b70c393844d02ca83642c2314ab96 CRs-Fixed: 2132152 --- etc/gps.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/gps.conf b/etc/gps.conf index d30461e6..7653408d 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -185,6 +185,16 @@ DR_SYNC_ENABLED = 0 ##################################### PPS_DEVICENAME = /dev/pps0 +##################################### +# Ignore PPS at Startup and after long outage +##################################### +IGNORE_PPS_PULSE_COUNT = 1 + +##################################### +# Long GNSS RF outage in seconds +##################################### +GNSS_OUTAGE_DURATION = 10 + ##################################### # AP Clock Accuracy ##################################### From 85e65f8168d6f3e32d63e47b0298b747eeeba0e5 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 13 Feb 2018 17:19:54 -0800 Subject: [PATCH 617/945] moving AGnssCbIface from static to class member mAGnssCbIface is a static C++ obj, which ctor may not get called at load time, but its memory block will only be 0'ed out. Change-Id: Ie275f916a01c5eb3bf0a7cfa71b19fe4e0d3e879 CRs-Fixed: 2190347 --- android/AGnss.cpp | 25 ++++++++++++++++++++----- android/AGnss.h | 6 ++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index 6213a083..3602e85d 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -30,12 +30,23 @@ namespace gnss { namespace V1_0 { namespace implementation { -sp AGnss::sAGnssCbIface = nullptr; +static AGnss* spAGnss = nullptr; AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { + spAGnss = this; +} + +AGnss::~AGnss() { + spAGnss = nullptr; } void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ + if (nullptr != spAGnss) { + spAGnss->statusIpV4Cb(status); + } +} + +void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) { IAGnssCallback::AGnssStatusIpV4 st = {}; switch (status.type) { @@ -72,9 +83,13 @@ void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ } st.ipV4Addr = status.ipV4Addr; - auto r = sAGnssCbIface->agnssStatusIpV4Cb(st); - if (!r.isOk()) { - LOC_LOGE("Error invoking AGNSS status cb %s", r.description().c_str()); + if (mAGnssCbIface != nullptr) { + auto r = mAGnssCbIface->agnssStatusIpV4Cb(st); + if (!r.isOk()) { + LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str()); + } + } else { + LOC_LOGw("setCallback has not been called yet"); } } @@ -86,7 +101,7 @@ Return AGnss::setCallback(const sp& callback) { } // Save the interface - sAGnssCbIface = callback; + mAGnssCbIface = callback; AgpsCbInfo cbInfo = {}; cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; diff --git a/android/AGnss.h b/android/AGnss.h index a3f4a87b..ead64169 100644 --- a/android/AGnss.h +++ b/android/AGnss.h @@ -43,7 +43,7 @@ struct Gnss; struct AGnss : public IAGnss { AGnss(Gnss* gnss); - ~AGnss() = default; + ~AGnss(); /* * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. * These declarations were generated from IAGnss.hal. @@ -60,12 +60,14 @@ struct AGnss : public IAGnss { Return setServer(IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) override; + void statusIpV4Cb(AGnssExtStatusIpV4 status); + /* Data call setup callback passed down to GNSS HAL implementation */ static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); private: Gnss* mGnss = nullptr; - static sp sAGnssCbIface; + sp mAGnssCbIface = nullptr; }; } // namespace implementation From 980d403c819d1053f8f19f00f077dcfbe9dd68a3 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 21 Feb 2018 16:04:28 +0530 Subject: [PATCH 618/945] KW Warning Fix Check file pointer before closing. Change-Id: Id9526f6eacf57e282dc0af35d72f571f950b0b0e CRs-Fixed: 2193268 --- utils/loc_cfg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index fd38c8a9..884bb10d 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1119,7 +1119,9 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } err: - fclose(conf_fp); + if (conf_fp) { + fclose(conf_fp); + } if (ret != 0) { LOC_LOGE("%s:%d]: ret: %d", __func__, __LINE__, ret); if (child_proc) { From cd1e0726c8d5f37c3ddfbb5d608a036a4b203e8d Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 22 Feb 2018 11:31:38 +0530 Subject: [PATCH 619/945] Reset MSA/MSB capabilities for APQ targets. - Capabilities MSA/MSB should be reset even if defined in gps.conf for APQ/QSC targets. Since WWAN modem will not be available, we need to trigger Standalone fixes only. If MSB capability is set,then default position mode is MSB. - Handle the new string "qcs" for baseband for Gen9 APQ targets. - Make sure that ContextBase::readConfig avoid repeat initialize for config reading. Change-Id: Ic0a1e57dd76a88bf4d037cd374ceded84cc0f904 CRs-Fixed: 2193207 --- core/ContextBase.cpp | 124 ++++++++++++++++++++++++------------------- utils/loc_target.cpp | 4 +- 2 files changed, 72 insertions(+), 56 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 35e65854..47194cba 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -92,65 +92,79 @@ const loc_param_s_type ContextBase::mSap_conf_table[] = void ContextBase::readConfig() { - /*Defaults for gps.conf*/ - mGps_conf.INTERMEDIATE_POS = 0; - mGps_conf.ACCURACY_THRES = 0; - mGps_conf.NMEA_PROVIDER = 0; - mGps_conf.GPS_LOCK = 0; - mGps_conf.SUPL_VER = 0x10000; - mGps_conf.SUPL_MODE = 0x1; - mGps_conf.SUPL_ES = 0; - mGps_conf.SUPL_HOST[0] = 0; - mGps_conf.SUPL_PORT = 0; - mGps_conf.CAPABILITIES = 0x7; - /* LTE Positioning Profile configuration is disable by default*/ - mGps_conf.LPP_PROFILE = 0; - /*By default no positioning protocol is selected on A-GLONASS system*/ - mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; - /*XTRA version check is disabled by default*/ - mGps_conf.XTRA_VERSION_CHECK=0; - /*Use emergency PDN by default*/ - mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1; - /* By default no LPPe CP technology is enabled*/ - mGps_conf.LPPE_CP_TECHNOLOGY = 0; - /* By default no LPPe UP technology is enabled*/ - mGps_conf.LPPE_UP_TECHNOLOGY = 0; + static bool confReadDone = false; + if (!confReadDone) { + confReadDone = true; + /*Defaults for gps.conf*/ + mGps_conf.INTERMEDIATE_POS = 0; + mGps_conf.ACCURACY_THRES = 0; + mGps_conf.NMEA_PROVIDER = 0; + mGps_conf.GPS_LOCK = 0; + mGps_conf.SUPL_VER = 0x10000; + mGps_conf.SUPL_MODE = 0x1; + mGps_conf.SUPL_ES = 0; + mGps_conf.SUPL_HOST[0] = 0; + mGps_conf.SUPL_PORT = 0; + mGps_conf.CAPABILITIES = 0x7; + /* LTE Positioning Profile configuration is disable by default*/ + mGps_conf.LPP_PROFILE = 0; + /*By default no positioning protocol is selected on A-GLONASS system*/ + mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; + /*XTRA version check is disabled by default*/ + mGps_conf.XTRA_VERSION_CHECK=0; + /*Use emergency PDN by default*/ + mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1; + /* By default no LPPe CP technology is enabled*/ + mGps_conf.LPPE_CP_TECHNOLOGY = 0; + /* By default no LPPe UP technology is enabled*/ + mGps_conf.LPPE_UP_TECHNOLOGY = 0; - /*Defaults for sap.conf*/ - mSap_conf.GYRO_BIAS_RANDOM_WALK = 0; - mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; - mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; - mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; - mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; - mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; - mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; - mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; - mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; - mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - mSap_conf.SENSOR_USAGE = 0; /* Enabled */ - mSap_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 */ - mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; - mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; - mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; - mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - /* default provider is SSC */ - mSap_conf.SENSOR_PROVIDER = 1; + /*Defaults for sap.conf*/ + mSap_conf.GYRO_BIAS_RANDOM_WALK = 0; + mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; + mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; + mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; + mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; + mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + mSap_conf.SENSOR_USAGE = 0; /* Enabled */ + mSap_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 */ + mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + /* default provider is SSC */ + mSap_conf.SENSOR_PROVIDER = 1; - /* None of the 10 slots for agps certificates are writable by default */ - mGps_conf.AGPS_CERT_WRITABLE_MASK = 0; + /* None of the 10 slots for agps certificates are writable by default */ + mGps_conf.AGPS_CERT_WRITABLE_MASK = 0; - /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ - mGps_conf.AGPS_CONFIG_INJECT = 1; + /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ + mGps_conf.AGPS_CONFIG_INJECT = 1; - UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); - UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); + UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); + UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); + + switch (getTargetGnssType(loc_get_target())) { + case GNSS_GSS: + case GNSS_AUTO: + // For APQ targets, MSA/MSB capabilities should be reset + mGps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB); + break; + default: + break; + } + } } uint32_t ContextBase::getCarrierCapabilities() { diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d31f8874..dd6aa4fc 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -54,6 +54,7 @@ #define STR_MTP "MTP" #define STR_APQ "apq" #define STR_SDC "sdc" // alternative string for APQ targets +#define STR_QCS "qcs" // string for Gen9 APQ targets #define STR_MSM "msm" #define STR_SDM "sdm" // alternative string for MSM targets #define STR_APQ_NO_WGR "baseband_apq_nowgr" @@ -175,7 +176,8 @@ unsigned int loc_get_target(void) } if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) || - !memcmp(baseband, STR_SDC, LENGTH(STR_SDC)) ) { + !memcmp(baseband, STR_SDC, LENGTH(STR_SDC)) || + !memcmp(baseband, STR_QCS, LENGTH(STR_QCS)) ) { if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) From c645cb167bfb81a8646da19457573b00534a6e7c Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 13 Feb 2018 16:04:32 +0530 Subject: [PATCH 620/945] Define gps user and group id's for Android and LE. - Define gps user and group id's for Android and LE. - Update to use getgrnam for getting group id's. - Get group id's for child processes for LE also. Change-Id: I5365dbc1c51eb89ab66ba8652f3ed1c5dbea6eb4 CRs-Fixed: 2183710 --- pla/android/loc_pla.h | 4 ++++ pla/oe/loc_pla.h | 3 +++ utils/loc_cfg.cpp | 13 ++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pla/android/loc_pla.h b/pla/android/loc_pla.h index 9caae737..bedb079c 100644 --- a/pla/android/loc_pla.h +++ b/pla/android/loc_pla.h @@ -41,6 +41,10 @@ extern "C" { #include #include #include +#include + +#define UID_GPS (AID_GPS) +#define GID_GPS (AID_GPS) #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 3ca1964a..50b19c2f 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -51,6 +51,9 @@ extern "C" { #define strlcpy strncpy #endif +#define UID_GPS (1021) +#define GID_GPS (1021) + #define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" #define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 884bb10d..3e1922cc 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -826,18 +826,17 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p child_proc[j].num_groups = 0; ngroups = loc_util_split_string(conf.group_list, split_strings, MAX_NUM_STRINGS, ' '); -#ifdef __ANDROID__ for(i=0; ipw_gid; + struct group* grp = getgrnam(split_strings[i]); + if (grp) { + child_proc[j].group_list[i] = grp->gr_gid; child_proc[j].num_groups++; LOC_LOGD("%s:%d]:Group %s = %d matches child_group: %d\n", __func__, __LINE__, split_strings[i], - pwd->pw_gid,child_proc[j].group_list[i]); + grp->gr_gid,child_proc[j].group_list[i]); } } -#endif + nstrings = loc_util_split_string(conf.platform_list, split_strings, MAX_NUM_STRINGS, ' '); if(strcmp("all", split_strings[0]) == 0) { if (nstrings == 1 || (nstrings == 2 && (strcmp("exclude", split_strings[1]) == 0))) { From 97f3f3905a46515ab852681268fcac155840f8b8 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 7 Feb 2018 12:09:33 +0530 Subject: [PATCH 621/945] remove unused variables for compilation remove unsed variables and fix few compiler issues CRs-fixed: 2175735 Change-Id: I635a7503326928f43070aa2224bc3c3d6e1ff929 --- android/location_api/BatchingAPIClient.cpp | 2 +- android/location_api/BatchingAPIClient.h | 1 - android/location_api/GnssAPIClient.cpp | 2 +- android/location_api/MeasurementAPIClient.cpp | 4 ++-- core/LocApiBase.cpp | 2 +- core/data-items/DataItemsFactoryProxy.cpp | 2 +- core/loc_core_log.cpp | 20 ------------------- gnss/GnssAdapter.cpp | 4 ++-- gnss/XtraSystemStatusObserver.h | 4 ++-- location/LocationAPIClientBase.cpp | 1 - utils/loc_cfg.cpp | 3 --- utils/loc_nmea.cpp | 5 ----- utils/loc_target.cpp | 1 - 13 files changed, 10 insertions(+), 41 deletions(-) diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 0b66d383..43fed5c7 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -153,7 +153,7 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa mLocationCapabilitiesMask = capabilitiesMask; } -void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions /*batchOptions*/) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); if (mGnssBatchingCbIface != nullptr && count > 0) { diff --git a/android/location_api/BatchingAPIClient.h b/android/location_api/BatchingAPIClient.h index c951a83c..61e20770 100644 --- a/android/location_api/BatchingAPIClient.h +++ b/android/location_api/BatchingAPIClient.h @@ -63,7 +63,6 @@ public: private: sp mGnssBatchingCbIface; uint32_t mDefaultId; - int mBatchSize; LocationCapabilitiesMask mLocationCapabilitiesMask; }; diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 996bbeea..fac5d0b3 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -504,7 +504,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); out.numSvs = in.count; if (out.numSvs > static_cast(GnssMax::SVS_COUNT)) { - LOC_LOGW("%s]: Too many satellites %zd. Clamps to %d.", + LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT); out.numSvs = static_cast(GnssMax::SVS_COUNT); } diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 731c7eda..fcdd693d 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -115,7 +115,7 @@ void MeasurementAPIClient::measurementClose() { void MeasurementAPIClient::onGnssMeasurementsCb( GnssMeasurementsNotification gnssMeasurementsNotification) { - LOC_LOGD("%s]: (count: %zu active: %zu)", + LOC_LOGD("%s]: (count: %zu active: %d)", __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { mMutex.lock(); @@ -246,7 +246,7 @@ static void convertGnssData(GnssMeasurementsNotification& in, { out.measurementCount = in.count; if (out.measurementCount > static_cast(GnssMax::SVS_COUNT)) { - LOC_LOGW("%s]: Too many measurement %zd. Clamps to %d.", + LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.", __FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT); out.measurementCount = static_cast(GnssMax::SVS_COUNT); } diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4bc38e2e..ce0d1bc4 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -118,7 +118,7 @@ struct LocOpenMsg : public LocMsg { mLocApi->open(mMask); } inline void locallog() const { - LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", + LOC_LOGV("%s:%d]: LocOpen Mask: %" PRIu64 "\n", __func__, __LINE__, mMask); } inline virtual void log() const { diff --git a/core/data-items/DataItemsFactoryProxy.cpp b/core/data-items/DataItemsFactoryProxy.cpp index 130eecf9..e07b3cd8 100644 --- a/core/data-items/DataItemsFactoryProxy.cpp +++ b/core/data-items/DataItemsFactoryProxy.cpp @@ -68,7 +68,7 @@ IDataItemCore* DataItemsFactoryProxy::createNewDataItem(DataItemId id) getConcreteDIFunc = (get_concrete_data_item_fn * ) dlsym(dataItemLibHandle, DATA_ITEMS_GET_CONCRETE_DI); if (NULL != getConcreteDIFunc) { - LOC_LOGD("Loaded function %s : %x",DATA_ITEMS_GET_CONCRETE_DI,getConcreteDIFunc); + LOC_LOGD("Loaded function %s : %p",DATA_ITEMS_GET_CONCRETE_DI,getConcreteDIFunc); mydi = (*getConcreteDIFunc)(id); } else { diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 5a627dd9..856398f7 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -100,26 +100,6 @@ const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence 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( LOC_GPS_DELETE_EPHEMERIS ), - NAME_VAL( LOC_GPS_DELETE_ALMANAC ), - NAME_VAL( LOC_GPS_DELETE_POSITION ), - NAME_VAL( LOC_GPS_DELETE_TIME ), - NAME_VAL( LOC_GPS_DELETE_IONO ), - NAME_VAL( LOC_GPS_DELETE_UTC ), - NAME_VAL( LOC_GPS_DELETE_HEALTH ), - NAME_VAL( LOC_GPS_DELETE_SVDIR ), - NAME_VAL( LOC_GPS_DELETE_SVSTEER ), - NAME_VAL( LOC_GPS_DELETE_SADATA ), - NAME_VAL( LOC_GPS_DELETE_RTI ), - NAME_VAL( LOC_GPS_DELETE_CELLDB_INFO ), - NAME_VAL( LOC_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(LocGpsAidingData /*data*/) { return NULL; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index bda75e9c..883922e7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -598,7 +598,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port) if ((NULL == server) || (server[0] == 0) || (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { - serverUrl[0] = NULL; + serverUrl[0] = '\0'; length = 0; mServerUrl.clear(); } else if (port > 0) { @@ -1173,7 +1173,7 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; - LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); + LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIu64 "", __func__, mask); } if (mAgpsCbInfo.statusV4Cb != NULL) { diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 6bf3f58e..31d80834 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -47,8 +47,8 @@ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this), - mIsConnectivityStatusKnown (false) { + mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), + mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index bb51238f..343743ad 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -153,7 +153,6 @@ uint32_t LocationAPIControlClient::locAPIGnssUpdateConfig(GnssConfig config) memcpy(&mConfig, &config, sizeof(GnssConfig)); - uint32_t session = 0; uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); if (idArray != nullptr) { diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d2364f69..8b495b92 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -381,9 +381,6 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta 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) { diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 6d34b512..8201e119 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -992,12 +992,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, ENTRY_LOG(); char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - char* pMarker = sentence; - int lengthRemaining = sizeof(sentence); - int length = 0; int svCount = svNotify.count; - int sentenceCount = 0; - int sentenceNumber = 1; int svNumber = 1; //Count GPS SVs for saparating GPS from GLONASS and throw others diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index cf429321..77275d47 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -213,7 +213,6 @@ detected: */ 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); From 73df7e0e6f3ff8b11717c51b47f38a2b0bfb1244 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 2 Mar 2018 17:02:28 -0800 Subject: [PATCH 622/945] fix: Default values in GNSS Debug Data Change default values for accuracies and uncertainties in GNSS Debug Data to non- zero constant values. Bug: 72753638 Change-Id: I075b364ed81c8a466b062ab4d5381c3d4ece1ea6 CRs-Fixed: 2185247 --- android/GnssDebug.cpp | 41 ++++++++++++++++++++++++++++++++++++----- gnss/GnssAdapter.cpp | 5 ++++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 3d2b8bda..33d7aa52 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -30,8 +30,14 @@ namespace implementation { using ::android::hardware::hidl_vec; -#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT -#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000) +#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000) +#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500) +#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) + +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) { @@ -89,6 +95,23 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.position.valid = false; } + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + // time block if (reports.mTime.mValid) { data.time.timeEstimate = reports.mTime.timeEstimate; @@ -96,10 +119,18 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.time.frequencyUncertaintyNsPerSec = reports.mTime.frequencyUncertaintyNsPerSec; } - else { + + if (data.time.timeEstimate <= 0 || + data.time.timeEstimate > GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; - data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC); - data.time.frequencyUncertaintyNsPerSec = 0; + } + if (data.time.timeUncertaintyNs <= 0 || + data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + } + if (data.time.frequencyUncertaintyNsPerSec <= 0 || + data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { + data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC; } // satellite data block diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 098c8aa0..5a1eb256 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 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 @@ -3043,6 +3043,9 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) r.mLocation.mLocation.longitude = (double)(reports.mBestPosition.back().mBestLon) * RAD2DEG; r.mLocation.mLocation.altitude = reports.mBestPosition.back().mBestAlt; + r.mLocation.mLocation.accuracy = + (double)(reports.mBestPosition.back().mBestHepe); + r.mLocation.mUtcReported = reports.mBestPosition.back().mUtcReported; } else { From 0fc49e84322b6cec0bf206ec1e6b57bcbfaa20c0 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Wed, 28 Feb 2018 11:22:58 -0800 Subject: [PATCH 623/945] feat: Separate LocationAPI.h Separate LocationAPI.h into ILocationAPI.h for interface and LocationDataTypes.h for data structure definitions. CRs-Fixed: 2148023 Change-Id: I9f375a6057b22cf5bdd0b73a41ba1c010d9e0e4e --- location/ILocationAPI.h | 194 +++++++ location/LocationAPI.h | 979 +---------------------------------- location/LocationDataTypes.h | 967 ++++++++++++++++++++++++++++++++++ location/Makefile.am | 4 +- 4 files changed, 1187 insertions(+), 957 deletions(-) create mode 100644 location/ILocationAPI.h create mode 100644 location/LocationDataTypes.h diff --git a/location/ILocationAPI.h b/location/ILocationAPI.h new file mode 100644 index 00000000..ae695cf8 --- /dev/null +++ b/location/ILocationAPI.h @@ -0,0 +1,194 @@ +/* Copyright (c) 2018 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 ILOCATIONAPI_H +#define ILOCATIONAPI_H + +#include "LocationDataTypes.h" + +class ILocationAPI +{ +public: + virtual ~ILocationAPI(){}; + + /** @brief Updates/changes the callbacks that will be called. + mandatory callbacks must be present for callbacks to be successfully updated + no return value */ + virtual void updateCallbacks(LocationCallbacks&) = 0; + + /* ================================== TRACKING ================================== */ + + /** @brief Starts a tracking session, which returns a session id that will be + used by the other tracking APIs and also in the responseCallback to match command + with response. locations are reported on the registered trackingCallback + periodically according to LocationOptions. + @return session id + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successfully started + LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress + LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameter is invalid */ + virtual uint32_t startTracking(LocationOptions&) = 0; + + /** @brief Stops a tracking session associated with id parameter. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ + virtual void stopTracking(uint32_t id) = 0; + + /** @brief Changes the LocationOptions of a tracking session associated with id. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ + virtual void updateTrackingOptions(uint32_t id, LocationOptions&) = 0; + + /* ================================== BATCHING ================================== */ + + /** @brief starts a batching session, which returns a session id that will be + used by the other batching APIs and also in the responseCallback to match command + with response. locations are reported on the batchingCallback passed in createInstance + periodically according to LocationOptions. A batching session starts tracking on + the low power processor and delivers them in batches by the batchingCallback when + the batch is full or when getBatchedLocations is called. This allows for the processor + that calls this API to sleep when the low power processor can batch locations in the + backgroup and wake up the processor calling the API only when the batch is full, thus + saving power. + @return session id + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_ALREADY_STARTED if a startBatching session is already in progress + LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback + LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid + LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ + virtual uint32_t startBatching(LocationOptions&, BatchingOptions&) = 0; + + /** @brief Stops a batching session associated with id parameter. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with batching session */ + virtual void stopBatching(uint32_t id) = 0; + + /** @brief Changes the LocationOptions of a batching session associated with id. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ + virtual void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&) = 0; + + /** @brief Gets a number of locations that are currently stored/batched + on the low power processor, delivered by the batchingCallback passed in createInstance. + Location are then deleted from the batch stored on the low power processor. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful, will be followed by batchingCallback call + LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ + virtual void getBatchedLocations(uint32_t id, size_t count) = 0; + + /* ================================== GEOFENCE ================================== */ + + /** @brief Adds any number of geofences and returns an array of geofence ids that + will be used by the other geofence APIs and also in the collectiveResponseCallback to + match command with response. The geofenceBreachCallback will deliver the status of each + geofence according to the GeofenceOption for each. The geofence id array returned will + be valid until the collectiveResponseCallback is called and has returned. + @return id array + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_CALLBACK_MISSING if no geofenceBreachCallback + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + LOCATION_ERROR_NOT_SUPPORTED if geofence is not supported */ + virtual uint32_t* addGeofences(size_t count, GeofenceOption*, GeofenceInfo*) = 0; + + /** @brief Removes any number of geofences. Caller should delete ids array after + removeGeofences returneds. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + virtual void removeGeofences(size_t count, uint32_t* ids) = 0; + + /** @brief Modifies any number of geofences. Caller should delete ids array after + modifyGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid */ + virtual void modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options) = 0; + + /** @brief Pauses any number of geofences, which is similar to removeGeofences, + only that they can be resumed at any time. Caller should delete ids array after + pauseGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + virtual void pauseGeofences(size_t count, uint32_t* ids) = 0; + + /** @brief Resumes any number of geofences that are currently paused. Caller should + delete ids array after resumeGeofences returns. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ + virtual void resumeGeofences(size_t count, uint32_t* ids) = 0; + + /* ================================== GNSS ====================================== */ + + /** @brief gnssNiResponse is called in response to a gnssNiCallback. + responseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters in GnssNiResponse are invalid + LOCATION_ERROR_ID_UNKNOWN if id does not match a gnssNiCallback */ + virtual void gnssNiResponse(uint32_t id, GnssNiResponse response) = 0; +}; + +class ILocationControlAPI +{ +public: + virtual ~ILocationControlAPI(){}; + + /** @brief Updates the gnss specific configuration, which returns a session id array + with an id for each of the bits set in GnssConfig.flags, order from low bits to high bits. + The response for each config that is set will be returned in collectiveResponseCallback. + The session id array returned will be valid until the collectiveResponseCallback is called + and has returned. This effect is global for all clients of ILocationAPI. + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_INVALID_PARAMETER if any other parameters are invalid + LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ + virtual uint32_t* gnssUpdateConfig(GnssConfig config) = 0; + + /** @brief Delete specific gnss aiding data for testing, which returns a session id + that will be returned in responseCallback to match command with response. + Only allowed in userdebug builds. This effect is global for all clients of ILocationAPI. + responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */ + virtual uint32_t gnssDeleteAidingData(GnssAidingData& data) = 0; +}; + +#endif /* ILOCATIONAPI_H */ diff --git a/location/LocationAPI.h b/location/LocationAPI.h index ce478d23..ce38bc6b 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018 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 @@ -26,945 +26,12 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LOCATION_H -#define LOCATION_H +#ifndef LOCATIONAPI_H +#define LOCATIONAPI_H -#include -#include -#include -#include +#include "ILocationAPI.h" -#define GNSS_NI_REQUESTOR_MAX 256 -#define GNSS_NI_MESSAGE_ID_MAX 2048 -#define GNSS_SV_MAX 64 -#define GNSS_MEASUREMENTS_MAX 64 -#define GNSS_UTC_TIME_OFFSET (3657) - -#define GNSS_BUGREPORT_GPS_MIN (1) -#define GNSS_BUGREPORT_SBAS_MIN (120) -#define GNSS_BUGREPORT_GLO_MIN (1) -#define GNSS_BUGREPORT_QZSS_MIN (193) -#define GNSS_BUGREPORT_BDS_MIN (1) -#define GNSS_BUGREPORT_GAL_MIN (1) - -typedef enum { - LOCATION_ERROR_SUCCESS = 0, - LOCATION_ERROR_GENERAL_FAILURE, - LOCATION_ERROR_CALLBACK_MISSING, - LOCATION_ERROR_INVALID_PARAMETER, - LOCATION_ERROR_ID_EXISTS, - LOCATION_ERROR_ID_UNKNOWN, - LOCATION_ERROR_ALREADY_STARTED, - LOCATION_ERROR_GEOFENCES_AT_MAX, - LOCATION_ERROR_NOT_SUPPORTED -} LocationError; - -// Flags to indicate which values are valid in a Location -typedef uint16_t LocationFlagsMask; -typedef enum { - LOCATION_HAS_LAT_LONG_BIT = (1<<0), // location has valid latitude and longitude - LOCATION_HAS_ALTITUDE_BIT = (1<<1), // location has valid altitude - LOCATION_HAS_SPEED_BIT = (1<<2), // location has valid speed - LOCATION_HAS_BEARING_BIT = (1<<3), // location has valid bearing - LOCATION_HAS_ACCURACY_BIT = (1<<4), // location has valid accuracy - LOCATION_HAS_VERTICAL_ACCURACY_BIT = (1<<5), // location has valid vertical accuracy - LOCATION_HAS_SPEED_ACCURACY_BIT = (1<<6), // location has valid speed accuracy - LOCATION_HAS_BEARING_ACCURACY_BIT = (1<<7), // location has valid bearing accuracy -} LocationFlagsBits; - -typedef uint16_t LocationTechnologyMask; -typedef enum { - LOCATION_TECHNOLOGY_GNSS_BIT = (1<<0), // location was calculated using GNSS - LOCATION_TECHNOLOGY_CELL_BIT = (1<<1), // location was calculated using Cell - LOCATION_TECHNOLOGY_WIFI_BIT = (1<<2), // location was calculated using WiFi - LOCATION_TECHNOLOGY_SENSORS_BIT = (1<<3), // location was calculated using Sensors -} LocationTechnologyBits; - -typedef enum { - LOCATION_RELIABILITY_NOT_SET = 0, - LOCATION_RELIABILITY_VERY_LOW, - LOCATION_RELIABILITY_LOW, - LOCATION_RELIABILITY_MEDIUM, - LOCATION_RELIABILITY_HIGH, -} LocationReliability; - -typedef uint32_t GnssLocationNavSolutionMask; -typedef enum { - LOCATION_SBAS_CORRECTION_IONO_BIT = (1<<0), // SBAS ionospheric correction is used - LOCATION_SBAS_CORRECTION_FAST_BIT = (1<<1), // SBAS fast correction is used - LOCATION_SBAS_CORRECTION_LONG_BIT = (1<<2), // SBAS long-tem correction is used - LOCATION_SBAS_INTEGRITY_BIT = (1<<3), // SBAS integrity information is used - LOCATION_NAV_CORRECTION_DGNSS_BIT = (1<<4), // Position Report is DGNSS corrected - LOCATION_NAV_CORRECTION_RTK_BIT = (1<<5), // Position Report is RTK corrected - LOCATION_NAV_CORRECTION_PPP_BIT = (1<<6) // Position Report is PPP corrected -} GnssLocationNavSolutionBits; - -typedef uint32_t GnssLocationPosTechMask; -typedef enum { - LOCATION_POS_TECH_DEFAULT_BIT = 0, - LOCATION_POS_TECH_SATELLITE_BIT = (1<<0), - LOCATION_POS_TECH_CELLID_BIT = (1<<1), - LOCATION_POS_TECH_WIFI_BIT = (1<<2), - LOCATION_POS_TECH_SENSORS_BIT = (1<<3), - LOCATION_POS_TECH_REFERENCE_LOCATION_BIT = (1<<4), - LOCATION_POS_TECH_INJECTED_COARSE_POSITION_BIT = (1<<5), - LOCATION_POS_TECH_AFLT_BIT = (1<<6), - LOCATION_POS_TECH_HYBRID_BIT = (1<<7), - LOCATION_POS_TECH_PPE_BIT = (1<<8) -} GnssLocationPosTechBits; - -typedef uint32_t GnssLocationPosDataMask; -typedef enum { - LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT = (1<<0), // Navigation data has Forward Acceleration - LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT = (1<<1), // Navigation data has Sideward Acceleration - LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT = (1<<2), // Navigation data has Vertical Acceleration - LOCATION_NAV_DATA_HAS_YAW_RATE_BIT = (1<<3), // Navigation data has Heading Rate - LOCATION_NAV_DATA_HAS_PITCH_BIT = (1<<4) // Navigation data has Body pitch -} GnssLocationPosDataBits; - -typedef uint32_t GnssLocationInfoFlagMask; -typedef enum { - GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT = (1<<0), // valid altitude mean sea level - GNSS_LOCATION_INFO_DOP_BIT = (1<<1), // valid pdop, hdop, and vdop - GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT = (1<<2), // valid magnetic deviation - GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT = (1<<3), // valid horizontal reliability - GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<4), // valid vertical reliability - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor - GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7), // valid accuracy elipsode azimuth - GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT = (1<<8), // valid gnss sv used in pos data - GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT = (1<<9), // valid navSolutionMask - GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask - GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource - GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data - GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time - GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop -} GnssLocationInfoFlagBits; - -typedef enum { - GEOFENCE_BREACH_ENTER = 0, - GEOFENCE_BREACH_EXIT, - GEOFENCE_BREACH_DWELL_IN, - GEOFENCE_BREACH_DWELL_OUT, - GEOFENCE_BREACH_UNKNOWN, -} GeofenceBreachType; - -typedef uint16_t GeofenceBreachTypeMask; -typedef enum { - GEOFENCE_BREACH_ENTER_BIT = (1<<0), - GEOFENCE_BREACH_EXIT_BIT = (1<<1), - GEOFENCE_BREACH_DWELL_IN_BIT = (1<<2), - GEOFENCE_BREACH_DWELL_OUT_BIT = (1<<3), -} GeofenceBreachTypeBits; - -typedef enum { - GEOFENCE_STATUS_AVAILABILE_NO = 0, - GEOFENCE_STATUS_AVAILABILE_YES, -} GeofenceStatusAvailable; - -typedef uint32_t LocationCapabilitiesMask; -typedef enum { - // supports startTracking API with minInterval param - LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0), - // supports startBatching API with minInterval param - LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1), - // supports startTracking API with minDistance param - LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2), - // supports startBatching API with minDistance param - LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3), - // supports addGeofences API - LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4), - // supports GnssMeasurementsCallback - LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5), - // supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based) - LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6), - // supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted) - LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7), - // supports debug nmea sentences in the debugNmeaCallback - LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8), - // support outdoor trip batching - LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9) -} LocationCapabilitiesBits; - -typedef enum { - LOCATION_TECHNOLOGY_TYPE_GNSS = 0, -} LocationTechnologyType; - -// Configures how GPS is locked when GPS is disabled (through GnssDisable) -typedef enum { - GNSS_CONFIG_GPS_LOCK_NONE = 0, // gps is not locked when GPS is disabled (GnssDisable) - GNSS_CONFIG_GPS_LOCK_MO, // gps mobile originated (MO) is locked when GPS is disabled - GNSS_CONFIG_GPS_LOCK_NI, // gps network initiated (NI) is locked when GPS is disabled - GNSS_CONFIG_GPS_LOCK_MO_AND_NI,// gps MO and NI is locked when GPS is disabled -} GnssConfigGpsLock; - -// SUPL version -typedef enum { - GNSS_CONFIG_SUPL_VERSION_1_0_0 = 1, - GNSS_CONFIG_SUPL_VERSION_2_0_0, - GNSS_CONFIG_SUPL_VERSION_2_0_2, -} GnssConfigSuplVersion; - -// LTE Positioning Profile -typedef enum { - GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE = 0, // RRLP on LTE (Default) - GNSS_CONFIG_LPP_PROFILE_USER_PLANE, // LPP User Plane (UP) on LTE - GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE, // LPP_Control_Plane (CP) - GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE, // Both LPP UP and CP -} GnssConfigLppProfile; - -// Technology for LPPe Control Plane -typedef uint16_t GnssConfigLppeControlPlaneMask; -typedef enum { - GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT = (1<<0), // DBH - GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS - GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS - GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), - // SENSOR_BARO_MEASUREMENTS -} GnssConfigLppeControlPlaneBits; - -// Technology for LPPe User Plane -typedef uint16_t GnssConfigLppeUserPlaneMask; -typedef enum { - GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT = (1<<0), // DBH - GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS - GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS - GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), - // SENSOR_BARO_MEASUREMENTS -} GnssConfigLppeUserPlaneBits; - -// Positioning Protocol on A-GLONASS system -typedef uint16_t GnssConfigAGlonassPositionProtocolMask; -typedef enum { - GNSS_CONFIG_RRC_CONTROL_PLANE_BIT = (1<<0), // RRC Control Plane - GNSS_CONFIG_RRLP_USER_PLANE_BIT = (1<<1), // RRLP User Plane - GNSS_CONFIG_LLP_USER_PLANE_BIT = (1<<2), // LPP User Plane - GNSS_CONFIG_LLP_CONTROL_PLANE_BIT = (1<<3), // LPP Control Plane -} GnssConfigAGlonassPositionProtocolBits; - -typedef enum { - GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO = 0, - GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES, -} GnssConfigEmergencyPdnForEmergencySupl; - -typedef enum { - GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO = 0, - GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES, -} GnssConfigSuplEmergencyServices; - -typedef uint16_t GnssConfigSuplModeMask; -typedef enum { - GNSS_CONFIG_SUPL_MODE_MSB_BIT = (1<<0), - GNSS_CONFIG_SUPL_MODE_MSA_BIT = (1<<1), -} GnssConfigSuplModeBits; - -typedef uint32_t GnssConfigFlagsMask; -typedef enum { - GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT = (1<<0), - GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT = (1<<1), - GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT = (1<<2), - GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT = (1<<3), - GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT = (1<<4), - GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT = (1<<5), - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT = (1<<6), - GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT = (1<<7), - GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), - GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), -} GnssConfigFlagsBits; - -typedef enum { - GNSS_NI_ENCODING_TYPE_NONE = 0, - GNSS_NI_ENCODING_TYPE_GSM_DEFAULT, - GNSS_NI_ENCODING_TYPE_UTF8, - GNSS_NI_ENCODING_TYPE_UCS2, -} GnssNiEncodingType; - -typedef enum { - GNSS_NI_TYPE_VOICE = 0, - GNSS_NI_TYPE_SUPL, - GNSS_NI_TYPE_CONTROL_PLANE, - GNSS_NI_TYPE_EMERGENCY_SUPL -} GnssNiType; - -typedef uint16_t GnssNiOptionsMask; -typedef enum { - GNSS_NI_OPTIONS_NOTIFICATION_BIT = (1<<0), - GNSS_NI_OPTIONS_VERIFICATION_BIT = (1<<1), - GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT = (1<<2), -} GnssNiOptionsBits; - -typedef enum { - GNSS_NI_RESPONSE_ACCEPT = 1, - GNSS_NI_RESPONSE_DENY, - GNSS_NI_RESPONSE_NO_RESPONSE, - GNSS_NI_RESPONSE_IGNORE, -} GnssNiResponse; - -typedef enum { - GNSS_SV_TYPE_UNKNOWN = 0, - GNSS_SV_TYPE_GPS, - GNSS_SV_TYPE_SBAS, - GNSS_SV_TYPE_GLONASS, - GNSS_SV_TYPE_QZSS, - GNSS_SV_TYPE_BEIDOU, - GNSS_SV_TYPE_GALILEO, -} GnssSvType; - -typedef enum { - GNSS_EPH_TYPE_UNKNOWN = 0, - GNSS_EPH_TYPE_EPHEMERIS, - GNSS_EPH_TYPE_ALMANAC, -} GnssEphemerisType; - -typedef enum { - GNSS_EPH_SOURCE_UNKNOWN = 0, - GNSS_EPH_SOURCE_DEMODULATED, - GNSS_EPH_SOURCE_SUPL_PROVIDED, - GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED, - GNSS_EPH_SOURCE_LOCAL, -} GnssEphemerisSource; - -typedef enum { - GNSS_EPH_HEALTH_UNKNOWN = 0, - GNSS_EPH_HEALTH_GOOD, - GNSS_EPH_HEALTH_BAD, -} GnssEphemerisHealth; - -typedef uint16_t GnssSvOptionsMask; -typedef enum { - GNSS_SV_OPTIONS_HAS_EPHEMER_BIT = (1<<0), - GNSS_SV_OPTIONS_HAS_ALMANAC_BIT = (1<<1), - GNSS_SV_OPTIONS_USED_IN_FIX_BIT = (1<<2), -} GnssSvOptionsBits; - -typedef enum { - GNSS_ASSISTANCE_TYPE_SUPL = 0, - GNSS_ASSISTANCE_TYPE_C2K, -} GnssAssistanceType; - -typedef enum { - GNSS_SUPL_MODE_STANDALONE = 0, - GNSS_SUPL_MODE_MSB, - GNSS_SUPL_MODE_MSA, -} GnssSuplMode; - -typedef enum { - BATCHING_MODE_ROUTINE = 0, // positions are reported when batched positions memory is full - BATCHING_MODE_TRIP, // positions are reported when a certain distance is covered - BATCHING_MODE_NO_AUTO_REPORT // no report of positions automatically, instead queried on demand -} BatchingMode; - -typedef enum { - BATCHING_STATUS_TRIP_COMPLETED = 0, - BATCHING_STATUS_POSITION_AVAILABE, - BATCHING_STATUS_POSITION_UNAVAILABLE -} BatchingStatus; - -typedef uint16_t GnssMeasurementsAdrStateMask; -typedef enum { - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT = (1<<0), - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT = (1<<1), - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT = (1<<2), -} GnssMeasurementsAdrStateBits; - -typedef uint32_t GnssMeasurementsDataFlagsMask; -typedef enum { - GNSS_MEASUREMENTS_DATA_SV_ID_BIT = (1<<0), - GNSS_MEASUREMENTS_DATA_SV_TYPE_BIT = (1<<1), - GNSS_MEASUREMENTS_DATA_STATE_BIT = (1<<2), - GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_BIT = (1<<3), - GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_UNCERTAINTY_BIT = (1<<4), - GNSS_MEASUREMENTS_DATA_CARRIER_TO_NOISE_BIT = (1<<5), - GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_BIT = (1<<6), - GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_UNCERTAINTY_BIT = (1<<7), - GNSS_MEASUREMENTS_DATA_ADR_STATE_BIT = (1<<8), - GNSS_MEASUREMENTS_DATA_ADR_BIT = (1<<9), - GNSS_MEASUREMENTS_DATA_ADR_UNCERTAINTY_BIT = (1<<10), - GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT = (1<<11), - GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT = (1<<12), - GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT = (1<<13), - GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT = (1<<14), - GNSS_MEASUREMENTS_DATA_MULTIPATH_INDICATOR_BIT = (1<<15), - GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT = (1<<16), - GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT = (1<<17), -} GnssMeasurementsDataFlagsBits; - -typedef uint32_t GnssMeasurementsStateMask; -typedef enum { - GNSS_MEASUREMENTS_STATE_UNKNOWN_BIT = 0, - GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT = (1<<0), - GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT = (1<<1), - GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT = (1<<2), - GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT = (1<<3), - GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT = (1<<4), - GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT = (1<<5), - GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT = (1<<6), - GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT = (1<<7), - GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT = (1<<8), - GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT = (1<<9), - GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT = (1<<10), - GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT = (1<<11), - GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT = (1<<12), - GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT = (1<<13), -} GnssMeasurementsStateBits; - -typedef enum { - GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_UNKNOWN = 0, - GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT, - GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT, -} GnssMeasurementsMultipathIndicator; - -typedef uint32_t GnssMeasurementsClockFlagsMask; -typedef enum { - GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT = (1<<0), - GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_BIT = (1<<1), - GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT = (1<<2), - GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT = (1<<3), - GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT = (1<<4), - GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT = (1<<5), - GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT = (1<<6), - GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT = (1<<7), - GNSS_MEASUREMENTS_CLOCK_FLAGS_HW_CLOCK_DISCONTINUITY_COUNT_BIT = (1<<8), -} GnssMeasurementsClockFlagsBits; - -typedef uint32_t GnssAidingDataSvMask; -typedef enum { - GNSS_AIDING_DATA_SV_EPHEMERIS_BIT = (1<<0), // ephemeris - GNSS_AIDING_DATA_SV_ALMANAC_BIT = (1<<1), // almanac - GNSS_AIDING_DATA_SV_HEALTH_BIT = (1<<2), // health - GNSS_AIDING_DATA_SV_DIRECTION_BIT = (1<<3), // direction - GNSS_AIDING_DATA_SV_STEER_BIT = (1<<4), // steer - GNSS_AIDING_DATA_SV_ALMANAC_CORR_BIT = (1<<5), // almanac correction - GNSS_AIDING_DATA_SV_BLACKLIST_BIT = (1<<6), // blacklist SVs - GNSS_AIDING_DATA_SV_SA_DATA_BIT = (1<<7), // sensitivity assistance data - GNSS_AIDING_DATA_SV_NO_EXIST_BIT = (1<<8), // SV does not exist - GNSS_AIDING_DATA_SV_IONOSPHERE_BIT = (1<<9), // ionosphere correction - GNSS_AIDING_DATA_SV_TIME_BIT = (1<<10),// reset satellite time -} GnssAidingDataSvBits; - -typedef uint32_t GnssAidingDataSvTypeMask; -typedef enum { - GNSS_AIDING_DATA_SV_TYPE_GPS_BIT = (1<<0), - GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT = (1<<1), - GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT = (1<<2), - GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT = (1<<3), - GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), -} GnssAidingDataSvTypeBits; - -typedef enum -{ - GNSS_LOC_SV_SYSTEM_GPS = 1, - /**< GPS satellite. */ - GNSS_LOC_SV_SYSTEM_GALILEO = 2, - /**< GALILEO satellite. */ - GNSS_LOC_SV_SYSTEM_SBAS = 3, - /**< SBAS satellite. */ - GNSS_LOC_SV_SYSTEM_COMPASS = 4, - /**< COMPASS satellite. */ - GNSS_LOC_SV_SYSTEM_GLONASS = 5, - /**< GLONASS satellite. */ - GNSS_LOC_SV_SYSTEM_BDS = 6, - /**< BDS satellite. */ - GNSS_LOC_SV_SYSTEM_QZSS = 7 - /**< QZSS satellite. */ -} Gnss_LocSvSystemEnumType; - -typedef uint32_t GnssSystemTimeStructTypeFlags; -typedef enum { - GNSS_SYSTEM_TIME_WEEK_VALID = (1 << 0), - GNSS_SYSTEM_TIME_WEEK_MS_VALID = (1 << 1), - GNSS_SYSTEM_CLK_TIME_BIAS_VALID = (1 << 2), - GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID = (1 << 3), - GNSS_SYSTEM_REF_FCOUNT_VALID = (1 << 4), - GNSS_SYSTEM_NUM_CLOCK_RESETS_VALID = (1 << 5) -} GnssSystemTimeTypeBits; - -typedef uint32_t GnssGloTimeStructTypeFlags; -typedef enum { - GNSS_CLO_DAYS_VALID = (1 << 0), - GNSS_GLOS_MSEC_VALID = (1 << 1), - GNSS_GLO_CLK_TIME_BIAS_VALID = (1 << 2), - GNSS_GLO_CLK_TIME_BIAS_UNC_VALID = (1 << 3), - GNSS_GLO_REF_FCOUNT_VALID = (1 << 4), - GNSS_GLO_NUM_CLOCK_RESETS_VALID = (1 << 5), - GNSS_GLO_FOUR_YEAR_VALID = (1 << 6) -} GnssGloTimeTypeBits; - -typedef struct { - GnssAidingDataSvMask svMask; // bitwise OR of GnssAidingDataSvBits - GnssAidingDataSvTypeMask svTypeMask; // bitwise OR of GnssAidingDataSvTypeBits -} GnssAidingDataSv; - -typedef uint32_t GnssAidingDataCommonMask; -typedef enum { - GNSS_AIDING_DATA_COMMON_POSITION_BIT = (1<<0), // position estimate - GNSS_AIDING_DATA_COMMON_TIME_BIT = (1<<1), // reset all clock values - GNSS_AIDING_DATA_COMMON_UTC_BIT = (1<<2), // UTC estimate - GNSS_AIDING_DATA_COMMON_RTI_BIT = (1<<3), // RTI - GNSS_AIDING_DATA_COMMON_FREQ_BIAS_EST_BIT = (1<<4), // frequency bias estimate - GNSS_AIDING_DATA_COMMON_CELLDB_BIT = (1<<5), // all celldb info -} GnssAidingDataCommonBits; - -typedef struct { - GnssAidingDataCommonMask mask; // bitwise OR of GnssAidingDataCommonBits -} GnssAidingDataCommon; - -typedef struct { - bool deleteAll; // if true, delete all aiding data and ignore other params - GnssAidingDataSv sv; // SV specific aiding data - GnssAidingDataCommon common; // common aiding data -} GnssAidingData; - -typedef struct { - size_t size; // set to sizeof(Location) - LocationFlagsMask flags; // bitwise OR of LocationFlagsBits to mark which params are valid - uint64_t timestamp; // UTC timestamp for location fix, milliseconds since January 1, 1970 - double latitude; // in degrees - double longitude; // in degrees - double altitude; // in meters above the WGS 84 reference ellipsoid - float speed; // in meters per second - float bearing; // in degrees; range [0, 360) - float accuracy; // in meters - float verticalAccuracy; // in meters - float speedAccuracy; // in meters/second - float bearingAccuracy; // in degrees (0 to 359.999) - LocationTechnologyMask techMask; -} Location; - -typedef struct { - size_t size; // set to sizeof(LocationOptions) - uint32_t minInterval; // in milliseconds - uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ - // gnssMeasurementsCallback may not be called - GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted -} LocationOptions; - -typedef struct { - size_t size; - BatchingMode batchingMode; -} BatchingOptions; - -typedef struct { - size_t size; - BatchingStatus batchingStatus; -} BatchingStatusInfo; - -typedef struct { - size_t size; // set to sizeof(GeofenceOption) - GeofenceBreachTypeMask breachTypeMask; // bitwise OR of GeofenceBreachTypeBits - uint32_t responsiveness; // in milliseconds - uint32_t dwellTime; // in seconds -} GeofenceOption; - -typedef struct { - size_t size; // set to sizeof(GeofenceInfo) - double latitude; // in degrees - double longitude; // in degrees - double radius; // in meters -} GeofenceInfo; - -typedef struct { - size_t size; // set to sizeof(GeofenceBreachNotification) - size_t count; // number of ids in array - uint32_t* ids; // array of ids that have breached - Location location; // location associated with breach - GeofenceBreachType type; // type of breach - uint64_t timestamp; // timestamp of breach -} GeofenceBreachNotification; - -typedef struct { - size_t size; // set to sizeof(GeofenceBreachNotification) - GeofenceStatusAvailable available; // GEOFENCE_STATUS_AVAILABILE_NO/_YES - LocationTechnologyType techType; // GNSS -} GeofenceStatusNotification; - -typedef struct { - uint64_t gpsSvUsedIdsMask; - uint64_t gloSvUsedIdsMask; - uint64_t galSvUsedIdsMask; - uint64_t bdsSvUsedIdsMask; - uint64_t qzssSvUsedIdsMask; -} GnssLocationSvUsedInPosition; - -/** @struct - Body Frame parameters -*/ -typedef struct { - GnssLocationPosDataMask bodyFrameDataMask; // Contains Body frame LocPosDataMask bits - float longAccel; // Forward Acceleration in body frame (m/s2) - float latAccel; // Sideward Acceleration in body frame (m/s2) - float vertAccel; // Vertical Acceleration in body frame (m/s2) - float yawRate; // Heading Rate (Radians/second) - float pitch; // Body pitch (Radians) -} GnssLocationPositionDynamics; - -typedef struct { - /** Validity mask for below fields */ - GnssSystemTimeStructTypeFlags validityMask; - /** Extended week number at reference tick. - Unit: Week. - Set to 65535 if week number is unknown. - For GPS: - Calculated from midnight, Jan. 6, 1980. - OTA decoded 10 bit GPS week is extended to map between: - [NV6264 to (NV6264 + 1023)]. - NV6264: Minimum GPS week number configuration. - Default value of NV6264: 1738 - For BDS: - Calculated from 00:00:00 on January 1, 2006 of Coordinated Universal Time (UTC). - For GAL: - Calculated from 00:00 UT on Sunday August 22, 1999 (midnight between August 21 and August 22). - */ - uint16_t systemWeek; - /** Time in to the current week at reference tick. - Unit: Millisecond. Range: 0 to 604799999. - Check for systemClkTimeUncMs before use */ - uint32_t systemMsec; - /** System clock time bias (sub-millisecond) - Units: Millisecond - Note: System time (TOW Millisecond) = systemMsec - systemClkTimeBias. - Check for systemClkTimeUncMs before use. */ - float systemClkTimeBias; - /** Single sided maximum time bias uncertainty - Units: Millisecond */ - float systemClkTimeUncMs; - /** FCount (free running HW timer) value. Don't use for relative time purpose - due to possible discontinuities. - Unit: Millisecond */ - uint32_t refFCount; - /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ - uint32_t numClockResets; -} GnssSystemTimeStructType; - -typedef struct { - /** GLONASS day number in four years. Refer to GLONASS ICD. - Applicable only for GLONASS and shall be ignored for other constellations. - If unknown shall be set to 65535 */ - uint16_t gloDays; - /** Validity mask for below fields */ - GnssGloTimeStructTypeFlags validityMask; - /** GLONASS time of day in Millisecond. Refer to GLONASS ICD. - Units: Millisecond - Check for gloClkTimeUncMs before use */ - uint32_t gloMsec; - /** GLONASS clock time bias (sub-millisecond) - Units: Millisecond - Note: GLO time (TOD Millisecond) = gloMsec - gloClkTimeBias. - Check for gloClkTimeUncMs before use. */ - float gloClkTimeBias; - /** Single sided maximum time bias uncertainty - Units: Millisecond */ - float gloClkTimeUncMs; - /** FCount (free running HW timer) value. Don't use for relative time purpose - due to possible discontinuities. - Unit: Millisecond */ - uint32_t refFCount; - /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ - uint32_t numClockResets; - /** GLONASS four year number from 1996. Refer to GLONASS ICD. - Applicable only for GLONASS and shall be ignored for other constellations. - If unknown shall be set to 255 */ - uint8_t gloFourYear; -} GnssGloTimeStructType; - -typedef union { - GnssSystemTimeStructType gpsSystemTime; - GnssSystemTimeStructType galSystemTime; - GnssSystemTimeStructType bdsSystemTime; - GnssSystemTimeStructType qzssSystemTime; - GnssGloTimeStructType gloSytemTime; -} SystemTimeStructUnion; - /** Time applicability of PVT report */ -typedef struct { - /** Specifies GNSS system time reported. Mandatory field */ - Gnss_LocSvSystemEnumType gnssSystemTimeSrc; - /** Reporting of GPS system time is recommended. - If GPS time is unknown & other satellite system time is known, - it should be reported. - Mandatory field - */ - SystemTimeStructUnion u; -} GnssSystemTime; - -typedef struct { - size_t size; // set to sizeof(GnssLocationInfo) - GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity - float altitudeMeanSeaLevel; // altitude wrt mean sea level - float pdop; // position dilusion of precision - float hdop; // horizontal dilusion of precision - float vdop; // vertical dilusion of precision - float gdop; // geometric dilution of precision - float tdop; // time dilution of precision - float magneticDeviation; // magnetic deviation - LocationReliability horReliability; // horizontal reliability - LocationReliability verReliability; // vertical reliability - float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis - float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis - float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth - float northVelocity; // North Velocity.Unit: Meters/sec - float eastVelocity; // East Velocity - float upVelocity; - float northVelocityStdDeviation; - float eastVelocityStdDeviation; - float upVelocityStdDeviation; - GnssLocationSvUsedInPosition svUsedInPosition;// Gnss sv used in position data - GnssLocationNavSolutionMask navSolutionMask; // Nav solution mask to indicate sbas corrections - GnssLocationPosTechMask posTechMask; // Position technology used in computing this fix - GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and - // pitch set with validity - GnssSystemTime gnssSystemTime; // GNSS System Time - Location location; -} GnssLocationInfoNotification; - -typedef struct { - size_t size; // set to sizeof(GnssNiNotification) - GnssNiType type; // type of NI (Voice, SUPL, Control Plane) - GnssNiOptionsMask options; // bitwise OR of GnssNiOptionsBits - uint32_t timeout; // time (seconds) to wait for user input - GnssNiResponse timeoutResponse; // the response that should be sent when timeout expires - char requestor[GNSS_NI_REQUESTOR_MAX]; // the requestor that is making the request - GnssNiEncodingType requestorEncoding; // the encoding type for requestor - char message[GNSS_NI_MESSAGE_ID_MAX]; // the message to show user - GnssNiEncodingType messageEncoding; // the encoding type for message - char extras[GNSS_NI_MESSAGE_ID_MAX]; -} GnssNiNotification; - -typedef struct { - size_t size; // set to sizeof(GnssSv) - uint16_t svId; // Unique Identifier - GnssSvType type; // type of SV (GPS, SBAS, GLONASS, QZSS, BEIDOU, GALILEO) - float cN0Dbhz; // signal strength - float elevation; // elevation of SV (in degrees) - float azimuth; // azimuth of SV (in degrees) - GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits -} GnssSv; - -typedef struct { - size_t size; // set to sizeof(GnssConfigSetAssistanceServer) - GnssAssistanceType type; // SUPL or C2K - const char* hostName; // null terminated string - uint32_t port; // port of server -} GnssConfigSetAssistanceServer; - -typedef struct { - size_t size; // set to sizeof(GnssMeasurementsData) - GnssMeasurementsDataFlagsMask flags; // bitwise OR of GnssMeasurementsDataFlagsBits - int16_t svId; - GnssSvType svType; - double timeOffsetNs; - GnssMeasurementsStateMask stateMask; // bitwise OR of GnssMeasurementsStateBits - int64_t receivedSvTimeNs; - int64_t receivedSvTimeUncertaintyNs; - double carrierToNoiseDbHz; - double pseudorangeRateMps; - double pseudorangeRateUncertaintyMps; - GnssMeasurementsAdrStateMask adrStateMask; // bitwise OR of GnssMeasurementsAdrStateBits - double adrMeters; - double adrUncertaintyMeters; - float carrierFrequencyHz; - int64_t carrierCycles; - double carrierPhase; - double carrierPhaseUncertainty; - GnssMeasurementsMultipathIndicator multipathIndicator; - double signalToNoiseRatioDb; - double agcLevelDb; -} GnssMeasurementsData; - -typedef struct { - size_t size; // set to sizeof(GnssMeasurementsClock) - GnssMeasurementsClockFlagsMask flags; // bitwise OR of GnssMeasurementsClockFlagsBits - int16_t leapSecond; - int64_t timeNs; - double timeUncertaintyNs; - int64_t fullBiasNs; - double biasNs; - double biasUncertaintyNs; - double driftNsps; - double driftUncertaintyNsps; - uint32_t hwClockDiscontinuityCount; -} GnssMeasurementsClock; - -typedef struct { - size_t size; // set to sizeof(GnssSvNotification) - size_t count; // number of SVs in the GnssSv array - GnssSv gnssSvs[GNSS_SV_MAX]; // information on a number of SVs -} GnssSvNotification; - -typedef struct { - size_t size; // set to sizeof(GnssNmeaNotification) - uint64_t timestamp; // timestamp - const char* nmea; // nmea text - size_t length; // length of the nmea text -} GnssNmeaNotification; - -typedef struct { - size_t size; // set to sizeof(GnssMeasurementsNotification) - size_t count; // number of items in GnssMeasurements array - GnssMeasurementsData measurements[GNSS_MEASUREMENTS_MAX]; - GnssMeasurementsClock clock; // clock -} GnssMeasurementsNotification; - -typedef struct { - size_t size; // set to sizeof(GnssConfig) - GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid - GnssConfigGpsLock gpsLock; - GnssConfigSuplVersion suplVersion; - GnssConfigSetAssistanceServer assistanceServer; - GnssConfigLppProfile lppProfile; - GnssConfigLppeControlPlaneMask lppeControlPlaneMask; - GnssConfigLppeUserPlaneMask lppeUserPlaneMask; - GnssConfigAGlonassPositionProtocolMask aGlonassPositionProtocolMask; - GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl; - GnssConfigSuplEmergencyServices suplEmergencyServices; - GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits -} GnssConfig; - -typedef struct { - size_t size; // set to sizeof - bool mValid; - Location mLocation; - double verticalAccuracyMeters; - double speedAccuracyMetersPerSecond; - double bearingAccuracyDegrees; - timespec mUtcReported; -} GnssDebugLocation; - -typedef struct { - size_t size; // set to sizeof - bool mValid; - int64_t timeEstimate; - float timeUncertaintyNs; - float frequencyUncertaintyNsPerSec; -} GnssDebugTime; - -typedef struct { - size_t size; // set to sizeof - uint32_t svid; - GnssSvType constellation; - GnssEphemerisType mEphemerisType; - GnssEphemerisSource mEphemerisSource; - GnssEphemerisHealth mEphemerisHealth; - float ephemerisAgeSeconds; - bool serverPredictionIsAvailable; - float serverPredictionAgeSeconds; -} GnssDebugSatelliteInfo; - -typedef struct { - size_t size; // set to sizeof - GnssDebugLocation mLocation; - GnssDebugTime mTime; - std::vector mSatelliteInfo; -} GnssDebugReport; - -/* Provides the capabilities of the system - capabilities callback is called once soon after createInstance is called */ -typedef std::function capabilitiesCallback; - -/* Used by tracking, batching, and miscellanous APIs - responseCallback is called for every Tracking, Batching API, and Miscellanous API */ -typedef std::function responseCallback; - -/* Used by APIs that gets more than one LocationError in it's response - collectiveResponseCallback is called for every geofence API call. - ids array and LocationError array are only valid until collectiveResponseCallback returns. */ -typedef std::function collectiveResponseCallback; - -/* Used for startTracking API, optional can be NULL - trackingCallback is called when delivering a location in a tracking session - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function trackingCallback; - -/* Used for startBatching API, optional can be NULL - batchingCallback is called when delivering locations in a batching session. - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function batchingCallback; - -typedef std::function & listOfCompletedTrips -)> batchingStatusCallback; - -/* Gives GNSS Location information, optional can be NULL - gnssLocationInfoCallback is called only during a tracking session - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function gnssLocationInfoCallback; - -/* Used for addGeofences API, optional can be NULL - geofenceBreachCallback is called when any number of geofences have a state change */ -typedef std::function geofenceBreachCallback; - -/* Used for addGeofences API, optional can be NULL - geofenceStatusCallback is called when any number of geofences have a status change */ -typedef std::function geofenceStatusCallback; - -/* Network Initiated request, optional can be NULL - This callback should be responded to by calling gnssNiResponse */ -typedef std::function gnssNiCallback; - -/* Gives GNSS SV information, optional can be NULL - gnssSvCallback is called only during a tracking session - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function gnssSvCallback; - -/* Gives GNSS NMEA data, optional can be NULL - gnssNmeaCallback is called only during a tracking session - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function gnssNmeaCallback; - -/* Gives GNSS Measurements information, optional can be NULL - gnssMeasurementsCallback is called only during a tracking session - broadcasted to all clients, no matter if a session has started by client */ -typedef std::function gnssMeasurementsCallback; - -typedef struct { - size_t size; // set to sizeof(LocationCallbacks) - capabilitiesCallback capabilitiesCb; // mandatory - responseCallback responseCb; // mandatory - collectiveResponseCallback collectiveResponseCb; // mandatory - trackingCallback trackingCb; // optional - batchingCallback batchingCb; // optional - geofenceBreachCallback geofenceBreachCb; // optional - geofenceStatusCallback geofenceStatusCb; // optional - gnssLocationInfoCallback gnssLocationInfoCb; // optional - gnssNiCallback gnssNiCb; // optional - gnssSvCallback gnssSvCb; // optional - gnssNmeaCallback gnssNmeaCb; // optional - gnssMeasurementsCallback gnssMeasurementsCb; // optional - batchingStatusCallback batchingStatusCb; // optional -} LocationCallbacks; - -class LocationAPI +class LocationAPI : public ILocationAPI { private: LocationAPI(); @@ -984,7 +51,7 @@ public: /* updates/changes the callbacks that will be called. mandatory callbacks must be present for callbacks to be successfully updated no return value */ - void updateCallbacks(LocationCallbacks&); + virtual void updateCallbacks(LocationCallbacks&) override; /* ================================== TRACKING ================================== */ @@ -997,20 +64,20 @@ public: LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed in createInstance LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameter is invalid */ - uint32_t startTracking(LocationOptions&); // returns session id + virtual uint32_t startTracking(LocationOptions&) override; /* stopTracking stops a tracking session associated with id parameter. responseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ - void stopTracking(uint32_t id); + virtual void stopTracking(uint32_t id) override; /* updateTrackingOptions changes the LocationOptions of a tracking session associated with id responseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ - void updateTrackingOptions(uint32_t id, LocationOptions&); + virtual void updateTrackingOptions(uint32_t id, LocationOptions&) override; /* ================================== BATCHING ================================== */ @@ -1029,20 +96,20 @@ public: LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ - uint32_t startBatching(LocationOptions&, BatchingOptions&); // returns session id + virtual uint32_t startBatching(LocationOptions&, BatchingOptions&) override; /* stopBatching stops a batching session associated with id parameter. responseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with batching session */ - void stopBatching(uint32_t id); + virtual void stopBatching(uint32_t id) override; /* updateBatchingOptions changes the LocationOptions of a batching session associated with id responseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ - void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&); + virtual void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&) override; /* getBatchedLocations gets a number of locations that are currently stored/batched on the low power processor, delivered by the batchingCallback passed in createInstance. @@ -1051,7 +118,7 @@ public: LOCATION_ERROR_SUCCESS if successful, will be followed by batchingCallback call LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ - void getBatchedLocations(uint32_t id, size_t count); + virtual void getBatchedLocations(uint32_t id, size_t count) override; /* ================================== GEOFENCE ================================== */ @@ -1065,14 +132,14 @@ public: LOCATION_ERROR_CALLBACK_MISSING if no geofenceBreachCallback LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid LOCATION_ERROR_NOT_SUPPORTED if geofence is not supported */ - uint32_t* addGeofences(size_t count, GeofenceOption*, GeofenceInfo*); // returns id array + virtual uint32_t* addGeofences(size_t count, GeofenceOption*, GeofenceInfo*) override; /* removeGeofences removes any number of geofences. Caller should delete ids array after removeGeofences returneds. collectiveResponseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ - void removeGeofences(size_t count, uint32_t* ids); + virtual void removeGeofences(size_t count, uint32_t* ids) override; /* modifyGeofences modifies any number of geofences. Caller should delete ids array after modifyGeofences returns. @@ -1080,7 +147,7 @@ public: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid */ - void modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options); + virtual void modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options) override; /* pauseGeofences pauses any number of geofences, which is similar to removeGeofences, only that they can be resumed at any time. Caller should delete ids array after @@ -1088,14 +155,14 @@ public: collectiveResponseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ - void pauseGeofences(size_t count, uint32_t* ids); + virtual void pauseGeofences(size_t count, uint32_t* ids) override; /* resumeGeofences resumes any number of geofences that are currently paused. Caller should delete ids array after resumeGeofences returns. collectiveResponseCallback returns: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */ - void resumeGeofences(size_t count, uint32_t* ids); + virtual void resumeGeofences(size_t count, uint32_t* ids) override; /* ================================== GNSS ====================================== */ @@ -1104,7 +171,7 @@ public: LOCATION_ERROR_SUCCESS if session was successful LOCATION_ERROR_INVALID_PARAMETER if any parameters in GnssNiResponse are invalid LOCATION_ERROR_ID_UNKNOWN if id does not match a gnssNiCallback */ - void gnssNiResponse(uint32_t id, GnssNiResponse response); + virtual void gnssNiResponse(uint32_t id, GnssNiResponse response) override; }; typedef struct { @@ -1113,7 +180,7 @@ typedef struct { collectiveResponseCallback collectiveResponseCb; // mandatory } LocationControlCallbacks; -class LocationControlAPI +class LocationControlAPI : public ILocationControlAPI { private: LocationControlAPI(); @@ -1162,7 +229,7 @@ public: LOCATION_ERROR_SUCCESS if session was successful LOCATION_ERROR_INVALID_PARAMETER if any other parameters are invalid LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ - uint32_t* gnssUpdateConfig(GnssConfig config); + virtual uint32_t* gnssUpdateConfig(GnssConfig config) override; /* delete specific gnss aiding data for testing, which returns a session id that will be returned in responseCallback to match command with response. @@ -1171,7 +238,7 @@ public: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */ - uint32_t gnssDeleteAidingData(GnssAidingData& data); + virtual uint32_t gnssDeleteAidingData(GnssAidingData& data) override; }; -#endif /* LOCATION_H */ +#endif /* LOCATIONAPI_H */ diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h new file mode 100644 index 00000000..d03a8b4d --- /dev/null +++ b/location/LocationDataTypes.h @@ -0,0 +1,967 @@ +/* Copyright (c) 2018 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 LOCATIONDATATYPES_H +#define LOCATIONDATATYPES_H + +#include +#include +#include +#include + +#define GNSS_NI_REQUESTOR_MAX (256) +#define GNSS_NI_MESSAGE_ID_MAX (2048) +#define GNSS_SV_MAX (64) +#define GNSS_MEASUREMENTS_MAX (64) +#define GNSS_UTC_TIME_OFFSET (3657) + +#define GNSS_BUGREPORT_GPS_MIN (1) +#define GNSS_BUGREPORT_SBAS_MIN (120) +#define GNSS_BUGREPORT_GLO_MIN (1) +#define GNSS_BUGREPORT_QZSS_MIN (193) +#define GNSS_BUGREPORT_BDS_MIN (1) +#define GNSS_BUGREPORT_GAL_MIN (1) + +typedef enum { + LOCATION_ERROR_SUCCESS = 0, + LOCATION_ERROR_GENERAL_FAILURE, + LOCATION_ERROR_CALLBACK_MISSING, + LOCATION_ERROR_INVALID_PARAMETER, + LOCATION_ERROR_ID_EXISTS, + LOCATION_ERROR_ID_UNKNOWN, + LOCATION_ERROR_ALREADY_STARTED, + LOCATION_ERROR_GEOFENCES_AT_MAX, + LOCATION_ERROR_NOT_SUPPORTED +} LocationError; + +// Flags to indicate which values are valid in a Location +typedef uint16_t LocationFlagsMask; +typedef enum { + LOCATION_HAS_LAT_LONG_BIT = (1<<0), // location has valid latitude and longitude + LOCATION_HAS_ALTITUDE_BIT = (1<<1), // location has valid altitude + LOCATION_HAS_SPEED_BIT = (1<<2), // location has valid speed + LOCATION_HAS_BEARING_BIT = (1<<3), // location has valid bearing + LOCATION_HAS_ACCURACY_BIT = (1<<4), // location has valid accuracy + LOCATION_HAS_VERTICAL_ACCURACY_BIT = (1<<5), // location has valid vertical accuracy + LOCATION_HAS_SPEED_ACCURACY_BIT = (1<<6), // location has valid speed accuracy + LOCATION_HAS_BEARING_ACCURACY_BIT = (1<<7), // location has valid bearing accuracy +} LocationFlagsBits; + +typedef uint16_t LocationTechnologyMask; +typedef enum { + LOCATION_TECHNOLOGY_GNSS_BIT = (1<<0), // location was calculated using GNSS + LOCATION_TECHNOLOGY_CELL_BIT = (1<<1), // location was calculated using Cell + LOCATION_TECHNOLOGY_WIFI_BIT = (1<<2), // location was calculated using WiFi + LOCATION_TECHNOLOGY_SENSORS_BIT = (1<<3), // location was calculated using Sensors +} LocationTechnologyBits; + +typedef enum { + LOCATION_RELIABILITY_NOT_SET = 0, + LOCATION_RELIABILITY_VERY_LOW, + LOCATION_RELIABILITY_LOW, + LOCATION_RELIABILITY_MEDIUM, + LOCATION_RELIABILITY_HIGH, +} LocationReliability; + +typedef uint32_t GnssLocationNavSolutionMask; +typedef enum { + LOCATION_SBAS_CORRECTION_IONO_BIT = (1<<0), // SBAS ionospheric correction is used + LOCATION_SBAS_CORRECTION_FAST_BIT = (1<<1), // SBAS fast correction is used + LOCATION_SBAS_CORRECTION_LONG_BIT = (1<<2), // SBAS long-tem correction is used + LOCATION_SBAS_INTEGRITY_BIT = (1<<3), // SBAS integrity information is used + LOCATION_NAV_CORRECTION_DGNSS_BIT = (1<<4), // Position Report is DGNSS corrected + LOCATION_NAV_CORRECTION_RTK_BIT = (1<<5), // Position Report is RTK corrected + LOCATION_NAV_CORRECTION_PPP_BIT = (1<<6) // Position Report is PPP corrected +} GnssLocationNavSolutionBits; + +typedef uint32_t GnssLocationPosTechMask; +typedef enum { + LOCATION_POS_TECH_DEFAULT_BIT = 0, + LOCATION_POS_TECH_SATELLITE_BIT = (1<<0), + LOCATION_POS_TECH_CELLID_BIT = (1<<1), + LOCATION_POS_TECH_WIFI_BIT = (1<<2), + LOCATION_POS_TECH_SENSORS_BIT = (1<<3), + LOCATION_POS_TECH_REFERENCE_LOCATION_BIT = (1<<4), + LOCATION_POS_TECH_INJECTED_COARSE_POSITION_BIT = (1<<5), + LOCATION_POS_TECH_AFLT_BIT = (1<<6), + LOCATION_POS_TECH_HYBRID_BIT = (1<<7), + LOCATION_POS_TECH_PPE_BIT = (1<<8) +} GnssLocationPosTechBits; + +typedef uint32_t GnssLocationPosDataMask; +typedef enum { + LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT = (1<<0), // Navigation data has Forward Acceleration + LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT = (1<<1), // Navigation data has Sideward Acceleration + LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT = (1<<2), // Navigation data has Vertical Acceleration + LOCATION_NAV_DATA_HAS_YAW_RATE_BIT = (1<<3), // Navigation data has Heading Rate + LOCATION_NAV_DATA_HAS_PITCH_BIT = (1<<4) // Navigation data has Body pitch +} GnssLocationPosDataBits; + +typedef uint32_t GnssLocationInfoFlagMask; +typedef enum { + GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT = (1<<0), // valid altitude mean sea level + GNSS_LOCATION_INFO_DOP_BIT = (1<<1), // valid pdop, hdop, and vdop + GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT = (1<<2), // valid magnetic deviation + GNSS_LOCATION_INFO_HOR_RELIABILITY_BIT = (1<<3), // valid horizontal reliability + GNSS_LOCATION_INFO_VER_RELIABILITY_BIT = (1<<4), // valid vertical reliability + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor + GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7), // valid accuracy elipsode azimuth + GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT = (1<<8), // valid gnss sv used in pos data + GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT = (1<<9), // valid navSolutionMask + GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask + GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource + GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data + GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time + GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop +} GnssLocationInfoFlagBits; + +typedef enum { + GEOFENCE_BREACH_ENTER = 0, + GEOFENCE_BREACH_EXIT, + GEOFENCE_BREACH_DWELL_IN, + GEOFENCE_BREACH_DWELL_OUT, + GEOFENCE_BREACH_UNKNOWN, +} GeofenceBreachType; + +typedef uint16_t GeofenceBreachTypeMask; +typedef enum { + GEOFENCE_BREACH_ENTER_BIT = (1<<0), + GEOFENCE_BREACH_EXIT_BIT = (1<<1), + GEOFENCE_BREACH_DWELL_IN_BIT = (1<<2), + GEOFENCE_BREACH_DWELL_OUT_BIT = (1<<3), +} GeofenceBreachTypeBits; + +typedef enum { + GEOFENCE_STATUS_AVAILABILE_NO = 0, + GEOFENCE_STATUS_AVAILABILE_YES, +} GeofenceStatusAvailable; + +typedef uint32_t LocationCapabilitiesMask; +typedef enum { + // supports startTracking API with minInterval param + LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0), + // supports startBatching API with minInterval param + LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1), + // supports startTracking API with minDistance param + LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2), + // supports startBatching API with minDistance param + LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3), + // supports addGeofences API + LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4), + // supports GnssMeasurementsCallback + LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5), + // supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based) + LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6), + // supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted) + LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7), + // supports debug nmea sentences in the debugNmeaCallback + LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8), + // support outdoor trip batching + LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9) +} LocationCapabilitiesBits; + +typedef enum { + LOCATION_TECHNOLOGY_TYPE_GNSS = 0, +} LocationTechnologyType; + +// Configures how GPS is locked when GPS is disabled (through GnssDisable) +typedef enum { + GNSS_CONFIG_GPS_LOCK_NONE = 0, // gps is not locked when GPS is disabled (GnssDisable) + GNSS_CONFIG_GPS_LOCK_MO, // gps mobile originated (MO) is locked when GPS is disabled + GNSS_CONFIG_GPS_LOCK_NI, // gps network initiated (NI) is locked when GPS is disabled + GNSS_CONFIG_GPS_LOCK_MO_AND_NI,// gps MO and NI is locked when GPS is disabled +} GnssConfigGpsLock; + +// SUPL version +typedef enum { + GNSS_CONFIG_SUPL_VERSION_1_0_0 = 1, + GNSS_CONFIG_SUPL_VERSION_2_0_0, + GNSS_CONFIG_SUPL_VERSION_2_0_2, +} GnssConfigSuplVersion; + +// LTE Positioning Profile +typedef enum { + GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE = 0, // RRLP on LTE (Default) + GNSS_CONFIG_LPP_PROFILE_USER_PLANE, // LPP User Plane (UP) on LTE + GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE, // LPP_Control_Plane (CP) + GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE, // Both LPP UP and CP +} GnssConfigLppProfile; + +// Technology for LPPe Control Plane +typedef uint16_t GnssConfigLppeControlPlaneMask; +typedef enum { + GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT = (1<<0), // DBH + GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), + // SENSOR_BARO_MEASUREMENTS +} GnssConfigLppeControlPlaneBits; + +// Technology for LPPe User Plane +typedef uint16_t GnssConfigLppeUserPlaneMask; +typedef enum { + GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT = (1<<0), // DBH + GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT = (1<<1), // WLAN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT = (1<<2), // SRN_AP_MEASUREMENTS + GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT = (1<<3), + // SENSOR_BARO_MEASUREMENTS +} GnssConfigLppeUserPlaneBits; + +// Positioning Protocol on A-GLONASS system +typedef uint16_t GnssConfigAGlonassPositionProtocolMask; +typedef enum { + GNSS_CONFIG_RRC_CONTROL_PLANE_BIT = (1<<0), // RRC Control Plane + GNSS_CONFIG_RRLP_USER_PLANE_BIT = (1<<1), // RRLP User Plane + GNSS_CONFIG_LLP_USER_PLANE_BIT = (1<<2), // LPP User Plane + GNSS_CONFIG_LLP_CONTROL_PLANE_BIT = (1<<3), // LPP Control Plane +} GnssConfigAGlonassPositionProtocolBits; + +typedef enum { + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO = 0, + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES, +} GnssConfigEmergencyPdnForEmergencySupl; + +typedef enum { + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO = 0, + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES, +} GnssConfigSuplEmergencyServices; + +typedef uint16_t GnssConfigSuplModeMask; +typedef enum { + GNSS_CONFIG_SUPL_MODE_MSB_BIT = (1<<0), + GNSS_CONFIG_SUPL_MODE_MSA_BIT = (1<<1), +} GnssConfigSuplModeBits; + +typedef uint32_t GnssConfigFlagsMask; +typedef enum { + GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT = (1<<0), + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT = (1<<1), + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT = (1<<2), + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT = (1<<3), + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT = (1<<4), + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT = (1<<5), + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT = (1<<6), + GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT = (1<<7), + GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), + GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), +} GnssConfigFlagsBits; + +typedef enum { + GNSS_NI_ENCODING_TYPE_NONE = 0, + GNSS_NI_ENCODING_TYPE_GSM_DEFAULT, + GNSS_NI_ENCODING_TYPE_UTF8, + GNSS_NI_ENCODING_TYPE_UCS2, +} GnssNiEncodingType; + +typedef enum { + GNSS_NI_TYPE_VOICE = 0, + GNSS_NI_TYPE_SUPL, + GNSS_NI_TYPE_CONTROL_PLANE, + GNSS_NI_TYPE_EMERGENCY_SUPL +} GnssNiType; + +typedef uint16_t GnssNiOptionsMask; +typedef enum { + GNSS_NI_OPTIONS_NOTIFICATION_BIT = (1<<0), + GNSS_NI_OPTIONS_VERIFICATION_BIT = (1<<1), + GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT = (1<<2), +} GnssNiOptionsBits; + +typedef enum { + GNSS_NI_RESPONSE_ACCEPT = 1, + GNSS_NI_RESPONSE_DENY, + GNSS_NI_RESPONSE_NO_RESPONSE, + GNSS_NI_RESPONSE_IGNORE, +} GnssNiResponse; + +typedef enum { + GNSS_SV_TYPE_UNKNOWN = 0, + GNSS_SV_TYPE_GPS, + GNSS_SV_TYPE_SBAS, + GNSS_SV_TYPE_GLONASS, + GNSS_SV_TYPE_QZSS, + GNSS_SV_TYPE_BEIDOU, + GNSS_SV_TYPE_GALILEO, +} GnssSvType; + +typedef enum { + GNSS_EPH_TYPE_UNKNOWN = 0, + GNSS_EPH_TYPE_EPHEMERIS, + GNSS_EPH_TYPE_ALMANAC, +} GnssEphemerisType; + +typedef enum { + GNSS_EPH_SOURCE_UNKNOWN = 0, + GNSS_EPH_SOURCE_DEMODULATED, + GNSS_EPH_SOURCE_SUPL_PROVIDED, + GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED, + GNSS_EPH_SOURCE_LOCAL, +} GnssEphemerisSource; + +typedef enum { + GNSS_EPH_HEALTH_UNKNOWN = 0, + GNSS_EPH_HEALTH_GOOD, + GNSS_EPH_HEALTH_BAD, +} GnssEphemerisHealth; + +typedef uint16_t GnssSvOptionsMask; +typedef enum { + GNSS_SV_OPTIONS_HAS_EPHEMER_BIT = (1<<0), + GNSS_SV_OPTIONS_HAS_ALMANAC_BIT = (1<<1), + GNSS_SV_OPTIONS_USED_IN_FIX_BIT = (1<<2), +} GnssSvOptionsBits; + +typedef enum { + GNSS_ASSISTANCE_TYPE_SUPL = 0, + GNSS_ASSISTANCE_TYPE_C2K, +} GnssAssistanceType; + +typedef enum { + GNSS_SUPL_MODE_STANDALONE = 0, + GNSS_SUPL_MODE_MSB, + GNSS_SUPL_MODE_MSA, +} GnssSuplMode; + +typedef enum { + BATCHING_MODE_ROUTINE = 0, // positions are reported when batched positions memory is full + BATCHING_MODE_TRIP, // positions are reported when a certain distance is covered + BATCHING_MODE_NO_AUTO_REPORT // no report of positions automatically, instead queried on demand +} BatchingMode; + +typedef enum { + BATCHING_STATUS_TRIP_COMPLETED = 0, + BATCHING_STATUS_POSITION_AVAILABE, + BATCHING_STATUS_POSITION_UNAVAILABLE +} BatchingStatus; + +typedef uint16_t GnssMeasurementsAdrStateMask; +typedef enum { + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT = (1<<0), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT = (1<<1), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT = (1<<2), +} GnssMeasurementsAdrStateBits; + +typedef uint32_t GnssMeasurementsDataFlagsMask; +typedef enum { + GNSS_MEASUREMENTS_DATA_SV_ID_BIT = (1<<0), + GNSS_MEASUREMENTS_DATA_SV_TYPE_BIT = (1<<1), + GNSS_MEASUREMENTS_DATA_STATE_BIT = (1<<2), + GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_BIT = (1<<3), + GNSS_MEASUREMENTS_DATA_RECEIVED_SV_TIME_UNCERTAINTY_BIT = (1<<4), + GNSS_MEASUREMENTS_DATA_CARRIER_TO_NOISE_BIT = (1<<5), + GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_BIT = (1<<6), + GNSS_MEASUREMENTS_DATA_PSEUDORANGE_RATE_UNCERTAINTY_BIT = (1<<7), + GNSS_MEASUREMENTS_DATA_ADR_STATE_BIT = (1<<8), + GNSS_MEASUREMENTS_DATA_ADR_BIT = (1<<9), + GNSS_MEASUREMENTS_DATA_ADR_UNCERTAINTY_BIT = (1<<10), + GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT = (1<<11), + GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT = (1<<12), + GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT = (1<<13), + GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT = (1<<14), + GNSS_MEASUREMENTS_DATA_MULTIPATH_INDICATOR_BIT = (1<<15), + GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT = (1<<16), + GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT = (1<<17), +} GnssMeasurementsDataFlagsBits; + +typedef uint32_t GnssMeasurementsStateMask; +typedef enum { + GNSS_MEASUREMENTS_STATE_UNKNOWN_BIT = 0, + GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT = (1<<0), + GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT = (1<<1), + GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT = (1<<2), + GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT = (1<<3), + GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT = (1<<4), + GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT = (1<<5), + GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT = (1<<6), + GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT = (1<<7), + GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT = (1<<8), + GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT = (1<<9), + GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT = (1<<10), + GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT = (1<<11), + GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT = (1<<12), + GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT = (1<<13), +} GnssMeasurementsStateBits; + +typedef enum { + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_UNKNOWN = 0, + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT, + GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT, +} GnssMeasurementsMultipathIndicator; + +typedef uint32_t GnssMeasurementsClockFlagsMask; +typedef enum { + GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT = (1<<0), + GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_BIT = (1<<1), + GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT = (1<<2), + GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT = (1<<3), + GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT = (1<<4), + GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT = (1<<5), + GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT = (1<<6), + GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT = (1<<7), + GNSS_MEASUREMENTS_CLOCK_FLAGS_HW_CLOCK_DISCONTINUITY_COUNT_BIT = (1<<8), +} GnssMeasurementsClockFlagsBits; + +typedef uint32_t GnssAidingDataSvMask; +typedef enum { + GNSS_AIDING_DATA_SV_EPHEMERIS_BIT = (1<<0), // ephemeris + GNSS_AIDING_DATA_SV_ALMANAC_BIT = (1<<1), // almanac + GNSS_AIDING_DATA_SV_HEALTH_BIT = (1<<2), // health + GNSS_AIDING_DATA_SV_DIRECTION_BIT = (1<<3), // direction + GNSS_AIDING_DATA_SV_STEER_BIT = (1<<4), // steer + GNSS_AIDING_DATA_SV_ALMANAC_CORR_BIT = (1<<5), // almanac correction + GNSS_AIDING_DATA_SV_BLACKLIST_BIT = (1<<6), // blacklist SVs + GNSS_AIDING_DATA_SV_SA_DATA_BIT = (1<<7), // sensitivity assistance data + GNSS_AIDING_DATA_SV_NO_EXIST_BIT = (1<<8), // SV does not exist + GNSS_AIDING_DATA_SV_IONOSPHERE_BIT = (1<<9), // ionosphere correction + GNSS_AIDING_DATA_SV_TIME_BIT = (1<<10),// reset satellite time +} GnssAidingDataSvBits; + +typedef uint32_t GnssAidingDataSvTypeMask; +typedef enum { + GNSS_AIDING_DATA_SV_TYPE_GPS_BIT = (1<<0), + GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT = (1<<1), + GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT = (1<<2), + GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT = (1<<3), + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), +} GnssAidingDataSvTypeBits; + +typedef enum +{ + GNSS_LOC_SV_SYSTEM_GPS = 1, + /**< GPS satellite. */ + GNSS_LOC_SV_SYSTEM_GALILEO = 2, + /**< GALILEO satellite. */ + GNSS_LOC_SV_SYSTEM_SBAS = 3, + /**< SBAS satellite. */ + GNSS_LOC_SV_SYSTEM_COMPASS = 4, + /**< COMPASS satellite. */ + GNSS_LOC_SV_SYSTEM_GLONASS = 5, + /**< GLONASS satellite. */ + GNSS_LOC_SV_SYSTEM_BDS = 6, + /**< BDS satellite. */ + GNSS_LOC_SV_SYSTEM_QZSS = 7 + /**< QZSS satellite. */ +} Gnss_LocSvSystemEnumType; + +typedef uint32_t GnssSystemTimeStructTypeFlags; +typedef enum { + GNSS_SYSTEM_TIME_WEEK_VALID = (1 << 0), + GNSS_SYSTEM_TIME_WEEK_MS_VALID = (1 << 1), + GNSS_SYSTEM_CLK_TIME_BIAS_VALID = (1 << 2), + GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID = (1 << 3), + GNSS_SYSTEM_REF_FCOUNT_VALID = (1 << 4), + GNSS_SYSTEM_NUM_CLOCK_RESETS_VALID = (1 << 5) +} GnssSystemTimeTypeBits; + +typedef uint32_t GnssGloTimeStructTypeFlags; +typedef enum { + GNSS_CLO_DAYS_VALID = (1 << 0), + GNSS_GLOS_MSEC_VALID = (1 << 1), + GNSS_GLO_CLK_TIME_BIAS_VALID = (1 << 2), + GNSS_GLO_CLK_TIME_BIAS_UNC_VALID = (1 << 3), + GNSS_GLO_REF_FCOUNT_VALID = (1 << 4), + GNSS_GLO_NUM_CLOCK_RESETS_VALID = (1 << 5), + GNSS_GLO_FOUR_YEAR_VALID = (1 << 6) +} GnssGloTimeTypeBits; + +typedef struct { + GnssAidingDataSvMask svMask; // bitwise OR of GnssAidingDataSvBits + GnssAidingDataSvTypeMask svTypeMask; // bitwise OR of GnssAidingDataSvTypeBits +} GnssAidingDataSv; + +typedef uint32_t GnssAidingDataCommonMask; +typedef enum { + GNSS_AIDING_DATA_COMMON_POSITION_BIT = (1<<0), // position estimate + GNSS_AIDING_DATA_COMMON_TIME_BIT = (1<<1), // reset all clock values + GNSS_AIDING_DATA_COMMON_UTC_BIT = (1<<2), // UTC estimate + GNSS_AIDING_DATA_COMMON_RTI_BIT = (1<<3), // RTI + GNSS_AIDING_DATA_COMMON_FREQ_BIAS_EST_BIT = (1<<4), // frequency bias estimate + GNSS_AIDING_DATA_COMMON_CELLDB_BIT = (1<<5), // all celldb info +} GnssAidingDataCommonBits; + +typedef struct { + GnssAidingDataCommonMask mask; // bitwise OR of GnssAidingDataCommonBits +} GnssAidingDataCommon; + +typedef struct { + bool deleteAll; // if true, delete all aiding data and ignore other params + GnssAidingDataSv sv; // SV specific aiding data + GnssAidingDataCommon common; // common aiding data +} GnssAidingData; + +typedef struct { + size_t size; // set to sizeof(Location) + LocationFlagsMask flags; // bitwise OR of LocationFlagsBits to mark which params are valid + uint64_t timestamp; // UTC timestamp for location fix, milliseconds since January 1, 1970 + double latitude; // in degrees + double longitude; // in degrees + double altitude; // in meters above the WGS 84 reference ellipsoid + float speed; // in meters per second + float bearing; // in degrees; range [0, 360) + float accuracy; // in meters + float verticalAccuracy; // in meters + float speedAccuracy; // in meters/second + float bearingAccuracy; // in degrees (0 to 359.999) + LocationTechnologyMask techMask; +} Location; + +typedef struct { + size_t size; // set to sizeof(LocationOptions) + uint32_t minInterval; // in milliseconds + uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ + // gnssMeasurementsCallback may not be called + GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted +} LocationOptions; + +typedef struct { + size_t size; + BatchingMode batchingMode; +} BatchingOptions; + +typedef struct { + size_t size; + BatchingStatus batchingStatus; +} BatchingStatusInfo; + +typedef struct { + size_t size; // set to sizeof(GeofenceOption) + GeofenceBreachTypeMask breachTypeMask; // bitwise OR of GeofenceBreachTypeBits + uint32_t responsiveness; // in milliseconds + uint32_t dwellTime; // in seconds +} GeofenceOption; + +typedef struct { + size_t size; // set to sizeof(GeofenceInfo) + double latitude; // in degrees + double longitude; // in degrees + double radius; // in meters +} GeofenceInfo; + +typedef struct { + size_t size; // set to sizeof(GeofenceBreachNotification) + size_t count; // number of ids in array + uint32_t* ids; // array of ids that have breached + Location location; // location associated with breach + GeofenceBreachType type; // type of breach + uint64_t timestamp; // timestamp of breach +} GeofenceBreachNotification; + +typedef struct { + size_t size; // set to sizeof(GeofenceBreachNotification) + GeofenceStatusAvailable available; // GEOFENCE_STATUS_AVAILABILE_NO/_YES + LocationTechnologyType techType; // GNSS +} GeofenceStatusNotification; + +typedef struct { + uint64_t gpsSvUsedIdsMask; + uint64_t gloSvUsedIdsMask; + uint64_t galSvUsedIdsMask; + uint64_t bdsSvUsedIdsMask; + uint64_t qzssSvUsedIdsMask; +} GnssLocationSvUsedInPosition; + +/** @struct + Body Frame parameters +*/ +typedef struct { + GnssLocationPosDataMask bodyFrameDataMask; // Contains Body frame LocPosDataMask bits + float longAccel; // Forward Acceleration in body frame (m/s2) + float latAccel; // Sideward Acceleration in body frame (m/s2) + float vertAccel; // Vertical Acceleration in body frame (m/s2) + float yawRate; // Heading Rate (Radians/second) + float pitch; // Body pitch (Radians) +} GnssLocationPositionDynamics; + +typedef struct { + /** Validity mask for below fields */ + GnssSystemTimeStructTypeFlags validityMask; + /** Extended week number at reference tick. + Unit: Week. + Set to 65535 if week number is unknown. + For GPS: + Calculated from midnight, Jan. 6, 1980. + OTA decoded 10 bit GPS week is extended to map between: + [NV6264 to (NV6264 + 1023)]. + NV6264: Minimum GPS week number configuration. + Default value of NV6264: 1738 + For BDS: + Calculated from 00:00:00 on January 1, 2006 of Coordinated Universal Time (UTC). + For GAL: + Calculated from 00:00 UT on Sunday August 22, 1999 (midnight between August 21 and August 22). + */ + uint16_t systemWeek; + /** Time in to the current week at reference tick. + Unit: Millisecond. Range: 0 to 604799999. + Check for systemClkTimeUncMs before use */ + uint32_t systemMsec; + /** System clock time bias (sub-millisecond) + Units: Millisecond + Note: System time (TOW Millisecond) = systemMsec - systemClkTimeBias. + Check for systemClkTimeUncMs before use. */ + float systemClkTimeBias; + /** Single sided maximum time bias uncertainty + Units: Millisecond */ + float systemClkTimeUncMs; + /** FCount (free running HW timer) value. Don't use for relative time purpose + due to possible discontinuities. + Unit: Millisecond */ + uint32_t refFCount; + /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ + uint32_t numClockResets; +} GnssSystemTimeStructType; + +typedef struct { + /** GLONASS day number in four years. Refer to GLONASS ICD. + Applicable only for GLONASS and shall be ignored for other constellations. + If unknown shall be set to 65535 */ + uint16_t gloDays; + /** Validity mask for below fields */ + GnssGloTimeStructTypeFlags validityMask; + /** GLONASS time of day in Millisecond. Refer to GLONASS ICD. + Units: Millisecond + Check for gloClkTimeUncMs before use */ + uint32_t gloMsec; + /** GLONASS clock time bias (sub-millisecond) + Units: Millisecond + Note: GLO time (TOD Millisecond) = gloMsec - gloClkTimeBias. + Check for gloClkTimeUncMs before use. */ + float gloClkTimeBias; + /** Single sided maximum time bias uncertainty + Units: Millisecond */ + float gloClkTimeUncMs; + /** FCount (free running HW timer) value. Don't use for relative time purpose + due to possible discontinuities. + Unit: Millisecond */ + uint32_t refFCount; + /** Number of clock resets/discontinuities detected, affecting the local hardware counter value. */ + uint32_t numClockResets; + /** GLONASS four year number from 1996. Refer to GLONASS ICD. + Applicable only for GLONASS and shall be ignored for other constellations. + If unknown shall be set to 255 */ + uint8_t gloFourYear; +} GnssGloTimeStructType; + +typedef union { + GnssSystemTimeStructType gpsSystemTime; + GnssSystemTimeStructType galSystemTime; + GnssSystemTimeStructType bdsSystemTime; + GnssSystemTimeStructType qzssSystemTime; + GnssGloTimeStructType gloSytemTime; +} SystemTimeStructUnion; + /** Time applicability of PVT report */ +typedef struct { + /** Specifies GNSS system time reported. Mandatory field */ + Gnss_LocSvSystemEnumType gnssSystemTimeSrc; + /** Reporting of GPS system time is recommended. + If GPS time is unknown & other satellite system time is known, + it should be reported. + Mandatory field + */ + SystemTimeStructUnion u; +} GnssSystemTime; + +typedef struct { + size_t size; // set to sizeof(GnssLocationInfo) + GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity + float altitudeMeanSeaLevel; // altitude wrt mean sea level + float pdop; // position dilusion of precision + float hdop; // horizontal dilusion of precision + float vdop; // vertical dilusion of precision + float gdop; // geometric dilution of precision + float tdop; // time dilution of precision + float magneticDeviation; // magnetic deviation + LocationReliability horReliability; // horizontal reliability + LocationReliability verReliability; // vertical reliability + float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis + float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis + float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth + float northVelocity; // North Velocity.Unit: Meters/sec + float eastVelocity; // East Velocity + float upVelocity; + float northVelocityStdDeviation; + float eastVelocityStdDeviation; + float upVelocityStdDeviation; + GnssLocationSvUsedInPosition svUsedInPosition;// Gnss sv used in position data + GnssLocationNavSolutionMask navSolutionMask; // Nav solution mask to indicate sbas corrections + GnssLocationPosTechMask posTechMask; // Position technology used in computing this fix + GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and + // pitch set with validity + GnssSystemTime gnssSystemTime; // GNSS System Time + Location location; +} GnssLocationInfoNotification; + +typedef struct { + size_t size; // set to sizeof(GnssNiNotification) + GnssNiType type; // type of NI (Voice, SUPL, Control Plane) + GnssNiOptionsMask options; // bitwise OR of GnssNiOptionsBits + uint32_t timeout; // time (seconds) to wait for user input + GnssNiResponse timeoutResponse; // the response that should be sent when timeout expires + char requestor[GNSS_NI_REQUESTOR_MAX]; // the requestor that is making the request + GnssNiEncodingType requestorEncoding; // the encoding type for requestor + char message[GNSS_NI_MESSAGE_ID_MAX]; // the message to show user + GnssNiEncodingType messageEncoding; // the encoding type for message + char extras[GNSS_NI_MESSAGE_ID_MAX]; +} GnssNiNotification; + +typedef struct { + size_t size; // set to sizeof(GnssSv) + uint16_t svId; // Unique Identifier + GnssSvType type; // type of SV (GPS, SBAS, GLONASS, QZSS, BEIDOU, GALILEO) + float cN0Dbhz; // signal strength + float elevation; // elevation of SV (in degrees) + float azimuth; // azimuth of SV (in degrees) + GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits +} GnssSv; + +typedef struct { + size_t size; // set to sizeof(GnssConfigSetAssistanceServer) + GnssAssistanceType type; // SUPL or C2K + const char* hostName; // null terminated string + uint32_t port; // port of server +} GnssConfigSetAssistanceServer; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsData) + GnssMeasurementsDataFlagsMask flags; // bitwise OR of GnssMeasurementsDataFlagsBits + int16_t svId; + GnssSvType svType; + double timeOffsetNs; + GnssMeasurementsStateMask stateMask; // bitwise OR of GnssMeasurementsStateBits + int64_t receivedSvTimeNs; + int64_t receivedSvTimeUncertaintyNs; + double carrierToNoiseDbHz; + double pseudorangeRateMps; + double pseudorangeRateUncertaintyMps; + GnssMeasurementsAdrStateMask adrStateMask; // bitwise OR of GnssMeasurementsAdrStateBits + double adrMeters; + double adrUncertaintyMeters; + float carrierFrequencyHz; + int64_t carrierCycles; + double carrierPhase; + double carrierPhaseUncertainty; + GnssMeasurementsMultipathIndicator multipathIndicator; + double signalToNoiseRatioDb; + double agcLevelDb; +} GnssMeasurementsData; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsClock) + GnssMeasurementsClockFlagsMask flags; // bitwise OR of GnssMeasurementsClockFlagsBits + int16_t leapSecond; + int64_t timeNs; + double timeUncertaintyNs; + int64_t fullBiasNs; + double biasNs; + double biasUncertaintyNs; + double driftNsps; + double driftUncertaintyNsps; + uint32_t hwClockDiscontinuityCount; +} GnssMeasurementsClock; + +typedef struct { + size_t size; // set to sizeof(GnssSvNotification) + size_t count; // number of SVs in the GnssSv array + GnssSv gnssSvs[GNSS_SV_MAX]; // information on a number of SVs +} GnssSvNotification; + +typedef struct { + size_t size; // set to sizeof(GnssNmeaNotification) + uint64_t timestamp; // timestamp + const char* nmea; // nmea text + size_t length; // length of the nmea text +} GnssNmeaNotification; + +typedef struct { + size_t size; // set to sizeof(GnssMeasurementsNotification) + size_t count; // number of items in GnssMeasurements array + GnssMeasurementsData measurements[GNSS_MEASUREMENTS_MAX]; + GnssMeasurementsClock clock; // clock +} GnssMeasurementsNotification; + +typedef struct { + size_t size; // set to sizeof(GnssConfig) + GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid + GnssConfigGpsLock gpsLock; + GnssConfigSuplVersion suplVersion; + GnssConfigSetAssistanceServer assistanceServer; + GnssConfigLppProfile lppProfile; + GnssConfigLppeControlPlaneMask lppeControlPlaneMask; + GnssConfigLppeUserPlaneMask lppeUserPlaneMask; + GnssConfigAGlonassPositionProtocolMask aGlonassPositionProtocolMask; + GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl; + GnssConfigSuplEmergencyServices suplEmergencyServices; + GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits +} GnssConfig; + +typedef struct { + size_t size; // set to sizeof + bool mValid; + Location mLocation; + double verticalAccuracyMeters; + double speedAccuracyMetersPerSecond; + double bearingAccuracyDegrees; + timespec mUtcReported; +} GnssDebugLocation; + +typedef struct { + size_t size; // set to sizeof + bool mValid; + int64_t timeEstimate; + float timeUncertaintyNs; + float frequencyUncertaintyNsPerSec; +} GnssDebugTime; + +typedef struct { + size_t size; // set to sizeof + uint32_t svid; + GnssSvType constellation; + GnssEphemerisType mEphemerisType; + GnssEphemerisSource mEphemerisSource; + GnssEphemerisHealth mEphemerisHealth; + float ephemerisAgeSeconds; + bool serverPredictionIsAvailable; + float serverPredictionAgeSeconds; +} GnssDebugSatelliteInfo; + +typedef struct { + size_t size; // set to sizeof + GnssDebugLocation mLocation; + GnssDebugTime mTime; + std::vector mSatelliteInfo; +} GnssDebugReport; + +/* Provides the capabilities of the system + capabilities callback is called once soon after createInstance is called */ +typedef std::function capabilitiesCallback; + +/* Used by tracking, batching, and miscellanous APIs + responseCallback is called for every Tracking, Batching API, and Miscellanous API */ +typedef std::function responseCallback; + +/* Used by APIs that gets more than one LocationError in it's response + collectiveResponseCallback is called for every geofence API call. + ids array and LocationError array are only valid until collectiveResponseCallback returns. */ +typedef std::function collectiveResponseCallback; + +/* Used for startTracking API, optional can be NULL + trackingCallback is called when delivering a location in a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function trackingCallback; + +/* Used for startBatching API, optional can be NULL + batchingCallback is called when delivering locations in a batching session. + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function batchingCallback; + +typedef std::function & listOfCompletedTrips +)> batchingStatusCallback; + +/* Gives GNSS Location information, optional can be NULL + gnssLocationInfoCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssLocationInfoCallback; + +/* Used for addGeofences API, optional can be NULL + geofenceBreachCallback is called when any number of geofences have a state change */ +typedef std::function geofenceBreachCallback; + +/* Used for addGeofences API, optional can be NULL + geofenceStatusCallback is called when any number of geofences have a status change */ +typedef std::function geofenceStatusCallback; + +/* Network Initiated request, optional can be NULL + This callback should be responded to by calling gnssNiResponse */ +typedef std::function gnssNiCallback; + +/* Gives GNSS SV information, optional can be NULL + gnssSvCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssSvCallback; + +/* Gives GNSS NMEA data, optional can be NULL + gnssNmeaCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssNmeaCallback; + +/* Gives GNSS Measurements information, optional can be NULL + gnssMeasurementsCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssMeasurementsCallback; + +typedef struct { + size_t size; // set to sizeof(LocationCallbacks) + capabilitiesCallback capabilitiesCb; // mandatory + responseCallback responseCb; // mandatory + collectiveResponseCallback collectiveResponseCb; // mandatory + trackingCallback trackingCb; // optional + batchingCallback batchingCb; // optional + geofenceBreachCallback geofenceBreachCb; // optional + geofenceStatusCallback geofenceStatusCb; // optional + gnssLocationInfoCallback gnssLocationInfoCb; // optional + gnssNiCallback gnssNiCb; // optional + gnssSvCallback gnssSvCb; // optional + gnssNmeaCallback gnssNmeaCb; // optional + gnssMeasurementsCallback gnssMeasurementsCb; // optional + batchingStatusCallback batchingStatusCb; // optional +} LocationCallbacks; + +#endif /* LOCATIONDATATYPES_H */ diff --git a/location/Makefile.am b/location/Makefile.am index 3688cc86..fccdf94d 100644 --- a/location/Makefile.am +++ b/location/Makefile.am @@ -26,7 +26,9 @@ liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) library_include_HEADERS = \ LocationAPI.h \ LocationAPIClientBase.h \ - location_interface.h + location_interface.h \ + LocationDataTypes.h \ + ILocationAPI.h #Create and Install libraries lib_LTLIBRARIES = liblocation_api.la From b47eea6b2373d42c5cf9153d2211fd08b9d9272a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 7 Mar 2018 10:19:24 -0800 Subject: [PATCH 624/945] GPS GNSS adapter: connectivity support for engine hub (1) allow engine hub to be able to receive connectivity status update (2) fix kw warning in LocIpc.h Change-Id: I62ac534639003051a8992c143ff273d5ff66ee5a CRs-fixed: 2198446 --- core/EngineHubProxyBase.h | 1 + gnss/GnssAdapter.cpp | 3 ++- gnss/GnssAdapter.h | 1 + utils/LocIpc.h | 6 +++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index c17b2c29..7b9f3ae8 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -101,6 +101,7 @@ typedef std::function // potential parameters: message queue: MsgTask * msgTask; // callback function to report back dr and ppe position and sv report typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, + IOsObserver* osObserver, GnssAdapterReportPositionEventCb positionEventCb, GnssAdapterReportSvEventCb svEventCb); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index a57d1a40..f996ebee 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3310,7 +3310,8 @@ GnssAdapter::initEngHubProxy() { getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); if(getter != nullptr) { - EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, reportPositionEventCb, + EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(), + reportPositionEventCb, reportSvEventCb); if (hubProxy != nullptr) { mEngHubProxy = hubProxy; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index e047f75b..c1e17545 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 8598a327..0c37a7ad 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -140,10 +140,10 @@ private: std::shared_ptr mSocket; struct sockaddr_un mDestAddr; - inline LocIpcSender( - const std::shared_ptr& mySocket, const char* destSocket) : mSocket(mySocket) { + inline LocIpcSender(const std::shared_ptr& mySocket, const char* destSocket) : + mSocket(mySocket), + mDestAddr({.sun_family = AF_UNIX, {}}) { if ((nullptr != mSocket) && (-1 != *mSocket) && (nullptr != destSocket)) { - mDestAddr.sun_family = AF_UNIX; snprintf(mDestAddr.sun_path, sizeof(mDestAddr.sun_path), "%s", destSocket); } } From 8f2e900e9e6aee5d9641b351dfffd5ca1a40ea6b Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 13 Mar 2018 09:30:43 -0700 Subject: [PATCH 625/945] fix: Typo in LocationDataTypes Fix typo in SystemTimeStructUnion definition. Change-Id: Idacfe730b4f56ae53f2c2dea72188788691da0f1 CRs-Fixed: 2206673 --- location/LocationDataTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index d03a8b4d..00cca183 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -673,7 +673,7 @@ typedef union { GnssSystemTimeStructType galSystemTime; GnssSystemTimeStructType bdsSystemTime; GnssSystemTimeStructType qzssSystemTime; - GnssGloTimeStructType gloSytemTime; + GnssGloTimeStructType gloSystemTime; } SystemTimeStructUnion; /** Time applicability of PVT report */ typedef struct { From 47d2e811e72e6fc0f3c799f3c884092ca0a67f30 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Fri, 16 Mar 2018 11:50:05 -0700 Subject: [PATCH 626/945] flp.conf should be read from /vendor/etc/ flp.conf was being read from incorrect path, which was causing GetBatchSize API to read incorrect batch size Change-Id: Ib95610e72157834fc731f35b67eb475dfe6af5a2 CRs-fixed: 2193052 Bug: 73251835 --- location/Android.mk | 3 ++- location/LocationAPIClientBase.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/location/Android.mk b/location/Android.mk index 6ac8e361..693a0cd0 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -15,7 +15,8 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libgps.utils \ libdl \ - liblog + liblog \ + libloc_pla LOCAL_SRC_FILES += \ LocationAPI.cpp \ diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 343743ad..cc9c0804 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -30,11 +30,11 @@ #define LOG_TAG "LocSvc_APIClientBase" #include +#include #include #include #include "LocationAPIClientBase.h" -#define FLP_CONF_FILE "/etc/flp.conf" #define GEOFENCE_SESSION_ID 0xFFFFFFFF #define CONFIG_SESSION_ID 0xFFFFFFFF @@ -364,7 +364,7 @@ int32_t LocationAPIClientBase::locAPIGetBatchSize() { {"BATCH_SIZE", &mBatchSize, nullptr, 'n'}, }; - UTIL_READ_CONF(FLP_CONF_FILE, flp_conf_param_table); + UTIL_READ_CONF(LOC_PATH_FLP_CONF, flp_conf_param_table); if (mBatchSize < 0) { // set mBatchSize to 0 if we got an illegal value from config file mBatchSize = 0; From 87c52f1f37b193dcb82500350e6c6efc4e41acac Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 20 Mar 2018 15:50:53 -0700 Subject: [PATCH 627/945] fix: add LOC_LOGi macro in log utility Add LOC_LOGi macro in log utility Change-Id: Ib30ce891496d61c10075cac028a80df2a6013a2a CRs-Fixed: 2209625 --- utils/log_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/log_util.h b/utils/log_util.h index 2fc04e2c..4fed90ba 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -160,6 +160,7 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #define LOC_LOG_HEAD(fmt) "%s:%d] " fmt #define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGi(fmt,...) LOC_LOGI(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) From 7f9ce9ddd07927aacf4b02333c66e381ac109bd2 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Tue, 27 Mar 2018 11:59:37 +0530 Subject: [PATCH 628/945] Add additional parameters in gps extended file Change-Id: I667b999dc164184d84aac0c5b6c1f3b2e9c761ea CRs-Fixed: 2183994 --- utils/gps_extended_c.h | 205 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 203 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index bd528d9e..57d9d517 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -105,6 +105,7 @@ typedef uint32_t LocPosTechMask; #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) +#define LOC_POS_TECH_MASK_PPE ((LocPosTechMask)0x00000100) enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, @@ -305,6 +306,30 @@ typedef uint32_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_GPS_TIME 0x20000 /** GpsLocationExtended has Extended Dilution of Precision */ #define GPS_LOCATION_EXTENDED_HAS_EXT_DOP 0x40000 +/** GpsLocationExtended has North standard deviation */ +#define GPS_LOCATION_EXTENDED_HAS_NORTH_STD_DEV 0x80000 +/** GpsLocationExtended has East standard deviation*/ +#define GPS_LOCATION_EXTENDED_HAS_EAST_STD_DEV 0x100000 +/** GpsLocationExtended has North Velocity */ +#define GPS_LOCATION_EXTENDED_HAS_NORTH_VEL 0x200000 +/** GpsLocationExtended has East Velocity */ +#define GPS_LOCATION_EXTENDED_HAS_EAST_VEL 0x400000 +/** GpsLocationExtended has up Velocity */ +#define GPS_LOCATION_EXTENDED_HAS_UP_VEL 0x800000 +/** GpsLocationExtended has North Velocity Uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC 0x1000000 +/** GpsLocationExtended has East Velocity Uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC 0x2000000 +/** GpsLocationExtended has up Velocity Uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC 0x4000000 +/** GpsLocationExtended has up Clock Bias */ +#define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS 0x8000000 +/** GpsLocationExtended has up Clock Bias std deviation*/ +#define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS_STD_DEV 0x10000000 +/** GpsLocationExtended has up Clock drift*/ +#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000 +/** GpsLocationExtended has up Clock drift std deviation**/ +#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -315,6 +340,12 @@ typedef uint32_t LocNavSolutionMask; #define LOC_NAV_MASK_SBAS_CORRECTION_LONG ((LocNavSolutionMask)0x0004) /**< Bitmask to specify whether SBAS integrity information is used */ #define LOC_NAV_MASK_SBAS_INTEGRITY ((LocNavSolutionMask)0x0008) +/**< Bitmask to specify whether Position Report is DGNSS corrected */ +#define LOC_NAV_MASK_DGNSS_CORRECTION ((LocNavSolutionMask)0x0010) +/**< Bitmask to specify whether Position Report is RTK corrected */ +#define LOC_NAV_MASK_RTK_CORRECTION ((LocNavSolutionMask)0x0020) +/**< Bitmask to specify whether Position Report is PPP corrected */ +#define LOC_NAV_MASK_PPP_CORRECTION ((LocNavSolutionMask)0x0040) typedef uint32_t LocPosDataMask; /* Bitmask to specify whether Navigation data has Forward Acceleration */ @@ -425,12 +456,123 @@ typedef struct { uint32_t gpsTimeOfWeekMs; }GPSTimeStruct; +typedef uint8_t CarrierPhaseAmbiguityType; +#define CARRIER_PHASE_AMBIGUITY_RESOLUTION_NONE ((CarrierPhaseAmbiguityType)0) +#define CARRIER_PHASE_AMBIGUITY_RESOLUTION_FLOAT ((CarrierPhaseAmbiguityType)1) +#define CARRIER_PHASE_AMBIGUITY_RESOLUTION_FIXED ((CarrierPhaseAmbiguityType)2) + +/** GNSS Signal Type and RF Band */ +typedef uint32_t GnssSignalTypeMask; +/** GPS L1CA Signal */ +#define GNSS_SIGNAL_GPS_L1CA ((GnssSignalTypeMask)0x00000001ul) +/** GPS L1C Signal */ +#define GNSS_SIGNAL_GPS_L1C ((GnssSignalTypeMask)0x00000002ul) +/** GPS L2 RF Band */ +#define GNSS_SIGNAL_GPS_L2 ((GnssSignalTypeMask)0x00000004ul) +/** GPS L5 RF Band */ +#define GNSS_SIGNAL_GPS_L5 ((GnssSignalTypeMask)0x00000008ul) +/** GLONASS G1 (L1OF) RF Band */ +#define GNSS_SIGNAL_GLONASS_G1 ((GnssSignalTypeMask)0x00000010ul) +/** GLONASS G2 (L2OF) RF Band */ +#define GNSS_SIGNAL_GLONASS_G2 ((GnssSignalTypeMask)0x00000020ul) +/** GALILEO E1 RF Band */ +#define GNSS_SIGNAL_GALILEO_E1 ((GnssSignalTypeMask)0x00000040ul) +/** GALILEO E5A RF Band */ +#define GNSS_SIGNAL_GALILEO_E5A ((GnssSignalTypeMask)0x00000080ul) +/** GALILEO E5B RF Band */ +#define GNSS_SIGNAL_GALILIEO_E5B ((GnssSignalTypeMask)0x00000100ul) +/** BEIDOU B1 RF Band */ +#define GNSS_SIGNAL_BEIDOU_B1 ((GnssSignalTypeMask)0x00000200ul) +/** BEIDOU B2 RF Band */ +#define GNSS_SIGNAL_BEIDOU_B2 ((GnssSignalTypeMask)0x00000400ul) +/** QZSS L1CA RF Band */ +#define GNSS_SIGNAL_QZSS_L1CA ((GnssSignalTypeMask)0x00000800ul) +/** QZSS L1S RF Band */ +#define GNSS_SIGNAL_QZSS_L1S ((GnssSignalTypeMask)0x00001000ul) +/** QZSS L2 RF Band */ +#define GNSS_SIGNAL_QZSS_L2 ((GnssSignalTypeMask)0x00002000ul) +/** QZSS L5 RF Band */ +#define GNSS_SIGNAL_QZSS_L5 ((GnssSignalTypeMask)0x00004000ul) +/** SBAS L1 RF Band */ +#define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00008000ul) + +typedef uint16_t GnssMeasUsageStatusBitMask; +/** Used in fix */ +#define GNSS_MEAS_USED_IN_PVT ((GnssMeasUsageStatusBitMask)0x00000001ul) +/** Measurement is Bad */ +#define GNSS_MEAS_USAGE_STATUS_BAD_MEAS ((GnssMeasUsageStatusBitMask)0x00000002ul) +/** Measurement has too low C/N */ +#define GNSS_MEAS_USAGE_STATUS_CNO_TOO_LOW ((GnssMeasUsageStatusBitMask)0x00000004ul) +/** Measurement has too low elevation */ +#define GNSS_MEAS_USAGE_STATUS_ELEVATION_TOO_LOW ((GnssMeasUsageStatusBitMask)0x00000008ul) +/** No ephemeris available for this measurement */ +#define GNSS_MEAS_USAGE_STATUS_NO_EPHEMERIS ((GnssMeasUsageStatusBitMask)0x00000010ul) +/** No corrections available for the measurement */ +#define GNSS_MEAS_USAGE_STATUS_NO_CORRECTIONS ((GnssMeasUsageStatusBitMask)0x00000020ul) +/** Corrections has timed out for the measurement */ +#define GNSS_MEAS_USAGE_STATUS_CORRECTION_TIMEOUT ((GnssMeasUsageStatusBitMask)0x00000040ul) +/** Measurement is unhealthy */ +#define GNSS_MEAS_USAGE_STATUS_UNHEALTHY ((GnssMeasUsageStatusBitMask)0x00000080ul) +/** Configuration is disabled for this measurement */ +#define GNSS_MEAS_USAGE_STATUS_CONFIG_DISABLED ((GnssMeasUsageStatusBitMask)0x00000100ul) +/** Measurement not used for other reasons */ +#define GNSS_MEAS_USAGE_STATUS_OTHER ((GnssMeasUsageStatusBitMask)0x00000200ul) + +/** Flags to indicate valid fields in epMeasUsageInfo */ +typedef uint16_t GnssMeasUsageInfoValidityMask; +#define GNSS_PSEUDO_RANGE_RESIDUAL_VALID ((GnssMeasUsageInfoValidityMask)0x00000001ul) +#define GNSS_DOPPLER_RESIDUAL_VALID ((GnssMeasUsageInfoValidityMask)0x00000002ul) +#define GNSS_CARRIER_PHASE_RESIDUAL_VALID ((GnssMeasUsageInfoValidityMask)0x00000004ul) +#define GNSS_CARRIER_PHASE_AMBIGUITY_TYPE_VALID ((GnssMeasUsageInfoValidityMask)0x00000008ul) + +typedef struct { + /** Specifies GNSS signal type + Mandatory Field*/ + GnssSignalTypeMask gnssSignalType; + /** Specifies GNSS Constellation Type + Mandatory Field*/ + Gnss_LocSvSystemEnumType gnssConstellation; + /** GNSS SV ID. + For GPS: 1 to 32 + For GLONASS: 65 to 96. When slot-number to SV ID mapping is unknown, set as 255. + For SBAS: 120 to 151 + For QZSS-L1CA:193 to 197 + For BDS: 201 to 237 + For GAL: 301 to 336 */ + uint16_t gnssSvId; + /** GLONASS frequency number + 7. + Valid only for a GLONASS system and + is to be ignored for all other systems. + Range: 1 to 14 */ + uint8_t gloFrequency; + /** Carrier phase ambiguity type. */ + CarrierPhaseAmbiguityType carrierPhaseAmbiguityType; + /** Validity mask */ + GnssMeasUsageStatusBitMask measUsageStatusMask; + /** Specifies measurement usage status + Mandatory Field*/ + GnssMeasUsageInfoValidityMask validityMask; + /** Computed pseudorange residual. + Unit: Meters */ + float pseudorangeResidual; + /** Computed doppler residual. + Unit: Meters/sec*/ + float dopplerResidual; + /** Computed carrier phase residual. + Unit: Cycles*/ + float carrierPhaseResidual; + /** Carrier phase ambiguity value. + Unit: Cycles*/ + float carrierPhasAmbiguity; +} GpsMeasUsageInfo; + + /** Represents gps location extended. */ typedef struct { /** set to sizeof(GpsLocationExtended) */ size_t size; /** Contains GpsLocationExtendedFlags bits. */ - uint32_t flags; + uint64_t flags; /** Contains the Altitude wrt mean sea level */ float altitudeMeanSeaLevel; /** Contains Position Dilusion of Precision. */ @@ -471,8 +613,52 @@ typedef struct { LocPositionDynamics bodyFrameData; /** GPS Time */ GPSTimeStruct gpsTime; + GnssSystemTime gnssSystemTime; /** Dilution of precision associated with this position*/ LocExtDOP extDOP; + /** North standard deviation. + Unit: Meters */ + float northStdDeviation; + /** East standard deviation. + Unit: Meters */ + float eastStdDeviation; + /** North Velocity. + Unit: Meters/sec */ + float northVelocity; + /** East Velocity. + Unit: Meters/sec */ + float eastVelocity; + /** Up Velocity. + Unit: Meters/sec */ + float upVelocity; + /** North Velocity standard deviation. + Unit: Meters/sec */ + float northVelocityStdDeviation; + /** East Velocity standard deviation. + Unit: Meters/sec */ + float eastVelocityStdDeviation; + /** Up Velocity standard deviation + Unit: Meters/sec */ + float upVelocityStdDeviation; + /** Estimated clock bias. Unit: Nano seconds */ + float clockbiasMeter; + /** Estimated clock bias std deviation. Unit: Nano seconds */ + float clockBiasStdDeviationMeter; + /** Estimated clock drift. Unit: Meters/sec */ + float clockDrift; + /** Estimated clock drift std deviation. Unit: Meters/sec */ + float clockDriftStdDeviation; + /** Number of valid reference stations. Range:[0-4] */ + uint8_t numValidRefStations; + /** Reference station(s) number */ + uint16_t referenceStation[4]; + /** Number of measurements received for use in fix. + Shall be used as maximum index in-to svUsageInfo[]. + Set to 0, if svUsageInfo reporting is not supported. + Range: 0-EP_GNSS_MAX_MEAS */ + uint8_t numOfMeasReceived; + /** Measurement Usage Information */ + GpsMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; } GpsLocationExtended; enum loc_sess_status { @@ -955,7 +1141,6 @@ typedef enum /**< SV is being tracked */ }Gnss_LocSvSearchStatusEnumT; - typedef struct { size_t size; @@ -1080,6 +1265,19 @@ typedef struct /**< Satellite Elevation - Units: radians \n */ + uint64_t validMeasStatusMask; + /**< Bitmask indicating SV measurement status Validity. + Valid bitmasks: \n + If any MSB bit in 0xFFC0000000000000 DONT_USE is set, the measurement + must not be used by the client. + @MASK() + */ + bool carrierPhaseUncValid; + /**< Validity flag for SV direction */ + + float carrierPhaseUnc; + + } Gnss_SVMeasurementStructType; /**< Maximum number of satellites in measurement block for given system. */ @@ -1141,6 +1339,9 @@ typedef struct bool gnssMeasValid; Gnss_ClockMeasurementStructType gnssMeas; Gnss_ApTimeStampStructType timeStamp; + /* Extended Time Information - Cumulative Number of Clock Resets */ + uint8_t numClockResets_valid; /**< Must be set to true if numClockResets is being passed */ + uint32_t numClockResets; } GnssSvMeasurementSet; From 6530ba80ad184259b0edc3c81d52e48e1259d8af Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Fri, 30 Mar 2018 14:08:29 +0530 Subject: [PATCH 629/945] update uptimeMillis to get boot time Change-Id: I0f0c8235898e33ed6cee69d7d4c5a1e9b199c835 CRs-Fixed: 2209099 --- pla/oe/loc_pla.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 50b19c2f..094e3f33 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -31,7 +31,18 @@ #ifdef __cplusplus #include -#define uptimeMillis android::uptimeMillis +#include +#include + +inline int64_t uptimeMillis() +{ + struct timespec ts; + int64_t time_ms = 0; + clock_gettime(CLOCK_BOOTTIME, &ts); + time_ms += (ts.tv_sec * 1000000000LL); + time_ms += ts.tv_nsec + 500000LL; + return time_ms / 1000000LL; +} extern "C" { #endif From 47fa2c06fa13e610d6df472b9fa39e22966a5630 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Mon, 26 Mar 2018 20:46:47 -0700 Subject: [PATCH 630/945] Add location client api sockets' strings Add location client api socket path string definitions in utils/gps_extended_c.h. CRs-Fixed: 2196048 Change-Id: Ie2eea05dfe440fa3a96b531fa4ba17605ab53431 --- utils/gps_extended_c.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 57d9d517..1a54278e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1489,8 +1489,15 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); /* Shared resources of LocIpc */ -#define LOC_IPC_HAL "/dev/socket/location/socket_hal" -#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" +#define LOC_IPC_HAL "/dev/socket/location/socket_hal" +#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" + +#define SOCKET_DIR_LOCATION "/dev/socket/location/" +#define SOCKET_DIR_EHUB "/dev/socket/location/ehub" +#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" + +#define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" +#define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" #ifdef __cplusplus } From 82d0efd99ae4aa5643d6fa844f44c850fa008cc5 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 15 Mar 2018 11:42:15 +0530 Subject: [PATCH 631/945] Map additional fields in GpsLocationExtended Map velocity and system time fields from GpsLocationExtended to GnssLocationInfoNotification Change-Id: If53575213de575ad71b68018beb8c3f5fd587bcf CRs-fixed: 2184592 --- gnss/GnssAdapter.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f996ebee..dca3d0f9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -367,6 +367,35 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate; out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch; } + if (GPS_LOCATION_EXTENDED_HAS_GPS_TIME & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_GPS_TIME; + out.gnssSystemTime.gnssSystemTimeSrc = locationExtended.gnssSystemTime.gnssSystemTimeSrc; + out.gnssSystemTime.u = locationExtended.gnssSystemTime.u; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_NORTH_VEL; + out.northVelocity = locationExtended.northVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_EAST_VEL; + out.eastVelocity = locationExtended.eastVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_UP_VEL; + out.upVelocity = locationExtended.upVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC; + out.northVelocityStdDeviation = locationExtended.northVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC; + out.eastVelocityStdDeviation = locationExtended.eastVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC & locationExtended.flags) { + out.flags |= GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC; + out.upVelocityStdDeviation = locationExtended.upVelocityStdDeviation; + } } inline uint32_t From d856a9414d745634c9dff7650a4d3dc48b8563f0 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Mon, 8 Jan 2018 16:21:29 +0800 Subject: [PATCH 632/945] hidl gnss hal 1.1 implementation Implement new apis for IGnss 1.1 Change-Id: I2c98c32355f6d9681d51b709697e49ec735fe1cf CRs-fixed: 2133458 --- android/AGnss.cpp | 6 +- android/AGnss.h | 6 +- android/AGnssRil.cpp | 6 +- android/AGnssRil.h | 6 +- android/Android.mk | 14 ++- android/Gnss.cpp | 112 +++++++++++++++--- android/Gnss.h | 71 +++++------ android/GnssBatching.cpp | 6 +- android/GnssBatching.h | 6 +- android/GnssConfiguration.cpp | 14 ++- android/GnssConfiguration.h | 14 ++- android/GnssDebug.cpp | 55 +++++++-- android/GnssDebug.h | 4 +- android/GnssGeofencing.cpp | 6 +- android/GnssGeofencing.h | 6 +- android/GnssMeasurement.cpp | 42 ++++++- android/GnssMeasurement.h | 25 ++-- android/GnssNi.cpp | 6 +- android/GnssNi.h | 6 +- ... android.hardware.gnss@1.1-service-qti.rc} | 2 +- android/location_api/BatchingAPIClient.cpp | 13 +- android/location_api/BatchingAPIClient.h | 14 +-- android/location_api/GeofenceAPIClient.cpp | 10 +- android/location_api/GeofenceAPIClient.h | 10 +- android/location_api/GnssAPIClient.cpp | 25 ++-- android/location_api/GnssAPIClient.h | 32 ++--- android/location_api/LocationUtil.cpp | 12 +- android/location_api/LocationUtil.h | 10 +- android/location_api/MeasurementAPIClient.cpp | 74 ++++++++++-- android/location_api/MeasurementAPIClient.h | 20 ++-- android/service.cpp | 8 +- core/Android.mk | 3 +- gnss/Android.mk | 3 +- gnss/GnssAdapter.cpp | 3 + location/Android.mk | 3 +- utils/Android.mk | 3 +- 36 files changed, 444 insertions(+), 212 deletions(-) rename android/{android.hardware.gnss@1.0-service-qti.rc => android.hardware.gnss@1.1-service-qti.rc} (50%) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index 6213a083..2f7d38db 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { sp AGnss::sAGnssCbIface = nullptr; @@ -182,7 +182,7 @@ Return AGnss::setServer(IAGnssCallback::AGnssType type, } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/AGnss.h b/android/AGnss.h index a3f4a87b..464d87ee 100644 --- a/android/AGnss.h +++ b/android/AGnss.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IAGnss; @@ -69,7 +69,7 @@ struct AGnss : public IAGnss { }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/AGnssRil.cpp b/android/AGnssRil.cpp index d790bae9..10478aab 100644 --- a/android/AGnssRil.cpp +++ b/android/AGnssRil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -36,7 +36,7 @@ typedef void* (getLocationInterface)(); namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { @@ -87,7 +87,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/AGnssRil.h b/android/AGnssRil.h index 61216d8f..5c9298a0 100644 --- a/android/AGnssRil.h +++ b/android/AGnssRil.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IAGnssRil; @@ -75,7 +75,7 @@ struct AGnssRil : public IAGnssRil { }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/Android.mk b/android/Android.mk index 46e23884..4f1cdf25 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,9 +1,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ AGnss.cpp \ @@ -36,8 +35,10 @@ LOCAL_SHARED_LIBRARIES := \ libhidlbase \ libhidltransport \ libhwbinder \ + libcutils \ libutils \ android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ LOCAL_SHARED_LIBRARIES += \ libloc_core \ @@ -57,10 +58,10 @@ endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.0-service-qti -LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) +LOCAL_MODULE := android.hardware.gnss@1.1-service-qti +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc +LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc LOCAL_SRC_FILES := \ service.cpp \ @@ -85,6 +86,7 @@ LOCAL_SHARED_LIBRARIES += \ libhidlbase \ libhidltransport \ android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index e3fd64ee..878cd202 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -20,17 +20,59 @@ #define LOG_TAG "LocSvc_GnssInterface" +#include #include #include +#include #include "Gnss.h" typedef void* (getLocationInterface)(); +#define IMAGES_INFO_FILE "/sys/devices/soc0/images" +#define DELIMITER ";" + namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +static std::string getVersionString() { + static std::string version; + if (!version.empty()) + return version; + + char value[PROPERTY_VALUE_MAX] = {0}; + property_get("ro.hardware", value, "unknown"); + version.append(value).append(DELIMITER); + + std::ifstream in(IMAGES_INFO_FILE); + std::string s; + while(getline(in, s)) { + std::size_t found = s.find("CRM:"); + if (std::string::npos == found) { + continue; + } + + // skip over space characters after "CRM:" + const char* substr = s.c_str(); + found += 4; + while (0 != substr[found] && isspace(substr[found])) { + found++; + } + if (s.find("11:") != found) { + continue; + } + s.erase(0, found + 3); + + found = s.find_first_of("\r\n"); + if (std::string::npos != found) { + s.erase(s.begin() + found, s.end()); + } + version.append(s).append(DELIMITER); + } + return version; +} + void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { LOC_LOGE("%s] service died. cookie: %llu, who: %p", __FUNCTION__, static_cast(cookie), &who); @@ -107,7 +149,7 @@ GnssInterface* Gnss::getGnssInterface() { return mGnssInterface; } -Return Gnss::setCallback(const sp& callback) { +Return Gnss::setCallback(const sp& callback) { ENTRY_LOG_CALLFLOW(); if (mGnssCbIface != nullptr) { mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); @@ -251,7 +293,7 @@ Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, } } -Return Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) { +Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) { ENTRY_LOG_CALLFLOW(); GnssAPIClient* api = getApi(); if (api) { @@ -260,8 +302,8 @@ Return Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) { return Void(); } -Return Gnss::setPositionMode(IGnss::GnssPositionMode mode, - IGnss::GnssPositionRecurrence recurrence, +Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) { @@ -275,52 +317,90 @@ Return Gnss::setPositionMode(IGnss::GnssPositionMode mode, return retVal; } -Return> Gnss::getExtensionAGnss() { +Return> Gnss::getExtensionAGnss() { ENTRY_LOG_CALLFLOW(); mAGnssIface = new AGnss(this); return mAGnssIface; } -Return> Gnss::getExtensionGnssNi() { +Return> Gnss::getExtensionGnssNi() { ENTRY_LOG_CALLFLOW(); mGnssNi = new GnssNi(this); return mGnssNi; } -Return> Gnss::getExtensionGnssMeasurement() { +Return> Gnss::getExtensionGnssMeasurement() { ENTRY_LOG_CALLFLOW(); - mGnssMeasurement = new GnssMeasurement(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); return mGnssMeasurement; } -Return> Gnss::getExtensionGnssConfiguration() { +Return> Gnss::getExtensionGnssConfiguration() { ENTRY_LOG_CALLFLOW(); mGnssConfig = new GnssConfiguration(this); return mGnssConfig; } -Return> Gnss::getExtensionGnssGeofencing() { +Return> Gnss::getExtensionGnssGeofencing() { ENTRY_LOG_CALLFLOW(); mGnssGeofencingIface = new GnssGeofencing(); return mGnssGeofencingIface; } -Return> Gnss::getExtensionGnssBatching() { +Return> Gnss::getExtensionGnssBatching() { mGnssBatching = new GnssBatching(); return mGnssBatching; } -Return> Gnss::getExtensionGnssDebug() { +Return> Gnss::getExtensionGnssDebug() { ENTRY_LOG_CALLFLOW(); mGnssDebug = new GnssDebug(this); return mGnssDebug; } -Return> Gnss::getExtensionAGnssRil() { +Return> Gnss::getExtensionAGnssRil() { mGnssRil = new AGnssRil(this); return mGnssRil; } +// Methods from ::android::hardware::gnss::V1_1::IGnss follow. +Return Gnss::setCallback_1_1(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + callback->gnssNameCb(getVersionString()); + return setCallback(callback); +} + +Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, + bool /*lowPowerMode*/) { + ENTRY_LOG_CALLFLOW(); + return setPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs); +} + +Return> Gnss::getExtensionGnssMeasurement_1_1() { + ENTRY_LOG_CALLFLOW(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} + +Return> Gnss::getExtensionGnssConfiguration_1_1() { + ENTRY_LOG_CALLFLOW(); + if (mGnssConfig == nullptr) + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} + +Return Gnss::injectBestLocation(const GnssLocation&) { + ENTRY_LOG_CALLFLOW(); + return true; +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; @@ -332,7 +412,7 @@ IGnss* HIDL_FETCH_IGnss(const char* hal) { } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/Gnss.h b/android/Gnss.h index e4589d60..c562b1fb 100644 --- a/android/Gnss.h +++ b/android/Gnss.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018-2018-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -30,7 +30,8 @@ #include #include -#include +#include +#include #include #include @@ -39,37 +40,27 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using ::android::hardware::hidl_vec; -using ::android::hardware::hidl_string; using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; struct Gnss : public IGnss { Gnss(); ~Gnss(); - // registerAsService will call interfaceChain to determine the version of service - /* comment this out until we know really how to manipulate hidl version - using interfaceChain_cb = std::function< - void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>; - virtual ::android::hardware::Return interfaceChain(interfaceChain_cb _hidl_cb) override { - _hidl_cb({ - "android.hardware.gnss@1.1::IGnss", - ::android::hidl::base::V1_0::IBase::descriptor, - }); - return ::android::hardware::Void(); - } - */ - /* * Methods from ::android::hardware::gnss::V1_0::IGnss follow. * These declarations were generated from Gnss.hal. */ - Return setCallback(const sp& callback) override; + Return setCallback(const sp& callback) override; Return start() override; Return stop() override; Return cleanup() override; @@ -79,30 +70,40 @@ struct Gnss : public IGnss { Return injectTime(int64_t timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs) override; - Return deleteAidingData(IGnss::GnssAidingData aidingDataFlags) override; - Return setPositionMode(IGnss::GnssPositionMode mode, - IGnss::GnssPositionRecurrence recurrence, + Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override; + Return setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) override; - Return> getExtensionAGnss() override; - Return> getExtensionGnssNi() override; - Return> getExtensionGnssMeasurement() override; - Return> getExtensionGnssConfiguration() override; - Return> getExtensionGnssGeofencing() override; - Return> getExtensionGnssBatching() override; + Return> getExtensionAGnss() override; + Return> getExtensionGnssNi() override; + Return> getExtensionGnssMeasurement() override; + Return> getExtensionGnssConfiguration() override; + Return> getExtensionGnssGeofencing() override; + Return> getExtensionGnssBatching() override; - Return> getExtensionAGnssRil() override; + Return> getExtensionAGnssRil() override; - inline Return> getExtensionGnssNavigationMessage() override { + inline Return> getExtensionGnssNavigationMessage() override { return nullptr; } - inline Return> getExtensionXtra() override { + inline Return> getExtensionXtra() override { return nullptr; } - Return> getExtensionGnssDebug() override; + Return> getExtensionGnssDebug() override; + + // Methods from ::android::hardware::gnss::V1_1::IGnss follow. + Return setCallback_1_1(const sp& callback) override; + Return setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, bool lowPowerMode) override; + Return> getExtensionGnssMeasurement_1_1() override; + Return> getExtensionGnssConfiguration_1_1() override; + Return injectBestLocation(const GnssLocation& location) override; // These methods are not part of the IGnss base class. GnssAPIClient* getApi(); @@ -132,8 +133,8 @@ struct Gnss : public IGnss { sp mGnssRil = nullptr; GnssAPIClient* mApi = nullptr; - sp mGnssCbIface = nullptr; - sp mGnssNiCbIface = nullptr; + sp mGnssCbIface = nullptr; + sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; GnssInterface* mGnssInterface = nullptr; }; @@ -141,7 +142,7 @@ struct Gnss : public IGnss { extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssBatching.cpp b/android/GnssBatching.cpp index 6ffadc95..9701affe 100644 --- a/android/GnssBatching.cpp +++ b/android/GnssBatching.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { void GnssBatching::GnssBatchingDeathRecipient::serviceDied( @@ -124,7 +124,7 @@ Return GnssBatching::cleanup() { } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssBatching.h b/android/GnssBatching.h index de5d5c37..8e235d85 100644 --- a/android/GnssBatching.h +++ b/android/GnssBatching.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssBatching; @@ -72,7 +72,7 @@ struct GnssBatching : public IGnssBatching { }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index 51ee8926..9eeceac2 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { @@ -220,8 +220,16 @@ Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { return mGnss->updateConfiguration(config); } +// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. +Return GnssConfiguration::setBlacklist( + const hidl_vec& /*blacklist*/) { + + ENTRY_LOG_CALLFLOW(); + return true; +} + } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssConfiguration.h b/android/GnssConfiguration.h index f9ea4235..f46f6071 100644 --- a/android/GnssConfiguration.h +++ b/android/GnssConfiguration.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ @@ -22,16 +22,16 @@ #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H #define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H -#include +#include #include namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssConfiguration; +using ::android::hardware::gnss::V1_1::IGnssConfiguration; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -58,12 +58,16 @@ struct GnssConfiguration : public IGnssConfiguration { Return setEmergencySuplPdn(bool enable) override; Return setGpsLock(uint8_t lock) override; + // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. + Return setBlacklist( + const hidl_vec& blacklist) override; + private: Gnss* mGnss = nullptr; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 3d2b8bda..45cde6be 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -25,13 +25,19 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::hidl_vec; -#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT -#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000) +#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000) +#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500) +#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) + +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) { @@ -79,16 +85,35 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; - struct timespec tv_now; - clock_gettime(CLOCK_MONOTONIC, &tv_now); + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; + gettimeofday(&tv_now, NULL); data.position.ageSeconds = - (tv_now.tv_sec - reports.mLocation.mUtcReported.tv_sec) + - (float)((tv_now.tv_nsec - reports.mLocation.mUtcReported.tv_nsec)) / 1000000000LL; + (tv_now.tv_sec - tv_report.tv_sec) + + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; } else { data.position.valid = false; } + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + // time block if (reports.mTime.mValid) { data.time.timeEstimate = reports.mTime.timeEstimate; @@ -96,10 +121,18 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.time.frequencyUncertaintyNsPerSec = reports.mTime.frequencyUncertaintyNsPerSec; } - else { + + if (data.time.timeEstimate <= 0 || + data.time.timeEstimate > GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; - data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC); - data.time.frequencyUncertaintyNsPerSec = 0; + } + if (data.time.timeUncertaintyNs <= 0 || + data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + } + if (data.time.frequencyUncertaintyNsPerSec <= 0 || + data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { + data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC; } // satellite data block @@ -135,7 +168,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssDebug.h b/android/GnssDebug.h index 7d29131e..cb818ac2 100644 --- a/android/GnssDebug.h +++ b/android/GnssDebug.h @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssDebug; @@ -51,7 +51,7 @@ private: }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssGeofencing.cpp b/android/GnssGeofencing.cpp index 035a092f..5c11afe0 100644 --- a/android/GnssGeofencing.cpp +++ b/android/GnssGeofencing.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied( @@ -135,7 +135,7 @@ Return GnssGeofencing::removeAllGeofences() { } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssGeofencing.h b/android/GnssGeofencing.h index 7af5f91c..94a73dea 100644 --- a/android/GnssGeofencing.h +++ b/android/GnssGeofencing.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; @@ -83,7 +83,7 @@ struct GnssGeofencing : public IGnssGeofencing { }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssMeasurement.cpp b/android/GnssMeasurement.cpp index 8cbfabdf..2578a853 100644 --- a/android/GnssMeasurement.cpp +++ b/android/GnssMeasurement.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( @@ -52,8 +52,9 @@ GnssMeasurement::~GnssMeasurement() { } // Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. + Return GnssMeasurement::setCallback( - const sp& callback) { + const sp& callback) { Return ret = IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; @@ -72,9 +73,10 @@ Return GnssMeasurement::setCallback( } mGnssMeasurementCbIface = callback; - mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/); + mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0); return mApi->measurementSetCallback(callback); + } Return GnssMeasurement::close() { @@ -87,13 +89,43 @@ Return GnssMeasurement::close() { mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); mGnssMeasurementCbIface = nullptr; } + if (mGnssMeasurementCbIface_1_1 != nullptr) { + mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface_1_1 = nullptr; + } mApi->measurementClose(); return Void(); } +// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. +Return GnssMeasurement::setCallback_1_1( + const sp& callback, bool /*enableFullTracking*/) { + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface_1_1 != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface_1_1 = callback; + mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0); + + return mApi->measurementSetCallback_1_1(callback); +} + } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssMeasurement.h b/android/GnssMeasurement.h index 5073169f..373f0d00 100644 --- a/android/GnssMeasurement.h +++ b/android/GnssMeasurement.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -21,17 +21,18 @@ #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H #define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H -#include +#include +#include #include namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssMeasurement; -using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; +using ::android::hardware::gnss::V1_1::IGnssMeasurement; +using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -47,10 +48,15 @@ struct GnssMeasurement : public IGnssMeasurement { * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. * These declarations were generated from IGnssMeasurement.hal. */ - Return setCallback( - const sp& callback) override; + Return setCallback( + const sp& callback) override; Return close() override; + // Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. + Return setCallback_1_1( + const sp& callback, + bool enableFullTracking) override; + private: struct GnssMeasurementDeathRecipient : hidl_death_recipient { GnssMeasurementDeathRecipient(sp gnssMeasurement) : @@ -63,12 +69,13 @@ struct GnssMeasurement : public IGnssMeasurement { private: sp mGnssMeasurementDeathRecipient = nullptr; - sp mGnssMeasurementCbIface = nullptr; + sp mGnssMeasurementCbIface = nullptr; + sp mGnssMeasurementCbIface_1_1 = nullptr; MeasurementAPIClient* mApi; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssNi.cpp b/android/GnssNi.cpp index 4437932a..5ce95695 100644 --- a/android/GnssNi.cpp +++ b/android/GnssNi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { @@ -79,7 +79,7 @@ Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseT } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/GnssNi.h b/android/GnssNi.h index f6fe0bb4..6733e5b4 100644 --- a/android/GnssNi.h +++ b/android/GnssNi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssNi; @@ -67,7 +67,7 @@ struct GnssNi : public IGnssNi { }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/android.hardware.gnss@1.0-service-qti.rc b/android/android.hardware.gnss@1.1-service-qti.rc similarity index 50% rename from android/android.hardware.gnss@1.0-service-qti.rc rename to android/android.hardware.gnss@1.1-service-qti.rc index b5da6f97..41b105b9 100644 --- a/android/android.hardware.gnss@1.0-service-qti.rc +++ b/android/android.hardware.gnss@1.1-service-qti.rc @@ -1,4 +1,4 @@ -service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti +service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti class hal user gps group system gps radio diff --git a/android/location_api/BatchingAPIClient.cpp b/android/location_api/BatchingAPIClient.cpp index 43fed5c7..82a803f8 100644 --- a/android/location_api/BatchingAPIClient.cpp +++ b/android/location_api/BatchingAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -42,9 +42,13 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, LocationCapabilitiesMask mask); @@ -153,7 +157,8 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa mLocationCapabilitiesMask = capabilitiesMask; } -void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions /*batchOptions*/) +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, + BatchingOptions /*batchOptions*/) { LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); if (mGnssBatchingCbIface != nullptr && count > 0) { @@ -185,7 +190,7 @@ static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/BatchingAPIClient.h b/android/location_api/BatchingAPIClient.h index 61e20770..64d47a01 100644 --- a/android/location_api/BatchingAPIClient.h +++ b/android/location_api/BatchingAPIClient.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -39,17 +39,17 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { class BatchingAPIClient : public LocationAPIClientBase { public: - BatchingAPIClient(const sp& callback); + BatchingAPIClient(const sp& callback); ~BatchingAPIClient(); int getBatchSize(); - int startSession(const IGnssBatching::Options& options); - int updateSessionOptions(const IGnssBatching::Options& options); + int startSession(const V1_0::IGnssBatching::Options& options); + int updateSessionOptions(const V1_0::IGnssBatching::Options& options); int stopSession(); void getBatchedLocation(int last_n_locations); void flushBatchedLocations(); @@ -61,13 +61,13 @@ public: void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; private: - sp mGnssBatchingCbIface; + sp mGnssBatchingCbIface; uint32_t mDefaultId; LocationCapabilitiesMask mLocationCapabilitiesMask; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/location_api/GeofenceAPIClient.cpp index 61671771..93d175ee 100644 --- a/android/location_api/GeofenceAPIClient.cpp +++ b/android/location_api/GeofenceAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -39,9 +39,11 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; GeofenceAPIClient::GeofenceAPIClient(const sp& callback) : LocationAPIClientBase(), @@ -158,7 +160,7 @@ void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBr auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb( geofenceBreachNotification.ids[i], gnssLocation, transition, - static_cast(geofenceBreachNotification.timestamp)); + static_cast(geofenceBreachNotification.timestamp)); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s", __func__, r.description().c_str()); @@ -267,7 +269,7 @@ void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/GeofenceAPIClient.h b/android/location_api/GeofenceAPIClient.h index f779bcbc..c74a59a3 100644 --- a/android/location_api/GeofenceAPIClient.h +++ b/android/location_api/GeofenceAPIClient.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -37,7 +37,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::sp; @@ -45,7 +45,7 @@ using ::android::sp; class GeofenceAPIClient : public LocationAPIClientBase { public: - GeofenceAPIClient(const sp& callback); + GeofenceAPIClient(const sp& callback); virtual ~GeofenceAPIClient() = default; void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, @@ -65,11 +65,11 @@ public: void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; private: - sp mGnssGeofencingCbIface; + sp mGnssGeofencingCbIface; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index fac5d0b3..4fcc8683 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -40,9 +40,14 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::IGnss; +using ::android::hardware::gnss::V1_0::IGnssCallback; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); GnssAPIClient::GnssAPIClient(const sp& gpsCb, @@ -414,11 +419,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio notificationGnss.notificationIdEncoding = IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; - auto r = gnssNiCbIface->niNotifyCb(notificationGnss); - if (!r.isOk()) { - LOC_LOGE("%s] Error from niNotifyCb description=%s", - __func__, r.description().c_str()); - } + gnssNiCbIface->niNotifyCb(notificationGnss); } void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) @@ -449,7 +450,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) android::hardware::hidl_string nmeaString; nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); auto r = gnssCbIface->gnssNmeaCb( - static_cast(gnssNmeaNotification.timestamp), nmeaString); + static_cast(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); @@ -503,10 +504,10 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta { memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); out.numSvs = in.count; - if (out.numSvs > static_cast(GnssMax::SVS_COUNT)) { + if (out.numSvs > static_cast(V1_0::GnssMax::SVS_COUNT)) { LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", - __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT); - out.numSvs = static_cast(GnssMax::SVS_COUNT); + __FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT); + out.numSvs = static_cast(V1_0::GnssMax::SVS_COUNT); } for (size_t i = 0; i < out.numSvs; i++) { IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; @@ -526,7 +527,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/GnssAPIClient.h b/android/location_api/GnssAPIClient.h index b5cffb1e..1589f396 100644 --- a/android/location_api/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -30,16 +30,17 @@ #ifndef GNSS_API_CLINET_H #define GNSS_API_CLINET_H + #include -#include -#include +#include +#include #include #include namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { using ::android::sp; @@ -47,28 +48,28 @@ using ::android::sp; class GnssAPIClient : public LocationAPIClientBase { public: - GnssAPIClient(const sp& gpsCb, - const sp& niCb); + GnssAPIClient(const sp& gpsCb, + const sp& niCb); virtual ~GnssAPIClient(); GnssAPIClient(const GnssAPIClient&) = delete; GnssAPIClient& operator=(const GnssAPIClient&) = delete; // for GpsInterface - void gnssUpdateCallbacks(const sp& gpsCb, - const sp& niCb); + void gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb); bool gnssStart(); bool gnssStop(); - bool gnssSetPositionMode(IGnss::GnssPositionMode mode, - IGnss::GnssPositionRecurrence recurrence, + bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs); // for GpsNiInterface - void gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse); + void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse); // these apis using LocationAPIControlClient - void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags); + void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags); void gnssEnable(LocationTechnologyType techType); void gnssDisable(); void gnssConfigurationUpdate(const GnssConfig& gnssConfig); @@ -89,17 +90,18 @@ public: void onStopTrackingCb(LocationError error) final; private: - sp mGnssCbIface; - sp mGnssNiCbIface; + sp mGnssCbIface; + sp mGnssNiCbIface; std::mutex mMutex; LocationAPIControlClient* mControlClient; LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; + LocationOptions mLocationOptions; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp index 311c0b2c..7f3a74bc 100644 --- a/android/location_api/LocationUtil.cpp +++ b/android/location_api/LocationUtil.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -32,9 +32,13 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::V1_0::GnssConstellationType; +using ::android::hardware::gnss::V1_0::GnssLocationFlags; + void convertGnssLocation(Location& in, GnssLocation& out) { memset(&out, 0, sizeof(GnssLocation)); @@ -63,7 +67,7 @@ void convertGnssLocation(Location& in, GnssLocation& out) out.verticalAccuracyMeters = in.verticalAccuracy; out.speedAccuracyMetersPerSecond = in.speedAccuracy; out.bearingAccuracyDegrees = in.bearingAccuracy; - out.timestamp = static_cast(in.timestamp); + out.timestamp = static_cast(in.timestamp); } void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) @@ -147,7 +151,7 @@ void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEph } } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/LocationUtil.h b/android/location_api/LocationUtil.h index 44d5e02f..acc0eabc 100644 --- a/android/location_api/LocationUtil.h +++ b/android/location_api/LocationUtil.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -37,17 +37,17 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { -void convertGnssLocation(Location& in, GnssLocation& out); -void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out); +void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index fcdd693d..f1a5d012 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -39,17 +39,23 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback; + static void convertGnssData(GnssMeasurementsNotification& in, + V1_0::IGnssMeasurementCallback::GnssData& out); +static void convertGnssData_1_1(GnssMeasurementsNotification& in, IGnssMeasurementCallback::GnssData& out); static void convertGnssMeasurement(GnssMeasurementsData& in, - IGnssMeasurementCallback::GnssMeasurement& out); + V1_0::IGnssMeasurementCallback::GnssMeasurement& out); static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), + mGnssMeasurementCbIface_1_1(nullptr), mTracking(false) { LOC_LOGD("%s]: ()", __FUNCTION__); @@ -62,7 +68,7 @@ MeasurementAPIClient::~MeasurementAPIClient() // for GpsInterface Return -MeasurementAPIClient::measurementSetCallback(const sp& callback) +MeasurementAPIClient::measurementSetCallback(const sp& callback) { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); @@ -70,6 +76,24 @@ MeasurementAPIClient::measurementSetCallback(const sp& mGnssMeasurementCbIface = callback; mMutex.unlock(); + return startTracking(); +} + +Return +MeasurementAPIClient::measurementSetCallback_1_1(const sp& callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + mMutex.lock(); + mGnssMeasurementCbIface_1_1 = callback; + mMutex.unlock(); + + return startTracking(); +} + +Return +MeasurementAPIClient::startTracking() +{ LocationCallbacks locationCallbacks; memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); locationCallbacks.size = sizeof(LocationCallbacks); @@ -84,7 +108,7 @@ MeasurementAPIClient::measurementSetCallback(const sp& locationCallbacks.gnssNmeaCb = nullptr; locationCallbacks.gnssMeasurementsCb = nullptr; - if (mGnssMeasurementCbIface != nullptr) { + if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) { locationCallbacks.gnssMeasurementsCb = [this](GnssMeasurementsNotification gnssMeasurementsNotification) { onGnssMeasurementsCb(gnssMeasurementsNotification); @@ -119,11 +143,25 @@ void MeasurementAPIClient::onGnssMeasurementsCb( __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { mMutex.lock(); - auto gnssMeasurementCbIface(mGnssMeasurementCbIface); + sp gnssMeasurementCbIface = nullptr; + sp gnssMeasurementCbIface_1_1 = nullptr; + if (mGnssMeasurementCbIface_1_1 != nullptr) { + gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1; + } else if (mGnssMeasurementCbIface != nullptr) { + gnssMeasurementCbIface = mGnssMeasurementCbIface; + } mMutex.unlock(); - if (gnssMeasurementCbIface != nullptr) { + if (gnssMeasurementCbIface_1_1 != nullptr) { IGnssMeasurementCallback::GnssData gnssData; + convertGnssData_1_1(gnssMeasurementsNotification, gnssData); + auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } + } else if (gnssMeasurementCbIface != nullptr) { + V1_0::IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); if (!r.isOk()) { @@ -135,7 +173,7 @@ void MeasurementAPIClient::onGnssMeasurementsCb( } static void convertGnssMeasurement(GnssMeasurementsData& in, - IGnssMeasurementCallback::GnssMeasurement& out) + V1_0::IGnssMeasurementCallback::GnssMeasurement& out) { memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement)); if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) @@ -242,13 +280,13 @@ static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback } static void convertGnssData(GnssMeasurementsNotification& in, - IGnssMeasurementCallback::GnssData& out) + V1_0::IGnssMeasurementCallback::GnssData& out) { out.measurementCount = in.count; - if (out.measurementCount > static_cast(GnssMax::SVS_COUNT)) { + if (out.measurementCount > static_cast(V1_0::GnssMax::SVS_COUNT)) { LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.", - __FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT); - out.measurementCount = static_cast(GnssMax::SVS_COUNT); + __FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT); + out.measurementCount = static_cast(V1_0::GnssMax::SVS_COUNT); } for (size_t i = 0; i < out.measurementCount; i++) { convertGnssMeasurement(in.measurements[i], out.measurements[i]); @@ -256,8 +294,18 @@ static void convertGnssData(GnssMeasurementsNotification& in, convertGnssClock(in.clock, out.clock); } +static void convertGnssData_1_1(GnssMeasurementsNotification& in, + IGnssMeasurementCallback::GnssData& out) +{ + out.measurements.resize(in.count); + for (size_t i = 0; i < in.count; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0); + } + convertGnssClock(in.clock, out.clock); +} + } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/location_api/MeasurementAPIClient.h b/android/location_api/MeasurementAPIClient.h index 8de13264..117ad542 100644 --- a/android/location_api/MeasurementAPIClient.h +++ b/android/location_api/MeasurementAPIClient.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, 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 @@ -31,18 +31,17 @@ #define MEASUREMENT_API_CLINET_H #include -#include -#include +#include +#include #include #include namespace android { namespace hardware { namespace gnss { -namespace V1_0 { +namespace V1_1 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssMeasurement; using ::android::sp; class MeasurementAPIClient : public LocationAPIClientBase @@ -54,21 +53,26 @@ public: MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete; // for GpsMeasurementInterface - Return measurementSetCallback( + Return measurementSetCallback( + const sp& callback); + Return measurementSetCallback_1_1( const sp& callback); void measurementClose(); + Return startTracking(); // callbacks we are interested in void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; private: - sp mGnssMeasurementCbIface; std::mutex mMutex; + sp mGnssMeasurementCbIface; + sp mGnssMeasurementCbIface_1_1; + bool mTracking; }; } // namespace implementation -} // namespace V1_0 +} // namespace V1_1 } // namespace gnss } // namespace hardware } // namespace android diff --git a/android/service.cpp b/android/service.cpp index 5779e67e..72cb4e9b 100644 --- a/android/service.cpp +++ b/android/service.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Not a Contribution */ /* @@ -18,12 +18,12 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.gnss@1.0-service-qti" +#define LOG_TAG "android.hardware.gnss@1.1-service-qti" -#include +#include #include -using android::hardware::gnss::V1_0::IGnss; +using android::hardware::gnss::V1_1::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { diff --git a/core/Android.mk b/core/Android.mk index 1374b6c0..6d1dd11b 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -6,8 +6,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional ifeq ($(TARGET_DEVICE),apq8026_lw) diff --git a/gnss/Android.mk b/gnss/Android.mk index 4d738bd3..d809bc2a 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -6,8 +6,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgnss -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d6cb0e70..e2a7c37f 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3002,6 +3002,9 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) r.mLocation.mLocation.longitude = (double)(reports.mBestPosition.back().mBestLon) * RAD2DEG; r.mLocation.mLocation.altitude = reports.mBestPosition.back().mBestAlt; + r.mLocation.mLocation.accuracy = + (double)(reports.mBestPosition.back().mBestHepe); + r.mLocation.mUtcReported = reports.mBestPosition.back().mUtcReported; } else { diff --git a/location/Android.mk b/location/Android.mk index 6ac8e361..bbd6fbd8 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -6,8 +6,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := liblocation_api -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := \ diff --git a/utils/Android.mk b/utils/Android.mk index 9607aaa1..56f5e08b 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -44,8 +44,7 @@ LOCAL_HEADER_LIBRARIES := \ liblocation_api_headers LOCAL_MODULE := libgps.utils -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false From 4145243b7e08a7bb423662bea92c726f9f924578 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 5 Apr 2018 17:54:50 -0700 Subject: [PATCH 633/945] Assure event mask is set properly to get positions The event mask can be retrieved in the context of client thread as zero and then queued up to go to msg task thread. By the time the msg is actually handled in msg task thread, the actual event mask at LOC API layer may have already changed, but this mask would then be overridden by zero. This can cause no modem events to ever come, including position reports. The fix is to not retrieve the event mask in the client thread, but instead wait for msg to be handled in msg task thread before retrieving it. Change-Id: I48562d028bbfa187732686c060b5cdd62c6d5a89 CRs-fixed: 2219519 --- core/LocApiBase.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 1e326d94..956c6f10 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -107,19 +107,16 @@ struct LocSsrMsg : public LocMsg { 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) + inline LocOpenMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) { locallog(); } inline virtual void proc() const { - mLocApi->open(mMask); + mLocApi->open(mLocApi->getEvtMask()); } inline void locallog() const { - LOC_LOGV("%s:%d]: LocOpen Mask: %" PRIu64 "\n", - __func__, __LINE__, mMask); + LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask()); } inline virtual void log() const { locallog(); @@ -163,8 +160,7 @@ 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, - mMask | adapter->getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); break; } } @@ -200,7 +196,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) close(); } else { // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); } } } From 49b42e8ce57f506745bf18f68a48a7304a02d09a Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sun, 8 Apr 2018 23:35:14 +0530 Subject: [PATCH 634/945] FR 48850 - Device based hybrid ODCPI Adding support for sending ODCPI request to framework via IGnss interface. Change-Id: I97ab4f00505705fedc266998602499fd344baf31 CRs-Fixed: 2217664 --- android/Gnss.cpp | 37 ++++++++- android/Gnss.h | 4 + android/location_api/LocationUtil.cpp | 31 +++++++ android/location_api/LocationUtil.h | 1 + core/LocAdapterBase.cpp | 4 + core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 10 +++ core/LocApiBase.h | 3 + gnss/GnssAdapter.cpp | 111 ++++++++++++++++++++++++++ gnss/GnssAdapter.h | 18 ++++- gnss/location_gnss.cpp | 20 +++++ location/location_interface.h | 2 + utils/gps_extended_c.h | 14 ++++ 13 files changed, 254 insertions(+), 2 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 878cd202..8f048e24 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -25,6 +25,8 @@ #include #include #include "Gnss.h" +#include + typedef void* (getLocationInterface)(); #define IMAGES_INFO_FILE "/sys/devices/soc0/images" @@ -368,6 +370,14 @@ Return> Gnss::getExtensionAGnssRil() { Return Gnss::setCallback_1_1(const sp& callback) { ENTRY_LOG_CALLFLOW(); callback->gnssNameCb(getVersionString()); + mGnssCbIface_1_1 = callback; + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { + odcpiRequestCb(odcpiRequest); + }; + gnssInterface->odcpiInit(cb); + } return setCallback(callback); } @@ -396,11 +406,36 @@ Return> Gnss::getExtensionGnssConfiguration_1_1() { return mGnssConfig; } -Return Gnss::injectBestLocation(const GnssLocation&) { +Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + Location location = {}; + convertGnssLocation(gnssLocation, location); + gnssInterface->odcpiInject(location); + } return true; } +void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface_1_1 != nullptr) { + // For emergency mode, request DBH (Device based hybrid) location + // Mark Independent from GNSS flag to false. + if (ODCPI_REQUEST_TYPE_START == request.type) { + if (request.isEmergencyMode) { + mGnssCbIface_1_1->gnssRequestLocationCb(false); + } else { + mGnssCbIface_1_1->gnssRequestLocationCb(true); + } + } else { + LOC_LOGv("Unsupported ODCPI request type: %d", request.type); + } + } else { + LOC_LOGe("ODCPI request not supported."); + } +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/Gnss.h b/android/Gnss.h index c562b1fb..4c0c8b05 100644 --- a/android/Gnss.h +++ b/android/Gnss.h @@ -111,6 +111,9 @@ struct Gnss : public IGnss { Return updateConfiguration(GnssConfig& gnssConfig); GnssInterface* getGnssInterface(); + // Callback for ODCPI request + void odcpiRequestCb(const OdcpiRequestInfo& request); + private: struct GnssDeathRecipient : hidl_death_recipient { GnssDeathRecipient(sp gnss) : mGnss(gnss) { @@ -134,6 +137,7 @@ struct Gnss : public IGnss { GnssAPIClient* mApi = nullptr; sp mGnssCbIface = nullptr; + sp mGnssCbIface_1_1 = nullptr; sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; GnssInterface* mGnssInterface = nullptr; diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp index 7f3a74bc..21c2e397 100644 --- a/android/location_api/LocationUtil.cpp +++ b/android/location_api/LocationUtil.cpp @@ -70,6 +70,37 @@ void convertGnssLocation(Location& in, GnssLocation& out) out.timestamp = static_cast(in.timestamp); } +void convertGnssLocation(const GnssLocation& in, Location& out) +{ + memset(&out, 0, sizeof(out)); + if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) + out.flags |= LOCATION_HAS_LAT_LONG_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) + out.flags |= LOCATION_HAS_ALTITUDE_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) + out.flags |= LOCATION_HAS_SPEED_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) + out.flags |= LOCATION_HAS_BEARING_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) + out.flags |= LOCATION_HAS_ACCURACY_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) + out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) + out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT; + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) + out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; + out.latitude = in.latitudeDegrees; + out.longitude = in.longitudeDegrees; + out.altitude = in.altitudeMeters; + out.speed = in.speedMetersPerSec; + out.bearing = in.bearingDegrees; + out.accuracy = in.horizontalAccuracyMeters; + out.verticalAccuracy = in.verticalAccuracyMeters; + out.speedAccuracy = in.speedAccuracyMetersPerSecond; + out.bearingAccuracy = in.bearingAccuracyDegrees; + out.timestamp = static_cast(in.timestamp); +} + void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) { switch(in) { diff --git a/android/location_api/LocationUtil.h b/android/location_api/LocationUtil.h index acc0eabc..63f4f6f0 100644 --- a/android/location_api/LocationUtil.h +++ b/android/location_api/LocationUtil.h @@ -41,6 +41,7 @@ namespace V1_1 { namespace implementation { void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index f3c999c2..d0da3dac 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -161,4 +161,8 @@ bool LocAdapterBase:: reportWwanZppFix(LocGpsLocation &/*zppLoc*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportOdcpiRequestEvent(OdcpiRequestInfo& /*request*/) +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e7beca83..35fc48e5 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -153,6 +153,7 @@ public: virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); + virtual bool reportOdcpiRequestEvent(OdcpiRequestInfo& request); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 1e326d94..13d0773b 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -264,6 +264,12 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); } +void LocApiBase::reportOdcpiRequest(OdcpiRequestInfo& request) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportOdcpiRequestEvent(request)); +} + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -440,6 +446,10 @@ 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:: + injectPosition(const Location& /*location*/) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + enum loc_api_adapter_err LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 25d95b2a..6563dead 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -134,6 +134,7 @@ public: void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); void saveSupportedFeatureList(uint8_t *featureList); void reportWwanZppFix(LocGpsLocation &zppLoc); + void reportOdcpiRequest(OdcpiRequestInfo& request); // downward calls // All below functions are to be defined by adapter specific modules: @@ -153,6 +154,8 @@ public: setAPN(char* apn, int len); virtual enum loc_api_adapter_err injectPosition(double latitude, double longitude, float accuracy); + virtual enum loc_api_adapter_err + injectPosition(const Location& location); virtual enum loc_api_adapter_err setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); virtual enum loc_api_adapter_err diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e2a7c37f..a482acc0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -74,6 +74,9 @@ GnssAdapter::GnssAdapter() : mNiData(), mAgpsManager(), mAgpsCbInfo(), + mOdcpiRequestCb(nullptr), + mOdcpiRequestActive(false), + mOdcpiInjectedPositionCount(0), mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) @@ -1179,6 +1182,11 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; } + // Add ODCPI handling + if (nullptr != mOdcpiRequestCb) { + mask |= LOC_API_ADAPTER_BIT_REQUEST_WIFI; + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } @@ -2512,6 +2520,109 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) mUlpProxy->reportSvPolynomial(svPolynomial); } +bool +GnssAdapter::reportOdcpiRequestEvent(OdcpiRequestInfo& request) +{ + LOC_LOGd("ODCPI request: type %d, tbf %d, isEmergency %d", request.type, + request.tbfMillis, request.isEmergencyMode); + + struct MsgReportOdcpiRequest : public LocMsg { + GnssAdapter& mAdapter; + OdcpiRequestInfo mOdcpiRequest; + inline MsgReportOdcpiRequest(GnssAdapter& adapter, OdcpiRequestInfo& request) : + LocMsg(), + mAdapter(adapter), + mOdcpiRequest(request) {} + inline virtual void proc() const { + mAdapter.reportOdcpiRequest(mOdcpiRequest); + } + }; + + sendMsg(new MsgReportOdcpiRequest(*this, request)); + return true; +} + +void GnssAdapter::reportOdcpiRequest(const OdcpiRequestInfo& request) +{ + if (nullptr != mOdcpiRequestCb) { + mOdcpiInjectedPositionCount = 0; + if (ODCPI_REQUEST_TYPE_START == request.type) { + mOdcpiRequestCb(request); + mOdcpiRequestActive = true; + } else { + mOdcpiRequestActive = false; + } + } else { + LOC_LOGe("ODCPI request not supported"); + } +} + +void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback) +{ + struct MsgInitOdcpi : public LocMsg { + GnssAdapter& mAdapter; + OdcpiRequestCallback mOdcpiCb; + inline MsgInitOdcpi(GnssAdapter& adapter, + const OdcpiRequestCallback& callback) : + LocMsg(), + mAdapter(adapter), + mOdcpiCb(callback) {} + inline virtual void proc() const { + mAdapter.initOdcpi(mOdcpiCb); + } + }; + + sendMsg(new MsgInitOdcpi(*this, callback)); +} + +void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback) +{ + mOdcpiRequestCb = callback; + + /* Register for WIFI request */ + updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI, + LOC_REGISTRATION_MASK_ENABLED); +} + +void GnssAdapter::injectOdcpiCommand(const Location& location) +{ + struct MsgInjectOdcpi : public LocMsg { + GnssAdapter& mAdapter; + Location mLocation; + inline MsgInjectOdcpi(GnssAdapter& adapter, const Location& location) : + LocMsg(), + mAdapter(adapter), + mLocation(location) {} + inline virtual void proc() const { + mAdapter.injectOdcpi(mLocation); + } + }; + + sendMsg(new MsgInjectOdcpi(*this, location)); +} + +void GnssAdapter::injectOdcpi(const Location& location) +{ + LOC_LOGd("ODCPI Injection: requestActive: %d, lat %.7f long %.7f", + mOdcpiRequestActive, location.latitude, location.longitude); + + if (mOdcpiRequestActive) { + loc_api_adapter_err err = mLocApi->injectPosition(location); + if (LOC_API_ADAPTER_ERR_SUCCESS == err) { + mOdcpiInjectedPositionCount++; + if (mOdcpiInjectedPositionCount >= + ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST) { + mOdcpiRequestActive = false; + mOdcpiInjectedPositionCount = 0; + } + } else { + LOC_LOGe("Inject Position API error %d", err); + } + } else { + LOC_LOGv("ODCPI request inactive, injection dropped"); + } +} + void GnssAdapter::initDefaultAgps() { LOC_LOGD("%s]: ", __func__); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 99ce5c9a..e98c76ea 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -43,6 +43,7 @@ #define MAX_SATELLITES_IN_USE 12 #define LOC_NI_NO_RESPONSE_TIME 20 #define LOC_GPS_NI_RESPONSE_IGNORE 4 +#define ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST 30 class GnssAdapter; @@ -102,12 +103,17 @@ class GnssAdapter : public LocAdapterBase { /* ==== NI ============================================================================= */ NiData mNiData; - /* ==== AGPS ========================================================*/ + /* ==== AGPS =========================================================================== */ // This must be initialized via initAgps() AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; void initAgps(const AgpsCbInfo& cbInfo); + /* ==== ODCPI ========================================================================== */ + OdcpiRequestCallback mOdcpiRequestCb; + bool mOdcpiRequestActive; + uint32_t mOdcpiInjectedPositionCount; + /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; std::string mServerUrl; @@ -209,6 +215,14 @@ public: void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); + /* ========= ODCPI ===================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void initOdcpiCommand(const OdcpiRequestCallback& callback); + void injectOdcpiCommand(const Location& location); + /* ======== UTILITIES ================================================================== */ + void initOdcpi(const OdcpiRequestCallback& callback); + void injectOdcpi(const Location& location); + /* ======== RESPONSES ================================================================== */ void reportResponse(LocationError err, uint32_t sessionId); void reportResponse(size_t count, LocationError* errs, uint32_t* ids); @@ -242,6 +256,7 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); + virtual bool reportOdcpiRequestEvent(OdcpiRequestInfo& request); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, @@ -254,6 +269,7 @@ public: void reportNmea(const char* nmea, size_t length); bool requestNiNotify(const GnssNiNotification& notify, const void* data); void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); + void reportOdcpiRequest(const OdcpiRequestInfo& request); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 3e989c97..21763dd1 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -62,6 +62,9 @@ static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); static void updateConnectionStatus(bool connected, int8_t type); +static void odcpiInit(const OdcpiRequestCallback& callback); +static void odcpiInject(const Location& location); + static const GnssInterface gGnssInterface = { sizeof(GnssInterface), initialize, @@ -87,6 +90,8 @@ static const GnssInterface gGnssInterface = { agpsDataConnFailed, getDebugReport, updateConnectionStatus, + odcpiInit, + odcpiInject, }; #ifndef DEBUG_X86 @@ -265,3 +270,18 @@ static void updateConnectionStatus(bool connected, int8_t type) { gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); } } + +static void odcpiInit(const OdcpiRequestCallback& callback) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->initOdcpiCommand(callback); + } +} + +static void odcpiInject(const Location& location) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->injectOdcpiCommand(location); + } +} + diff --git a/location/location_interface.h b/location/location_interface.h index 27589f71..92290521 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -57,6 +57,8 @@ struct GnssInterface { void (*agpsDataConnFailed)(AGpsExtType agpsType); void (*getDebugReport)(GnssDebugReport& report); void (*updateConnectionStatus)(bool connected, int8_t type); + void (*odcpiInit)(const OdcpiRequestCallback& callback); + void (*odcpiInject)(const Location& location); }; struct FlpInterface { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index afe47ccc..f029a354 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1293,6 +1293,20 @@ struct AGnssExtStatusIpV6 { uint8_t ipV6Addr[16]; }; +/* ODCPI Request Info */ +enum OdcpiRequestType { + ODCPI_REQUEST_TYPE_START, + ODCPI_REQUEST_TYPE_STOP +}; +struct OdcpiRequestInfo { + size_t size; + OdcpiRequestType type; + uint32_t tbfMillis; + bool isEmergencyMode; +}; +/* Callback to send ODCPI request to framework */ +typedef std::function OdcpiRequestCallback; + /* * Callback with AGNSS(IpV4) status information. * From e5c31f33c1fac9129b7141c62d61826dfc041a54 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 30 Mar 2018 17:10:59 -0700 Subject: [PATCH 635/945] GPS Adapter: GNSS adapter change to go with engine hub aggregator 1: GNSS adapter change to block out position and SV report from ULP when engine hub aggregator is used 2: Support unpropagated position report Change-Id: Id0cacd87d3f3f8eec893d751b9f7a55a736a4023 CRs-fixed: 2210253 --- core/EngineHubProxyBase.h | 7 +++-- core/LocAdapterBase.cpp | 5 ++-- core/LocAdapterBase.h | 6 +++-- gnss/GnssAdapter.cpp | 54 +++++++++++++++++++++++++++++++-------- gnss/GnssAdapter.h | 7 +++-- utils/gps_extended_c.h | 4 ++- 6 files changed, 64 insertions(+), 19 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 7b9f3ae8..4e259ba7 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -92,10 +92,13 @@ typedef std::function + bool fromUlp, + bool fromEngineHub)> GnssAdapterReportPositionEventCb; -typedef std::function +typedef std::function GnssAdapterReportSvEventCb; // potential parameters: message queue: MsgTask * msgTask; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index f3c999c2..5d1b2c21 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromUlp*/) { + bool /*fromUlp*/, bool /*fromEngineHub*/) { if (mLocAdapterProxyBase != NULL) { mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, (GpsLocationExtended&)locationExtended, @@ -91,7 +91,8 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSvEvent(const GnssSvNotification& /*svNotify*/, bool /*fromUlp*/) + reportSvEvent(const GnssSvNotification& /*svNotify*/, + bool /*fromUlp*/, bool /*fromEngineHub*/) DEFAULT_IMPL() void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e7beca83..8388c712 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -131,8 +131,10 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromUlp=false); - virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + bool fromUlp=false, + bool fromEngineHub=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, + bool fromUlp=false, bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index dca3d0f9..f619a9a3 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1259,6 +1259,7 @@ GnssAdapter::updateClientsEventMask() (true == initEngHubProxy())) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; + mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); } @@ -2121,22 +2122,43 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp) + bool fromUlp, + bool fromEngineHub) { LOC_LOGD("%s]: fromUlp %u status %u", __func__, fromUlp, status); // if this event is called from QMI LOC API, then try to call into ULP and return if successfull // if the position is called from ULP or engine hub, then send it out directly - if (!fromUlp) { - // report QMI position to engine hub, and engine hub will be - // distributing it to the registered plugins + if (!fromUlp && !fromEngineHub) { + // report QMI position (both propagated and unpropagated) to engine hub, + // and engine hub will be distributing it to the registered plugins mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); + + if (true == ulpLocation.unpropagatedPosition) { + return; + } + + // only send propagated position report to ulp if (mUlpProxy->reportPosition(ulpLocation, locationExtended, status, techMask)) { return; } + + // engine hub is loaded, do not report qmi position to client as + // final position report should come from engine hub + if (true == initEngHubProxy()){ + return; + } + } else if ((true == fromUlp) && (true == initEngHubProxy())) { + LOC_LOGV("%s]: drop ULP GNSS fix as engine hub is loaded", __func__); + return; } + // for all other cases: + // case 1: fix is from ULP and engine hub is not loaded, queue the msg + // case 2: fix is from engine hub, queue the msg + // when message is queued, the position can be dispatched to requesting client + struct MsgReportPosition : public LocMsg { GnssAdapter& mAdapter; const UlpLocation mUlpLocation; @@ -2237,18 +2259,28 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, void GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, - bool fromUlp) + bool fromUlp, + bool fromEngineHub) { LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); // if this event is not called from ULP, then try to call into ULP and return if successfull - if (!fromUlp) { + if (!fromUlp && !fromEngineHub) { // report QMI SV report to eng hub mEngHubProxy->gnssReportSv(svNotify); if (mUlpProxy->reportSv(svNotify)) { return; } + + // engine hub is loaded, do not report sv to client + // as sv report should come from engine hub + if (true == initEngHubProxy()){ + return; + } + } else if ((true == fromUlp) && (true == initEngHubProxy())) { + LOC_LOGV("%s]: drop ULP GNSS SV event as engine hub is loaded", __func__); + return; } struct MsgReportSv : public LocMsg { @@ -3326,15 +3358,17 @@ GnssAdapter::initEngHubProxy() { const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp) { + bool fromUlp, + bool fromEngineHub) { // report from engine hub on behalf of PPE will be treated as fromUlp - reportPositionEvent(ulpLocation, locationExtended, status, techMask, fromUlp); + reportPositionEvent(ulpLocation, locationExtended, status, + techMask, fromUlp, fromEngineHub); }; // callback function for engine hub to report back sv event GnssAdapterReportSvEventCb reportSvEventCb = - [this](const GnssSvNotification& svNotify, bool fromUlp) { - reportSvEvent(svNotify, fromUlp); + [this](const GnssSvNotification& svNotify, bool fromUlp, bool fromEngineHub) { + reportSvEvent(svNotify, fromUlp, fromEngineHub); }; getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index c1e17545..85962cfb 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -235,8 +235,11 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp=false); - virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + bool fromUlp=false, + bool fromEngineHub=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, + bool fromUlp=false, + bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 57d9d517..95656821 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -128,6 +128,7 @@ typedef struct { /* Provider indicator for HYBRID or GPS */ uint16_t position_source; LocPosTechMask tech_mask; + bool unpropagatedPosition; } UlpLocation; typedef struct { @@ -769,6 +770,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REQUEST_POSITION_INJECTION, // Position injection request LOC_API_ADAPTER_BATCH_STATUS, // batch status LOC_API_ADAPTER_FDCL_SERVICE_REQ, // FDCL service request + LOC_API_ADAPTER_REPORT_UNPROPAGATED_POSITION, // Unpropagated Position report LOC_API_ADAPTER_EVENT_MAX }; @@ -805,7 +807,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_POSITION_INJECTION_REQUEST (1< Date: Mon, 26 Mar 2018 20:46:47 -0700 Subject: [PATCH 636/945] Add location client api sockets' strings Add location client api socket path string definitions in utils/gps_extended_c.h. CRs-Fixed: 2196048 Change-Id: Ie2eea05dfe440fa3a96b531fa4ba17605ab53431 --- utils/gps_extended_c.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index bd528d9e..f8cd21fc 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1288,8 +1288,15 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); /* Shared resources of LocIpc */ -#define LOC_IPC_HAL "/dev/socket/location/socket_hal" -#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" +#define LOC_IPC_HAL "/dev/socket/location/socket_hal" +#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" + +#define SOCKET_DIR_LOCATION "/dev/socket/location/" +#define SOCKET_DIR_EHUB "/dev/socket/location/ehub" +#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" + +#define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" +#define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" #ifdef __cplusplus } From ae28b2989853a4de970ecaf78855d4bd0c34e362 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 22 Jan 2018 16:04:50 -0800 Subject: [PATCH 637/945] Addition of new LocApi thread 1. LocApiBase to create its own MsgTask thread to allow QMI calls to be made asynchronously. It shall no longer share the adapter's thread. 2. Implementation of new LocApiResponse classes for generic response type from LocApi layer to Adapter layers. 3. GnssAdapter modified to handle the asynchronous nature of LocApi calls. CRs-Fixed: 2218658 Change-Id: I6e401a89f16791ec144763ac5f070b7ee1dad931 --- core/ContextBase.cpp | 41 +- core/ContextBase.h | 100 +++++ core/LBSProxyBase.h | 5 +- core/LocAdapterBase.cpp | 6 + core/LocAdapterBase.h | 4 +- core/LocApiBase.cpp | 187 ++++----- core/LocApiBase.h | 134 +++--- gnss/Agps.cpp | 8 +- gnss/Agps.h | 3 +- gnss/GnssAdapter.cpp | 884 +++++++++++++++++++++++----------------- gnss/GnssAdapter.h | 25 +- gnss/Makefile.am | 2 +- 12 files changed, 842 insertions(+), 557 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 47194cba..e7ee8bf1 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -42,6 +42,10 @@ namespace loc_core { loc_gps_cfg_s_type ContextBase::mGps_conf {}; loc_sap_cfg_s_type ContextBase::mSap_conf {}; +bool ContextBase::sIsEngineCapabilitiesKnown = false; +uint64_t ContextBase::sSupportedMsgMask = 0; +bool ContextBase::sGnssMeasurementSupported = false; +uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH]; const loc_param_s_type ContextBase::mGps_conf_table[] = { @@ -215,7 +219,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // Check the target if (TARGET_NO_GNSS != loc_get_target()){ - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { + if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) { void *handle = NULL; //try to see if LocApiV02 is present if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { @@ -224,7 +228,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) if (getter != NULL) { LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); + locApi = (*getter)(exMask, this); } } // only RPC is the option now @@ -237,7 +241,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) if (NULL != getter) { LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); + locApi = (*getter)(exMask, this); } } } @@ -247,7 +251,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // locApi could still be NULL at this time // we would then create a dummy one if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask, this); + locApi = new LocApiBase(exMask, this); } return locApi; @@ -263,4 +267,33 @@ ContextBase::ContextBase(const MsgTask* msgTask, { } +void ContextBase::setEngineCapabilities(uint64_t supportedMsgMask, + uint8_t *featureList, bool gnssMeasurementSupported) { + + if (ContextBase::sIsEngineCapabilitiesKnown == false) { + ContextBase::sSupportedMsgMask = supportedMsgMask; + ContextBase::sGnssMeasurementSupported = gnssMeasurementSupported; + if (featureList != NULL) { + memcpy((void *)ContextBase::sFeaturesSupported, + (void *)featureList, sizeof(ContextBase::sFeaturesSupported)); + } + + ContextBase::sIsEngineCapabilitiesKnown = true; + } +} + + +bool ContextBase::isFeatureSupported(uint8_t featureVal) +{ + uint8_t arrayIndex = featureVal >> 3; + uint8_t bitPos = featureVal & 7; + + if (arrayIndex >= MAX_FEATURE_LENGTH) return false; + return ((ContextBase::sFeaturesSupported[arrayIndex] >> bitPos ) & 0x1); +} + +bool ContextBase::gnssConstellationConfig() { + return sGnssMeasurementSupported; +} + } diff --git a/core/ContextBase.h b/core/ContextBase.h index dc64b6ab..e7edb296 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -116,6 +116,7 @@ protected: const MsgTask* mMsgTask; LocApiBase* mLocApi; LocApiProxyBase *mLocApiProxy; + public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, @@ -140,12 +141,111 @@ public: static loc_gps_cfg_s_type mGps_conf; static loc_sap_cfg_s_type mSap_conf; + static bool sIsEngineCapabilitiesKnown; + static uint64_t sSupportedMsgMask; + static uint8_t sFeaturesSupported[MAX_FEATURE_LENGTH]; + static bool sGnssMeasurementSupported; void readConfig(); static uint32_t getCarrierCapabilities(); + void setEngineCapabilities(uint64_t supportedMsgMask, + uint8_t *featureList, bool gnssMeasurementSupported); + + static inline bool isEngineCapabilitiesKnown() { + return sIsEngineCapabilitiesKnown; + } + + static inline bool isMessageSupported(LocCheckingMessagesID msgID) { + + // confirm if msgID is not larger than the number of bits in + // mSupportedMsg + if ((uint64_t)msgID > (sizeof(sSupportedMsgMask) << 3)) { + return false; + } else { + uint32_t messageChecker = 1 << msgID; + return (messageChecker & sSupportedMsgMask) == messageChecker; + } + } + + /* + Check if a feature is supported + */ + static bool isFeatureSupported(uint8_t featureVal); + + /* + Check if gnss measurement is supported + */ + static bool gnssConstellationConfig(); }; +struct LocApiResponse: LocMsg { + private: + ContextBase& mContext; + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationError); + } + protected: + LocationError mLocationError; + public: + inline LocApiResponse(ContextBase& context, + std::function procImpl ) : + mContext(context), mProcImpl(procImpl) {} + + void returnToSender(const LocationError err) { + mLocationError = err; + mContext.sendMsg(this); + } +}; + +struct LocApiCollectiveResponse: LocMsg { + private: + ContextBase& mContext; + std::function errs)> mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationErrors); + } + protected: + std::vector mLocationErrors; + public: + inline LocApiCollectiveResponse(ContextBase& context, + std::function errs)> procImpl ) : + mContext(context), mProcImpl(procImpl) {} + inline virtual ~LocApiCollectiveResponse() { + } + + void returnToSender(std::vector& errs) { + mLocationErrors = errs; + mContext.sendMsg(this); + } +}; + + +template +struct LocApiResponseData: LocMsg { + private: + ContextBase& mContext; + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationError, mData); + } + protected: + LocationError mLocationError; + DATA mData; + public: + inline LocApiResponseData(ContextBase& context, + std::function procImpl ) : + mContext(context), mProcImpl(procImpl) {} + + void returnToSender(const LocationError err, const DATA data) { + mLocationError = err; + mData = data; + mContext.sendMsg(this); + } +}; + + } // namespace loc_core #endif //__LOC_CONTEXT_BASE__ diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 94ddd0fb..bf786a35 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -29,7 +29,6 @@ #ifndef IZAT_PROXY_BASE_H #define IZAT_PROXY_BASE_H #include -#include namespace loc_core { @@ -40,11 +39,9 @@ class ContextBase; class LBSProxyBase { friend class ContextBase; inline virtual LocApiBase* - getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, + getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase* context) const { - (void)msgTask; (void)exMask; (void)context; return NULL; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index f3c999c2..bf2be1c1 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -161,4 +161,10 @@ bool LocAdapterBase:: reportWwanZppFix(LocGpsLocation &/*zppLoc*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportZppBestAvailableFix(LocGpsLocation& /*zppLoc*/, + GpsLocationExtended& /*location_extended*/, LocPosTechMask /*tech_mask*/) +DEFAULT_IMPL(false) + + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e7beca83..7fd4c5b5 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -107,7 +107,7 @@ public: } inline bool isFeatureSupported(uint8_t featureVal) { - return mLocApi->isFeatureSupported(featureVal); + return ContextBase::isFeatureSupported(featureVal); } uint32_t generateSessionId(); @@ -153,6 +153,8 @@ public: virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); + virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8aef94b3..8981e8b8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -126,14 +126,36 @@ struct LocOpenMsg : public LocMsg { } }; -LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, +struct LocCloseMsg : public LocMsg { + LocApiBase* mLocApi; + inline LocCloseMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->close(); + } + inline void locallog() const { + LOC_LOGV("%s]: LocCloseMsg"); + } + inline virtual void log() const { + locallog(); + } +}; + +MsgTask* LocApiBase::mMsgTask; + +LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : - mMsgTask(msgTask), mContext(context), mSupportedMsg(0), + mContext(context), mMask(0), mExcludedMask(excludedMask) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); - memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported)); + + if (nullptr == mMsgTask) { + mMsgTask = new MsgTask("LocApiMsgTask", false); + } } LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() @@ -197,7 +219,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) // if we have an empty list of adapters if (0 == i) { - close(); + mMsgTask->sendMsg(new LocCloseMsg(this)); } else { // else we need to remove the bit mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); @@ -208,14 +230,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - open(getEvtMask()); + 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. @@ -223,7 +242,9 @@ void LocApiBase::handleEngineUpEvent() } void LocApiBase::handleEngineDownEvent() -{ +{ // This will take care of renegotiating the loc handle + sendMsg(new LocSsrMsg(this)); + // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent()); } @@ -239,7 +260,7 @@ void LocApiBase::reportPosition(UlpLocation& location, "timestamp: %" PRId64 "\n" "Session status: %d\n Technology mask: %u\n " "SV used in fix (gps/glo/bds/gal/qzss) : \ - (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")", + (0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 ")", location.gpsLocation.flags, location.position_source, location.gpsLocation.latitude, location.gpsLocation.longitude, location.gpsLocation.altitude, location.gpsLocation.speed, @@ -263,6 +284,15 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); } +void LocApiBase::reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportZppBestAvailableFix(zppLoc, + location_extended, tech_mask)); +} + + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -384,16 +414,6 @@ void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(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) @@ -415,86 +435,72 @@ 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) +void LocApiBase::startFix(const LocPosMode& /*posMode*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: - stopFix() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +void LocApiBase::stopFix(LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -LocationError LocApiBase:: - deleteAidingData(const GnssAidingData& /*data*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +void LocApiBase:: + deleteAidingData(const GnssAidingData& /*data*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -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:: +void LocApiBase:: injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() 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*/, +void LocApiBase:: + atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/, AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: atlCloseStatus(int /*handle*/, int /*is_succ*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: setPositionMode(const LocPosMode& /*posMode*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() LocationError LocApiBase:: - setServer(const char* /*url*/, int /*len*/) + setServerSync(const char* /*url*/, int /*len*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/) + setServerSync(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -LocationError LocApiBase:: +void LocApiBase:: informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +DEFAULT_IMPL() LocationError LocApiBase:: - setSUPLVersion(GnssConfigSuplVersion /*version*/) + setSUPLVersionSync(GnssConfigSuplVersion /*version*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setNMEATypes (uint32_t /*typesMask*/) + setNMEATypesSync (uint32_t /*typesMask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setLPPConfig(GnssConfigLppProfile /*profile*/) + setLPPConfigSync(GnssConfigLppProfile /*profile*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int /*sensorUsage*/, + setSensorControlConfigSync(int /*sensorUsage*/, int /*sensorProvider*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/, + setSensorPropertiesSync(bool /*gyroBiasVarianceRandomWalk_valid*/, float /*gyroBiasVarianceRandomWalk*/, bool /*accelBiasVarianceRandomWalk_valid*/, float /*accelBiasVarianceRandomWalk*/, @@ -507,7 +513,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorPerfControlConfig(int /*controlMode*/, + setSensorPerfControlConfigSync(int /*controlMode*/, int /*accelSamplesPerBatch*/, int /*accelBatchesPerSec*/, int /*gyroSamplesPerBatch*/, @@ -520,37 +526,36 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/) + setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/) + setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask /*lppeCP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/) + setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask /*lppeUP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +GnssConfigSuplVersion LocApiBase::convertSuplVersion(const uint32_t /*suplVersion*/) +DEFAULT_IMPL(GNSS_CONFIG_SUPL_VERSION_1_0_0) + +GnssConfigLppProfile LocApiBase::convertLppProfile(const uint32_t /*lppProfile*/) +DEFAULT_IMPL(GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE) + +GnssConfigLppeControlPlaneMask LocApiBase::convertLppeCp(const uint32_t /*lppeControlPlaneMask*/) +DEFAULT_IMPL(0) + +GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/) +DEFAULT_IMPL(0) + enum loc_api_adapter_err LocApiBase:: getWwanZppFix() DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation& zppLoc) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} - -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, - LocPosTechMask & tech_mask) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - memset(&tech_mask, 0, sizeof(tech_mask)); - memset(&locationExtended, 0, sizeof (locationExtended)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} +void LocApiBase:: + getBestAvailableZppFix() +DEFAULT_IMPL() int LocApiBase:: initDataServiceClient(bool /*isDueToSsr*/) @@ -573,7 +578,7 @@ void LocApiBase:: DEFAULT_IMPL() LocationError LocApiBase:: - setGpsLock(GnssConfigGpsLock /*lock*/) + setGpsLockSync(GnssConfigGpsLock /*lock*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) void LocApiBase:: @@ -587,21 +592,7 @@ int LocApiBase:: DEFAULT_IMPL(-1) LocationError LocApiBase:: - setXtraVersionCheck(uint32_t /*check*/) + setXtraVersionCheckSync(uint32_t /*check*/) DEFAULT_IMPL(LOCATION_ERROR_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/core/LocApiBase.h b/core/LocApiBase.h index 25d95b2a..f0b1f592 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -37,7 +37,9 @@ #include namespace loc_core { + class ContextBase; +struct LocApiResponse; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -66,6 +68,28 @@ class LocAdapterBase; struct LocSsrMsg; struct LocOpenMsg; +typedef struct +{ + uint32_t accumulatedDistance; + uint32_t numOfBatchedPositions; +} LocApiBatchData; + +typedef struct +{ + uint32_t hwId; +} LocApiGeofenceData; + +struct LocApiMsg: LocMsg { + private: + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(); + } + public: + inline LocApiMsg(std::function procImpl ) : + mProcImpl(procImpl) {} +}; + class LocApiProxyBase { public: inline LocApiProxyBase() {} @@ -78,22 +102,21 @@ class LocApiBase { //LocOpenMsg calls open() which makes it necessary to declare //it as a friend friend struct LocOpenMsg; + friend struct LocCloseMsg; friend class ContextBase; - const MsgTask* mMsgTask; - ContextBase *mContext; + static MsgTask* mMsgTask; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; - uint64_t mSupportedMsg; - uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH]; + protected: + ContextBase *mContext; virtual enum loc_api_adapter_err open(LOC_API_ADAPTER_EVENT_MASK_T mask); virtual enum loc_api_adapter_err close(); LOC_API_ADAPTER_EVENT_MASK_T getEvtMask(); LOC_API_ADAPTER_EVENT_MASK_T mMask; - LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); inline virtual ~LocApiBase() { close(); } bool isInSession(); @@ -130,10 +153,10 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GnssNiNotification ¬ify, const void* data); - void saveSupportedMsgList(uint64_t supportedMsgList); void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); - void saveSupportedFeatureList(uint8_t *featureList); void reportWwanZppFix(LocGpsLocation &zppLoc); + void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, + LocPosTechMask tech_mask); // downward calls // All below functions are to be defined by adapter specific modules: @@ -141,45 +164,43 @@ public: virtual void* getSibling(); virtual LocApiProxyBase* getLocApiProxy(); - virtual enum loc_api_adapter_err - startFix(const LocPosMode& posMode); - virtual enum loc_api_adapter_err - stopFix(); - virtual LocationError - deleteAidingData(const GnssAidingData& data); - 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 + virtual void startFix(const LocPosMode& fixCriteria, LocApiResponse* adapterResponse); + virtual void + stopFix(LocApiResponse* adapterResponse); + virtual void + deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse); + + virtual void injectPosition(double latitude, double longitude, float accuracy); - virtual enum loc_api_adapter_err + virtual void setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); + + // // TODO:: called from izatapipds 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, LocAGpsType agpsType); - virtual enum loc_api_adapter_err + + virtual void + atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, + AGpsBearerType bear, LocAGpsType agpsType); + virtual void atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err + virtual void setPositionMode(const LocPosMode& posMode); virtual LocationError - setServer(const char* url, int len); + setServerSync(const char* url, int len); virtual LocationError - setServer(unsigned int ip, int port, + setServerSync(unsigned int ip, int port, LocServerType type); - virtual LocationError + virtual void informNiResponse(GnssNiResponse userResponse, const void* passThroughData); - virtual LocationError setSUPLVersion(GnssConfigSuplVersion version); + virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version); virtual enum loc_api_adapter_err - setNMEATypes (uint32_t typesMask); - virtual LocationError setLPPConfig(GnssConfigLppProfile profile); + setNMEATypesSync(uint32_t typesMask); + virtual LocationError setLPPConfigSync(GnssConfigLppProfile profile); virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider); + setSensorControlConfigSync(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err - setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, + setSensorPropertiesSync(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, @@ -190,7 +211,7 @@ public: bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk); virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, + setSensorPerfControlConfigSync(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, int gyroSamplesPerBatch, @@ -201,16 +222,18 @@ public: int gyroBatchesPerSecHigh, int algorithmConfig); virtual LocationError - setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); - virtual LocationError setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP); - virtual LocationError setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP); + setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); + virtual LocationError setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask lppeCP); + virtual LocationError setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask lppeUP); + virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); + virtual GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); + virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); + virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); + virtual enum loc_api_adapter_err getWwanZppFix(); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, - LocPosTechMask & tech_mask); + virtual void + getBestAvailableZppFix(); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); @@ -223,21 +246,11 @@ public: (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(); - virtual LocationError setGpsLock(GnssConfigGpsLock lock); + virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); /* Returns Current value of GPS Lock on success @@ -245,20 +258,11 @@ public: */ virtual int getGpsLock(void); - virtual LocationError setXtraVersionCheck(uint32_t check); - /* - Check if the modem support the service - */ - virtual bool gnssConstellationConfig(); + virtual LocationError setXtraVersionCheckSync(uint32_t check); - /* - 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, +typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase *context); } // namespace loc_core diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 6ce0c345..d6a75aba 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -360,13 +360,13 @@ void AgpsStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 1, getAPN(), + subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(), getBearer(), mAgpsType); break; case AGPS_EVENT_DENIED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 0, getAPN(), + subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(), getBearer(), mAgpsType); break; @@ -661,7 +661,7 @@ void DSStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 1, NULL, + subscriberToNotify->mConnHandle, 1, NULL, 0, AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES); break; @@ -778,7 +778,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); mAtlOpenStatusCb( - connHandle, 0, NULL, AGPS_APN_BEARER_INVALID, agpsType); + connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType); return; } diff --git a/gnss/Agps.h b/gnss/Agps.h index 703a4750..f9a54f84 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -40,7 +40,7 @@ /* ATL callback function pointers * Passed in by Adapter to AgpsManager */ typedef std::function AgpsAtlOpenStatusCb; typedef std::function AgpsAtlCloseStatusCb; @@ -169,6 +169,7 @@ public: /* Getter/Setter methods */ void setAPN(char* apn, unsigned int len); inline char* getAPN() const { return (char*)mAPN; } + inline uint32_t getAPNLen() const { return mAPNLen; } inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline AGpsBearerType getBearer() const { return mBearer; } inline AGpsExtType getType() const { return mAgpsType; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f996ebee..91c88d6b 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -92,11 +92,11 @@ GnssAdapter::GnssAdapter() : /* Set ATL open/close callbacks */ AgpsAtlOpenStatusCb atlOpenStatusCb = - [this](int handle, int isSuccess, char* apn, + [this](int handle, int isSuccess, char* apn, uint32_t apnLen, AGpsBearerType bearerType, AGpsExtType agpsType) { mLocApi->atlOpenStatus( - handle, isSuccess, apn, bearerType, agpsType); + handle, isSuccess, apn, apnLen, bearerType, agpsType); }; AgpsAtlCloseStatusCb atlCloseStatusCb = [this](int handle, int isSuccess) { @@ -146,7 +146,7 @@ GnssAdapter::GnssAdapter() : dsClientCloseDataCallFn, dsClientReleaseFn, sendMsgFn); readConfigCommand(); - setConfigCommand(); + requestUlpCommand(); initDefaultAgpsCommand(); initEngHubProxyCommand(); } @@ -415,20 +415,6 @@ GnssAdapter::convertSuplVersion(const GnssConfigSuplVersion suplVersion) } } -inline GnssConfigSuplVersion -GnssAdapter::convertSuplVersion(const uint32_t suplVersion) -{ - switch (suplVersion) { - case 0x00020000: - return GNSS_CONFIG_SUPL_VERSION_2_0_0; - case 0x00020002: - return GNSS_CONFIG_SUPL_VERSION_2_0_2; - case 0x00010000: - default: - return GNSS_CONFIG_SUPL_VERSION_1_0_0; - } -} - inline uint32_t GnssAdapter::convertLppProfile(const GnssConfigLppProfile lppProfile) { @@ -445,22 +431,6 @@ GnssAdapter::convertLppProfile(const GnssConfigLppProfile lppProfile) } } -inline GnssConfigLppProfile -GnssAdapter::convertLppProfile(const uint32_t lppProfile) -{ - switch (lppProfile) { - case 1: - return GNSS_CONFIG_LPP_PROFILE_USER_PLANE; - case 2: - return GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; - case 3: - return GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; - case 0: - default: - return GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; - } -} - uint32_t GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask) { @@ -480,26 +450,6 @@ GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlane return mask; } -GnssConfigLppeControlPlaneMask -GnssAdapter::convertLppeCp(const uint32_t lppeControlPlaneMask) -{ - GnssConfigLppeControlPlaneMask mask = 0; - if ((1<<0) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT; - } - if ((1<<1) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT; - } - if ((1<<2) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT; - } - if ((1<<3) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; - } - return mask; -} - - uint32_t GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) { @@ -519,25 +469,6 @@ GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) return mask; } -GnssConfigLppeUserPlaneMask -GnssAdapter::convertLppeUp(const uint32_t lppeUserPlaneMask) -{ - GnssConfigLppeUserPlaneMask mask = 0; - if ((1<<0) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT; - } - if ((1<<1) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT; - } - if ((1<<2) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT; - } - if ((1<<3) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; - } - return mask; -} - uint32_t GnssAdapter::convertAGloProt(const GnssConfigAGlonassPositionProtocolMask aGloPositionProtocolMask) { @@ -594,27 +525,6 @@ GnssAdapter::convertSuplMode(const GnssConfigSuplModeMask suplModeMask) return mask; } -bool -GnssAdapter::resolveInAddress(const char* hostAddress, struct in_addr* inAddress) -{ - bool ret = true; - - struct hostent* hp; - hp = gethostbyname(hostAddress); - if (hp != NULL) { /* DNS OK */ - memcpy(inAddress, hp->h_addr_list[0], hp->h_length); - } else { - /* Try IP representation */ - if (inet_aton(hostAddress, inAddress) == 0) { - /* IP not valid */ - LOC_LOGE("%s]: DNS query on '%s' failed", __func__, hostAddress); - ret = false; - } - } - - return ret; -} - void GnssAdapter::readConfigCommand() { @@ -640,17 +550,37 @@ GnssAdapter::readConfigCommand() } } -LocationError +void +GnssAdapter::requestUlpCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgRequestUlp : public LocMsg { + GnssAdapter* mAdapter; + ContextBase& mContext; + inline MsgRequestUlp(GnssAdapter* adapter, + ContextBase& context) : + LocMsg(), + mAdapter(adapter), + mContext(context) {} + inline virtual void proc() const { + mContext.requestUlp((LocAdapterBase*)mAdapter, mContext.getCarrierCapabilities()); + } + }; + + if (mContext != NULL) { + sendMsg(new MsgRequestUlp(this, *mContext)); + } +} + +void GnssAdapter::setSuplHostServer(const char* server, int port) { - LocationError locErr = LOCATION_ERROR_SUCCESS; if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { char serverUrl[MAX_URL_LEN] = {}; int32_t length = -1; const char noHost[] = "NONE"; - locErr = LOCATION_ERROR_INVALID_PARAMETER; - if ((NULL == server) || (server[0] == 0) || (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { serverUrl[0] = NULL; @@ -662,14 +592,8 @@ GnssAdapter::setSuplHostServer(const char* server, int port) if (length >= 0 && strncasecmp(getServerUrl().c_str(), serverUrl, sizeof(serverUrl)) != 0) { setServerUrl(serverUrl); - locErr = mLocApi->setServer(serverUrl, length); - if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", - __func__, serverUrl); - } } } - return locErr; } void @@ -680,68 +604,105 @@ GnssAdapter::setConfigCommand() struct MsgSetConfig : public LocMsg { GnssAdapter& mAdapter; LocApiBase& mApi; - inline MsgSetConfig(GnssAdapter& adapter, - LocApiBase& api) : + inline MsgSetConfig(GnssAdapter& adapter, LocApiBase& api) : LocMsg(), mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - mApi.setSUPLVersion(mAdapter.convertSuplVersion(ContextBase::mGps_conf.SUPL_VER)); - mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE)); - mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT); - } - mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, - ContextBase::mGps_conf.SUPL_PORT); - mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE, - ContextBase::mSap_conf.SENSOR_PROVIDER); - mApi.setLPPeProtocolCp( - mAdapter.convertLppeCp(ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY)); - mApi.setLPPeProtocolUp( - mAdapter.convertLppeUp(ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY)); // set nmea mask type uint32_t mask = 0; if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; } - if (mApi.isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { mask |= LOC_NMEA_MASK_DEBUG_V02; } - if (mask != 0) { - mApi.setNMEATypes(mask); - } mAdapter.mNmeaMask= mask; - mApi.setXtraVersionCheck(ContextBase::mGps_conf.XTRA_VERSION_CHECK); - if (ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID || - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - mApi.setSensorProperties( - ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, - ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK, - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); - } - mApi.setSensorPerfControlConfig( - ContextBase::mSap_conf.SENSOR_CONTROL_MODE, - ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, - ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - ContextBase::mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK); + std::string oldServerUrl = mAdapter.getServerUrl(); + mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, + ContextBase::mGps_conf.SUPL_PORT); + + // inject the configurations into modem + GnssAdapter& adapter = mAdapter; + loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; + loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; + + mApi.sendMsg(new LocApiMsg( + [&adapter, gpsConf, sapConf, oldServerUrl] () { + + std::string serverUrl = adapter.getServerUrl(); + int serverUrlLen = serverUrl.length(); + + if (gpsConf.AGPS_CONFIG_INJECT) { + adapter.mLocApi->setSUPLVersionSync( + adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER)); + adapter.mLocApi->setLPPConfigSync( + adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE)); + adapter.mLocApi->setAGLONASSProtocolSync( + gpsConf.A_GLONASS_POS_PROTOCOL_SELECT); + } + + if ((serverUrlLen !=0) && (oldServerUrl.compare(serverUrl) != 0)) { + LocationError locErr = + adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", + __func__, serverUrl.c_str()); + } + } + + adapter.mLocApi->setSensorControlConfigSync(sapConf.SENSOR_USAGE, + sapConf.SENSOR_PROVIDER); + adapter.mLocApi->setLPPeProtocolCpSync( + adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY)); + adapter.mLocApi->setLPPeProtocolUpSync( + adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY)); + + // set nmea mask type + uint32_t mask = 0; + if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } + + if (mask != 0) { + adapter.mLocApi->setNMEATypesSync(mask); + } + + adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + adapter.mLocApi->setSensorPropertiesSync( + sapConf.GYRO_BIAS_RANDOM_WALK_VALID, + sapConf.GYRO_BIAS_RANDOM_WALK, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); + } + adapter.mLocApi->setSensorPerfControlConfigSync( + sapConf.SENSOR_CONTROL_MODE, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_ALGORITHM_CONFIG_MASK); + } )); } }; @@ -783,8 +744,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) GnssAdapter& mAdapter; LocApiBase& mApi; GnssConfig mConfig; - uint32_t* mIds; size_t mCount; + uint32_t* mIds; inline MsgGnssUpdateConfig(GnssAdapter& adapter, LocApiBase& api, GnssConfig config, @@ -794,163 +755,260 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) mAdapter(adapter), mApi(api), mConfig(config), - mIds(ids), - mCount(count) {} + mCount(count), + mIds(ids) {} inline virtual ~MsgGnssUpdateConfig() { - delete[] mIds; + delete [] mIds; } + inline virtual void proc() const { - LocationError* errs = new LocationError[mCount]; - LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t index = 0; - if (errs == nullptr) { - LOC_LOGE("%s] new allocation failed, fatal error.", __func__); - return; - } + GnssAdapter& adapter = mAdapter; + size_t countOfConfigs = mCount; + GnssConfig gnssConfigRequested = mConfig; + GnssConfig gnssConfigNeedEngineUpdate = mConfig; + std::string oldServerUrl = mAdapter.getServerUrl(); - if (mConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - uint32_t newGpsLock = mAdapter.convertGpsLock(mConfig.gpsLock); + std::vector sessionIds; + sessionIds.assign(mIds, mIds + mCount); + std::vector errs(mCount, LOCATION_ERROR_SUCCESS); + int index = 0; + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + index++; + uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; - if (0 == mAdapter.getPowerVoteId()) { - err = mApi.setGpsLock(mConfig.gpsLock); - } - if (index < mCount) { - errs[index++] = err; + if (0 != mAdapter.getPowerVoteId()) { + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion); + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + index++; + uint32_t newSuplVersion = + mAdapter.convertSuplVersion(gnssConfigRequested.suplVersion); if (newSuplVersion != ContextBase::mGps_conf.SUPL_VER && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.SUPL_VER = newSuplVersion; - err = mApi.setSUPLVersion(mConfig.suplVersion); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + index++; if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { - err = mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, - mConfig.assistanceServer.port); - } else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) { - if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - struct in_addr addr; - if (!mAdapter.resolveInAddress(mConfig.assistanceServer.hostName, - &addr)) { - LOC_LOGE("%s]: hostName %s cannot be resolved", - __func__, mConfig.assistanceServer.hostName); - err = LOCATION_ERROR_INVALID_PARAMETER; - } else { - unsigned int ip = htonl(addr.s_addr); - err = mApi.setServer(ip, mConfig.assistanceServer.port, - LOC_AGPS_CDMA_PDE_SERVER); - } - } else { - err = LOCATION_ERROR_SUCCESS; - } - } else { + mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, + mConfig.assistanceServer.port); + } else if (GNSS_ASSISTANCE_TYPE_C2K != mConfig.assistanceServer.type) { LOC_LOGE("%s]: Not a valid gnss assistance type %u", - __func__, mConfig.assistanceServer.type); - err = LOCATION_ERROR_INVALID_PARAMETER; - } - if (index < mCount) { - errs[index++] = err; + __func__, mConfig.assistanceServer.type); + errs.at(index) = LOCATION_ERROR_INVALID_PARAMETER; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile); + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + index++; + uint32_t newLppProfile = mAdapter.convertLppProfile(gnssConfigRequested.lppProfile); if (newLppProfile != ContextBase::mGps_conf.LPP_PROFILE && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.LPP_PROFILE = newLppProfile; - err = mApi.setLPPConfig(mConfig.lppProfile); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + index++; uint32_t newLppeControlPlaneMask = - mAdapter.convertLppeCp(mConfig.lppeControlPlaneMask); + mAdapter.convertLppeCp(gnssConfigRequested.lppeControlPlaneMask); if (newLppeControlPlaneMask != ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY) { ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY = newLppeControlPlaneMask; - err = mApi.setLPPeProtocolCp(mConfig.lppeControlPlaneMask); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + index++; uint32_t newLppeUserPlaneMask = - mAdapter.convertLppeUp(mConfig.lppeUserPlaneMask); + mAdapter.convertLppeUp(gnssConfigRequested.lppeUserPlaneMask); if (newLppeUserPlaneMask != ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY) { ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY = newLppeUserPlaneMask; - err = mApi.setLPPeProtocolUp(mConfig.lppeUserPlaneMask); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + index++; uint32_t newAGloProtMask = - mAdapter.convertAGloProt(mConfig.aGlonassPositionProtocolMask); + mAdapter.convertAGloProt(gnssConfigRequested.aGlonassPositionProtocolMask); if (newAGloProtMask != ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = newAGloProtMask; - err = mApi.setAGLONASSProtocol(mConfig.aGlonassPositionProtocolMask); } else { - err = LOCATION_ERROR_SUCCESS; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT); } - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { - uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + index++; + uint32_t newEP4ES = mAdapter.convertEP4ES( + gnssConfigRequested.emergencyPdnForEmergencySupl); if (newEP4ES != ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = newEP4ES; } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { - uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + index++; + uint32_t newSuplEs = mAdapter.convertSuplEs( + gnssConfigRequested.suplEmergencyServices); if (newSuplEs != ContextBase::mGps_conf.SUPL_ES) { ContextBase::mGps_conf.SUPL_ES = newSuplEs; } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { - uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + index++; + uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { ContextBase::mGps_conf.SUPL_MODE = newSuplMode; mAdapter.getUlpProxy()->setCapabilities( ContextBase::getCarrierCapabilities()); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } } - mAdapter.reportResponse(index, errs, mIds); - delete[] errs; + LocApiCollectiveResponse *configCollectiveResponse = new LocApiCollectiveResponse( + *adapter.getContext(), + [&adapter, sessionIds, countOfConfigs] (std::vector errs) { + + std::vector ids(sessionIds); + adapter.reportResponse(countOfConfigs, errs.data(), ids.data()); + }); + + mApi.sendMsg(new LocApiMsg( + [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, + countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () { + + size_t index = 0; + LocationError err = LOCATION_ERROR_SUCCESS; + std::vector errsList(errs); + + std::string serverUrl = adapter.getServerUrl(); + int serverUrlLen = serverUrl.length(); + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + err = adapter.mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_SUPL) { + if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { + err = adapter.mLocApi->setServerSync( + serverUrl.c_str(), serverUrlLen); + errsList[index] = err; + } + } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_C2K) { + struct in_addr addr; + struct hostent* hp; + bool resolveAddrSuccess = true; + + hp = gethostbyname( + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + if (hp != NULL) { /* DNS OK */ + memcpy(&addr, hp->h_addr_list[0], hp->h_length); + } else { + /* Try IP representation */ + if (inet_aton( + gnssConfigNeedEngineUpdate.assistanceServer.hostName, + &addr) == 0) { + /* IP not valid */ + LOC_LOGE("%s]: hostname '%s' cannot be resolved ", + __func__, + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; + } else { + resolveAddrSuccess = false; + } + } + + if (resolveAddrSuccess) { + unsigned int ip = htonl(addr.s_addr); + err = adapter.mLocApi->setServerSync(ip, + gnssConfigNeedEngineUpdate.assistanceServer.port, + LOC_AGPS_CDMA_PDE_SERVER); + errsList[index] = err; + } + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + err = adapter.mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + err = adapter.mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + err = adapter.mLocApi->setLPPeProtocolCpSync( + gnssConfigRequested.lppeControlPlaneMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + err = adapter.mLocApi->setLPPeProtocolUpSync( + gnssConfigRequested.lppeUserPlaneMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + err = adapter.mLocApi->setAGLONASSProtocolSync( + gnssConfigRequested.aGlonassPositionProtocolMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + configCollectiveResponse->returnToSender(errsList); + })); } }; @@ -963,6 +1021,13 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) return ids; } +void GnssAdapter::deleteAidingData(const GnssAidingData &data, uint32_t sessionId) { + mLocApi->deleteAidingData(data, new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId); + })); +} + uint32_t GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) { @@ -971,22 +1036,18 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) struct MsgDeleteAidingData : public LocMsg { GnssAdapter& mAdapter; - LocApiBase& mApi; uint32_t mSessionId; GnssAidingData mData; inline MsgDeleteAidingData(GnssAdapter& adapter, - LocApiBase& api, uint32_t sessionId, GnssAidingData& data) : LocMsg(), mAdapter(adapter), - mApi(api), mSessionId(sessionId), mData(data) {} inline virtual void proc() const { - LocationError err = LOCATION_ERROR_SUCCESS; - err = mApi.deleteAidingData(mData); - mAdapter.reportResponse(err, mSessionId); + mAdapter.deleteAidingData(mData, mSessionId); + SystemStatus* s = mAdapter.getSystemStatus(); if ((nullptr != s) && (mData.deleteAll)) { s->setDefaultGnssEngineStates(); @@ -995,7 +1056,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) } }; - sendMsg(new MsgDeleteAidingData(*this, *mLocApi, sessionId, data)); + sendMsg(new MsgDeleteAidingData(*this, sessionId, data)); return sessionId; } @@ -1187,11 +1248,9 @@ GnssAdapter::stopClientSessions(LocationAPI* client) LOC_LOGD("%s]: client %p", __func__, client); for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end();) { if (client == it->first.client) { - LocationError err = stopTrackingMultiplex(it->first.client, it->first.id); - if (LOCATION_ERROR_SUCCESS == err) { - it = mTrackingSessions.erase(it); - continue; - } + stopTrackingMultiplex(it->first.client, it->first.id); + it = mTrackingSessions.erase(it); + continue; } ++it; // increment only when not erasing an iterator } @@ -1244,18 +1303,23 @@ GnssAdapter::updateClientsEventMask() void GnssAdapter::handleEngineUpEvent() { - struct MsgRestartSessions : public LocMsg { + LOC_LOGD("%s]: ", __func__); + + struct MsgHandleEngineUpEvent : public LocMsg { GnssAdapter& mAdapter; - inline MsgRestartSessions(GnssAdapter& adapter) : + inline MsgHandleEngineUpEvent(GnssAdapter& adapter) : LocMsg(), mAdapter(adapter) {} virtual void proc() const { + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); + // restart sessions mAdapter.restartSessions(); } }; + readConfigCommand(); setConfigCommand(); - sendMsg(new MsgRestartSessions(*this)); + sendMsg(new MsgHandleEngineUpEvent(*this)); } void @@ -1279,11 +1343,9 @@ GnssAdapter::restartSessions() LocPosMode locPosMode = {}; convertOptions(locPosMode, smallestIntervalOptions); - // inform engine hub of the fix mode and start session - mEngHubProxy->gnssSetFixMode(locPosMode); - mEngHubProxy->gnssStartFix(); - - mLocApi->startFix(locPosMode); + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [] (LocationError err) {} + )); } void @@ -1306,12 +1368,14 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) return; } - LocationCapabilitiesMask mask = mAdapter.getCapabilities(); - callbacks.capabilitiesCb(mask); + LocationCapabilitiesMask mask = mAdapter.getCapabilities(); + callbacks.capabilitiesCb(mask); } }; - sendMsg(new MsgRequestCapabilities(*this, client)); + if (ContextBase::isEngineCapabilitiesKnown()) { + sendMsg(new MsgRequestCapabilities(*this, client)); + } } LocationCapabilitiesMask @@ -1329,22 +1393,20 @@ GnssAdapter::getCapabilities() if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; } - if (mLocApi == nullptr) - return mask; - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; } - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; } - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; } - if (mLocApi->gnssConstellationConfig()) { + if (ContextBase::gnssConstellationConfig()) { mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; } - if (mLocApi->isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; } return mask; @@ -1353,9 +1415,9 @@ GnssAdapter::getCapabilities() void GnssAdapter::broadcastCapabilities(LocationCapabilitiesMask mask) { - for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { - if (nullptr != it->second.capabilitiesCb) { - it->second.capabilitiesCb(mask); + for (auto clientData : mClientData) { + if (nullptr != clientData.second.capabilitiesCb) { + clientData.second.capabilitiesCb(mask); } } } @@ -1443,8 +1505,7 @@ GnssAdapter::reportResponse(LocationAPI* client, LocationError err, uint32_t ses LOC_LOGD("%s]: client %p id %u err %u", __func__, client, sessionId, err); auto it = mClientData.find(client); - if (it != mClientData.end() && - it->second.responseCb != nullptr) { + if (it != mClientData.end() && it->second.responseCb != nullptr) { it->second.responseCb(err, sessionId); } else { LOC_LOGW("%s]: client %p id %u not found in data", __func__, client, sessionId); @@ -1522,12 +1583,14 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) err = LOCATION_ERROR_INVALID_PARAMETER; } else { // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.startTrackingMultiplex(mOptions); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + bool reportToClientWithNoWait = + mAdapter.startTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); } } - mAdapter.reportResponse(mClient, err, mSessionId); } }; @@ -1536,13 +1599,14 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) } -LocationError -GnssAdapter::startTrackingMultiplex(const LocationOptions& options) +bool +GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; if (mTrackingSessions.empty()) { - err = startTracking(options); + reportToClientWithNoWait = startTracking(client, sessionId, options); } else { // get the LocationOptions that has the smallest interval, which should be the active one LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time @@ -1555,17 +1619,19 @@ GnssAdapter::startTrackingMultiplex(const LocationOptions& options) // if new session's minInterval is smaller than any in other sessions if (options.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with new options - err = startTracking(options); + reportToClientWithNoWait = startTracking(client, sessionId, options); } } - return err; + return reportToClientWithNoWait; } -LocationError -GnssAdapter::startTracking(const LocationOptions& options) +bool +GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + LocPosMode locPosMode = {}; convertOptions(locPosMode, options); if (!mUlpProxy->sendFixMode(locPosMode)) { @@ -1576,17 +1642,56 @@ GnssAdapter::startTracking(const LocationOptions& options) mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - loc_api_adapter_err apiErr = mLocApi->startFix(locPosMode); - if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { - err = LOCATION_ERROR_SUCCESS; - } else { - err = LOCATION_ERROR_GENERAL_FAILURE; - } + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + eraseTrackingSession(client, sessionId); + } + + reportResponse(client, err, sessionId); + } + )); + + reportToClientWithNoWait = false; } - return err; + return reportToClientWithNoWait; } +bool +GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& updatedOptions, const LocationOptions& oldOptions) +{ + bool reportToClientWithNoWait = true; + + LocPosMode locPosMode = {}; + convertOptions(locPosMode, updatedOptions); + if (!mUlpProxy->sendFixMode(locPosMode)) { + // do nothing + } + if (!mUlpProxy->sendStartFix()) { + // inform engine hub that GNSS session is about to start + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); + + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId, oldOptions] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + // restore the old LocationOptions + saveTrackingSession(client, sessionId, oldOptions); + } + + reportResponse(client, err, sessionId); + } + )); + + reportToClientWithNoWait = false; + } + + return reportToClientWithNoWait; +} + + void GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) { @@ -1640,8 +1745,11 @@ GnssAdapter::startTrackingCommand() // inform engine hub of the fix mode and start session mAdapter.mEngHubProxy->gnssSetFixMode(ulpPositionMode); mAdapter.mEngHubProxy->gnssStartFix(); - if (!mAdapter.isInSession()) { - mApi.startFix(ulpPositionMode); + if (!mAdapter.isInSession()) { + LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + mApi.startFix(ulpPositionMode, new LocApiResponse(*mAdapter.getContext(), + [] (LocationError err) {} + )); } } }; @@ -1680,12 +1788,14 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, err = LOCATION_ERROR_INVALID_PARAMETER; } else { // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + bool reportToClientWithNoWait = + mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, err, mSessionId); } } - mAdapter.reportResponse(mClient, err, mSessionId); } // we do not reportResponse for the case where there is no existing tracking session // for the client and id being used, since updateTrackingCommand can be sent to both @@ -1696,19 +1806,21 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, sendMsg(new MsgUpdateTracking(*this, *mLocApi, client, id, options)); } -LocationError +bool GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + + LocationSessionKey key(client, id); + // get the session we are updating + auto it = mTrackingSessions.find(key); + // cache the clients existing LocationOptions + LocationOptions oldOptions = it->second; if (1 == mTrackingSessions.size()) { - err = startTracking(options); + reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); } else { - LocationSessionKey key(client, id); - - // get the session we are updating - auto it = mTrackingSessions.find(key); if (it != mTrackingSessions.end()) { // find the smallest interval, other than the session we are updating LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time @@ -1723,16 +1835,17 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, // if session we are updating has smaller interval then next smallest if (options.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with the newly updated interval - err = startTracking(options); + reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); // else if the session we are updating used to be the smallest } else if (it->second.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with the next smallest - err = startTracking(smallestIntervalOptions); + reportToClientWithNoWait = updateTracking( + client, id, smallestIntervalOptions, oldOptions); } } } - return err; + return reportToClientWithNoWait; } void @@ -1756,31 +1869,31 @@ GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) mSessionId(sessionId) {} inline virtual void proc() const { if (mAdapter.isTrackingSession(mClient, mSessionId)) { - LocationError err = LOCATION_ERROR_SUCCESS; // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.stopTrackingMultiplex(mClient, mSessionId); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.eraseTrackingSession(mClient, mSessionId); + bool reportToClientWithNoWait = + mAdapter.stopTrackingMultiplex(mClient, mSessionId); + mAdapter.eraseTrackingSession(mClient, mSessionId); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); } - mAdapter.reportResponse(mClient, err, mSessionId); } // we do not reportResponse for the case where there is no existing tracking session // for the client and id being used, since stopTrackingCommand can be sent to both // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response - } }; sendMsg(new MsgStopTracking(*this, *mLocApi, client, id)); } -LocationError +bool GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; if (1 == mTrackingSessions.size()) { - err = stopTracking(); + reportToClientWithNoWait = stopTracking(client, id); } else { LocationSessionKey key(client, id); @@ -1800,31 +1913,32 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) // if session we are stopping has smaller interval then next smallest if (it->second.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with next smallest interval - err = startTracking(smallestIntervalOptions); + reportToClientWithNoWait = startTracking(client, id, smallestIntervalOptions); } } } - return err; + return reportToClientWithNoWait; } -LocationError -GnssAdapter::stopTracking() +bool +GnssAdapter::stopTracking(LocationAPI* client, uint32_t id) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + if (!mUlpProxy->sendStopFix()) { // inform engine hub that GNSS session has stopped mEngHubProxy->gnssStopFix(); - loc_api_adapter_err apiErr = mLocApi->stopFix(); - if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { - err = LOCATION_ERROR_SUCCESS; - } else { - err = LOCATION_ERROR_GENERAL_FAILURE; - } + mLocApi->stopFix(new LocApiResponse(*getContext(), + [this, client, id] (LocationError err) { + reportResponse(client, err, id); + })); + + reportToClientWithNoWait = false; } - return err; + return reportToClientWithNoWait; } void @@ -1849,7 +1963,9 @@ GnssAdapter::stopTrackingCommand() mLocPosMode.mode = LOC_POSITION_MODE_INVALID; mAdapter.setUlpPositionMode(mLocPosMode); // don't need to multiplex because ULP will do that for us if it is present - mApi.stopFix(); + mApi.stopFix(new LocApiResponse(*mAdapter.getContext(), + [] (LocationError /* err*/) {} + )); } }; @@ -1870,24 +1986,12 @@ GnssAdapter::getZppCommand() mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - UlpLocation location = {}; - LocPosTechMask techMask = LOC_POS_TECH_MASK_DEFAULT; - GpsLocationExtended locationExtended = {}; - locationExtended.size = sizeof(locationExtended); - - mApi.getBestAvailableZppFix(location.gpsLocation, locationExtended, - techMask); - //Mark the location source as from ZPP - location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; - location.position_source = ULP_LOCATION_IS_FROM_ZPP; - - mAdapter.getUlpProxy()->reportPosition(location, - locationExtended, - LOC_SESS_SUCCESS, - techMask); + mApi.getBestAvailableZppFix(); } }; + // TODO: we could avoid this extra context switch, as getBestAvailableZppFix + // will return asynchronously anyways. sendMsg(new MsgGetZpp(*this, *mLocApi)); } @@ -1971,28 +2075,28 @@ GnssAdapter::gnssNiResponseCommand(GnssNiResponse response, void* rawRequest) LOC_LOGD("%s]: response %u", __func__, response); struct MsgGnssNiResponse : public LocMsg { + GnssAdapter& mAdapter; LocApiBase& mApi; const GnssNiResponse mResponse; const void* mPayload; - inline MsgGnssNiResponse(LocApiBase& api, + inline MsgGnssNiResponse(GnssAdapter& adapter, + LocApiBase& api, const GnssNiResponse response, const void* rawRequest) : LocMsg(), + mAdapter(adapter), mApi(api), mResponse(response), mPayload(rawRequest) {} inline virtual ~MsgGnssNiResponse() { - // 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 { + const void *rawPayload = mPayload; mApi.informNiResponse(mResponse, mPayload); } }; - sendMsg(new MsgGnssNiResponse(*mLocApi, response, rawRequest)); + sendMsg(new MsgGnssNiResponse(*this, *mLocApi, response, rawRequest)); } @@ -2029,7 +2133,11 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) } else { mContext.modemPowerVote(true); mAdapter.setPowerVoteId(mSessionId); - mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); + + mApi.sendMsg(new LocApiMsg([&mApi = mApi] () { + mApi.setGpsLockSync(GNSS_CONFIG_GPS_LOCK_NONE); + })); + mAdapter.mXtraObserver.updateLockStatus( mAdapter.convertGpsLock(GNSS_CONFIG_GPS_LOCK_NONE)); } @@ -2073,7 +2181,12 @@ GnssAdapter::disableCommand(uint32_t id) } else { mContext.modemPowerVote(false); mAdapter.setPowerVoteId(0); - mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); + + GnssConfigGpsLock gpsLock = + mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK); + mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { + mApi.setGpsLockSync(gpsLock); + })); mAdapter.mXtraObserver.updateLockStatus( mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); } @@ -2810,6 +2923,41 @@ bool GnssAdapter::reportDataCallClosed(){ return true; } +bool GnssAdapter::reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask) { + + struct MsgReportZpp : public LocMsg { + GnssAdapter& mAdapter; + UlpLocation mUlpLocation; + GpsLocationExtended mGpsLocationExtended; + LocPosTechMask mPosTechMask; + + inline MsgReportZpp(GnssAdapter& adapter, + LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, + LocPosTechMask tech_mask) : + LocMsg(), + mAdapter(adapter), + mGpsLocationExtended(location_extended), + mPosTechMask(tech_mask) { + mUlpLocation = {}; + memcpy(&mUlpLocation.gpsLocation, &zppLoc, sizeof(LocGpsLocation)); + + //Mark the location source as from ZPP + mUlpLocation.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; + mUlpLocation.position_source = ULP_LOCATION_IS_FROM_ZPP; + } + inline virtual void proc() const { + mAdapter.getUlpProxy()->reportPosition(mUlpLocation, + mGpsLocationExtended, + LOC_SESS_SUCCESS, + mPosTechMask); + } + }; + + sendMsg(new MsgReportZpp(*this, zppLoc, location_extended, tech_mask)); + return true; +} + void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType){ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index c1e17545..8d639fe8 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -157,7 +157,7 @@ public: LocationCallbacks getClientCallbacks(LocationAPI* client); LocationCapabilitiesMask getCapabilities(); void broadcastCapabilities(LocationCapabilitiesMask); - LocationError setSuplHostServer(const char* server, int port); + void setSuplHostServer(const char* server, int port); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -180,12 +180,16 @@ public: void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); bool setUlpPositionMode(const LocPosMode& mode); LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } - LocationError startTrackingMultiplex(const LocationOptions& options); - LocationError startTracking(const LocationOptions& options); - LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id); - LocationError stopTracking(); - LocationError updateTrackingMultiplex(LocationAPI* client, uint32_t id, + bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options); + bool startTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options); + bool stopTrackingMultiplex(LocationAPI* client, uint32_t id); + bool stopTracking(LocationAPI* client, uint32_t id); + bool updateTrackingMultiplex(LocationAPI* client, uint32_t id, const LocationOptions& options); + bool updateTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& updatedOptions, const LocationOptions& oldOptions); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -203,9 +207,11 @@ public: void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); void readConfigCommand(); void setConfigCommand(); + void requestUlpCommand(); void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); void initDefaultAgpsCommand(); @@ -224,7 +230,6 @@ public: { mControlCallbacks = controlCallbacks; } void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } uint32_t getPowerVoteId() { return mPowerVoteId; } - bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); virtual bool isInSession() { return !mTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); @@ -249,6 +254,8 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); + virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, @@ -276,15 +283,11 @@ public: static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock); static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion); - static GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile); - static GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl); static uint32_t convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices); static uint32_t convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask); - static GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); static uint32_t convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask); - static GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask); static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask); static void convertSatelliteInfo(std::vector& out, diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 7ee60892..db20c15a 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -7,7 +7,7 @@ AM_CFLAGS = \ -I../utils \ -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ -I../location \ - -std=c++11 + -std=c++1y libgnss_la_SOURCES = \ location_gnss.cpp \ From 746606807f7189caa0f4deed77e41741a9fa1140 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 23:00:16 -0700 Subject: [PATCH 638/945] renamed DataItemIndex and ClientIndex files and moved them into utils. Change-Id: I138471168bf58d2cf09c6a435088edea29a567d0 CRs-Fixed: 2218519 --- core/data-items/common/ClientIndex.h => utils/LocListMap.h | 0 .../common/DataItemIndex.h => utils/LocUnorderedSetMap.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename core/data-items/common/ClientIndex.h => utils/LocListMap.h (100%) rename core/data-items/common/DataItemIndex.h => utils/LocUnorderedSetMap.h (100%) diff --git a/core/data-items/common/ClientIndex.h b/utils/LocListMap.h similarity index 100% rename from core/data-items/common/ClientIndex.h rename to utils/LocListMap.h diff --git a/core/data-items/common/DataItemIndex.h b/utils/LocUnorderedSetMap.h similarity index 100% rename from core/data-items/common/DataItemIndex.h rename to utils/LocUnorderedSetMap.h From 395001f24d4100fbcd69d77badd25f476ee32b80 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 22:57:51 -0700 Subject: [PATCH 639/945] changed SystemStatusOsObserver to allow clients to subscribe before subscription obj arrives, and also simplified ClientIndex and DataItemIndex implementation significantly. Change-Id: I092f344e688fa698aa98795b8a8f0c1ba8fcd9e4 CRs-Fixed: 2218519 --- core/Android.mk | 3 - core/Makefile.am | 3 - core/SystemStatus.cpp | 4 +- core/SystemStatusOsObserver.cpp | 623 ++++++++++------------- core/SystemStatusOsObserver.h | 94 ++-- core/data-items/common/ClientIndex.cpp | 172 ------- core/data-items/common/DataItemIndex.cpp | 203 -------- core/data-items/common/IClientIndex.h | 83 --- core/data-items/common/IDataItemIndex.h | 94 ---- core/data-items/common/IndexFactory.cpp | 64 --- core/data-items/common/IndexFactory.h | 48 -- utils/LocListMap.h | 70 --- utils/LocUnorderedSetMap.h | 166 +++++- 13 files changed, 473 insertions(+), 1154 deletions(-) delete mode 100644 core/data-items/common/ClientIndex.cpp delete mode 100644 core/data-items/common/DataItemIndex.cpp delete mode 100644 core/data-items/common/IClientIndex.h delete mode 100644 core/data-items/common/IDataItemIndex.h delete mode 100644 core/data-items/common/IndexFactory.cpp delete mode 100644 core/data-items/common/IndexFactory.h delete mode 100644 utils/LocListMap.h diff --git a/core/Android.mk b/core/Android.mk index 1374b6c0..82660d5e 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -31,9 +31,6 @@ LOCAL_SRC_FILES += \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/Makefile.am b/core/Makefile.am index dc540e9c..77bc6108 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -37,9 +37,6 @@ libloc_core_la_c_sources = \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 6eb99683..e12d9f32 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1694,9 +1694,7 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) // send networkinof dataitem to systemstatus observer clients SystemStatusNetworkInfo s(type, "", "", false, connected, false); - list dl(0); - dl.push_back(&s); - mSysStatusObsvr.notify(dl); + mSysStatusObsvr.notify({&s}); } return true; } diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 2fdd19f1..0f6d2289 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -32,28 +32,20 @@ #include #include #include -#include -#include -#include #include namespace loc_core { -SystemStatusOsObserver::SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask) : - mSystemStatus(systemstatus), - mAddress("SystemStatusOsObserver"), -#ifdef USE_GLIB - mBackHaulConnectReqCount(0), -#endif - mClientIndex(IndexFactory :: createClientIndex()), - mDataItemIndex(IndexFactory :: createDataItemIndex()) -{ - mContext.mMsgTask = msgTask; +template +COUT SystemStatusOsObserver::containerTransfer(CINT& inContainer) { + COUT outContainer(0); + for (auto item : inContainer) { + outContainer.insert(outContainer.begin(), item); + } + return outContainer; } -SystemStatusOsObserver::~SystemStatusOsObserver() -{ +SystemStatusOsObserver::~SystemStatusOsObserver() { // Close data-item library handle DataItemsFactoryProxy::closeDataItemLibraryHandle(); @@ -65,290 +57,238 @@ SystemStatusOsObserver::~SystemStatusOsObserver() } mDataItemCache.clear(); - delete mClientIndex; - delete mDataItemIndex; } void SystemStatusOsObserver::setSubscriptionObj(IDataItemSubscription* subscriptionObj) { - mContext.mSubscriptionObj = subscriptionObj; + struct SetSubsObj : public LocMsg { + ObserverContext& mContext; + IDataItemSubscription* mSubsObj; + inline SetSubsObj(ObserverContext& context, IDataItemSubscription* subscriptionObj) : + mContext(context), mSubsObj(subscriptionObj) {} + void proc() const { + mContext.mSubscriptionObj = mSubsObj; - LOC_LOGD("Request cache size - Subscribe:%zu RequestData:%zu", - mSubscribeReqCache.size(), mReqDataCache.size()); - - // we have received the subscription object. process cached requests - // process - subscribe request cache - for (auto each : mSubscribeReqCache) { - subscribe(each.second, each.first); - } - // process - requestData request cache - for (auto each : mReqDataCache) { - requestData(each.second, each.first); - } -} - -// Helper to cache requests subscribe and requestData till subscription obj is obtained -void SystemStatusOsObserver::cacheObserverRequest(ObserverReqCache& reqCache, - const list& l, IDataItemObserver* client) -{ - ObserverReqCache::iterator dicIter = reqCache.find(client); - if (dicIter != reqCache.end()) { - // found - list difference(0); - set_difference(l.begin(), l.end(), - dicIter->second.begin(), dicIter->second.end(), - inserter(difference, difference.begin())); - if (!difference.empty()) { - difference.sort(); - dicIter->second.merge(difference); - dicIter->second.unique(); + if (!mContext.mSSObserver->mDataItemToClients.empty()) { + list dis( + containerTransfer, list>( + mContext.mSSObserver->mDataItemToClients.getKeys())); + mContext.mSubscriptionObj->subscribe(dis, mContext.mSSObserver); + mContext.mSubscriptionObj->requestData(dis, mContext.mSSObserver); + } } - } - else { - // not found - reqCache[client] = l; + }; + + if (nullptr == subscriptionObj) { + LOC_LOGw("subscriptionObj is NULL"); + } else { + mContext.mMsgTask->sendMsg(new SetSubsObj(mContext, subscriptionObj)); } } /****************************************************************************** IDataItemSubscription Overrides ******************************************************************************/ -void SystemStatusOsObserver::subscribe( - const list& l, IDataItemObserver* client) +void SystemStatusOsObserver::subscribe(const list& l, IDataItemObserver* client, + bool toRequestData) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mSubscribeReqCache, l, client); - return; - } - struct HandleSubscribeReq : public LocMsg { - HandleSubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleSubscribeReq() {} + inline HandleSubscribeReq(SystemStatusOsObserver* parent, + list& l, IDataItemObserver* client, bool requestData) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)), + mToRequestData(requestData) {} + void proc() const { + unordered_set dataItemsToSubscribe(0); + mParent->mDataItemToClients.add(mDataItemSet, {mClient}, &dataItemsToSubscribe); + mParent->mClientToDataItems.add(mClient, mDataItemSet); - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + mParent->sendCachedDataItems(mDataItemSet, mClient); - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); - - // Do not send first response for only pendingFirstResponseList, - // instead send for all the data items (present in the cache) that - // have been subscribed for each time. - mParent->sendFirstResponse(mDataItemList, mClient); - - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add(mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe(yetToSubscribeDataItemsList, mParent); + // Send subscription set to framework + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) { LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); + mParent->logMe(dataItemsToSubscribe); + + if (mToRequestData) { + mParent->mContext.mSubscriptionObj->requestData( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } else { + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } } } - SystemStatusOsObserver* mParent; + mutable SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + const unordered_set mDataItemSet; + bool mToRequestData; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleSubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleSubscribeReq(this, (list&)l, client, toRequestData)); + } } void SystemStatusOsObserver::updateSubscription( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUpdateSubscriptionReq : public LocMsg { HandleUpdateSubscriptionReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUpdateSubscriptionReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list currentlySubscribedList(0); - mParent->mClientIndex->getSubscribedList(mClient, currentlySubscribedList); - - list removeDataItemList(0); - set_difference(currentlySubscribedList.begin(), currentlySubscribedList.end(), - mDataItemList.begin(), mDataItemList.end(), - inserter(removeDataItemList,removeDataItemList.begin())); - - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); + unordered_set dataItemsToSubscribe(0); + unordered_set dataItemsToUnsubscribe(0); + unordered_set clients({mClient}); + // below removes clients from all entries keyed with the return of the + // mClientToDataItems.update() call. If leaving an empty set of clients as the + // result, the entire entry will be removed. dataItemsToUnsubscribe will be + // populated to keep the keys of the removed entries. + mParent->mDataItemToClients.trimOrRemove( + // this call updates map; removes + // the DataItemId's that are not new to the clietn from mDataItemSet; + // and returns a set of mDataItemSet's that are no longer used by client. + // This unused set of mDataItemSet's is passed to trimOrRemove method of + // map to remove the client from the + // corresponding entries, and gets a set of the entries that are + // removed from the map as a result. + mParent->mClientToDataItems.update(mClient, + (unordered_set&)mDataItemSet), + clients, &dataItemsToUnsubscribe, nullptr); + // below adds mClient to map, and populates + // new keys added to that map, which are DataItemIds to be subscribed. + mParent->mDataItemToClients.add(mDataItemSet, clients, &dataItemsToSubscribe); // Send First Response - mParent->sendFirstResponse(pendingFirstResponseList, mClient); + mParent->sendCachedDataItems(mDataItemSet, mClient); - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); + if (nullptr != mParent->mContext.mSubscriptionObj) { + // Send subscription set to framework + if (!dataItemsToSubscribe.empty()) { + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToSubscribe); - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe( - yetToSubscribeDataItemsList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, removeDataItemList, unused); - - if (!mParent->mClientIndex->isSubscribedClient(mClient)) { - mParent->mDataItemIndex->remove( - list (1,mClient), unsubscribeList); - } - if (!unsubscribeList.empty()) { // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following"); - mParent->logMe(unsubscribeList); + if (!dataItemsToUnsubscribe.empty()) { + LOC_LOGD("Unsubscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToUnsubscribe); + + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUpdateSubscriptionReq(this, l, client)); -} -void SystemStatusOsObserver::requestData( - const list& l, IDataItemObserver* client) -{ - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mReqDataCache, l, client); - return; + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleUpdateSubscriptionReq(this, (list&)l, client)); } - - struct HandleRequestData : public LocMsg { - HandleRequestData(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleRequestData() {} - void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list yetToSubscribeDataItemsList(0); - mParent->mClientIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!mDataItemList.empty()) { - mParent->mContext.mSubscriptionObj->requestData(mDataItemList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } - } - SystemStatusOsObserver* mParent; - IDataItemObserver* mClient; - const list mDataItemList; - }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleRequestData(this, l, client)); } void SystemStatusOsObserver::unsubscribe( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } struct HandleUnsubscribeReq : public LocMsg { HandleUnsubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUnsubscribeReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + unordered_set dataItemsUnusedByClient(0); + unordered_set clientToRemove(0); + mParent->mClientToDataItems.trimOrRemove({mClient}, mDataItemSet, &clientToRemove, + &dataItemsUnusedByClient); + unordered_set dataItemsToUnsubscribe(0); + mParent->mDataItemToClients.trimOrRemove(dataItemsUnusedByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, mDataItemList, unused); - - for (auto each : mDataItemList) { - list clientListSubs(0); - list clientListOut(0); - mParent->mDataItemIndex->remove( - each, list (1,mClient), clientListOut); - // check if there are any other subscribed client for this data item id - mParent->mDataItemIndex->getListOfSubscribedClients(each, clientListSubs); - if (clientListSubs.empty()) - { - LOC_LOGD("Client list subscribed is empty for dataitem - %d", each); - unsubscribeList.push_back(each); - } - } - - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) { LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeReq(this, (list&)l, client)); + } } void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUnsubscribeAllReq : public LocMsg { HandleUnsubscribeAllReq(SystemStatusOsObserver* parent, IDataItemObserver* client) : mParent(parent), mClient(client) {} - virtual ~HandleUnsubscribeAllReq() {} - void proc() const { - list clients(1, mClient); - list unsubscribeList(0); - if(0 == mParent->mClientIndex->remove(mClient)) { - return; - } - mParent->mDataItemIndex->remove(clients, unsubscribeList); - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + void proc() const { + unordered_set diByClient = mParent->mClientToDataItems.getValSet(mClient); + if (!diByClient.empty()) { + unordered_set dataItemsToUnsubscribe; + mParent->mClientToDataItems.remove(mClient); + mParent->mDataItemToClients.trimOrRemove(diByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); + + if (!dataItemsToUnsubscribe.empty() && + nullptr != mParent->mContext.mSubscriptionObj) { + + LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeAllReq(this, client)); + + if (nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeAllReq(this, client)); + } } /****************************************************************************** @@ -356,84 +296,78 @@ void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) ******************************************************************************/ void SystemStatusOsObserver::notify(const list& dlist) { - list dataItemList(0); - - for (auto each : dlist) { - string dv; - each->stringify(dv); - LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); - - IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); - if (nullptr == di) { - LOC_LOGE("Unable to create dataitem:%d", each->getId()); - return; - } - - // Copy contents into the newly created data item - di->copy(each); - - // Request systemstatus to record this dataitem in its cache - if (mSystemStatus->eventDataItemNotify(di)) { - // add this dataitem if updated from last one - dataItemList.push_back(di); - } - } - struct HandleNotify : public LocMsg { - HandleNotify(SystemStatusOsObserver* parent, const list& l) : - mParent(parent), mDList(l) {} - virtual ~HandleNotify() { - for (auto each : mDList) { - delete each; + HandleNotify(SystemStatusOsObserver* parent, vector& v) : + mParent(parent), mDiVec(std::move(v)) {} + + inline virtual ~HandleNotify() { + for (auto item : mDiVec) { + delete item; } } + void proc() const { // Update Cache with received data items and prepare // list of data items to be sent. - list dataItemIdsToBeSent(0); - for (auto item : mDList) { - bool dataItemUpdated = false; - mParent->updateCache(item, dataItemUpdated); - if (dataItemUpdated) { - dataItemIdsToBeSent.push_back(item->getId()); + unordered_set dataItemIdsToBeSent(0); + for (auto item : mDiVec) { + if (mParent->updateCache(item)) { + dataItemIdsToBeSent.insert(item->getId()); } } // Send data item to all subscribed clients - list clientList(0); + unordered_set clientSet(0); for (auto each : dataItemIdsToBeSent) { - list clients(0); - mParent->mDataItemIndex->getListOfSubscribedClients(each, clients); - for (auto each_cient: clients) { - clientList.push_back(each_cient); + auto clients = mParent->mDataItemToClients.getValSetPtr(each); + if (nullptr != clients) { + clientSet.insert(clients->begin(), clients->end()); } } - clientList.unique(); - for (auto client : clientList) { - list dataItemIdsSubscribedByThisClient(0); - list dataItemIdsToBeSentForThisClient(0); - mParent->mClientIndex->getSubscribedList( - client, dataItemIdsSubscribedByThisClient); - dataItemIdsSubscribedByThisClient.sort(); - dataItemIdsToBeSent.sort(); + for (auto client : clientSet) { + unordered_set dataItemIdsForThisClient( + mParent->mClientToDataItems.getValSet(client)); + for (auto id : dataItemIdsForThisClient) { + if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) { + dataItemIdsForThisClient.erase(id); + } + } - set_intersection(dataItemIdsToBeSent.begin(), - dataItemIdsToBeSent.end(), - dataItemIdsSubscribedByThisClient.begin(), - dataItemIdsSubscribedByThisClient.end(), - inserter(dataItemIdsToBeSentForThisClient, - dataItemIdsToBeSentForThisClient.begin())); - - mParent->sendCachedDataItems(dataItemIdsToBeSentForThisClient, client); - dataItemIdsSubscribedByThisClient.clear(); - dataItemIdsToBeSentForThisClient.clear(); + mParent->sendCachedDataItems(dataItemIdsForThisClient, client); } } SystemStatusOsObserver* mParent; - const list mDList; + const vector mDiVec; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify(this, dataItemList)); + + if (!dlist.empty()) { + vector dataItemVec(dlist.size()); + + for (auto each : dlist) { + IF_LOC_LOGD { + string dv; + each->stringify(dv); + LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); + } + + IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); + if (nullptr == di) { + LOC_LOGw("Unable to create dataitem:%d", each->getId()); + continue; + } + + // Copy contents into the newly created data item + di->copy(each); + + // add this dataitem if updated from last one + dataItemVec.push_back(di); + } + + if (!dataItemVec.empty()) { + mContext.mMsgTask->sendMsg(new HandleNotify(this, dataItemVec)); + } + } } /****************************************************************************** @@ -447,7 +381,7 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer == mActiveRequestCount.end()) { // Data item not found in map // Add reference count as 1 and add dataitem to map @@ -485,7 +419,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer != mActiveRequestCount.end()) { // found citer->second--; @@ -573,84 +507,65 @@ bool SystemStatusOsObserver::disconnectBackhaul() /****************************************************************************** Helpers ******************************************************************************/ -void SystemStatusOsObserver::sendFirstResponse( - const list& l, IDataItemObserver* to) -{ - if (l.empty()) { - LOC_LOGV("list is empty. Nothing to do. Exiting"); - return; - } - - string clientName; - to->getName(clientName); - list dataItems(0); - - for (auto each : l) { - map::const_iterator citer = mDataItemCache.find(each); - if (citer != mDataItemCache.end()) { - string dv; - citer->second->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(citer->second); - } - } - if (dataItems.empty()) { - LOC_LOGV("No items to notify. Nothing to do. Exiting"); - return; - } - to->notify(dataItems); -} - void SystemStatusOsObserver::sendCachedDataItems( - const list& l, IDataItemObserver* to) + const unordered_set& s, IDataItemObserver* to) { - string clientName; - to->getName(clientName); - list dataItems(0); + if (nullptr == to) { + LOC_LOGv("client pointer is NULL."); + } else { + string clientName; + to->getName(clientName); + list dataItems(0); - for (auto each : l) { - string dv; - IDataItemCore* di = mDataItemCache[each]; - di->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(di); + for (auto each : s) { + auto citer = mDataItemCache.find(each); + if (citer != mDataItemCache.end()) { + string dv; + citer->second->stringify(dv); + LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_front(citer->second); + } + } + + if (dataItems.empty()) { + LOC_LOGv("No items to notify."); + } else { + to->notify(dataItems); + } } - to->notify(dataItems); } -void SystemStatusOsObserver::updateCache(IDataItemCore* d, bool& dataItemUpdated) +bool SystemStatusOsObserver::updateCache(IDataItemCore* d) { - if (nullptr == d) { - return; - } + bool dataItemUpdated = false; - // Check if data item exists in cache - map::iterator citer = - mDataItemCache.find(d->getId()); - if (citer == mDataItemCache.end()) { - // New data item; not found in cache - IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); - if (nullptr == dataitem) { - return; + // Request systemstatus to record this dataitem in its cache + // if the return is false, it means that SystemStatus is not + // handling it, so SystemStatusOsObserver also doesn't. + // So it has to be true to proceed. + if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) { + auto citer = mDataItemCache.find(d->getId()); + if (citer == mDataItemCache.end()) { + // New data item; not found in cache + IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); + if (nullptr != dataitem) { + // Copy the contents of the data item + dataitem->copy(d); + // Insert in mDataItemCache + mDataItemCache.insert(std::make_pair(d->getId(), dataitem)); + dataItemUpdated = true; + } + } else { + // Found in cache; Update cache if necessary + citer->second->copy(d, &dataItemUpdated); } - // Copy the contents of the data item - dataitem->copy(d); - pair cpair(d->getId(), dataitem); - // Insert in mDataItemCache - mDataItemCache.insert(cpair); - dataItemUpdated = true; - } - else { - // Found in cache; Update cache if necessary - if(0 == citer->second->copy(d, &dataItemUpdated)) { - return; + if (dataItemUpdated) { + LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); } } - if (dataItemUpdated) { - LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); - } + return dataItemUpdated; } } // namespace loc_core diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 930ddc12..fd606063 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -41,6 +41,7 @@ #include #include #include +#include namespace loc_core { @@ -48,39 +49,57 @@ namespace loc_core SystemStatusOsObserver ******************************************************************************/ using namespace std; +using namespace loc_util; // Forward Declarations class IDataItemCore; -template class IClientIndex; -template class IDataItemIndex; +class SystemStatus; +class SystemStatusOsObserver; +typedef map> ObserverReqCache; +typedef LocUnorderedSetMap ClientToDataItems; +typedef LocUnorderedSetMap DataItemToClients; +typedef unordered_map DataItemIdToCore; +typedef unordered_map DataItemIdToInt; -struct SystemContext { +struct ObserverContext { IDataItemSubscription* mSubscriptionObj; IFrameworkActionReq* mFrameworkActionReqObj; const MsgTask* mMsgTask; + SystemStatusOsObserver* mSSObserver; - inline SystemContext() : - mSubscriptionObj(NULL), - mFrameworkActionReqObj(NULL), - mMsgTask(NULL) {} + inline ObserverContext(const MsgTask* msgTask, SystemStatusOsObserver* observer) : + mSubscriptionObj(NULL), mFrameworkActionReqObj(NULL), + mMsgTask(msgTask), mSSObserver(observer) {} }; -typedef map> ObserverReqCache; - // Clients wanting to get data from OS/Framework would need to // subscribe with OSObserver using IDataItemSubscription interface. // Such clients would need to implement IDataItemObserver interface // to receive data when it becomes available. -class SystemStatus; class SystemStatusOsObserver : public IOsObserver { public: // ctor - SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask); + inline SystemStatusOsObserver(SystemStatus* systemstatus, const MsgTask* msgTask) : + mSystemStatus(systemstatus), mContext(msgTask, this), + mAddress("SystemStatusOsObserver"), + mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) +#ifdef USE_GLIB + , mBackHaulConnectReqCount(0) +#endif + { + } + // dtor ~SystemStatusOsObserver(); + template + static COUT containerTransfer(CINT& s); + template + inline static COUT containerTransfer(CINT&& s) { + return containerTransfer(s); + } + // To set the subscription object virtual void setSubscriptionObj(IDataItemSubscription* subscriptionObj); @@ -96,38 +115,40 @@ public: } // IDataItemSubscription Overrides - virtual void subscribe(const list& l, IDataItemObserver* client); - virtual void updateSubscription(const list& l, IDataItemObserver* client); - virtual void requestData(const list& l, IDataItemObserver* client); - virtual void unsubscribe(const list& l, IDataItemObserver* client); - virtual void unsubscribeAll(IDataItemObserver* client); + inline virtual void subscribe(const list& l, IDataItemObserver* client) override { + subscribe(l, client, false); + } + virtual void updateSubscription(const list& l, IDataItemObserver* client) override; + inline virtual void requestData(const list& l, IDataItemObserver* client) override { + subscribe(l, client, true); + } + virtual void unsubscribe(const list& l, IDataItemObserver* client) override; + virtual void unsubscribeAll(IDataItemObserver* client) override; // IDataItemObserver Overrides - virtual void notify(const list& dlist); - inline virtual void getName(string& name) { + virtual void notify(const list& dlist) override; + inline virtual void getName(string& name) override { name = mAddress; } // IFrameworkActionReq Overrides - virtual void turnOn(DataItemId dit, int timeOut = 0); - virtual void turnOff(DataItemId dit); + virtual void turnOn(DataItemId dit, int timeOut = 0) override; + virtual void turnOff(DataItemId dit) override; #ifdef USE_GLIB - virtual bool connectBackhaul(); + virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif private: SystemStatus* mSystemStatus; - SystemContext mContext; + ObserverContext mContext; const string mAddress; - IClientIndex* mClientIndex; - IDataItemIndex* mDataItemIndex; - map mDataItemCache; - map mActiveRequestCount; + ClientToDataItems mClientToDataItems; + DataItemToClients mDataItemToClients; + DataItemIdToCore mDataItemCache; + DataItemIdToInt mActiveRequestCount; // Cache the subscribe and requestData till subscription obj is obtained - ObserverReqCache mSubscribeReqCache; - ObserverReqCache mReqDataCache; void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); #ifdef USE_GLIB @@ -135,13 +156,16 @@ private: int mBackHaulConnectReqCount; #endif + void subscribe(const list& l, IDataItemObserver* client, bool toRequestData); + // Helpers - void sendFirstResponse(const list& l, IDataItemObserver* to); - void sendCachedDataItems(const list& l, IDataItemObserver* to); - void updateCache(IDataItemCore* d, bool& dataItemUpdated); - inline void logMe(const list& l) { - for (auto id : l) { - LOC_LOGD("DataItem %d", id); + void sendCachedDataItems(const unordered_set& s, IDataItemObserver* to); + bool updateCache(IDataItemCore* d); + inline void logMe(const unordered_set& l) { + IF_LOC_LOGD { + for (auto id : l) { + LOC_LOGD("DataItem %d", id); + } } } }; diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp deleted file mode 100644 index d4bd11e5..00000000 --- a/core/data-items/common/ClientIndex.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline ClientIndex :: ClientIndex () {} - -template -inline ClientIndex :: ~ClientIndex () {} - -template -bool ClientIndex :: isSubscribedClient (CT client) { - bool result = false; - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - result = true; - } - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: getSubscribedList (CT client, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - out = it->second; - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -int ClientIndex :: remove (CT client) { - int result = 0; - ENTRY_LOG (); - mDataItemsPerClientMap.erase (client); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.begin (); - while (dicIter != mDataItemsPerClientMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find (dicIter->second.begin (), dicIter->second.end (), *it); - if (iter != dicIter->second.end ()) { - dicIter->second.erase (iter); - } - } - if (dicIter->second.empty ()) { - out.push_back (dicIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mDataItemsPerClientMap.erase (dicIter++); - } else { - ++dicIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: remove -( - CT client, - const list & r, - list & out -) -{ - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_intersection (dicIter->second.begin (), dicIter->second.end (), - r.begin (), r.end (), - inserter (out,out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - dicIter->second.erase (find (dicIter->second.begin (), - dicIter->second.end (), - *it)); - } - } - if (dicIter->second.empty ()) { - mDataItemsPerClientMap.erase (dicIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_difference (l.begin (), l.end (), - dicIter->second.begin (), dicIter->second.end (), - inserter (difference,difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - dicIter->second.merge (difference); - dicIter->second.unique (); - } - } else { - out = l; - pair < CT, list > dicnpair (client, out); - mDataItemsPerClientMap.insert (dicnpair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class ClientIndex ; - template class ClientIndex ; -} diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp deleted file mode 100644 index 462bf748..00000000 --- a/core/data-items/common/DataItemIndex.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline DataItemIndex :: DataItemIndex () {} - -template -inline DataItemIndex :: ~DataItemIndex () {} - -template -void DataItemIndex :: getListOfSubscribedClients - ( - DIT id, - list & out -) -{ - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - out = cdiIter->second; - } -} - - -template -int DataItemIndex :: remove (DIT id) { - int result = 0; - ENTRY_LOG (); - mClientsPerDataItemMap.erase (id); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void DataItemIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.begin (); - while (cdiIter != mClientsPerDataItemMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - *it - ); - if (iter != cdiIter->second.end ()) { - cdiIter->second.erase (iter); - } - } - - if (cdiIter->second.empty ()) { - out.push_back (cdiIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mClientsPerDataItemMap.erase (cdiIter++); - } else { - ++cdiIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: remove -( - DIT id, - const list & r, - list & out -) -{ - ENTRY_LOG (); - - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_intersection (cdiIter->second.begin (), cdiIter->second.end (), - r.begin (), r.end (), - inserter (out, out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - cdiIter->second.erase (find (cdiIter->second.begin (), - cdiIter->second.end (), - *it)); - } - } - if (cdiIter->second.empty ()) { - mClientsPerDataItemMap.erase (cdiIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - DIT id, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_difference (l.begin (), l.end (), - cdiIter->second.begin (), cdiIter->second.end (), - inserter (difference, difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - cdiIter->second.merge (difference); - } - } else { - out = l; - pair < DIT, list > cndipair (id, out); - mClientsPerDataItemMap.insert (cndipair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter; - typename list :: const_iterator it = l.begin (); - for (; it != l.end (); ++it) { - cdiIter = mClientsPerDataItemMap.find (*it); - if (cdiIter == mClientsPerDataItemMap.end ()) { - out.push_back (*it); - pair < DIT, list > cndiPair (*it, list (1, client)); - mClientsPerDataItemMap.insert (cndiPair); - } else { - typename list :: iterator clientIter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - client - ); - if (clientIter == cdiIter->second.end()) { - cdiIter->second.push_back (client); - } - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class DataItemIndex ; - template class DataItemIndex ; -} diff --git a/core/data-items/common/IClientIndex.h b/core/data-items/common/IClientIndex.h deleted file mode 100644 index 0272e7b9..00000000 --- a/core/data-items/common/IClientIndex.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __ICLIENTINDEX_H__ -#define __ICLIENTINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IClientIndex { -public: - - // Checks if client is subscribed - virtual bool isSubscribedClient (CT client) = 0; - - // gets subscription list - virtual void getSubscribedList (CT client, std :: list & out) = 0; - - // removes an entry - virtual int remove (CT client) = 0; - - // removes std :: list of data items and returns a list of clients - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of data items indexed by client and returns list - // of data items removed if any. - virtual void remove - ( - CT client, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry in map and returns new data items added. - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IClientIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __ICLIENTINDEX_H__ diff --git a/core/data-items/common/IDataItemIndex.h b/core/data-items/common/IDataItemIndex.h deleted file mode 100644 index 91855826..00000000 --- a/core/data-items/common/IDataItemIndex.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __IDATAITEMINDEX_H__ -#define __IDATAITEMINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IDataItemIndex { - -public: - - // gets std :: list of subscribed clients - virtual void getListOfSubscribedClients - ( - DIT id, - std :: list & out - ) = 0; - - // removes an entry from - virtual int remove (DIT id) = 0; - - // removes list of clients and returns a list of data items - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of clients indexed by data item and returns list of - // clients removed if any. - virtual void remove - ( - DIT id, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry and returns new clients added - virtual void add - ( - DIT id, - const std :: list & l, - std :: list & out - ) = 0; - - // adds/modifies entry and returns yet to subscribe list of data items - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IDataItemIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __IDATAITEMINDEX_H__ - diff --git a/core/data-items/common/IndexFactory.cpp b/core/data-items/common/IndexFactory.cpp deleted file mode 100644 index cf494752..00000000 --- a/core/data-items/common/IndexFactory.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using loc_core::IClientIndex; -using loc_core::IDataItemIndex; -using loc_core::IDataItemObserver; -using namespace loc_core; - -template -inline IClientIndex * IndexFactory :: createClientIndex -() -{ - return new (nothrow) ClientIndex (); -} - -template -inline IDataItemIndex * IndexFactory :: createDataItemIndex -() -{ - return new (nothrow) DataItemIndex (); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class IndexFactory ; - template class IndexFactory ; -} diff --git a/core/data-items/common/IndexFactory.h b/core/data-items/common/IndexFactory.h deleted file mode 100644 index 9a2070e9..00000000 --- a/core/data-items/common/IndexFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __INDEXFACTORY_H__ -#define __INDEXFACTORY_H__ - -#include -#include - -namespace loc_core -{ -template -class IndexFactory { - -public: - static IClientIndex * createClientIndex (); - static IDataItemIndex * createDataItemIndex (); -}; - -} // namespace loc_core - -#endif // #ifndef __INDEXFACTORY_H__ diff --git a/utils/LocListMap.h b/utils/LocListMap.h deleted file mode 100644 index feccb059..00000000 --- a/utils/LocListMap.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __CLIENTINDEX_H__ -#define __CLIENTINDEX_H__ - -#include -#include -#include - -using loc_core::IClientIndex; - -namespace loc_core -{ - -template - -class ClientIndex : public IClientIndex { - -public: - - ClientIndex (); - - ~ClientIndex (); - - bool isSubscribedClient (CT client); - - void getSubscribedList (CT client, std :: list & out); - - int remove (CT client); - - void remove (const std :: list & r, std :: list & out); - - void remove (CT client, const std :: list & r, std :: list & out); - - void add (CT client, const std :: list & l, std :: list & out); - -private: - //Data members - std :: map < CT , std :: list > mDataItemsPerClientMap; -}; - -} // namespace loc_core - -#endif // #ifndef __CLIENTINDEX_H__ diff --git a/utils/LocUnorderedSetMap.h b/utils/LocUnorderedSetMap.h index d72e89eb..87481348 100644 --- a/utils/LocUnorderedSetMap.h +++ b/utils/LocUnorderedSetMap.h @@ -26,45 +26,167 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#ifndef __LOC_UNORDERDED_SETMAP_H__ +#define __LOC_UNORDERDED_SETMAP_H__ -#ifndef __DATAITEMINDEX_H__ -#define __DATAITEMINDEX_H__ +#include +#include +#include -#include -#include -#include +using std::unordered_set; +using std::unordered_map; -using loc_core::IDataItemIndex; +namespace loc_util { -namespace loc_core -{ +// Trim from *fromSet* any elements that also exist in *rVals*. +// The optional *goneVals*, if not null, will be populated with removed elements. +template +inline static void trimSet(unordered_set& fromSet, const unordered_set& rVals, + unordered_set* goneVals) { + for (auto val : rVals) { + if (fromSet.erase(val) > 0 && nullptr != goneVals) { + goneVals->insert(val); + } + } +} -template +// this method is destructive to the input unordered_sets. +// the return set is the interset extracted out from the two input sets, *s1* and *s2*. +// *s1* and *s2* will be left with the intersect removed from them. +template +static unordered_set removeAndReturnInterset(unordered_set& s1, unordered_set& s2) { + unordered_set common(0); + for (auto b = s2.begin(); b != s2.end(); b++) { + auto a = find(s1.begin(), s1.end(), *b); + if (a != s1.end()) { + // this is a common item of both l1 and l2, remove from both + // but after we add to common + common.insert(*a); + s1.erase(a); + s2.erase(b); + } + } + return common; +} -class DataItemIndex : public IDataItemIndex { +template +class LocUnorderedSetMap { + unordered_map> mMap; + + + // Trim the VALs pointed to by *iter*, with everything that also exist in *rVals*. + // If the set becomes empty, remove the map entry. *goneVals*, if not null, records + // the trimmed VALs. + bool trimOrRemove(typename unordered_map>::iterator iter, + const unordered_set& rVals, unordered_set* goneVals) { + trimSet(iter->second, rVals, goneVals); + bool removeEntry = (iter->second.empty()); + if (removeEntry) { + mMap.erase(iter); + } + return removeEntry; + } public: + inline LocUnorderedSetMap() {} + inline LocUnorderedSetMap(size_t size) : mMap(size) {} - DataItemIndex (); + inline bool empty() { return mMap.empty(); } - ~DataItemIndex (); + // This gets the raw pointer to the VALs pointed to by *key* + // If the entry is not in the map, nullptr will be returned. + inline unordered_set* getValSetPtr(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? &(entry->second) : nullptr; + } - void getListOfSubscribedClients (DIT id, std :: list & out); + // This gets a copy of VALs pointed to by *key* + // If the entry is not in the map, an empty set will be returned. + inline unordered_set getValSet(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? entry->second : unordered_set(0); + } - int remove (DIT id); + // This gets all the KEYs from the map + inline unordered_set getKeys() { + unordered_set keys(0); + for (auto entry : mMap) { + keys.insert(entry.first); + } + return keys; + } - void remove (const std :: list & r, std :: list & out); + inline bool remove(const KEY& key) { + return mMap.erase(key) > 0; + } - void remove (DIT id, const std :: list & r, std :: list & out); + // This looks into all the entries keyed by *keys*. Remove any VALs from the entries + // that also exist in *rVals*. If the entry is left with an empty set, the entry will + // be removed. The optional parameters *goneKeys* and *goneVals* will record the KEYs + // (or entries) and the collapsed VALs removed from the map, respectively. + inline void trimOrRemove(unordered_set&& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + trimOrRemove(keys, rVals, goneKeys, goneVals); + } + inline void trimOrRemove(unordered_set& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + for (auto key : keys) { + auto iter = mMap.find(key); + if (iter != mMap.end() && trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) { + goneKeys->insert(iter->first); + } + } + } - void add (DIT id, const std :: list & l, std :: list & out); + // This adds all VALs from *newVals* to the map entry keyed by *key*. Or if it + // doesn't exist yet, add the set to the map. + bool add(const KEY& key, const unordered_set& newVals) { + bool newEntryAdded = false; + if (!newVals.empty()) { + auto iter = mMap.find(key); + if (iter != mMap.end()) { + iter->second.insert(newVals.begin(), newVals.end()); + } else { + mMap[key] = newVals; + newEntryAdded = true; + } + } + return newEntryAdded; + } - void add (CT client, const std :: list & l, std :: list & out); + // This adds to each of entries in the map keyed by *keys* with the VALs in the + // *enwVals*. If there new entries added (new key in *keys*), *newKeys*, if not + // null, would be populated with those keys. + inline void add(const unordered_set& keys, const unordered_set&& newVals, + unordered_set* newKeys) { + add(keys, newVals, newKeys); + } + inline void add(const unordered_set& keys, const unordered_set& newVals, + unordered_set* newKeys) { + for (auto key : keys) { + if (add(key, newVals) && nullptr != newKeys) { + newKeys->insert(key); + } + } + } -private: - std :: map < DIT, std :: list > mClientsPerDataItemMap; + // This puts *newVals* into the map keyed by *key*, and returns the VALs that are + // in effect removed from the keyed VAL set in the map entry. + // This call would also remove those same VALs from *newVals*. + inline unordered_set update(const KEY& key, unordered_set& newVals) { + unordered_set goneVals(0); + + if (newVals.empty()) { + mMap.erase(key); + } else { + auto curVals = mMap[key]; + mMap[key] = newVals; + goneVals = removeAndReturnInterset(curVals, newVals); + } + return goneVals; + } }; -} // namespace loc_core +} // namespace loc_util -#endif // #ifndef __DATAITEMINDEX_H__ +#endif // #ifndef __LOC_UNORDERDED_SETMAP_H__ From 4c8f4e4e0437aff2694d9550579ee038c9209c5d Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 30 Mar 2018 17:10:59 -0700 Subject: [PATCH 640/945] GPS Adapter: GNSS adapter change to go with engine hub aggregator 1: GNSS adapter change to block out position and SV report from ULP when engine hub aggregator is used 2: Support unpropagated position report Change-Id: Id0cacd87d3f3f8eec893d751b9f7a55a736a4023 CRs-fixed: 2210253 --- core/EngineHubProxyBase.h | 7 +++-- core/LocAdapterBase.cpp | 5 ++-- core/LocAdapterBase.h | 6 +++-- gnss/GnssAdapter.cpp | 54 +++++++++++++++++++++++++++++++-------- gnss/GnssAdapter.h | 7 +++-- utils/gps_extended_c.h | 4 ++- 6 files changed, 64 insertions(+), 19 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 7b9f3ae8..4e259ba7 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -92,10 +92,13 @@ typedef std::function + bool fromUlp, + bool fromEngineHub)> GnssAdapterReportPositionEventCb; -typedef std::function +typedef std::function GnssAdapterReportSvEventCb; // potential parameters: message queue: MsgTask * msgTask; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index f3c999c2..5d1b2c21 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromUlp*/) { + bool /*fromUlp*/, bool /*fromEngineHub*/) { if (mLocAdapterProxyBase != NULL) { mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, (GpsLocationExtended&)locationExtended, @@ -91,7 +91,8 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSvEvent(const GnssSvNotification& /*svNotify*/, bool /*fromUlp*/) + reportSvEvent(const GnssSvNotification& /*svNotify*/, + bool /*fromUlp*/, bool /*fromEngineHub*/) DEFAULT_IMPL() void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e7beca83..8388c712 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -131,8 +131,10 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromUlp=false); - virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + bool fromUlp=false, + bool fromEngineHub=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, + bool fromUlp=false, bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f996ebee..ff352e20 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1230,6 +1230,7 @@ GnssAdapter::updateClientsEventMask() (true == initEngHubProxy())) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; + mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%x", __func__, mask); } @@ -2092,22 +2093,43 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp) + bool fromUlp, + bool fromEngineHub) { LOC_LOGD("%s]: fromUlp %u status %u", __func__, fromUlp, status); // if this event is called from QMI LOC API, then try to call into ULP and return if successfull // if the position is called from ULP or engine hub, then send it out directly - if (!fromUlp) { - // report QMI position to engine hub, and engine hub will be - // distributing it to the registered plugins + if (!fromUlp && !fromEngineHub) { + // report QMI position (both propagated and unpropagated) to engine hub, + // and engine hub will be distributing it to the registered plugins mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); + + if (true == ulpLocation.unpropagatedPosition) { + return; + } + + // only send propagated position report to ulp if (mUlpProxy->reportPosition(ulpLocation, locationExtended, status, techMask)) { return; } + + // engine hub is loaded, do not report qmi position to client as + // final position report should come from engine hub + if (true == initEngHubProxy()){ + return; + } + } else if ((true == fromUlp) && (true == initEngHubProxy())) { + LOC_LOGV("%s]: drop ULP GNSS fix as engine hub is loaded", __func__); + return; } + // for all other cases: + // case 1: fix is from ULP and engine hub is not loaded, queue the msg + // case 2: fix is from engine hub, queue the msg + // when message is queued, the position can be dispatched to requesting client + struct MsgReportPosition : public LocMsg { GnssAdapter& mAdapter; const UlpLocation mUlpLocation; @@ -2208,18 +2230,28 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, void GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, - bool fromUlp) + bool fromUlp, + bool fromEngineHub) { LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); // if this event is not called from ULP, then try to call into ULP and return if successfull - if (!fromUlp) { + if (!fromUlp && !fromEngineHub) { // report QMI SV report to eng hub mEngHubProxy->gnssReportSv(svNotify); if (mUlpProxy->reportSv(svNotify)) { return; } + + // engine hub is loaded, do not report sv to client + // as sv report should come from engine hub + if (true == initEngHubProxy()){ + return; + } + } else if ((true == fromUlp) && (true == initEngHubProxy())) { + LOC_LOGV("%s]: drop ULP GNSS SV event as engine hub is loaded", __func__); + return; } struct MsgReportSv : public LocMsg { @@ -3297,15 +3329,17 @@ GnssAdapter::initEngHubProxy() { const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp) { + bool fromUlp, + bool fromEngineHub) { // report from engine hub on behalf of PPE will be treated as fromUlp - reportPositionEvent(ulpLocation, locationExtended, status, techMask, fromUlp); + reportPositionEvent(ulpLocation, locationExtended, status, + techMask, fromUlp, fromEngineHub); }; // callback function for engine hub to report back sv event GnssAdapterReportSvEventCb reportSvEventCb = - [this](const GnssSvNotification& svNotify, bool fromUlp) { - reportSvEvent(svNotify, fromUlp); + [this](const GnssSvNotification& svNotify, bool fromUlp, bool fromEngineHub) { + reportSvEvent(svNotify, fromUlp, fromEngineHub); }; getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index c1e17545..85962cfb 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -235,8 +235,11 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp=false); - virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false); + bool fromUlp=false, + bool fromEngineHub=false); + virtual void reportSvEvent(const GnssSvNotification& svNotify, + bool fromUlp=false, + bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index bd528d9e..29b658fe 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -127,6 +127,7 @@ typedef struct { /* Provider indicator for HYBRID or GPS */ uint16_t position_source; LocPosTechMask tech_mask; + bool unpropagatedPosition; } UlpLocation; typedef struct { @@ -583,6 +584,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REQUEST_POSITION_INJECTION, // Position injection request LOC_API_ADAPTER_BATCH_STATUS, // batch status LOC_API_ADAPTER_FDCL_SERVICE_REQ, // FDCL service request + LOC_API_ADAPTER_REPORT_UNPROPAGATED_POSITION, // Unpropagated Position report LOC_API_ADAPTER_EVENT_MAX }; @@ -619,7 +621,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_POSITION_INJECTION_REQUEST (1< Date: Fri, 19 Jan 2018 17:32:08 +0530 Subject: [PATCH 641/945] Moving location sockets from /data to /dev Keeping sockets in /data/vendor/location prevents unmounting of /data partition after build load. CRs-Fixed: 2174503 Change-Id: Ib1b9f07bb25368ac7d1a32536e58c52dd2b2ad4e --- utils/gps_extended_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index afe47ccc..e29b2a84 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1314,8 +1314,8 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); /* Shared resources of LocIpc */ -#define LOC_IPC_HAL "/data/vendor/location/socket_hal" -#define LOC_IPC_XTRA "/data/vendor/location/xtra/socket_xtra" +#define LOC_IPC_HAL "/dev/socket/location/socket_hal" +#define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" #ifdef __cplusplus } From 594a0d7ab49b4ee2c126892828751c4a8113aa78 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Fri, 20 Apr 2018 11:23:14 +0800 Subject: [PATCH 642/945] Add correct libs to LOCAL_HEADER_LIBRARIES Vendor code should not include AOSP headers by absolute path or global path. CRs-fixed: 2228157 Change-Id: I84a4d0b9b9fe3a20713eea07e926aba5d665b435 --- core/Android.mk | 1 + utils/Android.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/core/Android.mk b/core/Android.mk index 1374b6c0..c6b8b207 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -47,6 +47,7 @@ LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/observer \ LOCAL_HEADER_LIBRARIES := \ + libutils_headers \ libgps.utils_headers \ libloc_pla_headers \ liblocation_api_headers diff --git a/utils/Android.mk b/utils/Android.mk index 9607aaa1..18c22039 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -40,6 +40,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_HEADER_LIBRARIES := \ + libutils_headers \ libloc_pla_headers \ liblocation_api_headers From 56334a379159f127071dd4552c5a28654cd586a4 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 2 Mar 2018 17:02:28 -0800 Subject: [PATCH 643/945] fix: Default values in GNSS Debug Data Change default values for accuracies and uncertainties in GNSS Debug Data to non- zero constant values. Bug: 72753638 Change-Id: I075b364ed81c8a466b062ab4d5381c3d4ece1ea6 CRs-Fixed: 2185247 --- android/GnssDebug.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 45cde6be..823c9b17 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -114,6 +114,23 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; } + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + // time block if (reports.mTime.mValid) { data.time.timeEstimate = reports.mTime.timeEstimate; From 37d34d0dc88f8f05cc6efbdfebe76b2e189175fb Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 5 Apr 2018 17:54:50 -0700 Subject: [PATCH 644/945] Assure event mask is set properly to get positions The event mask can be retrieved in the context of client thread as zero and then queued up to go to msg task thread. By the time the msg is actually handled in msg task thread, the actual event mask at LOC API layer may have already changed, but this mask would then be overridden by zero. This can cause no modem events to ever come, including position reports. The fix is to not retrieve the event mask in the client thread, but instead wait for msg to be handled in msg task thread before retrieving it. Change-Id: I48562d028bbfa187732686c060b5cdd62c6d5a89 CRs-fixed: 2219519 --- core/LocApiBase.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8aef94b3..96148726 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -107,19 +107,16 @@ struct LocSsrMsg : public LocMsg { 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) + inline LocOpenMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) { locallog(); } inline virtual void proc() const { - mLocApi->open(mMask); + mLocApi->open(mLocApi->getEvtMask()); } inline void locallog() const { - LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", - __func__, __LINE__, mMask); + LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask()); } inline virtual void log() const { locallog(); @@ -163,8 +160,7 @@ 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, - mMask | adapter->getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); break; } } @@ -200,7 +196,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) close(); } else { // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); } } } From 98125ae628a59fae6f1a4da19200b799595fd47e Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 9 Apr 2018 17:56:08 +0530 Subject: [PATCH 645/945] Adding Location Service Modem Emulator Adding Modem Emulator to test features not yet supported in Modem build. Change-Id: I86f4eeaa7577d83c5ef9605c78672068721c020e CRs-Fixed: 2193247 --- utils/loc_cfg.cpp | 17 +++++++++++++++-- utils/loc_cfg.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 80379792..aa8d0e82 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -57,12 +57,14 @@ /* Parameter data */ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; +static uint32_t LOC_MODEM_EMULATOR = 0; /* Parameter spec table */ static const loc_param_s_type loc_param_table[] = { - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"LOC_MODEM_EMULATOR", &LOC_MODEM_EMULATOR, NULL, 'n'}, }; static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); @@ -85,6 +87,17 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; +/*=========================================================================== +FUNCTION loc_modem_emulator_enabled + +DESCRIPTION + Provides access to Modem Emulator config item. +===========================================================================*/ +uint32_t loc_modem_emulator_enabled() +{ + return LOC_MODEM_EMULATOR; +} + /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index c89d3038..652d86eb 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -133,6 +133,8 @@ extern const char LOC_PATH_QUIPC_CONF[]; int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, loc_process_info_s_type** process_info_table_ptr); +uint32_t loc_modem_emulator_enabled(); + #ifdef __cplusplus } #endif From f93ec50a05ecee0faee6721f8ac5f1e984f4eca2 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 17 Apr 2018 11:11:26 -0700 Subject: [PATCH 646/945] fix: Incorrect path to ehub socket directory Change-Id: I58b41c4a8de8b51c8a6effe989182ea5942cff6e CRs-Fixed: 2196048 --- utils/gps_extended_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b7b1c09c..21eb5d55 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1495,7 +1495,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" #define SOCKET_DIR_LOCATION "/dev/socket/location/" -#define SOCKET_DIR_EHUB "/dev/socket/location/ehub" +#define SOCKET_DIR_EHUB "/dev/socket/location/ehub/" #define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" From f6b613a82760441f1257455256bba5dd9f3c2919 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 22 Jan 2018 16:04:50 -0800 Subject: [PATCH 647/945] Addition of new LocApi thread 1. LocApiBase to create its own MsgTask thread to allow QMI calls to be made asynchronously. It shall no longer share the adapter's thread. 2. Implementation of new LocApiResponse classes for generic response type from LocApi layer to Adapter layers 3. GnssAdapter modified to handle the asynchronous nature of LocApi calls. CRs-Fixed: 2218658 Change-Id: I6e401a89f16791ec144763ac5f070b7ee1dad931 --- core/ContextBase.cpp | 41 +- core/ContextBase.h | 100 +++++ core/LBSProxyBase.h | 5 +- core/LocAdapterBase.cpp | 6 + core/LocAdapterBase.h | 4 +- core/LocApiBase.cpp | 187 ++++----- core/LocApiBase.h | 134 +++--- gnss/Agps.cpp | 8 +- gnss/Agps.h | 3 +- gnss/GnssAdapter.cpp | 884 +++++++++++++++++++++++----------------- gnss/GnssAdapter.h | 25 +- gnss/Makefile.am | 2 +- 12 files changed, 842 insertions(+), 557 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 47194cba..e7ee8bf1 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -42,6 +42,10 @@ namespace loc_core { loc_gps_cfg_s_type ContextBase::mGps_conf {}; loc_sap_cfg_s_type ContextBase::mSap_conf {}; +bool ContextBase::sIsEngineCapabilitiesKnown = false; +uint64_t ContextBase::sSupportedMsgMask = 0; +bool ContextBase::sGnssMeasurementSupported = false; +uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH]; const loc_param_s_type ContextBase::mGps_conf_table[] = { @@ -215,7 +219,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // Check the target if (TARGET_NO_GNSS != loc_get_target()){ - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { + if (NULL == (locApi = mLBSProxy->getLocApi(exMask, this))) { void *handle = NULL; //try to see if LocApiV02 is present if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { @@ -224,7 +228,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) if (getter != NULL) { LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); + locApi = (*getter)(exMask, this); } } // only RPC is the option now @@ -237,7 +241,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) if (NULL != getter) { LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); + locApi = (*getter)(exMask, this); } } } @@ -247,7 +251,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) // locApi could still be NULL at this time // we would then create a dummy one if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask, this); + locApi = new LocApiBase(exMask, this); } return locApi; @@ -263,4 +267,33 @@ ContextBase::ContextBase(const MsgTask* msgTask, { } +void ContextBase::setEngineCapabilities(uint64_t supportedMsgMask, + uint8_t *featureList, bool gnssMeasurementSupported) { + + if (ContextBase::sIsEngineCapabilitiesKnown == false) { + ContextBase::sSupportedMsgMask = supportedMsgMask; + ContextBase::sGnssMeasurementSupported = gnssMeasurementSupported; + if (featureList != NULL) { + memcpy((void *)ContextBase::sFeaturesSupported, + (void *)featureList, sizeof(ContextBase::sFeaturesSupported)); + } + + ContextBase::sIsEngineCapabilitiesKnown = true; + } +} + + +bool ContextBase::isFeatureSupported(uint8_t featureVal) +{ + uint8_t arrayIndex = featureVal >> 3; + uint8_t bitPos = featureVal & 7; + + if (arrayIndex >= MAX_FEATURE_LENGTH) return false; + return ((ContextBase::sFeaturesSupported[arrayIndex] >> bitPos ) & 0x1); +} + +bool ContextBase::gnssConstellationConfig() { + return sGnssMeasurementSupported; +} + } diff --git a/core/ContextBase.h b/core/ContextBase.h index dc64b6ab..e7edb296 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -116,6 +116,7 @@ protected: const MsgTask* mMsgTask; LocApiBase* mLocApi; LocApiProxyBase *mLocApiProxy; + public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, @@ -140,12 +141,111 @@ public: static loc_gps_cfg_s_type mGps_conf; static loc_sap_cfg_s_type mSap_conf; + static bool sIsEngineCapabilitiesKnown; + static uint64_t sSupportedMsgMask; + static uint8_t sFeaturesSupported[MAX_FEATURE_LENGTH]; + static bool sGnssMeasurementSupported; void readConfig(); static uint32_t getCarrierCapabilities(); + void setEngineCapabilities(uint64_t supportedMsgMask, + uint8_t *featureList, bool gnssMeasurementSupported); + + static inline bool isEngineCapabilitiesKnown() { + return sIsEngineCapabilitiesKnown; + } + + static inline bool isMessageSupported(LocCheckingMessagesID msgID) { + + // confirm if msgID is not larger than the number of bits in + // mSupportedMsg + if ((uint64_t)msgID > (sizeof(sSupportedMsgMask) << 3)) { + return false; + } else { + uint32_t messageChecker = 1 << msgID; + return (messageChecker & sSupportedMsgMask) == messageChecker; + } + } + + /* + Check if a feature is supported + */ + static bool isFeatureSupported(uint8_t featureVal); + + /* + Check if gnss measurement is supported + */ + static bool gnssConstellationConfig(); }; +struct LocApiResponse: LocMsg { + private: + ContextBase& mContext; + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationError); + } + protected: + LocationError mLocationError; + public: + inline LocApiResponse(ContextBase& context, + std::function procImpl ) : + mContext(context), mProcImpl(procImpl) {} + + void returnToSender(const LocationError err) { + mLocationError = err; + mContext.sendMsg(this); + } +}; + +struct LocApiCollectiveResponse: LocMsg { + private: + ContextBase& mContext; + std::function errs)> mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationErrors); + } + protected: + std::vector mLocationErrors; + public: + inline LocApiCollectiveResponse(ContextBase& context, + std::function errs)> procImpl ) : + mContext(context), mProcImpl(procImpl) {} + inline virtual ~LocApiCollectiveResponse() { + } + + void returnToSender(std::vector& errs) { + mLocationErrors = errs; + mContext.sendMsg(this); + } +}; + + +template +struct LocApiResponseData: LocMsg { + private: + ContextBase& mContext; + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(mLocationError, mData); + } + protected: + LocationError mLocationError; + DATA mData; + public: + inline LocApiResponseData(ContextBase& context, + std::function procImpl ) : + mContext(context), mProcImpl(procImpl) {} + + void returnToSender(const LocationError err, const DATA data) { + mLocationError = err; + mData = data; + mContext.sendMsg(this); + } +}; + + } // namespace loc_core #endif //__LOC_CONTEXT_BASE__ diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index 94ddd0fb..bf786a35 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -29,7 +29,6 @@ #ifndef IZAT_PROXY_BASE_H #define IZAT_PROXY_BASE_H #include -#include namespace loc_core { @@ -40,11 +39,9 @@ class ContextBase; class LBSProxyBase { friend class ContextBase; inline virtual LocApiBase* - getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, + getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase* context) const { - (void)msgTask; (void)exMask; (void)context; return NULL; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5d1b2c21..5531fa2d 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -162,4 +162,10 @@ bool LocAdapterBase:: reportWwanZppFix(LocGpsLocation &/*zppLoc*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportZppBestAvailableFix(LocGpsLocation& /*zppLoc*/, + GpsLocationExtended& /*location_extended*/, LocPosTechMask /*tech_mask*/) +DEFAULT_IMPL(false) + + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 8388c712..64537fea 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -107,7 +107,7 @@ public: } inline bool isFeatureSupported(uint8_t featureVal) { - return mLocApi->isFeatureSupported(featureVal); + return ContextBase::isFeatureSupported(featureVal); } uint32_t generateSessionId(); @@ -155,6 +155,8 @@ public: virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); + virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 89a9164d..4b1aa28e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -126,14 +126,36 @@ struct LocOpenMsg : public LocMsg { } }; -LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, +struct LocCloseMsg : public LocMsg { + LocApiBase* mLocApi; + inline LocCloseMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->close(); + } + inline void locallog() const { + LOC_LOGV("%s]: LocCloseMsg"); + } + inline virtual void log() const { + locallog(); + } +}; + +MsgTask* LocApiBase::mMsgTask; + +LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : - mMsgTask(msgTask), mContext(context), mSupportedMsg(0), + mContext(context), mMask(0), mExcludedMask(excludedMask) { memset(mLocAdapters, 0, sizeof(mLocAdapters)); - memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported)); + + if (nullptr == mMsgTask) { + mMsgTask = new MsgTask("LocApiMsgTask", false); + } } LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() @@ -197,7 +219,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) // if we have an empty list of adapters if (0 == i) { - close(); + mMsgTask->sendMsg(new LocCloseMsg(this)); } else { // else we need to remove the bit mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); @@ -208,14 +230,11 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - open(getEvtMask()); + 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. @@ -223,7 +242,9 @@ void LocApiBase::handleEngineUpEvent() } void LocApiBase::handleEngineDownEvent() -{ +{ // This will take care of renegotiating the loc handle + sendMsg(new LocSsrMsg(this)); + // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent()); } @@ -239,7 +260,7 @@ void LocApiBase::reportPosition(UlpLocation& location, "timestamp: %" PRId64 "\n" "Session status: %d\n Technology mask: %u\n " "SV used in fix (gps/glo/bds/gal/qzss) : \ - (%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")", + (0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 ")", location.gpsLocation.flags, location.position_source, location.gpsLocation.latitude, location.gpsLocation.longitude, location.gpsLocation.altitude, location.gpsLocation.speed, @@ -263,6 +284,15 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc)); } +void LocApiBase::reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportZppBestAvailableFix(zppLoc, + location_extended, tech_mask)); +} + + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -384,16 +414,6 @@ void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(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) @@ -415,86 +435,72 @@ 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) +void LocApiBase::startFix(const LocPosMode& /*posMode*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: - stopFix() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +void LocApiBase::stopFix(LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -LocationError LocApiBase:: - deleteAidingData(const GnssAidingData& /*data*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +void LocApiBase:: + deleteAidingData(const GnssAidingData& /*data*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -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:: +void LocApiBase:: injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() 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*/, +void LocApiBase:: + atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/, AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: atlCloseStatus(int /*handle*/, int /*is_succ*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: setPositionMode(const LocPosMode& /*posMode*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() LocationError LocApiBase:: - setServer(const char* /*url*/, int /*len*/) + setServerSync(const char* /*url*/, int /*len*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/) + setServerSync(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -LocationError LocApiBase:: +void LocApiBase:: informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +DEFAULT_IMPL() LocationError LocApiBase:: - setSUPLVersion(GnssConfigSuplVersion /*version*/) + setSUPLVersionSync(GnssConfigSuplVersion /*version*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setNMEATypes (uint32_t /*typesMask*/) + setNMEATypesSync (uint32_t /*typesMask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setLPPConfig(GnssConfigLppProfile /*profile*/) + setLPPConfigSync(GnssConfigLppProfile /*profile*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int /*sensorUsage*/, + setSensorControlConfigSync(int /*sensorUsage*/, int /*sensorProvider*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/, + setSensorPropertiesSync(bool /*gyroBiasVarianceRandomWalk_valid*/, float /*gyroBiasVarianceRandomWalk*/, bool /*accelBiasVarianceRandomWalk_valid*/, float /*accelBiasVarianceRandomWalk*/, @@ -507,7 +513,7 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - setSensorPerfControlConfig(int /*controlMode*/, + setSensorPerfControlConfigSync(int /*controlMode*/, int /*accelSamplesPerBatch*/, int /*accelBatchesPerSec*/, int /*gyroSamplesPerBatch*/, @@ -520,37 +526,36 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) LocationError LocApiBase:: - setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/) + setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/) + setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask /*lppeCP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: - setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/) + setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask /*lppeUP*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +GnssConfigSuplVersion LocApiBase::convertSuplVersion(const uint32_t /*suplVersion*/) +DEFAULT_IMPL(GNSS_CONFIG_SUPL_VERSION_1_0_0) + +GnssConfigLppProfile LocApiBase::convertLppProfile(const uint32_t /*lppProfile*/) +DEFAULT_IMPL(GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE) + +GnssConfigLppeControlPlaneMask LocApiBase::convertLppeCp(const uint32_t /*lppeControlPlaneMask*/) +DEFAULT_IMPL(0) + +GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/) +DEFAULT_IMPL(0) + enum loc_api_adapter_err LocApiBase:: getWwanZppFix() DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation& zppLoc) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} - -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, - LocPosTechMask & tech_mask) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - memset(&tech_mask, 0, sizeof(tech_mask)); - memset(&locationExtended, 0, sizeof (locationExtended)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} +void LocApiBase:: + getBestAvailableZppFix() +DEFAULT_IMPL() int LocApiBase:: initDataServiceClient(bool /*isDueToSsr*/) @@ -573,7 +578,7 @@ void LocApiBase:: DEFAULT_IMPL() LocationError LocApiBase:: - setGpsLock(GnssConfigGpsLock /*lock*/) + setGpsLockSync(GnssConfigGpsLock /*lock*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) void LocApiBase:: @@ -587,21 +592,7 @@ int LocApiBase:: DEFAULT_IMPL(-1) LocationError LocApiBase:: - setXtraVersionCheck(uint32_t /*check*/) + setXtraVersionCheckSync(uint32_t /*check*/) DEFAULT_IMPL(LOCATION_ERROR_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/core/LocApiBase.h b/core/LocApiBase.h index 25d95b2a..f0b1f592 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -37,7 +37,9 @@ #include namespace loc_core { + class ContextBase; +struct LocApiResponse; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -66,6 +68,28 @@ class LocAdapterBase; struct LocSsrMsg; struct LocOpenMsg; +typedef struct +{ + uint32_t accumulatedDistance; + uint32_t numOfBatchedPositions; +} LocApiBatchData; + +typedef struct +{ + uint32_t hwId; +} LocApiGeofenceData; + +struct LocApiMsg: LocMsg { + private: + std::function mProcImpl; + inline virtual void proc() const { + mProcImpl(); + } + public: + inline LocApiMsg(std::function procImpl ) : + mProcImpl(procImpl) {} +}; + class LocApiProxyBase { public: inline LocApiProxyBase() {} @@ -78,22 +102,21 @@ class LocApiBase { //LocOpenMsg calls open() which makes it necessary to declare //it as a friend friend struct LocOpenMsg; + friend struct LocCloseMsg; friend class ContextBase; - const MsgTask* mMsgTask; - ContextBase *mContext; + static MsgTask* mMsgTask; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; - uint64_t mSupportedMsg; - uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH]; + protected: + ContextBase *mContext; virtual enum loc_api_adapter_err open(LOC_API_ADAPTER_EVENT_MASK_T mask); virtual enum loc_api_adapter_err close(); LOC_API_ADAPTER_EVENT_MASK_T getEvtMask(); LOC_API_ADAPTER_EVENT_MASK_T mMask; - LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); inline virtual ~LocApiBase() { close(); } bool isInSession(); @@ -130,10 +153,10 @@ public: void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GnssNiNotification ¬ify, const void* data); - void saveSupportedMsgList(uint64_t supportedMsgList); void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); - void saveSupportedFeatureList(uint8_t *featureList); void reportWwanZppFix(LocGpsLocation &zppLoc); + void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, + LocPosTechMask tech_mask); // downward calls // All below functions are to be defined by adapter specific modules: @@ -141,45 +164,43 @@ public: virtual void* getSibling(); virtual LocApiProxyBase* getLocApiProxy(); - virtual enum loc_api_adapter_err - startFix(const LocPosMode& posMode); - virtual enum loc_api_adapter_err - stopFix(); - virtual LocationError - deleteAidingData(const GnssAidingData& data); - 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 + virtual void startFix(const LocPosMode& fixCriteria, LocApiResponse* adapterResponse); + virtual void + stopFix(LocApiResponse* adapterResponse); + virtual void + deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse); + + virtual void injectPosition(double latitude, double longitude, float accuracy); - virtual enum loc_api_adapter_err + virtual void setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); + + // // TODO:: called from izatapipds 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, LocAGpsType agpsType); - virtual enum loc_api_adapter_err + + virtual void + atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, + AGpsBearerType bear, LocAGpsType agpsType); + virtual void atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err + virtual void setPositionMode(const LocPosMode& posMode); virtual LocationError - setServer(const char* url, int len); + setServerSync(const char* url, int len); virtual LocationError - setServer(unsigned int ip, int port, + setServerSync(unsigned int ip, int port, LocServerType type); - virtual LocationError + virtual void informNiResponse(GnssNiResponse userResponse, const void* passThroughData); - virtual LocationError setSUPLVersion(GnssConfigSuplVersion version); + virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version); virtual enum loc_api_adapter_err - setNMEATypes (uint32_t typesMask); - virtual LocationError setLPPConfig(GnssConfigLppProfile profile); + setNMEATypesSync(uint32_t typesMask); + virtual LocationError setLPPConfigSync(GnssConfigLppProfile profile); virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider); + setSensorControlConfigSync(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err - setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, + setSensorPropertiesSync(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, @@ -190,7 +211,7 @@ public: bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk); virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, + setSensorPerfControlConfigSync(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, int gyroSamplesPerBatch, @@ -201,16 +222,18 @@ public: int gyroBatchesPerSecHigh, int algorithmConfig); virtual LocationError - setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); - virtual LocationError setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP); - virtual LocationError setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP); + setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); + virtual LocationError setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask lppeCP); + virtual LocationError setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask lppeUP); + virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); + virtual GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); + virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); + virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); + virtual enum loc_api_adapter_err getWwanZppFix(); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended, - LocPosTechMask & tech_mask); + virtual void + getBestAvailableZppFix(); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); @@ -223,21 +246,11 @@ public: (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(); - virtual LocationError setGpsLock(GnssConfigGpsLock lock); + virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); /* Returns Current value of GPS Lock on success @@ -245,20 +258,11 @@ public: */ virtual int getGpsLock(void); - virtual LocationError setXtraVersionCheck(uint32_t check); - /* - Check if the modem support the service - */ - virtual bool gnssConstellationConfig(); + virtual LocationError setXtraVersionCheckSync(uint32_t check); - /* - 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, +typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, ContextBase *context); } // namespace loc_core diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 6ce0c345..d6a75aba 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -360,13 +360,13 @@ void AgpsStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 1, getAPN(), + subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(), getBearer(), mAgpsType); break; case AGPS_EVENT_DENIED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 0, getAPN(), + subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(), getBearer(), mAgpsType); break; @@ -661,7 +661,7 @@ void DSStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 1, NULL, + subscriberToNotify->mConnHandle, 1, NULL, 0, AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES); break; @@ -778,7 +778,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); mAtlOpenStatusCb( - connHandle, 0, NULL, AGPS_APN_BEARER_INVALID, agpsType); + connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType); return; } diff --git a/gnss/Agps.h b/gnss/Agps.h index 703a4750..f9a54f84 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -40,7 +40,7 @@ /* ATL callback function pointers * Passed in by Adapter to AgpsManager */ typedef std::function AgpsAtlOpenStatusCb; typedef std::function AgpsAtlCloseStatusCb; @@ -169,6 +169,7 @@ public: /* Getter/Setter methods */ void setAPN(char* apn, unsigned int len); inline char* getAPN() const { return (char*)mAPN; } + inline uint32_t getAPNLen() const { return mAPNLen; } inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline AGpsBearerType getBearer() const { return mBearer; } inline AGpsExtType getType() const { return mAgpsType; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7482fdf9..cb9744d9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -92,11 +92,11 @@ GnssAdapter::GnssAdapter() : /* Set ATL open/close callbacks */ AgpsAtlOpenStatusCb atlOpenStatusCb = - [this](int handle, int isSuccess, char* apn, + [this](int handle, int isSuccess, char* apn, uint32_t apnLen, AGpsBearerType bearerType, AGpsExtType agpsType) { mLocApi->atlOpenStatus( - handle, isSuccess, apn, bearerType, agpsType); + handle, isSuccess, apn, apnLen, bearerType, agpsType); }; AgpsAtlCloseStatusCb atlCloseStatusCb = [this](int handle, int isSuccess) { @@ -146,7 +146,7 @@ GnssAdapter::GnssAdapter() : dsClientCloseDataCallFn, dsClientReleaseFn, sendMsgFn); readConfigCommand(); - setConfigCommand(); + requestUlpCommand(); initDefaultAgpsCommand(); initEngHubProxyCommand(); } @@ -444,20 +444,6 @@ GnssAdapter::convertSuplVersion(const GnssConfigSuplVersion suplVersion) } } -inline GnssConfigSuplVersion -GnssAdapter::convertSuplVersion(const uint32_t suplVersion) -{ - switch (suplVersion) { - case 0x00020000: - return GNSS_CONFIG_SUPL_VERSION_2_0_0; - case 0x00020002: - return GNSS_CONFIG_SUPL_VERSION_2_0_2; - case 0x00010000: - default: - return GNSS_CONFIG_SUPL_VERSION_1_0_0; - } -} - inline uint32_t GnssAdapter::convertLppProfile(const GnssConfigLppProfile lppProfile) { @@ -474,22 +460,6 @@ GnssAdapter::convertLppProfile(const GnssConfigLppProfile lppProfile) } } -inline GnssConfigLppProfile -GnssAdapter::convertLppProfile(const uint32_t lppProfile) -{ - switch (lppProfile) { - case 1: - return GNSS_CONFIG_LPP_PROFILE_USER_PLANE; - case 2: - return GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; - case 3: - return GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; - case 0: - default: - return GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; - } -} - uint32_t GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask) { @@ -509,26 +479,6 @@ GnssAdapter::convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlane return mask; } -GnssConfigLppeControlPlaneMask -GnssAdapter::convertLppeCp(const uint32_t lppeControlPlaneMask) -{ - GnssConfigLppeControlPlaneMask mask = 0; - if ((1<<0) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_DBH_BIT; - } - if ((1<<1) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_WLAN_AP_MEASUREMENTS_BIT; - } - if ((1<<2) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SRN_AP_MEASUREMENTS_BIT; - } - if ((1<<3) & lppeControlPlaneMask) { - mask |= GNSS_CONFIG_LPPE_CONTROL_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; - } - return mask; -} - - uint32_t GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) { @@ -548,25 +498,6 @@ GnssAdapter::convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask) return mask; } -GnssConfigLppeUserPlaneMask -GnssAdapter::convertLppeUp(const uint32_t lppeUserPlaneMask) -{ - GnssConfigLppeUserPlaneMask mask = 0; - if ((1<<0) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_DBH_BIT; - } - if ((1<<1) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_WLAN_AP_MEASUREMENTS_BIT; - } - if ((1<<2) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_SRN_AP_MEASUREMENTS_BIT; - } - if ((1<<3) & lppeUserPlaneMask) { - mask |= GNSS_CONFIG_LPPE_USER_PLANE_SENSOR_BARO_MEASUREMENTS_BIT; - } - return mask; -} - uint32_t GnssAdapter::convertAGloProt(const GnssConfigAGlonassPositionProtocolMask aGloPositionProtocolMask) { @@ -623,27 +554,6 @@ GnssAdapter::convertSuplMode(const GnssConfigSuplModeMask suplModeMask) return mask; } -bool -GnssAdapter::resolveInAddress(const char* hostAddress, struct in_addr* inAddress) -{ - bool ret = true; - - struct hostent* hp; - hp = gethostbyname(hostAddress); - if (hp != NULL) { /* DNS OK */ - memcpy(inAddress, hp->h_addr_list[0], hp->h_length); - } else { - /* Try IP representation */ - if (inet_aton(hostAddress, inAddress) == 0) { - /* IP not valid */ - LOC_LOGE("%s]: DNS query on '%s' failed", __func__, hostAddress); - ret = false; - } - } - - return ret; -} - void GnssAdapter::readConfigCommand() { @@ -669,17 +579,37 @@ GnssAdapter::readConfigCommand() } } -LocationError +void +GnssAdapter::requestUlpCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgRequestUlp : public LocMsg { + GnssAdapter* mAdapter; + ContextBase& mContext; + inline MsgRequestUlp(GnssAdapter* adapter, + ContextBase& context) : + LocMsg(), + mAdapter(adapter), + mContext(context) {} + inline virtual void proc() const { + mContext.requestUlp((LocAdapterBase*)mAdapter, mContext.getCarrierCapabilities()); + } + }; + + if (mContext != NULL) { + sendMsg(new MsgRequestUlp(this, *mContext)); + } +} + +void GnssAdapter::setSuplHostServer(const char* server, int port) { - LocationError locErr = LOCATION_ERROR_SUCCESS; if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { char serverUrl[MAX_URL_LEN] = {}; int32_t length = -1; const char noHost[] = "NONE"; - locErr = LOCATION_ERROR_INVALID_PARAMETER; - if ((NULL == server) || (server[0] == 0) || (strncasecmp(noHost, server, sizeof(noHost)) == 0)) { serverUrl[0] = '\0'; @@ -691,14 +621,8 @@ GnssAdapter::setSuplHostServer(const char* server, int port) if (length >= 0 && strncasecmp(getServerUrl().c_str(), serverUrl, sizeof(serverUrl)) != 0) { setServerUrl(serverUrl); - locErr = mLocApi->setServer(serverUrl, length); - if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", - __func__, serverUrl); - } } } - return locErr; } void @@ -709,68 +633,105 @@ GnssAdapter::setConfigCommand() struct MsgSetConfig : public LocMsg { GnssAdapter& mAdapter; LocApiBase& mApi; - inline MsgSetConfig(GnssAdapter& adapter, - LocApiBase& api) : + inline MsgSetConfig(GnssAdapter& adapter, LocApiBase& api) : LocMsg(), mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - mApi.setSUPLVersion(mAdapter.convertSuplVersion(ContextBase::mGps_conf.SUPL_VER)); - mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE)); - mApi.setAGLONASSProtocol(ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT); - } - mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, - ContextBase::mGps_conf.SUPL_PORT); - mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE, - ContextBase::mSap_conf.SENSOR_PROVIDER); - mApi.setLPPeProtocolCp( - mAdapter.convertLppeCp(ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY)); - mApi.setLPPeProtocolUp( - mAdapter.convertLppeUp(ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY)); // set nmea mask type uint32_t mask = 0; if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; } - if (mApi.isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { mask |= LOC_NMEA_MASK_DEBUG_V02; } - if (mask != 0) { - mApi.setNMEATypes(mask); - } mAdapter.mNmeaMask= mask; - mApi.setXtraVersionCheck(ContextBase::mGps_conf.XTRA_VERSION_CHECK); - if (ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID || - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - mApi.setSensorProperties( - ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, - ContextBase::mSap_conf.GYRO_BIAS_RANDOM_WALK, - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - ContextBase::mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); - } - mApi.setSensorPerfControlConfig( - ContextBase::mSap_conf.SENSOR_CONTROL_MODE, - ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, - ContextBase::mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - ContextBase::mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - ContextBase::mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - ContextBase::mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - ContextBase::mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK); + std::string oldServerUrl = mAdapter.getServerUrl(); + mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, + ContextBase::mGps_conf.SUPL_PORT); + + // inject the configurations into modem + GnssAdapter& adapter = mAdapter; + loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; + loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; + + mApi.sendMsg(new LocApiMsg( + [&adapter, gpsConf, sapConf, oldServerUrl] () { + + std::string serverUrl = adapter.getServerUrl(); + int serverUrlLen = serverUrl.length(); + + if (gpsConf.AGPS_CONFIG_INJECT) { + adapter.mLocApi->setSUPLVersionSync( + adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER)); + adapter.mLocApi->setLPPConfigSync( + adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE)); + adapter.mLocApi->setAGLONASSProtocolSync( + gpsConf.A_GLONASS_POS_PROTOCOL_SELECT); + } + + if ((serverUrlLen !=0) && (oldServerUrl.compare(serverUrl) != 0)) { + LocationError locErr = + adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", + __func__, serverUrl.c_str()); + } + } + + adapter.mLocApi->setSensorControlConfigSync(sapConf.SENSOR_USAGE, + sapConf.SENSOR_PROVIDER); + adapter.mLocApi->setLPPeProtocolCpSync( + adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY)); + adapter.mLocApi->setLPPeProtocolUpSync( + adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY)); + + // set nmea mask type + uint32_t mask = 0; + if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } + + if (mask != 0) { + adapter.mLocApi->setNMEATypesSync(mask); + } + + adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + adapter.mLocApi->setSensorPropertiesSync( + sapConf.GYRO_BIAS_RANDOM_WALK_VALID, + sapConf.GYRO_BIAS_RANDOM_WALK, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); + } + adapter.mLocApi->setSensorPerfControlConfigSync( + sapConf.SENSOR_CONTROL_MODE, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_ALGORITHM_CONFIG_MASK); + } )); } }; @@ -812,8 +773,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) GnssAdapter& mAdapter; LocApiBase& mApi; GnssConfig mConfig; - uint32_t* mIds; size_t mCount; + uint32_t* mIds; inline MsgGnssUpdateConfig(GnssAdapter& adapter, LocApiBase& api, GnssConfig config, @@ -823,163 +784,260 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) mAdapter(adapter), mApi(api), mConfig(config), - mIds(ids), - mCount(count) {} + mCount(count), + mIds(ids) {} inline virtual ~MsgGnssUpdateConfig() { - delete[] mIds; + delete [] mIds; } + inline virtual void proc() const { - LocationError* errs = new LocationError[mCount]; - LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t index = 0; - if (errs == nullptr) { - LOC_LOGE("%s] new allocation failed, fatal error.", __func__); - return; - } + GnssAdapter& adapter = mAdapter; + size_t countOfConfigs = mCount; + GnssConfig gnssConfigRequested = mConfig; + GnssConfig gnssConfigNeedEngineUpdate = mConfig; + std::string oldServerUrl = mAdapter.getServerUrl(); - if (mConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - uint32_t newGpsLock = mAdapter.convertGpsLock(mConfig.gpsLock); + std::vector sessionIds; + sessionIds.assign(mIds, mIds + mCount); + std::vector errs(mCount, LOCATION_ERROR_SUCCESS); + int index = 0; + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + index++; + uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; - if (0 == mAdapter.getPowerVoteId()) { - err = mApi.setGpsLock(mConfig.gpsLock); - } - if (index < mCount) { - errs[index++] = err; + if (0 != mAdapter.getPowerVoteId()) { + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion); + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + index++; + uint32_t newSuplVersion = + mAdapter.convertSuplVersion(gnssConfigRequested.suplVersion); if (newSuplVersion != ContextBase::mGps_conf.SUPL_VER && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.SUPL_VER = newSuplVersion; - err = mApi.setSUPLVersion(mConfig.suplVersion); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + index++; if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { - err = mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, - mConfig.assistanceServer.port); - } else if (GNSS_ASSISTANCE_TYPE_C2K == mConfig.assistanceServer.type) { - if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - struct in_addr addr; - if (!mAdapter.resolveInAddress(mConfig.assistanceServer.hostName, - &addr)) { - LOC_LOGE("%s]: hostName %s cannot be resolved", - __func__, mConfig.assistanceServer.hostName); - err = LOCATION_ERROR_INVALID_PARAMETER; - } else { - unsigned int ip = htonl(addr.s_addr); - err = mApi.setServer(ip, mConfig.assistanceServer.port, - LOC_AGPS_CDMA_PDE_SERVER); - } - } else { - err = LOCATION_ERROR_SUCCESS; - } - } else { + mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, + mConfig.assistanceServer.port); + } else if (GNSS_ASSISTANCE_TYPE_C2K != mConfig.assistanceServer.type) { LOC_LOGE("%s]: Not a valid gnss assistance type %u", - __func__, mConfig.assistanceServer.type); - err = LOCATION_ERROR_INVALID_PARAMETER; - } - if (index < mCount) { - errs[index++] = err; + __func__, mConfig.assistanceServer.type); + errs.at(index) = LOCATION_ERROR_INVALID_PARAMETER; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile); + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + index++; + uint32_t newLppProfile = mAdapter.convertLppProfile(gnssConfigRequested.lppProfile); if (newLppProfile != ContextBase::mGps_conf.LPP_PROFILE && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.LPP_PROFILE = newLppProfile; - err = mApi.setLPPConfig(mConfig.lppProfile); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + index++; uint32_t newLppeControlPlaneMask = - mAdapter.convertLppeCp(mConfig.lppeControlPlaneMask); + mAdapter.convertLppeCp(gnssConfigRequested.lppeControlPlaneMask); if (newLppeControlPlaneMask != ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY) { ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY = newLppeControlPlaneMask; - err = mApi.setLPPeProtocolCp(mConfig.lppeControlPlaneMask); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + index++; uint32_t newLppeUserPlaneMask = - mAdapter.convertLppeUp(mConfig.lppeUserPlaneMask); + mAdapter.convertLppeUp(gnssConfigRequested.lppeUserPlaneMask); if (newLppeUserPlaneMask != ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY) { ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY = newLppeUserPlaneMask; - err = mApi.setLPPeProtocolUp(mConfig.lppeUserPlaneMask); } else { - err = LOCATION_ERROR_SUCCESS; - } - if (index < mCount) { - errs[index++] = err; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT); } } - if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + index++; uint32_t newAGloProtMask = - mAdapter.convertAGloProt(mConfig.aGlonassPositionProtocolMask); + mAdapter.convertAGloProt(gnssConfigRequested.aGlonassPositionProtocolMask); if (newAGloProtMask != ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = newAGloProtMask; - err = mApi.setAGLONASSProtocol(mConfig.aGlonassPositionProtocolMask); } else { - err = LOCATION_ERROR_SUCCESS; + gnssConfigNeedEngineUpdate.flags &= + ~(GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT); } - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { - uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + index++; + uint32_t newEP4ES = mAdapter.convertEP4ES( + gnssConfigRequested.emergencyPdnForEmergencySupl); if (newEP4ES != ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = newEP4ES; } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { - uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + index++; + uint32_t newSuplEs = mAdapter.convertSuplEs( + gnssConfigRequested.suplEmergencyServices); if (newSuplEs != ContextBase::mGps_conf.SUPL_ES) { ContextBase::mGps_conf.SUPL_ES = newSuplEs; } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } - } - if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { - uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask); + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + index++; + uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { ContextBase::mGps_conf.SUPL_MODE = newSuplMode; mAdapter.getUlpProxy()->setCapabilities( ContextBase::getCarrierCapabilities()); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); } - err = LOCATION_ERROR_SUCCESS; - if (index < mCount) { - errs[index++] = err; - } } - mAdapter.reportResponse(index, errs, mIds); - delete[] errs; + LocApiCollectiveResponse *configCollectiveResponse = new LocApiCollectiveResponse( + *adapter.getContext(), + [&adapter, sessionIds, countOfConfigs] (std::vector errs) { + + std::vector ids(sessionIds); + adapter.reportResponse(countOfConfigs, errs.data(), ids.data()); + }); + + mApi.sendMsg(new LocApiMsg( + [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, + countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () { + + size_t index = 0; + LocationError err = LOCATION_ERROR_SUCCESS; + std::vector errsList(errs); + + std::string serverUrl = adapter.getServerUrl(); + int serverUrlLen = serverUrl.length(); + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + err = adapter.mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_SUPL) { + if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { + err = adapter.mLocApi->setServerSync( + serverUrl.c_str(), serverUrlLen); + errsList[index] = err; + } + } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_C2K) { + struct in_addr addr; + struct hostent* hp; + bool resolveAddrSuccess = true; + + hp = gethostbyname( + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + if (hp != NULL) { /* DNS OK */ + memcpy(&addr, hp->h_addr_list[0], hp->h_length); + } else { + /* Try IP representation */ + if (inet_aton( + gnssConfigNeedEngineUpdate.assistanceServer.hostName, + &addr) == 0) { + /* IP not valid */ + LOC_LOGE("%s]: hostname '%s' cannot be resolved ", + __func__, + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; + } else { + resolveAddrSuccess = false; + } + } + + if (resolveAddrSuccess) { + unsigned int ip = htonl(addr.s_addr); + err = adapter.mLocApi->setServerSync(ip, + gnssConfigNeedEngineUpdate.assistanceServer.port, + LOC_AGPS_CDMA_PDE_SERVER); + errsList[index] = err; + } + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + err = adapter.mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + err = adapter.mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + err = adapter.mLocApi->setLPPeProtocolCpSync( + gnssConfigRequested.lppeControlPlaneMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + err = adapter.mLocApi->setLPPeProtocolUpSync( + gnssConfigRequested.lppeUserPlaneMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + index++; + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + err = adapter.mLocApi->setAGLONASSProtocolSync( + gnssConfigRequested.aGlonassPositionProtocolMask); + if (index < countOfConfigs) { + errsList[index] = err; + } + } + } + configCollectiveResponse->returnToSender(errsList); + })); } }; @@ -992,6 +1050,13 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) return ids; } +void GnssAdapter::deleteAidingData(const GnssAidingData &data, uint32_t sessionId) { + mLocApi->deleteAidingData(data, new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId); + })); +} + uint32_t GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) { @@ -1000,22 +1065,18 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) struct MsgDeleteAidingData : public LocMsg { GnssAdapter& mAdapter; - LocApiBase& mApi; uint32_t mSessionId; GnssAidingData mData; inline MsgDeleteAidingData(GnssAdapter& adapter, - LocApiBase& api, uint32_t sessionId, GnssAidingData& data) : LocMsg(), mAdapter(adapter), - mApi(api), mSessionId(sessionId), mData(data) {} inline virtual void proc() const { - LocationError err = LOCATION_ERROR_SUCCESS; - err = mApi.deleteAidingData(mData); - mAdapter.reportResponse(err, mSessionId); + mAdapter.deleteAidingData(mData, mSessionId); + SystemStatus* s = mAdapter.getSystemStatus(); if ((nullptr != s) && (mData.deleteAll)) { s->setDefaultGnssEngineStates(); @@ -1024,7 +1085,7 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) } }; - sendMsg(new MsgDeleteAidingData(*this, *mLocApi, sessionId, data)); + sendMsg(new MsgDeleteAidingData(*this, sessionId, data)); return sessionId; } @@ -1216,11 +1277,9 @@ GnssAdapter::stopClientSessions(LocationAPI* client) LOC_LOGD("%s]: client %p", __func__, client); for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end();) { if (client == it->first.client) { - LocationError err = stopTrackingMultiplex(it->first.client, it->first.id); - if (LOCATION_ERROR_SUCCESS == err) { - it = mTrackingSessions.erase(it); - continue; - } + stopTrackingMultiplex(it->first.client, it->first.id); + it = mTrackingSessions.erase(it); + continue; } ++it; // increment only when not erasing an iterator } @@ -1274,18 +1333,23 @@ GnssAdapter::updateClientsEventMask() void GnssAdapter::handleEngineUpEvent() { - struct MsgRestartSessions : public LocMsg { + LOC_LOGD("%s]: ", __func__); + + struct MsgHandleEngineUpEvent : public LocMsg { GnssAdapter& mAdapter; - inline MsgRestartSessions(GnssAdapter& adapter) : + inline MsgHandleEngineUpEvent(GnssAdapter& adapter) : LocMsg(), mAdapter(adapter) {} virtual void proc() const { + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); + // restart sessions mAdapter.restartSessions(); } }; + readConfigCommand(); setConfigCommand(); - sendMsg(new MsgRestartSessions(*this)); + sendMsg(new MsgHandleEngineUpEvent(*this)); } void @@ -1309,11 +1373,9 @@ GnssAdapter::restartSessions() LocPosMode locPosMode = {}; convertOptions(locPosMode, smallestIntervalOptions); - // inform engine hub of the fix mode and start session - mEngHubProxy->gnssSetFixMode(locPosMode); - mEngHubProxy->gnssStartFix(); - - mLocApi->startFix(locPosMode); + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [] (LocationError err) {} + )); } void @@ -1336,12 +1398,14 @@ GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) return; } - LocationCapabilitiesMask mask = mAdapter.getCapabilities(); - callbacks.capabilitiesCb(mask); + LocationCapabilitiesMask mask = mAdapter.getCapabilities(); + callbacks.capabilitiesCb(mask); } }; - sendMsg(new MsgRequestCapabilities(*this, client)); + if (ContextBase::isEngineCapabilitiesKnown()) { + sendMsg(new MsgRequestCapabilities(*this, client)); + } } LocationCapabilitiesMask @@ -1359,22 +1423,20 @@ GnssAdapter::getCapabilities() if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; } - if (mLocApi == nullptr) - return mask; - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; } - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; } - if (mLocApi->isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; } - if (mLocApi->gnssConstellationConfig()) { + if (ContextBase::gnssConstellationConfig()) { mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; } - if (mLocApi->isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; } return mask; @@ -1383,9 +1445,9 @@ GnssAdapter::getCapabilities() void GnssAdapter::broadcastCapabilities(LocationCapabilitiesMask mask) { - for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { - if (nullptr != it->second.capabilitiesCb) { - it->second.capabilitiesCb(mask); + for (auto clientData : mClientData) { + if (nullptr != clientData.second.capabilitiesCb) { + clientData.second.capabilitiesCb(mask); } } } @@ -1473,8 +1535,7 @@ GnssAdapter::reportResponse(LocationAPI* client, LocationError err, uint32_t ses LOC_LOGD("%s]: client %p id %u err %u", __func__, client, sessionId, err); auto it = mClientData.find(client); - if (it != mClientData.end() && - it->second.responseCb != nullptr) { + if (it != mClientData.end() && it->second.responseCb != nullptr) { it->second.responseCb(err, sessionId); } else { LOC_LOGW("%s]: client %p id %u not found in data", __func__, client, sessionId); @@ -1552,12 +1613,14 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) err = LOCATION_ERROR_INVALID_PARAMETER; } else { // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.startTrackingMultiplex(mOptions); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + bool reportToClientWithNoWait = + mAdapter.startTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); } } - mAdapter.reportResponse(mClient, err, mSessionId); } }; @@ -1566,13 +1629,14 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) } -LocationError -GnssAdapter::startTrackingMultiplex(const LocationOptions& options) +bool +GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; if (mTrackingSessions.empty()) { - err = startTracking(options); + reportToClientWithNoWait = startTracking(client, sessionId, options); } else { // get the LocationOptions that has the smallest interval, which should be the active one LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time @@ -1585,17 +1649,19 @@ GnssAdapter::startTrackingMultiplex(const LocationOptions& options) // if new session's minInterval is smaller than any in other sessions if (options.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with new options - err = startTracking(options); + reportToClientWithNoWait = startTracking(client, sessionId, options); } } - return err; + return reportToClientWithNoWait; } -LocationError -GnssAdapter::startTracking(const LocationOptions& options) +bool +GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + LocPosMode locPosMode = {}; convertOptions(locPosMode, options); if (!mUlpProxy->sendFixMode(locPosMode)) { @@ -1606,17 +1672,56 @@ GnssAdapter::startTracking(const LocationOptions& options) mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - loc_api_adapter_err apiErr = mLocApi->startFix(locPosMode); - if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { - err = LOCATION_ERROR_SUCCESS; - } else { - err = LOCATION_ERROR_GENERAL_FAILURE; - } + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + eraseTrackingSession(client, sessionId); + } + + reportResponse(client, err, sessionId); + } + )); + + reportToClientWithNoWait = false; } - return err; + return reportToClientWithNoWait; } +bool +GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& updatedOptions, const LocationOptions& oldOptions) +{ + bool reportToClientWithNoWait = true; + + LocPosMode locPosMode = {}; + convertOptions(locPosMode, updatedOptions); + if (!mUlpProxy->sendFixMode(locPosMode)) { + // do nothing + } + if (!mUlpProxy->sendStartFix()) { + // inform engine hub that GNSS session is about to start + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); + + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId, oldOptions] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + // restore the old LocationOptions + saveTrackingSession(client, sessionId, oldOptions); + } + + reportResponse(client, err, sessionId); + } + )); + + reportToClientWithNoWait = false; + } + + return reportToClientWithNoWait; +} + + void GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) { @@ -1670,8 +1775,11 @@ GnssAdapter::startTrackingCommand() // inform engine hub of the fix mode and start session mAdapter.mEngHubProxy->gnssSetFixMode(ulpPositionMode); mAdapter.mEngHubProxy->gnssStartFix(); - if (!mAdapter.isInSession()) { - mApi.startFix(ulpPositionMode); + if (!mAdapter.isInSession()) { + LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); + mApi.startFix(ulpPositionMode, new LocApiResponse(*mAdapter.getContext(), + [] (LocationError err) {} + )); } } }; @@ -1710,12 +1818,14 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, err = LOCATION_ERROR_INVALID_PARAMETER; } else { // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + bool reportToClientWithNoWait = + mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, err, mSessionId); } } - mAdapter.reportResponse(mClient, err, mSessionId); } // we do not reportResponse for the case where there is no existing tracking session // for the client and id being used, since updateTrackingCommand can be sent to both @@ -1726,19 +1836,21 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, sendMsg(new MsgUpdateTracking(*this, *mLocApi, client, id, options)); } -LocationError +bool GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, const LocationOptions& options) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + + LocationSessionKey key(client, id); + // get the session we are updating + auto it = mTrackingSessions.find(key); + // cache the clients existing LocationOptions + LocationOptions oldOptions = it->second; if (1 == mTrackingSessions.size()) { - err = startTracking(options); + reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); } else { - LocationSessionKey key(client, id); - - // get the session we are updating - auto it = mTrackingSessions.find(key); if (it != mTrackingSessions.end()) { // find the smallest interval, other than the session we are updating LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time @@ -1753,16 +1865,17 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, // if session we are updating has smaller interval then next smallest if (options.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with the newly updated interval - err = startTracking(options); + reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); // else if the session we are updating used to be the smallest } else if (it->second.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with the next smallest - err = startTracking(smallestIntervalOptions); + reportToClientWithNoWait = updateTracking( + client, id, smallestIntervalOptions, oldOptions); } } } - return err; + return reportToClientWithNoWait; } void @@ -1786,31 +1899,31 @@ GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) mSessionId(sessionId) {} inline virtual void proc() const { if (mAdapter.isTrackingSession(mClient, mSessionId)) { - LocationError err = LOCATION_ERROR_SUCCESS; // Api doesn't support multiple clients for time based tracking, so mutiplex - err = mAdapter.stopTrackingMultiplex(mClient, mSessionId); - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.eraseTrackingSession(mClient, mSessionId); + bool reportToClientWithNoWait = + mAdapter.stopTrackingMultiplex(mClient, mSessionId); + mAdapter.eraseTrackingSession(mClient, mSessionId); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); } - mAdapter.reportResponse(mClient, err, mSessionId); } // we do not reportResponse for the case where there is no existing tracking session // for the client and id being used, since stopTrackingCommand can be sent to both // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response - } }; sendMsg(new MsgStopTracking(*this, *mLocApi, client, id)); } -LocationError +bool GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; if (1 == mTrackingSessions.size()) { - err = stopTracking(); + reportToClientWithNoWait = stopTracking(client, id); } else { LocationSessionKey key(client, id); @@ -1830,31 +1943,32 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) // if session we are stopping has smaller interval then next smallest if (it->second.minInterval < smallestIntervalOptions.minInterval) { // restart time based tracking with next smallest interval - err = startTracking(smallestIntervalOptions); + reportToClientWithNoWait = startTracking(client, id, smallestIntervalOptions); } } } - return err; + return reportToClientWithNoWait; } -LocationError -GnssAdapter::stopTracking() +bool +GnssAdapter::stopTracking(LocationAPI* client, uint32_t id) { - LocationError err = LOCATION_ERROR_SUCCESS; + bool reportToClientWithNoWait = true; + if (!mUlpProxy->sendStopFix()) { // inform engine hub that GNSS session has stopped mEngHubProxy->gnssStopFix(); - loc_api_adapter_err apiErr = mLocApi->stopFix(); - if (LOC_API_ADAPTER_ERR_SUCCESS == apiErr) { - err = LOCATION_ERROR_SUCCESS; - } else { - err = LOCATION_ERROR_GENERAL_FAILURE; - } + mLocApi->stopFix(new LocApiResponse(*getContext(), + [this, client, id] (LocationError err) { + reportResponse(client, err, id); + })); + + reportToClientWithNoWait = false; } - return err; + return reportToClientWithNoWait; } void @@ -1879,7 +1993,9 @@ GnssAdapter::stopTrackingCommand() mLocPosMode.mode = LOC_POSITION_MODE_INVALID; mAdapter.setUlpPositionMode(mLocPosMode); // don't need to multiplex because ULP will do that for us if it is present - mApi.stopFix(); + mApi.stopFix(new LocApiResponse(*mAdapter.getContext(), + [] (LocationError /* err*/) {} + )); } }; @@ -1900,24 +2016,12 @@ GnssAdapter::getZppCommand() mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - UlpLocation location = {}; - LocPosTechMask techMask = LOC_POS_TECH_MASK_DEFAULT; - GpsLocationExtended locationExtended = {}; - locationExtended.size = sizeof(locationExtended); - - mApi.getBestAvailableZppFix(location.gpsLocation, locationExtended, - techMask); - //Mark the location source as from ZPP - location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; - location.position_source = ULP_LOCATION_IS_FROM_ZPP; - - mAdapter.getUlpProxy()->reportPosition(location, - locationExtended, - LOC_SESS_SUCCESS, - techMask); + mApi.getBestAvailableZppFix(); } }; + // TODO: we could avoid this extra context switch, as getBestAvailableZppFix + // will return asynchronously anyways. sendMsg(new MsgGetZpp(*this, *mLocApi)); } @@ -2001,28 +2105,28 @@ GnssAdapter::gnssNiResponseCommand(GnssNiResponse response, void* rawRequest) LOC_LOGD("%s]: response %u", __func__, response); struct MsgGnssNiResponse : public LocMsg { + GnssAdapter& mAdapter; LocApiBase& mApi; const GnssNiResponse mResponse; const void* mPayload; - inline MsgGnssNiResponse(LocApiBase& api, + inline MsgGnssNiResponse(GnssAdapter& adapter, + LocApiBase& api, const GnssNiResponse response, const void* rawRequest) : LocMsg(), + mAdapter(adapter), mApi(api), mResponse(response), mPayload(rawRequest) {} inline virtual ~MsgGnssNiResponse() { - // 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 { + const void *rawPayload = mPayload; mApi.informNiResponse(mResponse, mPayload); } }; - sendMsg(new MsgGnssNiResponse(*mLocApi, response, rawRequest)); + sendMsg(new MsgGnssNiResponse(*this, *mLocApi, response, rawRequest)); } @@ -2059,7 +2163,11 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) } else { mContext.modemPowerVote(true); mAdapter.setPowerVoteId(mSessionId); - mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); + + mApi.sendMsg(new LocApiMsg([&mApi = mApi] () { + mApi.setGpsLockSync(GNSS_CONFIG_GPS_LOCK_NONE); + })); + mAdapter.mXtraObserver.updateLockStatus( mAdapter.convertGpsLock(GNSS_CONFIG_GPS_LOCK_NONE)); } @@ -2103,7 +2211,12 @@ GnssAdapter::disableCommand(uint32_t id) } else { mContext.modemPowerVote(false); mAdapter.setPowerVoteId(0); - mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); + + GnssConfigGpsLock gpsLock = + mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK); + mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { + mApi.setGpsLockSync(gpsLock); + })); mAdapter.mXtraObserver.updateLockStatus( mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); } @@ -2871,6 +2984,41 @@ bool GnssAdapter::reportDataCallClosed(){ return true; } +bool GnssAdapter::reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask) { + + struct MsgReportZpp : public LocMsg { + GnssAdapter& mAdapter; + UlpLocation mUlpLocation; + GpsLocationExtended mGpsLocationExtended; + LocPosTechMask mPosTechMask; + + inline MsgReportZpp(GnssAdapter& adapter, + LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, + LocPosTechMask tech_mask) : + LocMsg(), + mAdapter(adapter), + mGpsLocationExtended(location_extended), + mPosTechMask(tech_mask) { + mUlpLocation = {}; + memcpy(&mUlpLocation.gpsLocation, &zppLoc, sizeof(LocGpsLocation)); + + //Mark the location source as from ZPP + mUlpLocation.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; + mUlpLocation.position_source = ULP_LOCATION_IS_FROM_ZPP; + } + inline virtual void proc() const { + mAdapter.getUlpProxy()->reportPosition(mUlpLocation, + mGpsLocationExtended, + LOC_SESS_SUCCESS, + mPosTechMask); + } + }; + + sendMsg(new MsgReportZpp(*this, zppLoc, location_extended, tech_mask)); + return true; +} + void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType){ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 85962cfb..80d67618 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -157,7 +157,7 @@ public: LocationCallbacks getClientCallbacks(LocationAPI* client); LocationCapabilitiesMask getCapabilities(); void broadcastCapabilities(LocationCapabilitiesMask); - LocationError setSuplHostServer(const char* server, int port); + void setSuplHostServer(const char* server, int port); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -180,12 +180,16 @@ public: void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); bool setUlpPositionMode(const LocPosMode& mode); LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } - LocationError startTrackingMultiplex(const LocationOptions& options); - LocationError startTracking(const LocationOptions& options); - LocationError stopTrackingMultiplex(LocationAPI* client, uint32_t id); - LocationError stopTracking(); - LocationError updateTrackingMultiplex(LocationAPI* client, uint32_t id, + bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options); + bool startTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& options); + bool stopTrackingMultiplex(LocationAPI* client, uint32_t id); + bool stopTracking(LocationAPI* client, uint32_t id); + bool updateTrackingMultiplex(LocationAPI* client, uint32_t id, const LocationOptions& options); + bool updateTracking(LocationAPI* client, uint32_t sessionId, + const LocationOptions& updatedOptions, const LocationOptions& oldOptions); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -203,9 +207,11 @@ public: void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); void readConfigCommand(); void setConfigCommand(); + void requestUlpCommand(); void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); + void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); void initDefaultAgpsCommand(); @@ -224,7 +230,6 @@ public: { mControlCallbacks = controlCallbacks; } void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } uint32_t getPowerVoteId() { return mPowerVoteId; } - bool resolveInAddress(const char* hostAddress, struct in_addr* inAddress); virtual bool isInSession() { return !mTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); @@ -252,6 +257,8 @@ public: virtual bool requestSuplES(int connHandle); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); + virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, + GpsLocationExtended &location_extended, LocPosTechMask tech_mask); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, @@ -279,15 +286,11 @@ public: static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock); static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion); - static GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile); - static GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl); static uint32_t convertSuplEs(const GnssConfigSuplEmergencyServices suplEmergencyServices); static uint32_t convertLppeCp(const GnssConfigLppeControlPlaneMask lppeControlPlaneMask); - static GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); static uint32_t convertLppeUp(const GnssConfigLppeUserPlaneMask lppeUserPlaneMask); - static GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); static uint32_t convertAGloProt(const GnssConfigAGlonassPositionProtocolMask); static uint32_t convertSuplMode(const GnssConfigSuplModeMask suplModeMask); static void convertSatelliteInfo(std::vector& out, diff --git a/gnss/Makefile.am b/gnss/Makefile.am index 7ee60892..db20c15a 100644 --- a/gnss/Makefile.am +++ b/gnss/Makefile.am @@ -7,7 +7,7 @@ AM_CFLAGS = \ -I../utils \ -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ -I../location \ - -std=c++11 + -std=c++1y libgnss_la_SOURCES = \ location_gnss.cpp \ From f8bd86f0124cb38152702ac186a77ef54757cc17 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 3 May 2018 11:41:51 -0700 Subject: [PATCH 648/945] fix: Add intermediate fixes in gnss debug report Include intermediate location fix info in gnss debug report that is cached in SystemStatus in addition to final fixes, so that the gnss debug report should always hold the latest information. Change-Id: I60aef92cf6d143a1b4f4b510ca2113887d051dcc CRs-Fixed: 2230415 --- gnss/GnssAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 0c0d8d00..fd406ac8 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2179,7 +2179,8 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = mAdapter.getSystemStatus(); - if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ + if ((nullptr != s) && + ((LOC_SESS_SUCCESS == mStatus) || (LOC_SESS_INTERMEDIATE == mStatus))){ s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); From 9bb67cc1d40bcdf3ec21fdf66373a134eeadd711 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 3 May 2018 11:41:51 -0700 Subject: [PATCH 649/945] fix: Add intermediate fixes in gnss debug report Include intermediate location fix info in gnss debug report that is cached in SystemStatus in addition to final fixes, so that the gnss debug report should always hold the latest information. Change-Id: I60aef92cf6d143a1b4f4b510ca2113887d051dcc CRs-Fixed: 2230415 --- gnss/GnssAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index a482acc0..d08bd447 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2050,7 +2050,8 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = mAdapter.getSystemStatus(); - if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ + if ((nullptr != s) && + ((LOC_SESS_SUCCESS == mStatus) || (LOC_SESS_INTERMEDIATE == mStatus))){ s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); From 5d6ee836086d1ed7769885a824662577f53eef9d Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 3 May 2018 11:41:51 -0700 Subject: [PATCH 650/945] fix: Add intermediate fixes in gnss debug report Include intermediate location fix info in gnss debug report that is cached in SystemStatus in addition to final fixes, so that the gnss debug report should always hold the latest information. Change-Id: I60aef92cf6d143a1b4f4b510ca2113887d051dcc CRs-Fixed: 2230415 --- gnss/GnssAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index cb9744d9..d1636d8b 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2292,7 +2292,8 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = mAdapter.getSystemStatus(); - if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ + if ((nullptr != s) && + ((LOC_SESS_SUCCESS == mStatus) || (LOC_SESS_INTERMEDIATE == mStatus))){ s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); From 1e824a912c76a87e5d35363036ba0916cfc4801e Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 13 Feb 2018 17:19:54 -0800 Subject: [PATCH 651/945] moving AGnssCbIface from static to class member mAGnssCbIface is a static C++ obj, which ctor may not get called at load time, but its memory block will only be 0'ed out. Change-Id: Ie275f916a01c5eb3bf0a7cfa71b19fe4e0d3e879 CRs-Fixed: 2190347 --- android/AGnss.cpp | 25 ++++++++++++++++++++----- android/AGnss.h | 6 ++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/android/AGnss.cpp b/android/AGnss.cpp index 2f7d38db..fe50c9a0 100644 --- a/android/AGnss.cpp +++ b/android/AGnss.cpp @@ -30,12 +30,23 @@ namespace gnss { namespace V1_1 { namespace implementation { -sp AGnss::sAGnssCbIface = nullptr; +static AGnss* spAGnss = nullptr; AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { + spAGnss = this; +} + +AGnss::~AGnss() { + spAGnss = nullptr; } void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ + if (nullptr != spAGnss) { + spAGnss->statusIpV4Cb(status); + } +} + +void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) { IAGnssCallback::AGnssStatusIpV4 st = {}; switch (status.type) { @@ -72,9 +83,13 @@ void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ } st.ipV4Addr = status.ipV4Addr; - auto r = sAGnssCbIface->agnssStatusIpV4Cb(st); - if (!r.isOk()) { - LOC_LOGE("Error invoking AGNSS status cb %s", r.description().c_str()); + if (mAGnssCbIface != nullptr) { + auto r = mAGnssCbIface->agnssStatusIpV4Cb(st); + if (!r.isOk()) { + LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str()); + } + } else { + LOC_LOGw("setCallback has not been called yet"); } } @@ -86,7 +101,7 @@ Return AGnss::setCallback(const sp& callback) { } // Save the interface - sAGnssCbIface = callback; + mAGnssCbIface = callback; AgpsCbInfo cbInfo = {}; cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; diff --git a/android/AGnss.h b/android/AGnss.h index 464d87ee..4b599b94 100644 --- a/android/AGnss.h +++ b/android/AGnss.h @@ -43,7 +43,7 @@ struct Gnss; struct AGnss : public IAGnss { AGnss(Gnss* gnss); - ~AGnss() = default; + ~AGnss(); /* * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. * These declarations were generated from IAGnss.hal. @@ -60,12 +60,14 @@ struct AGnss : public IAGnss { Return setServer(IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) override; + void statusIpV4Cb(AGnssExtStatusIpV4 status); + /* Data call setup callback passed down to GNSS HAL implementation */ static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); private: Gnss* mGnss = nullptr; - static sp sAGnssCbIface; + sp mAGnssCbIface = nullptr; }; } // namespace implementation From e807cc4aa117b8b412cb3c53c8df600fde4d4bc0 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 17 Apr 2018 11:11:26 -0700 Subject: [PATCH 652/945] fix: Incorrect path to ehub socket directory Change-Id: I58b41c4a8de8b51c8a6effe989182ea5942cff6e CRs-Fixed: 2196048 --- utils/gps_extended_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b7b1c09c..21eb5d55 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1495,7 +1495,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" #define SOCKET_DIR_LOCATION "/dev/socket/location/" -#define SOCKET_DIR_EHUB "/dev/socket/location/ehub" +#define SOCKET_DIR_EHUB "/dev/socket/location/ehub/" #define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" From 39837685982e73f6ea0be762eaa686577265e053 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 23:00:16 -0700 Subject: [PATCH 653/945] renamed DataItemIndex and ClientIndex files and moved them into utils. Change-Id: I138471168bf58d2cf09c6a435088edea29a567d0 CRs-Fixed: 2218519 --- core/data-items/common/ClientIndex.h => utils/LocListMap.h | 0 .../common/DataItemIndex.h => utils/LocUnorderedSetMap.h | 0 utils/Makefile.am | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) rename core/data-items/common/ClientIndex.h => utils/LocListMap.h (100%) rename core/data-items/common/DataItemIndex.h => utils/LocUnorderedSetMap.h (100%) diff --git a/core/data-items/common/ClientIndex.h b/utils/LocListMap.h similarity index 100% rename from core/data-items/common/ClientIndex.h rename to utils/LocListMap.h diff --git a/core/data-items/common/DataItemIndex.h b/utils/LocUnorderedSetMap.h similarity index 100% rename from core/data-items/common/DataItemIndex.h rename to utils/LocUnorderedSetMap.h diff --git a/utils/Makefile.am b/utils/Makefile.am index 3801fdd4..33afc1be 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -28,7 +28,8 @@ libgps_utils_la_h_sources = \ gps_extended_c.h \ gps_extended.h \ loc_gps.h \ - log_util.h + log_util.h \ + LocUnorderedSetMap.h libgps_utils_la_c_sources = \ linked_list.c \ From 0c73d4037677e1cb191001020ca3ddab46174706 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 22:57:51 -0700 Subject: [PATCH 654/945] changed SystemStatusOsObserver to allow clients to subscribe before subscription obj arrives, and also simplified ClientIndex and DataItemIndex implementation significantly. Change-Id: I092f344e688fa698aa98795b8a8f0c1ba8fcd9e4 CRs-Fixed: 2218519 --- core/Android.mk | 3 - core/Makefile.am | 3 - core/SystemStatus.cpp | 4 +- core/SystemStatusOsObserver.cpp | 623 ++++++++++------------- core/SystemStatusOsObserver.h | 94 ++-- core/data-items/common/ClientIndex.cpp | 172 ------- core/data-items/common/DataItemIndex.cpp | 203 -------- core/data-items/common/IClientIndex.h | 83 --- core/data-items/common/IDataItemIndex.h | 94 ---- core/data-items/common/IndexFactory.cpp | 64 --- core/data-items/common/IndexFactory.h | 48 -- utils/LocListMap.h | 70 --- utils/LocUnorderedSetMap.h | 166 +++++- 13 files changed, 473 insertions(+), 1154 deletions(-) delete mode 100644 core/data-items/common/ClientIndex.cpp delete mode 100644 core/data-items/common/DataItemIndex.cpp delete mode 100644 core/data-items/common/IClientIndex.h delete mode 100644 core/data-items/common/IDataItemIndex.h delete mode 100644 core/data-items/common/IndexFactory.cpp delete mode 100644 core/data-items/common/IndexFactory.h delete mode 100644 utils/LocListMap.h diff --git a/core/Android.mk b/core/Android.mk index 1374b6c0..82660d5e 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -31,9 +31,6 @@ LOCAL_SRC_FILES += \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/Makefile.am b/core/Makefile.am index 78ae76b0..cf8d9ff3 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -38,9 +38,6 @@ libloc_core_la_c_sources = \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 6eb99683..e12d9f32 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1694,9 +1694,7 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) // send networkinof dataitem to systemstatus observer clients SystemStatusNetworkInfo s(type, "", "", false, connected, false); - list dl(0); - dl.push_back(&s); - mSysStatusObsvr.notify(dl); + mSysStatusObsvr.notify({&s}); } return true; } diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 2fdd19f1..0f6d2289 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -32,28 +32,20 @@ #include #include #include -#include -#include -#include #include namespace loc_core { -SystemStatusOsObserver::SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask) : - mSystemStatus(systemstatus), - mAddress("SystemStatusOsObserver"), -#ifdef USE_GLIB - mBackHaulConnectReqCount(0), -#endif - mClientIndex(IndexFactory :: createClientIndex()), - mDataItemIndex(IndexFactory :: createDataItemIndex()) -{ - mContext.mMsgTask = msgTask; +template +COUT SystemStatusOsObserver::containerTransfer(CINT& inContainer) { + COUT outContainer(0); + for (auto item : inContainer) { + outContainer.insert(outContainer.begin(), item); + } + return outContainer; } -SystemStatusOsObserver::~SystemStatusOsObserver() -{ +SystemStatusOsObserver::~SystemStatusOsObserver() { // Close data-item library handle DataItemsFactoryProxy::closeDataItemLibraryHandle(); @@ -65,290 +57,238 @@ SystemStatusOsObserver::~SystemStatusOsObserver() } mDataItemCache.clear(); - delete mClientIndex; - delete mDataItemIndex; } void SystemStatusOsObserver::setSubscriptionObj(IDataItemSubscription* subscriptionObj) { - mContext.mSubscriptionObj = subscriptionObj; + struct SetSubsObj : public LocMsg { + ObserverContext& mContext; + IDataItemSubscription* mSubsObj; + inline SetSubsObj(ObserverContext& context, IDataItemSubscription* subscriptionObj) : + mContext(context), mSubsObj(subscriptionObj) {} + void proc() const { + mContext.mSubscriptionObj = mSubsObj; - LOC_LOGD("Request cache size - Subscribe:%zu RequestData:%zu", - mSubscribeReqCache.size(), mReqDataCache.size()); - - // we have received the subscription object. process cached requests - // process - subscribe request cache - for (auto each : mSubscribeReqCache) { - subscribe(each.second, each.first); - } - // process - requestData request cache - for (auto each : mReqDataCache) { - requestData(each.second, each.first); - } -} - -// Helper to cache requests subscribe and requestData till subscription obj is obtained -void SystemStatusOsObserver::cacheObserverRequest(ObserverReqCache& reqCache, - const list& l, IDataItemObserver* client) -{ - ObserverReqCache::iterator dicIter = reqCache.find(client); - if (dicIter != reqCache.end()) { - // found - list difference(0); - set_difference(l.begin(), l.end(), - dicIter->second.begin(), dicIter->second.end(), - inserter(difference, difference.begin())); - if (!difference.empty()) { - difference.sort(); - dicIter->second.merge(difference); - dicIter->second.unique(); + if (!mContext.mSSObserver->mDataItemToClients.empty()) { + list dis( + containerTransfer, list>( + mContext.mSSObserver->mDataItemToClients.getKeys())); + mContext.mSubscriptionObj->subscribe(dis, mContext.mSSObserver); + mContext.mSubscriptionObj->requestData(dis, mContext.mSSObserver); + } } - } - else { - // not found - reqCache[client] = l; + }; + + if (nullptr == subscriptionObj) { + LOC_LOGw("subscriptionObj is NULL"); + } else { + mContext.mMsgTask->sendMsg(new SetSubsObj(mContext, subscriptionObj)); } } /****************************************************************************** IDataItemSubscription Overrides ******************************************************************************/ -void SystemStatusOsObserver::subscribe( - const list& l, IDataItemObserver* client) +void SystemStatusOsObserver::subscribe(const list& l, IDataItemObserver* client, + bool toRequestData) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mSubscribeReqCache, l, client); - return; - } - struct HandleSubscribeReq : public LocMsg { - HandleSubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleSubscribeReq() {} + inline HandleSubscribeReq(SystemStatusOsObserver* parent, + list& l, IDataItemObserver* client, bool requestData) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)), + mToRequestData(requestData) {} + void proc() const { + unordered_set dataItemsToSubscribe(0); + mParent->mDataItemToClients.add(mDataItemSet, {mClient}, &dataItemsToSubscribe); + mParent->mClientToDataItems.add(mClient, mDataItemSet); - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + mParent->sendCachedDataItems(mDataItemSet, mClient); - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); - - // Do not send first response for only pendingFirstResponseList, - // instead send for all the data items (present in the cache) that - // have been subscribed for each time. - mParent->sendFirstResponse(mDataItemList, mClient); - - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add(mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe(yetToSubscribeDataItemsList, mParent); + // Send subscription set to framework + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) { LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); + mParent->logMe(dataItemsToSubscribe); + + if (mToRequestData) { + mParent->mContext.mSubscriptionObj->requestData( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } else { + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } } } - SystemStatusOsObserver* mParent; + mutable SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + const unordered_set mDataItemSet; + bool mToRequestData; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleSubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleSubscribeReq(this, (list&)l, client, toRequestData)); + } } void SystemStatusOsObserver::updateSubscription( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUpdateSubscriptionReq : public LocMsg { HandleUpdateSubscriptionReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUpdateSubscriptionReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list currentlySubscribedList(0); - mParent->mClientIndex->getSubscribedList(mClient, currentlySubscribedList); - - list removeDataItemList(0); - set_difference(currentlySubscribedList.begin(), currentlySubscribedList.end(), - mDataItemList.begin(), mDataItemList.end(), - inserter(removeDataItemList,removeDataItemList.begin())); - - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); + unordered_set dataItemsToSubscribe(0); + unordered_set dataItemsToUnsubscribe(0); + unordered_set clients({mClient}); + // below removes clients from all entries keyed with the return of the + // mClientToDataItems.update() call. If leaving an empty set of clients as the + // result, the entire entry will be removed. dataItemsToUnsubscribe will be + // populated to keep the keys of the removed entries. + mParent->mDataItemToClients.trimOrRemove( + // this call updates map; removes + // the DataItemId's that are not new to the clietn from mDataItemSet; + // and returns a set of mDataItemSet's that are no longer used by client. + // This unused set of mDataItemSet's is passed to trimOrRemove method of + // map to remove the client from the + // corresponding entries, and gets a set of the entries that are + // removed from the map as a result. + mParent->mClientToDataItems.update(mClient, + (unordered_set&)mDataItemSet), + clients, &dataItemsToUnsubscribe, nullptr); + // below adds mClient to map, and populates + // new keys added to that map, which are DataItemIds to be subscribed. + mParent->mDataItemToClients.add(mDataItemSet, clients, &dataItemsToSubscribe); // Send First Response - mParent->sendFirstResponse(pendingFirstResponseList, mClient); + mParent->sendCachedDataItems(mDataItemSet, mClient); - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); + if (nullptr != mParent->mContext.mSubscriptionObj) { + // Send subscription set to framework + if (!dataItemsToSubscribe.empty()) { + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToSubscribe); - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe( - yetToSubscribeDataItemsList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, removeDataItemList, unused); - - if (!mParent->mClientIndex->isSubscribedClient(mClient)) { - mParent->mDataItemIndex->remove( - list (1,mClient), unsubscribeList); - } - if (!unsubscribeList.empty()) { // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following"); - mParent->logMe(unsubscribeList); + if (!dataItemsToUnsubscribe.empty()) { + LOC_LOGD("Unsubscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToUnsubscribe); + + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUpdateSubscriptionReq(this, l, client)); -} -void SystemStatusOsObserver::requestData( - const list& l, IDataItemObserver* client) -{ - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mReqDataCache, l, client); - return; + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleUpdateSubscriptionReq(this, (list&)l, client)); } - - struct HandleRequestData : public LocMsg { - HandleRequestData(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleRequestData() {} - void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list yetToSubscribeDataItemsList(0); - mParent->mClientIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!mDataItemList.empty()) { - mParent->mContext.mSubscriptionObj->requestData(mDataItemList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } - } - SystemStatusOsObserver* mParent; - IDataItemObserver* mClient; - const list mDataItemList; - }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleRequestData(this, l, client)); } void SystemStatusOsObserver::unsubscribe( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } struct HandleUnsubscribeReq : public LocMsg { HandleUnsubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUnsubscribeReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + unordered_set dataItemsUnusedByClient(0); + unordered_set clientToRemove(0); + mParent->mClientToDataItems.trimOrRemove({mClient}, mDataItemSet, &clientToRemove, + &dataItemsUnusedByClient); + unordered_set dataItemsToUnsubscribe(0); + mParent->mDataItemToClients.trimOrRemove(dataItemsUnusedByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, mDataItemList, unused); - - for (auto each : mDataItemList) { - list clientListSubs(0); - list clientListOut(0); - mParent->mDataItemIndex->remove( - each, list (1,mClient), clientListOut); - // check if there are any other subscribed client for this data item id - mParent->mDataItemIndex->getListOfSubscribedClients(each, clientListSubs); - if (clientListSubs.empty()) - { - LOC_LOGD("Client list subscribed is empty for dataitem - %d", each); - unsubscribeList.push_back(each); - } - } - - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) { LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeReq(this, (list&)l, client)); + } } void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUnsubscribeAllReq : public LocMsg { HandleUnsubscribeAllReq(SystemStatusOsObserver* parent, IDataItemObserver* client) : mParent(parent), mClient(client) {} - virtual ~HandleUnsubscribeAllReq() {} - void proc() const { - list clients(1, mClient); - list unsubscribeList(0); - if(0 == mParent->mClientIndex->remove(mClient)) { - return; - } - mParent->mDataItemIndex->remove(clients, unsubscribeList); - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + void proc() const { + unordered_set diByClient = mParent->mClientToDataItems.getValSet(mClient); + if (!diByClient.empty()) { + unordered_set dataItemsToUnsubscribe; + mParent->mClientToDataItems.remove(mClient); + mParent->mDataItemToClients.trimOrRemove(diByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); + + if (!dataItemsToUnsubscribe.empty() && + nullptr != mParent->mContext.mSubscriptionObj) { + + LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeAllReq(this, client)); + + if (nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeAllReq(this, client)); + } } /****************************************************************************** @@ -356,84 +296,78 @@ void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) ******************************************************************************/ void SystemStatusOsObserver::notify(const list& dlist) { - list dataItemList(0); - - for (auto each : dlist) { - string dv; - each->stringify(dv); - LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); - - IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); - if (nullptr == di) { - LOC_LOGE("Unable to create dataitem:%d", each->getId()); - return; - } - - // Copy contents into the newly created data item - di->copy(each); - - // Request systemstatus to record this dataitem in its cache - if (mSystemStatus->eventDataItemNotify(di)) { - // add this dataitem if updated from last one - dataItemList.push_back(di); - } - } - struct HandleNotify : public LocMsg { - HandleNotify(SystemStatusOsObserver* parent, const list& l) : - mParent(parent), mDList(l) {} - virtual ~HandleNotify() { - for (auto each : mDList) { - delete each; + HandleNotify(SystemStatusOsObserver* parent, vector& v) : + mParent(parent), mDiVec(std::move(v)) {} + + inline virtual ~HandleNotify() { + for (auto item : mDiVec) { + delete item; } } + void proc() const { // Update Cache with received data items and prepare // list of data items to be sent. - list dataItemIdsToBeSent(0); - for (auto item : mDList) { - bool dataItemUpdated = false; - mParent->updateCache(item, dataItemUpdated); - if (dataItemUpdated) { - dataItemIdsToBeSent.push_back(item->getId()); + unordered_set dataItemIdsToBeSent(0); + for (auto item : mDiVec) { + if (mParent->updateCache(item)) { + dataItemIdsToBeSent.insert(item->getId()); } } // Send data item to all subscribed clients - list clientList(0); + unordered_set clientSet(0); for (auto each : dataItemIdsToBeSent) { - list clients(0); - mParent->mDataItemIndex->getListOfSubscribedClients(each, clients); - for (auto each_cient: clients) { - clientList.push_back(each_cient); + auto clients = mParent->mDataItemToClients.getValSetPtr(each); + if (nullptr != clients) { + clientSet.insert(clients->begin(), clients->end()); } } - clientList.unique(); - for (auto client : clientList) { - list dataItemIdsSubscribedByThisClient(0); - list dataItemIdsToBeSentForThisClient(0); - mParent->mClientIndex->getSubscribedList( - client, dataItemIdsSubscribedByThisClient); - dataItemIdsSubscribedByThisClient.sort(); - dataItemIdsToBeSent.sort(); + for (auto client : clientSet) { + unordered_set dataItemIdsForThisClient( + mParent->mClientToDataItems.getValSet(client)); + for (auto id : dataItemIdsForThisClient) { + if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) { + dataItemIdsForThisClient.erase(id); + } + } - set_intersection(dataItemIdsToBeSent.begin(), - dataItemIdsToBeSent.end(), - dataItemIdsSubscribedByThisClient.begin(), - dataItemIdsSubscribedByThisClient.end(), - inserter(dataItemIdsToBeSentForThisClient, - dataItemIdsToBeSentForThisClient.begin())); - - mParent->sendCachedDataItems(dataItemIdsToBeSentForThisClient, client); - dataItemIdsSubscribedByThisClient.clear(); - dataItemIdsToBeSentForThisClient.clear(); + mParent->sendCachedDataItems(dataItemIdsForThisClient, client); } } SystemStatusOsObserver* mParent; - const list mDList; + const vector mDiVec; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify(this, dataItemList)); + + if (!dlist.empty()) { + vector dataItemVec(dlist.size()); + + for (auto each : dlist) { + IF_LOC_LOGD { + string dv; + each->stringify(dv); + LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); + } + + IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); + if (nullptr == di) { + LOC_LOGw("Unable to create dataitem:%d", each->getId()); + continue; + } + + // Copy contents into the newly created data item + di->copy(each); + + // add this dataitem if updated from last one + dataItemVec.push_back(di); + } + + if (!dataItemVec.empty()) { + mContext.mMsgTask->sendMsg(new HandleNotify(this, dataItemVec)); + } + } } /****************************************************************************** @@ -447,7 +381,7 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer == mActiveRequestCount.end()) { // Data item not found in map // Add reference count as 1 and add dataitem to map @@ -485,7 +419,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer != mActiveRequestCount.end()) { // found citer->second--; @@ -573,84 +507,65 @@ bool SystemStatusOsObserver::disconnectBackhaul() /****************************************************************************** Helpers ******************************************************************************/ -void SystemStatusOsObserver::sendFirstResponse( - const list& l, IDataItemObserver* to) -{ - if (l.empty()) { - LOC_LOGV("list is empty. Nothing to do. Exiting"); - return; - } - - string clientName; - to->getName(clientName); - list dataItems(0); - - for (auto each : l) { - map::const_iterator citer = mDataItemCache.find(each); - if (citer != mDataItemCache.end()) { - string dv; - citer->second->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(citer->second); - } - } - if (dataItems.empty()) { - LOC_LOGV("No items to notify. Nothing to do. Exiting"); - return; - } - to->notify(dataItems); -} - void SystemStatusOsObserver::sendCachedDataItems( - const list& l, IDataItemObserver* to) + const unordered_set& s, IDataItemObserver* to) { - string clientName; - to->getName(clientName); - list dataItems(0); + if (nullptr == to) { + LOC_LOGv("client pointer is NULL."); + } else { + string clientName; + to->getName(clientName); + list dataItems(0); - for (auto each : l) { - string dv; - IDataItemCore* di = mDataItemCache[each]; - di->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(di); + for (auto each : s) { + auto citer = mDataItemCache.find(each); + if (citer != mDataItemCache.end()) { + string dv; + citer->second->stringify(dv); + LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_front(citer->second); + } + } + + if (dataItems.empty()) { + LOC_LOGv("No items to notify."); + } else { + to->notify(dataItems); + } } - to->notify(dataItems); } -void SystemStatusOsObserver::updateCache(IDataItemCore* d, bool& dataItemUpdated) +bool SystemStatusOsObserver::updateCache(IDataItemCore* d) { - if (nullptr == d) { - return; - } + bool dataItemUpdated = false; - // Check if data item exists in cache - map::iterator citer = - mDataItemCache.find(d->getId()); - if (citer == mDataItemCache.end()) { - // New data item; not found in cache - IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); - if (nullptr == dataitem) { - return; + // Request systemstatus to record this dataitem in its cache + // if the return is false, it means that SystemStatus is not + // handling it, so SystemStatusOsObserver also doesn't. + // So it has to be true to proceed. + if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) { + auto citer = mDataItemCache.find(d->getId()); + if (citer == mDataItemCache.end()) { + // New data item; not found in cache + IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); + if (nullptr != dataitem) { + // Copy the contents of the data item + dataitem->copy(d); + // Insert in mDataItemCache + mDataItemCache.insert(std::make_pair(d->getId(), dataitem)); + dataItemUpdated = true; + } + } else { + // Found in cache; Update cache if necessary + citer->second->copy(d, &dataItemUpdated); } - // Copy the contents of the data item - dataitem->copy(d); - pair cpair(d->getId(), dataitem); - // Insert in mDataItemCache - mDataItemCache.insert(cpair); - dataItemUpdated = true; - } - else { - // Found in cache; Update cache if necessary - if(0 == citer->second->copy(d, &dataItemUpdated)) { - return; + if (dataItemUpdated) { + LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); } } - if (dataItemUpdated) { - LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); - } + return dataItemUpdated; } } // namespace loc_core diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 930ddc12..fd606063 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -41,6 +41,7 @@ #include #include #include +#include namespace loc_core { @@ -48,39 +49,57 @@ namespace loc_core SystemStatusOsObserver ******************************************************************************/ using namespace std; +using namespace loc_util; // Forward Declarations class IDataItemCore; -template class IClientIndex; -template class IDataItemIndex; +class SystemStatus; +class SystemStatusOsObserver; +typedef map> ObserverReqCache; +typedef LocUnorderedSetMap ClientToDataItems; +typedef LocUnorderedSetMap DataItemToClients; +typedef unordered_map DataItemIdToCore; +typedef unordered_map DataItemIdToInt; -struct SystemContext { +struct ObserverContext { IDataItemSubscription* mSubscriptionObj; IFrameworkActionReq* mFrameworkActionReqObj; const MsgTask* mMsgTask; + SystemStatusOsObserver* mSSObserver; - inline SystemContext() : - mSubscriptionObj(NULL), - mFrameworkActionReqObj(NULL), - mMsgTask(NULL) {} + inline ObserverContext(const MsgTask* msgTask, SystemStatusOsObserver* observer) : + mSubscriptionObj(NULL), mFrameworkActionReqObj(NULL), + mMsgTask(msgTask), mSSObserver(observer) {} }; -typedef map> ObserverReqCache; - // Clients wanting to get data from OS/Framework would need to // subscribe with OSObserver using IDataItemSubscription interface. // Such clients would need to implement IDataItemObserver interface // to receive data when it becomes available. -class SystemStatus; class SystemStatusOsObserver : public IOsObserver { public: // ctor - SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask); + inline SystemStatusOsObserver(SystemStatus* systemstatus, const MsgTask* msgTask) : + mSystemStatus(systemstatus), mContext(msgTask, this), + mAddress("SystemStatusOsObserver"), + mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) +#ifdef USE_GLIB + , mBackHaulConnectReqCount(0) +#endif + { + } + // dtor ~SystemStatusOsObserver(); + template + static COUT containerTransfer(CINT& s); + template + inline static COUT containerTransfer(CINT&& s) { + return containerTransfer(s); + } + // To set the subscription object virtual void setSubscriptionObj(IDataItemSubscription* subscriptionObj); @@ -96,38 +115,40 @@ public: } // IDataItemSubscription Overrides - virtual void subscribe(const list& l, IDataItemObserver* client); - virtual void updateSubscription(const list& l, IDataItemObserver* client); - virtual void requestData(const list& l, IDataItemObserver* client); - virtual void unsubscribe(const list& l, IDataItemObserver* client); - virtual void unsubscribeAll(IDataItemObserver* client); + inline virtual void subscribe(const list& l, IDataItemObserver* client) override { + subscribe(l, client, false); + } + virtual void updateSubscription(const list& l, IDataItemObserver* client) override; + inline virtual void requestData(const list& l, IDataItemObserver* client) override { + subscribe(l, client, true); + } + virtual void unsubscribe(const list& l, IDataItemObserver* client) override; + virtual void unsubscribeAll(IDataItemObserver* client) override; // IDataItemObserver Overrides - virtual void notify(const list& dlist); - inline virtual void getName(string& name) { + virtual void notify(const list& dlist) override; + inline virtual void getName(string& name) override { name = mAddress; } // IFrameworkActionReq Overrides - virtual void turnOn(DataItemId dit, int timeOut = 0); - virtual void turnOff(DataItemId dit); + virtual void turnOn(DataItemId dit, int timeOut = 0) override; + virtual void turnOff(DataItemId dit) override; #ifdef USE_GLIB - virtual bool connectBackhaul(); + virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif private: SystemStatus* mSystemStatus; - SystemContext mContext; + ObserverContext mContext; const string mAddress; - IClientIndex* mClientIndex; - IDataItemIndex* mDataItemIndex; - map mDataItemCache; - map mActiveRequestCount; + ClientToDataItems mClientToDataItems; + DataItemToClients mDataItemToClients; + DataItemIdToCore mDataItemCache; + DataItemIdToInt mActiveRequestCount; // Cache the subscribe and requestData till subscription obj is obtained - ObserverReqCache mSubscribeReqCache; - ObserverReqCache mReqDataCache; void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); #ifdef USE_GLIB @@ -135,13 +156,16 @@ private: int mBackHaulConnectReqCount; #endif + void subscribe(const list& l, IDataItemObserver* client, bool toRequestData); + // Helpers - void sendFirstResponse(const list& l, IDataItemObserver* to); - void sendCachedDataItems(const list& l, IDataItemObserver* to); - void updateCache(IDataItemCore* d, bool& dataItemUpdated); - inline void logMe(const list& l) { - for (auto id : l) { - LOC_LOGD("DataItem %d", id); + void sendCachedDataItems(const unordered_set& s, IDataItemObserver* to); + bool updateCache(IDataItemCore* d); + inline void logMe(const unordered_set& l) { + IF_LOC_LOGD { + for (auto id : l) { + LOC_LOGD("DataItem %d", id); + } } } }; diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp deleted file mode 100644 index d4bd11e5..00000000 --- a/core/data-items/common/ClientIndex.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline ClientIndex :: ClientIndex () {} - -template -inline ClientIndex :: ~ClientIndex () {} - -template -bool ClientIndex :: isSubscribedClient (CT client) { - bool result = false; - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - result = true; - } - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: getSubscribedList (CT client, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - out = it->second; - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -int ClientIndex :: remove (CT client) { - int result = 0; - ENTRY_LOG (); - mDataItemsPerClientMap.erase (client); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.begin (); - while (dicIter != mDataItemsPerClientMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find (dicIter->second.begin (), dicIter->second.end (), *it); - if (iter != dicIter->second.end ()) { - dicIter->second.erase (iter); - } - } - if (dicIter->second.empty ()) { - out.push_back (dicIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mDataItemsPerClientMap.erase (dicIter++); - } else { - ++dicIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: remove -( - CT client, - const list & r, - list & out -) -{ - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_intersection (dicIter->second.begin (), dicIter->second.end (), - r.begin (), r.end (), - inserter (out,out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - dicIter->second.erase (find (dicIter->second.begin (), - dicIter->second.end (), - *it)); - } - } - if (dicIter->second.empty ()) { - mDataItemsPerClientMap.erase (dicIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_difference (l.begin (), l.end (), - dicIter->second.begin (), dicIter->second.end (), - inserter (difference,difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - dicIter->second.merge (difference); - dicIter->second.unique (); - } - } else { - out = l; - pair < CT, list > dicnpair (client, out); - mDataItemsPerClientMap.insert (dicnpair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class ClientIndex ; - template class ClientIndex ; -} diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp deleted file mode 100644 index 462bf748..00000000 --- a/core/data-items/common/DataItemIndex.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline DataItemIndex :: DataItemIndex () {} - -template -inline DataItemIndex :: ~DataItemIndex () {} - -template -void DataItemIndex :: getListOfSubscribedClients - ( - DIT id, - list & out -) -{ - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - out = cdiIter->second; - } -} - - -template -int DataItemIndex :: remove (DIT id) { - int result = 0; - ENTRY_LOG (); - mClientsPerDataItemMap.erase (id); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void DataItemIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.begin (); - while (cdiIter != mClientsPerDataItemMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - *it - ); - if (iter != cdiIter->second.end ()) { - cdiIter->second.erase (iter); - } - } - - if (cdiIter->second.empty ()) { - out.push_back (cdiIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mClientsPerDataItemMap.erase (cdiIter++); - } else { - ++cdiIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: remove -( - DIT id, - const list & r, - list & out -) -{ - ENTRY_LOG (); - - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_intersection (cdiIter->second.begin (), cdiIter->second.end (), - r.begin (), r.end (), - inserter (out, out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - cdiIter->second.erase (find (cdiIter->second.begin (), - cdiIter->second.end (), - *it)); - } - } - if (cdiIter->second.empty ()) { - mClientsPerDataItemMap.erase (cdiIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - DIT id, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_difference (l.begin (), l.end (), - cdiIter->second.begin (), cdiIter->second.end (), - inserter (difference, difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - cdiIter->second.merge (difference); - } - } else { - out = l; - pair < DIT, list > cndipair (id, out); - mClientsPerDataItemMap.insert (cndipair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter; - typename list :: const_iterator it = l.begin (); - for (; it != l.end (); ++it) { - cdiIter = mClientsPerDataItemMap.find (*it); - if (cdiIter == mClientsPerDataItemMap.end ()) { - out.push_back (*it); - pair < DIT, list > cndiPair (*it, list (1, client)); - mClientsPerDataItemMap.insert (cndiPair); - } else { - typename list :: iterator clientIter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - client - ); - if (clientIter == cdiIter->second.end()) { - cdiIter->second.push_back (client); - } - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class DataItemIndex ; - template class DataItemIndex ; -} diff --git a/core/data-items/common/IClientIndex.h b/core/data-items/common/IClientIndex.h deleted file mode 100644 index 0272e7b9..00000000 --- a/core/data-items/common/IClientIndex.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __ICLIENTINDEX_H__ -#define __ICLIENTINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IClientIndex { -public: - - // Checks if client is subscribed - virtual bool isSubscribedClient (CT client) = 0; - - // gets subscription list - virtual void getSubscribedList (CT client, std :: list & out) = 0; - - // removes an entry - virtual int remove (CT client) = 0; - - // removes std :: list of data items and returns a list of clients - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of data items indexed by client and returns list - // of data items removed if any. - virtual void remove - ( - CT client, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry in map and returns new data items added. - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IClientIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __ICLIENTINDEX_H__ diff --git a/core/data-items/common/IDataItemIndex.h b/core/data-items/common/IDataItemIndex.h deleted file mode 100644 index 91855826..00000000 --- a/core/data-items/common/IDataItemIndex.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __IDATAITEMINDEX_H__ -#define __IDATAITEMINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IDataItemIndex { - -public: - - // gets std :: list of subscribed clients - virtual void getListOfSubscribedClients - ( - DIT id, - std :: list & out - ) = 0; - - // removes an entry from - virtual int remove (DIT id) = 0; - - // removes list of clients and returns a list of data items - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of clients indexed by data item and returns list of - // clients removed if any. - virtual void remove - ( - DIT id, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry and returns new clients added - virtual void add - ( - DIT id, - const std :: list & l, - std :: list & out - ) = 0; - - // adds/modifies entry and returns yet to subscribe list of data items - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IDataItemIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __IDATAITEMINDEX_H__ - diff --git a/core/data-items/common/IndexFactory.cpp b/core/data-items/common/IndexFactory.cpp deleted file mode 100644 index cf494752..00000000 --- a/core/data-items/common/IndexFactory.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using loc_core::IClientIndex; -using loc_core::IDataItemIndex; -using loc_core::IDataItemObserver; -using namespace loc_core; - -template -inline IClientIndex * IndexFactory :: createClientIndex -() -{ - return new (nothrow) ClientIndex (); -} - -template -inline IDataItemIndex * IndexFactory :: createDataItemIndex -() -{ - return new (nothrow) DataItemIndex (); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class IndexFactory ; - template class IndexFactory ; -} diff --git a/core/data-items/common/IndexFactory.h b/core/data-items/common/IndexFactory.h deleted file mode 100644 index 9a2070e9..00000000 --- a/core/data-items/common/IndexFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __INDEXFACTORY_H__ -#define __INDEXFACTORY_H__ - -#include -#include - -namespace loc_core -{ -template -class IndexFactory { - -public: - static IClientIndex * createClientIndex (); - static IDataItemIndex * createDataItemIndex (); -}; - -} // namespace loc_core - -#endif // #ifndef __INDEXFACTORY_H__ diff --git a/utils/LocListMap.h b/utils/LocListMap.h deleted file mode 100644 index feccb059..00000000 --- a/utils/LocListMap.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __CLIENTINDEX_H__ -#define __CLIENTINDEX_H__ - -#include -#include -#include - -using loc_core::IClientIndex; - -namespace loc_core -{ - -template - -class ClientIndex : public IClientIndex { - -public: - - ClientIndex (); - - ~ClientIndex (); - - bool isSubscribedClient (CT client); - - void getSubscribedList (CT client, std :: list & out); - - int remove (CT client); - - void remove (const std :: list & r, std :: list & out); - - void remove (CT client, const std :: list & r, std :: list & out); - - void add (CT client, const std :: list & l, std :: list & out); - -private: - //Data members - std :: map < CT , std :: list > mDataItemsPerClientMap; -}; - -} // namespace loc_core - -#endif // #ifndef __CLIENTINDEX_H__ diff --git a/utils/LocUnorderedSetMap.h b/utils/LocUnorderedSetMap.h index d72e89eb..87481348 100644 --- a/utils/LocUnorderedSetMap.h +++ b/utils/LocUnorderedSetMap.h @@ -26,45 +26,167 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#ifndef __LOC_UNORDERDED_SETMAP_H__ +#define __LOC_UNORDERDED_SETMAP_H__ -#ifndef __DATAITEMINDEX_H__ -#define __DATAITEMINDEX_H__ +#include +#include +#include -#include -#include -#include +using std::unordered_set; +using std::unordered_map; -using loc_core::IDataItemIndex; +namespace loc_util { -namespace loc_core -{ +// Trim from *fromSet* any elements that also exist in *rVals*. +// The optional *goneVals*, if not null, will be populated with removed elements. +template +inline static void trimSet(unordered_set& fromSet, const unordered_set& rVals, + unordered_set* goneVals) { + for (auto val : rVals) { + if (fromSet.erase(val) > 0 && nullptr != goneVals) { + goneVals->insert(val); + } + } +} -template +// this method is destructive to the input unordered_sets. +// the return set is the interset extracted out from the two input sets, *s1* and *s2*. +// *s1* and *s2* will be left with the intersect removed from them. +template +static unordered_set removeAndReturnInterset(unordered_set& s1, unordered_set& s2) { + unordered_set common(0); + for (auto b = s2.begin(); b != s2.end(); b++) { + auto a = find(s1.begin(), s1.end(), *b); + if (a != s1.end()) { + // this is a common item of both l1 and l2, remove from both + // but after we add to common + common.insert(*a); + s1.erase(a); + s2.erase(b); + } + } + return common; +} -class DataItemIndex : public IDataItemIndex { +template +class LocUnorderedSetMap { + unordered_map> mMap; + + + // Trim the VALs pointed to by *iter*, with everything that also exist in *rVals*. + // If the set becomes empty, remove the map entry. *goneVals*, if not null, records + // the trimmed VALs. + bool trimOrRemove(typename unordered_map>::iterator iter, + const unordered_set& rVals, unordered_set* goneVals) { + trimSet(iter->second, rVals, goneVals); + bool removeEntry = (iter->second.empty()); + if (removeEntry) { + mMap.erase(iter); + } + return removeEntry; + } public: + inline LocUnorderedSetMap() {} + inline LocUnorderedSetMap(size_t size) : mMap(size) {} - DataItemIndex (); + inline bool empty() { return mMap.empty(); } - ~DataItemIndex (); + // This gets the raw pointer to the VALs pointed to by *key* + // If the entry is not in the map, nullptr will be returned. + inline unordered_set* getValSetPtr(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? &(entry->second) : nullptr; + } - void getListOfSubscribedClients (DIT id, std :: list & out); + // This gets a copy of VALs pointed to by *key* + // If the entry is not in the map, an empty set will be returned. + inline unordered_set getValSet(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? entry->second : unordered_set(0); + } - int remove (DIT id); + // This gets all the KEYs from the map + inline unordered_set getKeys() { + unordered_set keys(0); + for (auto entry : mMap) { + keys.insert(entry.first); + } + return keys; + } - void remove (const std :: list & r, std :: list & out); + inline bool remove(const KEY& key) { + return mMap.erase(key) > 0; + } - void remove (DIT id, const std :: list & r, std :: list & out); + // This looks into all the entries keyed by *keys*. Remove any VALs from the entries + // that also exist in *rVals*. If the entry is left with an empty set, the entry will + // be removed. The optional parameters *goneKeys* and *goneVals* will record the KEYs + // (or entries) and the collapsed VALs removed from the map, respectively. + inline void trimOrRemove(unordered_set&& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + trimOrRemove(keys, rVals, goneKeys, goneVals); + } + inline void trimOrRemove(unordered_set& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + for (auto key : keys) { + auto iter = mMap.find(key); + if (iter != mMap.end() && trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) { + goneKeys->insert(iter->first); + } + } + } - void add (DIT id, const std :: list & l, std :: list & out); + // This adds all VALs from *newVals* to the map entry keyed by *key*. Or if it + // doesn't exist yet, add the set to the map. + bool add(const KEY& key, const unordered_set& newVals) { + bool newEntryAdded = false; + if (!newVals.empty()) { + auto iter = mMap.find(key); + if (iter != mMap.end()) { + iter->second.insert(newVals.begin(), newVals.end()); + } else { + mMap[key] = newVals; + newEntryAdded = true; + } + } + return newEntryAdded; + } - void add (CT client, const std :: list & l, std :: list & out); + // This adds to each of entries in the map keyed by *keys* with the VALs in the + // *enwVals*. If there new entries added (new key in *keys*), *newKeys*, if not + // null, would be populated with those keys. + inline void add(const unordered_set& keys, const unordered_set&& newVals, + unordered_set* newKeys) { + add(keys, newVals, newKeys); + } + inline void add(const unordered_set& keys, const unordered_set& newVals, + unordered_set* newKeys) { + for (auto key : keys) { + if (add(key, newVals) && nullptr != newKeys) { + newKeys->insert(key); + } + } + } -private: - std :: map < DIT, std :: list > mClientsPerDataItemMap; + // This puts *newVals* into the map keyed by *key*, and returns the VALs that are + // in effect removed from the keyed VAL set in the map entry. + // This call would also remove those same VALs from *newVals*. + inline unordered_set update(const KEY& key, unordered_set& newVals) { + unordered_set goneVals(0); + + if (newVals.empty()) { + mMap.erase(key); + } else { + auto curVals = mMap[key]; + mMap[key] = newVals; + goneVals = removeAndReturnInterset(curVals, newVals); + } + return goneVals; + } }; -} // namespace loc_core +} // namespace loc_util -#endif // #ifndef __DATAITEMINDEX_H__ +#endif // #ifndef __LOC_UNORDERDED_SETMAP_H__ From 7bbc063ad215234850406216d4fb3632aeb404e6 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 9 Apr 2018 14:32:28 -0700 Subject: [PATCH 655/945] Fixed a number of issues with NetworkInfoDataItemBase There are a couple of issues. NetworkInfoDataItemBase objects might be from OsAgent or GnssLocationProvider. The two sources actually have mTypes defined differently. In addtion, when there are different types of connections such as wifi / mobile, getting connected / disconnected independently, clients need to be all notified correctly. Right now, if mConnected hasn't changed, no updates are send. For exmple, if mobile is connected, later wifi gets connected too, clients won't know. SystemStatus is also updated to get updated / colated informtion. In the above example, SystemStatus's top record would record as both mobile and wifi are connected. Change-Id: I1825902247fe1d4e6363f5e24a75be7e984d0dc4 CRs-Fixed: 2221114 --- core/SystemStatus.cpp | 113 +++++++++----------- core/SystemStatus.h | 43 +++++--- core/data-items/DataItemConcreteTypesBase.h | 32 +++--- gnss/XtraSystemStatusObserver.cpp | 26 +---- gnss/XtraSystemStatusObserver.h | 10 +- 5 files changed, 107 insertions(+), 117 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index e12d9f32..5d5c4b08 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1250,8 +1250,7 @@ IOsObserver* SystemStatus::getOsObserver() } SystemStatus::SystemStatus(const MsgTask* msgTask) : - mSysStatusObsvr(this, msgTask), - mConnected(false) + mSysStatusObsvr(this, msgTask) { int result = 0; ENTRY_LOG (); @@ -1301,17 +1300,10 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) : /****************************************************************************** SystemStatus - storing dataitems ******************************************************************************/ -template -bool SystemStatus::setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s) -{ - TYPE_SYSTEMSTATUS_ITEM sout(s); - return setIteminReport(report, sout); -} - template -bool SystemStatus::setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s) +bool SystemStatus::setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s) { - if (!report.empty() && report.back().equals(s)) { + if (!report.empty() && report.back().equals(static_cast(s.collate(report.back())))) { // there is no change - just update reported timestamp report.back().mUtcReported = s.mUtcReported; return false; @@ -1449,94 +1441,92 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) switch(dataitem->getId()) { case AIRPLANEMODE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAirplaneMode, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAirplaneMode, + SystemStatusAirplaneMode(*(static_cast(dataitem)))); break; case ENH_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mENH, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mENH, + SystemStatusENH(*(static_cast(dataitem)))); break; case GPSSTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mGPSState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mGPSState, + SystemStatusGpsState(*(static_cast(dataitem)))); break; case NLPSTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNLPStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNLPStatus, + SystemStatusNLPStatus(*(static_cast(dataitem)))); break; case WIFIHARDWARESTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mWifiHardwareState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiHardwareState, + SystemStatusWifiHardwareState(*(static_cast(dataitem)))); break; case NETWORKINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNetworkInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNetworkInfo, + SystemStatusNetworkInfo(*(static_cast(dataitem)))); break; case RILSERVICEINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilServiceInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilServiceInfo, + SystemStatusServiceInfo(*(static_cast(dataitem)))); break; case RILCELLINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilCellInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilCellInfo, + SystemStatusRilCellInfo(*(static_cast(dataitem)))); break; case SERVICESTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mServiceStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mServiceStatus, + SystemStatusServiceStatus(*(static_cast(dataitem)))); break; case MODEL_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mModel, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mModel, + SystemStatusModel(*(static_cast(dataitem)))); break; case MANUFACTURER_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mManufacturer, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mManufacturer, + SystemStatusManufacturer(*(static_cast(dataitem)))); break; case ASSISTED_GPS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAssistedGps, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAssistedGps, + SystemStatusAssistedGps(*(static_cast(dataitem)))); break; case SCREEN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mScreenState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mScreenState, + SystemStatusScreenState(*(static_cast(dataitem)))); break; case POWER_CONNECTED_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mPowerConnectState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mPowerConnectState, + SystemStatusPowerConnectState(*(static_cast(dataitem)))); break; case TIMEZONE_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeZoneChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeZoneChange, + SystemStatusTimeZoneChange(*(static_cast(dataitem)))); break; case TIME_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeChange, + SystemStatusTimeChange(*(static_cast(dataitem)))); break; case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mWifiSupplicantStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiSupplicantStatus, + SystemStatusWifiSupplicantStatus(*(static_cast(dataitem)))); break; case SHUTDOWN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mShutdownState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mShutdownState, + SystemStatusShutdownState(*(static_cast(dataitem)))); break; case TAC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTac, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTac, + SystemStatusTac(*(static_cast(dataitem)))); break; case MCCMNC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mMccMnc, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mMccMnc, + SystemStatusMccMnc(*(static_cast(dataitem)))); break; case BTLE_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mBtDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtDeviceScanDetail, + SystemStatusBtDeviceScanDetail(*(static_cast(dataitem)))); break; case BT_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mBtLeDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtLeDeviceScanDetail, + SystemStatusBtleDeviceScanDetail(*(static_cast(dataitem)))); break; default: break; @@ -1689,13 +1679,10 @@ bool SystemStatus::setDefaultGnssEngineStates(void) ******************************************************************************/ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { - if (connected != mConnected) { - mConnected = connected; + // send networkinof dataitem to systemstatus observer clients + SystemStatusNetworkInfo s(type, "", "", false, connected, false); + mSysStatusObsvr.notify({&s}); - // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", false, connected, false); - mSysStatusObsvr.notify({&s}); - } return true; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 9500264d..1c3adc84 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -77,8 +77,11 @@ public: mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; - virtual ~SystemStatusItemBase() { }; - virtual void dump(void) { }; + virtual ~SystemStatusItemBase() {}; + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase&) { + return *this; + } + virtual void dump(void) {}; }; class SystemStatusLocation : public SystemStatusItemBase @@ -93,7 +96,7 @@ public: const GpsLocationExtended& locationEx) : mValid(true), mLocation(location), - mLocationEx(locationEx) { } + mLocationEx(locationEx) {} bool equals(const SystemStatusLocation& peer); void dump(void); }; @@ -457,6 +460,7 @@ public: class SystemStatusNetworkInfo : public SystemStatusItemBase, public NetworkInfoDataItemBase { + NetworkInfoDataItemBase* mSrcObjPtr; public: inline SystemStatusNetworkInfo( int32_t type=0, @@ -466,18 +470,21 @@ public: bool connected=false, bool roaming=false) : NetworkInfoDataItemBase( + (NetworkType)type, type, typeName, subTypeName, available, connected, - roaming) {} + roaming), + mSrcObjPtr(nullptr) {} inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) : - NetworkInfoDataItemBase(itemBase) { + NetworkInfoDataItemBase(itemBase), + mSrcObjPtr((NetworkInfoDataItemBase*)&itemBase) { mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - if ((mType == peer.mType) && + if ((mAllTypes == peer.mAllTypes) && (mTypeName == peer.mTypeName) && (mSubTypeName == peer.mSubTypeName) && (mAvailable == peer.mAvailable) && @@ -487,8 +494,24 @@ public: } return false; } + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { + uint64_t allTypes = (static_cast(curInfo)).mAllTypes; + if (mConnected) { + mAllTypes |= allTypes; + } else if (0 != mAllTypes) { + mAllTypes = (allTypes & (~mAllTypes)); + } // else (mConnected == false && mAllTypes == 0) + // we keep mAllTypes as 0, which means no more connections. + + if (nullptr != mSrcObjPtr) { + // this is critical, changing mAllTypes of the original obj + mSrcObjPtr->mAllTypes = mAllTypes; + } + return *this; + } inline void dump(void) override { - LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); + LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x", + mAllTypes, mConnected, mType); } }; @@ -783,13 +806,9 @@ private: // Data members static pthread_mutex_t mMutexSystemStatus; SystemStatusReports mCache; - bool mConnected; - - template - bool setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s); template - bool setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); + bool setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s); // set default dataitem derived item in report cache template diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index fd744088..065366d3 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -221,9 +221,23 @@ protected: class NetworkInfoDataItemBase : public IDataItemCore { public: + enum NetworkType { + TYPE_MOBILE, + TYPE_WIFI, + TYPE_ETHERNET, + TYPE_BLUETOOTH, + TYPE_MMS, + TYPE_SUPL, + TYPE_DUN, + TYPE_HIPRI, + TYPE_WIMAX, + TYPE_UNKNOWN, + }; NetworkInfoDataItemBase( - int32_t type, string typeName, string subTypeName, + NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming ): + mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? + 0 : (1<& dlist) { NetworkInfoDataItemBase* networkInfo = static_cast(each); - mXtraSysStatObj->updateConnectionStatus(networkInfo->mConnected, - networkInfo->mType); + mXtraSysStatObj->updateConnections(networkInfo->getAllTypes()); } break; diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 6bf3f58e..af0789b6 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -33,22 +33,20 @@ #include #include #include -#include using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; using loc_util::LocIpc; -using CONNECTIONS = set; class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this), - mIsConnectivityStatusKnown (false) { + mGpsLock(-1), mConnections(0), mXtraThrottle(true), mReqStatusReceived(false), + mDelayLocTimer(*this), mIsConnectivityStatusKnown (false) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); @@ -63,7 +61,7 @@ public : virtual void notify(const list& dlist); bool updateLockStatus(uint32_t lock); - bool updateConnectionStatus(bool connected, int32_t type); + bool updateConnections(uint64_t allConnections); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); bool updateXtraThrottle(const bool enabled); @@ -77,7 +75,7 @@ private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; int32_t mGpsLock; - CONNECTIONS mConnections; + uint64_t mConnections; string mTac; string mMccmnc; bool mXtraThrottle; From 664e6431705d425d208ad65f21bb66501ff2c6bf Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Mon, 7 May 2018 09:45:20 -0700 Subject: [PATCH 656/945] fix: Incorrect time estimate in debug report GNSS Time estimate shown in Gnss debug report is incorrect. It always shows default value instead of value delivered by PQWM1 message. Change-Id: Iff471613ac6fa25d213c14b543871b6c3ae7af0a CRs-Fixed: 2235219 --- android/GnssDebug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 33d7aa52..e80eee6b 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -120,8 +120,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) reports.mTime.frequencyUncertaintyNsPerSec; } - if (data.time.timeEstimate <= 0 || - data.time.timeEstimate > GNSS_DEBUG_UNKNOWN_UTC_TIME) { + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } if (data.time.timeUncertaintyNs <= 0 || From f708597ed37fc1d77398c5f1de4678fbab66080c Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Mon, 7 May 2018 09:45:20 -0700 Subject: [PATCH 657/945] fix: Incorrect time estimate in debug report GNSS Time estimate shown in Gnss debug report is incorrect. It always shows default value instead of value delivered by PQWM1 message. Change-Id: Iff471613ac6fa25d213c14b543871b6c3ae7af0a CRs-Fixed: 2235219 --- android/GnssDebug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 823c9b17..94238abc 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -139,8 +139,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) reports.mTime.frequencyUncertaintyNsPerSec; } - if (data.time.timeEstimate <= 0 || - data.time.timeEstimate > GNSS_DEBUG_UNKNOWN_UTC_TIME) { + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } if (data.time.timeUncertaintyNs <= 0 || From 43699ba79c512ec8cebd54a5e804ea24bc6962eb Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Mon, 7 May 2018 09:45:20 -0700 Subject: [PATCH 658/945] fix: Incorrect time estimate in debug report GNSS Time estimate shown in Gnss debug report is incorrect. It always shows default value instead of value delivered by PQWM1 message. Change-Id: Iff471613ac6fa25d213c14b543871b6c3ae7af0a CRs-Fixed: 2235219 --- android/GnssDebug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/GnssDebug.cpp b/android/GnssDebug.cpp index 45cde6be..ce394767 100644 --- a/android/GnssDebug.cpp +++ b/android/GnssDebug.cpp @@ -122,8 +122,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) reports.mTime.frequencyUncertaintyNsPerSec; } - if (data.time.timeEstimate <= 0 || - data.time.timeEstimate > GNSS_DEBUG_UNKNOWN_UTC_TIME) { + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } if (data.time.timeUncertaintyNs <= 0 || From fdab877f359f323d322f2c109cc98b443e4a9b98 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 21 Feb 2018 16:04:28 +0530 Subject: [PATCH 659/945] KW Warning Fix Check file pointer before closing. Change-Id: Id9526f6eacf57e282dc0af35d72f571f950b0b0e CRs-Fixed: 2193268 --- utils/loc_cfg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index aa8d0e82..200293fc 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -1129,7 +1129,9 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } err: - fclose(conf_fp); + if (conf_fp) { + fclose(conf_fp); + } if (ret != 0) { LOC_LOGE("%s:%d]: ret: %d", __func__, __LINE__, ret); if (child_proc) { From f906756e7b491951b8c7bf230272051e41d1dced Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 9 Apr 2018 17:56:08 +0530 Subject: [PATCH 660/945] Adding Location Service Modem Emulator Adding Modem Emulator to test features not yet supported in Modem build. Change-Id: I86f4eeaa7577d83c5ef9605c78672068721c020e CRs-Fixed: 2193247 --- utils/loc_cfg.cpp | 17 +++++++++++++++-- utils/loc_cfg.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 6b53188a..78d40106 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -57,12 +57,14 @@ /* Parameter data */ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; +static uint32_t LOC_MODEM_EMULATOR = 0; /* Parameter spec table */ static const loc_param_s_type loc_param_table[] = { - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"LOC_MODEM_EMULATOR", &LOC_MODEM_EMULATOR, NULL, 'n'}, }; static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); @@ -85,6 +87,17 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; +/*=========================================================================== +FUNCTION loc_modem_emulator_enabled + +DESCRIPTION + Provides access to Modem Emulator config item. +===========================================================================*/ +uint32_t loc_modem_emulator_enabled() +{ + return LOC_MODEM_EMULATOR; +} + /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index c89d3038..652d86eb 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -133,6 +133,8 @@ extern const char LOC_PATH_QUIPC_CONF[]; int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, loc_process_info_s_type** process_info_table_ptr); +uint32_t loc_modem_emulator_enabled(); + #ifdef __cplusplus } #endif From 2ade2811c606908d4e10e7e2aaaf4773755c27d7 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 23 Mar 2018 10:32:51 -0700 Subject: [PATCH 661/945] fix: LocIpc client app unable to exit LocIpc client apps such as garden app is unable to delete LocIpc object since its socket listening thread cannot be closed while it is waiting for data and cannot be closed. Fixed to close it by sending an abort message. CRs-Fixed: 2213212 Change-Id: I95f26862e9faf7bd75a2f447421ba4ab7220576e --- utils/LocIpc.cpp | 38 ++++++++++++++++++++++++-------------- utils/LocIpc.h | 3 +-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 26a20765..59b659e4 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -28,19 +28,8 @@ */ #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include "gps_extended_c.h" #include "LocIpc.h" namespace loc_util { @@ -52,8 +41,10 @@ namespace loc_util { #define LOC_MSG_BUF_LEN 8192 #define LOC_MSG_HEAD "$MSGLEN$" +#define LOC_MSG_ABORT "LocIpcMsg::ABORT" class LocIpcRunnable : public LocRunnable { +friend LocIpc; public: LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) : mLocIpc(locIpc), mIpcName(ipcName) {} @@ -70,10 +61,10 @@ private: }; bool LocIpc::startListeningNonBlocking(const std::string& name) { - mRunnable.reset(new LocIpcRunnable(*this, name)); + mRunnable = new LocIpcRunnable(*this, name); std::string threadName("LocIpc-"); threadName.append(name); - return mThread.start(threadName.c_str(), mRunnable.get()); + return mThread.start(threadName.c_str(), mRunnable); } bool LocIpc::startListeningBlocking(const std::string& name) { @@ -107,6 +98,7 @@ bool LocIpc::startListeningBlocking(const std::string& name) { ssize_t nBytes = 0; std::string msg = ""; + std::string abort = LOC_MSG_ABORT; while (1) { msg.resize(LOC_MSG_BUF_LEN); nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); @@ -116,6 +108,11 @@ bool LocIpc::startListeningBlocking(const std::string& name) { continue; } + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + break; + } + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { // short message msg.resize(nBytes); @@ -142,7 +139,6 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (mStopRequested) { mStopRequested = false; return true; - } else { LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); (void)::close(mIpcFd); @@ -152,14 +148,28 @@ bool LocIpc::startListeningBlocking(const std::string& name) { } void LocIpc::stopListening() { + + const char *socketName = nullptr; mStopRequested = true; + if (mRunnable) { + std::string abort = LOC_MSG_ABORT; + socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); + send(socketName, abort); + mRunnable = nullptr; + } + if (mIpcFd >= 0) { if (::close(mIpcFd)) { LOC_LOGe("cannot close socket:%s", strerror(errno)); } mIpcFd = -1; } + + //delete from the file system at the end + if (socketName) { + unlink(socketName); + } } bool LocIpc::send(const char name[], const std::string& data) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 0c37a7ad..a1a994d1 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -96,7 +95,7 @@ private: int mIpcFd; bool mStopRequested; LocThread mThread; - std::unique_ptr mRunnable; + LocRunnable *mRunnable; }; class LocIpcSender { From 4005daa98993fe4325ecef5335ec86a09cd49665 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 23 Mar 2018 10:32:51 -0700 Subject: [PATCH 662/945] fix: LocIpc client app unable to exit LocIpc client apps such as garden app is unable to delete LocIpc object since its socket listening thread cannot be closed while it is waiting for data and cannot be closed. Fixed to close it by sending an abort message. CRs-Fixed: 2213212 Change-Id: I95f26862e9faf7bd75a2f447421ba4ab7220576e --- utils/LocIpc.cpp | 38 ++++++++++++++++++++++++-------------- utils/LocIpc.h | 3 +-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 26a20765..59b659e4 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -28,19 +28,8 @@ */ #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include "gps_extended_c.h" #include "LocIpc.h" namespace loc_util { @@ -52,8 +41,10 @@ namespace loc_util { #define LOC_MSG_BUF_LEN 8192 #define LOC_MSG_HEAD "$MSGLEN$" +#define LOC_MSG_ABORT "LocIpcMsg::ABORT" class LocIpcRunnable : public LocRunnable { +friend LocIpc; public: LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) : mLocIpc(locIpc), mIpcName(ipcName) {} @@ -70,10 +61,10 @@ private: }; bool LocIpc::startListeningNonBlocking(const std::string& name) { - mRunnable.reset(new LocIpcRunnable(*this, name)); + mRunnable = new LocIpcRunnable(*this, name); std::string threadName("LocIpc-"); threadName.append(name); - return mThread.start(threadName.c_str(), mRunnable.get()); + return mThread.start(threadName.c_str(), mRunnable); } bool LocIpc::startListeningBlocking(const std::string& name) { @@ -107,6 +98,7 @@ bool LocIpc::startListeningBlocking(const std::string& name) { ssize_t nBytes = 0; std::string msg = ""; + std::string abort = LOC_MSG_ABORT; while (1) { msg.resize(LOC_MSG_BUF_LEN); nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); @@ -116,6 +108,11 @@ bool LocIpc::startListeningBlocking(const std::string& name) { continue; } + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + break; + } + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { // short message msg.resize(nBytes); @@ -142,7 +139,6 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (mStopRequested) { mStopRequested = false; return true; - } else { LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); (void)::close(mIpcFd); @@ -152,14 +148,28 @@ bool LocIpc::startListeningBlocking(const std::string& name) { } void LocIpc::stopListening() { + + const char *socketName = nullptr; mStopRequested = true; + if (mRunnable) { + std::string abort = LOC_MSG_ABORT; + socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); + send(socketName, abort); + mRunnable = nullptr; + } + if (mIpcFd >= 0) { if (::close(mIpcFd)) { LOC_LOGe("cannot close socket:%s", strerror(errno)); } mIpcFd = -1; } + + //delete from the file system at the end + if (socketName) { + unlink(socketName); + } } bool LocIpc::send(const char name[], const std::string& data) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 0c37a7ad..a1a994d1 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -96,7 +95,7 @@ private: int mIpcFd; bool mStopRequested; LocThread mThread; - std::unique_ptr mRunnable; + LocRunnable *mRunnable; }; class LocIpcSender { From c0243c4ef526a178bde0e22c4b4ed9bd521881a5 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 14 May 2018 12:11:10 +0530 Subject: [PATCH 663/945] Fix KW issues in IOsObserver Fix KW issue in IOsObserver of non-void function not returning value. Change-Id: I8c4bc8939fe1518f28ff66029e6e000a3e9fef75 CRs-Fixed: 2239733 --- core/observer/IOsObserver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/observer/IOsObserver.h b/core/observer/IOsObserver.h index 40d76717..f6618281 100644 --- a/core/observer/IOsObserver.h +++ b/core/observer/IOsObserver.h @@ -91,8 +91,8 @@ public: inline virtual void turnOn (DataItemId /*dit*/, int /*timeOut*/){} inline virtual void turnOff (DataItemId /*dit*/) {} #ifdef USE_GLIB - inline virtual bool connectBackhaul() {} - inline virtual bool disconnectBackhaul() {} + inline virtual bool connectBackhaul() { return false; } + inline virtual bool disconnectBackhaul() { return false; } #endif /** From 86e1b52c812f5d9680ec1ad755d80644d0736a07 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 23:00:16 -0700 Subject: [PATCH 664/945] renamed DataItemIndex and ClientIndex files and moved them into utils. Change-Id: I138471168bf58d2cf09c6a435088edea29a567d0 CRs-Fixed: 2218519 --- core/data-items/common/ClientIndex.h => utils/LocListMap.h | 0 .../common/DataItemIndex.h => utils/LocUnorderedSetMap.h | 0 utils/Makefile.am | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) rename core/data-items/common/ClientIndex.h => utils/LocListMap.h (100%) rename core/data-items/common/DataItemIndex.h => utils/LocUnorderedSetMap.h (100%) diff --git a/core/data-items/common/ClientIndex.h b/utils/LocListMap.h similarity index 100% rename from core/data-items/common/ClientIndex.h rename to utils/LocListMap.h diff --git a/core/data-items/common/DataItemIndex.h b/utils/LocUnorderedSetMap.h similarity index 100% rename from core/data-items/common/DataItemIndex.h rename to utils/LocUnorderedSetMap.h diff --git a/utils/Makefile.am b/utils/Makefile.am index 3801fdd4..33afc1be 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -28,7 +28,8 @@ libgps_utils_la_h_sources = \ gps_extended_c.h \ gps_extended.h \ loc_gps.h \ - log_util.h + log_util.h \ + LocUnorderedSetMap.h libgps_utils_la_c_sources = \ linked_list.c \ From 36da980fea8cd9e95b26a113e7d2634bf25b3522 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 23 Mar 2018 22:57:51 -0700 Subject: [PATCH 665/945] changed SystemStatusOsObserver to allow clients to subscribe before subscription obj arrives, and also simplified ClientIndex and DataItemIndex implementation significantly. Change-Id: I092f344e688fa698aa98795b8a8f0c1ba8fcd9e4 CRs-Fixed: 2218519 --- core/Android.mk | 3 - core/Makefile.am | 3 - core/SystemStatus.cpp | 4 +- core/SystemStatusOsObserver.cpp | 623 ++++++++++------------- core/SystemStatusOsObserver.h | 94 ++-- core/data-items/common/ClientIndex.cpp | 172 ------- core/data-items/common/DataItemIndex.cpp | 203 -------- core/data-items/common/IClientIndex.h | 83 --- core/data-items/common/IDataItemIndex.h | 94 ---- core/data-items/common/IndexFactory.cpp | 64 --- core/data-items/common/IndexFactory.h | 48 -- utils/LocListMap.h | 70 --- utils/LocUnorderedSetMap.h | 166 +++++- 13 files changed, 473 insertions(+), 1154 deletions(-) delete mode 100644 core/data-items/common/ClientIndex.cpp delete mode 100644 core/data-items/common/DataItemIndex.cpp delete mode 100644 core/data-items/common/IClientIndex.h delete mode 100644 core/data-items/common/IDataItemIndex.h delete mode 100644 core/data-items/common/IndexFactory.cpp delete mode 100644 core/data-items/common/IndexFactory.h delete mode 100644 utils/LocListMap.h diff --git a/core/Android.mk b/core/Android.mk index d9227666..1a4f51ab 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -30,9 +30,6 @@ LOCAL_SRC_FILES += \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/Makefile.am b/core/Makefile.am index 78ae76b0..cf8d9ff3 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -38,9 +38,6 @@ libloc_core_la_c_sources = \ LocDualContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ - data-items/common/ClientIndex.cpp \ - data-items/common/DataItemIndex.cpp \ - data-items/common/IndexFactory.cpp \ SystemStatusOsObserver.cpp \ SystemStatus.cpp diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 6eb99683..e12d9f32 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1694,9 +1694,7 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) // send networkinof dataitem to systemstatus observer clients SystemStatusNetworkInfo s(type, "", "", false, connected, false); - list dl(0); - dl.push_back(&s); - mSysStatusObsvr.notify(dl); + mSysStatusObsvr.notify({&s}); } return true; } diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 2fdd19f1..0f6d2289 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -32,28 +32,20 @@ #include #include #include -#include -#include -#include #include namespace loc_core { -SystemStatusOsObserver::SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask) : - mSystemStatus(systemstatus), - mAddress("SystemStatusOsObserver"), -#ifdef USE_GLIB - mBackHaulConnectReqCount(0), -#endif - mClientIndex(IndexFactory :: createClientIndex()), - mDataItemIndex(IndexFactory :: createDataItemIndex()) -{ - mContext.mMsgTask = msgTask; +template +COUT SystemStatusOsObserver::containerTransfer(CINT& inContainer) { + COUT outContainer(0); + for (auto item : inContainer) { + outContainer.insert(outContainer.begin(), item); + } + return outContainer; } -SystemStatusOsObserver::~SystemStatusOsObserver() -{ +SystemStatusOsObserver::~SystemStatusOsObserver() { // Close data-item library handle DataItemsFactoryProxy::closeDataItemLibraryHandle(); @@ -65,290 +57,238 @@ SystemStatusOsObserver::~SystemStatusOsObserver() } mDataItemCache.clear(); - delete mClientIndex; - delete mDataItemIndex; } void SystemStatusOsObserver::setSubscriptionObj(IDataItemSubscription* subscriptionObj) { - mContext.mSubscriptionObj = subscriptionObj; + struct SetSubsObj : public LocMsg { + ObserverContext& mContext; + IDataItemSubscription* mSubsObj; + inline SetSubsObj(ObserverContext& context, IDataItemSubscription* subscriptionObj) : + mContext(context), mSubsObj(subscriptionObj) {} + void proc() const { + mContext.mSubscriptionObj = mSubsObj; - LOC_LOGD("Request cache size - Subscribe:%zu RequestData:%zu", - mSubscribeReqCache.size(), mReqDataCache.size()); - - // we have received the subscription object. process cached requests - // process - subscribe request cache - for (auto each : mSubscribeReqCache) { - subscribe(each.second, each.first); - } - // process - requestData request cache - for (auto each : mReqDataCache) { - requestData(each.second, each.first); - } -} - -// Helper to cache requests subscribe and requestData till subscription obj is obtained -void SystemStatusOsObserver::cacheObserverRequest(ObserverReqCache& reqCache, - const list& l, IDataItemObserver* client) -{ - ObserverReqCache::iterator dicIter = reqCache.find(client); - if (dicIter != reqCache.end()) { - // found - list difference(0); - set_difference(l.begin(), l.end(), - dicIter->second.begin(), dicIter->second.end(), - inserter(difference, difference.begin())); - if (!difference.empty()) { - difference.sort(); - dicIter->second.merge(difference); - dicIter->second.unique(); + if (!mContext.mSSObserver->mDataItemToClients.empty()) { + list dis( + containerTransfer, list>( + mContext.mSSObserver->mDataItemToClients.getKeys())); + mContext.mSubscriptionObj->subscribe(dis, mContext.mSSObserver); + mContext.mSubscriptionObj->requestData(dis, mContext.mSSObserver); + } } - } - else { - // not found - reqCache[client] = l; + }; + + if (nullptr == subscriptionObj) { + LOC_LOGw("subscriptionObj is NULL"); + } else { + mContext.mMsgTask->sendMsg(new SetSubsObj(mContext, subscriptionObj)); } } /****************************************************************************** IDataItemSubscription Overrides ******************************************************************************/ -void SystemStatusOsObserver::subscribe( - const list& l, IDataItemObserver* client) +void SystemStatusOsObserver::subscribe(const list& l, IDataItemObserver* client, + bool toRequestData) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mSubscribeReqCache, l, client); - return; - } - struct HandleSubscribeReq : public LocMsg { - HandleSubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleSubscribeReq() {} + inline HandleSubscribeReq(SystemStatusOsObserver* parent, + list& l, IDataItemObserver* client, bool requestData) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)), + mToRequestData(requestData) {} + void proc() const { + unordered_set dataItemsToSubscribe(0); + mParent->mDataItemToClients.add(mDataItemSet, {mClient}, &dataItemsToSubscribe); + mParent->mClientToDataItems.add(mClient, mDataItemSet); - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + mParent->sendCachedDataItems(mDataItemSet, mClient); - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); - - // Do not send first response for only pendingFirstResponseList, - // instead send for all the data items (present in the cache) that - // have been subscribed for each time. - mParent->sendFirstResponse(mDataItemList, mClient); - - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add(mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe(yetToSubscribeDataItemsList, mParent); + // Send subscription set to framework + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) { LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); + mParent->logMe(dataItemsToSubscribe); + + if (mToRequestData) { + mParent->mContext.mSubscriptionObj->requestData( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } else { + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } } } - SystemStatusOsObserver* mParent; + mutable SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + const unordered_set mDataItemSet; + bool mToRequestData; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleSubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleSubscribeReq(this, (list&)l, client, toRequestData)); + } } void SystemStatusOsObserver::updateSubscription( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUpdateSubscriptionReq : public LocMsg { HandleUpdateSubscriptionReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUpdateSubscriptionReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list currentlySubscribedList(0); - mParent->mClientIndex->getSubscribedList(mClient, currentlySubscribedList); - - list removeDataItemList(0); - set_difference(currentlySubscribedList.begin(), currentlySubscribedList.end(), - mDataItemList.begin(), mDataItemList.end(), - inserter(removeDataItemList,removeDataItemList.begin())); - - // Handle First Response - list pendingFirstResponseList(0); - mParent->mClientIndex->add(mClient, mDataItemList, pendingFirstResponseList); + unordered_set dataItemsToSubscribe(0); + unordered_set dataItemsToUnsubscribe(0); + unordered_set clients({mClient}); + // below removes clients from all entries keyed with the return of the + // mClientToDataItems.update() call. If leaving an empty set of clients as the + // result, the entire entry will be removed. dataItemsToUnsubscribe will be + // populated to keep the keys of the removed entries. + mParent->mDataItemToClients.trimOrRemove( + // this call updates map; removes + // the DataItemId's that are not new to the clietn from mDataItemSet; + // and returns a set of mDataItemSet's that are no longer used by client. + // This unused set of mDataItemSet's is passed to trimOrRemove method of + // map to remove the client from the + // corresponding entries, and gets a set of the entries that are + // removed from the map as a result. + mParent->mClientToDataItems.update(mClient, + (unordered_set&)mDataItemSet), + clients, &dataItemsToUnsubscribe, nullptr); + // below adds mClient to map, and populates + // new keys added to that map, which are DataItemIds to be subscribed. + mParent->mDataItemToClients.add(mDataItemSet, clients, &dataItemsToSubscribe); // Send First Response - mParent->sendFirstResponse(pendingFirstResponseList, mClient); + mParent->sendCachedDataItems(mDataItemSet, mClient); - list yetToSubscribeDataItemsList(0); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); + if (nullptr != mParent->mContext.mSubscriptionObj) { + // Send subscription set to framework + if (!dataItemsToSubscribe.empty()) { + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToSubscribe); - // Send subscription list to framework - if (!yetToSubscribeDataItemsList.empty()) { - mParent->mContext.mSubscriptionObj->subscribe( - yetToSubscribeDataItemsList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } + mParent->mContext.mSubscriptionObj->subscribe( + containerTransfer, list>( + std::move(dataItemsToSubscribe)), + mParent); + } - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, removeDataItemList, unused); - - if (!mParent->mClientIndex->isSubscribedClient(mClient)) { - mParent->mDataItemIndex->remove( - list (1,mClient), unsubscribeList); - } - if (!unsubscribeList.empty()) { // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following"); - mParent->logMe(unsubscribeList); + if (!dataItemsToUnsubscribe.empty()) { + LOC_LOGD("Unsubscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToUnsubscribe); + + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUpdateSubscriptionReq(this, l, client)); -} -void SystemStatusOsObserver::requestData( - const list& l, IDataItemObserver* client) -{ - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGD("%s]: Subscription object is NULL. Caching requests", __func__); - cacheObserverRequest(mReqDataCache, l, client); - return; + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg( + new HandleUpdateSubscriptionReq(this, (list&)l, client)); } - - struct HandleRequestData : public LocMsg { - HandleRequestData(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleRequestData() {} - void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } - - list yetToSubscribeDataItemsList(0); - mParent->mClientIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - mParent->mDataItemIndex->add( - mClient, mDataItemList, yetToSubscribeDataItemsList); - - // Send subscription list to framework - if (!mDataItemList.empty()) { - mParent->mContext.mSubscriptionObj->requestData(mDataItemList, mParent); - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(yetToSubscribeDataItemsList); - } - } - SystemStatusOsObserver* mParent; - IDataItemObserver* mClient; - const list mDataItemList; - }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleRequestData(this, l, client)); } void SystemStatusOsObserver::unsubscribe( const list& l, IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } struct HandleUnsubscribeReq : public LocMsg { HandleUnsubscribeReq(SystemStatusOsObserver* parent, - const list& l, IDataItemObserver* client) : - mParent(parent), mClient(client), mDataItemList(l) {} - virtual ~HandleUnsubscribeReq() {} + list& l, IDataItemObserver* client) : + mParent(parent), mClient(client), + mDataItemSet(containerTransfer, unordered_set>(l)) {} + void proc() const { - if (mDataItemList.empty()) { - LOC_LOGV("mDataItemList is empty. Nothing to do. Exiting"); - return; - } + unordered_set dataItemsUnusedByClient(0); + unordered_set clientToRemove(0); + mParent->mClientToDataItems.trimOrRemove({mClient}, mDataItemSet, &clientToRemove, + &dataItemsUnusedByClient); + unordered_set dataItemsToUnsubscribe(0); + mParent->mDataItemToClients.trimOrRemove(dataItemsUnusedByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); - list unsubscribeList(0); - list unused(0); - mParent->mClientIndex->remove(mClient, mDataItemList, unused); - - for (auto each : mDataItemList) { - list clientListSubs(0); - list clientListOut(0); - mParent->mDataItemIndex->remove( - each, list (1,mClient), clientListOut); - // check if there are any other subscribed client for this data item id - mParent->mDataItemIndex->getListOfSubscribedClients(each, clientListSubs); - if (clientListSubs.empty()) - { - LOC_LOGD("Client list subscribed is empty for dataitem - %d", each); - unsubscribeList.push_back(each); - } - } - - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); + if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToUnsubscribe.empty()) { LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; - const list mDataItemList; + unordered_set mDataItemSet; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeReq(this, l, client)); + + if (l.empty() || nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeReq(this, (list&)l, client)); + } } void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) { - if (nullptr == mContext.mSubscriptionObj) { - LOC_LOGE("%s:%d]: Subscription object is NULL", __func__, __LINE__); - return; - } - struct HandleUnsubscribeAllReq : public LocMsg { HandleUnsubscribeAllReq(SystemStatusOsObserver* parent, IDataItemObserver* client) : mParent(parent), mClient(client) {} - virtual ~HandleUnsubscribeAllReq() {} - void proc() const { - list clients(1, mClient); - list unsubscribeList(0); - if(0 == mParent->mClientIndex->remove(mClient)) { - return; - } - mParent->mDataItemIndex->remove(clients, unsubscribeList); - if (!unsubscribeList.empty()) { - // Send unsubscribe to framework - mParent->mContext.mSubscriptionObj->unsubscribe(unsubscribeList, mParent); - LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); - mParent->logMe(unsubscribeList); + void proc() const { + unordered_set diByClient = mParent->mClientToDataItems.getValSet(mClient); + if (!diByClient.empty()) { + unordered_set dataItemsToUnsubscribe; + mParent->mClientToDataItems.remove(mClient); + mParent->mDataItemToClients.trimOrRemove(diByClient, {mClient}, + &dataItemsToUnsubscribe, nullptr); + + if (!dataItemsToUnsubscribe.empty() && + nullptr != mParent->mContext.mSubscriptionObj) { + + LOC_LOGD("Unsubscribe Request sent to framework for the following data items"); + mParent->logMe(dataItemsToUnsubscribe); + + // Send unsubscribe to framework + mParent->mContext.mSubscriptionObj->unsubscribe( + containerTransfer, list>( + std::move(dataItemsToUnsubscribe)), + mParent); + } } } SystemStatusOsObserver* mParent; IDataItemObserver* mClient; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleUnsubscribeAllReq(this, client)); + + if (nullptr == client) { + LOC_LOGw("Data item set is empty or client is nullptr"); + } else { + mContext.mMsgTask->sendMsg(new HandleUnsubscribeAllReq(this, client)); + } } /****************************************************************************** @@ -356,84 +296,78 @@ void SystemStatusOsObserver::unsubscribeAll(IDataItemObserver* client) ******************************************************************************/ void SystemStatusOsObserver::notify(const list& dlist) { - list dataItemList(0); - - for (auto each : dlist) { - string dv; - each->stringify(dv); - LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); - - IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); - if (nullptr == di) { - LOC_LOGE("Unable to create dataitem:%d", each->getId()); - return; - } - - // Copy contents into the newly created data item - di->copy(each); - - // Request systemstatus to record this dataitem in its cache - if (mSystemStatus->eventDataItemNotify(di)) { - // add this dataitem if updated from last one - dataItemList.push_back(di); - } - } - struct HandleNotify : public LocMsg { - HandleNotify(SystemStatusOsObserver* parent, const list& l) : - mParent(parent), mDList(l) {} - virtual ~HandleNotify() { - for (auto each : mDList) { - delete each; + HandleNotify(SystemStatusOsObserver* parent, vector& v) : + mParent(parent), mDiVec(std::move(v)) {} + + inline virtual ~HandleNotify() { + for (auto item : mDiVec) { + delete item; } } + void proc() const { // Update Cache with received data items and prepare // list of data items to be sent. - list dataItemIdsToBeSent(0); - for (auto item : mDList) { - bool dataItemUpdated = false; - mParent->updateCache(item, dataItemUpdated); - if (dataItemUpdated) { - dataItemIdsToBeSent.push_back(item->getId()); + unordered_set dataItemIdsToBeSent(0); + for (auto item : mDiVec) { + if (mParent->updateCache(item)) { + dataItemIdsToBeSent.insert(item->getId()); } } // Send data item to all subscribed clients - list clientList(0); + unordered_set clientSet(0); for (auto each : dataItemIdsToBeSent) { - list clients(0); - mParent->mDataItemIndex->getListOfSubscribedClients(each, clients); - for (auto each_cient: clients) { - clientList.push_back(each_cient); + auto clients = mParent->mDataItemToClients.getValSetPtr(each); + if (nullptr != clients) { + clientSet.insert(clients->begin(), clients->end()); } } - clientList.unique(); - for (auto client : clientList) { - list dataItemIdsSubscribedByThisClient(0); - list dataItemIdsToBeSentForThisClient(0); - mParent->mClientIndex->getSubscribedList( - client, dataItemIdsSubscribedByThisClient); - dataItemIdsSubscribedByThisClient.sort(); - dataItemIdsToBeSent.sort(); + for (auto client : clientSet) { + unordered_set dataItemIdsForThisClient( + mParent->mClientToDataItems.getValSet(client)); + for (auto id : dataItemIdsForThisClient) { + if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) { + dataItemIdsForThisClient.erase(id); + } + } - set_intersection(dataItemIdsToBeSent.begin(), - dataItemIdsToBeSent.end(), - dataItemIdsSubscribedByThisClient.begin(), - dataItemIdsSubscribedByThisClient.end(), - inserter(dataItemIdsToBeSentForThisClient, - dataItemIdsToBeSentForThisClient.begin())); - - mParent->sendCachedDataItems(dataItemIdsToBeSentForThisClient, client); - dataItemIdsSubscribedByThisClient.clear(); - dataItemIdsToBeSentForThisClient.clear(); + mParent->sendCachedDataItems(dataItemIdsForThisClient, client); } } SystemStatusOsObserver* mParent; - const list mDList; + const vector mDiVec; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleNotify(this, dataItemList)); + + if (!dlist.empty()) { + vector dataItemVec(dlist.size()); + + for (auto each : dlist) { + IF_LOC_LOGD { + string dv; + each->stringify(dv); + LOC_LOGD("notify: DataItem In Value:%s", dv.c_str()); + } + + IDataItemCore* di = DataItemsFactoryProxy::createNewDataItem(each->getId()); + if (nullptr == di) { + LOC_LOGw("Unable to create dataitem:%d", each->getId()); + continue; + } + + // Copy contents into the newly created data item + di->copy(each); + + // add this dataitem if updated from last one + dataItemVec.push_back(di); + } + + if (!dataItemVec.empty()) { + mContext.mMsgTask->sendMsg(new HandleNotify(this, dataItemVec)); + } + } } /****************************************************************************** @@ -447,7 +381,7 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer == mActiveRequestCount.end()) { // Data item not found in map // Add reference count as 1 and add dataitem to map @@ -485,7 +419,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } // Check if data item exists in mActiveRequestCount - map::iterator citer = mActiveRequestCount.find(dit); + DataItemIdToInt::iterator citer = mActiveRequestCount.find(dit); if (citer != mActiveRequestCount.end()) { // found citer->second--; @@ -573,84 +507,65 @@ bool SystemStatusOsObserver::disconnectBackhaul() /****************************************************************************** Helpers ******************************************************************************/ -void SystemStatusOsObserver::sendFirstResponse( - const list& l, IDataItemObserver* to) -{ - if (l.empty()) { - LOC_LOGV("list is empty. Nothing to do. Exiting"); - return; - } - - string clientName; - to->getName(clientName); - list dataItems(0); - - for (auto each : l) { - map::const_iterator citer = mDataItemCache.find(each); - if (citer != mDataItemCache.end()) { - string dv; - citer->second->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(citer->second); - } - } - if (dataItems.empty()) { - LOC_LOGV("No items to notify. Nothing to do. Exiting"); - return; - } - to->notify(dataItems); -} - void SystemStatusOsObserver::sendCachedDataItems( - const list& l, IDataItemObserver* to) + const unordered_set& s, IDataItemObserver* to) { - string clientName; - to->getName(clientName); - list dataItems(0); + if (nullptr == to) { + LOC_LOGv("client pointer is NULL."); + } else { + string clientName; + to->getName(clientName); + list dataItems(0); - for (auto each : l) { - string dv; - IDataItemCore* di = mDataItemCache[each]; - di->stringify(dv); - LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); - dataItems.push_back(di); + for (auto each : s) { + auto citer = mDataItemCache.find(each); + if (citer != mDataItemCache.end()) { + string dv; + citer->second->stringify(dv); + LOC_LOGI("DataItem: %s >> %s", dv.c_str(), clientName.c_str()); + dataItems.push_front(citer->second); + } + } + + if (dataItems.empty()) { + LOC_LOGv("No items to notify."); + } else { + to->notify(dataItems); + } } - to->notify(dataItems); } -void SystemStatusOsObserver::updateCache(IDataItemCore* d, bool& dataItemUpdated) +bool SystemStatusOsObserver::updateCache(IDataItemCore* d) { - if (nullptr == d) { - return; - } + bool dataItemUpdated = false; - // Check if data item exists in cache - map::iterator citer = - mDataItemCache.find(d->getId()); - if (citer == mDataItemCache.end()) { - // New data item; not found in cache - IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); - if (nullptr == dataitem) { - return; + // Request systemstatus to record this dataitem in its cache + // if the return is false, it means that SystemStatus is not + // handling it, so SystemStatusOsObserver also doesn't. + // So it has to be true to proceed. + if (nullptr != d && mSystemStatus->eventDataItemNotify(d)) { + auto citer = mDataItemCache.find(d->getId()); + if (citer == mDataItemCache.end()) { + // New data item; not found in cache + IDataItemCore* dataitem = DataItemsFactoryProxy::createNewDataItem(d->getId()); + if (nullptr != dataitem) { + // Copy the contents of the data item + dataitem->copy(d); + // Insert in mDataItemCache + mDataItemCache.insert(std::make_pair(d->getId(), dataitem)); + dataItemUpdated = true; + } + } else { + // Found in cache; Update cache if necessary + citer->second->copy(d, &dataItemUpdated); } - // Copy the contents of the data item - dataitem->copy(d); - pair cpair(d->getId(), dataitem); - // Insert in mDataItemCache - mDataItemCache.insert(cpair); - dataItemUpdated = true; - } - else { - // Found in cache; Update cache if necessary - if(0 == citer->second->copy(d, &dataItemUpdated)) { - return; + if (dataItemUpdated) { + LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); } } - if (dataItemUpdated) { - LOC_LOGV("DataItem:%d updated:%d", d->getId(), dataItemUpdated); - } + return dataItemUpdated; } } // namespace loc_core diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 930ddc12..fd606063 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -41,6 +41,7 @@ #include #include #include +#include namespace loc_core { @@ -48,39 +49,57 @@ namespace loc_core SystemStatusOsObserver ******************************************************************************/ using namespace std; +using namespace loc_util; // Forward Declarations class IDataItemCore; -template class IClientIndex; -template class IDataItemIndex; +class SystemStatus; +class SystemStatusOsObserver; +typedef map> ObserverReqCache; +typedef LocUnorderedSetMap ClientToDataItems; +typedef LocUnorderedSetMap DataItemToClients; +typedef unordered_map DataItemIdToCore; +typedef unordered_map DataItemIdToInt; -struct SystemContext { +struct ObserverContext { IDataItemSubscription* mSubscriptionObj; IFrameworkActionReq* mFrameworkActionReqObj; const MsgTask* mMsgTask; + SystemStatusOsObserver* mSSObserver; - inline SystemContext() : - mSubscriptionObj(NULL), - mFrameworkActionReqObj(NULL), - mMsgTask(NULL) {} + inline ObserverContext(const MsgTask* msgTask, SystemStatusOsObserver* observer) : + mSubscriptionObj(NULL), mFrameworkActionReqObj(NULL), + mMsgTask(msgTask), mSSObserver(observer) {} }; -typedef map> ObserverReqCache; - // Clients wanting to get data from OS/Framework would need to // subscribe with OSObserver using IDataItemSubscription interface. // Such clients would need to implement IDataItemObserver interface // to receive data when it becomes available. -class SystemStatus; class SystemStatusOsObserver : public IOsObserver { public: // ctor - SystemStatusOsObserver( - SystemStatus* systemstatus, const MsgTask* msgTask); + inline SystemStatusOsObserver(SystemStatus* systemstatus, const MsgTask* msgTask) : + mSystemStatus(systemstatus), mContext(msgTask, this), + mAddress("SystemStatusOsObserver"), + mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) +#ifdef USE_GLIB + , mBackHaulConnectReqCount(0) +#endif + { + } + // dtor ~SystemStatusOsObserver(); + template + static COUT containerTransfer(CINT& s); + template + inline static COUT containerTransfer(CINT&& s) { + return containerTransfer(s); + } + // To set the subscription object virtual void setSubscriptionObj(IDataItemSubscription* subscriptionObj); @@ -96,38 +115,40 @@ public: } // IDataItemSubscription Overrides - virtual void subscribe(const list& l, IDataItemObserver* client); - virtual void updateSubscription(const list& l, IDataItemObserver* client); - virtual void requestData(const list& l, IDataItemObserver* client); - virtual void unsubscribe(const list& l, IDataItemObserver* client); - virtual void unsubscribeAll(IDataItemObserver* client); + inline virtual void subscribe(const list& l, IDataItemObserver* client) override { + subscribe(l, client, false); + } + virtual void updateSubscription(const list& l, IDataItemObserver* client) override; + inline virtual void requestData(const list& l, IDataItemObserver* client) override { + subscribe(l, client, true); + } + virtual void unsubscribe(const list& l, IDataItemObserver* client) override; + virtual void unsubscribeAll(IDataItemObserver* client) override; // IDataItemObserver Overrides - virtual void notify(const list& dlist); - inline virtual void getName(string& name) { + virtual void notify(const list& dlist) override; + inline virtual void getName(string& name) override { name = mAddress; } // IFrameworkActionReq Overrides - virtual void turnOn(DataItemId dit, int timeOut = 0); - virtual void turnOff(DataItemId dit); + virtual void turnOn(DataItemId dit, int timeOut = 0) override; + virtual void turnOff(DataItemId dit) override; #ifdef USE_GLIB - virtual bool connectBackhaul(); + virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif private: SystemStatus* mSystemStatus; - SystemContext mContext; + ObserverContext mContext; const string mAddress; - IClientIndex* mClientIndex; - IDataItemIndex* mDataItemIndex; - map mDataItemCache; - map mActiveRequestCount; + ClientToDataItems mClientToDataItems; + DataItemToClients mDataItemToClients; + DataItemIdToCore mDataItemCache; + DataItemIdToInt mActiveRequestCount; // Cache the subscribe and requestData till subscription obj is obtained - ObserverReqCache mSubscribeReqCache; - ObserverReqCache mReqDataCache; void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); #ifdef USE_GLIB @@ -135,13 +156,16 @@ private: int mBackHaulConnectReqCount; #endif + void subscribe(const list& l, IDataItemObserver* client, bool toRequestData); + // Helpers - void sendFirstResponse(const list& l, IDataItemObserver* to); - void sendCachedDataItems(const list& l, IDataItemObserver* to); - void updateCache(IDataItemCore* d, bool& dataItemUpdated); - inline void logMe(const list& l) { - for (auto id : l) { - LOC_LOGD("DataItem %d", id); + void sendCachedDataItems(const unordered_set& s, IDataItemObserver* to); + bool updateCache(IDataItemCore* d); + inline void logMe(const unordered_set& l) { + IF_LOC_LOGD { + for (auto id : l) { + LOC_LOGD("DataItem %d", id); + } } } }; diff --git a/core/data-items/common/ClientIndex.cpp b/core/data-items/common/ClientIndex.cpp deleted file mode 100644 index d4bd11e5..00000000 --- a/core/data-items/common/ClientIndex.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline ClientIndex :: ClientIndex () {} - -template -inline ClientIndex :: ~ClientIndex () {} - -template -bool ClientIndex :: isSubscribedClient (CT client) { - bool result = false; - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - result = true; - } - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: getSubscribedList (CT client, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator it = - mDataItemsPerClientMap.find (client); - if (it != mDataItemsPerClientMap.end ()) { - out = it->second; - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -int ClientIndex :: remove (CT client) { - int result = 0; - ENTRY_LOG (); - mDataItemsPerClientMap.erase (client); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void ClientIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.begin (); - while (dicIter != mDataItemsPerClientMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find (dicIter->second.begin (), dicIter->second.end (), *it); - if (iter != dicIter->second.end ()) { - dicIter->second.erase (iter); - } - } - if (dicIter->second.empty ()) { - out.push_back (dicIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mDataItemsPerClientMap.erase (dicIter++); - } else { - ++dicIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: remove -( - CT client, - const list & r, - list & out -) -{ - ENTRY_LOG (); - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_intersection (dicIter->second.begin (), dicIter->second.end (), - r.begin (), r.end (), - inserter (out,out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - dicIter->second.erase (find (dicIter->second.begin (), - dicIter->second.end (), - *it)); - } - } - if (dicIter->second.empty ()) { - mDataItemsPerClientMap.erase (dicIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void ClientIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < CT, list > :: iterator dicIter = - mDataItemsPerClientMap.find (client); - if (dicIter != mDataItemsPerClientMap.end ()) { - set_difference (l.begin (), l.end (), - dicIter->second.begin (), dicIter->second.end (), - inserter (difference,difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - dicIter->second.merge (difference); - dicIter->second.unique (); - } - } else { - out = l; - pair < CT, list > dicnpair (client, out); - mDataItemsPerClientMap.insert (dicnpair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class ClientIndex ; - template class ClientIndex ; -} diff --git a/core/data-items/common/DataItemIndex.cpp b/core/data-items/common/DataItemIndex.cpp deleted file mode 100644 index 462bf748..00000000 --- a/core/data-items/common/DataItemIndex.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using namespace loc_core; - -template -inline DataItemIndex :: DataItemIndex () {} - -template -inline DataItemIndex :: ~DataItemIndex () {} - -template -void DataItemIndex :: getListOfSubscribedClients - ( - DIT id, - list & out -) -{ - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - out = cdiIter->second; - } -} - - -template -int DataItemIndex :: remove (DIT id) { - int result = 0; - ENTRY_LOG (); - mClientsPerDataItemMap.erase (id); - EXIT_LOG_WITH_ERROR ("%d",result); - return result; -} - -template -void DataItemIndex :: remove (const list & r, list & out) { - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.begin (); - while (cdiIter != mClientsPerDataItemMap.end()) { - typename list :: const_iterator it = r.begin (); - for (; it != r.end (); ++it) { - typename list :: iterator iter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - *it - ); - if (iter != cdiIter->second.end ()) { - cdiIter->second.erase (iter); - } - } - - if (cdiIter->second.empty ()) { - out.push_back (cdiIter->first); - // Post-increment operator increases the iterator but returns the - // prevous one that will be invalidated by erase() - mClientsPerDataItemMap.erase (cdiIter++); - } else { - ++cdiIter; - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: remove -( - DIT id, - const list & r, - list & out -) -{ - ENTRY_LOG (); - - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_intersection (cdiIter->second.begin (), cdiIter->second.end (), - r.begin (), r.end (), - inserter (out, out.begin ())); - if (!out.empty ()) { - typename list :: iterator it = out.begin (); - for (; it != out.end (); ++it) { - cdiIter->second.erase (find (cdiIter->second.begin (), - cdiIter->second.end (), - *it)); - } - } - if (cdiIter->second.empty ()) { - mClientsPerDataItemMap.erase (cdiIter); - EXIT_LOG_WITH_ERROR ("%d",0); - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - DIT id, - const list & l, - list & out -) -{ - ENTRY_LOG (); - list difference; - typename map < DIT, list > :: iterator cdiIter = - mClientsPerDataItemMap.find (id); - if (cdiIter != mClientsPerDataItemMap.end ()) { - set_difference (l.begin (), l.end (), - cdiIter->second.begin (), cdiIter->second.end (), - inserter (difference, difference.begin ())); - if (!difference.empty ()) { - difference.sort (); - out = difference; - cdiIter->second.merge (difference); - } - } else { - out = l; - pair < DIT, list > cndipair (id, out); - mClientsPerDataItemMap.insert (cndipair); - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -template -void DataItemIndex :: add -( - CT client, - const list & l, - list & out -) -{ - ENTRY_LOG (); - typename map < DIT, list > :: iterator cdiIter; - typename list :: const_iterator it = l.begin (); - for (; it != l.end (); ++it) { - cdiIter = mClientsPerDataItemMap.find (*it); - if (cdiIter == mClientsPerDataItemMap.end ()) { - out.push_back (*it); - pair < DIT, list > cndiPair (*it, list (1, client)); - mClientsPerDataItemMap.insert (cndiPair); - } else { - typename list :: iterator clientIter = - find - ( - cdiIter->second.begin (), - cdiIter->second.end (), - client - ); - if (clientIter == cdiIter->second.end()) { - cdiIter->second.push_back (client); - } - } - } - EXIT_LOG_WITH_ERROR ("%d",0); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class DataItemIndex ; - template class DataItemIndex ; -} diff --git a/core/data-items/common/IClientIndex.h b/core/data-items/common/IClientIndex.h deleted file mode 100644 index 0272e7b9..00000000 --- a/core/data-items/common/IClientIndex.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __ICLIENTINDEX_H__ -#define __ICLIENTINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IClientIndex { -public: - - // Checks if client is subscribed - virtual bool isSubscribedClient (CT client) = 0; - - // gets subscription list - virtual void getSubscribedList (CT client, std :: list & out) = 0; - - // removes an entry - virtual int remove (CT client) = 0; - - // removes std :: list of data items and returns a list of clients - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of data items indexed by client and returns list - // of data items removed if any. - virtual void remove - ( - CT client, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry in map and returns new data items added. - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IClientIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __ICLIENTINDEX_H__ diff --git a/core/data-items/common/IDataItemIndex.h b/core/data-items/common/IDataItemIndex.h deleted file mode 100644 index 91855826..00000000 --- a/core/data-items/common/IDataItemIndex.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __IDATAITEMINDEX_H__ -#define __IDATAITEMINDEX_H__ - -#include - -namespace loc_core -{ - -template - -class IDataItemIndex { - -public: - - // gets std :: list of subscribed clients - virtual void getListOfSubscribedClients - ( - DIT id, - std :: list & out - ) = 0; - - // removes an entry from - virtual int remove (DIT id) = 0; - - // removes list of clients and returns a list of data items - // removed if any. - virtual void remove - ( - const std :: list & r, - std :: list & out - ) = 0; - - // removes list of clients indexed by data item and returns list of - // clients removed if any. - virtual void remove - ( - DIT id, - const std :: list & r, - std :: list & out - ) = 0; - - // adds/modifies entry and returns new clients added - virtual void add - ( - DIT id, - const std :: list & l, - std :: list & out - ) = 0; - - // adds/modifies entry and returns yet to subscribe list of data items - virtual void add - ( - CT client, - const std :: list & l, - std :: list & out - ) = 0; - - // dtor - virtual ~IDataItemIndex () {} -}; - -} // namespace loc_core - -#endif // #ifndef __IDATAITEMINDEX_H__ - diff --git a/core/data-items/common/IndexFactory.cpp b/core/data-items/common/IndexFactory.cpp deleted file mode 100644 index cf494752..00000000 --- a/core/data-items/common/IndexFactory.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2015, 2017 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 - -using namespace std; -using loc_core::IClientIndex; -using loc_core::IDataItemIndex; -using loc_core::IDataItemObserver; -using namespace loc_core; - -template -inline IClientIndex * IndexFactory :: createClientIndex -() -{ - return new (nothrow) ClientIndex (); -} - -template -inline IDataItemIndex * IndexFactory :: createDataItemIndex -() -{ - return new (nothrow) DataItemIndex (); -} - -// Explicit instantiation must occur in same namespace where class is defined -namespace loc_core -{ - template class IndexFactory ; - template class IndexFactory ; -} diff --git a/core/data-items/common/IndexFactory.h b/core/data-items/common/IndexFactory.h deleted file mode 100644 index 9a2070e9..00000000 --- a/core/data-items/common/IndexFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __INDEXFACTORY_H__ -#define __INDEXFACTORY_H__ - -#include -#include - -namespace loc_core -{ -template -class IndexFactory { - -public: - static IClientIndex * createClientIndex (); - static IDataItemIndex * createDataItemIndex (); -}; - -} // namespace loc_core - -#endif // #ifndef __INDEXFACTORY_H__ diff --git a/utils/LocListMap.h b/utils/LocListMap.h deleted file mode 100644 index feccb059..00000000 --- a/utils/LocListMap.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2015, 2017 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 __CLIENTINDEX_H__ -#define __CLIENTINDEX_H__ - -#include -#include -#include - -using loc_core::IClientIndex; - -namespace loc_core -{ - -template - -class ClientIndex : public IClientIndex { - -public: - - ClientIndex (); - - ~ClientIndex (); - - bool isSubscribedClient (CT client); - - void getSubscribedList (CT client, std :: list & out); - - int remove (CT client); - - void remove (const std :: list & r, std :: list & out); - - void remove (CT client, const std :: list & r, std :: list & out); - - void add (CT client, const std :: list & l, std :: list & out); - -private: - //Data members - std :: map < CT , std :: list > mDataItemsPerClientMap; -}; - -} // namespace loc_core - -#endif // #ifndef __CLIENTINDEX_H__ diff --git a/utils/LocUnorderedSetMap.h b/utils/LocUnorderedSetMap.h index d72e89eb..87481348 100644 --- a/utils/LocUnorderedSetMap.h +++ b/utils/LocUnorderedSetMap.h @@ -26,45 +26,167 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#ifndef __LOC_UNORDERDED_SETMAP_H__ +#define __LOC_UNORDERDED_SETMAP_H__ -#ifndef __DATAITEMINDEX_H__ -#define __DATAITEMINDEX_H__ +#include +#include +#include -#include -#include -#include +using std::unordered_set; +using std::unordered_map; -using loc_core::IDataItemIndex; +namespace loc_util { -namespace loc_core -{ +// Trim from *fromSet* any elements that also exist in *rVals*. +// The optional *goneVals*, if not null, will be populated with removed elements. +template +inline static void trimSet(unordered_set& fromSet, const unordered_set& rVals, + unordered_set* goneVals) { + for (auto val : rVals) { + if (fromSet.erase(val) > 0 && nullptr != goneVals) { + goneVals->insert(val); + } + } +} -template +// this method is destructive to the input unordered_sets. +// the return set is the interset extracted out from the two input sets, *s1* and *s2*. +// *s1* and *s2* will be left with the intersect removed from them. +template +static unordered_set removeAndReturnInterset(unordered_set& s1, unordered_set& s2) { + unordered_set common(0); + for (auto b = s2.begin(); b != s2.end(); b++) { + auto a = find(s1.begin(), s1.end(), *b); + if (a != s1.end()) { + // this is a common item of both l1 and l2, remove from both + // but after we add to common + common.insert(*a); + s1.erase(a); + s2.erase(b); + } + } + return common; +} -class DataItemIndex : public IDataItemIndex { +template +class LocUnorderedSetMap { + unordered_map> mMap; + + + // Trim the VALs pointed to by *iter*, with everything that also exist in *rVals*. + // If the set becomes empty, remove the map entry. *goneVals*, if not null, records + // the trimmed VALs. + bool trimOrRemove(typename unordered_map>::iterator iter, + const unordered_set& rVals, unordered_set* goneVals) { + trimSet(iter->second, rVals, goneVals); + bool removeEntry = (iter->second.empty()); + if (removeEntry) { + mMap.erase(iter); + } + return removeEntry; + } public: + inline LocUnorderedSetMap() {} + inline LocUnorderedSetMap(size_t size) : mMap(size) {} - DataItemIndex (); + inline bool empty() { return mMap.empty(); } - ~DataItemIndex (); + // This gets the raw pointer to the VALs pointed to by *key* + // If the entry is not in the map, nullptr will be returned. + inline unordered_set* getValSetPtr(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? &(entry->second) : nullptr; + } - void getListOfSubscribedClients (DIT id, std :: list & out); + // This gets a copy of VALs pointed to by *key* + // If the entry is not in the map, an empty set will be returned. + inline unordered_set getValSet(const KEY& key) { + auto entry = mMap.find(key); + return (entry != mMap.end()) ? entry->second : unordered_set(0); + } - int remove (DIT id); + // This gets all the KEYs from the map + inline unordered_set getKeys() { + unordered_set keys(0); + for (auto entry : mMap) { + keys.insert(entry.first); + } + return keys; + } - void remove (const std :: list & r, std :: list & out); + inline bool remove(const KEY& key) { + return mMap.erase(key) > 0; + } - void remove (DIT id, const std :: list & r, std :: list & out); + // This looks into all the entries keyed by *keys*. Remove any VALs from the entries + // that also exist in *rVals*. If the entry is left with an empty set, the entry will + // be removed. The optional parameters *goneKeys* and *goneVals* will record the KEYs + // (or entries) and the collapsed VALs removed from the map, respectively. + inline void trimOrRemove(unordered_set&& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + trimOrRemove(keys, rVals, goneKeys, goneVals); + } + inline void trimOrRemove(unordered_set& keys, const unordered_set& rVals, + unordered_set* goneKeys, unordered_set* goneVals) { + for (auto key : keys) { + auto iter = mMap.find(key); + if (iter != mMap.end() && trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) { + goneKeys->insert(iter->first); + } + } + } - void add (DIT id, const std :: list & l, std :: list & out); + // This adds all VALs from *newVals* to the map entry keyed by *key*. Or if it + // doesn't exist yet, add the set to the map. + bool add(const KEY& key, const unordered_set& newVals) { + bool newEntryAdded = false; + if (!newVals.empty()) { + auto iter = mMap.find(key); + if (iter != mMap.end()) { + iter->second.insert(newVals.begin(), newVals.end()); + } else { + mMap[key] = newVals; + newEntryAdded = true; + } + } + return newEntryAdded; + } - void add (CT client, const std :: list & l, std :: list & out); + // This adds to each of entries in the map keyed by *keys* with the VALs in the + // *enwVals*. If there new entries added (new key in *keys*), *newKeys*, if not + // null, would be populated with those keys. + inline void add(const unordered_set& keys, const unordered_set&& newVals, + unordered_set* newKeys) { + add(keys, newVals, newKeys); + } + inline void add(const unordered_set& keys, const unordered_set& newVals, + unordered_set* newKeys) { + for (auto key : keys) { + if (add(key, newVals) && nullptr != newKeys) { + newKeys->insert(key); + } + } + } -private: - std :: map < DIT, std :: list > mClientsPerDataItemMap; + // This puts *newVals* into the map keyed by *key*, and returns the VALs that are + // in effect removed from the keyed VAL set in the map entry. + // This call would also remove those same VALs from *newVals*. + inline unordered_set update(const KEY& key, unordered_set& newVals) { + unordered_set goneVals(0); + + if (newVals.empty()) { + mMap.erase(key); + } else { + auto curVals = mMap[key]; + mMap[key] = newVals; + goneVals = removeAndReturnInterset(curVals, newVals); + } + return goneVals; + } }; -} // namespace loc_core +} // namespace loc_util -#endif // #ifndef __DATAITEMINDEX_H__ +#endif // #ifndef __LOC_UNORDERDED_SETMAP_H__ From 80e09f69b6f186b95daf5c9200fc74ac3b8242be Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 9 Apr 2018 14:32:28 -0700 Subject: [PATCH 666/945] Fixed a number of issues with NetworkInfoDataItemBase There are a couple of issues. NetworkInfoDataItemBase objects might be from OsAgent or GnssLocationProvider. The two sources actually have mTypes defined differently. In addtion, when there are different types of connections such as wifi / mobile, getting connected / disconnected independently, clients need to be all notified correctly. Right now, if mConnected hasn't changed, no updates are send. For exmple, if mobile is connected, later wifi gets connected too, clients won't know. SystemStatus is also updated to get updated / colated informtion. In the above example, SystemStatus's top record would record as both mobile and wifi are connected. Change-Id: I1825902247fe1d4e6363f5e24a75be7e984d0dc4 CRs-Fixed: 2221114 --- core/SystemStatus.cpp | 113 +++++++++----------- core/SystemStatus.h | 43 +++++--- core/data-items/DataItemConcreteTypesBase.h | 32 +++--- gnss/XtraSystemStatusObserver.cpp | 26 +---- gnss/XtraSystemStatusObserver.h | 10 +- 5 files changed, 107 insertions(+), 117 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index e12d9f32..5d5c4b08 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1250,8 +1250,7 @@ IOsObserver* SystemStatus::getOsObserver() } SystemStatus::SystemStatus(const MsgTask* msgTask) : - mSysStatusObsvr(this, msgTask), - mConnected(false) + mSysStatusObsvr(this, msgTask) { int result = 0; ENTRY_LOG (); @@ -1301,17 +1300,10 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) : /****************************************************************************** SystemStatus - storing dataitems ******************************************************************************/ -template -bool SystemStatus::setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s) -{ - TYPE_SYSTEMSTATUS_ITEM sout(s); - return setIteminReport(report, sout); -} - template -bool SystemStatus::setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s) +bool SystemStatus::setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s) { - if (!report.empty() && report.back().equals(s)) { + if (!report.empty() && report.back().equals(static_cast(s.collate(report.back())))) { // there is no change - just update reported timestamp report.back().mUtcReported = s.mUtcReported; return false; @@ -1449,94 +1441,92 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) switch(dataitem->getId()) { case AIRPLANEMODE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAirplaneMode, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAirplaneMode, + SystemStatusAirplaneMode(*(static_cast(dataitem)))); break; case ENH_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mENH, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mENH, + SystemStatusENH(*(static_cast(dataitem)))); break; case GPSSTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mGPSState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mGPSState, + SystemStatusGpsState(*(static_cast(dataitem)))); break; case NLPSTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNLPStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNLPStatus, + SystemStatusNLPStatus(*(static_cast(dataitem)))); break; case WIFIHARDWARESTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mWifiHardwareState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiHardwareState, + SystemStatusWifiHardwareState(*(static_cast(dataitem)))); break; case NETWORKINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNetworkInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNetworkInfo, + SystemStatusNetworkInfo(*(static_cast(dataitem)))); break; case RILSERVICEINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilServiceInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilServiceInfo, + SystemStatusServiceInfo(*(static_cast(dataitem)))); break; case RILCELLINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilCellInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilCellInfo, + SystemStatusRilCellInfo(*(static_cast(dataitem)))); break; case SERVICESTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mServiceStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mServiceStatus, + SystemStatusServiceStatus(*(static_cast(dataitem)))); break; case MODEL_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mModel, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mModel, + SystemStatusModel(*(static_cast(dataitem)))); break; case MANUFACTURER_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mManufacturer, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mManufacturer, + SystemStatusManufacturer(*(static_cast(dataitem)))); break; case ASSISTED_GPS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAssistedGps, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAssistedGps, + SystemStatusAssistedGps(*(static_cast(dataitem)))); break; case SCREEN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mScreenState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mScreenState, + SystemStatusScreenState(*(static_cast(dataitem)))); break; case POWER_CONNECTED_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mPowerConnectState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mPowerConnectState, + SystemStatusPowerConnectState(*(static_cast(dataitem)))); break; case TIMEZONE_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeZoneChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeZoneChange, + SystemStatusTimeZoneChange(*(static_cast(dataitem)))); break; case TIME_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeChange, + SystemStatusTimeChange(*(static_cast(dataitem)))); break; case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mWifiSupplicantStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiSupplicantStatus, + SystemStatusWifiSupplicantStatus(*(static_cast(dataitem)))); break; case SHUTDOWN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mShutdownState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mShutdownState, + SystemStatusShutdownState(*(static_cast(dataitem)))); break; case TAC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTac, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTac, + SystemStatusTac(*(static_cast(dataitem)))); break; case MCCMNC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mMccMnc, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mMccMnc, + SystemStatusMccMnc(*(static_cast(dataitem)))); break; case BTLE_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mBtDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtDeviceScanDetail, + SystemStatusBtDeviceScanDetail(*(static_cast(dataitem)))); break; case BT_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mBtLeDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtLeDeviceScanDetail, + SystemStatusBtleDeviceScanDetail(*(static_cast(dataitem)))); break; default: break; @@ -1689,13 +1679,10 @@ bool SystemStatus::setDefaultGnssEngineStates(void) ******************************************************************************/ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { - if (connected != mConnected) { - mConnected = connected; + // send networkinof dataitem to systemstatus observer clients + SystemStatusNetworkInfo s(type, "", "", false, connected, false); + mSysStatusObsvr.notify({&s}); - // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", false, connected, false); - mSysStatusObsvr.notify({&s}); - } return true; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 9500264d..1c3adc84 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -77,8 +77,11 @@ public: mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; - virtual ~SystemStatusItemBase() { }; - virtual void dump(void) { }; + virtual ~SystemStatusItemBase() {}; + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase&) { + return *this; + } + virtual void dump(void) {}; }; class SystemStatusLocation : public SystemStatusItemBase @@ -93,7 +96,7 @@ public: const GpsLocationExtended& locationEx) : mValid(true), mLocation(location), - mLocationEx(locationEx) { } + mLocationEx(locationEx) {} bool equals(const SystemStatusLocation& peer); void dump(void); }; @@ -457,6 +460,7 @@ public: class SystemStatusNetworkInfo : public SystemStatusItemBase, public NetworkInfoDataItemBase { + NetworkInfoDataItemBase* mSrcObjPtr; public: inline SystemStatusNetworkInfo( int32_t type=0, @@ -466,18 +470,21 @@ public: bool connected=false, bool roaming=false) : NetworkInfoDataItemBase( + (NetworkType)type, type, typeName, subTypeName, available, connected, - roaming) {} + roaming), + mSrcObjPtr(nullptr) {} inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) : - NetworkInfoDataItemBase(itemBase) { + NetworkInfoDataItemBase(itemBase), + mSrcObjPtr((NetworkInfoDataItemBase*)&itemBase) { mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - if ((mType == peer.mType) && + if ((mAllTypes == peer.mAllTypes) && (mTypeName == peer.mTypeName) && (mSubTypeName == peer.mSubTypeName) && (mAvailable == peer.mAvailable) && @@ -487,8 +494,24 @@ public: } return false; } + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { + uint64_t allTypes = (static_cast(curInfo)).mAllTypes; + if (mConnected) { + mAllTypes |= allTypes; + } else if (0 != mAllTypes) { + mAllTypes = (allTypes & (~mAllTypes)); + } // else (mConnected == false && mAllTypes == 0) + // we keep mAllTypes as 0, which means no more connections. + + if (nullptr != mSrcObjPtr) { + // this is critical, changing mAllTypes of the original obj + mSrcObjPtr->mAllTypes = mAllTypes; + } + return *this; + } inline void dump(void) override { - LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); + LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x", + mAllTypes, mConnected, mType); } }; @@ -783,13 +806,9 @@ private: // Data members static pthread_mutex_t mMutexSystemStatus; SystemStatusReports mCache; - bool mConnected; - - template - bool setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s); template - bool setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); + bool setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s); // set default dataitem derived item in report cache template diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index fd744088..065366d3 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -221,9 +221,23 @@ protected: class NetworkInfoDataItemBase : public IDataItemCore { public: + enum NetworkType { + TYPE_MOBILE, + TYPE_WIFI, + TYPE_ETHERNET, + TYPE_BLUETOOTH, + TYPE_MMS, + TYPE_SUPL, + TYPE_DUN, + TYPE_HIPRI, + TYPE_WIMAX, + TYPE_UNKNOWN, + }; NetworkInfoDataItemBase( - int32_t type, string typeName, string subTypeName, + NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming ): + mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? + 0 : (1<& dlist) { NetworkInfoDataItemBase* networkInfo = static_cast(each); - mXtraSysStatObj->updateConnectionStatus(networkInfo->mConnected, - networkInfo->mType); + mXtraSysStatObj->updateConnections(networkInfo->getAllTypes()); } break; diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 31d80834..af0789b6 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -33,22 +33,20 @@ #include #include #include -#include using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; using loc_util::LocIpc; -using CONNECTIONS = set; class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), - mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { + mGpsLock(-1), mConnections(0), mXtraThrottle(true), mReqStatusReceived(false), + mDelayLocTimer(*this), mIsConnectivityStatusKnown (false) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); @@ -63,7 +61,7 @@ public : virtual void notify(const list& dlist); bool updateLockStatus(uint32_t lock); - bool updateConnectionStatus(bool connected, int32_t type); + bool updateConnections(uint64_t allConnections); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); bool updateXtraThrottle(const bool enabled); @@ -77,7 +75,7 @@ private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; int32_t mGpsLock; - CONNECTIONS mConnections; + uint64_t mConnections; string mTac; string mMccmnc; bool mXtraThrottle; From 533f43e690fd5faef877ba572ef4702f74a18c7b Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 9 Apr 2018 14:32:28 -0700 Subject: [PATCH 667/945] Fixed a number of issues with NetworkInfoDataItemBase There are a couple of issues. NetworkInfoDataItemBase objects might be from OsAgent or GnssLocationProvider. The two sources actually have mTypes defined differently. In addtion, when there are different types of connections such as wifi / mobile, getting connected / disconnected independently, clients need to be all notified correctly. Right now, if mConnected hasn't changed, no updates are send. For exmple, if mobile is connected, later wifi gets connected too, clients won't know. SystemStatus is also updated to get updated / colated informtion. In the above example, SystemStatus's top record would record as both mobile and wifi are connected. Change-Id: I1825902247fe1d4e6363f5e24a75be7e984d0dc4 CRs-Fixed: 2221114 --- core/SystemStatus.cpp | 113 +++++++++----------- core/SystemStatus.h | 43 +++++--- core/data-items/DataItemConcreteTypesBase.h | 32 +++--- gnss/XtraSystemStatusObserver.cpp | 26 +---- gnss/XtraSystemStatusObserver.h | 10 +- 5 files changed, 107 insertions(+), 117 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index e12d9f32..5d5c4b08 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1250,8 +1250,7 @@ IOsObserver* SystemStatus::getOsObserver() } SystemStatus::SystemStatus(const MsgTask* msgTask) : - mSysStatusObsvr(this, msgTask), - mConnected(false) + mSysStatusObsvr(this, msgTask) { int result = 0; ENTRY_LOG (); @@ -1301,17 +1300,10 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) : /****************************************************************************** SystemStatus - storing dataitems ******************************************************************************/ -template -bool SystemStatus::setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s) -{ - TYPE_SYSTEMSTATUS_ITEM sout(s); - return setIteminReport(report, sout); -} - template -bool SystemStatus::setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s) +bool SystemStatus::setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s) { - if (!report.empty() && report.back().equals(s)) { + if (!report.empty() && report.back().equals(static_cast(s.collate(report.back())))) { // there is no change - just update reported timestamp report.back().mUtcReported = s.mUtcReported; return false; @@ -1449,94 +1441,92 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) switch(dataitem->getId()) { case AIRPLANEMODE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAirplaneMode, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAirplaneMode, + SystemStatusAirplaneMode(*(static_cast(dataitem)))); break; case ENH_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mENH, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mENH, + SystemStatusENH(*(static_cast(dataitem)))); break; case GPSSTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mGPSState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mGPSState, + SystemStatusGpsState(*(static_cast(dataitem)))); break; case NLPSTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNLPStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNLPStatus, + SystemStatusNLPStatus(*(static_cast(dataitem)))); break; case WIFIHARDWARESTATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mWifiHardwareState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiHardwareState, + SystemStatusWifiHardwareState(*(static_cast(dataitem)))); break; case NETWORKINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mNetworkInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mNetworkInfo, + SystemStatusNetworkInfo(*(static_cast(dataitem)))); break; case RILSERVICEINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilServiceInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilServiceInfo, + SystemStatusServiceInfo(*(static_cast(dataitem)))); break; case RILCELLINFO_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mRilCellInfo, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mRilCellInfo, + SystemStatusRilCellInfo(*(static_cast(dataitem)))); break; case SERVICESTATUS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mServiceStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mServiceStatus, + SystemStatusServiceStatus(*(static_cast(dataitem)))); break; case MODEL_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mModel, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mModel, + SystemStatusModel(*(static_cast(dataitem)))); break; case MANUFACTURER_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mManufacturer, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mManufacturer, + SystemStatusManufacturer(*(static_cast(dataitem)))); break; case ASSISTED_GPS_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mAssistedGps, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mAssistedGps, + SystemStatusAssistedGps(*(static_cast(dataitem)))); break; case SCREEN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mScreenState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mScreenState, + SystemStatusScreenState(*(static_cast(dataitem)))); break; case POWER_CONNECTED_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mPowerConnectState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mPowerConnectState, + SystemStatusPowerConnectState(*(static_cast(dataitem)))); break; case TIMEZONE_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeZoneChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeZoneChange, + SystemStatusTimeZoneChange(*(static_cast(dataitem)))); break; case TIME_CHANGE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTimeChange, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTimeChange, + SystemStatusTimeChange(*(static_cast(dataitem)))); break; case WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mWifiSupplicantStatus, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mWifiSupplicantStatus, + SystemStatusWifiSupplicantStatus(*(static_cast(dataitem)))); break; case SHUTDOWN_STATE_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mShutdownState, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mShutdownState, + SystemStatusShutdownState(*(static_cast(dataitem)))); break; case TAC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mTac, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mTac, + SystemStatusTac(*(static_cast(dataitem)))); break; case MCCMNC_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mMccMnc, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mMccMnc, + SystemStatusMccMnc(*(static_cast(dataitem)))); break; case BTLE_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport(mCache.mBtDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtDeviceScanDetail, + SystemStatusBtDeviceScanDetail(*(static_cast(dataitem)))); break; case BT_SCAN_DATA_ITEM_ID: - ret = setItemBaseinReport( - mCache.mBtLeDeviceScanDetail, - *(static_cast(dataitem))); + ret = setIteminReport(mCache.mBtLeDeviceScanDetail, + SystemStatusBtleDeviceScanDetail(*(static_cast(dataitem)))); break; default: break; @@ -1689,13 +1679,10 @@ bool SystemStatus::setDefaultGnssEngineStates(void) ******************************************************************************/ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { - if (connected != mConnected) { - mConnected = connected; + // send networkinof dataitem to systemstatus observer clients + SystemStatusNetworkInfo s(type, "", "", false, connected, false); + mSysStatusObsvr.notify({&s}); - // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", false, connected, false); - mSysStatusObsvr.notify({&s}); - } return true; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 9500264d..1c3adc84 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -77,8 +77,11 @@ public: mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; - virtual ~SystemStatusItemBase() { }; - virtual void dump(void) { }; + virtual ~SystemStatusItemBase() {}; + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase&) { + return *this; + } + virtual void dump(void) {}; }; class SystemStatusLocation : public SystemStatusItemBase @@ -93,7 +96,7 @@ public: const GpsLocationExtended& locationEx) : mValid(true), mLocation(location), - mLocationEx(locationEx) { } + mLocationEx(locationEx) {} bool equals(const SystemStatusLocation& peer); void dump(void); }; @@ -457,6 +460,7 @@ public: class SystemStatusNetworkInfo : public SystemStatusItemBase, public NetworkInfoDataItemBase { + NetworkInfoDataItemBase* mSrcObjPtr; public: inline SystemStatusNetworkInfo( int32_t type=0, @@ -466,18 +470,21 @@ public: bool connected=false, bool roaming=false) : NetworkInfoDataItemBase( + (NetworkType)type, type, typeName, subTypeName, available, connected, - roaming) {} + roaming), + mSrcObjPtr(nullptr) {} inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) : - NetworkInfoDataItemBase(itemBase) { + NetworkInfoDataItemBase(itemBase), + mSrcObjPtr((NetworkInfoDataItemBase*)&itemBase) { mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - if ((mType == peer.mType) && + if ((mAllTypes == peer.mAllTypes) && (mTypeName == peer.mTypeName) && (mSubTypeName == peer.mSubTypeName) && (mAvailable == peer.mAvailable) && @@ -487,8 +494,24 @@ public: } return false; } + inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { + uint64_t allTypes = (static_cast(curInfo)).mAllTypes; + if (mConnected) { + mAllTypes |= allTypes; + } else if (0 != mAllTypes) { + mAllTypes = (allTypes & (~mAllTypes)); + } // else (mConnected == false && mAllTypes == 0) + // we keep mAllTypes as 0, which means no more connections. + + if (nullptr != mSrcObjPtr) { + // this is critical, changing mAllTypes of the original obj + mSrcObjPtr->mAllTypes = mAllTypes; + } + return *this; + } inline void dump(void) override { - LOC_LOGD("NetworkInfo: type=%u connected=%u", mType, mConnected); + LOC_LOGD("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x", + mAllTypes, mConnected, mType); } }; @@ -783,13 +806,9 @@ private: // Data members static pthread_mutex_t mMutexSystemStatus; SystemStatusReports mCache; - bool mConnected; - - template - bool setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s); template - bool setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s); + bool setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s); // set default dataitem derived item in report cache template diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index fd744088..065366d3 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -221,9 +221,23 @@ protected: class NetworkInfoDataItemBase : public IDataItemCore { public: + enum NetworkType { + TYPE_MOBILE, + TYPE_WIFI, + TYPE_ETHERNET, + TYPE_BLUETOOTH, + TYPE_MMS, + TYPE_SUPL, + TYPE_DUN, + TYPE_HIPRI, + TYPE_WIMAX, + TYPE_UNKNOWN, + }; NetworkInfoDataItemBase( - int32_t type, string typeName, string subTypeName, + NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming ): + mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? + 0 : (1<& dlist) { NetworkInfoDataItemBase* networkInfo = static_cast(each); - mXtraSysStatObj->updateConnectionStatus(networkInfo->mConnected, - networkInfo->mType); + mXtraSysStatObj->updateConnections(networkInfo->getAllTypes()); } break; diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 31d80834..af0789b6 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -33,22 +33,20 @@ #include #include #include -#include using namespace std; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; using loc_util::LocIpc; -using CONNECTIONS = set; class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mXtraThrottle(true), mReqStatusReceived(false), - mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { + mGpsLock(-1), mConnections(0), mXtraThrottle(true), mReqStatusReceived(false), + mDelayLocTimer(*this), mIsConnectivityStatusKnown (false) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); @@ -63,7 +61,7 @@ public : virtual void notify(const list& dlist); bool updateLockStatus(uint32_t lock); - bool updateConnectionStatus(bool connected, int32_t type); + bool updateConnections(uint64_t allConnections); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); bool updateXtraThrottle(const bool enabled); @@ -77,7 +75,7 @@ private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; int32_t mGpsLock; - CONNECTIONS mConnections; + uint64_t mConnections; string mTac; string mMccmnc; bool mXtraThrottle; From 8bda43ca51ab1946022e9896b0f030ad7cb7d786 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 23 Mar 2018 10:32:51 -0700 Subject: [PATCH 668/945] fix: LocIpc client app unable to exit LocIpc client apps such as garden app is unable to delete LocIpc object since its socket listening thread cannot be closed while it is waiting for data and cannot be closed. Fixed to close it by sending an abort message. CRs-Fixed: 2213212 Change-Id: I95f26862e9faf7bd75a2f447421ba4ab7220576e --- utils/LocIpc.cpp | 37 ++++++++++++++++++++++++------------- utils/LocIpc.h | 3 +-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 26a20765..675664a5 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -28,19 +28,9 @@ */ #include -#include -#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include "gps_extended_c.h" #include "LocIpc.h" namespace loc_util { @@ -52,8 +42,10 @@ namespace loc_util { #define LOC_MSG_BUF_LEN 8192 #define LOC_MSG_HEAD "$MSGLEN$" +#define LOC_MSG_ABORT "LocIpcMsg::ABORT" class LocIpcRunnable : public LocRunnable { +friend LocIpc; public: LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) : mLocIpc(locIpc), mIpcName(ipcName) {} @@ -70,10 +62,10 @@ private: }; bool LocIpc::startListeningNonBlocking(const std::string& name) { - mRunnable.reset(new LocIpcRunnable(*this, name)); + mRunnable = new LocIpcRunnable(*this, name); std::string threadName("LocIpc-"); threadName.append(name); - return mThread.start(threadName.c_str(), mRunnable.get()); + return mThread.start(threadName.c_str(), mRunnable); } bool LocIpc::startListeningBlocking(const std::string& name) { @@ -107,6 +99,7 @@ bool LocIpc::startListeningBlocking(const std::string& name) { ssize_t nBytes = 0; std::string msg = ""; + std::string abort = LOC_MSG_ABORT; while (1) { msg.resize(LOC_MSG_BUF_LEN); nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); @@ -116,6 +109,11 @@ bool LocIpc::startListeningBlocking(const std::string& name) { continue; } + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + break; + } + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { // short message msg.resize(nBytes); @@ -142,7 +140,6 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (mStopRequested) { mStopRequested = false; return true; - } else { LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); (void)::close(mIpcFd); @@ -152,14 +149,28 @@ bool LocIpc::startListeningBlocking(const std::string& name) { } void LocIpc::stopListening() { + + const char *socketName = nullptr; mStopRequested = true; + if (mRunnable) { + std::string abort = LOC_MSG_ABORT; + socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); + send(socketName, abort); + mRunnable = nullptr; + } + if (mIpcFd >= 0) { if (::close(mIpcFd)) { LOC_LOGe("cannot close socket:%s", strerror(errno)); } mIpcFd = -1; } + + //delete from the file system at the end + if (socketName) { + unlink(socketName); + } } bool LocIpc::send(const char name[], const std::string& data) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 0c37a7ad..a1a994d1 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -96,7 +95,7 @@ private: int mIpcFd; bool mStopRequested; LocThread mThread; - std::unique_ptr mRunnable; + LocRunnable *mRunnable; }; class LocIpcSender { From 2683aef90a0f2a2dd88020417a94b406d461a204 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 23 Mar 2018 10:32:51 -0700 Subject: [PATCH 669/945] fix: LocIpc client app unable to exit LocIpc client apps such as garden app is unable to delete LocIpc object since its socket listening thread cannot be closed while it is waiting for data and cannot be closed. Fixed to close it by sending an abort message. CRs-Fixed: 2213212 Change-Id: I95f26862e9faf7bd75a2f447421ba4ab7220576e --- utils/LocIpc.cpp | 37 ++++++++++++++++++++++++------------- utils/LocIpc.h | 3 +-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 26a20765..675664a5 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -28,19 +28,9 @@ */ #include -#include -#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include "gps_extended_c.h" #include "LocIpc.h" namespace loc_util { @@ -52,8 +42,10 @@ namespace loc_util { #define LOC_MSG_BUF_LEN 8192 #define LOC_MSG_HEAD "$MSGLEN$" +#define LOC_MSG_ABORT "LocIpcMsg::ABORT" class LocIpcRunnable : public LocRunnable { +friend LocIpc; public: LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) : mLocIpc(locIpc), mIpcName(ipcName) {} @@ -70,10 +62,10 @@ private: }; bool LocIpc::startListeningNonBlocking(const std::string& name) { - mRunnable.reset(new LocIpcRunnable(*this, name)); + mRunnable = new LocIpcRunnable(*this, name); std::string threadName("LocIpc-"); threadName.append(name); - return mThread.start(threadName.c_str(), mRunnable.get()); + return mThread.start(threadName.c_str(), mRunnable); } bool LocIpc::startListeningBlocking(const std::string& name) { @@ -107,6 +99,7 @@ bool LocIpc::startListeningBlocking(const std::string& name) { ssize_t nBytes = 0; std::string msg = ""; + std::string abort = LOC_MSG_ABORT; while (1) { msg.resize(LOC_MSG_BUF_LEN); nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); @@ -116,6 +109,11 @@ bool LocIpc::startListeningBlocking(const std::string& name) { continue; } + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + break; + } + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { // short message msg.resize(nBytes); @@ -142,7 +140,6 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (mStopRequested) { mStopRequested = false; return true; - } else { LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); (void)::close(mIpcFd); @@ -152,14 +149,28 @@ bool LocIpc::startListeningBlocking(const std::string& name) { } void LocIpc::stopListening() { + + const char *socketName = nullptr; mStopRequested = true; + if (mRunnable) { + std::string abort = LOC_MSG_ABORT; + socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); + send(socketName, abort); + mRunnable = nullptr; + } + if (mIpcFd >= 0) { if (::close(mIpcFd)) { LOC_LOGe("cannot close socket:%s", strerror(errno)); } mIpcFd = -1; } + + //delete from the file system at the end + if (socketName) { + unlink(socketName); + } } bool LocIpc::send(const char name[], const std::string& data) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 8598a327..364093bd 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -96,7 +95,7 @@ private: int mIpcFd; bool mStopRequested; LocThread mThread; - std::unique_ptr mRunnable; + LocRunnable *mRunnable; }; class LocIpcSender { From 5c25b329da9cf8c6d15bc0f5c0219e9accbf5f46 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 20 Mar 2018 15:50:53 -0700 Subject: [PATCH 670/945] fix: add LOC_LOGi macro in log utility Add LOC_LOGi macro in log utility Change-Id: Ib30ce891496d61c10075cac028a80df2a6013a2a CRs-Fixed: 2209625 --- utils/log_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/log_util.h b/utils/log_util.h index 460d6e7e..feb4d3cb 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -141,6 +141,7 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #define LOC_LOG_HEAD(fmt) "%s:%d] " fmt #define LOC_LOGv(fmt,...) LOC_LOGV(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGw(fmt,...) LOC_LOGW(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOC_LOGi(fmt,...) LOC_LOGI(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGd(fmt,...) LOC_LOGD(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) #define LOC_LOGe(fmt,...) LOC_LOGE(LOC_LOG_HEAD(fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) From 1f5fa2def4559d6fd10ca8052798296c291272be Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 3 Apr 2018 16:37:47 -0700 Subject: [PATCH 671/945] fix: Creating LocationAPI object rejected LocationAPI::createInstance() to accept if any one of gnssNiCb, trackingCb, gnssLocationCb or gnssMeasurementsCb is set. Change-Id: I3d026cd608aca2b9e0ee93617e10dc0b32e37849 CRs-Fixed: 2218707 --- location/LocationAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 0111a9c0..e43d9e03 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -62,6 +62,7 @@ static bool isGnssClient(LocationCallbacks& locationCallbacks) { return (locationCallbacks.gnssNiCb != nullptr || locationCallbacks.trackingCb != nullptr || + locationCallbacks.gnssLocationInfoCb != nullptr || locationCallbacks.gnssMeasurementsCb != nullptr); } From 9a8c42c3cb5beebe6e5259cccc12b4b6de1c4010 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 3 Apr 2018 16:37:47 -0700 Subject: [PATCH 672/945] fix: Creating LocationAPI object rejected LocationAPI::createInstance() to accept if any one of gnssNiCb, trackingCb, gnssLocationCb or gnssMeasurementsCb is set. Change-Id: I3d026cd608aca2b9e0ee93617e10dc0b32e37849 CRs-Fixed: 2218707 --- location/LocationAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 0111a9c0..e43d9e03 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -62,6 +62,7 @@ static bool isGnssClient(LocationCallbacks& locationCallbacks) { return (locationCallbacks.gnssNiCb != nullptr || locationCallbacks.trackingCb != nullptr || + locationCallbacks.gnssLocationInfoCb != nullptr || locationCallbacks.gnssMeasurementsCb != nullptr); } From e9c3f04f8628883091ca0912dd50b80fb9560316 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Mon, 21 May 2018 19:55:18 +0800 Subject: [PATCH 673/945] Replace MONOTONIC clock with BOOTTIME clock MONOTONIC clock doesn't tick when device is in suspend mode. BOOTTIME clock handles suspend mode while. Change-Id: I14ce943ddfd409fcc5cb70acde0cd4f5c94d1058 CRs-Fixed: 2241735 --- core/SystemStatus.h | 6 +++--- gnss/GnssAdapter.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 1c3adc84..ff5e7548 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -71,10 +71,10 @@ public: static const uint32_t maxItem = 5; SystemStatusItemBase() { - struct timespec tv; - clock_gettime(CLOCK_MONOTONIC, &tv); + timeval tv; + gettimeofday(&tv, NULL); mUtcTime.tv_sec = tv.tv_sec; - mUtcTime.tv_nsec = tv.tv_nsec; + mUtcTime.tv_nsec = tv.tv_usec *1000ULL; mUtcReported = mUtcTime; }; virtual ~SystemStatusItemBase() {}; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d08bd447..9ab1fd6a 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -86,7 +86,7 @@ GnssAdapter::GnssAdapter() : pthread_condattr_t condAttr; pthread_condattr_init(&condAttr); - pthread_condattr_setclock(&condAttr, CLOCK_MONOTONIC); + pthread_condattr_setclock(&condAttr, CLOCK_BOOTTIME); pthread_cond_init(&mNiData.session.tCond, &condAttr); pthread_cond_init(&mNiData.sessionEs.tCond, &condAttr); pthread_condattr_destroy(&condAttr); @@ -2343,7 +2343,7 @@ static void* niThreadProc(void *args) pthread_mutex_lock(&pSession->tLock); /* Calculate absolute expire time */ - clock_gettime(CLOCK_MONOTONIC, &present_time); + clock_gettime(CLOCK_BOOTTIME, &present_time); expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; expire_time.tv_nsec = present_time.tv_nsec; LOC_LOGD("%s]: time out set for abs time %ld with delay %d sec", From d462c0add34dacbdfe3e5e90c5aaeea7e5dc6952 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 18 May 2018 00:05:32 +0530 Subject: [PATCH 674/945] FR 46082 - SUPL Network Setup Improvements Adding enhancement to ATL messages to allow sending bearer type and apn type mask values. CRs-Fixed: 2209227 Change-Id: I09a294946610f26de4760a0fba6f13083f8752f3 --- core/LocAdapterBase.cpp | 4 ++-- core/LocAdapterBase.h | 4 ++-- core/LocApiBase.cpp | 10 +++++----- core/LocApiBase.h | 6 +++--- gnss/Agps.cpp | 24 +++++++++++++----------- gnss/Agps.h | 25 +++++++++++++++---------- gnss/GnssAdapter.cpp | 13 +++++++------ gnss/GnssAdapter.h | 4 ++-- utils/gps_extended_c.h | 12 ++++++++++++ 9 files changed, 61 insertions(+), 41 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5531fa2d..c11b93d8 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -130,7 +130,7 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/) + requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/, LocApnTypeMask /*mask*/) DEFAULT_IMPL(false) bool LocAdapterBase:: @@ -138,7 +138,7 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestSuplES(int /*connHandle*/) + requestSuplES(int /*connHandle*/, LocApnTypeMask /*mask*/) DEFAULT_IMPL(false) bool LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 64537fea..263855a7 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -144,9 +144,9 @@ public: virtual bool requestXtraData(); virtual bool requestTime(); virtual bool requestLocation(); - virtual bool requestATL(int connHandle, LocAGpsType agps_type); + virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); virtual bool releaseATL(int connHandle); - virtual bool requestSuplES(int connHandle); + virtual bool requestSuplES(int connHandle, LocApnTypeMask mask); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 5ec3ce62..45a0ec48 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -374,10 +374,10 @@ void LocApiBase::requestLocation() TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); } -void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type) +void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask) { // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type)); + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type, mask)); } void LocApiBase::releaseATL(int connHandle) @@ -386,10 +386,10 @@ void LocApiBase::releaseATL(int connHandle) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); } -void LocApiBase::requestSuplES(int connHandle) +void LocApiBase::requestSuplES(int connHandle, LocApnTypeMask mask) { // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle)); + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle, mask)); } void LocApiBase::reportDataCallOpened() @@ -455,7 +455,7 @@ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) void LocApiBase:: atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/, - AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/) + AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/, LocApnTypeMask /*mask*/) DEFAULT_IMPL() void LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f0b1f592..f9fdf4d6 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -147,9 +147,9 @@ public: void requestXtraData(); void requestTime(); void requestLocation(); - void requestATL(int connHandle, LocAGpsType agps_type); + void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); void releaseATL(int connHandle); - void requestSuplES(int connHandle); + void requestSuplES(int connHandle, LocApnTypeMask mask); void reportDataCallOpened(); void reportDataCallClosed(); void requestNiNotify(GnssNiNotification ¬ify, const void* data); @@ -181,7 +181,7 @@ public: virtual void atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, - AGpsBearerType bear, LocAGpsType agpsType); + AGpsBearerType bear, LocAGpsType agpsType, LocApnTypeMask mask); virtual void atlCloseStatus(int handle, int is_succ); virtual void diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index d6a75aba..6fe306e8 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -26,13 +26,14 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_Agps" #include #include #include #include +#include /* -------------------------------------------------------------------- * AGPS State Machine Methods @@ -361,13 +362,13 @@ void AgpsStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(), - getBearer(), mAgpsType); + getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL); break; case AGPS_EVENT_DENIED: mAgpsManager->mAtlOpenStatusCb( subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(), - getBearer(), mAgpsType); + getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL); break; case AGPS_EVENT_UNSUBSCRIBE: @@ -572,7 +573,7 @@ void DSStateMachine :: retryCallback() mAgpsManager->mSendMsgToAdapterQueueFn( new AgpsMsgRequestATL( mAgpsManager, subscriber->mConnHandle, - LOC_AGPS_TYPE_SUPL_ES)); + LOC_AGPS_TYPE_SUPL_ES, subscriber->mApnTypeMask)); } /* Overridden method @@ -662,7 +663,8 @@ void DSStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( subscriberToNotify->mConnHandle, 1, NULL, 0, - AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES); + AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES, + LOC_APN_TYPE_MASK_EMERGENCY); break; case AGPS_EVENT_DENIED: @@ -672,7 +674,7 @@ void DSStateMachine::notifyEventToSubscriber( mAgpsManager->mSendMsgToAdapterQueueFn( new AgpsMsgRequestATL( mAgpsManager, subscriberToNotify->mConnHandle, - LOC_AGPS_TYPE_SUPL)); + LOC_AGPS_TYPE_SUPL, subscriberToNotify->mApnTypeMask)); break; case AGPS_EVENT_UNSUBSCRIBE: @@ -767,10 +769,10 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { return NULL; } -void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ +void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask){ - LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d", - connHandle, agpsType); + LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d apnTypeMask %" PRIu64, + connHandle, agpsType, mask); AgpsStateMachine* sm = getAgpsStateMachine(agpsType); @@ -778,12 +780,12 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); mAtlOpenStatusCb( - connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType); + connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType, mask); return; } /* Invoke AGPS SM processing */ - AgpsSubscriber subscriber(connHandle, false, false); + AgpsSubscriber subscriber(connHandle, false, false, mask); sm->setCurrentSubscriber(&subscriber); /* If DS State Machine, wait for close complete */ diff --git a/gnss/Agps.h b/gnss/Agps.h index f9a54f84..e388cfe5 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -41,9 +41,10 @@ * Passed in by Adapter to AgpsManager */ typedef std::function AgpsAtlOpenStatusCb; + AGpsBearerType bearerType, AGpsExtType agpsType, + LocApnTypeMask mask)> AgpsAtlOpenStatusCb; -typedef std::function AgpsAtlCloseStatusCb; +typedef std::function AgpsAtlCloseStatusCb; /* DS Client control APIs * Passed in by Adapter to AgpsManager */ @@ -109,12 +110,15 @@ public: * inactive state. */ bool mWaitForCloseComplete; bool mIsInactive; + LocApnTypeMask mApnTypeMask; inline AgpsSubscriber( - int connHandle, bool waitForCloseComplete, bool isInactive) : + int connHandle, bool waitForCloseComplete, bool isInactive, + LocApnTypeMask apnTypeMask) : mConnHandle(connHandle), mWaitForCloseComplete(waitForCloseComplete), - mIsInactive(isInactive) {} + mIsInactive(isInactive), + mApnTypeMask(apnTypeMask) {} inline virtual ~AgpsSubscriber() {} inline virtual bool equals(const AgpsSubscriber *s) const @@ -122,7 +126,7 @@ public: inline virtual AgpsSubscriber* clone() { return new AgpsSubscriber( - mConnHandle, mWaitForCloseComplete, mIsInactive); } + mConnHandle, mWaitForCloseComplete, mIsInactive, mApnTypeMask); } }; /* AGPS STATE MACHINE */ @@ -306,7 +310,7 @@ public: void createAgpsStateMachines(); /* Process incoming ATL requests */ - void requestATL(int connHandle, AGpsExtType agpsType); + void requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask); void releaseATL(int connHandle); /* Process incoming DS Client data call events */ @@ -354,11 +358,12 @@ struct AgpsMsgRequestATL: public LocMsg { AgpsManager* mAgpsManager; int mConnHandle; AGpsExtType mAgpsType; + LocApnTypeMask mApnTypeMask; inline AgpsMsgRequestATL(AgpsManager* agpsManager, int connHandle, - AGpsExtType agpsType) : - LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle), mAgpsType( - agpsType) { + AGpsExtType agpsType, LocApnTypeMask mask) : + LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle), + mAgpsType(agpsType), mApnTypeMask(mask) { LOC_LOGV("AgpsMsgRequestATL"); } @@ -366,7 +371,7 @@ struct AgpsMsgRequestATL: public LocMsg { inline virtual void proc() const { LOC_LOGV("AgpsMsgRequestATL::proc()"); - mAgpsManager->requestATL(mConnHandle, mAgpsType); + mAgpsManager->requestATL(mConnHandle, mAgpsType, mApnTypeMask); } }; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 263a6338..ab2dac56 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -26,6 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_GnssAdapter" #include @@ -93,10 +94,10 @@ GnssAdapter::GnssAdapter() : /* Set ATL open/close callbacks */ AgpsAtlOpenStatusCb atlOpenStatusCb = [this](int handle, int isSuccess, char* apn, uint32_t apnLen, - AGpsBearerType bearerType, AGpsExtType agpsType) { + AGpsBearerType bearerType, AGpsExtType agpsType, LocApnTypeMask mask) { mLocApi->atlOpenStatus( - handle, isSuccess, apn, apnLen, bearerType, agpsType); + handle, isSuccess, apn, apnLen, bearerType, agpsType, mask); }; AgpsAtlCloseStatusCb atlCloseStatusCb = [this](int handle, int isSuccess) { @@ -2870,12 +2871,12 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ * Triggers the AGPS state machine to setup AGPS call for below WWAN types: * eQMI_LOC_WWAN_TYPE_INTERNET_V02 * eQMI_LOC_WWAN_TYPE_AGNSS_V02 */ -bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType){ +bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType, LocApnTypeMask mask){ LOC_LOGI("GnssAdapter::requestATL"); sendMsg( new AgpsMsgRequestATL( - &mAgpsManager, connHandle, (AGpsExtType)agpsType)); + &mAgpsManager, connHandle, (AGpsExtType)agpsType, mask)); return true; } @@ -2885,12 +2886,12 @@ bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType){ * eQMI_LOC_SERVER_REQUEST_OPEN_V02 * Triggers the AGPS state machine to setup AGPS call for below WWAN types: * eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 */ -bool GnssAdapter::requestSuplES(int connHandle){ +bool GnssAdapter::requestSuplES(int connHandle, LocApnTypeMask mask){ LOC_LOGI("GnssAdapter::requestSuplES"); sendMsg( new AgpsMsgRequestATL( - &mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES)); + &mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES, mask)); return true; } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 80d67618..c9491f06 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -252,9 +252,9 @@ public: virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); - virtual bool requestATL(int connHandle, LocAGpsType agps_type); + virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); virtual bool releaseATL(int connHandle); - virtual bool requestSuplES(int connHandle); + virtual bool requestSuplES(int connHandle, LocApnTypeMask mask); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 21eb5d55..60286683 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -158,6 +158,18 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 2 #define AGPS_APN_BEARER_IPV4V6 3 +typedef uint64_t LocApnTypeMask; +#define LOC_APN_TYPE_MASK_DEFAULT ((LocApnTypeMask)0x0000000000000001ull) /**< Denotes APN type for Default/Internet traffic */ +#define LOC_APN_TYPE_MASK_IMS ((LocApnTypeMask)0x0000000000000002ull) /**< Denotes APN type for IP Multimedia Subsystem */ +#define LOC_APN_TYPE_MASK_MMS ((LocApnTypeMask)0x0000000000000004ull) /**< Denotes APN type for Multimedia Messaging Service */ +#define LOC_APN_TYPE_MASK_DUN ((LocApnTypeMask)0x0000000000000008ull) /**< Denotes APN type for Dial Up Network */ +#define LOC_APN_TYPE_MASK_SUPL ((LocApnTypeMask)0x0000000000000010ull) /**< Denotes APN type for Secure User Plane Location */ +#define LOC_APN_TYPE_MASK_HIPRI ((LocApnTypeMask)0x0000000000000020ull) /**< Denotes APN type for High Priority Mobile Data */ +#define LOC_APN_TYPE_MASK_FOTA ((LocApnTypeMask)0x0000000000000040ull) /**< Denotes APN type for over the air administration */ +#define LOC_APN_TYPE_MASK_CBS ((LocApnTypeMask)0x0000000000000080ull) /**< Denotes APN type for Carrier Branded Services */ +#define LOC_APN_TYPE_MASK_IA ((LocApnTypeMask)0x0000000000000100ull) /**< Denotes APN type for Initial Attach */ +#define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x0000000000000200ull) /**< Denotes APN type for emergency */ + typedef enum { AGPS_CB_PRIORITY_LOW = 1, AGPS_CB_PRIORITY_MED = 2, From 21308b61a8cacd8b3a9129f4431796aa78934b06 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 27 Apr 2018 13:38:36 -0700 Subject: [PATCH 675/945] GNSS adapter: Do not send SPE NMEA to engine hub Engine service does not need SPE NMEA report. Change-Id: I809fa2857eec8292269b640928a44d8cc54308ed CRs-fixed: 2232811 --- core/EngineHubProxyBase.h | 5 ----- gnss/GnssAdapter.cpp | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 4e259ba7..5282350f 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -81,11 +81,6 @@ public: (void) svPolynomial; return false; } - - inline virtual bool gnssReportNmea(const char* nmea) { - (void) nmea; - return false; - } }; typedef std::functiongnssReportNmea(nmea); if (mUlpProxy->reportNmea(nmea, length)) { return; } From a6177a4d144db112aa9e9afd963ca476a5630285 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Mon, 30 Apr 2018 12:22:18 +0530 Subject: [PATCH 676/945] Changed max size of line read of config. Change-Id: Ib1c7b11b03cdb8d788148091135313b438723670 CRs-Fixed: 2233260 --- utils/loc_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index c89d3038..e0e711ed 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -37,7 +37,7 @@ #include #define LOC_MAX_PARAM_NAME 80 -#define LOC_MAX_PARAM_STRING 80 +#define LOC_MAX_PARAM_STRING 170 #define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) #define LOC_FEATURE_MODE_DISABLED "DISABLED" From a93b10c6770079c9f23ca3484b56fa0136b25464 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 23 May 2018 16:51:48 -0700 Subject: [PATCH 677/945] Update location supported feature enum Update location supported feature enumeration to match MP (constellation enablement, agpm, xtra integrity) Change-Id: I8cad9d8e09ebed3d16a32f63172bc7b3619a8969 CRs-Fixed: 2118920 --- utils/gps_extended_c.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 60286683..bc6e384b 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -118,7 +118,10 @@ typedef enum { LOC_SUPPORTED_FEATURE_WIFI_AP_DATA_INJECT_2_V02, /**< Support Wifi AP data inject version 2 feature */ LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02, /**< Support debug NMEA feature */ LOC_SUPPORTED_FEATURE_GNSS_ONLY_POSITION_REPORT, /**< Support GNSS Only position reports */ - LOC_SUPPORTED_FEATURE_FDCL /**< Support FDCL */ + LOC_SUPPORTED_FEATURE_FDCL, /**< Support FDCL */ + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT, /**< Support constellation enablement */ + LOC_SUPPORTED_FEATURE_AGPM, /**< Support AGPM feature */ + LOC_SUPPORTED_FEATURE_XTRA_INTEGRITY /**< Support XTRA integrity */ } loc_supported_feature_enum; typedef struct { From eaf7e54b54a31c571560bf5fe869bb235a2aacaf Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sun, 20 May 2018 19:29:46 +0530 Subject: [PATCH 678/945] FR 45651 - GNSS SV/Constellation Control Adding support for configuring GNSS SVs and constellations to be used. Change-Id: I47d5cd9d08ac9aaf633be2fe3b1bd152a2f4293b CRs-Fixed: 2184871 --- android/Gnss.cpp | 4 + android/GnssConfiguration.cpp | 57 ++- android/GnssConfiguration.h | 3 + core/LocAdapterBase.cpp | 5 + core/LocAdapterBase.h | 2 + core/LocApiBase.cpp | 42 ++- core/LocApiBase.h | 9 + gnss/GnssAdapter.cpp | 538 +++++++++++++++++++++++++++++ gnss/GnssAdapter.h | 40 ++- gnss/location_gnss.cpp | 43 ++- location/LocationAPI.cpp | 15 + location/LocationAPI.h | 16 + location/LocationAPIClientBase.cpp | 89 +++-- location/LocationAPIClientBase.h | 28 +- location/LocationDataTypes.h | 74 +++- location/location_interface.h | 4 + utils/gps_extended_c.h | 30 +- 17 files changed, 956 insertions(+), 43 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 878cd202..d31a18bb 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -234,6 +234,10 @@ Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; mPendingConfig.suplModeMask = gnssConfig.suplModeMask; } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds; + } } return true; } diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index 9eeceac2..cee928ab 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -23,6 +23,7 @@ #include #include "Gnss.h" #include "GnssConfiguration.h" +#include namespace android { namespace hardware { @@ -30,6 +31,8 @@ namespace gnss { namespace V1_1 { namespace implementation { +using ::android::hardware::gnss::V1_0::GnssConstellationType; + GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { } @@ -222,10 +225,60 @@ Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. Return GnssConfiguration::setBlacklist( - const hidl_vec& /*blacklist*/) { + const hidl_vec& blacklist) { ENTRY_LOG_CALLFLOW(); - return true; + if (nullptr == mGnss) { + LOC_LOGe("mGnss is null"); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + config.blacklistedSvIds.clear(); + + GnssSvIdSource source = {}; + for (int idx = 0; idx < (int)blacklist.size(); idx++) { + setBlacklistedSource(source, blacklist[idx]); + config.blacklistedSvIds.push_back(source); + } + + return mGnss->updateConfiguration(config); +} + +void GnssConfiguration::setBlacklistedSource( + GnssSvIdSource& copyToSource, + const GnssConfiguration::BlacklistedSource& copyFromSource) { + + copyToSource.size = sizeof(GnssSvIdSource); + + switch(copyFromSource.constellation) { + case GnssConstellationType::GPS: + copyToSource.constellation = GNSS_SV_TYPE_GPS; + break; + case GnssConstellationType::SBAS: + copyToSource.constellation = GNSS_SV_TYPE_SBAS; + break; + case GnssConstellationType::GLONASS: + copyToSource.constellation = GNSS_SV_TYPE_GLONASS; + break; + case GnssConstellationType::QZSS: + copyToSource.constellation = GNSS_SV_TYPE_QZSS; + break; + case GnssConstellationType::BEIDOU: + copyToSource.constellation = GNSS_SV_TYPE_BEIDOU; + break; + case GnssConstellationType::GALILEO: + copyToSource.constellation = GNSS_SV_TYPE_GALILEO; + break; + default: + copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; + break; + } + + copyToSource.svId = copyFromSource.svid; } } // namespace implementation diff --git a/android/GnssConfiguration.h b/android/GnssConfiguration.h index f46f6071..15ee2906 100644 --- a/android/GnssConfiguration.h +++ b/android/GnssConfiguration.h @@ -64,6 +64,9 @@ struct GnssConfiguration : public IGnssConfiguration { private: Gnss* mGnss = nullptr; + void setBlacklistedSource( + GnssSvIdSource& copyToSource, + const GnssConfiguration::BlacklistedSource& copyFromSource); }; } // namespace implementation diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index c11b93d8..5f98456c 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -167,5 +167,10 @@ bool LocAdapterBase:: GpsLocationExtended& /*location_extended*/, LocPosTechMask /*tech_mask*/) DEFAULT_IMPL(false) +void LocAdapterBase::reportGnssSvIdConfigEvent(const GnssSvIdConfig& /*config*/) +DEFAULT_IMPL() + +void LocAdapterBase::reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& /*config*/) +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 263855a7..79cb25cb 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -157,6 +157,8 @@ public: virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, LocPosTechMask tech_mask); + virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); + virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 45a0ec48..9c547261 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2018 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 @@ -423,6 +423,28 @@ void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measure TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurements, msInWeek)); } +void LocApiBase::reportGnssSvIdConfig(const GnssSvIdConfig& config) +{ + // Print the config + LOC_LOGv("gloBlacklistSvMask: %" PRIu64 ", bdsBlacklistSvMask: %" PRIu64 ",\n" + "qzssBlacklistSvMask: %" PRIu64 ", galBlacklistSvMask: %" PRIu64, + config.gloBlacklistSvMask, config.bdsBlacklistSvMask, + config.qzssBlacklistSvMask, config.galBlacklistSvMask); + + // Loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssSvIdConfigEvent(config)); +} + +void LocApiBase::reportGnssSvTypeConfig(const GnssSvTypeConfig& config) +{ + // Print the config + LOC_LOGv("blacklistedMask: %" PRIu64 ", enabledMask: %" PRIu64, + config.blacklistedSvTypesMask, config.enabledSvTypesMask); + + // Loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssSvTypeConfigEvent(config)); +} + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -591,4 +613,22 @@ LocationError LocApiBase:: setXtraVersionCheckSync(uint32_t /*check*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +LocationError LocApiBase::setBlacklistSvSync(const GnssSvIdConfig& /*config*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::setBlacklistSv(const GnssSvIdConfig& /*config*/) +DEFAULT_IMPL() + +void LocApiBase::getBlacklistSv() +DEFAULT_IMPL() + +void LocApiBase::setConstellationControl(const GnssSvTypeConfig& /*config*/) +DEFAULT_IMPL() + +void LocApiBase::getConstellationControl() +DEFAULT_IMPL() + +void LocApiBase::resetConstellationControl() +DEFAULT_IMPL() + } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f9fdf4d6..17ccc4ef 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -157,6 +157,8 @@ public: void reportWwanZppFix(LocGpsLocation &zppLoc); void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, LocPosTechMask tech_mask); + void reportGnssSvIdConfig(const GnssSvIdConfig& config); + void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); // downward calls // All below functions are to be defined by adapter specific modules: @@ -260,6 +262,13 @@ public: virtual LocationError setXtraVersionCheckSync(uint32_t check); + /* Requests for SV/Constellation Control */ + virtual LocationError setBlacklistSvSync(const GnssSvIdConfig& config); + virtual void setBlacklistSv(const GnssSvIdConfig& config); + virtual void getBlacklistSv(); + virtual void setConstellationControl(const GnssSvTypeConfig& config); + virtual void getConstellationControl(); + virtual void resetConstellationControl(); }; typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ab2dac56..cedd27b6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -74,6 +74,9 @@ GnssAdapter::GnssAdapter() : mControlCallbacks(), mPowerVoteId(0), mNmeaMask(0), + mGnssSvIdConfig(), + mGnssSvTypeConfig(), + mGnssSvTypeConfigCb(nullptr), mNiData(), mAgpsManager(), mAgpsCbInfo(), @@ -1037,6 +1040,24 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } } } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + index++; + // Check if feature is supported + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature constellation enablement not supported."); + err = LOCATION_ERROR_NOT_SUPPORTED; + } else { + // Send the SV ID Config to Modem + err = adapter.gnssSvIdConfigUpdateSync(gnssConfigRequested.blacklistedSvIds); + if (LOCATION_ERROR_SUCCESS != err) { + LOC_LOGe("Failed to send config to modem, err %d", err); + } + } + if (index < countOfConfigs) { + errsList[index] = err; + } + } configCollectiveResponse->returnToSender(errsList); })); } @@ -1051,6 +1072,521 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) return ids; } +void +GnssAdapter::gnssSvIdConfigUpdate(const std::vector& blacklistedSvIds) +{ + // Clear the existing config + memset(&mGnssSvIdConfig, 0, sizeof(GnssSvIdConfig)); + + // Convert the sv id lists to masks + convertToGnssSvIdConfig(blacklistedSvIds, mGnssSvIdConfig); + + // Now send to Modem + gnssSvIdConfigUpdate(); +} + +void +GnssAdapter::gnssSvIdConfigUpdate() +{ + LOC_LOGd("blacklist bds 0x%" PRIx64 ", glo 0x%" PRIx64 + ", qzss 0x%" PRIx64 ", gal 0x%" PRIx64, + mGnssSvIdConfig.bdsBlacklistSvMask, mGnssSvIdConfig.gloBlacklistSvMask, + mGnssSvIdConfig.qzssBlacklistSvMask, mGnssSvIdConfig.galBlacklistSvMask); + + // Now set required blacklisted SVs + mLocApi->setBlacklistSv(mGnssSvIdConfig); +} + +LocationError +GnssAdapter::gnssSvIdConfigUpdateSync(const std::vector& blacklistedSvIds) +{ + // Clear the existing config + memset(&mGnssSvIdConfig, 0, sizeof(GnssSvIdConfig)); + + // Convert the sv id lists to masks + convertToGnssSvIdConfig(blacklistedSvIds, mGnssSvIdConfig); + + // Now send to Modem + return gnssSvIdConfigUpdateSync(); +} + +LocationError +GnssAdapter::gnssSvIdConfigUpdateSync() +{ + LOC_LOGd("blacklist bds 0x%" PRIx64 ", glo 0x%" PRIx64 + ", qzss 0x%" PRIx64 ", gal 0x%" PRIx64, + mGnssSvIdConfig.bdsBlacklistSvMask, mGnssSvIdConfig.gloBlacklistSvMask, + mGnssSvIdConfig.qzssBlacklistSvMask, mGnssSvIdConfig.galBlacklistSvMask); + + // Now set required blacklisted SVs + return mLocApi->setBlacklistSvSync(mGnssSvIdConfig); +} + +uint32_t* +GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { + + // count the number of bits set + GnssConfigFlagsMask flagsCopy = configMask; + size_t count = 0; + while (flagsCopy > 0) { + if (flagsCopy & 1) { + count++; + } + flagsCopy >>= 1; + } + std::string idsString = "["; + uint32_t* ids = NULL; + if (count > 0) { + ids = new uint32_t[count]; + if (nullptr == ids) { + LOC_LOGe("new allocation failed, fatal error."); + return nullptr; + } + for (size_t i=0; i < count; ++i) { + ids[i] = generateSessionId(); + IF_LOC_LOGD { + idsString += std::to_string(ids[i]) + " "; + } + } + } + idsString += "]"; + + LOC_LOGd("ids %s flags 0x%X", idsString.c_str(), configMask); + + struct MsgGnssGetConfig : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + GnssConfigFlagsMask mConfigMask; + uint32_t* mIds; + size_t mCount; + inline MsgGnssGetConfig(GnssAdapter& adapter, + LocApiBase& api, + GnssConfigFlagsMask configMask, + uint32_t* ids, + size_t count) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mConfigMask(configMask), + mIds(ids), + mCount(count) {} + inline virtual ~MsgGnssGetConfig() + { + delete[] mIds; + } + inline virtual void proc() const { + + LocationError* errs = new LocationError[mCount]; + LocationError err = LOCATION_ERROR_SUCCESS; + uint32_t index = 0; + + if (nullptr == errs) { + LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + return; + } + + if (mConfigMask & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + err = LOCATION_ERROR_NOT_SUPPORTED; + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } + if (mConfigMask & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + // Check if feature is supported + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature not supported."); + err = LOCATION_ERROR_NOT_SUPPORTED; + } else { + // Send request to Modem to fetch the config + mApi.getBlacklistSv(); + err = LOCATION_ERROR_SUCCESS; + } + if (index < mCount) { + errs[index++] = err; + } + } + + mAdapter.reportResponse(index, errs, mIds); + delete[] errs; + } + }; + + if (NULL != ids) { + sendMsg(new MsgGnssGetConfig(*this, *mLocApi, configMask, ids, count)); + } else { + LOC_LOGe("No GNSS config items to Get"); + } + + return ids; +} + +void +GnssAdapter::convertToGnssSvIdConfig( + const std::vector& blacklistedSvIds, GnssSvIdConfig& config) +{ + config.size = sizeof(GnssSvIdConfig); + + // Empty vector => Clear any previous blacklisted SVs + if (0 == blacklistedSvIds.size()) { + config.gloBlacklistSvMask = 0; + config.bdsBlacklistSvMask = 0; + config.qzssBlacklistSvMask = 0; + config.galBlacklistSvMask = 0; + } else { + // Parse the vector and convert SV IDs to mask values + for (GnssSvIdSource source : blacklistedSvIds) { + uint64_t* svMaskPtr = NULL; + GnssSvId initialSvId = 0; + switch(source.constellation) { + case GNSS_SV_TYPE_GLONASS: + svMaskPtr = &config.gloBlacklistSvMask; + initialSvId = GNSS_SV_CONFIG_GLO_INITIAL_SV_ID; + break; + case GNSS_SV_TYPE_BEIDOU: + svMaskPtr = &config.bdsBlacklistSvMask; + initialSvId = GNSS_SV_CONFIG_BDS_INITIAL_SV_ID; + break; + case GNSS_SV_TYPE_QZSS: + svMaskPtr = &config.qzssBlacklistSvMask; + initialSvId = GNSS_SV_CONFIG_QZSS_INITIAL_SV_ID; + break; + case GNSS_SV_TYPE_GALILEO: + svMaskPtr = &config.galBlacklistSvMask; + initialSvId = GNSS_SV_CONFIG_GAL_INITIAL_SV_ID; + break; + default: + break; + } + + if (NULL == svMaskPtr) { + LOC_LOGe("Invalid constellation %d", source.constellation); + } else { + // SV ID 0 = All SV IDs + if (0 == source.svId) { + *svMaskPtr = GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK; + } else if (source.svId < initialSvId || source.svId >= initialSvId + 64) { + LOC_LOGe("Invalid sv id %d for sv type %d", + source.svId, source.constellation); + } else { + *svMaskPtr |= (1 << (source.svId - initialSvId)); + } + } + } + } +} + +void GnssAdapter::convertFromGnssSvIdConfig( + const GnssSvIdConfig& svConfig, GnssConfig& config) +{ + // Convert blacklisted SV mask values to vectors + if (svConfig.bdsBlacklistSvMask) { + convertGnssSvIdMaskToList( + svConfig.bdsBlacklistSvMask, config.blacklistedSvIds, + GNSS_SV_CONFIG_BDS_INITIAL_SV_ID, GNSS_SV_TYPE_BEIDOU); + config.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + } + if (svConfig.galBlacklistSvMask) { + convertGnssSvIdMaskToList( + svConfig.galBlacklistSvMask, config.blacklistedSvIds, + GNSS_SV_CONFIG_GAL_INITIAL_SV_ID, GNSS_SV_TYPE_GALILEO); + config.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + } + if (svConfig.gloBlacklistSvMask) { + convertGnssSvIdMaskToList( + svConfig.gloBlacklistSvMask, config.blacklistedSvIds, + GNSS_SV_CONFIG_GLO_INITIAL_SV_ID, GNSS_SV_TYPE_GLONASS); + config.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + } + if (svConfig.qzssBlacklistSvMask) { + convertGnssSvIdMaskToList( + svConfig.qzssBlacklistSvMask, config.blacklistedSvIds, + GNSS_SV_CONFIG_QZSS_INITIAL_SV_ID, GNSS_SV_TYPE_QZSS); + config.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + } +} + +void GnssAdapter::convertGnssSvIdMaskToList( + uint64_t svIdMask, std::vector& svIds, + GnssSvId initialSvId, GnssSvType svType) +{ + GnssSvIdSource source = {}; + source.size = sizeof(GnssSvIdSource); + source.constellation = svType; + + // SV ID 0 => All SV IDs in mask + if (GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK == svIdMask) { + source.svId = 0; + svIds.push_back(source); + return; + } + + // Convert each bit in svIdMask to vector entry + uint32_t bitNumber = 0; + while (svIdMask > 0) { + if (svIdMask & 0x1) { + source.svId = bitNumber + initialSvId; + svIds.push_back(source); + } + bitNumber++; + svIdMask >>= 1; + } +} + +void GnssAdapter::reportGnssSvIdConfigEvent(const GnssSvIdConfig& config) +{ + struct MsgReportGnssSvIdConfig : public LocMsg { + GnssAdapter& mAdapter; + const GnssSvIdConfig mConfig; + inline MsgReportGnssSvIdConfig(GnssAdapter& adapter, + const GnssSvIdConfig& config) : + LocMsg(), + mAdapter(adapter), + mConfig(config) {} + inline virtual void proc() const { + mAdapter.reportGnssSvIdConfig(mConfig); + } + }; + + sendMsg(new MsgReportGnssSvIdConfig(*this, config)); +} + +void GnssAdapter::reportGnssSvIdConfig(const GnssSvIdConfig& svIdConfig) +{ + GnssConfig config = {}; + config.size = sizeof(GnssConfig); + + // Invoke control clients config callback + if (nullptr != mControlCallbacks.gnssConfigCb && + svIdConfig.size == sizeof(GnssSvIdConfig)) { + convertFromGnssSvIdConfig(svIdConfig, config); + LOC_LOGd("blacklist bds 0x%" PRIx64 ", glo 0x%" PRIx64 + ", qzss 0x%" PRIx64 ", gal 0x%" PRIx64, + svIdConfig.bdsBlacklistSvMask, svIdConfig.gloBlacklistSvMask, + svIdConfig.qzssBlacklistSvMask, svIdConfig.galBlacklistSvMask); + mControlCallbacks.gnssConfigCb(config); + } else { + LOC_LOGe("Failed to report, size %d", (uint32_t)config.size); + } +} + +void +GnssAdapter::gnssUpdateSvTypeConfigCommand(GnssSvTypeConfig config) +{ + struct MsgGnssUpdateSvTypeConfig : public LocMsg { + GnssAdapter* mAdapter; + LocApiBase* mApi; + GnssSvTypeConfig mConfig; + inline MsgGnssUpdateSvTypeConfig( + GnssAdapter* adapter, + LocApiBase* api, + GnssSvTypeConfig& config) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mConfig(config) {} + inline virtual void proc() const { + + // Check if feature is supported + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature not supported."); + } else { + // Send update request to modem + mAdapter->gnssSvTypeConfigUpdate(mConfig); + } + } + }; + + sendMsg(new MsgGnssUpdateSvTypeConfig(this, mLocApi, config)); +} + +void +GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config) +{ + gnssSetSvTypeConfig(config); + gnssSvTypeConfigUpdate(); +} + +void +GnssAdapter::gnssSvTypeConfigUpdate() +{ + LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64, + mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask); + + if (mGnssSvTypeConfig.size == sizeof(mGnssSvTypeConfig)) { + GnssSvIdConfig blacklistConfig = {}; + // Revert to previously blacklisted SVs for each enabled constellation + blacklistConfig = mGnssSvIdConfig; + // Blacklist all SVs for each disabled constellation + if (mGnssSvTypeConfig.blacklistedSvTypesMask) { + if (mGnssSvTypeConfig.blacklistedSvTypesMask & GNSS_SV_TYPES_MASK_GLO_BIT) { + blacklistConfig.gloBlacklistSvMask = GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK; + } + if (mGnssSvTypeConfig.blacklistedSvTypesMask & GNSS_SV_TYPES_MASK_BDS_BIT) { + blacklistConfig.bdsBlacklistSvMask = GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK; + } + if (mGnssSvTypeConfig.blacklistedSvTypesMask & GNSS_SV_TYPES_MASK_QZSS_BIT) { + blacklistConfig.qzssBlacklistSvMask = GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK; + } + if (mGnssSvTypeConfig.blacklistedSvTypesMask & GNSS_SV_TYPES_MASK_GAL_BIT) { + blacklistConfig.galBlacklistSvMask = GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK; + } + } + + // Send blacklist info + mLocApi->setBlacklistSv(blacklistConfig); + + // Send only enabled constellation config + if (mGnssSvTypeConfig.enabledSvTypesMask) { + GnssSvTypeConfig svTypeConfig = {sizeof(GnssSvTypeConfig), 0, 0}; + svTypeConfig.enabledSvTypesMask = mGnssSvTypeConfig.enabledSvTypesMask; + mLocApi->setConstellationControl(svTypeConfig); + } + } else { + LOC_LOGE("Invalid GnssSvTypeConfig size"); + } +} + +void +GnssAdapter::gnssGetSvTypeConfigCommand(GnssSvTypeConfigCallback callback) +{ + struct MsgGnssGetSvTypeConfig : public LocMsg { + GnssAdapter* mAdapter; + LocApiBase* mApi; + GnssSvTypeConfigCallback mCallback; + inline MsgGnssGetSvTypeConfig( + GnssAdapter* adapter, + LocApiBase* api, + GnssSvTypeConfigCallback callback) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mCallback(callback) {} + inline virtual void proc() const { + + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature not supported."); + } else { + // Save the callback + mAdapter->gnssSetSvTypeConfigCallback(mCallback); + // Send GET request to modem + mApi->getConstellationControl(); + } + } + }; + + sendMsg(new MsgGnssGetSvTypeConfig(this, mLocApi, callback)); +} + +void +GnssAdapter::gnssResetSvTypeConfigCommand() +{ + struct MsgGnssResetSvTypeConfig : public LocMsg { + GnssAdapter* mAdapter; + LocApiBase* mApi; + inline MsgGnssResetSvTypeConfig( + GnssAdapter* adapter, + LocApiBase* api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature not supported."); + } else { + // Reset constellation config + mAdapter->gnssSetSvTypeConfig({sizeof(GnssSvTypeConfig), 0, 0}); + // Re-enforce SV blacklist config + mAdapter->gnssSvIdConfigUpdate(); + // Send reset request to modem + mApi->resetConstellationControl(); + } + } + }; + + sendMsg(new MsgGnssResetSvTypeConfig(this, mLocApi)); +} + +void GnssAdapter::reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config) +{ + struct MsgReportGnssSvTypeConfig : public LocMsg { + GnssAdapter& mAdapter; + const GnssSvTypeConfig mConfig; + inline MsgReportGnssSvTypeConfig(GnssAdapter& adapter, + const GnssSvTypeConfig& config) : + LocMsg(), + mAdapter(adapter), + mConfig(config) {} + inline virtual void proc() const { + mAdapter.reportGnssSvTypeConfig(mConfig); + } + }; + + sendMsg(new MsgReportGnssSvTypeConfig(*this, config)); +} + +void GnssAdapter::reportGnssSvTypeConfig(const GnssSvTypeConfig& config) +{ + // Invoke Get SV Type Callback + if (NULL != mGnssSvTypeConfigCb && + config.size == sizeof(GnssSvTypeConfig)) { + LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64, + config.blacklistedSvTypesMask, config.enabledSvTypesMask); + mGnssSvTypeConfigCb(config); + } else { + LOC_LOGe("Failed to report, size %d", (uint32_t)config.size); + } +} + void GnssAdapter::deleteAidingData(const GnssAidingData &data, uint32_t sessionId) { mLocApi->deleteAidingData(data, new LocApiResponse(*getContext(), [this, sessionId] (LocationError err) { @@ -1345,6 +1881,8 @@ GnssAdapter::handleEngineUpEvent() mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); // restart sessions mAdapter.restartSessions(); + mAdapter.gnssSvIdConfigUpdate(); + mAdapter.gnssSvTypeConfigUpdate(); } }; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index c9491f06..b906e484 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -103,6 +103,9 @@ class GnssAdapter : public LocAdapterBase { LocationControlCallbacks mControlCallbacks; uint32_t mPowerVoteId; uint32_t mNmeaMask; + GnssSvIdConfig mGnssSvIdConfig; + GnssSvTypeConfig mGnssSvTypeConfig; + GnssSvTypeConfigCallback mGnssSvTypeConfigCb; /* ==== NI ============================================================================= */ NiData mNiData; @@ -200,7 +203,7 @@ public: bool hasNiNotifyCallback(LocationAPI* client); NiData& getNiData() { return mNiData; } - /* ==== CONTROL ======================================================================== */ + /* ==== CONTROL CLIENT ================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ uint32_t enableCommand(LocationTechnologyType techType); void disableCommand(uint32_t id); @@ -210,10 +213,34 @@ public: void requestUlpCommand(); void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); + uint32_t* gnssGetConfigCommand(GnssConfigFlagsMask mask); uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); + /* ==== GNSS SV TYPE CONFIG ============================================================ */ + /* ==== COMMANDS ====(Called from Client Thread)======================================== */ + /* ==== These commands are received directly from client bypassing Location API ======== */ + void gnssUpdateSvTypeConfigCommand(GnssSvTypeConfig config); + void gnssGetSvTypeConfigCommand(GnssSvTypeConfigCallback callback); + void gnssResetSvTypeConfigCommand(); + + /* ==== UTILITIES ====================================================================== */ + LocationError gnssSvIdConfigUpdateSync(const std::vector& blacklistedSvIds); + LocationError gnssSvIdConfigUpdateSync(); + void gnssSvIdConfigUpdate(const std::vector& blacklistedSvIds); + void gnssSvIdConfigUpdate(); + void gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config); + void gnssSvTypeConfigUpdate(); + inline void gnssSetSvTypeConfig(const GnssSvTypeConfig& config) + { mGnssSvTypeConfig = config; } + inline void gnssSetSvTypeConfigCallback(GnssSvTypeConfigCallback callback) + { mGnssSvTypeConfigCb = callback; } + inline GnssSvTypeConfigCallback gnssGetSvTypeConfigCallback() + { return mGnssSvTypeConfigCb; } + + /* ========= AGPS ====================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void initDefaultAgpsCommand(); void initAgpsCommand(const AgpsCbInfo& cbInfo); void dataConnOpenCommand(AGpsExtType agpsType, @@ -251,6 +278,8 @@ public: int msInWeek); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); + virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); + virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); virtual bool releaseATL(int connHandle); @@ -271,6 +300,8 @@ public: void reportNmea(const char* nmea, size_t length); bool requestNiNotify(const GnssNiNotification& notify, const void* data); void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); + void reportGnssSvIdConfig(const GnssSvIdConfig& config); + void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); @@ -296,6 +327,13 @@ public: static void convertSatelliteInfo(std::vector& out, const GnssSvType& in_constellation, const SystemStatusReports& in); + static void convertToGnssSvIdConfig( + const std::vector& blacklistedSvIds, GnssSvIdConfig& config); + static void convertFromGnssSvIdConfig( + const GnssSvIdConfig& svConfig, GnssConfig& config); + static void convertGnssSvIdMaskToList( + uint64_t svIdMask, std::vector& svIds, + GnssSvId initialSvId, GnssSvType svType); void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 3e989c97..0dac13d5 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -51,6 +51,11 @@ static void setControlCallbacks(LocationControlCallbacks& controlCallbacks); static uint32_t enable(LocationTechnologyType techType); static void disable(uint32_t id); static uint32_t* gnssUpdateConfig(GnssConfig config); +static uint32_t* gnssGetConfig(GnssConfigFlagsMask mask); + +static void gnssUpdateSvTypeConfig(GnssSvTypeConfig& config); +static void gnssGetSvTypeConfig(GnssSvTypeConfigCallback& callback); +static void gnssResetSvTypeConfig(); static void injectLocation(double latitude, double longitude, float accuracy); static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty); @@ -77,6 +82,10 @@ static const GnssInterface gGnssInterface = { enable, disable, gnssUpdateConfig, + gnssGetConfig, + gnssUpdateSvTypeConfig, + gnssGetSvTypeConfig, + gnssResetSvTypeConfig, gnssDeleteAidingData, gnssUpdateXtraThrottle, injectLocation, @@ -167,7 +176,7 @@ static void gnssNiResponse(LocationAPI* client, uint32_t id, GnssNiResponse resp static void setControlCallbacks(LocationControlCallbacks& controlCallbacks) { if (NULL != gGnssAdapter) { - return gGnssAdapter->setControlCallbacksCommand(controlCallbacks); + gGnssAdapter->setControlCallbacksCommand(controlCallbacks); } } @@ -183,7 +192,7 @@ static uint32_t enable(LocationTechnologyType techType) static void disable(uint32_t id) { if (NULL != gGnssAdapter) { - return gGnssAdapter->disableCommand(id); + gGnssAdapter->disableCommand(id); } } @@ -196,6 +205,36 @@ static uint32_t* gnssUpdateConfig(GnssConfig config) } } +static uint32_t* gnssGetConfig(GnssConfigFlagsMask mask) +{ + if (NULL != gGnssAdapter) { + return gGnssAdapter->gnssGetConfigCommand(mask); + } else { + return NULL; + } +} + +static void gnssUpdateSvTypeConfig(GnssSvTypeConfig& config) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->gnssUpdateSvTypeConfigCommand(config); + } +} + +static void gnssGetSvTypeConfig(GnssSvTypeConfigCallback& callback) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->gnssGetSvTypeConfigCommand(callback); + } +} + +static void gnssResetSvTypeConfig() +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->gnssResetSvTypeConfigCommand(); + } +} + static uint32_t gnssDeleteAidingData(GnssAidingData& data) { if (NULL != gGnssAdapter) { diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index e43d9e03..060ce5f2 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -628,6 +628,21 @@ LocationControlAPI::gnssUpdateConfig(GnssConfig config) return ids; } +uint32_t* LocationControlAPI::gnssGetConfig(GnssConfigFlagsMask mask) { + + uint32_t* ids = NULL; + pthread_mutex_lock(&gDataMutex); + + if (NULL != gData.gnssInterface) { + ids = gData.gnssInterface->gnssGetConfig(mask); + } else { + LOC_LOGe("No gnss interface available for Control API client %p", this); + } + + pthread_mutex_unlock(&gDataMutex); + return ids; +} + uint32_t LocationControlAPI::gnssDeleteAidingData(GnssAidingData& data) { diff --git a/location/LocationAPI.h b/location/LocationAPI.h index ce38bc6b..cfdb19f2 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -178,6 +178,7 @@ typedef struct { size_t size; // set to sizeof(LocationControlCallbacks) responseCallback responseCb; // mandatory collectiveResponseCallback collectiveResponseCb; // mandatory + gnssConfigCallback gnssConfigCb; // optional } LocationControlCallbacks; class LocationControlAPI : public ILocationControlAPI @@ -231,6 +232,21 @@ public: LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */ virtual uint32_t* gnssUpdateConfig(GnssConfig config) override; + /* gnssGetConfig fetches the current constellation and SV configuration + on the GNSS engine. + Returns a session id array with an id for each of the bits set in + the mask parameter, order from low bits to high bits. + Response is sent via the registered gnssConfigCallback. + This effect is global for all clients of LocationAPI + collectiveResponseCallback returns: + LOCATION_ERROR_SUCCESS if session was successful + LOCATION_ERROR_INVALID_PARAMETER if any parameter is invalid + LOCATION_ERROR_CALLBACK_MISSING If no gnssConfigCallback + was passed in createInstance + LOCATION_ERROR_NOT_SUPPORTED If read of requested configuration + is not supported */ + uint32_t* gnssGetConfig(GnssConfigFlagsMask mask); + /* delete specific gnss aiding data for testing, which returns a session id that will be returned in responseCallback to match command with response. Only allowed in userdebug builds. This effect is global for all clients of LocationAPI diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 626968c9..65a09847 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -26,7 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define LOG_NDDEBUG 0 +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_APIClientBase" #include @@ -45,7 +45,7 @@ LocationAPIControlClient::LocationAPIControlClient() : pthread_mutex_init(&mMutex, nullptr); for (int i = 0; i < CTRL_REQUEST_MAX; i++) { - mRequestQueues[i].reset(0); + mRequestQueues[i].reset((uint32_t)0); } memset(&mConfig, 0, sizeof(GnssConfig)); @@ -75,7 +75,7 @@ LocationAPIControlClient::~LocationAPIControlClient() } for (int i = 0; i < CTRL_REQUEST_MAX; i++) { - mRequestQueues[i].reset(0); + mRequestQueues[i].reset((uint32_t)0); } pthread_mutex_unlock(&mMutex); @@ -142,24 +142,43 @@ void LocationAPIControlClient::locAPIDisable() uint32_t LocationAPIControlClient::locAPIGnssUpdateConfig(GnssConfig config) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; - if (memcmp(&mConfig, &config, sizeof(GnssConfig)) == 0) { - LOC_LOGV("%s:%d] GnssConfig is identical to previous call", __FUNCTION__, __LINE__); - retVal = LOCATION_ERROR_SUCCESS; - return retVal; + + pthread_mutex_lock(&mMutex); + if (mLocationControlAPI) { + if (mConfig.equals(config)) { + LOC_LOGv("GnssConfig is identical to previous call"); + retVal = LOCATION_ERROR_SUCCESS; + } else { + mConfig = config; + uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); + LOC_LOGv("gnssUpdateConfig return array: %p", idArray); + if (nullptr != idArray) { + if (nullptr != mRequestQueues[CTRL_REQUEST_CONFIG_UPDATE].getSessionArrayPtr()) { + mRequestQueues[CTRL_REQUEST_CONFIG_UPDATE].reset(idArray); + } + mRequestQueues[CTRL_REQUEST_CONFIG_UPDATE].push(new GnssUpdateConfigRequest(*this)); + retVal = LOCATION_ERROR_SUCCESS; + } + } } + pthread_mutex_unlock(&mMutex); + return retVal; +} + +uint32_t LocationAPIControlClient::locAPIGnssGetConfig(GnssConfigFlagsMask mask) +{ + uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); if (mLocationControlAPI) { - memcpy(&mConfig, &config, sizeof(GnssConfig)); - - uint32_t* idArray = mLocationControlAPI->gnssUpdateConfig(config); - LOC_LOGV("%s:%d] gnssUpdateConfig return array: %p", __FUNCTION__, __LINE__, idArray); - if (idArray != nullptr) { - if (mRequestQueues[CTRL_REQUEST_CONFIG].getSession() != CONFIG_SESSION_ID) { - mRequestQueues[CTRL_REQUEST_CONFIG].reset(CONFIG_SESSION_ID); + uint32_t* idArray = mLocationControlAPI->gnssGetConfig(mask); + LOC_LOGv("gnssGetConfig return array: %p", idArray); + if (nullptr != idArray) { + if (nullptr != mRequestQueues[CTRL_REQUEST_CONFIG_GET].getSessionArrayPtr()) { + mRequestQueues[CTRL_REQUEST_CONFIG_GET].reset(idArray); } - mRequestQueues[CTRL_REQUEST_CONFIG].push(new GnssUpdateConfigRequest(*this)); + mRequestQueues[CTRL_REQUEST_CONFIG_GET].push(new GnssGetConfigRequest(*this)); retVal = LOCATION_ERROR_SUCCESS; } } @@ -191,12 +210,7 @@ void LocationAPIControlClient::onCtrlCollectiveResponseCb( LOC_LOGV("%s:%d] SUCCESS: %d id: %d", __FUNCTION__, __LINE__, errors[i], ids[i]); } } - LocationAPIRequest* request = nullptr; - pthread_mutex_lock(&mMutex); - if (mRequestQueues[CTRL_REQUEST_CONFIG].getSession() == CONFIG_SESSION_ID) { - request = mRequestQueues[CTRL_REQUEST_CONFIG].pop(); - } - pthread_mutex_unlock(&mMutex); + LocationAPIRequest* request = getRequestBySessionArrayPtr(ids); if (request) { request->onCollectiveResponse(count, errors, ids); delete request; @@ -207,13 +221,30 @@ LocationAPIRequest* LocationAPIControlClient::getRequestBySession(uint32_t sessi { pthread_mutex_lock(&mMutex); LocationAPIRequest* request = nullptr; - for (int i = 0; i < CTRL_REQUEST_MAX; i++) { - if (i != CTRL_REQUEST_CONFIG && - mRequestQueues[i].getSession() == session) { - request = mRequestQueues[i].pop(); - break; - } + + if (mRequestQueues[CTRL_REQUEST_DELETEAIDINGDATA].getSession() == session) { + request = mRequestQueues[CTRL_REQUEST_DELETEAIDINGDATA].pop(); + } else if (mRequestQueues[CTRL_REQUEST_CONTROL].getSession() == session) { + request = mRequestQueues[CTRL_REQUEST_CONTROL].pop(); } + + pthread_mutex_unlock(&mMutex); + return request; +} + +LocationAPIRequest* +LocationAPIControlClient::getRequestBySessionArrayPtr( + uint32_t* sessionArrayPtr) +{ + pthread_mutex_lock(&mMutex); + LocationAPIRequest* request = nullptr; + + if (mRequestQueues[CTRL_REQUEST_CONFIG_UPDATE].getSessionArrayPtr() == sessionArrayPtr) { + request = mRequestQueues[CTRL_REQUEST_CONFIG_UPDATE].pop(); + } else if (mRequestQueues[CTRL_REQUEST_CONFIG_GET].getSessionArrayPtr() == sessionArrayPtr) { + request = mRequestQueues[CTRL_REQUEST_CONFIG_GET].pop(); + } + pthread_mutex_unlock(&mMutex); return request; } @@ -234,7 +265,7 @@ LocationAPIClientBase::LocationAPIClientBase() : pthread_mutex_init(&mMutex, &attr); for (int i = 0; i < REQUEST_MAX; i++) { - mRequestQueues[i].reset(0); + mRequestQueues[i].reset((uint32_t)0); } } @@ -291,7 +322,7 @@ LocationAPIClientBase::~LocationAPIClientBase() } for (int i = 0; i < REQUEST_MAX; i++) { - mRequestQueues[i].reset(0); + mRequestQueues[i].reset((uint32_t)0); } pthread_mutex_unlock(&mMutex); diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 4bd1466b..4d48932a 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -57,7 +57,8 @@ enum REQUEST_TYPE { enum CTRL_REQUEST_TYPE { CTRL_REQUEST_DELETEAIDINGDATA = 0, CTRL_REQUEST_CONTROL, - CTRL_REQUEST_CONFIG, + CTRL_REQUEST_CONFIG_UPDATE, + CTRL_REQUEST_CONFIG_GET, CTRL_REQUEST_MAX, }; @@ -74,12 +75,13 @@ public: class RequestQueue { public: - RequestQueue(): mSession(0) { + RequestQueue(): mSession(0), mSessionArrayPtr(nullptr) { } virtual ~RequestQueue() { - reset(0); + reset((uint32_t)0); } void inline setSession(uint32_t session) { mSession = session; } + void inline setSessionArrayPtr(uint32_t* ptr) { mSessionArrayPtr = ptr; } void reset(uint32_t session) { LocationAPIRequest* request = nullptr; while (!mQueue.empty()) { @@ -89,6 +91,10 @@ public: } mSession = session; } + void reset(uint32_t* sessionArrayPtr) { + reset((uint32_t)0); + mSessionArrayPtr = sessionArrayPtr; + } void push(LocationAPIRequest* request) { mQueue.push(request); } @@ -101,8 +107,10 @@ public: return request; } uint32_t getSession() { return mSession; } + uint32_t* getSessionArrayPtr() { return mSessionArrayPtr; } private: uint32_t mSession; + uint32_t* mSessionArrayPtr; std::queue mQueue; }; @@ -114,12 +122,15 @@ public: LocationAPIControlClient& operator=(const LocationAPIControlClient&) = delete; LocationAPIRequest* getRequestBySession(uint32_t session); + LocationAPIRequest* getRequestBySessionArrayPtr(uint32_t* sessionArrayPtr); // LocationControlAPI uint32_t locAPIGnssDeleteAidingData(GnssAidingData& data); uint32_t locAPIEnable(LocationTechnologyType techType); void locAPIDisable(); uint32_t locAPIGnssUpdateConfig(GnssConfig config); + uint32_t locAPIGnssGetConfig(GnssConfigFlagsMask config); + inline LocationControlAPI* getControlAPI() { return mLocationControlAPI; } // callbacks void onCtrlResponseCb(LocationError error, uint32_t id); @@ -130,6 +141,8 @@ public: inline virtual void onDisableCb(LocationError /*error*/) {} inline virtual void onGnssUpdateConfigCb( size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} + inline virtual void onGnssGetConfigCb( + size_t /*count*/, LocationError* /*errors*/, uint32_t* /*ids*/) {} class GnssDeleteAidingDataRequest : public LocationAPIRequest { public: @@ -167,6 +180,15 @@ public: LocationAPIControlClient& mAPI; }; + class GnssGetConfigRequest : public LocationAPIRequest { + public: + GnssGetConfigRequest(LocationAPIControlClient& API) : mAPI(API) {} + inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* ids) { + mAPI.onGnssGetConfigCb(count, errors, ids); + } + LocationAPIControlClient& mAPI; + }; + private: pthread_mutex_t mMutex; LocationControlAPI* mLocationControlAPI; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 00cca183..5d1c8093 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -270,6 +270,7 @@ typedef enum { GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT = (1<<7), GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), + GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT = (1<<10), } GnssConfigFlagsBits; typedef enum { @@ -740,12 +741,22 @@ typedef struct { GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits } GnssSv; -typedef struct { +struct GnssConfigSetAssistanceServer { size_t size; // set to sizeof(GnssConfigSetAssistanceServer) GnssAssistanceType type; // SUPL or C2K const char* hostName; // null terminated string uint32_t port; // port of server -} GnssConfigSetAssistanceServer; + + inline bool equals(const GnssConfigSetAssistanceServer& config) { + if (config.type == type && config.port == port && + ((NULL == config.hostName && NULL == hostName) || + (NULL != config.hostName && NULL != hostName && + 0 == strcmp(config.hostName, hostName)))) { + return true; + } + return false; + } +}; typedef struct { size_t size; // set to sizeof(GnssMeasurementsData) @@ -805,7 +816,40 @@ typedef struct { GnssMeasurementsClock clock; // clock } GnssMeasurementsNotification; +typedef uint32_t GnssSvId; + +struct GnssSvIdSource{ + size_t size; // set to sizeof(GnssSvIdSource) + GnssSvType constellation; // constellation for the sv to blacklist + GnssSvId svId; // sv id to blacklist +}; +inline bool operator ==(GnssSvIdSource const& left, GnssSvIdSource const& right) { + return left.size == right.size && + left.constellation == right.constellation && left.svId == right.svId; +} + +#define GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK ((uint64_t)0xFFFFFFFFFFFFFFFF) typedef struct { + size_t size; // set to sizeof(GnssSvIdConfig) + + // GLONASS - SV 65 maps to bit 0 +#define GNSS_SV_CONFIG_GLO_INITIAL_SV_ID 65 + uint64_t gloBlacklistSvMask; + + // BEIDOU - SV 201 maps to bit 0 +#define GNSS_SV_CONFIG_BDS_INITIAL_SV_ID 201 + uint64_t bdsBlacklistSvMask; + + // QZSS - SV 193 maps to bit 0 +#define GNSS_SV_CONFIG_QZSS_INITIAL_SV_ID 193 + uint64_t qzssBlacklistSvMask; + + // GAL - SV 301 maps to bit 0 +#define GNSS_SV_CONFIG_GAL_INITIAL_SV_ID 301 + uint64_t galBlacklistSvMask; +} GnssSvIdConfig; + +struct GnssConfig{ size_t size; // set to sizeof(GnssConfig) GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid GnssConfigGpsLock gpsLock; @@ -818,7 +862,26 @@ typedef struct { GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl; GnssConfigSuplEmergencyServices suplEmergencyServices; GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits -} GnssConfig; + std::vector blacklistedSvIds; + + inline bool equals(const GnssConfig& config) { + if (flags == config.flags && + gpsLock == config.gpsLock && + suplVersion == config.suplVersion && + assistanceServer.equals(config.assistanceServer) && + lppProfile == config.lppProfile && + lppeControlPlaneMask == config.lppeControlPlaneMask && + lppeUserPlaneMask == config.lppeUserPlaneMask && + aGlonassPositionProtocolMask == config.aGlonassPositionProtocolMask && + emergencyPdnForEmergencySupl == config.emergencyPdnForEmergencySupl && + suplEmergencyServices == config.suplEmergencyServices && + suplModeMask == config.suplModeMask && + blacklistedSvIds == config.blacklistedSvIds) { + return true; + } + return false; + } +}; typedef struct { size_t size; // set to sizeof @@ -947,6 +1010,11 @@ typedef std::function gnssMeasurementsCallback; +/* Provides the current GNSS configuration to the client */ +typedef std::function gnssConfigCallback; + typedef struct { size_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory diff --git a/location/location_interface.h b/location/location_interface.h index 27589f71..f4f904d9 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -47,6 +47,10 @@ struct GnssInterface { uint32_t (*enable)(LocationTechnologyType techType); void (*disable)(uint32_t id); uint32_t* (*gnssUpdateConfig)(GnssConfig config); + uint32_t* (*gnssGetConfig)(GnssConfigFlagsMask config); + void (*gnssUpdateSvTypeConfig)(GnssSvTypeConfig& config); + void (*gnssGetSvTypeConfig)(GnssSvTypeConfigCallback& callback); + void (*gnssResetSvTypeConfig)(); uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); void (*gnssUpdateXtraThrottle)(const bool enabled); void (*injectLocation)(double latitude, double longitude, float accuracy); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index bc6e384b..5c5405fe 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -119,8 +119,8 @@ typedef enum { LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02, /**< Support debug NMEA feature */ LOC_SUPPORTED_FEATURE_GNSS_ONLY_POSITION_REPORT, /**< Support GNSS Only position reports */ LOC_SUPPORTED_FEATURE_FDCL, /**< Support FDCL */ - LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT, /**< Support constellation enablement */ - LOC_SUPPORTED_FEATURE_AGPM, /**< Support AGPM feature */ + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02, /**< Support constellation enablement */ + LOC_SUPPORTED_FEATURE_AGPM_V02, /**< Support AGPM feature */ LOC_SUPPORTED_FEATURE_XTRA_INTEGRITY /**< Support XTRA integrity */ } loc_supported_feature_enum; @@ -1461,6 +1461,32 @@ typedef struct Gnss_Srn_MacAddr_Type macAddrType; /* SRN AP MAC Address type */ } GnssSrnDataReq; +/* Mask indicating enabled or disabled constellations */ +typedef uint64_t GnssSvTypesMask; +typedef enum { + GNSS_SV_TYPES_MASK_GLO_BIT = (1<<0), + GNSS_SV_TYPES_MASK_BDS_BIT = (1<<1), + GNSS_SV_TYPES_MASK_QZSS_BIT = (1<<2), + GNSS_SV_TYPES_MASK_GAL_BIT = (1<<3), +} GnssSvTypesMaskBits; + +/* This SV Type config is injected directly to GNSS Adapter + * bypassing Location API */ +typedef struct { + size_t size; // set to sizeof(GnssSvTypeConfig) + // Enabled Constellations + GnssSvTypesMask enabledSvTypesMask; + // Disabled Constellations + GnssSvTypesMask blacklistedSvTypesMask; +} GnssSvTypeConfig; + +/* Provides the current GNSS SV Type configuration to the client. + * This is fetched via direct call to GNSS Adapter bypassing + * Location API */ +typedef std::function GnssSvTypeConfigCallback; + /* * Represents the status of AGNSS augmented to support IPv4. */ From 66c682f7d977846215b6d3607a5a43ad21c9c8b9 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sun, 20 May 2018 23:06:12 +0530 Subject: [PATCH 679/945] FR 45623 - AGPM 1.0 Adding AGPM FR changes to add power modes support. CRs-Fixed: 2195518 Change-Id: Ifd1da6194b58ad5590ea755e3f6b237c4b4db2ad --- android/Gnss.cpp | 13 +- android/GnssMeasurement.cpp | 9 +- android/location_api/GnssAPIClient.cpp | 40 +-- android/location_api/GnssAPIClient.h | 7 +- android/location_api/MeasurementAPIClient.cpp | 25 +- android/location_api/MeasurementAPIClient.h | 9 +- core/LocAdapterBase.h | 1 + core/loc_core_log.cpp | 7 +- gnss/GnssAdapter.cpp | 237 ++++++++++++------ gnss/GnssAdapter.h | 20 +- gnss/location_gnss.cpp | 15 +- location/ILocationAPI.h | 8 +- location/LocationAPI.cpp | 44 ++-- location/LocationAPI.h | 18 +- location/LocationAPIClientBase.cpp | 31 ++- location/LocationAPIClientBase.h | 12 +- location/LocationDataTypes.h | 52 +++- location/location_interface.h | 13 +- utils/gps_extended.h | 14 +- utils/gps_extended_c.h | 3 + 20 files changed, 378 insertions(+), 200 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index d31a18bb..36598236 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -380,10 +380,17 @@ Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs, - bool /*lowPowerMode*/) { + bool lowPowerMode) { ENTRY_LOG_CALLFLOW(); - return setPositionMode(mode, recurrence, minIntervalMs, - preferredAccuracyMeters, preferredTimeMs); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + GnssPowerMode powerMode = lowPowerMode? + GNSS_POWER_MODE_M4 : GNSS_POWER_MODE_M2; + retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs, powerMode, minIntervalMs); + } + return retVal; } Return> Gnss::getExtensionGnssMeasurement_1_1() { diff --git a/android/GnssMeasurement.cpp b/android/GnssMeasurement.cpp index 2578a853..ffe5c524 100644 --- a/android/GnssMeasurement.cpp +++ b/android/GnssMeasurement.cpp @@ -100,7 +100,7 @@ Return GnssMeasurement::close() { // Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. Return GnssMeasurement::setCallback_1_1( - const sp& callback, bool /*enableFullTracking*/) { + const sp& callback, bool enableFullTracking) { Return ret = IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; @@ -113,7 +113,7 @@ Return GnssMeasurement::setCallback_1_1( LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); return ret; } - if (mApi == nullptr) { + if (nullptr == mApi) { LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); return ret; } @@ -121,7 +121,10 @@ Return GnssMeasurement::setCallback_1_1( mGnssMeasurementCbIface_1_1 = callback; mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0); - return mApi->measurementSetCallback_1_1(callback); + GnssPowerMode powerMode = enableFullTracking? + GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2; + + return mApi->measurementSetCallback_1_1(callback, powerMode); } } // namespace implementation diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 4fcc8683..65e8b91b 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -62,11 +62,11 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb, LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); // set default LocationOptions. - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = 1000; - mLocationOptions.minDistance = 0; - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = 1000; + mTrackingOptions.minDistance = 0; + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; gnssUpdateCallbacks(gpsCb, niCb); } @@ -142,7 +142,7 @@ bool GnssAPIClient::gnssStart() { LOC_LOGD("%s]: ()", __FUNCTION__); bool retVal = true; - locAPIStartTracking(mLocationOptions); + locAPIStartTracking(mTrackingOptions); return retVal; } @@ -156,26 +156,32 @@ bool GnssAPIClient::gnssStop() bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, - uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs) + uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) { - LOC_LOGD("%s]: (%d %d %d %d %d)", __FUNCTION__, - (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, preferredTimeMs); + LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__, + (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, + preferredTimeMs, (int)powerMode, timeBetweenMeasurement); bool retVal = true; - memset(&mLocationOptions, 0, sizeof(LocationOptions)); - mLocationOptions.size = sizeof(LocationOptions); - mLocationOptions.minInterval = minIntervalMs; - mLocationOptions.minDistance = preferredAccuracyMeters; + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = minIntervalMs; + mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) - mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; else if (mode == IGnss::GnssPositionMode::MS_BASED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSB; + mTrackingOptions.mode = GNSS_SUPL_MODE_MSB; else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) - mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + mTrackingOptions.mode = GNSS_SUPL_MODE_MSA; else { LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode); retVal = false; } - locAPIUpdateTrackingOptions(mLocationOptions); + if (GNSS_POWER_MODE_INVALID != powerMode) { + mTrackingOptions.powerMode = powerMode; + mTrackingOptions.tbm = timeBetweenMeasurement; + } + locAPIUpdateTrackingOptions(mTrackingOptions); return retVal; } diff --git a/android/location_api/GnssAPIClient.h b/android/location_api/GnssAPIClient.h index 1589f396..82f8fbfc 100644 --- a/android/location_api/GnssAPIClient.h +++ b/android/location_api/GnssAPIClient.h @@ -63,7 +63,9 @@ public: V1_0::IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, - uint32_t preferredTimeMs); + uint32_t preferredTimeMs, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = 0); // for GpsNiInterface void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse); @@ -96,8 +98,7 @@ private: LocationAPIControlClient* mControlClient; LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; - - LocationOptions mLocationOptions; + TrackingOptions mTrackingOptions; }; } // namespace implementation diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index f1a5d012..7017e523 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -80,19 +80,23 @@ MeasurementAPIClient::measurementSetCallback(const sp -MeasurementAPIClient::measurementSetCallback_1_1(const sp& callback) +MeasurementAPIClient::measurementSetCallback_1_1( + const sp& callback, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) { - LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)", + __FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement); mMutex.lock(); mGnssMeasurementCbIface_1_1 = callback; mMutex.unlock(); - return startTracking(); + return startTracking(powerMode, timeBetweenMeasurement); } Return -MeasurementAPIClient::startTracking() +MeasurementAPIClient::startTracking( + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) { LocationCallbacks locationCallbacks; memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); @@ -116,15 +120,20 @@ MeasurementAPIClient::startTracking() } locAPISetCallbacks(locationCallbacks); - LocationOptions options; - memset(&options, 0, sizeof(LocationOptions)); - options.size = sizeof(LocationOptions); + + TrackingOptions options = {}; + memset(&options, 0, sizeof(TrackingOptions)); + options.size = sizeof(TrackingOptions); options.minInterval = 1000; options.mode = GNSS_SUPL_MODE_STANDALONE; + if (GNSS_POWER_MODE_INVALID != powerMode) { + options.powerMode = powerMode; + options.tbm = timeBetweenMeasurement; + } + mTracking = true; LOC_LOGD("%s]: start tracking session", __FUNCTION__); locAPIStartTracking(options); - return IGnssMeasurement::GnssMeasurementStatus::SUCCESS; } diff --git a/android/location_api/MeasurementAPIClient.h b/android/location_api/MeasurementAPIClient.h index 117ad542..38811c55 100644 --- a/android/location_api/MeasurementAPIClient.h +++ b/android/location_api/MeasurementAPIClient.h @@ -35,6 +35,7 @@ #include #include #include +#include namespace android { namespace hardware { @@ -56,9 +57,13 @@ public: Return measurementSetCallback( const sp& callback); Return measurementSetCallback_1_1( - const sp& callback); + const sp& callback, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); void measurementClose(); - Return startTracking(); + Return startTracking( + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); // callbacks we are interested in void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 79cb25cb..9fcee128 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -51,6 +51,7 @@ inline bool operator !=(LocationSessionKey const& left, LocationSessionKey const return left.id != right.id || left.client != right.client; } typedef std::map LocationSessionMap; +typedef std::map TrackingOptionsMap; namespace loc_core { diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp index 67d68f04..ddf18ec8 100644 --- a/core/loc_core_log.cpp +++ b/core/loc_core_log.cpp @@ -39,14 +39,17 @@ 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", + "preferred time: %d\n credentials: %s provider: %s \n " + "power mode: %d\n tbm %d", loc_get_position_mode_name(mode), loc_get_position_recurrence_name(recurrence), min_interval, preferred_accuracy, preferred_time, credentials, - provider); + provider, + powerMode, + timeBetweenMeasurements); } /* GPS status names */ diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index cedd27b6..0bbc3f5c 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -175,10 +175,9 @@ GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbac } void -GnssAdapter::convertOptions(LocPosMode& out, const LocationOptions& options) +GnssAdapter::convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions) { - LocPosMode locPosMode = {}; - switch (options.mode) { + switch (trackingOptions.mode) { case GNSS_SUPL_MODE_MSB: out.mode = LOC_POSITION_MODE_MS_BASED; break; @@ -190,7 +189,9 @@ GnssAdapter::convertOptions(LocPosMode& out, const LocationOptions& options) break; } out.share_position = true; - out.min_interval = options.minInterval; + out.min_interval = trackingOptions.minInterval; + out.powerMode = trackingOptions.powerMode; + out.timeBetweenMeasurements = trackingOptions.tbm; } void @@ -1901,17 +1902,26 @@ GnssAdapter::restartSessions() } // get the LocationOptions that has the smallest interval, which should be the active one - LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time + TrackingOptions smallestIntervalOptions = {}; // size is zero until set for the first time + TrackingOptions highestPowerTrackingOptions = {}; for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { - if (0 == smallestIntervalOptions.size || //size of zero means we havent set it yet + // size of zero means we havent set it yet + if (0 == smallestIntervalOptions.size || it->second.minInterval < smallestIntervalOptions.minInterval) { smallestIntervalOptions = it->second; } + GnssPowerMode powerMode = it->second.powerMode; + // Size of zero means we havent set it yet + if (0 == highestPowerTrackingOptions.size || + (GNSS_POWER_MODE_INVALID != powerMode && + powerMode < highestPowerTrackingOptions.powerMode)) { + highestPowerTrackingOptions = it->second; + } } LocPosMode locPosMode = {}; - convertOptions(locPosMode, smallestIntervalOptions); - + highestPowerTrackingOptions.setLocationOptions(smallestIntervalOptions); + convertOptions(locPosMode, highestPowerTrackingOptions); mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), [] (LocationError err) {} )); @@ -2042,21 +2052,20 @@ GnssAdapter::isTrackingSession(LocationAPI* client, uint32_t sessionId) void GnssAdapter::saveTrackingSession(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options) + const TrackingOptions& trackingOptions) { LocationSessionKey key(client, sessionId); - mTrackingSessions[key] = options; + mTrackingSessions[key] = trackingOptions; } void GnssAdapter::eraseTrackingSession(LocationAPI* client, uint32_t sessionId) { LocationSessionKey key(client, sessionId); - auto it = mTrackingSessions.find(key); - if (it != mTrackingSessions.end()) { - mTrackingSessions.erase(it); + auto itr = mTrackingSessions.find(key); + if (itr != mTrackingSessions.end()) { + mTrackingSessions.erase(itr); } - } bool GnssAdapter::setUlpPositionMode(const LocPosMode& mode) { @@ -2120,41 +2129,54 @@ GnssAdapter::reportResponse(size_t count, LocationError* errs, uint32_t* ids) } uint32_t -GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) +GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) { uint32_t sessionId = generateSessionId(); - LOC_LOGD("%s]: client %p id %u minInterval %u mode %u", - __func__, client, sessionId, options.minInterval, options.mode); + LOC_LOGD("%s]: client %p id %u minInterval %u minDistance %u mode %u powermode %u tbm %u", + __func__, client, sessionId, options.minInterval, options.minDistance, options.mode, + options.powerMode, options.tbm); struct MsgStartTracking : public LocMsg { GnssAdapter& mAdapter; LocApiBase& mApi; LocationAPI* mClient; uint32_t mSessionId; - LocationOptions mOptions; + mutable TrackingOptions mTrackingOptions; inline MsgStartTracking(GnssAdapter& adapter, LocApiBase& api, LocationAPI* client, uint32_t sessionId, - LocationOptions options) : + TrackingOptions trackingOptions) : LocMsg(), mAdapter(adapter), mApi(api), mClient(client), mSessionId(sessionId), - mOptions(options) {} + mTrackingOptions(trackingOptions) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; if (!mAdapter.hasTrackingCallback(mClient) && !mAdapter.hasMeasurementsCallback(mClient)) { err = LOCATION_ERROR_CALLBACK_MISSING; - } else if (0 == mOptions.size) { + } else if (0 == mTrackingOptions.size) { err = LOCATION_ERROR_INVALID_PARAMETER; } else { + if (GNSS_POWER_MODE_INVALID != mTrackingOptions.powerMode && + !ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { + LOC_LOGv("Ignoring power mode, feature not supported."); + mTrackingOptions.powerMode = GNSS_POWER_MODE_INVALID; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02) && + GNSS_POWER_MODE_M4 == mTrackingOptions.powerMode && + mTrackingOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { + LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", + mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); + mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; + } // Api doesn't support multiple clients for time based tracking, so mutiplex bool reportToClientWithNoWait = - mAdapter.startTrackingMultiplex(mClient, mSessionId, mOptions); - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + mAdapter.startTrackingMultiplex(mClient, mSessionId, mTrackingOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mTrackingOptions); if (reportToClientWithNoWait) { mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); @@ -2170,25 +2192,43 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, LocationOptions& options) bool GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options) + const TrackingOptions& options) { bool reportToClientWithNoWait = true; if (mTrackingSessions.empty()) { reportToClientWithNoWait = startTracking(client, sessionId, options); } else { - // get the LocationOptions that has the smallest interval, which should be the active one - LocationOptions smallestIntervalOptions = {}; // size is zero until set for the first time + // find the smallest interval and powerMode + TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time + GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { - if (0 == smallestIntervalOptions.size || //size of zero means we havent set it yet - it->second.minInterval < smallestIntervalOptions.minInterval) { - smallestIntervalOptions = it->second; + // if not set or there is a new smallest interval, then set the new interval + if (0 == multiplexedOptions.size || + it->second.minInterval < multiplexedOptions.minInterval) { + multiplexedOptions = it->second; + } + // if session is not the one we are updating and either powerMode + // is not set or there is a new smallest powerMode, then set the new powerMode + if (GNSS_POWER_MODE_INVALID == multiplexedPowerMode || + it->second.powerMode < multiplexedPowerMode) { + multiplexedPowerMode = it->second.powerMode; } } - // if new session's minInterval is smaller than any in other sessions - if (options.minInterval < smallestIntervalOptions.minInterval) { - // restart time based tracking with new options - reportToClientWithNoWait = startTracking(client, sessionId, options); + bool updateOptions = false; + // if session we are starting has smaller interval then next smallest + if (options.minInterval < multiplexedOptions.minInterval) { + multiplexedOptions.minInterval = options.minInterval; + updateOptions = true; + } + // if session we are starting has smaller powerMode then next smallest + if (options.powerMode < multiplexedPowerMode) { + multiplexedOptions.powerMode = options.powerMode; + updateOptions = true; + } + if (updateOptions) { + // restart time based tracking with the newly updated options + reportToClientWithNoWait = startTracking(client, sessionId, multiplexedOptions); } } @@ -2197,12 +2237,12 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, bool GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options) + const TrackingOptions& trackingOptions) { bool reportToClientWithNoWait = true; LocPosMode locPosMode = {}; - convertOptions(locPosMode, options); + convertOptions(locPosMode, trackingOptions); if (!mUlpProxy->sendFixMode(locPosMode)) { // do nothing } @@ -2229,7 +2269,7 @@ GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, bool GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, - const LocationOptions& updatedOptions, const LocationOptions& oldOptions) + const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions) { bool reportToClientWithNoWait = true; @@ -2328,7 +2368,7 @@ GnssAdapter::startTrackingCommand() void GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, - LocationOptions& options) + TrackingOptions& options) { LOC_LOGD("%s]: client %p id %u minInterval %u mode %u", __func__, client, id, options.minInterval, options.mode); @@ -2338,28 +2378,40 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, LocApiBase& mApi; LocationAPI* mClient; uint32_t mSessionId; - LocationOptions mOptions; + mutable TrackingOptions mTrackingOptions; inline MsgUpdateTracking(GnssAdapter& adapter, LocApiBase& api, LocationAPI* client, uint32_t sessionId, - LocationOptions options) : + TrackingOptions trackingOptions) : LocMsg(), mAdapter(adapter), mApi(api), mClient(client), mSessionId(sessionId), - mOptions(options) {} + mTrackingOptions(trackingOptions) {} inline virtual void proc() const { if (mAdapter.isTrackingSession(mClient, mSessionId)) { LocationError err = LOCATION_ERROR_SUCCESS; - if (0 == mOptions.size) { + if (0 == mTrackingOptions.size) { err = LOCATION_ERROR_INVALID_PARAMETER; } else { + if (GNSS_POWER_MODE_INVALID != mTrackingOptions.powerMode && + !ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { + LOC_LOGv("Ignoring power mode, feature not supported."); + mTrackingOptions.powerMode = GNSS_POWER_MODE_INVALID; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02) && + GNSS_POWER_MODE_M4 == mTrackingOptions.powerMode && + mTrackingOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { + LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", + mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); + mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; + } // Api doesn't support multiple clients for time based tracking, so mutiplex bool reportToClientWithNoWait = - mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); - mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + mAdapter.updateTrackingMultiplex(mClient, mSessionId, mTrackingOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mTrackingOptions); if (reportToClientWithNoWait) { mAdapter.reportResponse(mClient, err, mSessionId); @@ -2377,41 +2429,58 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, bool GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, - const LocationOptions& options) + const TrackingOptions& trackingOptions) { bool reportToClientWithNoWait = true; LocationSessionKey key(client, id); // get the session we are updating auto it = mTrackingSessions.find(key); - // cache the clients existing LocationOptions - LocationOptions oldOptions = it->second; - if (1 == mTrackingSessions.size()) { - reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); - } else { - if (it != mTrackingSessions.end()) { - // find the smallest interval, other than the session we are updating - LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time - for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { - // if session is not the one we are updating and either smallest interval is not set - // or there is a new smallest interval, then set the new smallest interval - if (it2->first != key && (0 == smallestIntervalOptions.size || - it2->second.minInterval < smallestIntervalOptions.minInterval)) { - smallestIntervalOptions = it2->second; - } + // cache the clients existing LocationOptions + TrackingOptions oldOptions = it->second; + + // if session we are updating exists and the minInterval or powerMode has changed + if (it != mTrackingSessions.end() && (it->second.minInterval != trackingOptions.minInterval || + it->second.powerMode != trackingOptions.powerMode)) { + // find the smallest interval and powerMode, other than the session we are updating + TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time + GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; + for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { + // if session is not the one we are updating and either interval + // is not set or there is a new smallest interval, then set the new interval + if (it2->first != key && (0 == multiplexedOptions.size || + it2->second.minInterval < multiplexedOptions.minInterval)) { + multiplexedOptions = it2->second; } - // if session we are updating has smaller interval then next smallest - if (options.minInterval < smallestIntervalOptions.minInterval) { - // restart time based tracking with the newly updated interval - reportToClientWithNoWait = updateTracking(client, id, options, oldOptions); - // else if the session we are updating used to be the smallest - } else if (it->second.minInterval < smallestIntervalOptions.minInterval) { - // restart time based tracking with the next smallest - reportToClientWithNoWait = updateTracking( - client, id, smallestIntervalOptions, oldOptions); + // if session is not the one we are updating and either powerMode + // is not set or there is a new smallest powerMode, then set the new powerMode + if (it2->first != key && (GNSS_POWER_MODE_INVALID == multiplexedPowerMode || + it2->second.powerMode < multiplexedPowerMode)) { + multiplexedPowerMode = it2->second.powerMode; } } + bool updateOptions = false; + // if session we are updating has smaller interval then next smallest + if (trackingOptions.minInterval < multiplexedOptions.minInterval) { + multiplexedOptions.minInterval = trackingOptions.minInterval; + updateOptions = true; + } + // if session we are updating has smaller powerMode then next smallest + if (trackingOptions.powerMode < multiplexedPowerMode) { + multiplexedOptions.powerMode = trackingOptions.powerMode; + updateOptions = true; + } + // if only one session exists, then tracking should be updated with it + if (1 == mTrackingSessions.size()) { + multiplexedOptions = trackingOptions; + updateOptions = true; + } + if (updateOptions) { + // restart time based tracking with the newly updated options + reportToClientWithNoWait = updateTracking( + client, id, multiplexedOptions, oldOptions); + } } return reportToClientWithNoWait; @@ -2469,20 +2538,30 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) // get the session we are stopping auto it = mTrackingSessions.find(key); if (it != mTrackingSessions.end()) { - // find the next smallest interval, other than the session we are stopping - LocationOptions smallestIntervalOptions = {}; // size is 0 until set for the first time + // find the smallest interval and powerMode, other than the session we are stopping + TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time + GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { - // if session is not the one we are stopping and either smallest interval is not set - // or there is a new smallest interval, then set the new smallest interval - if (it2->first != key && (0 == smallestIntervalOptions.size || - it2->second.minInterval < smallestIntervalOptions.minInterval)) { - smallestIntervalOptions = it2->second; + // if session is not the one we are stopping and either interval + // is not set or there is a new smallest interval, then set the new interval + if (it2->first != key && (0 == multiplexedOptions.size || + it2->second.minInterval < multiplexedOptions.minInterval)) { + multiplexedOptions = it2->second; + } + // if session is not the one we are stopping and either powerMode + // is not set or there is a new smallest powerMode, then set the new powerMode + if (it2->first != key && (GNSS_POWER_MODE_INVALID == multiplexedPowerMode || + it2->second.powerMode < multiplexedPowerMode)) { + multiplexedPowerMode = it2->second.powerMode; } } - // if session we are stopping has smaller interval then next smallest - if (it->second.minInterval < smallestIntervalOptions.minInterval) { - // restart time based tracking with next smallest interval - reportToClientWithNoWait = startTracking(client, id, smallestIntervalOptions); + // if session we are stopping has smaller interval then next smallest or + // if session we are stopping has smaller powerMode then next smallest + if (it->second.minInterval < multiplexedOptions.minInterval || + it->second.powerMode < multiplexedPowerMode) { + multiplexedOptions.powerMode = multiplexedPowerMode; + // restart time based tracking with the newly updated options + reportToClientWithNoWait = startTracking(client, id, multiplexedOptions); } } } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b906e484..ff66de43 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -94,7 +94,7 @@ class GnssAdapter : public LocAdapterBase { ClientDataMap mClientData; /* ==== TRACKING ======================================================================= */ - LocationSessionMap mTrackingSessions; + TrackingOptionsMap mTrackingSessions; LocPosMode mUlpPositionMode; GnssSvUsedInPosition mGnssSvIdUsedInPosition; bool mGnssSvIdUsedInPosAvail; @@ -122,7 +122,7 @@ class GnssAdapter : public LocAdapterBase { XtraSystemStatusObserver mXtraObserver; /*==== CONVERSION ===================================================================*/ - static void convertOptions(LocPosMode& out, const LocationOptions& options); + static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions); static void convertLocation(Location& out, const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, const LocPosTechMask techMask); @@ -164,8 +164,10 @@ public: /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ - uint32_t startTrackingCommand(LocationAPI* client, LocationOptions& options); - void updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, LocationOptions& options); + uint32_t startTrackingCommand( + LocationAPI* client, TrackingOptions& trackingOptions); + void updateTrackingOptionsCommand( + LocationAPI* client, uint32_t id, TrackingOptions& trackingOptions); void stopTrackingCommand(LocationAPI* client, uint32_t id); /* ======================(Called from ULP Thread)======================================= */ virtual void setPositionModeCommand(LocPosMode& locPosMode); @@ -179,20 +181,20 @@ public: bool hasMeasurementsCallback(LocationAPI* client); bool isTrackingSession(LocationAPI* client, uint32_t sessionId); void saveTrackingSession(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options); + const TrackingOptions& trackingOptions); void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); bool setUlpPositionMode(const LocPosMode& mode); LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options); + const TrackingOptions& trackingOptions); bool startTracking(LocationAPI* client, uint32_t sessionId, - const LocationOptions& options); + const TrackingOptions& trackingOptions); bool stopTrackingMultiplex(LocationAPI* client, uint32_t id); bool stopTracking(LocationAPI* client, uint32_t id); bool updateTrackingMultiplex(LocationAPI* client, uint32_t id, - const LocationOptions& options); + const TrackingOptions& trackingOptions); bool updateTracking(LocationAPI* client, uint32_t sessionId, - const LocationOptions& updatedOptions, const LocationOptions& oldOptions); + const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 0dac13d5..34903950 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -39,8 +39,8 @@ static void addClient(LocationAPI* client, const LocationCallbacks& callbacks); static void removeClient(LocationAPI* client); static void requestCapabilities(LocationAPI* client); -static uint32_t startTracking(LocationAPI* client, LocationOptions& options); -static void updateTrackingOptions(LocationAPI* client, uint32_t id, LocationOptions& options); +static uint32_t startTracking(LocationAPI* client, TrackingOptions&); +static void updateTrackingOptions(LocationAPI* client, uint32_t id, TrackingOptions&); static void stopTracking(LocationAPI* client, uint32_t id); static void gnssNiResponse(LocationAPI* client, uint32_t id, GnssNiResponse response); @@ -143,19 +143,22 @@ static void requestCapabilities(LocationAPI* client) } } -static uint32_t startTracking(LocationAPI* client, LocationOptions& options) +static uint32_t startTracking( + LocationAPI* client, TrackingOptions& trackingOptions) { if (NULL != gGnssAdapter) { - return gGnssAdapter->startTrackingCommand(client, options); + return gGnssAdapter->startTrackingCommand(client, trackingOptions); } else { return 0; } } -static void updateTrackingOptions(LocationAPI* client, uint32_t id, LocationOptions& options) +static void updateTrackingOptions( + LocationAPI* client, uint32_t id, TrackingOptions& trackingOptions) { if (NULL != gGnssAdapter) { - gGnssAdapter->updateTrackingOptionsCommand(client, id, options); + gGnssAdapter->updateTrackingOptionsCommand( + client, id, trackingOptions); } } diff --git a/location/ILocationAPI.h b/location/ILocationAPI.h index ae695cf8..3df6f799 100644 --- a/location/ILocationAPI.h +++ b/location/ILocationAPI.h @@ -53,7 +53,7 @@ public: LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameter is invalid */ - virtual uint32_t startTracking(LocationOptions&) = 0; + virtual uint32_t startTracking(TrackingOptions&) = 0; /** @brief Stops a tracking session associated with id parameter. responseCallback returns: @@ -66,7 +66,7 @@ public: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ - virtual void updateTrackingOptions(uint32_t id, LocationOptions&) = 0; + virtual void updateTrackingOptions(uint32_t id, TrackingOptions&) = 0; /* ================================== BATCHING ================================== */ @@ -86,7 +86,7 @@ public: LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ - virtual uint32_t startBatching(LocationOptions&, BatchingOptions&) = 0; + virtual uint32_t startBatching(BatchingOptions&) = 0; /** @brief Stops a batching session associated with id parameter. responseCallback returns: @@ -99,7 +99,7 @@ public: LOCATION_ERROR_SUCCESS if successful LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ - virtual void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&) = 0; + virtual void updateBatchingOptions(uint32_t id, BatchingOptions&) = 0; /** @brief Gets a number of locations that are currently stored/batched on the low power processor, delivered by the batchingCallback passed in createInstance. diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 060ce5f2..581158bd 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -25,6 +25,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_LocationAPI" #include @@ -289,21 +290,21 @@ LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) } uint32_t -LocationAPI::startTracking(LocationOptions& locationOptions) +LocationAPI::startTracking(TrackingOptions& trackingOptions) { uint32_t id = 0; pthread_mutex_lock(&gDataMutex); auto it = gData.clientData.find(this); if (it != gData.clientData.end()) { - if (gData.flpInterface != NULL && locationOptions.minDistance > 0) { - id = gData.flpInterface->startTracking(this, locationOptions); - } else if (gData.gnssInterface != NULL && needsGnssTrackingInfo(it->second)) { - id = gData.gnssInterface->startTracking(this, locationOptions); - } else if (gData.flpInterface != NULL) { - id = gData.flpInterface->startTracking(this, locationOptions); - } else if (gData.gnssInterface != NULL) { - id = gData.gnssInterface->startTracking(this, locationOptions); + if (NULL != gData.flpInterface && trackingOptions.minDistance > 0) { + id = gData.flpInterface->startTracking(this, trackingOptions); + } else if (NULL != gData.gnssInterface && needsGnssTrackingInfo(it->second)) { + id = gData.gnssInterface->startTracking(this, trackingOptions); + } else if (NULL != gData.flpInterface) { + id = gData.flpInterface->startTracking(this, trackingOptions); + } else if (NULL != gData.gnssInterface) { + id = gData.gnssInterface->startTracking(this, trackingOptions); } else { LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", __func__, __LINE__, this); @@ -345,7 +346,8 @@ LocationAPI::stopTracking(uint32_t id) } void -LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions) +LocationAPI::updateTrackingOptions( + uint32_t id, TrackingOptions& trackingOptions) { pthread_mutex_lock(&gDataMutex); @@ -354,10 +356,10 @@ LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions // we don't know if tracking was started on flp or gnss, so we call update on both, where // updateTracking call to the incorrect interface will fail without response back to client if (gData.gnssInterface != NULL) { - gData.gnssInterface->updateTrackingOptions(this, id, locationOptions); + gData.gnssInterface->updateTrackingOptions(this, id, trackingOptions); } if (gData.flpInterface != NULL) { - gData.flpInterface->updateTrackingOptions(this, id, locationOptions); + gData.flpInterface->updateTrackingOptions(this, id, trackingOptions); } if (gData.flpInterface == NULL && gData.gnssInterface == NULL) { LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", @@ -372,13 +374,13 @@ LocationAPI::updateTrackingOptions(uint32_t id, LocationOptions& locationOptions } uint32_t -LocationAPI::startBatching(LocationOptions& locationOptions, BatchingOptions &batchingOptions) +LocationAPI::startBatching(BatchingOptions &batchingOptions) { uint32_t id = 0; pthread_mutex_lock(&gDataMutex); - if (gData.flpInterface != NULL) { - id = gData.flpInterface->startBatching(this, locationOptions, batchingOptions); + if (NULL != gData.flpInterface) { + id = gData.flpInterface->startBatching(this, batchingOptions); } else { LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", __func__, __LINE__, this); @@ -393,7 +395,7 @@ LocationAPI::stopBatching(uint32_t id) { pthread_mutex_lock(&gDataMutex); - if (gData.flpInterface != NULL) { + if (NULL != gData.flpInterface) { gData.flpInterface->stopBatching(this, id); } else { LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", @@ -404,16 +406,12 @@ LocationAPI::stopBatching(uint32_t id) } void -LocationAPI::updateBatchingOptions(uint32_t id, - LocationOptions& locationOptions, BatchingOptions& batchOptions) +LocationAPI::updateBatchingOptions(uint32_t id, BatchingOptions& batchOptions) { pthread_mutex_lock(&gDataMutex); - if (gData.flpInterface != NULL) { - gData.flpInterface->updateBatchingOptions(this, - id, - locationOptions, - batchOptions); + if (NULL != gData.flpInterface) { + gData.flpInterface->updateBatchingOptions(this, id, batchOptions); } else { LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", __func__, __LINE__, this); diff --git a/location/LocationAPI.h b/location/LocationAPI.h index cfdb19f2..f4f31f96 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -63,8 +63,8 @@ public: LOCATION_ERROR_SUCCESS if session was successfully started LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed in createInstance - LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameter is invalid */ - virtual uint32_t startTracking(LocationOptions&) override; + LOCATION_ERROR_INVALID_PARAMETER if TrackingOptions parameter is invalid */ + virtual uint32_t startTracking(TrackingOptions&) override; /* stopTracking stops a tracking session associated with id parameter. responseCallback returns: @@ -72,12 +72,12 @@ public: LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ virtual void stopTracking(uint32_t id) override; - /* updateTrackingOptions changes the LocationOptions of a tracking session associated with id + /* updateTrackingOptions changes the TrackingOptions of a tracking session associated with id responseCallback returns: LOCATION_ERROR_SUCCESS if successful - LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_INVALID_PARAMETER if TrackingOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */ - virtual void updateTrackingOptions(uint32_t id, LocationOptions&) override; + virtual void updateTrackingOptions(uint32_t id, TrackingOptions&) override; /* ================================== BATCHING ================================== */ @@ -96,7 +96,7 @@ public: LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */ - virtual uint32_t startBatching(LocationOptions&, BatchingOptions&) override; + virtual uint32_t startBatching(BatchingOptions&) override; /* stopBatching stops a batching session associated with id parameter. responseCallback returns: @@ -104,12 +104,12 @@ public: LOCATION_ERROR_ID_UNKNOWN if id is not associated with batching session */ virtual void stopBatching(uint32_t id) override; - /* updateBatchingOptions changes the LocationOptions of a batching session associated with id + /* updateBatchingOptions changes the BatchingOptions of a batching session associated with id responseCallback returns: LOCATION_ERROR_SUCCESS if successful - LOCATION_ERROR_INVALID_PARAMETER if LocationOptions parameters are invalid + LOCATION_ERROR_INVALID_PARAMETER if BatchingOptions parameters are invalid LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */ - virtual void updateBatchingOptions(uint32_t id, LocationOptions&, BatchingOptions&) override; + virtual void updateBatchingOptions(uint32_t id, BatchingOptions&) override; /* getBatchedLocations gets a number of locations that are currently stored/batched on the low power processor, delivered by the batchingCallback passed in createInstance. diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 65a09847..67e559b9 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -330,7 +330,7 @@ LocationAPIClientBase::~LocationAPIClientBase() pthread_mutex_destroy(&mMutex); } -uint32_t LocationAPIClientBase::locAPIStartTracking(LocationOptions& options) +uint32_t LocationAPIClientBase::locAPIStartTracking(TrackingOptions& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); @@ -372,7 +372,7 @@ void LocationAPIClientBase::locAPIStopTracking() pthread_mutex_unlock(&mMutex); } -void LocationAPIClientBase::locAPIUpdateTrackingOptions(LocationOptions& options) +void LocationAPIClientBase::locAPIUpdateTrackingOptions(TrackingOptions& options) { pthread_mutex_lock(&mMutex); if (mLocationAPI) { @@ -404,9 +404,8 @@ int32_t LocationAPIClientBase::locAPIGetBatchSize() return mBatchSize; } - -uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t sessionMode, - LocationOptions& locationOptions) +uint32_t LocationAPIClientBase::locAPIStartSession( + uint32_t id, uint32_t sessionMode, TrackingOptions&& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); @@ -420,7 +419,7 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session uint32_t batchingSession = 0; if (sessionMode == SESSION_MODE_ON_FIX) { - trackingSession = mLocationAPI->startTracking(locationOptions); + trackingSession = mLocationAPI->startTracking(options); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, trackingSession); mRequestQueues[REQUEST_SESSION].push(new StartTrackingRequest(*this)); } else { @@ -439,7 +438,12 @@ uint32_t LocationAPIClientBase::locAPIStartSession(uint32_t id, uint32_t session break; } - batchingSession = mLocationAPI->startBatching(locationOptions, batchOptions); + // Populate location option values + batchOptions.minDistance = options.minDistance; + batchOptions.minInterval = options.minInterval; + batchOptions.mode = options.mode; + + batchingSession = mLocationAPI->startBatching(batchOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); mRequestQueues[REQUEST_SESSION].setSession(batchingSession); mRequestQueues[REQUEST_SESSION].push(new StartBatchingRequest(*this)); @@ -496,8 +500,8 @@ uint32_t LocationAPIClientBase::locAPIStopSession(uint32_t id) return retVal; } -uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, - LocationOptions& options) +uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions( + uint32_t id, uint32_t sessionMode, TrackingOptions&& options) { uint32_t retVal = LOCATION_ERROR_GENERAL_FAILURE; pthread_mutex_lock(&mMutex); @@ -554,13 +558,18 @@ uint32_t LocationAPIClientBase::locAPIUpdateSessionOptions(uint32_t id, uint32_t mLocationAPI->stopTracking(trackingSession); trackingSession = 0; + // Populate location option values + batchOptions.minDistance = options.minDistance; + batchOptions.minInterval = options.minInterval; + batchOptions.mode = options.mode; + // start batching - batchingSession = mLocationAPI->startBatching(options, batchOptions); + batchingSession = mLocationAPI->startBatching(batchOptions); LOC_LOGI("%s:%d] start new session: %d", __FUNCTION__, __LINE__, batchingSession); mRequestQueues[REQUEST_SESSION].setSession(batchingSession); } else { - mLocationAPI->updateBatchingOptions(batchingSession, options, batchOptions); + mLocationAPI->updateBatchingOptions(batchingSession, batchOptions); } } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 4d48932a..bcc39f3c 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -209,16 +209,16 @@ public: LocationAPIRequest* getRequestBySession(uint32_t session); // LocationAPI - uint32_t locAPIStartTracking(LocationOptions& options); + uint32_t locAPIStartTracking(TrackingOptions& trackingOptions); void locAPIStopTracking(); - void locAPIUpdateTrackingOptions(LocationOptions& options); + void locAPIUpdateTrackingOptions(TrackingOptions& trackingOptions); int32_t locAPIGetBatchSize(); - uint32_t locAPIStartSession(uint32_t id, uint32_t sessionMode, - LocationOptions& options); + uint32_t locAPIStartSession( + uint32_t id, uint32_t sessionMode, TrackingOptions&& trackingOptions); uint32_t locAPIStopSession(uint32_t id); - uint32_t locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, - LocationOptions& options); + uint32_t locAPIUpdateSessionOptions( + uint32_t id, uint32_t sessionMode, TrackingOptions&& trackingOptions); uint32_t locAPIGetBatchedLocations(uint32_t id, size_t count); uint32_t locAPIAddGeofences(size_t count, uint32_t* ids, diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 5d1c8093..9809e616 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -533,18 +533,60 @@ typedef struct { LocationTechnologyMask techMask; } Location; -typedef struct { +struct LocationOptions { size_t size; // set to sizeof(LocationOptions) uint32_t minInterval; // in milliseconds uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ // gnssMeasurementsCallback may not be called GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted -} LocationOptions; -typedef struct { - size_t size; + inline LocationOptions() : + size(0), minInterval(0), minDistance(0), mode(GNSS_SUPL_MODE_STANDALONE) {} +}; + +typedef enum { + GNSS_POWER_MODE_INVALID = 0, + GNSS_POWER_MODE_M1, /* Improved Accuracy Mode */ + GNSS_POWER_MODE_M2, /* Normal Mode */ + GNSS_POWER_MODE_M3, /* Background Mode */ + GNSS_POWER_MODE_M4, /* Background Mode */ + GNSS_POWER_MODE_M5 /* Background Mode */ +} GnssPowerMode; + +struct TrackingOptions : LocationOptions { + GnssPowerMode powerMode; /* Power Mode to be used for time based tracking + sessions */ + uint32_t tbm; /* Time interval between measurements specified in millis. + Applicable to background power modes */ + + inline TrackingOptions() : + LocationOptions(), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} + inline TrackingOptions(size_t s, GnssPowerMode m, uint32_t t) : + LocationOptions(), powerMode(m), tbm(t) { LocationOptions::size = s; } + inline TrackingOptions(const LocationOptions& options) : + LocationOptions(options), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} + inline void setLocationOptions(const LocationOptions& options) { + minInterval = options.minInterval; + minDistance = options.minDistance; + mode = options.mode; + } +}; + +struct BatchingOptions : LocationOptions { BatchingMode batchingMode; -} BatchingOptions; + + inline BatchingOptions() : + LocationOptions(), batchingMode(BATCHING_MODE_ROUTINE) {} + inline BatchingOptions(size_t s, BatchingMode m) : + LocationOptions(), batchingMode(m) { LocationOptions::size = s; } + inline BatchingOptions(const LocationOptions& options) : + LocationOptions(options), batchingMode(BATCHING_MODE_ROUTINE) {} + inline void setLocationOptions(const LocationOptions& options) { + minInterval = options.minInterval; + minDistance = options.minDistance; + mode = options.mode; + } +}; typedef struct { size_t size; diff --git a/location/location_interface.h b/location/location_interface.h index f4f904d9..a460bb62 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -39,8 +39,8 @@ struct GnssInterface { void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); void (*removeClient)(LocationAPI* client); void (*requestCapabilities)(LocationAPI* client); - uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); - void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); + uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); + void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); void (*stopTracking)(LocationAPI* client, uint32_t id); void (*gnssNiResponse)(LocationAPI* client, uint32_t id, GnssNiResponse response); void (*setControlCallbacks)(LocationControlCallbacks& controlCallbacks); @@ -70,13 +70,12 @@ struct FlpInterface { void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); void (*removeClient)(LocationAPI* client); void (*requestCapabilities)(LocationAPI* client); - uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); - void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); + uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); + void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); void (*stopTracking)(LocationAPI* client, uint32_t id); - uint32_t (*startBatching)(LocationAPI* client, LocationOptions&, BatchingOptions&); + uint32_t (*startBatching)(LocationAPI* client, BatchingOptions&); void (*stopBatching)(LocationAPI* client, uint32_t id); - void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, LocationOptions&, - BatchingOptions&); + void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, BatchingOptions&); void (*getBatchedLocations)(LocationAPI* client, uint32_t id, size_t count); void (*getPowerStateChanges)(void* powerStateCb); }; diff --git a/utils/gps_extended.h b/utils/gps_extended.h index dc6ad1eb..24556299 100644 --- a/utils/gps_extended.h +++ b/utils/gps_extended.h @@ -55,14 +55,19 @@ struct LocPosMode bool share_position; char credentials[14]; char provider[8]; + GnssPowerMode powerMode; + uint32_t timeBetweenMeasurements; LocPosMode(LocPositionMode m, LocGpsPositionRecurrence recr, uint32_t gap, uint32_t accu, uint32_t time, - bool sp, const char* cred, const char* prov) : + bool sp, const char* cred, const char* prov, + GnssPowerMode pMode = GNSS_POWER_MODE_INVALID, + uint32_t tbm = 0) : 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) { + share_position(sp), powerMode(pMode), + timeBetweenMeasurements(tbm) { memset(credentials, 0, sizeof(credentials)); memset(provider, 0, sizeof(provider)); if (NULL != cred) { @@ -78,7 +83,8 @@ struct LocPosMode recurrence(LOC_GPS_POSITION_RECURRENCE_PERIODIC), min_interval(GPS_DEFAULT_FIX_INTERVAL_MS), preferred_accuracy(50), preferred_time(120000), - share_position(true) { + share_position(true), powerMode(GNSS_POWER_MODE_INVALID), + timeBetweenMeasurements(GPS_DEFAULT_FIX_INTERVAL_MS) { memset(credentials, 0, sizeof(credentials)); memset(provider, 0, sizeof(provider)); } @@ -90,6 +96,8 @@ struct LocPosMode anotherMode.min_interval == min_interval && anotherMode.preferred_accuracy == preferred_accuracy && anotherMode.preferred_time == preferred_time && + anotherMode.powerMode == powerMode && + anotherMode.timeBetweenMeasurements == timeBetweenMeasurements && !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) && !strncmp(anotherMode.provider, provider, sizeof(provider)-1); } diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 5c5405fe..5db1b130 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -95,6 +95,9 @@ typedef uint32_t LocSvInfoSource; #define LOC_AGPS_CERTIFICATE_MAX_LENGTH 2000 #define LOC_AGPS_CERTIFICATE_MAX_SLOTS 10 +/* TBM Threshold for tracking in background power mode : in millis */ +#define TRACKING_TBM_THRESHOLD_MILLIS 480000 + typedef uint32_t LocPosTechMask; #define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000) #define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001) From 98edc19bea3cf5787e5af903c8408dede420be58 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sun, 8 Apr 2018 23:35:14 +0530 Subject: [PATCH 680/945] FR 48850 - Device based hybrid ODCPI Adding support for sending ODCPI request to framework via IGnss interface. Change-Id: I97ab4f00505705fedc266998602499fd344baf31 CRs-Fixed: 2217664 --- android/Gnss.cpp | 37 +++++++++- android/Gnss.h | 4 + android/location_api/LocationUtil.cpp | 83 ++++++++++++++++----- android/location_api/LocationUtil.h | 1 + core/LocAdapterBase.cpp | 4 + core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 9 +++ core/LocApiBase.h | 3 + gnss/GnssAdapter.cpp | 102 ++++++++++++++++++++++++++ gnss/GnssAdapter.h | 19 ++++- gnss/location_gnss.cpp | 20 +++++ location/location_interface.h | 2 + utils/gps_extended_c.h | 14 ++++ 13 files changed, 280 insertions(+), 19 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 36598236..5cec786a 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -25,6 +25,8 @@ #include #include #include "Gnss.h" +#include + typedef void* (getLocationInterface)(); #define IMAGES_INFO_FILE "/sys/devices/soc0/images" @@ -372,6 +374,14 @@ Return> Gnss::getExtensionAGnssRil() { Return Gnss::setCallback_1_1(const sp& callback) { ENTRY_LOG_CALLFLOW(); callback->gnssNameCb(getVersionString()); + mGnssCbIface_1_1 = callback; + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { + odcpiRequestCb(odcpiRequest); + }; + gnssInterface->odcpiInit(cb); + } return setCallback(callback); } @@ -407,11 +417,36 @@ Return> Gnss::getExtensionGnssConfiguration_1_1() { return mGnssConfig; } -Return Gnss::injectBestLocation(const GnssLocation&) { +Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + Location location = {}; + convertGnssLocation(gnssLocation, location); + gnssInterface->odcpiInject(location); + } return true; } +void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface_1_1 != nullptr) { + // For emergency mode, request DBH (Device based hybrid) location + // Mark Independent from GNSS flag to false. + if (ODCPI_REQUEST_TYPE_START == request.type) { + if (request.isEmergencyMode) { + mGnssCbIface_1_1->gnssRequestLocationCb(false); + } else { + mGnssCbIface_1_1->gnssRequestLocationCb(true); + } + } else { + LOC_LOGv("Unsupported ODCPI request type: %d", request.type); + } + } else { + LOC_LOGe("ODCPI request not supported."); + } +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/Gnss.h b/android/Gnss.h index c562b1fb..4c0c8b05 100644 --- a/android/Gnss.h +++ b/android/Gnss.h @@ -111,6 +111,9 @@ struct Gnss : public IGnss { Return updateConfiguration(GnssConfig& gnssConfig); GnssInterface* getGnssInterface(); + // Callback for ODCPI request + void odcpiRequestCb(const OdcpiRequestInfo& request); + private: struct GnssDeathRecipient : hidl_death_recipient { GnssDeathRecipient(sp gnss) : mGnss(gnss) { @@ -134,6 +137,7 @@ struct Gnss : public IGnss { GnssAPIClient* mApi = nullptr; sp mGnssCbIface = nullptr; + sp mGnssCbIface_1_1 = nullptr; sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; GnssInterface* mGnssInterface = nullptr; diff --git a/android/location_api/LocationUtil.cpp b/android/location_api/LocationUtil.cpp index 7f3a74bc..f1d051c1 100644 --- a/android/location_api/LocationUtil.cpp +++ b/android/location_api/LocationUtil.cpp @@ -42,34 +42,83 @@ using ::android::hardware::gnss::V1_0::GnssLocationFlags; void convertGnssLocation(Location& in, GnssLocation& out) { memset(&out, 0, sizeof(GnssLocation)); - if (in.flags & LOCATION_HAS_LAT_LONG_BIT) + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG; - if (in.flags & LOCATION_HAS_ALTITUDE_BIT) + out.latitudeDegrees = in.latitude; + out.longitudeDegrees = in.longitude; + } + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE; - if (in.flags & LOCATION_HAS_SPEED_BIT) + out.altitudeMeters = in.altitude; + } + if (in.flags & LOCATION_HAS_SPEED_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED; - if (in.flags & LOCATION_HAS_BEARING_BIT) + out.speedMetersPerSec = in.speed; + } + if (in.flags & LOCATION_HAS_BEARING_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING; - if (in.flags & LOCATION_HAS_ACCURACY_BIT) + out.bearingDegrees = in.bearing; + } + if (in.flags & LOCATION_HAS_ACCURACY_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY; - if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) + out.horizontalAccuracyMeters = in.accuracy; + } + if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; - if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) + out.verticalAccuracyMeters = in.verticalAccuracy; + } + if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; - if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) + out.speedAccuracyMetersPerSecond = in.speedAccuracy; + } + if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; - out.latitudeDegrees = in.latitude; - out.longitudeDegrees = in.longitude; - out.altitudeMeters = in.altitude; - out.speedMetersPerSec = in.speed; - out.bearingDegrees = in.bearing; - out.horizontalAccuracyMeters = in.accuracy; - out.verticalAccuracyMeters = in.verticalAccuracy; - out.speedAccuracyMetersPerSecond = in.speedAccuracy; - out.bearingAccuracyDegrees = in.bearingAccuracy; + out.bearingAccuracyDegrees = in.bearingAccuracy; + } + out.timestamp = static_cast(in.timestamp); } +void convertGnssLocation(const GnssLocation& in, Location& out) +{ + memset(&out, 0, sizeof(out)); + if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) { + out.flags |= LOCATION_HAS_LAT_LONG_BIT; + out.latitude = in.latitudeDegrees; + out.longitude = in.longitudeDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) { + out.flags |= LOCATION_HAS_ALTITUDE_BIT; + out.altitude = in.altitudeMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) { + out.flags |= LOCATION_HAS_SPEED_BIT; + out.speed = in.speedMetersPerSec; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) { + out.flags |= LOCATION_HAS_BEARING_BIT; + out.bearing = in.bearingDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) { + out.flags |= LOCATION_HAS_ACCURACY_BIT; + out.accuracy = in.horizontalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) { + out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; + out.verticalAccuracy = in.verticalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) { + out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT; + out.speedAccuracy = in.speedAccuracyMetersPerSecond; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) { + out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; + out.bearingAccuracy = in.bearingAccuracyDegrees; + } + + out.timestamp = static_cast(in.timestamp); +} + void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) { switch(in) { diff --git a/android/location_api/LocationUtil.h b/android/location_api/LocationUtil.h index acc0eabc..63f4f6f0 100644 --- a/android/location_api/LocationUtil.h +++ b/android/location_api/LocationUtil.h @@ -41,6 +41,7 @@ namespace V1_1 { namespace implementation { void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5f98456c..267d539f 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -173,4 +173,8 @@ DEFAULT_IMPL() void LocAdapterBase::reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& /*config*/) DEFAULT_IMPL() +bool LocAdapterBase:: + requestOdcpiEvent(OdcpiRequestInfo& /*request*/) +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 9fcee128..2083ac41 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -160,6 +160,7 @@ public: GpsLocationExtended &location_extended, LocPosTechMask tech_mask); virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); + virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 9c547261..3eec209b 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -288,6 +288,11 @@ void LocApiBase::reportZppBestAvailableFix(LocGpsLocation &zppLoc, location_extended, tech_mask)); } +void LocApiBase::requestOdcpi(OdcpiRequestInfo& request) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestOdcpiEvent(request)); +} void LocApiBase::reportSv(GnssSvNotification& svNotify) { @@ -467,6 +472,10 @@ void LocApiBase:: injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/) DEFAULT_IMPL() +void LocApiBase:: + injectPosition(const Location& /*location*/, bool /*onDemandCpi*/) +DEFAULT_IMPL() + void LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) DEFAULT_IMPL() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 17ccc4ef..7b3aee32 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -159,6 +159,7 @@ public: LocPosTechMask tech_mask); void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); + void requestOdcpi(OdcpiRequestInfo& request); // downward calls // All below functions are to be defined by adapter specific modules: @@ -174,6 +175,8 @@ public: virtual void injectPosition(double latitude, double longitude, float accuracy); + virtual void + injectPosition(const Location& location, bool onDemandCpi); virtual void setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 0bbc3f5c..703eec8e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -80,6 +80,9 @@ GnssAdapter::GnssAdapter() : mNiData(), mAgpsManager(), mAgpsCbInfo(), + mOdcpiRequestCb(nullptr), + mOdcpiRequestActive(false), + mOdcpiInjectedPositionCount(0), mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) @@ -1865,6 +1868,11 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; } + // Add ODCPI handling + if (nullptr != mOdcpiRequestCb) { + mask |= LOC_API_ADAPTER_BIT_REQUEST_WIFI; + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } @@ -3389,6 +3397,100 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) mEngHubProxy->gnssReportSvPolynomial(svPolynomial); } +bool +GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request) +{ + LOC_LOGd("ODCPI request: type %d, tbf %d, isEmergency %d", request.type, + request.tbfMillis, request.isEmergencyMode); + + struct MsgRequestOdcpi : public LocMsg { + GnssAdapter& mAdapter; + OdcpiRequestInfo mOdcpiRequest; + inline MsgRequestOdcpi(GnssAdapter& adapter, OdcpiRequestInfo& request) : + LocMsg(), + mAdapter(adapter), + mOdcpiRequest(request) {} + inline virtual void proc() const { + mAdapter.requestOdcpi(mOdcpiRequest); + } + }; + + sendMsg(new MsgRequestOdcpi(*this, request)); + return true; +} + +void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request) +{ + if (nullptr != mOdcpiRequestCb) { + mOdcpiInjectedPositionCount = 0; + if (ODCPI_REQUEST_TYPE_START == request.type) { + mOdcpiRequestCb(request); + mOdcpiRequestActive = true; + } else { + mOdcpiRequestActive = false; + } + } else { + LOC_LOGe("ODCPI request not supported"); + } +} + +void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback) +{ + struct MsgInitOdcpi : public LocMsg { + GnssAdapter& mAdapter; + OdcpiRequestCallback mOdcpiCb; + inline MsgInitOdcpi(GnssAdapter& adapter, + const OdcpiRequestCallback& callback) : + LocMsg(), + mAdapter(adapter), + mOdcpiCb(callback) {} + inline virtual void proc() const { + mAdapter.initOdcpi(mOdcpiCb); + } + }; + + sendMsg(new MsgInitOdcpi(*this, callback)); +} + +void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback) +{ + mOdcpiRequestCb = callback; + + /* Register for WIFI request */ + updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI, + LOC_REGISTRATION_MASK_ENABLED); +} + +void GnssAdapter::injectOdcpiCommand(const Location& location) +{ + struct MsgInjectOdcpi : public LocMsg { + GnssAdapter& mAdapter; + Location mLocation; + inline MsgInjectOdcpi(GnssAdapter& adapter, const Location& location) : + LocMsg(), + mAdapter(adapter), + mLocation(location) {} + inline virtual void proc() const { + mAdapter.injectOdcpi(mLocation); + } + }; + + sendMsg(new MsgInjectOdcpi(*this, location)); +} + +void GnssAdapter::injectOdcpi(const Location& location) +{ + mLocApi->injectPosition(location, true); + if (mOdcpiRequestActive) { + mOdcpiInjectedPositionCount++; + if (mOdcpiInjectedPositionCount >= + ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST) { + mOdcpiRequestActive = false; + mOdcpiInjectedPositionCount = 0; + } + } +} + void GnssAdapter::initDefaultAgps() { LOC_LOGD("%s]: ", __func__); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index ff66de43..277cc2a8 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -45,6 +45,7 @@ #define MAX_SATELLITES_IN_USE 12 #define LOC_NI_NO_RESPONSE_TIME 20 #define LOC_GPS_NI_RESPONSE_IGNORE 4 +#define ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST 30 class GnssAdapter; @@ -110,12 +111,17 @@ class GnssAdapter : public LocAdapterBase { /* ==== NI ============================================================================= */ NiData mNiData; - /* ==== AGPS ========================================================*/ + /* ==== AGPS =========================================================================== */ // This must be initialized via initAgps() AgpsManager mAgpsManager; AgpsCbInfo mAgpsCbInfo; void initAgps(const AgpsCbInfo& cbInfo); + /* ==== ODCPI ========================================================================== */ + OdcpiRequestCallback mOdcpiRequestCb; + bool mOdcpiRequestActive; + uint32_t mOdcpiInjectedPositionCount; + /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; std::string mServerUrl; @@ -129,6 +135,10 @@ class GnssAdapter : public LocAdapterBase { static void convertLocationInfo(GnssLocationInfoNotification& out, const GpsLocationExtended& locationExtended); + /* ======== UTILITIES ================================================================== */ + inline void initOdcpi(const OdcpiRequestCallback& callback); + inline void injectOdcpi(const Location& location); + public: GnssAdapter(); @@ -250,6 +260,11 @@ public: void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); + /* ========= ODCPI ===================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void initOdcpiCommand(const OdcpiRequestCallback& callback); + void injectOdcpiCommand(const Location& location); + /* ======== RESPONSES ================================================================== */ void reportResponse(LocationError err, uint32_t sessionId); void reportResponse(size_t count, LocationError* errs, uint32_t* ids); @@ -290,6 +305,7 @@ public: virtual bool reportDataCallClosed(); virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, LocPosTechMask tech_mask); + virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, @@ -304,6 +320,7 @@ public: void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); + void requestOdcpi(const OdcpiRequestInfo& request); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 34903950..105145a4 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -67,6 +67,9 @@ static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); static void updateConnectionStatus(bool connected, int8_t type); +static void odcpiInit(const OdcpiRequestCallback& callback); +static void odcpiInject(const Location& location); + static const GnssInterface gGnssInterface = { sizeof(GnssInterface), initialize, @@ -96,6 +99,8 @@ static const GnssInterface gGnssInterface = { agpsDataConnFailed, getDebugReport, updateConnectionStatus, + odcpiInit, + odcpiInject, }; #ifndef DEBUG_X86 @@ -307,3 +312,18 @@ static void updateConnectionStatus(bool connected, int8_t type) { gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); } } + +static void odcpiInit(const OdcpiRequestCallback& callback) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->initOdcpiCommand(callback); + } +} + +static void odcpiInject(const Location& location) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->injectOdcpiCommand(location); + } +} + diff --git a/location/location_interface.h b/location/location_interface.h index a460bb62..3c1558e9 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -61,6 +61,8 @@ struct GnssInterface { void (*agpsDataConnFailed)(AGpsExtType agpsType); void (*getDebugReport)(GnssDebugReport& report); void (*updateConnectionStatus)(bool connected, int8_t type); + void (*odcpiInit)(const OdcpiRequestCallback& callback); + void (*odcpiInject)(const Location& location); }; struct FlpInterface { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 5db1b130..c0b97af2 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1514,6 +1514,20 @@ struct AGnssExtStatusIpV6 { uint8_t ipV6Addr[16]; }; +/* ODCPI Request Info */ +enum OdcpiRequestType { + ODCPI_REQUEST_TYPE_START, + ODCPI_REQUEST_TYPE_STOP +}; +struct OdcpiRequestInfo { + size_t size; + OdcpiRequestType type; + uint32_t tbfMillis; + bool isEmergencyMode; +}; +/* Callback to send ODCPI request to framework */ +typedef std::function OdcpiRequestCallback; + /* * Callback with AGNSS(IpV4) status information. * From daff821d9cc4028c7a5637e3c359806bf61443ca Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 5 Jun 2018 12:59:11 +0800 Subject: [PATCH 681/945] Include filesystem_config header from cutils We can not include header file from private folder. Include it from cutils instead. Change-Id: Ib0995ecfa1bef600c346bc5d055212103578fcae CRs-Fixed: 2254045 --- pla/android/loc_pla.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pla/android/loc_pla.h b/pla/android/loc_pla.h index bedb079c..6b38fa73 100644 --- a/pla/android/loc_pla.h +++ b/pla/android/loc_pla.h @@ -41,7 +41,7 @@ extern "C" { #include #include #include -#include +#include #define UID_GPS (AID_GPS) #define GID_GPS (AID_GPS) From ed7d229dea05777ac0d1078f0bd51449c0e4ac59 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 21 May 2018 14:33:14 -0700 Subject: [PATCH 682/945] Add AGC value for QZSS measurement report Add AGC value for QZSS measurement report to Android framework - value is the same as GPS Change-Id: I1e3106d99d124945be7f1bda725a413be11a75e6 CRs-fixed: 2245786 --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 703eec8e..9a722bef 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -4084,6 +4084,7 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m for (size_t i = 0; i < measurements.count; i++) { switch (measurements.measurements[i].svType) { case GNSS_SV_TYPE_GPS: + case GNSS_SV_TYPE_QZSS: measurements.measurements[i].agcLevelDb = reports.mRfAndParams.back().mAgcGps; measurements.measurements[i].flags |= @@ -4111,7 +4112,6 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; break; - case GNSS_SV_TYPE_QZSS: case GNSS_SV_TYPE_SBAS: case GNSS_SV_TYPE_UNKNOWN: default: From 0344cc790152c8301bf05038fa0d8287c85823c9 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 4 Jun 2018 13:16:59 -0700 Subject: [PATCH 683/945] Change prototype of getWwanZppFix API No need for return value as it will be handled asynchronously. CRs-Fixed: 2250516 Change-Id: I7c3ce33cb61688a8cb206c397a69bf192c92beb1 --- core/LocApiBase.cpp | 4 ++-- core/LocApiBase.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3eec209b..c1e08020 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -576,9 +576,9 @@ DEFAULT_IMPL(0) GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/) DEFAULT_IMPL(0) -enum loc_api_adapter_err LocApiBase:: +void LocApiBase:: getWwanZppFix() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +DEFAULT_IMPL() void LocApiBase:: getBestAvailableZppFix() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 7b3aee32..4db51fa1 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -235,10 +235,8 @@ public: virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); - virtual enum loc_api_adapter_err - getWwanZppFix(); - virtual void - getBestAvailableZppFix(); + virtual void getWwanZppFix(); + virtual void getBestAvailableZppFix(); virtual int initDataServiceClient(bool isDueToSsr); virtual int openAndStartDataCall(); virtual void stopDataCall(); From 745505e5bea3ff9be676d7a539a854cf62711b76 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 24 May 2018 11:09:33 -0700 Subject: [PATCH 684/945] Vote for internal modem only Vote for internal modem only in power vote temporary fix until we process a .jsn file Change-Id: I732f920a0c18976b0f1323501e0e5541b11d5887 CRs-fixed: 2247589 --- core/ContextBase.cpp | 3 +++ core/ContextBase.h | 1 + etc/gps.conf | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index e7ee8bf1..5695544a 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -71,6 +71,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'}, {"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'}, + {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' }, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -122,6 +123,8 @@ void ContextBase::readConfig() mGps_conf.LPPE_CP_TECHNOLOGY = 0; /* By default no LPPe UP technology is enabled*/ mGps_conf.LPPE_UP_TECHNOLOGY = 0; + /* By default we use unknown modem type*/ + mGps_conf.MODEM_TYPE = 2; /*Defaults for sap.conf*/ mSap_conf.GYRO_BIAS_RANDOM_WALK = 0; diff --git a/core/ContextBase.h b/core/ContextBase.h index e7edb296..fca381f3 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -67,6 +67,7 @@ typedef struct loc_gps_cfg_s uint32_t EXTERNAL_DR_ENABLED; char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; uint32_t SUPL_PORT; + uint32_t MODEM_TYPE; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/etc/gps.conf b/etc/gps.conf index 7653408d..51c0b965 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -229,3 +229,13 @@ PROPAGATION_TIME_UNCERTAINTY = 1 # INTERNET_IP_TYPE = 4 # SUPL_APN = abc.xyz # SUPL_IP_TYPE = 4 + +##################################### +# Modem type +##################################### +# This setting configures modem type +# (external=0 or internal=1) +# comment out the next line to vote +# for the first modem in the list +MODEM_TYPE = 1 + From 5891ffe9bc6c522ce1907a60e303a0c5587a358a Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 21 May 2018 14:33:14 -0700 Subject: [PATCH 685/945] Add AGC value for QZSS measurement report Add AGC value for QZSS measurement report to Android framework - value is the same as GPS Change-Id: I1e3106d99d124945be7f1bda725a413be11a75e6 CRs-fixed: 2245786 --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9ab1fd6a..fd26ac1e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3182,6 +3182,7 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m for (size_t i = 0; i < measurements.count; i++) { switch (measurements.measurements[i].svType) { case GNSS_SV_TYPE_GPS: + case GNSS_SV_TYPE_QZSS: measurements.measurements[i].agcLevelDb = reports.mRfAndParams.back().mAgcGps; measurements.measurements[i].flags |= @@ -3209,7 +3210,6 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT; break; - case GNSS_SV_TYPE_QZSS: case GNSS_SV_TYPE_SBAS: case GNSS_SV_TYPE_UNKNOWN: default: From 4c4660c11be67a6b5ce60ab427ae3a07d0f3354c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 May 2018 10:03:33 -0700 Subject: [PATCH 686/945] fixed data items for service and cell info which right now are not keeping any data into the SSOO's table, therefore it is not able to determine if the new data arrives is different than the current one. This results in not passing the following data updates to the clients. Change-Id: Ieb94e959228d9a9f8d43b090f3328208387d864f CRs-Fixed: 2239616 --- core/SystemStatus.h | 10 ++++--- core/data-items/DataItemConcreteTypesBase.h | 30 ++++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index ff5e7548..46e004a8 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -523,8 +523,9 @@ public: RilServiceInfoDataItemBase() {} inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) : RilServiceInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusServiceInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusServiceInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; @@ -536,8 +537,9 @@ public: RilCellInfoDataItemBase() {} inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) : RilCellInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusRilCellInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusRilCellInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 065366d3..d35c5450 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -313,24 +313,42 @@ protected: class RilServiceInfoDataItemBase : public IDataItemCore { public: - RilServiceInfoDataItemBase() : - mId(RILSERVICEINFO_DATA_ITEM_ID) {} - virtual ~RilServiceInfoDataItemBase() {} + inline RilServiceInfoDataItemBase() : + mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {} + inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) : + RilServiceInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; }; class RilCellInfoDataItemBase : public IDataItemCore { public: - RilCellInfoDataItemBase() : - mId(RILCELLINFO_DATA_ITEM_ID) {} - virtual ~RilCellInfoDataItemBase() {} + inline RilCellInfoDataItemBase() : + mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {} + inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) : + RilCellInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilCellInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; }; From dd85ce83f35bd4b54bf61e2df0b21555ee9bf691 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 30 May 2018 17:44:25 -0700 Subject: [PATCH 687/945] DataItem changes to fix incorrect NetworkInfo connect handling NetworkInfoBaase added a type to allTypes protected method so that derived class can use it. Also, the SystemStatusNetworkInfo no longer compares names in its equal(), as it only is going to return false when comparing GnssLocationProvider NetworkInfo and OsAgent NetworkInfo. Change-Id: I363f27f4ed7be4aab2a4c4c033d5dff69d0a47d9 CRs-Fixed: 2251564 --- core/SystemStatus.cpp | 2 +- core/SystemStatus.h | 13 ++----------- core/data-items/DataItemConcreteTypesBase.h | 7 ++++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 5d5c4b08..b3260bdd 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1680,7 +1680,7 @@ bool SystemStatus::setDefaultGnssEngineStates(void) bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", false, connected, false); + SystemStatusNetworkInfo s(type, "", "", connected); mSysStatusObsvr.notify({&s}); return true; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 1c3adc84..657720d4 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -466,7 +466,6 @@ public: int32_t type=0, std::string typeName="", string subTypeName="", - bool available=false, bool connected=false, bool roaming=false) : NetworkInfoDataItemBase( @@ -474,7 +473,7 @@ public: type, typeName, subTypeName, - available, + connected && (!roaming), connected, roaming), mSrcObjPtr(nullptr) {} @@ -484,15 +483,7 @@ public: mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - if ((mAllTypes == peer.mAllTypes) && - (mTypeName == peer.mTypeName) && - (mSubTypeName == peer.mSubTypeName) && - (mAvailable == peer.mAvailable) && - (mConnected == peer.mConnected) && - (mRoaming == peer.mRoaming)) { - return true; - } - return false; + return (mAllTypes == peer.mAllTypes); } inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { uint64_t allTypes = (static_cast(curInfo)).mAllTypes; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 065366d3..45cd3253 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -236,8 +236,7 @@ public: NetworkInfoDataItemBase( NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming ): - mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? - 0 : (1<= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1< Date: Thu, 7 Jun 2018 12:03:55 -0700 Subject: [PATCH 688/945] changes to work without ULP module Rework the module with ULP module being removed Change-Id: I5ac81e8c1c734352b3087545b83f4812fa3e8aff CRs-fixed: 2235309 --- core/ContextBase.h | 5 - core/EngineHubProxyBase.h | 3 - core/LBSProxyBase.h | 7 - core/LocAdapterBase.cpp | 6 +- core/LocAdapterBase.h | 16 +- core/LocApiBase.cpp | 1 - core/Makefile.am | 1 - core/UlpProxyBase.h | 124 ------------ gnss/GnssAdapter.cpp | 410 +++++++------------------------------- gnss/GnssAdapter.h | 43 ++-- utils/gps_extended_c.h | 14 +- 11 files changed, 96 insertions(+), 534 deletions(-) delete mode 100644 core/UlpProxyBase.h diff --git a/core/ContextBase.h b/core/ContextBase.h index fca381f3..478283f8 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -128,13 +128,8 @@ public: 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(); } diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 4e259ba7..3851b2f0 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -39,7 +39,6 @@ public: // gnss session related functions inline virtual bool gnssStartFix() { - LOC_LOGD("%s]: empty called ", __func__); return false; } @@ -92,12 +91,10 @@ typedef std::function GnssAdapterReportPositionEventCb; typedef std::function GnssAdapterReportSvEventCb; diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index bf786a35..564c60bc 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -50,14 +50,7 @@ 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; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 267d539f..744a4403 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -79,7 +79,7 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromUlp*/, bool /*fromEngineHub*/) { + bool /*fromEngineHub*/) { if (mLocAdapterProxyBase != NULL) { mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, (GpsLocationExtended&)locationExtended, @@ -92,7 +92,7 @@ void LocAdapterBase:: void LocAdapterBase:: reportSvEvent(const GnssSvNotification& /*svNotify*/, - bool /*fromUlp*/, bool /*fromEngineHub*/) + bool /*fromEngineHub*/) DEFAULT_IMPL() void LocAdapterBase:: @@ -109,7 +109,7 @@ DEFAULT_IMPL() void LocAdapterBase:: - reportNmeaEvent(const char* /*nmea*/, size_t /*length*/, bool /*fromUlp*/) + reportNmeaEvent(const char* /*nmea*/, size_t /*length*/) DEFAULT_IMPL() bool LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 2083ac41..e31a5d22 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -30,7 +30,6 @@ #define LOC_API_ADAPTER_BASE_H #include -#include #include #include #include @@ -112,31 +111,20 @@ public: } uint32_t generateSessionId(); - - // This will be overridden by the individual adapters - // if necessary. - inline virtual void setUlpProxyCommand(UlpProxyBase* ulp) { - - (void)ulp; - } virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); inline virtual void setPositionModeCommand(LocPosMode& posMode) { (void)posMode; } - virtual void startTrackingCommand() {} - virtual void stopTrackingCommand() {} - virtual void getZppCommand() {} virtual void reportPositionEvent(const UlpLocation& location, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromUlp=false, bool fromEngineHub=false); virtual void reportSvEvent(const GnssSvNotification& svNotify, - bool fromUlp=false, bool fromEngineHub=false); - virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); + bool fromEngineHub=false); + virtual void reportNmeaEvent(const char* nmea, size_t length); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportStatus(LocGpsStatusValue status); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c1e08020..b7e3aeb8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -134,7 +134,6 @@ struct LocCloseMsg : public LocMsg { mLocApi->close(); } inline void locallog() const { - LOC_LOGV("%s]: LocCloseMsg"); } inline virtual void log() const { locallog(); diff --git a/core/Makefile.am b/core/Makefile.am index cf8d9ff3..53059e41 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -17,7 +17,6 @@ libloc_core_la_h_sources = \ ContextBase.h \ LocDualContext.h \ LBSProxyBase.h \ - UlpProxyBase.h \ loc_core_log.h \ LocAdapterProxyBase.h \ EngineHubProxyBase.h \ diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h deleted file mode 100644 index 8863b66c..00000000 --- a/core/UlpProxyBase.h +++ /dev/null @@ -1,124 +0,0 @@ -/* Copyright (c) 2013-2017, 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 -#include - -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(const UlpLocation &location, - const GpsLocationExtended &locationExtended, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) { - (void)location; - (void)locationExtended; - (void)status; - (void)loc_technology_mask; - return false; - } - inline virtual bool reportSv(const GnssSvNotification& svNotify) { - (void)svNotify; - 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(LocGpsStatusValue 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(const LocationOptions& options, bool active) - { - (void)options; - (void)active; - return false; - } - inline virtual bool reportPositions(const UlpLocation* ulpLocations, - const GpsLocationExtended* extendedLocations, - const uint32_t* techMasks, - const size_t count) - { - (void)ulpLocations; - (void)extendedLocations; - (void)techMasks; - (void)count; - return false; - } - inline virtual bool reportDeleteAidingData(LocGpsAidingData aidingData) - { - (void)aidingData; - return false; - } - inline virtual bool reportNmea(const char* nmea, int length) - { - (void)nmea; - (void)length; - return false; - } -}; - -} // namespace loc_core - -#endif // ULP_PROXY_BASE_H diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9a722bef..b566681e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -66,9 +66,8 @@ GnssAdapter::GnssAdapter() : NULL, LocDualContext::mLocationHalName, false)), - mUlpProxy(new UlpProxyBase()), mEngHubProxy(new EngineHubProxyBase()), - mUlpPositionMode(), + mLocPositionMode(), mGnssSvIdUsedInPosition(), mGnssSvIdUsedInPosAvail(false), mControlCallbacks(), @@ -88,7 +87,7 @@ GnssAdapter::GnssAdapter() : mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) { LOC_LOGD("%s]: Constructor %p", __func__, this); - mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; + mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; pthread_condattr_t condAttr; pthread_condattr_init(&condAttr); @@ -153,7 +152,6 @@ GnssAdapter::GnssAdapter() : dsClientCloseDataCallFn, dsClientReleaseFn, sendMsgFn); readConfigCommand(); - requestUlpCommand(); initDefaultAgpsCommand(); initEngHubProxyCommand(); } @@ -578,7 +576,6 @@ GnssAdapter::readConfigCommand() inline virtual void proc() const { // reads config into mContext->mGps_conf mContext.readConfig(); - mContext.requestUlp((LocAdapterBase*)mAdapter, mContext.getCarrierCapabilities()); } }; @@ -587,29 +584,6 @@ GnssAdapter::readConfigCommand() } } -void -GnssAdapter::requestUlpCommand() -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgRequestUlp : public LocMsg { - GnssAdapter* mAdapter; - ContextBase& mContext; - inline MsgRequestUlp(GnssAdapter* adapter, - ContextBase& context) : - LocMsg(), - mAdapter(adapter), - mContext(context) {} - inline virtual void proc() const { - mContext.requestUlp((LocAdapterBase*)mAdapter, mContext.getCarrierCapabilities()); - } - }; - - if (mContext != NULL) { - sendMsg(new MsgRequestUlp(this, *mContext)); - } -} - void GnssAdapter::setSuplHostServer(const char* server, int port) { @@ -910,8 +884,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { ContextBase::mGps_conf.SUPL_MODE = newSuplMode; - mAdapter.getUlpProxy()->setCapabilities( - ContextBase::getCarrierCapabilities()); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); } } @@ -1674,9 +1646,7 @@ GnssAdapter::injectLocationCommand(double latitude, double longitude, float accu mLongitude(longitude), mAccuracy(accuracy) {} inline virtual void proc() const { - if (!mContext.hasCPIExtendedCapabilities()) { - mApi.injectPosition(mLatitude, mLongitude, mAccuracy); - } + mApi.injectPosition(mLatitude, mLongitude, mAccuracy); } }; @@ -1714,58 +1684,6 @@ GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t unce sendMsg(new MsgInjectTime(*mLocApi, *mContext, time, timeReference, uncertainty)); } -void -GnssAdapter::setUlpProxyCommand(UlpProxyBase* ulp) -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgSetUlpProxy : public LocMsg { - GnssAdapter& mAdapter; - UlpProxyBase* mUlp; - inline MsgSetUlpProxy(GnssAdapter& adapter, - UlpProxyBase* ulp) : - LocMsg(), - mAdapter(adapter), - mUlp(ulp) {} - inline virtual void proc() const { - mAdapter.setUlpProxy(mUlp); - if (mUlp) { - mUlp->setCapabilities(ContextBase::getCarrierCapabilities()); - } - } - }; - - sendMsg(new MsgSetUlpProxy(*this, ulp)); -} - -void -GnssAdapter::setUlpProxy(UlpProxyBase* ulp) -{ - if (ulp == mUlpProxy) { - //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]: ulp pointer is NULL", __func__); - ulp = new UlpProxyBase(); - } - - if (LOC_POSITION_MODE_INVALID != mUlpProxy->mPosMode.mode) { - // need to send this mode and start msg to ULP - ulp->sendFixMode(mUlpProxy->mPosMode); - } - - if (mUlpProxy->mFixSet) { - ulp->sendStartFix(); - } - - delete mUlpProxy; - mUlpProxy = ulp; -} - void GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks) { @@ -1930,9 +1848,7 @@ GnssAdapter::restartSessions() LocPosMode locPosMode = {}; highestPowerTrackingOptions.setLocationOptions(smallestIntervalOptions); convertOptions(locPosMode, highestPowerTrackingOptions); - mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), - [] (LocationError err) {} - )); + mLocApi->startFix(locPosMode, nullptr); } void @@ -2076,9 +1992,9 @@ GnssAdapter::eraseTrackingSession(LocationAPI* client, uint32_t sessionId) } } -bool GnssAdapter::setUlpPositionMode(const LocPosMode& mode) { - if (!mUlpPositionMode.equals(mode)) { - mUlpPositionMode = mode; +bool GnssAdapter::setLocPositionMode(const LocPosMode& mode) { + if (!mLocPositionMode.equals(mode)) { + mLocPositionMode = mode; return true; } else { return false; @@ -2205,7 +2121,9 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, bool reportToClientWithNoWait = true; if (mTrackingSessions.empty()) { - reportToClientWithNoWait = startTracking(client, sessionId, options); + startTracking(client, sessionId, options); + // need to wait for QMI callback + reportToClientWithNoWait = false; } else { // find the smallest interval and powerMode TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time @@ -2236,79 +2154,61 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, } if (updateOptions) { // restart time based tracking with the newly updated options - reportToClientWithNoWait = startTracking(client, sessionId, multiplexedOptions); + startTracking(client, sessionId, multiplexedOptions); + // need to wait for QMI callback + reportToClientWithNoWait = false; } + // else part: no QMI call is made, need to report back to client right away } return reportToClientWithNoWait; } -bool +void GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions) { - bool reportToClientWithNoWait = true; - LocPosMode locPosMode = {}; convertOptions(locPosMode, trackingOptions); - if (!mUlpProxy->sendFixMode(locPosMode)) { - // do nothing - } - if (!mUlpProxy->sendStartFix()) { - // inform engine hub that GNSS session is about to start - mEngHubProxy->gnssSetFixMode(locPosMode); - mEngHubProxy->gnssStartFix(); - mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), - [this, client, sessionId] (LocationError err) { - if (LOCATION_ERROR_SUCCESS != err) { - eraseTrackingSession(client, sessionId); - } + // inform engine hub that GNSS session is about to start + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); - reportResponse(client, err, sessionId); + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + eraseTrackingSession(client, sessionId); } - )); - reportToClientWithNoWait = false; - } - - return reportToClientWithNoWait; + reportResponse(client, err, sessionId); + } + )); } -bool +void GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions) { - bool reportToClientWithNoWait = true; - LocPosMode locPosMode = {}; convertOptions(locPosMode, updatedOptions); - if (!mUlpProxy->sendFixMode(locPosMode)) { - // do nothing - } - if (!mUlpProxy->sendStartFix()) { - // inform engine hub that GNSS session is about to start - mEngHubProxy->gnssSetFixMode(locPosMode); - mEngHubProxy->gnssStartFix(); - mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), - [this, client, sessionId, oldOptions] (LocationError err) { - if (LOCATION_ERROR_SUCCESS != err) { - // restore the old LocationOptions - saveTrackingSession(client, sessionId, oldOptions); - } + // inform engine hub that GNSS session is about to start + mEngHubProxy->gnssSetFixMode(locPosMode); + mEngHubProxy->gnssStartFix(); - reportResponse(client, err, sessionId); + mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + [this, client, sessionId, oldOptions] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + // restore the old LocationOptions + saveTrackingSession(client, sessionId, oldOptions); } - )); - reportToClientWithNoWait = false; - } - - return reportToClientWithNoWait; + reportResponse(client, err, sessionId); + } + )); } - void GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) { @@ -2328,7 +2228,7 @@ GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) mLocPosMode(locPosMode) {} inline virtual void proc() const { // saves the mode in adapter to be used when startTrackingCommand is called from ULP - if (mAdapter.setUlpPositionMode(mLocPosMode)) { + if (mAdapter.setLocPositionMode(mLocPosMode)) { mAdapter.mEngHubProxy->gnssSetFixMode(mLocPosMode); mApi.setPositionMode(mLocPosMode); } @@ -2338,42 +2238,6 @@ GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) sendMsg(new MsgSetPositionMode(*this, *mLocApi, locPosMode)); } -void -GnssAdapter::startTrackingCommand() -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgStartTracking : public LocMsg { - GnssAdapter& mAdapter; - LocApiBase& mApi; - inline MsgStartTracking(GnssAdapter& adapter, - LocApiBase& api) : - LocMsg(), - mAdapter(adapter), - mApi(api) {} - inline virtual void proc() const { - // we get this call from ULP, so just call LocApi without multiplexing because - // ulp would be doing the multiplexing for us if it is present - LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); - - // TBD: once CR 2165853 is fixed, move below codes - // to inside condition of if (!mAdapter.isInSession()) - // - // inform engine hub of the fix mode and start session - mAdapter.mEngHubProxy->gnssSetFixMode(ulpPositionMode); - mAdapter.mEngHubProxy->gnssStartFix(); - if (!mAdapter.isInSession()) { - LocPosMode& ulpPositionMode = mAdapter.getUlpPositionMode(); - mApi.startFix(ulpPositionMode, new LocApiResponse(*mAdapter.getContext(), - [] (LocationError err) {} - )); - } - } - }; - - sendMsg(new MsgStartTracking(*this, *mLocApi)); -} - void GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, TrackingOptions& options) @@ -2467,6 +2331,7 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, it2->second.powerMode < multiplexedPowerMode)) { multiplexedPowerMode = it2->second.powerMode; } + // else part: no QMI call is made, need to report back to client right away } bool updateOptions = false; // if session we are updating has smaller interval then next smallest @@ -2486,8 +2351,9 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, } if (updateOptions) { // restart time based tracking with the newly updated options - reportToClientWithNoWait = updateTracking( - client, id, multiplexedOptions, oldOptions); + updateTracking(client, id, multiplexedOptions, oldOptions); + // need to wait for QMI callback + reportToClientWithNoWait = false; } } @@ -2539,7 +2405,9 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) bool reportToClientWithNoWait = true; if (1 == mTrackingSessions.size()) { - reportToClientWithNoWait = stopTracking(client, id); + stopTracking(client, id); + // need to wait for QMI callback + reportToClientWithNoWait = false; } else { LocationSessionKey key(client, id); @@ -2569,86 +2437,27 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) it->second.powerMode < multiplexedPowerMode) { multiplexedOptions.powerMode = multiplexedPowerMode; // restart time based tracking with the newly updated options - reportToClientWithNoWait = startTracking(client, id, multiplexedOptions); + startTracking(client, id, multiplexedOptions); + // need to wait for QMI callback + reportToClientWithNoWait = false; } + // else part: no QMI call is made, need to report back to client right away } } return reportToClientWithNoWait; } -bool +void GnssAdapter::stopTracking(LocationAPI* client, uint32_t id) { - bool reportToClientWithNoWait = true; + // inform engine hub that GNSS session has stopped + mEngHubProxy->gnssStopFix(); - if (!mUlpProxy->sendStopFix()) { - // inform engine hub that GNSS session has stopped - mEngHubProxy->gnssStopFix(); - - mLocApi->stopFix(new LocApiResponse(*getContext(), - [this, client, id] (LocationError err) { - reportResponse(client, err, id); - })); - - reportToClientWithNoWait = false; - } - - return reportToClientWithNoWait; -} - -void -GnssAdapter::stopTrackingCommand() -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgStopTracking : public LocMsg { - GnssAdapter& mAdapter; - LocApiBase& mApi; - inline MsgStopTracking(GnssAdapter& adapter, - LocApiBase& api) : - LocMsg(), - mAdapter(adapter), - mApi(api) {} - inline virtual void proc() const { - // inform engine hub that GNSS session has stopped - mAdapter.mEngHubProxy->gnssStopFix(); - - // clear the position mode - LocPosMode mLocPosMode = {}; - mLocPosMode.mode = LOC_POSITION_MODE_INVALID; - mAdapter.setUlpPositionMode(mLocPosMode); - // don't need to multiplex because ULP will do that for us if it is present - mApi.stopFix(new LocApiResponse(*mAdapter.getContext(), - [] (LocationError /* err*/) {} - )); - } - }; - - sendMsg(new MsgStopTracking(*this, *mLocApi)); -} - -void -GnssAdapter::getZppCommand() -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgGetZpp : public LocMsg { - GnssAdapter& mAdapter; - LocApiBase& mApi; - inline MsgGetZpp(GnssAdapter& adapter, - LocApiBase& api) : - LocMsg(), - mAdapter(adapter), - mApi(api) {} - inline virtual void proc() const { - mApi.getBestAvailableZppFix(); - } - }; - - // TODO: we could avoid this extra context switch, as getBestAvailableZppFix - // will return asynchronously anyways. - sendMsg(new MsgGetZpp(*this, *mLocApi)); + mLocApi->stopFix(new LocApiResponse(*getContext(), + [this, client, id] (LocationError err) { + reportResponse(client, err, id); + })); } bool @@ -2747,7 +2556,6 @@ GnssAdapter::gnssNiResponseCommand(GnssNiResponse response, void* rawRequest) inline virtual ~MsgGnssNiResponse() { } inline virtual void proc() const { - const void *rawPayload = mPayload; mApi.informNiResponse(mResponse, mPayload); } }; @@ -2861,14 +2669,12 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp, bool fromEngineHub) { - LOC_LOGD("%s]: fromUlp %u status %u", __func__, fromUlp, status); - - // if this event is called from QMI LOC API, then try to call into ULP and return if successfull - // if the position is called from ULP or engine hub, then send it out directly - if (!fromUlp && !fromEngineHub) { + // if this event is called from QMI LOC API, then send report to engine hub + // if sending is successful, we return as we will wait for final report from engine hub + // if the position is called from engine hub, then send it out directly + if (!fromEngineHub) { // report QMI position (both propagated and unpropagated) to engine hub, // and engine hub will be distributing it to the registered plugins mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); @@ -2877,27 +2683,18 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, return; } - // only send propagated position report to ulp - if (mUlpProxy->reportPosition(ulpLocation, locationExtended, - status, techMask)) { - return; - } - // engine hub is loaded, do not report qmi position to client as // final position report should come from engine hub if (true == initEngHubProxy()){ return; } - } else if ((true == fromUlp) && (true == initEngHubProxy())) { - LOC_LOGV("%s]: drop ULP GNSS fix as engine hub is loaded", __func__); - return; } // for all other cases: - // case 1: fix is from ULP and engine hub is not loaded, queue the msg - // case 2: fix is from engine hub, queue the msg + // case 1: fix is from engine hub, queue the msg + // case 2: fix is not from engine hub, e.g. from QMI, and it is not an + // unpropagated position and engine hub is not loaded, queue the msg // when message is queued, the position can be dispatched to requesting client - struct MsgReportPosition : public LocMsg { GnssAdapter& mAdapter; const UlpLocation mUlpLocation; @@ -2999,28 +2796,13 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, void GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, - bool fromUlp, bool fromEngineHub) { - LOC_LOGD("%s]: fromUlp %u", __func__, fromUlp); - - // if this event is not called from ULP, then try to call into ULP and return if successfull - if (!fromUlp && !fromEngineHub) { - // report QMI SV report to eng hub + if (!fromEngineHub) { mEngHubProxy->gnssReportSv(svNotify); - - if (mUlpProxy->reportSv(svNotify)) { - return; - } - - // engine hub is loaded, do not report sv to client - // as sv report should come from engine hub if (true == initEngHubProxy()){ return; } - } else if ((true == fromUlp) && (true == initEngHubProxy())) { - LOC_LOGV("%s]: drop ULP GNSS SV event as engine hub is loaded", __func__); - return; } struct MsgReportSv : public LocMsg { @@ -3108,14 +2890,10 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) } void -GnssAdapter::reportNmeaEvent(const char* nmea, size_t length, bool fromUlp) +GnssAdapter::reportNmeaEvent(const char* nmea, size_t length) { - // if this event is not called from ULP, then try to call into ULP and return if successfull - if (!fromUlp && !loc_nmea_is_debug(nmea, length)) { + if (!loc_nmea_is_debug(nmea, length)) { mEngHubProxy->gnssReportNmea(nmea); - if (mUlpProxy->reportNmea(nmea, length)) { - return; - } } struct MsgReportNmea : public LocMsg { @@ -3380,9 +3158,6 @@ void GnssAdapter::reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) { LOC_LOGD("%s]: ", __func__); - - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - mUlpProxy->reportSvMeasurement(svMeasurementSet); mEngHubProxy->gnssReportSvMeasurement(svMeasurementSet); } @@ -3390,10 +3165,6 @@ void GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) { LOC_LOGD("%s]: ", __func__); - - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - mUlpProxy->reportSvPolynomial(svPolynomial); - mEngHubProxy->gnssReportSvPolynomial(svPolynomial); } @@ -3705,41 +3476,6 @@ bool GnssAdapter::reportDataCallClosed(){ return true; } -bool GnssAdapter::reportZppBestAvailableFix(LocGpsLocation &zppLoc, - GpsLocationExtended &location_extended, LocPosTechMask tech_mask) { - - struct MsgReportZpp : public LocMsg { - GnssAdapter& mAdapter; - UlpLocation mUlpLocation; - GpsLocationExtended mGpsLocationExtended; - LocPosTechMask mPosTechMask; - - inline MsgReportZpp(GnssAdapter& adapter, - LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, - LocPosTechMask tech_mask) : - LocMsg(), - mAdapter(adapter), - mGpsLocationExtended(location_extended), - mPosTechMask(tech_mask) { - mUlpLocation = {}; - memcpy(&mUlpLocation.gpsLocation, &zppLoc, sizeof(LocGpsLocation)); - - //Mark the location source as from ZPP - mUlpLocation.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; - mUlpLocation.position_source = ULP_LOCATION_IS_FROM_ZPP; - } - inline virtual void proc() const { - mAdapter.getUlpProxy()->reportPosition(mUlpLocation, - mGpsLocationExtended, - LOC_SESS_SUCCESS, - mPosTechMask); - } - }; - - sendMsg(new MsgReportZpp(*this, zppLoc, location_extended, tech_mask)); - return true; -} - void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType){ @@ -4230,17 +3966,16 @@ GnssAdapter::initEngHubProxy() { const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp, bool fromEngineHub) { // report from engine hub on behalf of PPE will be treated as fromUlp reportPositionEvent(ulpLocation, locationExtended, status, - techMask, fromUlp, fromEngineHub); + techMask, fromEngineHub); }; // callback function for engine hub to report back sv event GnssAdapterReportSvEventCb reportSvEventCb = - [this](const GnssSvNotification& svNotify, bool fromUlp, bool fromEngineHub) { - reportSvEvent(svNotify, fromUlp, fromEngineHub); + [this](const GnssSvNotification& svNotify, bool fromEngineHub) { + reportSvEvent(svNotify, fromEngineHub); }; getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); @@ -4256,6 +3991,10 @@ GnssAdapter::initEngHubProxy() { else { LOC_LOGD("%s]: entered, did not find function", __func__); } + + LOC_LOGD("%s]: first time initialization %d, returned %d", + __func__, firstTime, engHubLoadSuccessful); + } while (0); if (processInfoList != nullptr) { @@ -4263,9 +4002,6 @@ GnssAdapter::initEngHubProxy() { processInfoList = nullptr; } - LOC_LOGD("%s]: first time initialization %d, returned %d", - __func__, firstTime, engHubLoadSuccessful); - firstTime = false; return engHubLoadSuccessful; } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 277cc2a8..cf556d70 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -84,8 +83,6 @@ namespace loc_core { } class GnssAdapter : public LocAdapterBase { - /* ==== ULP ============================================================================ */ - UlpProxyBase* mUlpProxy; /* ==== Engine Hub ===================================================================== */ EngineHubProxyBase* mEngHubProxy; @@ -96,7 +93,7 @@ class GnssAdapter : public LocAdapterBase { /* ==== TRACKING ======================================================================= */ TrackingOptionsMap mTrackingSessions; - LocPosMode mUlpPositionMode; + LocPosMode mLocPositionMode; GnssSvUsedInPosition mGnssSvIdUsedInPosition; bool mGnssSvIdUsedInPosAvail; @@ -142,7 +139,7 @@ class GnssAdapter : public LocAdapterBase { public: GnssAdapter(); - virtual inline ~GnssAdapter() { delete mUlpProxy; } + virtual inline ~GnssAdapter() { } /* ==== SSR ============================================================================ */ /* ======== EVENTS ====(Called from QMI Thread)========================================= */ @@ -150,13 +147,6 @@ public: /* ======== UTILITIES ================================================================== */ void restartSessions(); - /* ==== ULP ============================================================================ */ - /* ======== COMMANDS ====(Called from ULP Thread)==================================== */ - virtual void setUlpProxyCommand(UlpProxyBase* ulp); - /* ======== UTILITIES ================================================================== */ - void setUlpProxy(UlpProxyBase* ulp); - inline UlpProxyBase* getUlpProxy() { return mUlpProxy; } - /* ==== CLIENT ========================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); @@ -179,11 +169,7 @@ public: void updateTrackingOptionsCommand( LocationAPI* client, uint32_t id, TrackingOptions& trackingOptions); void stopTrackingCommand(LocationAPI* client, uint32_t id); - /* ======================(Called from ULP Thread)======================================= */ virtual void setPositionModeCommand(LocPosMode& locPosMode); - virtual void startTrackingCommand(); - virtual void stopTrackingCommand(); - virtual void getZppCommand(); /* ======== RESPONSES ================================================================== */ void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId); /* ======== UTILITIES ================================================================== */ @@ -193,17 +179,19 @@ public: void saveTrackingSession(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions); void eraseTrackingSession(LocationAPI* client, uint32_t sessionId); - bool setUlpPositionMode(const LocPosMode& mode); - LocPosMode& getUlpPositionMode() { return mUlpPositionMode; } + + bool setLocPositionMode(const LocPosMode& mode); + LocPosMode& getLocPositionMode() { return mLocPositionMode; } + bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& trackingOptions); - bool startTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions); + void startTracking(LocationAPI* client, uint32_t sessionId, + const TrackingOptions& trackingOptions); bool stopTrackingMultiplex(LocationAPI* client, uint32_t id); - bool stopTracking(LocationAPI* client, uint32_t id); + void stopTracking(LocationAPI* client, uint32_t id); bool updateTrackingMultiplex(LocationAPI* client, uint32_t id, - const TrackingOptions& trackingOptions); - bool updateTracking(LocationAPI* client, uint32_t sessionId, + const TrackingOptions& trackingOptions); + void updateTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); /* ==== NI ============================================================================= */ @@ -222,7 +210,6 @@ public: void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); void readConfigCommand(); void setConfigCommand(); - void requestUlpCommand(); void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); uint32_t* gnssGetConfigCommand(GnssConfigFlagsMask mask); @@ -279,17 +266,15 @@ public: bool initEngHubProxy(); /* ==== REPORTS ======================================================================== */ - /* ======== EVENTS ====(Called from QMI/ULP Thread)===================================== */ + /* ======== EVENTS ====(Called from QMI/EngineHub Thread)===================================== */ virtual void reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromUlp=false, bool fromEngineHub=false); virtual void reportSvEvent(const GnssSvNotification& svNotify, - bool fromUlp=false, bool fromEngineHub=false); - virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false); + virtual void reportNmeaEvent(const char* nmea, size_t length); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek); @@ -303,8 +288,6 @@ public: virtual bool requestSuplES(int connHandle, LocApnTypeMask mask); virtual bool reportDataCallOpened(); virtual bool reportDataCallClosed(); - virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, - GpsLocationExtended &location_extended, LocPosTechMask tech_mask); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); /* ======== UTILITIES ================================================================= */ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index c0b97af2..ed4a1b80 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -65,20 +65,16 @@ extern "C" { #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 +#define ULP_LOCATION_IS_FROM_GEOFENCE 0X0004 /** Position is from Hardware FLP */ -#define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 +#define ULP_LOCATION_IS_FROM_HW_FLP 0x0008 /** Position is from NLP */ -#define ULP_LOCATION_IS_FROM_NLP 0x0020 -/** Position is from PIP */ -#define ULP_LOCATION_IS_FROM_PIP 0x0040 +#define ULP_LOCATION_IS_FROM_NLP 0x0010 /** Position is from external DR solution*/ -#define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 +#define ULP_LOCATION_IS_FROM_EXT_DR 0X0020 /** Raw GNSS position fixes */ -#define ULP_LOCATION_IS_FROM_GNSS_RAW 0X0100 +#define ULP_LOCATION_IS_FROM_GNSS_RAW 0X0040 typedef uint32_t LocSvInfoSource; /** SVinfo source is GNSS/DR */ From 17015dd790b13345c547709ef8b6144a3526d079 Mon Sep 17 00:00:00 2001 From: haohuang Date: Mon, 16 Apr 2018 15:12:49 +0800 Subject: [PATCH 689/945] Add spoof report mask in location object Add the spoof mask report in location object in position report and ZPP position report in LocApiV02. Propagate this mask to the location object in Location API module. Change-Id: I5df87d389d5315c55ed2afce1f440a0486e4bebd CRs-fixed: 2236154 --- gnss/GnssAdapter.cpp | 5 +++++ location/LocationDataTypes.h | 9 +++++++++ utils/loc_gps.h | 11 +++++++++++ 3 files changed, 25 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index b566681e..4b6fce85 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -248,6 +248,11 @@ GnssAdapter::convertLocation(Location& out, const UlpLocation& ulpLocation, if (LOC_POS_TECH_MASK_SENSORS & techMask) { out.techMask |= LOCATION_TECHNOLOGY_SENSORS_BIT; } + + if (LOC_GPS_LOCATION_HAS_SPOOF_MASK & ulpLocation.gpsLocation.flags) { + out.flags |= LOCATION_HAS_SPOOF_MASK; + out.spoofMask = ulpLocation.gpsLocation.spoof_mask; + } } void diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 9809e616..66ed3ad1 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -70,6 +70,7 @@ typedef enum { LOCATION_HAS_VERTICAL_ACCURACY_BIT = (1<<5), // location has valid vertical accuracy LOCATION_HAS_SPEED_ACCURACY_BIT = (1<<6), // location has valid speed accuracy LOCATION_HAS_BEARING_ACCURACY_BIT = (1<<7), // location has valid bearing accuracy + LOCATION_HAS_SPOOF_MASK = (1<<8), // location has valid spoof mask } LocationFlagsBits; typedef uint16_t LocationTechnologyMask; @@ -80,6 +81,13 @@ typedef enum { LOCATION_TECHNOLOGY_SENSORS_BIT = (1<<3), // location was calculated using Sensors } LocationTechnologyBits; +typedef uint32_t LocationSpoofMask; +typedef enum { + LOCATION_POSTION_SPOOFED = (1<<0), // location position spoofed + LOCATION_TIME_SPOOFED = (1<<1), // location time spoofed + LOCATION_NAVIGATION_DATA_SPOOFED = (1<<2), // location navigation data spoofed +} LocationSpoofBits; + typedef enum { LOCATION_RELIABILITY_NOT_SET = 0, LOCATION_RELIABILITY_VERY_LOW, @@ -531,6 +539,7 @@ typedef struct { float speedAccuracy; // in meters/second float bearingAccuracy; // in degrees (0 to 359.999) LocationTechnologyMask techMask; + LocationSpoofMask spoofMask; } Location; struct LocationOptions { diff --git a/utils/loc_gps.h b/utils/loc_gps.h index 5e915a32..aaeea237 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -100,6 +100,15 @@ typedef uint16_t LocGpsLocationFlags; #define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010 /** LocGpsLocation has valid vertical uncertainity */ #define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0040 +/** LocGpsLocation has valid spoof mask */ +#define LOC_GPS_LOCATION_HAS_SPOOF_MASK 0x0080 + +/** Spoof mask in LocGpsLocation */ +typedef uint32_t LocGpsSpoofMask; +#define LOC_GPS_LOCATION_NONE_SPOOFED 0x0000 +#define LOC_GPS_LOCATION_POSITION_SPOOFED 0x0001 +#define LOC_GPS_LOCATION_TIME_SPOOFED 0x0002 +#define LOC_GPS_LOCATION_NAVIGATION_DATA_SPOOFED 0x0004 /** Flags for the loc_gps_set_capabilities callback. */ @@ -533,6 +542,8 @@ typedef struct { size_t size; /** Contains LocGpsLocationFlags bits. */ uint16_t flags; + /** The spoof mask */ + LocGpsSpoofMask spoof_mask; /** Represents latitude in degrees. */ double latitude; /** Represents longitude in degrees. */ From 6c80f04dbace74cc65bdd5eb85239790b1711bf6 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 25 May 2018 14:34:08 -0700 Subject: [PATCH 690/945] Populate some more fields for end client. These are the fields populated: North, East, Up velocity and their uncertainties North and East standard deviation Gps Time, Leap Sec and time uncertainty Gps Measurement usage info CRs-Fixed: 2249350 Change-Id: I8936b1c47be25fdc792322592f8ea5466a3fa6fd --- gnss/GnssAdapter.cpp | 55 ++++++++++++++++++++++++++ location/LocationDataTypes.h | 75 ++++++++++++++++++++++++++++++++++-- utils/gps_extended_c.h | 19 ++++++--- 3 files changed, 140 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 3f9d3cf8..ef835aee 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -320,6 +320,38 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT; out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth; } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_STD_DEV & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT; + out.northVelocityStdDeviation = locationExtended.northStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_STD_DEV & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_STD_DEV_BIT; + out.eastVelocityStdDeviation = locationExtended.eastStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_BIT; + out.northVelocity = locationExtended.northVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT; + out.northVelocityStdDeviation = locationExtended.northVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_VEL_BIT; + out.eastVelocity = locationExtended.eastVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT; + out.eastVelocityStdDeviation = locationExtended.eastVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_UP_VEL_BIT; + out.upVelocity = locationExtended.upVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_UP_VEL_UNC_BIT; + out.upVelocityStdDeviation = locationExtended.upVelocityStdDeviation; + } if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT; out.svUsedInPosition.gpsSvUsedIdsMask = @@ -332,6 +364,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; out.svUsedInPosition.qzssSvUsedIdsMask = locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + out.numOfMeasReceived = locationExtended.numOfMeasReceived; + + for (int idx =0; idx < locationExtended.numOfMeasReceived; idx++) { + out.measUsageInfo[idx].gnssSignalType = + locationExtended.measUsageInfo[idx].gnssSignalType; + out.measUsageInfo[idx].gnssSvId = + locationExtended.measUsageInfo[idx].gnssSvId; + out.measUsageInfo[idx].gnssConstellation = + locationExtended.measUsageInfo[idx].gnssConstellation; + } } if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT; @@ -367,6 +409,19 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate; out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch; } + + // Validity of this structure is established from the timeSrc of the GnssSystemTime structure. + out.gnssSystemTime = locationExtended.gnssSystemTime; + + if (GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_LEAP_SECONDS_BIT; + out.leapSeconds = locationExtended.leapSeconds; + } + + if (GPS_LOCATION_EXTENDED_HAS_TIME_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_TIME_UNC_BIT; + out.timeUncMs = locationExtended.timeUncMs; + } } inline uint32_t diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 00cca183..8bb11cc7 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -137,8 +137,17 @@ typedef enum { GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data - GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time - GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop + GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<13),// valid gdop, tdop + GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT = (1<<14),// valid North standard deviation + GNSS_LOCATION_INFO_EAST_STD_DEV_BIT = (1<<15),// valid East standard deviation + GNSS_LOCATION_INFO_NORTH_VEL_BIT = (1<<16),// valid North Velocity + GNSS_LOCATION_INFO_EAST_VEL_BIT = (1<<17),// valid East Velocity + GNSS_LOCATION_INFO_UP_VEL_BIT = (1<<18),// valid Up Velocity + GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT = (1<<19),// valid North Velocity Uncertainty + GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT = (1<<20),// valid East Velocity Uncertainty + GNSS_LOCATION_INFO_UP_VEL_UNC_BIT = (1<<21),// valid Up Velocity Uncertainty + GNSS_LOCATION_INFO_LEAP_SECONDS_BIT = (1<<22),// valid leap seconds + GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23) // valid time uncertainty } GnssLocationInfoFlagBits; typedef enum { @@ -452,6 +461,43 @@ typedef enum { GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), } GnssAidingDataSvTypeBits; +/** GNSS Signal Type and RF Band */ +typedef uint32_t GnssSignalTypeMask; +typedef enum { + /** GPS L1CA Signal */ + GNSS_SIGNAL_GPS_L1CA = (1<<0), + /** GPS L1C Signal */ + GNSS_SIGNAL_GPS_L1C = (1<<1), + /** GPS L2 RF Band */ + GNSS_SIGNAL_GPS_L2 = (1<<2), + /** GPS L5 RF Band */ + GNSS_SIGNAL_GPS_L5 = (1<<3), + /** GLONASS G1 (L1OF) RF Band */ + GNSS_SIGNAL_GLONASS_G1 = (1<<4), + /** GLONASS G2 (L2OF) RF Band */ + GNSS_SIGNAL_GLONASS_G2 = (1<<5), + /** GALILEO E1 RF Band */ + GNSS_SIGNAL_GALILEO_E1 = (1<<6), + /** GALILEO E5A RF Band */ + GNSS_SIGNAL_GALILEO_E5A = (1<<7), + /** GALILEO E5B RF Band */ + GNSS_SIGNAL_GALILIEO_E5B = (1<<8), + /** BEIDOU B1 RF Band */ + GNSS_SIGNAL_BEIDOU_B1 = (1<<9), + /** BEIDOU B2 RF Band */ + GNSS_SIGNAL_BEIDOU_B2 = (1<<10), + /** QZSS L1CA RF Band */ + GNSS_SIGNAL_QZSS_L1CA = (1<<11), + /** QZSS L1S RF Band */ + GNSS_SIGNAL_QZSS_L1S = (1<<12), + /** QZSS L2 RF Band */ + GNSS_SIGNAL_QZSS_L2 = (1<<13), + /** QZSS L5 RF Band */ + GNSS_SIGNAL_QZSS_L5 = (1<<14), + /** SBAS L1 RF Band */ + GNSS_SIGNAL_SBAS_L1 = (1<<15) +} GnssSignalTypeBits; + typedef enum { GNSS_LOC_SV_SYSTEM_GPS = 1, @@ -587,6 +633,21 @@ typedef struct { uint64_t qzssSvUsedIdsMask; } GnssLocationSvUsedInPosition; +typedef struct { + /** GnssSignalType mask */ + GnssSignalTypeMask gnssSignalType; + /** Specifies GNSS Constellation Type */ + Gnss_LocSvSystemEnumType gnssConstellation; + /** GNSS SV ID. + For GPS: 1 to 32 + For GLONASS: 65 to 96. When slot-number to SV ID mapping is unknown, set as 255. + For SBAS: 120 to 151 + For QZSS-L1CA:193 to 197 + For BDS: 201 to 237 + For GAL: 301 to 336 */ + uint16_t gnssSvId; +} GnssMeasUsageInfo; + /** @struct Body Frame parameters */ @@ -702,9 +763,11 @@ typedef struct { float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth + float northStdDeviation; // North standard deviation Unit: Meters + float eastStdDeviation; // East standard deviation. Unit: Meters float northVelocity; // North Velocity.Unit: Meters/sec - float eastVelocity; // East Velocity - float upVelocity; + float eastVelocity; // East Velocity Unit Meters/sec + float upVelocity; // Up Velocity. Unit Meters/sec float northVelocityStdDeviation; float eastVelocityStdDeviation; float upVelocityStdDeviation; @@ -714,6 +777,10 @@ typedef struct { GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and // pitch set with validity GnssSystemTime gnssSystemTime; // GNSS System Time + uint8_t numOfMeasReceived; // Number of measurements received for use in fix. + GnssMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; // GNSS Measurement Usage info + uint8_t leapSeconds; // leap second + float timeUncMs; // Time uncertainty in milliseconds Location location; } GnssLocationInfoNotification; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 21eb5d55..ea38eb38 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -268,7 +268,7 @@ typedef enum loc_position_mode_type { #define GPS_DEFAULT_FIX_INTERVAL_MS 1000 /** Flags to indicate which values are valid in a GpsLocationExtended. */ -typedef uint32_t GpsLocationExtendedFlags; +typedef uint64_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 /** GpsLocationExtended has valid altitude mean sea level. */ @@ -323,14 +323,19 @@ typedef uint32_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC 0x2000000 /** GpsLocationExtended has up Velocity Uncertainty */ #define GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC 0x4000000 -/** GpsLocationExtended has up Clock Bias */ +/** GpsLocationExtended has Clock Bias */ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS 0x8000000 -/** GpsLocationExtended has up Clock Bias std deviation*/ +/** GpsLocationExtended has Clock Bias std deviation*/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS_STD_DEV 0x10000000 -/** GpsLocationExtended has up Clock drift*/ +/** GpsLocationExtended has Clock drift*/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000 -/** GpsLocationExtended has up Clock drift std deviation**/ +/** GpsLocationExtended has Clock drift std deviation**/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 +/** GpsLocationExtended has leap seconds **/ +#define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000 +/** GpsLocationExtended has time uncertainty **/ +#define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 + typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -660,6 +665,10 @@ typedef struct { uint8_t numOfMeasReceived; /** Measurement Usage Information */ GpsMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; + /** Leap Seconds */ + uint8_t leapSeconds; + /** Time uncertainty in milliseconds */ + float timeUncMs; } GpsLocationExtended; enum loc_sess_status { From 2c817bdc5851629cb039ebcd26f46d9167adbb01 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 7 Jun 2018 15:26:26 -0700 Subject: [PATCH 691/945] Revert "Replace MONOTONIC clock with BOOTTIME clock" This reverts commit e9c3f04f8628883091ca0912dd50b80fb9560316. Change-Id: Iabdead2a535b26bc3f7df1987265c4e2aea4f62e CRs-Fixed: 2241735 --- core/SystemStatus.h | 6 +++--- gnss/GnssAdapter.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 46e004a8..ac59cdc7 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -71,10 +71,10 @@ public: static const uint32_t maxItem = 5; SystemStatusItemBase() { - timeval tv; - gettimeofday(&tv, NULL); + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); mUtcTime.tv_sec = tv.tv_sec; - mUtcTime.tv_nsec = tv.tv_usec *1000ULL; + mUtcTime.tv_nsec = tv.tv_nsec; mUtcReported = mUtcTime; }; virtual ~SystemStatusItemBase() {}; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fd26ac1e..30bc4212 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -86,7 +86,7 @@ GnssAdapter::GnssAdapter() : pthread_condattr_t condAttr; pthread_condattr_init(&condAttr); - pthread_condattr_setclock(&condAttr, CLOCK_BOOTTIME); + pthread_condattr_setclock(&condAttr, CLOCK_MONOTONIC); pthread_cond_init(&mNiData.session.tCond, &condAttr); pthread_cond_init(&mNiData.sessionEs.tCond, &condAttr); pthread_condattr_destroy(&condAttr); @@ -2343,7 +2343,7 @@ static void* niThreadProc(void *args) pthread_mutex_lock(&pSession->tLock); /* Calculate absolute expire time */ - clock_gettime(CLOCK_BOOTTIME, &present_time); + clock_gettime(CLOCK_MONOTONIC, &present_time); expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; expire_time.tv_nsec = present_time.tv_nsec; LOC_LOGD("%s]: time out set for abs time %ld with delay %d sec", From ccdb671f87cad33335c0389576335907876fc388 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 30 May 2018 17:44:25 -0700 Subject: [PATCH 692/945] DataItem changes to fix incorrect NetworkInfo connect handling NetworkInfoBaase added a type to allTypes protected method so that derived class can use it. Also, the SystemStatusNetworkInfo no longer compares names in its equal(), as it only is going to return false when comparing GnssLocationProvider NetworkInfo and OsAgent NetworkInfo. Change-Id: I363f27f4ed7be4aab2a4c4c033d5dff69d0a47d9 CRs-Fixed: 2251564 --- core/SystemStatus.cpp | 2 +- core/SystemStatus.h | 13 ++----------- core/data-items/DataItemConcreteTypesBase.h | 7 ++++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 5d5c4b08..b3260bdd 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1680,7 +1680,7 @@ bool SystemStatus::setDefaultGnssEngineStates(void) bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) { // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", false, connected, false); + SystemStatusNetworkInfo s(type, "", "", connected); mSysStatusObsvr.notify({&s}); return true; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index ac59cdc7..b2f4fb6a 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -466,7 +466,6 @@ public: int32_t type=0, std::string typeName="", string subTypeName="", - bool available=false, bool connected=false, bool roaming=false) : NetworkInfoDataItemBase( @@ -474,7 +473,7 @@ public: type, typeName, subTypeName, - available, + connected && (!roaming), connected, roaming), mSrcObjPtr(nullptr) {} @@ -484,15 +483,7 @@ public: mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - if ((mAllTypes == peer.mAllTypes) && - (mTypeName == peer.mTypeName) && - (mSubTypeName == peer.mSubTypeName) && - (mAvailable == peer.mAvailable) && - (mConnected == peer.mConnected) && - (mRoaming == peer.mRoaming)) { - return true; - } - return false; + return (mAllTypes == peer.mAllTypes); } inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { uint64_t allTypes = (static_cast(curInfo)).mAllTypes; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index d35c5450..bcb8d725 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -236,8 +236,7 @@ public: NetworkInfoDataItemBase( NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming ): - mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? - 0 : (1<= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1< Date: Tue, 13 Mar 2018 10:11:02 -0700 Subject: [PATCH 693/945] SUPL connection enhancements Adding enhancement to ATL messages to allow sending bearer type and apn type mask values. CRs-fixed: 2206014 Change-Id: I28f6583d842e82c9e26d40be55312f8aaf01193e --- core/LocAdapterBase.cpp | 17 +-- core/LocAdapterBase.h | 8 +- core/LocApiBase.cpp | 47 +------ core/LocApiBase.h | 15 +- gnss/Agps.cpp | 299 +++------------------------------------- gnss/Agps.h | 98 ++----------- gnss/GnssAdapter.cpp | 125 ++--------------- gnss/GnssAdapter.h | 5 +- utils/gps_extended_c.h | 48 ++++--- utils/loc_gps.h | 6 +- 10 files changed, 95 insertions(+), 573 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 744a4403..f7443f86 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2017The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2018 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 @@ -130,25 +130,14 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/, LocApnTypeMask /*mask*/) + requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/, + LocApnTypeMask /*apn_type_mask*/) DEFAULT_IMPL(false) bool LocAdapterBase:: releaseATL(int /*connHandle*/) DEFAULT_IMPL(false) -bool LocAdapterBase:: - requestSuplES(int /*connHandle*/, LocApnTypeMask /*mask*/) -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - reportDataCallOpened() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - reportDataCallClosed() -DEFAULT_IMPL(false) - bool LocAdapterBase:: requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/) DEFAULT_IMPL(false) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e31a5d22..a187a8dc 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2018 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 @@ -133,11 +133,9 @@ public: virtual bool requestXtraData(); virtual bool requestTime(); virtual bool requestLocation(); - virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); + virtual bool requestATL(int connHandle, LocAGpsType agps_type, + LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); - virtual bool requestSuplES(int connHandle, LocApnTypeMask mask); - virtual bool reportDataCallOpened(); - virtual bool reportDataCallClosed(); virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index b7e3aeb8..4a1c8fcf 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -378,10 +378,12 @@ void LocApiBase::requestLocation() TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); } -void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask) +void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type, + LocApnTypeMask apn_type_mask) { // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type, mask)); + TO_1ST_HANDLING_LOCADAPTERS( + mLocAdapters[i]->requestATL(connHandle, agps_type, apn_type_mask)); } void LocApiBase::releaseATL(int connHandle) @@ -390,24 +392,6 @@ void LocApiBase::releaseATL(int connHandle) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); } -void LocApiBase::requestSuplES(int connHandle, LocApnTypeMask mask) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle, mask)); -} - -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(GnssNiNotification ¬ify, const void* data) { // loop through adapters, and deliver to the first handling adapter. @@ -485,7 +469,8 @@ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) void LocApiBase:: atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/, - AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/, LocApnTypeMask /*mask*/) + AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/, + LocApnTypeMask /*mask*/) DEFAULT_IMPL() void LocApiBase:: @@ -583,26 +568,6 @@ void LocApiBase:: getBestAvailableZppFix() DEFAULT_IMPL() -int LocApiBase:: - initDataServiceClient(bool /*isDueToSsr*/) -DEFAULT_IMPL(-1) - -int LocApiBase:: - openAndStartDataCall() -DEFAULT_IMPL(-1) - -void LocApiBase:: - stopDataCall() -DEFAULT_IMPL() - -void LocApiBase:: - closeDataCall() -DEFAULT_IMPL() - -void LocApiBase:: - releaseDataServiceClient() -DEFAULT_IMPL() - LocationError LocApiBase:: setGpsLockSync(GnssConfigGpsLock /*lock*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 4db51fa1..a96c0199 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2018 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 @@ -147,11 +147,8 @@ public: void requestXtraData(); void requestTime(); void requestLocation(); - void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); + void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); void releaseATL(int connHandle); - void requestSuplES(int connHandle, LocApnTypeMask mask); - void reportDataCallOpened(); - void reportDataCallClosed(); void requestNiNotify(GnssNiNotification ¬ify, const void* data); void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); void reportWwanZppFix(LocGpsLocation &zppLoc); @@ -186,7 +183,8 @@ public: virtual void atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, - AGpsBearerType bear, LocAGpsType agpsType, LocApnTypeMask mask); + AGpsBearerType bear, LocAGpsType agpsType, + LocApnTypeMask mask); virtual void atlCloseStatus(int handle, int is_succ); virtual void @@ -237,11 +235,6 @@ public: virtual void getWwanZppFix(); virtual void getBestAvailableZppFix(); - virtual int initDataServiceClient(bool isDueToSsr); - virtual int openAndStartDataCall(); - virtual void stopDataCall(); - virtual void closeDataCall(); - virtual void releaseDataServiceClient(); virtual void installAGpsCert(const LocDerEncodedCertificate* pData, size_t length, uint32_t slotBitMask); diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 6fe306e8..4d01ba78 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 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 @@ -78,16 +78,8 @@ void AgpsStateMachine::processAgpsEventSubscribe(){ /* Add subscriber to list * No notifications until we get RSRC_GRANTED */ addSubscriber(mCurrentSubscriber); - - /* Send data request - * The if condition below 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 (requestOrReleaseDataConn(true) == 0) { - // If data request successful, move to pending state - transitionState(AGPS_STATE_PENDING); - } + requestOrReleaseDataConn(true); + transitionState(AGPS_STATE_PENDING); break; case AGPS_STATE_PENDING: @@ -294,24 +286,25 @@ void AgpsStateMachine::processAgpsEventDenied(){ * bool request : * true = Request data connection * false = Release data connection */ -int AgpsStateMachine::requestOrReleaseDataConn(bool request){ +void AgpsStateMachine::requestOrReleaseDataConn(bool request){ AGnssExtStatusIpV4 nifRequest; memset(&nifRequest, 0, sizeof(nifRequest)); nifRequest.type = mAgpsType; - + nifRequest.apnTypeMask = mApnTypeMask; if (request) { - LOC_LOGD("AGPS Data Conn Request"); + LOC_LOGD("AGPS Data Conn Request mAgpsType=%d mApnTypeMask=0x%X", + mAgpsType, mApnTypeMask); nifRequest.status = LOC_GPS_REQUEST_AGPS_DATA_CONN; } else{ - LOC_LOGD("AGPS Data Conn Release"); + LOC_LOGD("AGPS Data Conn Release mAgpsType=%d mApnTypeMask=0x%X", + mAgpsType, mApnTypeMask); nifRequest.status = LOC_GPS_RELEASE_AGPS_DATA_CONN; } mAgpsManager->mFrameworkStatusV4Cb(nifRequest); - return 0; } void AgpsStateMachine::notifyAllSubscribers( @@ -362,13 +355,13 @@ void AgpsStateMachine::notifyEventToSubscriber( case AGPS_EVENT_GRANTED: mAgpsManager->mAtlOpenStatusCb( subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(), - getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL); + getBearer(), mAgpsType, mApnTypeMask); break; case AGPS_EVENT_DENIED: mAgpsManager->mAtlOpenStatusCb( subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(), - getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL); + getBearer(), mAgpsType, mApnTypeMask); break; case AGPS_EVENT_UNSUBSCRIBE: @@ -513,189 +506,6 @@ void AgpsStateMachine::dropAllSubscribers(){ } } -/* -------------------------------------------------------------------- - * DS State Machine Methods - * -------------------------------------------------------------------*/ -const int DSStateMachine::MAX_START_DATA_CALL_RETRIES = 4; -const int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500; - -/* Overridden method - * DS SM needs to handle one scenario differently */ -void DSStateMachine::processAgpsEvent(AgpsEvent event) { - - LOC_LOGD("DSStateMachine::processAgpsEvent() %d", event); - - /* DS Client call setup APIs don't return failure/closure separately. - * Hence we receive RELEASED event in both cases. - * If we are in pending, we should consider RELEASED as DENIED */ - if (event == AGPS_EVENT_RELEASED && mState == AGPS_STATE_PENDING) { - - LOC_LOGD("Translating RELEASED to DENIED event"); - event = AGPS_EVENT_DENIED; - } - - /* Redirect process to base class */ - AgpsStateMachine::processAgpsEvent(event); -} - -/* Timer Callback - * For the retry timer started in case of DS Client call setup failure */ -void delay_callback(void *callbackData, int result) -{ - LOC_LOGD("delay_callback(): cbData %p", callbackData); - - (void)result; - - if (callbackData == NULL) { - LOC_LOGE("delay_callback(): NULL argument received !"); - return; - } - DSStateMachine* dsStateMachine = (DSStateMachine *)callbackData; - dsStateMachine->retryCallback(); -} - -/* Invoked from Timer Callback - * For the retry timer started in case of DS Client call setup failure */ -void DSStateMachine :: retryCallback() -{ - LOC_LOGD("DSStateMachine::retryCallback()"); - - /* Request SUPL ES - * There must be at least one active subscriber in list */ - AgpsSubscriber* subscriber = getFirstSubscriber(false); - if (subscriber == NULL) { - - LOC_LOGE("No active subscriber for DS Client call setup"); - return; - } - - /* Send message to retry */ - mAgpsManager->mSendMsgToAdapterQueueFn( - new AgpsMsgRequestATL( - mAgpsManager, subscriber->mConnHandle, - LOC_AGPS_TYPE_SUPL_ES, subscriber->mApnTypeMask)); -} - -/* Overridden method - * Request or Release data connection - * bool request : - * true = Request data connection - * false = Release data connection */ -int DSStateMachine::requestOrReleaseDataConn(bool request){ - - LOC_LOGD("DSStateMachine::requestOrReleaseDataConn(): " - "request %d", request); - - /* Release data connection required ? */ - if (!request && mAgpsManager->mDSClientStopDataCallFn) { - - mAgpsManager->mDSClientStopDataCallFn(); - LOC_LOGD("DS Client release data call request sent !"); - return 0; - } - - /* Setup data connection request - * There must be at least one active subscriber in list */ - AgpsSubscriber* subscriber = getFirstSubscriber(false); - if (subscriber == NULL) { - - LOC_LOGE("No active subscriber for DS Client call setup"); - return -1; - } - - /* DS Client Fn registered ? */ - if (!mAgpsManager->mDSClientOpenAndStartDataCallFn) { - - LOC_LOGE("DS Client start fn not registered, fallback to SUPL ATL"); - notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); - return -1; - } - - /* Setup the call */ - int ret = mAgpsManager->mDSClientOpenAndStartDataCallFn(); - - /* Check if data call start failed */ - switch (ret) { - - case LOC_API_ADAPTER_ERR_ENGINE_BUSY: - LOC_LOGE("DS Client open call failed, err: %d", ret); - mRetries++; - if (mRetries > MAX_START_DATA_CALL_RETRIES) { - - LOC_LOGE("DS Client call retries exhausted, " - "falling back to normal SUPL ATL"); - notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); - } - /* Retry DS Client call setup after some delay */ - else if(loc_timer_start( - DATA_CALL_RETRY_DELAY_MSEC, delay_callback, this)) { - LOC_LOGE("Error: Could not start delay thread\n"); - return -1; - } - break; - - case LOC_API_ADAPTER_ERR_UNSUPPORTED: - LOC_LOGE("No emergency profile found. Fall back to normal SUPL ATL"); - notifyEventToSubscriber(AGPS_EVENT_DENIED, subscriber, false); - break; - - case LOC_API_ADAPTER_ERR_SUCCESS: - LOC_LOGD("Request to start data call sent"); - break; - - default: - LOC_LOGE("Unrecognized return value: %d", ret); - } - - return ret; -} - -void DSStateMachine::notifyEventToSubscriber( - AgpsEvent event, AgpsSubscriber* subscriberToNotify, - bool deleteSubscriberPostNotify) { - - LOC_LOGD("DSStateMachine::notifyEventToSubscriber(): " - "SM %p, Event %d Subscriber %p Delete %d", - this, event, subscriberToNotify, deleteSubscriberPostNotify); - - switch (event) { - - case AGPS_EVENT_GRANTED: - mAgpsManager->mAtlOpenStatusCb( - subscriberToNotify->mConnHandle, 1, NULL, 0, - AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES, - LOC_APN_TYPE_MASK_EMERGENCY); - break; - - case AGPS_EVENT_DENIED: - /* Now try with regular SUPL - * We need to send request via message queue */ - mRetries = 0; - mAgpsManager->mSendMsgToAdapterQueueFn( - new AgpsMsgRequestATL( - mAgpsManager, subscriberToNotify->mConnHandle, - LOC_AGPS_TYPE_SUPL, subscriberToNotify->mApnTypeMask)); - break; - - case AGPS_EVENT_UNSUBSCRIBE: - mAgpsManager->mAtlCloseStatusCb(subscriberToNotify->mConnHandle, 1); - break; - - case AGPS_EVENT_RELEASED: - mAgpsManager->mDSClientCloseDataCallFn(); - mAgpsManager->mAtlCloseStatusCb(subscriberToNotify->mConnHandle, 1); - break; - - default: - LOC_LOGE("Invalid event %d", event); - } - - /* Search this subscriber in list and delete */ - if (deleteSubscriberPostNotify) { - deleteSubscriber(subscriberToNotify); - } -} - /* -------------------------------------------------------------------- * Loc AGPS Manager Methods * -------------------------------------------------------------------*/ @@ -719,22 +529,6 @@ void AgpsManager::createAgpsStateMachines() { mAgnssNif = new AgpsStateMachine(this, LOC_AGPS_TYPE_SUPL); LOC_LOGD("AGNSS NIF: %p", mAgnssNif); } - if (NULL == mDsNif && - loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - - if(!mDSClientInitFn){ - - LOC_LOGE("DS Client Init Fn not registered !"); - return; - } - if (mDSClientInitFn(false) != 0) { - - LOC_LOGE("Failed to init data service client"); - return; - } - mDsNif = new DSStateMachine(this); - LOC_LOGD("DS NIF: %p", mDsNif); - } } } @@ -746,21 +540,11 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { case LOC_AGPS_TYPE_INVALID: case LOC_AGPS_TYPE_SUPL: + case LOC_AGPS_TYPE_SUPL_ES: if (mAgnssNif == NULL) { LOC_LOGE("NULL AGNSS NIF !"); } return mAgnssNif; - - case LOC_AGPS_TYPE_SUPL_ES: - if (loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - if (mDsNif == NULL) { - createAgpsStateMachines(); - } - return mDsNif; - } else { - return mAgnssNif; - } - default: return mInternetNif; } @@ -769,30 +553,28 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { return NULL; } -void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask){ +void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, + LocApnTypeMask apnTypeMask){ - LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d apnTypeMask %" PRIu64, - connHandle, agpsType, mask); + LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType 0x%X apnTypeMask: 0x%X", + connHandle, agpsType, apnTypeMask); AgpsStateMachine* sm = getAgpsStateMachine(agpsType); if (sm == NULL) { - LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); + LOC_LOGE("No AGPS State Machine for agpsType: %d apnTypeMask: 0x%X", + agpsType, apnTypeMask); mAtlOpenStatusCb( - connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType, mask); + connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType, apnTypeMask); return; } + sm->setType(agpsType); + sm->setApnTypeMask(apnTypeMask); /* Invoke AGPS SM processing */ - AgpsSubscriber subscriber(connHandle, false, false, mask); + AgpsSubscriber subscriber(connHandle, false, false, apnTypeMask); sm->setCurrentSubscriber(&subscriber); - - /* If DS State Machine, wait for close complete */ - if (agpsType == LOC_AGPS_TYPE_SUPL_ES) { - subscriber.mWaitForCloseComplete = true; - } - /* Send subscriber event */ sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE); } @@ -814,11 +596,6 @@ void AgpsManager::releaseATL(int connHandle){ (subscriber = mInternetNif->getSubscriber(connHandle)) != NULL) { sm = mInternetNif; } - else if (mDsNif && - (subscriber = mDsNif->getSubscriber(connHandle)) != NULL) { - sm = mDsNif; - } - if (sm == NULL) { LOC_LOGE("Subscriber with connHandle %d not found in any SM", connHandle); @@ -831,24 +608,6 @@ void AgpsManager::releaseATL(int connHandle){ sm->processAgpsEvent(AGPS_EVENT_UNSUBSCRIBE); } -void AgpsManager::reportDataCallOpened(){ - - LOC_LOGD("AgpsManager::reportDataCallOpened"); - - if (mDsNif) { - mDsNif->processAgpsEvent(AGPS_EVENT_GRANTED); - } -} - -void AgpsManager::reportDataCallClosed(){ - - LOC_LOGD("AgpsManager::reportDataCallClosed"); - - if (mDsNif) { - mDsNif->processAgpsEvent(AGPS_EVENT_RELEASED); - } -} - void AgpsManager::reportAtlOpenSuccess( AGpsExtType agpsType, char* apnName, int apnLen, AGpsBearerType bearerType){ @@ -897,18 +656,4 @@ void AgpsManager::handleModemSSR(){ if (mInternetNif) { mInternetNif->dropAllSubscribers(); } - if (mDsNif) { - mDsNif->dropAllSubscribers(); - } - - // reinitialize DS client in SSR mode - if (loc_core::ContextBase::mGps_conf. - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - - mDSClientStopDataCallFn(); - mDSClientCloseDataCallFn(); - mDSClientReleaseFn(); - - mDSClientInitFn(true); - } } diff --git a/gnss/Agps.h b/gnss/Agps.h index e388cfe5..829cbd59 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 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 @@ -42,18 +42,10 @@ typedef std::function AgpsAtlOpenStatusCb; + LocApnTypeMask mask)> AgpsAtlOpenStatusCb; typedef std::function AgpsAtlCloseStatusCb; -/* DS Client control APIs - * Passed in by Adapter to AgpsManager */ -typedef std::function AgpsDSClientInitFn; -typedef std::function AgpsDSClientOpenAndStartDataCallFn; -typedef std::function AgpsDSClientStopDataCallFn; -typedef std::function AgpsDSClientCloseDataCallFn; -typedef std::function AgpsDSClientReleaseFn; - /* Post message to adapter's message queue */ typedef std::function SendMsgToAdapterMsgQueueFn; @@ -93,8 +85,6 @@ typedef enum { class AgpsSubscriber; class AgpsManager; class AgpsStateMachine; -class DSStateMachine; - /* SUBSCRIBER * Each Subscriber instance corresponds to one AGPS request, @@ -154,6 +144,7 @@ private: LOC_AGPS_TYPE_WWAN_ANY 3 LOC_AGPS_TYPE_SUPL_ES 5 */ AGpsExtType mAgpsType; + LocApnTypeMask mApnTypeMask; /* APN and IP Type info for AGPS Call */ char* mAPN; @@ -175,7 +166,11 @@ public: inline char* getAPN() const { return (char*)mAPN; } inline uint32_t getAPNLen() const { return mAPNLen; } inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline LocApnTypeMask getApnTypeMask() const { return mApnTypeMask; } + inline void setApnTypeMask(LocApnTypeMask apnTypeMask) + { mApnTypeMask = apnTypeMask; } inline AGpsBearerType getBearer() const { return mBearer; } + inline void setType(AGpsExtType type) { mAgpsType = type; } inline AGpsExtType getType() const { return mAgpsType; } inline void setCurrentSubscriber(AgpsSubscriber* subscriber) { mCurrentSubscriber = subscriber; } @@ -204,7 +199,7 @@ private: /* Send call setup request to framework * sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN) * sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN) */ - virtual int requestOrReleaseDataConn(bool request); + void requestOrReleaseDataConn(bool request); /* Individual event processing methods */ void processAgpsEventSubscribe(); @@ -232,74 +227,23 @@ private: void transitionState(AgpsState newState); }; -/* DS STATE MACHINE */ -class DSStateMachine : public AgpsStateMachine { - -private: - static const int MAX_START_DATA_CALL_RETRIES; - static const int DATA_CALL_RETRY_DELAY_MSEC; - - int mRetries; - -public: - /* CONSTRUCTOR */ - DSStateMachine(AgpsManager* agpsManager): - AgpsStateMachine(agpsManager, LOC_AGPS_TYPE_SUPL_ES), mRetries(0) {} - - /* Overridden method - * DS SM needs to handle one event differently */ - void processAgpsEvent(AgpsEvent event); - - /* Retry callback, used in case call failure */ - void retryCallback(); - -private: - /* Overridden method, different functionality for DS SM - * Send call setup request to framework - * sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN) - * sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN) */ - int requestOrReleaseDataConn(bool request); - - /* Overridden method, different functionality for DS SM */ - void notifyEventToSubscriber( - AgpsEvent event, AgpsSubscriber* subscriber, - bool deleteSubscriberPostNotify); -}; - /* LOC AGPS MANAGER */ class AgpsManager { friend class AgpsStateMachine; - friend class DSStateMachine; - public: /* CONSTRUCTOR */ AgpsManager(): mFrameworkStatusV4Cb(NULL), mAtlOpenStatusCb(), mAtlCloseStatusCb(), - mDSClientInitFn(), mDSClientOpenAndStartDataCallFn(), - mDSClientStopDataCallFn(), mDSClientCloseDataCallFn(), mDSClientReleaseFn(), - mSendMsgToAdapterQueueFn(), - mAgnssNif(NULL), mInternetNif(NULL), mDsNif(NULL) {} + mAgnssNif(NULL), mInternetNif(NULL)/*, mDsNif(NULL)*/ {} /* Register callbacks */ inline void registerATLCallbacks(AgpsAtlOpenStatusCb atlOpenStatusCb, - AgpsAtlCloseStatusCb atlCloseStatusCb, - AgpsDSClientInitFn dsClientInitFn, - AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn, - AgpsDSClientStopDataCallFn dsClientStopDataCallFn, - AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn, - AgpsDSClientReleaseFn dsClientReleaseFn, - SendMsgToAdapterMsgQueueFn sendMsgToAdapterQueueFn) { + AgpsAtlCloseStatusCb atlCloseStatusCb) { mAtlOpenStatusCb = atlOpenStatusCb; mAtlCloseStatusCb = atlCloseStatusCb; - mDSClientInitFn = dsClientInitFn; - mDSClientOpenAndStartDataCallFn = dsClientOpenAndStartDataCallFn; - mDSClientStopDataCallFn = dsClientStopDataCallFn; - mDSClientCloseDataCallFn = dsClientCloseDataCallFn; - mDSClientReleaseFn = dsClientReleaseFn; - mSendMsgToAdapterQueueFn = sendMsgToAdapterQueueFn; } inline void registerFrameworkStatusCallback(AgnssStatusIpV4Cb frameworkStatusV4Cb) { @@ -310,13 +254,8 @@ public: void createAgpsStateMachines(); /* Process incoming ATL requests */ - void requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask); + void requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask apnTypeMask); void releaseATL(int connHandle); - - /* Process incoming DS Client data call events */ - void reportDataCallOpened(); - void reportDataCallClosed(); - /* Process incoming framework data call events */ void reportAtlOpenSuccess(AGpsExtType agpsType, char* apnName, int apnLen, AGpsBearerType bearerType); @@ -331,19 +270,8 @@ protected: AgpsAtlOpenStatusCb mAtlOpenStatusCb; AgpsAtlCloseStatusCb mAtlCloseStatusCb; - - AgpsDSClientInitFn mDSClientInitFn; - AgpsDSClientOpenAndStartDataCallFn mDSClientOpenAndStartDataCallFn; - AgpsDSClientStopDataCallFn mDSClientStopDataCallFn; - AgpsDSClientCloseDataCallFn mDSClientCloseDataCallFn; - AgpsDSClientReleaseFn mDSClientReleaseFn; - - SendMsgToAdapterMsgQueueFn mSendMsgToAdapterQueueFn; - AgpsStateMachine* mAgnssNif; AgpsStateMachine* mInternetNif; - AgpsStateMachine* mDsNif; - private: /* Fetch state machine for handling request ATL call */ AgpsStateMachine* getAgpsStateMachine(AGpsExtType agpsType); @@ -361,9 +289,9 @@ struct AgpsMsgRequestATL: public LocMsg { LocApnTypeMask mApnTypeMask; inline AgpsMsgRequestATL(AgpsManager* agpsManager, int connHandle, - AGpsExtType agpsType, LocApnTypeMask mask) : + AGpsExtType agpsType, LocApnTypeMask apnTypeMask) : LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle), - mAgpsType(agpsType), mApnTypeMask(mask) { + mAgpsType(agpsType), mApnTypeMask(apnTypeMask){ LOC_LOGV("AgpsMsgRequestATL"); } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 4b6fce85..9a79c610 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -109,47 +109,7 @@ GnssAdapter::GnssAdapter() : mLocApi->atlCloseStatus(handle, isSuccess); }; - - /* Register DS Client APIs */ - AgpsDSClientInitFn dsClientInitFn = - [this](bool isDueToSSR) { - - return mLocApi->initDataServiceClient(isDueToSSR); - }; - - AgpsDSClientOpenAndStartDataCallFn dsClientOpenAndStartDataCallFn = - [this] { - - return mLocApi->openAndStartDataCall(); - }; - - AgpsDSClientStopDataCallFn dsClientStopDataCallFn = - [this] { - - mLocApi->stopDataCall(); - }; - - AgpsDSClientCloseDataCallFn dsClientCloseDataCallFn = - [this] { - - mLocApi->closeDataCall(); - }; - - AgpsDSClientReleaseFn dsClientReleaseFn = - [this] { - - mLocApi->releaseDataServiceClient(); - }; - - /* Send Msg function */ - SendMsgToAdapterMsgQueueFn sendMsgFn = - [this](LocMsg* msg) { - - sendMsg(msg); - }; - mAgpsManager.registerATLCallbacks(atlOpenStatusCb, atlCloseStatusCb, - dsClientInitFn, dsClientOpenAndStartDataCallFn, dsClientStopDataCallFn, - dsClientCloseDataCallFn, dsClientReleaseFn, sendMsgFn); + mAgpsManager.registerATLCallbacks(atlOpenStatusCb, atlCloseStatusCb); readConfigCommand(); initDefaultAgpsCommand(); @@ -3365,28 +3325,17 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ * eQMI_LOC_SERVER_REQUEST_OPEN_V02 * Triggers the AGPS state machine to setup AGPS call for below WWAN types: * eQMI_LOC_WWAN_TYPE_INTERNET_V02 - * eQMI_LOC_WWAN_TYPE_AGNSS_V02 */ -bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType, LocApnTypeMask mask){ - - LOC_LOGI("GnssAdapter::requestATL"); - - sendMsg( new AgpsMsgRequestATL( - &mAgpsManager, connHandle, (AGpsExtType)agpsType, mask)); - - return true; -} - -/* GnssAdapter::requestSuplES - * Method triggered in QMI thread as part of handling below message: - * eQMI_LOC_SERVER_REQUEST_OPEN_V02 - * Triggers the AGPS state machine to setup AGPS call for below WWAN types: + * eQMI_LOC_WWAN_TYPE_AGNSS_V02 * eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 */ -bool GnssAdapter::requestSuplES(int connHandle, LocApnTypeMask mask){ +bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType, + LocApnTypeMask apnTypeMask){ - LOC_LOGI("GnssAdapter::requestSuplES"); + LOC_LOGI("GnssAdapter::requestATL handle=%d agpsType=0x%X apnTypeMask=0x%X", + connHandle, agpsType, apnTypeMask); sendMsg( new AgpsMsgRequestATL( - &mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES, mask)); + &mAgpsManager, connHandle, (AGpsExtType)agpsType, + apnTypeMask)); return true; } @@ -3423,64 +3372,6 @@ bool GnssAdapter::releaseATL(int connHandle){ return true; } -/* GnssAdapter::reportDataCallOpened - * DS Client data call opened successfully. - * Send message to AGPS Manager to handle. */ -bool GnssAdapter::reportDataCallOpened(){ - - LOC_LOGI("GnssAdapter::reportDataCallOpened"); - - struct AgpsMsgSuplEsOpened: public LocMsg { - - AgpsManager* mAgpsManager; - - inline AgpsMsgSuplEsOpened(AgpsManager* agpsManager) : - LocMsg(), mAgpsManager(agpsManager) { - - LOC_LOGV("AgpsMsgSuplEsOpened"); - } - - inline virtual void proc() const { - - LOC_LOGV("AgpsMsgSuplEsOpened::proc()"); - mAgpsManager->reportDataCallOpened(); - } - }; - - sendMsg( new AgpsMsgSuplEsOpened(&mAgpsManager)); - - return true; -} - -/* GnssAdapter::reportDataCallClosed - * DS Client data call closed. - * Send message to AGPS Manager to handle. */ -bool GnssAdapter::reportDataCallClosed(){ - - LOC_LOGI("GnssAdapter::reportDataCallClosed"); - - struct AgpsMsgSuplEsClosed: public LocMsg { - - AgpsManager* mAgpsManager; - - inline AgpsMsgSuplEsClosed(AgpsManager* agpsManager) : - LocMsg(), mAgpsManager(agpsManager) { - - LOC_LOGV("AgpsMsgSuplEsClosed"); - } - - inline virtual void proc() const { - - LOC_LOGV("AgpsMsgSuplEsClosed::proc()"); - mAgpsManager->reportDataCallClosed(); - } - }; - - sendMsg( new AgpsMsgSuplEsClosed(&mAgpsManager)); - - return true; -} - void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType){ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index cf556d70..319ea6bb 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -283,11 +283,8 @@ public: virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); - virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask); + virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); - virtual bool requestSuplES(int connHandle, LocApnTypeMask mask); - virtual bool reportDataCallOpened(); - virtual bool reportDataCallClosed(); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); /* ======== UTILITIES ================================================================= */ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index ed4a1b80..f2b5b9f0 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2018 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 @@ -160,17 +160,27 @@ typedef int16_t AGpsBearerType; #define AGPS_APN_BEARER_IPV6 2 #define AGPS_APN_BEARER_IPV4V6 3 -typedef uint64_t LocApnTypeMask; -#define LOC_APN_TYPE_MASK_DEFAULT ((LocApnTypeMask)0x0000000000000001ull) /**< Denotes APN type for Default/Internet traffic */ -#define LOC_APN_TYPE_MASK_IMS ((LocApnTypeMask)0x0000000000000002ull) /**< Denotes APN type for IP Multimedia Subsystem */ -#define LOC_APN_TYPE_MASK_MMS ((LocApnTypeMask)0x0000000000000004ull) /**< Denotes APN type for Multimedia Messaging Service */ -#define LOC_APN_TYPE_MASK_DUN ((LocApnTypeMask)0x0000000000000008ull) /**< Denotes APN type for Dial Up Network */ -#define LOC_APN_TYPE_MASK_SUPL ((LocApnTypeMask)0x0000000000000010ull) /**< Denotes APN type for Secure User Plane Location */ -#define LOC_APN_TYPE_MASK_HIPRI ((LocApnTypeMask)0x0000000000000020ull) /**< Denotes APN type for High Priority Mobile Data */ -#define LOC_APN_TYPE_MASK_FOTA ((LocApnTypeMask)0x0000000000000040ull) /**< Denotes APN type for over the air administration */ -#define LOC_APN_TYPE_MASK_CBS ((LocApnTypeMask)0x0000000000000080ull) /**< Denotes APN type for Carrier Branded Services */ -#define LOC_APN_TYPE_MASK_IA ((LocApnTypeMask)0x0000000000000100ull) /**< Denotes APN type for Initial Attach */ -#define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x0000000000000200ull) /**< Denotes APN type for emergency */ +typedef uint32_t LocApnTypeMask; +/**< Denotes APN type for Default/Internet traffic */ +#define LOC_APN_TYPE_MASK_DEFAULT ((LocApnTypeMask)0x00000001) +/**< Denotes APN type for IP Multimedia Subsystem */ +#define LOC_APN_TYPE_MASK_IMS ((LocApnTypeMask)0x00000002) +/**< Denotes APN type for Multimedia Messaging Service */ +#define LOC_APN_TYPE_MASK_MMS ((LocApnTypeMask)0x00000004) +/**< Denotes APN type for Dial Up Network */ +#define LOC_APN_TYPE_MASK_DUN ((LocApnTypeMask)0x00000008) +/**< Denotes APN type for Secure User Plane Location */ +#define LOC_APN_TYPE_MASK_SUPL ((LocApnTypeMask)0x00000010) +/**< Denotes APN type for High Priority Mobile Data */ +#define LOC_APN_TYPE_MASK_HIPRI ((LocApnTypeMask)0x00000020) +/**< Denotes APN type for over the air administration */ +#define LOC_APN_TYPE_MASK_FOTA ((LocApnTypeMask)0x00000040) +/**< Denotes APN type for Carrier Branded Services */ +#define LOC_APN_TYPE_MASK_CBS ((LocApnTypeMask)0x00000080) +/**< Denotes APN type for Initial Attach */ +#define LOC_APN_TYPE_MASK_IA ((LocApnTypeMask)0x00000100) +/**< Denotes APN type for emergency */ +#define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x00000200) typedef enum { AGPS_CB_PRIORITY_LOW = 1, @@ -1490,24 +1500,26 @@ typedef std::function Date: Tue, 15 May 2018 10:21:09 -0700 Subject: [PATCH 694/945] Handle updating the carrier configuration Set GPS_LOCK for cases where the modem has two SIMs Change-Id: I2745b9469b2f755b0a24be2a7f4ae514c35a37cb CRs-fixed: 2018029 --- core/ContextBase.cpp | 2 +- core/LocAdapterBase.cpp | 5 +++-- core/LocAdapterBase.h | 18 +++++++++++++++--- core/LocApiBase.cpp | 16 ++++++++++++---- core/LocApiBase.h | 7 +------ etc/gps.conf | 4 ++-- gnss/GnssAdapter.cpp | 7 +++++-- 7 files changed, 39 insertions(+), 20 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 5695544a..2c7f04cb 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -104,7 +104,7 @@ void ContextBase::readConfig() mGps_conf.INTERMEDIATE_POS = 0; mGps_conf.ACCURACY_THRES = 0; mGps_conf.NMEA_PROVIDER = 0; - mGps_conf.GPS_LOCK = 0; + mGps_conf.GPS_LOCK = 0x03; mGps_conf.SUPL_VER = 0x10000; mGps_conf.SUPL_MODE = 0x1; mGps_conf.SUPL_ES = 0; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index f7443f86..8301ee86 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -42,8 +42,9 @@ namespace loc_core { // 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), + ContextBase* context, bool isMaster, + LocAdapterProxyBase *adapterProxyBase) : + mIsMaster(isMaster), mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), mMsgTask(context->getMsgTask()) { diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index a187a8dc..e3502b21 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -59,6 +59,7 @@ class LocAdapterProxyBase; class LocAdapterBase { private: static uint32_t mSessionIdCounter; + const bool mIsMaster; protected: LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; ContextBase* mContext; @@ -66,12 +67,18 @@ protected: LocAdapterProxyBase* mLocAdapterProxyBase; const MsgTask* mMsgTask; inline LocAdapterBase(const MsgTask* msgTask) : - mEvtMask(0), mContext(NULL), mLocApi(NULL), + mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL), mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context, bool isMaster, + LocAdapterProxyBase *adapterProxyBase = NULL); public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); + inline LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context, + LocAdapterProxyBase *adapterProxyBase = NULL) : + LocAdapterBase(mask, context, false, adapterProxyBase) {} + inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { return mEvtMask & mask; @@ -111,6 +118,11 @@ public: } uint32_t generateSessionId(); + + inline bool isAdapterMaster() { + return mIsMaster; + } + virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); inline virtual void setPositionModeCommand(LocPosMode& posMode) { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 4a1c8fcf..650de92e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -163,6 +163,18 @@ LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() return mask & ~mExcludedMask; } +bool LocApiBase::isMaster() +{ + bool isMaster = false; + + for (int i = 0; + !isMaster && i < MAX_ADAPTERS && NULL != mLocAdapters[i]; + i++) { + isMaster |= mLocAdapters[i]->isAdapterMaster(); + } + return isMaster; +} + bool LocApiBase::isInSession() { bool inSession = false; @@ -578,10 +590,6 @@ void LocApiBase:: uint32_t /*slotBitMask*/) DEFAULT_IMPL() -int LocApiBase:: - getGpsLock() -DEFAULT_IMPL(-1) - LocationError LocApiBase:: setXtraVersionCheckSync(uint32_t /*check*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index a96c0199..8c516fdd 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -121,6 +121,7 @@ protected: inline virtual ~LocApiBase() { close(); } bool isInSession(); const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask; + bool isMaster(); public: inline void sendMsg(const LocMsg* msg) const { @@ -247,12 +248,6 @@ public: void updateEvtMask(); virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); - /* - Returns - Current value of GPS Lock on success - -1 on failure - */ - virtual int getGpsLock(void); virtual LocationError setXtraVersionCheckSync(uint32_t check); diff --git a/etc/gps.conf b/etc/gps.conf index 51c0b965..3f2ee2f6 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -34,8 +34,8 @@ INTERMEDIATE_POS=0 # 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 +# default – both MO and NI locked for maximal privacy +#GPS_LOCK = 3 # supl version 1.0 SUPL_VER=0x10000 diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9a79c610..dbfbb743 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -65,7 +65,7 @@ GnssAdapter::GnssAdapter() : LocDualContext::getLocFgContext(NULL, NULL, LocDualContext::mLocationHalName, - false)), + false), true, nullptr), mEngHubProxy(new EngineHubProxyBase()), mLocPositionMode(), mGnssSvIdUsedInPosition(), @@ -755,6 +755,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) index++; uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; + if (0 == ContextBase::mGps_conf.GPS_LOCK) { + ContextBase::mGps_conf.GPS_LOCK = 3; + } if (0 != mAdapter.getPowerVoteId()) { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } @@ -1744,7 +1747,7 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; - LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIu64 "", __func__, mask); + LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIx64 "", __func__, mask); } if (mAgpsCbInfo.statusV4Cb != NULL) { From 271cfd8a00f97f13a937877cc8ef66ef0392a087 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 4 Jun 2018 16:55:56 -0700 Subject: [PATCH 695/945] Report yearOfHw=2018 when P features are supported Support of features AGPM or Constellation Control mean that we report yearOfHW as 2018 Change-Id: I01b7a3ce7f8b38569cf419cf07fef1d55da5f149 CRs-fixed: 2254698 --- android/location_api/GnssAPIClient.cpp | 5 ++++- gnss/GnssAdapter.cpp | 6 ++++++ location/LocationDataTypes.h | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 65e8b91b..24d94aa2 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -319,7 +319,10 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) } if (gnssCbIface != nullptr) { IGnssCallback::GnssSystemInfo gnssInfo; - if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { + if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || + capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) { + gnssInfo.yearOfHw = 2018; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { gnssInfo.yearOfHw = 2017; } else if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { gnssInfo.yearOfHw = 2016; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index dbfbb743..98a3249e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1880,6 +1880,12 @@ GnssAdapter::getCapabilities() if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { + mask |= LOCATION_CAPABILITIES_AGPM_BIT; + } return mask; } diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 66ed3ad1..1ebcb33b 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -191,7 +191,11 @@ typedef enum { // supports debug nmea sentences in the debugNmeaCallback LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8), // support outdoor trip batching - LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9) + LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9), + // support constellation enablement + LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT = (1<<10), + // support agpm + LOCATION_CAPABILITIES_AGPM_BIT = (1<<11), } LocationCapabilitiesBits; typedef enum { From 7dfa87b244f3acc601c7db5721d6d5ebc50320f3 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 6 Feb 2018 16:36:27 -0800 Subject: [PATCH 696/945] Support Multiband feature Add carrierFrequency to GNSS Measurements reporting. Also, add AGC level from QMI LOC message to GNSS measurements (as opposed to adding it from NMEA debug messages). CRs-fixed: 2186144 Change-Id: Ia3995ba9e09ef4c68e8922b7570f7af0eb50098a --- android/location_api/GnssAPIClient.cpp | 3 +++ core/LocApiBase.cpp | 3 ++- location/LocationDataTypes.h | 9 ++++++--- utils/gps_extended_c.h | 2 ++ utils/loc_gps.h | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 24d94aa2..9fbbb272 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -525,6 +525,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; info.elevationDegrees = in.gnssSvs[i].elevation; info.azimuthDegrees = in.gnssSvs[i].azimuth; + info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; info.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; @@ -532,6 +533,8 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; } } diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 650de92e..30fececc 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -320,7 +320,7 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) sizeof(constellationString) / sizeof(constellationString[0]) - 1) { svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN; } - LOC_LOGV(" %03zu: %*s %02d %f %f %f 0x%02X", + LOC_LOGV(" %03zu: %*s %02d %f %f %f %f 0x%02X", i, 13, constellationString[svNotify.gnssSvs[i].type], @@ -328,6 +328,7 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) svNotify.gnssSvs[i].cN0Dbhz, svNotify.gnssSvs[i].elevation, svNotify.gnssSvs[i].azimuth, + svNotify.gnssSvs[i].carrierFrequencyHz, svNotify.gnssSvs[i].gnssSvOptionsMask); } // loop through adapters, and deliver to all adapters. diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 1ebcb33b..29bae91e 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -345,9 +345,10 @@ typedef enum { typedef uint16_t GnssSvOptionsMask; typedef enum { - GNSS_SV_OPTIONS_HAS_EPHEMER_BIT = (1<<0), - GNSS_SV_OPTIONS_HAS_ALMANAC_BIT = (1<<1), - GNSS_SV_OPTIONS_USED_IN_FIX_BIT = (1<<2), + GNSS_SV_OPTIONS_HAS_EPHEMER_BIT = (1<<0), + GNSS_SV_OPTIONS_HAS_ALMANAC_BIT = (1<<1), + GNSS_SV_OPTIONS_USED_IN_FIX_BIT = (1<<2), + GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT = (1<<3), } GnssSvOptionsBits; typedef enum { @@ -454,6 +455,7 @@ typedef enum { GNSS_AIDING_DATA_SV_NO_EXIST_BIT = (1<<8), // SV does not exist GNSS_AIDING_DATA_SV_IONOSPHERE_BIT = (1<<9), // ionosphere correction GNSS_AIDING_DATA_SV_TIME_BIT = (1<<10),// reset satellite time + GNSS_AIDING_DATA_SV_MB_DATA = (1 << 11),// delete multiband data } GnssAidingDataSvBits; typedef uint32_t GnssAidingDataSvTypeMask; @@ -794,6 +796,7 @@ typedef struct { float elevation; // elevation of SV (in degrees) float azimuth; // azimuth of SV (in degrees) GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits + float carrierFrequencyHz; // carrier frequency of the signal tracked } GnssSv; struct GnssConfigSetAssistanceServer { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index f2b5b9f0..481889fc 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -57,6 +57,8 @@ extern "C" { /** LocGpsLocation has valid map index */ #define LOC_GPS_LOCATION_HAS_MAP_INDEX 0x0200 +#define GNSS_INVALID_JAMMER_IND 0x7FFFFFFF + /** Sizes for indoor fields */ #define GPS_LOCATION_MAP_URL_SIZE 400 #define GPS_LOCATION_MAP_INDEX_SIZE 16 diff --git a/utils/loc_gps.h b/utils/loc_gps.h index 95d0c21a..505060cd 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -151,6 +151,7 @@ typedef uint16_t LocGpsAidingData; #define LOC_GPS_DELETE_SVSTEER 0x0100 #define LOC_GPS_DELETE_SADATA 0x0200 #define LOC_GPS_DELETE_RTI 0x0400 +#define LOC_GPS_DELETE_MB_DATA 0x0800 #define LOC_GPS_DELETE_CELLDB_INFO 0x8000 #define LOC_GPS_DELETE_ALL 0xFFFF From aac86a158ad76119efe8d9b0718f600354a99b97 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 18 Jun 2018 16:51:41 +0530 Subject: [PATCH 697/945] body frame uncertainty parameters in position report added uncertainty parameters for longAccel, latAccel, vertAccel, yawRate and pitch. Change-Id: I804dc0b370dd78402a6641f5a16e5ee7a53ff9a1 CRs-Fixed: 2262454 --- utils/gps_extended_c.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 21eb5d55..255acd8e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -359,6 +359,16 @@ typedef uint32_t LocPosDataMask; #define LOC_NAV_DATA_HAS_YAW_RATE ((LocPosDataMask)0x0008) /* Bitmask to specify whether Navigation data has Body pitch */ #define LOC_NAV_DATA_HAS_PITCH ((LocPosDataMask)0x0010) +/* Bitmask to specify whether Navigation data has Forward Acceleration Unc */ +#define LOC_NAV_DATA_HAS_LONG_ACCEL_UNC ((LocPosDataMask)0x0020) +/* Bitmask to specify whether Navigation data has Sideward Acceleration Unc*/ +#define LOC_NAV_DATA_HAS_LAT_ACCEL_UNC ((LocPosDataMask)0x0040) +/* Bitmask to specify whether Navigation data has Vertical Acceleration Unc*/ +#define LOC_NAV_DATA_HAS_VERT_ACCEL_UNC ((LocPosDataMask)0x0080) +/* Bitmask to specify whether Navigation data has Heading Rate Unc*/ +#define LOC_NAV_DATA_HAS_YAW_RATE_UNC ((LocPosDataMask)0x0100) +/* Bitmask to specify whether Navigation data has Body pitch Unc*/ +#define LOC_NAV_DATA_HAS_PITCH_UNC ((LocPosDataMask)0x0200) /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 @@ -412,14 +422,24 @@ typedef struct { uint32_t bodyFrameDatamask; /* Forward Acceleration in body frame (m/s2)*/ float longAccel; + /** Uncertainty of Forward Acceleration in body frame */ + float longAccelUnc; /* Sideward Acceleration in body frame (m/s2)*/ float latAccel; + /** Uncertainty of Side-ward Acceleration in body frame */ + float latAccelUnc; /* Vertical Acceleration in body frame (m/s2)*/ float vertAccel; + /** Uncertainty of Vertical Acceleration in body frame */ + float vertAccelUnc; /* Heading Rate (Radians/second) */ float yawRate; + /** Uncertainty of Heading Rate */ + float yawRateUnc; /* Body pitch (Radians) */ float pitch; + /** Uncertainty of Body pitch */ + float pitchRadUnc; }LocPositionDynamics; typedef struct { From f50e02a555cd8320c8e65383030fba166dc4fead Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 27 Apr 2018 13:38:36 -0700 Subject: [PATCH 698/945] GNSS adapter: Do not send SPE NMEA to engine hub Engine service does not need SPE NMEA report. Change-Id: I809fa2857eec8292269b640928a44d8cc54308ed CRs-fixed: 2232811 --- core/EngineHubProxyBase.h | 5 ----- gnss/GnssAdapter.cpp | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 3851b2f0..b159bd89 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -80,11 +80,6 @@ public: (void) svPolynomial; return false; } - - inline virtual bool gnssReportNmea(const char* nmea) { - (void) nmea; - return false; - } }; typedef std::functiongnssReportNmea(nmea); + return; } struct MsgReportNmea : public LocMsg { From dc1e6f6f3469138aed389cd42e429d454ffc1c07 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 13 Jun 2018 15:10:43 -0700 Subject: [PATCH 699/945] Changed to allow only locclient group to access hal daemon Move hal daemon socket creation to loc_client directory Define uid/gid for locclient CRs-Fixed: 2260194 Change-Id: Icaac885c19cd65b11254bb93b6a938b2d4595761 --- pla/oe/loc_pla.h | 2 ++ utils/gps_extended_c.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 094e3f33..94468881 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -64,6 +64,8 @@ extern "C" { #define UID_GPS (1021) #define GID_GPS (1021) +#define UID_LOCCLIENT (4021) +#define GID_LOCCLIENT (4021) #define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index ea38eb38..7720489a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1505,7 +1505,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_DIR_LOCATION "/dev/socket/location/" #define SOCKET_DIR_EHUB "/dev/socket/location/ehub/" -#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" +#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/loc_client/hal_daemon" #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" #define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" From 383a8afbb2dc8758535397f651b805770a00ad09 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 19 Jun 2018 10:06:15 -0700 Subject: [PATCH 700/945] Fixed wrongly changed year in header Change-Id: I61d6406c9a45f5215bebb0a398319e159e490c69 CRs-fixed: 2206014 --- utils/loc_gps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loc_gps.h b/utils/loc_gps.h index 505060cd..b905c53e 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2018 The Android Open Source Project + * Copyright (C) 2010 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. From 2c99ad159fcd37adcbdcf1ca55d798d701bf24d6 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Tue, 19 Jun 2018 19:23:30 +0800 Subject: [PATCH 701/945] Set interval to large value for single mode For RECURRENCE_SINGLE mode, set interval to a very large value: std::numeric_limits<>::max() Change-Id: Id9f2ddd1948d9660f69a308b3fe6ad6e6dcc6a77 CRs-Fixed: 2260711 --- android/location_api/GnssAPIClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 9fbbb272..61412120 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -166,6 +166,10 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); mTrackingOptions.size = sizeof(TrackingOptions); mTrackingOptions.minInterval = minIntervalMs; + if (IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { + mTrackingOptions.minInterval = + std::numeric_limits::max(); + } mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; From 02cddf0f260b4c0b78aec15272f3594de8a8ec8c Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Thu, 21 Jun 2018 10:44:51 +0530 Subject: [PATCH 702/945] GNSS hal: propagate position dynamics uncertainty Support for uncertainty of positition dynamics, including uncertainty of forward, sideward, upward accelation, and uncertainty of heading and pitch Change-Id: I33fbfd0344d4beb7eabaa629b0c0993fe368293b CRs-fixed: 2263818 --- gnss/GnssAdapter.cpp | 28 +++----------------- location/LocationDataTypes.h | 17 +++++++++++- utils/gps_extended_c.h | 50 +----------------------------------- 3 files changed, 20 insertions(+), 75 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ef835aee..e22bee09 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -380,34 +380,12 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.navSolutionMask = locationExtended.navSolutionMask; } if (GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK & locationExtended.flags) { - out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK; + out.flags |= GNSS_LOCATION_INFO_POS_TECH_MASK_BIT; out.posTechMask = locationExtended.tech_mask; } if (GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA & locationExtended.flags) { - out.flags |= GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA; - if (locationExtended.bodyFrameData.bodyFrameDatamask & - LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT) { - out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LONG_ACCEL_BIT; - } - if (locationExtended.bodyFrameData.bodyFrameDatamask & - LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT) { - out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT; - } - if (locationExtended.bodyFrameData.bodyFrameDatamask & - LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT) { - out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT; - } - if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_YAW_RATE_BIT) { - out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_YAW_RATE_BIT; - } - if (locationExtended.bodyFrameData.bodyFrameDatamask & LOCATION_NAV_DATA_HAS_PITCH_BIT) { - out.bodyFrameData.bodyFrameDataMask |= LOCATION_NAV_DATA_HAS_PITCH_BIT; - } - out.bodyFrameData.longAccel = locationExtended.bodyFrameData.longAccel; - out.bodyFrameData.latAccel = locationExtended.bodyFrameData.latAccel; - out.bodyFrameData.vertAccel = locationExtended.bodyFrameData.vertAccel; - out.bodyFrameData.yawRate = locationExtended.bodyFrameData.yawRate; - out.bodyFrameData.pitch = locationExtended.bodyFrameData.pitch; + out.flags |= GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT; + out.bodyFrameData = locationExtended.bodyFrameData; } // Validity of this structure is established from the timeSrc of the GnssSystemTime structure. diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 8bb11cc7..e40dcaab 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -119,7 +119,17 @@ typedef enum { LOCATION_NAV_DATA_HAS_LAT_ACCEL_BIT = (1<<1), // Navigation data has Sideward Acceleration LOCATION_NAV_DATA_HAS_VERT_ACCEL_BIT = (1<<2), // Navigation data has Vertical Acceleration LOCATION_NAV_DATA_HAS_YAW_RATE_BIT = (1<<3), // Navigation data has Heading Rate - LOCATION_NAV_DATA_HAS_PITCH_BIT = (1<<4) // Navigation data has Body pitch + LOCATION_NAV_DATA_HAS_PITCH_BIT = (1<<4), // Navigation data has Body pitch + // Navigation data has Forward Acceleration uncertainty + LOCATION_NAV_DATA_HAS_LONG_ACCEL_UNC_BIT = (1<<5), + // Navigation data has Sideward Acceleration uncertainty + LOCATION_NAV_DATA_HAS_LAT_ACCEL_UNC_BIT = (1<<6), + // Navigation data has Vertical Acceleration uncertainty + LOCATION_NAV_DATA_HAS_VERT_ACCEL_UNC_BIT = (1<<7), + // Navigation data has Heading Rate uncertainty + LOCATION_NAV_DATA_HAS_YAW_RATE_UNC_BIT = (1<<8), + // Navigation data has Body pitch uncertainty + LOCATION_NAV_DATA_HAS_PITCH_UNC_BIT = (1<<9) } GnssLocationPosDataBits; typedef uint32_t GnssLocationInfoFlagMask; @@ -658,6 +668,11 @@ typedef struct { float vertAccel; // Vertical Acceleration in body frame (m/s2) float yawRate; // Heading Rate (Radians/second) float pitch; // Body pitch (Radians) + float longAccelUnc; // Uncertainty of Forward Acceleration in body frame + float latAccelUnc; // Uncertainty of Side-ward Acceleration in body frame + float vertAccelUnc; // Uncertainty of Vertical Acceleration in body frame + float yawRateUnc; // Uncertainty of Heading Rate + float pitchUnc; // Uncertainty of Body pitch } GnssLocationPositionDynamics; typedef struct { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 5f9dead9..aff87e96 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -353,28 +353,6 @@ typedef uint32_t LocNavSolutionMask; /**< Bitmask to specify whether Position Report is PPP corrected */ #define LOC_NAV_MASK_PPP_CORRECTION ((LocNavSolutionMask)0x0040) -typedef uint32_t LocPosDataMask; -/* Bitmask to specify whether Navigation data has Forward Acceleration */ -#define LOC_NAV_DATA_HAS_LONG_ACCEL ((LocPosDataMask)0x0001) -/* Bitmask to specify whether Navigation data has Sideward Acceleration */ -#define LOC_NAV_DATA_HAS_LAT_ACCEL ((LocPosDataMask)0x0002) -/* Bitmask to specify whether Navigation data has Vertical Acceleration */ -#define LOC_NAV_DATA_HAS_VERT_ACCEL ((LocPosDataMask)0x0004) -/* Bitmask to specify whether Navigation data has Heading Rate */ -#define LOC_NAV_DATA_HAS_YAW_RATE ((LocPosDataMask)0x0008) -/* Bitmask to specify whether Navigation data has Body pitch */ -#define LOC_NAV_DATA_HAS_PITCH ((LocPosDataMask)0x0010) -/* Bitmask to specify whether Navigation data has Forward Acceleration Unc */ -#define LOC_NAV_DATA_HAS_LONG_ACCEL_UNC ((LocPosDataMask)0x0020) -/* Bitmask to specify whether Navigation data has Sideward Acceleration Unc*/ -#define LOC_NAV_DATA_HAS_LAT_ACCEL_UNC ((LocPosDataMask)0x0040) -/* Bitmask to specify whether Navigation data has Vertical Acceleration Unc*/ -#define LOC_NAV_DATA_HAS_VERT_ACCEL_UNC ((LocPosDataMask)0x0080) -/* Bitmask to specify whether Navigation data has Heading Rate Unc*/ -#define LOC_NAV_DATA_HAS_YAW_RATE_UNC ((LocPosDataMask)0x0100) -/* Bitmask to specify whether Navigation data has Body pitch Unc*/ -#define LOC_NAV_DATA_HAS_PITCH_UNC ((LocPosDataMask)0x0200) - /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 #define GPS_SV_PRN_MAX 32 @@ -421,32 +399,6 @@ typedef struct { uint64_t qzss_sv_used_ids_mask; } GnssSvUsedInPosition; -/* Body Frame parameters */ -typedef struct { - /** Contains Body frame LocPosDataMask bits. */ - uint32_t bodyFrameDatamask; - /* Forward Acceleration in body frame (m/s2)*/ - float longAccel; - /** Uncertainty of Forward Acceleration in body frame */ - float longAccelUnc; - /* Sideward Acceleration in body frame (m/s2)*/ - float latAccel; - /** Uncertainty of Side-ward Acceleration in body frame */ - float latAccelUnc; - /* Vertical Acceleration in body frame (m/s2)*/ - float vertAccel; - /** Uncertainty of Vertical Acceleration in body frame */ - float vertAccelUnc; - /* Heading Rate (Radians/second) */ - float yawRate; - /** Uncertainty of Heading Rate */ - float yawRateUnc; - /* Body pitch (Radians) */ - float pitch; - /** Uncertainty of Body pitch */ - float pitchRadUnc; -}LocPositionDynamics; - typedef struct { /** Position dilution of precision. @@ -636,7 +588,7 @@ typedef struct { /** SV Info source used in computing this fix */ LocSvInfoSource sv_source; /** Body Frame Dynamics: 4wayAcceleration and pitch set with validity */ - LocPositionDynamics bodyFrameData; + GnssLocationPositionDynamics bodyFrameData; /** GPS Time */ GPSTimeStruct gpsTime; GnssSystemTime gnssSystemTime; From ce82e3ba4acf5310e3f60b04f3858ca114123355 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 21 Jun 2018 15:16:33 +0800 Subject: [PATCH 703/945] Correct the nmea sv info in the first fix Use the sv used info from postion report to correct nmea GPGSA in the first fix and decouple from the sv report. Change-Id: Ibc94f5b51f4112951a2bb13d83b757fa4088eb5c CRs-fixed: 2261346 --- utils/loc_nmea.cpp | 64 ++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index dd6b1285..558dc65b 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -73,8 +73,6 @@ typedef struct loc_sv_cache_info_s float vdop; } loc_sv_cache_info; -static loc_sv_cache_info sv_cache_info; - /*=========================================================================== FUNCTION loc_nmea_sv_meta_init @@ -92,6 +90,7 @@ SIDE EFFECTS ===========================================================================*/ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, + loc_sv_cache_info& sv_cache_info, GnssSvType svType, bool needCombine) { @@ -498,7 +497,20 @@ void loc_nmea_generate_pos(const UlpLocation &location, int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; int utcMSeconds = (location.gpsLocation.timestamp)%1000; + loc_sv_cache_info sv_cache_info = {}; + if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { + sv_cache_info.gps_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask; + sv_cache_info.glo_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask; + sv_cache_info.gal_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask; + sv_cache_info.qzss_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; + sv_cache_info.bds_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + } if (generate_nmea) { char talker[3] = {'G', 'P', '\0'}; uint32_t svUsedCount = 0; @@ -509,7 +521,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -522,7 +535,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -535,7 +549,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -548,7 +563,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // -------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -559,7 +575,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ---$PQGSA/$GNGSA (BEIDOU)--- // ---------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -931,13 +948,6 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - - // clear the cache so they can't be used again - sv_cache_info.gps_used_mask = 0; - sv_cache_info.glo_used_mask = 0; - sv_cache_info.gal_used_mask = 0; - sv_cache_info.qzss_used_mask = 0; - sv_cache_info.bds_used_mask = 0; } //Send blank NMEA reports for non-final fixes else { @@ -995,20 +1005,9 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; int svCount = svNotify.count; int svNumber = 1; + loc_sv_cache_info sv_cache_info = {}; //Count GPS SVs for saparating GPS from GLONASS and throw others - - sv_cache_info.gps_used_mask = 0; - sv_cache_info.glo_used_mask = 0; - sv_cache_info.gal_used_mask = 0; - sv_cache_info.qzss_used_mask = 0; - sv_cache_info.bds_used_mask = 0; - - sv_cache_info.gps_count = 0; - sv_cache_info.glo_count = 0; - sv_cache_info.gal_count = 0; - sv_cache_info.qzss_count = 0; - sv_cache_info.bds_count = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) { @@ -1078,35 +1077,38 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, false), nmeaArraystr); // ------------------ // ------$GLGSV------ // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, false), + nmeaArraystr); // ------------------ // ------$GAGSV------ // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, false), + nmeaArraystr); // ------------------------- // ------$PQGSV (QZSS)------ // ------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); // --------------------------- // ------$PQGSV (BEIDOU)------ // --------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), + nmeaArraystr); EXIT_LOG(%d, 0); } From 81736d37ab6c7b92e2915428180298565f4af5d1 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 21 Jun 2018 15:16:33 +0800 Subject: [PATCH 704/945] Correct the nmea sv info in the first fix Use the sv used info from postion report to correct nmea GPGSA in the first fix and decouple from the sv report. Change-Id: Ibc94f5b51f4112951a2bb13d83b757fa4088eb5c CRs-fixed: 2261346 --- utils/loc_nmea.cpp | 64 ++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index dd6b1285..558dc65b 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -73,8 +73,6 @@ typedef struct loc_sv_cache_info_s float vdop; } loc_sv_cache_info; -static loc_sv_cache_info sv_cache_info; - /*=========================================================================== FUNCTION loc_nmea_sv_meta_init @@ -92,6 +90,7 @@ SIDE EFFECTS ===========================================================================*/ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, + loc_sv_cache_info& sv_cache_info, GnssSvType svType, bool needCombine) { @@ -498,7 +497,20 @@ void loc_nmea_generate_pos(const UlpLocation &location, int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; int utcMSeconds = (location.gpsLocation.timestamp)%1000; + loc_sv_cache_info sv_cache_info = {}; + if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { + sv_cache_info.gps_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask; + sv_cache_info.glo_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask; + sv_cache_info.gal_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask; + sv_cache_info.qzss_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; + sv_cache_info.bds_used_mask = + (uint32_t)locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + } if (generate_nmea) { char talker[3] = {'G', 'P', '\0'}; uint32_t svUsedCount = 0; @@ -509,7 +521,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -522,7 +535,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -535,7 +549,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, true), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -548,7 +563,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // -------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -559,7 +575,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ---$PQGSA/$GNGSA (BEIDOU)--- // ---------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), + nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -931,13 +948,6 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - - // clear the cache so they can't be used again - sv_cache_info.gps_used_mask = 0; - sv_cache_info.glo_used_mask = 0; - sv_cache_info.gal_used_mask = 0; - sv_cache_info.qzss_used_mask = 0; - sv_cache_info.bds_used_mask = 0; } //Send blank NMEA reports for non-final fixes else { @@ -995,20 +1005,9 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; int svCount = svNotify.count; int svNumber = 1; + loc_sv_cache_info sv_cache_info = {}; //Count GPS SVs for saparating GPS from GLONASS and throw others - - sv_cache_info.gps_used_mask = 0; - sv_cache_info.glo_used_mask = 0; - sv_cache_info.gal_used_mask = 0; - sv_cache_info.qzss_used_mask = 0; - sv_cache_info.bds_used_mask = 0; - - sv_cache_info.gps_count = 0; - sv_cache_info.glo_count = 0; - sv_cache_info.gal_count = 0; - sv_cache_info.qzss_count = 0; - sv_cache_info.bds_count = 0; for(svNumber=1; svNumber <= svCount; svNumber++) { if (GNSS_SV_TYPE_GPS == svNotify.gnssSvs[svNumber - 1].type) { @@ -1078,35 +1077,38 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GPS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, false), nmeaArraystr); // ------------------ // ------$GLGSV------ // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GLONASS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, false), + nmeaArraystr); // ------------------ // ------$GAGSV------ // ------------------ loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_GALILEO, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, false), + nmeaArraystr); // ------------------------- // ------$PQGSV (QZSS)------ // ------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); // --------------------------- // ------$PQGSV (BEIDOU)------ // --------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, GNSS_SV_TYPE_BEIDOU, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), + nmeaArraystr); EXIT_LOG(%d, 0); } From 2ef3437f1994ff0105206e59f3993a79d18e0fd2 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 26 Jun 2018 14:38:32 +0530 Subject: [PATCH 705/945] Checking return for ODCPI CB Adding return value check for ODCPI HIDL callback API. CRs-Fixed: 2263480 Change-Id: I652a4717ab08f8a0c64b3bc0f78bae4e8f553513 --- android/Gnss.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 8f048e24..de1430cd 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -423,10 +423,9 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { // For emergency mode, request DBH (Device based hybrid) location // Mark Independent from GNSS flag to false. if (ODCPI_REQUEST_TYPE_START == request.type) { - if (request.isEmergencyMode) { - mGnssCbIface_1_1->gnssRequestLocationCb(false); - } else { - mGnssCbIface_1_1->gnssRequestLocationCb(true); + auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode); + if (!r.isOk()) { + LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str()); } } else { LOC_LOGv("Unsupported ODCPI request type: %d", request.type); From d12b82b4e4647c3dcab0c5593385344461bf9f32 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 4 Jun 2018 18:02:09 -0700 Subject: [PATCH 706/945] Added optional MO SUPL SLP Change-Id: I89c3e697b92dfe04d403c073e779906d21cefd69 CRs-fixed: 2259090 --- core/ContextBase.cpp | 2 ++ core/ContextBase.h | 2 ++ core/LocApiBase.cpp | 2 +- core/LocApiBase.h | 5 ++--- etc/gps.conf | 6 ++++++ gnss/GnssAdapter.cpp | 49 +++++++++++++++++++++++++++++++----------- gnss/GnssAdapter.h | 5 +++-- utils/gps_extended_c.h | 3 ++- 8 files changed, 54 insertions(+), 20 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 2c7f04cb..c71ca7a4 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -72,6 +72,8 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'}, {"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'}, {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' }, + {"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' }, + {"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' }, }; const loc_param_s_type ContextBase::mSap_conf_table[] = diff --git a/core/ContextBase.h b/core/ContextBase.h index 478283f8..7c5ac175 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -68,6 +68,8 @@ typedef struct loc_gps_cfg_s char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; uint32_t SUPL_PORT; uint32_t MODEM_TYPE; + char MO_SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; + uint32_t MO_SUPL_PORT; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 30fececc..ca26b328 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -495,7 +495,7 @@ void LocApiBase:: DEFAULT_IMPL() LocationError LocApiBase:: - setServerSync(const char* /*url*/, int /*len*/) + setServerSync(const char* /*url*/, int /*len*/, LocServerType /*type*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase:: diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8c516fdd..fc86eb34 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -191,10 +191,9 @@ public: virtual void setPositionMode(const LocPosMode& posMode); virtual LocationError - setServerSync(const char* url, int len); + setServerSync(const char* url, int len, LocServerType type); virtual LocationError - setServerSync(unsigned int ip, int port, - LocServerType type); + setServerSync(unsigned int ip, int port, LocServerType type); virtual void informNiResponse(GnssNiResponse userResponse, const void* passThroughData); virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version); diff --git a/etc/gps.conf b/etc/gps.conf index 3f2ee2f6..0a06cb59 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -76,6 +76,10 @@ CAPABILITIES=0x37 # SUPL_HOST=supl.host.com or IP # SUPL_PORT=1234 +# FOR MO SUPL SUPPORT, set the following +# MO_SUPL_HOST=supl.host.com or IP +# MO_SUPL_PORT=1234 + # FOR C2K PDE SUPPORT, set the following # C2K_HOST=c2k.pde.com or IP # C2K_PORT=1234 @@ -138,6 +142,8 @@ LPPE_UP_TECHNOLOGY = 0 # SUPL_VER # SUPL_HOST # SUPL_PORT +# MO_SUPL_HOST +# MO_SUPL_PORT # C2K_HOST # C2K_PORT # LPP_PROFILE diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d6efe56d..6f702af1 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -550,7 +550,7 @@ GnssAdapter::readConfigCommand() } void -GnssAdapter::setSuplHostServer(const char* server, int port) +GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) { if (ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { char serverUrl[MAX_URL_LEN] = {}; @@ -564,10 +564,14 @@ GnssAdapter::setSuplHostServer(const char* server, int port) } else if (port > 0) { length = snprintf(serverUrl, sizeof(serverUrl), "%s:%u", server, port); } - - if (length >= 0 && strncasecmp(getServerUrl().c_str(), - serverUrl, sizeof(serverUrl)) != 0) { - setServerUrl(serverUrl); + if (LOC_AGPS_SUPL_SERVER != type && LOC_AGPS_MO_SUPL_SERVER != type) { + LOC_LOGe("Invalid type=%d", type); + } else { + string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl(); + if (length > 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) { + url.assign(serverUrl); + LOC_LOGv("serverUrl=%s length=%d type=%d", serverUrl, length, type); + } } } } @@ -597,8 +601,13 @@ GnssAdapter::setConfigCommand() mAdapter.mNmeaMask= mask; std::string oldServerUrl = mAdapter.getServerUrl(); + std::string oldMoServerUrl = mAdapter.getMoServerUrl(); mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, - ContextBase::mGps_conf.SUPL_PORT); + ContextBase::mGps_conf.SUPL_PORT, + LOC_AGPS_SUPL_SERVER); + mAdapter.setSuplHostServer(ContextBase::mGps_conf.MO_SUPL_HOST, + ContextBase::mGps_conf.MO_SUPL_PORT, + LOC_AGPS_MO_SUPL_SERVER); // inject the configurations into modem GnssAdapter& adapter = mAdapter; @@ -606,10 +615,12 @@ GnssAdapter::setConfigCommand() loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; mApi.sendMsg(new LocApiMsg( - [&adapter, gpsConf, sapConf, oldServerUrl] () { + [&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () { std::string serverUrl = adapter.getServerUrl(); + std::string moServerUrl = adapter.getMoServerUrl(); int serverUrlLen = serverUrl.length(); + int moServerUrlLen = moServerUrl.length(); if (gpsConf.AGPS_CONFIG_INJECT) { adapter.mLocApi->setSUPLVersionSync( @@ -622,10 +633,21 @@ GnssAdapter::setConfigCommand() if ((serverUrlLen !=0) && (oldServerUrl.compare(serverUrl) != 0)) { LocationError locErr = - adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen); + adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen, + LOC_AGPS_SUPL_SERVER); if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGE("%s]:Error while setting SUPL_HOST server:%s", - __func__, serverUrl.c_str()); + LOC_LOGe("Error while setting SUPL_HOST server:%s", + serverUrl.c_str()); + } + } + if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) { + LocationError locErr = + adapter.mLocApi->setServerSync(moServerUrl.c_str(), + moServerUrlLen, + LOC_AGPS_MO_SUPL_SERVER); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGe("Error while setting MO SUPL_HOST server:%s", + moServerUrl.c_str()); } } @@ -777,8 +799,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) index++; if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, - mConfig.assistanceServer.port); - } else if (GNSS_ASSISTANCE_TYPE_C2K != mConfig.assistanceServer.type) { + mConfig.assistanceServer.port, + LOC_AGPS_SUPL_SERVER); + } else { LOC_LOGE("%s]: Not a valid gnss assistance type %u", __func__, mConfig.assistanceServer.type); errs.at(index) = LOCATION_ERROR_INVALID_PARAMETER; @@ -892,7 +915,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) GNSS_ASSISTANCE_TYPE_SUPL) { if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { err = adapter.mLocApi->setServerSync( - serverUrl.c_str(), serverUrlLen); + serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); errsList[index] = err; } } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 319ea6bb..7fbaf9cc 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -122,6 +122,7 @@ class GnssAdapter : public LocAdapterBase { /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; std::string mServerUrl; + std::string mMoServerUrl; XtraSystemStatusObserver mXtraObserver; /*==== CONVERSION ===================================================================*/ @@ -160,7 +161,7 @@ public: LocationCallbacks getClientCallbacks(LocationAPI* client); LocationCapabilitiesMask getCapabilities(); void broadcastCapabilities(LocationCapabilitiesMask); - void setSuplHostServer(const char* server, int port); + void setSuplHostServer(const char* server, int port, LocServerType type); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -310,7 +311,7 @@ public: /*==== SYSTEM STATUS ================================================================*/ inline SystemStatus* getSystemStatus(void) { return mSystemStatus; } std::string& getServerUrl(void) { return mServerUrl; } - void setServerUrl(const char* server) { mServerUrl.assign(server); } + std::string& getMoServerUrl(void) { return mMoServerUrl; } /*==== CONVERSION ===================================================================*/ static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 481889fc..142ae151 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -258,7 +258,8 @@ typedef enum loc_server_type { LOC_AGPS_CDMA_PDE_SERVER, LOC_AGPS_CUSTOM_PDE_SERVER, LOC_AGPS_MPC_SERVER, - LOC_AGPS_SUPL_SERVER + LOC_AGPS_SUPL_SERVER, + LOC_AGPS_MO_SUPL_SERVER } LocServerType; typedef enum loc_position_mode_type { From ee8213f3cea1ea7f90e54cb03278b4abd27864b2 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 25 May 2018 14:34:08 -0700 Subject: [PATCH 707/945] Populate some more fields for end client. These are the fields populated: North, East, Up velocity and their uncertainties North and East standard deviation Gps Time, Leap Sec and time uncertainty Gps Measurement usage info CRs-Fixed: 2249350 Change-Id: I8936b1c47be25fdc792322592f8ea5466a3fa6fd --- gnss/GnssAdapter.cpp | 55 ++++++++++++++++++++++++++ location/LocationDataTypes.h | 75 ++++++++++++++++++++++++++++++++++-- utils/gps_extended_c.h | 19 ++++++--- 3 files changed, 140 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index d6efe56d..7b7c6480 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -291,6 +291,38 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT; out.horUncEllipseOrientAzimuth = locationExtended.horUncEllipseOrientAzimuth; } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_STD_DEV & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT; + out.northVelocityStdDeviation = locationExtended.northStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_STD_DEV & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_STD_DEV_BIT; + out.eastVelocityStdDeviation = locationExtended.eastStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_BIT; + out.northVelocity = locationExtended.northVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT; + out.northVelocityStdDeviation = locationExtended.northVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_VEL_BIT; + out.eastVelocity = locationExtended.eastVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT; + out.eastVelocityStdDeviation = locationExtended.eastVelocityStdDeviation; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_UP_VEL_BIT; + out.upVelocity = locationExtended.upVelocity; + } + if (GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_UP_VEL_UNC_BIT; + out.upVelocityStdDeviation = locationExtended.upVelocityStdDeviation; + } if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT; out.svUsedInPosition.gpsSvUsedIdsMask = @@ -303,6 +335,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; out.svUsedInPosition.qzssSvUsedIdsMask = locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + out.numOfMeasReceived = locationExtended.numOfMeasReceived; + + for (int idx =0; idx < locationExtended.numOfMeasReceived; idx++) { + out.measUsageInfo[idx].gnssSignalType = + locationExtended.measUsageInfo[idx].gnssSignalType; + out.measUsageInfo[idx].gnssSvId = + locationExtended.measUsageInfo[idx].gnssSvId; + out.measUsageInfo[idx].gnssConstellation = + locationExtended.measUsageInfo[idx].gnssConstellation; + } } if (GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT; @@ -367,6 +409,19 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC; out.upVelocityStdDeviation = locationExtended.upVelocityStdDeviation; } + + // Validity of this structure is established from the timeSrc of the GnssSystemTime structure. + out.gnssSystemTime = locationExtended.gnssSystemTime; + + if (GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_LEAP_SECONDS_BIT; + out.leapSeconds = locationExtended.leapSeconds; + } + + if (GPS_LOCATION_EXTENDED_HAS_TIME_UNC & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_TIME_UNC_BIT; + out.timeUncMs = locationExtended.timeUncMs; + } } inline uint32_t diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 29bae91e..a9778e2c 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -145,8 +145,17 @@ typedef enum { GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource GNSS_LOCATION_INFO_POS_DYNAMICS_DATA_BIT = (1<<12),// valid position dynamics data - GNSS_LOCATION_INFO_GPS_TIME_BIT = (1<<13),// valid GPS Time - GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<14) // valid gdop, tdop + GNSS_LOCATION_INFO_EXT_DOP_BIT = (1<<13),// valid gdop, tdop + GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT = (1<<14),// valid North standard deviation + GNSS_LOCATION_INFO_EAST_STD_DEV_BIT = (1<<15),// valid East standard deviation + GNSS_LOCATION_INFO_NORTH_VEL_BIT = (1<<16),// valid North Velocity + GNSS_LOCATION_INFO_EAST_VEL_BIT = (1<<17),// valid East Velocity + GNSS_LOCATION_INFO_UP_VEL_BIT = (1<<18),// valid Up Velocity + GNSS_LOCATION_INFO_NORTH_VEL_UNC_BIT = (1<<19),// valid North Velocity Uncertainty + GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT = (1<<20),// valid East Velocity Uncertainty + GNSS_LOCATION_INFO_UP_VEL_UNC_BIT = (1<<21),// valid Up Velocity Uncertainty + GNSS_LOCATION_INFO_LEAP_SECONDS_BIT = (1<<22),// valid leap seconds + GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23) // valid time uncertainty } GnssLocationInfoFlagBits; typedef enum { @@ -467,6 +476,43 @@ typedef enum { GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), } GnssAidingDataSvTypeBits; +/** GNSS Signal Type and RF Band */ +typedef uint32_t GnssSignalTypeMask; +typedef enum { + /** GPS L1CA Signal */ + GNSS_SIGNAL_GPS_L1CA = (1<<0), + /** GPS L1C Signal */ + GNSS_SIGNAL_GPS_L1C = (1<<1), + /** GPS L2 RF Band */ + GNSS_SIGNAL_GPS_L2 = (1<<2), + /** GPS L5 RF Band */ + GNSS_SIGNAL_GPS_L5 = (1<<3), + /** GLONASS G1 (L1OF) RF Band */ + GNSS_SIGNAL_GLONASS_G1 = (1<<4), + /** GLONASS G2 (L2OF) RF Band */ + GNSS_SIGNAL_GLONASS_G2 = (1<<5), + /** GALILEO E1 RF Band */ + GNSS_SIGNAL_GALILEO_E1 = (1<<6), + /** GALILEO E5A RF Band */ + GNSS_SIGNAL_GALILEO_E5A = (1<<7), + /** GALILEO E5B RF Band */ + GNSS_SIGNAL_GALILIEO_E5B = (1<<8), + /** BEIDOU B1 RF Band */ + GNSS_SIGNAL_BEIDOU_B1 = (1<<9), + /** BEIDOU B2 RF Band */ + GNSS_SIGNAL_BEIDOU_B2 = (1<<10), + /** QZSS L1CA RF Band */ + GNSS_SIGNAL_QZSS_L1CA = (1<<11), + /** QZSS L1S RF Band */ + GNSS_SIGNAL_QZSS_L1S = (1<<12), + /** QZSS L2 RF Band */ + GNSS_SIGNAL_QZSS_L2 = (1<<13), + /** QZSS L5 RF Band */ + GNSS_SIGNAL_QZSS_L5 = (1<<14), + /** SBAS L1 RF Band */ + GNSS_SIGNAL_SBAS_L1 = (1<<15) +} GnssSignalTypeBits; + typedef enum { GNSS_LOC_SV_SYSTEM_GPS = 1, @@ -645,6 +691,21 @@ typedef struct { uint64_t qzssSvUsedIdsMask; } GnssLocationSvUsedInPosition; +typedef struct { + /** GnssSignalType mask */ + GnssSignalTypeMask gnssSignalType; + /** Specifies GNSS Constellation Type */ + Gnss_LocSvSystemEnumType gnssConstellation; + /** GNSS SV ID. + For GPS: 1 to 32 + For GLONASS: 65 to 96. When slot-number to SV ID mapping is unknown, set as 255. + For SBAS: 120 to 151 + For QZSS-L1CA:193 to 197 + For BDS: 201 to 237 + For GAL: 301 to 336 */ + uint16_t gnssSvId; +} GnssMeasUsageInfo; + /** @struct Body Frame parameters */ @@ -760,9 +821,11 @@ typedef struct { float horUncEllipseSemiMajor; // horizontal elliptical accuracy semi-major axis float horUncEllipseSemiMinor; // horizontal elliptical accuracy semi-minor axis float horUncEllipseOrientAzimuth; // horizontal elliptical accuracy azimuth + float northStdDeviation; // North standard deviation Unit: Meters + float eastStdDeviation; // East standard deviation. Unit: Meters float northVelocity; // North Velocity.Unit: Meters/sec - float eastVelocity; // East Velocity - float upVelocity; + float eastVelocity; // East Velocity Unit Meters/sec + float upVelocity; // Up Velocity. Unit Meters/sec float northVelocityStdDeviation; float eastVelocityStdDeviation; float upVelocityStdDeviation; @@ -772,6 +835,10 @@ typedef struct { GnssLocationPositionDynamics bodyFrameData; // Body Frame Dynamics: 4wayAcceleration and // pitch set with validity GnssSystemTime gnssSystemTime; // GNSS System Time + uint8_t numOfMeasReceived; // Number of measurements received for use in fix. + GnssMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; // GNSS Measurement Usage info + uint8_t leapSeconds; // leap second + float timeUncMs; // Time uncertainty in milliseconds Location location; } GnssLocationInfoNotification; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 481889fc..e7206f27 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -294,7 +294,7 @@ typedef enum loc_position_mode_type { #define GPS_DEFAULT_FIX_INTERVAL_MS 1000 /** Flags to indicate which values are valid in a GpsLocationExtended. */ -typedef uint32_t GpsLocationExtendedFlags; +typedef uint64_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 /** GpsLocationExtended has valid altitude mean sea level. */ @@ -349,14 +349,19 @@ typedef uint32_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_EAST_VEL_UNC 0x2000000 /** GpsLocationExtended has up Velocity Uncertainty */ #define GPS_LOCATION_EXTENDED_HAS_UP_VEL_UNC 0x4000000 -/** GpsLocationExtended has up Clock Bias */ +/** GpsLocationExtended has Clock Bias */ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS 0x8000000 -/** GpsLocationExtended has up Clock Bias std deviation*/ +/** GpsLocationExtended has Clock Bias std deviation*/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_BIAS_STD_DEV 0x10000000 -/** GpsLocationExtended has up Clock drift*/ +/** GpsLocationExtended has Clock drift*/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000 -/** GpsLocationExtended has up Clock drift std deviation**/ +/** GpsLocationExtended has Clock drift std deviation**/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 +/** GpsLocationExtended has leap seconds **/ +#define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000 +/** GpsLocationExtended has time uncertainty **/ +#define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 + typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -686,6 +691,10 @@ typedef struct { uint8_t numOfMeasReceived; /** Measurement Usage Information */ GpsMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; + /** Leap Seconds */ + uint8_t leapSeconds; + /** Time uncertainty in milliseconds */ + float timeUncMs; } GpsLocationExtended; enum loc_sess_status { From cbf99f89055d7d9a327b8ea4ddb4f216a15f185f Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 26 Jun 2018 18:39:26 -0700 Subject: [PATCH 708/945] Don't send ACK to modem for a 2nd close request For the case the modem sends a close request for the same connection handle do not process the request and do not ACK to the modem CRs-fixed: 2269123 Change-Id: I027c3e79965bb0f9ab311093904e6dded1aa5d03 --- gnss/Agps.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 4d01ba78..2470b813 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -599,7 +599,6 @@ void AgpsManager::releaseATL(int connHandle){ if (sm == NULL) { LOC_LOGE("Subscriber with connHandle %d not found in any SM", connHandle); - mAtlCloseStatusCb(connHandle, 0); return; } From 802e89fcdfedb55e317ad1464db9d30d79edd63f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 May 2018 10:03:33 -0700 Subject: [PATCH 709/945] fixed data items for service and cell info which right now are not keeping any data into the SSOO's table, therefore it is not able to determine if the new data arrives is different than the current one. This results in not passing the following data updates to the clients. Change-Id: Ieb94e959228d9a9f8d43b090f3328208387d864f CRs-Fixed: 2239616 --- core/SystemStatus.h | 10 ++++--- core/data-items/DataItemConcreteTypesBase.h | 30 ++++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 657720d4..b2f4fb6a 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -514,8 +514,9 @@ public: RilServiceInfoDataItemBase() {} inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) : RilServiceInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusServiceInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusServiceInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; @@ -527,8 +528,9 @@ public: RilCellInfoDataItemBase() {} inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) : RilCellInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusRilCellInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusRilCellInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 45cd3253..bcb8d725 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -314,24 +314,42 @@ protected: class RilServiceInfoDataItemBase : public IDataItemCore { public: - RilServiceInfoDataItemBase() : - mId(RILSERVICEINFO_DATA_ITEM_ID) {} - virtual ~RilServiceInfoDataItemBase() {} + inline RilServiceInfoDataItemBase() : + mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {} + inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) : + RilServiceInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; }; class RilCellInfoDataItemBase : public IDataItemCore { public: - RilCellInfoDataItemBase() : - mId(RILCELLINFO_DATA_ITEM_ID) {} - virtual ~RilCellInfoDataItemBase() {} + inline RilCellInfoDataItemBase() : + mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {} + inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) : + RilCellInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilCellInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; }; From 1e871997d65d6479d0950b52e0c52c795f73cf70 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Wed, 27 Jun 2018 15:20:21 +0800 Subject: [PATCH 710/945] Fix: wrong string format operator a log print in LocCloseMsg print a string without dereferenced address, and it will cause null pointer dereference. Change-Id: I0daf7cbf09033e065e07825f842320ae5d2508cb CRs-Fixed: 2259999 --- core/LocApiBase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8981e8b8..98aa50b8 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -137,7 +137,6 @@ struct LocCloseMsg : public LocMsg { mLocApi->close(); } inline void locallog() const { - LOC_LOGV("%s]: LocCloseMsg"); } inline virtual void log() const { locallog(); From 7a8e0643c3484a7991abf1a9d53cc12d0d3a7165 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 19 Jun 2018 18:43:51 +0530 Subject: [PATCH 711/945] Checking return for ODCPI CB Adding return value check for ODCPI HIDL callback API CRs-Fixed: 2263480 Change-Id: I652a4717ab08f8a0c64b3bc0f78bae4e8f553513 --- android/Gnss.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android/Gnss.cpp b/android/Gnss.cpp index 5cec786a..fca72e6e 100644 --- a/android/Gnss.cpp +++ b/android/Gnss.cpp @@ -434,10 +434,9 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { // For emergency mode, request DBH (Device based hybrid) location // Mark Independent from GNSS flag to false. if (ODCPI_REQUEST_TYPE_START == request.type) { - if (request.isEmergencyMode) { - mGnssCbIface_1_1->gnssRequestLocationCb(false); - } else { - mGnssCbIface_1_1->gnssRequestLocationCb(true); + auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode); + if (!r.isOk()) { + LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str()); } } else { LOC_LOGv("Unsupported ODCPI request type: %d", request.type); From 864d80533243578917ecc9e56bf00037a2ca92db Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 25 Jun 2018 14:36:06 -0700 Subject: [PATCH 712/945] Get AGC from PQWM1 regardless of time validity Eliminated time valid dependency when processing PQWM1 message to get AGC Bug: 110460486 Change-Id: I962272a749599db7a9dc84e00da9e1152686c366 CRs-fixed: 2267159 --- gnss/GnssAdapter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 30bc4212..f8ba0eb4 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2470,7 +2470,7 @@ void GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek) { - LOC_LOGD("%s]: ", __func__); + LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek); struct MsgReportGnssMeasurementData : public LocMsg { GnssAdapter& mAdapter; @@ -3176,7 +3176,6 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m systemstatus->getReport(reports, true); if ((!reports.mRfAndParams.empty()) && (!reports.mTimeAndClock.empty()) && - reports.mTimeAndClock.back().mTimeValid && (abs(msInWeek - (int)reports.mTimeAndClock.back().mGpsTowMs) < 2000)) { for (size_t i = 0; i < measurements.count; i++) { From 1d42da7b67692ed627e1deae4b4ea06e63267340 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 25 Jun 2018 14:36:06 -0700 Subject: [PATCH 713/945] Get AGC from PQWM1 regardless of time validity Eliminated time valid dependency when processing PQWM1 message to get AGC Bug: 110460486 Change-Id: I962272a749599db7a9dc84e00da9e1152686c366 CRs-fixed: 2267159 --- gnss/GnssAdapter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7b7c6480..25820efd 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3150,7 +3150,7 @@ void GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek) { - LOC_LOGD("%s]: ", __func__); + LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek); struct MsgReportGnssMeasurementData : public LocMsg { GnssAdapter& mAdapter; @@ -3774,7 +3774,6 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m systemstatus->getReport(reports, true); if ((!reports.mRfAndParams.empty()) && (!reports.mTimeAndClock.empty()) && - reports.mTimeAndClock.back().mTimeValid && (abs(msInWeek - (int)reports.mTimeAndClock.back().mGpsTowMs) < 2000)) { for (size_t i = 0; i < measurements.count; i++) { From 59269e171eb1b1b2dbfa01ae2b3d1d40f11e31f7 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sun, 1 Jul 2018 00:43:09 +0530 Subject: [PATCH 714/945] Add a getLocationOptions() function in TrackingOptions Add a getLocationOptions() function in TrackingOptions to return the LocationOptions object data associated with this class. This is for use in client_api and location-hal-daemon. Change-Id: Id725e1961dc390b8dac908575bb1686b16756057 CRs-Fixed: 2270936 --- location/LocationDataTypes.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index a9778e2c..1b82e47d 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -33,6 +33,7 @@ #include #include #include +#include #define GNSS_NI_REQUESTOR_MAX (256) #define GNSS_NI_MESSAGE_ID_MAX (2048) @@ -631,6 +632,14 @@ struct TrackingOptions : LocationOptions { minDistance = options.minDistance; mode = options.mode; } + inline LocationOptions getLocationOptions() { + LocationOptions locOption; + locOption.size = sizeof(locOption); + locOption.minDistance = minDistance; + locOption.minInterval = minInterval; + locOption.mode = mode; + return locOption; + } }; struct BatchingOptions : LocationOptions { From f7e3cd59e391017043829ae1a8cc52c09273e771 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 4 May 2018 14:34:17 +0530 Subject: [PATCH 715/945] Returning failure on GPS blacklisting Returning false for HIDL Set Blacklist API when a GPS constellation SV is passed in for blacklisting. Change-Id: I4fdaf226111d9db365af11c0e5bb6fa043c0b6fb CRs-Fixed: 2234230 --- android/GnssConfiguration.cpp | 22 +++++++++++++++++++--- android/GnssConfiguration.h | 2 +- gnss/GnssAdapter.cpp | 24 ++++++++++++++++++++---- gnss/GnssAdapter.h | 2 +- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index cee928ab..f52ae4bd 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -233,6 +233,11 @@ Return GnssConfiguration::setBlacklist( return false; } + // blValid is true if blacklist is empty, i.e. clearing the BL; + // if blacklist is not empty, blValid is initialied to false, and later + // updated in the for loop to become true only if there is at least + // one {constellation, svid} in the list that is valid. + bool blValid = (0 == blacklist.size()); GnssConfig config; memset(&config, 0, sizeof(GnssConfig)); config.size = sizeof(GnssConfig); @@ -241,25 +246,33 @@ Return GnssConfiguration::setBlacklist( GnssSvIdSource source = {}; for (int idx = 0; idx < (int)blacklist.size(); idx++) { - setBlacklistedSource(source, blacklist[idx]); + // Set blValid true if any one source is valid + blValid = setBlacklistedSource(source, blacklist[idx]) || blValid; config.blacklistedSvIds.push_back(source); } - return mGnss->updateConfiguration(config); + // Update configuration only if blValid is true + // i.e. only if atleast one source is valid for blacklisting + return (blValid && mGnss->updateConfiguration(config)); } -void GnssConfiguration::setBlacklistedSource( +bool GnssConfiguration::setBlacklistedSource( GnssSvIdSource& copyToSource, const GnssConfiguration::BlacklistedSource& copyFromSource) { + bool retVal = true; copyToSource.size = sizeof(GnssSvIdSource); switch(copyFromSource.constellation) { case GnssConstellationType::GPS: copyToSource.constellation = GNSS_SV_TYPE_GPS; + LOC_LOGe("GPS SVs can't be blacklisted."); + retVal = false; break; case GnssConstellationType::SBAS: copyToSource.constellation = GNSS_SV_TYPE_SBAS; + LOC_LOGe("SBAS SVs can't be blacklisted."); + retVal = false; break; case GnssConstellationType::GLONASS: copyToSource.constellation = GNSS_SV_TYPE_GLONASS; @@ -275,10 +288,13 @@ void GnssConfiguration::setBlacklistedSource( break; default: copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; + LOC_LOGe("Invalid constellation %d", copyFromSource.constellation); + retVal = false; break; } copyToSource.svId = copyFromSource.svid; + return retVal; } } // namespace implementation diff --git a/android/GnssConfiguration.h b/android/GnssConfiguration.h index 15ee2906..96681b61 100644 --- a/android/GnssConfiguration.h +++ b/android/GnssConfiguration.h @@ -64,7 +64,7 @@ struct GnssConfiguration : public IGnssConfiguration { private: Gnss* mGnss = nullptr; - void setBlacklistedSource( + bool setBlacklistedSource( GnssSvIdSource& copyToSource, const GnssConfiguration::BlacklistedSource& copyFromSource); }; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f3c7d5e2..90e1a50f 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1101,10 +1101,14 @@ GnssAdapter::gnssSvIdConfigUpdate(const std::vector& blacklisted memset(&mGnssSvIdConfig, 0, sizeof(GnssSvIdConfig)); // Convert the sv id lists to masks - convertToGnssSvIdConfig(blacklistedSvIds, mGnssSvIdConfig); + bool convertSuccess = convertToGnssSvIdConfig(blacklistedSvIds, mGnssSvIdConfig); - // Now send to Modem - gnssSvIdConfigUpdate(); + // Now send to Modem if conversion successful + if (convertSuccess) { + gnssSvIdConfigUpdate(); + } else { + LOC_LOGe("convertToGnssSvIdConfig failed"); + } } void @@ -1288,10 +1292,11 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { return ids; } -void +bool GnssAdapter::convertToGnssSvIdConfig( const std::vector& blacklistedSvIds, GnssSvIdConfig& config) { + bool retVal = false; config.size = sizeof(GnssSvIdConfig); // Empty vector => Clear any previous blacklisted SVs @@ -1300,6 +1305,7 @@ GnssAdapter::convertToGnssSvIdConfig( config.bdsBlacklistSvMask = 0; config.qzssBlacklistSvMask = 0; config.galBlacklistSvMask = 0; + retVal = true; } else { // Parse the vector and convert SV IDs to mask values for (GnssSvIdSource source : blacklistedSvIds) { @@ -1340,7 +1346,17 @@ GnssAdapter::convertToGnssSvIdConfig( } } } + + // Return true if any one source is valid + if (0 != config.gloBlacklistSvMask || + 0 != config.bdsBlacklistSvMask || + 0 != config.galBlacklistSvMask || + 0 != config.qzssBlacklistSvMask) { + retVal = true; + } } + + return retVal; } void GnssAdapter::convertFromGnssSvIdConfig( diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 7fbaf9cc..ad556877 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -327,7 +327,7 @@ public: static void convertSatelliteInfo(std::vector& out, const GnssSvType& in_constellation, const SystemStatusReports& in); - static void convertToGnssSvIdConfig( + static bool convertToGnssSvIdConfig( const std::vector& blacklistedSvIds, GnssSvIdConfig& config); static void convertFromGnssSvIdConfig( const GnssSvIdConfig& svConfig, GnssConfig& config); From 050de4e82ea5ce5fe95bf40c5493d42be0c2e6d6 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 11 May 2018 01:27:14 +0530 Subject: [PATCH 716/945] Adding offset for SV ID values Adding offset to SV ID values received for blacklisting in HIDL API. Change-Id: I16dd5e918e9397a23fa4e142dd94d029970f4217 CRs-Fixed: 2239179 --- android/GnssConfiguration.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/GnssConfiguration.cpp b/android/GnssConfiguration.cpp index f52ae4bd..93f96457 100644 --- a/android/GnssConfiguration.cpp +++ b/android/GnssConfiguration.cpp @@ -261,7 +261,9 @@ bool GnssConfiguration::setBlacklistedSource( const GnssConfiguration::BlacklistedSource& copyFromSource) { bool retVal = true; + uint16_t svIdOffset = 0; copyToSource.size = sizeof(GnssSvIdSource); + copyToSource.svId = copyFromSource.svid; switch(copyFromSource.constellation) { case GnssConstellationType::GPS: @@ -276,15 +278,19 @@ bool GnssConfiguration::setBlacklistedSource( break; case GnssConstellationType::GLONASS: copyToSource.constellation = GNSS_SV_TYPE_GLONASS; + svIdOffset = GNSS_SV_CONFIG_GLO_INITIAL_SV_ID - 1; break; case GnssConstellationType::QZSS: copyToSource.constellation = GNSS_SV_TYPE_QZSS; + svIdOffset = 0; break; case GnssConstellationType::BEIDOU: copyToSource.constellation = GNSS_SV_TYPE_BEIDOU; + svIdOffset = GNSS_SV_CONFIG_BDS_INITIAL_SV_ID - 1; break; case GnssConstellationType::GALILEO: copyToSource.constellation = GNSS_SV_TYPE_GALILEO; + svIdOffset = GNSS_SV_CONFIG_GAL_INITIAL_SV_ID - 1; break; default: copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; @@ -293,7 +299,10 @@ bool GnssConfiguration::setBlacklistedSource( break; } - copyToSource.svId = copyFromSource.svid; + if (copyToSource.svId > 0 && svIdOffset > 0) { + copyToSource.svId += svIdOffset; + } + return retVal; } From 889d1eed233d4875e7b265eaa81d589e922f17be Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 26 Jun 2018 15:45:41 +0530 Subject: [PATCH 717/945] Fixing error population logic Updating error vector population logic in GNSS Update config command. Change-Id: Ia328ad112056ecc20221ca10ba91c72f3182830a CRs-Fixed: 2261813 --- gnss/GnssAdapter.cpp | 47 +++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 90e1a50f..9a846c85 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -829,7 +829,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) int index = 0; if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - index++; uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; if (0 == ContextBase::mGps_conf.GPS_LOCK) { @@ -838,9 +837,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (0 != mAdapter.getPowerVoteId()) { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - index++; uint32_t newSuplVersion = mAdapter.convertSuplVersion(gnssConfigRequested.suplVersion); if (newSuplVersion != ContextBase::mGps_conf.SUPL_VER && @@ -849,9 +848,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } else { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { - index++; if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { mAdapter.setSuplHostServer(mConfig.assistanceServer.hostName, mConfig.assistanceServer.port, @@ -863,9 +862,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - index++; uint32_t newLppProfile = mAdapter.convertLppProfile(gnssConfigRequested.lppProfile); if (newLppProfile != ContextBase::mGps_conf.LPP_PROFILE && ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { @@ -873,9 +872,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } else { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { - index++; uint32_t newLppeControlPlaneMask = mAdapter.convertLppeCp(gnssConfigRequested.lppeControlPlaneMask); if (newLppeControlPlaneMask != ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY) { @@ -884,9 +883,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { - index++; uint32_t newLppeUserPlaneMask = mAdapter.convertLppeUp(gnssConfigRequested.lppeUserPlaneMask); if (newLppeUserPlaneMask != ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY) { @@ -895,10 +894,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { - index++; uint32_t newAGloProtMask = mAdapter.convertAGloProt(gnssConfigRequested.aGlonassPositionProtocolMask); if (newAGloProtMask != ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT && @@ -908,30 +907,31 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT); } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { - index++; uint32_t newEP4ES = mAdapter.convertEP4ES( gnssConfigRequested.emergencyPdnForEmergencySupl); if (newEP4ES != ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = newEP4ES; } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { - index++; uint32_t newSuplEs = mAdapter.convertSuplEs( gnssConfigRequested.suplEmergencyServices); if (newSuplEs != ContextBase::mGps_conf.SUPL_ES) { ContextBase::mGps_conf.SUPL_ES = newSuplEs; } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { - index++; uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { ContextBase::mGps_conf.SUPL_MODE = newSuplMode; mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); } + index++; } LocApiCollectiveResponse *configCollectiveResponse = new LocApiCollectiveResponse( @@ -960,10 +960,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (gnssConfigNeedEngineUpdate.assistanceServer.type == @@ -971,7 +971,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { err = adapter.mLocApi->setServerSync( serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); - errsList[index] = err; + if (index < countOfConfigs) { + errsList[index] = err; + } } } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == GNSS_ASSISTANCE_TYPE_C2K) { @@ -992,7 +994,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) LOC_LOGE("%s]: hostname '%s' cannot be resolved ", __func__, gnssConfigNeedEngineUpdate.assistanceServer.hostName); - errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; + if (index < countOfConfigs) { + errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; + } } else { resolveAddrSuccess = false; } @@ -1003,13 +1007,15 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = adapter.mLocApi->setServerSync(ip, gnssConfigNeedEngineUpdate.assistanceServer.port, LOC_AGPS_CDMA_PDE_SERVER); - errsList[index] = err; + if (index < countOfConfigs) { + errsList[index] = err; + } } } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { err = adapter.mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion); @@ -1017,9 +1023,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { err = adapter.mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile); @@ -1027,9 +1033,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { err = adapter.mLocApi->setLPPeProtocolCpSync( @@ -1038,9 +1044,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { err = adapter.mLocApi->setLPPeProtocolUpSync( @@ -1049,10 +1055,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { - index++; if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { err = adapter.mLocApi->setAGLONASSProtocolSync( @@ -1061,9 +1067,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) errsList[index] = err; } } + index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { - index++; // Check if feature is supported if (!ContextBase::isFeatureSupported( LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { @@ -1079,6 +1085,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (index < countOfConfigs) { errsList[index] = err; } + index++; } configCollectiveResponse->returnToSender(errsList); })); From 56c4dd442074bad94c2ef1483ecfc328703f8557 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 3 Jul 2018 10:45:56 -0700 Subject: [PATCH 718/945] GPS: block CPI injection for those fixes orginate from modem GNSS adapter to block CPI injection for CPI originates from modem. One source of the fix is QNP fix from modem. Only fixes that comes within time threshold and with latitude and longitude falls within the same proximity will be blocked. Change-Id: If67a164d1e1c75735979f048a9f8dc93f0b0a41f CRs-fixed: 2260721 --- gnss/GnssAdapter.cpp | 83 ++++++++++++++++++++++++++++++----- gnss/GnssAdapter.h | 18 ++++++++ gnss/location_gnss.cpp | 11 +++++ location/location_interface.h | 2 + 4 files changed, 104 insertions(+), 10 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 98a3249e..558cf495 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -84,7 +84,8 @@ GnssAdapter::GnssAdapter() : mOdcpiInjectedPositionCount(0), mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), - mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask) + mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask), + mBlockCPIInfo{} { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -1599,26 +1600,39 @@ GnssAdapter::injectLocationCommand(double latitude, double longitude, float accu struct MsgInjectLocation : public LocMsg { LocApiBase& mApi; ContextBase& mContext; + BlockCPIInfo& mBlockCPI; double mLatitude; double mLongitude; float mAccuracy; inline MsgInjectLocation(LocApiBase& api, ContextBase& context, + BlockCPIInfo& blockCPIInfo, double latitude, double longitude, float accuracy) : LocMsg(), mApi(api), mContext(context), + mBlockCPI(blockCPIInfo), mLatitude(latitude), mLongitude(longitude), mAccuracy(accuracy) {} inline virtual void proc() const { - mApi.injectPosition(mLatitude, mLongitude, mAccuracy); + if ((uptimeMillis() <= mBlockCPI.blockedTillTsMs) && + (fabs(mLatitude-mBlockCPI.latitude) <= mBlockCPI.latLonDiffThreshold) && + (fabs(mLongitude-mBlockCPI.longitude) <= mBlockCPI.latLonDiffThreshold)) { + + LOC_LOGD("%s]: positon injeciton blocked: lat: %f, lon: %f, accuracy: %f", + __func__, mLatitude, mLongitude, mAccuracy); + + } else { + mApi.injectPosition(mLatitude, mLongitude, mAccuracy); + } } }; - sendMsg(new MsgInjectLocation(*mLocApi, *mContext, latitude, longitude, accuracy)); + sendMsg(new MsgInjectLocation(*mLocApi, *mContext, mBlockCPIInfo, + latitude, longitude, accuracy)); } void @@ -1652,6 +1666,43 @@ GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t unce sendMsg(new MsgInjectTime(*mLocApi, *mContext, time, timeReference, uncertainty)); } +// This command is to called to block the position to be injected to the modem. +// This can happen for network position that comes from modem. +void +GnssAdapter::blockCPICommand(double latitude, double longitude, + float accuracy, int blockDurationMsec, + double latLonDiffThreshold) +{ + struct MsgBlockCPI : public LocMsg { + BlockCPIInfo& mDstCPIInfo; + BlockCPIInfo mSrcCPIInfo; + + inline MsgBlockCPI(BlockCPIInfo& dstCPIInfo, + BlockCPIInfo& srcCPIInfo) : + mDstCPIInfo(dstCPIInfo), + mSrcCPIInfo(srcCPIInfo) {} + inline virtual void proc() const { + // in the same hal thread, save the cpi to be blocked + // the global variable + mDstCPIInfo = mSrcCPIInfo; + } + }; + + // construct the new block CPI info and queue on the same thread + // for processing + BlockCPIInfo blockCPIInfo; + blockCPIInfo.latitude = latitude; + blockCPIInfo.longitude = longitude; + blockCPIInfo.accuracy = accuracy; + blockCPIInfo.blockedTillTsMs = uptimeMillis() + blockDurationMsec; + blockCPIInfo.latLonDiffThreshold = latLonDiffThreshold; + + LOC_LOGD("%s]: block CPI lat: %f, lon: %f ", __func__, latitude, longitude); + // send a message to record down the coarse position + // to be blocked from injection in the master copy (mBlockCPIInfo) + sendMsg(new MsgBlockCPI(mBlockCPIInfo, blockCPIInfo)); +} + void GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks) { @@ -3225,13 +3276,25 @@ void GnssAdapter::injectOdcpiCommand(const Location& location) void GnssAdapter::injectOdcpi(const Location& location) { - mLocApi->injectPosition(location, true); - if (mOdcpiRequestActive) { - mOdcpiInjectedPositionCount++; - if (mOdcpiInjectedPositionCount >= - ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST) { - mOdcpiRequestActive = false; - mOdcpiInjectedPositionCount = 0; + if (LOCATION_HAS_LAT_LONG_BIT & location.flags) { + if ((uptimeMillis() <= mBlockCPIInfo.blockedTillTsMs) && + (fabs(location.latitude-mBlockCPIInfo.latitude) <= + mBlockCPIInfo.latLonDiffThreshold) && + (fabs(location.longitude-mBlockCPIInfo.longitude) <= + mBlockCPIInfo.latLonDiffThreshold)) { + + LOC_LOGD("%s]: positon injeciton blocked: lat: %f, lon: %f, accuracy: %f", + __func__, location.latitude, location.longitude, location.accuracy); + } else { + mLocApi->injectPosition(location, true); + if (mOdcpiRequestActive) { + mOdcpiInjectedPositionCount++; + if (mOdcpiInjectedPositionCount >= + ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST) { + mOdcpiRequestActive = false; + mOdcpiInjectedPositionCount = 0; + } + } } } } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 319ea6bb..695caf8c 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -76,6 +76,19 @@ typedef struct { uint32_t svIdOffset; } NmeaSvMeta; +typedef struct { + double latitude; + double longitude; + float accuracy; + // the CPI will be blocked until the boot time + // specified in blockedTillTsMs + int64_t blockedTillTsMs; + // CPIs whose both latitude and longitude differ + // no more than latLonThreshold will be blocked + // in units of degree + double latLonDiffThreshold; +} BlockCPIInfo; + using namespace loc_core; namespace loc_core { @@ -124,6 +137,9 @@ class GnssAdapter : public LocAdapterBase { std::string mServerUrl; XtraSystemStatusObserver mXtraObserver; + /* === Misc ===================================================================== */ + BlockCPIInfo mBlockCPIInfo; + /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions); static void convertLocation(Location& out, const UlpLocation& ulpLocation, @@ -336,6 +352,8 @@ public: void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); + void blockCPICommand(double latitude, double longitude, float accuracy, + int blockDurationMsec, double latLonDiffThreshold); }; #endif //GNSS_ADAPTER_H diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 105145a4..800ea1b9 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -70,6 +70,9 @@ static void updateConnectionStatus(bool connected, int8_t type); static void odcpiInit(const OdcpiRequestCallback& callback); static void odcpiInject(const Location& location); +static void blockCPI(double latitude, double longitude, float accuracy, + int blockDurationMsec, double latLonDiffThreshold); + static const GnssInterface gGnssInterface = { sizeof(GnssInterface), initialize, @@ -101,6 +104,7 @@ static const GnssInterface gGnssInterface = { updateConnectionStatus, odcpiInit, odcpiInject, + blockCPI, }; #ifndef DEBUG_X86 @@ -327,3 +331,10 @@ static void odcpiInject(const Location& location) } } +static void blockCPI(double latitude, double longitude, float accuracy, + int blockDurationMsec, double latLonDiffThreshold) { + if (NULL != gGnssAdapter) { + gGnssAdapter->blockCPICommand(latitude, longitude, accuracy, + blockDurationMsec, latLonDiffThreshold); + } +} \ No newline at end of file diff --git a/location/location_interface.h b/location/location_interface.h index 3c1558e9..359cb2be 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -63,6 +63,8 @@ struct GnssInterface { void (*updateConnectionStatus)(bool connected, int8_t type); void (*odcpiInit)(const OdcpiRequestCallback& callback); void (*odcpiInject)(const Location& location); + void (*blockCPI)(double latitude, double longitude, float accuracy, + int blockDurationMsec, double latLonDiffThreshold); }; struct FlpInterface { From ffbe00b52bf0310ca2f68cb0b0283d9adfbe3fb6 Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 27 Jun 2018 15:44:49 +0800 Subject: [PATCH 719/945] Set interval to large value for all MSA cases If position mode is MSA, set interval to 590 hours Change-Id: I552e0da679bf5b817bdc2463b32c8159c98b6e87 CRs-Fixed: 2268571 --- android/location_api/GnssAPIClient.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index 61412120..a6e941ec 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -29,6 +29,7 @@ #define LOG_NDEBUG 0 #define LOG_TAG "LocSvc_GnssAPIClient" +#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours #include #include @@ -166,9 +167,12 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); mTrackingOptions.size = sizeof(TrackingOptions); mTrackingOptions.minInterval = minIntervalMs; - if (IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { - mTrackingOptions.minInterval = - std::numeric_limits::max(); + if (IGnss::GnssPositionMode::MS_ASSISTED == mode || + IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { + // We set a very large interval to simulate SINGLE mode. Once we report a fix, + // the caller should take the responsibility to stop the session. + // For MSA, we always treat it as SINGLE mode. + mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; } mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) From 395c8110d6b9c4f09b9f537402fc5656c1557c81 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 5 Apr 2018 17:54:50 -0700 Subject: [PATCH 720/945] Assure event mask is set properly to get positions The event mask can be retrieved in the context of client thread as zero and then queued up to go to msg task thread. By the time the msg is actually handled in msg task thread, the actual event mask at LOC API layer may have already changed, but this mask would then be overridden by zero. This can cause no modem events to ever come, including position reports. The fix is to not retrieve the event mask in the client thread, but instead wait for msg to be handled in msg task thread before retrieving it. Change-Id: I48562d028bbfa187732686c060b5cdd62c6d5a89 CRs-fixed: 2219519 --- core/LocApiBase.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 98aa50b8..d4e0fd6e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -107,19 +107,16 @@ struct LocSsrMsg : public LocMsg { 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) + inline LocOpenMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) { locallog(); } inline virtual void proc() const { - mLocApi->open(mMask); + mLocApi->open(mLocApi->getEvtMask()); } inline void locallog() const { - LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", - __func__, __LINE__, mMask); + LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask()); } inline virtual void log() const { locallog(); @@ -184,8 +181,7 @@ 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, - mMask | adapter->getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); break; } } @@ -221,7 +217,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) mMsgTask->sendMsg(new LocCloseMsg(this)); } else { // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); } } } @@ -229,7 +225,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + mMsgTask->sendMsg(new LocOpenMsg(this)); } void LocApiBase::handleEngineUpEvent() From aa6481f63899a072602191893c0b9e25fba758dc Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 3 Jul 2018 23:25:25 +0530 Subject: [PATCH 721/945] Print QZSS SV ID with offset Adding QZSS SV ID offset for logging. Change-Id: I19fc6ba93d222b0646e3f6e2e59fe84ce42fbae4 CRs-Fixed: 2272374 --- core/LocApiBase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index ca26b328..a82e30b2 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -320,11 +320,15 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) sizeof(constellationString) / sizeof(constellationString[0]) - 1) { svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN; } + // Display what we report to clients + uint16_t displaySvId = GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[i].type ? + svNotify.gnssSvs[i].svId + QZSS_SV_PRN_MIN - 1 : + svNotify.gnssSvs[i].svId; LOC_LOGV(" %03zu: %*s %02d %f %f %f %f 0x%02X", i, 13, constellationString[svNotify.gnssSvs[i].type], - svNotify.gnssSvs[i].svId, + displaySvId, svNotify.gnssSvs[i].cN0Dbhz, svNotify.gnssSvs[i].elevation, svNotify.gnssSvs[i].azimuth, From 27114f21cc1964cecad7686cdd8ff7be7d055968 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 13 Jun 2018 15:10:43 -0700 Subject: [PATCH 722/945] Changed to allow only locclient group to access hal daemon Move hal daemon socket creation to loc_client directory Define uid/gid for locclient CRs-Fixed: 2260194 Change-Id: Icaac885c19cd65b11254bb93b6a938b2d4595761 --- pla/android/loc_pla.h | 2 ++ pla/oe/loc_pla.h | 2 ++ utils/gps_extended_c.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pla/android/loc_pla.h b/pla/android/loc_pla.h index 6b38fa73..43a09067 100644 --- a/pla/android/loc_pla.h +++ b/pla/android/loc_pla.h @@ -45,6 +45,8 @@ extern "C" { #define UID_GPS (AID_GPS) #define GID_GPS (AID_GPS) +#define UID_LOCCLIENT (4021) +#define GID_LOCCLIENT (4021) #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 094e3f33..94468881 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -64,6 +64,8 @@ extern "C" { #define UID_GPS (1021) #define GID_GPS (1021) +#define UID_LOCCLIENT (4021) +#define GID_LOCCLIENT (4021) #define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" #define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b7c25a7f..cd1ce070 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1574,7 +1574,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_DIR_LOCATION "/dev/socket/location/" #define SOCKET_DIR_EHUB "/dev/socket/location/ehub/" -#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/location/hal_daemon" +#define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/loc_client/hal_daemon" #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" #define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" From 2900a1c570cfcc0ebbbff5fa642e0748be98ed02 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 18 Jun 2018 16:51:41 +0530 Subject: [PATCH 723/945] body frame uncertainty parameters in position report added uncertainty parameters for longAccel, latAccel, vertAccel, yawRate and pitch. Change-Id: I804dc0b370dd78402a6641f5a16e5ee7a53ff9a1 CRs-Fixed: 2262454 --- utils/gps_extended_c.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index cd1ce070..a76b03df 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -391,6 +391,16 @@ typedef uint32_t LocPosDataMask; #define LOC_NAV_DATA_HAS_YAW_RATE ((LocPosDataMask)0x0008) /* Bitmask to specify whether Navigation data has Body pitch */ #define LOC_NAV_DATA_HAS_PITCH ((LocPosDataMask)0x0010) +/* Bitmask to specify whether Navigation data has Forward Acceleration Unc */ +#define LOC_NAV_DATA_HAS_LONG_ACCEL_UNC ((LocPosDataMask)0x0020) +/* Bitmask to specify whether Navigation data has Sideward Acceleration Unc*/ +#define LOC_NAV_DATA_HAS_LAT_ACCEL_UNC ((LocPosDataMask)0x0040) +/* Bitmask to specify whether Navigation data has Vertical Acceleration Unc*/ +#define LOC_NAV_DATA_HAS_VERT_ACCEL_UNC ((LocPosDataMask)0x0080) +/* Bitmask to specify whether Navigation data has Heading Rate Unc*/ +#define LOC_NAV_DATA_HAS_YAW_RATE_UNC ((LocPosDataMask)0x0100) +/* Bitmask to specify whether Navigation data has Body pitch Unc*/ +#define LOC_NAV_DATA_HAS_PITCH_UNC ((LocPosDataMask)0x0200) /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 @@ -444,14 +454,24 @@ typedef struct { uint32_t bodyFrameDatamask; /* Forward Acceleration in body frame (m/s2)*/ float longAccel; + /** Uncertainty of Forward Acceleration in body frame */ + float longAccelUnc; /* Sideward Acceleration in body frame (m/s2)*/ float latAccel; + /** Uncertainty of Side-ward Acceleration in body frame */ + float latAccelUnc; /* Vertical Acceleration in body frame (m/s2)*/ float vertAccel; + /** Uncertainty of Vertical Acceleration in body frame */ + float vertAccelUnc; /* Heading Rate (Radians/second) */ float yawRate; + /** Uncertainty of Heading Rate */ + float yawRateUnc; /* Body pitch (Radians) */ float pitch; + /** Uncertainty of Body pitch */ + float pitchRadUnc; }LocPositionDynamics; typedef struct { From 48b4774ece81ed5d61af7de46961483cf2da2278 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 19 Jul 2018 10:43:21 -0700 Subject: [PATCH 724/945] Add a timer for better handling of ODCPI/DBH Prevent more than one ODCPI request into frameworks each 30 seconds. Request ODCPI every 30 seconds while modem is actively requesting it Allow location injections for ODCPI even outside ODCPI session. Emergency ODCPI requests override normal ODCPI requests Change-Id: Ie2de6a5d42e749fce2e45cd672fc1d667b3f3347 CRs-fixed: 2246658 --- gnss/GnssAdapter.cpp | 105 ++++++++++++++++++++++++++++++++----------- gnss/GnssAdapter.h | 37 +++++++++++++-- 2 files changed, 113 insertions(+), 29 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 43b7e598..87565d73 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -81,7 +81,8 @@ GnssAdapter::GnssAdapter() : mAgpsCbInfo(), mOdcpiRequestCb(nullptr), mOdcpiRequestActive(false), - mOdcpiInjectedPositionCount(0), + mOdcpiTimer(this), + mOdcpiRequest(), mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask), @@ -1943,6 +1944,9 @@ GnssAdapter::restartSessions() { LOC_LOGD("%s]: ", __func__); + // odcpi session is no longer active after restart + mOdcpiRequestActive = false; + if (mTrackingSessions.empty()) { return; } @@ -3297,9 +3301,6 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) bool GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request) { - LOC_LOGd("ODCPI request: type %d, tbf %d, isEmergency %d", request.type, - request.tbfMillis, request.isEmergencyMode); - struct MsgRequestOdcpi : public LocMsg { GnssAdapter& mAdapter; OdcpiRequestInfo mOdcpiRequest; @@ -3319,15 +3320,45 @@ GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request) void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request) { if (nullptr != mOdcpiRequestCb) { - mOdcpiInjectedPositionCount = 0; + LOC_LOGd("request: type %d, tbf %d, isEmergency %d" + " requestActive: %d timerActive: %d", + request.type, request.tbfMillis, request.isEmergencyMode, + mOdcpiRequestActive, mOdcpiTimer.isActive()); + // ODCPI START and ODCPI STOP from modem can come in quick succession + // so the mOdcpiTimer helps avoid spamming the framework as well as + // extending the odcpi session past 30 seconds if needed if (ODCPI_REQUEST_TYPE_START == request.type) { - mOdcpiRequestCb(request); - mOdcpiRequestActive = true; + if (false == mOdcpiRequestActive && false == mOdcpiTimer.isActive()) { + mOdcpiRequestCb(request); + mOdcpiRequestActive = true; + mOdcpiTimer.start(); + // if the current active odcpi session is non-emergency, and the new + // odcpi request is emergency, replace the odcpi request with new request + // and restart the timer + } else if (false == mOdcpiRequest.isEmergencyMode && + true == request.isEmergencyMode) { + mOdcpiRequestCb(request); + mOdcpiRequestActive = true; + if (true == mOdcpiTimer.isActive()) { + mOdcpiTimer.restart(); + } else { + mOdcpiTimer.start(); + } + // if ODCPI request is not active but the timer is active, then + // just update the active state and wait for timer to expire + // before requesting new ODCPI to avoid spamming ODCPI requests + } else if (false == mOdcpiRequestActive && true == mOdcpiTimer.isActive()) { + mOdcpiRequestActive = true; + } + mOdcpiRequest = request; + // the request is being stopped, but allow timer to expire first + // before stopping the timer just in case more ODCPI requests come + // to avoid spamming more odcpi requests to the framework } else { mOdcpiRequestActive = false; } } else { - LOC_LOGe("ODCPI request not supported"); + LOC_LOGw("ODCPI request not supported"); } } @@ -3377,26 +3408,48 @@ void GnssAdapter::injectOdcpiCommand(const Location& location) void GnssAdapter::injectOdcpi(const Location& location) { - if (LOCATION_HAS_LAT_LONG_BIT & location.flags) { - if ((uptimeMillis() <= mBlockCPIInfo.blockedTillTsMs) && - (fabs(location.latitude-mBlockCPIInfo.latitude) <= - mBlockCPIInfo.latLonDiffThreshold) && - (fabs(location.longitude-mBlockCPIInfo.longitude) <= - mBlockCPIInfo.latLonDiffThreshold)) { + LOC_LOGd("ODCPI Injection: requestActive: %d timerActive: %d" + "lat %.7f long %.7f", + mOdcpiRequestActive, mOdcpiTimer.isActive(), + location.latitude, location.longitude); - LOC_LOGD("%s]: positon injeciton blocked: lat: %f, lon: %f, accuracy: %f", - __func__, location.latitude, location.longitude, location.accuracy); - } else { - mLocApi->injectPosition(location, true); - if (mOdcpiRequestActive) { - mOdcpiInjectedPositionCount++; - if (mOdcpiInjectedPositionCount >= - ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST) { - mOdcpiRequestActive = false; - mOdcpiInjectedPositionCount = 0; - } - } + mLocApi->injectPosition(location, true); +} + +// Called in the context of LocTimer thread +void OdcpiTimer::timeOutCallback() +{ + if (nullptr != mAdapter) { + mAdapter->odcpiTimerExpireEvent(); + } +} + +// Called in the context of LocTimer thread +void GnssAdapter::odcpiTimerExpireEvent() +{ + struct MsgOdcpiTimerExpire : public LocMsg { + GnssAdapter& mAdapter; + inline MsgOdcpiTimerExpire(GnssAdapter& adapter) : + LocMsg(), + mAdapter(adapter) {} + inline virtual void proc() const { + mAdapter.odcpiTimerExpire(); } + }; + sendMsg(new MsgOdcpiTimerExpire(*this)); +} +void GnssAdapter::odcpiTimerExpire() +{ + LOC_LOGd("requestActive: %d timerActive: %d", + mOdcpiRequestActive, mOdcpiTimer.isActive()); + + // if ODCPI request is still active after timer + // expires, request again and restart timer + if (mOdcpiRequestActive) { + mOdcpiRequestCb(mOdcpiRequest); + mOdcpiTimer.restart(); + } else { + mOdcpiTimer.stop(); } } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 6ed96552..7ca605af 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -44,10 +44,39 @@ #define MAX_SATELLITES_IN_USE 12 #define LOC_NI_NO_RESPONSE_TIME 20 #define LOC_GPS_NI_RESPONSE_IGNORE 4 -#define ODCPI_INJECTED_POSITION_COUNT_PER_REQUEST 30 +#define ODCPI_EXPECTED_INJECTION_TIME_MS 30000 class GnssAdapter; +class OdcpiTimer : public LocTimer { +public: + OdcpiTimer(GnssAdapter* adapter) : + LocTimer(), mAdapter(adapter), mActive(false) {} + + inline void start() { + mActive = true; + LocTimer::start(ODCPI_EXPECTED_INJECTION_TIME_MS, false); + } + inline void stop() { + mActive = false; + LocTimer::stop(); + } + inline void restart() { + stop(); + start(); + } + inline bool isActive() { + return mActive; + } + +private: + // Override + virtual void timeOutCallback() override; + + GnssAdapter* mAdapter; + bool mActive; +}; + typedef struct { pthread_t thread; /* NI thread */ uint32_t respTimeLeft; /* examine time for NI response */ @@ -130,7 +159,9 @@ class GnssAdapter : public LocAdapterBase { /* ==== ODCPI ========================================================================== */ OdcpiRequestCallback mOdcpiRequestCb; bool mOdcpiRequestActive; - uint32_t mOdcpiInjectedPositionCount; + OdcpiTimer mOdcpiTimer; + OdcpiRequestInfo mOdcpiRequest; + void odcpiTimerExpire(); /* === SystemStatus ===================================================================== */ SystemStatus* mSystemStatus; @@ -268,7 +299,6 @@ public: /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void initOdcpiCommand(const OdcpiRequestCallback& callback); void injectOdcpiCommand(const Location& location); - /* ======== RESPONSES ================================================================== */ void reportResponse(LocationError err, uint32_t sessionId); void reportResponse(size_t count, LocationError* errs, uint32_t* ids); @@ -281,6 +311,7 @@ public: virtual bool isInSession() { return !mTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); + void odcpiTimerExpireEvent(); /* ==== REPORTS ======================================================================== */ /* ======== EVENTS ====(Called from QMI/EngineHub Thread)===================================== */ From 06d93da4a1ad7559356e489e6b342490dc53aa09 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 23 Jul 2018 14:11:58 -0700 Subject: [PATCH 725/945] Deprecate reading of ro.lean property ro.lean property is no longer used, so remove reading logic of this property. If ro.lean is added in the future, it will need vendor prefix. Change-Id: I6b5e891f6d59c0809f9136541bbfb6696cbf4d5a CRs-fixed: 2282702 --- utils/loc_cfg.cpp | 12 ------------ utils/loc_target.cpp | 13 ------------- utils/loc_target.h | 6 ------ 3 files changed, 31 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 78d40106..fd232bbc 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -467,7 +467,6 @@ typedef struct { unsigned int loc_feature_mask; char platform_list[LOC_MAX_PARAM_STRING]; char baseband[LOC_MAX_PARAM_STRING]; - char lean_targets[LOC_MAX_PARAM_STRING]; unsigned int sglte_target; char feature_gtp_cell_proc[LOC_MAX_PARAM_STRING]; char feature_gtp_waa[LOC_MAX_PARAM_STRING]; @@ -512,7 +511,6 @@ static const loc_param_s_type loc_process_conf_parameter_table[] = { {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, {"PLATFORMS", &conf.platform_list, NULL, 's'}, {"BASEBAND", &conf.baseband, NULL, 's'}, - {"LEAN_TARGETS", &conf.lean_targets, NULL, 's'}, {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, }; @@ -554,7 +552,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p FILE* conf_fp = nullptr; char platform_name[PROPERTY_VALUE_MAX], baseband_name[PROPERTY_VALUE_MAX]; char autoplatform_name[PROPERTY_VALUE_MAX]; - int lean_target=0; unsigned int loc_service_mask=0; char config_mask = 0; unsigned char proc_list_length=0; @@ -586,8 +583,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p loc_get_platform_name(platform_name, sizeof(platform_name)); //Get baseband name from ro.baseband property loc_get_target_baseband(baseband_name, sizeof(baseband_name)); - lean_target = loc_identify_lean_target(); - LOC_LOGD("%s:%d]: lean target:%d", __func__, __LINE__, lean_target); //Identify if this is an automotive platform loc_get_auto_platform_name(autoplatform_name,sizeof(autoplatform_name)); @@ -927,13 +922,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } } - nstrings = loc_util_split_string(conf.lean_targets, split_strings, MAX_NUM_STRINGS, ' '); - if(!strcmp("DISABLED", split_strings[0]) && lean_target) { - LOC_LOGD("%s:%d]: Disabled for lean targets\n", __func__, __LINE__); - child_proc[j].proc_status = DISABLED; - continue; - } - if((config_mask & CONFIG_MASK_TARGET_CHECK) && (config_mask & CONFIG_MASK_BASEBAND_CHECK) && (config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) && diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index f116e5ee..f6fd728a 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -208,16 +208,3 @@ detected: LOC_LOGW("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() -{ - 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/utils/loc_target.h b/utils/loc_target.h index 47a67d91..172b4752 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -55,12 +55,6 @@ void loc_get_platform_name(char *platform_name, int array_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 { From 6a12f3743f2e0b4e008c493e1196372eee0e331c Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 16 Jul 2018 14:57:34 -0700 Subject: [PATCH 726/945] Added FDCL_2 feature support bit Added FDCL_2 feature support bit Change-Id: Icae2cf89f06f8d1d8d87c8115fe8efce9ccc566a CRs-Fixed: 2191059 --- utils/gps_extended_c.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index cd1ce070..ec6bb6ce 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -122,7 +122,8 @@ typedef enum { LOC_SUPPORTED_FEATURE_FDCL, /**< Support FDCL */ LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02, /**< Support constellation enablement */ LOC_SUPPORTED_FEATURE_AGPM_V02, /**< Support AGPM feature */ - LOC_SUPPORTED_FEATURE_XTRA_INTEGRITY /**< Support XTRA integrity */ + LOC_SUPPORTED_FEATURE_XTRA_INTEGRITY, /**< Support XTRA integrity */ + LOC_SUPPORTED_FEATURE_FDCL_2 /**< Support FDCL V2 */ } loc_supported_feature_enum; typedef struct { @@ -807,6 +808,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_BATCH_STATUS, // batch status LOC_API_ADAPTER_FDCL_SERVICE_REQ, // FDCL service request LOC_API_ADAPTER_REPORT_UNPROPAGATED_POSITION, // Unpropagated Position report + LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ, // BS observation data request LOC_API_ADAPTER_EVENT_MAX }; @@ -844,6 +846,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_BATCH_STATUS (1< Date: Fri, 20 Jul 2018 11:02:03 -0700 Subject: [PATCH 727/945] Modify ODCPI timer from 30s to 10s ODCPI timer is modified to match location request duration that was changed from 30s to 10s in frameworks. Change-Id: If1380635b0b87d55bf9a00197b806b3de48b6f4f CRs-fixed: 2282588 --- gnss/GnssAdapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 55a558a1..0b0b396c 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -44,7 +44,7 @@ #define MAX_SATELLITES_IN_USE 12 #define LOC_NI_NO_RESPONSE_TIME 20 #define LOC_GPS_NI_RESPONSE_IGNORE 4 -#define ODCPI_EXPECTED_INJECTION_TIME_MS 30000 +#define ODCPI_EXPECTED_INJECTION_TIME_MS 10000 class GnssAdapter; From 2a005b5816fb4942403ece1cc968e90dc6172d2f Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 18 Jul 2018 12:00:54 -0700 Subject: [PATCH 728/945] Cache the SUPL server and port on each update CRs-Fixed: 2286256 Change-Id: I7adb584ff6f81c6a7f50f5ec4e9a4a094414e297 --- gnss/GnssAdapter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index de4934f4..75cb3216 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -627,6 +627,15 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl(); if (length > 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) { url.assign(serverUrl); + + if (LOC_AGPS_SUPL_SERVER == type) { + int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ? + strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1); + strncpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy); + ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0'; + ContextBase::mGps_conf.SUPL_PORT = port; + } + LOC_LOGv("serverUrl=%s length=%d type=%d", serverUrl, length, type); } } From a8f926020f4883aa3915b8e5e0d35e09527bbbd5 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 23 Jul 2018 16:24:00 -0700 Subject: [PATCH 729/945] Delete LocApiBase and derived class on msgTask thread Direct delete of the API obj on caller thread could result in a race condition that caller still has close() or other handling running at the same time the API object is being or already deleted. CRs-Fixed: 2275383 Change-Id: I5d3de204befec3c22c73cece8516e90800abbd35 --- core/ContextBase.h | 11 ++++++++++- core/LocApiBase.h | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 7c5ac175..4ad6cb16 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -124,7 +124,16 @@ public: ContextBase(const MsgTask* msgTask, LOC_API_ADAPTER_EVENT_MASK_T exMask, const char* libName); - inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } + inline virtual ~ContextBase() { + if (nullptr != mLocApi) { + mLocApi->destroy(); + mLocApi = nullptr; + } + if (nullptr != mLBSProxy) { + delete mLBSProxy; + mLBSProxy = nullptr; + } + } inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } diff --git a/core/LocApiBase.h b/core/LocApiBase.h index fc86eb34..b50a973c 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -103,11 +103,11 @@ class LocApiBase { //it as a friend friend struct LocOpenMsg; friend struct LocCloseMsg; + friend struct LocKillMsg; friend class ContextBase; static MsgTask* mMsgTask; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; - protected: ContextBase *mContext; virtual enum loc_api_adapter_err @@ -118,7 +118,12 @@ protected: LOC_API_ADAPTER_EVENT_MASK_T mMask; LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); - inline virtual ~LocApiBase() { close(); } + inline virtual ~LocApiBase() { + if (nullptr != mMsgTask) { + mMsgTask->destroy(); + mMsgTask = nullptr; + } + } bool isInSession(); const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask; bool isMaster(); @@ -127,6 +132,18 @@ public: inline void sendMsg(const LocMsg* msg) const { mMsgTask->sendMsg(msg); } + inline void destroy() { + close(); + struct LocKillMsg : public LocMsg { + LocApiBase* mLocApi; + inline LocKillMsg(LocApiBase* locApi) : LocMsg(), mLocApi(locApi) {} + inline virtual void proc() const { + delete mLocApi; + } + }; + sendMsg(new LocKillMsg(this)); + } + void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); From 12b33020949e491c60aaf17ca23a09de0456c3a4 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 2 Aug 2018 13:57:51 -0700 Subject: [PATCH 730/945] Skip position filtering for telematics When engine hub is loaded, e.g.: if any of the engine services are enabled in izat.conf, position filtering is skipped and all position (valid or invalid) will be reported to requesting client Change-Id: Idc340478c977d8da441211d4c81580987b0f4a29 CRs-fixed: 2290155 --- gnss/GnssAdapter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 43b7e598..25addc8e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2857,7 +2857,12 @@ GnssAdapter::needReport(const UlpLocation& ulpLocation, enum loc_sess_status status, LocPosTechMask techMask) { bool reported = false; - if (LOC_SESS_SUCCESS == status) { + + // if engine hub is enabled, aka, any of the engine services is enabled, + // then always output position reported by engine hub to requesting client + if (true == initEngHubProxy()) { + reported = true; + } else if (LOC_SESS_SUCCESS == status) { // this is a final fix LocPosTechMask mask = LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID; From f2f6ca70c5b530299d73f398edae3ef41e4f78c8 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Mon, 30 Jul 2018 15:05:32 +0800 Subject: [PATCH 731/945] SAP:update SENSOR_CONTROL_MODE configuration set SENSOR_CONTROL_MODE to MODEM_DEFAULT to make INS use its default setting. remove SENSOR_PROVIDER and SENSOR_USAGE. Change-Id: I99d48d4600a6bca8e64ae0d1ff065af762888b2e CRs-Fixed: 2285242 --- core/ContextBase.cpp | 7 +------ core/ContextBase.h | 2 -- core/LocApiBase.cpp | 4 ---- core/LocApiBase.h | 2 -- gnss/GnssAdapter.cpp | 2 -- 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index c71ca7a4..fa87c3ee 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -92,9 +92,7 @@ const loc_param_s_type ContextBase::mSap_conf_table[] = {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, {"SENSOR_CONTROL_MODE", &mSap_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, - {"SENSOR_USAGE", &mSap_conf.SENSOR_USAGE, NULL, 'n'}, - {"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, - {"SENSOR_PROVIDER", &mSap_conf.SENSOR_PROVIDER, NULL, 'n'} + {"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'} }; void ContextBase::readConfig() @@ -139,7 +137,6 @@ void ContextBase::readConfig() mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - mSap_conf.SENSOR_USAGE = 0; /* Enabled */ mSap_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 */ @@ -152,8 +149,6 @@ void ContextBase::readConfig() mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - /* default provider is SSC */ - mSap_conf.SENSOR_PROVIDER = 1; /* None of the 10 slots for agps certificates are writable by default */ mGps_conf.AGPS_CERT_WRITABLE_MASK = 0; diff --git a/core/ContextBase.h b/core/ContextBase.h index 4ad6cb16..d268f5ad 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -92,7 +92,6 @@ typedef struct 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; @@ -102,7 +101,6 @@ typedef struct 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 { diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index a82e30b2..dd52ab64 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -522,10 +522,6 @@ LocationError LocApiBase:: setLPPConfigSync(GnssConfigLppProfile /*profile*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -enum loc_api_adapter_err LocApiBase:: - setSensorControlConfigSync(int /*sensorUsage*/, - int /*sensorProvider*/) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: setSensorPropertiesSync(bool /*gyroBiasVarianceRandomWalk_valid*/, diff --git a/core/LocApiBase.h b/core/LocApiBase.h index b50a973c..75b98a68 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -217,8 +217,6 @@ public: virtual enum loc_api_adapter_err setNMEATypesSync(uint32_t typesMask); virtual LocationError setLPPConfigSync(GnssConfigLppProfile profile); - virtual enum loc_api_adapter_err - setSensorControlConfigSync(int sensorUsage, int sensorProvider); virtual enum loc_api_adapter_err setSensorPropertiesSync(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f75febd3..d155d6ce 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -717,8 +717,6 @@ GnssAdapter::setConfigCommand() } } - adapter.mLocApi->setSensorControlConfigSync(sapConf.SENSOR_USAGE, - sapConf.SENSOR_PROVIDER); adapter.mLocApi->setLPPeProtocolCpSync( adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY)); adapter.mLocApi->setLPPeProtocolUpSync( From 4bab73548d6c030cb4a30ac07b068b35e0553af4 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Wed, 11 Jul 2018 17:24:08 +0800 Subject: [PATCH 732/945] Fix: Xtra connection initialization issue HAL sends an empty field to Xtra when connections is not updated. Change-Id: I42c456581a1a968887880154f1ffffee12421354 CRs-Fixed: 2259165 --- gnss/XtraSystemStatusObserver.cpp | 3 ++- gnss/XtraSystemStatusObserver.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index de7d49ab..6df54800 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -132,7 +132,8 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate stringstream ss; ss << "respondStatus" << endl; - (mGpsLock == -1 ? ss : ss << mGpsLock) << endl << mConnections << endl + (mGpsLock == -1 ? ss : ss << mGpsLock) << endl; + (mConnections == (uint64_t)~0 ? ss : ss << mConnections) << endl << mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown; return ( send(LOC_IPC_XTRA, ss.str()) ); diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index af0789b6..b49a0bcd 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -45,7 +45,7 @@ public : // constructor & destructor inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mConnections(0), mXtraThrottle(true), mReqStatusReceived(false), + mGpsLock(-1), mConnections(~0), mXtraThrottle(true), mReqStatusReceived(false), mDelayLocTimer(*this), mIsConnectivityStatusKnown (false) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); From f8f7e876e3fc95e08988cfe4ab0218b68c9fb5a5 Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Fri, 3 Aug 2018 13:58:18 +0530 Subject: [PATCH 733/945] Disable GTP CELL and GTP WAA feature. Disable GTP_CELL and GTP WAA feature as it will not work with GTP_AP_MODE 4 CRs-Fixed: 2288722 Change-Id: I88cbb05030c1588fb2be30c3de41839208bb14c0 --- utils/loc_cfg.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index fd232bbc..4c3bc588 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -491,9 +491,7 @@ static const loc_param_s_type gps_conf_parameter_table[] = { /* location feature conf, e.g.: izat.conf feature mode table*/ static const loc_param_s_type loc_feature_conf_table[] = { {"GTP_CELL_PROC", &conf.feature_gtp_cell_proc, NULL, 's'}, - {"GTP_CELL", &conf.feature_gtp_cell, NULL, 's'}, {"GTP_WIFI", &conf.feature_gtp_wifi, NULL, 's'}, - {"GTP_WAA", &conf.feature_gtp_waa, NULL, 's'}, {"SAP", &conf.feature_sap, NULL, 's'}, {"ODCPI", &conf.feature_odcpi, NULL, 's'}, {"FREE_WIFI_SCAN_INJECT", &conf.feature_free_wifi_scan_inject, NULL, 's'}, @@ -612,6 +610,8 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p gtp_cell_ap_enabled = 1; } + //by default make it disabled as it will not work with GTP_AP_MODE 4 + strlcpy (conf.feature_gtp_cell, "DISABLED", sizeof (conf.feature_gtp_cell)); if(strcmp(conf.feature_gtp_cell, "PREMIUM") == 0) { LOC_LOGE("%s:%d]: Error: location feature GTP CELL does not support PREMIUM mode" \ " available modes are BASIC and DISABLED. Starting feature in BASIC mode", @@ -648,6 +648,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } //Set service mask for GTP_WAA + strlcpy (conf.feature_gtp_waa, "DISABLED", sizeof (conf.feature_gtp_waa)); if(strcmp(conf.feature_gtp_waa, "PREMIUM") == 0) { LOC_LOGE("%s:%d]: Error: location feature GTP WAA does not support PREMIUM mode" \ " available modes are BASIC and DISABLED. Starting feature in BASIC mode", From 8a752aa1b37af0cc12a975ed1f0f3eb69a3984b4 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Thu, 2 Aug 2018 15:31:28 -0700 Subject: [PATCH 734/945] Systemsatus - add support older version of PQWME Add support of older (shorter) version of PQWME strings from modem. Systemstatus currently discards those shorter strings. This change is to fill out all zeros in those missing fields instead of discarding the whole sentence. Change-Id: I31c42b6de53c3002f598cfd815304086bba056f9 CRs-Fixed: 2153513 --- core/SystemStatus.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index b3260bdd..f4316ca0 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -157,6 +157,7 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, + eMax0 = eAgcGal, eLeapSeconds = 23, eLeapSecUnc = 24, eGloBpAmpI = 25, @@ -205,7 +206,7 @@ public: : SystemStatusNmeaBase(str_in, len_in) { memset(&mM1, 0, sizeof(mM1)); - if (mField.size() < eMax) { + if (mField.size() <= eMax0) { LOC_LOGE("PQWM1parser - invalid size=%zu", mField.size()); mM1.mTimeValid = 0; return; @@ -232,14 +233,18 @@ public: mM1.mAgcGlo = atof(mField[eAgcGlo].c_str()); mM1.mAgcBds = atof(mField[eAgcBds].c_str()); mM1.mAgcGal = atof(mField[eAgcGal].c_str()); - mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); - mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); - mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str()); - mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str()); - mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str()); - mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str()); - mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); - mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); + if (mField.size() > eLeapSecUnc) { + mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str()); + mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str()); + } + if (mField.size() > eGalBpAmpQ) { + mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str()); + mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str()); + mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str()); + mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str()); + mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); + mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); + } } inline SystemStatusPQWM1& get() { return mM1;} //getparser From 2124941746a1e407145097a7b42993ca1c1c4296 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 17 Jul 2018 14:48:32 -0700 Subject: [PATCH 735/945] Add support for multiband data CRs-Fixed: 2289264 Change-Id: I5339870e8be3247b445203dad39e6f8522a64575 --- location/LocationDataTypes.h | 4 +++- utils/gps_extended_c.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 1f2a422a..4b5b86da 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -37,7 +37,7 @@ #define GNSS_NI_REQUESTOR_MAX (256) #define GNSS_NI_MESSAGE_ID_MAX (2048) -#define GNSS_SV_MAX (64) +#define GNSS_SV_MAX (176) #define GNSS_MEASUREMENTS_MAX (64) #define GNSS_UTC_TIME_OFFSET (3657) @@ -888,6 +888,7 @@ typedef struct { float azimuth; // azimuth of SV (in degrees) GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits float carrierFrequencyHz; // carrier frequency of the signal tracked + GnssSignalTypeMask gnssSignalTypeMask; // Specifies GNSS signal type } GnssSv; struct GnssConfigSetAssistanceServer { @@ -948,6 +949,7 @@ typedef struct { typedef struct { size_t size; // set to sizeof(GnssSvNotification) size_t count; // number of SVs in the GnssSv array + bool gnssSignalTypeMaskValid; GnssSv gnssSvs[GNSS_SV_MAX]; // information on a number of SVs } GnssSvNotification; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 8062cfdd..77d09de3 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1403,6 +1403,8 @@ typedef struct /* Extended Time Information - Cumulative Number of Clock Resets */ uint8_t numClockResets_valid; /**< Must be set to true if numClockResets is being passed */ uint32_t numClockResets; + bool gnssSignalTypeMaskValid; + GnssSignalTypeMask gnssSignalTypeMask; } GnssSvMeasurementSet; From a030bf9baac9f77a2645c11e76eff69e7cb515e0 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 14 Aug 2018 16:38:57 -0700 Subject: [PATCH 736/945] GNSS_NI_RESPONSE_IGNORE handling GNSS_NI_RESPONSE_IGNORE inaverdently mapped to NO_RESPONSE, which is a different reponse code. The two should be handled differently. Bug: 111770241 CRs-Fixed: 2296845 Change-Id: If2697f51c07a0272841709bfca247daaa4e963b6 --- android/location_api/GnssAPIClient.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index a6e941ec..cec51451 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -198,17 +198,22 @@ void GnssAPIClient::gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); - GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; - if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT) + GnssNiResponse data; + switch (userResponse) { + case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT: data = GNSS_NI_RESPONSE_ACCEPT; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY) + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY: data = GNSS_NI_RESPONSE_DENY; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP: data = GNSS_NI_RESPONSE_NO_RESPONSE; - else { - LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, (int)userResponse); - return; + break; + default: + data = GNSS_NI_RESPONSE_IGNORE; + break; } + locAPIGnssNiResponse(notifId, data); } From de454e21f661ef460b04acb63a8172688fd3216d Mon Sep 17 00:00:00 2001 From: Baili Feng Date: Wed, 15 Aug 2018 20:54:54 +0800 Subject: [PATCH 737/945] Filter DataItems with suitable way. We should carefully modify unordered_set when traversing it. Update the iterator with the return value of erase function. Change-Id: I777f42b077502f617a513128db9a4f3b7c9a322c CRs-Fixed: 2288358 --- core/SystemStatusOsObserver.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 0f6d2289..8127e869 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -328,9 +328,12 @@ void SystemStatusOsObserver::notify(const list& dlist) for (auto client : clientSet) { unordered_set dataItemIdsForThisClient( mParent->mClientToDataItems.getValSet(client)); - for (auto id : dataItemIdsForThisClient) { - if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) { - dataItemIdsForThisClient.erase(id); + for (auto itr = dataItemIdsForThisClient.begin(); + itr != dataItemIdsForThisClient.end(); ) { + if (dataItemIdsToBeSent.find(*itr) == dataItemIdsToBeSent.end()) { + itr = dataItemIdsForThisClient.erase(itr); + } else { + itr++; } } From 75cfd43bfdab4fb478e1504808a418320f5dcd95 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 7 Jun 2018 16:54:35 -0700 Subject: [PATCH 738/945] Add jammer indication Add AGC and jammer indication Change-Id: I93641864338beec368e7a56b3a20b158ea892202 CRs-fixed: 2239155 --- core/LocAdapterBase.cpp | 10 +- core/LocAdapterBase.h | 10 +- core/LocAdapterProxyBase.h | 1 - core/LocApiBase.cpp | 38 ++++++- core/LocApiBase.h | 7 +- gnss/GnssAdapter.cpp | 173 ++++++++++++++++++++++++++++++- gnss/GnssAdapter.h | 8 +- location/LocationAPI.cpp | 1 + location/LocationAPIClientBase.h | 1 + location/LocationDataTypes.h | 45 ++++++++ 10 files changed, 283 insertions(+), 11 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8301ee86..8197f4df 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -80,7 +80,10 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromEngineHub*/) { + bool /*fromEngineHub*/, + GnssDataNotification* pDataNotify, + int msInWeek) +{ if (mLocAdapterProxyBase != NULL) { mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location, (GpsLocationExtended&)locationExtended, @@ -113,6 +116,11 @@ void LocAdapterBase:: reportNmeaEvent(const char* /*nmea*/, size_t /*length*/) DEFAULT_IMPL() +void LocAdapterBase:: + reportDataEvent(const GnssDataNotification& /*dataNotify*/, + int /*msInWeek*/) +DEFAULT_IMPL() + bool LocAdapterBase:: reportXtraServer(const char* /*url1*/, const char* /*url2*/, const char* /*url3*/, const int /*maxlength*/) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e3502b21..6b3e02ff 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -113,6 +113,11 @@ public: mLocApi->updateEvtMask(); } + inline void updateNmeaMask(uint32_t mask) + { + mLocApi->updateNmeaMask(mask); + } + inline bool isFeatureSupported(uint8_t featureVal) { return ContextBase::isFeatureSupported(featureVal); } @@ -133,9 +138,12 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromEngineHub=false); + bool fromEngineHub = false, + GnssDataNotification* pDataNotify = nullptr, + int msInWeek = -1); virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub=false); + virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); virtual void reportNmeaEvent(const char* nmea, size_t length); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index 044f59bd..b33d7b0e 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -65,7 +65,6 @@ public: GpsLocationExtended &locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask) { - (void)location; (void)locationExtended; (void)status; diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index a82e30b2..7a0900b0 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -240,6 +240,30 @@ void LocApiBase::updateEvtMask() mMsgTask->sendMsg(new LocOpenMsg(this)); } +void LocApiBase::updateNmeaMask(uint32_t mask) +{ + struct LocSetNmeaMsg : public LocMsg { + LocApiBase* mLocApi; + uint32_t mMask; + inline LocSetNmeaMsg(LocApiBase* locApi, uint32_t mask) : + LocMsg(), mLocApi(locApi), mMask(mask) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->setNMEATypesSync(mMask); + } + inline void locallog() const { + LOC_LOGv("LocSyncNmea NmeaMask: %" PRIx32 "\n", mMask); + } + inline virtual void log() const { + locallog(); + } + }; + + mMsgTask->sendMsg(new LocSetNmeaMsg(this, mask)); +} + void LocApiBase::handleEngineUpEvent() { LocDualContext::injectFeatureConfig(mContext); @@ -259,7 +283,9 @@ void LocApiBase::handleEngineDownEvent() void LocApiBase::reportPosition(UlpLocation& location, GpsLocationExtended& locationExtended, enum loc_sess_status status, - LocPosTechMask loc_technology_mask) + LocPosTechMask loc_technology_mask, + GnssDataNotification* pDataNotify, + int msInWeek) { // print the location info before delivering LOC_LOGD("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n " @@ -281,7 +307,9 @@ void LocApiBase::reportPosition(UlpLocation& location, // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPositionEvent(location, locationExtended, - status, loc_technology_mask) + status, loc_technology_mask, + false, + pDataNotify, msInWeek) ); } @@ -363,6 +391,12 @@ void LocApiBase::reportStatus(LocGpsStatusValue status) TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status)); } +void LocApiBase::reportData(GnssDataNotification& dataNotify, int msInWeek) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportDataEvent(dataNotify, msInWeek)); +} + void LocApiBase::reportNmea(const char* nmea, int length) { // loop through adapters, and deliver to all adapters. diff --git a/core/LocApiBase.h b/core/LocApiBase.h index b50a973c..538db303 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -116,6 +116,7 @@ protected: close(); LOC_API_ADAPTER_EVENT_MASK_T getEvtMask(); LOC_API_ADAPTER_EVENT_MASK_T mMask; + uint32_t mNmeaMask; LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); inline virtual ~LocApiBase() { @@ -154,12 +155,15 @@ public: GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask = - LOC_POS_TECH_MASK_DEFAULT); + LOC_POS_TECH_MASK_DEFAULT, + GnssDataNotification* pDataNotify = nullptr, + int msInWeek = -1); void reportSv(GnssSvNotification& svNotify); void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); void reportSvPolynomial(GnssSvPolynomial &svPolynomial); void reportStatus(LocGpsStatusValue status); void reportNmea(const char* nmea, int length); + void reportData(GnssDataNotification& dataNotify, int msInWeek); void reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength); void requestXtraData(); @@ -262,6 +266,7 @@ public: void updateEvtMask(); + void updateNmeaMask(uint32_t mask); virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f75febd3..a72d4b31 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1896,6 +1896,11 @@ GnssAdapter::updateClientsEventMask() if (it->second.gnssMeasurementsCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; } + if (it->second.gnssDataCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT; + mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; + updateNmeaMask(mNmeaMask | LOC_NMEA_MASK_DEBUG_V02); + } } /* @@ -2810,7 +2815,9 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromEngineHub) + bool fromEngineHub, + GnssDataNotification* pDataNotify, + int msInWeek) { // if this event is called from QMI LOC API, then send report to engine hub // if sending is successful, we return as we will wait for final report from engine hub @@ -2842,17 +2849,30 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended mLocationExtended; loc_sess_status mStatus; LocPosTechMask mTechMask; + GnssDataNotification mDataNotify; + int mMsInWeek; + bool mbIsDataValid; inline MsgReportPosition(GnssAdapter& adapter, const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, loc_sess_status status, - LocPosTechMask techMask) : + LocPosTechMask techMask, + GnssDataNotification* pDataNotify, + int msInWeek) : LocMsg(), mAdapter(adapter), mUlpLocation(ulpLocation), mLocationExtended(locationExtended), mStatus(status), - mTechMask(techMask) {} + mTechMask(techMask), + mMsInWeek(msInWeek) { + if (pDataNotify != nullptr) { + mDataNotify = *pDataNotify; + mbIsDataValid = true; + } else { + mbIsDataValid = false; + } + } inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = mAdapter.getSystemStatus(); @@ -2861,10 +2881,19 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); + if (true == mbIsDataValid) { + if (-1 != mMsInWeek) { + mAdapter.getDataInformation((GnssDataNotification&)mDataNotify, + mMsInWeek); + } + mAdapter.reportData((GnssDataNotification&)mDataNotify); + } } }; - sendMsg(new MsgReportPosition(*this, ulpLocation, locationExtended, status, techMask)); + sendMsg(new MsgReportPosition(*this, ulpLocation, locationExtended, + status, techMask, + pDataNotify, msInWeek)); } bool @@ -3100,6 +3129,54 @@ GnssAdapter::reportNmea(const char* nmea, size_t length) } } +void +GnssAdapter::reportDataEvent(const GnssDataNotification& dataNotify, + int msInWeek) +{ + struct MsgReportData : public LocMsg { + GnssAdapter& mAdapter; + GnssDataNotification mDataNotify; + int mMsInWeek; + inline MsgReportData(GnssAdapter& adapter, + const GnssDataNotification& dataNotify, + int msInWeek) : + LocMsg(), + mAdapter(adapter), + mDataNotify(dataNotify), + mMsInWeek(msInWeek) { + } + inline virtual void proc() const { + if (-1 != mMsInWeek) { + mAdapter.getDataInformation((GnssDataNotification&)mDataNotify, + mMsInWeek); + } + mAdapter.reportData((GnssDataNotification&)mDataNotify); + } + }; + + sendMsg(new MsgReportData(*this, dataNotify, msInWeek)); +} + +void +GnssAdapter::reportData(GnssDataNotification& dataNotify) +{ + for (int sig = 0; sig < GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES; sig++) { + if (GNSS_LOC_DATA_JAMMER_IND_BIT == + (dataNotify.gnssDataMask[sig] & GNSS_LOC_DATA_JAMMER_IND_BIT)) { + LOC_LOGv("jammerInd[%d]=%f", sig, dataNotify.jammerInd[sig]); + } + if (GNSS_LOC_DATA_AGC_BIT == + (dataNotify.gnssDataMask[sig] & GNSS_LOC_DATA_AGC_BIT)) { + LOC_LOGv("agc[%d]=%f", sig, dataNotify.agc[sig]); + } + } + for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.gnssDataCb) { + it->second.gnssDataCb(dataNotify); + } + } +} + bool GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data) { @@ -3995,6 +4072,94 @@ GnssAdapter::getAgcInformation(GnssMeasurementsNotification& measurements, int m } } +/* get Data information from system status and fill it */ +void +GnssAdapter::getDataInformation(GnssDataNotification& data, int msInWeek) +{ + SystemStatus* systemstatus = getSystemStatus(); + + LOC_LOGV("%s]: msInWeek=%d", __func__, msInWeek); + if (nullptr != systemstatus) { + SystemStatusReports reports = {}; + systemstatus->getReport(reports, true); + + if ((!reports.mRfAndParams.empty()) && (!reports.mTimeAndClock.empty()) && + (abs(msInWeek - (int)reports.mTimeAndClock.back().mGpsTowMs) < 2000)) { + + for (int sig = GNSS_LOC_SIGNAL_TYPE_GPS_L1CA; + sig < GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES; sig++) { + data.gnssDataMask[sig] = 0; + data.jammerInd[sig] = 0.0; + data.agc[sig] = 0.0; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mAgcGps) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA] = + reports.mRfAndParams.back().mAgcGps; + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_QZSS_L1CA] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_QZSS_L1CA] = + reports.mRfAndParams.back().mAgcGps; + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA] = + reports.mRfAndParams.back().mAgcGps; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mJammerGps) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA] = + (double)reports.mRfAndParams.back().mJammerGps; + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_QZSS_L1CA] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_QZSS_L1CA] = + (double)reports.mRfAndParams.back().mJammerGps; + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA] = + (double)reports.mRfAndParams.back().mJammerGps; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mAgcGlo) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1] = + reports.mRfAndParams.back().mAgcGlo; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mJammerGlo) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1] = + (double)reports.mRfAndParams.back().mJammerGlo; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mAgcBds) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I] = + reports.mRfAndParams.back().mAgcBds; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mJammerBds) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I] = + (double)reports.mRfAndParams.back().mJammerBds; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mAgcGal) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C] |= + GNSS_LOC_DATA_AGC_BIT; + data.agc[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C] = + reports.mRfAndParams.back().mAgcGal; + } + if (GNSS_INVALID_JAMMER_IND != reports.mRfAndParams.back().mJammerGal) { + data.gnssDataMask[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C] |= + GNSS_LOC_DATA_JAMMER_IND_BIT; + data.jammerInd[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C] = + (double)reports.mRfAndParams.back().mJammerGal; + } + } + } +} + /* Callbacks registered with loc_net_iface library */ static void agpsOpenResultCb (bool isSuccess, AGpsExtType agpsType, const char* apn, AGpsBearerType bearerType, void* userDataPtr) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 0b0b396c..bf757b47 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -320,10 +320,13 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromEngineHub=false); + bool fromEngineHub = false, + GnssDataNotification* pDataNotify = nullptr, + int msInWeek = -1); virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length); + virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, int msInWeek); @@ -345,6 +348,7 @@ public: LocPosTechMask techMask); void reportSv(GnssSvNotification& svNotify); void reportNmea(const char* nmea, size_t length); + void reportData(GnssDataNotification& dataNotify); bool requestNiNotify(const GnssNiNotification& notify, const void* data); void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); void reportGnssSvIdConfig(const GnssSvIdConfig& config); @@ -355,6 +359,8 @@ public: bool getDebugReport(GnssDebugReport& report); /* get AGC information from system status and fill it */ void getAgcInformation(GnssMeasurementsNotification& measurements, int msInWeek); + /* get Data information from system status and fill it */ + void getDataInformation(GnssDataNotification& data, int msInWeek); /*==== SYSTEM STATUS ================================================================*/ inline SystemStatus* getSystemStatus(void) { return mSystemStatus; } diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 581158bd..9a67f39e 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -56,6 +56,7 @@ static bool needsGnssTrackingInfo(LocationCallbacks& locationCallbacks) return (locationCallbacks.gnssLocationInfoCb != nullptr || locationCallbacks.gnssSvCb != nullptr || locationCallbacks.gnssNmeaCb != nullptr || + locationCallbacks.gnssDataCb != nullptr || locationCallbacks.gnssMeasurementsCb != nullptr); } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index bcc39f3c..c61e4a83 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -239,6 +239,7 @@ public: inline virtual void onCapabilitiesCb(LocationCapabilitiesMask /*capabilitiesMask*/) {} inline virtual void onGnssNmeaCb(GnssNmeaNotification /*gnssNmeaNotification*/) {} + inline virtual void onGnssDataCb(GnssDataNotification /*gnssDataNotification*/) {} inline virtual void onGnssMeasurementsCb( GnssMeasurementsNotification /*gnssMeasurementsNotification*/) {} diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 1f2a422a..c80c213d 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -542,6 +542,36 @@ typedef enum /**< QZSS satellite. */ } Gnss_LocSvSystemEnumType; +typedef enum { + GNSS_LOC_SIGNAL_TYPE_GPS_L1CA = 0, /**< GPS L1CA Signal */ + GNSS_LOC_SIGNAL_TYPE_GPS_L1C = 1, /**< GPS L1C Signal */ + GNSS_LOC_SIGNAL_TYPE_GPS_L2C_L = 2, /**< GPS L2C_L RF Band */ + GNSS_LOC_SIGNAL_TYPE_GPS_L5_Q = 3, /**< GPS L5_Q RF Band */ + GNSS_LOC_SIGNAL_TYPE_GLONASS_G1 = 4, /**< GLONASS G1 (L1OF) RF Band */ + GNSS_LOC_SIGNAL_TYPE_GLONASS_G2 = 5, /**< GLONASS G2 (L2OF) RF Band */ + GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C = 6, /**< GALILEO E1_C RF Band */ + GNSS_LOC_SIGNAL_TYPE_GALILEO_E5A_Q = 7, /**< GALILEO E5A_Q RF Band */ + GNSS_LOC_SIGNAL_TYPE_GALILEO_E5B_Q = 8, /**< GALILEO E5B_Q RF Band */ + GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I = 9, /**< BEIDOU B1_I RF Band */ + GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1C = 10, /**< BEIDOU B1C RF Band */ + GNSS_LOC_SIGNAL_TYPE_BEIDOU_B2_I = 11, /**< BEIDOU B2_I RF Band */ + GNSS_LOC_SIGNAL_TYPE_BEIDOU_B2A_I = 12, /**< BEIDOU B2A_I RF Band */ + GNSS_LOC_SIGNAL_TYPE_QZSS_L1CA = 13, /**< QZSS L1CA RF Band */ + GNSS_LOC_SIGNAL_TYPE_QZSS_L1S = 14, /**< QZSS L1S RF Band */ + GNSS_LOC_SIGNAL_TYPE_QZSS_L2C_L = 15, /**< QZSS L2C_L RF Band */ + GNSS_LOC_SIGNAL_TYPE_QZSS_L5_Q = 16, /**< QZSS L5_Q RF Band */ + GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA = 17, /**< SBAS L1_CA RF Band */ + GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 18 /**< Maximum number of signal types */ +} Gnss_LocSignalEnumType; + +typedef uint64_t GnssDataMask; +typedef enum { + // Jammer Indicator is available + GNSS_LOC_DATA_JAMMER_IND_BIT = (1ULL << 0), + // AGC is available + GNSS_LOC_DATA_AGC_BIT = (1ULL << 1) +} GnssDataBits; + typedef uint32_t GnssSystemTimeStructTypeFlags; typedef enum { GNSS_SYSTEM_TIME_WEEK_VALID = (1 << 0), @@ -958,6 +988,13 @@ typedef struct { size_t length; // length of the nmea text } GnssNmeaNotification; +typedef struct { + size_t size; // set to sizeof(GnssDataNotification) + GnssDataMask gnssDataMask[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // bitwise OR of GnssDataBits + double jammerInd[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // Jammer Indication + double agc[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // Automatic gain control +} GnssDataNotification; + typedef struct { size_t size; // set to sizeof(GnssMeasurementsNotification) size_t count; // number of items in GnssMeasurements array @@ -1152,6 +1189,13 @@ typedef std::function gnssNmeaCallback; +/* Gives GNSS data, optional can be NULL + gnssDataCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function gnssDataCallback; + /* Gives GNSS Measurements information, optional can be NULL gnssMeasurementsCallback is called only during a tracking session broadcasted to all clients, no matter if a session has started by client */ @@ -1177,6 +1221,7 @@ typedef struct { gnssNiCallback gnssNiCb; // optional gnssSvCallback gnssSvCb; // optional gnssNmeaCallback gnssNmeaCb; // optional + gnssDataCallback gnssDataCb; // optional gnssMeasurementsCallback gnssMeasurementsCb; // optional batchingStatusCallback batchingStatusCb; // optional } LocationCallbacks; From 4599ab400c9b129604f3feed221c41e8203c33e7 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 17 Aug 2018 10:29:48 -0700 Subject: [PATCH 739/945] Replace unsafe functions Replace strncpy with strlcpy Change-Id: Iade6b1201db75fb15da37431183cb372cd1ad41a CRs-fixed: 2298929 --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f75febd3..b4ac0786 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -631,7 +631,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) if (LOC_AGPS_SUPL_SERVER == type) { int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ? strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1); - strncpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy); + strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy); ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0'; ContextBase::mGps_conf.SUPL_PORT = port; } From d2980eb906a57d6d2179786d35f681178c76a4b9 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 15 Aug 2018 15:17:08 -0700 Subject: [PATCH 740/945] GpsLocationExtended: Add heading rate support Add heading rate for DRE engines to report heading rate Change-Id: I3ea5921a0cac1b0f7efdaabc2e26d58295deda68 CRs-fixed: 2297348 --- utils/gps_extended_c.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 77d09de3..9cc835e5 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -363,7 +363,8 @@ typedef uint64_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000 /** GpsLocationExtended has time uncertainty **/ #define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 - +/** GpsLocationExtended has heading rate **/ +#define GPS_LOCATION_EXTENDED_HAS_HEADING_RATE 0x200000000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -717,6 +718,10 @@ typedef struct { uint8_t leapSeconds; /** Time uncertainty in milliseconds */ float timeUncMs; + /** Heading Rate is in NED frame. + Range: 0 to 359.999. 946 + Unit: Degrees per Seconds */ + float headingRateDeg; } GpsLocationExtended; enum loc_sess_status { From 5eff5e8ba233482fe6ebc024ea8461165ca6f337 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 22 Aug 2018 17:30:33 -0700 Subject: [PATCH 741/945] Add null check to avoid sigsegv on shutdown During shutdown, it's possible that msg task is freed as part of shutdown before the objects that can send messages to msg task are freed, which can result in a sigsegv when messages are sent during this time. Change-Id: I8f9963de75b395ca6c9a3d484416c34682cd0821 CRs-fixed: 2300596 --- utils/MsgTask.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index eaead5cf..ad95a83e 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -74,10 +74,11 @@ void MsgTask::destroy() { } void MsgTask::sendMsg(const LocMsg* msg) const { - if (msg) { + if (msg && this) { msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); } else { - LOC_LOGE("%s: msg is NULL", __func__); + LOC_LOGE("%s: msg is %p and this is %p", + __func__, msg, this); } } From 033a0fa1c6cabd0841bbbd0c762f4b4dd4a5753f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 14 Aug 2018 17:57:57 -0700 Subject: [PATCH 742/945] modem generated NMEA won't get reported when NMEA_PROVIDER_MP (i.e. NMEA_PROVIDER=1 in gps.conf), nmea is dropped at GnssAdpater::reportNmeaEvent Change-Id: Ib200780a887589e8e495b2e012e0649aba275c5c CRs-Fixed: 2297257 --- gnss/GnssAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index b9653fb8..8feedda9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3065,7 +3065,8 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) void GnssAdapter::reportNmeaEvent(const char* nmea, size_t length) { - if (!loc_nmea_is_debug(nmea, length)) { + if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && + !loc_nmea_is_debug(nmea, length)) { return; } From 0a196513162c60f595e1c5cea351900c1eb77019 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 24 Aug 2018 16:57:57 -0700 Subject: [PATCH 743/945] GPS: unify buffer size passed to retrieve string with loc cfg Loc cfg parsing routines assuming that string buffer size is LOC_MAX_PARAM_STRING. Changes are to make sure that caller to loc cfg routine does use that buffer of size LOC_MAX_PARAM_STRING. Change-Id: Icecf6bf017e6dda1da0766adc746f60d471653d0 CRs-fixed: 2301437 --- core/ContextBase.h | 13 +++++-------- gnss/GnssAdapter.cpp | 5 +---- utils/loc_cfg.cpp | 2 +- utils/loc_cfg.h | 14 +++++++------- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index d268f5ad..bdabf7bd 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -36,9 +36,6 @@ #include #include -#define MAX_XTRA_SERVER_URL_LENGTH (256) -#define MAX_SUPL_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, @@ -53,9 +50,9 @@ typedef struct loc_gps_cfg_s 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]; + char XTRA_SERVER_1[LOC_MAX_PARAM_STRING]; + char XTRA_SERVER_2[LOC_MAX_PARAM_STRING]; + char XTRA_SERVER_3[LOC_MAX_PARAM_STRING]; uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; uint32_t NMEA_PROVIDER; uint32_t GPS_LOCK; @@ -65,10 +62,10 @@ typedef struct loc_gps_cfg_s uint32_t LPPE_CP_TECHNOLOGY; uint32_t LPPE_UP_TECHNOLOGY; uint32_t EXTERNAL_DR_ENABLED; - char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; + char SUPL_HOST[LOC_MAX_PARAM_STRING]; uint32_t SUPL_PORT; uint32_t MODEM_TYPE; - char MO_SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH]; + char MO_SUPL_HOST[LOC_MAX_PARAM_STRING]; uint32_t MO_SUPL_PORT; } loc_gps_cfg_s_type; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index b9653fb8..a40fe71a 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -629,10 +629,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) url.assign(serverUrl); if (LOC_AGPS_SUPL_SERVER == type) { - int nCharsToCopy = strlen(server) < MAX_SUPL_SERVER_URL_LENGTH ? - strlen(server) : (MAX_SUPL_SERVER_URL_LENGTH - 1); - strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, nCharsToCopy); - ContextBase::mGps_conf.SUPL_HOST[nCharsToCopy] = '\0'; + strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING); ContextBase::mGps_conf.SUPL_PORT = port; } diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 4c3bc588..7de67141 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -141,7 +141,7 @@ int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* else { strlcpy((char*) config_entry->param_ptr, config_value->param_str_value, - LOC_MAX_PARAM_STRING + 1); + LOC_MAX_PARAM_STRING); } /* Log INI values */ LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index f0334d0b..3057abc2 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -37,7 +37,7 @@ #include #define LOC_MAX_PARAM_NAME 80 -#define LOC_MAX_PARAM_STRING 170 +#define LOC_MAX_PARAM_STRING 172 #define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) #define LOC_FEATURE_MODE_DISABLED "DISABLED" @@ -72,12 +72,12 @@ *============================================================================*/ typedef struct { - const char *param_name; - void *param_ptr; - uint8_t *param_set; /* indicate value set by config file */ - char param_type; /* 'n' for number, - 's' for string, - 'f' for double */ + const char *param_name; + void *param_ptr; /* for string type, buf size need to be LOC_MAX_PARAM_STRING */ + uint8_t *param_set; /* indicate value set by config file */ + char param_type; /* 'n' for number, + 's' for string, NOTE: buf size need to be LOC_MAX_PARAM_STRING + 'f' for double */ } loc_param_s_type; typedef enum { From 9831975c767bce45769ad42d916991d2f4caa1dd Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 27 Aug 2018 15:32:35 -0700 Subject: [PATCH 744/945] Fix issue with use of incorrect index in group list If a group is not found there is a mismatch with group count and actual number of groups in the list leading to some groups not getting set correctly. CRs-Fixed: 2303952 Change-Id: Iafb3aa4e90a79b511f3d36e42583e013fd05391b --- utils/loc_cfg.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 4c3bc588..d319fb45 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -835,11 +835,9 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p for(i=0; igr_gid; + child_proc[j].group_list[child_proc[j].num_groups] = grp->gr_gid; child_proc[j].num_groups++; - LOC_LOGD("%s:%d]:Group %s = %d matches child_group: %d\n", - __func__, __LINE__, split_strings[i], - grp->gr_gid,child_proc[j].group_list[i]); + LOC_LOGd("Group %s = %d", split_strings[i], grp->gr_gid); } } From 12ab7e152fad5490fff256f95d888047d684139f Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Sat, 25 Aug 2018 00:42:54 +0530 Subject: [PATCH 745/945] Accept enabled list for constellation control Accept both enabled and disabled constellation lists for IZAT Constellation Control API CRs-Fixed: 2302898 Change-Id: Ia271efef619fc91a1457d1af7aeebcb8a8a0686d --- gnss/GnssAdapter.cpp | 20 ++++++++++++++++---- gnss/GnssAdapter.h | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8feedda9..223a6273 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1504,17 +1504,29 @@ GnssAdapter::gnssUpdateSvTypeConfigCommand(GnssSvTypeConfig config) void GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config) { + // Gather bits removed from enabled mask + GnssSvTypesMask enabledRemoved = mGnssSvTypeConfig.enabledSvTypesMask & + (mGnssSvTypeConfig.enabledSvTypesMask ^ config.enabledSvTypesMask); + // Send reset if any constellation is removed from the enabled list + bool sendReset = (enabledRemoved != 0); + // Save new config and update gnssSetSvTypeConfig(config); - gnssSvTypeConfigUpdate(); + gnssSvTypeConfigUpdate(sendReset); } void -GnssAdapter::gnssSvTypeConfigUpdate() +GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset) { - LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64, - mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask); + LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 ", sendReset %d", + mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask, + sendReset); if (mGnssSvTypeConfig.size == sizeof(mGnssSvTypeConfig)) { + + if (sendReset) { + mLocApi->resetConstellationControl(); + } + GnssSvIdConfig blacklistConfig = {}; // Revert to previously blacklisted SVs for each enabled constellation blacklistConfig = mGnssSvIdConfig; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index bf757b47..3f2afaab 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -279,7 +279,7 @@ public: void gnssSvIdConfigUpdate(const std::vector& blacklistedSvIds); void gnssSvIdConfigUpdate(); void gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config); - void gnssSvTypeConfigUpdate(); + void gnssSvTypeConfigUpdate(bool sendReset = false); inline void gnssSetSvTypeConfig(const GnssSvTypeConfig& config) { mGnssSvTypeConfig = config; } inline void gnssSetSvTypeConfigCallback(GnssSvTypeConfigCallback callback) From 6932fdd6cdeae81bade8c94dcc3235857b909aec Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 28 Aug 2018 13:30:56 -0700 Subject: [PATCH 746/945] New GTP_MODE in izat.conf to simplify the setup of GTP Added GTP_MODE in izat.conf, replacing GTP_CELL, GTP_CELL_PROC and GTP_WIFI CRs-Fixed: 2301406 Change-Id: Ied2f14f6d1d01b6692cfedb69cd2a9ea18958e5c --- utils/loc_cfg.cpp | 93 +++++++---------------------------------------- 1 file changed, 14 insertions(+), 79 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d319fb45..dc2d8832 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -468,10 +468,7 @@ typedef struct { char platform_list[LOC_MAX_PARAM_STRING]; char baseband[LOC_MAX_PARAM_STRING]; unsigned int sglte_target; - char feature_gtp_cell_proc[LOC_MAX_PARAM_STRING]; - char feature_gtp_waa[LOC_MAX_PARAM_STRING]; - char feature_gtp_cell[LOC_MAX_PARAM_STRING]; - char feature_gtp_wifi[LOC_MAX_PARAM_STRING]; + char feature_gtp_mode[LOC_MAX_PARAM_STRING]; char feature_sap[LOC_MAX_PARAM_STRING]; char feature_odcpi[LOC_MAX_PARAM_STRING]; char feature_free_wifi_scan_inject[LOC_MAX_PARAM_STRING]; @@ -490,8 +487,7 @@ static const loc_param_s_type gps_conf_parameter_table[] = { /* location feature conf, e.g.: izat.conf feature mode table*/ static const loc_param_s_type loc_feature_conf_table[] = { - {"GTP_CELL_PROC", &conf.feature_gtp_cell_proc, NULL, 's'}, - {"GTP_WIFI", &conf.feature_gtp_wifi, NULL, 's'}, + {"GTP_MODE", &conf.feature_gtp_mode, NULL, 's'}, {"SAP", &conf.feature_sap, NULL, 's'}, {"ODCPI", &conf.feature_odcpi, NULL, 's'}, {"FREE_WIFI_SCAN_INJECT", &conf.feature_free_wifi_scan_inject, NULL, 's'}, @@ -586,87 +582,26 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p UTIL_READ_CONF(conf_file_name, loc_feature_conf_table); - //Set service mask for GTP_WIFI - if(strcmp(conf.feature_gtp_wifi, "DISABLED") == 0) { - LOC_LOGD("%s:%d]: GTP WIFI DISABLED", __func__, __LINE__); + //Set service mask for GTP_MODE + if(strcmp(conf.feature_gtp_mode, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: GTP MODE DISABLED", __func__, __LINE__); } - else if(strcmp(conf.feature_gtp_wifi, "BASIC") == 0) { - LOC_LOGD("%s:%d]: Setting GTP WIFI to mode: BASIC", __func__, __LINE__); + else if(strcmp(conf.feature_gtp_mode, "LEGACY_WWAN") == 0) { + LOC_LOGD("%s:%d]: Setting GTP MODE to mode: LEGACY_WWAN", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; + } + else if(strcmp(conf.feature_gtp_mode, "SDK") == 0) { + LOC_LOGD("%s:%d]: Setting GTP MODE to mode: SDK", __func__, __LINE__); loc_service_mask |= LOC_FEATURE_MASK_GTP_WIFI_BASIC; } //conf file has a garbage value else { - LOC_LOGE("%s:%d]: Unrecognized value for GTP WIFI Mode."\ - " Setting GTP WIFI to default mode: BASIC", __func__, __LINE__); - loc_service_mask |= LOC_FEATURE_MASK_GTP_WIFI_BASIC; - } - - //Set service mask for GTP_CELL - //Using a temp variable here to indicate wheter GTP cell is - //enabled on the AP or modem. This variable will be used in - //further checks below. An alternative was to compare the - //string again in each place which would've been more expensive - if(strcmp(conf.feature_gtp_cell_proc, "AP") == 0) { - gtp_cell_ap_enabled = 1; - } - - //by default make it disabled as it will not work with GTP_AP_MODE 4 - strlcpy (conf.feature_gtp_cell, "DISABLED", sizeof (conf.feature_gtp_cell)); - if(strcmp(conf.feature_gtp_cell, "PREMIUM") == 0) { - LOC_LOGE("%s:%d]: Error: location feature GTP CELL does not support PREMIUM mode" \ - " available modes are BASIC and DISABLED. Starting feature in BASIC mode", - __func__, __LINE__); - if(gtp_cell_ap_enabled) { - loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; - } - else { - loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; - } - } - else if(strcmp(conf.feature_gtp_cell, "BASIC") == 0) { - LOC_LOGD("%s:%d]: Setting GTP CELL to mode: BASIC", __func__, __LINE__); - if(gtp_cell_ap_enabled) { - loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; - } - else { - loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; - } - } - else if(strcmp(conf.feature_gtp_cell, "DISABLED") == 0) { - LOC_LOGD("%s:%d]: GTP CELL DISABLED", __func__, __LINE__); - } - //conf file has a garbage value - else { - LOC_LOGE("%s:%d]: Unrecognized value for GTP CELL Mode." \ - " Setting GTP CELL to default mode: BASIC", __func__, __LINE__); - if(gtp_cell_ap_enabled) { - loc_service_mask |= LOC_FEATURE_MASK_GTP_AP_CELL_BASIC; - } - else { - loc_service_mask |= LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC; - } + LOC_LOGE("%s:%d]: Unrecognized value for GTP MODE Mode."\ + " Setting GTP WIFI to default mode: DISABLED", __func__, __LINE__); } //Set service mask for GTP_WAA - strlcpy (conf.feature_gtp_waa, "DISABLED", sizeof (conf.feature_gtp_waa)); - if(strcmp(conf.feature_gtp_waa, "PREMIUM") == 0) { - LOC_LOGE("%s:%d]: Error: location feature GTP WAA does not support PREMIUM mode" \ - " available modes are BASIC and DISABLED. Starting feature in BASIC mode", - __func__, __LINE__); - loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC; - } - else if(strcmp(conf.feature_gtp_waa, "BASIC") == 0) { - LOC_LOGD("%s:%d]: Setting GTP WAA to mode: BASIC", __func__, __LINE__); - loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC; - } - else if(strcmp(conf.feature_gtp_waa, "DISABLED") == 0) { - LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__); - } - //conf file has a garbage value - else { - LOC_LOGE("%s:%d]: Unrecognized value for GTP WAA Mode."\ - " Setting GTP WAA to default mode: DISABLED", __func__, __LINE__); - } + LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__); //Set service mask for SAP if(strcmp(conf.feature_sap, "PREMIUM") == 0) { From c30e7c5e6304a15b6522f37f30bdb813c20833a6 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 5 Sep 2018 15:36:13 -0700 Subject: [PATCH 747/945] Set SV in use mask based on final fixes Do not set SV in use mask based on intermediate position update from modem since it might contain stale information Change-Id: I4300854ead3f85758bfb37d4c47ace10f63541a0 CRs-fixed: 2307493 --- core/LocApiBase.cpp | 29 +++++++++++++++++++++++++++++ core/LocApiBase.h | 4 ++++ gnss/GnssAdapter.cpp | 20 ++------------------ 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index f44ab454..7b52c828 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -188,6 +188,35 @@ bool LocApiBase::isInSession() return inSession; } +bool LocApiBase::needReport(const UlpLocation& ulpLocation, + enum loc_sess_status status, + LocPosTechMask techMask) +{ + bool reported = false; + + if (LOC_SESS_SUCCESS == status) { + // this is a final fix + LocPosTechMask mask = + LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID; + // it is a Satellite fix or a sensor fix + reported = (mask & techMask); + } + else if (LOC_SESS_INTERMEDIATE == status && + LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS) { + // this is a intermediate fix and we accept intermediate + + // it is NOT the case that + // there is inaccuracy; and + // we care about inaccuracy; and + // the inaccuracy exceeds our tolerance + reported = !((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ACCURACY) && + (ContextBase::mGps_conf.ACCURACY_THRES != 0) && + (ulpLocation.gpsLocation.accuracy > ContextBase::mGps_conf.ACCURACY_THRES)); + } + + return reported; +} + void LocApiBase::addAdapter(LocAdapterBase* adapter) { for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index ea5e0716..e80e2738 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -145,6 +145,10 @@ public: sendMsg(new LocKillMsg(this)); } + static bool needReport(const UlpLocation& ulpLocation, + enum loc_sess_status status, + LocPosTechMask techMask); + void addAdapter(LocAdapterBase* adapter); void removeAdapter(LocAdapterBase* adapter); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8feedda9..b43ec2ab 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2904,25 +2904,9 @@ GnssAdapter::needReport(const UlpLocation& ulpLocation, // then always output position reported by engine hub to requesting client if (true == initEngHubProxy()) { reported = true; - } else if (LOC_SESS_SUCCESS == status) { - // this is a final fix - LocPosTechMask mask = - LOC_POS_TECH_MASK_SATELLITE | LOC_POS_TECH_MASK_SENSORS | LOC_POS_TECH_MASK_HYBRID; - // it is a Satellite fix or a sensor fix - reported = (mask & techMask); - } else if (LOC_SESS_INTERMEDIATE == status && - LOC_SESS_INTERMEDIATE == ContextBase::mGps_conf.INTERMEDIATE_POS) { - // this is a intermediate fix and we accepte intermediate - - // it is NOT the case that - // there is inaccuracy; and - // we care about inaccuracy; and - // the inaccuracy exceeds our tolerance - reported = !((ulpLocation.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ACCURACY) && - (ContextBase::mGps_conf.ACCURACY_THRES != 0) && - (ulpLocation.gpsLocation.accuracy > ContextBase::mGps_conf.ACCURACY_THRES)); + } else { + reported = LocApiBase::needReport(ulpLocation, status, techMask); } - return reported; } From 48b4e04af7c1bc58227afb33dcef23b5c6712bef Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Mon, 3 Sep 2018 15:27:08 +0800 Subject: [PATCH 748/945] support signal ID in NMEA support GPS L5, GALILEO E5 and BDS B2 in NMEA. Change-Id: I7302ec8dfabaf28832fc93206f70cd1942f48183 CRs-Fixed: 2307787 --- location/LocationDataTypes.h | 24 +-- utils/gps_extended_c.h | 22 +-- utils/loc_nmea.cpp | 296 ++++++++++++++++++++++++++++------- 3 files changed, 269 insertions(+), 73 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 7ebbd63c..9688b4ad 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -507,21 +507,25 @@ typedef enum { /** GALILEO E5A RF Band */ GNSS_SIGNAL_GALILEO_E5A = (1<<7), /** GALILEO E5B RF Band */ - GNSS_SIGNAL_GALILIEO_E5B = (1<<8), - /** BEIDOU B1 RF Band */ - GNSS_SIGNAL_BEIDOU_B1 = (1<<9), - /** BEIDOU B2 RF Band */ - GNSS_SIGNAL_BEIDOU_B2 = (1<<10), + GNSS_SIGNAL_GALILEO_E5B = (1<<8), + /** BEIDOU B1_I RF Band */ + GNSS_SIGNAL_BEIDOU_B1I = (1<<9), + /** BEIDOU B1C RF Band */ + GNSS_SIGNAL_BEIDOU_B1C = (1<<10), + /** BEIDOU B2_I RF Band */ + GNSS_SIGNAL_BEIDOU_B2I = (1<<11), + /** BEIDOU B2A_I RF Band */ + GNSS_SIGNAL_BEIDOU_B2AI = (1<<12), /** QZSS L1CA RF Band */ - GNSS_SIGNAL_QZSS_L1CA = (1<<11), + GNSS_SIGNAL_QZSS_L1CA = (1<<13), /** QZSS L1S RF Band */ - GNSS_SIGNAL_QZSS_L1S = (1<<12), + GNSS_SIGNAL_QZSS_L1S = (1<<14), /** QZSS L2 RF Band */ - GNSS_SIGNAL_QZSS_L2 = (1<<13), + GNSS_SIGNAL_QZSS_L2 = (1<<15), /** QZSS L5 RF Band */ - GNSS_SIGNAL_QZSS_L5 = (1<<14), + GNSS_SIGNAL_QZSS_L5 = (1<<16), /** SBAS L1 RF Band */ - GNSS_SIGNAL_SBAS_L1 = (1<<15) + GNSS_SIGNAL_SBAS_L1 = (1<<17) } GnssSignalTypeBits; typedef enum diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 9cc835e5..10605f78 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -536,20 +536,24 @@ typedef uint32_t GnssSignalTypeMask; #define GNSS_SIGNAL_GALILEO_E5A ((GnssSignalTypeMask)0x00000080ul) /** GALILEO E5B RF Band */ #define GNSS_SIGNAL_GALILIEO_E5B ((GnssSignalTypeMask)0x00000100ul) -/** BEIDOU B1 RF Band */ -#define GNSS_SIGNAL_BEIDOU_B1 ((GnssSignalTypeMask)0x00000200ul) -/** BEIDOU B2 RF Band */ -#define GNSS_SIGNAL_BEIDOU_B2 ((GnssSignalTypeMask)0x00000400ul) +/** BEIDOU B1_I RF Band */ +#define GNSS_SIGNAL_BEIDOU_B1I ((GnssSignalTypeMask)0x00000200ul) +/** BEIDOU B1C RF Band */ +#define GNSS_SIGNAL_BEIDOU_B1C ((GnssSignalTypeMask)0x00000400ul) +/** BEIDOU B2_I RF Band */ +#define GNSS_SIGNAL_BEIDOU_B2I ((GnssSignalTypeMask)0x00000800ul) +/** BEIDOU B2A_I RF Band */ +#define GNSS_SIGNAL_BEIDOU_B2AI ((GnssSignalTypeMask)0x00001000ul) /** QZSS L1CA RF Band */ -#define GNSS_SIGNAL_QZSS_L1CA ((GnssSignalTypeMask)0x00000800ul) +#define GNSS_SIGNAL_QZSS_L1CA ((GnssSignalTypeMask)0x00002000ul) /** QZSS L1S RF Band */ -#define GNSS_SIGNAL_QZSS_L1S ((GnssSignalTypeMask)0x00001000ul) +#define GNSS_SIGNAL_QZSS_L1S ((GnssSignalTypeMask)0x00004000ul) /** QZSS L2 RF Band */ -#define GNSS_SIGNAL_QZSS_L2 ((GnssSignalTypeMask)0x00002000ul) +#define GNSS_SIGNAL_QZSS_L2 ((GnssSignalTypeMask)0x00008000ul) /** QZSS L5 RF Band */ -#define GNSS_SIGNAL_QZSS_L5 ((GnssSignalTypeMask)0x00004000ul) +#define GNSS_SIGNAL_QZSS_L5 ((GnssSignalTypeMask)0x00010000ul) /** SBAS L1 RF Band */ -#define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00008000ul) +#define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00020000ul) typedef uint16_t GnssMeasUsageStatusBitMask; /** Used in fix */ diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 558dc65b..03a1ffdf 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -45,6 +45,39 @@ #define SYSTEM_ID_BEIDOU 4 #define SYSTEM_ID_QZSS 5 +//GNSS signal id according to NMEA spec +#define SIGNAL_ID_ALL_SIGNALS 0 +#define SIGNAL_ID_GPS_L1CA 1 +#define SIGNAL_ID_GPS_L1P 2 +#define SIGNAL_ID_GPS_L1M 3 +#define SIGNAL_ID_GPS_L2P 4 +#define SIGNAL_ID_GPS_L2CM 5 +#define SIGNAL_ID_GPS_L2CL 6 +#define SIGNAL_ID_GPS_L5I 7 +#define SIGNAL_ID_GPS_L5Q 8 + + +#define SIGNAL_ID_GLO_G1CA 1 +#define SIGNAL_ID_GLO_G1P 2 +#define SIGNAL_ID_GLO_G2CA 3 +#define SIGNAL_ID_GLO_G2P 4 + + +#define SIGNAL_ID_GAL_E5A 1 +#define SIGNAL_ID_GAL_E5B 2 +#define SIGNAL_ID_GAL_E5AB 3 +#define SIGNAL_ID_GAL_E6A 4 +#define SIGNAL_ID_GAL_E6BC 5 +#define SIGNAL_ID_GAL_L1A 6 +#define SIGNAL_ID_GAL_L1BC 7 + +//Extended signal id +#define SIGNAL_ID_BDS_B1I 1 +#define SIGNAL_ID_BDS_B1C 2 +#define SIGNAL_ID_BDS_B2I 3 +#define SIGNAL_ID_BDS_B2AI 4 + + typedef struct loc_nmea_sv_meta_s { char talker[3]; @@ -63,16 +96,95 @@ typedef struct loc_sv_cache_info_s uint32_t gal_used_mask; uint32_t qzss_used_mask; uint32_t bds_used_mask; - uint32_t gps_count; - uint32_t glo_count; - uint32_t gal_count; - uint32_t qzss_count; - uint32_t bds_count; + uint32_t gps_l1_count; + uint32_t gps_l5_count; + uint32_t glo_g1_count; + uint32_t glo_g2_count; + uint32_t gal_e1_count; + uint32_t gal_e5_count; + uint32_t qzss_l1_count; + uint32_t qzss_l5_count; + uint32_t bds_b1_count; + uint32_t bds_b2_count; float hdop; float pdop; float vdop; } loc_sv_cache_info; +/*=========================================================================== +FUNCTION convert_signalType_to_signalId + +DESCRIPTION + convert signalType to signal ID + +DEPENDENCIES + NONE + +RETURN VALUE + value of signal ID + +SIDE EFFECTS + N/A + +===========================================================================*/ +static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) +{ + uint32_t signalId = SIGNAL_ID_ALL_SIGNALS; + + switch (signalType) { + case GNSS_SIGNAL_GPS_L1CA: + signalId = SIGNAL_ID_GPS_L1CA; + break; + case GNSS_SIGNAL_GPS_L2: + signalId = SIGNAL_ID_GPS_L2CL; + break; + case GNSS_SIGNAL_GPS_L5: + signalId = SIGNAL_ID_GPS_L5Q; + break; + case GNSS_SIGNAL_GLONASS_G1: + signalId = SIGNAL_ID_GLO_G1CA; + break; + case GNSS_SIGNAL_GLONASS_G2: + signalId = SIGNAL_ID_GLO_G2CA; + break; + case GNSS_SIGNAL_GALILEO_E1: + signalId = SIGNAL_ID_GAL_L1BC; + break; + case GNSS_SIGNAL_GALILEO_E5A: + signalId = SIGNAL_ID_GAL_E5A; + break; + case GNSS_SIGNAL_GALILEO_E5B: + signalId = SIGNAL_ID_GAL_E5B; + break; + case GNSS_SIGNAL_QZSS_L1CA: + signalId = SIGNAL_ID_GPS_L1CA; + break; + case GNSS_SIGNAL_QZSS_L2: + signalId = SIGNAL_ID_GPS_L2CL; + break; + case GNSS_SIGNAL_QZSS_L5: + signalId = SIGNAL_ID_GPS_L5Q; + break; + case GNSS_SIGNAL_BEIDOU_B1I: + signalId = SIGNAL_ID_BDS_B1I; + break; + case GNSS_SIGNAL_BEIDOU_B1C: + signalId = SIGNAL_ID_BDS_B1C; + break; + case GNSS_SIGNAL_BEIDOU_B2I: + signalId = SIGNAL_ID_BDS_B2I; + break; + case GNSS_SIGNAL_BEIDOU_B2AI: + signalId = SIGNAL_ID_BDS_B2AI; + break; + default: + signalId = SIGNAL_ID_ALL_SIGNALS; + } + + return signalId; + +} + /*=========================================================================== FUNCTION loc_nmea_sv_meta_init @@ -92,6 +204,7 @@ SIDE EFFECTS static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, loc_sv_cache_info& sv_cache_info, GnssSvType svType, + GnssSignalTypeMask signalType, bool needCombine) { memset(&sv_meta, 0, sizeof(sv_meta)); @@ -103,50 +216,66 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'P'; sv_meta.mask = sv_cache_info.gps_used_mask; - sv_meta.svCount = sv_cache_info.gps_count; - sv_meta.signalId = 1; sv_meta.systemId = SYSTEM_ID_GPS; + if (GNSS_SIGNAL_GPS_L1CA == signalType) { + sv_meta.svCount = sv_cache_info.gps_l1_count; + } else if (GNSS_SIGNAL_GPS_L5 == signalType) { + sv_meta.svCount = sv_cache_info.gps_l5_count; + } break; case GNSS_SV_TYPE_GLONASS: sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'L'; sv_meta.mask = sv_cache_info.glo_used_mask; - sv_meta.svCount = sv_cache_info.glo_count; // GLONASS SV ids are from 65-96 sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET; - sv_meta.signalId = 1; sv_meta.systemId = SYSTEM_ID_GLONASS; + if (GNSS_SIGNAL_GLONASS_G1 == signalType) { + sv_meta.svCount = sv_cache_info.glo_g1_count; + } else if (GNSS_SIGNAL_GLONASS_G2 == signalType) { + sv_meta.svCount = sv_cache_info.glo_g2_count; + } break; case GNSS_SV_TYPE_GALILEO: sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'A'; sv_meta.mask = sv_cache_info.gal_used_mask; - sv_meta.svCount = sv_cache_info.gal_count; - sv_meta.signalId = 7; sv_meta.systemId = SYSTEM_ID_GALILEO; + if (GNSS_SIGNAL_GALILEO_E1 == signalType) { + sv_meta.svCount = sv_cache_info.gal_e1_count; + } else if (GNSS_SIGNAL_GALILEO_E5A == signalType) { + sv_meta.svCount = sv_cache_info.gal_e5_count; + } break; case GNSS_SV_TYPE_QZSS: sv_meta.talker[0] = 'P'; sv_meta.talker[1] = 'Q'; sv_meta.mask = sv_cache_info.qzss_used_mask; - sv_meta.svCount = sv_cache_info.qzss_count; // QZSS SV ids are from 193-197. So keep svIdOffset 0 - sv_meta.signalId = 0; sv_meta.systemId = SYSTEM_ID_QZSS; + if (GNSS_SIGNAL_QZSS_L1CA == signalType) { + sv_meta.svCount = sv_cache_info.qzss_l1_count; + } else if (GNSS_SIGNAL_QZSS_L5 == signalType) { + sv_meta.svCount = sv_cache_info.qzss_l5_count; + } break; case GNSS_SV_TYPE_BEIDOU: sv_meta.talker[0] = 'P'; sv_meta.talker[1] = 'Q'; sv_meta.mask = sv_cache_info.bds_used_mask; - sv_meta.svCount = sv_cache_info.bds_count; // BDS SV ids are from 201-235. So keep svIdOffset 0 - sv_meta.signalId = 0; sv_meta.systemId = SYSTEM_ID_BEIDOU; + if (GNSS_SIGNAL_BEIDOU_B1I == signalType) { + sv_meta.svCount = sv_cache_info.bds_b1_count; + } else if (GNSS_SIGNAL_BEIDOU_B2AI == signalType) { + sv_meta.svCount = sv_cache_info.bds_b2_count; + } break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svType); return NULL; } + sv_meta.signalId = convert_signalType_to_signalId(signalType); if (needCombine && (sv_cache_info.gps_used_mask ? 1 : 0) + (sv_cache_info.glo_used_mask ? 1 : 0) + @@ -371,7 +500,6 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, const char* talker = sv_meta_p->talker; uint32_t svIdOffset = sv_meta_p->svIdOffset; int svCount = sv_meta_p->svCount; - if (svCount <= 0) { // no svs in view, so just send a blank $--GSV sentence @@ -403,7 +531,8 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, for (int i=0; (svNumber <= svNotify.count) && (i < 4); svNumber++) { - if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type) + if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type && sv_meta_p->signalId == + convert_signalType_to_signalId(svNotify.gnssSvs[svNumber-1].gnssSignalTypeMask)) { length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", svNotify.gnssSvs[svNumber - 1].svId + svIdOffset, @@ -521,8 +650,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, true), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, + GNSS_SIGNAL_GPS_L1CA, true), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -535,8 +664,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, true), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, + GNSS_SIGNAL_GLONASS_G1, true), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -549,8 +678,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, true), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, + GNSS_SIGNAL_GALILEO_E1, true), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -563,8 +692,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // -------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, + GNSS_SIGNAL_QZSS_L1CA, false), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -575,8 +704,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ---$PQGSA/$GNGSA (BEIDOU)--- // ---------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, + GNSS_SIGNAL_BEIDOU_B1I, false), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -1019,7 +1148,11 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gps_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - sv_cache_info.gps_count++; + if (GNSS_SIGNAL_GPS_L1CA == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.gps_l1_count++; + } else if (GNSS_SIGNAL_GPS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.gps_l5_count++; + } } else if (GNSS_SV_TYPE_GLONASS == svNotify.gnssSvs[svNumber - 1].type) { @@ -1031,7 +1164,11 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.glo_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - sv_cache_info.glo_count++; + if (GNSS_SIGNAL_GLONASS_G1 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.glo_g1_count++; + } else if (GNSS_SIGNAL_GLONASS_G2 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + sv_cache_info.glo_g2_count++; + } } else if (GNSS_SV_TYPE_GALILEO == svNotify.gnssSvs[svNumber - 1].type) { @@ -1043,7 +1180,11 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gal_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - sv_cache_info.gal_count++; + if (GNSS_SIGNAL_GALILEO_E1 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.gal_e1_count++; + } else if(GNSS_SIGNAL_GALILEO_E5A == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + sv_cache_info.gal_e5_count++; + } } else if (GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[svNumber - 1].type) { @@ -1055,7 +1196,11 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.qzss_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - sv_cache_info.qzss_count++; + if (GNSS_SIGNAL_QZSS_L1CA == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.qzss_l1_count++; + } else if (GNSS_SIGNAL_QZSS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.qzss_l5_count++; + } } else if (GNSS_SV_TYPE_BEIDOU == svNotify.gnssSvs[svNumber - 1].type) { @@ -1067,48 +1212,91 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.bds_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - sv_cache_info.bds_count++; + if (GNSS_SIGNAL_BEIDOU_B1I == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + sv_cache_info.bds_b1_count++; + } else if(GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + sv_cache_info.bds_b2_count++; + } } } loc_nmea_sv_meta sv_meta; - // ------------------ - // ------$GPGSV------ - // ------------------ + // --------------------- + // ------$GPGSV:L1CA---- + // --------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, + GNSS_SIGNAL_GPS_L1CA, false), nmeaArraystr); - // ------------------ - // ------$GLGSV------ - // ------------------ + // --------------------- + // ------$GPGSV:L5------ + // --------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, false), - nmeaArraystr); - - // ------------------ - // ------$GAGSV------ - // ------------------ + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GPS, + GNSS_SIGNAL_GPS_L5, false), nmeaArraystr); + // --------------------- + // ------$GLGSV:G1------ + // --------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, false), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, + GNSS_SIGNAL_GLONASS_G1, false), nmeaArraystr); + + // --------------------- + // ------$GLGSV:G2------ + // --------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GLONASS, + GNSS_SIGNAL_GLONASS_G2, false), nmeaArraystr); + + // --------------------- + // ------$GAGSV:E1------ + // --------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, + GNSS_SIGNAL_GALILEO_E1, false), nmeaArraystr); // ------------------------- - // ------$PQGSV (QZSS)------ + // ------$GAGSV:E5A--------- // ------------------------- + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_GALILEO, + GNSS_SIGNAL_GALILEO_E5A, false), nmeaArraystr); + + // ----------------------------- + // ------$PQGSV (QZSS):L1CA----- + // ----------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, false), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, + GNSS_SIGNAL_QZSS_L1CA, false), nmeaArraystr); - // --------------------------- - // ------$PQGSV (BEIDOU)------ - // --------------------------- + // ----------------------------- + // ------$PQGSV (QZSS):L5------- + // ----------------------------- loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, false), - nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, + GNSS_SIGNAL_QZSS_L5, false), nmeaArraystr); + // ----------------------------- + // ------$PQGSV (BEIDOU:B1I)---- + // ----------------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, + GNSS_SIGNAL_BEIDOU_B1I,false), nmeaArraystr); + + // ----------------------------- + // ------$PQGSV (BEIDOU:B2AI)--- + // ----------------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, + GNSS_SIGNAL_BEIDOU_B2AI,false), nmeaArraystr); EXIT_LOG(%d, 0); } From b81c6d4955dae8b24b972bbcd55315700ace575c Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 10 Sep 2018 18:06:40 -0700 Subject: [PATCH 749/945] Fixed KW issues such as uninitialized variables Change-Id: I24093a79fe0befc4484a9538110d44f667d1cbd6 CRs-fixed: 2312583 --- gnss/GnssAdapter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8feedda9..00643d42 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2271,6 +2271,7 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, // find the smallest interval and powerMode TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; + memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { // if not set or there is a new smallest interval, then set the new interval if (0 == multiplexedOptions.size || @@ -2461,6 +2462,7 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, // find the smallest interval and powerMode, other than the session we are updating TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; + memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { // if session is not the one we are updating and either interval // is not set or there is a new smallest interval, then set the new interval @@ -2560,6 +2562,7 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) // find the smallest interval and powerMode, other than the session we are stopping TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; + memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { // if session is not the one we are stopping and either interval // is not set or there is a new smallest interval, then set the new interval @@ -2864,6 +2867,7 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, mStatus(status), mTechMask(techMask), mMsInWeek(msInWeek) { + memset(&mDataNotify, 0, sizeof(mDataNotify)); if (pDataNotify != nullptr) { mDataNotify = *pDataNotify; mbIsDataValid = true; From b5fac5c63559786af3d1554de213348569a7473e Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 12 Sep 2018 14:07:11 -0700 Subject: [PATCH 750/945] Added support for USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL CRs-fixed: 2314577 Change-Id: I64969dfa47860d963ca0682948fb784ca47000c5 --- gnss/Agps.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 2470b813..a4f6a307 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -559,6 +559,15 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType 0x%X apnTypeMask: 0x%X", connHandle, agpsType, apnTypeMask); + if (0 == loc_core::ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL && + LOC_AGPS_TYPE_SUPL_ES == agpsType) { + agpsType = LOC_AGPS_TYPE_SUPL; + apnTypeMask &= ~LOC_APN_TYPE_MASK_EMERGENCY; + LOC_LOGD("Changed agpsType to non-emergency when USE_EMERGENCY... is 0" + "and removed LOC_APN_TYPE_MASK_EMERGENCY from apnTypeMask" + "agpsType 0x%X apnTypeMask : 0x%X", + agpsType, apnTypeMask); + } AgpsStateMachine* sm = getAgpsStateMachine(agpsType); if (sm == NULL) { From a9049e3aebc3fa75ba0c6e1ad098428bfca6abda Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Mon, 10 Sep 2018 11:14:31 +0800 Subject: [PATCH 751/945] Decouple Gnss Hidl impl into 1.0 and 1.1 version Decouple Gnss Hidl implementation into 1.0 and 1.1 version. msmnile and later targets would use gnss hidl 1.1, and older targets would use gnss hidl 1.0 Change-Id: I31fdf932ce55a0547ff69fc3d28dae1d001e8d56 CRs-fixed: 2311903 --- android/1.0/AGnss.cpp | 203 +++++++ android/1.0/AGnss.h | 79 +++ android/1.0/AGnssRil.cpp | 93 +++ android/1.0/AGnssRil.h | 83 +++ android/1.0/Android.mk | 91 +++ android/1.0/Gnss.cpp | 347 +++++++++++ android/1.0/Gnss.h | 143 +++++ android/1.0/GnssBatching.cpp | 130 ++++ android/1.0/GnssBatching.h | 80 +++ android/1.0/GnssConfiguration.cpp | 230 ++++++++ android/1.0/GnssConfiguration.h | 71 +++ android/1.0/GnssDebug.cpp | 173 ++++++ android/1.0/GnssDebug.h | 59 ++ android/1.0/GnssGeofencing.cpp | 141 +++++ android/1.0/GnssGeofencing.h | 91 +++ android/1.0/GnssMeasurement.cpp | 101 ++++ android/1.0/GnssMeasurement.h | 77 +++ android/1.0/GnssNi.cpp | 85 +++ android/1.0/GnssNi.h | 75 +++ .../android.hardware.gnss@1.0-service-qti.rc | 4 + .../1.0/location_api/BatchingAPIClient.cpp | 196 ++++++ android/1.0/location_api/BatchingAPIClient.h | 74 +++ .../1.0/location_api/GeofenceAPIClient.cpp | 275 +++++++++ android/1.0/location_api/GeofenceAPIClient.h | 76 +++ android/1.0/location_api/GnssAPIClient.cpp | 558 ++++++++++++++++++ android/1.0/location_api/GnssAPIClient.h | 109 ++++ android/1.0/location_api/LocationUtil.cpp | 206 +++++++ android/1.0/location_api/LocationUtil.h | 55 ++ .../1.0/location_api/MeasurementAPIClient.cpp | 276 +++++++++ .../1.0/location_api/MeasurementAPIClient.h | 77 +++ android/1.0/service.cpp | 31 + android/{ => 1.1}/AGnss.cpp | 0 android/{ => 1.1}/AGnss.h | 0 android/{ => 1.1}/AGnssRil.cpp | 0 android/{ => 1.1}/AGnssRil.h | 0 android/1.1/Android.mk | 93 +++ android/{ => 1.1}/Gnss.cpp | 0 android/{ => 1.1}/Gnss.h | 0 android/{ => 1.1}/GnssBatching.cpp | 0 android/{ => 1.1}/GnssBatching.h | 0 android/{ => 1.1}/GnssConfiguration.cpp | 0 android/{ => 1.1}/GnssConfiguration.h | 0 android/{ => 1.1}/GnssDebug.cpp | 0 android/{ => 1.1}/GnssDebug.h | 0 android/{ => 1.1}/GnssGeofencing.cpp | 0 android/{ => 1.1}/GnssGeofencing.h | 0 android/{ => 1.1}/GnssMeasurement.cpp | 0 android/{ => 1.1}/GnssMeasurement.h | 0 android/{ => 1.1}/GnssNi.cpp | 0 android/{ => 1.1}/GnssNi.h | 0 .../android.hardware.gnss@1.1-service-qti.rc | 0 .../location_api/BatchingAPIClient.cpp | 0 .../location_api/BatchingAPIClient.h | 0 .../location_api/GeofenceAPIClient.cpp | 0 .../location_api/GeofenceAPIClient.h | 0 .../{ => 1.1}/location_api/GnssAPIClient.cpp | 0 .../{ => 1.1}/location_api/GnssAPIClient.h | 0 .../{ => 1.1}/location_api/LocationUtil.cpp | 0 android/{ => 1.1}/location_api/LocationUtil.h | 0 .../location_api/MeasurementAPIClient.cpp | 0 .../location_api/MeasurementAPIClient.h | 0 android/{ => 1.1}/service.cpp | 0 android/Android.mk | 98 +-- build/target_specific_features.mk | 31 + 64 files changed, 4420 insertions(+), 91 deletions(-) create mode 100644 android/1.0/AGnss.cpp create mode 100644 android/1.0/AGnss.h create mode 100644 android/1.0/AGnssRil.cpp create mode 100644 android/1.0/AGnssRil.h create mode 100644 android/1.0/Android.mk create mode 100644 android/1.0/Gnss.cpp create mode 100644 android/1.0/Gnss.h create mode 100644 android/1.0/GnssBatching.cpp create mode 100644 android/1.0/GnssBatching.h create mode 100644 android/1.0/GnssConfiguration.cpp create mode 100644 android/1.0/GnssConfiguration.h create mode 100644 android/1.0/GnssDebug.cpp create mode 100644 android/1.0/GnssDebug.h create mode 100644 android/1.0/GnssGeofencing.cpp create mode 100644 android/1.0/GnssGeofencing.h create mode 100644 android/1.0/GnssMeasurement.cpp create mode 100644 android/1.0/GnssMeasurement.h create mode 100644 android/1.0/GnssNi.cpp create mode 100644 android/1.0/GnssNi.h create mode 100644 android/1.0/android.hardware.gnss@1.0-service-qti.rc create mode 100644 android/1.0/location_api/BatchingAPIClient.cpp create mode 100644 android/1.0/location_api/BatchingAPIClient.h create mode 100644 android/1.0/location_api/GeofenceAPIClient.cpp create mode 100644 android/1.0/location_api/GeofenceAPIClient.h create mode 100644 android/1.0/location_api/GnssAPIClient.cpp create mode 100644 android/1.0/location_api/GnssAPIClient.h create mode 100644 android/1.0/location_api/LocationUtil.cpp create mode 100644 android/1.0/location_api/LocationUtil.h create mode 100644 android/1.0/location_api/MeasurementAPIClient.cpp create mode 100644 android/1.0/location_api/MeasurementAPIClient.h create mode 100644 android/1.0/service.cpp rename android/{ => 1.1}/AGnss.cpp (100%) rename android/{ => 1.1}/AGnss.h (100%) rename android/{ => 1.1}/AGnssRil.cpp (100%) rename android/{ => 1.1}/AGnssRil.h (100%) create mode 100644 android/1.1/Android.mk rename android/{ => 1.1}/Gnss.cpp (100%) rename android/{ => 1.1}/Gnss.h (100%) rename android/{ => 1.1}/GnssBatching.cpp (100%) rename android/{ => 1.1}/GnssBatching.h (100%) rename android/{ => 1.1}/GnssConfiguration.cpp (100%) rename android/{ => 1.1}/GnssConfiguration.h (100%) rename android/{ => 1.1}/GnssDebug.cpp (100%) rename android/{ => 1.1}/GnssDebug.h (100%) rename android/{ => 1.1}/GnssGeofencing.cpp (100%) rename android/{ => 1.1}/GnssGeofencing.h (100%) rename android/{ => 1.1}/GnssMeasurement.cpp (100%) rename android/{ => 1.1}/GnssMeasurement.h (100%) rename android/{ => 1.1}/GnssNi.cpp (100%) rename android/{ => 1.1}/GnssNi.h (100%) rename android/{ => 1.1}/android.hardware.gnss@1.1-service-qti.rc (100%) rename android/{ => 1.1}/location_api/BatchingAPIClient.cpp (100%) rename android/{ => 1.1}/location_api/BatchingAPIClient.h (100%) rename android/{ => 1.1}/location_api/GeofenceAPIClient.cpp (100%) rename android/{ => 1.1}/location_api/GeofenceAPIClient.h (100%) rename android/{ => 1.1}/location_api/GnssAPIClient.cpp (100%) rename android/{ => 1.1}/location_api/GnssAPIClient.h (100%) rename android/{ => 1.1}/location_api/LocationUtil.cpp (100%) rename android/{ => 1.1}/location_api/LocationUtil.h (100%) rename android/{ => 1.1}/location_api/MeasurementAPIClient.cpp (100%) rename android/{ => 1.1}/location_api/MeasurementAPIClient.h (100%) rename android/{ => 1.1}/service.cpp (100%) diff --git a/android/1.0/AGnss.cpp b/android/1.0/AGnss.cpp new file mode 100644 index 00000000..faaf75e5 --- /dev/null +++ b/android/1.0/AGnss.cpp @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_AGnssInterface" + +#include +#include "Gnss.h" +#include "AGnss.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +static AGnss* spAGnss = nullptr; + +AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { + spAGnss = this; +} + +AGnss::~AGnss() { + spAGnss = nullptr; +} + +void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ + if (nullptr != spAGnss) { + spAGnss->statusIpV4Cb(status); + } +} + +void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) { + IAGnssCallback::AGnssStatusIpV4 st = {}; + + switch (status.type) { + case LOC_AGPS_TYPE_SUPL: + st.type = IAGnssCallback::AGnssType::TYPE_SUPL; + break; + case LOC_AGPS_TYPE_C2K: + st.type = IAGnssCallback::AGnssType::TYPE_C2K; + break; + default: + LOC_LOGE("invalid type: %d", status.type); + return; + } + + switch (status.status) { + case LOC_GPS_REQUEST_AGPS_DATA_CONN: + st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN; + break; + case LOC_GPS_RELEASE_AGPS_DATA_CONN: + st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN; + break; + case LOC_GPS_AGPS_DATA_CONNECTED: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED; + break; + case LOC_GPS_AGPS_DATA_CONN_DONE: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE; + break; + case LOC_GPS_AGPS_DATA_CONN_FAILED: + st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED; + break; + default: + LOC_LOGE("invalid status: %d", status.status); + return; + } + st.ipV4Addr = status.ipV4Addr; + + if (mAGnssCbIface != nullptr) { + auto r = mAGnssCbIface->agnssStatusIpV4Cb(st); + if (!r.isOk()) { + LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str()); + } + } else { + LOC_LOGw("setCallback has not been called yet"); + } +} + +Return AGnss::setCallback(const sp& callback) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return Void(); + } + + // Save the interface + mAGnssCbIface = callback; + + AgpsCbInfo cbInfo = {}; + cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; + cbInfo.cbPriority = AGPS_CB_PRIORITY_LOW; + + mGnss->getGnssInterface()->agpsInit(cbInfo); + return Void(); +} + +Return AGnss::dataConnClosed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL); + return true; +} + +Return AGnss::dataConnFailed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL); + return true; +} + +Return AGnss::dataConnOpen(const hidl_string& apn, + IAGnss::ApnIpType apnIpType) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + /* Validate */ + if(apn.empty()){ + LOC_LOGE("Invalid APN"); + return false; + } + + LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str()); + + AGpsBearerType bearerType; + switch (apnIpType) { + case IAGnss::ApnIpType::IPV4: + bearerType = AGPS_APN_BEARER_IPV4; + break; + case IAGnss::ApnIpType::IPV6: + bearerType = AGPS_APN_BEARER_IPV6; + break; + case IAGnss::ApnIpType::IPV4V6: + bearerType = AGPS_APN_BEARER_IPV4V6; + break; + default: + bearerType = AGPS_APN_BEARER_IPV4; + break; + } + + mGnss->getGnssInterface()->agpsDataConnOpen( + LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType); + return true; +} + +Return AGnss::setServer(IAGnssCallback::AGnssType type, + const hidl_string& hostname, + int32_t port) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + if (type == IAGnssCallback::AGnssType::TYPE_SUPL) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL; + } else if (type == IAGnssCallback::AGnssType::TYPE_C2K) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K; + } else { + LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast(type)); + return false; + } + config.assistanceServer.hostName = strdup(hostname.c_str()); + config.assistanceServer.port = port; + return mGnss->updateConfiguration(config); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/AGnss.h b/android/1.0/AGnss.h new file mode 100644 index 00000000..cdd5931e --- /dev/null +++ b/android/1.0/AGnss.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H +#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IAGnss; +using ::android::hardware::gnss::V1_0::IAGnssCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct AGnss : public IAGnss { + + AGnss(Gnss* gnss); + ~AGnss(); + /* + * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. + * These declarations were generated from IAGnss.hal. + */ + Return setCallback(const sp& callback) override; + + Return dataConnClosed() override; + + Return dataConnFailed() override; + + Return dataConnOpen(const hidl_string& apn, + IAGnss::ApnIpType apnIpType) override; + + Return setServer(IAGnssCallback::AGnssType type, + const hidl_string& hostname, int32_t port) override; + + void statusIpV4Cb(AGnssExtStatusIpV4 status); + + /* Data call setup callback passed down to GNSS HAL implementation */ + static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); + + private: + Gnss* mGnss = nullptr; + sp mAGnssCbIface = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H diff --git a/android/1.0/AGnssRil.cpp b/android/1.0/AGnssRil.cpp new file mode 100644 index 00000000..f4b9849e --- /dev/null +++ b/android/1.0/AGnssRil.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc__AGnssRilInterface" + +#include +#include +#include +#include +#include +#include +#include +#include "Gnss.h" +#include "AGnssRil.h" +#include + +typedef void* (getLocationInterface)(); + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + + +AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) { + ENTRY_LOG_CALLFLOW(); +} + +AGnssRil::~AGnssRil() { + ENTRY_LOG_CALLFLOW(); +} + +Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { + ENTRY_LOG_CALLFLOW(); + + // for XTRA + if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { + int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + switch(type) + { + case IAGnssRil::NetworkType::MOBILE: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + break; + case IAGnssRil::NetworkType::WIFI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + break; + case IAGnssRil::NetworkType::MMS: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS; + break; + case IAGnssRil::NetworkType::SUPL: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL; + break; + case IAGnssRil::NetworkType::DUN: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN; + break; + case IAGnssRil::NetworkType::HIPRI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI; + break; + case IAGnssRil::NetworkType::WIMAX: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; + break; + default: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + break; + } + mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); + } + return true; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/AGnssRil.h b/android/1.0/AGnssRil.h new file mode 100644 index 00000000..7f18c571 --- /dev/null +++ b/android/1.0/AGnssRil.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ +#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IAGnssRil; +using ::android::hardware::gnss::V1_0::IAGnssRilCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +/* + * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface + * allows the GNSS chipset to request radio interface layer information from Android platform. + * Examples of such information are reference location, unique subscriber ID, phone number string + * and network availability changes. Also contains wrapper methods to allow methods from + * IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL. + */ +struct AGnssRil : public IAGnssRil { + AGnssRil(Gnss* gnss); + ~AGnssRil(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow. + * These declarations were generated from IAGnssRil.hal. + */ + Return setCallback(const sp& /*callback*/) override { + return Void(); + } + Return setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override { + return Void(); + } + Return setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override { + return false; + } + Return updateNetworkAvailability(bool /*available*/, + const hidl_string& /*apn*/) override { + return false; + } + Return updateNetworkState(bool connected, NetworkType type, bool roaming) override; + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk new file mode 100644 index 00000000..dc721db4 --- /dev/null +++ b/android/1.0/Android.mk @@ -0,0 +1,91 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := \ + AGnss.cpp \ + Gnss.cpp \ + GnssBatching.cpp \ + GnssGeofencing.cpp \ + GnssMeasurement.cpp \ + GnssNi.cpp \ + GnssConfiguration.cpp \ + GnssDebug.cpp \ + AGnssRil.cpp + +LOCAL_SRC_FILES += \ + location_api/LocationUtil.cpp \ + location_api/GnssAPIClient.cpp \ + location_api/GeofenceAPIClient.cpp \ + location_api/BatchingAPIClient.cpp \ + location_api/MeasurementAPIClient.cpp \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libcutils \ + libutils \ + android.hardware.gnss@1.0 \ + +LOCAL_SHARED_LIBRARIES += \ + libloc_core \ + libgps.utils \ + libdl \ + liblocation_api \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +BUILD_GNSS_HIDL_SERVICE := true +ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) +ifneq ($(LW_FEATURE_SET),true) +BUILD_GNSS_HIDL_SERVICE := false +endif # LW_FEATURE_SET +endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET + +ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc +LOCAL_SRC_FILES := \ + service.cpp \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libcutils \ + libdl \ + libbase \ + libutils \ + +LOCAL_SHARED_LIBRARIES += \ + libhwbinder \ + libhidlbase \ + libhidltransport \ + android.hardware.gnss@1.0 \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_EXECUTABLE) +endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp new file mode 100644 index 00000000..6e34f1e5 --- /dev/null +++ b/android/1.0/Gnss.cpp @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssInterface" + +#include +#include +#include +#include +#include "Gnss.h" +#include + +typedef void* (getLocationInterface)(); + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnss != nullptr) { + mGnss->stop(); + mGnss->cleanup(); + } +} + +Gnss::Gnss() { + ENTRY_LOG_CALLFLOW(); + // clear pending GnssConfig + memset(&mPendingConfig, 0, sizeof(GnssConfig)); + + mGnssDeathRecipient = new GnssDeathRecipient(this); +} + +Gnss::~Gnss() { + ENTRY_LOG_CALLFLOW(); + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +GnssAPIClient* Gnss::getApi() { + if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) { + mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); + if (mApi == nullptr) { + LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__); + return mApi; + } + + if (mPendingConfig.size == sizeof(GnssConfig)) { + // we have pending GnssConfig + mApi->gnssConfigurationUpdate(mPendingConfig); + // clear size to invalid mPendingConfig + mPendingConfig.size = 0; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + } + } + } + if (mApi == nullptr) { + LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__); + } + return mApi; +} + +GnssInterface* Gnss::getGnssInterface() { + static bool getGnssInterfaceFailed = false; + if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { + LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); + getLocationInterface* getter = NULL; + const char *error = NULL; + dlerror(); + void *handle = dlopen("libgnss.so", RTLD_NOW); + if (NULL == handle || (error = dlerror()) != NULL) { + LOC_LOGW("dlopen for libgnss.so failed, error = %s", error); + } else { + getter = (getLocationInterface*)dlsym(handle, "getGnssInterface"); + if ((error = dlerror()) != NULL) { + LOC_LOGW("dlsym for libgnss.so::getGnssInterface failed, error = %s", error); + getter = NULL; + } + } + + if (NULL == getter) { + getGnssInterfaceFailed = true; + } else { + mGnssInterface = (GnssInterface*)(*getter)(); + } + } + return mGnssInterface; +} + +Return Gnss::setCallback(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + } + mGnssCbIface = callback; + if (mGnssCbIface != nullptr) { + mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/); + } + + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->requestCapabilities(); + } + return true; +} + +Return Gnss::setGnssNiCb(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + mGnssNiCbIface = callback; + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + } + return true; +} + +Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->gnssConfigurationUpdate(gnssConfig); + } else if (gnssConfig.flags != 0) { + // api is not ready yet, update mPendingConfig with gnssConfig + mPendingConfig.size = sizeof(GnssConfig); + + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + mPendingConfig.gpsLock = gnssConfig.gpsLock; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + mPendingConfig.suplVersion = gnssConfig.suplVersion; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + mPendingConfig.assistanceServer.hostName = + strdup(gnssConfig.assistanceServer.hostName); + } + mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + mPendingConfig.lppProfile = gnssConfig.lppProfile; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT; + mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT; + mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + mPendingConfig.suplModeMask = gnssConfig.suplModeMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds; + } + } + return true; +} + +Return Gnss::start() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStart(); + } + return retVal; +} + +Return Gnss::stop() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStop(); + } + return retVal; +} + +Return Gnss::cleanup() { + ENTRY_LOG_CALLFLOW(); + + if (mApi != nullptr) { + mApi->gnssDisable(); + } + + return Void(); +} + +Return Gnss::injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); + return true; + } else { + return false; + } +} + +Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, + int32_t uncertaintyMs) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); + return true; + } else { + return false; + } +} + +Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->gnssDeleteAidingData(aidingDataFlags); + } + return Void(); +} + +Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs); + } + return retVal; +} + +Return> Gnss::getExtensionAGnss() { + ENTRY_LOG_CALLFLOW(); + mAGnssIface = new AGnss(this); + return mAGnssIface; +} + +Return> Gnss::getExtensionGnssNi() { + ENTRY_LOG_CALLFLOW(); + mGnssNi = new GnssNi(this); + return mGnssNi; +} + +Return> Gnss::getExtensionGnssMeasurement() { + ENTRY_LOG_CALLFLOW(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} + +Return> Gnss::getExtensionGnssConfiguration() { + ENTRY_LOG_CALLFLOW(); + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} + +Return> Gnss::getExtensionGnssGeofencing() { + ENTRY_LOG_CALLFLOW(); + mGnssGeofencingIface = new GnssGeofencing(); + return mGnssGeofencingIface; +} + +Return> Gnss::getExtensionGnssBatching() { + mGnssBatching = new GnssBatching(); + return mGnssBatching; +} + +Return> Gnss::getExtensionGnssDebug() { + ENTRY_LOG_CALLFLOW(); + mGnssDebug = new GnssDebug(this); + return mGnssDebug; +} + +Return> Gnss::getExtensionAGnssRil() { + mGnssRil = new AGnssRil(this); + return mGnssRil; +} + +IGnss* HIDL_FETCH_IGnss(const char* hal) { + ENTRY_LOG_CALLFLOW(); + IGnss* iface = nullptr; + iface = new Gnss(); + if (iface == nullptr) { + LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal); + } + return iface; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/Gnss.h b/android/1.0/Gnss.h new file mode 100644 index 00000000..c23b3370 --- /dev/null +++ b/android/1.0/Gnss.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; + +struct Gnss : public IGnss { + Gnss(); + ~Gnss(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnss follow. + * These declarations were generated from Gnss.hal. + */ + Return setCallback(const sp& callback) override; + Return start() override; + Return stop() override; + Return cleanup() override; + Return injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) override; + Return injectTime(int64_t timeMs, + int64_t timeReferenceMs, + int32_t uncertaintyMs) override; + Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override; + Return setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) override; + Return> getExtensionAGnss() override; + Return> getExtensionGnssNi() override; + Return> getExtensionGnssMeasurement() override; + Return> getExtensionGnssConfiguration() override; + Return> getExtensionGnssGeofencing() override; + Return> getExtensionGnssBatching() override; + + Return> getExtensionAGnssRil() override; + + inline Return> getExtensionGnssNavigationMessage() override { + return nullptr; + } + + inline Return> getExtensionXtra() override { + return nullptr; + } + + Return> getExtensionGnssDebug() override; + + // These methods are not part of the IGnss base class. + GnssAPIClient* getApi(); + Return setGnssNiCb(const sp& niCb); + Return updateConfiguration(GnssConfig& gnssConfig); + GnssInterface* getGnssInterface(); + + // Callback for ODCPI request + void odcpiRequestCb(const OdcpiRequestInfo& request); + + private: + struct GnssDeathRecipient : hidl_death_recipient { + GnssDeathRecipient(sp gnss) : mGnss(gnss) { + } + ~GnssDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnss; + }; + + private: + sp mGnssDeathRecipient = nullptr; + + sp mAGnssIface = nullptr; + sp mGnssNi = nullptr; + sp mGnssMeasurement = nullptr; + sp mGnssConfig = nullptr; + sp mGnssGeofencingIface = nullptr; + sp mGnssBatching = nullptr; + sp mGnssDebug = nullptr; + sp mGnssRil = nullptr; + + GnssAPIClient* mApi = nullptr; + sp mGnssCbIface = nullptr; + sp mGnssNiCbIface = nullptr; + GnssConfig mPendingConfig; + GnssInterface* mGnssInterface = nullptr; +}; + +extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H diff --git a/android/1.0/GnssBatching.cpp b/android/1.0/GnssBatching.cpp new file mode 100644 index 00000000..3e5a9f4a --- /dev/null +++ b/android/1.0/GnssBatching.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssBatchingInterface" + +#include +#include +#include "GnssBatching.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssBatching::GnssBatchingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssBatching != nullptr) { + mGnssBatching->stop(); + mGnssBatching->cleanup(); + } +} + +GnssBatching::GnssBatching() : mApi(nullptr) { + mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this); +} + +GnssBatching::~GnssBatching() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + + +// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. +Return GnssBatching::init(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__); + delete mApi; + mApi = nullptr; + } + + mApi = new BatchingAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + return false; + } + + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + mGnssBatchingCbIface = callback; + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/); + } + + return true; +} + +Return GnssBatching::getBatchSize() { + uint16_t ret = 0; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->getBatchSize(); + } + return ret; +} + +Return GnssBatching::start(const IGnssBatching::Options& options) { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->startSession(options); + } + return ret; +} + +Return GnssBatching::flush() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->flushBatchedLocations(); + } + return Void(); +} + +Return GnssBatching::stop() { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->stopSession(); + } + return ret; +} + +Return GnssBatching::cleanup() { + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/GnssBatching.h b/android/1.0/GnssBatching.h new file mode 100644 index 00000000..8fab8576 --- /dev/null +++ b/android/1.0/GnssBatching.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H + +#include +#include + + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hidl::base::V1_0::IBase; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +class BatchingAPIClient; +struct GnssBatching : public IGnssBatching { + GnssBatching(); + ~GnssBatching(); + + // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. + Return init(const sp& callback) override; + Return getBatchSize() override; + Return start(const IGnssBatching::Options& options ) override; + Return flush() override; + Return stop() override; + Return cleanup() override; + + private: + struct GnssBatchingDeathRecipient : hidl_death_recipient { + GnssBatchingDeathRecipient(sp gnssBatching) : + mGnssBatching(gnssBatching) { + } + ~GnssBatchingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssBatching; + }; + + private: + sp mGnssBatchingDeathRecipient = nullptr; + sp mGnssBatchingCbIface = nullptr; + BatchingAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H diff --git a/android/1.0/GnssConfiguration.cpp b/android/1.0/GnssConfiguration.cpp new file mode 100644 index 00000000..0b622494 --- /dev/null +++ b/android/1.0/GnssConfiguration.cpp @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssConfigurationInterface" + +#include +#include "Gnss.h" +#include "GnssConfiguration.h" +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::GnssConstellationType; + +GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { +} + +// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow. +Return GnssConfiguration::setSuplEs(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + config.suplEmergencyServices = (enabled ? + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES : + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplVersion(uint32_t version) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + switch (version) { + case 0x00020002: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; + break; + case 0x00020000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0; + break; + case 0x00010000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0; + break; + default: + LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplMode(uint8_t mode) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + switch (mode) { + case 0: + config.suplModeMask = 0; // STANDALONE ONLY + break; + case 1: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT; + break; + case 2: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT; + break; + case 3: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT; + break; + default: + LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setLppProfile(uint8_t lppProfile) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + switch (lppProfile) { + case 0: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; + break; + case 1: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE; + break; + case 2: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; + break; + case 3: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; + break; + default: + LOC_LOGE("%s]: invalid lppProfile: %d.", __FUNCTION__, lppProfile); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + + config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + if (protocol & (1<<0)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT; + } + if (protocol & (1<<1)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT; + } + if (protocol & (1<<2)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT; + } + if (protocol & (1<<3)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGpsLock(uint8_t lock) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + switch (lock) { + case 0: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + break; + case 1: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; + break; + case 2: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; + break; + case 3: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + break; + default: + LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + config.emergencyPdnForEmergencySupl = (enabled ? + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES : + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO); + + return mGnss->updateConfiguration(config); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/GnssConfiguration.h b/android/1.0/GnssConfiguration.h new file mode 100644 index 00000000..1629e06e --- /dev/null +++ b/android/1.0/GnssConfiguration.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ + + /* Copyright (C) 2016 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. + */ + + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssConfiguration; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* + * Interface for passing GNSS configuration info from platform to HAL. + */ +struct Gnss; +struct GnssConfiguration : public IGnssConfiguration { + GnssConfiguration(Gnss* gnss); + ~GnssConfiguration() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. + * These declarations were generated from IGnssConfiguration.hal. + */ + Return setSuplVersion(uint32_t version) override; + Return setSuplMode(uint8_t mode) override; + Return setSuplEs(bool enabled) override; + Return setLppProfile(uint8_t lppProfile) override; + Return setGlonassPositioningProtocol(uint8_t protocol) override; + Return setEmergencySuplPdn(bool enable) override; + Return setGpsLock(uint8_t lock) override; + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H diff --git a/android/1.0/GnssDebug.cpp b/android/1.0/GnssDebug.cpp new file mode 100644 index 00000000..ead72e17 --- /dev/null +++ b/android/1.0/GnssDebug.cpp @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssDebugInterface" + +#include +#include +#include "Gnss.h" +#include "GnssDebug.h" +#include "LocationUtil.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_vec; + +#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000) +#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000) +#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500) +#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) + +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm + +GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) +{ +} + +/* + * This methods requests position, time and satellite ephemeris debug information + * from the HAL. + * + * @return void +*/ +Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) +{ + LOC_LOGD("%s]: ", __func__); + + DebugData data = { }; + + if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){ + LOC_LOGE("GnssDebug - Null GNSS interface"); + _hidl_cb(data); + return Void(); + } + + // get debug report snapshot via hal interface + GnssDebugReport reports = { }; + mGnss->getGnssInterface()->getDebugReport(reports); + + // location block + if (reports.mLocation.mValid) { + data.position.valid = true; + data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; + data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; + data.position.altitudeMeters = reports.mLocation.mLocation.altitude; + + data.position.speedMetersPerSec = + (double)(reports.mLocation.mLocation.speed); + data.position.bearingDegrees = + (double)(reports.mLocation.mLocation.bearing); + data.position.horizontalAccuracyMeters = + (double)(reports.mLocation.mLocation.accuracy); + data.position.verticalAccuracyMeters = + reports.mLocation.verticalAccuracyMeters; + data.position.speedAccuracyMetersPerSecond = + reports.mLocation.speedAccuracyMetersPerSecond; + data.position.bearingAccuracyDegrees = + reports.mLocation.bearingAccuracyDegrees; + + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; + gettimeofday(&tv_now, NULL); + data.position.ageSeconds = + (tv_now.tv_sec - tv_report.tv_sec) + + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + } + else { + data.position.valid = false; + } + + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + + // time block + if (reports.mTime.mValid) { + data.time.timeEstimate = reports.mTime.timeEstimate; + data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; + data.time.frequencyUncertaintyNsPerSec = + reports.mTime.frequencyUncertaintyNsPerSec; + } + + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { + data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; + } + if (data.time.timeUncertaintyNs <= 0 || + data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + } + if (data.time.frequencyUncertaintyNsPerSec <= 0 || + data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { + data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC; + } + + // satellite data block + SatelliteData s = { }; + std::vector s_array = { }; + + for (uint32_t i=0; i +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssDebug; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* Interface for GNSS Debug support. */ +struct Gnss; +struct GnssDebug : public IGnssDebug { + GnssDebug(Gnss* gnss); + ~GnssDebug() {}; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. + * These declarations were generated from IGnssDebug.hal. + */ + Return getDebugData(getDebugData_cb _hidl_cb) override; + +private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H diff --git a/android/1.0/GnssGeofencing.cpp b/android/1.0/GnssGeofencing.cpp new file mode 100644 index 00000000..2a8ff88d --- /dev/null +++ b/android/1.0/GnssGeofencing.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "GnssHal_GnssGeofencing" + +#include +#include +#include "GnssGeofencing.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssGeofencing != nullptr) { + mGnssGeofencing->removeAllGeofences(); + } +} + +GnssGeofencing::GnssGeofencing() : mApi(nullptr) { + mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this); +} + +GnssGeofencing::~GnssGeofencing() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. +Return GnssGeofencing::setCallback(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__); + return Void(); + } + + mApi = new GeofenceAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + } + + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient); + } + mGnssGeofencingCbIface = callback; + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssGeofencing::addGeofence( + int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceAdd( + geofenceId, + latitudeDegrees, + longitudeDegrees, + radiusMeters, + static_cast(lastTransition), + monitorTransitions, + notificationResponsivenessMs, + unknownTimerMs); + } + return Void(); +} + +Return GnssGeofencing::pauseGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofencePause(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceResume(geofenceId, monitorTransitions); + } + return Void(); +} + +Return GnssGeofencing::removeGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceRemove(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::removeAllGeofences() { + if (mApi == nullptr) { + LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__); + } else { + mApi->geofenceRemoveAll(); + } + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/GnssGeofencing.h b/android/1.0/GnssGeofencing.h new file mode 100644 index 00000000..db5f9d29 --- /dev/null +++ b/android/1.0/GnssGeofencing.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::IGnssGeofencing; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class GeofenceAPIClient; +struct GnssGeofencing : public IGnssGeofencing { + GnssGeofencing(); + ~GnssGeofencing(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. + * These declarations were generated from IGnssGeofencing.hal. + */ + Return setCallback(const sp& callback) override; + Return addGeofence(int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) override; + + Return pauseGeofence(int32_t geofenceId) override; + Return resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override; + Return removeGeofence(int32_t geofenceId) override; + + private: + // This method is not part of the IGnss base class. + // It is called by GnssGeofencingDeathRecipient to remove all geofences added so far. + Return removeAllGeofences(); + + private: + struct GnssGeofencingDeathRecipient : hidl_death_recipient { + GnssGeofencingDeathRecipient(sp gnssGeofencing) : + mGnssGeofencing(gnssGeofencing) { + } + ~GnssGeofencingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssGeofencing; + }; + + private: + sp mGnssGeofencingDeathRecipient = nullptr; + sp mGnssGeofencingCbIface = nullptr; + GeofenceAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H diff --git a/android/1.0/GnssMeasurement.cpp b/android/1.0/GnssMeasurement.cpp new file mode 100644 index 00000000..1c65bd6d --- /dev/null +++ b/android/1.0/GnssMeasurement.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssMeasurementInterface" + +#include +#include +#include "GnssMeasurement.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssMeasurement != nullptr) { + mGnssMeasurement->close(); + } +} + +GnssMeasurement::GnssMeasurement() { + mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this); + mApi = new MeasurementAPIClient(); +} + +GnssMeasurement::~GnssMeasurement() { + if (mApi) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. + +Return GnssMeasurement::setCallback( + const sp& callback) { + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface = callback; + mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0); + + return mApi->measurementSetCallback(callback); + +} + +Return GnssMeasurement::close() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return Void(); + } + + if (mGnssMeasurementCbIface != nullptr) { + mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface = nullptr; + } + mApi->measurementClose(); + + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/GnssMeasurement.h b/android/1.0/GnssMeasurement.h new file mode 100644 index 00000000..4247dbf8 --- /dev/null +++ b/android/1.0/GnssMeasurement.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class MeasurementAPIClient; +struct GnssMeasurement : public IGnssMeasurement { + GnssMeasurement(); + ~GnssMeasurement(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. + * These declarations were generated from IGnssMeasurement.hal. + */ + Return setCallback( + const sp& callback) override; + Return close() override; + + private: + struct GnssMeasurementDeathRecipient : hidl_death_recipient { + GnssMeasurementDeathRecipient(sp gnssMeasurement) : + mGnssMeasurement(gnssMeasurement) { + } + ~GnssMeasurementDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssMeasurement; + }; + + private: + sp mGnssMeasurementDeathRecipient = nullptr; + sp mGnssMeasurementCbIface = nullptr; + MeasurementAPIClient* mApi; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H diff --git a/android/1.0/GnssNi.cpp b/android/1.0/GnssNi.cpp new file mode 100644 index 00000000..d06cc209 --- /dev/null +++ b/android/1.0/GnssNi.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssNiInterface" + +#include +#include "Gnss.h" +#include "GnssNi.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + // we do nothing here + // Gnss::GnssDeathRecipient will stop the session +} + +GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { + mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. +Return GnssNi::setCallback(const sp& callback) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + mGnss->setGnssNiCb(callback); + + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); + } + mGnssNiCbIface = callback; + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + GnssAPIClient* api = mGnss->getApi(); + if (api == nullptr) { + LOC_LOGE("%s]: api is nullptr", __FUNCTION__); + return Void(); + } + + api->gnssNiRespond(notifId, userResponse); + + return Void(); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/GnssNi.h b/android/1.0/GnssNi.h new file mode 100644 index 00000000..90f62d5f --- /dev/null +++ b/android/1.0/GnssNi.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssNi; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct GnssNi : public IGnssNi { + GnssNi(Gnss* gnss); + ~GnssNi() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. + * These declarations were generated from IGnssNi.hal. + */ + Return setCallback(const sp& callback) override; + Return respond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) override; + + private: + struct GnssNiDeathRecipient : hidl_death_recipient { + GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { + } + ~GnssNiDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssNi; + }; + + private: + sp mGnssNiDeathRecipient = nullptr; + sp mGnssNiCbIface = nullptr; + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H diff --git a/android/1.0/android.hardware.gnss@1.0-service-qti.rc b/android/1.0/android.hardware.gnss@1.0-service-qti.rc new file mode 100644 index 00000000..b5da6f97 --- /dev/null +++ b/android/1.0/android.hardware.gnss@1.0-service-qti.rc @@ -0,0 +1,4 @@ +service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti + class hal + user gps + group system gps radio diff --git a/android/1.0/location_api/BatchingAPIClient.cpp b/android/1.0/location_api/BatchingAPIClient.cpp new file mode 100644 index 00000000..264ab83b --- /dev/null +++ b/android/1.0/location_api/BatchingAPIClient.cpp @@ -0,0 +1,196 @@ +/* Copyright (c) 2017-2018, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_BatchingAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "BatchingAPIClient.h" + +#include "limits.h" + + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask); + +BatchingAPIClient::BatchingAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssBatchingCbIface(callback), + mDefaultId(UINT_MAX), + mLocationCapabilitiesMask(0) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + if (mGnssBatchingCbIface != nullptr) { + locationCallbacks.batchingCb = [this](size_t count, Location* location, + BatchingOptions batchOptions) { + onBatchingCb(count, location, batchOptions); + }; + } + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +BatchingAPIClient::~BatchingAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +int BatchingAPIClient::getBatchSize() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + return locAPIGetBatchSize(); +} + +int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int BatchingAPIClient::stopSession() +{ + LOC_LOGD("%s]: ", __FUNCTION__); + int retVal = -1; + if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +void BatchingAPIClient::getBatchedLocation(int last_n_locations) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations); + locAPIGetBatchedLocations(mDefaultId, last_n_locations); +} + +void BatchingAPIClient::flushBatchedLocations() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); +} + +void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; +} + +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, + BatchingOptions /*batchOptions*/) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); + if (mGnssBatchingCbIface != nullptr && count > 0) { + hidl_vec locationVec; + locationVec.resize(count); + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i]); + } + auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s", + __func__, r.description().c_str()); + } + } +} + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask) +{ + memset(&out, 0, sizeof(LocationOptions)); + out.size = sizeof(LocationOptions); + out.minInterval = (uint32_t)(in.periodNanos / 1000000L); + out.minDistance = 0; + out.mode = GNSS_SUPL_MODE_STANDALONE; + if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + out.mode = GNSS_SUPL_MODE_MSA; + if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + out.mode = GNSS_SUPL_MODE_MSB; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/location_api/BatchingAPIClient.h b/android/1.0/location_api/BatchingAPIClient.h new file mode 100644 index 00000000..5d64df3f --- /dev/null +++ b/android/1.0/location_api/BatchingAPIClient.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2017-2018, 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 BATCHING_API_CLINET_H +#define BATCHING_API_CLINET_H + +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +class BatchingAPIClient : public LocationAPIClientBase +{ +public: + BatchingAPIClient(const sp& callback); + ~BatchingAPIClient(); + int getBatchSize(); + int startSession(const V1_0::IGnssBatching::Options& options); + int updateSessionOptions(const V1_0::IGnssBatching::Options& options); + int stopSession(); + void getBatchedLocation(int last_n_locations); + void flushBatchedLocations(); + + inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; } + + // callbacks + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; + +private: + sp mGnssBatchingCbIface; + uint32_t mDefaultId; + LocationCapabilitiesMask mLocationCapabilitiesMask; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // BATCHING_API_CLINET_H diff --git a/android/1.0/location_api/GeofenceAPIClient.cpp b/android/1.0/location_api/GeofenceAPIClient.cpp new file mode 100644 index 00000000..774a0495 --- /dev/null +++ b/android/1.0/location_api/GeofenceAPIClient.cpp @@ -0,0 +1,275 @@ +/* Copyright (c) 2017-2018, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_GeofenceApiClient" + +#include +#include + +#include "LocationUtil.h" +#include "GeofenceAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +GeofenceAPIClient::GeofenceAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssGeofencingCbIface(callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + + locationCallbacks.geofenceBreachCb = nullptr; + if (mGnssGeofencingCbIface != nullptr) { + locationCallbacks.geofenceBreachCb = + [this](GeofenceBreachNotification geofenceBreachNotification) { + onGeofenceBreachCb(geofenceBreachNotification); + }; + + locationCallbacks.geofenceStatusCb = + [this](GeofenceStatusNotification geofenceStatusNotification) { + onGeofenceStatusCb(geofenceStatusNotification); + }; + } + + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms) +{ + LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__, + geofence_id, latitude, longitude, radius_meters, + last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms); + + GeofenceOption options; + memset(&options, 0, sizeof(GeofenceOption)); + options.size = sizeof(GeofenceOption); + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) + options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) + options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT; + options.responsiveness = notification_responsiveness_ms; + + GeofenceInfo data; + data.size = sizeof(GeofenceInfo); + data.latitude = latitude; + data.longitude = longitude; + data.radius = radius_meters; + + LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data); + if (LOCATION_ERROR_SUCCESS != err) { + onAddGeofencesCb(1, &err, &geofence_id); + } +} + +void GeofenceAPIClient::geofencePause(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); + locAPIPauseGeofences(1, &geofence_id); +} + +void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions); + GeofenceBreachTypeMask mask = 0; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) + mask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) + mask |= GEOFENCE_BREACH_EXIT_BIT; + locAPIResumeGeofences(1, &geofence_id, &mask); +} + +void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); + locAPIRemoveGeofences(1, &geofence_id); +} + +void GeofenceAPIClient::geofenceRemoveAll() +{ + LOC_LOGD("%s]", __FUNCTION__); + // TODO locAPIRemoveAllGeofences(); +} + +// callbacks +void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < geofenceBreachNotification.count; i++) { + GnssLocation gnssLocation; + convertGnssLocation(geofenceBreachNotification.location, gnssLocation); + + IGnssGeofenceCallback::GeofenceTransition transition; + if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER) + transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED; + else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT) + transition = IGnssGeofenceCallback::GeofenceTransition::EXITED; + else { + // continue with other breach if transition is + // nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED + continue; + } + + auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb( + geofenceBreachNotification.ids[i], gnssLocation, transition, + static_cast(geofenceBreachNotification.timestamp)); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available); + if (mGnssGeofencingCbIface != nullptr) { + IGnssGeofenceCallback::GeofenceAvailability status = + IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE; + if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) { + status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE; + } + GnssLocation gnssLocation; + memset(&gnssLocation, 0, sizeof(GnssLocation)); + auto r = mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_EXISTS) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS; + auto r = mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/location_api/GeofenceAPIClient.h b/android/1.0/location_api/GeofenceAPIClient.h new file mode 100644 index 00000000..dc99ddd1 --- /dev/null +++ b/android/1.0/location_api/GeofenceAPIClient.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2017-2018, 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 GEOFENCE_API_CLINET_H +#define GEOFENCE_API_CLINET_H + + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::sp; + +class GeofenceAPIClient : public LocationAPIClientBase +{ +public: + GeofenceAPIClient(const sp& callback); + virtual ~GeofenceAPIClient() = default; + + void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms); + void geofencePause(uint32_t geofence_id); + void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions); + void geofenceRemove(uint32_t geofence_id); + void geofenceRemoveAll(); + + // callbacks + void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final; + void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final; + void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + +private: + sp mGnssGeofencingCbIface; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // GEOFENCE_API_CLINET_H diff --git a/android/1.0/location_api/GnssAPIClient.cpp b/android/1.0/location_api/GnssAPIClient.cpp new file mode 100644 index 00000000..9edba93d --- /dev/null +++ b/android/1.0/location_api/GnssAPIClient.cpp @@ -0,0 +1,558 @@ +/* Copyright (c) 2017-2018, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_GnssAPIClient" +#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours + +#include +#include + +#include "LocationUtil.h" +#include "GnssAPIClient.h" +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnss; +using ::android::hardware::gnss::V1_0::IGnssCallback; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); + +GnssAPIClient::GnssAPIClient(const sp& gpsCb, + const sp& niCb) : + LocationAPIClientBase(), + mGnssCbIface(nullptr), + mGnssNiCbIface(nullptr), + mControlClient(new LocationAPIControlClient()), + mLocationCapabilitiesMask(0), + mLocationCapabilitiesCached(false) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + // set default LocationOptions. + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = 1000; + mTrackingOptions.minDistance = 0; + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; + + gnssUpdateCallbacks(gpsCb, niCb); +} + +GnssAPIClient::~GnssAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient) { + delete mControlClient; + mControlClient = nullptr; + } +} + +// for GpsInterface +void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + mMutex.lock(); + mGnssCbIface = gpsCb; + mGnssNiCbIface = niCb; + mMutex.unlock(); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.trackingCb = [this](Location location) { + onTrackingCb(location); + }; + } + + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + + locationCallbacks.gnssNiCb = nullptr; + loc_core::ContextBase* context = + loc_core::LocDualContext::getLocFgContext( + NULL, NULL, + loc_core::LocDualContext::mLocationHalName, false); + if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { + LOC_LOGD("Registering NI CB"); + locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { + onGnssNiCb(id, gnssNiNotification); + }; + } + + locationCallbacks.gnssSvCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { + onGnssSvCb(gnssSvNotification); + }; + } + + locationCallbacks.gnssNmeaCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { + onGnssNmeaCb(gnssNmeaNotification); + }; + } + + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +bool GnssAPIClient::gnssStart() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStartTracking(mTrackingOptions); + return retVal; +} + +bool GnssAPIClient::gnssStop() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStopTracking(); + return retVal; +} + +bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) +{ + LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__, + (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, + preferredTimeMs, (int)powerMode, timeBetweenMeasurement); + bool retVal = true; + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = minIntervalMs; + if (IGnss::GnssPositionMode::MS_ASSISTED == mode || + IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { + // We set a very large interval to simulate SINGLE mode. Once we report a fix, + // the caller should take the responsibility to stop the session. + // For MSA, we always treat it as SINGLE mode. + mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; + } + mTrackingOptions.minDistance = preferredAccuracyMeters; + if (mode == IGnss::GnssPositionMode::STANDALONE) + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; + else if (mode == IGnss::GnssPositionMode::MS_BASED) + mTrackingOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) + mTrackingOptions.mode = GNSS_SUPL_MODE_MSA; + else { + LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode); + retVal = false; + } + if (GNSS_POWER_MODE_INVALID != powerMode) { + mTrackingOptions.powerMode = powerMode; + mTrackingOptions.tbm = timeBetweenMeasurement; + } + locAPIUpdateTrackingOptions(mTrackingOptions); + return retVal; +} + +// for GpsNiInterface +void GnssAPIClient::gnssNiRespond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); + GnssNiResponse data; + switch (userResponse) { + case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT: + data = GNSS_NI_RESPONSE_ACCEPT; + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY: + data = GNSS_NI_RESPONSE_DENY; + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP: + data = GNSS_NI_RESPONSE_NO_RESPONSE; + break; + default: + data = GNSS_NI_RESPONSE_IGNORE; + break; + } + + locAPIGnssNiResponse(notifId, data); +} + +// these apis using LocationAPIControlClient +void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) +{ + LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags); + if (mControlClient == nullptr) { + return; + } + GnssAidingData data; + memset(&data, 0, sizeof (GnssAidingData)); + data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT | + GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT | + GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | + GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; + + if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) + data.deleteAll = true; + else { + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS) + data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC) + data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION) + data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME) + data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO) + data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC) + data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH) + data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR) + data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER) + data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA) + data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI) + data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO) + data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT; + } + mControlClient->locAPIGnssDeleteAidingData(data); +} + +void GnssAPIClient::gnssEnable(LocationTechnologyType techType) +{ + LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIEnable(techType); +} + +void GnssAPIClient::gnssDisable() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIDisable(); +} + +void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIGnssUpdateConfig(gnssConfig); +} + +void GnssAPIClient::requestCapabilities() { + // only send capablities if it's already cached, otherwise the first time LocationAPI + // is initialized, capabilities will be sent by LocationAPI + if (mLocationCapabilitiesCached) { + onCapabilitiesCb(mLocationCapabilitiesMask); + } +} + +// callbacks +void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; + mLocationCapabilitiesCached = true; + + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + uint32_t data = 0; + if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) + data |= IGnssCallback::Capabilities::SCHEDULING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) + data |= IGnssCallback::Capabilities::GEOFENCING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) + data |= IGnssCallback::Capabilities::MEASUREMENTS; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + data |= IGnssCallback::Capabilities::MSB; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + data |= IGnssCallback::Capabilities::MSA; + auto r = gnssCbIface->gnssSetCapabilitesCb(data); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", + __func__, r.description().c_str()); + } + } + if (gnssCbIface != nullptr) { + IGnssCallback::GnssSystemInfo gnssInfo; + if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || + capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) { + gnssInfo.yearOfHw = 2018; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { + gnssInfo.yearOfHw = 2017; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + gnssInfo.yearOfHw = 2016; + } else { + gnssInfo.yearOfHw = 2015; + } + LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); + auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onTrackingCb(Location location) +{ + LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + GnssLocation gnssLocation; + convertGnssLocation(location, gnssLocation); + auto r = gnssCbIface->gnssLocationCb(gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) +{ + LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id); + mMutex.lock(); + auto gnssNiCbIface(mGnssNiCbIface); + mMutex.unlock(); + + if (gnssNiCbIface == nullptr) { + LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__); + return; + } + + IGnssNiCallback::GnssNiNotification notificationGnss = {}; + + notificationGnss.notificationId = id; + + if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL; + else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL) + notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL; + + if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY; + if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY; + if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE; + + notificationGnss.timeoutSec = gnssNiNotification.timeout; + + if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE || + gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP; + + notificationGnss.requestorId = gnssNiNotification.requestor; + + notificationGnss.notificationMessage = gnssNiNotification.message; + + if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + gnssNiCbIface->niNotifyCb(notificationGnss); +} + +void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + IGnssCallback::GnssSvStatus svStatus; + convertGnssSvStatus(gnssSvNotification, svStatus); + auto r = gnssCbIface->gnssSvStatusCb(svStatus); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSvStatusCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) +{ + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + android::hardware::hidl_string nmeaString; + nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); + auto r = gnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, + gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); + } + } +} + +void GnssAPIClient::onStartTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onStopTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", + __func__, r.description().c_str()); + } + } +} + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out) +{ + memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); + out.numSvs = in.count; + if (out.numSvs > static_cast(V1_0::GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", + __FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT); + out.numSvs = static_cast(V1_0::GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.numSvs; i++) { + IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; + info.svid = in.gnssSvs[i].svId; + convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); + info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; + info.elevationDegrees = in.gnssSvs[i].elevation; + info.azimuthDegrees = in.gnssSvs[i].azimuth; + info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; + info.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/location_api/GnssAPIClient.h b/android/1.0/location_api/GnssAPIClient.h new file mode 100644 index 00000000..4e4b4a9b --- /dev/null +++ b/android/1.0/location_api/GnssAPIClient.h @@ -0,0 +1,109 @@ +/* Copyright (c) 2017-2018, 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 GNSS_API_CLINET_H +#define GNSS_API_CLINET_H + + +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::sp; + +class GnssAPIClient : public LocationAPIClientBase +{ +public: + GnssAPIClient(const sp& gpsCb, + const sp& niCb); + virtual ~GnssAPIClient(); + GnssAPIClient(const GnssAPIClient&) = delete; + GnssAPIClient& operator=(const GnssAPIClient&) = delete; + + // for GpsInterface + void gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb); + bool gnssStart(); + bool gnssStop(); + bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = 0); + + // for GpsNiInterface + void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse); + + // these apis using LocationAPIControlClient + void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags); + void gnssEnable(LocationTechnologyType techType); + void gnssDisable(); + void gnssConfigurationUpdate(const GnssConfig& gnssConfig); + + inline LocationCapabilitiesMask gnssGetCapabilities() const { + return mLocationCapabilitiesMask; + } + void requestCapabilities(); + + // callbacks we are interested in + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onTrackingCb(Location location) final; + void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final; + void onGnssSvCb(GnssSvNotification gnssSvNotification) final; + void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final; + + void onStartTrackingCb(LocationError error) final; + void onStopTrackingCb(LocationError error) final; + +private: + sp mGnssCbIface; + sp mGnssNiCbIface; + std::mutex mMutex; + LocationAPIControlClient* mControlClient; + LocationCapabilitiesMask mLocationCapabilitiesMask; + bool mLocationCapabilitiesCached; + TrackingOptions mTrackingOptions; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // GNSS_API_CLINET_H diff --git a/android/1.0/location_api/LocationUtil.cpp b/android/1.0/location_api/LocationUtil.cpp new file mode 100644 index 00000000..102593bc --- /dev/null +++ b/android/1.0/location_api/LocationUtil.cpp @@ -0,0 +1,206 @@ +/* Copyright (c) 2017-2018, 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 + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::V1_0::GnssConstellationType; +using ::android::hardware::gnss::V1_0::GnssLocationFlags; + +void convertGnssLocation(Location& in, GnssLocation& out) +{ + memset(&out, 0, sizeof(GnssLocation)); + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG; + out.latitudeDegrees = in.latitude; + out.longitudeDegrees = in.longitude; + } + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE; + out.altitudeMeters = in.altitude; + } + if (in.flags & LOCATION_HAS_SPEED_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED; + out.speedMetersPerSec = in.speed; + } + if (in.flags & LOCATION_HAS_BEARING_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING; + out.bearingDegrees = in.bearing; + } + if (in.flags & LOCATION_HAS_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY; + out.horizontalAccuracyMeters = in.accuracy; + } + if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; + out.verticalAccuracyMeters = in.verticalAccuracy; + } + if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; + out.speedAccuracyMetersPerSecond = in.speedAccuracy; + } + if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; + out.bearingAccuracyDegrees = in.bearingAccuracy; + } + + out.timestamp = static_cast(in.timestamp); +} + +void convertGnssLocation(const GnssLocation& in, Location& out) +{ + memset(&out, 0, sizeof(out)); + if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) { + out.flags |= LOCATION_HAS_LAT_LONG_BIT; + out.latitude = in.latitudeDegrees; + out.longitude = in.longitudeDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) { + out.flags |= LOCATION_HAS_ALTITUDE_BIT; + out.altitude = in.altitudeMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) { + out.flags |= LOCATION_HAS_SPEED_BIT; + out.speed = in.speedMetersPerSec; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) { + out.flags |= LOCATION_HAS_BEARING_BIT; + out.bearing = in.bearingDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) { + out.flags |= LOCATION_HAS_ACCURACY_BIT; + out.accuracy = in.horizontalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) { + out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; + out.verticalAccuracy = in.verticalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) { + out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT; + out.speedAccuracy = in.speedAccuracyMetersPerSecond; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) { + out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; + out.bearingAccuracy = in.bearingAccuracyDegrees; + } + + out.timestamp = static_cast(in.timestamp); +} + +void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) +{ + switch(in) { + case GNSS_SV_TYPE_GPS: + out = GnssConstellationType::GPS; + break; + case GNSS_SV_TYPE_SBAS: + out = GnssConstellationType::SBAS; + break; + case GNSS_SV_TYPE_GLONASS: + out = GnssConstellationType::GLONASS; + break; + case GNSS_SV_TYPE_QZSS: + out = GnssConstellationType::QZSS; + break; + case GNSS_SV_TYPE_BEIDOU: + out = GnssConstellationType::BEIDOU; + break; + case GNSS_SV_TYPE_GALILEO: + out = GnssConstellationType::GALILEO; + break; + case GNSS_SV_TYPE_UNKNOWN: + default: + out = GnssConstellationType::UNKNOWN; + break; + } +} + +void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out) +{ + switch(in) { + case GNSS_EPH_TYPE_EPHEMERIS: + out = GnssDebug::SatelliteEphemerisType::EPHEMERIS; + break; + case GNSS_EPH_TYPE_ALMANAC: + out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY; + break; + case GNSS_EPH_TYPE_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE; + break; + } +} + +void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out) +{ + switch(in) { + case GNSS_EPH_SOURCE_DEMODULATED: + out = GnssDebug::SatelliteEphemerisSource::DEMODULATED; + break; + case GNSS_EPH_SOURCE_SUPL_PROVIDED: + out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED; + break; + case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED: + out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED; + break; + case GNSS_EPH_SOURCE_LOCAL: + case GNSS_EPH_SOURCE_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisSource::OTHER; + break; + } +} + +void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out) +{ + switch(in) { + case GNSS_EPH_HEALTH_GOOD: + out = GnssDebug::SatelliteEphemerisHealth::GOOD; + break; + case GNSS_EPH_HEALTH_BAD: + out = GnssDebug::SatelliteEphemerisHealth::BAD; + break; + case GNSS_EPH_HEALTH_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN; + break; + } +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/location_api/LocationUtil.h b/android/1.0/location_api/LocationUtil.h new file mode 100644 index 00000000..9e0cd369 --- /dev/null +++ b/android/1.0/location_api/LocationUtil.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2017-2018, 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 LOCATION_UTIL_H +#define LOCATION_UTIL_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); +void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); +void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); +void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); +void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // LOCATION_UTIL_H diff --git a/android/1.0/location_api/MeasurementAPIClient.cpp b/android/1.0/location_api/MeasurementAPIClient.cpp new file mode 100644 index 00000000..73709e3a --- /dev/null +++ b/android/1.0/location_api/MeasurementAPIClient.cpp @@ -0,0 +1,276 @@ +/* Copyright (c) 2017-2018, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_MeasurementAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "MeasurementAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; + +static void convertGnssData(GnssMeasurementsNotification& in, + V1_0::IGnssMeasurementCallback::GnssData& out); +static void convertGnssMeasurement(GnssMeasurementsData& in, + V1_0::IGnssMeasurementCallback::GnssMeasurement& out); +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); + +MeasurementAPIClient::MeasurementAPIClient() : + mGnssMeasurementCbIface(nullptr), + mTracking(false) +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +MeasurementAPIClient::~MeasurementAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +// for GpsInterface +Return +MeasurementAPIClient::measurementSetCallback(const sp& callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + mMutex.lock(); + mGnssMeasurementCbIface = callback; + mMutex.unlock(); + + return startTracking(); +} + +Return +MeasurementAPIClient::startTracking() +{ + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + + locationCallbacks.gnssMeasurementsCb = nullptr; + if (mGnssMeasurementCbIface != nullptr) { + locationCallbacks.gnssMeasurementsCb = + [this](GnssMeasurementsNotification gnssMeasurementsNotification) { + onGnssMeasurementsCb(gnssMeasurementsNotification); + }; + } + + locAPISetCallbacks(locationCallbacks); + + TrackingOptions options = {}; + memset(&options, 0, sizeof(TrackingOptions)); + options.size = sizeof(TrackingOptions); + options.minInterval = 1000; + options.mode = GNSS_SUPL_MODE_STANDALONE; + + mTracking = true; + LOC_LOGD("%s]: start tracking session", __FUNCTION__); + locAPIStartTracking(options); + return IGnssMeasurement::GnssMeasurementStatus::SUCCESS; +} + +// for GpsMeasurementInterface +void MeasurementAPIClient::measurementClose() { + LOC_LOGD("%s]: ()", __FUNCTION__); + mTracking = false; + locAPIStopTracking(); +} + +// callbacks +void MeasurementAPIClient::onGnssMeasurementsCb( + GnssMeasurementsNotification gnssMeasurementsNotification) +{ + LOC_LOGD("%s]: (count: %zu active: %d)", + __FUNCTION__, gnssMeasurementsNotification.count, mTracking); + if (mTracking) { + mMutex.lock(); + sp gnssMeasurementCbIface = nullptr; + if (mGnssMeasurementCbIface != nullptr) { + gnssMeasurementCbIface = mGnssMeasurementCbIface; + } + mMutex.unlock(); + + if (gnssMeasurementCbIface != nullptr) { + V1_0::IGnssMeasurementCallback::GnssData gnssData; + convertGnssData(gnssMeasurementsNotification, gnssData); + auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from GnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +static void convertGnssMeasurement(GnssMeasurementsData& in, + V1_0::IGnssMeasurementCallback::GnssMeasurement& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement)); + if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL; + out.svid = in.svId; + convertGnssConstellationType(in.svType, out.constellation); + out.timeOffsetNs = in.timeOffsetNs; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC; + out.receivedSvTimeInNs = in.receivedSvTimeNs; + out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs; + out.cN0DbHz = in.carrierToNoiseDbHz; + out.pseudorangeRateMps = in.pseudorangeRateMps; + out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + out.accumulatedDeltaRangeM = in.adrMeters; + out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters; + out.carrierFrequencyHz = in.carrierFrequencyHz; + out.carrierCycles = in.carrierCycles; + out.carrierPhase = in.carrierPhase; + out.carrierPhaseUncertainty = in.carrierPhaseUncertainty; + uint8_t indicator = + static_cast(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN); + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT; + out.multipathIndicator = + static_cast(indicator); + out.snrDb = in.signalToNoiseRatioDb; + out.agcLevelDb = in.agcLevelDb; +} + +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock)); + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY; + out.leapSecond = in.leapSecond; + out.timeNs = in.timeNs; + out.timeUncertaintyNs = in.timeUncertaintyNs; + out.fullBiasNs = in.fullBiasNs; + out.biasNs = in.biasNs; + out.biasUncertaintyNs = in.biasUncertaintyNs; + out.driftNsps = in.driftNsps; + out.driftUncertaintyNsps = in.driftUncertaintyNsps; + out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount; +} + +static void convertGnssData(GnssMeasurementsNotification& in, + V1_0::IGnssMeasurementCallback::GnssData& out) +{ + out.measurementCount = in.count; + if (out.measurementCount > static_cast(V1_0::GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.", + __FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT); + out.measurementCount = static_cast(V1_0::GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.measurementCount; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i]); + } + convertGnssClock(in.clock, out.clock); +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/1.0/location_api/MeasurementAPIClient.h b/android/1.0/location_api/MeasurementAPIClient.h new file mode 100644 index 00000000..c357313a --- /dev/null +++ b/android/1.0/location_api/MeasurementAPIClient.h @@ -0,0 +1,77 @@ +/* Copyright (c) 2017-2018, 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 MEASUREMENT_API_CLINET_H +#define MEASUREMENT_API_CLINET_H + +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::sp; + +class MeasurementAPIClient : public LocationAPIClientBase +{ +public: + MeasurementAPIClient(); + virtual ~MeasurementAPIClient(); + MeasurementAPIClient(const MeasurementAPIClient&) = delete; + MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete; + + // for GpsMeasurementInterface + Return measurementSetCallback( + const sp& callback); + void measurementClose(); + Return startTracking(); + + // callbacks we are interested in + void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; + +private: + std::mutex mMutex; + sp mGnssMeasurementCbIface; + + bool mTracking; +}; + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // MEASUREMENT_API_CLINET_H diff --git a/android/1.0/service.cpp b/android/1.0/service.cpp new file mode 100644 index 00000000..6b0f6022 --- /dev/null +++ b/android/1.0/service.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "android.hardware.gnss@1.0-service-qti" + +#include +#include + +using android::hardware::gnss::V1_0::IGnss; +using android::hardware::defaultPassthroughServiceImplementation; + +int main() { + return defaultPassthroughServiceImplementation(); +} diff --git a/android/AGnss.cpp b/android/1.1/AGnss.cpp similarity index 100% rename from android/AGnss.cpp rename to android/1.1/AGnss.cpp diff --git a/android/AGnss.h b/android/1.1/AGnss.h similarity index 100% rename from android/AGnss.h rename to android/1.1/AGnss.h diff --git a/android/AGnssRil.cpp b/android/1.1/AGnssRil.cpp similarity index 100% rename from android/AGnssRil.cpp rename to android/1.1/AGnssRil.cpp diff --git a/android/AGnssRil.h b/android/1.1/AGnssRil.h similarity index 100% rename from android/AGnssRil.h rename to android/1.1/AGnssRil.h diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk new file mode 100644 index 00000000..4f1cdf25 --- /dev/null +++ b/android/1.1/Android.mk @@ -0,0 +1,93 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := \ + AGnss.cpp \ + Gnss.cpp \ + GnssBatching.cpp \ + GnssGeofencing.cpp \ + GnssMeasurement.cpp \ + GnssNi.cpp \ + GnssConfiguration.cpp \ + GnssDebug.cpp \ + AGnssRil.cpp + +LOCAL_SRC_FILES += \ + location_api/LocationUtil.cpp \ + location_api/GnssAPIClient.cpp \ + location_api/GeofenceAPIClient.cpp \ + location_api/BatchingAPIClient.cpp \ + location_api/MeasurementAPIClient.cpp \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libcutils \ + libutils \ + android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ + +LOCAL_SHARED_LIBRARIES += \ + libloc_core \ + libgps.utils \ + libdl \ + liblocation_api \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +BUILD_GNSS_HIDL_SERVICE := true +ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) +ifneq ($(LW_FEATURE_SET),true) +BUILD_GNSS_HIDL_SERVICE := false +endif # LW_FEATURE_SET +endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET + +ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.1-service-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc +LOCAL_SRC_FILES := \ + service.cpp \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libcutils \ + libdl \ + libbase \ + libutils \ + +LOCAL_SHARED_LIBRARIES += \ + libhwbinder \ + libhidlbase \ + libhidltransport \ + android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_EXECUTABLE) +endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/Gnss.cpp b/android/1.1/Gnss.cpp similarity index 100% rename from android/Gnss.cpp rename to android/1.1/Gnss.cpp diff --git a/android/Gnss.h b/android/1.1/Gnss.h similarity index 100% rename from android/Gnss.h rename to android/1.1/Gnss.h diff --git a/android/GnssBatching.cpp b/android/1.1/GnssBatching.cpp similarity index 100% rename from android/GnssBatching.cpp rename to android/1.1/GnssBatching.cpp diff --git a/android/GnssBatching.h b/android/1.1/GnssBatching.h similarity index 100% rename from android/GnssBatching.h rename to android/1.1/GnssBatching.h diff --git a/android/GnssConfiguration.cpp b/android/1.1/GnssConfiguration.cpp similarity index 100% rename from android/GnssConfiguration.cpp rename to android/1.1/GnssConfiguration.cpp diff --git a/android/GnssConfiguration.h b/android/1.1/GnssConfiguration.h similarity index 100% rename from android/GnssConfiguration.h rename to android/1.1/GnssConfiguration.h diff --git a/android/GnssDebug.cpp b/android/1.1/GnssDebug.cpp similarity index 100% rename from android/GnssDebug.cpp rename to android/1.1/GnssDebug.cpp diff --git a/android/GnssDebug.h b/android/1.1/GnssDebug.h similarity index 100% rename from android/GnssDebug.h rename to android/1.1/GnssDebug.h diff --git a/android/GnssGeofencing.cpp b/android/1.1/GnssGeofencing.cpp similarity index 100% rename from android/GnssGeofencing.cpp rename to android/1.1/GnssGeofencing.cpp diff --git a/android/GnssGeofencing.h b/android/1.1/GnssGeofencing.h similarity index 100% rename from android/GnssGeofencing.h rename to android/1.1/GnssGeofencing.h diff --git a/android/GnssMeasurement.cpp b/android/1.1/GnssMeasurement.cpp similarity index 100% rename from android/GnssMeasurement.cpp rename to android/1.1/GnssMeasurement.cpp diff --git a/android/GnssMeasurement.h b/android/1.1/GnssMeasurement.h similarity index 100% rename from android/GnssMeasurement.h rename to android/1.1/GnssMeasurement.h diff --git a/android/GnssNi.cpp b/android/1.1/GnssNi.cpp similarity index 100% rename from android/GnssNi.cpp rename to android/1.1/GnssNi.cpp diff --git a/android/GnssNi.h b/android/1.1/GnssNi.h similarity index 100% rename from android/GnssNi.h rename to android/1.1/GnssNi.h diff --git a/android/android.hardware.gnss@1.1-service-qti.rc b/android/1.1/android.hardware.gnss@1.1-service-qti.rc similarity index 100% rename from android/android.hardware.gnss@1.1-service-qti.rc rename to android/1.1/android.hardware.gnss@1.1-service-qti.rc diff --git a/android/location_api/BatchingAPIClient.cpp b/android/1.1/location_api/BatchingAPIClient.cpp similarity index 100% rename from android/location_api/BatchingAPIClient.cpp rename to android/1.1/location_api/BatchingAPIClient.cpp diff --git a/android/location_api/BatchingAPIClient.h b/android/1.1/location_api/BatchingAPIClient.h similarity index 100% rename from android/location_api/BatchingAPIClient.h rename to android/1.1/location_api/BatchingAPIClient.h diff --git a/android/location_api/GeofenceAPIClient.cpp b/android/1.1/location_api/GeofenceAPIClient.cpp similarity index 100% rename from android/location_api/GeofenceAPIClient.cpp rename to android/1.1/location_api/GeofenceAPIClient.cpp diff --git a/android/location_api/GeofenceAPIClient.h b/android/1.1/location_api/GeofenceAPIClient.h similarity index 100% rename from android/location_api/GeofenceAPIClient.h rename to android/1.1/location_api/GeofenceAPIClient.h diff --git a/android/location_api/GnssAPIClient.cpp b/android/1.1/location_api/GnssAPIClient.cpp similarity index 100% rename from android/location_api/GnssAPIClient.cpp rename to android/1.1/location_api/GnssAPIClient.cpp diff --git a/android/location_api/GnssAPIClient.h b/android/1.1/location_api/GnssAPIClient.h similarity index 100% rename from android/location_api/GnssAPIClient.h rename to android/1.1/location_api/GnssAPIClient.h diff --git a/android/location_api/LocationUtil.cpp b/android/1.1/location_api/LocationUtil.cpp similarity index 100% rename from android/location_api/LocationUtil.cpp rename to android/1.1/location_api/LocationUtil.cpp diff --git a/android/location_api/LocationUtil.h b/android/1.1/location_api/LocationUtil.h similarity index 100% rename from android/location_api/LocationUtil.h rename to android/1.1/location_api/LocationUtil.h diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/1.1/location_api/MeasurementAPIClient.cpp similarity index 100% rename from android/location_api/MeasurementAPIClient.cpp rename to android/1.1/location_api/MeasurementAPIClient.cpp diff --git a/android/location_api/MeasurementAPIClient.h b/android/1.1/location_api/MeasurementAPIClient.h similarity index 100% rename from android/location_api/MeasurementAPIClient.h rename to android/1.1/location_api/MeasurementAPIClient.h diff --git a/android/service.cpp b/android/1.1/service.cpp similarity index 100% rename from android/service.cpp rename to android/1.1/service.cpp diff --git a/android/Android.mk b/android/Android.mk index 4f1cdf25..11d5889d 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,93 +1,9 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) +ifeq ($(GNSS_HIDL_VERSION),1.1) +include $(LOCAL_PATH)/1.1/Android.mk +else +include $(LOCAL_PATH)/1.0/Android.mk +endif -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_SRC_FILES := \ - AGnss.cpp \ - Gnss.cpp \ - GnssBatching.cpp \ - GnssGeofencing.cpp \ - GnssMeasurement.cpp \ - GnssNi.cpp \ - GnssConfiguration.cpp \ - GnssDebug.cpp \ - AGnssRil.cpp - -LOCAL_SRC_FILES += \ - location_api/LocationUtil.cpp \ - location_api/GnssAPIClient.cpp \ - location_api/GeofenceAPIClient.cpp \ - location_api/BatchingAPIClient.cpp \ - location_api/MeasurementAPIClient.cpp \ - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/location_api -LOCAL_HEADER_LIBRARIES := \ - libgps.utils_headers \ - libloc_core_headers \ - libloc_pla_headers \ - liblocation_api_headers - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libhidlbase \ - libhidltransport \ - libhwbinder \ - libcutils \ - libutils \ - android.hardware.gnss@1.0 \ - android.hardware.gnss@1.1 \ - -LOCAL_SHARED_LIBRARIES += \ - libloc_core \ - libgps.utils \ - libdl \ - liblocation_api \ - -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -BUILD_GNSS_HIDL_SERVICE := true -ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) -ifneq ($(LW_FEATURE_SET),true) -BUILD_GNSS_HIDL_SERVICE := false -endif # LW_FEATURE_SET -endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET - -ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.1-service-qti -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc -LOCAL_SRC_FILES := \ - service.cpp \ - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/location_api -LOCAL_HEADER_LIBRARIES := \ - libgps.utils_headers \ - libloc_core_headers \ - libloc_pla_headers \ - liblocation_api_headers - - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils \ - libdl \ - libbase \ - libutils \ - -LOCAL_SHARED_LIBRARIES += \ - libhwbinder \ - libhidlbase \ - libhidltransport \ - android.hardware.gnss@1.0 \ - android.hardware.gnss@1.1 \ - -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_EXECUTABLE) -endif # BUILD_GNSS_HIDL_SERVICE +endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 943e2310..17c3b033 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -15,3 +15,34 @@ GNSS_CFLAGS := \ -Wno-error=tautological-compare \ -Wno-error=switch \ -Wno-error=date-time + +# GPS-HIDL +GNSS_HIDL_1_0_TARGET_LIST := msm8960 +GNSS_HIDL_1_0_TARGET_LIST += msm8974 +GNSS_HIDL_1_0_TARGET_LIST += msm8226 +GNSS_HIDL_1_0_TARGET_LIST += msm8610 +GNSS_HIDL_1_0_TARGET_LIST += apq8084 +GNSS_HIDL_1_0_TARGET_LIST += msm8916 +GNSS_HIDL_1_0_TARGET_LIST += msm8994 +GNSS_HIDL_1_0_TARGET_LIST += msm8909 +GNSS_HIDL_1_0_TARGET_LIST += msm8952 +GNSS_HIDL_1_0_TARGET_LIST += msm8992 +GNSS_HIDL_1_0_TARGET_LIST += msm8996 +GNSS_HIDL_1_0_TARGET_LIST += msm8937 +GNSS_HIDL_1_0_TARGET_LIST += msm8953 +GNSS_HIDL_1_0_TARGET_LIST += msm8998 +GNSS_HIDL_1_0_TARGET_LIST += apq8098_latv +GNSS_HIDL_1_0_TARGET_LIST += sdm710 +GNSS_HIDL_1_0_TARGET_LIST += qcs605 +GNSS_HIDL_1_0_TARGET_LIST += sdm845 +GNSS_HIDL_1_0_TARGET_LIST += sdm660 +GNSS_HIDL_1_1_TARGET_LIST := msmnile + + +ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) +GNSS_HIDL_VERSION = 1.0 +endif + +ifneq (,$(filter $(GNSS_HIDL_1_1_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) +GNSS_HIDL_VERSION = 1.1 +endif From 2ed4407e7c3e31801b55937008691a07908c4673 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Fri, 7 Sep 2018 14:32:15 +0530 Subject: [PATCH 752/945] gps: use common compilation flag for the same functionality modify the compilation flag to be in alignment with the location services library Change-Id: Ie65e6e803c50524c0913b1475edbf556a5b7f207 CRs-Fixed: 2299356 --- core/SystemStatusOsObserver.cpp | 2 +- core/SystemStatusOsObserver.h | 8 ++++---- core/observer/IFrameworkActionReq.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 8127e869..9c65aad6 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -448,7 +448,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } } -#ifdef USE_GLIB +#ifdef USE_QCMAP bool SystemStatusOsObserver::connectBackhaul() { bool result = false; diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index fd606063..87109762 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -84,7 +84,7 @@ public: mSystemStatus(systemstatus), mContext(msgTask, this), mAddress("SystemStatusOsObserver"), mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) -#ifdef USE_GLIB +#ifdef USE_QCMAP , mBackHaulConnectReqCount(0) #endif { @@ -106,7 +106,7 @@ public: // To set the framework action request object inline void setFrameworkActionReqObj(IFrameworkActionReq* frameworkActionReqObj) { mContext.mFrameworkActionReqObj = frameworkActionReqObj; -#ifdef USE_GLIB +#ifdef USE_QCMAP if (mBackHaulConnectReqCount > 0) { connectBackhaul(); mBackHaulConnectReqCount = 0; @@ -134,7 +134,7 @@ public: // IFrameworkActionReq Overrides virtual void turnOn(DataItemId dit, int timeOut = 0) override; virtual void turnOff(DataItemId dit) override; -#ifdef USE_GLIB +#ifdef USE_QCMAP virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif @@ -151,7 +151,7 @@ private: // Cache the subscribe and requestData till subscription obj is obtained void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); -#ifdef USE_GLIB +#ifdef USE_QCMAP // Cache the framework action request for connect/disconnect int mBackHaulConnectReqCount; #endif diff --git a/core/observer/IFrameworkActionReq.h b/core/observer/IFrameworkActionReq.h index 4be947ff..a4ccad8a 100644 --- a/core/observer/IFrameworkActionReq.h +++ b/core/observer/IFrameworkActionReq.h @@ -70,7 +70,7 @@ public: */ virtual void turnOff (DataItemId dit) = 0; -#ifdef USE_GLIB +#ifdef USE_QCMAP /** * @brief Setup WWAN backhaul * @details Setup WWAN backhaul From 935c00192ef480a3b5385d57ec496dda05c3962e Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 21 Sep 2018 14:52:32 -0700 Subject: [PATCH 753/945] Fix for vertical accuracy field missing on SDK APIs Field flag VERTICAL_ACCURACY_BIT changed definition internally in HAL, and was mapped 1 to 1 to LocHidlLocationFlagsBits. Fixed by adding a proper remapping function. Change-Id: Ida510c2b54568208ffa28e7c017f22a7f0e3f11c CRs-fixed: 2317059 --- utils/loc_gps.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/loc_gps.h b/utils/loc_gps.h index b905c53e..b58f20b0 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -102,6 +102,10 @@ typedef uint16_t LocGpsLocationFlags; #define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0040 /** LocGpsLocation has valid spoof mask */ #define LOC_GPS_LOCATION_HAS_SPOOF_MASK 0x0080 +/** LocGpsLocation has valid speed accuracy */ +#define LOC_GPS_LOCATION_HAS_SPEED_ACCURACY 0x0100 +/** LocGpsLocation has valid bearing accuracy */ +#define LOC_GPS_LOCATION_HAS_BEARING_ACCURACY 0x0200 /** Spoof mask in LocGpsLocation */ typedef uint32_t LocGpsSpoofMask; From 352ffcb3c5fe7ae430c43d882bc1965e787e71cb Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 14 Sep 2018 12:36:09 +0530 Subject: [PATCH 754/945] Pass Framework Action request object to HandleTurnOn msg task Currently Sys Status OS Observer object was being passed, due to which actual turn on functionality in Framework action request object was not being invoked. Implement equals for SystemStatus class for BT scan device data so that it is handled correctly in setIteminReport. Change-Id: Ie7f24a1eaf886a2402698489bfd1d0ddc34585cf CRs-Fixed: 2321041 --- core/SystemStatus.h | 16 ++++++++++++---- core/SystemStatusOsObserver.cpp | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index b2f4fb6a..94223223 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -713,8 +713,12 @@ public: BtDeviceScanDetailsDataItemBase() {} inline SystemStatusBtDeviceScanDetail(const BtDeviceScanDetailsDataItemBase& itemBase) : BtDeviceScanDetailsDataItemBase(itemBase) {} - inline bool equals(const SystemStatusBtDeviceScanDetail& /*peer*/) { - return true; + inline bool equals(const SystemStatusBtDeviceScanDetail& peer) { + return ((mApSrnRssi == peer.mApSrnRssi) && + (0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) && + (mApSrnTimestamp == peer.mApSrnTimestamp) && + (mRequestTimestamp == peer.mRequestTimestamp) && + (mReceiveTimestamp == peer.mReceiveTimestamp)); } }; @@ -726,8 +730,12 @@ public: BtLeDeviceScanDetailsDataItemBase() {} inline SystemStatusBtleDeviceScanDetail(const BtLeDeviceScanDetailsDataItemBase& itemBase) : BtLeDeviceScanDetailsDataItemBase(itemBase) {} - inline bool equals(const SystemStatusBtleDeviceScanDetail& /*peer*/) { - return true; + inline bool equals(const SystemStatusBtleDeviceScanDetail& peer) { + return ((mApSrnRssi == peer.mApSrnRssi) && + (0 == memcmp(mApSrnMacAddress, peer.mApSrnMacAddress, sizeof(mApSrnMacAddress))) && + (mApSrnTimestamp == peer.mApSrnTimestamp) && + (mRequestTimestamp == peer.mRequestTimestamp) && + (mReceiveTimestamp == peer.mReceiveTimestamp)); } }; diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 9c65aad6..20ef1ae8 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -405,7 +405,8 @@ void SystemStatusOsObserver::turnOn(DataItemId dit, int timeOut) DataItemId mDataItemId; int mTimeOut; }; - mContext.mMsgTask->sendMsg(new (nothrow) HandleTurnOnMsg(this, dit, timeOut)); + mContext.mMsgTask->sendMsg( + new (nothrow) HandleTurnOnMsg(mContext.mFrameworkActionReqObj, dit, timeOut)); } else { // Found in map, update reference count From 2bef34e8b2b6ffa021cc5544efab5dfdcc802ef3 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 11 Sep 2018 15:36:47 -0700 Subject: [PATCH 755/945] FR47184: tunc constrained and position assisted time estimator (1) Configure tunc constrained module on modem via gps.conf (2) Configure position assisted time estimator and inject DRE position with additional info to modem (3) Support get total energy consumption API by GNSS engine since device first bootup Change-Id: I1e73057df090c1d356c55a498f06eed45839ca8f CRs-fixed: 2276355 --- core/ContextBase.cpp | 13 ++++++ core/ContextBase.h | 4 ++ core/LocAdapterBase.cpp | 4 ++ core/LocAdapterBase.h | 1 + core/LocApiBase.cpp | 24 ++++++++++ core/LocApiBase.h | 11 +++++ etc/gps.conf | 36 +++++++++++++++ gnss/GnssAdapter.cpp | 82 ++++++++++++++++++++++++++++++++--- gnss/GnssAdapter.h | 11 +++++ gnss/location_gnss.cpp | 8 ++++ location/location_interface.h | 15 +++++++ 11 files changed, 203 insertions(+), 6 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index fa87c3ee..3d55e1ca 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -74,6 +74,10 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' }, {"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' }, {"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' }, + {"CONSTRAINED_TIME_UNCERTAINTY_ENABLED", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'}, + {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'}, + {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, + {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -156,6 +160,15 @@ void ContextBase::readConfig() /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ mGps_conf.AGPS_CONFIG_INJECT = 1; + /* default configuration value of constrained time uncertainty mode: + feature disabled, time uncertainty threshold defined by modem, + and unlimited power budget */ + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0; + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0; + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; + /* default configuration value of position assisted clock estimator mode */ + mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; + UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); diff --git a/core/ContextBase.h b/core/ContextBase.h index bdabf7bd..8a3d3000 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -67,6 +67,10 @@ typedef struct loc_gps_cfg_s uint32_t MODEM_TYPE; char MO_SUPL_HOST[LOC_MAX_PARAM_STRING]; uint32_t MO_SUPL_PORT; + uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENABLED; + double CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD; + uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET; + uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8197f4df..5a16b172 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -175,4 +175,8 @@ bool LocAdapterBase:: requestOdcpiEvent(OdcpiRequestInfo& /*request*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportGnssEngEnergyConsumedEvent(uint64_t /*energyConsumedSinceFirstBoot*/) +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 6b3e02ff..abbf3d6e 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -167,6 +167,7 @@ public: virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); + virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 7b52c828..99a089e2 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -362,6 +362,13 @@ void LocApiBase::requestOdcpi(OdcpiRequestInfo& request) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestOdcpiEvent(request)); } +void LocApiBase::reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssEngEnergyConsumedEvent( + energyConsumedSinceFirstBoot)); +} + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -539,6 +546,10 @@ void LocApiBase:: injectPosition(const Location& /*location*/, bool /*onDemandCpi*/) DEFAULT_IMPL() +void LocApiBase:: + injectPosition(const GnssLocationInfoNotification & /*locationInfo*/, bool /*onDemandCpi*/) +DEFAULT_IMPL() + void LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) DEFAULT_IMPL() @@ -676,4 +687,17 @@ DEFAULT_IMPL() void LocApiBase::resetConstellationControl() DEFAULT_IMPL() +LocationError LocApiBase:: + setConstrainedTuncMode(bool /*enabled*/, + float /*tuncConstraint*/, + uint32_t /*energyBudget*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +LocationError LocApiBase:: + setPositionAssistedClockEstimatorMode(bool /*enabled*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +LocationError LocApiBase:: + getGnssEnergyConsumed() +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index e80e2738..d4d337ad 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -183,6 +183,7 @@ public: void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); void requestOdcpi(OdcpiRequestInfo& request); + void reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); // downward calls // All below functions are to be defined by adapter specific modules: @@ -198,6 +199,10 @@ public: virtual void injectPosition(double latitude, double longitude, float accuracy); + + virtual void + injectPosition(const GnssLocationInfoNotification &locationInfo, bool onDemandCpi=false); + virtual void injectPosition(const Location& location, bool onDemandCpi); virtual void @@ -281,6 +286,12 @@ public: virtual void setConstellationControl(const GnssSvTypeConfig& config); virtual void getConstellationControl(); virtual void resetConstellationControl(); + + virtual LocationError setConstrainedTuncMode(bool enabled, + float tuncConstraint, + uint32_t energyBudget); + virtual LocationError setPositionAssistedClockEstimatorMode(bool enabled); + virtual LocationError getGnssEnergyConsumed(); }; typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, diff --git a/etc/gps.conf b/etc/gps.conf index 0a06cb59..957b6613 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -245,3 +245,39 @@ PROPAGATION_TIME_UNCERTAINTY = 1 # for the first modem in the list MODEM_TYPE = 1 +################################################## +# CONSTRAINED TIME UNCERTAINTY MODE +################################################## +# 0 : disabled (default) +# 1 : enabled +# This setting enables GPS engine to keep its time +# uncertainty below the specified constraint +#CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0 + +# If constrained time uncertainty mode is enabled, +# this setting specifies the time uncertainty +# threshold that gps engine need to maintain. +# In unit of milli-seconds. +# Default is 0.0 meaning that modem default value +# of time uncertainty threshold will be used. +#CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0 + +# If constrained time uncertainty mode is enabled, +# this setting specifies the power budget that +# gps engine is allowed to spend to maintain the time +# uncertainty. +# Default is 0 meaning that GPS engine is not constained +# by power budget and can spend as much power as needed. +# In unit of 0.1 milli watt second. +#CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0 + +################################################## +# POSITION ASSISTED CLOCK ESTIMATOR +################################################## +# 0 : disabled (default) +# 1 : enabled +# This setting enables GPS engine to estimate clock +# bias and drift when the signal from at least 1 +# SV is available and the UE’s position is known by +# other position engines. +#POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0 diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 78f39404..04ac1871 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -733,6 +733,14 @@ GnssAdapter::setConfigCommand() } adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + + adapter.mLocApi->setConstrainedTuncMode( + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, + (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); + adapter.mLocApi->setPositionAssistedClockEstimatorMode( + gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); + if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || @@ -2935,18 +2943,25 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, mGnssSvIdUsedInPosAvail = true; mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; } + + GnssLocationInfoNotification locationInfo = {}; + convertLocationInfo(locationInfo, locationExtended); + convertLocation(locationInfo.location, ulpLocation, locationExtended, techMask); + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { if (nullptr != it->second.gnssLocationInfoCb) { - GnssLocationInfoNotification locationInfo = {}; - convertLocationInfo(locationInfo, locationExtended); - convertLocation(locationInfo.location, ulpLocation, locationExtended, techMask); it->second.gnssLocationInfoCb(locationInfo); } else if (nullptr != it->second.trackingCb) { - Location location = {}; - convertLocation(location, ulpLocation, locationExtended, techMask); - it->second.trackingCb(location); + it->second.trackingCb(locationInfo.location); } } + + // if engine hub is running and the fix is from sensor, e.g.: DRE, + // inject DRE fix to modem + if ((1 == ContextBase::mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED) && + (true == initEngHubProxy()) && (LOC_POS_TECH_MASK_SENSORS & techMask)) { + mLocApi->injectPosition(locationInfo, false); + } } if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { @@ -3542,6 +3557,35 @@ void GnssAdapter::odcpiTimerExpire() } } +void +GnssAdapter::invokeGnssEnergyConsumedCallback(uint64_t energyConsumedSinceFirstBoot) { + if (mGnssEnergyConsumedCb) { + mGnssEnergyConsumedCb(energyConsumedSinceFirstBoot); + mGnssEnergyConsumedCb = nullptr; + } +} + +bool +GnssAdapter::reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot){ + LOC_LOGD("%s]: %" PRIu64 " ", __func__, energyConsumedSinceFirstBoot); + + struct MsgReportGnssGnssEngEnergyConsumed : public LocMsg { + GnssAdapter& mAdapter; + uint64_t mGnssEnergyConsumedSinceFirstBoot; + inline MsgReportGnssGnssEngEnergyConsumed(GnssAdapter& adapter, + uint64_t energyConsumed) : + LocMsg(), + mAdapter(adapter), + mGnssEnergyConsumedSinceFirstBoot(energyConsumed) {} + inline virtual void proc() const { + mAdapter.invokeGnssEnergyConsumedCallback(mGnssEnergyConsumedSinceFirstBoot); + } + }; + + sendMsg(new MsgReportGnssGnssEngEnergyConsumed(*this, energyConsumedSinceFirstBoot)); + return true; +} + void GnssAdapter::initDefaultAgps() { LOC_LOGD("%s]: ", __func__); @@ -4190,6 +4234,32 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD } } +void +GnssAdapter::saveGnssEnergyConsumedCallback(GnssEnergyConsumedCallback energyConsumedCb) { + mGnssEnergyConsumedCb = energyConsumedCb; +} + +void +GnssAdapter::getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsumedCb) { + struct MsgGetGnssEnergyConsumed : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + GnssEnergyConsumedCallback mEnergyConsumedCb; + inline MsgGetGnssEnergyConsumed(GnssAdapter& adapter, LocApiBase& api, + GnssEnergyConsumedCallback energyConsumedCb) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mEnergyConsumedCb(energyConsumedCb){} + inline virtual void proc() const { + mAdapter.saveGnssEnergyConsumedCallback(mEnergyConsumedCb); + mApi.getGnssEnergyConsumed(); + } + }; + + sendMsg(new MsgGetGnssEnergyConsumed(*this, *mLocApi, energyConsumedCb)); +} + /* ==== Eng Hub Proxy ================================================================= */ /* ======== UTILITIES ================================================================= */ void diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3f2afaab..b3288848 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -124,6 +124,10 @@ namespace loc_core { class SystemStatus; } +typedef std::function GnssEnergyConsumedCallback; + class GnssAdapter : public LocAdapterBase { /* ==== Engine Hub ===================================================================== */ @@ -172,6 +176,9 @@ class GnssAdapter : public LocAdapterBase { /* === Misc ===================================================================== */ BlockCPIInfo mBlockCPIInfo; + /* === Misc callback from QMI LOC API ============================================== */ + GnssEnergyConsumedCallback mGnssEnergyConsumedCb; + /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions); static void convertLocation(Location& out, const UlpLocation& ulpLocation, @@ -295,6 +302,7 @@ public: const char* apnName, int apnLen, AGpsBearerType bearerType); void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); + void getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsumedCb); /* ========= ODCPI ===================================================================== */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -334,6 +342,7 @@ public: virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); + virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); @@ -354,6 +363,8 @@ public: void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); void requestOdcpi(const OdcpiRequestInfo& request); + void invokeGnssEnergyConsumedCallback(uint64_t energyConsumedSinceFirstBoot); + void saveGnssEnergyConsumedCallback(GnssEnergyConsumedCallback energyConsumedCb); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 800ea1b9..5a7710a2 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -66,6 +66,7 @@ static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); static void updateConnectionStatus(bool connected, int8_t type); +static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb); static void odcpiInit(const OdcpiRequestCallback& callback); static void odcpiInject(const Location& location); @@ -105,6 +106,7 @@ static const GnssInterface gGnssInterface = { odcpiInit, odcpiInject, blockCPI, + getGnssEnergyConsumed }; #ifndef DEBUG_X86 @@ -337,4 +339,10 @@ static void blockCPI(double latitude, double longitude, float accuracy, gGnssAdapter->blockCPICommand(latitude, longitude, accuracy, blockDurationMsec, latLonDiffThreshold); } +} + +static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb) { + if (NULL != gGnssAdapter) { + gGnssAdapter->getGnssEnergyConsumedCommand(energyConsumedCb); + } } \ No newline at end of file diff --git a/location/location_interface.h b/location/location_interface.h index 359cb2be..e9e2fe89 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -32,6 +32,20 @@ #include #include +/* Used for callback to deliver GNSS energy consumed */ +/** @fn + @brief Used by query API that retrieves energy consumed by + modem GNSS engine. + + @param gnssEnergyConsumedFromFirstBoot: + Energy consumed by the GNSS engine since the first bootup + in units of 0.1 milli watt seconds. + A value of 0xffffffffffffffff indicates an invalid reading. +*/ +typedef std::function GnssEnergyConsumedCallback; + struct GnssInterface { size_t size; void (*initialize)(void); @@ -65,6 +79,7 @@ struct GnssInterface { void (*odcpiInject)(const Location& location); void (*blockCPI)(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); + void (*getGnssEnergyConsumed)(GnssEnergyConsumedCallback energyConsumedCb); }; struct FlpInterface { From 6700088d79e006afe49c124b556d3873f4174404 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 18 Sep 2018 17:32:16 -0700 Subject: [PATCH 756/945] Set SV in use mask based on final fixes Do not set SV in use mask based on intermediate position update from modem since it might contain stale information. Reset the flag indicating SV are used in fix for intermediate fixes. Change-Id: I10a324a160b20a6ced94c689acf9fc9d77f6e826 CRs-fixed: 2318041 --- gnss/GnssAdapter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 04ac1871..c6ed5874 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2938,6 +2938,7 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, LocPosTechMask techMask) { bool reported = needReport(ulpLocation, status, techMask); + mGnssSvIdUsedInPosAvail = false; if (reported) { if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { mGnssSvIdUsedInPosAvail = true; From b95f55fbeda91c5f5d9d6b84867c038fab0a73f8 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 1 Oct 2018 11:53:01 -0700 Subject: [PATCH 757/945] Add gnss hal 1.1 support for new target Support for gnss hal 1.1 on new target msmsteppe Change-Id: I0e078ba434d6bc1bc0040386c153c8420c028968 CRs-fixed: 2326090 --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 17c3b033..60c53bc6 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -37,6 +37,7 @@ GNSS_HIDL_1_0_TARGET_LIST += qcs605 GNSS_HIDL_1_0_TARGET_LIST += sdm845 GNSS_HIDL_1_0_TARGET_LIST += sdm660 GNSS_HIDL_1_1_TARGET_LIST := msmnile +GNSS_HIDL_1_1_TARGET_LIST += $(MSMSTEPPE) ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) From 5a8d17118152a87e3772deb204960c38a7810f1a Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 22 Aug 2018 09:45:25 -0700 Subject: [PATCH 758/945] New additions for Ephemeris and Poly handling 1. Add new data structures to hold the Ephemeris reports. 2. Modifications to SV Poly structure to include delete flags. 3. Add SV_POLY bit to GnssAidingDataSvMask to support delete commands from modem for poly and ephemeris per constellation. 4. Define LocApiBase and LocAdapter functions to report the ephemeris content, request for complete valid ephemeris and Poly content at any time and report delete commands from modem on Ephemeris and Poly content. CRs-Fixed: 2301149 Change-Id: If36e87c410c3204c94a6ed7db30f297edba95508 --- core/EngineHubProxyBase.h | 11 +- core/LocAdapterBase.cpp | 8 + core/LocAdapterBase.h | 2 + core/LocApiBase.cpp | 18 ++ core/LocApiBase.h | 3 + gnss/GnssAdapter.cpp | 44 +++- gnss/GnssAdapter.h | 2 + location/LocationDataTypes.h | 3 +- utils/gps_extended_c.h | 447 ++++++++++++++++++++++++++++++++++- 9 files changed, 529 insertions(+), 9 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index b159bd89..455c52ea 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -80,6 +80,11 @@ public: (void) svPolynomial; return false; } + + inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) { + (void) svEphemeris; + return false; + } }; typedef std::function GnssAdapterReportSvEventCb; +typedef std::function + GnssAdapterReqAidingDataCb; + // potential parameters: message queue: MsgTask * msgTask; // callback function to report back dr and ppe position and sv report typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, IOsObserver* osObserver, GnssAdapterReportPositionEventCb positionEventCb, - GnssAdapterReportSvEventCb svEventCb); + GnssAdapterReportSvEventCb svEventCb, + GnssAdapterReqAidingDataCb reqAidingDataCb); } // namespace loc_core diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5a16b172..42cf7aa8 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -107,6 +107,11 @@ void LocAdapterBase:: reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/) DEFAULT_IMPL() +void LocAdapterBase:: + reportSvEphemerisEvent(GnssSvEphemerisReport &/*svEphemeris*/) +DEFAULT_IMPL() + + void LocAdapterBase:: reportStatus(LocGpsStatusValue /*status*/) DEFAULT_IMPL() @@ -179,4 +184,7 @@ bool LocAdapterBase:: reportGnssEngEnergyConsumedEvent(uint64_t /*energyConsumedSinceFirstBoot*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportDeleteAidingDataEvent(GnssAidingData & /*aidingData*/) +DEFAULT_IMPL(false) } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index abbf3d6e..a934817d 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -147,6 +147,7 @@ public: virtual void reportNmeaEvent(const char* nmea, size_t length); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); + virtual void reportSvEphemerisEvent(GnssSvEphemerisReport &svEphemeris); virtual void reportStatus(LocGpsStatusValue status); virtual bool reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength); @@ -168,6 +169,7 @@ public: virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); + virtual bool reportDeleteAidingDataEvent(GnssAidingData &aidingData); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 99a089e2..b2642cac 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -369,6 +369,12 @@ void LocApiBase::reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFi energyConsumedSinceFirstBoot)); } +void LocApiBase::reportDeleteAidingDataEvent(GnssAidingData& aidingData) { + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDeleteAidingDataEvent(aidingData)); +} + + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -421,6 +427,14 @@ void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) ); } +void LocApiBase::reportSvEphemeris(GnssSvEphemerisReport & svEphemeris) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportSvEphemerisEvent(svEphemeris) + ); +} + void LocApiBase::reportStatus(LocGpsStatusValue status) { // loop through adapters, and deliver to all adapters. @@ -659,6 +673,10 @@ LocationError LocApiBase:: setGpsLockSync(GnssConfigGpsLock /*lock*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +void LocApiBase:: + requestForAidingData(GnssAidingDataSvMask /*svDataMask*/) +DEFAULT_IMPL() + void LocApiBase:: installAGpsCert(const LocDerEncodedCertificate* /*pData*/, size_t /*length*/, diff --git a/core/LocApiBase.h b/core/LocApiBase.h index d4d337ad..77c57d98 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -165,6 +165,7 @@ public: void reportSv(GnssSvNotification& svNotify); void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); void reportSvPolynomial(GnssSvPolynomial &svPolynomial); + void reportSvEphemeris(GnssSvEphemerisReport &svEphemeris); void reportStatus(LocGpsStatusValue status); void reportNmea(const char* nmea, int length); void reportData(GnssDataNotification& dataNotify, int msInWeek); @@ -184,6 +185,7 @@ public: void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); void requestOdcpi(OdcpiRequestInfo& request); void reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); + void reportDeleteAidingDataEvent(GnssAidingData& aidingData); // downward calls // All below functions are to be defined by adapter specific modules: @@ -276,6 +278,7 @@ public: void updateNmeaMask(uint32_t mask); virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); + virtual void requestForAidingData(GnssAidingDataSvMask svDataMask); virtual LocationError setXtraVersionCheckSync(uint32_t check); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 04ac1871..bf8dedc8 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1919,7 +1919,7 @@ GnssAdapter::updateClientsEventMask() } /* - ** For Automotive use cases we need to enable MEASUREMENT and POLY + ** For Automotive use cases we need to enable MEASUREMENT, POLY and EPHEMERIS ** when QDR is enabled (e.g.: either enabled via conf file or ** engine hub is loaded successfully). ** Note: this need to be called from msg queue thread. @@ -1929,8 +1929,10 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; + mask |= LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT; - LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIx64 "", __func__, mask); + LOC_LOGd("Auto usecase, Enable MEAS/POLY/EPHEMERIS - mask 0x%" PRIx64 "", + mask); } if (mAgpsCbInfo.statusV4Cb != NULL) { @@ -3402,6 +3404,14 @@ GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) mEngHubProxy->gnssReportSvPolynomial(svPolynomial); } +void +GnssAdapter::reportSvEphemerisEvent(GnssSvEphemerisReport & svEphemeris) +{ + LOC_LOGD("%s]:", __func__); + mEngHubProxy->gnssReportSvEphemeris(svEphemeris); +} + + bool GnssAdapter::requestOdcpiEvent(OdcpiRequestInfo& request) { @@ -3466,6 +3476,28 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request) } } +bool GnssAdapter::reportDeleteAidingDataEvent(GnssAidingData& aidingData) +{ + LOC_LOGD("%s]:", __func__); + + struct MsgHandleDeleteAidingDataEvent : public LocMsg { + GnssAdapter& mAdapter; + GnssAidingData mData; + inline MsgHandleDeleteAidingDataEvent(GnssAdapter& adapter, + GnssAidingData& data) : + LocMsg(), + mAdapter(adapter), + mData(data) {} + inline virtual void proc() const { + mAdapter.mEngHubProxy->gnssDeleteAidingData(mData); + } + }; + + sendMsg(new MsgHandleDeleteAidingDataEvent(*this, aidingData)); + return true; +} + + void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback) { struct MsgInitOdcpi : public LocMsg { @@ -4346,11 +4378,17 @@ GnssAdapter::initEngHubProxy() { reportSvEvent(svNotify, fromEngineHub); }; + // callback function for engine hub to request for complete aiding data + GnssAdapterReqAidingDataCb reqAidingDataCb = + [this] (const GnssAidingDataSvMask& svDataMask) { + mLocApi->requestForAidingData(svDataMask); + }; + getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); if(getter != nullptr) { EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(), reportPositionEventCb, - reportSvEventCb); + reportSvEventCb, reqAidingDataCb); if (hubProxy != nullptr) { mEngHubProxy = hubProxy; engHubLoadSuccessful = true; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b3288848..21ce787d 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -340,6 +340,7 @@ public: int msInWeek); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); + virtual void reportSvEphemerisEvent(GnssSvEphemerisReport & svEphemeris); virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); @@ -347,6 +348,7 @@ public: virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); + virtual bool reportDeleteAidingDataEvent(GnssAidingData& aidingData); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 9688b4ad..aae6dcf9 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -475,7 +475,8 @@ typedef enum { GNSS_AIDING_DATA_SV_NO_EXIST_BIT = (1<<8), // SV does not exist GNSS_AIDING_DATA_SV_IONOSPHERE_BIT = (1<<9), // ionosphere correction GNSS_AIDING_DATA_SV_TIME_BIT = (1<<10),// reset satellite time - GNSS_AIDING_DATA_SV_MB_DATA = (1 << 11),// delete multiband data + GNSS_AIDING_DATA_SV_MB_DATA = (1<<11),// delete multiband data + GNSS_AIDING_DATA_SV_POLY_BIT = (1<<12),// poly } GnssAidingDataSvBits; typedef uint32_t GnssAidingDataSvTypeMask; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 10605f78..146b2f4e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -96,6 +96,9 @@ typedef uint32_t LocSvInfoSource; /* TBM Threshold for tracking in background power mode : in millis */ #define TRACKING_TBM_THRESHOLD_MILLIS 480000 +/** Maximum number of satellites in an ephemeris report. */ +#define GNSS_EPHEMERIS_LIST_MAX_SIZE_V02 32 + typedef uint32_t LocPosTechMask; #define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000) #define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001) @@ -584,6 +587,16 @@ typedef uint16_t GnssMeasUsageInfoValidityMask; #define GNSS_CARRIER_PHASE_RESIDUAL_VALID ((GnssMeasUsageInfoValidityMask)0x00000004ul) #define GNSS_CARRIER_PHASE_AMBIGUITY_TYPE_VALID ((GnssMeasUsageInfoValidityMask)0x00000008ul) +typedef uint16_t GnssSvPolyStatusMask; +#define GNSS_SV_POLY_SRC_ALM_CORR_V02 ((GnssSvPolyStatusMask)0x01) +#define GNSS_SV_POLY_GLO_STR4_V02 ((GnssSvPolyStatusMask)0x02) +#define GNSS_SV_POLY_DELETE_V02 ((GnssSvPolyStatusMask)0x04) +typedef uint16_t GnssSvPolyStatusMaskValidity; +#define GNSS_SV_POLY_SRC_ALM_CORR_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x01) +#define GNSS_SV_POLY_GLO_STR4_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x02) +#define GNSS_SV_POLY_DELETE_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x04) + + typedef struct { /** Specifies GNSS signal type Mandatory Field*/ @@ -838,6 +851,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_FDCL_SERVICE_REQ, // FDCL service request LOC_API_ADAPTER_REPORT_UNPROPAGATED_POSITION, // Unpropagated Position report LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ, // BS observation data request + LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT, // GNSS SV Ephemeris Report LOC_API_ADAPTER_EVENT_MAX }; @@ -876,6 +890,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_FDCL_SERVICE_REQ (1ULL< Date: Sat, 29 Sep 2018 12:50:33 +0530 Subject: [PATCH 759/945] Handling network types not available in IAgnssRil enums Handling network types not available in IAgnssRil enums like Bluetooth, Ethernet, Proxy etc. Pass these network type info to framework, rather than sending the default TYPE_UNKNOWN. Change-Id: I7e997b82b07ca68d928bef322182031a2d47e532 CRs-Fixed: 2325210 --- android/1.0/AGnssRil.cpp | 23 ++++++++++++++++++++- android/1.1/AGnssRil.cpp | 23 ++++++++++++++++++++- core/data-items/DataItemConcreteTypesBase.h | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/android/1.0/AGnssRil.cpp b/android/1.0/AGnssRil.cpp index f4b9849e..0ab4fadd 100644 --- a/android/1.0/AGnssRil.cpp +++ b/android/1.0/AGnssRil.cpp @@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() { Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { ENTRY_LOG_CALLFLOW(); + // Extra NetworkTypes not available in IAgnssRil enums + const int NetworkType_BLUETOOTH = 7; + const int NetworkType_ETHERNET = 9; + const int NetworkType_PROXY = 16; // for XTRA if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { @@ -78,7 +82,24 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; break; default: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + { + int networkType = (int) type; + // Handling network types not available in IAgnssRil + switch(networkType) + { + case NetworkType_BLUETOOTH: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH; + break; + case NetworkType_ETHERNET: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET; + break; + case NetworkType_PROXY: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY; + break; + default: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + } + } break; } mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); diff --git a/android/1.1/AGnssRil.cpp b/android/1.1/AGnssRil.cpp index 10478aab..96e3597a 100644 --- a/android/1.1/AGnssRil.cpp +++ b/android/1.1/AGnssRil.cpp @@ -50,6 +50,10 @@ AGnssRil::~AGnssRil() { Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { ENTRY_LOG_CALLFLOW(); + // Extra NetworkTypes not available in IAgnssRil enums + const int NetworkType_BLUETOOTH = 7; + const int NetworkType_ETHERNET = 9; + const int NetworkType_PROXY = 16; // for XTRA if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { @@ -78,7 +82,24 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; break; default: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + { + int networkType = (int) type; + // Handling network types not available in IAgnssRil + switch(networkType) + { + case NetworkType_BLUETOOTH: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH; + break; + case NetworkType_ETHERNET: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET; + break; + case NetworkType_PROXY: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY; + break; + default: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + } + } break; } mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index bcb8d725..44be5f99 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -231,6 +231,7 @@ public: TYPE_DUN, TYPE_HIPRI, TYPE_WIMAX, + TYPE_PROXY, TYPE_UNKNOWN, }; NetworkInfoDataItemBase( From 5b53be1d9e037a197cdc56b65c73543c63051df1 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 2 Oct 2018 16:10:03 -0700 Subject: [PATCH 760/945] perf: Reduce NMEA traffic over client IPC Improve hal daemon performance by reducing number of NMEA callbacks on IPC. Position and sv NMEA sentences, generated during one TBF will be concatenated by hal and sent over one IPC, then client lib disassemble it into multiple sentences. Change-Id: I522e293d7e26fb8a25edb6ed931c4d69186223e8 CRs-Fixed: 2299008 --- android/1.0/location_api/GnssAPIClient.cpp | 21 ++++++++++++++------- android/1.1/location_api/GnssAPIClient.cpp | 21 ++++++++++++++------- gnss/GnssAdapter.cpp | 11 +++++++++-- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/android/1.0/location_api/GnssAPIClient.cpp b/android/1.0/location_api/GnssAPIClient.cpp index 9edba93d..d04939e3 100644 --- a/android/1.0/location_api/GnssAPIClient.cpp +++ b/android/1.0/location_api/GnssAPIClient.cpp @@ -469,13 +469,20 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) mMutex.unlock(); if (gnssCbIface != nullptr) { - android::hardware::hidl_string nmeaString; - nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); - auto r = gnssCbIface->gnssNmeaCb( - static_cast(gnssNmeaNotification.timestamp), nmeaString); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, - gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); + const std::string s(gnssNmeaNotification.nmea); + std::stringstream ss(s); + std::string each; + while(std::getline(ss, each, '\n')) { + each += '\n'; + android::hardware::hidl_string nmeaString; + nmeaString.setToExternal(each.c_str(), each.length()); + auto r = gnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, + gnssNmeaNotification.nmea, gnssNmeaNotification.length, + r.description().c_str()); + } } } } diff --git a/android/1.1/location_api/GnssAPIClient.cpp b/android/1.1/location_api/GnssAPIClient.cpp index cec51451..fcef4592 100644 --- a/android/1.1/location_api/GnssAPIClient.cpp +++ b/android/1.1/location_api/GnssAPIClient.cpp @@ -469,13 +469,20 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) mMutex.unlock(); if (gnssCbIface != nullptr) { - android::hardware::hidl_string nmeaString; - nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length); - auto r = gnssCbIface->gnssNmeaCb( - static_cast(gnssNmeaNotification.timestamp), nmeaString); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, - gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); + const std::string s(gnssNmeaNotification.nmea); + std::stringstream ss(s); + std::string each; + while(std::getline(ss, each, '\n')) { + each += '\n'; + android::hardware::hidl_string nmeaString; + nmeaString.setToExternal(each.c_str(), each.length()); + auto r = gnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, + gnssNmeaNotification.nmea, gnssNmeaNotification.length, + r.description().c_str()); + } } } } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 32e0833a..3d3c990d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -2976,9 +2977,12 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE && !blank_fix); std::vector nmeaArraystr; loc_nmea_generate_pos(ulpLocation, locationExtended, generate_nmea, nmeaArraystr); + stringstream ss; for (auto sentence : nmeaArraystr) { - reportNmea(sentence.c_str(), sentence.length()); + ss << sentence; } + string s = ss.str(); + reportNmea(s.c_str(), s.length()); } } @@ -3069,9 +3073,12 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { std::vector nmeaArraystr; loc_nmea_generate_sv(svNotify, nmeaArraystr); + stringstream ss; for (auto sentence : nmeaArraystr) { - reportNmea(sentence.c_str(), sentence.length()); + ss << sentence; } + string s = ss.str(); + reportNmea(s.c_str(), s.length()); } mGnssSvIdUsedInPosAvail = false; From 21b9c4e47ed5811f53d764c38943e3b971bde5e8 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Wed, 19 Sep 2018 10:59:28 -0700 Subject: [PATCH 761/945] FR48381: Support leap second change event Support leap second change event (1) Info will be available in location api and location client api (2) Engine hub aggregator will use the info to calculate UTC timestamp Change-Id: Ie79c1a38301fa094134a4a31af424487758343f6 CRs-fixed: 2289457 --- core/EngineHubProxyBase.h | 5 ++ core/LocAdapterBase.cpp | 4 ++ core/LocAdapterBase.h | 2 + core/LocApiBase.cpp | 6 +++ core/LocApiBase.h | 1 + gnss/GnssAdapter.cpp | 79 +++++++++++++++++++++++++++++++- gnss/GnssAdapter.h | 5 ++ location/LocationAPIClientBase.h | 2 + location/LocationDataTypes.h | 60 ++++++++++++++++++++++++ utils/gps_extended_c.h | 2 + 10 files changed, 165 insertions(+), 1 deletion(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 455c52ea..34af4d06 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -85,6 +85,11 @@ public: (void) svEphemeris; return false; } + + inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) { + (void) systemInfo; + return false; + } }; typedef std::functionreportLocationSystemInfoEvent(locationSystemInfo)); +} + void LocApiBase::requestXtraData() { // loop through adapters, and deliver to the first handling adapter. diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 77c57d98..e5dfebf9 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -171,6 +171,7 @@ public: void reportData(GnssDataNotification& dataNotify, int msInWeek); void reportXtraServer(const char* url1, const char* url2, const char* url3, const int maxlength); + void reportLocationSystemInfo(const LocationSystemInfo& locationSystemInfo); void requestXtraData(); void requestTime(); void requestLocation(); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 3d3c990d..b7c57e8a 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -87,7 +87,8 @@ GnssAdapter::GnssAdapter() : mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask), - mBlockCPIInfo{} + mBlockCPIInfo{}, + mLocSystemInfo{} { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -1848,6 +1849,8 @@ GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& call mClient(client), mCallbacks(callbacks) {} inline virtual void proc() const { + // check whether we need to notify client of cached location system info + mAdapter.notifyClientOfCachedLocationSystemInfo(mClient, mCallbacks); mAdapter.saveClient(mClient, mCallbacks); } }; @@ -1917,6 +1920,9 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; updateNmeaMask(mNmeaMask | LOC_NMEA_MASK_DEBUG_V02); } + if (it->second.locationSystemInfoCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; + } } /* @@ -1931,6 +1937,7 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT; + mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; LOC_LOGd("Auto usecase, Enable MEAS/POLY/EPHEMERIS - mask 0x%" PRIx64 "", mask); @@ -2106,6 +2113,35 @@ GnssAdapter::saveClient(LocationAPI* client, const LocationCallbacks& callbacks) updateClientsEventMask(); } +void +GnssAdapter::notifyClientOfCachedLocationSystemInfo( + LocationAPI* client, const LocationCallbacks& callbacks) { + + if (mLocSystemInfo.systemInfoMask) { + // client need to be notified if client has not yet previously registered + // for the info but now register for it. + bool notifyClientOfSystemInfo = false; + // check whether we need to notify client of cached location system info + // + // client need to be notified if client has not yet previously registered + // for the info but now register for it. + if (callbacks.locationSystemInfoCb) { + notifyClientOfSystemInfo = true; + auto it = mClientData.find(client); + if (it != mClientData.end()) { + LocationCallbacks oldCallbacks = it->second; + if (oldCallbacks.locationSystemInfoCb) { + notifyClientOfSystemInfo = false; + } + } + } + + if (notifyClientOfSystemInfo) { + callbacks.locationSystemInfoCb(mLocSystemInfo); + } + } +} + void GnssAdapter::eraseClient(LocationAPI* client) { @@ -3228,6 +3264,47 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* return true; } +void +GnssAdapter::reportLocationSystemInfoEvent(const LocationSystemInfo & locationSystemInfo) { + + // send system info to engine hub + mEngHubProxy->gnssReportSystemInfo(locationSystemInfo); + + struct MsgLocationSystemInfo : public LocMsg { + GnssAdapter& mAdapter; + LocationSystemInfo mSystemInfo; + inline MsgLocationSystemInfo(GnssAdapter& adapter, + const LocationSystemInfo& systemInfo) : + LocMsg(), + mAdapter(adapter), + mSystemInfo(systemInfo) {} + inline virtual void proc() const { + mAdapter.reportLocationSystemInfo(mSystemInfo); + } + }; + + sendMsg(new MsgLocationSystemInfo(*this, locationSystemInfo)); +} + +void +GnssAdapter::reportLocationSystemInfo(const LocationSystemInfo & locationSystemInfo) { + // save the info into the master copy piece by piece, as other system info + // may come at different time + if (locationSystemInfo.systemInfoMask & LOCATION_SYS_INFO_LEAP_SECOND) { + mLocSystemInfo.systemInfoMask |= LOCATION_SYS_INFO_LEAP_SECOND; + mLocSystemInfo.leapSecondSysInfo = locationSystemInfo.leapSecondSysInfo; + } + + // we received new info, inform client of the newly received info + if (locationSystemInfo.systemInfoMask) { + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (it->second.locationSystemInfoCb != nullptr) { + it->second.locationSystemInfoCb(locationSystemInfo); + } + } + } +} + static void* niThreadProc(void *args) { NiSession* pSession = (NiSession*)args; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 21ce787d..f382c6ad 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -172,6 +172,7 @@ class GnssAdapter : public LocAdapterBase { std::string mServerUrl; std::string mMoServerUrl; XtraSystemStatusObserver mXtraObserver; + LocationSystemInfo mLocSystemInfo; /* === Misc ===================================================================== */ BlockCPIInfo mBlockCPIInfo; @@ -210,6 +211,8 @@ public: /* ======== UTILITIES ================================================================== */ void saveClient(LocationAPI* client, const LocationCallbacks& callbacks); void eraseClient(LocationAPI* client); + void notifyClientOfCachedLocationSystemInfo(LocationAPI* client, + const LocationCallbacks& callbacks); void updateClientsEventMask(); void stopClientSessions(LocationAPI* client); LocationCallbacks getClientCallbacks(LocationAPI* client); @@ -344,6 +347,7 @@ public: virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); + virtual void reportLocationSystemInfoEvent(const LocationSystemInfo& locationSystemInfo); virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); @@ -367,6 +371,7 @@ public: void requestOdcpi(const OdcpiRequestInfo& request); void invokeGnssEnergyConsumedCallback(uint64_t energyConsumedSinceFirstBoot); void saveGnssEnergyConsumedCallback(GnssEnergyConsumedCallback energyConsumedCb); + void reportLocationSystemInfo(const LocationSystemInfo & locationSystemInfo); /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index c61e4a83..da87535a 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -281,6 +281,8 @@ public: inline virtual void onGnssNiCb(uint32_t /*id*/, GnssNiNotification /*gnssNiNotification*/) {} inline virtual void onGnssNiResponseCb(LocationError /*error*/) {} + inline virtual void onLocationSystemInfoCb(LocationSystemInfo /*locationSystemInfo*/) {} + private: // private inner classes typedef struct { diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index aae6dcf9..f35b2200 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1113,6 +1113,58 @@ typedef struct { std::vector mSatelliteInfo; } GnssDebugReport; +typedef uint32_t LeapSecondSysInfoMask; +typedef enum { + // current leap second info is available. This info will only + // be available if the leap second change info is not available. + // + // If leap second change info is avaiable, to figure out + // the current leap second info, compare current gps time with + // the gps timestamp of leap second change to know whether to choose + // leapSecondBefore or leapSecondAfter as current leap second. + LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT = (1ULL << 0), + // the last known leap change event is available. + // The info can be available on two scenario: + // 1: this leap second change event has been scheduled and yet to happen + // 2: this leap second change event has already happened and next + // leap second change event has not yet been scheduled. + LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT = (1ULL << 1), +} LeapSecondSysInfoDataBits; + +struct LeapSecondChangeInfo { + // GPS timestamp that corrresponds to the last known + // leap second change event. + // + // The info can be available on two scenario: + // 1: this leap second change event has been scheduled and yet to happen + // 2: this leap second change event has already happened and next + // leap second change event has not yet been scheduled. + GnssSystemTimeStructType gpsTimestampLsChange; + // Number of leap seconds prior to the leap second change event + // that corresponds to the timestamp at gpsTimestampLsChange. + uint8_t leapSecondsBeforeChange; + // Number of leap seconds after the leap second change event + // that corresponds to the timestamp at gpsTimestampLsChange. + uint8_t leapSecondsAfterChange; +}; + +struct LeapSecondSystemInfo { + LeapSecondSysInfoMask leapSecondInfoMask; + uint8_t leapSecondCurrent; + LeapSecondChangeInfo leapSecondChangeInfo; +}; + +typedef uint32_t LocationSystemInfoMask; +typedef enum { + // contains current leap second or leap second change info + LOCATION_SYS_INFO_LEAP_SECOND = (1ULL << 0), +} LocationSystemInfoDataBits; + +struct LocationSystemInfo { + LocationSystemInfoMask systemInfoMask; + LeapSecondSystemInfo leapSecondSysInfo; +}; + /* Provides the capabilities of the system capabilities callback is called once soon after createInstance is called */ typedef std::function gnssConfigCallback; +/* LocationSystemInfoCb is for receiving rare occuring location + system information update. optional, can be NULL. +*/ +typedef std::function locationSystemInfoCallback; + typedef struct { size_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory @@ -1231,6 +1290,7 @@ typedef struct { gnssDataCallback gnssDataCb; // optional gnssMeasurementsCallback gnssMeasurementsCb; // optional batchingStatusCallback batchingStatusCb; // optional + locationSystemInfoCallback locationSystemInfoCb; // optional } LocationCallbacks; #endif /* LOCATIONDATATYPES_H */ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 146b2f4e..8ddf488a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -852,6 +852,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_REPORT_UNPROPAGATED_POSITION, // Unpropagated Position report LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ, // BS observation data request LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT, // GNSS SV Ephemeris Report + LOC_API_ADAPTER_LOC_SYSTEM_INFO, // Location system info event LOC_API_ADAPTER_EVENT_MAX }; @@ -891,6 +892,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT (1ULL< Date: Wed, 24 Oct 2018 08:42:54 +0530 Subject: [PATCH 762/945] Fix issue with app side NMEA generation for GSV Handling the case when there is no signal type available as part of SV report. Change-Id: I7696f8f19b490506211c83d3d20659a69fffba66 CRs-Fixed: 2338206 --- utils/loc_nmea.cpp | 71 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 03a1ffdf..5ef4277a 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -531,8 +531,35 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, for (int i=0; (svNumber <= svNotify.count) && (i < 4); svNumber++) { - if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type && sv_meta_p->signalId == - convert_signalType_to_signalId(svNotify.gnssSvs[svNumber-1].gnssSignalTypeMask)) + GnssSignalTypeMask signalType = svNotify.gnssSvs[svNumber-1].gnssSignalTypeMask; + if (0 == signalType) { + // If no signal type in report, it means default L1,G1,E1,B1I + switch (svNotify.gnssSvs[svNumber - 1].type) + { + case GNSS_SV_TYPE_GPS: + signalType = GNSS_SIGNAL_GPS_L1CA; + break; + case GNSS_SV_TYPE_GLONASS: + signalType = GNSS_SIGNAL_GLONASS_G1; + break; + case GNSS_SV_TYPE_GALILEO: + signalType = GNSS_SIGNAL_GALILEO_E1; + break; + case GNSS_SV_TYPE_QZSS: + signalType = GNSS_SIGNAL_QZSS_L1CA; + break; + case GNSS_SV_TYPE_BEIDOU: + signalType = GNSS_SIGNAL_BEIDOU_B1I; + break; + default: + LOC_LOGE("NMEA Error unknow constellation type: %d", + svNotify.gnssSvs[svNumber - 1].type); + continue; + } + } + + if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type && + sv_meta_p->signalId == convert_signalType_to_signalId(signalType)) { length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", svNotify.gnssSvs[svNumber - 1].svId + svIdOffset, @@ -1148,10 +1175,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gps_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if (GNSS_SIGNAL_GPS_L1CA == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { - sv_cache_info.gps_l1_count++; - } else if (GNSS_SIGNAL_GPS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + if (GNSS_SIGNAL_GPS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { sv_cache_info.gps_l5_count++; + } else { + // GNSS_SIGNAL_GPS_L1CA or default + // If no signal type in report, it means default L1 + sv_cache_info.gps_l1_count++; } } else if (GNSS_SV_TYPE_GLONASS == svNotify.gnssSvs[svNumber - 1].type) @@ -1164,10 +1193,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.glo_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if (GNSS_SIGNAL_GLONASS_G1 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { - sv_cache_info.glo_g1_count++; - } else if (GNSS_SIGNAL_GLONASS_G2 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + if (GNSS_SIGNAL_GLONASS_G2 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.glo_g2_count++; + } else { + // GNSS_SIGNAL_GLONASS_G1 or default + // If no signal type in report, it means default G1 + sv_cache_info.glo_g1_count++; } } else if (GNSS_SV_TYPE_GALILEO == svNotify.gnssSvs[svNumber - 1].type) @@ -1180,10 +1211,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.gal_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if (GNSS_SIGNAL_GALILEO_E1 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { - sv_cache_info.gal_e1_count++; - } else if(GNSS_SIGNAL_GALILEO_E5A == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + if(GNSS_SIGNAL_GALILEO_E5A == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.gal_e5_count++; + } else { + // GNSS_SIGNAL_GALILEO_E1 or default + // If no signal type in report, it means default E1 + sv_cache_info.gal_e1_count++; } } else if (GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[svNumber - 1].type) @@ -1196,10 +1229,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.qzss_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if (GNSS_SIGNAL_QZSS_L1CA == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { - sv_cache_info.qzss_l1_count++; - } else if (GNSS_SIGNAL_QZSS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { + if (GNSS_SIGNAL_QZSS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { sv_cache_info.qzss_l5_count++; + } else { + // GNSS_SIGNAL_QZSS_L1CA or default + // If no signal type in report, it means default L1 + sv_cache_info.qzss_l1_count++; } } else if (GNSS_SV_TYPE_BEIDOU == svNotify.gnssSvs[svNumber - 1].type) @@ -1212,10 +1247,12 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.bds_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if (GNSS_SIGNAL_BEIDOU_B1I == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { - sv_cache_info.bds_b1_count++; - } else if(GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + if(GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.bds_b2_count++; + } else { + // GNSS_SIGNAL_BEIDOU_B1I or default + // If no signal type in report, it means default B1I + sv_cache_info.bds_b1_count++; } } } From f3b1394b15c26ec0a5dab6d0e8b48f92bfe23d97 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Wed, 24 Oct 2018 14:00:47 -0700 Subject: [PATCH 763/945] Add socket name in error log message Change-Id: I229ce4c5bfa54df26ff00d68377dfc91cf11f5f0 CRs-Fixed: 2338533 --- utils/LocIpc.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 675664a5..f7e163da 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -203,7 +203,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin if (length <= LOC_MSG_BUF_LEN) { if (::sendto(fd, data, length, 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + LOC_LOGe("cannot send to socket:%s. reason:%s", + addr.sun_path, strerror(errno)); result = false; } } else { @@ -211,7 +212,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin head.append(std::to_string(length)); if (::sendto(fd, head.c_str(), head.length(), 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + LOC_LOGe("cannot send to socket:%s. reason:%s", + addr.sun_path, strerror(errno)); result = false; } else { size_t sentBytes = 0; @@ -223,7 +225,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin ssize_t rv = ::sendto(fd, data + sentBytes, partLen, 0, (struct sockaddr*)&addr, sizeof(addr)); if (rv < 0) { - LOC_LOGe("cannot send to socket. reason:%s", strerror(errno)); + LOC_LOGe("cannot send to socket:%s. reason:%s", + addr.sun_path, strerror(errno)); result = false; break; } From 831ea96a2371635d0db834c03188eb7394f50459 Mon Sep 17 00:00:00 2001 From: Mohit Sharma Date: Thu, 25 Oct 2018 16:11:58 +0530 Subject: [PATCH 764/945] Initial Android target definition for trinket CRs-fixed: 2339147 Change-Id: I295f393ca721c92003f2dfd726861b63e4e1e977 --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 60c53bc6..0c0f7301 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -38,6 +38,7 @@ GNSS_HIDL_1_0_TARGET_LIST += sdm845 GNSS_HIDL_1_0_TARGET_LIST += sdm660 GNSS_HIDL_1_1_TARGET_LIST := msmnile GNSS_HIDL_1_1_TARGET_LIST += $(MSMSTEPPE) +GNSS_HIDL_1_1_TARGET_LIST += $(TRINKET) ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) From 84a25954a72d6120ab340a01b3c92f8a0f77920f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 31 Oct 2018 14:22:22 -0700 Subject: [PATCH 765/945] remove LOC_MODEM_EMULATOR from gps.utils Move LOC_MODEM_EMULATOR reading out of libgps.utils, as utils is being use by the whole world, and nobody but one cares about this valude. Change-Id: I95ad52222172c3f31e8013dd4d917713392e1a4d CRs-Fixed: 2343169 --- utils/loc_cfg.cpp | 13 ------------- utils/loc_cfg.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index af2ece68..71dfc665 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -57,14 +57,12 @@ /* Parameter data */ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; -static uint32_t LOC_MODEM_EMULATOR = 0; /* Parameter spec table */ static const loc_param_s_type loc_param_table[] = { {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, - {"LOC_MODEM_EMULATOR", &LOC_MODEM_EMULATOR, NULL, 'n'}, }; static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); @@ -87,17 +85,6 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; -/*=========================================================================== -FUNCTION loc_modem_emulator_enabled - -DESCRIPTION - Provides access to Modem Emulator config item. -===========================================================================*/ -uint32_t loc_modem_emulator_enabled() -{ - return LOC_MODEM_EMULATOR; -} - /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index 3057abc2..a8bdaede 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -133,8 +133,6 @@ extern const char LOC_PATH_QUIPC_CONF[]; int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, loc_process_info_s_type** process_info_table_ptr); -uint32_t loc_modem_emulator_enabled(); - #ifdef __cplusplus } #endif From 512388f80689620fae581302ce6d05111568951b Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Mon, 5 Nov 2018 14:52:13 +0530 Subject: [PATCH 766/945] gps: add include files for LA compilation add include files for LA compilation Change-Id: I2781337a7b5d50eaaada20bcf2a6bfb97095749d CRs-Fixed: 2344727 --- pla/android/loc_pla.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pla/android/loc_pla.h b/pla/android/loc_pla.h index 43a09067..6104bfb2 100644 --- a/pla/android/loc_pla.h +++ b/pla/android/loc_pla.h @@ -42,6 +42,8 @@ extern "C" { #include #include #include +#include +#include #define UID_GPS (AID_GPS) #define GID_GPS (AID_GPS) From d6b0854a7050ca571a6eeb3b0302e000c8857fb2 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 9 Nov 2018 14:15:28 -0800 Subject: [PATCH 767/945] Lowered the severity of debug message Lowered the severity of debug message when setting callback function for geofencing Change-Id: I2bbd0648d1dba5d7d655545bb0487223dbccb9cb CRs-fixed: 2347777 --- android/1.1/GnssGeofencing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/1.1/GnssGeofencing.cpp b/android/1.1/GnssGeofencing.cpp index 5c11afe0..d57a6667 100644 --- a/android/1.1/GnssGeofencing.cpp +++ b/android/1.1/GnssGeofencing.cpp @@ -53,7 +53,7 @@ GnssGeofencing::~GnssGeofencing() { // Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. Return GnssGeofencing::setCallback(const sp& callback) { if (mApi != nullptr) { - LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__); + LOC_LOGd("mApi is NOT nullptr"); return Void(); } From b00c1c26c9d7673c8bc84d7e8697958541912587 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 16 Nov 2018 11:49:40 +0530 Subject: [PATCH 768/945] Invoking dlclose in error case Invoking dlclose for loc_net_iface library dlopen call in error case. Change-Id: Ib8d4b05904214ebaa83608309679bc055bd7abe5 CRs-Fixed: 2347372 --- gnss/GnssAdapter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index b7c57e8a..fc59c224 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3716,6 +3716,7 @@ void GnssAdapter::initDefaultAgps() { dlsym(handle, "LocNetIfaceAgps_getAgpsCbInfo"); if (getAgpsCbInfo == nullptr) { LOC_LOGE("%s]: Failed to get method LocNetIfaceAgps_getStatusCb", __func__); + dlclose(handle); return; } @@ -3723,6 +3724,7 @@ void GnssAdapter::initDefaultAgps() { if (cbInfo.statusV4Cb == nullptr) { LOC_LOGE("%s]: statusV4Cb is nullptr!", __func__); + dlclose(handle); return; } From 06d7e5bbba73be1399450ae1c3c077f7c177bf9b Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 16 Nov 2018 17:58:35 +0530 Subject: [PATCH 769/945] Request for a data item value is not handle by SSO Subscribe for a data item first time adds the DI to internal SSO client list. When the request comes for after this, since item is already added, dataItemsToSubscribe will be empty. So the code for request value for DI is not invoked. Handle this scenario in SSO. Change-Id: Ife04fe4eedc9b3132e7967f781b0e29ac41c01e7 CRs-Fixed: 2347338 --- core/SystemStatusOsObserver.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 20ef1ae8..3fdb5130 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -97,6 +97,7 @@ void SystemStatusOsObserver::subscribe(const list& l, IDataItemObser list& l, IDataItemObserver* client, bool requestData) : mParent(parent), mClient(client), mDataItemSet(containerTransfer, unordered_set>(l)), + diItemlist(l), mToRequestData(requestData) {} void proc() const { @@ -107,16 +108,13 @@ void SystemStatusOsObserver::subscribe(const list& l, IDataItemObser mParent->sendCachedDataItems(mDataItemSet, mClient); // Send subscription set to framework - if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) { - LOC_LOGD("Subscribe Request sent to framework for the following"); - mParent->logMe(dataItemsToSubscribe); - + if (nullptr != mParent->mContext.mSubscriptionObj) { if (mToRequestData) { - mParent->mContext.mSubscriptionObj->requestData( - containerTransfer, list>( - std::move(dataItemsToSubscribe)), - mParent); - } else { + LOC_LOGD("Request Data sent to framework for the following"); + mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent); + } else if (!dataItemsToSubscribe.empty()) { + LOC_LOGD("Subscribe Request sent to framework for the following"); + mParent->logMe(dataItemsToSubscribe); mParent->mContext.mSubscriptionObj->subscribe( containerTransfer, list>( std::move(dataItemsToSubscribe)), @@ -127,6 +125,7 @@ void SystemStatusOsObserver::subscribe(const list& l, IDataItemObser mutable SystemStatusOsObserver* mParent; IDataItemObserver* mClient; const unordered_set mDataItemSet; + const list diItemlist; bool mToRequestData; }; From dca1724d17700135ee806027dec12a82b4940462 Mon Sep 17 00:00:00 2001 From: Ankur Sharma Date: Wed, 21 Nov 2018 22:41:09 +0530 Subject: [PATCH 770/945] Remove XTRA URLs from gps.conf Remove default URL's for XTRA from gps.conf CRs-Fixed:2355372 Change-Id: Iea1caa42e8cd4f84a0d37bb6bcd69655609d368d --- etc/gps.conf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 957b6613..2f2e5ca6 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -1,9 +1,3 @@ -#Uncommenting these urls would only enable -#the power up auto injection and force injection(test case). -#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin -#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin -#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin - #Version check for XTRA #DISABLE = 0 #AUTO = 1 From 730abcc3d4354badb431ec99ca10011b29d5eccd Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 19 Oct 2018 15:52:40 -0700 Subject: [PATCH 771/945] GPS NMEA: generate proper nmea during leap second transition During leap second transition, the hour, minute and seconds displayed need to be in the format of 23:59:60 to denote the extra leap second Change-Id: Ice7c6f934b1251990ba26e2b7e399554a2862eb4 CRs-fixed: 2335188 --- gnss/GnssAdapter.cpp | 26 ++++++++--- utils/loc_nmea.cpp | 100 ++++++++++++++++++++++++++++++++++++++++++- utils/loc_nmea.h | 1 + 3 files changed, 120 insertions(+), 7 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fc59c224..6b3e8463 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1920,9 +1920,6 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; updateNmeaMask(mNmeaMask | LOC_NMEA_MASK_DEBUG_V02); } - if (it->second.locationSystemInfoCb != nullptr) { - mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; - } } /* @@ -1952,6 +1949,9 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_REQUEST_WIFI; } + // need to register for leap second info + // for proper nmea generation + mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } @@ -3012,7 +3012,8 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, (LOC_RELIABILITY_NOT_SET == locationExtended.horizontal_reliability)); uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE && !blank_fix); std::vector nmeaArraystr; - loc_nmea_generate_pos(ulpLocation, locationExtended, generate_nmea, nmeaArraystr); + loc_nmea_generate_pos(ulpLocation, locationExtended, mLocSystemInfo, + generate_nmea, nmeaArraystr); stringstream ss; for (auto sentence : nmeaArraystr) { ss << sentence; @@ -3292,7 +3293,22 @@ GnssAdapter::reportLocationSystemInfo(const LocationSystemInfo & locationSystemI // may come at different time if (locationSystemInfo.systemInfoMask & LOCATION_SYS_INFO_LEAP_SECOND) { mLocSystemInfo.systemInfoMask |= LOCATION_SYS_INFO_LEAP_SECOND; - mLocSystemInfo.leapSecondSysInfo = locationSystemInfo.leapSecondSysInfo; + + const LeapSecondSystemInfo &srcLeapSecondSysInfo = locationSystemInfo.leapSecondSysInfo; + LeapSecondSystemInfo &dstLeapSecondSysInfo = mLocSystemInfo.leapSecondSysInfo; + if (srcLeapSecondSysInfo.leapSecondInfoMask & + LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT) { + dstLeapSecondSysInfo.leapSecondInfoMask |= + LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT; + dstLeapSecondSysInfo.leapSecondCurrent = srcLeapSecondSysInfo.leapSecondCurrent; + } + // once leap second change event is complete, modem may send up event invalidate the leap second + // change info while AP is still processing report during leap second transition + // so, we choose to keep this info around even though it is old + if (srcLeapSecondSysInfo.leapSecondInfoMask & LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT) { + dstLeapSecondSysInfo.leapSecondInfoMask |= LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT; + dstLeapSecondSysInfo.leapSecondChangeInfo = srcLeapSecondSysInfo.leapSecondChangeInfo; + } } // we received new info, inform client of the newly received info diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 5ef4277a..b4de6dba 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -36,6 +36,8 @@ #define GLONASS_SV_ID_OFFSET 64 #define MAX_SATELLITES_IN_USE 12 +#define MSEC_IN_ONE_WEEK 604800000ULL +#define UTC_GPS_OFFSET_MSECS 315964800000ULL // GNSS system id according to NMEA spec #define SYSTEM_ID_GPS 1 @@ -605,6 +607,79 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } //while } +/*=========================================================================== +FUNCTION getUtcTimeWithLeapSecondTransition + +DESCRIPTION + This function returns true if the position report is generated during + leap second transition period. If not, then the utc timestamp returned + will be set to the timestamp in the position report. If it is, + then the utc timestamp returned will need to take into account + of the leap second transition so that proper calendar year/month/date + can be calculated from the returned utc timestamp. + +DEPENDENCIES + NONE + +RETURN VALUE + true: position report is generated in leap second transition period. + +SIDE EFFECTS + N/A + +===========================================================================*/ +bool getUtcTimeWithLeapSecondTransition(const UlpLocation &location, + const GpsLocationExtended &locationExtended, + const LocationSystemInfo &systemInfo, + LocGpsUtcTime &utcPosTimestamp) { + bool inTransition = false; + + // position report is not generated during leap second transition, + // we can use the UTC timestamp from position report as is + utcPosTimestamp = location.gpsLocation.timestamp; + + // Check whether we are in leap second transition. + // If so, per NMEA spec, we need to display the extra second in format of 23:59:60 + // with year/month/date not getting advanced. + if ((locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GPS_TIME) && + ((systemInfo.systemInfoMask & LOCATION_SYS_INFO_LEAP_SECOND) && + (systemInfo.leapSecondSysInfo.leapSecondInfoMask & + LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT))) { + + const LeapSecondChangeInfo &leapSecondChangeInfo = + systemInfo.leapSecondSysInfo.leapSecondChangeInfo; + const GnssSystemTimeStructType &gpsTimestampLsChange = + leapSecondChangeInfo.gpsTimestampLsChange; + + uint64_t gpsTimeLsChange = gpsTimestampLsChange.systemWeek * MSEC_IN_ONE_WEEK + + gpsTimestampLsChange.systemMsec; + uint64_t gpsTimePosReport = locationExtended.gpsTime.gpsWeek * MSEC_IN_ONE_WEEK + + locationExtended.gpsTime.gpsTimeOfWeekMs; + // we are only dealing with positive leap second change, as negative + // leap second change has never occurred and should not occur in future + if (leapSecondChangeInfo.leapSecondsAfterChange > + leapSecondChangeInfo.leapSecondsBeforeChange) { + // leap second adjustment is always 1 second at a time. It can happen + // every quarter end and up to four times per year. + if ((gpsTimePosReport >= gpsTimeLsChange) && + (gpsTimePosReport < (gpsTimeLsChange + 1000))) { + inTransition = true; + utcPosTimestamp = gpsTimeLsChange + UTC_GPS_OFFSET_MSECS - + leapSecondChangeInfo.leapSecondsBeforeChange * 1000; + + // we substract 1000 milli-seconds from UTC timestmap in order to calculate the + // proper year, month and date during leap second transtion. + // Let us give an example, assuming leap second transition is scheduled on 2019, + // Dec 31st mid night. When leap second transition is happening, + // instead of outputting the time as 2020, Jan, 1st, 00 hour, 00 min, and 00 sec. + // The time need to be displayed as 2019, Dec, 31st, 23 hour, 59 min and 60 sec. + utcPosTimestamp -= 1000; + } + } + } + return inTransition; +} + /*=========================================================================== FUNCTION loc_nmea_generate_pos @@ -631,11 +706,19 @@ SIDE EFFECTS ===========================================================================*/ void loc_nmea_generate_pos(const UlpLocation &location, const GpsLocationExtended &locationExtended, + const LocationSystemInfo &systemInfo, unsigned char generate_nmea, std::vector &nmeaArraystr) { ENTRY_LOG(); - time_t utcTime(location.gpsLocation.timestamp/1000); + + LocGpsUtcTime utcPosTimestamp = 0; + bool inLsTransition = false; + + inLsTransition = getUtcTimeWithLeapSecondTransition + (location, locationExtended, systemInfo, utcPosTimestamp); + + time_t utcTime(utcPosTimestamp/1000); tm * pTm = gmtime(&utcTime); if (NULL == pTm) { LOC_LOGE("gmtime failed"); @@ -653,7 +736,19 @@ void loc_nmea_generate_pos(const UlpLocation &location, int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; int utcMSeconds = (location.gpsLocation.timestamp)%1000; - loc_sv_cache_info sv_cache_info = {}; + + if (inLsTransition) { + // During leap second transition, we need to display the extra + // leap second of hour, minute, second as (23:59:60) + utcHours = 23; + utcMinutes = 59; + utcSeconds = 60; + // As UTC timestamp is freezing during leap second transition, + // retrieve milli-seconds portion from GPS timestamp. + utcMSeconds = locationExtended.gpsTime.gpsTimeOfWeekMs % 1000; + } + + loc_sv_cache_info sv_cache_info = {}; if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { sv_cache_info.gps_used_mask = @@ -667,6 +762,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, sv_cache_info.bds_used_mask = (uint32_t)locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; } + if (generate_nmea) { char talker[3] = {'G', 'P', '\0'}; uint32_t svUsedCount = 0; diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h index 585a9c13..fbf88a74 100644 --- a/utils/loc_nmea.h +++ b/utils/loc_nmea.h @@ -40,6 +40,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, void loc_nmea_generate_pos(const UlpLocation &location, const GpsLocationExtended &locationExtended, + const LocationSystemInfo &systemInfo, unsigned char generate_nmea, std::vector &nmeaArraystr); From e232986d84deb7178d1a57cc7f1e4d24cbaeeb3c Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Thu, 15 Nov 2018 09:41:26 -0800 Subject: [PATCH 772/945] GPS location API: support destroy with callback for completion Support Location API destroy function with callback. Location API client that passes callback to Location API need to wait for the destroy complete callback to be invoked before releasing the memory that holds the callback Change-Id: I29b1c6d46feb79c789e6f1ec1500c941b022a3ac CRs-fixed: 2349398 --- gnss/GnssAdapter.cpp | 15 +++- gnss/GnssAdapter.h | 5 +- gnss/location_gnss.cpp | 8 +- location/LocationAPI.cpp | 148 ++++++++++++++++++++++++++++------ location/LocationAPI.h | 12 ++- location/LocationDataTypes.h | 3 + location/location_interface.h | 8 +- 7 files changed, 159 insertions(+), 40 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fc59c224..f7297d0e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1859,25 +1859,32 @@ GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& call } void -GnssAdapter::removeClientCommand(LocationAPI* client) +GnssAdapter::removeClientCommand(LocationAPI* client, + removeClientCompleteCallback rmClientCb) { LOC_LOGD("%s]: client %p", __func__, client); struct MsgRemoveClient : public LocMsg { GnssAdapter& mAdapter; LocationAPI* mClient; + removeClientCompleteCallback mRmClientCb; inline MsgRemoveClient(GnssAdapter& adapter, - LocationAPI* client) : + LocationAPI* client, + removeClientCompleteCallback rmCb) : LocMsg(), mAdapter(adapter), - mClient(client) {} + mClient(client), + mRmClientCb(rmCb){} inline virtual void proc() const { mAdapter.stopClientSessions(mClient); mAdapter.eraseClient(mClient); + if (nullptr != mRmClientCb) { + mRmClientCb(mClient); + } } }; - sendMsg(new MsgRemoveClient(*this, client)); + sendMsg(new MsgRemoveClient(*this, client, rmClientCb)); } void diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index f382c6ad..1682f027 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -128,6 +128,8 @@ typedef std::function GnssEnergyConsumedCallback; +typedef void (*removeClientCompleteCallback)(LocationAPI* client); + class GnssAdapter : public LocAdapterBase { /* ==== Engine Hub ===================================================================== */ @@ -206,7 +208,8 @@ public: /* ==== CLIENT ========================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); - void removeClientCommand(LocationAPI* client); + void removeClientCommand(LocationAPI* client, + removeClientCompleteCallback rmClientCb); void requestCapabilitiesCommand(LocationAPI* client); /* ======== UTILITIES ================================================================== */ void saveClient(LocationAPI* client, const LocationCallbacks& callbacks); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 5a7710a2..f9fbddc9 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -36,7 +36,7 @@ static void initialize(); static void deinitialize(); static void addClient(LocationAPI* client, const LocationCallbacks& callbacks); -static void removeClient(LocationAPI* client); +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb); static void requestCapabilities(LocationAPI* client); static uint32_t startTracking(LocationAPI* client, TrackingOptions&); @@ -140,10 +140,10 @@ static void addClient(LocationAPI* client, const LocationCallbacks& callbacks) } } -static void removeClient(LocationAPI* client) +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb) { if (NULL != gGnssAdapter) { - gGnssAdapter->removeClientCommand(client); + gGnssAdapter->removeClientCommand(client, rmClientCb); } } @@ -345,4 +345,4 @@ static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb) { if (NULL != gGnssAdapter) { gGnssAdapter->getGnssEnergyConsumedCommand(energyConsumedCb); } -} \ No newline at end of file +} diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 9a67f39e..4d859b30 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -36,15 +36,37 @@ #include typedef void* (getLocationInterface)(); + +typedef uint16_t LocationAdapterTypeMask; +typedef enum { + LOCATION_ADAPTER_GNSS_TYPE_BIT = (1<<0), // adapter type is GNSS + LOCATION_ADAPTER_FLP_TYPE_BIT = (1<<1), // adapter type is FLP + LOCATION_ADAPTER_GEOFENCE_TYPE_BIT = (1<<2) // adapter type is geo fence +} LocationAdapterTypeBits; + +typedef struct { + // bit mask of the adpaters that we need to wait for the removeClientCompleteCallback + // before we invoke the registered locationApiDestroyCompleteCallback + LocationAdapterTypeMask waitAdapterMask; + locationApiDestroyCompleteCallback destroyCompleteCb; +} LocationAPIDestroyCbData; + +// This is the map for the client that has requested destroy with +// destroy callback provided. +typedef std::map + LocationClientDestroyCbMap; + typedef std::map LocationClientMap; typedef struct { LocationClientMap clientData; + LocationClientDestroyCbMap destroyClientData; LocationControlAPI* controlAPI; LocationControlCallbacks controlCallbacks; GnssInterface* gnssInterface; GeofenceInterface* geofenceInterface; FlpInterface* flpInterface; } LocationAPIData; + static LocationAPIData gData = {}; static pthread_mutex_t gDataMutex = PTHREAD_MUTEX_INITIALIZER; static bool gGnssLoadFailed = false; @@ -80,7 +102,8 @@ static bool isGeofenceClient(LocationCallbacks& locationCallbacks) locationCallbacks.geofenceStatusCb != nullptr); } -static void* loadLocationInterface(const char* library, const char* name) { +static void* loadLocationInterface(const char* library, const char* name) +{ LOC_LOGD("%s]: loading %s::%s ...", __func__, library, name); if (NULL == library || NULL == name) { return NULL; @@ -106,6 +129,46 @@ static void* loadLocationInterface(const char* library, const char* name) { } } +void onRemoveClientCompleteCb ( + LocationAPI* client, LocationAdapterTypeMask adapterType) +{ + bool invokeCallback = false; + locationApiDestroyCompleteCallback destroyCompleteCb; + LOC_LOGd("adatper type %x", adapterType); + pthread_mutex_lock(&gDataMutex); + auto it = gData.destroyClientData.find(client); + if (it != gData.destroyClientData.end()) { + it->second.waitAdapterMask &= ~adapterType; + if (it->second.waitAdapterMask == 0) { + invokeCallback = true; + destroyCompleteCb = it->second.destroyCompleteCb; + gData.destroyClientData.erase(it); + } + } + pthread_mutex_unlock(&gDataMutex); + + if ((true == invokeCallback) && (nullptr != destroyCompleteCb)) { + LOC_LOGd("invoke client destroy cb"); + (destroyCompleteCb) (); + LOC_LOGd("finish invoke client destroy cb"); + } +} + +void onGnssRemoveClientCompleteCb (LocationAPI* client) +{ + onRemoveClientCompleteCb (client, LOCATION_ADAPTER_GNSS_TYPE_BIT); +} + +void onFlpRemoveClientCompleteCb (LocationAPI* client) +{ + onRemoveClientCompleteCb (client, LOCATION_ADAPTER_FLP_TYPE_BIT); +} + +void onGeofenceRemoveClientCompleteCb (LocationAPI* client) +{ + onRemoveClientCompleteCb (client, LOCATION_ADAPTER_GEOFENCE_TYPE_BIT); +} + LocationAPI* LocationAPI::createInstance(LocationCallbacks& locationCallbacks) { @@ -188,9 +251,66 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) } void -LocationAPI::destroy() +LocationAPI::destroy(locationApiDestroyCompleteCallback destroyCompleteCb) { - delete this; + bool invokeDestroyCb = false; + + pthread_mutex_lock(&gDataMutex); + auto it = gData.clientData.find(this); + if (it != gData.clientData.end()) { + bool removeFromGnssInf = + (isGnssClient(it->second) && NULL != gData.gnssInterface); + bool removeFromFlpInf = + (isFlpClient(it->second) && NULL != gData.flpInterface); + bool removeFromGeofenceInf = + (isGeofenceClient(it->second) && NULL != gData.geofenceInterface); + bool needToWait = (removeFromGnssInf || removeFromFlpInf || removeFromGeofenceInf); + LOC_LOGe("removeFromGnssInf: %d, removeFromFlpInf: %d, removeFromGeofenceInf: %d, need %d", + removeFromGnssInf, removeFromFlpInf, removeFromGeofenceInf, needToWait); + + if ((NULL != destroyCompleteCb) && (true == needToWait)) { + LocationAPIDestroyCbData destroyCbData = {}; + destroyCbData.destroyCompleteCb = destroyCompleteCb; + // record down from which adapter we need to wait for the destroy complete callback + // only when we have received all the needed callbacks from all the associated stacks, + // we shall notify the client. + destroyCbData.waitAdapterMask = + (removeFromGnssInf ? LOCATION_ADAPTER_GNSS_TYPE_BIT : 0); + destroyCbData.waitAdapterMask |= + (removeFromFlpInf ? LOCATION_ADAPTER_FLP_TYPE_BIT : 0); + destroyCbData.waitAdapterMask |= + (removeFromGeofenceInf ? LOCATION_ADAPTER_GEOFENCE_TYPE_BIT : 0); + gData.destroyClientData[this] = destroyCbData; + LOC_LOGe("destroy data stored in the map: 0x%x", destroyCbData.waitAdapterMask); + } + + if (removeFromGnssInf) { + gData.gnssInterface->removeClient(it->first, + onGnssRemoveClientCompleteCb); + } + if (removeFromFlpInf) { + gData.flpInterface->removeClient(it->first, + onFlpRemoveClientCompleteCb); + } + if (removeFromGeofenceInf) { + gData.geofenceInterface->removeClient(it->first, + onGeofenceRemoveClientCompleteCb); + } + + gData.clientData.erase(it); + + if ((NULL != destroyCompleteCb) && (false == needToWait)) { + invokeDestroyCb = true; + } + } else { + LOC_LOGE("%s:%d]: Location API client %p not found in client data", + __func__, __LINE__, this); + } + + pthread_mutex_unlock(&gDataMutex); + if (invokeDestroyCb == true) { + (destroyCompleteCb) (); + } } LocationAPI::LocationAPI() @@ -198,29 +318,9 @@ LocationAPI::LocationAPI() LOC_LOGD("LOCATION API CONSTRUCTOR"); } +// private destructor LocationAPI::~LocationAPI() { - LOC_LOGD("LOCATION API DESTRUCTOR"); - pthread_mutex_lock(&gDataMutex); - - auto it = gData.clientData.find(this); - if (it != gData.clientData.end()) { - if (isGnssClient(it->second) && NULL != gData.gnssInterface) { - gData.gnssInterface->removeClient(it->first); - } - if (isFlpClient(it->second) && NULL != gData.flpInterface) { - gData.flpInterface->removeClient(it->first); - } - if (isGeofenceClient(it->second) && NULL != gData.geofenceInterface) { - gData.geofenceInterface->removeClient(it->first); - } - gData.clientData.erase(it); - } else { - LOC_LOGE("%s:%d]: Location API client %p not found in client data", - __func__, __LINE__, this); - } - - pthread_mutex_unlock(&gDataMutex); } void diff --git a/location/LocationAPI.h b/location/LocationAPI.h index f4f31f96..c270ef41 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -43,10 +43,14 @@ public: of instances have been reached */ static LocationAPI* createInstance(LocationCallbacks&); - /* destroy/cleans up the instance, which should be called when LocationAPI object is - no longer needed. LocationAPI* returned from createInstance will no longer valid - after destroy is called */ - void destroy(); + /* destroy/cleans up the instance, which should be called when LocationControlAPI object is + no longer needed. LocationControlAPI* returned from createInstance will no longer valid + after destroy is called. + If the caller allocates the memory for LocationControlCallbacks used in + LocationControlAPI::createInstance, then the caller must ensure that the memory still remains + valid until destroyCompleteCb is invoked. + */ + void destroy(locationApiDestroyCompleteCallback destroyCompleteCb=nullptr); /* updates/changes the callbacks that will be called. mandatory callbacks must be present for callbacks to be successfully updated diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index f35b2200..61598be8 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1274,6 +1274,9 @@ typedef std::function locationSystemInfoCallback; +typedef std::function locationApiDestroyCompleteCallback; + typedef struct { size_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory diff --git a/location/location_interface.h b/location/location_interface.h index e9e2fe89..480bbdb4 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -46,12 +46,14 @@ typedef std::function GnssEnergyConsumedCallback; +typedef void (*removeClientCompleteCallback)(LocationAPI* client); + struct GnssInterface { size_t size; void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); @@ -87,7 +89,7 @@ struct FlpInterface { void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); @@ -104,7 +106,7 @@ struct GeofenceInterface { void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t* (*addGeofences)(LocationAPI* client, size_t count, GeofenceOption*, GeofenceInfo*); void (*removeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); From 3203504a28c72cf9823f1864b46b8692cf7979ec Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Tue, 27 Nov 2018 15:00:57 +0800 Subject: [PATCH 773/945] PZ90 datum support add a configuration DATUM_TYPE in gps.conf to configure datum type. Default datum type is WGS84. Change-Id: Ia8404aa5cf6d49741b9f487f8b086abd095f21ea CRs-fixed: 2338883 --- etc/gps.conf | 7 + utils/loc_cfg.cpp | 25 ++++ utils/loc_cfg.h | 2 +- utils/loc_nmea.cpp | 311 +++++++++++++++++++++++++++++++++++++++++++-- utils/loc_nmea.h | 37 ++++++ 5 files changed, 368 insertions(+), 14 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 2f2e5ca6..e5be3858 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -95,6 +95,13 @@ CAPABILITIES=0x37 # 3: Enable both LPP_User_Plane and LPP_Control_Plane LPP_PROFILE = 2 +#################################### +#Datum Type +#################################### +# 0: WGS-84 +# 1: PZ-90 +DATUM_TYPE = 0 + ################################ # EXTRA SETTINGS ################################ diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 71dfc665..3676bd58 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -57,12 +57,14 @@ /* Parameter data */ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; +static uint32_t DATUM_TYPE = 0; /* Parameter spec table */ static const loc_param_s_type loc_param_table[] = { {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, + {"DATUM_TYPE", &DATUM_TYPE, NULL, 'n'}, }; static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); @@ -85,6 +87,29 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; +/*=========================================================================== +FUNCTION loc_get_datum_type + +DESCRIPTION + get datum type + +PARAMETERS: + N/A + +DEPENDENCIES + N/A + +RETURN VALUE + DATUM TYPE + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_get_datum_type() +{ + return DATUM_TYPE; +} + /*=========================================================================== FUNCTION loc_set_config_entry diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index a8bdaede..aa001480 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -132,7 +132,7 @@ extern const char LOC_PATH_QUIPC_CONF[]; int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_ptr, loc_process_info_s_type** process_info_table_ptr); - +int loc_get_datum_type(); #ifdef __cplusplus } #endif diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index b4de6dba..e9a8f848 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #define GLONASS_SV_ID_OFFSET 64 #define MAX_SATELLITES_IN_USE 12 @@ -113,6 +114,126 @@ typedef struct loc_sv_cache_info_s float vdop; } loc_sv_cache_info; +/*=========================================================================== +FUNCTION convert_Lla_to_Ecef + +DESCRIPTION + Convert LLA to ECEF + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void convert_Lla_to_Ecef(const LocLla& plla, LocEcef& pecef) +{ + double r; + + r = MAJA / sqrt(1.0 - ESQR * sin(plla.lat) * sin(plla.lat)); + pecef.X = (r + plla.alt) * cos(plla.lat) * cos(plla.lon); + pecef.Y = (r + plla.alt) * cos(plla.lat) * sin(plla.lon); + pecef.Z = (r * OMES + plla.alt) * sin(plla.lat); +} + +/*=========================================================================== +FUNCTION convert_WGS84_to_PZ90 + +DESCRIPTION + Convert datum from WGS84 to PZ90 + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void convert_WGS84_to_PZ90(const LocEcef& pWGS84, LocEcef& pPZ90) +{ + double deltaX = DatumConstFromWGS84[0]; + double deltaY = DatumConstFromWGS84[1]; + double deltaZ = DatumConstFromWGS84[2]; + double deltaScale = DatumConstFromWGS84[3]; + double rotX = DatumConstFromWGS84[4]; + double rotY = DatumConstFromWGS84[5]; + double rotZ = DatumConstFromWGS84[6]; + + pPZ90.X = deltaX + deltaScale * (pWGS84.X + rotZ * pWGS84.Y - rotY * pWGS84.Z); + pPZ90.Y = deltaY + deltaScale * (pWGS84.Y - rotZ * pWGS84.X + rotX * pWGS84.Z); + pPZ90.Z = deltaZ + deltaScale * (pWGS84.Z + rotY * pWGS84.X - rotX * pWGS84.Y); +} + +/*=========================================================================== +FUNCTION convert_Ecef_to_Lla + +DESCRIPTION + Convert ECEF to LLA + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void convert_Ecef_to_Lla(const LocEcef& pecef, LocLla& plla) +{ + double p, r; + double EcefA = C_PZ90A; + double EcefB = C_PZ90B; + double Ecef1Mf; + double EcefE2; + double Mu; + double Smu; + double Cmu; + double Phi; + double Sphi; + double N; + + p = sqrt(pecef.X * pecef.X + pecef.Y * pecef.Y); + r = sqrt(p * p + pecef.Z * pecef.Z); + if (r < 1.0) { + plla.lat = 1.0; + plla.lon = 1.0; + plla.alt = 1.0; + } + Ecef1Mf = 1.0 - (EcefA - EcefB) / EcefA; + EcefE2 = 1.0 - (EcefB * EcefB) / (EcefA * EcefA); + if (p > 1.0) { + Mu = atan2(pecef.Z * (Ecef1Mf + EcefE2 * EcefA / r), p); + } else { + if (pecef.Z > 0.0) { + Mu = M_PI / 2.0; + } else { + Mu = -M_PI / 2.0; + } + } + Smu = sin(Mu); + Cmu = cos(Mu); + Phi = atan2(pecef.Z * Ecef1Mf + EcefE2 * EcefA * Smu * Smu * Smu, + Ecef1Mf * (p - EcefE2 * EcefA * Cmu * Cmu * Cmu)); + Sphi = sin(Phi); + N = EcefA / sqrt(1.0 - EcefE2 * Sphi * Sphi); + plla.alt = p * cos(Phi) + pecef.Z * Sphi - EcefA * EcefA/N; + plla.lat = Phi; + if ( p > 1.0) { + plla.lon = atan2(pecef.Y, pecef.X); + } else { + plla.lon = 0.0; + } +} + /*=========================================================================== FUNCTION convert_signalType_to_signalId @@ -607,6 +728,110 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } //while } +/*=========================================================================== +FUNCTION loc_nmea_generate_DTM + +DESCRIPTION + Generate NMEA DTM sentences generated based on position report + +DEPENDENCIES + NONE + +RETURN VALUE + NONE + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_nmea_generate_DTM(const LocLla &ref_lla, + const LocLla &local_lla, + char *sentence, + int bufSize) +{ + char* pMarker = sentence; + int lengthRemaining = bufSize; + int length = 0; + int datum_type; + char ref_datum[4] = {0}; + char local_datum[4] = {0}; + double lla_offset[3] = {0}; + char latHem, longHem; + double latMins, longMins; + + + + datum_type = loc_get_datum_type(); + switch (datum_type) { + case LOC_GNSS_DATUM_WGS84: + ref_datum[0] = 'W'; + ref_datum[1] = '8'; + ref_datum[2] = '4'; + local_datum[0] = 'P'; + local_datum[1] = '9'; + local_datum[2] = '0'; + break; + case LOC_GNSS_DATUM_PZ90: + ref_datum[0] = 'P'; + ref_datum[1] = '9'; + ref_datum[2] = '0'; + local_datum[0] = 'W'; + local_datum[1] = '8'; + local_datum[2] = '4'; + break; + default: + break; + } + length = snprintf(pMarker , lengthRemaining , "$GPDTM,%s,," , local_datum); + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + lla_offset[0] = local_lla.lat - ref_lla.lat; + lla_offset[1] = fmod(local_lla.lon - ref_lla.lon, 360.0); + if (lla_offset[1] < -180.0) { + lla_offset[1] += 360.0; + } else if ( lla_offset[1] > 180.0) { + lla_offset[1] -= 360.0; + } + lla_offset[2] = local_lla.alt - ref_lla.alt; + if (lla_offset[0] > 0.0) { + latHem = 'N'; + } else { + latHem = 'S'; + lla_offset[0] *= -1.0; + } + latMins = fmod(lla_offset[0] * 60.0, 60.0); + if (lla_offset[1] < 0.0) { + longHem = 'W'; + lla_offset[1] *= -1.0; + }else { + longHem = 'E'; + } + longMins = fmod(lla_offset[1] * 60.0, 60.0); + length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,%.3lf,", + (uint8_t)floor(lla_offset[0]), latMins, latHem, + (uint8_t)floor(lla_offset[1]), longMins, longHem, lla_offset[2]); + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + length = snprintf(pMarker , lengthRemaining , "%s" , ref_datum); + if (length < 0 || length >= lengthRemaining) { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + length = loc_nmea_put_checksum(sentence, bufSize); +} + /*=========================================================================== FUNCTION getUtcTimeWithLeapSecondTransition @@ -726,6 +951,9 @@ void loc_nmea_generate_pos(const UlpLocation &location, } char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char sentence_DTM[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char sentence_RMC[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char sentence_GGA[NMEA_SENTENCE_MAX_LENGTH] = {0}; char* pMarker = sentence; int lengthRemaining = sizeof(sentence); int length = 0; @@ -736,6 +964,13 @@ void loc_nmea_generate_pos(const UlpLocation &location, int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; int utcMSeconds = (location.gpsLocation.timestamp)%1000; + int datum_type = loc_get_datum_type(); + LocEcef ecef_w84; + LocEcef ecef_p90; + LocLla lla_w84; + LocLla lla_p90; + LocLla ref_lla; + LocLla local_lla; if (inLsTransition) { // During leap second transition, we need to display the extra @@ -904,12 +1139,52 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); + memset(&ecef_w84, 0, sizeof(ecef_w84)); + memset(&ecef_p90, 0, sizeof(ecef_p90)); + memset(&lla_w84, 0, sizeof(lla_w84)); + memset(&lla_p90, 0, sizeof(lla_p90)); + memset(&ref_lla, 0, sizeof(ref_lla)); + memset(&local_lla, 0, sizeof(local_lla)); + lla_w84.lat = location.gpsLocation.latitude / 180.0 * M_PI; + lla_w84.lon = location.gpsLocation.longitude / 180.0 * M_PI; + lla_w84.alt = location.gpsLocation.altitude; + + convert_Lla_to_Ecef(lla_w84, ecef_w84); + convert_WGS84_to_PZ90(ecef_w84, ecef_p90); + convert_Ecef_to_Lla(ecef_p90, lla_p90); + + switch (datum_type) { + case LOC_GNSS_DATUM_WGS84: + ref_lla.lat = location.gpsLocation.latitude; + ref_lla.lon = location.gpsLocation.longitude; + ref_lla.alt = location.gpsLocation.altitude; + local_lla.lat = lla_p90.lat / M_PI * 180.0; + local_lla.lon = lla_p90.lon / M_PI * 180.0; + local_lla.alt = lla_p90.alt; + break; + case LOC_GNSS_DATUM_PZ90: + ref_lla.lat = lla_p90.lat / M_PI * 180.0; + ref_lla.lon = lla_p90.lon / M_PI * 180.0; + ref_lla.alt = lla_p90.alt; + local_lla.lat = location.gpsLocation.latitude; + local_lla.lon = location.gpsLocation.longitude; + local_lla.alt = location.gpsLocation.altitude; + break; + default: + break; + } + + // ------------------- + // ------$--DTM------- + // ------------------- + loc_nmea_generate_DTM(ref_lla, local_lla, sentence_DTM, sizeof(sentence_DTM)); + // ------------------- // ------$--RMC------- // ------------------- - pMarker = sentence; - lengthRemaining = sizeof(sentence); + pMarker = sentence_RMC; + lengthRemaining = sizeof(sentence_RMC); length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); @@ -924,8 +1199,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { - double latitude = location.gpsLocation.latitude; - double longitude = location.gpsLocation.longitude; + double latitude = ref_lla.lat; + double longitude = ref_lla.lon; char latHemisphere; char lonHemisphere; double latMinutes; @@ -1067,15 +1342,14 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker += length; lengthRemaining -= length; - length = loc_nmea_put_checksum(sentence, sizeof(sentence)); - nmeaArraystr.push_back(sentence); + length = loc_nmea_put_checksum(sentence_RMC, sizeof(sentence_RMC)); // ------------------- // ------$--GGA------- // ------------------- - pMarker = sentence; - lengthRemaining = sizeof(sentence); + pMarker = sentence_GGA; + lengthRemaining = sizeof(sentence_GGA); length = snprintf(pMarker, lengthRemaining, "$%sGGA,%02d%02d%02d.%02d," , talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); @@ -1090,8 +1364,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG) { - double latitude = location.gpsLocation.latitude; - double longitude = location.gpsLocation.longitude; + double latitude = ref_lla.lat; + double longitude = ref_lla.lon; char latHemisphere; char lonHemisphere; double latMinutes; @@ -1191,15 +1465,26 @@ void loc_nmea_generate_pos(const UlpLocation &location, (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) { length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", - location.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); + ref_lla.alt - locationExtended.altitudeMeanSeaLevel); } else { length = snprintf(pMarker, lengthRemaining,",,,"); } - length = loc_nmea_put_checksum(sentence, sizeof(sentence)); - nmeaArraystr.push_back(sentence); + length = loc_nmea_put_checksum(sentence_GGA, sizeof(sentence_GGA)); + + // ------$--DTM------- + nmeaArraystr.push_back(sentence_DTM); + // ------$--RMC------- + nmeaArraystr.push_back(sentence_RMC); + if(LOC_GNSS_DATUM_PZ90 == datum_type) { + // ------$--DTM------- + nmeaArraystr.push_back(sentence_DTM); + } + // ------$--GGA------- + nmeaArraystr.push_back(sentence_GGA); + } //Send blank NMEA reports for non-final fixes else { diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h index fbf88a74..c6c83db4 100644 --- a/utils/loc_nmea.h +++ b/utils/loc_nmea.h @@ -35,6 +35,43 @@ #include #define NMEA_SENTENCE_MAX_LENGTH 200 +/** gnss datum type */ +#define LOC_GNSS_DATUM_WGS84 0 +#define LOC_GNSS_DATUM_PZ90 1 + +/* len of semi major axis of ref ellips*/ +#define MAJA (6378137.0) +/* flattening coef of ref ellipsoid*/ +#define FLAT (1.0/298.2572235630) +/* 1st eccentricity squared*/ +#define ESQR (FLAT*(2.0 - FLAT)) +/*1 minus eccentricity squared*/ +#define OMES (1.0 - ESQR) +#define MILARCSEC2RAD (4.848136811095361e-09) +/*semi major axis */ +#define C_PZ90A (6378136.0) +/*semi minor axis */ +#define C_PZ90B (6356751.3618) +/* Transformation from WGS84 to PZ90 + * Cx,Cy,Cz,Rs,Rx,Ry,Rz,C_SYS_A,C_SYS_B*/ +const double DatumConstFromWGS84[9] = + {+0.003, +0.001, 0.000, (1.0+(0.000*1E-6)), (-0.019*MILARCSEC2RAD), + (+0.042*MILARCSEC2RAD), (-0.002*MILARCSEC2RAD), C_PZ90A, C_PZ90B}; + +/** Represents a LTP*/ +typedef struct { + double lat; + double lon; + double alt; +} LocLla; + +/** Represents a ECEF*/ +typedef struct { + double X; + double Y; + double Z; +} LocEcef; + void loc_nmea_generate_sv(const GnssSvNotification &svNotify, std::vector &nmeaArraystr); From f7c6bf552ae3818f98c19dd327b55de531924d47 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Tue, 4 Dec 2018 16:58:02 +0800 Subject: [PATCH 774/945] fix multiple GPS_LOCK request donot send GPS_LOCK request when new gpsLock is the same as last one. Change-Id: Ifb87018d11aef0383762b9b132742faf3d4d7e79 CRs-fixed: 2360896 --- gnss/GnssAdapter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fc59c224..54a2145e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -846,13 +846,14 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); - ContextBase::mGps_conf.GPS_LOCK = newGpsLock; - if (0 == ContextBase::mGps_conf.GPS_LOCK) { - ContextBase::mGps_conf.GPS_LOCK = 3; + if (0 == newGpsLock) { + newGpsLock = 3; } - if (0 != mAdapter.getPowerVoteId()) { + if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK || + 0 != mAdapter.getPowerVoteId()) { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } + ContextBase::mGps_conf.GPS_LOCK = newGpsLock; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { From abfeea182d6ea4905f80da6f17556da278cce4d4 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 4 Jan 2019 15:56:04 +0800 Subject: [PATCH 775/945] Fix KW P1 related issues Change-Id: Ifc3cb9dcabf2e07439fd596b5ad33b46ea562b3d CRs-fixed: 2375836 --- gnss/GnssAdapter.cpp | 14 ++++++++------ gnss/XtraSystemStatusObserver.cpp | 7 +++++-- utils/LocIpc.h | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 016356b4..fb1c7ecc 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1999,8 +1999,10 @@ GnssAdapter::restartSessions() } // get the LocationOptions that has the smallest interval, which should be the active one - TrackingOptions smallestIntervalOptions = {}; // size is zero until set for the first time - TrackingOptions highestPowerTrackingOptions = {}; + TrackingOptions smallestIntervalOptions; // size is zero until set for the first time + TrackingOptions highestPowerTrackingOptions; + memset(&smallestIntervalOptions, 0, sizeof(smallestIntervalOptions)); + memset(&highestPowerTrackingOptions, 0, sizeof(highestPowerTrackingOptions)); for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { // size of zero means we havent set it yet if (0 == smallestIntervalOptions.size || @@ -3022,8 +3024,8 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, loc_nmea_generate_pos(ulpLocation, locationExtended, mLocSystemInfo, generate_nmea, nmeaArraystr); stringstream ss; - for (auto sentence : nmeaArraystr) { - ss << sentence; + for (auto itor = nmeaArraystr.begin(); itor != nmeaArraystr.end(); ++itor) { + ss << *itor; } string s = ss.str(); reportNmea(s.c_str(), s.length()); @@ -3118,8 +3120,8 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) std::vector nmeaArraystr; loc_nmea_generate_sv(svNotify, nmeaArraystr); stringstream ss; - for (auto sentence : nmeaArraystr) { - ss << sentence; + for (auto itor = nmeaArraystr.begin(); itor != nmeaArraystr.end(); ++itor) { + ss << *itor; } string s = ss.str(); reportNmea(s.c_str(), s.length()); diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 6df54800..d84ae424 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -219,8 +219,11 @@ void XtraSystemStatusObserver::notify(const list& dlist) } inline ~HandleOsObserverUpdateMsg() { - for (auto each : mDataItemList) { - delete each; + for (auto itor = mDataItemList.begin(); itor != mDataItemList.end(); ++itor) { + if (*itor != nullptr) { + delete *itor; + *itor = nullptr; + } } } diff --git a/utils/LocIpc.h b/utils/LocIpc.h index a1a994d1..62309e78 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -106,7 +106,7 @@ public: // This class hides generated fd and destination address object from user. inline LocIpcSender(const char* destSocket): LocIpcSender(std::make_shared(::socket(AF_UNIX, SOCK_DGRAM, 0)), destSocket) { - if (-1 == *mSocket) { + if (mSocket != nullptr && -1 == *mSocket) { mSocket = nullptr; } } From 2332db20a984a1f49b31be3bf320aaa448b40b8d Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 4 Jan 2019 17:13:21 -0800 Subject: [PATCH 776/945] Fix issue with setting of thread name Only first 3 chars of thread name were getting set because of incorrect length check. This change fixes the issue. CRs-Fixed: 2376235 Change-Id: Iba4ad44af2e3bfde8da8ae4efdd4b132299ae9b7 --- utils/LocThread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/LocThread.cpp b/utils/LocThread.cpp index c1052cb0..568a6bb3 100644 --- a/utils/LocThread.cpp +++ b/utils/LocThread.cpp @@ -85,8 +85,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, if (mThandle) { // set thread name char lname[16]; - int len = (sizeof(lname)>sizeof(threadName)) ? - (sizeof(threadName) -1):(sizeof(lname) - 1); + int len = (sizeof(lname) > (strlen(threadName) + 1)) ? + (strlen(threadName)):(sizeof(lname) - 1); memcpy(lname, threadName, len); lname[len] = 0; // set the thread name here From 18c99090be9e90ca419d17410de01bca1bdd90b0 Mon Sep 17 00:00:00 2001 From: haohuang Date: Sat, 15 Dec 2018 17:01:37 +0800 Subject: [PATCH 777/945] Qualcomm Unified Vendor - GPS Remove remaining build flag checks in all location vendor modules : BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET LW_FEATURE_SET Change-Id: Ideacd3ae7f6a49ff3da3ca8cd14668c01400484a CRs-Fixed: 2341041 --- android/1.0/Android.mk | 9 --------- android/1.1/Android.mk | 9 --------- core/Android.mk | 6 ------ 3 files changed, 24 deletions(-) diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index dc721db4..1893560d 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -48,14 +48,6 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) -BUILD_GNSS_HIDL_SERVICE := true -ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) -ifneq ($(LW_FEATURE_SET),true) -BUILD_GNSS_HIDL_SERVICE := false -endif # LW_FEATURE_SET -endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET - -ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti LOCAL_VENDOR_MODULE := true @@ -88,4 +80,3 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) -endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index 4f1cdf25..3c3d734a 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -49,14 +49,6 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) -BUILD_GNSS_HIDL_SERVICE := true -ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) -ifneq ($(LW_FEATURE_SET),true) -BUILD_GNSS_HIDL_SERVICE := false -endif # LW_FEATURE_SET -endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET - -ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-service-qti LOCAL_VENDOR_MODULE := true @@ -90,4 +82,3 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) -endif # BUILD_GNSS_HIDL_SERVICE diff --git a/core/Android.mk b/core/Android.mk index 1a4f51ab..97614a17 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -9,12 +9,6 @@ LOCAL_MODULE := libloc_core LOCAL_VENDOR_MODULE := true 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 := \ liblog \ libutils \ From 400c1e8b5748ae2ad360aa558ad3552ce4e0227c Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Tue, 8 Jan 2019 17:32:37 +0530 Subject: [PATCH 778/945] Launch platform specific processes Launch processes based on whether the platform is vendor enhanced or not. Change-Id: I04c074023e631c4f5d1e16ac166612f323b7a868 CRs-Fixed: 2341030 --- android/1.0/Android.mk | 1 + android/1.0/service.cpp | 10 +++++++++- android/1.1/Android.mk | 1 + android/1.1/service.cpp | 10 +++++++++- utils/Android.mk | 3 ++- utils/loc_cfg.cpp | 35 +++++++++++++++++++++++++---------- utils/loc_cfg.h | 3 ++- 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index 1893560d..b8cddd4d 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -71,6 +71,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libbase \ libutils \ + libqti_vndfwk_detect \ LOCAL_SHARED_LIBRARIES += \ libhwbinder \ diff --git a/android/1.0/service.cpp b/android/1.0/service.cpp index 6b0f6022..2f258ae4 100644 --- a/android/1.0/service.cpp +++ b/android/1.0/service.cpp @@ -23,9 +23,17 @@ #include #include +extern "C" { +#include "vndfwk-detect.h" +} + using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - return defaultPassthroughServiceImplementation(); + if (!isRunningWithVendorEnhancedFramework()) { + return defaultPassthroughServiceImplementation(); + } else { + return -1; + } } diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index 3c3d734a..c3988a90 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -72,6 +72,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libbase \ libutils \ + libqti_vndfwk_detect \ LOCAL_SHARED_LIBRARIES += \ libhwbinder \ diff --git a/android/1.1/service.cpp b/android/1.1/service.cpp index 72cb4e9b..ff7a4868 100644 --- a/android/1.1/service.cpp +++ b/android/1.1/service.cpp @@ -23,9 +23,17 @@ #include #include +extern "C" { +#include "vndfwk-detect.h" +} + using android::hardware::gnss::V1_1::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - return defaultPassthroughServiceImplementation(); + if (!isRunningWithVendorEnhancedFramework()) { + return defaultPassthroughServiceImplementation(); + } else { + return -1; + } } diff --git a/utils/Android.mk b/utils/Android.mk index b8320de9..d031d422 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -11,7 +11,8 @@ include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog + liblog \ + libqti_vndfwk_detect LOCAL_SRC_FILES += \ loc_log.cpp \ diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 3676bd58..36bd80a4 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -48,6 +48,10 @@ #endif #include "log_util.h" +extern "C" { +#include "vndfwk-detect.h" +} + /*============================================================================= * * GLOBAL DATA DECLARATION @@ -487,6 +491,7 @@ typedef struct { char feature_supl_wifi[LOC_MAX_PARAM_STRING]; char feature_wifi_supplicant_info[LOC_MAX_PARAM_STRING]; char auto_platform[LOC_MAX_PARAM_STRING]; + unsigned int vendor_enhanced_process; } loc_launcher_conf; /* process configuration parameters */ @@ -509,15 +514,16 @@ static const loc_param_s_type loc_feature_conf_table[] = { /* location process conf, e.g.: izat.conf Parameter spec table */ static const loc_param_s_type loc_process_conf_parameter_table[] = { - {"PROCESS_NAME", &conf.proc_name, NULL, 's'}, - {"PROCESS_ARGUMENT", &conf.proc_argument, NULL, 's'}, - {"PROCESS_STATE", &conf.proc_status, NULL, 's'}, - {"PROCESS_GROUPS", &conf.group_list, NULL, 's'}, - {"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'}, - {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, - {"PLATFORMS", &conf.platform_list, NULL, 's'}, - {"BASEBAND", &conf.baseband, NULL, 's'}, - {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, + {"PROCESS_NAME", &conf.proc_name, NULL, 's'}, + {"PROCESS_ARGUMENT", &conf.proc_argument, NULL, 's'}, + {"PROCESS_STATE", &conf.proc_status, NULL, 's'}, + {"PROCESS_GROUPS", &conf.group_list, NULL, 's'}, + {"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'}, + {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, + {"PLATFORMS", &conf.platform_list, NULL, 's'}, + {"BASEBAND", &conf.baseband, NULL, 's'}, + {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, + {"VENDOR_ENHANCED_PROCESS", &conf.vendor_enhanced_process, NULL, 'n'}, }; /*=========================================================================== @@ -758,6 +764,14 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p continue; } + if ((isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process == 0) || + (!isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process != 0)) { + LOC_LOGD("%s:%d]: Process %s is disabled via vendor enhanced process check", + __func__, __LINE__, conf.proc_name); + child_proc[j].proc_status = DISABLED_VIA_VENDOR_ENHANCED_CHECK; + continue; + } + if(strcmp(conf.proc_status, "DISABLED") == 0) { LOC_LOGD("%s:%d]: Process %s is disabled in conf file", __func__, __LINE__, conf.proc_name); @@ -871,7 +885,8 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p if((config_mask & CONFIG_MASK_TARGET_CHECK) && (config_mask & CONFIG_MASK_BASEBAND_CHECK) && (config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) && - (child_proc[j].proc_status != DISABLED_FROM_CONF)) { + (child_proc[j].proc_status != DISABLED_FROM_CONF) && + (child_proc[j].proc_status != DISABLED_VIA_VENDOR_ENHANCED_CHECK)) { //Set args //The first argument passed through argv is usually the name of the diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index aa001480..c8c39c94 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -84,7 +84,8 @@ typedef enum { ENABLED, RUNNING, DISABLED, - DISABLED_FROM_CONF + DISABLED_FROM_CONF, + DISABLED_VIA_VENDOR_ENHANCED_CHECK } loc_process_e_status; typedef struct { From cd387d1e8eb7dbf07741005f0cf33677a911dd43 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 Jan 2019 17:41:30 -0800 Subject: [PATCH 779/945] LocIpc could be using data member from a deleted obj startListeningBlocking is meant to be called under a reader thread, which is the case if startListeningNonBlocking calls it. A LocIpc client may delete the LocIpc obj, which would trigger sending an ABORT msg to the reader thread before it is subsequently deleted, in which case, it is possible that when the reader thread comes around to process the ABORT msg, referencing the data members of the possibly stale obj would cause unpredictable behaviors. Change-Id: I441af85c04d92b6fff695c020e3e0b4bd5e90409 CRs-Fixed: 2380093 --- utils/LocIpc.cpp | 117 +++++++++++++++++++++-------------------------- utils/LocIpc.h | 3 +- 2 files changed, 53 insertions(+), 67 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index f7e163da..7347b781 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -69,8 +69,9 @@ bool LocIpc::startListeningNonBlocking(const std::string& name) { } bool LocIpc::startListeningBlocking(const std::string& name) { - + bool stopRequested = false; int fd = socket(AF_UNIX, SOCK_DGRAM, 0); + if (fd < 0) { LOC_LOGe("create socket error. reason:%s", strerror(errno)); return false; @@ -87,89 +88,75 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (::bind(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { LOC_LOGe("bind socket error. reason:%s", strerror(errno)); - ::close(fd); - fd = -1; - return false; - } + } else { + mIpcFd = fd; - mIpcFd = fd; + // inform that the socket is ready to receive message + onListenerReady(); - // inform that the socket is ready to receive message - onListenerReady(); - - ssize_t nBytes = 0; - std::string msg = ""; - std::string abort = LOC_MSG_ABORT; - while (1) { - msg.resize(LOC_MSG_BUF_LEN); - nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); - if (nBytes < 0) { - break; - } else if (nBytes == 0) { - continue; - } - - if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { - LOC_LOGi("recvd abort msg.data %s", msg.data()); - break; - } - - if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { - // short message - msg.resize(nBytes); - onReceive(msg); - } else { - // long message - size_t msgLen = 0; - sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); - msg.resize(msgLen); - size_t msgLenReceived = 0; - while ((msgLenReceived < msgLen) && (nBytes > 0)) { - nBytes = recvfrom(mIpcFd, (void*)&(msg[msgLenReceived]), - msg.size() - msgLenReceived, 0, NULL, NULL); - msgLenReceived += nBytes; + ssize_t nBytes = 0; + std::string msg = ""; + std::string abort = LOC_MSG_ABORT; + while (1) { + msg.resize(LOC_MSG_BUF_LEN); + nBytes = ::recvfrom(fd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); + if (nBytes < 0) { + LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); + break; + } else if (0 == nBytes) { + continue; } - if (nBytes > 0) { - onReceive(msg); - } else { + + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + stopRequested = true; break; } + + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { + // short message + msg.resize(nBytes); + onReceive(msg); + } else { + // long message + size_t msgLen = 0; + sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); + msg.resize(msgLen); + size_t msgLenReceived = 0; + while ((msgLenReceived < msgLen) && (nBytes > 0)) { + nBytes = recvfrom(fd, (void*)&(msg[msgLenReceived]), + msg.size() - msgLenReceived, 0, NULL, NULL); + msgLenReceived += nBytes; + } + if (nBytes > 0) { + onReceive(msg); + } else { + LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); + break; + } + } } } - if (mStopRequested) { - mStopRequested = false; - return true; - } else { - LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); - (void)::close(mIpcFd); - mIpcFd = -1; - return false; + if (::close(fd)) { + LOC_LOGe("cannot close socket:%s", strerror(errno)); } + unlink(name.c_str()); + + return stopRequested; } void LocIpc::stopListening() { - const char *socketName = nullptr; - mStopRequested = true; - if (mRunnable) { + if (mIpcFd >= 0) { std::string abort = LOC_MSG_ABORT; socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); send(socketName, abort); - mRunnable = nullptr; - } - - if (mIpcFd >= 0) { - if (::close(mIpcFd)) { - LOC_LOGe("cannot close socket:%s", strerror(errno)); - } mIpcFd = -1; } - - //delete from the file system at the end - if (socketName) { - unlink(socketName); + if (mRunnable) { + mRunnable = nullptr; } } diff --git a/utils/LocIpc.h b/utils/LocIpc.h index a1a994d1..87f2ff8c 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -44,7 +44,7 @@ class LocIpcSender; class LocIpc { friend LocIpcSender; public: - inline LocIpc() : mIpcFd(-1), mStopRequested(false), mRunnable(nullptr) {} + inline LocIpc() : mIpcFd(-1), mRunnable(nullptr) {} inline virtual ~LocIpc() { stopListening(); } // Listen for new messages in current thread. Calling this funciton will @@ -93,7 +93,6 @@ private: const uint8_t data[], uint32_t length); int mIpcFd; - bool mStopRequested; LocThread mThread; LocRunnable *mRunnable; }; From 877b2e40c3c062435142b135994cc149fe7e2c4c Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 21 Dec 2018 17:56:30 +0800 Subject: [PATCH 780/945] Build dummy QMAA HAL to unblock framework Build dummy QMAA HAL to unblock framework when BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE flag is not defined. Change-Id: I62f71d7964e916619f0157e69a57cd83a62bba54 CRs-Fixed: 2378795 --- Android.mk | 5 +- android/Android.mk | 5 +- android/dummy/Android.mk | 63 ++++++++++ android/dummy/GnssDummy.cpp | 115 ++++++++++++++++++ android/dummy/GnssDummy.h | 96 +++++++++++++++ .../android.hardware.gnss@1.0-service-qti.rc | 4 + android/dummy/serviceDummy.cpp | 32 +++++ 7 files changed, 316 insertions(+), 4 deletions(-) create mode 100644 android/dummy/Android.mk create mode 100644 android/dummy/GnssDummy.cpp create mode 100644 android/dummy/GnssDummy.h create mode 100644 android/dummy/android.hardware.gnss@1.0-service-qti.rc create mode 100644 android/dummy/serviceDummy.cpp diff --git a/Android.mk b/Android.mk index 23b2a666..a995aff2 100644 --- a/Android.mk +++ b/Android.mk @@ -1,6 +1,7 @@ -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) include $(LOCAL_PATH)/build/target_specific_features.mk - +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) include $(call all-makefiles-under,$(LOCAL_PATH)) +else +include $(LOCAL_PATH)/android/Android.mk endif diff --git a/android/Android.mk b/android/Android.mk index 11d5889d..bff117ed 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,9 +1,10 @@ -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) ifeq ($(GNSS_HIDL_VERSION),1.1) include $(LOCAL_PATH)/1.1/Android.mk else include $(LOCAL_PATH)/1.0/Android.mk endif - +else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti +include $(LOCAL_PATH)/dummy/Android.mk endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/android/dummy/Android.mk b/android/dummy/Android.mk new file mode 100644 index 00000000..d4388888 --- /dev/null +++ b/android/dummy/Android.mk @@ -0,0 +1,63 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +#build dummy android.hardware.gnss@1.0-impl-qti +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := GnssDummy.cpp + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libcutils \ + libutils \ + android.hardware.gnss@1.0 \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +BUILD_GNSS_HIDL_SERVICE := true +ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) +ifneq ($(LW_FEATURE_SET),true) +#BUILD_GNSS_HIDL_SERVICE := false +endif # LW_FEATURE_SET +endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET + +ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc +LOCAL_SRC_FILES := \ + serviceDummy.cpp \ + +#LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api +#LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libcutils \ + libdl \ + libbase \ + libutils \ + +LOCAL_SHARED_LIBRARIES += \ + libhwbinder \ + libhidlbase \ + libhidltransport \ + android.hardware.gnss@1.0 \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_EXECUTABLE) +endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/dummy/GnssDummy.cpp b/android/dummy/GnssDummy.cpp new file mode 100644 index 00000000..b30b4370 --- /dev/null +++ b/android/dummy/GnssDummy.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ +#include "GnssDummy.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +Gnss::Gnss() { +} + +Gnss::~Gnss() { +} + +Return Gnss::setCallback(const sp& /*callback*/) { + return false; +} + +Return Gnss::start() { + return false; +} + +Return Gnss::stop() { + return false; +} + +Return Gnss::cleanup() { + return Void(); +} + +Return Gnss::injectLocation(double /*latitudeDegrees*/, + double /*longitudeDegrees*/, + float /*accuracyMeters*/) { + return false; +} + +Return Gnss::injectTime(int64_t /*timeMs*/, int64_t /*timeReferenceMs*/, + int32_t /*uncertaintyMs*/) { + return false; +} + +Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData /*aidingDataFlags*/) { + return Void(); +} + +Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode /*mode*/, + V1_0::IGnss::GnssPositionRecurrence /*recurrence*/, + uint32_t /*minIntervalMs*/, + uint32_t /*preferredAccuracyMeters*/, + uint32_t /*preferredTimeMs*/) { + return false; +} + +Return> Gnss::getExtensionAGnss() { + return nullptr; +} + +Return> Gnss::getExtensionGnssNi() { + return nullptr; +} + +Return> Gnss::getExtensionGnssMeasurement() { + return nullptr; +} + +Return> Gnss::getExtensionGnssConfiguration() { + return nullptr; +} + +Return> Gnss::getExtensionGnssGeofencing() { + return nullptr; +} + +Return> Gnss::getExtensionGnssBatching() { + return nullptr; +} + +Return> Gnss::getExtensionGnssDebug() { + return nullptr; +} + +Return> Gnss::getExtensionAGnssRil() { + return nullptr; +} + +IGnss* HIDL_FETCH_IGnss(const char* /*hal*/) { + IGnss* iface = nullptr; + iface = new Gnss(); + return iface; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/dummy/GnssDummy.h b/android/dummy/GnssDummy.h new file mode 100644 index 00000000..89c876f0 --- /dev/null +++ b/android/dummy/GnssDummy.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssInterface" + +#include +#include +#include + +#include +#include +#include +namespace android { +namespace hardware { +namespace gnss { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; + +struct Gnss : public IGnss { + Gnss(); + ~Gnss(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnss follow. + * These declarations were generated from Gnss.hal. + */ + Return setCallback(const sp& callback) override; + Return start() override; + Return stop() override; + Return cleanup() override; + Return injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) override; + Return injectTime(int64_t timeMs, + int64_t timeReferenceMs, + int32_t uncertaintyMs) override; + Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override; + Return setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) override; + Return> getExtensionAGnss() override; + Return> getExtensionGnssNi() override; + Return> getExtensionGnssMeasurement() override; + Return> getExtensionGnssConfiguration() override; + Return> getExtensionGnssGeofencing() override; + Return> getExtensionGnssBatching() override; + + Return> getExtensionAGnssRil() override; + + inline Return> getExtensionGnssNavigationMessage() override { + return nullptr; + } + + inline Return> getExtensionXtra() override { + return nullptr; + } + + Return> getExtensionGnssDebug() override; +}; + +extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); + +} // namespace implementation +} // namespace V1_0 +} // namespace gnss +} // namespace hardware +} // namespace android + diff --git a/android/dummy/android.hardware.gnss@1.0-service-qti.rc b/android/dummy/android.hardware.gnss@1.0-service-qti.rc new file mode 100644 index 00000000..b5da6f97 --- /dev/null +++ b/android/dummy/android.hardware.gnss@1.0-service-qti.rc @@ -0,0 +1,4 @@ +service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti + class hal + user gps + group system gps radio diff --git a/android/dummy/serviceDummy.cpp b/android/dummy/serviceDummy.cpp new file mode 100644 index 00000000..10ce60b2 --- /dev/null +++ b/android/dummy/serviceDummy.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "android.hardware.gnss@1.0-service-qti" + +#include +#include + +using android::hardware::gnss::V1_0::IGnss; +using android::hardware::defaultPassthroughServiceImplementation; + +int main() { + ALOGI("%s", __FUNCTION__); + return defaultPassthroughServiceImplementation(); +} From 99e5e01b131234e489ddc1d7d7adf4da0d646367 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 Jan 2019 17:41:30 -0800 Subject: [PATCH 781/945] LocIpc could be using data member from a deleted obj startListeningBlocking is meant to be called under a reader thread, which is the case if startListeningNonBlocking calls it. A LocIpc client may delete the LocIpc obj, which would trigger sending an ABORT msg to the reader thread before it is subsequently deleted, in which case, it is possible that when the reader thread comes around to process the ABORT msg, referencing the data members of the possibly stale obj would cause unpredictable behaviors. Change-Id: I441af85c04d92b6fff695c020e3e0b4bd5e90409 CRs-Fixed: 2380093 --- utils/LocIpc.cpp | 117 +++++++++++++++++++++-------------------------- utils/LocIpc.h | 3 +- 2 files changed, 53 insertions(+), 67 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index f7e163da..7347b781 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -69,8 +69,9 @@ bool LocIpc::startListeningNonBlocking(const std::string& name) { } bool LocIpc::startListeningBlocking(const std::string& name) { - + bool stopRequested = false; int fd = socket(AF_UNIX, SOCK_DGRAM, 0); + if (fd < 0) { LOC_LOGe("create socket error. reason:%s", strerror(errno)); return false; @@ -87,89 +88,75 @@ bool LocIpc::startListeningBlocking(const std::string& name) { if (::bind(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { LOC_LOGe("bind socket error. reason:%s", strerror(errno)); - ::close(fd); - fd = -1; - return false; - } + } else { + mIpcFd = fd; - mIpcFd = fd; + // inform that the socket is ready to receive message + onListenerReady(); - // inform that the socket is ready to receive message - onListenerReady(); - - ssize_t nBytes = 0; - std::string msg = ""; - std::string abort = LOC_MSG_ABORT; - while (1) { - msg.resize(LOC_MSG_BUF_LEN); - nBytes = ::recvfrom(mIpcFd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); - if (nBytes < 0) { - break; - } else if (nBytes == 0) { - continue; - } - - if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { - LOC_LOGi("recvd abort msg.data %s", msg.data()); - break; - } - - if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { - // short message - msg.resize(nBytes); - onReceive(msg); - } else { - // long message - size_t msgLen = 0; - sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); - msg.resize(msgLen); - size_t msgLenReceived = 0; - while ((msgLenReceived < msgLen) && (nBytes > 0)) { - nBytes = recvfrom(mIpcFd, (void*)&(msg[msgLenReceived]), - msg.size() - msgLenReceived, 0, NULL, NULL); - msgLenReceived += nBytes; + ssize_t nBytes = 0; + std::string msg = ""; + std::string abort = LOC_MSG_ABORT; + while (1) { + msg.resize(LOC_MSG_BUF_LEN); + nBytes = ::recvfrom(fd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); + if (nBytes < 0) { + LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); + break; + } else if (0 == nBytes) { + continue; } - if (nBytes > 0) { - onReceive(msg); - } else { + + if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + stopRequested = true; break; } + + if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { + // short message + msg.resize(nBytes); + onReceive(msg); + } else { + // long message + size_t msgLen = 0; + sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); + msg.resize(msgLen); + size_t msgLenReceived = 0; + while ((msgLenReceived < msgLen) && (nBytes > 0)) { + nBytes = recvfrom(fd, (void*)&(msg[msgLenReceived]), + msg.size() - msgLenReceived, 0, NULL, NULL); + msgLenReceived += nBytes; + } + if (nBytes > 0) { + onReceive(msg); + } else { + LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); + break; + } + } } } - if (mStopRequested) { - mStopRequested = false; - return true; - } else { - LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); - (void)::close(mIpcFd); - mIpcFd = -1; - return false; + if (::close(fd)) { + LOC_LOGe("cannot close socket:%s", strerror(errno)); } + unlink(name.c_str()); + + return stopRequested; } void LocIpc::stopListening() { - const char *socketName = nullptr; - mStopRequested = true; - if (mRunnable) { + if (mIpcFd >= 0) { std::string abort = LOC_MSG_ABORT; socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); send(socketName, abort); - mRunnable = nullptr; - } - - if (mIpcFd >= 0) { - if (::close(mIpcFd)) { - LOC_LOGe("cannot close socket:%s", strerror(errno)); - } mIpcFd = -1; } - - //delete from the file system at the end - if (socketName) { - unlink(socketName); + if (mRunnable) { + mRunnable = nullptr; } } diff --git a/utils/LocIpc.h b/utils/LocIpc.h index a1a994d1..87f2ff8c 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -44,7 +44,7 @@ class LocIpcSender; class LocIpc { friend LocIpcSender; public: - inline LocIpc() : mIpcFd(-1), mStopRequested(false), mRunnable(nullptr) {} + inline LocIpc() : mIpcFd(-1), mRunnable(nullptr) {} inline virtual ~LocIpc() { stopListening(); } // Listen for new messages in current thread. Calling this funciton will @@ -93,7 +93,6 @@ private: const uint8_t data[], uint32_t length); int mIpcFd; - bool mStopRequested; LocThread mThread; LocRunnable *mRunnable; }; From afcf4af54e4dd7d0b19471ea42b24a6713ed9043 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 15 Jan 2019 22:23:55 -0800 Subject: [PATCH 782/945] make location.lnx.5.0 build for LE Change-Id: Ia8c39902ae7ce532d5efa9f36058a8f3f0e0b674 CRs-Fixed: 2381679 --- android/1.0/Android.mk | 1 + android/1.0/service.cpp | 6 +++++- android/1.1/Android.mk | 1 + android/1.1/service.cpp | 6 +++++- utils/Android.mk | 3 +-- utils/loc_cfg.cpp | 15 +++++++++------ utils/loc_cfg.h | 2 ++ 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index b8cddd4d..434b4321 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -71,6 +71,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libbase \ libutils \ + libgps.utils \ libqti_vndfwk_detect \ LOCAL_SHARED_LIBRARIES += \ diff --git a/android/1.0/service.cpp b/android/1.0/service.cpp index 2f258ae4..ee61a102 100644 --- a/android/1.0/service.cpp +++ b/android/1.0/service.cpp @@ -23,6 +23,7 @@ #include #include +#include "loc_cfg.h" extern "C" { #include "vndfwk-detect.h" } @@ -31,7 +32,10 @@ using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - if (!isRunningWithVendorEnhancedFramework()) { + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + setVendorEnhanced(vendorEnhanced); + + if (!vendorEnhanced) { return defaultPassthroughServiceImplementation(); } else { return -1; diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index c3988a90..33e5b0dc 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -72,6 +72,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libbase \ libutils \ + libgps.utils \ libqti_vndfwk_detect \ LOCAL_SHARED_LIBRARIES += \ diff --git a/android/1.1/service.cpp b/android/1.1/service.cpp index ff7a4868..c1bc6b0e 100644 --- a/android/1.1/service.cpp +++ b/android/1.1/service.cpp @@ -23,6 +23,7 @@ #include #include +#include "loc_cfg.h" extern "C" { #include "vndfwk-detect.h" } @@ -31,7 +32,10 @@ using android::hardware::gnss::V1_1::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - if (!isRunningWithVendorEnhancedFramework()) { + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + setVendorEnhanced(vendorEnhanced); + + if (!vendorEnhanced) { return defaultPassthroughServiceImplementation(); } else { return -1; diff --git a/utils/Android.mk b/utils/Android.mk index d031d422..b8320de9 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -11,8 +11,7 @@ include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog \ - libqti_vndfwk_detect + liblog LOCAL_SRC_FILES += \ loc_log.cpp \ diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 36bd80a4..4ab68f01 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -48,10 +48,6 @@ #endif #include "log_util.h" -extern "C" { -#include "vndfwk-detect.h" -} - /*============================================================================= * * GLOBAL DATA DECLARATION @@ -62,6 +58,7 @@ extern "C" { static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; static uint32_t DATUM_TYPE = 0; +static bool sVendorEnhanced = true; /* Parameter spec table */ static const loc_param_s_type loc_param_table[] = @@ -91,6 +88,13 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR; +bool isVendorEnhanced() { + return sVendorEnhanced; +} +void setVendorEnhanced(bool vendorEnhanced) { + sVendorEnhanced = vendorEnhanced; +} + /*=========================================================================== FUNCTION loc_get_datum_type @@ -764,8 +768,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p continue; } - if ((isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process == 0) || - (!isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process != 0)) { + if (isVendorEnhanced() != conf.vendor_enhanced_process != 0) { LOC_LOGD("%s:%d]: Process %s is disabled via vendor enhanced process check", __func__, __LINE__, conf.proc_name); child_proc[j].proc_status = DISABLED_VIA_VENDOR_ENHANCED_CHECK; diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index c8c39c94..5c77dc64 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -113,6 +113,8 @@ extern "C" { * MODULE EXPORTED FUNCTIONS * *============================================================================*/ +bool isVendorEnhanced(); +void setVendorEnhanced(bool vendorEnhanced); void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, uint32_t table_length); From 5fba9e7dfb011b776264ffb57849970aa1b41fb0 Mon Sep 17 00:00:00 2001 From: "Srivastava, Saurabh" Date: Fri, 25 Jan 2019 10:33:26 +0530 Subject: [PATCH 783/945] Adding SBAS in GSV NMEA Adding missing constellation handling for SBAS in GSV NMEA Change-Id: I51ce3f60fc3bf340936901b753169df34d6db5c2 CRs-Fixed: 2387458 --- utils/loc_nmea.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index e9a8f848..0f7c48ff 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -674,6 +674,9 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, case GNSS_SV_TYPE_BEIDOU: signalType = GNSS_SIGNAL_BEIDOU_B1I; break; + case GNSS_SV_TYPE_SBAS: + signalType = GNSS_SIGNAL_SBAS_L1; + break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svNotify.gnssSvs[svNumber - 1].type); From 49c60ab27a04ab0f0f41b62181c5539b4e671842 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 24 Jan 2019 16:18:38 -0800 Subject: [PATCH 784/945] LocationAPI must also be freed on destroy call LocationAPI object instance itself must also be freed when destroy is called. CRs-Fixed: 2388028 Change-Id: Ie6e1c34e126a10ea58076c0385aecd447233c7aa --- location/LocationAPI.cpp | 22 +++++++++------------- location/LocationAPI.h | 2 ++ location/LocationDataTypes.h | 7 +++++++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 4d859b30..e9f2ee4d 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -37,13 +37,6 @@ typedef void* (getLocationInterface)(); -typedef uint16_t LocationAdapterTypeMask; -typedef enum { - LOCATION_ADAPTER_GNSS_TYPE_BIT = (1<<0), // adapter type is GNSS - LOCATION_ADAPTER_FLP_TYPE_BIT = (1<<1), // adapter type is FLP - LOCATION_ADAPTER_GEOFENCE_TYPE_BIT = (1<<2) // adapter type is geo fence -} LocationAdapterTypeBits; - typedef struct { // bit mask of the adpaters that we need to wait for the removeClientCompleteCallback // before we invoke the registered locationApiDestroyCompleteCallback @@ -129,14 +122,13 @@ static void* loadLocationInterface(const char* library, const char* name) } } -void onRemoveClientCompleteCb ( - LocationAPI* client, LocationAdapterTypeMask adapterType) +void LocationAPI::onRemoveClientCompleteCb (LocationAdapterTypeMask adapterType) { bool invokeCallback = false; locationApiDestroyCompleteCallback destroyCompleteCb; LOC_LOGd("adatper type %x", adapterType); pthread_mutex_lock(&gDataMutex); - auto it = gData.destroyClientData.find(client); + auto it = gData.destroyClientData.find(this); if (it != gData.destroyClientData.end()) { it->second.waitAdapterMask &= ~adapterType; if (it->second.waitAdapterMask == 0) { @@ -151,22 +143,24 @@ void onRemoveClientCompleteCb ( LOC_LOGd("invoke client destroy cb"); (destroyCompleteCb) (); LOC_LOGd("finish invoke client destroy cb"); + + delete this; } } void onGnssRemoveClientCompleteCb (LocationAPI* client) { - onRemoveClientCompleteCb (client, LOCATION_ADAPTER_GNSS_TYPE_BIT); + client->onRemoveClientCompleteCb (LOCATION_ADAPTER_GNSS_TYPE_BIT); } void onFlpRemoveClientCompleteCb (LocationAPI* client) { - onRemoveClientCompleteCb (client, LOCATION_ADAPTER_FLP_TYPE_BIT); + client->onRemoveClientCompleteCb (LOCATION_ADAPTER_FLP_TYPE_BIT); } void onGeofenceRemoveClientCompleteCb (LocationAPI* client) { - onRemoveClientCompleteCb (client, LOCATION_ADAPTER_GEOFENCE_TYPE_BIT); + client->onRemoveClientCompleteCb (LOCATION_ADAPTER_GEOFENCE_TYPE_BIT); } LocationAPI* @@ -310,6 +304,7 @@ LocationAPI::destroy(locationApiDestroyCompleteCallback destroyCompleteCb) pthread_mutex_unlock(&gDataMutex); if (invokeDestroyCb == true) { (destroyCompleteCb) (); + delete this; } } @@ -321,6 +316,7 @@ LocationAPI::LocationAPI() // private destructor LocationAPI::~LocationAPI() { + LOC_LOGD("LOCATION API DESTRUCTOR"); } void diff --git a/location/LocationAPI.h b/location/LocationAPI.h index c270ef41..6f5987ca 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -52,6 +52,8 @@ public: */ void destroy(locationApiDestroyCompleteCallback destroyCompleteCb=nullptr); + void onRemoveClientCompleteCb (LocationAdapterTypeMask adapterType); + /* updates/changes the callbacks that will be called. mandatory callbacks must be present for callbacks to be successfully updated no return value */ diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 61598be8..1590b885 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1277,6 +1277,13 @@ typedef std::function locationApiDestroyCompleteCallback; +typedef uint16_t LocationAdapterTypeMask; +typedef enum { + LOCATION_ADAPTER_GNSS_TYPE_BIT = (1<<0), // adapter type is GNSS + LOCATION_ADAPTER_FLP_TYPE_BIT = (1<<1), // adapter type is FLP + LOCATION_ADAPTER_GEOFENCE_TYPE_BIT = (1<<2) // adapter type is geo fence +} LocationAdapterTypeBits; + typedef struct { size_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory From 8e04d01cd2e35bfea1dc7d1f5f689e7780a90f1f Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 4 Dec 2018 15:55:00 -0800 Subject: [PATCH 785/945] GPS SV meas: new structure to support 10Hz (1) revise struct of GnssSvMeasurementSet so it can be used to send only valid SV measurement via IPC (2) remove reference to COMPASS system, as COMPASS named is replaced by BEIDOU system (3) correct typo in GNSS_GLOS_MSEC_VALID to GNSS_GLO_MSEC_VALID CRs-fixed: 2337832 Change-Id: I325346fa414e3a94422cb8ab4cc5b77d6efaf485 --- gnss/GnssAdapter.cpp | 1 + location/LocationDataTypes.h | 28 ++++-- utils/gps_extended_c.h | 175 ++++++++++++----------------------- 3 files changed, 81 insertions(+), 123 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 791f9d64..57d055c7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1939,6 +1939,7 @@ GnssAdapter::updateClientsEventMask() if((1 == ContextBase::mGps_conf.EXTERNAL_DR_ENABLED) || (true == initEngHubProxy())) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; + mask |= LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 1590b885..e4784735 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -488,6 +488,22 @@ typedef enum { GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), } GnssAidingDataSvTypeBits; +/* Gnss constellation type mask */ +typedef uint16_t GnssConstellationTypeMask; +typedef enum { + GNSS_CONSTELLATION_TYPE_GPS_BIT = (1<<0), + GNSS_CONSTELLATION_TYPE_GLONASS_BIT = (1<<1), + GNSS_CONSTELLATION_TYPE_QZSS_BIT = (1<<2), + GNSS_CONSTELLATION_TYPE_BEIDOU_BIT = (1<<3), + GNSS_CONSTELLATION_TYPE_GALILEO_BIT = (1<<4), + GNSS_CONSTELLATION_TYPE_SBAS_BIT = (1<<5) +} GnssConstellationTypeBits; + +#define GNSS_CONSTELLATION_TYPE_MASK_ALL\ + (GNSS_CONSTELLATION_TYPE_GPS_BIT | GNSS_CONSTELLATION_TYPE_GLONASS_BIT |\ + GNSS_CONSTELLATION_TYPE_QZSS_BIT | GNSS_CONSTELLATION_TYPE_BEIDOU_BIT |\ + GNSS_CONSTELLATION_TYPE_GALILEO_BIT | GNSS_CONSTELLATION_TYPE_SBAS_BIT) + /** GNSS Signal Type and RF Band */ typedef uint32_t GnssSignalTypeMask; typedef enum { @@ -531,19 +547,19 @@ typedef enum { typedef enum { + GNSS_LOC_SV_SYSTEM_UNKNOWN = 0, + /** unknown sv system. */ GNSS_LOC_SV_SYSTEM_GPS = 1, /**< GPS satellite. */ GNSS_LOC_SV_SYSTEM_GALILEO = 2, /**< GALILEO satellite. */ GNSS_LOC_SV_SYSTEM_SBAS = 3, /**< SBAS satellite. */ - GNSS_LOC_SV_SYSTEM_COMPASS = 4, - /**< COMPASS satellite. */ - GNSS_LOC_SV_SYSTEM_GLONASS = 5, + GNSS_LOC_SV_SYSTEM_GLONASS = 4, /**< GLONASS satellite. */ - GNSS_LOC_SV_SYSTEM_BDS = 6, + GNSS_LOC_SV_SYSTEM_BDS = 5, /**< BDS satellite. */ - GNSS_LOC_SV_SYSTEM_QZSS = 7 + GNSS_LOC_SV_SYSTEM_QZSS = 6 /**< QZSS satellite. */ } Gnss_LocSvSystemEnumType; @@ -590,7 +606,7 @@ typedef enum { typedef uint32_t GnssGloTimeStructTypeFlags; typedef enum { GNSS_CLO_DAYS_VALID = (1 << 0), - GNSS_GLOS_MSEC_VALID = (1 << 1), + GNSS_GLO_MSEC_VALID = (1 << 1), GNSS_GLO_CLK_TIME_BIAS_VALID = (1 << 2), GNSS_GLO_CLK_TIME_BIAS_UNC_VALID = (1 << 3), GNSS_GLO_REF_FCOUNT_VALID = (1 << 4), diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 8ddf488a..22b2dd03 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -410,6 +410,8 @@ typedef uint32_t LocPosDataMask; /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 #define GPS_SV_PRN_MAX 32 +#define SBAS_SV_PRN_MIN 33 +#define SBAS_SV_PRN_MAX 64 #define GLO_SV_PRN_MIN 65 #define GLO_SV_PRN_MAX 96 #define QZSS_SV_PRN_MIN 193 @@ -838,8 +840,8 @@ enum loc_api_adapter_event_index { 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_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 @@ -853,6 +855,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_BS_OBS_DATA_SERVICE_REQ, // BS observation data request LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT, // GNSS SV Ephemeris Report LOC_API_ADAPTER_LOC_SYSTEM_INFO, // Location system info event + LOC_API_ADAPTER_GNSS_NHZ_MEASUREMENT_REPORT, // GNSS SV nHz measurement report LOC_API_ADAPTER_EVENT_MAX }; @@ -893,6 +896,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_BS_OBS_DATA_SERVICE_REQ (1ULL< Date: Tue, 29 Jan 2019 15:53:57 -0800 Subject: [PATCH 786/945] Fix build errors with libgps.utils.so set_sched_policy() was moved from libcutils to libprocessgroup CRs-fixed: 2390701 Change-Id: I1468dee2b30f79bcdaa4ab3144628fddc69c4e80 --- utils/Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/Android.mk b/utils/Android.mk index b8320de9..ec6bf058 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -11,7 +11,8 @@ include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - liblog + liblog \ + libprocessgroup LOCAL_SRC_FILES += \ loc_log.cpp \ From 4b5fd7ed54abbc6cd1b87d6e33376098d8b82795 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 1 Feb 2019 14:56:46 -0800 Subject: [PATCH 787/945] process launch switch based on vendor enhanced check is incorrect Some vendor enhaced processes are not to be launched only if this is not a vendor enhanced produce. Condition incorrect. Change-Id: Ieb520d77500f78968cb78b69169b068356f880ab CRs-Fixed: 2392220 --- utils/loc_cfg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 4ab68f01..8160cc14 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -768,7 +768,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p continue; } - if (isVendorEnhanced() != conf.vendor_enhanced_process != 0) { + if (!isVendorEnhanced() && (conf.vendor_enhanced_process != 0)) { LOC_LOGD("%s:%d]: Process %s is disabled via vendor enhanced process check", __func__, __LINE__, conf.proc_name); child_proc[j].proc_status = DISABLED_VIA_VENDOR_ENHANCED_CHECK; From 51dca017c55fce4852d48ec38fc40b9811ed7fd8 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Mon, 14 Jan 2019 16:27:35 +0800 Subject: [PATCH 788/945] GNSS HAL 2.0 implementation Implement AGnss, AGnssRil, GnssConfiguration, GnssMeasurement and MeasurementCorrections of GNSS HAL 2.0 to on par with Android P Change-Id: Id430e60c2d9cc7333f4b331c7e5a1e9a45a0289a CRs-Fixed: 2342198 --- android/2.0/AGnss.cpp | 76 +++ android/2.0/AGnss.h | 77 +++ android/2.0/AGnssRil.cpp | 128 ++++ android/2.0/AGnssRil.h | 84 +++ android/2.0/Android.mk | 92 +++ android/2.0/Gnss.cpp | 505 ++++++++++++++++ android/2.0/Gnss.h | 180 ++++++ android/2.0/GnssBatching.cpp | 130 ++++ android/2.0/GnssBatching.h | 80 +++ android/2.0/GnssConfiguration.cpp | 319 ++++++++++ android/2.0/GnssConfiguration.h | 80 +++ android/2.0/GnssDebug.cpp | 177 ++++++ android/2.0/GnssDebug.h | 63 ++ android/2.0/GnssGeofencing.cpp | 141 +++++ android/2.0/GnssGeofencing.h | 91 +++ android/2.0/GnssMeasurement.cpp | 138 +++++ android/2.0/GnssMeasurement.h | 85 +++ android/2.0/GnssNi.cpp | 85 +++ android/2.0/GnssNi.h | 75 +++ .../android.hardware.gnss@2.0-service-qti.rc} | 2 +- .../2.0/location_api/BatchingAPIClient.cpp | 196 ++++++ android/2.0/location_api/BatchingAPIClient.h | 74 +++ .../2.0/location_api/GeofenceAPIClient.cpp | 275 +++++++++ android/2.0/location_api/GeofenceAPIClient.h | 76 +++ android/2.0/location_api/GnssAPIClient.cpp | 565 ++++++++++++++++++ android/2.0/location_api/GnssAPIClient.h | 108 ++++ android/2.0/location_api/LocationUtil.cpp | 206 +++++++ android/2.0/location_api/LocationUtil.h | 55 ++ .../2.0/location_api/MeasurementAPIClient.cpp | 320 ++++++++++ .../2.0/location_api/MeasurementAPIClient.h | 84 +++ android/2.0/service.cpp | 42 ++ android/Android.mk | 5 + android/dummy/Android.mk | 17 +- .../android.hardware.gnss@2.0-service-qti.rc | 4 + .../1.0/MeasurementCorrections.cpp | 66 ++ .../1.0/MeasurementCorrections.h | 72 +++ .../1.0/GnssVisibilityControl.cpp | 72 +++ .../1.0/GnssVisibilityControl.h | 77 +++ build/target_specific_features.mk | 5 +- 39 files changed, 4912 insertions(+), 15 deletions(-) create mode 100644 android/2.0/AGnss.cpp create mode 100644 android/2.0/AGnss.h create mode 100644 android/2.0/AGnssRil.cpp create mode 100644 android/2.0/AGnssRil.h create mode 100644 android/2.0/Android.mk create mode 100644 android/2.0/Gnss.cpp create mode 100644 android/2.0/Gnss.h create mode 100644 android/2.0/GnssBatching.cpp create mode 100644 android/2.0/GnssBatching.h create mode 100644 android/2.0/GnssConfiguration.cpp create mode 100644 android/2.0/GnssConfiguration.h create mode 100644 android/2.0/GnssDebug.cpp create mode 100644 android/2.0/GnssDebug.h create mode 100644 android/2.0/GnssGeofencing.cpp create mode 100644 android/2.0/GnssGeofencing.h create mode 100644 android/2.0/GnssMeasurement.cpp create mode 100644 android/2.0/GnssMeasurement.h create mode 100644 android/2.0/GnssNi.cpp create mode 100644 android/2.0/GnssNi.h rename android/{dummy/android.hardware.gnss@1.0-service-qti.rc => 2.0/android.hardware.gnss@2.0-service-qti.rc} (50%) create mode 100644 android/2.0/location_api/BatchingAPIClient.cpp create mode 100644 android/2.0/location_api/BatchingAPIClient.h create mode 100644 android/2.0/location_api/GeofenceAPIClient.cpp create mode 100644 android/2.0/location_api/GeofenceAPIClient.h create mode 100644 android/2.0/location_api/GnssAPIClient.cpp create mode 100644 android/2.0/location_api/GnssAPIClient.h create mode 100644 android/2.0/location_api/LocationUtil.cpp create mode 100644 android/2.0/location_api/LocationUtil.h create mode 100644 android/2.0/location_api/MeasurementAPIClient.cpp create mode 100644 android/2.0/location_api/MeasurementAPIClient.h create mode 100644 android/2.0/service.cpp create mode 100644 android/dummy/android.hardware.gnss@2.0-service-qti.rc create mode 100644 android/measurement_corrections/1.0/MeasurementCorrections.cpp create mode 100644 android/measurement_corrections/1.0/MeasurementCorrections.h create mode 100644 android/visibility_control/1.0/GnssVisibilityControl.cpp create mode 100644 android/visibility_control/1.0/GnssVisibilityControl.h diff --git a/android/2.0/AGnss.cpp b/android/2.0/AGnss.cpp new file mode 100644 index 00000000..ce387989 --- /dev/null +++ b/android/2.0/AGnss.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_AGnssInterface" + +#include +#include "Gnss.h" +#include "AGnss.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +static AGnss* spAGnss = nullptr; + +AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { + spAGnss = this; +} + +AGnss::~AGnss() { + spAGnss = nullptr; +} + +void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ +} + +void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) { +} + +Return AGnss::setCallback(const sp& callback) { + return Void(); +} + +Return AGnss::dataConnClosed() { + return true; +} + +Return AGnss::dataConnFailed() { + return true; +} + +Return AGnss::dataConnOpen(uint64_t networkHandle, const hidl_string& apn, + V2_0::IAGnss::ApnIpType apnIpType) { + return true; +} + +Return AGnss::setServer(V2_0::IAGnssCallback::AGnssType type, + const hidl_string& hostname, + int32_t port) { + return true; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/AGnss.h b/android/2.0/AGnss.h new file mode 100644 index 00000000..ed9c0e89 --- /dev/null +++ b/android/2.0/AGnss.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H +#define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct AGnss : public V2_0::IAGnss { + + AGnss(Gnss* gnss); + ~AGnss(); + /* + * Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow. + * These declarations were generated from IAGnss.hal. + */ + Return setCallback(const sp& callback) override; + + Return dataConnClosed() override; + + Return dataConnFailed() override; + + Return dataConnOpen(uint64_t networkHandle, const hidl_string& apn, + V2_0::IAGnss::ApnIpType apnIpType) override; + + Return setServer(V2_0::IAGnssCallback::AGnssType type, + const hidl_string& hostname, int32_t port) override; + + void statusIpV4Cb(AGnssExtStatusIpV4 status); + + /* Data call setup callback passed down to GNSS HAL implementation */ + static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); + + private: + Gnss* mGnss = nullptr; + sp mAGnssCbIface = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H diff --git a/android/2.0/AGnssRil.cpp b/android/2.0/AGnssRil.cpp new file mode 100644 index 00000000..e17a06d4 --- /dev/null +++ b/android/2.0/AGnssRil.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc__AGnssRilInterface" + +#include +#include +#include +#include +#include +#include +#include +#include "Gnss.h" +#include "AGnssRil.h" +#include + +typedef void* (getLocationInterface)(); + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + + +AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) { + ENTRY_LOG_CALLFLOW(); +} + +AGnssRil::~AGnssRil() { + ENTRY_LOG_CALLFLOW(); +} + +Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { + ENTRY_LOG_CALLFLOW(); + // Extra NetworkTypes not available in IAgnssRil enums + const int NetworkType_BLUETOOTH = 7; + const int NetworkType_ETHERNET = 9; + const int NetworkType_PROXY = 16; + + // for XTRA + if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { + int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + switch(type) + { + case IAGnssRil::NetworkType::MOBILE: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + break; + case IAGnssRil::NetworkType::WIFI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + break; + case IAGnssRil::NetworkType::MMS: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS; + break; + case IAGnssRil::NetworkType::SUPL: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL; + break; + case IAGnssRil::NetworkType::DUN: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN; + break; + case IAGnssRil::NetworkType::HIPRI: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI; + break; + case IAGnssRil::NetworkType::WIMAX: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; + break; + default: + { + int networkType = (int) type; + // Handling network types not available in IAgnssRil + switch(networkType) + { + case NetworkType_BLUETOOTH: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH; + break; + case NetworkType_ETHERNET: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET; + break; + case NetworkType_PROXY: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY; + break; + default: + typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + } + } + break; + } + mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); + } + return true; +} +Return AGnssRil::updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttributes& attributes) { + ENTRY_LOG_CALLFLOW(); + + if (nullptr != mGnss && (nullptr != mGnss->getGnssInterface())) { + int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_METERED) { + typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + } else { + typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + } + mGnss->getGnssInterface()->updateConnectionStatus(attributes.isConnected, typeout); + } + return true; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/AGnssRil.h b/android/2.0/AGnssRil.h new file mode 100644 index 00000000..a04d8aa5 --- /dev/null +++ b/android/2.0/AGnssRil.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ +#define ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +/* + * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface + * allows the GNSS chipset to request radio interface layer information from Android platform. + * Examples of such information are reference location, unique subscriber ID, phone number string + * and network availability changes. Also contains wrapper methods to allow methods from + * IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL. + */ +struct AGnssRil : public V2_0::IAGnssRil { + AGnssRil(Gnss* gnss); + ~AGnssRil(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow. + * These declarations were generated from IAGnssRil.hal. + */ + Return setCallback(const sp& /*callback*/) override { + return Void(); + } + Return setRefLocation(const V1_0::IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override { + return Void(); + } + Return setSetId(V1_0::IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override { + return false; + } + Return updateNetworkAvailability(bool /*available*/, + const hidl_string& /*apn*/) override { + return false; + } + Return updateNetworkState(bool connected, V1_0::IAGnssRil::NetworkType type, bool roaming) override; + + // Methods from ::android::hardware::gnss::V2_0::IAGnssRil follow + Return updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttributes& attributes) override; + + private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSSRIL_H_ diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk new file mode 100644 index 00000000..0fa50bdf --- /dev/null +++ b/android/2.0/Android.mk @@ -0,0 +1,92 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := \ + AGnss.cpp \ + Gnss.cpp \ + AGnssRil.cpp \ + GnssMeasurement.cpp \ + GnssConfiguration.cpp \ + GnssBatching.cpp \ + GnssGeofencing.cpp \ + GnssNi.cpp \ + GnssDebug.cpp \ + ../measurement_corrections/1.0/MeasurementCorrections.cpp \ + ../visibility_control/1.0/GnssVisibilityControl.cpp + +LOCAL_SRC_FILES += \ + location_api/GnssAPIClient.cpp \ + location_api/MeasurementAPIClient.cpp \ + location_api/GeofenceAPIClient.cpp \ + location_api/BatchingAPIClient.cpp \ + location_api/LocationUtil.cpp \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/location_api \ + $(LOCAL_PATH)/../measurement_corrections/1.0 \ + $(LOCAL_PATH)/../visibility_control/1.0 +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libcutils \ + libutils \ + android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ + android.hardware.gnss@2.0 \ + android.hardware.gnss.measurement_corrections@1.0 \ + android.hardware.gnss.visibility_control@1.0 + +LOCAL_SHARED_LIBRARIES += \ + libloc_core \ + libgps.utils \ + libdl \ + liblocation_api \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.gnss@2.0-service-qti +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc +LOCAL_SRC_FILES := \ + service.cpp \ + +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + + +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libcutils \ + libdl \ + libbase \ + libutils \ + libgps.utils \ + libqti_vndfwk_detect \ + +LOCAL_SHARED_LIBRARIES += \ + libhwbinder \ + libhidlbase \ + libhidltransport \ + android.hardware.gnss@1.0 \ + android.hardware.gnss@1.1 \ + android.hardware.gnss@2.0 \ + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_EXECUTABLE) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp new file mode 100644 index 00000000..0a4b34ba --- /dev/null +++ b/android/2.0/Gnss.cpp @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssInterface" + +#include +#include +#include +#include +#include "Gnss.h" +#include "LocationUtil.h" + +typedef void* (getLocationInterface)(); + +#define IMAGES_INFO_FILE "/sys/devices/soc0/images" +#define DELIMITER ";" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +static std::string getVersionString() { + static std::string version; + if (!version.empty()) + return version; + + char value[PROPERTY_VALUE_MAX] = {0}; + property_get("ro.hardware", value, "unknown"); + version.append(value).append(DELIMITER); + + std::ifstream in(IMAGES_INFO_FILE); + std::string s; + while(getline(in, s)) { + std::size_t found = s.find("CRM:"); + if (std::string::npos == found) { + continue; + } + + // skip over space characters after "CRM:" + const char* substr = s.c_str(); + found += 4; + while (0 != substr[found] && isspace(substr[found])) { + found++; + } + if (s.find("11:") != found) { + continue; + } + s.erase(0, found + 3); + + found = s.find_first_of("\r\n"); + if (std::string::npos != found) { + s.erase(s.begin() + found, s.end()); + } + version.append(s).append(DELIMITER); + } + return version; +} + +void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnss != nullptr) { + mGnss->stop(); + mGnss->cleanup(); + } +} + +Gnss::Gnss() { + ENTRY_LOG_CALLFLOW(); + // clear pending GnssConfig + memset(&mPendingConfig, 0, sizeof(GnssConfig)); + mGnssDeathRecipient = new GnssDeathRecipient(this); +} + +Gnss::~Gnss() { + ENTRY_LOG_CALLFLOW(); + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +GnssAPIClient* Gnss::getApi() { + if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) { + mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); + if (mApi == nullptr) { + LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__); + return mApi; + } + + if (mPendingConfig.size == sizeof(GnssConfig)) { + // we have pending GnssConfig + mApi->gnssConfigurationUpdate(mPendingConfig); + // clear size to invalid mPendingConfig + mPendingConfig.size = 0; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + } + } + } + if (mApi == nullptr) { + LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__); + } + return mApi; +} + +GnssInterface* Gnss::getGnssInterface() { + static bool getGnssInterfaceFailed = false; + if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { + LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); + getLocationInterface* getter = NULL; + const char *error = NULL; + dlerror(); + void *handle = dlopen("libgnss.so", RTLD_NOW); + if (NULL == handle || (error = dlerror()) != NULL) { + LOC_LOGW("dlopen for libgnss.so failed, error = %s", error); + } else { + getter = (getLocationInterface*)dlsym(handle, "getGnssInterface"); + if ((error = dlerror()) != NULL) { + LOC_LOGW("dlsym for libgnss.so::getGnssInterface failed, error = %s", error); + getter = NULL; + } + } + + if (NULL == getter) { + getGnssInterfaceFailed = true; + } else { + mGnssInterface = (GnssInterface*)(*getter)(); + } + } + return mGnssInterface; +} + +Return Gnss::setCallback(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + } + mGnssCbIface = callback; + if (mGnssCbIface != nullptr) { + mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/); + } + + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->requestCapabilities(); + } + return true; +} + +Return Gnss::setGnssNiCb(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + mGnssNiCbIface = callback; + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface); + } + return true; +} + +Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->gnssConfigurationUpdate(gnssConfig); + } else if (gnssConfig.flags != 0) { + // api is not ready yet, update mPendingConfig with gnssConfig + mPendingConfig.size = sizeof(GnssConfig); + + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + mPendingConfig.gpsLock = gnssConfig.gpsLock; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + mPendingConfig.suplVersion = gnssConfig.suplVersion; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); + mPendingConfig.assistanceServer.hostName = + strdup(gnssConfig.assistanceServer.hostName); + } + mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + mPendingConfig.lppProfile = gnssConfig.lppProfile; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT; + mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT; + mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + mPendingConfig.suplModeMask = gnssConfig.suplModeMask; + } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds; + } + } + return true; +} + +Return Gnss::start() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStart(); + } + return retVal; +} + +Return Gnss::stop() { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssStop(); + } + return retVal; +} + +Return Gnss::cleanup() { + ENTRY_LOG_CALLFLOW(); + + if (mApi != nullptr) { + mApi->gnssDisable(); + } + + return Void(); +} + +Return Gnss::injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); + return true; + } else { + return false; + } +} + +Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, + int32_t uncertaintyMs) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); + return true; + } else { + return false; + } +} + +Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) { + ENTRY_LOG_CALLFLOW(); + GnssAPIClient* api = getApi(); + if (api) { + api->gnssDeleteAidingData(aidingDataFlags); + } + return Void(); +} + +Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs); + } + return retVal; +} + +Return> Gnss::getExtensionAGnss() { + ENTRY_LOG_CALLFLOW(); + //mAGnssIface = new ::android::hardware::gnss::V1_1::implementation::AGnss(this); //need V1_1 AGnss + //return mAGnssIface; + return nullptr; +} + +Return> Gnss::getExtensionGnssNi() { + ENTRY_LOG_CALLFLOW(); + mGnssNi = new GnssNi(this); + return mGnssNi; +} + +Return> Gnss::getExtensionGnssMeasurement() { + ENTRY_LOG_CALLFLOW(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} + +Return> Gnss::getExtensionGnssConfiguration() { + ENTRY_LOG_CALLFLOW(); + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} + +Return> Gnss::getExtensionGnssGeofencing() { + ENTRY_LOG_CALLFLOW(); + mGnssGeofencingIface = new GnssGeofencing(); + return mGnssGeofencingIface; +} + +Return> Gnss::getExtensionGnssBatching() { + ENTRY_LOG_CALLFLOW(); + mGnssBatching = new GnssBatching(); + return mGnssBatching; +} + +Return> Gnss::getExtensionGnssDebug() { + ENTRY_LOG_CALLFLOW(); + mGnssDebug = new GnssDebug(this); + return mGnssDebug; +} + +Return> Gnss::getExtensionAGnssRil() { + ENTRY_LOG_CALLFLOW(); + mGnssRil = new AGnssRil(this); + return mGnssRil; +} + +// Methods from ::android::hardware::gnss::V1_1::IGnss follow. +Return Gnss::setCallback_1_1(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + callback->gnssNameCb(getVersionString()); + mGnssCbIface_1_1 = callback; + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { + odcpiRequestCb(odcpiRequest); + }; + gnssInterface->odcpiInit(cb); + } + return setCallback(callback); +} + +Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, + bool lowPowerMode) { + ENTRY_LOG_CALLFLOW(); + bool retVal = false; + GnssAPIClient* api = getApi(); + if (api) { + GnssPowerMode powerMode = lowPowerMode? + GNSS_POWER_MODE_M4 : GNSS_POWER_MODE_M2; + retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs, + preferredAccuracyMeters, preferredTimeMs, powerMode, minIntervalMs); + } + return retVal; +} + +Return> Gnss::getExtensionGnssMeasurement_1_1() { + ENTRY_LOG_CALLFLOW(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} + +Return> Gnss::getExtensionGnssConfiguration_1_1() { + ENTRY_LOG_CALLFLOW(); + if (mGnssConfig == nullptr) + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} + +Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { + ENTRY_LOG_CALLFLOW(); + GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + Location location = {}; + convertGnssLocation(gnssLocation, location); + gnssInterface->odcpiInject(location); + } + return true; +} + +void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { + ENTRY_LOG_CALLFLOW(); + if (mGnssCbIface_1_1 != nullptr) { + // For emergency mode, request DBH (Device based hybrid) location + // Mark Independent from GNSS flag to false. + if (ODCPI_REQUEST_TYPE_START == request.type) { + auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode); + if (!r.isOk()) { + LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str()); + } + } else { + LOC_LOGv("Unsupported ODCPI request type: %d", request.type); + } + } else { + LOC_LOGe("ODCPI request not supported."); + } +} + +// Methods from ::android::hardware::gnss::V2_0::IGnss follow. +Return Gnss::setCallback_2_0(const sp& callback) { + ENTRY_LOG_CALLFLOW(); + return setCallback_1_1(callback); +} +Return> Gnss::getExtensionAGnss_2_0() { + ENTRY_LOG_CALLFLOW(); + mAGnssIface_2_0 = new AGnss(this); + return mAGnssIface_2_0; +} +Return> Gnss::getExtensionAGnssRil_2_0() { + mGnssRil = new AGnssRil(this); + return mGnssRil; +} + +Return> Gnss::getExtensionGnssConfiguration_2_0() { + ENTRY_LOG_CALLFLOW(); + mGnssConfig = new GnssConfiguration(this); + return mGnssConfig; +} +Return> Gnss::getExtensionGnssMeasurement_2_0() { + ENTRY_LOG_CALLFLOW(); + if (mGnssMeasurement == nullptr) + mGnssMeasurement = new GnssMeasurement(); + return mGnssMeasurement; +} +Return> + Gnss::getExtensionMeasurementCorrections() { + if (mGnssMeasCorr == nullptr) { + mGnssMeasCorr = new MeasurementCorrections(); + } + return mGnssMeasCorr; +} +Return> + Gnss::getExtensionVisibilityControl() { + if (mVisibCtrl == nullptr) { + mVisibCtrl = new GnssVisibilityControl(); + } + return mVisibCtrl; +} +IGnss* HIDL_FETCH_IGnss(const char* hal) { + ENTRY_LOG_CALLFLOW(); + IGnss* iface = nullptr; + iface = new Gnss(); + if (iface == nullptr) { + LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal); + } + return iface; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h new file mode 100644 index 00000000..bef1e3ac --- /dev/null +++ b/android/2.0/Gnss.h @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSS_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "GnssAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections; +using ::android::hardware::gnss::measurement_corrections::V1_0::implementation::MeasurementCorrections; +using ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl; +using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; + +struct Gnss : public IGnss { + Gnss(); + ~Gnss(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnss follow. + * These declarations were generated from Gnss.hal. + */ + Return setCallback(const sp& callback) override; + Return start() override; + Return stop() override; + Return cleanup() override; + Return injectLocation(double latitudeDegrees, + double longitudeDegrees, + float accuracyMeters) override; + Return injectTime(int64_t timeMs, + int64_t timeReferenceMs, + int32_t uncertaintyMs) override; + Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override; + Return setPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs) override; + Return> getExtensionAGnss() override; + Return> getExtensionGnssNi() override; + Return> getExtensionGnssMeasurement() override; + Return> getExtensionGnssConfiguration() override; + Return> getExtensionGnssGeofencing() override; + Return> getExtensionGnssBatching() override; + + Return> getExtensionAGnssRil() override; + + inline Return> getExtensionGnssNavigationMessage() override { + return nullptr; + } + + inline Return> getExtensionXtra() override { + return nullptr; + } + + Return> getExtensionGnssDebug() override; + + // Methods from ::android::hardware::gnss::V1_1::IGnss follow. + Return setCallback_1_1(const sp& callback) override; + Return setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, bool lowPowerMode) override; + Return> getExtensionGnssMeasurement_1_1() override; + Return> getExtensionGnssConfiguration_1_1() override; + Return injectBestLocation(const GnssLocation& location) override; + + // Methods from ::android::hardware::gnss::V2_0::IGnss follow. + Return setCallback_2_0(const sp& callback) override; + Return> getExtensionAGnss_2_0() override; + Return> getExtensionAGnssRil_2_0() override; + + Return> getExtensionGnssConfiguration_2_0() override; + Return> + getExtensionMeasurementCorrections() override; + Return> getExtensionGnssMeasurement_2_0() override; + /** + * This method returns the IGnssVisibilityControl interface. + * + * @return visibilityControlIface Handle to the IGnssVisibilityControl interface. + */ + Return> + getExtensionVisibilityControl() override; + + + + // These methods are not part of the IGnss base class. + GnssAPIClient* getApi(); + Return setGnssNiCb(const sp& niCb); + Return updateConfiguration(GnssConfig& gnssConfig); + GnssInterface* getGnssInterface(); + + // Callback for ODCPI request + void odcpiRequestCb(const OdcpiRequestInfo& request); + private: + struct GnssDeathRecipient : hidl_death_recipient { + GnssDeathRecipient(sp gnss) : mGnss(gnss) { + } + ~GnssDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnss; + }; + + private: + sp mGnssDeathRecipient = nullptr; + + sp mGnssNi = nullptr; + sp mGnssGeofencingIface = nullptr; + sp mGnssBatching = nullptr; + sp mGnssDebug = nullptr; + sp mAGnssIface = nullptr; + sp mGnssCbIface = nullptr; + sp mGnssNiCbIface = nullptr; + sp mGnssCbIface_1_1 = nullptr; + sp mAGnssIface_2_0 = nullptr; + sp mGnssRil = nullptr; + sp mGnssMeasurement = nullptr; + sp mGnssConfig = nullptr; + sp mGnssMeasCorr = nullptr; + sp mVisibCtrl = nullptr; + + GnssAPIClient* mApi = nullptr; + GnssConfig mPendingConfig; + GnssInterface* mGnssInterface = nullptr; +}; + +extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSS_H diff --git a/android/2.0/GnssBatching.cpp b/android/2.0/GnssBatching.cpp new file mode 100644 index 00000000..cf215ea7 --- /dev/null +++ b/android/2.0/GnssBatching.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssBatchingInterface" + +#include +#include +#include "GnssBatching.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +void GnssBatching::GnssBatchingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssBatching != nullptr) { + mGnssBatching->stop(); + mGnssBatching->cleanup(); + } +} + +GnssBatching::GnssBatching() : mApi(nullptr) { + mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this); +} + +GnssBatching::~GnssBatching() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + + +// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. +Return GnssBatching::init(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__); + delete mApi; + mApi = nullptr; + } + + mApi = new BatchingAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + return false; + } + + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + mGnssBatchingCbIface = callback; + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/); + } + + return true; +} + +Return GnssBatching::getBatchSize() { + uint16_t ret = 0; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->getBatchSize(); + } + return ret; +} + +Return GnssBatching::start(const IGnssBatching::Options& options) { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->startSession(options); + } + return ret; +} + +Return GnssBatching::flush() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->flushBatchedLocations(); + } + return Void(); +} + +Return GnssBatching::stop() { + bool ret = false; + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + ret = mApi->stopSession(); + } + return ret; +} + +Return GnssBatching::cleanup() { + if (mGnssBatchingCbIface != nullptr) { + mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + } + return Void(); +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/GnssBatching.h b/android/2.0/GnssBatching.h new file mode 100644 index 00000000..f7dc65b8 --- /dev/null +++ b/android/2.0/GnssBatching.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H + +#include +#include + + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hidl::base::V1_0::IBase; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +class BatchingAPIClient; +struct GnssBatching : public IGnssBatching { + GnssBatching(); + ~GnssBatching(); + + // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. + Return init(const sp& callback) override; + Return getBatchSize() override; + Return start(const IGnssBatching::Options& options ) override; + Return flush() override; + Return stop() override; + Return cleanup() override; + + private: + struct GnssBatchingDeathRecipient : hidl_death_recipient { + GnssBatchingDeathRecipient(sp gnssBatching) : + mGnssBatching(gnssBatching) { + } + ~GnssBatchingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssBatching; + }; + + private: + sp mGnssBatchingDeathRecipient = nullptr; + sp mGnssBatchingCbIface = nullptr; + BatchingAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp new file mode 100644 index 00000000..93a843a6 --- /dev/null +++ b/android/2.0/GnssConfiguration.cpp @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssConfigurationInterface" + +#include +#include "Gnss.h" +#include "GnssConfiguration.h" +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::GnssConstellationType; + +GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { +} + +// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow. +Return GnssConfiguration::setSuplEs(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; + config.suplEmergencyServices = (enabled ? + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES : + GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO); + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplVersion(uint32_t version) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; + switch (version) { + case 0x00020002: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; + break; + case 0x00020000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0; + break; + case 0x00010000: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0; + break; + default: + LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setSuplMode(uint8_t mode) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT; + switch (mode) { + case 0: + config.suplModeMask = 0; // STANDALONE ONLY + break; + case 1: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT; + break; + case 2: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT; + break; + case 3: + config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT; + break; + default: + LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setLppProfile(uint8_t lppProfile) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + switch (lppProfile) { + case 0: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE; + break; + case 1: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE; + break; + case 2: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE; + break; + case 3: + config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE; + break; + default: + LOC_LOGE("%s]: invalid lppProfile: %d.", __FUNCTION__, lppProfile); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + + config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + if (protocol & (1<<0)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT; + } + if (protocol & (1<<1)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT; + } + if (protocol & (1<<2)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT; + } + if (protocol & (1<<3)) { + config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setGpsLock(uint8_t lock) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + switch (lock) { + case 0: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + break; + case 1: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; + break; + case 2: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; + break; + case 3: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + break; + default: + LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); + return false; + break; + } + + return mGnss->updateConfiguration(config); +} + +Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT; + config.emergencyPdnForEmergencySupl = (enabled ? + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES : + GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO); + + return mGnss->updateConfiguration(config); +} + +// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. +Return GnssConfiguration::setBlacklist( + const hidl_vec& blacklist) { + + ENTRY_LOG_CALLFLOW(); + if (nullptr == mGnss) { + LOC_LOGe("mGnss is null"); + return false; + } + + // blValid is true if blacklist is empty, i.e. clearing the BL; + // if blacklist is not empty, blValid is initialied to false, and later + // updated in the for loop to become true only if there is at least + // one {constellation, svid} in the list that is valid. + bool blValid = (0 == blacklist.size()); + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + config.blacklistedSvIds.clear(); + + GnssSvIdSource source = {}; + for (int idx = 0; idx < (int)blacklist.size(); idx++) { + // Set blValid true if any one source is valid + blValid = setBlacklistedSource(source, blacklist[idx]) || blValid; + config.blacklistedSvIds.push_back(source); + } + + // Update configuration only if blValid is true + // i.e. only if atleast one source is valid for blacklisting + return (blValid && mGnss->updateConfiguration(config)); +} + +bool GnssConfiguration::setBlacklistedSource( + GnssSvIdSource& copyToSource, + const GnssConfiguration::BlacklistedSource& copyFromSource) { + + bool retVal = true; + uint16_t svIdOffset = 0; + copyToSource.size = sizeof(GnssSvIdSource); + copyToSource.svId = copyFromSource.svid; + + switch(copyFromSource.constellation) { + case GnssConstellationType::GPS: + copyToSource.constellation = GNSS_SV_TYPE_GPS; + LOC_LOGe("GPS SVs can't be blacklisted."); + retVal = false; + break; + case GnssConstellationType::SBAS: + copyToSource.constellation = GNSS_SV_TYPE_SBAS; + LOC_LOGe("SBAS SVs can't be blacklisted."); + retVal = false; + break; + case GnssConstellationType::GLONASS: + copyToSource.constellation = GNSS_SV_TYPE_GLONASS; + svIdOffset = GNSS_SV_CONFIG_GLO_INITIAL_SV_ID - 1; + break; + case GnssConstellationType::QZSS: + copyToSource.constellation = GNSS_SV_TYPE_QZSS; + svIdOffset = 0; + break; + case GnssConstellationType::BEIDOU: + copyToSource.constellation = GNSS_SV_TYPE_BEIDOU; + svIdOffset = GNSS_SV_CONFIG_BDS_INITIAL_SV_ID - 1; + break; + case GnssConstellationType::GALILEO: + copyToSource.constellation = GNSS_SV_TYPE_GALILEO; + svIdOffset = GNSS_SV_CONFIG_GAL_INITIAL_SV_ID - 1; + break; + default: + copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; + LOC_LOGe("Invalid constellation %d", copyFromSource.constellation); + retVal = false; + break; + } + + if (copyToSource.svId > 0 && svIdOffset > 0) { + copyToSource.svId += svIdOffset; + } + + return retVal; +} + +// Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow. +Return GnssConfiguration::setEsExtensionSec(uint32_t emergencyExtensionSeconds) { + //TODO emergencyExtensionSeconds is not supporded in GnssConfig yet + return false; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/GnssConfiguration.h b/android/2.0/GnssConfiguration.h new file mode 100644 index 00000000..202a9fda --- /dev/null +++ b/android/2.0/GnssConfiguration.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ + + /* Copyright (C) 2016 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. + */ + + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSCONFIGURATION_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSSCONFIGURATION_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* + * Interface for passing GNSS configuration info from platform to HAL. + */ +struct Gnss; +struct GnssConfiguration : public V2_0::IGnssConfiguration { + GnssConfiguration(Gnss* gnss); + ~GnssConfiguration() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. + * These declarations were generated from IGnssConfiguration.hal. + */ + Return setSuplVersion(uint32_t version) override; + Return setSuplMode(uint8_t mode) override; + Return setSuplEs(bool enabled) override; + Return setLppProfile(uint8_t lppProfile) override; + Return setGlonassPositioningProtocol(uint8_t protocol) override; + Return setEmergencySuplPdn(bool enable) override; + Return setGpsLock(uint8_t lock) override; + + // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. + Return setBlacklist( + const hidl_vec& blacklist) override; + + // Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow. + Return setEsExtensionSec(uint32_t emergencyExtensionSeconds) override; + + private: + Gnss* mGnss = nullptr; + bool setBlacklistedSource( + GnssSvIdSource& copyToSource, + const GnssConfiguration::BlacklistedSource& copyFromSource); +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSCONFIGURATION_H diff --git a/android/2.0/GnssDebug.cpp b/android/2.0/GnssDebug.cpp new file mode 100644 index 00000000..582acc92 --- /dev/null +++ b/android/2.0/GnssDebug.cpp @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssDebugInterface" + +#include +#include +#include "Gnss.h" +#include "GnssDebug.h" +#include "LocationUtil.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::hidl_vec; + +#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000) +#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000) +#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500) +#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) + +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm + +GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) +{ +} + +/* + * This methods requests position, time and satellite ephemeris debug information + * from the HAL. + * + * @return void +*/ +Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) +{ + LOC_LOGD("%s]: ", __func__); + + DebugData data = { }; + + if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){ + LOC_LOGE("GnssDebug - Null GNSS interface"); + _hidl_cb(data); + return Void(); + } + + // get debug report snapshot via hal interface + GnssDebugReport reports = { }; + mGnss->getGnssInterface()->getDebugReport(reports); + + // location block + if (reports.mLocation.mValid) { + data.position.valid = true; + data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; + data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; + data.position.altitudeMeters = reports.mLocation.mLocation.altitude; + + data.position.speedMetersPerSec = + (double)(reports.mLocation.mLocation.speed); + data.position.bearingDegrees = + (double)(reports.mLocation.mLocation.bearing); + data.position.horizontalAccuracyMeters = + (double)(reports.mLocation.mLocation.accuracy); + data.position.verticalAccuracyMeters = + reports.mLocation.verticalAccuracyMeters; + data.position.speedAccuracyMetersPerSecond = + reports.mLocation.speedAccuracyMetersPerSecond; + data.position.bearingAccuracyDegrees = + reports.mLocation.bearingAccuracyDegrees; + + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; + gettimeofday(&tv_now, NULL); + data.position.ageSeconds = + (tv_now.tv_sec - tv_report.tv_sec) + + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + } + else { + data.position.valid = false; + } + + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + + // time block + if (reports.mTime.mValid) { + data.time.timeEstimate = reports.mTime.timeEstimate; + data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; + data.time.frequencyUncertaintyNsPerSec = + reports.mTime.frequencyUncertaintyNsPerSec; + } + + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { + data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; + } + if (data.time.timeUncertaintyNs <= 0 || + data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + } + if (data.time.frequencyUncertaintyNsPerSec <= 0 || + data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { + data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC; + } + + // satellite data block + SatelliteData s = { }; + std::vector s_array = { }; + + for (uint32_t i=0; i +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssDebug; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +/* Interface for GNSS Debug support. */ +struct Gnss; +struct GnssDebug : public IGnssDebug { + GnssDebug(Gnss* gnss); + ~GnssDebug() {}; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. + * These declarations were generated from IGnssDebug.hal. + */ + Return getDebugData(getDebugData_cb _hidl_cb) override; + +private: + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H diff --git a/android/2.0/GnssGeofencing.cpp b/android/2.0/GnssGeofencing.cpp new file mode 100644 index 00000000..b72d8353 --- /dev/null +++ b/android/2.0/GnssGeofencing.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "GnssHal_GnssGeofencing" + +#include +#include +#include "GnssGeofencing.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssGeofencing != nullptr) { + mGnssGeofencing->removeAllGeofences(); + } +} + +GnssGeofencing::GnssGeofencing() : mApi(nullptr) { + mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this); +} + +GnssGeofencing::~GnssGeofencing() { + if (mApi != nullptr) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. +Return GnssGeofencing::setCallback(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGd("mApi is NOT nullptr"); + return Void(); + } + + mApi = new GeofenceAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + } + + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient); + } + mGnssGeofencingCbIface = callback; + if (mGnssGeofencingCbIface != nullptr) { + mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssGeofencing::addGeofence( + int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceAdd( + geofenceId, + latitudeDegrees, + longitudeDegrees, + radiusMeters, + static_cast(lastTransition), + monitorTransitions, + notificationResponsivenessMs, + unknownTimerMs); + } + return Void(); +} + +Return GnssGeofencing::pauseGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofencePause(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceResume(geofenceId, monitorTransitions); + } + return Void(); +} + +Return GnssGeofencing::removeGeofence(int32_t geofenceId) { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + } else { + mApi->geofenceRemove(geofenceId); + } + return Void(); +} + +Return GnssGeofencing::removeAllGeofences() { + if (mApi == nullptr) { + LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__); + } else { + mApi->geofenceRemoveAll(); + } + return Void(); +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/GnssGeofencing.h b/android/2.0/GnssGeofencing.h new file mode 100644 index 00000000..caa56d06 --- /dev/null +++ b/android/2.0/GnssGeofencing.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::IGnssGeofencing; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class GeofenceAPIClient; +struct GnssGeofencing : public IGnssGeofencing { + GnssGeofencing(); + ~GnssGeofencing(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow. + * These declarations were generated from IGnssGeofencing.hal. + */ + Return setCallback(const sp& callback) override; + Return addGeofence(int32_t geofenceId, + double latitudeDegrees, + double longitudeDegrees, + double radiusMeters, + IGnssGeofenceCallback::GeofenceTransition lastTransition, + int32_t monitorTransitions, + uint32_t notificationResponsivenessMs, + uint32_t unknownTimerMs) override; + + Return pauseGeofence(int32_t geofenceId) override; + Return resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override; + Return removeGeofence(int32_t geofenceId) override; + + private: + // This method is not part of the IGnss base class. + // It is called by GnssGeofencingDeathRecipient to remove all geofences added so far. + Return removeAllGeofences(); + + private: + struct GnssGeofencingDeathRecipient : hidl_death_recipient { + GnssGeofencingDeathRecipient(sp gnssGeofencing) : + mGnssGeofencing(gnssGeofencing) { + } + ~GnssGeofencingDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssGeofencing; + }; + + private: + sp mGnssGeofencingDeathRecipient = nullptr; + sp mGnssGeofencingCbIface = nullptr; + GeofenceAPIClient* mApi = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSGEOFENCING_H diff --git a/android/2.0/GnssMeasurement.cpp b/android/2.0/GnssMeasurement.cpp new file mode 100644 index 00000000..5984a60a --- /dev/null +++ b/android/2.0/GnssMeasurement.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssMeasurementInterface" + +#include +#include "GnssMeasurement.h" +#include "MeasurementAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( + uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + if (mGnssMeasurement != nullptr) { + mGnssMeasurement->close(); + } +} + +GnssMeasurement::GnssMeasurement() { + mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this); + mApi = new MeasurementAPIClient(); +} + +GnssMeasurement::~GnssMeasurement() { + if (mApi) { + delete mApi; + mApi = nullptr; + } +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. +Return GnssMeasurement::setCallback( + const sp& callback) { + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface = callback; + mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0); + + return mApi->measurementSetCallback(callback); +} + +Return GnssMeasurement::close() { + if (mApi == nullptr) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return Void(); + } + + if (mGnssMeasurementCbIface != nullptr) { + mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface = nullptr; + } + if (mGnssMeasurementCbIface_1_1 != nullptr) { + mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface_1_1 = nullptr; + } + mApi->measurementClose(); + + return Void(); +} + +// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. +Return GnssMeasurement::setCallback_1_1( + const sp& callback, bool enableFullTracking) { + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface_1_1 != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (nullptr == mApi) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface_1_1 = callback; + mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0); + + GnssPowerMode powerMode = enableFullTracking? + GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2; + + return mApi->measurementSetCallback_1_1(callback, powerMode); +} +// Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow. +Return GnssMeasurement::setCallback_2_0( + const sp& callback, + bool enableFullTracking) { + return V1_0::IGnssMeasurement::GnssMeasurementStatus::SUCCESS; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/GnssMeasurement.h b/android/2.0/GnssMeasurement.h new file mode 100644 index 00000000..6f3480b8 --- /dev/null +++ b/android/2.0/GnssMeasurement.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +class MeasurementAPIClient; +struct GnssMeasurement : public V2_0::IGnssMeasurement { + GnssMeasurement(); + ~GnssMeasurement(); + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. + * These declarations were generated from IGnssMeasurement.hal. + */ + Return setCallback( + const sp& callback) override; + Return close() override; + + // Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. + Return setCallback_1_1( + const sp& callback, + bool enableFullTracking) override; + + // Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow. + Return setCallback_2_0( + const sp& callback, + bool enableFullTracking) override; + private: + struct GnssMeasurementDeathRecipient : hidl_death_recipient { + GnssMeasurementDeathRecipient(sp gnssMeasurement) : + mGnssMeasurement(gnssMeasurement) { + } + ~GnssMeasurementDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssMeasurement; + }; + + private: + sp mGnssMeasurementDeathRecipient = nullptr; + sp mGnssMeasurementCbIface = nullptr; + sp mGnssMeasurementCbIface_1_1 = nullptr; + MeasurementAPIClient* mApi; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSMEASUREMENT_H diff --git a/android/2.0/GnssNi.cpp b/android/2.0/GnssNi.cpp new file mode 100644 index 00000000..d65a488a --- /dev/null +++ b/android/2.0/GnssNi.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "LocSvc_GnssNiInterface" + +#include +#include "Gnss.h" +#include "GnssNi.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { + LOC_LOGE("%s] service died. cookie: %llu, who: %p", + __FUNCTION__, static_cast(cookie), &who); + // we do nothing here + // Gnss::GnssDeathRecipient will stop the session +} + +GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { + mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); +} + +// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. +Return GnssNi::setCallback(const sp& callback) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + mGnss->setGnssNiCb(callback); + + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); + } + mGnssNiCbIface = callback; + if (mGnssNiCbIface != nullptr) { + mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); + } + + return Void(); +} + +Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return Void(); + } + + GnssAPIClient* api = mGnss->getApi(); + if (api == nullptr) { + LOC_LOGE("%s]: api is nullptr", __FUNCTION__); + return Void(); + } + + api->gnssNiRespond(notifId, userResponse); + + return Void(); +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/GnssNi.h b/android/2.0/GnssNi.h new file mode 100644 index 00000000..26e281fb --- /dev/null +++ b/android/2.0/GnssNi.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H +#define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssNi; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::hardware::hidl_vec; +using ::android::hardware::hidl_string; +using ::android::sp; + +struct Gnss; +struct GnssNi : public IGnssNi { + GnssNi(Gnss* gnss); + ~GnssNi() = default; + + /* + * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. + * These declarations were generated from IGnssNi.hal. + */ + Return setCallback(const sp& callback) override; + Return respond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) override; + + private: + struct GnssNiDeathRecipient : hidl_death_recipient { + GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { + } + ~GnssNiDeathRecipient() = default; + virtual void serviceDied(uint64_t cookie, const wp& who) override; + sp mGnssNi; + }; + + private: + sp mGnssNiDeathRecipient = nullptr; + sp mGnssNiCbIface = nullptr; + Gnss* mGnss = nullptr; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H diff --git a/android/dummy/android.hardware.gnss@1.0-service-qti.rc b/android/2.0/android.hardware.gnss@2.0-service-qti.rc similarity index 50% rename from android/dummy/android.hardware.gnss@1.0-service-qti.rc rename to android/2.0/android.hardware.gnss@2.0-service-qti.rc index b5da6f97..36ee47c7 100644 --- a/android/dummy/android.hardware.gnss@1.0-service-qti.rc +++ b/android/2.0/android.hardware.gnss@2.0-service-qti.rc @@ -1,4 +1,4 @@ -service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti +service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti class hal user gps group system gps radio diff --git a/android/2.0/location_api/BatchingAPIClient.cpp b/android/2.0/location_api/BatchingAPIClient.cpp new file mode 100644 index 00000000..48caee6f --- /dev/null +++ b/android/2.0/location_api/BatchingAPIClient.cpp @@ -0,0 +1,196 @@ +/* Copyright (c) 2017-2019, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_BatchingAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "BatchingAPIClient.h" + +#include "limits.h" + + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssBatching; +using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask); + +BatchingAPIClient::BatchingAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssBatchingCbIface(callback), + mDefaultId(UINT_MAX), + mLocationCapabilitiesMask(0) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + if (mGnssBatchingCbIface != nullptr) { + locationCallbacks.batchingCb = [this](size_t count, Location* location, + BatchingOptions batchOptions) { + onBatchingCb(count, location, batchOptions); + }; + } + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +BatchingAPIClient::~BatchingAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +int BatchingAPIClient::getBatchSize() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + return locAPIGetBatchSize(); +} + +int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts) +{ + LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, + static_cast(opts.periodNanos), static_cast(opts.flags)); + int retVal = -1; + LocationOptions options; + convertBatchOption(opts, options, mLocationCapabilitiesMask); + + uint32_t mode = 0; + if (opts.flags == static_cast(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) { + mode = SESSION_MODE_ON_FULL; + } + if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +int BatchingAPIClient::stopSession() +{ + LOC_LOGD("%s]: ", __FUNCTION__); + int retVal = -1; + if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) { + retVal = 1; + } + return retVal; +} + +void BatchingAPIClient::getBatchedLocation(int last_n_locations) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations); + locAPIGetBatchedLocations(mDefaultId, last_n_locations); +} + +void BatchingAPIClient::flushBatchedLocations() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); +} + +void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; +} + +void BatchingAPIClient::onBatchingCb(size_t count, Location* location, + BatchingOptions /*batchOptions*/) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); + if (mGnssBatchingCbIface != nullptr && count > 0) { + hidl_vec locationVec; + locationVec.resize(count); + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i]); + } + auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s", + __func__, r.description().c_str()); + } + } +} + +static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, + LocationCapabilitiesMask mask) +{ + memset(&out, 0, sizeof(LocationOptions)); + out.size = sizeof(LocationOptions); + out.minInterval = (uint32_t)(in.periodNanos / 1000000L); + out.minDistance = 0; + out.mode = GNSS_SUPL_MODE_STANDALONE; + if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + out.mode = GNSS_SUPL_MODE_MSA; + if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + out.mode = GNSS_SUPL_MODE_MSB; +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/location_api/BatchingAPIClient.h b/android/2.0/location_api/BatchingAPIClient.h new file mode 100644 index 00000000..33a8c2ef --- /dev/null +++ b/android/2.0/location_api/BatchingAPIClient.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2017-2019, 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 BATCHING_API_CLINET_H +#define BATCHING_API_CLINET_H + +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +class BatchingAPIClient : public LocationAPIClientBase +{ +public: + BatchingAPIClient(const sp& callback); + ~BatchingAPIClient(); + int getBatchSize(); + int startSession(const V1_0::IGnssBatching::Options& options); + int updateSessionOptions(const V1_0::IGnssBatching::Options& options); + int stopSession(); + void getBatchedLocation(int last_n_locations); + void flushBatchedLocations(); + + inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; } + + // callbacks + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; + +private: + sp mGnssBatchingCbIface; + uint32_t mDefaultId; + LocationCapabilitiesMask mLocationCapabilitiesMask; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // BATCHING_API_CLINET_H diff --git a/android/2.0/location_api/GeofenceAPIClient.cpp b/android/2.0/location_api/GeofenceAPIClient.cpp new file mode 100644 index 00000000..fabf8bb1 --- /dev/null +++ b/android/2.0/location_api/GeofenceAPIClient.cpp @@ -0,0 +1,275 @@ +/* Copyright (c) 2017-2019, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_GeofenceApiClient" + +#include +#include + +#include "LocationUtil.h" +#include "GeofenceAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +GeofenceAPIClient::GeofenceAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssGeofencingCbIface(callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + + locationCallbacks.geofenceBreachCb = nullptr; + if (mGnssGeofencingCbIface != nullptr) { + locationCallbacks.geofenceBreachCb = + [this](GeofenceBreachNotification geofenceBreachNotification) { + onGeofenceBreachCb(geofenceBreachNotification); + }; + + locationCallbacks.geofenceStatusCb = + [this](GeofenceStatusNotification geofenceStatusNotification) { + onGeofenceStatusCb(geofenceStatusNotification); + }; + } + + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms) +{ + LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__, + geofence_id, latitude, longitude, radius_meters, + last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms); + + GeofenceOption options; + memset(&options, 0, sizeof(GeofenceOption)); + options.size = sizeof(GeofenceOption); + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) + options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) + options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT; + options.responsiveness = notification_responsiveness_ms; + + GeofenceInfo data; + data.size = sizeof(GeofenceInfo); + data.latitude = latitude; + data.longitude = longitude; + data.radius = radius_meters; + + LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data); + if (LOCATION_ERROR_SUCCESS != err) { + onAddGeofencesCb(1, &err, &geofence_id); + } +} + +void GeofenceAPIClient::geofencePause(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); + locAPIPauseGeofences(1, &geofence_id); +} + +void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions); + GeofenceBreachTypeMask mask = 0; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED) + mask |= GEOFENCE_BREACH_ENTER_BIT; + if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED) + mask |= GEOFENCE_BREACH_EXIT_BIT; + locAPIResumeGeofences(1, &geofence_id, &mask); +} + +void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id); + locAPIRemoveGeofences(1, &geofence_id); +} + +void GeofenceAPIClient::geofenceRemoveAll() +{ + LOC_LOGD("%s]", __FUNCTION__); + // TODO locAPIRemoveAllGeofences(); +} + +// callbacks +void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < geofenceBreachNotification.count; i++) { + GnssLocation gnssLocation; + convertGnssLocation(geofenceBreachNotification.location, gnssLocation); + + IGnssGeofenceCallback::GeofenceTransition transition; + if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER) + transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED; + else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT) + transition = IGnssGeofenceCallback::GeofenceTransition::EXITED; + else { + // continue with other breach if transition is + // nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED + continue; + } + + auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb( + geofenceBreachNotification.ids[i], gnssLocation, transition, + static_cast(geofenceBreachNotification.timestamp)); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available); + if (mGnssGeofencingCbIface != nullptr) { + IGnssGeofenceCallback::GeofenceAvailability status = + IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE; + if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) { + status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE; + } + GnssLocation gnssLocation; + memset(&gnssLocation, 0, sizeof(GnssLocation)); + auto r = mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_EXISTS) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS; + auto r = mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) +{ + LOC_LOGD("%s]: (%zu)", __FUNCTION__, count); + if (mGnssGeofencingCbIface != nullptr) { + for (size_t i = 0; i < count; i++) { + IGnssGeofenceCallback::GeofenceStatus status = + IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC; + if (errors[i] == LOCATION_ERROR_SUCCESS) + status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS; + else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN) + status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN; + auto r = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/location_api/GeofenceAPIClient.h b/android/2.0/location_api/GeofenceAPIClient.h new file mode 100644 index 00000000..71049de6 --- /dev/null +++ b/android/2.0/location_api/GeofenceAPIClient.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2017-2019, 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 GEOFENCE_API_CLINET_H +#define GEOFENCE_API_CLINET_H + + +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::sp; + +class GeofenceAPIClient : public LocationAPIClientBase +{ +public: + GeofenceAPIClient(const sp& callback); + virtual ~GeofenceAPIClient() = default; + + void geofenceAdd(uint32_t geofence_id, double latitude, double longitude, + double radius_meters, int32_t last_transition, int32_t monitor_transitions, + uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms); + void geofencePause(uint32_t geofence_id); + void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions); + void geofenceRemove(uint32_t geofence_id); + void geofenceRemoveAll(); + + // callbacks + void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final; + void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final; + void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final; + +private: + sp mGnssGeofencingCbIface; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // GEOFENCE_API_CLINET_H diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp new file mode 100644 index 00000000..ceb0aa47 --- /dev/null +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -0,0 +1,565 @@ +/* Copyright (c) 2017-2019, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_GnssAPIClient" +#define SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC (590 * 60 * 60 * 1000) // 590 hours + +#include +#include + +#include "LocationUtil.h" +#include "GnssAPIClient.h" +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnss; +using ::android::hardware::gnss::V1_0::IGnssCallback; +using ::android::hardware::gnss::V1_0::IGnssNiCallback; +using ::android::hardware::gnss::V1_0::GnssLocation; + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); + +GnssAPIClient::GnssAPIClient(const sp& gpsCb, + const sp& niCb) : + LocationAPIClientBase(), + mGnssCbIface(nullptr), + mGnssNiCbIface(nullptr), + mControlClient(new LocationAPIControlClient()), + mLocationCapabilitiesMask(0), + mLocationCapabilitiesCached(false) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + // set default LocationOptions. + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = 1000; + mTrackingOptions.minDistance = 0; + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; + + gnssUpdateCallbacks(gpsCb, niCb); +} + +GnssAPIClient::~GnssAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient) { + delete mControlClient; + mControlClient = nullptr; + } +} + +// for GpsInterface +void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb) +{ + LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); + + mMutex.lock(); + mGnssCbIface = gpsCb; + mGnssNiCbIface = niCb; + mMutex.unlock(); + + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.trackingCb = [this](Location location) { + onTrackingCb(location); + }; + } + + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + + locationCallbacks.gnssNiCb = nullptr; + loc_core::ContextBase* context = + loc_core::LocDualContext::getLocFgContext( + NULL, NULL, + loc_core::LocDualContext::mLocationHalName, false); + if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { + LOC_LOGD("Registering NI CB"); + locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { + onGnssNiCb(id, gnssNiNotification); + }; + } + + locationCallbacks.gnssSvCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { + onGnssSvCb(gnssSvNotification); + }; + } + + locationCallbacks.gnssNmeaCb = nullptr; + if (mGnssCbIface != nullptr) { + locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { + onGnssNmeaCb(gnssNmeaNotification); + }; + } + + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +bool GnssAPIClient::gnssStart() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStartTracking(mTrackingOptions); + return retVal; +} + +bool GnssAPIClient::gnssStop() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + bool retVal = true; + locAPIStopTracking(); + return retVal; +} + +bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, + IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) +{ + LOC_LOGD("%s]: (%d %d %d %d %d %d %d)", __FUNCTION__, + (int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, + preferredTimeMs, (int)powerMode, timeBetweenMeasurement); + bool retVal = true; + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = minIntervalMs; + if (IGnss::GnssPositionMode::MS_ASSISTED == mode || + IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) { + // We set a very large interval to simulate SINGLE mode. Once we report a fix, + // the caller should take the responsibility to stop the session. + // For MSA, we always treat it as SINGLE mode. + mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; + } + mTrackingOptions.minDistance = preferredAccuracyMeters; + if (mode == IGnss::GnssPositionMode::STANDALONE) + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; + else if (mode == IGnss::GnssPositionMode::MS_BASED) + mTrackingOptions.mode = GNSS_SUPL_MODE_MSB; + else if (mode == IGnss::GnssPositionMode::MS_ASSISTED) + mTrackingOptions.mode = GNSS_SUPL_MODE_MSA; + else { + LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode); + retVal = false; + } + if (GNSS_POWER_MODE_INVALID != powerMode) { + mTrackingOptions.powerMode = powerMode; + mTrackingOptions.tbm = timeBetweenMeasurement; + } + locAPIUpdateTrackingOptions(mTrackingOptions); + return retVal; +} + +// for GpsNiInterface +void GnssAPIClient::gnssNiRespond(int32_t notifId, + IGnssNiCallback::GnssUserResponseType userResponse) +{ + LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast(userResponse)); + GnssNiResponse data; + switch (userResponse) { + case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT: + data = GNSS_NI_RESPONSE_ACCEPT; + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY: + data = GNSS_NI_RESPONSE_DENY; + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP: + data = GNSS_NI_RESPONSE_NO_RESPONSE; + break; + default: + data = GNSS_NI_RESPONSE_IGNORE; + break; + } + + locAPIGnssNiResponse(notifId, data); +} + +// these apis using LocationAPIControlClient +void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) +{ + LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags); + if (mControlClient == nullptr) { + return; + } + GnssAidingData data; + memset(&data, 0, sizeof (GnssAidingData)); + data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT | + GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT | + GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | + GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; + + if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) + data.deleteAll = true; + else { + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS) + data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC) + data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION) + data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME) + data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO) + data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC) + data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH) + data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR) + data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER) + data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA) + data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI) + data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT; + if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO) + data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT; + } + mControlClient->locAPIGnssDeleteAidingData(data); +} + +void GnssAPIClient::gnssEnable(LocationTechnologyType techType) +{ + LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIEnable(techType); +} + +void GnssAPIClient::gnssDisable() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIDisable(); +} + +void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags); + if (mControlClient == nullptr) { + return; + } + mControlClient->locAPIGnssUpdateConfig(gnssConfig); +} + +void GnssAPIClient::requestCapabilities() { + // only send capablities if it's already cached, otherwise the first time LocationAPI + // is initialized, capabilities will be sent by LocationAPI + if (mLocationCapabilitiesCached) { + onCapabilitiesCb(mLocationCapabilitiesMask); + } +} + +// callbacks +void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) +{ + LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask); + mLocationCapabilitiesMask = capabilitiesMask; + mLocationCapabilitiesCached = true; + + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + uint32_t data = 0; + if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) || + (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) + data |= IGnssCallback::Capabilities::SCHEDULING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) + data |= IGnssCallback::Capabilities::GEOFENCING; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) + data |= IGnssCallback::Capabilities::MEASUREMENTS; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) + data |= IGnssCallback::Capabilities::MSB; + if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) + data |= IGnssCallback::Capabilities::MSA; + auto r = gnssCbIface->gnssSetCapabilitesCb(data); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", + __func__, r.description().c_str()); + } + } + if (gnssCbIface != nullptr) { + IGnssCallback::GnssSystemInfo gnssInfo; + if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || + capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) { + gnssInfo.yearOfHw = 2018; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { + gnssInfo.yearOfHw = 2017; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) { + gnssInfo.yearOfHw = 2016; + } else { + gnssInfo.yearOfHw = 2015; + } + LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); + auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onTrackingCb(Location location) +{ + LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + GnssLocation gnssLocation; + convertGnssLocation(location, gnssLocation); + auto r = gnssCbIface->gnssLocationCb(gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) +{ + LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id); + mMutex.lock(); + auto gnssNiCbIface(mGnssNiCbIface); + mMutex.unlock(); + + if (gnssNiCbIface == nullptr) { + LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__); + return; + } + + IGnssNiCallback::GnssNiNotification notificationGnss = {}; + + notificationGnss.notificationId = id; + + if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL; + else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE) + notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE; + else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL) + notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL; + + if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY; + if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY; + if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT) + notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE; + + notificationGnss.timeoutSec = gnssNiNotification.timeout; + + if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY; + else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE || + gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE) + notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP; + + notificationGnss.requestorId = gnssNiNotification.requestor; + + notificationGnss.notificationMessage = gnssNiNotification.message; + + if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.requestorIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_NONE; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8; + else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2) + notificationGnss.notificationIdEncoding = + IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2; + + gnssNiCbIface->niNotifyCb(notificationGnss); +} + +void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) +{ + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + IGnssCallback::GnssSvStatus svStatus; + convertGnssSvStatus(gnssSvNotification, svStatus); + auto r = gnssCbIface->gnssSvStatusCb(svStatus); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSvStatusCb description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) +{ + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (gnssCbIface != nullptr) { + const std::string s(gnssNmeaNotification.nmea); + std::stringstream ss(s); + std::string each; + while(std::getline(ss, each, '\n')) { + each += '\n'; + android::hardware::hidl_string nmeaString; + nmeaString.setToExternal(each.c_str(), each.length()); + auto r = gnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, + gnssNmeaNotification.nmea, gnssNmeaNotification.length, + r.description().c_str()); + } + } + } +} + +void GnssAPIClient::onStartTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", + __func__, r.description().c_str()); + } + } +} + +void GnssAPIClient::onStopTrackingCb(LocationError error) +{ + LOC_LOGD("%s]: (%d)", __FUNCTION__, error); + mMutex.lock(); + auto gnssCbIface(mGnssCbIface); + mMutex.unlock(); + + if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", + __func__, r.description().c_str()); + } + } +} + +static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out) +{ + memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); + out.numSvs = in.count; + if (out.numSvs > static_cast(V1_0::GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.", + __FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT); + out.numSvs = static_cast(V1_0::GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.numSvs; i++) { + IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; + info.svid = in.gnssSvs[i].svId; + convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); + info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; + info.elevationDegrees = in.gnssSvs[i].elevation; + info.azimuthDegrees = in.gnssSvs[i].azimuth; + info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; + info.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT) + info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; + } +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/location_api/GnssAPIClient.h b/android/2.0/location_api/GnssAPIClient.h new file mode 100644 index 00000000..a129cee1 --- /dev/null +++ b/android/2.0/location_api/GnssAPIClient.h @@ -0,0 +1,108 @@ +/* Copyright (c) 2017-2019, 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 GNSS_API_CLINET_H +#define GNSS_API_CLINET_H + + +#include +#include +//#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::sp; + +class GnssAPIClient : public LocationAPIClientBase +{ +public: + GnssAPIClient(const sp& gpsCb, + const sp& niCb); + virtual ~GnssAPIClient(); + GnssAPIClient(const GnssAPIClient&) = delete; + GnssAPIClient& operator=(const GnssAPIClient&) = delete; + + // for GpsInterface + void gnssUpdateCallbacks(const sp& gpsCb, + const sp& niCb); + bool gnssStart(); + bool gnssStop(); + bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode, + V1_0::IGnss::GnssPositionRecurrence recurrence, + uint32_t minIntervalMs, + uint32_t preferredAccuracyMeters, + uint32_t preferredTimeMs, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = 0); + + // for GpsNiInterface + void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse); + + // these apis using LocationAPIControlClient + void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags); + void gnssEnable(LocationTechnologyType techType); + void gnssDisable(); + void gnssConfigurationUpdate(const GnssConfig& gnssConfig); + + inline LocationCapabilitiesMask gnssGetCapabilities() const { + return mLocationCapabilitiesMask; + } + void requestCapabilities(); + + // callbacks we are interested in + void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; + void onTrackingCb(Location location) final; + void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final; + void onGnssSvCb(GnssSvNotification gnssSvNotification) final; + void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final; + + void onStartTrackingCb(LocationError error) final; + void onStopTrackingCb(LocationError error) final; + +private: + sp mGnssCbIface; + sp mGnssNiCbIface; + std::mutex mMutex; + LocationAPIControlClient* mControlClient; + LocationCapabilitiesMask mLocationCapabilitiesMask; + bool mLocationCapabilitiesCached; + TrackingOptions mTrackingOptions; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // GNSS_API_CLINET_H diff --git a/android/2.0/location_api/LocationUtil.cpp b/android/2.0/location_api/LocationUtil.cpp new file mode 100644 index 00000000..c921154e --- /dev/null +++ b/android/2.0/location_api/LocationUtil.cpp @@ -0,0 +1,206 @@ +/* Copyright (c) 2017-2019, 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 + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::V1_0::GnssConstellationType; +using ::android::hardware::gnss::V1_0::GnssLocationFlags; + +void convertGnssLocation(Location& in, GnssLocation& out) +{ + memset(&out, 0, sizeof(GnssLocation)); + if (in.flags & LOCATION_HAS_LAT_LONG_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG; + out.latitudeDegrees = in.latitude; + out.longitudeDegrees = in.longitude; + } + if (in.flags & LOCATION_HAS_ALTITUDE_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE; + out.altitudeMeters = in.altitude; + } + if (in.flags & LOCATION_HAS_SPEED_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED; + out.speedMetersPerSec = in.speed; + } + if (in.flags & LOCATION_HAS_BEARING_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING; + out.bearingDegrees = in.bearing; + } + if (in.flags & LOCATION_HAS_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY; + out.horizontalAccuracyMeters = in.accuracy; + } + if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY; + out.verticalAccuracyMeters = in.verticalAccuracy; + } + if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY; + out.speedAccuracyMetersPerSecond = in.speedAccuracy; + } + if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT) { + out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY; + out.bearingAccuracyDegrees = in.bearingAccuracy; + } + + out.timestamp = static_cast(in.timestamp); +} + +void convertGnssLocation(const GnssLocation& in, Location& out) +{ + memset(&out, 0, sizeof(out)); + if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) { + out.flags |= LOCATION_HAS_LAT_LONG_BIT; + out.latitude = in.latitudeDegrees; + out.longitude = in.longitudeDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE) { + out.flags |= LOCATION_HAS_ALTITUDE_BIT; + out.altitude = in.altitudeMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED) { + out.flags |= LOCATION_HAS_SPEED_BIT; + out.speed = in.speedMetersPerSec; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING) { + out.flags |= LOCATION_HAS_BEARING_BIT; + out.bearing = in.bearingDegrees; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY) { + out.flags |= LOCATION_HAS_ACCURACY_BIT; + out.accuracy = in.horizontalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY) { + out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT; + out.verticalAccuracy = in.verticalAccuracyMeters; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY) { + out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT; + out.speedAccuracy = in.speedAccuracyMetersPerSecond; + } + if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY) { + out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT; + out.bearingAccuracy = in.bearingAccuracyDegrees; + } + + out.timestamp = static_cast(in.timestamp); +} + +void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) +{ + switch(in) { + case GNSS_SV_TYPE_GPS: + out = GnssConstellationType::GPS; + break; + case GNSS_SV_TYPE_SBAS: + out = GnssConstellationType::SBAS; + break; + case GNSS_SV_TYPE_GLONASS: + out = GnssConstellationType::GLONASS; + break; + case GNSS_SV_TYPE_QZSS: + out = GnssConstellationType::QZSS; + break; + case GNSS_SV_TYPE_BEIDOU: + out = GnssConstellationType::BEIDOU; + break; + case GNSS_SV_TYPE_GALILEO: + out = GnssConstellationType::GALILEO; + break; + case GNSS_SV_TYPE_UNKNOWN: + default: + out = GnssConstellationType::UNKNOWN; + break; + } +} + +void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out) +{ + switch(in) { + case GNSS_EPH_TYPE_EPHEMERIS: + out = GnssDebug::SatelliteEphemerisType::EPHEMERIS; + break; + case GNSS_EPH_TYPE_ALMANAC: + out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY; + break; + case GNSS_EPH_TYPE_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE; + break; + } +} + +void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out) +{ + switch(in) { + case GNSS_EPH_SOURCE_DEMODULATED: + out = GnssDebug::SatelliteEphemerisSource::DEMODULATED; + break; + case GNSS_EPH_SOURCE_SUPL_PROVIDED: + out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED; + break; + case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED: + out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED; + break; + case GNSS_EPH_SOURCE_LOCAL: + case GNSS_EPH_SOURCE_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisSource::OTHER; + break; + } +} + +void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out) +{ + switch(in) { + case GNSS_EPH_HEALTH_GOOD: + out = GnssDebug::SatelliteEphemerisHealth::GOOD; + break; + case GNSS_EPH_HEALTH_BAD: + out = GnssDebug::SatelliteEphemerisHealth::BAD; + break; + case GNSS_EPH_HEALTH_UNKNOWN: + default: + out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN; + break; + } +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/location_api/LocationUtil.h b/android/2.0/location_api/LocationUtil.h new file mode 100644 index 00000000..c6f5eadc --- /dev/null +++ b/android/2.0/location_api/LocationUtil.h @@ -0,0 +1,55 @@ +/* Copyright (c) 2017-2019, 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 LOCATION_UTIL_H +#define LOCATION_UTIL_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); +void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); +void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); +void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); +void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // LOCATION_UTIL_H diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp new file mode 100644 index 00000000..bcc22342 --- /dev/null +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -0,0 +1,320 @@ +/* Copyright (c) 2017-2019, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_MeasurementAPIClient" + +#include +#include + +#include "LocationUtil.h" +#include "MeasurementAPIClient.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V2_0::IGnssMeasurementCallback; + +static void convertGnssData(GnssMeasurementsNotification& in, + V1_0::IGnssMeasurementCallback::GnssData& out); +static void convertGnssData_1_1(GnssMeasurementsNotification& in, + V1_1::IGnssMeasurementCallback::GnssData& out); +static void convertGnssMeasurement(GnssMeasurementsData& in, + V1_0::IGnssMeasurementCallback::GnssMeasurement& out); +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); + +MeasurementAPIClient::MeasurementAPIClient() : + mGnssMeasurementCbIface(nullptr), + mGnssMeasurementCbIface_1_1(nullptr), + mTracking(false) +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +MeasurementAPIClient::~MeasurementAPIClient() +{ + LOC_LOGD("%s]: ()", __FUNCTION__); +} + +// for GpsInterface +Return +MeasurementAPIClient::measurementSetCallback(const sp& callback) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + + mMutex.lock(); + mGnssMeasurementCbIface = callback; + mMutex.unlock(); + + return startTracking(); +} + +Return +MeasurementAPIClient::measurementSetCallback_1_1( + const sp& callback, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) +{ + LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)", + __FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement); + + mMutex.lock(); + mGnssMeasurementCbIface_1_1 = callback; + mMutex.unlock(); + + return startTracking(powerMode, timeBetweenMeasurement); +} + +Return +MeasurementAPIClient::startTracking( + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) +{ + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + + locationCallbacks.gnssMeasurementsCb = nullptr; + if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) { + locationCallbacks.gnssMeasurementsCb = + [this](GnssMeasurementsNotification gnssMeasurementsNotification) { + onGnssMeasurementsCb(gnssMeasurementsNotification); + }; + } + + locAPISetCallbacks(locationCallbacks); + + TrackingOptions options = {}; + memset(&options, 0, sizeof(TrackingOptions)); + options.size = sizeof(TrackingOptions); + options.minInterval = 1000; + options.mode = GNSS_SUPL_MODE_STANDALONE; + if (GNSS_POWER_MODE_INVALID != powerMode) { + options.powerMode = powerMode; + options.tbm = timeBetweenMeasurement; + } + + mTracking = true; + LOC_LOGD("%s]: start tracking session", __FUNCTION__); + locAPIStartTracking(options); + return IGnssMeasurement::GnssMeasurementStatus::SUCCESS; +} + +// for GpsMeasurementInterface +void MeasurementAPIClient::measurementClose() { + LOC_LOGD("%s]: ()", __FUNCTION__); + mTracking = false; + locAPIStopTracking(); +} + +// callbacks +void MeasurementAPIClient::onGnssMeasurementsCb( + GnssMeasurementsNotification gnssMeasurementsNotification) +{ + LOC_LOGD("%s]: (count: %zu active: %d)", + __FUNCTION__, gnssMeasurementsNotification.count, mTracking); + if (mTracking) { + mMutex.lock(); + sp gnssMeasurementCbIface = nullptr; + sp gnssMeasurementCbIface_1_1 = nullptr; + if (mGnssMeasurementCbIface_1_1 != nullptr) { + gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1; + } else if (mGnssMeasurementCbIface != nullptr) { + gnssMeasurementCbIface = mGnssMeasurementCbIface; + } + mMutex.unlock(); + + if (gnssMeasurementCbIface_1_1 != nullptr) { + V1_1::IGnssMeasurementCallback::GnssData gnssData; + convertGnssData_1_1(gnssMeasurementsNotification, gnssData); + auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } + } else if (gnssMeasurementCbIface != nullptr) { + V1_0::IGnssMeasurementCallback::GnssData gnssData; + convertGnssData(gnssMeasurementsNotification, gnssData); + auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from GnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } + } + } +} + +static void convertGnssMeasurement(GnssMeasurementsData& in, + V1_0::IGnssMeasurementCallback::GnssMeasurement& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement)); + if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE; + if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT) + out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL; + out.svid = in.svId; + convertGnssConstellationType(in.svType, out.constellation); + out.timeOffsetNs = in.timeOffsetNs; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC; + if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) + out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC; + out.receivedSvTimeInNs = in.receivedSvTimeNs; + out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs; + out.cN0DbHz = in.carrierToNoiseDbHz; + out.pseudorangeRateMps = in.pseudorangeRateMps; + out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + out.accumulatedDeltaRangeM = in.adrMeters; + out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters; + out.carrierFrequencyHz = in.carrierFrequencyHz; + out.carrierCycles = in.carrierCycles; + out.carrierPhase = in.carrierPhase; + out.carrierPhaseUncertainty = in.carrierPhaseUncertainty; + uint8_t indicator = + static_cast(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN); + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT; + if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT) + indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT; + out.multipathIndicator = + static_cast(indicator); + out.snrDb = in.signalToNoiseRatioDb; + out.agcLevelDb = in.agcLevelDb; +} + +static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out) +{ + memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock)); + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT; + if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT) + out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY; + out.leapSecond = in.leapSecond; + out.timeNs = in.timeNs; + out.timeUncertaintyNs = in.timeUncertaintyNs; + out.fullBiasNs = in.fullBiasNs; + out.biasNs = in.biasNs; + out.biasUncertaintyNs = in.biasUncertaintyNs; + out.driftNsps = in.driftNsps; + out.driftUncertaintyNsps = in.driftUncertaintyNsps; + out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount; +} + +static void convertGnssData(GnssMeasurementsNotification& in, + V1_0::IGnssMeasurementCallback::GnssData& out) +{ + out.measurementCount = in.count; + if (out.measurementCount > static_cast(V1_0::GnssMax::SVS_COUNT)) { + LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.", + __FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT); + out.measurementCount = static_cast(V1_0::GnssMax::SVS_COUNT); + } + for (size_t i = 0; i < out.measurementCount; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i]); + } + convertGnssClock(in.clock, out.clock); +} + +static void convertGnssData_1_1(GnssMeasurementsNotification& in, + V1_1::IGnssMeasurementCallback::GnssData& out) +{ + out.measurements.resize(in.count); + for (size_t i = 0; i < in.count; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0); + } + convertGnssClock(in.clock, out.clock); +} + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/2.0/location_api/MeasurementAPIClient.h b/android/2.0/location_api/MeasurementAPIClient.h new file mode 100644 index 00000000..db2c2fa1 --- /dev/null +++ b/android/2.0/location_api/MeasurementAPIClient.h @@ -0,0 +1,84 @@ +/* Copyright (c) 2017-2019, 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 MEASUREMENT_API_CLINET_H +#define MEASUREMENT_API_CLINET_H + +#include +#include +//#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace V2_0 { +namespace implementation { + +using ::android::sp; + +class MeasurementAPIClient : public LocationAPIClientBase +{ +public: + MeasurementAPIClient(); + virtual ~MeasurementAPIClient(); + MeasurementAPIClient(const MeasurementAPIClient&) = delete; + MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete; + + // for GpsMeasurementInterface + Return measurementSetCallback( + const sp& callback); + Return measurementSetCallback_1_1( + const sp& callback, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); + void measurementClose(); + Return startTracking( + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); + + // callbacks we are interested in + void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; + +private: + std::mutex mMutex; + sp mGnssMeasurementCbIface; + sp mGnssMeasurementCbIface_1_1; + + bool mTracking; +}; + +} // namespace implementation +} // namespace V2_0 +} // namespace gnss +} // namespace hardware +} // namespace android +#endif // MEASUREMENT_API_CLINET_H diff --git a/android/2.0/service.cpp b/android/2.0/service.cpp new file mode 100644 index 00000000..1fdccabe --- /dev/null +++ b/android/2.0/service.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Not a Contribution + */ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "android.hardware.gnss@2.0-service-qti" + +#include +#include +#include "loc_cfg.h" + +extern "C" { +#include "vndfwk-detect.h" +} +using android::hardware::gnss::V2_0::IGnss; +using android::hardware::defaultPassthroughServiceImplementation; + +int main() { + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + setVendorEnhanced(vendorEnhanced); + + if (!vendorEnhanced) { + return defaultPassthroughServiceImplementation(); + } else { + return -1; + } +} diff --git a/android/Android.mk b/android/Android.mk index bff117ed..c1bdd594 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,5 +1,8 @@ LOCAL_PATH := $(call my-dir) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifeq ($(GNSS_HIDL_VERSION),2.0) +include $(LOCAL_PATH)/2.0/Android.mk +else ifeq ($(GNSS_HIDL_VERSION),1.1) include $(LOCAL_PATH)/1.1/Android.mk else @@ -7,4 +10,6 @@ include $(LOCAL_PATH)/1.0/Android.mk endif else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti include $(LOCAL_PATH)/dummy/Android.mk +endif + endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/android/dummy/Android.mk b/android/dummy/Android.mk index d4388888..05114e18 100644 --- a/android/dummy/Android.mk +++ b/android/dummy/Android.mk @@ -1,9 +1,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -#build dummy android.hardware.gnss@1.0-impl-qti +#build dummy android.hardware.gnss@2.0-impl-qti include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := GnssDummy.cpp @@ -20,19 +20,11 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_SHARED_LIBRARY) -BUILD_GNSS_HIDL_SERVICE := true -ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) -ifneq ($(LW_FEATURE_SET),true) -#BUILD_GNSS_HIDL_SERVICE := false -endif # LW_FEATURE_SET -endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET - -ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_MODULE := android.hardware.gnss@2.0-service-qti LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc +LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc LOCAL_SRC_FILES := \ serviceDummy.cpp \ @@ -60,4 +52,3 @@ LOCAL_SHARED_LIBRARIES += \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) -endif # BUILD_GNSS_HIDL_SERVICE diff --git a/android/dummy/android.hardware.gnss@2.0-service-qti.rc b/android/dummy/android.hardware.gnss@2.0-service-qti.rc new file mode 100644 index 00000000..36ee47c7 --- /dev/null +++ b/android/dummy/android.hardware.gnss@2.0-service-qti.rc @@ -0,0 +1,4 @@ +service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti + class hal + user gps + group system gps radio diff --git a/android/measurement_corrections/1.0/MeasurementCorrections.cpp b/android/measurement_corrections/1.0/MeasurementCorrections.cpp new file mode 100644 index 00000000..bca4c45f --- /dev/null +++ b/android/measurement_corrections/1.0/MeasurementCorrections.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019, 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_TAG "LocSvc_MeasurementCorrectionsInterface" + +#include +#include "MeasurementCorrections.h" + +namespace android { +namespace hardware { +namespace gnss { +namespace measurement_corrections { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; + +MeasurementCorrections::MeasurementCorrections() { +} + +MeasurementCorrections::~MeasurementCorrections() { +} + +Return MeasurementCorrections::setCorrections(const ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections& corrections) { + return true; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace measurement_corrections +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/measurement_corrections/1.0/MeasurementCorrections.h b/android/measurement_corrections/1.0/MeasurementCorrections.h new file mode 100644 index 00000000..231c5349 --- /dev/null +++ b/android/measurement_corrections/1.0/MeasurementCorrections.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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 ANDROID_HARDWARE_GNSS_V1_0_MeasurementCorrections_H +#define ANDROID_HARDWARE_GNSS_V1_0_MeasurementCorrections_H + +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace measurement_corrections { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; +using ::android::hardware::gnss::V1_0::GnssLocation; + +struct MeasurementCorrections : public IMeasurementCorrections { + MeasurementCorrections(); + ~MeasurementCorrections(); + +// Methods from ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections follow. +Return setCorrections(const ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections& corrections) override; + +}; + + +} // namespace implementation +} // namespace V1_0 +} // namespace measurement_corrections +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_MeasurementCorrections_H diff --git a/android/visibility_control/1.0/GnssVisibilityControl.cpp b/android/visibility_control/1.0/GnssVisibilityControl.cpp new file mode 100644 index 00000000..5608050e --- /dev/null +++ b/android/visibility_control/1.0/GnssVisibilityControl.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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 "GnssVisibilityControl.h" +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace visibility_control { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +GnssVisibilityControl::GnssVisibilityControl() {} +GnssVisibilityControl::~GnssVisibilityControl() {} + +// Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow. +Return GnssVisibilityControl::enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) { + return true; +} +/** + * Registers the callback for HAL implementation to use. + * + * @param callback Handle to IGnssVisibilityControlCallback interface. + */ +Return GnssVisibilityControl::setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) { + return true; +} + +} // namespace implementation +} // namespace V1_0 +} // namespace visibility_control +} // namespace gnss +} // namespace hardware +} // namespace android diff --git a/android/visibility_control/1.0/GnssVisibilityControl.h b/android/visibility_control/1.0/GnssVisibilityControl.h new file mode 100644 index 00000000..30233476 --- /dev/null +++ b/android/visibility_control/1.0/GnssVisibilityControl.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2019, 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 ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H +#define ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H + +#include +#include +#include + +#include + +namespace android { +namespace hardware { +namespace gnss { +namespace visibility_control { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +struct GnssVisibilityControl : public IGnssVisibilityControl { + GnssVisibilityControl(); + ~GnssVisibilityControl(); + + // Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow. + Return enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) override; + /** + * Registers the callback for HAL implementation to use. + * + * @param callback Handle to IGnssVisibilityControlCallback interface. + */ + Return setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) override; + +}; + + +} // namespace implementation +} // namespace V1_0 +} // namespace visibility_control +} // namespace gnss +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_GNSS_V1_0_GnssVisibilityControl_H diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 0c0f7301..447f8607 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -36,11 +36,14 @@ GNSS_HIDL_1_0_TARGET_LIST += sdm710 GNSS_HIDL_1_0_TARGET_LIST += qcs605 GNSS_HIDL_1_0_TARGET_LIST += sdm845 GNSS_HIDL_1_0_TARGET_LIST += sdm660 -GNSS_HIDL_1_1_TARGET_LIST := msmnile +GNSS_HIDL_2_0_TARGET_LIST := msmnile GNSS_HIDL_1_1_TARGET_LIST += $(MSMSTEPPE) GNSS_HIDL_1_1_TARGET_LIST += $(TRINKET) +ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) +GNSS_HIDL_VERSION = 2.0 +endif ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 1.0 endif From 7445c50730a9f81de3926926bf74265653d6377a Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 15 Jan 2019 16:29:48 -0800 Subject: [PATCH 789/945] New structures and handling of new data in the pipe 1. KlobucharIonoModel 2. Additional parameters for Glonass 3. Add gps system time to ephemeris reports. CRs-Fixed: 2388931 Change-Id: Ibd08496c8eda2ce7571cbdd71ff0c179f7376aa7 --- core/EngineHubProxyBase.h | 11 +++++ core/LocAdapterBase.cpp | 8 ++++ core/LocAdapterBase.h | 3 ++ core/LocApiBase.cpp | 10 ++++ core/LocApiBase.h | 2 + gnss/GnssAdapter.cpp | 31 +++++++------ gnss/GnssAdapter.h | 3 ++ location/LocationDataTypes.h | 8 ++++ utils/gps_extended_c.h | 90 +++++++++++++++++++++++++++++++++++- 9 files changed, 150 insertions(+), 16 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 34af4d06..4239a508 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -90,6 +90,17 @@ public: (void) systemInfo; return false; } + + inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) { + (void) ionoModel; + return false; + } + + inline virtual bool gnssReportAdditionalSystemInfo( + const GnssAdditionalSystemInfo& additionalSystemInfo) { + (void) additionalSystemInfo; + return false; + } }; typedef std::functionreportDeleteAidingDataEvent(aidingData)); } +void LocApiBase::reportKlobucharIonoModel(GnssKlobucharIonoModel & ionoModel) { + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportKlobucharIonoModelEvent(ionoModel)); +} + +void LocApiBase::reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additionalSystemInfo) { + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportGnssAdditionalSystemInfoEvent( + additionalSystemInfo)); +} void LocApiBase::reportSv(GnssSvNotification& svNotify) { diff --git a/core/LocApiBase.h b/core/LocApiBase.h index e5dfebf9..70bebc31 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -187,6 +187,8 @@ public: void requestOdcpi(OdcpiRequestInfo& request); void reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); void reportDeleteAidingDataEvent(GnssAidingData& aidingData); + void reportKlobucharIonoModel(GnssKlobucharIonoModel& ionoModel); + void reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additionalSystemInfo); // downward calls // All below functions are to be defined by adapter specific modules: diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 57d055c7..e0290ad4 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1944,6 +1944,7 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT; mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; + mask |= LOC_API_ADAPTER_BIT_EVENT_REPORT_INFO; LOC_LOGd("Auto usecase, Enable MEAS/POLY/EPHEMERIS - mask 0x%" PRIx64 "", mask); @@ -3591,24 +3592,24 @@ void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request) bool GnssAdapter::reportDeleteAidingDataEvent(GnssAidingData& aidingData) { LOC_LOGD("%s]:", __func__); - - struct MsgHandleDeleteAidingDataEvent : public LocMsg { - GnssAdapter& mAdapter; - GnssAidingData mData; - inline MsgHandleDeleteAidingDataEvent(GnssAdapter& adapter, - GnssAidingData& data) : - LocMsg(), - mAdapter(adapter), - mData(data) {} - inline virtual void proc() const { - mAdapter.mEngHubProxy->gnssDeleteAidingData(mData); - } - }; - - sendMsg(new MsgHandleDeleteAidingDataEvent(*this, aidingData)); + mEngHubProxy->gnssDeleteAidingData(aidingData); return true; } +bool GnssAdapter::reportKlobucharIonoModelEvent(GnssKlobucharIonoModel & ionoModel) +{ + LOC_LOGD("%s]:", __func__); + mEngHubProxy->gnssReportKlobucharIonoModel(ionoModel); + return true; +} + +bool GnssAdapter::reportGnssAdditionalSystemInfoEvent( + GnssAdditionalSystemInfo & additionalSystemInfo) +{ + LOC_LOGD("%s]:", __func__); + mEngHubProxy->gnssReportAdditionalSystemInfo(additionalSystemInfo); + return true; +} void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1682f027..55cadba6 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -356,6 +356,9 @@ public: virtual bool releaseATL(int connHandle); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); virtual bool reportDeleteAidingDataEvent(GnssAidingData& aidingData); + virtual bool reportKlobucharIonoModelEvent(GnssKlobucharIonoModel& ionoModel); + virtual bool reportGnssAdditionalSystemInfoEvent( + GnssAdditionalSystemInfo& additionalSystemInfo); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index e4784735..99e6d45d 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -545,6 +545,14 @@ typedef enum { GNSS_SIGNAL_SBAS_L1 = (1<<17) } GnssSignalTypeBits; +#define GNSS_SIGNAL_TYPE_MASK_ALL\ + (GNSS_SIGNAL_GPS_L1CA | GNSS_SIGNAL_GPS_L1C | GNSS_SIGNAL_GPS_L2 |\ + GNSS_SIGNAL_GPS_L5| GNSS_SIGNAL_GLONASS_G1 | GNSS_SIGNAL_GLONASS_G2 |\ + GNSS_SIGNAL_GALILEO_E1 | GNSS_SIGNAL_GALILEO_E5A | GNSS_SIGNAL_GALILEO_E5B |\ + GNSS_SIGNAL_BEIDOU_B1I | GNSS_SIGNAL_BEIDOU_B1C | GNSS_SIGNAL_BEIDOU_B2I|\ + GNSS_SIGNAL_BEIDOU_B2AI | GNSS_SIGNAL_QZSS_L1CA | GNSS_SIGNAL_QZSS_L1S |\ + GNSS_SIGNAL_QZSS_L2| GNSS_SIGNAL_QZSS_L5 | GNSS_SIGNAL_SBAS_L1) + typedef enum { GNSS_LOC_SV_SYSTEM_UNKNOWN = 0, diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 22b2dd03..cd661b3a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -407,6 +407,13 @@ typedef uint32_t LocPosDataMask; /* Bitmask to specify whether Navigation data has Body pitch Unc*/ #define LOC_NAV_DATA_HAS_PITCH_UNC ((LocPosDataMask)0x0200) +typedef uint32_t GnssAdditionalSystemInfoMask; +/* Bitmask to specify whether Tauc is valid */ +#define GNSS_ADDITIONAL_SYSTEMINFO_HAS_TAUC ((GnssAdditionalSystemInfoMask)0x0001) +/* Bitmask to specify whether leapSec is valid */ +#define GNSS_ADDITIONAL_SYSTEMINFO_HAS_LEAP_SEC ((GnssAdditionalSystemInfoMask)0x0002) + + /** GPS PRN Range */ #define GPS_SV_PRN_MIN 1 #define GPS_SV_PRN_MAX 32 @@ -856,6 +863,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_GNSS_SV_EPHEMERIS_REPORT, // GNSS SV Ephemeris Report LOC_API_ADAPTER_LOC_SYSTEM_INFO, // Location system info event LOC_API_ADAPTER_GNSS_NHZ_MEASUREMENT_REPORT, // GNSS SV nHz measurement report + LOC_API_ADAPTER_EVENT_REPORT_INFO, // Event report info LOC_API_ADAPTER_EVENT_MAX }; @@ -897,6 +905,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT (1ULL< Date: Wed, 30 Jan 2019 04:07:41 +0530 Subject: [PATCH 790/945] Adding gps_vendor_product.mk Adding vendor specific make flags Change-Id: Icbc9bc4ac6acb58e887e142f96ef95742127c215 CRs-Fixed: 2389780 --- gps_vendor_product.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 gps_vendor_product.mk diff --git a/gps_vendor_product.mk b/gps_vendor_product.mk new file mode 100644 index 00000000..cfe2b903 --- /dev/null +++ b/gps_vendor_product.mk @@ -0,0 +1,10 @@ +# HAL packages +PRODUCT_PACKAGES += android.hardware.gnss@1.0-impl-qti +PRODUCT_PACKAGES += android.hardware.gnss@1.0-service-qti +PRODUCT_PACKAGES += android.hardware.gnss@1.1-impl-qti +PRODUCT_PACKAGES += android.hardware.gnss@1.1-service-qti +PRODUCT_PACKAGES += gps.conf +PRODUCT_PACKAGES += libloc_core +PRODUCT_PACKAGES += libgnss +PRODUCT_PACKAGES += liblocation_api +PRODUCT_PACKAGES += libgps.utils From dc0efb480067db854d27ef439c1fb598769ba361 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 13 Dec 2018 10:08:18 -0800 Subject: [PATCH 791/945] Enable support for External AP build Enable support for build on External AP without libcutils or any Android library support. CRs-fixed: 2368435 Change-Id: I978127348fd6b8d90ed5ef0a714c02437dc59ee0 --- pla/oe/loc_pla.h | 17 +++++++++++++++++ utils/LocSharedLock.h | 20 +++++++++++++++++++- utils/MsgTask.cpp | 2 ++ utils/configure.ac | 18 ++++++++++++++---- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/pla/oe/loc_pla.h b/pla/oe/loc_pla.h index 94468881..e795a23e 100644 --- a/pla/oe/loc_pla.h +++ b/pla/oe/loc_pla.h @@ -30,7 +30,10 @@ #define __LOC_PLA__ #ifdef __cplusplus +#ifndef FEATURE_EXTERNAL_AP #include +#endif /* FEATURE_EXTERNAL_AP */ +#include #include #include @@ -47,10 +50,14 @@ inline int64_t uptimeMillis() extern "C" { #endif +#ifndef FEATURE_EXTERNAL_AP #include #include #include +#endif /* FEATURE_EXTERNAL_AP */ +#include #include +#include #include #include #ifndef OFF_TARGET @@ -76,6 +83,16 @@ extern "C" { #define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" #define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" +#ifdef FEATURE_EXTERNAL_AP +#define PROPERTY_VALUE_MAX 92 + +inline int property_get(const char* key, char* value, const char* default_value) +{ + strlcpy(value, default_value, PROPERTY_VALUE_MAX - 1); + return strlen(value); +} +#endif /* FEATURE_EXTERNAL_AP */ + #ifdef __cplusplus } #endif /*__cplusplus */ diff --git a/utils/LocSharedLock.h b/utils/LocSharedLock.h index 7fe62376..a7af35ed 100644 --- a/utils/LocSharedLock.h +++ b/utils/LocSharedLock.h @@ -30,10 +30,28 @@ #define __LOC_SHARED_LOCK__ #include +#ifndef FEATURE_EXTERNAL_AP #include +#endif /* FEATURE_EXTERNAL_AP */ #include -// This is a utility created for use cases such that there are more than +#ifdef FEATURE_EXTERNAL_AP +#include + +inline int32_t android_atomic_inc(volatile int32_t *addr) +{ + volatile std::atomic_int_least32_t* a = (volatile std::atomic_int_least32_t*)addr; + return std::atomic_fetch_add_explicit(a, 1, std::memory_order_release); +} + +inline int32_t android_atomic_dec(volatile int32_t *addr) +{ + volatile std::atomic_int_least32_t* a = (volatile std::atomic_int_least32_t*)addr; + return std::atomic_fetch_sub_explicit(a, 1, std::memory_order_release); +} + +#endif /* FEATURE_EXTERNAL_AP */ + // 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, diff --git a/utils/MsgTask.cpp b/utils/MsgTask.cpp index ad95a83e..73a77fdb 100644 --- a/utils/MsgTask.cpp +++ b/utils/MsgTask.cpp @@ -83,8 +83,10 @@ void MsgTask::sendMsg(const LocMsg* msg) const { } void MsgTask::prerun() { +#ifndef FEATURE_EXTERNAL_AP // make sure we do not run in background scheduling group set_sched_policy(gettid(), SP_FOREGROUND); +#endif /* FEATURE_EXTERNAL_AP */ } bool MsgTask::run() { diff --git a/utils/configure.ac b/utils/configure.ac index 639f8c47..fd164943 100644 --- a/utils/configure.ac +++ b/utils/configure.ac @@ -28,10 +28,20 @@ AC_PROG_LN_S AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG -# Checks for libraries. -PKG_CHECK_MODULES([CUTILS], [libcutils]) -AC_SUBST([CUTILS_CFLAGS]) -AC_SUBST([CUTILS_LIBS]) +AC_ARG_WITH([external_ap], + AC_HELP_STRING([--with-external_ap=@<:@dir@:>@], + [Using External Application Processor]), + [], + with_external_ap=no) + +if test "x$with_external_ap" != "xno"; then + CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP" +else + # Checks for libraries. + PKG_CHECK_MODULES([CUTILS], [libcutils]) + AC_SUBST([CUTILS_CFLAGS]) + AC_SUBST([CUTILS_LIBS]) +fi AC_ARG_WITH([core_includes], AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], From 1d823b05ec27ec6ed5a0565213aae66321e9812d Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 14 Dec 2018 16:22:17 -0800 Subject: [PATCH 792/945] FR47367: Location client API for External AP (1) In location data struct, change size_t to uint32_t as size_t is machine dependent and can not be sent as part of payload to the other processor. (2) Change LocIpc ifdef to match with the file name Change-Id: Ia3f029641106a547e18904be1e3fb56ec09de569 CRs-fixed: 2367517 --- location/LocationDataTypes.h | 70 ++++++++++++++++++------------------ utils/LocIpc.h | 6 ++-- utils/gps_extended_c.h | 1 + utils/log_util.h | 9 +++++ 4 files changed, 48 insertions(+), 38 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index e4784735..e4e4b07e 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -640,7 +640,7 @@ typedef struct { } GnssAidingData; typedef struct { - size_t size; // set to sizeof(Location) + uint32_t size; // set to sizeof(Location) LocationFlagsMask flags; // bitwise OR of LocationFlagsBits to mark which params are valid uint64_t timestamp; // UTC timestamp for location fix, milliseconds since January 1, 1970 double latitude; // in degrees @@ -657,7 +657,7 @@ typedef struct { } Location; struct LocationOptions { - size_t size; // set to sizeof(LocationOptions) + uint32_t size; // set to sizeof(LocationOptions) uint32_t minInterval; // in milliseconds uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ // gnssMeasurementsCallback may not be called @@ -684,7 +684,7 @@ struct TrackingOptions : LocationOptions { inline TrackingOptions() : LocationOptions(), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} - inline TrackingOptions(size_t s, GnssPowerMode m, uint32_t t) : + inline TrackingOptions(uint32_t s, GnssPowerMode m, uint32_t t) : LocationOptions(), powerMode(m), tbm(t) { LocationOptions::size = s; } inline TrackingOptions(const LocationOptions& options) : LocationOptions(options), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} @@ -708,7 +708,7 @@ struct BatchingOptions : LocationOptions { inline BatchingOptions() : LocationOptions(), batchingMode(BATCHING_MODE_ROUTINE) {} - inline BatchingOptions(size_t s, BatchingMode m) : + inline BatchingOptions(uint32_t s, BatchingMode m) : LocationOptions(), batchingMode(m) { LocationOptions::size = s; } inline BatchingOptions(const LocationOptions& options) : LocationOptions(options), batchingMode(BATCHING_MODE_ROUTINE) {} @@ -720,27 +720,27 @@ struct BatchingOptions : LocationOptions { }; typedef struct { - size_t size; + uint32_t size; BatchingStatus batchingStatus; } BatchingStatusInfo; typedef struct { - size_t size; // set to sizeof(GeofenceOption) + uint32_t size; // set to sizeof(GeofenceOption) GeofenceBreachTypeMask breachTypeMask; // bitwise OR of GeofenceBreachTypeBits uint32_t responsiveness; // in milliseconds uint32_t dwellTime; // in seconds } GeofenceOption; typedef struct { - size_t size; // set to sizeof(GeofenceInfo) + uint32_t size; // set to sizeof(GeofenceInfo) double latitude; // in degrees double longitude; // in degrees double radius; // in meters } GeofenceInfo; typedef struct { - size_t size; // set to sizeof(GeofenceBreachNotification) - size_t count; // number of ids in array + uint32_t size; // set to sizeof(GeofenceBreachNotification) + uint32_t count; // number of ids in array uint32_t* ids; // array of ids that have breached Location location; // location associated with breach GeofenceBreachType type; // type of breach @@ -748,7 +748,7 @@ typedef struct { } GeofenceBreachNotification; typedef struct { - size_t size; // set to sizeof(GeofenceBreachNotification) + uint32_t size; // set to sizeof(GeofenceBreachNotification) GeofenceStatusAvailable available; // GEOFENCE_STATUS_AVAILABILE_NO/_YES LocationTechnologyType techType; // GNSS } GeofenceStatusNotification; @@ -882,7 +882,7 @@ typedef struct { } GnssSystemTime; typedef struct { - size_t size; // set to sizeof(GnssLocationInfo) + uint32_t size; // set to sizeof(GnssLocationInfo) GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity float altitudeMeanSeaLevel; // altitude wrt mean sea level float pdop; // position dilusion of precision @@ -918,7 +918,7 @@ typedef struct { } GnssLocationInfoNotification; typedef struct { - size_t size; // set to sizeof(GnssNiNotification) + uint32_t size; // set to sizeof(GnssNiNotification) GnssNiType type; // type of NI (Voice, SUPL, Control Plane) GnssNiOptionsMask options; // bitwise OR of GnssNiOptionsBits uint32_t timeout; // time (seconds) to wait for user input @@ -931,7 +931,7 @@ typedef struct { } GnssNiNotification; typedef struct { - size_t size; // set to sizeof(GnssSv) + uint32_t size; // set to sizeof(GnssSv) uint16_t svId; // Unique Identifier GnssSvType type; // type of SV (GPS, SBAS, GLONASS, QZSS, BEIDOU, GALILEO) float cN0Dbhz; // signal strength @@ -943,7 +943,7 @@ typedef struct { } GnssSv; struct GnssConfigSetAssistanceServer { - size_t size; // set to sizeof(GnssConfigSetAssistanceServer) + uint32_t size; // set to sizeof(GnssConfigSetAssistanceServer) GnssAssistanceType type; // SUPL or C2K const char* hostName; // null terminated string uint32_t port; // port of server @@ -960,7 +960,7 @@ struct GnssConfigSetAssistanceServer { }; typedef struct { - size_t size; // set to sizeof(GnssMeasurementsData) + uint32_t size; // set to sizeof(GnssMeasurementsData) GnssMeasurementsDataFlagsMask flags; // bitwise OR of GnssMeasurementsDataFlagsBits int16_t svId; GnssSvType svType; @@ -984,7 +984,7 @@ typedef struct { } GnssMeasurementsData; typedef struct { - size_t size; // set to sizeof(GnssMeasurementsClock) + uint32_t size; // set to sizeof(GnssMeasurementsClock) GnssMeasurementsClockFlagsMask flags; // bitwise OR of GnssMeasurementsClockFlagsBits int16_t leapSecond; int64_t timeNs; @@ -998,29 +998,29 @@ typedef struct { } GnssMeasurementsClock; typedef struct { - size_t size; // set to sizeof(GnssSvNotification) - size_t count; // number of SVs in the GnssSv array + uint32_t size; // set to sizeof(GnssSvNotification) + uint32_t count; // number of SVs in the GnssSv array bool gnssSignalTypeMaskValid; GnssSv gnssSvs[GNSS_SV_MAX]; // information on a number of SVs } GnssSvNotification; typedef struct { - size_t size; // set to sizeof(GnssNmeaNotification) + uint32_t size; // set to sizeof(GnssNmeaNotification) uint64_t timestamp; // timestamp const char* nmea; // nmea text - size_t length; // length of the nmea text + uint32_t length; // length of the nmea text } GnssNmeaNotification; typedef struct { - size_t size; // set to sizeof(GnssDataNotification) + uint32_t size; // set to sizeof(GnssDataNotification) GnssDataMask gnssDataMask[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // bitwise OR of GnssDataBits double jammerInd[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // Jammer Indication double agc[GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES]; // Automatic gain control } GnssDataNotification; typedef struct { - size_t size; // set to sizeof(GnssMeasurementsNotification) - size_t count; // number of items in GnssMeasurements array + uint32_t size; // set to sizeof(GnssMeasurementsNotification) + uint32_t count; // number of items in GnssMeasurements array GnssMeasurementsData measurements[GNSS_MEASUREMENTS_MAX]; GnssMeasurementsClock clock; // clock } GnssMeasurementsNotification; @@ -1028,9 +1028,9 @@ typedef struct { typedef uint32_t GnssSvId; struct GnssSvIdSource{ - size_t size; // set to sizeof(GnssSvIdSource) - GnssSvType constellation; // constellation for the sv to blacklist - GnssSvId svId; // sv id to blacklist + uint32_t size; // set to sizeof(GnssSvIdSource) + GnssSvType constellation; // constellation for the sv to blacklist + GnssSvId svId; // sv id to blacklist }; inline bool operator ==(GnssSvIdSource const& left, GnssSvIdSource const& right) { return left.size == right.size && @@ -1039,7 +1039,7 @@ inline bool operator ==(GnssSvIdSource const& left, GnssSvIdSource const& right) #define GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK ((uint64_t)0xFFFFFFFFFFFFFFFF) typedef struct { - size_t size; // set to sizeof(GnssSvIdConfig) + uint32_t size; // set to sizeof(GnssSvIdConfig) // GLONASS - SV 65 maps to bit 0 #define GNSS_SV_CONFIG_GLO_INITIAL_SV_ID 65 @@ -1059,7 +1059,7 @@ typedef struct { } GnssSvIdConfig; struct GnssConfig{ - size_t size; // set to sizeof(GnssConfig) + uint32_t size; // set to sizeof(GnssConfig) GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid GnssConfigGpsLock gpsLock; GnssConfigSuplVersion suplVersion; @@ -1093,7 +1093,7 @@ struct GnssConfig{ }; typedef struct { - size_t size; // set to sizeof + uint32_t size; // set to sizeof bool mValid; Location mLocation; double verticalAccuracyMeters; @@ -1103,7 +1103,7 @@ typedef struct { } GnssDebugLocation; typedef struct { - size_t size; // set to sizeof + uint32_t size; // set to sizeof bool mValid; int64_t timeEstimate; float timeUncertaintyNs; @@ -1111,7 +1111,7 @@ typedef struct { } GnssDebugTime; typedef struct { - size_t size; // set to sizeof + uint32_t size; // set to sizeof uint32_t svid; GnssSvType constellation; GnssEphemerisType mEphemerisType; @@ -1123,7 +1123,7 @@ typedef struct { } GnssDebugSatelliteInfo; typedef struct { - size_t size; // set to sizeof + uint32_t size; // set to sizeof GnssDebugLocation mLocation; GnssDebugTime mTime; std::vector mSatelliteInfo; @@ -1198,7 +1198,7 @@ typedef std::function collectiveResponseCallback; @@ -1214,7 +1214,7 @@ typedef std::function batchingCallback; @@ -1301,7 +1301,7 @@ typedef enum { } LocationAdapterTypeBits; typedef struct { - size_t size; // set to sizeof(LocationCallbacks) + uint32_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory responseCallback responseCb; // mandatory collectiveResponseCallback collectiveResponseCb; // mandatory diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 2288a0a9..90f9e1b7 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -27,8 +27,8 @@ * */ -#ifndef __LOC_SOCKET__ -#define __LOC_SOCKET__ +#ifndef __LOC_IPC__ +#define __LOC_IPC__ #include #include @@ -149,4 +149,4 @@ private: } -#endif //__LOC_SOCKET__ +#endif //__LOC_IPC__ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 22b2dd03..9b38c0e9 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1994,6 +1994,7 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" #define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" +#define SOCKET_TO_EXTERANL_AP_LOCATION_CLIENT_BASE "/dev/socket/loc_client/extap.toclient" #ifdef __cplusplus } diff --git a/utils/log_util.h b/utils/log_util.h index 4fed90ba..ed7e19e1 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -47,6 +47,14 @@ #endif /* LOG_TAG */ // LE targets with no logcat support +#ifdef FEATURE_EXTERNAL_AP +#include +#define ALOGE(...) syslog(LOG_ERR, "LOC_LOGE: " __VA_ARGS__); +#define ALOGW(...) syslog(LOG_WARNING, "LOC_LOGW: " __VA_ARGS__); +#define ALOGI(...) syslog(LOG_NOTICE, "LOC_LOGI: " __VA_ARGS__); +#define ALOGD(...) syslog(LOG_DEBUG, "LOC_LOGD: " __VA_ARGS__); +#define ALOGV(...) syslog(LOG_NOTICE, "LOC_LOGV: " __VA_ARGS__); +#else /* FEATURE_EXTERNAL_AP */ #define TS_PRINTF(format, x...) \ { \ struct timeval tv; \ @@ -64,6 +72,7 @@ #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 /* FEATURE_EXTERNAL_AP */ #endif /* #if defined (USE_ANDROID_LOGGING) || defined (ANDROID) */ From 8926b41ce3a45e14d62b457ff06530b95cd32e51 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 14 Feb 2019 14:25:16 +0530 Subject: [PATCH 793/945] Adding gps_vendor_board.mk Adding vendor specific board config flags. Change-Id: Ib16f800f2f9f3e385890088ae36f5d6197f2ee2c CRs-Fixed: 2398736 --- gps_vendor_board.mk | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 gps_vendor_board.mk diff --git a/gps_vendor_board.mk b/gps_vendor_board.mk new file mode 100644 index 00000000..be346dcd --- /dev/null +++ b/gps_vendor_board.mk @@ -0,0 +1,3 @@ +# Flags from BoardConfigVendor.mk +BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default + From 9b2e79c42e881973d5924888022b6d3b0a89c73a Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 12 Feb 2019 18:44:00 -0800 Subject: [PATCH 794/945] Fix race condition that adapter does not get handleEngineUp - Removed redundant injectFeatureConfig() call, as it this happens twice, once when the first context is created which would have been too early and once when LocApi open success. - Resolved a race condition that second adapter added may not have been in LocApi's adapter list yet when handleEngineUp() is broadcast. Change-Id: I8ecc18eab6b450c326c0be1abc011f70285439aa CRs-Fixed: 2397902 --- core/LocApiBase.cpp | 20 +++++++++++++------- core/LocDualContext.cpp | 21 +++------------------ core/LocDualContext.h | 1 - 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c2ee4114..13b1c71a 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -95,7 +96,10 @@ struct LocSsrMsg : public LocMsg { } inline virtual void proc() const { mLocApi->close(); - mLocApi->open(mLocApi->getEvtMask()); + if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask())) { + // Notify adapters that engine up after SSR + mLocApi->handleEngineUpEvent(); + } } inline void locallog() const { LOC_LOGV("LocSsrMsg"); @@ -107,13 +111,17 @@ struct LocSsrMsg : public LocMsg { struct LocOpenMsg : public LocMsg { LocApiBase* mLocApi; - inline LocOpenMsg(LocApiBase* locApi) : - LocMsg(), mLocApi(locApi) + LocAdapterBase* mAdapter; + inline LocOpenMsg(LocApiBase* locApi, LocAdapterBase* adapter = nullptr) : + LocMsg(), mLocApi(locApi), mAdapter(adapter) { locallog(); } inline virtual void proc() const { - mLocApi->open(mLocApi->getEvtMask()); + if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask()) && + nullptr != mAdapter) { + mAdapter->handleEngineUpEvent(); + } } inline void locallog() const { LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask()); @@ -222,7 +230,7 @@ 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)); + mMsgTask->sendMsg(new LocOpenMsg(this, adapter)); break; } } @@ -295,8 +303,6 @@ void LocApiBase::updateNmeaMask(uint32_t mask) void LocApiBase::handleEngineUpEvent() { - LocDualContext::injectFeatureConfig(mContext); - // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent()); } diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 180d9dca..9851d610 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -55,7 +55,6 @@ LocDualContext::mBgExclMask = 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 @@ -91,11 +90,6 @@ ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator, 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) { @@ -116,11 +110,6 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, 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) { @@ -132,13 +121,9 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, 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__); + LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", + __func__, __LINE__, ((LocDualContext *)curContext)->mLBSProxy); + ((LocDualContext *)curContext)->mLBSProxy->injectFeatureConfig(curContext); } LocDualContext::LocDualContext(const MsgTask* msgTask, diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 3b3ce2cf..edfbfb7d 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -40,7 +40,6 @@ 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); From 9a055d5208d598a841404ba5276c00e060f62fca Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 12 Feb 2019 18:44:00 -0800 Subject: [PATCH 795/945] Fix race condition that adapter does not get handleEngineUp - Removed redundant injectFeatureConfig() call, as it this happens twice, once when the first context is created which would have been too early and once when LocApi open success. - Resolved a race condition that second adapter added may not have been in LocApi's adapter list yet when handleEngineUp() is broadcast. Change-Id: I8ecc18eab6b450c326c0be1abc011f70285439aa CRs-Fixed: 2397902 --- core/LocApiBase.cpp | 20 +++++++++++++------- core/LocDualContext.cpp | 21 +++------------------ core/LocDualContext.h | 1 - 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c2ee4114..13b1c71a 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -95,7 +96,10 @@ struct LocSsrMsg : public LocMsg { } inline virtual void proc() const { mLocApi->close(); - mLocApi->open(mLocApi->getEvtMask()); + if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask())) { + // Notify adapters that engine up after SSR + mLocApi->handleEngineUpEvent(); + } } inline void locallog() const { LOC_LOGV("LocSsrMsg"); @@ -107,13 +111,17 @@ struct LocSsrMsg : public LocMsg { struct LocOpenMsg : public LocMsg { LocApiBase* mLocApi; - inline LocOpenMsg(LocApiBase* locApi) : - LocMsg(), mLocApi(locApi) + LocAdapterBase* mAdapter; + inline LocOpenMsg(LocApiBase* locApi, LocAdapterBase* adapter = nullptr) : + LocMsg(), mLocApi(locApi), mAdapter(adapter) { locallog(); } inline virtual void proc() const { - mLocApi->open(mLocApi->getEvtMask()); + if (LOC_API_ADAPTER_ERR_SUCCESS == mLocApi->open(mLocApi->getEvtMask()) && + nullptr != mAdapter) { + mAdapter->handleEngineUpEvent(); + } } inline void locallog() const { LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask()); @@ -222,7 +230,7 @@ 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)); + mMsgTask->sendMsg(new LocOpenMsg(this, adapter)); break; } } @@ -295,8 +303,6 @@ void LocApiBase::updateNmeaMask(uint32_t mask) void LocApiBase::handleEngineUpEvent() { - LocDualContext::injectFeatureConfig(mContext); - // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent()); } diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp index 180d9dca..9851d610 100644 --- a/core/LocDualContext.cpp +++ b/core/LocDualContext.cpp @@ -55,7 +55,6 @@ LocDualContext::mBgExclMask = 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 @@ -91,11 +90,6 @@ ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator, 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) { @@ -116,11 +110,6 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, 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) { @@ -132,13 +121,9 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, 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__); + LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", + __func__, __LINE__, ((LocDualContext *)curContext)->mLBSProxy); + ((LocDualContext *)curContext)->mLBSProxy->injectFeatureConfig(curContext); } LocDualContext::LocDualContext(const MsgTask* msgTask, diff --git a/core/LocDualContext.h b/core/LocDualContext.h index 3b3ce2cf..edfbfb7d 100644 --- a/core/LocDualContext.h +++ b/core/LocDualContext.h @@ -40,7 +40,6 @@ 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); From ae8db6cf15b243e58efddae88d2790a4a59bca81 Mon Sep 17 00:00:00 2001 From: Naresh Munagala Date: Wed, 10 Oct 2018 16:53:28 +0530 Subject: [PATCH 796/945] add remove api for message queue Change-Id: I278eca90ebb50e291a1b9076caf46f41a074b1d7 CRs-Fixed: 2338245 --- utils/linked_list.h | 2 ++ utils/msg_q.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ utils/msg_q.h | 23 +++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/utils/linked_list.h b/utils/linked_list.h index a85f09a3..0b33ecb8 100644 --- a/utils/linked_list.h +++ b/utils/linked_list.h @@ -50,6 +50,8 @@ typedef enum /**< Failed because an there were not enough resources. */ eLINKED_LIST_INSUFFICIENT_BUFFER = -5, /**< Failed because an the supplied buffer was too small. */ + eLINKED_LIST_EMPTY = -6 + /**< Failed because list is empty. */ }linked_list_err_type; /*=========================================================================== diff --git a/utils/msg_q.c b/utils/msg_q.c index 76c14789..2d49b4a3 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -265,6 +265,51 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) return rv; } +/*=========================================================================== + + FUNCTION: msg_q_rmv + + ===========================================================================*/ +msq_q_err_type msg_q_rmv(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; + + 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; + } + + if (linked_list_empty(p_msg_q->msg_list)) { + LOC_LOGW("%s: list is empty !!\n", __FUNCTION__); + pthread_mutex_unlock(&p_msg_q->list_mutex); + return eLINKED_LIST_EMPTY; + } + + 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: Removed message %p rv = %d\n", __FUNCTION__, *msg_obj, rv); + + return rv; +} + + + /*=========================================================================== FUNCTION: msg_q_flush diff --git a/utils/msg_q.h b/utils/msg_q.h index 453b8ce3..16df4944 100644 --- a/utils/msg_q.h +++ b/utils/msg_q.h @@ -157,6 +157,29 @@ SIDE EFFECTS ===========================================================================*/ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj); +/*=========================================================================== +FUNCTION msg_q_rmv + +DESCRIPTION + Remove 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_rmv(void* msg_q_data, void** msg_obj); + + /*=========================================================================== FUNCTION msg_q_flush From e78728024dd2b1998811478494319be07458d05e Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 25 Jan 2019 10:15:19 -0800 Subject: [PATCH 797/945] SUPL over WiFi changes in GNSS HIDL2.0 Change-Id: I20a2071fd748dea16cd55aa120bc307ebc0645a9 CRs-fixed: 2342192 --- android/2.0/AGnss.cpp | 141 ++++++++++++++++++++++++++++++++++- android/2.0/AGnss.h | 2 +- location/LocationDataTypes.h | 4 +- 3 files changed, 141 insertions(+), 6 deletions(-) diff --git a/android/2.0/AGnss.cpp b/android/2.0/AGnss.cpp index ce387989..7bd015e7 100644 --- a/android/2.0/AGnss.cpp +++ b/android/2.0/AGnss.cpp @@ -40,33 +40,166 @@ AGnss::~AGnss() { spAGnss = nullptr; } -void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){ +void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status) { + if (nullptr != spAGnss) { + spAGnss->statusCb(status.type, status.status); + } } -void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) { +void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) { + + V2_0::IAGnssCallback::AGnssType aType; + IAGnssCallback::AGnssStatusValue aStatus; + + switch (type) { + case LOC_AGPS_TYPE_SUPL: + aType = IAGnssCallback::AGnssType::SUPL; + break; + case LOC_AGPS_TYPE_SUPL_ES: + aType = IAGnssCallback::AGnssType::SUPL_EIMS; + break; + default: + LOC_LOGE("invalid type: %d", type); + return; + } + + switch (status) { + case LOC_GPS_REQUEST_AGPS_DATA_CONN: + aStatus = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN; + break; + case LOC_GPS_RELEASE_AGPS_DATA_CONN: + aStatus = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN; + break; + case LOC_GPS_AGPS_DATA_CONNECTED: + aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED; + break; + case LOC_GPS_AGPS_DATA_CONN_DONE: + aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE; + break; + case LOC_GPS_AGPS_DATA_CONN_FAILED: + aStatus = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED; + break; + default: + LOC_LOGE("invalid status: %d", status); + return; + } + + if (mAGnssCbIface != nullptr) { + auto r = mAGnssCbIface->agnssStatusCb(aType, aStatus); + if (!r.isOk()) { + LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str()); + } + } + else { + LOC_LOGw("setCallback has not been called yet"); + } } Return AGnss::setCallback(const sp& callback) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return Void(); + } + + // Save the interface + mAGnssCbIface = callback; + + AgpsCbInfo cbInfo = {}; + cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; + cbInfo.cbPriority = AGPS_CB_PRIORITY_HIGH; + + mGnss->getGnssInterface()->agpsInit(cbInfo); return Void(); } Return AGnss::dataConnClosed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL); return true; } Return AGnss::dataConnFailed() { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL); return true; } -Return AGnss::dataConnOpen(uint64_t networkHandle, const hidl_string& apn, +Return AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string& apn, V2_0::IAGnss::ApnIpType apnIpType) { + + if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + LOC_LOGE("Null GNSS interface"); + return false; + } + + /* Validate */ + if(apn.empty()){ + LOC_LOGE("Invalid APN"); + return false; + } + + LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str()); + + AGpsBearerType bearerType; + switch (apnIpType) { + case IAGnss::ApnIpType::IPV4: + bearerType = AGPS_APN_BEARER_IPV4; + break; + case IAGnss::ApnIpType::IPV6: + bearerType = AGPS_APN_BEARER_IPV6; + break; + case IAGnss::ApnIpType::IPV4V6: + bearerType = AGPS_APN_BEARER_IPV4V6; + break; + default: + bearerType = AGPS_APN_BEARER_IPV4; + break; + } + + mGnss->getGnssInterface()->agpsDataConnOpen( + LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType); return true; } Return AGnss::setServer(V2_0::IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) { - return true; + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT; + config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer); + if (type == IAGnssCallback::AGnssType::SUPL) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL; + } else if (type == IAGnssCallback::AGnssType::C2K) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K; + } else if (type == IAGnssCallback::AGnssType::SUPL_EIMS) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL_EIMS; + } else if (type == IAGnssCallback::AGnssType::SUPL_IMS) { + config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL_IMS; + } else { + LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast(type)); + return false; + } + config.assistanceServer.hostName = strdup(hostname.c_str()); + config.assistanceServer.port = port; + return mGnss->updateConfiguration(config); } } // namespace implementation diff --git a/android/2.0/AGnss.h b/android/2.0/AGnss.h index ed9c0e89..c4423276 100644 --- a/android/2.0/AGnss.h +++ b/android/2.0/AGnss.h @@ -58,7 +58,7 @@ struct AGnss : public V2_0::IAGnss { Return setServer(V2_0::IAGnssCallback::AGnssType type, const hidl_string& hostname, int32_t port) override; - void statusIpV4Cb(AGnssExtStatusIpV4 status); + void statusCb(AGpsExtType type, LocAGpsStatusValue status); /* Data call setup callback passed down to GNSS HAL implementation */ static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 61598be8..e138bbbc 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2018-2019 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 @@ -374,6 +374,8 @@ typedef enum { typedef enum { GNSS_ASSISTANCE_TYPE_SUPL = 0, GNSS_ASSISTANCE_TYPE_C2K, + GNSS_ASSISTANCE_TYPE_SUPL_EIMS, + GNSS_ASSISTANCE_TYPE_SUPL_IMS, } GnssAssistanceType; typedef enum { From 1d1d0e57221c81305386ba7a84f3dbc4a179d38d Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 21 Feb 2019 17:05:51 -0800 Subject: [PATCH 798/945] Enablement of location modules for kona CRs-fixed: 2403289 Change-Id: Iab273dcb9c0783557df15b1361c08862201bd8ce --- build/target_specific_features.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 0c0f7301..241bca4e 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -39,7 +39,7 @@ GNSS_HIDL_1_0_TARGET_LIST += sdm660 GNSS_HIDL_1_1_TARGET_LIST := msmnile GNSS_HIDL_1_1_TARGET_LIST += $(MSMSTEPPE) GNSS_HIDL_1_1_TARGET_LIST += $(TRINKET) - +GNSS_HIDL_1_1_TARGET_LIST += kona ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 1.0 From 4149abcc2df9ac7bd13f38cb5047053a63f7b84b Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 4 Feb 2019 16:28:51 -0800 Subject: [PATCH 799/945] Measurement changes in GNSS HIDL2.0 CRs-fixed: 2385560 Change-Id: I5f4548e6df0cb8ac3f2762020dfdbb49a9022854 --- .../1.1/location_api/MeasurementAPIClient.cpp | 12 ++ android/2.0/GnssMeasurement.cpp | 31 ++++- android/2.0/GnssMeasurement.h | 3 +- .../2.0/location_api/MeasurementAPIClient.cpp | 108 +++++++++++++++++- .../2.0/location_api/MeasurementAPIClient.h | 5 + location/LocationDataTypes.h | 34 +++++- 6 files changed, 181 insertions(+), 12 deletions(-) diff --git a/android/1.1/location_api/MeasurementAPIClient.cpp b/android/1.1/location_api/MeasurementAPIClient.cpp index 7017e523..6f250676 100644 --- a/android/1.1/location_api/MeasurementAPIClient.cpp +++ b/android/1.1/location_api/MeasurementAPIClient.cpp @@ -309,6 +309,18 @@ static void convertGnssData_1_1(GnssMeasurementsNotification& in, out.measurements.resize(in.count); for (size_t i = 0; i < in.count; i++) { convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0); + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED; } convertGnssClock(in.clock, out.clock); } diff --git a/android/2.0/GnssMeasurement.cpp b/android/2.0/GnssMeasurement.cpp index 5984a60a..48dabf35 100644 --- a/android/2.0/GnssMeasurement.cpp +++ b/android/2.0/GnssMeasurement.cpp @@ -52,10 +52,10 @@ GnssMeasurement::~GnssMeasurement() { } // Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. -Return GnssMeasurement::setCallback( +Return GnssMeasurement::setCallback( const sp& callback) { - Return ret = + Return ret = IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; if (mGnssMeasurementCbIface != nullptr) { LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); @@ -100,7 +100,7 @@ Return GnssMeasurement::close() { Return GnssMeasurement::setCallback_1_1( const sp& callback, bool enableFullTracking) { - Return ret = + Return ret = IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; if (mGnssMeasurementCbIface_1_1 != nullptr) { LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); @@ -128,7 +128,30 @@ Return GnssMeasurement::setCallback_1_1( Return GnssMeasurement::setCallback_2_0( const sp& callback, bool enableFullTracking) { - return V1_0::IGnssMeasurement::GnssMeasurementStatus::SUCCESS; + + Return ret = + IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; + if (mGnssMeasurementCbIface_2_0 != nullptr) { + LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); + return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; + } + + if (callback == nullptr) { + LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); + return ret; + } + if (nullptr == mApi) { + LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); + return ret; + } + + mGnssMeasurementCbIface_2_0 = callback; + mGnssMeasurementCbIface_2_0->linkToDeath(mGnssMeasurementDeathRecipient, 0); + + GnssPowerMode powerMode = enableFullTracking ? + GNSS_POWER_MODE_M1 : GNSS_POWER_MODE_M2; + + return mApi->measurementSetCallback_2_0(callback, powerMode); } } // namespace implementation diff --git a/android/2.0/GnssMeasurement.h b/android/2.0/GnssMeasurement.h index 6f3480b8..000b00f4 100644 --- a/android/2.0/GnssMeasurement.h +++ b/android/2.0/GnssMeasurement.h @@ -56,7 +56,7 @@ struct GnssMeasurement : public V2_0::IGnssMeasurement { bool enableFullTracking) override; // Methods from ::android::hardware::gnss::V2_0::IGnssMeasurement follow. - Return setCallback_2_0( + Return setCallback_2_0( const sp& callback, bool enableFullTracking) override; private: @@ -73,6 +73,7 @@ struct GnssMeasurement : public V2_0::IGnssMeasurement { sp mGnssMeasurementDeathRecipient = nullptr; sp mGnssMeasurementCbIface = nullptr; sp mGnssMeasurementCbIface_1_1 = nullptr; + sp mGnssMeasurementCbIface_2_0 = nullptr; MeasurementAPIClient* mApi; }; diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp index bcc22342..1d82139e 100644 --- a/android/2.0/location_api/MeasurementAPIClient.cpp +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -49,6 +49,8 @@ static void convertGnssData(GnssMeasurementsNotification& in, V1_0::IGnssMeasurementCallback::GnssData& out); static void convertGnssData_1_1(GnssMeasurementsNotification& in, V1_1::IGnssMeasurementCallback::GnssData& out); +static void convertGnssData_2_0(GnssMeasurementsNotification& in, + V2_0::IGnssMeasurementCallback::GnssData& out); static void convertGnssMeasurement(GnssMeasurementsData& in, V1_0::IGnssMeasurementCallback::GnssMeasurement& out); static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); @@ -56,6 +58,7 @@ static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), mGnssMeasurementCbIface_1_1(nullptr), + mGnssMeasurementCbIface_2_0(nullptr), mTracking(false) { LOC_LOGD("%s]: ()", __FUNCTION__); @@ -94,6 +97,21 @@ MeasurementAPIClient::measurementSetCallback_1_1( return startTracking(powerMode, timeBetweenMeasurement); } +Return +MeasurementAPIClient::measurementSetCallback_2_0( + const sp& callback, + GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) +{ + LOC_LOGD("%s]: (%p) (powermode: %d) (tbm: %d)", + __FUNCTION__, &callback, (int)powerMode, timeBetweenMeasurement); + + mMutex.lock(); + mGnssMeasurementCbIface_2_0 = callback; + mMutex.unlock(); + + return startTracking(powerMode, timeBetweenMeasurement); +} + Return MeasurementAPIClient::startTracking( GnssPowerMode powerMode, uint32_t timeBetweenMeasurement) @@ -112,7 +130,9 @@ MeasurementAPIClient::startTracking( locationCallbacks.gnssNmeaCb = nullptr; locationCallbacks.gnssMeasurementsCb = nullptr; - if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) { + if (mGnssMeasurementCbIface_2_0 != nullptr || + mGnssMeasurementCbIface_1_1 != nullptr || + mGnssMeasurementCbIface != nullptr) { locationCallbacks.gnssMeasurementsCb = [this](GnssMeasurementsNotification gnssMeasurementsNotification) { onGnssMeasurementsCb(gnssMeasurementsNotification); @@ -154,14 +174,25 @@ void MeasurementAPIClient::onGnssMeasurementsCb( mMutex.lock(); sp gnssMeasurementCbIface = nullptr; sp gnssMeasurementCbIface_1_1 = nullptr; - if (mGnssMeasurementCbIface_1_1 != nullptr) { + sp gnssMeasurementCbIface_2_0 = nullptr; + if (mGnssMeasurementCbIface_2_0 != nullptr) { + gnssMeasurementCbIface_2_0 = mGnssMeasurementCbIface_2_0; + } else if (mGnssMeasurementCbIface_1_1 != nullptr) { gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1; } else if (mGnssMeasurementCbIface != nullptr) { gnssMeasurementCbIface = mGnssMeasurementCbIface; } mMutex.unlock(); - if (gnssMeasurementCbIface_1_1 != nullptr) { + if (gnssMeasurementCbIface_2_0 != nullptr) { + V2_0::IGnssMeasurementCallback::GnssData gnssData; + convertGnssData_2_0(gnssMeasurementsNotification, gnssData); + auto r = gnssMeasurementCbIface_2_0->gnssMeasurementCb_2_0(gnssData); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssMeasurementCb description=%s", + __func__, r.description().c_str()); + } + } else if (gnssMeasurementCbIface_1_1 != nullptr) { V1_1::IGnssMeasurementCallback::GnssData gnssData; convertGnssData_1_1(gnssMeasurementsNotification, gnssData); auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData); @@ -309,6 +340,77 @@ static void convertGnssData_1_1(GnssMeasurementsNotification& in, out.measurements.resize(in.count); for (size_t i = 0; i < in.count; i++) { convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0); + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT) + out.measurements[i].accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED; + } + convertGnssClock(in.clock, out.clock); +} + +static void convertGnssData_2_0(GnssMeasurementsNotification& in, + V2_0::IGnssMeasurementCallback::GnssData& out) +{ + out.measurements.resize(in.count); + for (size_t i = 0; i < in.count; i++) { + convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_1.v1_0); + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) + out.measurements[i].v1_1.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT) + out.measurements[i].v1_1.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT) + out.measurements[i].v1_1.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP; + if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT) + out.measurements[i].v1_1.accumulatedDeltaRangeState |= + IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED; + out.measurements[i].codeType = + static_cast(in.measurements[i].codeType); + out.measurements[i].otherCodeTypeName = in.measurements[i].otherCodeTypeName; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_TOW_KNOWN_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_KNOWN; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_KNOWN_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_KNOWN; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_2ND_CODE_LOCK_BIT) + out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_2ND_CODE_LOCK; } convertGnssClock(in.clock, out.clock); } diff --git a/android/2.0/location_api/MeasurementAPIClient.h b/android/2.0/location_api/MeasurementAPIClient.h index db2c2fa1..4146a131 100644 --- a/android/2.0/location_api/MeasurementAPIClient.h +++ b/android/2.0/location_api/MeasurementAPIClient.h @@ -60,6 +60,10 @@ public: const sp& callback, GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); + Return measurementSetCallback_2_0( + const sp& callback, + GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, + uint32_t timeBetweenMeasurement = GPS_DEFAULT_FIX_INTERVAL_MS); void measurementClose(); Return startTracking( GnssPowerMode powerMode = GNSS_POWER_MODE_INVALID, @@ -72,6 +76,7 @@ private: std::mutex mMutex; sp mGnssMeasurementCbIface; sp mGnssMeasurementCbIface_1_1; + sp mGnssMeasurementCbIface_2_0; bool mTracking; }; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index e138bbbc..8108ffce 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -48,6 +48,8 @@ #define GNSS_BUGREPORT_BDS_MIN (1) #define GNSS_BUGREPORT_GAL_MIN (1) +#define GNSS_MAX_NAME_LENGTH (8) + typedef enum { LOCATION_ERROR_SUCCESS = 0, LOCATION_ERROR_GENERAL_FAILURE, @@ -398,12 +400,31 @@ typedef enum { typedef uint16_t GnssMeasurementsAdrStateMask; typedef enum { - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT = (1<<0), - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT = (1<<1), - GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT = (1<<2), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_UNKNOWN = 0, + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT = (1<<0), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT = (1<<1), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT = (1<<2), + GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT = (1<<3), } GnssMeasurementsAdrStateBits; +typedef enum { + GNSS_MEASUREMENTS_CODE_TYPE_A = 0, + GNSS_MEASUREMENTS_CODE_TYPE_B = 1, + GNSS_MEASUREMENTS_CODE_TYPE_C = 2, + GNSS_MEASUREMENTS_CODE_TYPE_I = 3, + GNSS_MEASUREMENTS_CODE_TYPE_L = 4, + GNSS_MEASUREMENTS_CODE_TYPE_M = 5, + GNSS_MEASUREMENTS_CODE_TYPE_P = 6, + GNSS_MEASUREMENTS_CODE_TYPE_Q = 7, + GNSS_MEASUREMENTS_CODE_TYPE_S = 8, + GNSS_MEASUREMENTS_CODE_TYPE_W = 9, + GNSS_MEASUREMENTS_CODE_TYPE_X = 10, + GNSS_MEASUREMENTS_CODE_TYPE_Y = 11, + GNSS_MEASUREMENTS_CODE_TYPE_Z = 12, + GNSS_MEASUREMENTS_CODE_TYPE_N = 13, + GNSS_MEASUREMENTS_CODE_TYPE_OTHER = 255, +} GnssMeasurementsCodeType; + typedef uint32_t GnssMeasurementsDataFlagsMask; typedef enum { GNSS_MEASUREMENTS_DATA_SV_ID_BIT = (1<<0), @@ -443,6 +464,9 @@ typedef enum { GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT = (1<<11), GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT = (1<<12), GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT = (1<<13), + GNSS_MEASUREMENTS_STATE_TOW_KNOWN_BIT = (1<<14), + GNSS_MEASUREMENTS_STATE_GLO_TOD_KNOWN_BIT = (1<<15), + GNSS_MEASUREMENTS_STATE_2ND_CODE_LOCK_BIT = (1<<16), } GnssMeasurementsStateBits; typedef enum { @@ -967,6 +991,8 @@ typedef struct { GnssMeasurementsMultipathIndicator multipathIndicator; double signalToNoiseRatioDb; double agcLevelDb; + GnssMeasurementsCodeType codeType; + char otherCodeTypeName[GNSS_MAX_NAME_LENGTH]; } GnssMeasurementsData; typedef struct { From ce952c486ad4251355da6aee74e871cb9f8b3508 Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Tue, 5 Feb 2019 11:14:10 +0530 Subject: [PATCH 800/945] GTP: Remove GTP-WAA and GTP AP CELL feature. Remove GTP-WAA and GTP_AP_CELL feature as GTP will support only third party GTP WIFI and legacy GTP WWAN solution. CRs-Fixed: 2384327 Change-Id: Id3613bde1716542027978af30084f5e997f28b00 --- utils/loc_cfg.cpp | 74 +---------------------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 8160cc14..de887eec 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -465,14 +465,9 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta #define LOC_FEATURE_MASK_GTP_WIFI_PREMIUM 0X02 #define LOC_FEATURE_MASK_GTP_CELL_BASIC 0X04 #define LOC_FEATURE_MASK_GTP_CELL_PREMIUM 0X08 -#define LOC_FEATURE_MASK_GTP_AP_CELL_BASIC LOC_FEATURE_MASK_GTP_CELL_BASIC -#define LOC_FEATURE_MASK_GTP_AP_CELL_PREMIUM LOC_FEATURE_MASK_GTP_CELL_PREMIUM #define LOC_FEATURE_MASK_SAP_BASIC 0x40 #define LOC_FEATURE_MASK_SAP_PREMIUM 0X80 -#define LOC_FEATURE_MASK_GTP_WAA_BASIC 0X100 -#define LOC_FEATURE_MASK_GTP_WAA_PREMIUM 0x200 #define LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC 0X400 -#define LOC_FEATURE_MASK_GTP_MODEM_CELL_PREMIUM 0X800 #define LOC_FEATURE_MASK_ODCPI 0x1000 #define LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT 0x2000 #define LOC_FEATURE_MASK_SUPL_WIFI 0x4000 @@ -572,8 +567,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p char config_mask = 0; unsigned char proc_list_length=0; int gtp_cell_ap_enabled = 0; - char arg_gtp_waa[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; - char arg_gtp_ap_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_gtp_modem_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_gtp_wifi[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_sap[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; @@ -589,8 +582,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p UTIL_READ_CONF(LOC_PATH_GPS_CONF, gps_conf_parameter_table); //Form argument strings - strlcat(arg_gtp_waa, LOC_FEATURE_GTP_WAA, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); - strlcat(arg_gtp_ap_cell, LOC_FEATURE_GTP_AP_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_gtp_modem_cell, LOC_FEATURE_GTP_MODEM_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_gtp_wifi, LOC_FEATURE_GTP_WIFI, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_sap, LOC_FEATURE_SAP, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); @@ -622,9 +613,6 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p " Setting GTP WIFI to default mode: DISABLED", __func__, __LINE__); } - //Set service mask for GTP_WAA - LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__); - //Set service mask for SAP if(strcmp(conf.feature_sap, "PREMIUM") == 0) { LOC_LOGD("%s:%d]: Setting SAP to mode: PREMIUM", __func__, __LINE__); @@ -931,79 +919,19 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } if(conf.loc_feature_mask & (LOC_FEATURE_MASK_GTP_CELL_BASIC | LOC_FEATURE_MASK_GTP_CELL_PREMIUM )) { - if(loc_service_mask & LOC_FEATURE_MASK_GTP_AP_CELL_BASIC){ - strlcpy(child_proc[j].args[i++], arg_gtp_ap_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_basic, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_gtp_modem_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - else if(loc_service_mask & LOC_FEATURE_MASK_GTP_AP_CELL_PREMIUM){ - strlcpy(child_proc[j].args[i++], arg_gtp_ap_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_premium, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_gtp_modem_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - else if(loc_service_mask & LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC) { + if(loc_service_mask & LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC) { strlcpy(child_proc[j].args[i++], arg_gtp_modem_cell, LOC_PROCESS_MAX_ARG_STR_LENGTH); strlcpy(child_proc[j].args[i++], arg_basic, LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_gtp_ap_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - else if(loc_service_mask & LOC_FEATURE_MASK_GTP_MODEM_CELL_PREMIUM) { - strlcpy(child_proc[j].args[i++], arg_gtp_modem_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_premium, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_gtp_ap_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); } else { - strlcpy(child_proc[j].args[i++], arg_gtp_ap_cell, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); strlcpy(child_proc[j].args[i++], arg_gtp_modem_cell, LOC_PROCESS_MAX_ARG_STR_LENGTH); strlcpy(child_proc[j].args[i++], arg_disabled, LOC_PROCESS_MAX_ARG_STR_LENGTH); } } - if(conf.loc_feature_mask & - (LOC_FEATURE_MASK_GTP_WAA_BASIC | LOC_FEATURE_MASK_GTP_WAA_PREMIUM)) { - if(loc_service_mask & LOC_FEATURE_MASK_GTP_WAA_BASIC) { - strlcpy(child_proc[j].args[i++], arg_gtp_waa, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_basic, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - else if(loc_service_mask & LOC_FEATURE_MASK_GTP_WAA_PREMIUM) { - strlcpy(child_proc[j].args[i++], arg_gtp_waa, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_premium, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - else - { - strlcpy(child_proc[j].args[i++], arg_gtp_waa, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - strlcpy(child_proc[j].args[i++], arg_disabled, - LOC_PROCESS_MAX_ARG_STR_LENGTH); - } - } if(conf.loc_feature_mask & (LOC_FEATURE_MASK_SAP_BASIC | LOC_FEATURE_MASK_SAP_PREMIUM)) { if(loc_service_mask & LOC_FEATURE_MASK_SAP_BASIC) { From 90310754f831db93624240fa3592d2ef50e564d6 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 25 Feb 2019 11:15:42 -0800 Subject: [PATCH 801/945] Add module android.hardware.gnss@2.0 for build CRs-fixed: 2404857 Change-Id: I873ce21e1fb4924a1f3bb2e7162791f6d69be51d --- gps_vendor_product.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gps_vendor_product.mk b/gps_vendor_product.mk index cfe2b903..c21a2827 100644 --- a/gps_vendor_product.mk +++ b/gps_vendor_product.mk @@ -3,6 +3,8 @@ PRODUCT_PACKAGES += android.hardware.gnss@1.0-impl-qti PRODUCT_PACKAGES += android.hardware.gnss@1.0-service-qti PRODUCT_PACKAGES += android.hardware.gnss@1.1-impl-qti PRODUCT_PACKAGES += android.hardware.gnss@1.1-service-qti +PRODUCT_PACKAGES += android.hardware.gnss@2.0-impl-qti +PRODUCT_PACKAGES += android.hardware.gnss@2.0-service-qti PRODUCT_PACKAGES += gps.conf PRODUCT_PACKAGES += libloc_core PRODUCT_PACKAGES += libgnss From a928d60188ff466fce61c2c83e381790c4497426 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Mon, 25 Feb 2019 13:31:49 -0800 Subject: [PATCH 802/945] util to get get symbol from a library Added dlGetSymFromLib() to provide a utility that dlopen()'s a library, and get the pointer to a symbol name. Change-Id: I770eaef18a61aaa458833b3ca778f44b299585f5 CRs-Fixed: 2404939 --- utils/Android.mk | 1 + utils/Makefile.am | 2 +- utils/loc_misc_utils.cpp | 31 +++++++++++++++++++++++++++++++ utils/loc_misc_utils.h | 28 ++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/utils/Android.mk b/utils/Android.mk index ec6bf058..38876965 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -9,6 +9,7 @@ include $(CLEAR_VARS) ## Libs LOCAL_SHARED_LIBRARIES := \ + libdl \ libutils \ libcutils \ liblog \ diff --git a/utils/Makefile.am b/utils/Makefile.am index 33afc1be..50e1e9a1 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -61,7 +61,7 @@ libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif -libgps_utils_la_LIBADD = $(CUTILS_LIBS) +libgps_utils_la_LIBADD = $(CUTILS_LIBS) -ldl #Create and Install libraries lib_LTLIBRARIES = libgps_utils.la diff --git a/utils/loc_misc_utils.cpp b/utils/loc_misc_utils.cpp index b7c84061..70fdbc3a 100644 --- a/utils/loc_misc_utils.cpp +++ b/utils/loc_misc_utils.cpp @@ -30,6 +30,7 @@ #define LOG_TAG "LocSvc_misc_utils" #include #include +#include #include #include #include @@ -112,3 +113,33 @@ void loc_util_trim_space(char *org_string) err: return; } + +inline void logDlError(const char* failedCall) { + const char * err = dlerror(); + LOC_LOGe("%s error: %s", failedCall, (nullptr == err) ? "unknown" : err); +} + +void* dlGetSymFromLib(void*& libHandle, const char* libName, const char* symName) +{ + void* sym = nullptr; + if ((nullptr != libHandle || nullptr != libName) && nullptr != symName) { + if (nullptr == libHandle) { + libHandle = dlopen(libName, RTLD_NOW); + if (nullptr == libHandle) { + logDlError("dlopen"); + } + } + // NOT else, as libHandle gets assigned 5 line above + if (nullptr != libHandle) { + sym = dlsym(libHandle, symName); + if (nullptr == sym) { + logDlError("dlsym"); + } + } + } else { + LOC_LOGe("Either libHandle (%p) or libName (%p) must not be null; " + "symName (%p) can not be null.", libHandle, libName, symName); + } + + return sym; +} diff --git a/utils/loc_misc_utils.h b/utils/loc_misc_utils.h index 7d66d842..fad1b6db 100644 --- a/utils/loc_misc_utils.h +++ b/utils/loc_misc_utils.h @@ -92,6 +92,34 @@ SIDE EFFECTS N/A ===========================================================================*/ void loc_util_trim_space(char *org_string); + +/*=========================================================================== +FUNCTION dlGetSymFromLib + +DESCRIPTION + Handy function to get a pointer to a symbol from a library. + + If libHandle is not null, it will be used as the handle to the library. In + that case libName wll not be used; + libHandle is an in / out parameter. + If libHandle is null, libName will be used to dlopen. + Either libHandle or libName must not be nullptr. + symName must not be null. + +DEPENDENCIES + N/A + +RETURN VALUE + pointer to symName. Could be nullptr if + Parameters are incorrect; or + libName can not be opened; or + symName can not be found. + +SIDE EFFECTS + N/A +===========================================================================*/ +void* dlGetSymFromLib(void*& libHandle, const char* libName, const char* symName); + #ifdef __cplusplus } #endif From e22619060be72c2e5729612a2f811c8b252c5eec Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 20 Feb 2019 11:30:12 -0800 Subject: [PATCH 803/945] Remove tracking redundanty and assure min interval A tracking interval should not be less than 100ms If tracking interval or power mode is updated to the same value, then start tracking should not be sent to the modem again. Fix some issues with multiplex with powerMode Change-Id: I91e5d0577569b96179a5337af0fc91641dc126db CRs-fixed: 2190953 --- core/LocAdapterBase.h | 2 ++ gnss/GnssAdapter.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e4f7be22..a0dd63e2 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -34,6 +34,8 @@ #include #include +#define MIN_TRACKING_INTERVAL (100) // 100 msec + typedef struct LocationSessionKey { LocationAPI* client; uint32_t id; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 016356b4..7b8d07f0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2303,6 +2303,9 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; } + if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) { + mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL; + } // Api doesn't support multiple clients for time based tracking, so mutiplex bool reportToClientWithNoWait = mAdapter.startTrackingMultiplex(mClient, mSessionId, mTrackingOptions); @@ -2361,6 +2364,7 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, } if (updateOptions) { // restart time based tracking with the newly updated options + startTracking(client, sessionId, multiplexedOptions); // need to wait for QMI callback reportToClientWithNoWait = false; @@ -2375,6 +2379,10 @@ void GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions) { + LOC_LOGd("minInterval %u minDistance %u mode %u powermode %u tbm %u", + trackingOptions.minInterval, trackingOptions.minDistance, + trackingOptions.mode, trackingOptions.powerMode, trackingOptions.tbm); + LocPosMode locPosMode = {}; convertOptions(locPosMode, trackingOptions); @@ -2487,6 +2495,9 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; } + if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) { + mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL; + } // Api doesn't support multiple clients for time based tracking, so mutiplex bool reportToClientWithNoWait = mAdapter.updateTrackingMultiplex(mClient, mSessionId, mTrackingOptions); From b082fd7f7b113eea91a6a8756bb3991dda7b0491 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 27 Feb 2019 14:44:29 -0800 Subject: [PATCH 804/945] allow a isMaster client in LocAdapterProxyBase ctor This would allow GeofenceAdapter become a master adapter, in case it gets created before GnssAdapter. Change-Id: I9eb55b7fac9970fd11d4e34bdf7cf824e5b1c586 CRs-Fixed: 2403691 --- core/LocAdapterBase.h | 10 +++------- core/LocAdapterProxyBase.h | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index e4f7be22..97e0b4aa 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -69,15 +69,11 @@ protected: inline LocAdapterBase(const MsgTask* msgTask) : mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL), mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} - LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, bool isMaster, - LocAdapterProxyBase *adapterProxyBase = NULL); public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - inline LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, - LocAdapterProxyBase *adapterProxyBase = NULL) : - LocAdapterBase(mask, context, false, adapterProxyBase) {} + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context, bool isMaster = false, + LocAdapterProxyBase *adapterProxyBase = NULL); inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { diff --git a/core/LocAdapterProxyBase.h b/core/LocAdapterProxyBase.h index b33d7b0e..727d424f 100644 --- a/core/LocAdapterProxyBase.h +++ b/core/LocAdapterProxyBase.h @@ -40,8 +40,8 @@ private: LocAdapterBase *mLocAdapterBase; protected: inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context): - mLocAdapterBase(new LocAdapterBase(mask, context, this)) { + ContextBase* context, bool isMaster = false): + mLocAdapterBase(new LocAdapterBase(mask, context, isMaster, this)) { } inline virtual ~LocAdapterProxyBase() { delete mLocAdapterBase; From d0825b64efe1ff3ab2e10ecc7aa64d33248c5b0a Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 8 Mar 2019 10:20:43 +0800 Subject: [PATCH 805/945] Fix makefile error for Gnss Hidl Correct the if-else-endif logic error. Change-Id: I5d3fa711e911642def689308f73c19f0c46ab632 CRs-fixed: 2411979 --- android/Android.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/Android.mk b/android/Android.mk index c1bdd594..f117def1 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -7,9 +7,8 @@ ifeq ($(GNSS_HIDL_VERSION),1.1) include $(LOCAL_PATH)/1.1/Android.mk else include $(LOCAL_PATH)/1.0/Android.mk -endif +endif #GNSS HIDL 1.1 +endif #GNSS HIDL 2.0 else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti include $(LOCAL_PATH)/dummy/Android.mk -endif - endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE From 6b687ef48e134b153a256cb0c8f05860722de72e Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 19 Feb 2019 18:37:58 +0800 Subject: [PATCH 806/945] Combine updateConfig in GnssAdapter Adjust setConfigCommand and gnssUpdateConfigCommand to use one gnssUpdateConfig method. CRs-fixed: 2402752 Change-Id: I6a9ec474bd9ffed52edd2422574af0f6d41493c4 --- gnss/GnssAdapter.cpp | 378 +++++++++++++++++++++++-------------------- gnss/GnssAdapter.h | 4 + 2 files changed, 207 insertions(+), 175 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e0290ad4..fe02db13 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -681,45 +681,36 @@ GnssAdapter::setConfigCommand() mApi.sendMsg(new LocApiMsg( [&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () { - - std::string serverUrl = adapter.getServerUrl(); - std::string moServerUrl = adapter.getMoServerUrl(); - int serverUrlLen = serverUrl.length(); - int moServerUrlLen = moServerUrl.length(); + //cache the injected configuration with GnssConfigRequested struct + GnssConfig gnssConfigRequested = {}; + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + if (0 == adapter.getPowerVoteId()) { + gnssConfigRequested.gpsLock = adapter.convertGpsLock(gpsConf.GPS_LOCK); + } if (gpsConf.AGPS_CONFIG_INJECT) { - adapter.mLocApi->setSUPLVersionSync( - adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER)); - adapter.mLocApi->setLPPConfigSync( - adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE)); - adapter.mLocApi->setAGLONASSProtocolSync( - gpsConf.A_GLONASS_POS_PROTOCOL_SELECT); + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + gnssConfigRequested.suplVersion = + adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); + gnssConfigRequested.lppProfile = + adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); + gnssConfigRequested.aGlonassPositionProtocolMask = + gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; } - - if ((serverUrlLen !=0) && (oldServerUrl.compare(serverUrl) != 0)) { - LocationError locErr = - adapter.mLocApi->setServerSync(serverUrl.c_str(), serverUrlLen, - LOC_AGPS_SUPL_SERVER); - if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGe("Error while setting SUPL_HOST server:%s", - serverUrl.c_str()); - } - } - if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) { - LocationError locErr = - adapter.mLocApi->setServerSync(moServerUrl.c_str(), - moServerUrlLen, - LOC_AGPS_MO_SUPL_SERVER); - if (locErr != LOCATION_ERROR_SUCCESS) { - LOC_LOGe("Error while setting MO SUPL_HOST server:%s", - moServerUrl.c_str()); - } - } - - adapter.mLocApi->setLPPeProtocolCpSync( - adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY)); - adapter.mLocApi->setLPPeProtocolUpSync( - adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY)); + gnssConfigRequested.lppeControlPlaneMask = + adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); + gnssConfigRequested.lppeUserPlaneMask = + adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); + gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(), + adapter.mBlacklistedSvIds.end()); + adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested, + gnssConfigRequested); // set nmea mask type uint32_t mask = 0; @@ -778,6 +769,180 @@ GnssAdapter::setConfigCommand() sendMsg(new MsgSetConfig(*this, *mLocApi)); } +std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldServerUrl, + const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested, + const GnssConfig& gnssConfigNeedEngineUpdate, size_t count) { + loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; + size_t index = 0; + LocationError err = LOCATION_ERROR_SUCCESS; + std::vector errsList = {err}; + if (count > 0) { + errsList.insert(errsList.begin(), count, LOCATION_ERROR_SUCCESS); + } + + + std::string serverUrl = getServerUrl(); + std::string moServerUrl = getMoServerUrl(); + + int serverUrlLen = serverUrl.length(); + int moServerUrlLen = moServerUrl.length(); + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { + err = mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_SUPL) { + if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { + + err = mLocApi->setServerSync( + serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); + if (index < count) { + errsList[index] = err; + } + } + if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) { + LocationError locErr = + mLocApi->setServerSync(moServerUrl.c_str(), + moServerUrlLen, + LOC_AGPS_MO_SUPL_SERVER); + if (locErr != LOCATION_ERROR_SUCCESS) { + LOC_LOGe("Error while setting MO SUPL_HOST server:%s", + moServerUrl.c_str()); + } + } + } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == + GNSS_ASSISTANCE_TYPE_C2K) { + struct in_addr addr; + struct hostent* hp; + bool resolveAddrSuccess = true; + + hp = gethostbyname( + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + if (hp != NULL) { /* DNS OK */ + memcpy(&addr, hp->h_addr_list[0], hp->h_length); + } else { + /* Try IP representation */ + if (inet_aton( + gnssConfigNeedEngineUpdate.assistanceServer.hostName, + &addr) == 0) { + /* IP not valid */ + LOC_LOGE("%s]: hostname '%s' cannot be resolved ", + __func__, + gnssConfigNeedEngineUpdate.assistanceServer.hostName); + if (index < count) { + errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; + } + } else { + resolveAddrSuccess = false; + } + } + + if (resolveAddrSuccess) { + unsigned int ip = htonl(addr.s_addr); + err = mLocApi->setServerSync(ip, + gnssConfigNeedEngineUpdate.assistanceServer.port, + LOC_AGPS_CDMA_PDE_SERVER); + if (index < count) { + errsList[index] = err; + } + } + } + } + index++; + } + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { + err = mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { + err = mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { + err = mLocApi->setLPPeProtocolCpSync( + gnssConfigRequested.lppeControlPlaneMask); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { + err = mLocApi->setLPPeProtocolUpSync( + gnssConfigRequested.lppeUserPlaneMask); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { + err = mLocApi->setAGLONASSProtocolSync( + gnssConfigRequested.aGlonassPositionProtocolMask); + if (index < count) { + errsList[index] = err; + } + } + index++; + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { + // Check if feature is supported + if (!ContextBase::isFeatureSupported( + LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + LOC_LOGe("Feature constellation enablement not supported."); + err = LOCATION_ERROR_NOT_SUPPORTED; + } else { + // Send the SV ID Config to Modem + mBlacklistedSvIds.assign(gnssConfigRequested.blacklistedSvIds.begin(), + gnssConfigRequested.blacklistedSvIds.end()); + err = gnssSvIdConfigUpdateSync(gnssConfigRequested.blacklistedSvIds); + if (LOCATION_ERROR_SUCCESS != err) { + LOC_LOGe("Failed to send config to modem, err %d", err); + } + } + if (index < count) { + errsList[index] = err; + } + index++; + } + return errsList; +} + uint32_t* GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) { @@ -962,148 +1127,11 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) mApi.sendMsg(new LocApiMsg( [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () { - - size_t index = 0; - LocationError err = LOCATION_ERROR_SUCCESS; - std::vector errsList(errs); - std::string serverUrl = adapter.getServerUrl(); int serverUrlLen = serverUrl.length(); + std::vector errsList = adapter.gnssUpdateConfig(oldServerUrl, + "", gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs); - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - err = adapter.mLocApi->setGpsLockSync(gnssConfigRequested.gpsLock); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & - GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.assistanceServer.type == - GNSS_ASSISTANCE_TYPE_SUPL) { - if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { - err = adapter.mLocApi->setServerSync( - serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - } else if (gnssConfigNeedEngineUpdate.assistanceServer.type == - GNSS_ASSISTANCE_TYPE_C2K) { - struct in_addr addr; - struct hostent* hp; - bool resolveAddrSuccess = true; - - hp = gethostbyname( - gnssConfigNeedEngineUpdate.assistanceServer.hostName); - if (hp != NULL) { /* DNS OK */ - memcpy(&addr, hp->h_addr_list[0], hp->h_length); - } else { - /* Try IP representation */ - if (inet_aton( - gnssConfigNeedEngineUpdate.assistanceServer.hostName, - &addr) == 0) { - /* IP not valid */ - LOC_LOGE("%s]: hostname '%s' cannot be resolved ", - __func__, - gnssConfigNeedEngineUpdate.assistanceServer.hostName); - if (index < countOfConfigs) { - errsList[index] = LOCATION_ERROR_INVALID_PARAMETER; - } - } else { - resolveAddrSuccess = false; - } - } - - if (resolveAddrSuccess) { - unsigned int ip = htonl(addr.s_addr); - err = adapter.mLocApi->setServerSync(ip, - gnssConfigNeedEngineUpdate.assistanceServer.port, - LOC_AGPS_CDMA_PDE_SERVER); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - } - } - index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { - err = adapter.mLocApi->setSUPLVersionSync(gnssConfigRequested.suplVersion); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { - err = adapter.mLocApi->setLPPConfigSync(gnssConfigRequested.lppProfile); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { - err = adapter.mLocApi->setLPPeProtocolCpSync( - gnssConfigRequested.lppeControlPlaneMask); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { - err = adapter.mLocApi->setLPPeProtocolUpSync( - gnssConfigRequested.lppeUserPlaneMask); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { - if (gnssConfigNeedEngineUpdate.flags & - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { - err = adapter.mLocApi->setAGLONASSProtocolSync( - gnssConfigRequested.aGlonassPositionProtocolMask); - if (index < countOfConfigs) { - errsList[index] = err; - } - } - index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT) { - // Check if feature is supported - if (!ContextBase::isFeatureSupported( - LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { - LOC_LOGe("Feature constellation enablement not supported."); - err = LOCATION_ERROR_NOT_SUPPORTED; - } else { - // Send the SV ID Config to Modem - err = adapter.gnssSvIdConfigUpdateSync(gnssConfigRequested.blacklistedSvIds); - if (LOCATION_ERROR_SUCCESS != err) { - LOC_LOGe("Failed to send config to modem, err %d", err); - } - } - if (index < countOfConfigs) { - errsList[index] = err; - } - index++; - } configCollectiveResponse->returnToSender(errsList); })); } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 55cadba6..381ccf44 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -175,6 +175,7 @@ class GnssAdapter : public LocAdapterBase { std::string mMoServerUrl; XtraSystemStatusObserver mXtraObserver; LocationSystemInfo mLocSystemInfo; + std::vector mBlacklistedSvIds; /* === Misc ===================================================================== */ BlockCPIInfo mBlockCPIInfo; @@ -278,6 +279,9 @@ public: uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); + std::vector gnssUpdateConfig(const std::string& oldServerUrl, + const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested, + const GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0); /* ==== GNSS SV TYPE CONFIG ============================================================ */ /* ==== COMMANDS ====(Called from Client Thread)======================================== */ From ac8ce3c7d5b189a55c9de4ae31b50fa9adb20ddd Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 13 Mar 2019 16:47:02 +0530 Subject: [PATCH 807/945] Dummy impl for injectBestLocation_2_0 Change-Id: I37a96ee52dea4bce92bb741bf0be79279ec86d67 --- android/2.0/Gnss.cpp | 8 ++++++++ android/2.0/Gnss.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 0a4b34ba..0c9519fa 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -488,6 +488,14 @@ Return Gnss::injectBestLocation_2_0( + const ::android::hardware::gnss::V2_0::GnssLocation& location) { + ENTRY_LOG_CALLFLOW(); + /* TBD */ + return false; +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h index bef1e3ac..b0a4f91f 100644 --- a/android/2.0/Gnss.h +++ b/android/2.0/Gnss.h @@ -119,6 +119,9 @@ struct Gnss : public IGnss { Return> getExtensionMeasurementCorrections() override; Return> getExtensionGnssMeasurement_2_0() override; + + Return injectBestLocation_2_0(const ::android::hardware::gnss::V2_0::GnssLocation& location) override; + /** * This method returns the IGnssVisibilityControl interface. * From 8d7df7b2c19e4b739af12676aa4d807d5d4ff598 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Mon, 18 Mar 2019 10:46:34 +0800 Subject: [PATCH 808/945] enable gnss integer-overflow sanitization Change-Id: I27359843e5f22353771b8843012f110cbd704094 CRs-Fixed: 2341063 --- build/target_specific_features.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 0c0f7301..46cca6c0 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -16,6 +16,8 @@ GNSS_CFLAGS := \ -Wno-error=switch \ -Wno-error=date-time +LOCAL_SANITIZE := signed-integer-overflow, unsigned-integer-overflow + # GPS-HIDL GNSS_HIDL_1_0_TARGET_LIST := msm8960 GNSS_HIDL_1_0_TARGET_LIST += msm8974 From 3a0ae431d5ae96a29686306f114ca77312d13356 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 15 Mar 2019 12:54:02 -0700 Subject: [PATCH 809/945] Add unlink for corresponding link in measurements for GNSS HIDL 2.0 Change-Id: I7423ed1c515745f2f4a0ea4f5495e86eea4de0ee CRs-fixed: 2417264 --- android/2.0/GnssMeasurement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/2.0/GnssMeasurement.cpp b/android/2.0/GnssMeasurement.cpp index 48dabf35..721a48c3 100644 --- a/android/2.0/GnssMeasurement.cpp +++ b/android/2.0/GnssMeasurement.cpp @@ -91,6 +91,10 @@ Return GnssMeasurement::close() { mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient); mGnssMeasurementCbIface_1_1 = nullptr; } + if (mGnssMeasurementCbIface_2_0 != nullptr) { + mGnssMeasurementCbIface_2_0->unlinkToDeath(mGnssMeasurementDeathRecipient); + mGnssMeasurementCbIface_2_0 = nullptr; + } mApi->measurementClose(); return Void(); From 1839fb1140242da10a6a599e65a7b79836007517 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Thu, 20 Dec 2018 15:05:08 +0800 Subject: [PATCH 810/945] clear magic number for GPS_LOCK Change-Id: I3c1b5a18ab16382a436098f8af541bf7f125783e CRs-fixed: 2370451 --- core/ContextBase.cpp | 2 +- core/ContextBase.h | 2 +- gnss/GnssAdapter.cpp | 44 +++++-------------------------- gnss/GnssAdapter.h | 2 -- gnss/XtraSystemStatusObserver.cpp | 2 +- gnss/XtraSystemStatusObserver.h | 4 +-- location/LocationDataTypes.h | 5 ++-- 7 files changed, 15 insertions(+), 46 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 3d55e1ca..28109bb0 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -108,7 +108,7 @@ void ContextBase::readConfig() mGps_conf.INTERMEDIATE_POS = 0; mGps_conf.ACCURACY_THRES = 0; mGps_conf.NMEA_PROVIDER = 0; - mGps_conf.GPS_LOCK = 0x03; + mGps_conf.GPS_LOCK = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; mGps_conf.SUPL_VER = 0x10000; mGps_conf.SUPL_MODE = 0x1; mGps_conf.SUPL_ES = 0; diff --git a/core/ContextBase.h b/core/ContextBase.h index 8a3d3000..9c728354 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -55,7 +55,7 @@ typedef struct loc_gps_cfg_s char XTRA_SERVER_3[LOC_MAX_PARAM_STRING]; uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; uint32_t NMEA_PROVIDER; - uint32_t GPS_LOCK; + GnssConfigGpsLock GPS_LOCK; uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t AGPS_CERT_WRITABLE_MASK; uint32_t AGPS_CONFIG_INJECT; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index fe02db13..eee55e37 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -428,37 +428,7 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, } } -inline uint32_t -GnssAdapter::convertGpsLock(const GnssConfigGpsLock gpsLock) -{ - switch (gpsLock) { - case GNSS_CONFIG_GPS_LOCK_MO: - return 1; - case GNSS_CONFIG_GPS_LOCK_NI: - return 2; - case GNSS_CONFIG_GPS_LOCK_MO_AND_NI: - return 3; - case GNSS_CONFIG_GPS_LOCK_NONE: - default: - return 0; - } -} -inline GnssConfigGpsLock -GnssAdapter::convertGpsLock(const uint32_t gpsLock) -{ - switch (gpsLock) { - case 1: - return GNSS_CONFIG_GPS_LOCK_MO; - case 2: - return GNSS_CONFIG_GPS_LOCK_NI; - case 3: - return GNSS_CONFIG_GPS_LOCK_MO_AND_NI; - case 0: - default: - return GNSS_CONFIG_GPS_LOCK_NONE; - } -} inline uint32_t GnssAdapter::convertSuplVersion(const GnssConfigSuplVersion suplVersion) @@ -689,7 +659,7 @@ GnssAdapter::setConfigCommand() GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; if (0 == adapter.getPowerVoteId()) { - gnssConfigRequested.gpsLock = adapter.convertGpsLock(gpsConf.GPS_LOCK); + gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; } if (gpsConf.AGPS_CONFIG_INJECT) { @@ -1010,9 +980,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) int index = 0; if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { - uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock); - if (0 == newGpsLock) { - newGpsLock = 3; + GnssConfigGpsLock newGpsLock = gnssConfigRequested.gpsLock; + if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) { + newGpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; } if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK || 0 != mAdapter.getPowerVoteId()) { @@ -2846,7 +2816,7 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) })); mAdapter.mXtraObserver.updateLockStatus( - mAdapter.convertGpsLock(GNSS_CONFIG_GPS_LOCK_NONE)); + GNSS_CONFIG_GPS_LOCK_NONE); } mAdapter.reportResponse(err, mSessionId); } @@ -2890,12 +2860,12 @@ GnssAdapter::disableCommand(uint32_t id) mAdapter.setPowerVoteId(0); GnssConfigGpsLock gpsLock = - mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK); + ContextBase::mGps_conf.GPS_LOCK; mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { mApi.setGpsLockSync(gpsLock); })); mAdapter.mXtraObserver.updateLockStatus( - mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); + ContextBase::mGps_conf.GPS_LOCK); } mAdapter.reportResponse(err, mSessionId); } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 381ccf44..1f72c43c 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -396,8 +396,6 @@ public: std::string& getMoServerUrl(void) { return mMoServerUrl; } /*==== CONVERSION ===================================================================*/ - static uint32_t convertGpsLock(const GnssConfigGpsLock gpsLock); - static GnssConfigGpsLock convertGpsLock(const uint32_t gpsLock); static uint32_t convertSuplVersion(const GnssConfigSuplVersion suplVersion); static uint32_t convertLppProfile(const GnssConfigLppProfile lppProfile); static uint32_t convertEP4ES(const GnssConfigEmergencyPdnForEmergencySupl); diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index d84ae424..962e1000 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -56,7 +56,7 @@ using namespace loc_core; #endif #define LOG_TAG "LocSvc_XSSO" -bool XtraSystemStatusObserver::updateLockStatus(uint32_t lock) { +bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { mGpsLock = lock; if (!mReqStatusReceived) { diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index b49a0bcd..cbbeda61 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -60,7 +60,7 @@ public : inline virtual void getName(string& name); virtual void notify(const list& dlist); - bool updateLockStatus(uint32_t lock); + bool updateLockStatus(GnssConfigGpsLock lock); bool updateConnections(uint64_t allConnections); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); @@ -74,7 +74,7 @@ protected: private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; - int32_t mGpsLock; + GnssConfigGpsLock mGpsLock; uint64_t mConnections; string mTac; string mMccmnc; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 5f21e0b2..f60ba78b 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -225,12 +225,13 @@ typedef enum { } LocationTechnologyType; // Configures how GPS is locked when GPS is disabled (through GnssDisable) -typedef enum { +enum { GNSS_CONFIG_GPS_LOCK_NONE = 0, // gps is not locked when GPS is disabled (GnssDisable) GNSS_CONFIG_GPS_LOCK_MO, // gps mobile originated (MO) is locked when GPS is disabled GNSS_CONFIG_GPS_LOCK_NI, // gps network initiated (NI) is locked when GPS is disabled GNSS_CONFIG_GPS_LOCK_MO_AND_NI,// gps MO and NI is locked when GPS is disabled -} GnssConfigGpsLock; +}; +typedef int32_t GnssConfigGpsLock; // SUPL version typedef enum { From 8bd22760a63799075005c8f8de217cf4cc38b589 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 21 Feb 2019 17:01:13 +0530 Subject: [PATCH 811/945] Unified Vendor - Launch only android.hardware.gnss Launch android.hardware.gnss HIDL service for both vendor enhanced and non-enhanced platforms Change-Id: Ia9cb9ef52d42c788bcaa73bc1001ed8d90f7c755 CRs-Fixed: 2402833 --- android/1.0/Android.mk | 5 ++++ android/1.0/service.cpp | 51 +++++++++++++++++++++++++++++++++++++---- android/1.1/Android.mk | 5 ++++ android/1.1/service.cpp | 51 +++++++++++++++++++++++++++++++++++++---- android/2.0/Android.mk | 5 ++++ android/2.0/service.cpp | 50 ++++++++++++++++++++++++++++++++++++---- 6 files changed, 153 insertions(+), 14 deletions(-) diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index 434b4321..122ff8d1 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -81,4 +81,9 @@ LOCAL_SHARED_LIBRARIES += \ android.hardware.gnss@1.0 \ LOCAL_CFLAGS += $(GNSS_CFLAGS) + +ifneq ($(LOC_HIDL_VERSION),) +LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"' +endif + include $(BUILD_EXECUTABLE) diff --git a/android/1.0/service.cpp b/android/1.0/service.cpp index ee61a102..04bb8abf 100644 --- a/android/1.0/service.cpp +++ b/android/1.0/service.cpp @@ -22,22 +22,63 @@ #include #include - #include "loc_cfg.h" +#include "loc_misc_utils.h" + extern "C" { #include "vndfwk-detect.h" } +#ifdef ARCH_ARM_32 +#define DEFAULT_HW_BINDER_MEM_SIZE 65536 +#endif + using android::hardware::gnss::V1_0::IGnss; -using android::hardware::defaultPassthroughServiceImplementation; + +using android::hardware::configureRpcThreadpool; +using android::hardware::registerPassthroughServiceImplementation; +using android::hardware::joinRpcThreadpool; + +using android::status_t; +using android::OK; + +typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); int main() { + + ALOGI("%s", __FUNCTION__); + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); setVendorEnhanced(vendorEnhanced); - if (!vendorEnhanced) { - return defaultPassthroughServiceImplementation(); +#ifdef ARCH_ARM_32 + android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); +#endif + configureRpcThreadpool(1, true); + status_t status; + + status = registerPassthroughServiceImplementation(); + if (status == OK) { + if (vendorEnhanced) { + #ifdef LOC_HIDL_VERSION + #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" + + void* libHandle = NULL; + vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) + dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); + if (NULL != vendorEnhancedMainMethod) { + (*vendorEnhancedMainMethod)(0, NULL); + } + #else + ALOGE("LOC_HIDL_VERSION not defined."); + #endif + } + + joinRpcThreadpool(); + } else { - return -1; + ALOGE("Error while registering IGnss 1.0 service: %d", status); } + + return 0; } diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index 33e5b0dc..5c97f400 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -83,4 +83,9 @@ LOCAL_SHARED_LIBRARIES += \ android.hardware.gnss@1.1 \ LOCAL_CFLAGS += $(GNSS_CFLAGS) + +ifneq ($(LOC_HIDL_VERSION),) +LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"' +endif + include $(BUILD_EXECUTABLE) diff --git a/android/1.1/service.cpp b/android/1.1/service.cpp index c1bc6b0e..bf7ad07c 100644 --- a/android/1.1/service.cpp +++ b/android/1.1/service.cpp @@ -22,22 +22,63 @@ #include #include - #include "loc_cfg.h" +#include "loc_misc_utils.h" + extern "C" { #include "vndfwk-detect.h" } +#ifdef ARCH_ARM_32 +#define DEFAULT_HW_BINDER_MEM_SIZE 65536 +#endif + using android::hardware::gnss::V1_1::IGnss; -using android::hardware::defaultPassthroughServiceImplementation; + +using android::hardware::configureRpcThreadpool; +using android::hardware::registerPassthroughServiceImplementation; +using android::hardware::joinRpcThreadpool; + +using android::status_t; +using android::OK; + +typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); int main() { + + ALOGI("%s", __FUNCTION__); + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); setVendorEnhanced(vendorEnhanced); - if (!vendorEnhanced) { - return defaultPassthroughServiceImplementation(); +#ifdef ARCH_ARM_32 + android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); +#endif + configureRpcThreadpool(1, true); + status_t status; + + status = registerPassthroughServiceImplementation(); + if (status == OK) { + if (vendorEnhanced) { + #ifdef LOC_HIDL_VERSION + #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" + + void* libHandle = NULL; + vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) + dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); + if (NULL != vendorEnhancedMainMethod) { + (*vendorEnhancedMainMethod)(0, NULL); + } + #else + ALOGE("LOC_HIDL_VERSION not defined."); + #endif + } + + joinRpcThreadpool(); + } else { - return -1; + ALOGE("Error while registering IGnss 1.1 service: %d", status); } + + return 0; } diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 0fa50bdf..244bd9c1 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -89,4 +89,9 @@ LOCAL_SHARED_LIBRARIES += \ android.hardware.gnss@2.0 \ LOCAL_CFLAGS += $(GNSS_CFLAGS) + +ifneq ($(LOC_HIDL_VERSION),) +LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"' +endif + include $(BUILD_EXECUTABLE) diff --git a/android/2.0/service.cpp b/android/2.0/service.cpp index 1fdccabe..16f0b06b 100644 --- a/android/2.0/service.cpp +++ b/android/2.0/service.cpp @@ -23,20 +23,62 @@ #include #include #include "loc_cfg.h" +#include "loc_misc_utils.h" extern "C" { #include "vndfwk-detect.h" } + +#ifdef ARCH_ARM_32 +#define DEFAULT_HW_BINDER_MEM_SIZE 65536 +#endif + using android::hardware::gnss::V2_0::IGnss; -using android::hardware::defaultPassthroughServiceImplementation; + +using android::hardware::configureRpcThreadpool; +using android::hardware::registerPassthroughServiceImplementation; +using android::hardware::joinRpcThreadpool; + +using android::status_t; +using android::OK; + +typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); int main() { + + ALOGI("%s", __FUNCTION__); + bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); setVendorEnhanced(vendorEnhanced); - if (!vendorEnhanced) { - return defaultPassthroughServiceImplementation(); +#ifdef ARCH_ARM_32 + android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); +#endif + configureRpcThreadpool(1, true); + status_t status; + + status = registerPassthroughServiceImplementation(); + if (status == OK) { + if (vendorEnhanced) { + #ifdef LOC_HIDL_VERSION + #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" + + void* libHandle = NULL; + vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) + dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); + if (NULL != vendorEnhancedMainMethod) { + (*vendorEnhancedMainMethod)(0, NULL); + } + #else + ALOGE("LOC_HIDL_VERSION not defined."); + #endif + } + + joinRpcThreadpool(); + } else { - return -1; + ALOGE("Error while registering IGnss 2.0 service: %d", status); } + + return 0; } From 4b9768f09111fac44fe5974555a9b456728d85c1 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 20 Mar 2019 13:53:08 -0700 Subject: [PATCH 812/945] Move Legacy targets to GNSS HIDL 2.0 Legacy targets will support a subset of GNSS HIDL 2.0 features, but will need to stay on GNSS 1.0 Measurements CRs-fixed: 2423825 Change-Id: I1fc5134dbf4b8fc6b1e76cced3acfeaf8bf8d581 --- android/2.0/Android.mk | 5 ++++ android/2.0/Gnss.cpp | 8 +++++++ build/target_specific_features.mk | 38 ++++++++++++++++++++----------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 0fa50bdf..6e429f0a 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -24,6 +24,11 @@ LOCAL_SRC_FILES += \ location_api/BatchingAPIClient.cpp \ location_api/LocationUtil.cpp \ +ifeq ($(GNSS_HIDL_LEGACY_MEASURMENTS),true) +LOCAL_CFLAGS += \ + -DGNSS_HIDL_LEGACY_MEASURMENTS +endif + LOCAL_C_INCLUDES:= \ $(LOCAL_PATH)/location_api \ $(LOCAL_PATH)/../measurement_corrections/1.0 \ diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 0a4b34ba..43f8537c 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -407,9 +407,13 @@ Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, Return> Gnss::getExtensionGnssMeasurement_1_1() { ENTRY_LOG_CALLFLOW(); +#ifdef GNSS_HIDL_LEGACY_MEASURMENTS + return nullptr; +#else if (mGnssMeasurement == nullptr) mGnssMeasurement = new GnssMeasurement(); return mGnssMeasurement; +#endif } Return> Gnss::getExtensionGnssConfiguration_1_1() { @@ -470,9 +474,13 @@ Return> Gnss::getExtensionGnssConfiguration_2_0() { } Return> Gnss::getExtensionGnssMeasurement_2_0() { ENTRY_LOG_CALLFLOW(); +#ifdef GNSS_HIDL_LEGACY_MEASURMENTS + return nullptr; +#else if (mGnssMeasurement == nullptr) mGnssMeasurement = new GnssMeasurement(); return mGnssMeasurement; +#endif } Return> Gnss::getExtensionMeasurementCorrections() { diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index e652e1a7..a03e6e88 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -28,18 +28,18 @@ GNSS_HIDL_1_0_TARGET_LIST += msm8909 GNSS_HIDL_1_0_TARGET_LIST += msm8952 GNSS_HIDL_1_0_TARGET_LIST += msm8992 GNSS_HIDL_1_0_TARGET_LIST += msm8996 -GNSS_HIDL_1_0_TARGET_LIST += msm8937 -GNSS_HIDL_1_0_TARGET_LIST += msm8953 -GNSS_HIDL_1_0_TARGET_LIST += msm8998 -GNSS_HIDL_1_0_TARGET_LIST += apq8098_latv -GNSS_HIDL_1_0_TARGET_LIST += sdm710 -GNSS_HIDL_1_0_TARGET_LIST += qcs605 -GNSS_HIDL_1_0_TARGET_LIST += sdm845 -GNSS_HIDL_1_0_TARGET_LIST += sdm660 -GNSS_HIDL_2_0_TARGET_LIST := msmnile -GNSS_HIDL_1_1_TARGET_LIST += $(MSMSTEPPE) -GNSS_HIDL_1_1_TARGET_LIST += $(TRINKET) -GNSS_HIDL_1_1_TARGET_LIST += kona +GNSS_HIDL_2_0_TARGET_LIST := msm8937 +GNSS_HIDL_2_0_TARGET_LIST += msm8953 +GNSS_HIDL_2_0_TARGET_LIST += msm8998 +GNSS_HIDL_2_0_TARGET_LIST += apq8098_latv +GNSS_HIDL_2_0_TARGET_LIST += sdm710 +GNSS_HIDL_2_0_TARGET_LIST += qcs605 +GNSS_HIDL_2_0_TARGET_LIST += sdm845 +GNSS_HIDL_2_0_TARGET_LIST += sdm660 +GNSS_HIDL_2_0_TARGET_LIST += msmnile +GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) +GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) +GNSS_HIDL_2_0_TARGET_LIST += kona ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 2.0 @@ -47,7 +47,19 @@ endif ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 1.0 endif - ifneq (,$(filter $(GNSS_HIDL_1_1_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 1.1 endif + +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST := msm8937 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845 +GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 + +ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) +GNSS_HIDL_LEGACY_MEASURMENTS = true +endif From b046241ec2fdc9a48e99face1794046488a8cabe Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 11 Feb 2019 09:11:09 -0800 Subject: [PATCH 813/945] Improved Location NI Privacy Changes to be made starting in Android Q in the way that Location requests made by Location clients other than the Android FrameWork (e.g. Network Initiated AGNSS clients, modem-based clients such as MDT) are handled CRs-fixed: 2397454 Change-Id: Ibb5b9429a1ec1e14ee59d89763d8a78607997615 --- android/2.0/Gnss.cpp | 9 +- android/2.0/Gnss.h | 2 - android/2.0/GnssConfiguration.cpp | 47 ++---- .../1.0/GnssVisibilityControl.cpp | 77 ++++++++- .../1.0/GnssVisibilityControl.h | 13 +- core/LocAdapterBase.cpp | 6 +- core/LocAdapterBase.h | 3 +- core/LocApiBase.cpp | 16 +- core/LocApiBase.h | 4 +- gnss/GnssAdapter.cpp | 148 +++++++++++++++--- gnss/GnssAdapter.h | 20 ++- gnss/location_gnss.cpp | 36 ++++- location/LocationAPIClientBase.h | 6 +- location/LocationDataTypes.h | 5 +- location/location_interface.h | 5 +- utils/gps_extended_c.h | 52 +++++- 16 files changed, 374 insertions(+), 75 deletions(-) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 0c9519fa..40331477 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -38,6 +38,8 @@ namespace gnss { namespace V2_0 { namespace implementation { +using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; + static std::string getVersionString() { static std::string version; if (!version.empty()) @@ -239,6 +241,10 @@ Return Gnss::updateConfiguration(GnssConfig& gnssConfig) { mPendingConfig.flags |= GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; mPendingConfig.blacklistedSvIds = gnssConfig.blacklistedSvIds; } + if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT) { + mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT; + mPendingConfig.emergencyExtensionSeconds = gnssConfig.emergencyExtensionSeconds; + } } return true; } @@ -483,8 +489,9 @@ Return> Gnss::getExtensionVisibilityControl() { + ENTRY_LOG_CALLFLOW(); if (mVisibCtrl == nullptr) { - mVisibCtrl = new GnssVisibilityControl(); + mVisibCtrl = new GnssVisibilityControl(this); } return mVisibCtrl; } diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h index b0a4f91f..dfae2a3e 100644 --- a/android/2.0/Gnss.h +++ b/android/2.0/Gnss.h @@ -55,7 +55,6 @@ using ::android::hardware::gnss::V1_0::GnssLocation; using ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections; using ::android::hardware::gnss::measurement_corrections::V1_0::implementation::MeasurementCorrections; using ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl; -using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; struct Gnss : public IGnss { Gnss(); @@ -131,7 +130,6 @@ struct Gnss : public IGnss { getExtensionVisibilityControl() override; - // These methods are not part of the IGnss base class. GnssAPIClient* getApi(); Return setGnssNiCb(const sp& niCb); diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index 93a843a6..eb98be1a 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -175,35 +175,9 @@ Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) } Return GnssConfiguration::setGpsLock(uint8_t lock) { - if (mGnss == nullptr) { - LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); - return false; - } - - GnssConfig config; - memset(&config, 0, sizeof(GnssConfig)); - config.size = sizeof(GnssConfig); - config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; - switch (lock) { - case 0: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - break; - case 1: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; - break; - case 2: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; - break; - case 3: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; - break; - default: - LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); - return false; - break; - } - - return mGnss->updateConfiguration(config); + /* we no longer set GPS lock here, there is + visibility control for this */ + return true; } Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { @@ -308,8 +282,19 @@ bool GnssConfiguration::setBlacklistedSource( // Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow. Return GnssConfiguration::setEsExtensionSec(uint32_t emergencyExtensionSeconds) { - //TODO emergencyExtensionSeconds is not supporded in GnssConfig yet - return false; + ENTRY_LOG_CALLFLOW(); + if (mGnss == nullptr) { + LOC_LOGe("mGnss is nullptr"); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT; + config.emergencyExtensionSeconds = emergencyExtensionSeconds; + + return mGnss->updateConfiguration(config); } } // namespace implementation diff --git a/android/visibility_control/1.0/GnssVisibilityControl.cpp b/android/visibility_control/1.0/GnssVisibilityControl.cpp index 5608050e..82e465cc 100644 --- a/android/visibility_control/1.0/GnssVisibilityControl.cpp +++ b/android/visibility_control/1.0/GnssVisibilityControl.cpp @@ -48,11 +48,72 @@ using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; -GnssVisibilityControl::GnssVisibilityControl() {} -GnssVisibilityControl::~GnssVisibilityControl() {} +static GnssVisibilityControl* spGnssVisibilityControl = nullptr; + +static void convertGnssNfwNotification(GnssNfwNotification& in, + IGnssVisibilityControlCallback::NfwNotification& out); + +GnssVisibilityControl::GnssVisibilityControl(Gnss* gnss) : mGnss(gnss) { + spGnssVisibilityControl = this; +} +GnssVisibilityControl::~GnssVisibilityControl() { + spGnssVisibilityControl = nullptr; +} + +void GnssVisibilityControl::nfwStatusCb(GnssNfwNotification notification) { + if (nullptr != spGnssVisibilityControl) { + spGnssVisibilityControl->statusCb(notification); + } +} + +static void convertGnssNfwNotification(GnssNfwNotification& in, + IGnssVisibilityControlCallback::NfwNotification& out) +{ + memset(&out, 0, sizeof(IGnssVisibilityControlCallback::NfwNotification)); + out.proxyAppPackageName = in.proxyAppPackageName; + out.protocolStack = (IGnssVisibilityControlCallback::NfwProtocolStack)in.protocolStack; + out.otherProtocolStackName = in.otherProtocolStackName; + out.requestor = (IGnssVisibilityControlCallback::NfwRequestor)in.requestor; + out.requestorId = in.requestorId; + out.responseType = (IGnssVisibilityControlCallback::NfwResponseType)in.responseType; + out.inEmergencyMode = in.inEmergencyMode; + out.isCachedLocation = in.isCachedLocation; +} + +void GnssVisibilityControl::statusCb(GnssNfwNotification notification) { + + if (mGnssVisibilityControlCbIface != nullptr) { + IGnssVisibilityControlCallback::NfwNotification nfwNotification; + + // Convert from one structure to another + convertGnssNfwNotification(notification, nfwNotification); + + auto r = mGnssVisibilityControlCbIface->nfwNotifyCb(nfwNotification); + if (!r.isOk()) { + LOC_LOGw("Error invoking NFW status cb %s", r.description().c_str()); + } + } else { + LOC_LOGw("setCallback has not been called yet"); + } +} // Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow. Return GnssVisibilityControl::enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) { + + if (nullptr == mGnss || nullptr == mGnss->getGnssInterface()) { + LOC_LOGe("Null GNSS interface"); + return false; + } + + /* If the vector is empty we need to disable all NFW clients + If there is at least one app in the vector we need to enable + all NFW clients */ + if (0 == proxyApps.size()) { + mGnss->getGnssInterface()->enableNfwLocationAccess(false); + } else { + mGnss->getGnssInterface()->enableNfwLocationAccess(true); + } + return true; } /** @@ -61,6 +122,18 @@ Return GnssVisibilityControl::enableNfwLocationAccess(const hidl_vec<::and * @param callback Handle to IGnssVisibilityControlCallback interface. */ Return GnssVisibilityControl::setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) { + + if (nullptr == mGnss || nullptr == mGnss->getGnssInterface()) { + LOC_LOGe("Null GNSS interface"); + return false; + } + mGnssVisibilityControlCbIface = callback; + + NfwCbInfo cbInfo = {}; + cbInfo.visibilityControlCb = (void*)nfwStatusCb; + + mGnss->getGnssInterface()->nfwInit(cbInfo); + return true; } diff --git a/android/visibility_control/1.0/GnssVisibilityControl.h b/android/visibility_control/1.0/GnssVisibilityControl.h index 30233476..4eaea51e 100644 --- a/android/visibility_control/1.0/GnssVisibilityControl.h +++ b/android/visibility_control/1.0/GnssVisibilityControl.h @@ -34,7 +34,9 @@ #include #include +#include #include +#include "Gnss.h" namespace android { namespace hardware { @@ -50,9 +52,10 @@ using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; +using ::android::hardware::gnss::V2_0::implementation::Gnss; struct GnssVisibilityControl : public IGnssVisibilityControl { - GnssVisibilityControl(); + GnssVisibilityControl(Gnss* gnss); ~GnssVisibilityControl(); // Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow. @@ -64,6 +67,14 @@ struct GnssVisibilityControl : public IGnssVisibilityControl { */ Return setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) override; + void statusCb(GnssNfwNotification notification); + + /* Data call setup callback passed down to GNSS HAL implementation */ + static void nfwStatusCb(GnssNfwNotification notification); + +private: + Gnss* mGnss = nullptr; + sp mGnssVisibilityControlCbIface = nullptr; }; diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 22116e67..cea72fa9 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2019 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 @@ -199,4 +199,8 @@ DEFAULT_IMPL(false) bool LocAdapterBase:: reportGnssAdditionalSystemInfoEvent(GnssAdditionalSystemInfo& /*additionalSystemInfo*/) DEFAULT_IMPL(false) + +void LocAdapterBase:: + reportNfwNotificationEvent(GnssNfwNotification& /*notification*/) +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 722947af..af56cc9f 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2019 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 @@ -171,6 +171,7 @@ public: virtual bool reportKlobucharIonoModelEvent(GnssKlobucharIonoModel& ionoModel); virtual bool reportGnssAdditionalSystemInfoEvent( GnssAdditionalSystemInfo& additionalSystemInfo); + virtual void reportNfwNotificationEvent(GnssNfwNotification& notification); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8fe84c21..fac81e77 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2019 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 @@ -391,6 +391,13 @@ void LocApiBase::reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additi additionalSystemInfo)); } +void LocApiBase::sendNfwNotification(GnssNfwNotification& notification) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNfwNotificationEvent(notification)); + +} + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -683,6 +690,10 @@ DEFAULT_IMPL(0) GnssConfigLppeUserPlaneMask LocApiBase::convertLppeUp(const uint32_t /*lppeUserPlaneMask*/) DEFAULT_IMPL(0) +LocationError LocApiBase::setEmergencyExtensionWindowSync( + const uint32_t /*emergencyExtensionSeconds*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + void LocApiBase:: getWwanZppFix() DEFAULT_IMPL() @@ -737,7 +748,6 @@ LocationError LocApiBase:: setPositionAssistedClockEstimatorMode(bool /*enabled*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) -LocationError LocApiBase:: - getGnssEnergyConsumed() +LocationError LocApiBase::getGnssEnergyConsumed() DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 70bebc31..f0bd5392 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2016-2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2016-2019 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 @@ -189,6 +189,7 @@ public: void reportDeleteAidingDataEvent(GnssAidingData& aidingData); void reportKlobucharIonoModel(GnssKlobucharIonoModel& ionoModel); void reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additionalSystemInfo); + void sendNfwNotification(GnssNfwNotification& notification); // downward calls // All below functions are to be defined by adapter specific modules: @@ -265,6 +266,7 @@ public: virtual GnssConfigLppProfile convertLppProfile(const uint32_t lppProfile); virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask); virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask); + virtual LocationError setEmergencyExtensionWindowSync(const uint32_t emergencyExtensionSeconds); virtual void getWwanZppFix(); virtual void getBestAvailableZppFix(); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index eee55e37..3f640ad6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -88,7 +88,8 @@ GnssAdapter::GnssAdapter() : mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask), mBlockCPIInfo{}, - mLocSystemInfo{} + mLocSystemInfo{}, + mNfwCb(NULL) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -658,7 +659,7 @@ GnssAdapter::setConfigCommand() GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - if (0 == adapter.getPowerVoteId()) { + if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) { gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; } @@ -910,6 +911,18 @@ std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldS } index++; } + if (gnssConfigRequested.flags & + GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT) { + if (gnssConfigNeedEngineUpdate.flags & + GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT) { + err = mLocApi->setEmergencyExtensionWindowSync( + gnssConfigRequested.emergencyExtensionSeconds); + if (index < count) { + errsList[index] = err; + } + } + index++; + } return errsList; } @@ -982,10 +995,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { GnssConfigGpsLock newGpsLock = gnssConfigRequested.gpsLock; if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) { - newGpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + newGpsLock = GNSS_CONFIG_GPS_LOCK_MO; } if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK || - 0 != mAdapter.getPowerVoteId()) { + 0 != mAdapter.getAfwControlId()) { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } ContextBase::mGps_conf.GPS_LOCK = newGpsLock; @@ -1060,24 +1073,24 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) ~(GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT); } index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { uint32_t newEP4ES = mAdapter.convertEP4ES( gnssConfigRequested.emergencyPdnForEmergencySupl); if (newEP4ES != ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { ContextBase::mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = newEP4ES; } index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { uint32_t newSuplEs = mAdapter.convertSuplEs( gnssConfigRequested.suplEmergencyServices); if (newSuplEs != ContextBase::mGps_conf.SUPL_ES) { ContextBase::mGps_conf.SUPL_ES = newSuplEs; } index++; - } - if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { + } + if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { ContextBase::mGps_conf.SUPL_MODE = newSuplMode; @@ -1299,6 +1312,12 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { errs[index++] = err; } } + if (mConfigMask & GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT) { + err = LOCATION_ERROR_NOT_SUPPORTED; + if (index < mCount) { + errs[index++] = LOCATION_ERROR_NOT_SUPPORTED; + } + } mAdapter.reportResponse(index, errs, mIds); delete[] errs; @@ -2802,21 +2821,24 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) mTechType(techType) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t powerVoteId = mAdapter.getPowerVoteId(); + uint32_t powerVoteId = mAdapter.getAfwControlId(); if (mTechType != LOCATION_TECHNOLOGY_TYPE_GNSS) { err = LOCATION_ERROR_INVALID_PARAMETER; } else if (powerVoteId > 0) { err = LOCATION_ERROR_ALREADY_STARTED; } else { mContext.modemPowerVote(true); - mAdapter.setPowerVoteId(mSessionId); + mAdapter.setAfwControlId(mSessionId); - mApi.sendMsg(new LocApiMsg([&mApi = mApi] () { - mApi.setGpsLockSync(GNSS_CONFIG_GPS_LOCK_NONE); - })); - - mAdapter.mXtraObserver.updateLockStatus( - GNSS_CONFIG_GPS_LOCK_NONE); + GnssConfigGpsLock gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + if (NULL != mAdapter.mNfwCb) { + ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI; + gpsLock = ContextBase::mGps_conf.GPS_LOCK; + } + mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() { + mApi.setGpsLockSync(gpsLock); + })); + mAdapter.mXtraObserver.updateLockStatus(gpsLock); } mAdapter.reportResponse(err, mSessionId); } @@ -2852,15 +2874,18 @@ GnssAdapter::disableCommand(uint32_t id) mSessionId(sessionId) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t powerVoteId = mAdapter.getPowerVoteId(); + uint32_t powerVoteId = mAdapter.getAfwControlId(); if (powerVoteId != mSessionId) { err = LOCATION_ERROR_ID_UNKNOWN; } else { mContext.modemPowerVote(false); - mAdapter.setPowerVoteId(0); + mAdapter.setAfwControlId(0); - GnssConfigGpsLock gpsLock = - ContextBase::mGps_conf.GPS_LOCK; + if (NULL != mAdapter.mNfwCb) { + /* We need to disable MO (AFW) */ + ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO; + } + GnssConfigGpsLock gpsLock = ContextBase::mGps_conf.GPS_LOCK; mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { mApi.setGpsLockSync(gpsLock); })); @@ -3824,6 +3849,52 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ sendMsg(new AgpsMsgInit(cbInfo, *this)); } +void GnssAdapter::initNfwCommand(const NfwCbInfo& cbInfo) { + LOC_LOGi("GnssAdapter::initNfwCommand"); + + /* Message to initialize NFW */ + struct MsgInitNfw : public LocMsg { + const NfwCbInfo mCbInfo; + GnssAdapter& mAdapter; + + inline MsgInitNfw(const NfwCbInfo& cbInfo, + GnssAdapter& adapter) : + LocMsg(), mCbInfo(cbInfo), mAdapter(adapter) { + LOC_LOGv("MsgInitNfw"); + } + + inline virtual void proc() const { + LOC_LOGv("MsgInitNfw::proc()"); + mAdapter.initNfw(mCbInfo); + } + }; + + /* Send message to initialize NFW */ + sendMsg(new MsgInitNfw(cbInfo, *this)); +} + +void GnssAdapter::reportNfwNotificationEvent(GnssNfwNotification& notification) { + LOC_LOGi("GnssAdapter::reportNfwNotificationEvent"); + + struct MsgReportNfwNotification : public LocMsg { + const GnssNfwNotification mNotification; + GnssAdapter& mAdapter; + + inline MsgReportNfwNotification(const GnssNfwNotification& notification, + GnssAdapter& adapter) : + LocMsg(), mNotification(notification), mAdapter(adapter) { + LOC_LOGv("MsgReportNfwNotification"); + } + + inline virtual void proc() const { + LOC_LOGv("MsgReportNfwNotification::proc()"); + mAdapter.reportNfwNotification(mNotification); + } + }; + + sendMsg(new MsgReportNfwNotification(notification, *this)); +} + /* GnssAdapter::requestATL * Method triggered in QMI thread as part of handling below message: * eQMI_LOC_SERVER_REQUEST_OPEN_V02 @@ -4405,6 +4476,37 @@ GnssAdapter::getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsu sendMsg(new MsgGetGnssEnergyConsumed(*this, *mLocApi, energyConsumedCb)); } +void +GnssAdapter::nfwControlCommand(bool enable) { + struct MsgenableNfwLocationAccess : public LocMsg { + GnssAdapter& mAdapter; + LocApiBase& mApi; + bool mEnable; + inline MsgenableNfwLocationAccess(GnssAdapter& adapter, LocApiBase& api, + bool enable) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mEnable(enable) {} + inline virtual void proc() const { + GnssConfigGpsLock gpsLock; + + gpsLock = ContextBase::mGps_conf.GPS_LOCK; + if (mEnable) { + gpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI; + } else { + gpsLock |= GNSS_CONFIG_GPS_LOCK_NI; + } + ContextBase::mGps_conf.GPS_LOCK = gpsLock; + mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() { + mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock); + })); + } + }; + + sendMsg(new MsgenableNfwLocationAccess(*this, *mLocApi, enable)); +} + /* ==== Eng Hub Proxy ================================================================= */ /* ======== UTILITIES ================================================================= */ void diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1f72c43c..e304fe6e 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -162,6 +162,12 @@ class GnssAdapter : public LocAdapterBase { AgpsCbInfo mAgpsCbInfo; void initAgps(const AgpsCbInfo& cbInfo); + /* ==== NFW =========================================================================== */ + NfwStatusCb mNfwCb; + inline void initNfw(const NfwCbInfo& cbInfo) { + mNfwCb = (NfwStatusCb)cbInfo.visibilityControlCb; + } + /* ==== ODCPI ========================================================================== */ OdcpiRequestCallback mOdcpiRequestCb; bool mOdcpiRequestActive; @@ -308,11 +314,13 @@ public: /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void initDefaultAgpsCommand(); void initAgpsCommand(const AgpsCbInfo& cbInfo); + void initNfwCommand(const NfwCbInfo& cbInfo); void dataConnOpenCommand(AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType); void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); void getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsumedCb); + void nfwControlCommand(bool enable); /* ========= ODCPI ===================================================================== */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -325,8 +333,8 @@ public: LocationControlCallbacks& getControlCallbacks() { return mControlCallbacks; } void setControlCallbacks(const LocationControlCallbacks& controlCallbacks) { mControlCallbacks = controlCallbacks; } - void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } - uint32_t getPowerVoteId() { return mPowerVoteId; } + void setAfwControlId(uint32_t id) { mPowerVoteId = id; } + uint32_t getAfwControlId() { return mPowerVoteId; } virtual bool isInSession() { return !mTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); @@ -363,6 +371,7 @@ public: virtual bool reportKlobucharIonoModelEvent(GnssKlobucharIonoModel& ionoModel); virtual bool reportGnssAdditionalSystemInfoEvent( GnssAdditionalSystemInfo& additionalSystemInfo); + virtual void reportNfwNotificationEvent(GnssNfwNotification& notification); /* ======== UTILITIES ================================================================= */ bool needReport(const UlpLocation& ulpLocation, @@ -382,6 +391,11 @@ public: void invokeGnssEnergyConsumedCallback(uint64_t energyConsumedSinceFirstBoot); void saveGnssEnergyConsumedCallback(GnssEnergyConsumedCallback energyConsumedCb); void reportLocationSystemInfo(const LocationSystemInfo & locationSystemInfo); + inline void reportNfwNotification(const GnssNfwNotification& notification) { + if (NULL != mNfwCb) { + mNfwCb(notification); + } + } /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index f9fbddc9..45ad292c 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 2019 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 @@ -67,6 +67,9 @@ static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); static void updateConnectionStatus(bool connected, int8_t type); static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb); +static void enableNfwLocationAccess(bool enable); +static void nfwInit(const NfwCbInfo& cbInfo); +static uint8_t getGpsLock(); static void odcpiInit(const OdcpiRequestCallback& callback); static void odcpiInject(const Location& location); @@ -106,7 +109,10 @@ static const GnssInterface gGnssInterface = { odcpiInit, odcpiInject, blockCPI, - getGnssEnergyConsumed + getGnssEnergyConsumed, + enableNfwLocationAccess, + nfwInit, + getGpsLock }; #ifndef DEBUG_X86 @@ -346,3 +352,29 @@ static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb) { gGnssAdapter->getGnssEnergyConsumedCommand(energyConsumedCb); } } + +static void enableNfwLocationAccess(bool enable) { + if (NULL != gGnssAdapter) { + gGnssAdapter->nfwControlCommand(enable); + } +} + +static void nfwInit(const NfwCbInfo& cbInfo) { + if (NULL != gGnssAdapter) { + gGnssAdapter->initNfwCommand(cbInfo); + } +} + +static uint8_t getGpsLock() { + if (NULL != gGnssAdapter) { + return ContextBase::mGps_conf.GPS_LOCK; + } else { + /* In case gGnssAdapter is NULL + just return 0x3 which means both + AFW and NFW are locked (the bits are NFW + for 2^1 and AFW for 2^0) */ + LOC_LOGe("gGnssAdapter is NULL"); + return 0x3; + } +} + diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index da87535a..fd22b040 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019 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 @@ -36,6 +36,7 @@ #include #include "LocationAPI.h" +#include #include #include @@ -252,6 +253,9 @@ public: inline virtual void onGnssLocationInfoCb( GnssLocationInfoNotification /*gnssLocationInfoNotification*/) {} + inline virtual void onGnssNfwStatusCb( + GnssNfwNotification /*notification*/) {} + inline virtual void onBatchingCb(size_t /*count*/, Location* /*location*/, BatchingOptions /*batchingOptions*/) {} inline virtual void onBatchingStatusCb(BatchingStatusInfo /*batchingStatus*/, diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index f60ba78b..0a2c0608 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -306,6 +306,7 @@ typedef enum { GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT = (1<<10), + GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT = (1<<11), } GnssConfigFlagsBits; typedef enum { @@ -1109,6 +1110,7 @@ struct GnssConfig{ GnssConfigSuplEmergencyServices suplEmergencyServices; GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits std::vector blacklistedSvIds; + uint32_t emergencyExtensionSeconds; inline bool equals(const GnssConfig& config) { if (flags == config.flags && @@ -1122,7 +1124,8 @@ struct GnssConfig{ emergencyPdnForEmergencySupl == config.emergencyPdnForEmergencySupl && suplEmergencyServices == config.suplEmergencyServices && suplModeMask == config.suplModeMask && - blacklistedSvIds == config.blacklistedSvIds) { + blacklistedSvIds == config.blacklistedSvIds && + emergencyExtensionSeconds == config.emergencyExtensionSeconds) { return true; } return false; diff --git a/location/location_interface.h b/location/location_interface.h index 480bbdb4..47dda870 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019 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 @@ -82,6 +82,9 @@ struct GnssInterface { void (*blockCPI)(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); void (*getGnssEnergyConsumed)(GnssEnergyConsumedCallback energyConsumedCb); + void (*enableNfwLocationAccess)(bool enable); + void (*nfwInit)(const NfwCbInfo& cbInfo); + uint8_t (*getGpsLock)(); }; struct FlpInterface { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index abe4f680..64e2c39d 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2019 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 @@ -199,6 +199,11 @@ typedef struct { AgpsCbPriority cbPriority; } AgpsCbInfo; +typedef struct { + void* visibilityControlCb; + void* isInEmergencySession; +} NfwCbInfo; + /** GPS extended callback structure. */ typedef struct { /** set to sizeof(LocGpsCallbacks) */ @@ -2038,6 +2043,46 @@ struct AGnssExtStatusIpV6 { uint8_t ipV6Addr[16]; }; +/* +* Represents the the Nfw Notification structure +*/ +#define GNSS_MAX_NFW_STRING_LEN 20 + +typedef enum { + GNSS_NFW_CTRL_PLANE = 0, + GNSS_NFW_SUPL = 1, + GNSS_NFW_IMS = 10, + GNSS_NFW_SIM = 11, + GNSS_NFW_OTHER_PROTOCOL_STACK = 100 +} GnssNfwProtocolStack; + +typedef enum { + GNSS_NFW_CARRIER = 0, + GNSS_NFW_OEM = 10, + GNSS_NFW_MODEM_CHIPSET_VENDOR = 11, + GNSS_NFW_GNSS_CHIPSET_VENDOR = 12, + GNSS_NFW_OTHER_CHIPSET_VENDOR = 13, + GNSS_NFW_AUTOMOBILE_CLIENT = 20, + GNSS_NFW_OTHER_REQUESTOR = 100 +} GnssNfwRequestor; + +typedef enum { + GNSS_NFW_REJECTED = 0, + GNSS_NFW_ACCEPTED_NO_LOCATION_PROVIDED = 1, + GNSS_NFW_ACCEPTED_LOCATION_PROVIDED = 2, +} GnssNfwResponseType; + +typedef struct { + char proxyAppPackageName[GNSS_MAX_NFW_STRING_LEN]; + GnssNfwProtocolStack protocolStack; + char otherProtocolStackName[GNSS_MAX_NFW_STRING_LEN]; + GnssNfwRequestor requestor; + char requestorId[GNSS_MAX_NFW_STRING_LEN]; + GnssNfwResponseType responseType; + bool inEmergencyMode; + bool isCachedLocation; +} GnssNfwNotification; + /* ODCPI Request Info */ enum OdcpiRequestType { ODCPI_REQUEST_TYPE_START, @@ -2059,6 +2104,11 @@ typedef std::function OdcpiRequestCallbac */ typedef void (*AgnssStatusIpV4Cb)(AGnssExtStatusIpV4 status); +/* +* Callback with NFW information. +*/ +typedef void(*NfwStatusCb)(GnssNfwNotification notification); + /* * Callback with AGNSS(IpV6) status information. * From 546e88fc046234170088cd93bc78567c548ca559 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 26 Mar 2019 18:40:03 -0700 Subject: [PATCH 814/945] Add HAL support for network handle Add HAL support for modifications to the network status information passed in. Change-Id: I99defc6a419d9f21ce74469a1aa016cc7fade4a5 CRs-Fixed: 2397433 --- android/2.0/AGnssRil.cpp | 9 +++++++-- core/SystemStatus.cpp | 8 +++++--- core/SystemStatus.h | 21 +++++++++++++++++---- core/data-items/DataItemConcreteTypesBase.h | 19 +++++++++++++++---- gnss/XtraSystemStatusObserver.cpp | 19 ++++++++++++++----- gnss/XtraSystemStatusObserver.h | 7 +++++-- gnss/location_gnss.cpp | 11 +++++++---- location/location_interface.h | 3 ++- utils/gps_extended_c.h | 3 +++ 9 files changed, 75 insertions(+), 25 deletions(-) diff --git a/android/2.0/AGnssRil.cpp b/android/2.0/AGnssRil.cpp index e17a06d4..9de8b7d6 100644 --- a/android/2.0/AGnssRil.cpp +++ b/android/2.0/AGnssRil.cpp @@ -102,7 +102,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool } break; } - mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); + mGnss->getGnssInterface()->updateConnectionStatus(connected, false, typeout, 0); } return true; } @@ -111,12 +111,17 @@ Return AGnssRil::updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttr if (nullptr != mGnss && (nullptr != mGnss->getGnssInterface())) { int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + bool roaming = false; if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_METERED) { typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; } else { typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; } - mGnss->getGnssInterface()->updateConnectionStatus(attributes.isConnected, typeout); + if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_ROAMING) { + roaming = false; + } + mGnss->getGnssInterface()->updateConnectionStatus(attributes.isConnected, + typeout, roaming, (NetworkHandle) attributes.networkHandle); } return true; } diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index f4316ca0..6ef49935 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 2019, 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 @@ -1682,10 +1682,12 @@ bool SystemStatus::setDefaultGnssEngineStates(void) @return true when successfully done ******************************************************************************/ -bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) +bool SystemStatus::eventConnectionStatus(bool connected, int8_t type, + bool roaming, NetworkHandle networkHandle) { // send networkinof dataitem to systemstatus observer clients - SystemStatusNetworkInfo s(type, "", "", connected); + SystemStatusNetworkInfo s(type, "", "", connected, roaming, + (uint64_t) networkHandle); mSysStatusObsvr.notify({&s}); return true; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 94223223..73a220a0 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -467,7 +469,8 @@ public: std::string typeName="", string subTypeName="", bool connected=false, - bool roaming=false) : + bool roaming=false, + uint64_t networkHandle=NETWORK_HANDLE_UNKNOWN) : NetworkInfoDataItemBase( (NetworkType)type, type, @@ -475,7 +478,8 @@ public: subTypeName, connected && (!roaming), connected, - roaming), + roaming, + networkHandle), mSrcObjPtr(nullptr) {} inline SystemStatusNetworkInfo(const NetworkInfoDataItemBase& itemBase) : NetworkInfoDataItemBase(itemBase), @@ -487,16 +491,24 @@ public: } inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { uint64_t allTypes = (static_cast(curInfo)).mAllTypes; + uint64_t networkHandle = + (static_cast(curInfo)).mNetworkHandle; + int32_t type = (static_cast(curInfo)).mType; if (mConnected) { mAllTypes |= allTypes; + mAllNetworkHandles[type] = networkHandle; } else if (0 != mAllTypes) { mAllTypes = (allTypes & (~mAllTypes)); + mAllNetworkHandles[type] = NETWORK_HANDLE_UNKNOWN; } // else (mConnected == false && mAllTypes == 0) // we keep mAllTypes as 0, which means no more connections. if (nullptr != mSrcObjPtr) { // this is critical, changing mAllTypes of the original obj mSrcObjPtr->mAllTypes = mAllTypes; + memcpy(mSrcObjPtr->mAllNetworkHandles, + mAllNetworkHandles, + sizeof(mSrcObjPtr->mAllNetworkHandles)); } return *this; } @@ -830,7 +842,8 @@ public: bool setNmeaString(const char *data, uint32_t len); bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const; bool setDefaultGnssEngineStates(void); - bool eventConnectionStatus(bool connected, int8_t type); + bool eventConnectionStatus(bool connected, int8_t type, + bool roaming, NetworkHandle networkHandle); }; } // namespace loc_core diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 44be5f99..552d46a1 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2017, 2019, 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 @@ -34,6 +34,7 @@ #include #include #include +#include #define MAC_ADDRESS_LENGTH 6 // MAC address length in bytes @@ -222,7 +223,7 @@ protected: class NetworkInfoDataItemBase : public IDataItemCore { public: enum NetworkType { - TYPE_MOBILE, + TYPE_MOBILE = 0, TYPE_WIFI, TYPE_ETHERNET, TYPE_BLUETOOTH, @@ -236,7 +237,7 @@ public: }; NetworkInfoDataItemBase( NetworkType initialType, int32_t type, string typeName, string subTypeName, - bool available, bool connected, bool roaming ): + bool available, bool connected, bool roaming, uint64_t networkHandle ): mAllTypes(typeToAllTypes(initialType)), mType(type), mTypeName(typeName), @@ -244,7 +245,12 @@ public: mAvailable(available), mConnected(connected), mRoaming(roaming), - mId(NETWORKINFO_DATA_ITEM_ID) {} + mNetworkHandle(networkHandle), + mId(NETWORKINFO_DATA_ITEM_ID) { + memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN, + sizeof (mAllNetworkHandles)); + mAllNetworkHandles[type] = networkHandle; + } virtual ~NetworkInfoDataItemBase() {} inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} @@ -253,6 +259,9 @@ public: return (NetworkType)mType; } inline uint64_t getAllTypes() { return mAllTypes; } + inline uint64_t getNetworkHandle(NetworkType type) { + return mAllNetworkHandles[type]; + } // Data members uint64_t mAllTypes; int32_t mType; @@ -261,6 +270,8 @@ public: bool mAvailable; bool mConnected; bool mRoaming; + uint64_t mAllNetworkHandles[TYPE_UNKNOWN + 1]; + uint64_t mNetworkHandle; protected: DataItemId mId; inline uint64_t typeToAllTypes(NetworkType type) { diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 962e1000..6e1902c5 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 2019, 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 @@ -69,17 +69,21 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { return ( send(LOC_IPC_XTRA, ss.str()) ); } -bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections) { +bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections, + uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle) { mIsConnectivityStatusKnown = true; mConnections = allConnections; + mWifiNetworkHandle = wifiNetworkHandle; + mMobileNetworkHandle = mobileNetworkHandle; if (!mReqStatusReceived) { return true; } stringstream ss; - ss << "connection"; - ss << " " << mConnections; + ss << "connection" << endl << mConnections << endl << wifiNetworkHandle + << endl << mobileNetworkHandle; + return ( send(LOC_IPC_XTRA, ss.str()) ); } @@ -134,6 +138,7 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate ss << "respondStatus" << endl; (mGpsLock == -1 ? ss : ss << mGpsLock) << endl; (mConnections == (uint64_t)~0 ? ss : ss << mConnections) << endl + << mWifiNetworkHandle << endl << mMobileNetworkHandle << endl << mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown; return ( send(LOC_IPC_XTRA, ss.str()) ); @@ -235,7 +240,11 @@ void XtraSystemStatusObserver::notify(const list& dlist) { NetworkInfoDataItemBase* networkInfo = static_cast(each); - mXtraSysStatObj->updateConnections(networkInfo->getAllTypes()); + mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(), + (NetworkHandle) networkInfo->getNetworkHandle( + loc_core::NetworkInfoDataItemBase::TYPE_WIFI), + (NetworkHandle) networkInfo->getNetworkHandle( + loc_core::NetworkInfoDataItemBase::TYPE_MOBILE)); } break; diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index cbbeda61..22a3013c 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -61,7 +61,8 @@ public : virtual void notify(const list& dlist); bool updateLockStatus(GnssConfigGpsLock lock); - bool updateConnections(uint64_t allConnections); + bool updateConnections(uint64_t allConnections, + uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); bool updateXtraThrottle(const bool enabled); @@ -76,6 +77,8 @@ private: const MsgTask* mMsgTask; GnssConfigGpsLock mGpsLock; uint64_t mConnections; + uint64_t mWifiNetworkHandle; + uint64_t mMobileNetworkHandle; string mTac; string mMccmnc; bool mXtraThrottle; diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 45ad292c..f3b15eef 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -65,7 +65,8 @@ static void agpsDataConnOpen(AGpsExtType agpsType, const char* apnName, int apnL static void agpsDataConnClosed(AGpsExtType agpsType); static void agpsDataConnFailed(AGpsExtType agpsType); static void getDebugReport(GnssDebugReport& report); -static void updateConnectionStatus(bool connected, int8_t type); +static void updateConnectionStatus(bool connected, int8_t type, bool roaming = false, + NetworkHandle networkHandle = NETWORK_HANDLE_UNKNOWN); static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb); static void enableNfwLocationAccess(bool enable); static void nfwInit(const NfwCbInfo& cbInfo); @@ -319,9 +320,11 @@ static void getDebugReport(GnssDebugReport& report) { } } -static void updateConnectionStatus(bool connected, int8_t type) { +static void updateConnectionStatus(bool connected, int8_t type, + bool roaming, NetworkHandle networkHandle) { if (NULL != gGnssAdapter) { - gGnssAdapter->getSystemStatus()->eventConnectionStatus(connected, type); + gGnssAdapter->getSystemStatus()->eventConnectionStatus( + connected, type, roaming, networkHandle); } } diff --git a/location/location_interface.h b/location/location_interface.h index 47dda870..5e596eae 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -76,7 +76,8 @@ struct GnssInterface { void (*agpsDataConnClosed)(AGpsExtType agpsType); void (*agpsDataConnFailed)(AGpsExtType agpsType); void (*getDebugReport)(GnssDebugReport& report); - void (*updateConnectionStatus)(bool connected, int8_t type); + void (*updateConnectionStatus)(bool connected, int8_t type, bool roaming, + NetworkHandle networkHandle); void (*odcpiInit)(const OdcpiRequestCallback& callback); void (*odcpiInject)(const Location& location); void (*blockCPI)(double latitude, double longitude, float accuracy, diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 64e2c39d..680f9381 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2134,6 +2134,9 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" #define SOCKET_TO_EXTERANL_AP_LOCATION_CLIENT_BASE "/dev/socket/loc_client/extap.toclient" +typedef uint64_t NetworkHandle; +#define NETWORK_HANDLE_UNKNOWN ~0 + #ifdef __cplusplus } #endif /* __cplusplus */ From b47ee496e588eab7d03cb2f3fb952d5fab1043ee Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Fri, 22 Mar 2019 17:26:09 +0530 Subject: [PATCH 815/945] Integer overflow leading to a buffer overflow Added a length check in to avoid integer overflow in dataConnOpenCommand and set APN methods. As the APN name is like few 100bytes so using the micro defined int gps_extended_c.h Change-Id: Idb5ebbf2e3647de5fa07673f248c0c256d6c1b52 CRs-fixed: 2419292 --- gnss/Agps.cpp | 7 +++---- gnss/GnssAdapter.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index a4f6a307..9de13292 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -445,15 +445,14 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){ if (NULL != mAPN) { delete mAPN; + mAPN = NULL; } - if (apn == NULL || len <= 0) { + if (NULL == apn || len <= 0 || len > MAX_APN_LEN || strlen(apn) != len) { LOC_LOGD("Invalid apn len (%d) or null apn", len); mAPN = NULL; mAPNLen = 0; - } - - if (NULL != apn) { + } else { mAPN = new char[len+1]; if (NULL != mAPN) { memcpy(mAPN, apn, len); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f6dff894..8d171a6d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3980,6 +3980,8 @@ void GnssAdapter::dataConnOpenCommand( LOC_LOGV("AgpsMsgAtlOpenSuccess"); if (mApnName == nullptr) { LOC_LOGE("%s] new allocation failed, fatal error.", __func__); + // Reporting the failure here + mAgpsManager->reportAtlClosed(mAgpsType); return; } memcpy(mApnName, apnName, apnLen); @@ -3996,9 +3998,15 @@ void GnssAdapter::dataConnOpenCommand( mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, mBearerType); } }; - - sendMsg( new AgpsMsgAtlOpenSuccess( - &mAgpsManager, agpsType, apnName, apnLen, bearerType)); + // Added inital length checks for apnlen check to avoid security issues + // In case of failure reporting the same + if (NULL == apnName || apnLen <= 0 || apnLen > MAX_APN_LEN || (strlen(apnName) != apnLen)) { + LOC_LOGe("%s]: incorrect apnlen length or incorrect apnName", __func__); + mAgpsManager.reportAtlClosed(agpsType); + } else { + sendMsg( new AgpsMsgAtlOpenSuccess( + &mAgpsManager, agpsType, apnName, apnLen, bearerType)); + } } void GnssAdapter::dataConnClosedCommand(AGpsExtType agpsType){ From 5c1e23cf022ab1c06f4601bf0f2d8ca652784b87 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 6 Mar 2019 09:36:20 -0800 Subject: [PATCH 816/945] Batching and Geofence moved to GNSS HAL Addition of BatchingAdapter and GeofenceAdapter. Deprecated Background LOC QMI Client and renamed LocDualContext renamed to LocContext. Moved some common Adapter functions into LocAdapterBase. Added Distance Based Tracking logic into GnssAdapter. Addition of flp.conf Deprecated GEOFENCE capabilities configuration in gps.conf CRs-fixed: 2342200 Change-Id: I6b6257c4cf296e5a8c56bc0b149e4de77cf6cdf9 --- android/1.0/location_api/GnssAPIClient.cpp | 8 +- android/1.1/location_api/GnssAPIClient.cpp | 8 +- android/2.0/location_api/GnssAPIClient.cpp | 6 +- batching/Android.mk | 37 + batching/BatchingAdapter.cpp | 1050 ++++++++++++++++++++ batching/BatchingAdapter.h | 152 +++ batching/Makefile.am | 45 + batching/configure.ac | 78 ++ batching/location-batching.pc.in | 10 + batching/location_batching.cpp | 134 +++ core/Android.mk | 2 +- core/LocAdapterBase.cpp | 207 +++- core/LocAdapterBase.h | 49 +- core/LocApiBase.cpp | 142 ++- core/LocApiBase.h | 167 ++-- core/LocContext.cpp | 98 ++ core/{LocDualContext.h => LocContext.h} | 31 +- core/LocDualContext.cpp | 135 --- core/Makefile.am | 4 +- etc/Android.mk | 15 +- etc/flp.conf | 60 ++ etc/gps.conf | 5 +- geofence/Android.mk | 36 + geofence/GeofenceAdapter.cpp | 867 ++++++++++++++++ geofence/GeofenceAdapter.h | 136 +++ geofence/Makefile.am | 50 + geofence/configure.ac | 72 ++ geofence/location-geofence.pc.in | 10 + geofence/location_geofence.cpp | 145 +++ gnss/GnssAdapter.cpp | 712 +++++++------ gnss/GnssAdapter.h | 78 +- gnss/XtraSystemStatusObserver.h | 2 +- gnss/location_gnss.cpp | 11 +- gps_vendor_product.mk | 2 + location/LocationAPI.cpp | 143 ++- location/LocationDataTypes.h | 2 +- location/location_interface.h | 7 +- 37 files changed, 4003 insertions(+), 713 deletions(-) create mode 100644 batching/Android.mk create mode 100644 batching/BatchingAdapter.cpp create mode 100644 batching/BatchingAdapter.h create mode 100644 batching/Makefile.am create mode 100644 batching/configure.ac create mode 100644 batching/location-batching.pc.in create mode 100644 batching/location_batching.cpp create mode 100644 core/LocContext.cpp rename core/{LocDualContext.h => LocContext.h} (66%) delete mode 100644 core/LocDualContext.cpp create mode 100644 etc/flp.conf create mode 100644 geofence/Android.mk create mode 100644 geofence/GeofenceAdapter.cpp create mode 100644 geofence/GeofenceAdapter.h create mode 100644 geofence/Makefile.am create mode 100644 geofence/configure.ac create mode 100644 geofence/location-geofence.pc.in create mode 100644 geofence/location_geofence.cpp diff --git a/android/1.0/location_api/GnssAPIClient.cpp b/android/1.0/location_api/GnssAPIClient.cpp index d04939e3..a36d2b48 100644 --- a/android/1.0/location_api/GnssAPIClient.cpp +++ b/android/1.0/location_api/GnssAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -36,7 +36,7 @@ #include "LocationUtil.h" #include "GnssAPIClient.h" -#include +#include namespace android { namespace hardware { @@ -110,9 +110,9 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, locationCallbacks.gnssNiCb = nullptr; loc_core::ContextBase* context = - loc_core::LocDualContext::getLocFgContext( + loc_core::LocContext::getLocContext( NULL, NULL, - loc_core::LocDualContext::mLocationHalName, false); + loc_core::LocContext::mLocationHalName, false); if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { LOC_LOGD("Registering NI CB"); locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { diff --git a/android/1.1/location_api/GnssAPIClient.cpp b/android/1.1/location_api/GnssAPIClient.cpp index fcef4592..89877e5e 100644 --- a/android/1.1/location_api/GnssAPIClient.cpp +++ b/android/1.1/location_api/GnssAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, 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 @@ -36,7 +36,7 @@ #include "LocationUtil.h" #include "GnssAPIClient.h" -#include +#include namespace android { namespace hardware { @@ -110,9 +110,9 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, locationCallbacks.gnssNiCb = nullptr; loc_core::ContextBase* context = - loc_core::LocDualContext::getLocFgContext( + loc_core::LocContext::getLocContext( NULL, NULL, - loc_core::LocDualContext::mLocationHalName, false); + loc_core::LocContext::mLocationHalName, false); if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { LOC_LOGD("Registering NI CB"); locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index ceb0aa47..44ae284c 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -36,7 +36,7 @@ #include "LocationUtil.h" #include "GnssAPIClient.h" -#include +#include namespace android { namespace hardware { @@ -110,9 +110,9 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, locationCallbacks.gnssNiCb = nullptr; loc_core::ContextBase* context = - loc_core::LocDualContext::getLocFgContext( + loc_core::LocContext::getLocContext( NULL, NULL, - loc_core::LocDualContext::mLocationHalName, false); + loc_core::LocContext::mLocationHalName, false); if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { LOC_LOGD("Registering NI CB"); locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { diff --git a/batching/Android.mk b/batching/Android.mk new file mode 100644 index 00000000..b08d1558 --- /dev/null +++ b/batching/Android.mk @@ -0,0 +1,37 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libbatching +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + liblog \ + libloc_core \ + libgps.utils \ + libdl \ + liblbs_core + +LOCAL_SRC_FILES += \ + location_batching.cpp \ + BatchingAdapter.cpp + +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + +LOCAL_PRELINK_MODULE := false + +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/batching/BatchingAdapter.cpp b/batching/BatchingAdapter.cpp new file mode 100644 index 00000000..135f0ed9 --- /dev/null +++ b/batching/BatchingAdapter.cpp @@ -0,0 +1,1050 @@ +/* Copyright (c) 2017-2019, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_BatchingAdapter" + +#include +#include +#include +#include + +using namespace loc_core; + +BatchingAdapter::BatchingAdapter() : + LocAdapterBase(0, + LocContext::getLocContext( + NULL, + NULL, + LocContext::mLocationHalName, + false)), + mOngoingTripDistance(0), + mOngoingTripTBFInterval(0), + mTripWithOngoingTBFDropped(false), + mTripWithOngoingTripDistanceDropped(false), + mBatchingTimeout(0), + mBatchingAccuracy(1), + mBatchSize(0), + mTripBatchSize(0) +{ + LOC_LOGD("%s]: Constructor", __func__); + readConfigCommand(); + setConfigCommand(); +} + +void +BatchingAdapter::readConfigCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgReadConfig : public LocMsg { + BatchingAdapter& mAdapter; + inline MsgReadConfig(BatchingAdapter& adapter) : + LocMsg(), + mAdapter(adapter) {} + inline virtual void proc() const { + uint32_t batchingTimeout = 0; + uint32_t batchingAccuracy = 0; + uint32_t batchSize = 0; + uint32_t tripBatchSize = 0; + static const loc_param_s_type flp_conf_param_table[] = + { + {"BATCH_SIZE", &batchSize, NULL, 'n'}, + {"OUTDOOR_TRIP_BATCH_SIZE", &tripBatchSize, NULL, 'n'}, + {"BATCH_SESSION_TIMEOUT", &batchingTimeout, NULL, 'n'}, + {"ACCURACY", &batchingAccuracy, NULL, 'n'}, + }; + UTIL_READ_CONF(LOC_PATH_FLP_CONF, flp_conf_param_table); + + LOC_LOGD("%s]: batchSize %u tripBatchSize %u batchingAccuracy %u batchingTimeout %u ", + __func__, batchSize, tripBatchSize, batchingAccuracy, batchingTimeout); + + mAdapter.setBatchSize(batchSize); + mAdapter.setTripBatchSize(tripBatchSize); + mAdapter.setBatchingTimeout(batchingTimeout); + mAdapter.setBatchingAccuracy(batchingAccuracy); + } + }; + + sendMsg(new MsgReadConfig(*this)); + +} + +void +BatchingAdapter::setConfigCommand() +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgSetConfig : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + inline MsgSetConfig(BatchingAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + inline virtual void proc() const { + mApi.setBatchSize(mAdapter.getBatchSize()); + mApi.setTripBatchSize(mAdapter.getTripBatchSize()); + } + }; + + sendMsg(new MsgSetConfig(*this, *mLocApi)); +} + +void +BatchingAdapter::stopClientSessions(LocationAPI* client) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + typedef struct pairKeyBatchMode { + LocationAPI* client; + uint32_t id; + BatchingMode batchingMode; + inline pairKeyBatchMode(LocationAPI* _client, uint32_t _id, BatchingMode _bMode) : + client(_client), id(_id), batchingMode(_bMode) {} + } pairKeyBatchMode; + std::vector vBatchingClient; + for (auto it : mBatchingSessions) { + if (client == it.first.client) { + vBatchingClient.emplace_back(it.first.client, it.first.id, it.second.batchingMode); + } + } + for (auto keyBatchingMode : vBatchingClient) { + if (keyBatchingMode.batchingMode != BATCHING_MODE_TRIP) { + stopBatching(keyBatchingMode.client, keyBatchingMode.id); + } else { + stopTripBatchingMultiplex(keyBatchingMode.client, keyBatchingMode.id); + } + } +} + +void +BatchingAdapter::updateClientsEventMask() +{ + LOC_API_ADAPTER_EVENT_MASK_T mask = 0; + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + // we don't register LOC_API_ADAPTER_BIT_BATCH_FULL until we + // start batching with ROUTINE or TRIP option + if (it->second.batchingCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_BATCH_STATUS; + } + } + if (autoReportBatchingSessionsCount() > 0) { + mask |= LOC_API_ADAPTER_BIT_BATCH_FULL; + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); +} + +void +BatchingAdapter::handleEngineUpEvent() +{ + struct MsgSSREvent : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + inline MsgSSREvent(BatchingAdapter& adapter, + LocApiBase& api) : + LocMsg(), + mAdapter(adapter), + mApi(api) {} + virtual void proc() const { + mAdapter.setEngineCapabilitiesKnown(true); + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); + mApi.setBatchSize(mAdapter.getBatchSize()); + mApi.setTripBatchSize(mAdapter.getTripBatchSize()); + mAdapter.restartSessions(); + for (auto msg: mAdapter.mPendingMsgs) { + mAdapter.sendMsg(msg); + } + mAdapter.mPendingMsgs.clear(); + } + }; + + sendMsg(new MsgSSREvent(*this, *mLocApi)); +} + +void +BatchingAdapter::restartSessions() +{ + LOC_LOGD("%s]: ", __func__); + + if (autoReportBatchingSessionsCount() > 0) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_ENABLED); + } + for (auto it = mBatchingSessions.begin(); + it != mBatchingSessions.end(); ++it) { + if (it->second.batchingMode != BATCHING_MODE_TRIP) { + mLocApi->startBatching(it->first.id, it->second, + getBatchingAccuracy(), getBatchingTimeout(), + new LocApiResponse(*getContext(), + [] (LocationError /*err*/) {})); + } + } + + if (mTripSessions.size() > 0) { + // restart outdoor trip batching session if any. + mOngoingTripDistance = 0; + mOngoingTripTBFInterval = 0; + + // record the min trip distance and min tbf interval of all ongoing sessions + for (auto tripSession : mTripSessions) { + + TripSessionStatus &tripSessStatus = tripSession.second; + + if ((0 == mOngoingTripDistance) || + (mOngoingTripDistance > + (tripSessStatus.tripDistance - tripSessStatus.accumulatedDistanceThisTrip))) { + mOngoingTripDistance = tripSessStatus.tripDistance - + tripSessStatus.accumulatedDistanceThisTrip; + } + + if ((0 == mOngoingTripTBFInterval) || + (mOngoingTripTBFInterval > tripSessStatus.tripTBFInterval)) { + mOngoingTripTBFInterval = tripSessStatus.tripTBFInterval; + } + + // reset the accumulatedDistanceOngoingBatch for each session + tripSessStatus.accumulatedDistanceOngoingBatch = 0; + + } + + mLocApi->startOutdoorTripBatching(mOngoingTripDistance, mOngoingTripTBFInterval, + getBatchingTimeout(), new LocApiResponse(*getContext(), [this] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + mOngoingTripDistance = 0; + mOngoingTripTBFInterval = 0; + } + printTripReport(); + })); + } +} + +bool +BatchingAdapter::hasBatchingCallback(LocationAPI* client) +{ + auto it = mClientData.find(client); + return (it != mClientData.end() && it->second.batchingCb); +} + +bool +BatchingAdapter::isBatchingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + return (mBatchingSessions.find(key) != mBatchingSessions.end()); +} + +bool +BatchingAdapter::isTripSession(uint32_t sessionId) { + return (mTripSessions.find(sessionId) != mTripSessions.end()); +} + +void +BatchingAdapter::saveBatchingSession(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions) +{ + LocationSessionKey key(client, sessionId); + mBatchingSessions[key] = batchingOptions; +} + +void +BatchingAdapter::eraseBatchingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + auto it = mBatchingSessions.find(key); + if (it != mBatchingSessions.end()) { + mBatchingSessions.erase(it); + } +} + +void +BatchingAdapter::reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId) +{ + LOC_LOGD("%s]: client %p id %u err %u", __func__, client, sessionId, err); + + auto it = mClientData.find(client); + if (it != mClientData.end() && + it->second.responseCb != nullptr) { + it->second.responseCb(err, sessionId); + } else { + LOC_LOGE("%s]: client %p id %u not found in data", __func__, client, sessionId); + } +} + +uint32_t +BatchingAdapter::autoReportBatchingSessionsCount() +{ + uint32_t count = 0; + for (auto batchingSession: mBatchingSessions) { + if (batchingSession.second.batchingMode != BATCHING_MODE_NO_AUTO_REPORT) { + count++; + } + } + count += mTripSessions.size(); + return count; +} + +uint32_t +BatchingAdapter::startBatchingCommand( + LocationAPI* client, BatchingOptions& batchOptions) +{ + uint32_t sessionId = generateSessionId(); + LOC_LOGD("%s]: client %p id %u minInterval %u minDistance %u mode %u Batching Mode %d", + __func__, client, sessionId, batchOptions.minInterval, batchOptions.minDistance, + batchOptions.mode,batchOptions.batchingMode); + + struct MsgStartBatching : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + BatchingOptions mBatchingOptions; + inline MsgStartBatching(BatchingAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId, + BatchingOptions batchOptions) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId), + mBatchingOptions(batchOptions) {} + inline virtual void proc() const { + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgStartBatching(*this)); + return; + } + LocationError err = LOCATION_ERROR_SUCCESS; + + if (!mAdapter.hasBatchingCallback(mClient)) { + err = LOCATION_ERROR_CALLBACK_MISSING; + } else if (0 == mBatchingOptions.size) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } else if (!ContextBase::isMessageSupported( + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { + err = LOCATION_ERROR_NOT_SUPPORTED; + } + if (LOCATION_ERROR_SUCCESS == err) { + if (mBatchingOptions.batchingMode == BATCHING_MODE_ROUTINE || + mBatchingOptions.batchingMode == BATCHING_MODE_NO_AUTO_REPORT) { + mAdapter.startBatching(mClient, mSessionId, mBatchingOptions); + } else if (mBatchingOptions.batchingMode == BATCHING_MODE_TRIP) { + mAdapter.startTripBatchingMultiplex(mClient, mSessionId, mBatchingOptions); + } else { + mAdapter.reportResponse(mClient, LOCATION_ERROR_INVALID_PARAMETER, mSessionId); + } + } + } + }; + + sendMsg(new MsgStartBatching(*this, *mLocApi, client, sessionId, batchOptions)); + + return sessionId; +} + +void +BatchingAdapter::startBatching(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions) +{ + if (batchingOptions.batchingMode != BATCHING_MODE_NO_AUTO_REPORT && + 0 == autoReportBatchingSessionsCount()) { + // if there is currenty no batching sessions interested in batch full event, then this + // new session will need to register for batch full event + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_ENABLED); + } + + // Assume start will be OK, remove session if not + saveBatchingSession(client, sessionId, batchingOptions); + mLocApi->startBatching(sessionId, batchingOptions, getBatchingAccuracy(), getBatchingTimeout(), + new LocApiResponse(*getContext(), + [this, client, sessionId, batchingOptions] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + eraseBatchingSession(client, sessionId); + } + + if (LOCATION_ERROR_SUCCESS != err && + batchingOptions.batchingMode != BATCHING_MODE_NO_AUTO_REPORT && + 0 == autoReportBatchingSessionsCount()) { + // if we fail to start batching and we have already registered batch full event + // we need to undo that since no sessions are now interested in batch full event + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_DISABLED); + } + + reportResponse(client, err, sessionId); + })); +} + +void +BatchingAdapter::updateBatchingOptionsCommand(LocationAPI* client, uint32_t id, + BatchingOptions& batchOptions) +{ + LOC_LOGD("%s]: client %p id %u minInterval %u minDistance %u mode %u batchMode %u", + __func__, client, id, batchOptions.minInterval, + batchOptions.minDistance, batchOptions.mode, + batchOptions.batchingMode); + + struct MsgUpdateBatching : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + BatchingOptions mBatchOptions; + inline MsgUpdateBatching(BatchingAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId, + BatchingOptions batchOptions) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId), + mBatchOptions(batchOptions) {} + inline virtual void proc() const { + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgUpdateBatching(*this)); + return; + } + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mAdapter.isBatchingSession(mClient, mSessionId)) { + err = LOCATION_ERROR_ID_UNKNOWN; + } else if ((0 == mBatchOptions.size) || + (mBatchOptions.batchingMode > BATCHING_MODE_NO_AUTO_REPORT)) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } + if (LOCATION_ERROR_SUCCESS == err) { + if (!mAdapter.isTripSession(mSessionId)) { + mAdapter.stopBatching(mClient, mSessionId, true, mBatchOptions); + } else { + mAdapter.stopTripBatchingMultiplex(mClient, mSessionId, true, mBatchOptions); + } + } + } + }; + + sendMsg(new MsgUpdateBatching(*this, *mLocApi, client, id, batchOptions)); +} + +void +BatchingAdapter::stopBatchingCommand(LocationAPI* client, uint32_t id) +{ + LOC_LOGD("%s]: client %p id %u", __func__, client, id); + + struct MsgStopBatching : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + inline MsgStopBatching(BatchingAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId) {} + inline virtual void proc() const { + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgStopBatching(*this)); + return; + } + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mAdapter.isBatchingSession(mClient, mSessionId)) { + err = LOCATION_ERROR_ID_UNKNOWN; + } + if (LOCATION_ERROR_SUCCESS == err) { + if (mAdapter.isTripSession(mSessionId)) { + mAdapter.stopTripBatchingMultiplex(mClient, mSessionId); + } else { + mAdapter.stopBatching(mClient, mSessionId); + } + } + } + }; + + sendMsg(new MsgStopBatching(*this, *mLocApi, client, id)); +} + +void +BatchingAdapter::stopBatching(LocationAPI* client, uint32_t sessionId, bool restartNeeded, + const BatchingOptions& batchOptions) +{ + LocationSessionKey key(client, sessionId); + auto it = mBatchingSessions.find(key); + if (it != mBatchingSessions.end()) { + auto flpOptions = it->second; + // Assume stop will be OK, restore session if not + eraseBatchingSession(client, sessionId); + mLocApi->stopBatching(sessionId, + new LocApiResponse(*getContext(), + [this, client, sessionId, flpOptions, restartNeeded, batchOptions] + (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + saveBatchingSession(client, sessionId, batchOptions); + } else { + // if stopBatching is success, unregister for batch full event if this was the last + // batching session that is interested in batch full event + if (0 == autoReportBatchingSessionsCount() && + flpOptions.batchingMode != BATCHING_MODE_NO_AUTO_REPORT) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_DISABLED); + } + + if (restartNeeded) { + if (batchOptions.batchingMode == BATCHING_MODE_ROUTINE || + batchOptions.batchingMode == BATCHING_MODE_NO_AUTO_REPORT) { + startBatching(client, sessionId, batchOptions); + } else if (batchOptions.batchingMode == BATCHING_MODE_TRIP) { + startTripBatchingMultiplex(client, sessionId, batchOptions); + } + } + } + reportResponse(client, err, sessionId); + })); + } +} + +void +BatchingAdapter::getBatchedLocationsCommand(LocationAPI* client, uint32_t id, size_t count) +{ + LOC_LOGD("%s]: client %p id %u count %zu", __func__, client, id, count); + + struct MsgGetBatchedLocations : public LocMsg { + BatchingAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + uint32_t mSessionId; + size_t mCount; + inline MsgGetBatchedLocations(BatchingAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + uint32_t sessionId, + size_t count) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mSessionId(sessionId), + mCount(count) {} + inline virtual void proc() const { + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgGetBatchedLocations(*this)); + return; + } + LocationError err = LOCATION_ERROR_SUCCESS; + if (!mAdapter.hasBatchingCallback(mClient)) { + err = LOCATION_ERROR_CALLBACK_MISSING; + } else if (!mAdapter.isBatchingSession(mClient, mSessionId)) { + err = LOCATION_ERROR_ID_UNKNOWN; + } + if (LOCATION_ERROR_SUCCESS == err) { + if (mAdapter.isTripSession(mSessionId)) { + mApi.getBatchedTripLocations(mCount, 0, + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, + mClient = mClient] (LocationError err) { + mAdapter.reportResponse(mClient, err, mSessionId); + })); + } else { + mApi.getBatchedLocations(mCount, new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, + mClient = mClient] (LocationError err) { + mAdapter.reportResponse(mClient, err, mSessionId); + })); + } + } else { + mAdapter.reportResponse(mClient, err, mSessionId); + } + } + }; + + sendMsg(new MsgGetBatchedLocations(*this, *mLocApi, client, id, count)); +} + +void +BatchingAdapter::reportLocationsEvent(const Location* locations, size_t count, + BatchingMode batchingMode) +{ + LOC_LOGD("%s]: count %zu batchMode %d", __func__, count, batchingMode); + + struct MsgReportLocations : public LocMsg { + BatchingAdapter& mAdapter; + Location* mLocations; + size_t mCount; + BatchingMode mBatchingMode; + inline MsgReportLocations(BatchingAdapter& adapter, + const Location* locations, + size_t count, + BatchingMode batchingMode) : + LocMsg(), + mAdapter(adapter), + mLocations(new Location[count]), + mCount(count), + mBatchingMode(batchingMode) + { + if (nullptr == mLocations) { + LOC_LOGE("%s]: new failed to allocate mLocations", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + mLocations[i] = locations[i]; + } + } + inline virtual ~MsgReportLocations() { + if (nullptr != mLocations) + delete[] mLocations; + } + inline virtual void proc() const { + mAdapter.reportLocations(mLocations, mCount, mBatchingMode); + } + }; + + sendMsg(new MsgReportLocations(*this, locations, count, batchingMode)); +} + +void +BatchingAdapter::reportLocations(Location* locations, size_t count, BatchingMode batchingMode) +{ + BatchingOptions batchOptions = {sizeof(BatchingOptions), batchingMode}; + + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.batchingCb) { + it->second.batchingCb(count, locations, batchOptions); + } + } +} + +void +BatchingAdapter::reportCompletedTripsEvent(uint32_t accumulated_distance) +{ + struct MsgReportCompletedTrips : public LocMsg { + BatchingAdapter& mAdapter; + uint32_t mAccumulatedDistance; + inline MsgReportCompletedTrips(BatchingAdapter& adapter, + uint32_t accumulated_distance) : + LocMsg(), + mAdapter(adapter), + mAccumulatedDistance(accumulated_distance) + { + } + inline virtual ~MsgReportCompletedTrips() { + } + inline virtual void proc() const { + + // Check if any trips are completed + std::list completedTripsList; + completedTripsList.clear(); + + for(auto itt = mAdapter.mTripSessions.begin(); itt != mAdapter.mTripSessions.end();) + { + TripSessionStatus &tripSession = itt->second; + + tripSession.accumulatedDistanceThisTrip = + tripSession.accumulatedDistanceOnTripRestart + + (mAccumulatedDistance - tripSession.accumulatedDistanceOngoingBatch); + if (tripSession.tripDistance <= tripSession.accumulatedDistanceThisTrip) { + // trip is completed + completedTripsList.push_back(itt->first); + itt = mAdapter.mTripSessions.erase(itt); + + if (tripSession.tripTBFInterval == mAdapter.mOngoingTripTBFInterval) { + // trip with ongoing TBF interval is completed + mAdapter.mTripWithOngoingTBFDropped = true; + } + + if (tripSession.tripDistance == mAdapter.mOngoingTripDistance) { + // trip with ongoing trip distance is completed + mAdapter.mTripWithOngoingTripDistanceDropped = true; + } + } else { + itt++; + } + } + + if (completedTripsList.size() > 0) { + mAdapter.reportBatchStatusChange(BATCHING_STATUS_TRIP_COMPLETED, + completedTripsList); + mAdapter.restartTripBatching(false, mAccumulatedDistance, 0); + } else { + mAdapter.printTripReport(); + } + } + }; + + LOC_LOGD("%s]: Accumulated Distance so far: %u", + __func__, accumulated_distance); + + sendMsg(new MsgReportCompletedTrips(*this, accumulated_distance)); +} + +void +BatchingAdapter::reportBatchStatusChange(BatchingStatus batchStatus, + std::list & completedTripsList) +{ + BatchingStatusInfo batchStatusInfo = + {sizeof(BatchingStatusInfo), batchStatus}; + + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.batchingStatusCb) { + it->second.batchingStatusCb(batchStatusInfo, completedTripsList); + } + } +} + +void +BatchingAdapter::reportBatchStatusChangeEvent(BatchingStatus batchStatus) +{ + struct MsgReportBatchStatus : public LocMsg { + BatchingAdapter& mAdapter; + BatchingStatus mBatchStatus; + inline MsgReportBatchStatus(BatchingAdapter& adapter, + BatchingStatus batchStatus) : + LocMsg(), + mAdapter(adapter), + mBatchStatus(batchStatus) + { + } + inline virtual ~MsgReportBatchStatus() { + } + inline virtual void proc() const { + std::list tempList; + tempList.clear(); + mAdapter.reportBatchStatusChange(mBatchStatus, tempList); + } + }; + + sendMsg(new MsgReportBatchStatus(*this, batchStatus)); +} + +void +BatchingAdapter::startTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions) +{ + if (mTripSessions.size() == 0) { + // if there is currenty no batching sessions interested in batch full event, then this + // new session will need to register for batch full event + if (0 == autoReportBatchingSessionsCount()) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_ENABLED); + } + + // Assume start will be OK, remove session if not + saveBatchingSession(client, sessionId, batchingOptions); + + mTripSessions[sessionId] = { 0, 0, 0, batchingOptions.minDistance, + batchingOptions.minInterval}; + mLocApi->startOutdoorTripBatching(batchingOptions.minDistance, + batchingOptions.minInterval, getBatchingTimeout(), new LocApiResponse(*getContext(), + [this, client, sessionId, batchingOptions] (LocationError err) { + if (err == LOCATION_ERROR_SUCCESS) { + mOngoingTripDistance = batchingOptions.minDistance; + mOngoingTripTBFInterval = batchingOptions.minInterval; + LOC_LOGD("%s] New Trip started ...", __func__); + printTripReport(); + } else { + eraseBatchingSession(client, sessionId); + mTripSessions.erase(sessionId); + // if we fail to start batching and we have already registered batch full event + // we need to undo that since no sessions are now interested in batch full event + if (0 == autoReportBatchingSessionsCount()) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_DISABLED); + } + } + reportResponse(client, err, sessionId); + })); + } else { + // query accumulated distance + mLocApi->queryAccumulatedTripDistance( + new LocApiResponseData(*getContext(), + [this, batchingOptions, sessionId, client] + (LocationError err, LocApiBatchData data) { + uint32_t accumulatedDistanceOngoingBatch = 0; + uint32_t numOfBatchedPositions = 0; + uint32_t ongoingTripDistance = mOngoingTripDistance; + uint32_t ongoingTripInterval = mOngoingTripTBFInterval; + bool needsRestart = false; + + // check if TBF of new session is lesser than ongoing TBF interval + if (ongoingTripInterval > batchingOptions.minInterval) { + ongoingTripInterval = batchingOptions.minInterval; + needsRestart = true; + } + accumulatedDistanceOngoingBatch = data.accumulatedDistance; + numOfBatchedPositions = data.numOfBatchedPositions; + TripSessionStatus newTripSession = { accumulatedDistanceOngoingBatch, 0, 0, + batchingOptions.minDistance, + batchingOptions.minInterval}; + if (err != LOCATION_ERROR_SUCCESS) { + // unable to query accumulated distance, assume remaining distance in + // ongoing batch is mongoingTripDistance. + if (batchingOptions.minDistance < ongoingTripDistance) { + ongoingTripDistance = batchingOptions.minDistance; + needsRestart = true; + } + } else { + // compute the remaining distance + uint32_t ongoing_trip_remaining_distance = ongoingTripDistance - + accumulatedDistanceOngoingBatch; + + // check if new trip distance is lesser than the ongoing batch remaining distance + if (batchingOptions.minDistance < ongoing_trip_remaining_distance) { + ongoingTripDistance = batchingOptions.minDistance; + needsRestart = true; + } else if (needsRestart == true) { + // needsRestart is anyways true , may be because of lesser TBF of new session. + ongoingTripDistance = ongoing_trip_remaining_distance; + } + mTripSessions[sessionId] = newTripSession; + LOC_LOGD("%s] New Trip started ...", __func__); + printTripReport(); + } + + if (needsRestart) { + mOngoingTripDistance = ongoingTripDistance; + mOngoingTripTBFInterval = ongoingTripInterval; + + // reset the accumulatedDistanceOngoingBatch for each session, + // and record the total accumulated distance so far for the session. + for (auto itt = mTripSessions.begin(); itt != mTripSessions.end(); itt++) { + TripSessionStatus &tripSessStatus = itt->second; + tripSessStatus.accumulatedDistanceOngoingBatch = 0; + tripSessStatus.accumulatedDistanceOnTripRestart = + tripSessStatus.accumulatedDistanceThisTrip; + } + mLocApi->reStartOutdoorTripBatching(ongoingTripDistance, ongoingTripInterval, + getBatchingTimeout(), new LocApiResponse(*getContext(), + [this, client, sessionId] (LocationError err) { + if (err != LOCATION_ERROR_SUCCESS) { + LOC_LOGE("%s] New Trip restart failed!", __func__); + } + reportResponse(client, err, sessionId); + })); + } else { + reportResponse(client, LOCATION_ERROR_SUCCESS, sessionId); + } + })); + } +} + +void +BatchingAdapter::stopTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId, + bool restartNeeded, const BatchingOptions& batchOptions) +{ + LocationError err = LOCATION_ERROR_SUCCESS; + + if (mTripSessions.size() == 1) { + mLocApi->stopOutdoorTripBatching(true, new LocApiResponse(*getContext(), + [this, restartNeeded, client, sessionId, batchOptions] + (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + // if stopOutdoorTripBatching is success, unregister for batch full event if this + // was the last batching session that is interested in batch full event + if (1 == autoReportBatchingSessionsCount()) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_DISABLED); + } + } + stopTripBatchingMultiplexCommon(err, client, sessionId, restartNeeded, batchOptions); + })); + return; + } + + stopTripBatchingMultiplexCommon(err, client, sessionId, restartNeeded, batchOptions); +} + +void +BatchingAdapter::stopTripBatchingMultiplexCommon(LocationError err, LocationAPI* client, + uint32_t sessionId, bool restartNeeded, const BatchingOptions& batchOptions) +{ + auto itt = mTripSessions.find(sessionId); + TripSessionStatus tripSess = itt->second; + if (tripSess.tripTBFInterval == mOngoingTripTBFInterval) { + // trip with ongoing trip interval is stopped + mTripWithOngoingTBFDropped = true; + } + + if (tripSess.tripDistance == mOngoingTripDistance) { + // trip with ongoing trip distance is stopped + mTripWithOngoingTripDistanceDropped = true; + } + + mTripSessions.erase(sessionId); + + if (mTripSessions.size() == 0) { + mOngoingTripDistance = 0; + mOngoingTripTBFInterval = 0; + } else { + restartTripBatching(true); + } + + if (restartNeeded) { + eraseBatchingSession(client, sessionId); + if (batchOptions.batchingMode == BATCHING_MODE_ROUTINE || + batchOptions.batchingMode == BATCHING_MODE_NO_AUTO_REPORT) { + startBatching(client, sessionId, batchOptions); + } else if (batchOptions.batchingMode == BATCHING_MODE_TRIP) { + startTripBatchingMultiplex(client, sessionId, batchOptions); + } + } + reportResponse(client, err, sessionId); +} + + +void +BatchingAdapter::restartTripBatching(bool queryAccumulatedDistance, uint32_t accDist, + uint32_t numbatchedPos) +{ + // does batch need restart with new trip distance / TBF interval + uint32_t minRemainingDistance = 0; + uint32_t minTBFInterval = 0; + + // if no more trips left, stop the ongoing trip + if (mTripSessions.size() == 0) { + mLocApi->stopOutdoorTripBatching(true, new LocApiResponse(*getContext(), + [] (LocationError /*err*/) {})); + mOngoingTripDistance = 0; + mOngoingTripTBFInterval = 0; + // unregister for batch full event if there are no more + // batching session that is interested in batch full event + if (0 == autoReportBatchingSessionsCount()) { + updateEvtMask(LOC_API_ADAPTER_BIT_BATCH_FULL, + LOC_REGISTRATION_MASK_DISABLED); + } + return; + } + + // record the min trip distance and min tbf interval of all ongoing sessions + for (auto itt = mTripSessions.begin(); itt != mTripSessions.end(); itt++) { + + TripSessionStatus tripSessStatus = itt->second; + + if ((minRemainingDistance == 0) || + (minRemainingDistance > (tripSessStatus.tripDistance + - tripSessStatus.accumulatedDistanceThisTrip))) { + minRemainingDistance = tripSessStatus.tripDistance - + tripSessStatus.accumulatedDistanceThisTrip; + } + + if ((minTBFInterval == 0) || + (minTBFInterval > tripSessStatus.tripTBFInterval)) { + minTBFInterval = tripSessStatus.tripTBFInterval; + } + } + + mLocApi->queryAccumulatedTripDistance( + new LocApiResponseData(*getContext(), + [this, queryAccumulatedDistance, minRemainingDistance, minTBFInterval, accDist, + numbatchedPos] (LocationError /*err*/, LocApiBatchData data) { + bool needsRestart = false; + + uint32_t ongoingTripDistance = mOngoingTripDistance; + uint32_t ongoingTripInterval = mOngoingTripTBFInterval; + uint32_t accumulatedDistance = accDist; + uint32_t numOfBatchedPositions = numbatchedPos; + + if (queryAccumulatedDistance) { + accumulatedDistance = data.accumulatedDistance; + numOfBatchedPositions = data.numOfBatchedPositions; + } + + if ((!mTripWithOngoingTripDistanceDropped) && + (ongoingTripDistance - accumulatedDistance != 0)) { + // if ongoing trip is already not completed still, + // check the min distance against the remaining distance + if (minRemainingDistance < + (ongoingTripDistance - accumulatedDistance)) { + ongoingTripDistance = minRemainingDistance; + needsRestart = true; + } + } else if (minRemainingDistance != 0) { + // else if ongoing trip is already completed / dropped, + // use the minRemainingDistance of ongoing sessions + ongoingTripDistance = minRemainingDistance; + needsRestart = true; + } + + if ((minTBFInterval < ongoingTripInterval) || + ((minTBFInterval != ongoingTripInterval) && + (mTripWithOngoingTBFDropped))) { + ongoingTripInterval = minTBFInterval; + needsRestart = true; + } + + if (needsRestart) { + mLocApi->reStartOutdoorTripBatching(ongoingTripDistance, ongoingTripInterval, + getBatchingTimeout(), new LocApiResponse(*getContext(), + [this, accumulatedDistance, ongoingTripDistance, ongoingTripInterval] + (LocationError err) { + + if (err == LOCATION_ERROR_SUCCESS) { + for(auto itt = mTripSessions.begin(); itt != mTripSessions.end(); itt++) { + TripSessionStatus &tripSessStatus = itt->second; + tripSessStatus.accumulatedDistanceThisTrip = + tripSessStatus.accumulatedDistanceOnTripRestart + + (accumulatedDistance - + tripSessStatus.accumulatedDistanceOngoingBatch); + + tripSessStatus.accumulatedDistanceOngoingBatch = 0; + tripSessStatus.accumulatedDistanceOnTripRestart = + tripSessStatus.accumulatedDistanceThisTrip; + } + + mOngoingTripDistance = ongoingTripDistance; + mOngoingTripTBFInterval = ongoingTripInterval; + } + })); + } + })); +} + +void +BatchingAdapter::printTripReport() +{ + IF_LOC_LOGD { + LOC_LOGD("Ongoing Trip Distance = %u, Ongoing Trip TBF Interval = %u", + mOngoingTripDistance, mOngoingTripTBFInterval); + + for (auto itt = mTripSessions.begin(); itt != mTripSessions.end(); itt++) { + TripSessionStatus tripSessStatus = itt->second; + + LOC_LOGD("tripDistance:%u tripTBFInterval:%u" + " trip accumulated Distance:%u" + " trip accumualted distance ongoing batch:%u" + " trip accumulated distance on trip restart %u \r\n", + tripSessStatus.tripDistance, tripSessStatus.tripTBFInterval, + tripSessStatus.accumulatedDistanceThisTrip, + tripSessStatus.accumulatedDistanceOngoingBatch, + tripSessStatus.accumulatedDistanceOnTripRestart); + } + } +} diff --git a/batching/BatchingAdapter.h b/batching/BatchingAdapter.h new file mode 100644 index 00000000..66f7c5f1 --- /dev/null +++ b/batching/BatchingAdapter.h @@ -0,0 +1,152 @@ +/* Copyright (c) 2017-2019, 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 BATCHING_ADAPTER_H +#define BATCHING_ADAPTER_H + +#include +#include +#include +#include + +using namespace loc_core; + +class BatchingAdapter : public LocAdapterBase { + + /* ==== BATCHING ======================================================================= */ + typedef struct { + uint32_t accumulatedDistanceOngoingBatch; + uint32_t accumulatedDistanceThisTrip; + uint32_t accumulatedDistanceOnTripRestart; + uint32_t tripDistance; + uint32_t tripTBFInterval; + } TripSessionStatus; + typedef std::map TripSessionStatusMap; + typedef std::map BatchingSessionMap; + + BatchingSessionMap mBatchingSessions; + TripSessionStatusMap mTripSessions; + uint32_t mOngoingTripDistance; + uint32_t mOngoingTripTBFInterval; + bool mTripWithOngoingTBFDropped; + bool mTripWithOngoingTripDistanceDropped; + + void startTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions); + void stopTripBatchingMultiplex(LocationAPI* client, uint32_t sessionId, + bool restartNeeded, + const BatchingOptions& batchOptions); + inline void stopTripBatchingMultiplex(LocationAPI* client, uint32_t id) { + BatchingOptions batchOptions; + stopTripBatchingMultiplex(client, id, false, batchOptions); + }; + void stopTripBatchingMultiplexCommon(LocationError err, + LocationAPI* client, + uint32_t sessionId, + bool restartNeeded, + const BatchingOptions& batchOptions); + void restartTripBatching(bool queryAccumulatedDistance, uint32_t accDist = 0, + uint32_t numbatchedPos = 0); + void printTripReport(); + + /* ==== CONFIGURATION ================================================================== */ + uint32_t mBatchingTimeout; + uint32_t mBatchingAccuracy; + size_t mBatchSize; + size_t mTripBatchSize; + +protected: + + /* ==== CLIENT ========================================================================= */ + virtual void updateClientsEventMask(); + virtual void stopClientSessions(LocationAPI* client); + +public: + BatchingAdapter(); + virtual ~BatchingAdapter() {} + + /* ==== SSR ============================================================================ */ + /* ======== EVENTS ====(Called from QMI Thread)========================================= */ + virtual void handleEngineUpEvent(); + /* ======== UTILITIES ================================================================== */ + void restartSessions(); + + /* ==== BATCHING ======================================================================= */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + uint32_t startBatchingCommand(LocationAPI* client, BatchingOptions &batchOptions); + void updateBatchingOptionsCommand( + LocationAPI* client, uint32_t id, BatchingOptions& batchOptions); + void stopBatchingCommand(LocationAPI* client, uint32_t id); + void getBatchedLocationsCommand(LocationAPI* client, uint32_t id, size_t count); + /* ======== RESPONSES ================================================================== */ + void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId); + /* ======== UTILITIES ================================================================== */ + bool hasBatchingCallback(LocationAPI* client); + bool isBatchingSession(LocationAPI* client, uint32_t sessionId); + bool isTripSession(uint32_t sessionId); + void saveBatchingSession(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions); + void eraseBatchingSession(LocationAPI* client, uint32_t sessionId); + uint32_t autoReportBatchingSessionsCount(); + void startBatching(LocationAPI* client, uint32_t sessionId, + const BatchingOptions& batchingOptions); + void stopBatching(LocationAPI* client, uint32_t sessionId, bool restartNeeded, + const BatchingOptions& batchOptions); + void stopBatching(LocationAPI* client, uint32_t sessionId) { + BatchingOptions batchOptions; + stopBatching(client, sessionId, false, batchOptions); + }; + + /* ==== REPORTS ======================================================================== */ + /* ======== EVENTS ====(Called from QMI Thread)========================================= */ + void reportLocationsEvent(const Location* locations, size_t count, + BatchingMode batchingMode); + void reportCompletedTripsEvent(uint32_t accumulatedDistance); + void reportBatchStatusChangeEvent(BatchingStatus batchStatus); + /* ======== UTILITIES ================================================================== */ + void reportLocations(Location* locations, size_t count, BatchingMode batchingMode); + void reportBatchStatusChange(BatchingStatus batchStatus, + std::list & completedTripsList); + + /* ==== CONFIGURATION ================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void readConfigCommand(); + void setConfigCommand(); + /* ======== UTILITIES ================================================================== */ + void setBatchSize(size_t batchSize) { mBatchSize = batchSize; } + size_t getBatchSize() { return mBatchSize; } + void setTripBatchSize(size_t batchSize) { mTripBatchSize = batchSize; } + size_t getTripBatchSize() { return mTripBatchSize; } + void setBatchingTimeout(uint32_t batchingTimeout) { mBatchingTimeout = batchingTimeout; } + uint32_t getBatchingTimeout() { return mBatchingTimeout; } + void setBatchingAccuracy(uint32_t accuracy) { mBatchingAccuracy = accuracy; } + uint32_t getBatchingAccuracy() { return mBatchingAccuracy; } + +}; + +#endif /* BATCHING_ADAPTER_H */ diff --git a/batching/Makefile.am b/batching/Makefile.am new file mode 100644 index 00000000..ef8011e9 --- /dev/null +++ b/batching/Makefile.am @@ -0,0 +1,45 @@ +AM_CFLAGS = \ + $(GPSUTILS_CFLAGS) \ + $(LOCCORE_CFLAGS) \ + -I./ \ + -std=c++1y \ + -D__func__=__PRETTY_FUNCTION__ \ + -fno-short-enums + +ACLOCAL_AMFLAGS = -I m4 + +requiredlibs = \ + $(GPSUTILS_LIBS) \ + $(LOCCORE_LIBS) \ + -llog + +h_sources = \ + BatchingAdapter.h + +libbatching_la_SOURCES = \ + location_batching.cpp \ + BatchingAdapter.cpp + +if USE_GLIB +libbatching_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +#libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -shared -avoid-version +libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -avoid-version +libbatching_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libbatching_la_CFLAGS = $(AM_CFLAGS) +libbatching_la_LDFLAGS = -Wl,-z,defs -lpthread $(requiredlibs) -shared -version-info 1:0:0 +libbatching_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +library_include_HEADERS = $(h_sources) + +library_includedir = $(pkgincludedir) + +#Create and Install libraries +lib_LTLIBRARIES = libbatching.la + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = location-batching.pc +sysconf_DATA = $(WORKSPACE)/hardware/qcom/gps/etc/flp.conf +EXTRA_DIST = $(pkgconfig_DATA) + diff --git a/batching/configure.ac b/batching/configure.ac new file mode 100644 index 00000000..27435c66 --- /dev/null +++ b/batching/configure.ac @@ -0,0 +1,78 @@ +# configure.ac -- Autoconf script for gps location-batching +# +# Process this file with autoconf to produce a configure script + +# Requires autoconf tool later than 2.61 +AC_PREREQ(2.61) +# Initialize the gps location-batching package version 1.0.0 +AC_INIT([location-batching],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([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + +PKG_CHECK_MODULES([LOCCORE], [loc-core]) +AC_SUBST([LOCCORE_CFLAGS]) +AC_SUBST([LOCCORE_LIBS]) + +PKG_CHECK_MODULES([GEOFENCE], [location-geofence]) +AC_SUBST([GEOFENCE_CFLAGS]) +AC_SUBST([GEOFENCE_LIBS]) + +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_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 \ + location-batching.pc + ]) + +AC_OUTPUT diff --git a/batching/location-batching.pc.in b/batching/location-batching.pc.in new file mode 100644 index 00000000..da1fbf44 --- /dev/null +++ b/batching/location-batching.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: location-batching +Description: QTI GPS Batching +Version: @VERSION +Libs: -L${libdir} -lbatching +Cflags: -I${includedir}/location-batching diff --git a/batching/location_batching.cpp b/batching/location_batching.cpp new file mode 100644 index 00000000..571da725 --- /dev/null +++ b/batching/location_batching.cpp @@ -0,0 +1,134 @@ +/* Copyright (c) 2017-2019, 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 "BatchingAdapter.h" +#include "location_interface.h" + +static BatchingAdapter* gBatchingAdapter = NULL; + +static void initialize(); +static void deinitialize(); + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks); +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb); +static void requestCapabilities(LocationAPI* client); + +static uint32_t startBatching(LocationAPI* client, BatchingOptions&); +static void stopBatching(LocationAPI* client, uint32_t id); +static void updateBatchingOptions(LocationAPI* client, uint32_t id, BatchingOptions&); +static void getBatchedLocations(LocationAPI* client, uint32_t id, size_t count); + +static const BatchingInterface gBatchingInterface = { + sizeof(BatchingInterface), + initialize, + deinitialize, + addClient, + removeClient, + requestCapabilities, + startBatching, + stopBatching, + updateBatchingOptions, + getBatchedLocations +}; + +#ifndef DEBUG_X86 +extern "C" const BatchingInterface* getBatchingInterface() +#else +const BatchingInterface* getBatchingInterface() +#endif // DEBUG_X86 +{ + return &gBatchingInterface; +} + +static void initialize() +{ + if (NULL == gBatchingAdapter) { + gBatchingAdapter = new BatchingAdapter(); + } +} + +static void deinitialize() +{ + if (NULL != gBatchingAdapter) { + delete gBatchingAdapter; + gBatchingAdapter = NULL; + } +} + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->addClientCommand(client, callbacks); + } +} + +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->removeClientCommand(client, rmClientCb); + } +} + +static void requestCapabilities(LocationAPI* client) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->requestCapabilitiesCommand(client); + } +} + +static uint32_t startBatching(LocationAPI* client, BatchingOptions &batchOptions) +{ + if (NULL != gBatchingAdapter) { + return gBatchingAdapter->startBatchingCommand(client, batchOptions); + } else { + return 0; + } +} + +static void stopBatching(LocationAPI* client, uint32_t id) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->stopBatchingCommand(client, id); + } +} + +static void updateBatchingOptions( + LocationAPI* client, uint32_t id, BatchingOptions& batchOptions) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->updateBatchingOptionsCommand(client, id, batchOptions); + } +} + +static void getBatchedLocations(LocationAPI* client, uint32_t id, size_t count) +{ + if (NULL != gBatchingAdapter) { + gBatchingAdapter->getBatchedLocationsCommand(client, id, count); + } +} + diff --git a/core/Android.mk b/core/Android.mk index 97614a17..bd955c1f 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -21,7 +21,7 @@ LOCAL_SRC_FILES += \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ - LocDualContext.cpp \ + LocContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ SystemStatusOsObserver.cpp \ diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index cea72fa9..5f6a0c8e 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -46,7 +46,8 @@ LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, LocAdapterProxyBase *adapterProxyBase) : mIsMaster(isMaster), mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), - mMsgTask(context->getMsgTask()) + mMsgTask(context->getMsgTask()), + mIsEngineCapabilitiesKnown(ContextBase::sIsEngineCapabilitiesKnown) { mLocApi->addAdapter(this); } @@ -203,4 +204,208 @@ DEFAULT_IMPL(false) void LocAdapterBase:: reportNfwNotificationEvent(GnssNfwNotification& /*notification*/) DEFAULT_IMPL() + +void +LocAdapterBase::geofenceBreachEvent(size_t /*count*/, uint32_t* /*hwIds*/, Location& /*location*/, + GeofenceBreachType /*breachType*/, uint64_t /*timestamp*/) +DEFAULT_IMPL() + +void +LocAdapterBase::geofenceStatusEvent(GeofenceStatusAvailable /*available*/) +DEFAULT_IMPL() + +void +LocAdapterBase::reportLocationsEvent(const Location* /*locations*/, size_t /*count*/, + BatchingMode /*batchingMode*/) +DEFAULT_IMPL() + +void +LocAdapterBase::reportCompletedTripsEvent(uint32_t /*accumulated_distance*/) +DEFAULT_IMPL() + +void +LocAdapterBase::reportBatchStatusChangeEvent(BatchingStatus /*batchStatus*/) +DEFAULT_IMPL() + +void +LocAdapterBase::reportPositionEvent(UlpLocation& /*location*/, + GpsLocationExtended& /*locationExtended*/, + enum loc_sess_status /*status*/, + LocPosTechMask /*loc_technology_mask*/) +DEFAULT_IMPL() + +void +LocAdapterBase::saveClient(LocationAPI* client, const LocationCallbacks& callbacks) +{ + mClientData[client] = callbacks; + updateClientsEventMask(); +} + +void +LocAdapterBase::eraseClient(LocationAPI* client) +{ + auto it = mClientData.find(client); + if (it != mClientData.end()) { + mClientData.erase(it); + } + updateClientsEventMask(); +} + +LocationCallbacks +LocAdapterBase::getClientCallbacks(LocationAPI* client) +{ + LocationCallbacks callbacks = {}; + auto it = mClientData.find(client); + if (it != mClientData.end()) { + callbacks = it->second; + } + return callbacks; +} + +LocationCapabilitiesMask +LocAdapterBase::getCapabilities() +{ + LocationCapabilitiesMask mask = 0; + + if (isEngineCapabilitiesKnown()) { + // time based tracking always supported + mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; + if (ContextBase::isMessageSupported( + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)){ + mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | + LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; + } + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; + } + if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { + mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; + } + // geofence always supported + mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; + if (ContextBase::gnssConstellationConfig()) { + mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; + } + uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities(); + if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) { + mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT; + } + if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { + mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { + mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { + mask |= LOCATION_CAPABILITIES_AGPM_BIT; + } + } else { + LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__); + } + + return mask; +} + +void +LocAdapterBase::broadcastCapabilities(LocationCapabilitiesMask mask) +{ + for (auto clientData : mClientData) { + if (nullptr != clientData.second.capabilitiesCb) { + clientData.second.capabilitiesCb(mask); + } + } +} + +void +LocAdapterBase::updateClientsEventMask() +DEFAULT_IMPL() + +void +LocAdapterBase::stopClientSessions(LocationAPI* client) +DEFAULT_IMPL() + +void +LocAdapterBase::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + struct MsgAddClient : public LocMsg { + LocAdapterBase& mAdapter; + LocationAPI* mClient; + const LocationCallbacks mCallbacks; + inline MsgAddClient(LocAdapterBase& adapter, + LocationAPI* client, + const LocationCallbacks& callbacks) : + LocMsg(), + mAdapter(adapter), + mClient(client), + mCallbacks(callbacks) {} + inline virtual void proc() const { + mAdapter.saveClient(mClient, mCallbacks); + } + }; + + sendMsg(new MsgAddClient(*this, client, callbacks)); +} + +void +LocAdapterBase::removeClientCommand(LocationAPI* client, + removeClientCompleteCallback rmClientCb) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + struct MsgRemoveClient : public LocMsg { + LocAdapterBase& mAdapter; + LocationAPI* mClient; + removeClientCompleteCallback mRmClientCb; + inline MsgRemoveClient(LocAdapterBase& adapter, + LocationAPI* client, + removeClientCompleteCallback rmCb) : + LocMsg(), + mAdapter(adapter), + mClient(client), + mRmClientCb(rmCb){} + inline virtual void proc() const { + mAdapter.stopClientSessions(mClient); + mAdapter.eraseClient(mClient); + if (nullptr != mRmClientCb) { + (mRmClientCb)(mClient); + } + } + }; + + sendMsg(new MsgRemoveClient(*this, client, rmClientCb)); +} + +void +LocAdapterBase::requestCapabilitiesCommand(LocationAPI* client) +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgRequestCapabilities : public LocMsg { + LocAdapterBase& mAdapter; + LocationAPI* mClient; + inline MsgRequestCapabilities(LocAdapterBase& adapter, + LocationAPI* client) : + LocMsg(), + mAdapter(adapter), + mClient(client) {} + inline virtual void proc() const { + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgRequestCapabilities(*this)); + return; + } + LocationCallbacks callbacks = mAdapter.getClientCallbacks(mClient); + if (callbacks.capabilitiesCb != nullptr) { + callbacks.capabilitiesCb(mAdapter.getCapabilities()); + } + } + }; + + sendMsg(new MsgRequestCapabilities(*this, client)); +} + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 8aa7112f..05b72dbe 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -51,8 +51,8 @@ inline bool operator ==(LocationSessionKey const& left, LocationSessionKey const inline bool operator !=(LocationSessionKey const& left, LocationSessionKey const& right) { return left.id != right.id || left.client != right.client; } -typedef std::map LocationSessionMap; -typedef std::map TrackingOptionsMap; + +typedef void (*removeClientCompleteCallback)(LocationAPI* client); namespace loc_core { @@ -62,6 +62,8 @@ class LocAdapterBase { private: static uint32_t mSessionIdCounter; const bool mIsMaster; + bool mIsEngineCapabilitiesKnown = false; + protected: LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; ContextBase* mContext; @@ -71,6 +73,20 @@ protected: inline LocAdapterBase(const MsgTask* msgTask) : mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL), mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} + + /* ==== CLIENT ========================================================================= */ + typedef std::map ClientDataMap; + ClientDataMap mClientData; + std::vector mPendingMsgs; // For temporal storage of msgs before Open is completed + /* ======== UTILITIES ================================================================== */ + void saveClient(LocationAPI* client, const LocationCallbacks& callbacks); + void eraseClient(LocationAPI* client); + LocationCallbacks getClientCallbacks(LocationAPI* client); + LocationCapabilitiesMask getCapabilities(); + void broadcastCapabilities(LocationCapabilitiesMask mask); + virtual void updateClientsEventMask(); + virtual void stopClientSessions(LocationAPI* client); + public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, @@ -126,12 +142,11 @@ public: return mIsMaster; } + inline bool isEngineCapabilitiesKnown() { return mIsEngineCapabilitiesKnown;} + inline void setEngineCapabilitiesKnown(bool value) { mIsEngineCapabilitiesKnown = value;} + virtual void handleEngineUpEvent(); virtual void handleEngineDownEvent(); - inline virtual void setPositionModeCommand(LocPosMode& posMode) { - - (void)posMode; - } virtual void reportPositionEvent(const UlpLocation& location, const GpsLocationExtended& locationExtended, enum loc_sess_status status, @@ -174,6 +189,28 @@ public: virtual bool reportGnssAdditionalSystemInfoEvent( GnssAdditionalSystemInfo& additionalSystemInfo); virtual void reportNfwNotificationEvent(GnssNfwNotification& notification); + + virtual void geofenceBreachEvent(size_t count, uint32_t* hwIds, Location& location, + GeofenceBreachType breachType, uint64_t timestamp); + virtual void geofenceStatusEvent(GeofenceStatusAvailable available); + + virtual void reportPositionEvent(UlpLocation &location, + GpsLocationExtended &locationExtended, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + + virtual void reportLocationsEvent(const Location* locations, size_t count, + BatchingMode batchingMode); + virtual void reportCompletedTripsEvent(uint32_t accumulated_distance); + virtual void reportBatchStatusChangeEvent(BatchingStatus batchStatus); + + /* ==== CLIENT ========================================================================= */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); + void removeClientCommand(LocationAPI* client, + removeClientCompleteCallback rmClientCb); + void requestCapabilitiesCommand(LocationAPI* client); + }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index fac81e77..3c67af2e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include namespace loc_core { @@ -197,8 +197,8 @@ bool LocApiBase::isInSession() } bool LocApiBase::needReport(const UlpLocation& ulpLocation, - enum loc_sess_status status, - LocPosTechMask techMask) + enum loc_sess_status status, + LocPosTechMask techMask) { bool reported = false; @@ -563,6 +563,41 @@ void LocApiBase::reportGnssSvTypeConfig(const GnssSvTypeConfig& config) TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssSvTypeConfigEvent(config)); } +void LocApiBase::geofenceBreach(size_t count, uint32_t* hwIds, Location& location, + GeofenceBreachType breachType, uint64_t timestamp) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->geofenceBreachEvent(count, hwIds, location, breachType, + timestamp)); +} + +void LocApiBase::geofenceStatus(GeofenceStatusAvailable available) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->geofenceStatusEvent(available)); +} + +void LocApiBase::reportDBTPosition(UlpLocation &location, GpsLocationExtended &locationExtended, + enum loc_sess_status status, LocPosTechMask loc_technology_mask) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportPositionEvent(location, locationExtended, status, + loc_technology_mask)); +} + +void LocApiBase::reportLocations(Location* locations, size_t count, BatchingMode batchingMode) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportLocationsEvent(locations, count, batchingMode)); +} + +void LocApiBase::reportCompletedTrips(uint32_t accumulated_distance) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportCompletedTripsEvent(accumulated_distance)); +} + +void LocApiBase::handleBatchStatusEvent(BatchingStatus batchStatus) +{ + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportBatchStatusChangeEvent(batchStatus)); +} + + enum loc_api_adapter_err LocApiBase:: open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) @@ -611,10 +646,6 @@ void LocApiBase:: atlCloseStatus(int /*handle*/, int /*is_succ*/) DEFAULT_IMPL() -void LocApiBase:: - setPositionMode(const LocPosMode& /*posMode*/) -DEFAULT_IMPL() - LocationError LocApiBase:: setServerSync(const char* /*url*/, int /*len*/, LocServerType /*type*/) DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) @@ -750,4 +781,101 @@ DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) LocationError LocApiBase::getGnssEnergyConsumed() DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + + +void LocApiBase::addGeofence(uint32_t /*clientId*/, const GeofenceOption& /*options*/, + const GeofenceInfo& /*info*/, + LocApiResponseData* /*adapterResponseData*/) +DEFAULT_IMPL() + +void LocApiBase::removeGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::pauseGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::resumeGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::modifyGeofence(uint32_t /*hwId*/, uint32_t /*clientId*/, + const GeofenceOption& /*options*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::startTimeBasedTracking(const TrackingOptions& /*options*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::stopTimeBasedTracking(LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::startDistanceBasedTracking(uint32_t /*sessionId*/, + const LocationOptions& /*options*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::stopDistanceBasedTracking(uint32_t /*sessionId*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::startBatching(uint32_t /*sessionId*/, const LocationOptions& /*options*/, + uint32_t /*accuracy*/, uint32_t /*timeout*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::stopBatching(uint32_t /*sessionId*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +LocationError LocApiBase::startOutdoorTripBatchingSync(uint32_t /*tripDistance*/, + uint32_t /*tripTbf*/, uint32_t /*timeout*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::startOutdoorTripBatching(uint32_t /*tripDistance*/, uint32_t /*tripTbf*/, + uint32_t /*timeout*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +void LocApiBase::reStartOutdoorTripBatching(uint32_t /*ongoingTripDistance*/, + uint32_t /*ongoingTripInterval*/, uint32_t /*batchingTimeout,*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +LocationError LocApiBase::stopOutdoorTripBatchingSync(bool /*deallocBatchBuffer*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::stopOutdoorTripBatching(bool /*deallocBatchBuffer*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +LocationError LocApiBase::getBatchedLocationsSync(size_t /*count*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::getBatchedLocations(size_t /*count*/, LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +LocationError LocApiBase::getBatchedTripLocationsSync(size_t /*count*/, + uint32_t /*accumulatedDistance*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::getBatchedTripLocations(size_t /*count*/, uint32_t /*accumulatedDistance*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + +LocationError LocApiBase::queryAccumulatedTripDistanceSync(uint32_t& /*accumulated_trip_distance*/, + uint32_t& /*numOfBatchedPositions*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +void LocApiBase::queryAccumulatedTripDistance( + LocApiResponseData* /*adapterResponseData*/) +DEFAULT_IMPL() + +void LocApiBase::setBatchSize(size_t /*size*/) +DEFAULT_IMPL() + +void LocApiBase::setTripBatchSize(size_t /*size*/) +DEFAULT_IMPL() + +void LocApiBase::addToCallQueue(LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() + + } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index f0bd5392..afdb83ce 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -40,6 +40,7 @@ namespace loc_core { class ContextBase; struct LocApiResponse; +template struct LocApiResponseData; int hexcode(char *hexstring, int string_size, const char *data, int data_size); @@ -191,75 +192,50 @@ public: void reportGnssAdditionalSystemInfo(GnssAdditionalSystemInfo& additionalSystemInfo); void sendNfwNotification(GnssNfwNotification& notification); - // downward calls - // All below functions are to be defined by adapter specific modules: - // RPC, QMI, etc. The default implementation is empty. + void geofenceBreach(size_t count, uint32_t* hwIds, Location& location, + GeofenceBreachType breachType, uint64_t timestamp); + void geofenceStatus(GeofenceStatusAvailable available); + void reportDBTPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + void reportLocations(Location* locations, size_t count, BatchingMode batchingMode); + void reportCompletedTrips(uint32_t accumulated_distance); + void handleBatchStatusEvent(BatchingStatus batchStatus); + // downward calls virtual void* getSibling(); virtual LocApiProxyBase* getLocApiProxy(); virtual void startFix(const LocPosMode& fixCriteria, LocApiResponse* adapterResponse); - virtual void - stopFix(LocApiResponse* adapterResponse); - virtual void - deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse); - - virtual void - injectPosition(double latitude, double longitude, float accuracy); - - virtual void - injectPosition(const GnssLocationInfoNotification &locationInfo, bool onDemandCpi=false); - - virtual void - injectPosition(const Location& location, bool onDemandCpi); - virtual void - setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); - - // // TODO:: called from izatapipds - virtual enum loc_api_adapter_err - setXtraData(char* data, int length); - - virtual void - atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, - AGpsBearerType bear, LocAGpsType agpsType, - LocApnTypeMask mask); - virtual void - atlCloseStatus(int handle, int is_succ); - virtual void - setPositionMode(const LocPosMode& posMode); - virtual LocationError - setServerSync(const char* url, int len, LocServerType type); - virtual LocationError - setServerSync(unsigned int ip, int port, LocServerType type); - virtual void - informNiResponse(GnssNiResponse userResponse, const void* passThroughData); + virtual void stopFix(LocApiResponse* adapterResponse); + virtual void deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse); + virtual void injectPosition(double latitude, double longitude, float accuracy); + virtual void injectPosition(const GnssLocationInfoNotification &locationInfo, + bool onDemandCpi=false); + virtual void injectPosition(const Location& location, bool onDemandCpi); + virtual void setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty); + virtual enum loc_api_adapter_err setXtraData(char* data, int length); + virtual void atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, + AGpsBearerType bear, LocAGpsType agpsType, LocApnTypeMask mask); + virtual void atlCloseStatus(int handle, int is_succ); + virtual LocationError setServerSync(const char* url, int len, LocServerType type); + virtual LocationError setServerSync(unsigned int ip, int port, LocServerType type); + virtual void informNiResponse(GnssNiResponse userResponse, const void* passThroughData); virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version); - virtual enum loc_api_adapter_err - setNMEATypesSync(uint32_t typesMask); + virtual enum loc_api_adapter_err setNMEATypesSync(uint32_t typesMask); virtual LocationError setLPPConfigSync(GnssConfigLppProfile profile); - virtual enum loc_api_adapter_err - setSensorPropertiesSync(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 - setSensorPerfControlConfigSync(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 setSensorPropertiesSync( + 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 setSensorPerfControlConfigSync(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, int gyroSamplesPerBatch, + int gyroBatchesPerSec, int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig); virtual LocationError - setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); + setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol); virtual LocationError setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask lppeCP); virtual LocationError setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask lppeUP); virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion); @@ -270,23 +246,11 @@ public: virtual void getWwanZppFix(); virtual void getBestAvailableZppFix(); - virtual void installAGpsCert(const LocDerEncodedCertificate* pData, - size_t length, - uint32_t slotBitMask); - inline virtual void setInSession(bool inSession) { - - (void)inSession; - } - - - void updateEvtMask(); - void updateNmeaMask(uint32_t mask); - + virtual void installAGpsCert(const LocDerEncodedCertificate* pData, size_t length, + uint32_t slotBitMask); virtual LocationError setGpsLockSync(GnssConfigGpsLock lock); virtual void requestForAidingData(GnssAidingDataSvMask svDataMask); - virtual LocationError setXtraVersionCheckSync(uint32_t check); - /* Requests for SV/Constellation Control */ virtual LocationError setBlacklistSvSync(const GnssSvIdConfig& config); virtual void setBlacklistSv(const GnssSvIdConfig& config); @@ -294,12 +258,55 @@ public: virtual void setConstellationControl(const GnssSvTypeConfig& config); virtual void getConstellationControl(); virtual void resetConstellationControl(); - - virtual LocationError setConstrainedTuncMode(bool enabled, - float tuncConstraint, - uint32_t energyBudget); + virtual LocationError setConstrainedTuncMode(bool enabled, float tuncConstraint, + uint32_t energyBudget); virtual LocationError setPositionAssistedClockEstimatorMode(bool enabled); virtual LocationError getGnssEnergyConsumed(); + + virtual void addGeofence(uint32_t clientId, const GeofenceOption& options, + const GeofenceInfo& info, LocApiResponseData* adapterResponseData); + virtual void removeGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse); + virtual void pauseGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse); + virtual void resumeGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse); + virtual void modifyGeofence(uint32_t hwId, uint32_t clientId, const GeofenceOption& options, + LocApiResponse* adapterResponse); + + virtual void startTimeBasedTracking(const TrackingOptions& options, + LocApiResponse* adapterResponse); + virtual void stopTimeBasedTracking(LocApiResponse* adapterResponse); + virtual void startDistanceBasedTracking(uint32_t sessionId, const LocationOptions& options, + LocApiResponse* adapterResponse); + virtual void stopDistanceBasedTracking(uint32_t sessionId, + LocApiResponse* adapterResponse = nullptr); + virtual void startBatching(uint32_t sessionId, const LocationOptions& options, + uint32_t accuracy, uint32_t timeout, LocApiResponse* adapterResponse); + virtual void stopBatching(uint32_t sessionId, LocApiResponse* adapterResponse); + virtual LocationError startOutdoorTripBatchingSync(uint32_t tripDistance, + uint32_t tripTbf, uint32_t timeout); + virtual void startOutdoorTripBatching(uint32_t tripDistance, + uint32_t tripTbf, uint32_t timeout, LocApiResponse* adapterResponse); + virtual void reStartOutdoorTripBatching(uint32_t ongoingTripDistance, + uint32_t ongoingTripInterval, uint32_t batchingTimeout, + LocApiResponse* adapterResponse); + virtual LocationError stopOutdoorTripBatchingSync(bool deallocBatchBuffer = true); + virtual void stopOutdoorTripBatching(bool deallocBatchBuffer = true, + LocApiResponse* adapterResponse = nullptr); + virtual LocationError getBatchedLocationsSync(size_t count); + virtual void getBatchedLocations(size_t count, LocApiResponse* adapterResponse); + virtual LocationError getBatchedTripLocationsSync(size_t count, uint32_t accumulatedDistance); + virtual void getBatchedTripLocations(size_t count, uint32_t accumulatedDistance, + LocApiResponse* adapterResponse); + virtual LocationError queryAccumulatedTripDistanceSync(uint32_t &accumulated_trip_distance, + uint32_t &numOfBatchedPositions); + virtual void queryAccumulatedTripDistance( + LocApiResponseData* adapterResponseData); + virtual void setBatchSize(size_t size); + virtual void setTripBatchSize(size_t size); + virtual void addToCallQueue(LocApiResponse* adapterResponse); + + void updateEvtMask(); + void updateNmeaMask(uint32_t mask); + }; typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, diff --git a/core/LocContext.cpp b/core/LocContext.cpp new file mode 100644 index 00000000..18d3f2d1 --- /dev/null +++ b/core/LocContext.cpp @@ -0,0 +1,98 @@ +/* Copyright (c) 2011-2014, 2016-2019 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_NDEBUG 0 +#define LOG_TAG "LocSvc_Ctx" + +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +const MsgTask* LocContext::mMsgTask = NULL; +ContextBase* LocContext::mContext = NULL; +// the name must be shorter than 15 chars +const char* LocContext::mLocationHalName = "Loc_hal_worker"; +#ifndef USE_GLIB +const char* LocContext::mLBSLibName = "liblbs_core.so"; +#else +const char* LocContext::mLBSLibName = "liblbs_core.so.1"; +#endif + +pthread_mutex_t LocContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; + +const MsgTask* LocContext::getMsgTask(LocThread::tCreate tCreator, + const char* name, bool joinable) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tCreator, name, joinable); + } + return mMsgTask; +} + +inline +const MsgTask* LocContext::getMsgTask(const char* name, bool joinable) { + return getMsgTask((LocThread::tCreate)NULL, name, joinable); +} + +ContextBase* LocContext::getLocContext(LocThread::tCreate tCreator, + LocMsg* firstMsg, const char* name, bool joinable) +{ + pthread_mutex_lock(&LocContext::mGetLocContextMutex); + LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); + if (NULL == mContext) { + LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); + mContext = new LocContext(msgTask); + } + pthread_mutex_unlock(&LocContext::mGetLocContextMutex); + + if (firstMsg) { + mContext->sendMsg(firstMsg); + } + + return mContext; +} + +void LocContext :: injectFeatureConfig(ContextBase *curContext) +{ + LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", + __func__, __LINE__, ((LocContext *)curContext)->mLBSProxy); + ((LocContext *)curContext)->mLBSProxy->injectFeatureConfig(curContext); +} + +LocContext::LocContext(const MsgTask* msgTask) : + ContextBase(msgTask, 0, mLBSLibName) +{ +} + +} diff --git a/core/LocDualContext.h b/core/LocContext.h similarity index 66% rename from core/LocDualContext.h rename to core/LocContext.h index edfbfb7d..fb7d009d 100644 --- a/core/LocDualContext.h +++ b/core/LocContext.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, 2017-2019 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 @@ -26,8 +26,8 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -#ifndef __LOC_ENG_CONTEXT__ -#define __LOC_ENG_CONTEXT__ +#ifndef __LOC_CONTEXT__ +#define __LOC_CONTEXT__ #include #include @@ -36,35 +36,26 @@ namespace loc_core { -class LocDualContext : public ContextBase { +class LocContext : public ContextBase { static const MsgTask* mMsgTask; - static ContextBase* mFgContext; - static ContextBase* mBgContext; + static ContextBase* mContext; 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() {} + LocContext(const MsgTask* msgTask); + inline virtual ~LocContext() {} 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, + static ContextBase* getLocContext(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); + inline static ContextBase* getLocContext(const char* name, bool joinable = true) { + return getLocContext(NULL, NULL, name, joinable); } static void injectFeatureConfig(ContextBase *context); @@ -72,4 +63,4 @@ public: } -#endif //__LOC_ENG_CONTEXT__ +#endif //__LOC_CONTEXT__ diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp deleted file mode 100644 index 9851d610..00000000 --- a/core/LocDualContext.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (c) 2011-2014, 2016-2017 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_NDEBUG 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_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; -// 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); - } - 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); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - - if (firstMsg) { - mBgContext->sendMsg(firstMsg); - } - - return mBgContext; -} - -void LocDualContext :: injectFeatureConfig(ContextBase *curContext) -{ - LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", - __func__, __LINE__, ((LocDualContext *)curContext)->mLBSProxy); - ((LocDualContext *)curContext)->mLBSProxy->injectFeatureConfig(curContext); -} - -LocDualContext::LocDualContext(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - ContextBase(msgTask, exMask, mLBSLibName) -{ -} - -} diff --git a/core/Makefile.am b/core/Makefile.am index 53059e41..ffd93579 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -15,7 +15,7 @@ libloc_core_la_h_sources = \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ - LocDualContext.h \ + LocContext.h \ LBSProxyBase.h \ loc_core_log.h \ LocAdapterProxyBase.h \ @@ -34,7 +34,7 @@ libloc_core_la_c_sources = \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ - LocDualContext.cpp \ + LocContext.cpp \ loc_core_log.cpp \ data-items/DataItemsFactoryProxy.cpp \ SystemStatusOsObserver.cpp \ diff --git a/etc/Android.mk b/etc/Android.mk index d9eb0e10..22ca2f71 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -1,12 +1,21 @@ LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) +include $(CLEAR_VARS) LOCAL_MODULE := gps.conf +LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/ LOCAL_SRC_FILES := gps.conf - +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := flp.conf +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := flp.conf +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) include $(BUILD_PREBUILT) diff --git a/etc/flp.conf b/etc/flp.conf new file mode 100644 index 00000000..65d54d38 --- /dev/null +++ b/etc/flp.conf @@ -0,0 +1,60 @@ +################################### +##### FLP settings ##### +################################### + +################################### +# FLP BATCH 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 OUTDOOR TRIP BATCH SIZE +################################### +# The number of batched locations +# requested to modem for outdoor +# trip batching. 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 +# trip batch size defined as 600 as below. +OUTDOOR_TRIP_BATCH_SIZE=600 + +################################### +# 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 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 + +#################################### +# By default if network fixes are not sensor assisted +# these fixes must be dropped. This parameter adds an exception +# for targets where there is no PDR and we still want to +# report out network fixes +# 0: MUST NOT ALLOW NETWORK FIXES +# 1: ALLOW NETWORK FIXES +#################################### +ALLOW_NETWORK_FIXES = 0 diff --git a/etc/gps.conf b/etc/gps.conf index e5be3858..82a7b3ca 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -54,9 +54,8 @@ SUPL_VER=0x10000 # MSB = 0x02 # MSA = 0x04 # ON_DEMAND_TIME = 0x10 -# GEOFENCE = 0x20 -# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE -CAPABILITIES=0x37 +# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING +CAPABILITIES=0x17 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions diff --git a/geofence/Android.mk b/geofence/Android.mk new file mode 100644 index 00000000..6e9e8706 --- /dev/null +++ b/geofence/Android.mk @@ -0,0 +1,36 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libgeofencing +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES:= \ + GeofenceAdapter.cpp \ + location_geofence.cpp + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + liblog \ + libloc_core \ + liblbs_core + +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + libloc_core_headers \ + libloc_pla_headers \ + liblocation_api_headers + +LOCAL_PRELINK_MODULE := false +LOCAL_CFLAGS += $(GNSS_CFLAGS) +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID +endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE + diff --git a/geofence/GeofenceAdapter.cpp b/geofence/GeofenceAdapter.cpp new file mode 100644 index 00000000..b8746fbc --- /dev/null +++ b/geofence/GeofenceAdapter.cpp @@ -0,0 +1,867 @@ +/* Copyright (c) 2013-2019, 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_TAG "LocSvc_GeofenceAdapter" + +#include +#include "loc_log.h" +#include +#include + +using namespace loc_core; + +GeofenceAdapter::GeofenceAdapter() : + LocAdapterBase(0, + LocContext::getLocContext( + NULL, + NULL, + LocContext::mLocationHalName, + false), + true /*isMaster*/) +{ + LOC_LOGD("%s]: Constructor", __func__); +} + +void +GeofenceAdapter::stopClientSessions(LocationAPI* client) +{ + LOC_LOGD("%s]: client %p", __func__, client); + + + for (auto it = mGeofenceIds.begin(); it != mGeofenceIds.end();) { + uint32_t hwId = it->second; + GeofenceKey key(it->first); + if (client == key.client) { + it = mGeofenceIds.erase(it); + mLocApi->removeGeofence(hwId, key.id, + new LocApiResponse(*getContext(), + [this, hwId] (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + auto it2 = mGeofences.find(hwId); + if (it2 != mGeofences.end()) { + mGeofences.erase(it2); + } else { + LOC_LOGE("%s]:geofence item to erase not found. hwId %u", __func__, hwId); + } + } + })); + continue; + } + ++it; // increment only when not erasing an iterator + } + +} + +void +GeofenceAdapter::updateClientsEventMask() +{ + LOC_API_ADAPTER_EVENT_MASK_T mask = 0; + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (it->second.geofenceBreachCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_BATCHED_GENFENCE_BREACH_REPORT; + mask |= LOC_API_ADAPTER_BIT_REPORT_GENFENCE_DWELL; + } + if (it->second.geofenceStatusCb != nullptr) { + mask |= LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT; + } + } + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); +} + +LocationError +GeofenceAdapter::getHwIdFromClient(LocationAPI* client, uint32_t clientId, uint32_t& hwId) +{ + GeofenceKey key(client, clientId); + auto it = mGeofenceIds.find(key); + if (it != mGeofenceIds.end()) { + hwId = it->second; + return LOCATION_ERROR_SUCCESS; + } + return LOCATION_ERROR_ID_UNKNOWN; +} + +LocationError +GeofenceAdapter::getGeofenceKeyFromHwId(uint32_t hwId, GeofenceKey& key) +{ + auto it = mGeofences.find(hwId); + if (it != mGeofences.end()) { + key = it->second.key; + return LOCATION_ERROR_SUCCESS; + } + return LOCATION_ERROR_ID_UNKNOWN; +} + +void +GeofenceAdapter::handleEngineUpEvent() +{ + struct MsgSSREvent : public LocMsg { + GeofenceAdapter& mAdapter; + inline MsgSSREvent(GeofenceAdapter& adapter) : + LocMsg(), + mAdapter(adapter) {} + virtual void proc() const { + mAdapter.setEngineCapabilitiesKnown(true); + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); + mAdapter.restartGeofences(); + for (auto msg: mAdapter.mPendingMsgs) { + mAdapter.sendMsg(msg); + } + mAdapter.mPendingMsgs.clear(); + } + }; + + sendMsg(new MsgSSREvent(*this)); +} + +void +GeofenceAdapter::restartGeofences() +{ + if (mGeofences.empty()) { + return; + } + + GeofencesMap oldGeofences(mGeofences); + mGeofences.clear(); + mGeofenceIds.clear(); + + for (auto it = oldGeofences.begin(); it != oldGeofences.end(); it++) { + GeofenceObject object = it->second; + GeofenceOption options = {sizeof(GeofenceOption), + object.breachMask, + object.responsiveness, + object.dwellTime}; + GeofenceInfo info = {sizeof(GeofenceInfo), + object.latitude, + object.longitude, + object.radius}; + mLocApi->addGeofence(object.key.id, + options, + info, + new LocApiResponseData(*getContext(), + [this, object, options, info] (LocationError err, LocApiGeofenceData data) { + if (LOCATION_ERROR_SUCCESS == err) { + if (true == object.paused) { + mLocApi->pauseGeofence(data.hwId, object.key.id, + new LocApiResponse(*getContext(), [] (LocationError err ) {})); + } + saveGeofenceItem(object.key.client, object.key.id, data.hwId, options, info); + } + })); + } +} + +void +GeofenceAdapter::reportResponse(LocationAPI* client, size_t count, LocationError* errs, + uint32_t* ids) +{ + IF_LOC_LOGD { + std::string idsString = "["; + std::string errsString = "["; + if (NULL != ids && NULL != errs) { + for (size_t i=0; i < count; ++i) { + idsString += std::to_string(ids[i]) + " "; + errsString += std::to_string(errs[i]) + " "; + } + } + idsString += "]"; + errsString += "]"; + + LOC_LOGD("%s]: client %p ids %s errs %s", + __func__, client, idsString.c_str(), errsString.c_str()); + } + + auto it = mClientData.find(client); + if (it != mClientData.end() && it->second.collectiveResponseCb != nullptr) { + it->second.collectiveResponseCb(count, errs, ids); + } else { + LOC_LOGE("%s]: client %p response not found in info", __func__, client); + } +} + +uint32_t* +GeofenceAdapter::addGeofencesCommand(LocationAPI* client, size_t count, GeofenceOption* options, + GeofenceInfo* infos) +{ + LOC_LOGD("%s]: client %p count %zu", __func__, client, count); + + struct MsgAddGeofences : public LocMsg { + GeofenceAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + size_t mCount; + uint32_t* mIds; + GeofenceOption* mOptions; + GeofenceInfo* mInfos; + inline MsgAddGeofences(GeofenceAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + size_t count, + uint32_t* ids, + GeofenceOption* options, + GeofenceInfo* infos) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mCount(count), + mIds(ids), + mOptions(options), + mInfos(infos) {} + inline virtual void proc() const { + LocationError* errs = new LocationError[mCount]; + if (nullptr == errs) { + LOC_LOGE("%s]: new failed to allocate errs", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + if (NULL == mIds || NULL == mOptions || NULL == mInfos) { + errs[i] = LOCATION_ERROR_INVALID_PARAMETER; + } else { + mApi.addGeofence(mIds[i], + mOptions[i], + mInfos[i], + new LocApiResponseData(*mAdapter.getContext(), + [&mAdapter = mAdapter, mOptions = mOptions, mClient = mClient, + mCount = mCount, mIds = mIds, mInfos = mInfos, errs, i] + (LocationError err, LocApiGeofenceData data) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.saveGeofenceItem(mClient, + mIds[i], + data.hwId, + mOptions[i], + mInfos[i]); + } + errs[i] = err; + + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + delete[] mOptions; + delete[] mInfos; + } + })); + } + } + } + }; + + if (0 == count) { + return NULL; + } + uint32_t* ids = new uint32_t[count]; + if (nullptr == ids) { + LOC_LOGE("%s]: new failed to allocate ids", __func__); + return NULL; + } + if (NULL != ids) { + for (size_t i=0; i < count; ++i) { + ids[i] = generateSessionId(); + } + } + GeofenceOption* optionsCopy; + if (options == NULL) { + optionsCopy = NULL; + } else { + optionsCopy = new GeofenceOption[count]; + if (nullptr == optionsCopy) { + LOC_LOGE("%s]: new failed to allocate optionsCopy", __func__); + return NULL; + } + COPY_IF_NOT_NULL(optionsCopy, options, count); + } + GeofenceInfo* infosCopy; + if (infos == NULL) { + infosCopy = NULL; + } else { + infosCopy = new GeofenceInfo[count]; + if (nullptr == infosCopy) { + LOC_LOGE("%s]: new failed to allocate infosCopy", __func__); + return NULL; + } + COPY_IF_NOT_NULL(infosCopy, infos, count); + } + + sendMsg(new MsgAddGeofences(*this, *mLocApi, client, count, ids, optionsCopy, infosCopy)); + return ids; +} + +void +GeofenceAdapter::removeGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids) +{ + LOC_LOGD("%s]: client %p count %zu", __func__, client, count); + + struct MsgRemoveGeofences : public LocMsg { + GeofenceAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + size_t mCount; + uint32_t* mIds; + inline MsgRemoveGeofences(GeofenceAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + size_t count, + uint32_t* ids) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mCount(count), + mIds(ids) {} + inline virtual void proc() const { + LocationError* errs = new LocationError[mCount]; + if (nullptr == errs) { + LOC_LOGE("%s]: new failed to allocate errs", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + mApi.addToCallQueue(new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + &mApi = mApi, errs, i] (LocationError err ) { + uint32_t hwId = 0; + errs[i] = mAdapter.getHwIdFromClient(mClient, mIds[i], hwId); + if (LOCATION_ERROR_SUCCESS == errs[i]) { + mApi.removeGeofence(hwId, mIds[i], + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + hwId, errs, i] (LocationError err ) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.removeGeofenceItem(hwId); + } + errs[i] = err; + + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + })); + } else { + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + } + })); + } + } + }; + + if (0 == count) { + return; + } + uint32_t* idsCopy = new uint32_t[count]; + if (nullptr == idsCopy) { + LOC_LOGE("%s]: new failed to allocate idsCopy", __func__); + return; + } + COPY_IF_NOT_NULL(idsCopy, ids, count); + sendMsg(new MsgRemoveGeofences(*this, *mLocApi, client, count, idsCopy)); +} + +void +GeofenceAdapter::pauseGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids) +{ + LOC_LOGD("%s]: client %p count %zu", __func__, client, count); + + struct MsgPauseGeofences : public LocMsg { + GeofenceAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + size_t mCount; + uint32_t* mIds; + inline MsgPauseGeofences(GeofenceAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + size_t count, + uint32_t* ids) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mCount(count), + mIds(ids) {} + inline virtual void proc() const { + LocationError* errs = new LocationError[mCount]; + if (nullptr == errs) { + LOC_LOGE("%s]: new failed to allocate errs", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + mApi.addToCallQueue(new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + &mApi = mApi, errs, i] (LocationError err ) { + uint32_t hwId = 0; + errs[i] = mAdapter.getHwIdFromClient(mClient, mIds[i], hwId); + if (LOCATION_ERROR_SUCCESS == errs[i]) { + mApi.pauseGeofence(hwId, mIds[i], new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + hwId, errs, i] (LocationError err ) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.pauseGeofenceItem(hwId); + } + errs[i] = err; + + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + })); + } else { + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + } + })); + } + } + }; + + if (0 == count) { + return; + } + uint32_t* idsCopy = new uint32_t[count]; + if (nullptr == idsCopy) { + LOC_LOGE("%s]: new failed to allocate idsCopy", __func__); + return; + } + COPY_IF_NOT_NULL(idsCopy, ids, count); + sendMsg(new MsgPauseGeofences(*this, *mLocApi, client, count, idsCopy)); +} + +void +GeofenceAdapter::resumeGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids) +{ + LOC_LOGD("%s]: client %p count %zu", __func__, client, count); + + struct MsgResumeGeofences : public LocMsg { + GeofenceAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + size_t mCount; + uint32_t* mIds; + inline MsgResumeGeofences(GeofenceAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + size_t count, + uint32_t* ids) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mCount(count), + mIds(ids) {} + inline virtual void proc() const { + LocationError* errs = new LocationError[mCount]; + if (nullptr == errs) { + LOC_LOGE("%s]: new failed to allocate errs", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + mApi.addToCallQueue(new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + &mApi = mApi, errs, i] (LocationError err ) { + uint32_t hwId = 0; + errs[i] = mAdapter.getHwIdFromClient(mClient, mIds[i], hwId); + if (LOCATION_ERROR_SUCCESS == errs[i]) { + mApi.resumeGeofence(hwId, mIds[i], + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, hwId, + errs, mIds = mIds, i] (LocationError err ) { + if (LOCATION_ERROR_SUCCESS == err) { + errs[i] = err; + + mAdapter.resumeGeofenceItem(hwId); + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + } + })); + } else { + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + } + } + })); + } + } + }; + + if (0 == count) { + return; + } + uint32_t* idsCopy = new uint32_t[count]; + if (nullptr == idsCopy) { + LOC_LOGE("%s]: new failed to allocate idsCopy", __func__); + return; + } + COPY_IF_NOT_NULL(idsCopy, ids, count); + sendMsg(new MsgResumeGeofences(*this, *mLocApi, client, count, idsCopy)); +} + +void +GeofenceAdapter::modifyGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids, + GeofenceOption* options) +{ + LOC_LOGD("%s]: client %p count %zu", __func__, client, count); + + struct MsgModifyGeofences : public LocMsg { + GeofenceAdapter& mAdapter; + LocApiBase& mApi; + LocationAPI* mClient; + size_t mCount; + uint32_t* mIds; + GeofenceOption* mOptions; + inline MsgModifyGeofences(GeofenceAdapter& adapter, + LocApiBase& api, + LocationAPI* client, + size_t count, + uint32_t* ids, + GeofenceOption* options) : + LocMsg(), + mAdapter(adapter), + mApi(api), + mClient(client), + mCount(count), + mIds(ids), + mOptions(options) {} + inline virtual void proc() const { + LocationError* errs = new LocationError[mCount]; + if (nullptr == errs) { + LOC_LOGE("%s]: new failed to allocate errs", __func__); + return; + } + for (size_t i=0; i < mCount; ++i) { + if (NULL == mIds || NULL == mOptions) { + errs[i] = LOCATION_ERROR_INVALID_PARAMETER; + } else { + mApi.addToCallQueue(new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, mIds = mIds, + &mApi = mApi, mOptions = mOptions, errs, i] (LocationError err ) { + uint32_t hwId = 0; + errs[i] = mAdapter.getHwIdFromClient(mClient, mIds[i], hwId); + if (LOCATION_ERROR_SUCCESS == errs[i]) { + mApi.modifyGeofence(hwId, mIds[i], mOptions[i], + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, + mIds = mIds, mOptions = mOptions, hwId, errs, i] + (LocationError err ) { + if (LOCATION_ERROR_SUCCESS == err) { + errs[i] = err; + + mAdapter.modifyGeofenceItem(hwId, mOptions[i]); + } + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + delete[] mOptions; + } + })); + } else { + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + delete[] mOptions; + } + } + })); + } + } + } + }; + + if (0 == count) { + return; + } + uint32_t* idsCopy = new uint32_t[count]; + if (nullptr == idsCopy) { + LOC_LOGE("%s]: new failed to allocate idsCopy", __func__); + return; + } + COPY_IF_NOT_NULL(idsCopy, ids, count); + GeofenceOption* optionsCopy; + if (options == NULL) { + optionsCopy = NULL; + } else { + optionsCopy = new GeofenceOption[count]; + if (nullptr == optionsCopy) { + LOC_LOGE("%s]: new failed to allocate optionsCopy", __func__); + return; + } + COPY_IF_NOT_NULL(optionsCopy, options, count); + } + + sendMsg(new MsgModifyGeofences(*this, *mLocApi, client, count, idsCopy, optionsCopy)); +} + +void +GeofenceAdapter::saveGeofenceItem(LocationAPI* client, uint32_t clientId, uint32_t hwId, + const GeofenceOption& options, const GeofenceInfo& info) +{ + LOC_LOGD("%s]: hwId %u client %p clientId %u", __func__, hwId, client, clientId); + GeofenceKey key(client, clientId); + GeofenceObject object = {key, + options.breachTypeMask, + options.responsiveness, + options.dwellTime, + info.latitude, + info.longitude, + info.radius, + false}; + mGeofences[hwId] = object; + mGeofenceIds[key] = hwId; + dump(); +} + +void +GeofenceAdapter::removeGeofenceItem(uint32_t hwId) +{ + GeofenceKey key; + LocationError err = getGeofenceKeyFromHwId(hwId, key); + if (LOCATION_ERROR_SUCCESS != err) { + LOC_LOGE("%s]: can not find the key for hwId %u", __func__, hwId); + } else { + auto it1 = mGeofenceIds.find(key); + if (it1 != mGeofenceIds.end()) { + mGeofenceIds.erase(it1); + + auto it2 = mGeofences.find(hwId); + if (it2 != mGeofences.end()) { + mGeofences.erase(it2); + dump(); + } else { + LOC_LOGE("%s]:geofence item to erase not found. hwId %u", __func__, hwId); + } + } else { + LOC_LOGE("%s]: geofence item to erase not found. hwId %u", __func__, hwId); + } + } +} + +void +GeofenceAdapter::pauseGeofenceItem(uint32_t hwId) +{ + auto it = mGeofences.find(hwId); + if (it != mGeofences.end()) { + it->second.paused = true; + dump(); + } else { + LOC_LOGE("%s]: geofence item to pause not found. hwId %u", __func__, hwId); + } +} + +void +GeofenceAdapter::resumeGeofenceItem(uint32_t hwId) +{ + auto it = mGeofences.find(hwId); + if (it != mGeofences.end()) { + it->second.paused = false; + dump(); + } else { + LOC_LOGE("%s]: geofence item to resume not found. hwId %u", __func__, hwId); + } +} + +void +GeofenceAdapter::modifyGeofenceItem(uint32_t hwId, const GeofenceOption& options) +{ + auto it = mGeofences.find(hwId); + if (it != mGeofences.end()) { + it->second.breachMask = options.breachTypeMask; + it->second.responsiveness = options.responsiveness; + it->second.dwellTime = options.dwellTime; + dump(); + } else { + LOC_LOGE("%s]: geofence item to modify not found. hwId %u", __func__, hwId); + } +} + + +void +GeofenceAdapter::geofenceBreachEvent(size_t count, uint32_t* hwIds, Location& location, + GeofenceBreachType breachType, uint64_t timestamp) +{ + + IF_LOC_LOGD { + std::string idsString = "["; + if (NULL != hwIds) { + for (size_t i=0; i < count; ++i) { + idsString += std::to_string(hwIds[i]) + " "; + } + } + idsString += "]"; + LOC_LOGD("%s]: breachType %u count %zu ids %s", + __func__, breachType, count, idsString.c_str()); + } + + if (0 == count || NULL == hwIds) + return; + + struct MsgGeofenceBreach : public LocMsg { + GeofenceAdapter& mAdapter; + size_t mCount; + uint32_t* mHwIds; + Location mLocation; + GeofenceBreachType mBreachType; + uint64_t mTimestamp; + inline MsgGeofenceBreach(GeofenceAdapter& adapter, + size_t count, + uint32_t* hwIds, + Location& location, + GeofenceBreachType breachType, + uint64_t timestamp) : + LocMsg(), + mAdapter(adapter), + mCount(count), + mHwIds(new uint32_t[count]), + mLocation(location), + mBreachType(breachType), + mTimestamp(timestamp) + { + if (nullptr == mHwIds) { + LOC_LOGE("%s]: new failed to allocate mHwIds", __func__); + return; + } + COPY_IF_NOT_NULL(mHwIds, hwIds, mCount); + } + inline virtual ~MsgGeofenceBreach() { + delete[] mHwIds; + } + inline virtual void proc() const { + mAdapter.geofenceBreach(mCount, mHwIds, mLocation, mBreachType, mTimestamp); + } + }; + + sendMsg(new MsgGeofenceBreach(*this, count, hwIds, location, breachType, timestamp)); + +} + +void +GeofenceAdapter::geofenceBreach(size_t count, uint32_t* hwIds, const Location& location, + GeofenceBreachType breachType, uint64_t timestamp) +{ + + for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { + uint32_t* clientIds = new uint32_t[count]; + if (nullptr == clientIds) { + return; + } + uint32_t index = 0; + for (size_t i=0; i < count; ++i) { + GeofenceKey key; + LocationError err = getGeofenceKeyFromHwId(hwIds[i], key); + if (LOCATION_ERROR_SUCCESS == err) { + if (key.client == it->first) { + clientIds[index++] = key.id; + } + } + } + if (index > 0 && it->second.geofenceBreachCb != nullptr) { + GeofenceBreachNotification notify = {sizeof(GeofenceBreachNotification), + index, + clientIds, + location, + breachType, + timestamp}; + + it->second.geofenceBreachCb(notify); + } + delete[] clientIds; + } +} + +void +GeofenceAdapter::geofenceStatusEvent(GeofenceStatusAvailable available) +{ + LOC_LOGD("%s]: available %u ", __func__, available); + + struct MsgGeofenceStatus : public LocMsg { + GeofenceAdapter& mAdapter; + GeofenceStatusAvailable mAvailable; + inline MsgGeofenceStatus(GeofenceAdapter& adapter, + GeofenceStatusAvailable available) : + LocMsg(), + mAdapter(adapter), + mAvailable(available) {} + inline virtual void proc() const { + mAdapter.geofenceStatus(mAvailable); + } + }; + + sendMsg(new MsgGeofenceStatus(*this, available)); +} + +void +GeofenceAdapter::geofenceStatus(GeofenceStatusAvailable available) +{ + for (auto it = mClientData.begin(); it != mClientData.end(); ++it) { + if (it->second.geofenceStatusCb != nullptr) { + GeofenceStatusNotification notify = {sizeof(GeofenceStatusNotification), + available, + LOCATION_TECHNOLOGY_TYPE_GNSS}; + it->second.geofenceStatusCb(notify); + } + } +} + +void +GeofenceAdapter::dump() +{ + IF_LOC_LOGV { + LOC_LOGV( + "HAL | hwId | mask | respon | latitude | longitude | radius | paused | Id | client"); + for (auto it = mGeofences.begin(); it != mGeofences.end(); ++it) { + uint32_t hwId = it->first; + GeofenceObject object = it->second; + LOC_LOGV(" | %5u | %4u | %6u | %8.2f | %9.2f | %6.2f | %6u | %04x | %p ", + hwId, object.breachMask, object.responsiveness, + object.latitude, object.longitude, object.radius, + object.paused, object.key.id, object.key.client); + } + } +} + diff --git a/geofence/GeofenceAdapter.h b/geofence/GeofenceAdapter.h new file mode 100644 index 00000000..38f48230 --- /dev/null +++ b/geofence/GeofenceAdapter.h @@ -0,0 +1,136 @@ +/* Copyright (c) 2013-2019, 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 GEOFENCE_ADAPTER_H +#define GEOFENCE_ADAPTER_H + +#include +#include +#include +#include + +using namespace loc_core; + +#define COPY_IF_NOT_NULL(dest, src, len) do { \ + if (NULL!=dest && NULL!=src) { \ + for (size_t i=0; i GeofencesMap; //map of hwId to GeofenceObject +typedef std::map GeofenceIdMap; //map of GeofenceKey to hwId + +class GeofenceAdapter : public LocAdapterBase { + + /* ==== GEOFENCES ====================================================================== */ + GeofencesMap mGeofences; //map hwId to GeofenceObject + GeofenceIdMap mGeofenceIds; //map of GeofenceKey to hwId + +protected: + + /* ==== CLIENT ========================================================================= */ + virtual void updateClientsEventMask(); + virtual void stopClientSessions(LocationAPI* client); + +public: + + GeofenceAdapter(); + virtual ~GeofenceAdapter() {} + + /* ==== SSR ============================================================================ */ + /* ======== EVENTS ====(Called from QMI Thread)========================================= */ + virtual void handleEngineUpEvent(); + /* ======== UTILITIES ================================================================== */ + void restartGeofences(); + + /* ==== GEOFENCES ====================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + uint32_t* addGeofencesCommand(LocationAPI* client, size_t count, + GeofenceOption* options, GeofenceInfo* info); + void removeGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids); + void pauseGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids); + void resumeGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids); + void modifyGeofencesCommand(LocationAPI* client, size_t count, uint32_t* ids, + GeofenceOption* options); + /* ======== RESPONSES ================================================================== */ + void reportResponse(LocationAPI* client, size_t count, LocationError* errs, uint32_t* ids); + /* ======== UTILITIES ================================================================== */ + void saveGeofenceItem(LocationAPI* client, + uint32_t clientId, + uint32_t hwId, + const GeofenceOption& options, + const GeofenceInfo& info); + void removeGeofenceItem(uint32_t hwId); + void pauseGeofenceItem(uint32_t hwId); + void resumeGeofenceItem(uint32_t hwId); + void modifyGeofenceItem(uint32_t hwId, const GeofenceOption& options); + LocationError getHwIdFromClient(LocationAPI* client, uint32_t clientId, uint32_t& hwId); + LocationError getGeofenceKeyFromHwId(uint32_t hwId, GeofenceKey& key); + void dump(); + + /* ==== REPORTS ======================================================================== */ + /* ======== EVENTS ====(Called from QMI Thread)========================================= */ + void geofenceBreachEvent(size_t count, uint32_t* hwIds, Location& location, + GeofenceBreachType breachType, uint64_t timestamp); + void geofenceStatusEvent(GeofenceStatusAvailable available); + /* ======== UTILITIES ================================================================== */ + void geofenceBreach(size_t count, uint32_t* hwIds, const Location& location, + GeofenceBreachType breachType, uint64_t timestamp); + void geofenceStatus(GeofenceStatusAvailable available); +}; + +#endif /* GEOFENCE_ADAPTER_H */ diff --git a/geofence/Makefile.am b/geofence/Makefile.am new file mode 100644 index 00000000..61883ff2 --- /dev/null +++ b/geofence/Makefile.am @@ -0,0 +1,50 @@ +AM_CFLAGS = -Wundef \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ + ${GPSUTILS_CFLAGS} \ + ${LOCCORE_CFLAGS} \ + $(LOCPLA_CFLAGS) \ + -D__func__=__PRETTY_FUNCTION__ \ + -std=c++1y + +AM_CPPFLAGS = $(AM_CFLAGS) + +ACLOCAL_AMFLAGS = -I m4 + +requiredlibs = \ + ${LOCCORE_LIBS} \ + $(GPSUTILS_LIBS) \ + -llog + +h_sources = \ + GeofenceAdapter.h + +c_sources = \ + GeofenceAdapter.cpp \ + location_geofence.cpp + +libgeofencing_la_SOURCES = $(c_sources) +if USE_GLIB +libgeofencing_la_CFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) +libgeofencing_la_CPPFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) $(AM_CPPFLAGS) +libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs @GLIB_LIBS@ $(requiredlibs) -shared -version-info 1:0:0 +libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ @GLIB_LIBS@ +else +libgeofencing_la_CFLAGS = $(AM_CFLAGS) +libgeofencing_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs $(requiredlibs) -shared -version-info 1:0:0 +libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ +endif + +library_include_HEADERS = $(h_sources) + +library_includedir = $(pkgincludedir) + +lib_LTLIBRARIES = libgeofencing.la + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = location-geofence.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/geofence/configure.ac b/geofence/configure.ac new file mode 100644 index 00000000..8e3cd819 --- /dev/null +++ b/geofence/configure.ac @@ -0,0 +1,72 @@ +AC_PREREQ(2.61) +AC_INIT([location-geofence], 1.0.0) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +# Check 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 + +# Check for libraries +PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) +AC_SUBST([GPSUTILS_CFLAGS]) +AC_SUBST([GPSUTILS_LIBS]) + +PKG_CHECK_MODULES([LOCCORE], [loc-core]) +AC_SUBST([LOCCORE_CFLAGS]) +AC_SUBST([LOCCORE_LIBS]) + +AS_CASE([$host], + [arm*], [ARM=yes], + [ARM=no] +) + +AC_ARG_WITH([locpla_includes], + AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], + [specify the path to locpla-includes in loc-pla_git.bb]), + [locpla_incdir=$withval], + with_locpla_includes=no) + +if test "x$with_locpla_includes" != "xno"; then + AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_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_SUBST([CFLAGS]) +AC_SUBST([CPPFLAGS]) +AC_SUBST([LIBS]) + +AC_CONFIG_FILES([ \ + Makefile \ + location-geofence.pc + ]) + +AC_OUTPUT diff --git a/geofence/location-geofence.pc.in b/geofence/location-geofence.pc.in new file mode 100644 index 00000000..6a0781f2 --- /dev/null +++ b/geofence/location-geofence.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: location-geofence +Description: QTI GPS Geofence +Version: @VERSION +Libs: -L${libdir} -lgeofencing +Cflags: -I${includedir}/location-geofence diff --git a/geofence/location_geofence.cpp b/geofence/location_geofence.cpp new file mode 100644 index 00000000..66729f44 --- /dev/null +++ b/geofence/location_geofence.cpp @@ -0,0 +1,145 @@ +/* Copyright (c) 2017-2019, 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 "GeofenceAdapter.h" +#include "location_interface.h" + +static GeofenceAdapter* gGeofenceAdapter = NULL; + +static void initialize(); +static void deinitialize(); + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks); +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb); +static void requestCapabilities(LocationAPI* client); + +static uint32_t* addGeofences(LocationAPI* client, size_t count, GeofenceOption*, GeofenceInfo*); +static void removeGeofences(LocationAPI* client, size_t count, uint32_t* ids); +static void modifyGeofences(LocationAPI* client, size_t count, uint32_t* ids, + GeofenceOption* options); +static void pauseGeofences(LocationAPI* client, size_t count, uint32_t* ids); +static void resumeGeofences(LocationAPI* client, size_t count, uint32_t* ids); + +static const GeofenceInterface gGeofenceInterface = { + sizeof(GeofenceInterface), + initialize, + deinitialize, + addClient, + removeClient, + requestCapabilities, + addGeofences, + removeGeofences, + modifyGeofences, + pauseGeofences, + resumeGeofences +}; + +#ifndef DEBUG_X86 +extern "C" const GeofenceInterface* getGeofenceInterface() +#else +const GeofenceInterface* getGeofenceInterface() +#endif // DEBUG_X86 +{ + return &gGeofenceInterface; +} + +static void initialize() +{ + if (NULL == gGeofenceAdapter) { + gGeofenceAdapter = new GeofenceAdapter(); + } +} + +static void deinitialize() +{ + if (NULL != gGeofenceAdapter) { + delete gGeofenceAdapter; + gGeofenceAdapter = NULL; + } +} + +static void addClient(LocationAPI* client, const LocationCallbacks& callbacks) +{ + if (NULL != gGeofenceAdapter) { + gGeofenceAdapter->addClientCommand(client, callbacks); + } +} + +static void removeClient(LocationAPI* client, removeClientCompleteCallback rmClientCb) +{ + if (NULL != gGeofenceAdapter) { + gGeofenceAdapter->removeClientCommand(client, rmClientCb); + } +} + +static void requestCapabilities(LocationAPI* client) +{ + if (NULL != gGeofenceAdapter) { + gGeofenceAdapter->requestCapabilitiesCommand(client); + } +} + +static uint32_t* addGeofences(LocationAPI* client, size_t count, + GeofenceOption* options, GeofenceInfo* info) +{ + if (NULL != gGeofenceAdapter) { + return gGeofenceAdapter->addGeofencesCommand(client, count, options, info); + } else { + return NULL; + } +} + +static void removeGeofences(LocationAPI* client, size_t count, uint32_t* ids) +{ + if (NULL != gGeofenceAdapter) { + return gGeofenceAdapter->removeGeofencesCommand(client, count, ids); + } +} + +static void modifyGeofences(LocationAPI* client, size_t count, uint32_t* ids, + GeofenceOption* options) +{ + if (NULL != gGeofenceAdapter) { + return gGeofenceAdapter->modifyGeofencesCommand(client, count, ids, options); + } +} + +static void pauseGeofences(LocationAPI* client, size_t count, uint32_t* ids) +{ + if (NULL != gGeofenceAdapter) { + return gGeofenceAdapter->pauseGeofencesCommand(client, count, ids); + } +} + +static void resumeGeofences(LocationAPI* client, size_t count, uint32_t* ids) +{ + if (NULL != gGeofenceAdapter) { + return gGeofenceAdapter->resumeGeofencesCommand(client, count, ids); + } +} + diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index f6dff894..10f0255c 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -50,6 +50,7 @@ #define RAD2DEG (180.0 / M_PI) #define PROCESS_NAME_ENGINE_SERVICE "engine-service" +#define MIN_TRACKING_INTERVAL (100) // 100 msec using namespace loc_core; @@ -63,9 +64,9 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD GnssAdapter::GnssAdapter() : LocAdapterBase(0, - LocDualContext::getLocFgContext(NULL, + LocContext::getLocContext(NULL, NULL, - LocDualContext::mLocationHalName, + LocContext::mLocationHalName, false), true, nullptr), mEngHubProxy(new EngineHubProxyBase()), mLocPositionMode(), @@ -87,9 +88,13 @@ GnssAdapter::GnssAdapter() : mSystemStatus(SystemStatus::getInstance(mMsgTask)), mServerUrl(":"), mXtraObserver(mSystemStatus->getOsObserver(), mMsgTask), - mBlockCPIInfo{}, mLocSystemInfo{}, - mNfwCb(NULL) + mBlockCPIInfo{}, + mNfwCb(NULL), + mPowerOn(false), + mAllowFlpNetworkFixes(0), + mGnssEnergyConsumedCb(nullptr), + mPowerStateCb(nullptr) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -569,8 +574,21 @@ GnssAdapter::readConfigCommand() mAdapter(adapter), mContext(context) {} inline virtual void proc() const { - // reads config into mContext->mGps_conf - mContext.readConfig(); + static bool confReadDone = false; + if (!confReadDone) { + confReadDone = true; + // reads config into mContext->mGps_conf + mContext.readConfig(); + + uint32_t allowFlpNetworkFixes = 0; + static const loc_param_s_type flp_conf_param_table[] = + { + {"ALLOW_NETWORK_FIXES", &allowFlpNetworkFixes, NULL, 'n'}, + }; + UTIL_READ_CONF(LOC_PATH_FLP_CONF, flp_conf_param_table); + LOC_LOGd("allowFlpNetworkFixes %u", allowFlpNetworkFixes); + mAdapter->setAllowFlpNetworkFixes(allowFlpNetworkFixes); + } } }; @@ -625,7 +643,10 @@ GnssAdapter::setConfigCommand() mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgSetConfig(*this)); + return; + } // set nmea mask type uint32_t mask = 0; if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { @@ -980,7 +1001,10 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } inline virtual void proc() const { - + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgGnssUpdateConfig(*this)); + return; + } GnssAdapter& adapter = mAdapter; size_t countOfConfigs = mCount; GnssConfig gnssConfigRequested = mConfig; @@ -1236,7 +1260,10 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { delete[] mIds; } inline virtual void proc() const { - + if (!mAdapter.isEngineCapabilitiesKnown()) { + mAdapter.mPendingMsgs.push_back(new MsgGnssGetConfig(*this)); + return; + } LocationError* errs = new LocationError[mCount]; LocationError err = LOCATION_ERROR_SUCCESS; uint32_t index = 0; @@ -1511,7 +1538,10 @@ GnssAdapter::gnssUpdateSvTypeConfigCommand(GnssSvTypeConfig config) mApi(api), mConfig(config) {} inline virtual void proc() const { - + if (!mAdapter->isEngineCapabilitiesKnown()) { + mAdapter->mPendingMsgs.push_back(new MsgGnssUpdateSvTypeConfig(*this)); + return; + } // Check if feature is supported if (!ContextBase::isFeatureSupported( LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { @@ -1601,7 +1631,10 @@ GnssAdapter::gnssGetSvTypeConfigCommand(GnssSvTypeConfigCallback callback) mApi(api), mCallback(callback) {} inline virtual void proc() const { - + if (!mAdapter->isEngineCapabilitiesKnown()) { + mAdapter->mPendingMsgs.push_back(new MsgGnssGetSvTypeConfig(*this)); + return; + } if (!ContextBase::isFeatureSupported( LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { LOC_LOGe("Feature not supported."); @@ -1630,7 +1663,10 @@ GnssAdapter::gnssResetSvTypeConfigCommand() mAdapter(adapter), mApi(api) {} inline virtual void proc() const { - + if (!mAdapter->isEngineCapabilitiesKnown()) { + mAdapter->mPendingMsgs.push_back(new MsgGnssResetSvTypeConfig(*this)); + return; + } if (!ContextBase::isFeatureSupported( LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { LOC_LOGe("Feature not supported."); @@ -1876,44 +1912,33 @@ GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& call sendMsg(new MsgAddClient(*this, client, callbacks)); } -void -GnssAdapter::removeClientCommand(LocationAPI* client, - removeClientCompleteCallback rmClientCb) -{ - LOC_LOGD("%s]: client %p", __func__, client); - - struct MsgRemoveClient : public LocMsg { - GnssAdapter& mAdapter; - LocationAPI* mClient; - removeClientCompleteCallback mRmClientCb; - inline MsgRemoveClient(GnssAdapter& adapter, - LocationAPI* client, - removeClientCompleteCallback rmCb) : - LocMsg(), - mAdapter(adapter), - mClient(client), - mRmClientCb(rmCb){} - inline virtual void proc() const { - mAdapter.stopClientSessions(mClient); - mAdapter.eraseClient(mClient); - if (nullptr != mRmClientCb) { - mRmClientCb(mClient); - } - } - }; - - sendMsg(new MsgRemoveClient(*this, client, rmClientCb)); -} - void GnssAdapter::stopClientSessions(LocationAPI* client) { LOC_LOGD("%s]: client %p", __func__, client); - for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end();) { + + /* Time-based Tracking */ + std::vector vTimeBasedTrackingClient; + for (auto it : mTimeBasedTrackingSessions) { + if (client == it.first.client) { + vTimeBasedTrackingClient.emplace_back(it.first.client, it.first.id); + } + } + for (auto key : vTimeBasedTrackingClient) { + stopTimeBasedTrackingMultiplex(key.client, key.id); + } + + /* Distance-based Tracking */ + for (auto it = mDistanceBasedTrackingSessions.begin(); + it != mDistanceBasedTrackingSessions.end(); /* no increment here*/) { if (client == it->first.client) { - stopTrackingMultiplex(it->first.client, it->first.id); - it = mTrackingSessions.erase(it); - continue; + mLocApi->stopDistanceBasedTracking(it->first.id, new LocApiResponse(*getContext(), + [this, client, id=it->first.id] (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + eraseTrackingSession(client, id); + } + } + )); } ++it; // increment only when not erasing an iterator } @@ -1993,11 +2018,15 @@ GnssAdapter::handleEngineUpEvent() LocMsg(), mAdapter(adapter) {} virtual void proc() const { + mAdapter.setEngineCapabilitiesKnown(true); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); - // restart sessions mAdapter.restartSessions(); mAdapter.gnssSvIdConfigUpdate(); mAdapter.gnssSvTypeConfigUpdate(); + for (auto msg: mAdapter.mPendingMsgs) { + mAdapter.sendMsg(msg); + } + mAdapter.mPendingMsgs.clear(); } }; @@ -2014,132 +2043,37 @@ GnssAdapter::restartSessions() // odcpi session is no longer active after restart mOdcpiRequestActive = false; - if (mTrackingSessions.empty()) { - return; - } - - // get the LocationOptions that has the smallest interval, which should be the active one - TrackingOptions smallestIntervalOptions; // size is zero until set for the first time - TrackingOptions highestPowerTrackingOptions; - memset(&smallestIntervalOptions, 0, sizeof(smallestIntervalOptions)); - memset(&highestPowerTrackingOptions, 0, sizeof(highestPowerTrackingOptions)); - for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { - // size of zero means we havent set it yet - if (0 == smallestIntervalOptions.size || - it->second.minInterval < smallestIntervalOptions.minInterval) { - smallestIntervalOptions = it->second; - } - GnssPowerMode powerMode = it->second.powerMode; - // Size of zero means we havent set it yet - if (0 == highestPowerTrackingOptions.size || - (GNSS_POWER_MODE_INVALID != powerMode && - powerMode < highestPowerTrackingOptions.powerMode)) { - highestPowerTrackingOptions = it->second; - } - } - - LocPosMode locPosMode = {}; - highestPowerTrackingOptions.setLocationOptions(smallestIntervalOptions); - convertOptions(locPosMode, highestPowerTrackingOptions); - mLocApi->startFix(locPosMode, nullptr); -} - -void -GnssAdapter::requestCapabilitiesCommand(LocationAPI* client) -{ - LOC_LOGD("%s]: ", __func__); - - struct MsgRequestCapabilities : public LocMsg { - GnssAdapter& mAdapter; - LocationAPI* mClient; - inline MsgRequestCapabilities(GnssAdapter& adapter, - LocationAPI* client) : - LocMsg(), - mAdapter(adapter), - mClient(client) {} - inline virtual void proc() const { - LocationCallbacks callbacks = mAdapter.getClientCallbacks(mClient); - if (callbacks.capabilitiesCb == nullptr) { - LOC_LOGE("%s]: capabilitiesCb is NULL", __func__); - return; + if (!mTimeBasedTrackingSessions.empty()) { + // get the LocationOptions that has the smallest interval, which should be the active one + TrackingOptions smallestIntervalOptions; // size is zero until set for the first time + TrackingOptions highestPowerTrackingOptions; + memset(&smallestIntervalOptions, 0, sizeof(smallestIntervalOptions)); + memset(&highestPowerTrackingOptions, 0, sizeof(highestPowerTrackingOptions)); + for (auto it = mTimeBasedTrackingSessions.begin(); it != mTimeBasedTrackingSessions.end(); ++it) { + // size of zero means we havent set it yet + if (0 == smallestIntervalOptions.size || + it->second.minInterval < smallestIntervalOptions.minInterval) { + smallestIntervalOptions = it->second; + } + GnssPowerMode powerMode = it->second.powerMode; + // Size of zero means we havent set it yet + if (0 == highestPowerTrackingOptions.size || + (GNSS_POWER_MODE_INVALID != powerMode && + powerMode < highestPowerTrackingOptions.powerMode)) { + highestPowerTrackingOptions = it->second; } - - LocationCapabilitiesMask mask = mAdapter.getCapabilities(); - callbacks.capabilitiesCb(mask); } - }; - if (ContextBase::isEngineCapabilitiesKnown()) { - sendMsg(new MsgRequestCapabilities(*this, client)); + highestPowerTrackingOptions.setLocationOptions(smallestIntervalOptions); + mLocApi->startTimeBasedTracking(highestPowerTrackingOptions, nullptr); } -} -LocationCapabilitiesMask -GnssAdapter::getCapabilities() -{ - LocationCapabilitiesMask mask = 0; - uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities(); - // time based tracking always supported - mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT; - // geofence always supported - mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT; - if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) { - mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT; + for (auto it = mDistanceBasedTrackingSessions.begin(); + it != mDistanceBasedTrackingSessions.end(); ++it) { + mLocApi->startDistanceBasedTracking(it->first.id, it->second, + new LocApiResponse(*getContext(), + [] (LocationError /*err*/) {})); } - if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) { - mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT; - } - if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) { - mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT | - LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT; - } - if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { - mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT; - } - if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) { - mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT; - } - if (ContextBase::gnssConstellationConfig()) { - mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { - mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) { - mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { - mask |= LOCATION_CAPABILITIES_AGPM_BIT; - } - return mask; -} - -void -GnssAdapter::broadcastCapabilities(LocationCapabilitiesMask mask) -{ - for (auto clientData : mClientData) { - if (nullptr != clientData.second.capabilitiesCb) { - clientData.second.capabilitiesCb(mask); - } - } -} - -LocationCallbacks -GnssAdapter::getClientCallbacks(LocationAPI* client) -{ - LocationCallbacks callbacks = {}; - auto it = mClientData.find(client); - if (it != mClientData.end()) { - callbacks = it->second; - } - return callbacks; -} - -void -GnssAdapter::saveClient(LocationAPI* client, const LocationCallbacks& callbacks) -{ - mClientData[client] = callbacks; - updateClientsEventMask(); } void @@ -2171,16 +2105,6 @@ GnssAdapter::notifyClientOfCachedLocationSystemInfo( } } -void -GnssAdapter::eraseClient(LocationAPI* client) -{ - auto it = mClientData.find(client); - if (it != mClientData.end()) { - mClientData.erase(it); - } - updateClientsEventMask(); -} - bool GnssAdapter::hasTrackingCallback(LocationAPI* client) { @@ -2188,6 +2112,20 @@ GnssAdapter::hasTrackingCallback(LocationAPI* client) return (it != mClientData.end() && (it->second.trackingCb || it->second.gnssLocationInfoCb)); } +bool +GnssAdapter::isTimeBasedTrackingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + return (mTimeBasedTrackingSessions.find(key) != mTimeBasedTrackingSessions.end()); +} + +bool +GnssAdapter::isDistanceBasedTrackingSession(LocationAPI* client, uint32_t sessionId) +{ + LocationSessionKey key(client, sessionId); + return (mDistanceBasedTrackingSessions.find(key) != mDistanceBasedTrackingSessions.end()); +} + bool GnssAdapter::hasMeasurementsCallback(LocationAPI* client) { @@ -2199,27 +2137,75 @@ bool GnssAdapter::isTrackingSession(LocationAPI* client, uint32_t sessionId) { LocationSessionKey key(client, sessionId); - return (mTrackingSessions.find(key) != mTrackingSessions.end()); + return (mTimeBasedTrackingSessions.find(key) != mTimeBasedTrackingSessions.end()); +} + +void +GnssAdapter::reportPowerStateIfChanged() +{ + bool newPowerOn = !mTimeBasedTrackingSessions.empty() || + !mDistanceBasedTrackingSessions.empty(); + if (newPowerOn != mPowerOn) { + mPowerOn = newPowerOn; + if (mPowerStateCb != nullptr) { + mPowerStateCb(mPowerOn); + } + } +} + +void +GnssAdapter::getPowerStateChangesCommand(void* powerStateCb) +{ + LOC_LOGD("%s]: ", __func__); + + struct MsgReportLocation : public LocMsg { + GnssAdapter& mAdapter; + powerStateCallback mPowerStateCb; + inline MsgReportLocation(GnssAdapter& adapter, + powerStateCallback powerStateCb) : + LocMsg(), + mAdapter(adapter), + mPowerStateCb(powerStateCb) {} + inline virtual void proc() const { + mAdapter.savePowerStateCallback(mPowerStateCb); + mPowerStateCb(mAdapter.getPowerState()); + } + }; + + sendMsg(new MsgReportLocation(*this, (powerStateCallback)powerStateCb)); } void GnssAdapter::saveTrackingSession(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& trackingOptions) + const TrackingOptions& options) { LocationSessionKey key(client, sessionId); - mTrackingSessions[key] = trackingOptions; + if ((options.minDistance > 0) && + ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + mDistanceBasedTrackingSessions[key] = options; + } else { + mTimeBasedTrackingSessions[key] = options; + } + reportPowerStateIfChanged(); } void GnssAdapter::eraseTrackingSession(LocationAPI* client, uint32_t sessionId) { LocationSessionKey key(client, sessionId); - auto itr = mTrackingSessions.find(key); - if (itr != mTrackingSessions.end()) { - mTrackingSessions.erase(itr); + auto it = mTimeBasedTrackingSessions.find(key); + if (it != mTimeBasedTrackingSessions.end()) { + mTimeBasedTrackingSessions.erase(it); + } else { + auto itr = mDistanceBasedTrackingSessions.find(key); + if (itr != mDistanceBasedTrackingSessions.end()) { + mDistanceBasedTrackingSessions.erase(itr); + } } + reportPowerStateIfChanged(); } + bool GnssAdapter::setLocPositionMode(const LocPosMode& mode) { if (!mLocPositionMode.equals(mode)) { mLocPositionMode = mode; @@ -2293,48 +2279,62 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) LocApiBase& mApi; LocationAPI* mClient; uint32_t mSessionId; - mutable TrackingOptions mTrackingOptions; + mutable TrackingOptions mOptions; inline MsgStartTracking(GnssAdapter& adapter, LocApiBase& api, LocationAPI* client, uint32_t sessionId, - TrackingOptions trackingOptions) : + TrackingOptions options) : LocMsg(), mAdapter(adapter), mApi(api), mClient(client), mSessionId(sessionId), - mTrackingOptions(trackingOptions) {} + mOptions(options) {} inline virtual void proc() const { + // distance based tracking will need to know engine capabilities before it can start + if (!mAdapter.isEngineCapabilitiesKnown() && mOptions.minDistance > 0) { + mAdapter.mPendingMsgs.push_back(new MsgStartTracking(*this)); + return; + } LocationError err = LOCATION_ERROR_SUCCESS; if (!mAdapter.hasTrackingCallback(mClient) && !mAdapter.hasMeasurementsCallback(mClient)) { err = LOCATION_ERROR_CALLBACK_MISSING; - } else if (0 == mTrackingOptions.size) { + } else if (0 == mOptions.size) { err = LOCATION_ERROR_INVALID_PARAMETER; } else { - if (GNSS_POWER_MODE_INVALID != mTrackingOptions.powerMode && - !ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { - LOC_LOGv("Ignoring power mode, feature not supported."); - mTrackingOptions.powerMode = GNSS_POWER_MODE_INVALID; + if (mOptions.minInterval < MIN_TRACKING_INTERVAL) { + mOptions.minInterval = MIN_TRACKING_INTERVAL; } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02) && - GNSS_POWER_MODE_M4 == mTrackingOptions.powerMode && - mTrackingOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { - LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", - mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); - mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; - } - if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) { - mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL; - } - // Api doesn't support multiple clients for time based tracking, so mutiplex - bool reportToClientWithNoWait = - mAdapter.startTrackingMultiplex(mClient, mSessionId, mTrackingOptions); - mAdapter.saveTrackingSession(mClient, mSessionId, mTrackingOptions); + if (mOptions.minDistance > 0 && + ContextBase::isMessageSupported( + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) { + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + mApi.startDistanceBasedTracking(mSessionId, mOptions, + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient] + (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + mAdapter.eraseTrackingSession(mClient, mSessionId); + } + mAdapter.reportResponse(mClient, err, mSessionId); + })); + } else { + if (GNSS_POWER_MODE_M4 == mOptions.powerMode && + mOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { + LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", + mOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); + mOptions.powerMode = GNSS_POWER_MODE_M2; + } + // Api doesn't support multiple clients for time based tracking, so mutiplex + bool reportToClientWithNoWait = + mAdapter.startTimeBasedTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); - if (reportToClientWithNoWait) { - mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + } } } } @@ -2346,13 +2346,13 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) } bool -GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& options) +GnssAdapter::startTimeBasedTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const TrackingOptions& options) { bool reportToClientWithNoWait = true; - if (mTrackingSessions.empty()) { - startTracking(client, sessionId, options); + if (mTimeBasedTrackingSessions.empty()) { + startTimeBasedTracking(client, sessionId, options); // need to wait for QMI callback reportToClientWithNoWait = false; } else { @@ -2360,7 +2360,7 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); - for (auto it = mTrackingSessions.begin(); it != mTrackingSessions.end(); ++it) { + for (auto it = mTimeBasedTrackingSessions.begin(); it != mTimeBasedTrackingSessions.end(); ++it) { // if not set or there is a new smallest interval, then set the new interval if (0 == multiplexedOptions.size || it->second.minInterval < multiplexedOptions.minInterval) { @@ -2387,7 +2387,7 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, if (updateOptions) { // restart time based tracking with the newly updated options - startTracking(client, sessionId, multiplexedOptions); + startTimeBasedTracking(client, sessionId, multiplexedOptions); // need to wait for QMI callback reportToClientWithNoWait = false; } @@ -2398,12 +2398,12 @@ GnssAdapter::startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, } void -GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, +GnssAdapter::startTimeBasedTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions) { LOC_LOGd("minInterval %u minDistance %u mode %u powermode %u tbm %u", - trackingOptions.minInterval, trackingOptions.minDistance, - trackingOptions.mode, trackingOptions.powerMode, trackingOptions.tbm); + trackingOptions.minInterval, trackingOptions.minDistance, + trackingOptions.mode, trackingOptions.powerMode, trackingOptions.tbm); LocPosMode locPosMode = {}; convertOptions(locPosMode, trackingOptions); @@ -2412,7 +2412,7 @@ GnssAdapter::startTracking(LocationAPI* client, uint32_t sessionId, mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + mLocApi->startTimeBasedTracking(trackingOptions, new LocApiResponse(*getContext(), [this, client, sessionId] (LocationError err) { if (LOCATION_ERROR_SUCCESS != err) { eraseTrackingSession(client, sessionId); @@ -2434,7 +2434,7 @@ GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - mLocApi->startFix(locPosMode, new LocApiResponse(*getContext(), + mLocApi->startTimeBasedTracking(updatedOptions, new LocApiResponse(*getContext(), [this, client, sessionId, oldOptions] (LocationError err) { if (LOCATION_ERROR_SUCCESS != err) { // restore the old LocationOptions @@ -2446,35 +2446,6 @@ GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, )); } -void -GnssAdapter::setPositionModeCommand(LocPosMode& locPosMode) -{ - LOC_LOGD("%s]: min_interval %u mode %u", - __func__, locPosMode.min_interval, locPosMode.mode); - - struct MsgSetPositionMode : public LocMsg { - GnssAdapter& mAdapter; - LocApiBase& mApi; - LocPosMode mLocPosMode; - inline MsgSetPositionMode(GnssAdapter& adapter, - LocApiBase& api, - LocPosMode& locPosMode) : - LocMsg(), - mAdapter(adapter), - mApi(api), - mLocPosMode(locPosMode) {} - inline virtual void proc() const { - // saves the mode in adapter to be used when startTrackingCommand is called from ULP - if (mAdapter.setLocPositionMode(mLocPosMode)) { - mAdapter.mEngHubProxy->gnssSetFixMode(mLocPosMode); - mApi.setPositionMode(mLocPosMode); - } - } - }; - - sendMsg(new MsgSetPositionMode(*this, *mLocApi, locPosMode)); -} - void GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, TrackingOptions& options) @@ -2487,52 +2458,108 @@ GnssAdapter::updateTrackingOptionsCommand(LocationAPI* client, uint32_t id, LocApiBase& mApi; LocationAPI* mClient; uint32_t mSessionId; - mutable TrackingOptions mTrackingOptions; + mutable TrackingOptions mOptions; inline MsgUpdateTracking(GnssAdapter& adapter, LocApiBase& api, LocationAPI* client, uint32_t sessionId, - TrackingOptions trackingOptions) : + TrackingOptions options) : LocMsg(), mAdapter(adapter), mApi(api), mClient(client), mSessionId(sessionId), - mTrackingOptions(trackingOptions) {} + mOptions(options) {} inline virtual void proc() const { - if (mAdapter.isTrackingSession(mClient, mSessionId)) { - LocationError err = LOCATION_ERROR_SUCCESS; - if (0 == mTrackingOptions.size) { - err = LOCATION_ERROR_INVALID_PARAMETER; - } else { - if (GNSS_POWER_MODE_INVALID != mTrackingOptions.powerMode && - !ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { - LOC_LOGv("Ignoring power mode, feature not supported."); - mTrackingOptions.powerMode = GNSS_POWER_MODE_INVALID; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02) && - GNSS_POWER_MODE_M4 == mTrackingOptions.powerMode && - mTrackingOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { - LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", - mTrackingOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); - mTrackingOptions.powerMode = GNSS_POWER_MODE_M2; - } - if (mTrackingOptions.minInterval < MIN_TRACKING_INTERVAL) { - mTrackingOptions.minInterval = MIN_TRACKING_INTERVAL; - } + // distance based tracking will need to know engine capabilities before it can start + if (!mAdapter.isEngineCapabilitiesKnown() && mOptions.minDistance > 0) { + mAdapter.mPendingMsgs.push_back(new MsgUpdateTracking(*this)); + return; + } + LocationError err = LOCATION_ERROR_SUCCESS; + bool isTimeBased = mAdapter.isTimeBasedTrackingSession(mClient, mSessionId); + bool isDistanceBased = mAdapter.isDistanceBasedTrackingSession(mClient, mSessionId); + if (!isTimeBased && !isDistanceBased) { + err = LOCATION_ERROR_ID_UNKNOWN; + } else if (0 == mOptions.size) { + err = LOCATION_ERROR_INVALID_PARAMETER; + } + if (LOCATION_ERROR_SUCCESS != err) { + mAdapter.reportResponse(mClient, err, mSessionId); + } else { + if (GNSS_POWER_MODE_M4 == mOptions.powerMode && + mOptions.tbm > TRACKING_TBM_THRESHOLD_MILLIS) { + LOC_LOGd("TBM (%d) > %d Falling back to M2 power mode", + mOptions.tbm, TRACKING_TBM_THRESHOLD_MILLIS); + mOptions.powerMode = GNSS_POWER_MODE_M2; + } + if (mOptions.minInterval < MIN_TRACKING_INTERVAL) { + mOptions.minInterval = MIN_TRACKING_INTERVAL; + } + // Now update session as required + if (isTimeBased && mOptions.minDistance > 0) { + // switch from time based to distance based // Api doesn't support multiple clients for time based tracking, so mutiplex bool reportToClientWithNoWait = - mAdapter.updateTrackingMultiplex(mClient, mSessionId, mTrackingOptions); - mAdapter.saveTrackingSession(mClient, mSessionId, mTrackingOptions); + mAdapter.stopTimeBasedTrackingMultiplex(mClient, mSessionId); + // erases the time based Session + mAdapter.eraseTrackingSession(mClient, mSessionId); + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + } + // saves as distance based Session + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + mApi.startDistanceBasedTracking(mSessionId, mOptions, + new LocApiResponse(*mAdapter.getContext(), + [] (LocationError /*err*/) {})); + } else if (isDistanceBased && mOptions.minDistance == 0) { + // switch from distance based to time based + mAdapter.eraseTrackingSession(mClient, mSessionId); + mApi.stopDistanceBasedTracking(mSessionId, new LocApiResponse( + *mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, mOptions = mOptions, + mClient = mClient] (LocationError /*err*/) { + // Api doesn't support multiple clients for time based tracking, + // so mutiplex + bool reportToClientWithNoWait = + mAdapter.startTimeBasedTrackingMultiplex(mClient, mSessionId, + mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + } + })); + } else if (isTimeBased) { + // update time based tracking + // Api doesn't support multiple clients for time based tracking, so mutiplex + bool reportToClientWithNoWait = + mAdapter.updateTrackingMultiplex(mClient, mSessionId, mOptions); + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); if (reportToClientWithNoWait) { mAdapter.reportResponse(mClient, err, mSessionId); } + } else if (isDistanceBased) { + // restart distance based tracking + mApi.stopDistanceBasedTracking(mSessionId, new LocApiResponse( + *mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, mOptions = mOptions, + mClient = mClient, &mApi = mApi] (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + mApi.startDistanceBasedTracking(mSessionId, mOptions, + new LocApiResponse(*mAdapter.getContext(), + [&mAdapter, mClient, mSessionId, mOptions] + (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.saveTrackingSession(mClient, mSessionId, mOptions); + } + mAdapter.reportResponse(mClient, err, mSessionId); + })); + } + })); } } - // we do not reportResponse for the case where there is no existing tracking session - // for the client and id being used, since updateTrackingCommand can be sent to both - // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response } }; @@ -2547,19 +2574,21 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, LocationSessionKey key(client, id); // get the session we are updating - auto it = mTrackingSessions.find(key); + auto it = mTimeBasedTrackingSessions.find(key); // cache the clients existing LocationOptions TrackingOptions oldOptions = it->second; // if session we are updating exists and the minInterval or powerMode has changed - if (it != mTrackingSessions.end() && (it->second.minInterval != trackingOptions.minInterval || + if (it != mTimeBasedTrackingSessions.end() && + (it->second.minInterval != trackingOptions.minInterval || it->second.powerMode != trackingOptions.powerMode)) { // find the smallest interval and powerMode, other than the session we are updating TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); - for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { + for (auto it2 = mTimeBasedTrackingSessions.begin(); + it2 != mTimeBasedTrackingSessions.end(); ++it2) { // if session is not the one we are updating and either interval // is not set or there is a new smallest interval, then set the new interval if (it2->first != key && (0 == multiplexedOptions.size || @@ -2586,7 +2615,7 @@ GnssAdapter::updateTrackingMultiplex(LocationAPI* client, uint32_t id, updateOptions = true; } // if only one session exists, then tracking should be updated with it - if (1 == mTrackingSessions.size()) { + if (1 == mTimeBasedTrackingSessions.size()) { multiplexedOptions = trackingOptions; updateOptions = true; } @@ -2621,19 +2650,33 @@ GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) mClient(client), mSessionId(sessionId) {} inline virtual void proc() const { - if (mAdapter.isTrackingSession(mClient, mSessionId)) { - // Api doesn't support multiple clients for time based tracking, so mutiplex - bool reportToClientWithNoWait = - mAdapter.stopTrackingMultiplex(mClient, mSessionId); - mAdapter.eraseTrackingSession(mClient, mSessionId); + bool isTimeBased = mAdapter.isTimeBasedTrackingSession(mClient, mSessionId); + bool isDistanceBased = mAdapter.isDistanceBasedTrackingSession(mClient, mSessionId); + if (isTimeBased || isDistanceBased) { + if (isTimeBased) { + // Api doesn't support multiple clients for time based tracking, so mutiplex + bool reportToClientWithNoWait = + mAdapter.stopTimeBasedTrackingMultiplex(mClient, mSessionId); + mAdapter.eraseTrackingSession(mClient, mSessionId); - if (reportToClientWithNoWait) { - mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + if (reportToClientWithNoWait) { + mAdapter.reportResponse(mClient, LOCATION_ERROR_SUCCESS, mSessionId); + } + } else if (isDistanceBased) { + mApi.stopDistanceBasedTracking(mSessionId, new LocApiResponse( + *mAdapter.getContext(), + [&mAdapter = mAdapter, mSessionId = mSessionId, mClient = mClient] + (LocationError err) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.eraseTrackingSession(mClient, mSessionId); + } + mAdapter.reportResponse(mClient, err, mSessionId); + })); } + } else { + mAdapter.reportResponse(mClient, LOCATION_ERROR_ID_UNKNOWN, mSessionId); } - // we do not reportResponse for the case where there is no existing tracking session - // for the client and id being used, since stopTrackingCommand can be sent to both - // GnssAdapter & FlpAdapter by LocationAPI and we want to avoid incorrect error response + } }; @@ -2641,11 +2684,11 @@ GnssAdapter::stopTrackingCommand(LocationAPI* client, uint32_t id) } bool -GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) +GnssAdapter::stopTimeBasedTrackingMultiplex(LocationAPI* client, uint32_t id) { bool reportToClientWithNoWait = true; - if (1 == mTrackingSessions.size()) { + if (1 == mTimeBasedTrackingSessions.size()) { stopTracking(client, id); // need to wait for QMI callback reportToClientWithNoWait = false; @@ -2653,13 +2696,14 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) LocationSessionKey key(client, id); // get the session we are stopping - auto it = mTrackingSessions.find(key); - if (it != mTrackingSessions.end()) { + auto it = mTimeBasedTrackingSessions.find(key); + if (it != mTimeBasedTrackingSessions.end()) { // find the smallest interval and powerMode, other than the session we are stopping TrackingOptions multiplexedOptions = {}; // size is 0 until set for the first time GnssPowerMode multiplexedPowerMode = GNSS_POWER_MODE_INVALID; memset(&multiplexedOptions, 0, sizeof(multiplexedOptions)); - for (auto it2 = mTrackingSessions.begin(); it2 != mTrackingSessions.end(); ++it2) { + for (auto it2 = mTimeBasedTrackingSessions.begin(); + it2 != mTimeBasedTrackingSessions.end(); ++it2) { // if session is not the one we are stopping and either interval // is not set or there is a new smallest interval, then set the new interval if (it2->first != key && (0 == multiplexedOptions.size || @@ -2679,7 +2723,7 @@ GnssAdapter::stopTrackingMultiplex(LocationAPI* client, uint32_t id) it->second.powerMode < multiplexedPowerMode) { multiplexedOptions.powerMode = multiplexedPowerMode; // restart time based tracking with the newly updated options - startTracking(client, id, multiplexedOptions); + startTimeBasedTracking(client, id, multiplexedOptions); // need to wait for QMI callback reportToClientWithNoWait = false; } @@ -2798,7 +2842,6 @@ GnssAdapter::gnssNiResponseCommand(GnssNiResponse response, void* rawRequest) inline virtual ~MsgGnssNiResponse() { } inline virtual void proc() const { - const void *rawPayload = mPayload; mApi.informNiResponse(mResponse, mPayload); } }; @@ -3001,9 +3044,9 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, } bool -GnssAdapter::needReport(const UlpLocation& ulpLocation, - enum loc_sess_status status, - LocPosTechMask techMask) { +GnssAdapter::needReportForGnssClient(const UlpLocation& ulpLocation, + enum loc_sess_status status, + LocPosTechMask techMask) { bool reported = false; // if engine hub is enabled, aka, any of the engine services is enabled, @@ -3016,47 +3059,77 @@ GnssAdapter::needReport(const UlpLocation& ulpLocation, return reported; } +bool +GnssAdapter::needReportForFlpClient(enum loc_sess_status status, + LocPosTechMask techMask) { + if ((status == LOC_SESS_INTERMEDIATE) && + !(techMask & LOC_POS_TECH_MASK_SENSORS) && + (!getAllowFlpNetworkFixes())) { + return false; + } else { + return true; + } +} + +bool +GnssAdapter::isFlpClient(LocationCallbacks& locationCallbacks) +{ + return (locationCallbacks.gnssLocationInfoCb == nullptr && + locationCallbacks.gnssSvCb == nullptr && + locationCallbacks.gnssNmeaCb == nullptr && + locationCallbacks.gnssDataCb == nullptr && + locationCallbacks.gnssMeasurementsCb == nullptr); +} + void GnssAdapter::reportPosition(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask) { - bool reported = needReport(ulpLocation, status, techMask); - mGnssSvIdUsedInPosAvail = false; - if (reported) { - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { - mGnssSvIdUsedInPosAvail = true; - mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; - } + bool reportToGnssClient = needReportForGnssClient(ulpLocation, status, techMask); + bool reportToFlpClient = needReportForFlpClient(status, techMask); + if (reportToGnssClient || reportToFlpClient) { GnssLocationInfoNotification locationInfo = {}; convertLocationInfo(locationInfo, locationExtended); convertLocation(locationInfo.location, ulpLocation, locationExtended, techMask); for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { - if (nullptr != it->second.gnssLocationInfoCb) { - it->second.gnssLocationInfoCb(locationInfo); - } else if (nullptr != it->second.trackingCb) { - it->second.trackingCb(locationInfo.location); + if ((reportToFlpClient && isFlpClient(it->second)) || + (reportToGnssClient && !isFlpClient(it->second))) { + if (nullptr != it->second.gnssLocationInfoCb) { + it->second.gnssLocationInfoCb(locationInfo); + } else if (nullptr != it->second.trackingCb) { + it->second.trackingCb(locationInfo.location); + } } } - // if engine hub is running and the fix is from sensor, e.g.: DRE, - // inject DRE fix to modem - if ((1 == ContextBase::mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED) && - (true == initEngHubProxy()) && (LOC_POS_TECH_MASK_SENSORS & techMask)) { - mLocApi->injectPosition(locationInfo, false); + mGnssSvIdUsedInPosAvail = false; + if (reportToGnssClient) { + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { + mGnssSvIdUsedInPosAvail = true; + mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; + } + + // if engine hub is running and the fix is from sensor, e.g.: DRE, + // inject DRE fix to modem + if ((1 == ContextBase::mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED) && + (true == initEngHubProxy()) && (LOC_POS_TECH_MASK_SENSORS & techMask)) { + mLocApi->injectPosition(locationInfo, false); + } } } - if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { + if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && + !mTimeBasedTrackingSessions.empty()) { /*Only BlankNMEA sentence needs to be processed and sent, if both lat, long is 0 & horReliability is not set. */ bool blank_fix = ((0 == ulpLocation.gpsLocation.latitude) && (0 == ulpLocation.gpsLocation.longitude) && (LOC_RELIABILITY_NOT_SET == locationExtended.horizontal_reliability)); - uint8_t generate_nmea = (reported && status != LOC_SESS_FAILURE && !blank_fix); + uint8_t generate_nmea = (reportToGnssClient && status != LOC_SESS_FAILURE && !blank_fix); std::vector nmeaArraystr; loc_nmea_generate_pos(ulpLocation, locationExtended, mLocSystemInfo, generate_nmea, nmeaArraystr); @@ -3153,7 +3226,8 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) } } - if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && !mTrackingSessions.empty()) { + if (NMEA_PROVIDER_AP == ContextBase::mGps_conf.NMEA_PROVIDER && + !mTimeBasedTrackingSessions.empty()) { std::vector nmeaArraystr; loc_nmea_generate_sv(svNotify, nmeaArraystr); stringstream ss; @@ -3348,8 +3422,8 @@ GnssAdapter::reportLocationSystemInfo(const LocationSystemInfo & locationSystemI LEAP_SECOND_SYS_INFO_CURRENT_LEAP_SECONDS_BIT; dstLeapSecondSysInfo.leapSecondCurrent = srcLeapSecondSysInfo.leapSecondCurrent; } - // once leap second change event is complete, modem may send up event invalidate the leap second - // change info while AP is still processing report during leap second transition + // once leap second change event is complete, modem may send up event invalidate the leap + // second change info while AP is still processing report during leap second transition // so, we choose to keep this info around even though it is old if (srcLeapSecondSysInfo.leapSecondInfoMask & LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT) { dstLeapSecondSysInfo.leapSecondInfoMask |= LEAP_SECOND_SYS_INFO_LEAP_SECOND_CHANGE_BIT; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index e304fe6e..1ed11517 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -30,13 +30,14 @@ #define GNSS_ADAPTER_H #include -#include +#include #include #include #include #include #include #include +#include #define MAX_URL_LEN 256 #define NMEA_SENTENCE_MAX_LENGTH 200 @@ -48,6 +49,9 @@ class GnssAdapter; +typedef std::map LocationSessionMap; +typedef std::map TrackingOptionsMap; + class OdcpiTimer : public LocTimer { public: OdcpiTimer(GnssAdapter* adapter) : @@ -128,19 +132,16 @@ typedef std::function GnssEnergyConsumedCallback; -typedef void (*removeClientCompleteCallback)(LocationAPI* client); +typedef void (*powerStateCallback)(bool on); class GnssAdapter : public LocAdapterBase { /* ==== Engine Hub ===================================================================== */ EngineHubProxyBase* mEngHubProxy; - /* ==== CLIENT ========================================================================= */ - typedef std::map ClientDataMap; - ClientDataMap mClientData; - /* ==== TRACKING ======================================================================= */ - TrackingOptionsMap mTrackingSessions; + TrackingOptionsMap mTimeBasedTrackingSessions; + LocationSessionMap mDistanceBasedTrackingSessions; LocPosMode mLocPositionMode; GnssSvUsedInPosition mGnssSvIdUsedInPosition; bool mGnssSvIdUsedInPosAvail; @@ -185,9 +186,12 @@ class GnssAdapter : public LocAdapterBase { /* === Misc ===================================================================== */ BlockCPIInfo mBlockCPIInfo; + bool mPowerOn; + uint32_t mAllowFlpNetworkFixes; /* === Misc callback from QMI LOC API ============================================== */ GnssEnergyConsumedCallback mGnssEnergyConsumedCb; + powerStateCallback mPowerStateCb; /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions); @@ -200,6 +204,13 @@ class GnssAdapter : public LocAdapterBase { /* ======== UTILITIES ================================================================== */ inline void initOdcpi(const OdcpiRequestCallback& callback); inline void injectOdcpi(const Location& location); + static bool isFlpClient(LocationCallbacks& locationCallbacks); + +protected: + + /* ==== CLIENT ========================================================================= */ + virtual void updateClientsEventMask(); + virtual void stopClientSessions(LocationAPI* client); public: @@ -214,21 +225,7 @@ public: /* ==== CLIENT ========================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ - void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); - void removeClientCommand(LocationAPI* client, - removeClientCompleteCallback rmClientCb); - void requestCapabilitiesCommand(LocationAPI* client); - /* ======== UTILITIES ================================================================== */ - void saveClient(LocationAPI* client, const LocationCallbacks& callbacks); - void eraseClient(LocationAPI* client); - void notifyClientOfCachedLocationSystemInfo(LocationAPI* client, - const LocationCallbacks& callbacks); - void updateClientsEventMask(); - void stopClientSessions(LocationAPI* client); - LocationCallbacks getClientCallbacks(LocationAPI* client); - LocationCapabilitiesMask getCapabilities(); - void broadcastCapabilities(LocationCapabilitiesMask); - void setSuplHostServer(const char* server, int port, LocServerType type); + virtual void addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks); /* ==== TRACKING ======================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -237,11 +234,12 @@ public: void updateTrackingOptionsCommand( LocationAPI* client, uint32_t id, TrackingOptions& trackingOptions); void stopTrackingCommand(LocationAPI* client, uint32_t id); - virtual void setPositionModeCommand(LocPosMode& locPosMode); /* ======== RESPONSES ================================================================== */ void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId); /* ======== UTILITIES ================================================================== */ bool hasTrackingCallback(LocationAPI* client); + bool isTimeBasedTrackingSession(LocationAPI* client, uint32_t sessionId); + bool isDistanceBasedTrackingSession(LocationAPI* client, uint32_t sessionId); bool hasMeasurementsCallback(LocationAPI* client); bool isTrackingSession(LocationAPI* client, uint32_t sessionId); void saveTrackingSession(LocationAPI* client, uint32_t sessionId, @@ -251,16 +249,16 @@ public: bool setLocPositionMode(const LocPosMode& mode); LocPosMode& getLocPositionMode() { return mLocPositionMode; } - bool startTrackingMultiplex(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& trackingOptions); - void startTracking(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& trackingOptions); - bool stopTrackingMultiplex(LocationAPI* client, uint32_t id); + bool startTimeBasedTrackingMultiplex(LocationAPI* client, uint32_t sessionId, + const TrackingOptions& trackingOptions); + void startTimeBasedTracking(LocationAPI* client, uint32_t sessionId, + const TrackingOptions& trackingOptions); + bool stopTimeBasedTrackingMultiplex(LocationAPI* client, uint32_t id); void stopTracking(LocationAPI* client, uint32_t id); bool updateTrackingMultiplex(LocationAPI* client, uint32_t id, - const TrackingOptions& trackingOptions); + const TrackingOptions& trackingOptions); void updateTracking(LocationAPI* client, uint32_t sessionId, - const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); + const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -335,7 +333,9 @@ public: { mControlCallbacks = controlCallbacks; } void setAfwControlId(uint32_t id) { mPowerVoteId = id; } uint32_t getAfwControlId() { return mPowerVoteId; } - virtual bool isInSession() { return !mTrackingSessions.empty(); } + void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } + uint32_t getPowerVoteId() { return mPowerVoteId; } + virtual bool isInSession() { return !mTimeBasedTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); void odcpiTimerExpireEvent(); @@ -374,8 +374,9 @@ public: virtual void reportNfwNotificationEvent(GnssNfwNotification& notification); /* ======== UTILITIES ================================================================= */ - bool needReport(const UlpLocation& ulpLocation, + bool needReportForGnssClient(const UlpLocation& ulpLocation, enum loc_sess_status status, LocPosTechMask techMask); + bool needReportForFlpClient(enum loc_sess_status status, LocPosTechMask techMask); void reportPosition(const UlpLocation &ulpLocation, const GpsLocationExtended &locationExtended, enum loc_sess_status status, @@ -433,6 +434,19 @@ public: void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); void blockCPICommand(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); + + /* ==== MISCELLANEOUS ================================================================== */ + /* ======== COMMANDS ====(Called from Client Thread)==================================== */ + void getPowerStateChangesCommand(void* powerStateCb); + /* ======== UTILITIES ================================================================== */ + void reportPowerStateIfChanged(); + void savePowerStateCallback(powerStateCallback powerStateCb){ mPowerStateCb = powerStateCb; } + bool getPowerState() { return mPowerOn; } + void setAllowFlpNetworkFixes(uint32_t allow) { mAllowFlpNetworkFixes = allow; } + uint32_t getAllowFlpNetworkFixes() { return mAllowFlpNetworkFixes; } + void setSuplHostServer(const char* server, int port, LocServerType type); + void notifyClientOfCachedLocationSystemInfo(LocationAPI* client, + const LocationCallbacks& callbacks); }; #endif //GNSS_ADAPTER_H diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index cbbeda61..24f9776c 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -46,7 +46,7 @@ public : inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), mGpsLock(-1), mConnections(~0), mXtraThrottle(true), mReqStatusReceived(false), - mDelayLocTimer(*this), mIsConnectivityStatusKnown (false) { + mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { subscribe(true); startListeningNonBlocking(LOC_IPC_HAL); mDelayLocTimer.start(100 /*.1 sec*/, false); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 45ad292c..23ec2cf1 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -70,6 +70,7 @@ static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb); static void enableNfwLocationAccess(bool enable); static void nfwInit(const NfwCbInfo& cbInfo); static uint8_t getGpsLock(); +static void getPowerStateChanges(void* powerStateCb); static void odcpiInit(const OdcpiRequestCallback& callback); static void odcpiInject(const Location& location); @@ -112,7 +113,8 @@ static const GnssInterface gGnssInterface = { getGnssEnergyConsumed, enableNfwLocationAccess, nfwInit, - getGpsLock + getGpsLock, + getPowerStateChanges }; #ifndef DEBUG_X86 @@ -378,3 +380,10 @@ static uint8_t getGpsLock() { } } +static void getPowerStateChanges(void* powerStateCb) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->getPowerStateChangesCommand(powerStateCb); + } +} + diff --git a/gps_vendor_product.mk b/gps_vendor_product.mk index c21a2827..6e938b35 100644 --- a/gps_vendor_product.mk +++ b/gps_vendor_product.mk @@ -10,3 +10,5 @@ PRODUCT_PACKAGES += libloc_core PRODUCT_PACKAGES += libgnss PRODUCT_PACKAGES += liblocation_api PRODUCT_PACKAGES += libgps.utils +PRODUCT_PACKAGES += libbatching +PRODUCT_PACKAGES += libgeofencing diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index e9f2ee4d..f3088bcd 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019 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 @@ -57,24 +57,15 @@ typedef struct { LocationControlCallbacks controlCallbacks; GnssInterface* gnssInterface; GeofenceInterface* geofenceInterface; - FlpInterface* flpInterface; + BatchingInterface* batchingInterface; } LocationAPIData; static LocationAPIData gData = {}; static pthread_mutex_t gDataMutex = PTHREAD_MUTEX_INITIALIZER; static bool gGnssLoadFailed = false; -static bool gFlpLoadFailed = false; +static bool gBatchingLoadFailed = false; static bool gGeofenceLoadFailed = false; -static bool needsGnssTrackingInfo(LocationCallbacks& locationCallbacks) -{ - return (locationCallbacks.gnssLocationInfoCb != nullptr || - locationCallbacks.gnssSvCb != nullptr || - locationCallbacks.gnssNmeaCb != nullptr || - locationCallbacks.gnssDataCb != nullptr || - locationCallbacks.gnssMeasurementsCb != nullptr); -} - static bool isGnssClient(LocationCallbacks& locationCallbacks) { return (locationCallbacks.gnssNiCb != nullptr || @@ -83,10 +74,9 @@ static bool isGnssClient(LocationCallbacks& locationCallbacks) locationCallbacks.gnssMeasurementsCb != nullptr); } -static bool isFlpClient(LocationCallbacks& locationCallbacks) +static bool isBatchingClient(LocationCallbacks& locationCallbacks) { - return (locationCallbacks.trackingCb != nullptr || - locationCallbacks.batchingCb != nullptr); + return (locationCallbacks.batchingCb != nullptr); } static bool isGeofenceClient(LocationCallbacks& locationCallbacks) @@ -153,9 +143,9 @@ void onGnssRemoveClientCompleteCb (LocationAPI* client) client->onRemoveClientCompleteCb (LOCATION_ADAPTER_GNSS_TYPE_BIT); } -void onFlpRemoveClientCompleteCb (LocationAPI* client) +void onBatchingRemoveClientCompleteCb (LocationAPI* client) { - client->onRemoveClientCompleteCb (LOCATION_ADAPTER_FLP_TYPE_BIT); + client->onRemoveClientCompleteCb (LOCATION_ADAPTER_BATCHING_TYPE_BIT); } void onGeofenceRemoveClientCompleteCb (LocationAPI* client) @@ -197,21 +187,21 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) } } - if (isFlpClient(locationCallbacks)) { - if (NULL == gData.flpInterface && !gFlpLoadFailed) { - gData.flpInterface = - (FlpInterface*)loadLocationInterface("libflp.so", "getFlpInterface"); - if (NULL == gData.flpInterface) { - gFlpLoadFailed = true; - LOC_LOGW("%s:%d]: No flp interface available", __func__, __LINE__); + if (isBatchingClient(locationCallbacks)) { + if (NULL == gData.batchingInterface && !gBatchingLoadFailed) { + gData.batchingInterface = + (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); + if (NULL == gData.batchingInterface) { + gBatchingLoadFailed = true; + LOC_LOGW("%s:%d]: No batching interface available", __func__, __LINE__); } else { - gData.flpInterface->initialize(); + gData.batchingInterface->initialize(); } } - if (NULL != gData.flpInterface) { - gData.flpInterface->addClient(newLocationAPI, locationCallbacks); + if (NULL != gData.batchingInterface) { + gData.batchingInterface->addClient(newLocationAPI, locationCallbacks); if (!requestedCapabilities) { - gData.flpInterface->requestCapabilities(newLocationAPI); + gData.batchingInterface->requestCapabilities(newLocationAPI); requestedCapabilities = true; } } @@ -220,7 +210,7 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) if (isGeofenceClient(locationCallbacks)) { if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { gData.geofenceInterface = - (GeofenceInterface*)loadLocationInterface("libgeofence.so", "getGeofenceInterface"); + (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); if (NULL == gData.geofenceInterface) { gGeofenceLoadFailed = true; LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); @@ -254,13 +244,14 @@ LocationAPI::destroy(locationApiDestroyCompleteCallback destroyCompleteCb) if (it != gData.clientData.end()) { bool removeFromGnssInf = (isGnssClient(it->second) && NULL != gData.gnssInterface); - bool removeFromFlpInf = - (isFlpClient(it->second) && NULL != gData.flpInterface); + bool removeFromBatchingInf = + (isBatchingClient(it->second) && NULL != gData.batchingInterface); bool removeFromGeofenceInf = (isGeofenceClient(it->second) && NULL != gData.geofenceInterface); - bool needToWait = (removeFromGnssInf || removeFromFlpInf || removeFromGeofenceInf); - LOC_LOGe("removeFromGnssInf: %d, removeFromFlpInf: %d, removeFromGeofenceInf: %d, need %d", - removeFromGnssInf, removeFromFlpInf, removeFromGeofenceInf, needToWait); + bool needToWait = (removeFromGnssInf || removeFromBatchingInf || removeFromGeofenceInf); + LOC_LOGe("removeFromGnssInf: %d, removeFromBatchingInf: %d, removeFromGeofenceInf: %d," + "need %d", removeFromGnssInf, removeFromBatchingInf, removeFromGeofenceInf, + needToWait); if ((NULL != destroyCompleteCb) && (true == needToWait)) { LocationAPIDestroyCbData destroyCbData = {}; @@ -271,7 +262,7 @@ LocationAPI::destroy(locationApiDestroyCompleteCallback destroyCompleteCb) destroyCbData.waitAdapterMask = (removeFromGnssInf ? LOCATION_ADAPTER_GNSS_TYPE_BIT : 0); destroyCbData.waitAdapterMask |= - (removeFromFlpInf ? LOCATION_ADAPTER_FLP_TYPE_BIT : 0); + (removeFromBatchingInf ? LOCATION_ADAPTER_BATCHING_TYPE_BIT : 0); destroyCbData.waitAdapterMask |= (removeFromGeofenceInf ? LOCATION_ADAPTER_GEOFENCE_TYPE_BIT : 0); gData.destroyClientData[this] = destroyCbData; @@ -282,9 +273,9 @@ LocationAPI::destroy(locationApiDestroyCompleteCallback destroyCompleteCb) gData.gnssInterface->removeClient(it->first, onGnssRemoveClientCompleteCb); } - if (removeFromFlpInf) { - gData.flpInterface->removeClient(it->first, - onFlpRemoveClientCompleteCb); + if (removeFromBatchingInf) { + gData.batchingInterface->removeClient(it->first, + onBatchingRemoveClientCompleteCb); } if (removeFromGeofenceInf) { gData.geofenceInterface->removeClient(it->first, @@ -347,27 +338,27 @@ LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) } } - if (isFlpClient(locationCallbacks)) { - if (NULL == gData.flpInterface && !gFlpLoadFailed) { - gData.flpInterface = - (FlpInterface*)loadLocationInterface("libflp.so", "getFlpInterface"); - if (NULL == gData.flpInterface) { - gFlpLoadFailed = true; - LOC_LOGW("%s:%d]: No flp interface available", __func__, __LINE__); + if (isBatchingClient(locationCallbacks)) { + if (NULL == gData.batchingInterface && !gBatchingLoadFailed) { + gData.batchingInterface = + (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); + if (NULL == gData.batchingInterface) { + gBatchingLoadFailed = true; + LOC_LOGW("%s:%d]: No batching interface available", __func__, __LINE__); } else { - gData.flpInterface->initialize(); + gData.batchingInterface->initialize(); } } - if (NULL != gData.flpInterface) { + if (NULL != gData.batchingInterface) { // either adds new Client or updates existing Client - gData.flpInterface->addClient(this, locationCallbacks); + gData.batchingInterface->addClient(this, locationCallbacks); } } if (isGeofenceClient(locationCallbacks)) { if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { gData.geofenceInterface = - (GeofenceInterface*)loadLocationInterface("libgeofence.so", "getGeofenceInterface"); + (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); if (NULL == gData.geofenceInterface) { gGeofenceLoadFailed = true; LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); @@ -394,16 +385,10 @@ LocationAPI::startTracking(TrackingOptions& trackingOptions) auto it = gData.clientData.find(this); if (it != gData.clientData.end()) { - if (NULL != gData.flpInterface && trackingOptions.minDistance > 0) { - id = gData.flpInterface->startTracking(this, trackingOptions); - } else if (NULL != gData.gnssInterface && needsGnssTrackingInfo(it->second)) { - id = gData.gnssInterface->startTracking(this, trackingOptions); - } else if (NULL != gData.flpInterface) { - id = gData.flpInterface->startTracking(this, trackingOptions); - } else if (NULL != gData.gnssInterface) { + if (NULL != gData.gnssInterface) { id = gData.gnssInterface->startTracking(this, trackingOptions); } else { - LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + LOC_LOGE("%s:%d]: No gnss interface available for Location API client %p ", __func__, __LINE__, this); } } else { @@ -422,16 +407,10 @@ LocationAPI::stopTracking(uint32_t id) auto it = gData.clientData.find(this); if (it != gData.clientData.end()) { - // we don't know if tracking was started on flp or gnss, so we call stop on both, where - // stopTracking call to the incorrect interface will fail without response back to client if (gData.gnssInterface != NULL) { gData.gnssInterface->stopTracking(this, id); - } - if (gData.flpInterface != NULL) { - gData.flpInterface->stopTracking(this, id); - } - if (gData.flpInterface == NULL && gData.gnssInterface == NULL) { - LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location API client %p ", __func__, __LINE__, this); } } else { @@ -450,16 +429,10 @@ LocationAPI::updateTrackingOptions( auto it = gData.clientData.find(this); if (it != gData.clientData.end()) { - // we don't know if tracking was started on flp or gnss, so we call update on both, where - // updateTracking call to the incorrect interface will fail without response back to client if (gData.gnssInterface != NULL) { gData.gnssInterface->updateTrackingOptions(this, id, trackingOptions); - } - if (gData.flpInterface != NULL) { - gData.flpInterface->updateTrackingOptions(this, id, trackingOptions); - } - if (gData.flpInterface == NULL && gData.gnssInterface == NULL) { - LOC_LOGE("%s:%d]: No gnss/flp interface available for Location API client %p ", + } else { + LOC_LOGE("%s:%d]: No gnss interface available for Location API client %p ", __func__, __LINE__, this); } } else { @@ -476,10 +449,10 @@ LocationAPI::startBatching(BatchingOptions &batchingOptions) uint32_t id = 0; pthread_mutex_lock(&gDataMutex); - if (NULL != gData.flpInterface) { - id = gData.flpInterface->startBatching(this, batchingOptions); + if (NULL != gData.batchingInterface) { + id = gData.batchingInterface->startBatching(this, batchingOptions); } else { - LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + LOC_LOGE("%s:%d]: No batching interface available for Location API client %p ", __func__, __LINE__, this); } @@ -492,10 +465,10 @@ LocationAPI::stopBatching(uint32_t id) { pthread_mutex_lock(&gDataMutex); - if (NULL != gData.flpInterface) { - gData.flpInterface->stopBatching(this, id); + if (NULL != gData.batchingInterface) { + gData.batchingInterface->stopBatching(this, id); } else { - LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + LOC_LOGE("%s:%d]: No batching interface available for Location API client %p ", __func__, __LINE__, this); } @@ -507,10 +480,10 @@ LocationAPI::updateBatchingOptions(uint32_t id, BatchingOptions& batchOptions) { pthread_mutex_lock(&gDataMutex); - if (NULL != gData.flpInterface) { - gData.flpInterface->updateBatchingOptions(this, id, batchOptions); + if (NULL != gData.batchingInterface) { + gData.batchingInterface->updateBatchingOptions(this, id, batchOptions); } else { - LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + LOC_LOGE("%s:%d]: No batching interface available for Location API client %p ", __func__, __LINE__, this); } @@ -522,10 +495,10 @@ LocationAPI::getBatchedLocations(uint32_t id, size_t count) { pthread_mutex_lock(&gDataMutex); - if (gData.flpInterface != NULL) { - gData.flpInterface->getBatchedLocations(this, id, count); + if (gData.batchingInterface != NULL) { + gData.batchingInterface->getBatchedLocations(this, id, count); } else { - LOC_LOGE("%s:%d]: No flp interface available for Location API client %p ", + LOC_LOGE("%s:%d]: No batching interface available for Location API client %p ", __func__, __LINE__, this); } diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 0a2c0608..1cb63fe3 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1336,7 +1336,7 @@ typedef std::function Date: Thu, 14 Mar 2019 18:16:45 +0800 Subject: [PATCH 817/945] add sufficient delimiter for blank GSA sentence Change-Id: I96e7dec543a4bfb326e5c72d9e943a57d183cf87 CRs-Fixed: 2416152 --- utils/loc_nmea.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 0f7c48ff..6b814d30 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1491,15 +1491,15 @@ void loc_nmea_generate_pos(const UlpLocation &location, } //Send blank NMEA reports for non-final fixes else { - strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$PQGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); + strlcpy(sentence, "$PQGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); From a6c61bde6a815aa723fd3dc144875e5758349955 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 4 Apr 2019 13:36:47 +0530 Subject: [PATCH 818/945] Temp compilation fix for LKG integration CRs-Fixed: 2429432 Change-Id: I8141c5583cddbd0118b9e13ddf07534ee890372c --- android/2.0/Gnss.cpp | 10 ++++++++++ android/2.0/Gnss.h | 4 ++++ android/2.0/location_api/MeasurementAPIClient.cpp | 8 +++++--- .../1.0/MeasurementCorrections.cpp | 4 ++++ .../1.0/MeasurementCorrections.h | 4 ++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index cd886499..43a2dbb1 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -511,6 +511,16 @@ Return Gnss::injectBestLocation_2_0( return false; } +Return> Gnss::getExtensionGnssBatching_2_0() { + ENTRY_LOG_CALLFLOW(); + return nullptr; +} + +Return> Gnss::getExtensionGnssDebug_2_0() { + ENTRY_LOG_CALLFLOW(); + return nullptr; +} + IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h index dfae2a3e..eefe8e02 100644 --- a/android/2.0/Gnss.h +++ b/android/2.0/Gnss.h @@ -121,6 +121,10 @@ struct Gnss : public IGnss { Return injectBestLocation_2_0(const ::android::hardware::gnss::V2_0::GnssLocation& location) override; + Return> getExtensionGnssBatching_2_0() override; + Return> getExtensionGnssDebug_2_0() override; + + /** * This method returns the IGnssVisibilityControl interface. * diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp index 1d82139e..d9cae18b 100644 --- a/android/2.0/location_api/MeasurementAPIClient.cpp +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -374,9 +374,11 @@ static void convertGnssData_2_0(GnssMeasurementsNotification& in, if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT) out.measurements[i].v1_1.accumulatedDeltaRangeState |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED; - out.measurements[i].codeType = - static_cast(in.measurements[i].codeType); - out.measurements[i].otherCodeTypeName = in.measurements[i].otherCodeTypeName; + +// out.measurements[i].codeType = +// static_cast(in.measurements[i].codeType); +// out.measurements[i].otherCodeTypeName = in.measurements[i].otherCodeTypeName; + if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) diff --git a/android/measurement_corrections/1.0/MeasurementCorrections.cpp b/android/measurement_corrections/1.0/MeasurementCorrections.cpp index bca4c45f..c1a335aa 100644 --- a/android/measurement_corrections/1.0/MeasurementCorrections.cpp +++ b/android/measurement_corrections/1.0/MeasurementCorrections.cpp @@ -58,6 +58,10 @@ Return MeasurementCorrections::setCorrections(const ::android::hardware::g return true; } +Return MeasurementCorrections::setCallback(const sp& callback) { + return true; +} + } // namespace implementation } // namespace V1_0 } // namespace measurement_corrections diff --git a/android/measurement_corrections/1.0/MeasurementCorrections.h b/android/measurement_corrections/1.0/MeasurementCorrections.h index 231c5349..ad534dc1 100644 --- a/android/measurement_corrections/1.0/MeasurementCorrections.h +++ b/android/measurement_corrections/1.0/MeasurementCorrections.h @@ -31,6 +31,7 @@ #define ANDROID_HARDWARE_GNSS_V1_0_MeasurementCorrections_H #include +#include #include #include @@ -51,6 +52,7 @@ using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrectionsCallback; struct MeasurementCorrections : public IMeasurementCorrections { MeasurementCorrections(); @@ -59,6 +61,8 @@ struct MeasurementCorrections : public IMeasurementCorrections { // Methods from ::android::hardware::gnss::measurement_corrections::V1_0::IMeasurementCorrections follow. Return setCorrections(const ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections& corrections) override; +Return setCallback(const sp& callback) override; + }; From b95f05cc738a5de5d3dd9751af6da532c6f0079a Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 8 Apr 2019 11:17:31 -0700 Subject: [PATCH 819/945] Streamline measurements processing Consolidate the translation from QMI LOC into one place in order to minimize traffic Change-Id: I73c2f25e94544a2b69d4227c63548ef11b6a4d91 CRs-fixed: 2430668 --- core/LocAdapterBase.cpp | 6 +----- core/LocAdapterBase.h | 3 +-- core/LocApiBase.cpp | 13 ++----------- core/LocApiBase.h | 3 +-- gnss/GnssAdapter.cpp | 17 ++++++----------- gnss/GnssAdapter.h | 3 +-- location/LocationDataTypes.h | 2 +- utils/gps_extended_c.h | 6 ++++++ 8 files changed, 19 insertions(+), 34 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5f6a0c8e..6fad918b 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -100,10 +100,6 @@ void LocAdapterBase:: bool /*fromEngineHub*/) DEFAULT_IMPL() -void LocAdapterBase:: - reportSvMeasurementEvent(GnssSvMeasurementSet &/*svMeasurementSet*/) -DEFAULT_IMPL() - void LocAdapterBase:: reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/) DEFAULT_IMPL() @@ -162,7 +158,7 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) void LocAdapterBase:: - reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurements*/, +reportGnssMeasurementsEvent(const GnssMeasurements& /*gnssMeasurements*/, int /*msInWeek*/) DEFAULT_IMPL() diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 05b72dbe..13c84936 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -158,7 +158,6 @@ public: bool fromEngineHub=false); virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); virtual void reportNmeaEvent(const char* nmea, size_t length); - virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportSvEphemerisEvent(GnssSvEphemerisReport &svEphemeris); virtual void reportStatus(LocGpsStatusValue status); @@ -175,7 +174,7 @@ public: virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } - virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, + virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements, int msInWeek); virtual bool reportWwanZppFix(LocGpsLocation &zppLoc); virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 3c67af2e..c1723766 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -434,14 +434,6 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) ); } -void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvMeasurementEvent(svMeasurementSet) - ); -} - void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) { // loop through adapters, and deliver to all adapters. @@ -534,11 +526,10 @@ void* LocApiBase :: getSibling() LocApiProxyBase* LocApiBase :: getLocApiProxy() DEFAULT_IMPL(NULL) -void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurements, - int msInWeek) +void LocApiBase::reportGnssMeasurements(GnssMeasurements& gnssMeasurements, int msInWeek) { // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurements, msInWeek)); + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementsEvent(gnssMeasurements, msInWeek)); } void LocApiBase::reportGnssSvIdConfig(const GnssSvIdConfig& config) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index afdb83ce..1c2afafe 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -164,7 +164,6 @@ public: GnssDataNotification* pDataNotify = nullptr, int msInWeek = -1); void reportSv(GnssSvNotification& svNotify); - void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); void reportSvPolynomial(GnssSvPolynomial &svPolynomial); void reportSvEphemeris(GnssSvEphemerisReport &svEphemeris); void reportStatus(LocGpsStatusValue status); @@ -179,7 +178,7 @@ public: void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); void releaseATL(int connHandle); void requestNiNotify(GnssNiNotification ¬ify, const void* data); - void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek); + void reportGnssMeasurements(GnssMeasurements& gnssMeasurements, int msInWeek); void reportWwanZppFix(LocGpsLocation &zppLoc); void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, LocPosTechMask tech_mask); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index febea69b..3563ed03 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3575,20 +3575,21 @@ GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data) } void -GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, +GnssAdapter::reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements, int msInWeek) { LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek); struct MsgReportGnssMeasurementData : public LocMsg { GnssAdapter& mAdapter; + GnssMeasurements mGnssMeasurements; GnssMeasurementsNotification mMeasurementsNotify; inline MsgReportGnssMeasurementData(GnssAdapter& adapter, - const GnssMeasurementsNotification& measurements, + const GnssMeasurements& gnssMeasurements, int msInWeek) : LocMsg(), mAdapter(adapter), - mMeasurementsNotify(measurements) { + mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) { if (-1 != msInWeek) { mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek); } @@ -3598,7 +3599,8 @@ GnssAdapter::reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& } }; - sendMsg(new MsgReportGnssMeasurementData(*this, measurements, msInWeek)); + sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek)); + mEngHubProxy->gnssReportSvMeasurement(gnssMeasurements.gnssSvMeasurementSet); } void @@ -3611,13 +3613,6 @@ GnssAdapter::reportGnssMeasurementData(const GnssMeasurementsNotification& measu } } -void -GnssAdapter::reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet) -{ - LOC_LOGD("%s]: ", __func__); - mEngHubProxy->gnssReportSvMeasurement(svMeasurementSet); -} - void GnssAdapter::reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1ed11517..9720ba41 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -354,9 +354,8 @@ public: virtual void reportNmeaEvent(const char* nmea, size_t length); virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); - virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements, + virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements, int msInWeek); - virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportSvEphemerisEvent(GnssSvEphemerisReport & svEphemeris); virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 1cb63fe3..f8bb6cba 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -38,7 +38,7 @@ #define GNSS_NI_REQUESTOR_MAX (256) #define GNSS_NI_MESSAGE_ID_MAX (2048) #define GNSS_SV_MAX (176) -#define GNSS_MEASUREMENTS_MAX (64) +#define GNSS_MEASUREMENTS_MAX (128) #define GNSS_UTC_TIME_OFFSET (3657) #define GNSS_BUGREPORT_GPS_MIN (1) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 680f9381..242fe84a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1397,6 +1397,12 @@ typedef struct { } GnssSvMeasurementSet; +typedef struct { + uint32_t size; // set to sizeof(GnssMeasurements) + GnssSvMeasurementSet gnssSvMeasurementSet; + GnssMeasurementsNotification gnssMeasNotification; +} GnssMeasurements; + typedef enum { GNSS_SV_POLY_COEFF_VALID = 0x01, From 07db01d9af3ac18a2be12bbf58904a6d6fb749f6 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 5 Apr 2019 19:46:29 -0700 Subject: [PATCH 820/945] LocIpc derefs nullptr if stopping blocking listener LocIpcRunnable is created only for nonBlocking listeners. But stopListening would use LocIpcRunnable not knowing if this is a blocking or nonblocking listener. LocIpcRunnable is no longer a shared resource between the two threads. We use a copy of string to keep the needed socket name. Change-Id: Ib5c57a89f630807d6d03f3fbc698a56b9ffddf4d CRs-Fixed: 2431397 --- utils/LocIpc.cpp | 38 ++++++++++++++++++++------------------ utils/LocIpc.h | 6 ++++-- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 7347b781..4178d52a 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -33,6 +33,8 @@ #include #include "LocIpc.h" +using std::string; + namespace loc_util { #ifdef LOG_TAG @@ -47,7 +49,7 @@ namespace loc_util { class LocIpcRunnable : public LocRunnable { friend LocIpc; public: - LocIpcRunnable(LocIpc& locIpc, const std::string& ipcName) + LocIpcRunnable(LocIpc& locIpc, const string& ipcName) : mLocIpc(locIpc), mIpcName(ipcName) {} bool run() override { if (!mLocIpc.startListeningBlocking(mIpcName)) { @@ -58,17 +60,17 @@ public: } private: LocIpc& mLocIpc; - const std::string mIpcName; + const string mIpcName; }; -bool LocIpc::startListeningNonBlocking(const std::string& name) { - mRunnable = new LocIpcRunnable(*this, name); - std::string threadName("LocIpc-"); +bool LocIpc::startListeningNonBlocking(const string& name) { + auto runnable = new LocIpcRunnable(*this, name); + string threadName("LocIpc-"); threadName.append(name); - return mThread.start(threadName.c_str(), mRunnable); + return mThread.start(threadName.c_str(), runnable); } -bool LocIpc::startListeningBlocking(const std::string& name) { +bool LocIpc::startListeningBlocking(const string& name) { bool stopRequested = false; int fd = socket(AF_UNIX, SOCK_DGRAM, 0); @@ -90,13 +92,14 @@ bool LocIpc::startListeningBlocking(const std::string& name) { LOC_LOGe("bind socket error. reason:%s", strerror(errno)); } else { mIpcFd = fd; + mIpcName = name; // inform that the socket is ready to receive message onListenerReady(); ssize_t nBytes = 0; - std::string msg = ""; - std::string abort = LOC_MSG_ABORT; + string msg = ""; + string abort = LOC_MSG_ABORT; while (1) { msg.resize(LOC_MSG_BUF_LEN); nBytes = ::recvfrom(fd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); @@ -147,20 +150,19 @@ bool LocIpc::startListeningBlocking(const std::string& name) { } void LocIpc::stopListening() { - const char *socketName = nullptr; - if (mIpcFd >= 0) { - std::string abort = LOC_MSG_ABORT; - socketName = (reinterpret_cast(mRunnable))->mIpcName.c_str(); - send(socketName, abort); + string abort = LOC_MSG_ABORT; + if (!mIpcName.empty()) { + send(mIpcName.c_str(), abort); + } mIpcFd = -1; } - if (mRunnable) { - mRunnable = nullptr; + if (!mIpcName.empty()) { + mIpcName.clear(); } } -bool LocIpc::send(const char name[], const std::string& data) { +bool LocIpc::send(const char name[], const string& data) { return send(name, (const uint8_t*)data.c_str(), data.length()); } @@ -195,7 +197,7 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin result = false; } } else { - std::string head = LOC_MSG_HEAD; + string head = LOC_MSG_HEAD; head.append(std::to_string(length)); if (::sendto(fd, head.c_str(), head.length(), 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 87f2ff8c..2dee5ffd 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -37,6 +37,8 @@ #include #include +using std::string; + namespace loc_util { class LocIpcSender; @@ -44,7 +46,7 @@ class LocIpcSender; class LocIpc { friend LocIpcSender; public: - inline LocIpc() : mIpcFd(-1), mRunnable(nullptr) {} + inline LocIpc() : mIpcFd(-1) {} inline virtual ~LocIpc() { stopListening(); } // Listen for new messages in current thread. Calling this funciton will @@ -94,7 +96,7 @@ private: int mIpcFd; LocThread mThread; - LocRunnable *mRunnable; + string mIpcName; }; class LocIpcSender { From 313284b9ddbad37302a90bd53521f1046ba91834 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Thu, 4 Apr 2019 14:22:23 +0800 Subject: [PATCH 821/945] fix CFI issues Change-Id: I5b94804c381f1d26196ddf6dee97adbee36dc128 CRs-Fixed: 2353650 --- android/1.0/Gnss.cpp | 10 +++---- android/1.0/Gnss.h | 4 +-- android/1.1/Gnss.cpp | 18 ++++++------ android/1.1/Gnss.h | 6 ++-- android/2.0/Gnss.cpp | 18 ++++++------ android/2.0/Gnss.h | 6 ++-- location/LocationAPI.cpp | 63 ++++++++++++++++++---------------------- 7 files changed, 60 insertions(+), 65 deletions(-) diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp index 6e34f1e5..93b320bc 100644 --- a/android/1.0/Gnss.cpp +++ b/android/1.0/Gnss.cpp @@ -27,7 +27,7 @@ #include "Gnss.h" #include -typedef void* (getLocationInterface)(); +typedef const GnssInterface* (getLocationInterface)(); namespace android { namespace hardware { @@ -84,7 +84,7 @@ GnssAPIClient* Gnss::getApi() { return mApi; } -GnssInterface* Gnss::getGnssInterface() { +const GnssInterface* Gnss::getGnssInterface() { static bool getGnssInterfaceFailed = false; if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); @@ -105,7 +105,7 @@ GnssInterface* Gnss::getGnssInterface() { if (NULL == getter) { getGnssInterfaceFailed = true; } else { - mGnssInterface = (GnssInterface*)(*getter)(); + mGnssInterface = (const GnssInterface*)(*getter)(); } } return mGnssInterface; @@ -238,7 +238,7 @@ Return Gnss::injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); return true; @@ -250,7 +250,7 @@ Return Gnss::injectLocation(double latitudeDegrees, Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); return true; diff --git a/android/1.0/Gnss.h b/android/1.0/Gnss.h index c23b3370..900a5104 100644 --- a/android/1.0/Gnss.h +++ b/android/1.0/Gnss.h @@ -99,7 +99,7 @@ struct Gnss : public IGnss { GnssAPIClient* getApi(); Return setGnssNiCb(const sp& niCb); Return updateConfiguration(GnssConfig& gnssConfig); - GnssInterface* getGnssInterface(); + const GnssInterface* getGnssInterface(); // Callback for ODCPI request void odcpiRequestCb(const OdcpiRequestInfo& request); @@ -129,7 +129,7 @@ struct Gnss : public IGnss { sp mGnssCbIface = nullptr; sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; - GnssInterface* mGnssInterface = nullptr; + const GnssInterface* mGnssInterface = nullptr; }; extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index fca72e6e..8d5d8a82 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/Gnss.cpp @@ -27,7 +27,7 @@ #include "Gnss.h" #include -typedef void* (getLocationInterface)(); +typedef const GnssInterface* (getLocationInterface)(); #define IMAGES_INFO_FILE "/sys/devices/soc0/images" #define DELIMITER ";" @@ -124,7 +124,7 @@ GnssAPIClient* Gnss::getApi() { return mApi; } -GnssInterface* Gnss::getGnssInterface() { +const GnssInterface* Gnss::getGnssInterface() { static bool getGnssInterfaceFailed = false; if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); @@ -145,7 +145,7 @@ GnssInterface* Gnss::getGnssInterface() { if (NULL == getter) { getGnssInterfaceFailed = true; } else { - mGnssInterface = (GnssInterface*)(*getter)(); + mGnssInterface = (const GnssInterface*)(*getter)(); } } return mGnssInterface; @@ -278,7 +278,7 @@ Return Gnss::injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); return true; @@ -290,7 +290,7 @@ Return Gnss::injectLocation(double latitudeDegrees, Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); return true; @@ -375,7 +375,7 @@ Return Gnss::setCallback_1_1(const sp& callback) { ENTRY_LOG_CALLFLOW(); callback->gnssNameCb(getVersionString()); mGnssCbIface_1_1 = callback; - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { odcpiRequestCb(odcpiRequest); @@ -419,7 +419,7 @@ Return> Gnss::getExtensionGnssConfiguration_1_1() { Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { Location location = {}; convertGnssLocation(gnssLocation, location); @@ -446,9 +446,9 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { } } -IGnss* HIDL_FETCH_IGnss(const char* hal) { +V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); - IGnss* iface = nullptr; + V1_0::IGnss* iface = nullptr; iface = new Gnss(); if (iface == nullptr) { LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal); diff --git a/android/1.1/Gnss.h b/android/1.1/Gnss.h index 4c0c8b05..15645ebf 100644 --- a/android/1.1/Gnss.h +++ b/android/1.1/Gnss.h @@ -109,7 +109,7 @@ struct Gnss : public IGnss { GnssAPIClient* getApi(); Return setGnssNiCb(const sp& niCb); Return updateConfiguration(GnssConfig& gnssConfig); - GnssInterface* getGnssInterface(); + const GnssInterface* getGnssInterface(); // Callback for ODCPI request void odcpiRequestCb(const OdcpiRequestInfo& request); @@ -140,10 +140,10 @@ struct Gnss : public IGnss { sp mGnssCbIface_1_1 = nullptr; sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; - GnssInterface* mGnssInterface = nullptr; + const GnssInterface* mGnssInterface = nullptr; }; -extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); +extern "C" V1_0::IGnss* HIDL_FETCH_IGnss(const char* name); } // namespace implementation } // namespace V1_1 diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 43a2dbb1..1021938e 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -27,7 +27,7 @@ #include "Gnss.h" #include "LocationUtil.h" -typedef void* (getLocationInterface)(); +typedef const GnssInterface* (getLocationInterface)(); #define IMAGES_INFO_FILE "/sys/devices/soc0/images" #define DELIMITER ";" @@ -125,7 +125,7 @@ GnssAPIClient* Gnss::getApi() { return mApi; } -GnssInterface* Gnss::getGnssInterface() { +const GnssInterface* Gnss::getGnssInterface() { static bool getGnssInterfaceFailed = false; if (nullptr == mGnssInterface && !getGnssInterfaceFailed) { LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__); @@ -146,7 +146,7 @@ GnssInterface* Gnss::getGnssInterface() { if (NULL == getter) { getGnssInterfaceFailed = true; } else { - mGnssInterface = (GnssInterface*)(*getter)(); + mGnssInterface = (const GnssInterface*)(*getter)(); } } return mGnssInterface; @@ -283,7 +283,7 @@ Return Gnss::injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters); return true; @@ -295,7 +295,7 @@ Return Gnss::injectLocation(double latitudeDegrees, Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs); return true; @@ -383,7 +383,7 @@ Return Gnss::setCallback_1_1(const sp& callback) { ENTRY_LOG_CALLFLOW(); callback->gnssNameCb(getVersionString()); mGnssCbIface_1_1 = callback; - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { odcpiRequestCb(odcpiRequest); @@ -431,7 +431,7 @@ Return> Gnss::getExtensionGnssConfiguration_1_1() { Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { Location location = {}; convertGnssLocation(gnssLocation, location); @@ -521,9 +521,9 @@ Return> Gnss::getExtensionGnssDebug_2_0() { return nullptr; } -IGnss* HIDL_FETCH_IGnss(const char* hal) { +V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); - IGnss* iface = nullptr; + V1_0::IGnss* iface = nullptr; iface = new Gnss(); if (iface == nullptr) { LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal); diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h index eefe8e02..df629012 100644 --- a/android/2.0/Gnss.h +++ b/android/2.0/Gnss.h @@ -138,7 +138,7 @@ struct Gnss : public IGnss { GnssAPIClient* getApi(); Return setGnssNiCb(const sp& niCb); Return updateConfiguration(GnssConfig& gnssConfig); - GnssInterface* getGnssInterface(); + const GnssInterface* getGnssInterface(); // Callback for ODCPI request void odcpiRequestCb(const OdcpiRequestInfo& request); @@ -171,10 +171,10 @@ struct Gnss : public IGnss { GnssAPIClient* mApi = nullptr; GnssConfig mPendingConfig; - GnssInterface* mGnssInterface = nullptr; + const GnssInterface* mGnssInterface = nullptr; }; -extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); +extern "C" V1_0::IGnss* HIDL_FETCH_IGnss(const char* name); } // namespace implementation } // namespace V2_0 diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index f3088bcd..a43178d1 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -34,8 +34,11 @@ #include #include #include +#include -typedef void* (getLocationInterface)(); +typedef const GnssInterface* (getGnssInterface)(); +typedef const GeofenceInterface* (getGeofenceInterface)(); +typedef const BatchingInterface* (getBatchingInterface)(); typedef struct { // bit mask of the adpaters that we need to wait for the removeClientCompleteCallback @@ -66,6 +69,17 @@ static bool gGnssLoadFailed = false; static bool gBatchingLoadFailed = false; static bool gGeofenceLoadFailed = false; +template +static const T1* loadLocationInterface(const char* library, const char* name) { + void* libhandle = nullptr; + T2* getter = (T2*)dlGetSymFromLib(libhandle, library, name); + if (nullptr == getter) { + return (const T1*) getter; + }else { + return (*getter)(); + } +} + static bool isGnssClient(LocationCallbacks& locationCallbacks) { return (locationCallbacks.gnssNiCb != nullptr || @@ -85,32 +99,6 @@ static bool isGeofenceClient(LocationCallbacks& locationCallbacks) locationCallbacks.geofenceStatusCb != nullptr); } -static void* loadLocationInterface(const char* library, const char* name) -{ - LOC_LOGD("%s]: loading %s::%s ...", __func__, library, name); - if (NULL == library || NULL == name) { - return NULL; - } - getLocationInterface* getter = NULL; - const char *error = NULL; - dlerror(); - void *handle = dlopen(library, RTLD_NOW); - if (NULL == handle || (error = dlerror()) != NULL) { - LOC_LOGW("dlopen for %s failed, error = %s", library, error); - } else { - getter = (getLocationInterface*)dlsym(handle, name); - if ((error = dlerror()) != NULL) { - LOC_LOGW("dlsym for %s::%s failed, error = %s", library, name, error); - getter = NULL; - } - } - - if (NULL == getter) { - return (void*)getter; - } else { - return (*getter)(); - } -} void LocationAPI::onRemoveClientCompleteCb (LocationAdapterTypeMask adapterType) { @@ -170,7 +158,8 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) if (isGnssClient(locationCallbacks)) { if (NULL == gData.gnssInterface && !gGnssLoadFailed) { gData.gnssInterface = - (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); if (NULL == gData.gnssInterface) { gGnssLoadFailed = true; LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); @@ -190,7 +179,8 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) if (isBatchingClient(locationCallbacks)) { if (NULL == gData.batchingInterface && !gBatchingLoadFailed) { gData.batchingInterface = - (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); + (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); if (NULL == gData.batchingInterface) { gBatchingLoadFailed = true; LOC_LOGW("%s:%d]: No batching interface available", __func__, __LINE__); @@ -210,7 +200,8 @@ LocationAPI::createInstance(LocationCallbacks& locationCallbacks) if (isGeofenceClient(locationCallbacks)) { if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { gData.geofenceInterface = - (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); + (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); if (NULL == gData.geofenceInterface) { gGeofenceLoadFailed = true; LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); @@ -324,7 +315,8 @@ LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) if (isGnssClient(locationCallbacks)) { if (NULL == gData.gnssInterface && !gGnssLoadFailed) { gData.gnssInterface = - (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); if (NULL == gData.gnssInterface) { gGnssLoadFailed = true; LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); @@ -341,7 +333,8 @@ LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) if (isBatchingClient(locationCallbacks)) { if (NULL == gData.batchingInterface && !gBatchingLoadFailed) { gData.batchingInterface = - (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); + (BatchingInterface*)loadLocationInterface("libbatching.so", "getBatchingInterface"); if (NULL == gData.batchingInterface) { gBatchingLoadFailed = true; LOC_LOGW("%s:%d]: No batching interface available", __func__, __LINE__); @@ -358,7 +351,8 @@ LocationAPI::updateCallbacks(LocationCallbacks& locationCallbacks) if (isGeofenceClient(locationCallbacks)) { if (NULL == gData.geofenceInterface && !gGeofenceLoadFailed) { gData.geofenceInterface = - (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); + (GeofenceInterface*)loadLocationInterface("libgeofencing.so", "getGeofenceInterface"); if (NULL == gData.geofenceInterface) { gGeofenceLoadFailed = true; LOC_LOGW("%s:%d]: No geofence interface available", __func__, __LINE__); @@ -606,7 +600,8 @@ LocationControlAPI::createInstance(LocationControlCallbacks& locationControlCall if (nullptr != locationControlCallbacks.responseCb && NULL == gData.controlAPI) { if (NULL == gData.gnssInterface && !gGnssLoadFailed) { gData.gnssInterface = - (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); + (GnssInterface*)loadLocationInterface("libgnss.so", "getGnssInterface"); if (NULL == gData.gnssInterface) { gGnssLoadFailed = true; LOC_LOGW("%s:%d]: No gnss interface available", __func__, __LINE__); From a65b865a1bbc600c78cda42fcc53e42d3b7cc49c Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Wed, 10 Apr 2019 12:52:04 +0800 Subject: [PATCH 822/945] modify NMEA according to version 4.11 1.modify BDS/QZSS/NavIC system id and signal id 2.add GNS sentence Change-Id: I81c5c6806e8c4cdf2aee32415b0cfa3a3b1b0cd1 CRs-Fixed: 2432122 --- utils/loc_nmea.cpp | 224 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 200 insertions(+), 24 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 6b814d30..9cd34720 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -44,9 +44,9 @@ #define SYSTEM_ID_GPS 1 #define SYSTEM_ID_GLONASS 2 #define SYSTEM_ID_GALILEO 3 -// Extended systems -#define SYSTEM_ID_BEIDOU 4 +#define SYSTEM_ID_BDS 4 #define SYSTEM_ID_QZSS 5 +#define SYSTEM_ID_NAVIC 6 //GNSS signal id according to NMEA spec #define SIGNAL_ID_ALL_SIGNALS 0 @@ -74,11 +74,35 @@ #define SIGNAL_ID_GAL_L1A 6 #define SIGNAL_ID_GAL_L1BC 7 -//Extended signal id #define SIGNAL_ID_BDS_B1I 1 -#define SIGNAL_ID_BDS_B1C 2 -#define SIGNAL_ID_BDS_B2I 3 -#define SIGNAL_ID_BDS_B2AI 4 +#define SIGNAL_ID_BDS_B1Q 2 +#define SIGNAL_ID_BDS_B1C 3 +#define SIGNAL_ID_BDS_B1A 4 +#define SIGNAL_ID_BDS_B2A 5 +#define SIGNAL_ID_BDS_B2B 6 +#define SIGNAL_ID_BDS_B2AB 7 +#define SIGNAL_ID_BDS_B3I 8 +#define SIGNAL_ID_BDS_B3Q 9 +#define SIGNAL_ID_BDS_B3A 0xA +#define SIGNAL_ID_BDS_B2I 0xB +#define SIGNAL_ID_BDS_B2Q 0xC + +#define SIGNAL_ID_QZSS_L1CA 1 +#define SIGNAL_ID_QZSS_L1CD 2 +#define SIGNAL_ID_QZSS_L1CP 3 +#define SIGNAL_ID_QZSS_LIS 4 +#define SIGNAL_ID_QZSS_L2CM 5 +#define SIGNAL_ID_QZSS_L2CL 6 +#define SIGNAL_ID_QZSS_L5I 7 +#define SIGNAL_ID_QZSS_L5Q 8 +#define SIGNAL_ID_QZSS_L6D 9 +#define SIGNAL_ID_QZSS_L6E 0xA + +#define SIGNAL_ID_NAVIC_L5SPS 1 +#define SIGNAL_ID_NAVIC_SSPS 2 +#define SIGNAL_ID_NAVIC_L5RS 3 +#define SIGNAL_ID_NAVIC_SRS 4 +#define SIGNAL_ID_NAVIC_L1SPS 5 typedef struct loc_nmea_sv_meta_s @@ -280,13 +304,13 @@ static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) signalId = SIGNAL_ID_GAL_E5B; break; case GNSS_SIGNAL_QZSS_L1CA: - signalId = SIGNAL_ID_GPS_L1CA; + signalId = SIGNAL_ID_QZSS_L1CA; break; case GNSS_SIGNAL_QZSS_L2: - signalId = SIGNAL_ID_GPS_L2CL; + signalId = SIGNAL_ID_QZSS_L2CL; break; case GNSS_SIGNAL_QZSS_L5: - signalId = SIGNAL_ID_GPS_L5Q; + signalId = SIGNAL_ID_QZSS_L5Q; break; case GNSS_SIGNAL_BEIDOU_B1I: signalId = SIGNAL_ID_BDS_B1I; @@ -298,7 +322,7 @@ static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) signalId = SIGNAL_ID_BDS_B2I; break; case GNSS_SIGNAL_BEIDOU_B2AI: - signalId = SIGNAL_ID_BDS_B2AI; + signalId = SIGNAL_ID_BDS_B2A; break; default: signalId = SIGNAL_ID_ALL_SIGNALS; @@ -371,7 +395,7 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, } break; case GNSS_SV_TYPE_QZSS: - sv_meta.talker[0] = 'P'; + sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'Q'; sv_meta.mask = sv_cache_info.qzss_used_mask; // QZSS SV ids are from 193-197. So keep svIdOffset 0 @@ -383,11 +407,11 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, } break; case GNSS_SV_TYPE_BEIDOU: - sv_meta.talker[0] = 'P'; - sv_meta.talker[1] = 'Q'; + sv_meta.talker[0] = 'G'; + sv_meta.talker[1] = 'B'; sv_meta.mask = sv_cache_info.bds_used_mask; // BDS SV ids are from 201-235. So keep svIdOffset 0 - sv_meta.systemId = SYSTEM_ID_BEIDOU; + sv_meta.systemId = SYSTEM_ID_BDS; if (GNSS_SIGNAL_BEIDOU_B1I == signalType) { sv_meta.svCount = sv_cache_info.bds_b1_count; } else if (GNSS_SIGNAL_BEIDOU_B2AI == signalType) { @@ -626,7 +650,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, if (svCount <= 0) { // no svs in view, so just send a blank $--GSV sentence - snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,%d", talker, sv_meta_p->signalId); + snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,%X", talker, sv_meta_p->signalId); length = loc_nmea_put_checksum(sentence, bufSize); nmeaArraystr.push_back(sentence); return; @@ -720,7 +744,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, } // append signalId - length = snprintf(pMarker, lengthRemaining,",%d",sv_meta_p->signalId); + length = snprintf(pMarker, lengthRemaining,",%X",sv_meta_p->signalId); pMarker += length; lengthRemaining -= length; @@ -956,6 +980,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; char sentence_DTM[NMEA_SENTENCE_MAX_LENGTH] = {0}; char sentence_RMC[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char sentence_GNS[NMEA_SENTENCE_MAX_LENGTH] = {0}; char sentence_GGA[NMEA_SENTENCE_MAX_LENGTH] = {0}; char* pMarker = sentence; int lengthRemaining = sizeof(sentence); @@ -1054,11 +1079,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, - GNSS_SIGNAL_QZSS_L1CA, false), nmeaArraystr); + GNSS_SIGNAL_QZSS_L1CA, true), nmeaArraystr); if (count > 0) { svUsedCount += count; - // talker should be default "GP". If GPS, GLO etc is used, it should be "GN" + talker[0] = sv_meta.talker[0]; + talker[1] = sv_meta.talker[1]; } // ---------------------------- @@ -1066,11 +1092,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ---------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, - GNSS_SIGNAL_BEIDOU_B1I, false), nmeaArraystr); + GNSS_SIGNAL_BEIDOU_B1I, true), nmeaArraystr); if (count > 0) { svUsedCount += count; - // talker should be default "GP". If GPS, GLO etc is used, it should be "GN" + talker[0] = sv_meta.talker[0]; + talker[1] = sv_meta.talker[1]; } // ------------------- @@ -1347,6 +1374,145 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence_RMC, sizeof(sentence_RMC)); + // ------------------- + // ------$--GNS------- + // ------------------- + + pMarker = sentence_GNS; + lengthRemaining = sizeof(sentence_GNS); + + length = snprintf(pMarker, lengthRemaining, "$%sGNS,%02d%02d%02d.%02d," , + talker, 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 & LOC_GPS_LOCATION_HAS_LAT_LONG) + { + double latitude = ref_lla.lat; + double longitude = ref_lla.lon; + 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 & LOC_GPS_LOCATION_HAS_LAT_LONG)) + // N means no fix + length = snprintf(pMarker, lengthRemaining, "%c,", 'N'); + else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) + // D means differential + length = snprintf(pMarker, lengthRemaining, "%c,", 'D'); + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + // E means estimated (dead reckoning) + length = snprintf(pMarker, lengthRemaining, "%c,", 'E'); + else // A means autonomous + length = snprintf(pMarker, lengthRemaining, "%c,", 'A'); + + pMarker += length; + lengthRemaining -= length; + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { + length = snprintf(pMarker, lengthRemaining, "%02d,%.1f,", + svUsedCount, locationExtended.hdop); + } + else { // no hdop + length = snprintf(pMarker, lengthRemaining, "%02d,,", + 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,", + 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 & LOC_GPS_LOCATION_HAS_ALTITUDE) && + (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,,", + ref_lla.alt - locationExtended.altitudeMeanSeaLevel); + } + else + { + length = snprintf(pMarker, lengthRemaining,",,"); + } + + pMarker += length; + lengthRemaining -= length; + + // hardcode Navigation Status field to 'V' + length = snprintf(pMarker, lengthRemaining, ",%c", 'V'); + pMarker += length; + lengthRemaining -= length; + + length = loc_nmea_put_checksum(sentence_GNS, sizeof(sentence_GNS)); + + // ------------------- // ------$--GGA------- // ------------------- @@ -1485,6 +1651,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------$--DTM------- nmeaArraystr.push_back(sentence_DTM); } + // ------$--GNS------- + nmeaArraystr.push_back(sentence_GNS); + if(LOC_GNSS_DATUM_PZ90 == datum_type) { + // ------$--DTM------- + nmeaArraystr.push_back(sentence_DTM); + } // ------$--GGA------- nmeaArraystr.push_back(sentence_GGA); @@ -1499,18 +1671,22 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$PQGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); - length = loc_nmea_put_checksum(sentence, sizeof(sentence)); - nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$GPDTM,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N,V", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$GPGNS,,,,,,N,,,,,,,V", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); From 9f37d8bb5196b15b161a83235b0d13878e727de6 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 27 Mar 2019 17:43:29 -0700 Subject: [PATCH 823/945] Clean up several functions as a result of a better approach in GARDEn app for Privacy Change-Id: Ia030385d5ee26305ea041258cc3fb664735983be CRs-fixed: 2424763 --- gnss/location_gnss.cpp | 17 ----------------- location/LocationAPIClientBase.h | 4 ---- location/location_interface.h | 1 - 3 files changed, 22 deletions(-) diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 4b2421ac..43665b44 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -70,7 +70,6 @@ static void updateConnectionStatus(bool connected, int8_t type, bool roaming = f static void getGnssEnergyConsumed(GnssEnergyConsumedCallback energyConsumedCb); static void enableNfwLocationAccess(bool enable); static void nfwInit(const NfwCbInfo& cbInfo); -static uint8_t getGpsLock(); static void getPowerStateChanges(void* powerStateCb); static void odcpiInit(const OdcpiRequestCallback& callback); @@ -114,7 +113,6 @@ static const GnssInterface gGnssInterface = { getGnssEnergyConsumed, enableNfwLocationAccess, nfwInit, - getGpsLock, getPowerStateChanges }; @@ -369,24 +367,9 @@ static void nfwInit(const NfwCbInfo& cbInfo) { gGnssAdapter->initNfwCommand(cbInfo); } } - -static uint8_t getGpsLock() { - if (NULL != gGnssAdapter) { - return ContextBase::mGps_conf.GPS_LOCK; - } else { - /* In case gGnssAdapter is NULL - just return 0x3 which means both - AFW and NFW are locked (the bits are NFW - for 2^1 and AFW for 2^0) */ - LOC_LOGe("gGnssAdapter is NULL"); - return 0x3; - } -} - static void getPowerStateChanges(void* powerStateCb) { if (NULL != gGnssAdapter) { gGnssAdapter->getPowerStateChangesCommand(powerStateCb); } } - diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index fd22b040..fddae604 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -36,7 +36,6 @@ #include #include "LocationAPI.h" -#include #include #include @@ -253,9 +252,6 @@ public: inline virtual void onGnssLocationInfoCb( GnssLocationInfoNotification /*gnssLocationInfoNotification*/) {} - inline virtual void onGnssNfwStatusCb( - GnssNfwNotification /*notification*/) {} - inline virtual void onBatchingCb(size_t /*count*/, Location* /*location*/, BatchingOptions /*batchingOptions*/) {} inline virtual void onBatchingStatusCb(BatchingStatusInfo /*batchingStatus*/, diff --git a/location/location_interface.h b/location/location_interface.h index 45c2c258..4235a137 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -85,7 +85,6 @@ struct GnssInterface { void (*getGnssEnergyConsumed)(GnssEnergyConsumedCallback energyConsumedCb); void (*enableNfwLocationAccess)(bool enable); void (*nfwInit)(const NfwCbInfo& cbInfo); - uint8_t (*getGpsLock)(); void (*getPowerStateChanges)(void* powerStateCb); }; From e3240df27fb63294175f6e8a74e51da27aba03c9 Mon Sep 17 00:00:00 2001 From: Ankur Sharma Date: Tue, 9 Apr 2019 17:28:05 +0530 Subject: [PATCH 824/945] Changing the CaPath for SSL certificates Modifying the CaPath for SSL certs in gps.conf to be used by xtra-daemon while estalishing SSL connection for downloading XTRA file. Change-Id: Id360b21fdda8b539568cbd505c16e99ee1ad6816 CRs-Fixed: 2432184 --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index 82a7b3ca..a5dabb2d 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -14,7 +14,7 @@ ERR_ESTIMATE=0 NTP_SERVER=time.izatcloud.net #XTRA CA path -XTRA_CA_PATH=/system/etc/security/cacerts +XTRA_CA_PATH=/usr/lib/ssl/certs # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose From cd1031a520ec204990a00ce2bc4f55a6130f7c93 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 18 Apr 2019 12:57:11 -0700 Subject: [PATCH 825/945] Update proxyAppPackageName field in nfw notification Change-Id: I993a6d9227b03626bc254675944df28cc578a6c7 CRs-fixed: 2437418 --- core/ContextBase.cpp | 1 + core/ContextBase.h | 1 + etc/gps.conf | 7 +++++++ utils/gps_extended_c.h | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 28109bb0..96507016 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -78,6 +78,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'}, {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, + {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' }, }; const loc_param_s_type ContextBase::mSap_conf_table[] = diff --git a/core/ContextBase.h b/core/ContextBase.h index 9c728354..8fc2bd5f 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -71,6 +71,7 @@ typedef struct loc_gps_cfg_s double CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD; uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET; uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; + char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING]; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/etc/gps.conf b/etc/gps.conf index a5dabb2d..f1cf84d8 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -281,3 +281,10 @@ MODEM_TYPE = 1 # SV is available and the UE’s position is known by # other position engines. #POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0 + +##################################### +# proxyAppPackageName +##################################### +# This is a string that is sent to the framework +# in nfwNotifyCb callback +PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 242fe84a..279fa20f 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2052,6 +2052,7 @@ struct AGnssExtStatusIpV6 { /* * Represents the the Nfw Notification structure */ +#define GNSS_MAX_NFW_APP_STRING_LEN 64 #define GNSS_MAX_NFW_STRING_LEN 20 typedef enum { @@ -2079,7 +2080,7 @@ typedef enum { } GnssNfwResponseType; typedef struct { - char proxyAppPackageName[GNSS_MAX_NFW_STRING_LEN]; + char proxyAppPackageName[GNSS_MAX_NFW_APP_STRING_LEN]; GnssNfwProtocolStack protocolStack; char otherProtocolStackName[GNSS_MAX_NFW_STRING_LEN]; GnssNfwRequestor requestor; From 0802cf66449eb39bad120787f219edb000cac20f Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Tue, 23 Apr 2019 15:13:15 +0530 Subject: [PATCH 826/945] LTE Positioning Profile is not reflecting properly Added the GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT flag. So that the NV value of LPP profile provided in gps.conf can be refelected to modem. Change-Id: I6429a4a79cb83d5991c8a1328ab5daa4ef49619a CRs-fixed: 2439533 --- gnss/GnssAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 3563ed03..20394656 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -687,7 +687,8 @@ GnssAdapter::setConfigCommand() if (gpsConf.AGPS_CONFIG_INJECT) { gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT; + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; gnssConfigRequested.suplVersion = adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); gnssConfigRequested.lppProfile = From 27198a21021dd6f47d9b118c1bfdab3dca70a691 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 17 Apr 2019 11:23:56 -0700 Subject: [PATCH 827/945] ApnTypeMask is not returned when USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL CRs-fixed: 2437315 Change-Id: If042451e94a651dafb542cdad9d419f08c85ba56 --- gnss/Agps.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 9de13292..7931d0c3 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2019, 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 @@ -562,6 +562,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, LOC_AGPS_TYPE_SUPL_ES == agpsType) { agpsType = LOC_AGPS_TYPE_SUPL; apnTypeMask &= ~LOC_APN_TYPE_MASK_EMERGENCY; + apnTypeMask |= LOC_APN_TYPE_MASK_SUPL; LOC_LOGD("Changed agpsType to non-emergency when USE_EMERGENCY... is 0" "and removed LOC_APN_TYPE_MASK_EMERGENCY from apnTypeMask" "agpsType 0x%X apnTypeMask : 0x%X", From 9d0d8e3c7294dac72a2db83b9bcd9185dd53e057 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Thu, 25 Apr 2019 15:27:40 -0700 Subject: [PATCH 828/945] Default value of SUPL_ES to enable SUPL_ES by default needs to be enabled, since it is no longer set by AFW at runtime. CRs-fixed: 2444734 Change-Id: I370a3e0f8ab6905b47629c4076f645b26ff8acc9 --- core/ContextBase.cpp | 2 +- etc/gps.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 28109bb0..f046baaf 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -111,7 +111,7 @@ void ContextBase::readConfig() mGps_conf.GPS_LOCK = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; mGps_conf.SUPL_VER = 0x10000; mGps_conf.SUPL_MODE = 0x1; - mGps_conf.SUPL_ES = 0; + mGps_conf.SUPL_ES = 1; mGps_conf.SUPL_HOST[0] = 0; mGps_conf.SUPL_PORT = 0; mGps_conf.CAPABILITIES = 0x7; diff --git a/etc/gps.conf b/etc/gps.conf index a5dabb2d..577c7b07 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -35,7 +35,7 @@ INTERMEDIATE_POS=0 SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable -#SUPL_ES=0 +#SUPL_ES=1 #Choose PDN for Emergency SUPL #1 - Use emergency PDN From 6f1fd95a2030be43309e3601499722c78cf0660b Mon Sep 17 00:00:00 2001 From: Deepthi Gunturi Date: Mon, 22 Apr 2019 14:31:47 +0530 Subject: [PATCH 829/945] Initial target definition for atoll Change-Id: I6d997cb20da93a407b4948c97723d2ae97f70f6a CRs-Fixed: 2441728 --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 2e74aff6..83f3cdde 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -42,6 +42,7 @@ GNSS_HIDL_2_0_TARGET_LIST += msmnile GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) GNSS_HIDL_2_0_TARGET_LIST += kona +GNSS_HIDL_2_0_TARGET_LIST += atoll ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 2.0 From d6d55a4948301d76a8489a5a166acd1b1385e4a1 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 24 Apr 2019 11:33:20 -0700 Subject: [PATCH 830/945] Send SUPL notification to the framework for E911 sessions only (older modems) Change-Id: Icd317f6e4b042c31afc63011596689d5fb35135f CRs-fixed: 2441292 --- .../1.0/GnssVisibilityControl.cpp | 24 +++++++++++++++++++ .../1.0/GnssVisibilityControl.h | 2 ++ gnss/GnssAdapter.cpp | 22 ++++++++++++++--- gnss/GnssAdapter.h | 8 +++++++ utils/gps_extended_c.h | 1 + 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/android/visibility_control/1.0/GnssVisibilityControl.cpp b/android/visibility_control/1.0/GnssVisibilityControl.cpp index 82e465cc..5a8c697a 100644 --- a/android/visibility_control/1.0/GnssVisibilityControl.cpp +++ b/android/visibility_control/1.0/GnssVisibilityControl.cpp @@ -66,6 +66,13 @@ void GnssVisibilityControl::nfwStatusCb(GnssNfwNotification notification) { } } +bool GnssVisibilityControl::isInEmergencySession() { + if (nullptr != spGnssVisibilityControl) { + return spGnssVisibilityControl->isE911Session(); + } + return false; +} + static void convertGnssNfwNotification(GnssNfwNotification& in, IGnssVisibilityControlCallback::NfwNotification& out) { @@ -97,6 +104,22 @@ void GnssVisibilityControl::statusCb(GnssNfwNotification notification) { } } +bool GnssVisibilityControl::isE911Session() { + + if (mGnssVisibilityControlCbIface != nullptr) { + auto r = mGnssVisibilityControlCbIface->isInEmergencySession(); + if (!r.isOk()) { + LOC_LOGw("Error invoking NFW status cb %s", r.description().c_str()); + return false; + } else { + return (r); + } + } else { + LOC_LOGw("setCallback has not been called yet"); + return false; + } +} + // Methods from ::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControl follow. Return GnssVisibilityControl::enableNfwLocationAccess(const hidl_vec<::android::hardware::hidl_string>& proxyApps) { @@ -131,6 +154,7 @@ Return GnssVisibilityControl::setCallback(const ::android::sp<::android::h NfwCbInfo cbInfo = {}; cbInfo.visibilityControlCb = (void*)nfwStatusCb; + cbInfo.isInEmergencySession = (void*)isInEmergencySession; mGnss->getGnssInterface()->nfwInit(cbInfo); diff --git a/android/visibility_control/1.0/GnssVisibilityControl.h b/android/visibility_control/1.0/GnssVisibilityControl.h index 4eaea51e..9c26e384 100644 --- a/android/visibility_control/1.0/GnssVisibilityControl.h +++ b/android/visibility_control/1.0/GnssVisibilityControl.h @@ -68,9 +68,11 @@ struct GnssVisibilityControl : public IGnssVisibilityControl { Return setCallback(const ::android::sp<::android::hardware::gnss::visibility_control::V1_0::IGnssVisibilityControlCallback>& callback) override; void statusCb(GnssNfwNotification notification); + bool isE911Session(); /* Data call setup callback passed down to GNSS HAL implementation */ static void nfwStatusCb(GnssNfwNotification notification); + static bool isInEmergencySession(); private: Gnss* mGnss = nullptr; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 20394656..fe0fc9be 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -94,7 +94,8 @@ GnssAdapter::GnssAdapter() : mPowerOn(false), mAllowFlpNetworkFixes(0), mGnssEnergyConsumedCb(nullptr), - mPowerStateCb(nullptr) + mPowerStateCb(nullptr), + mIsE911Session(NULL) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -3367,21 +3368,36 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* struct MsgReportNiNotify : public LocMsg { GnssAdapter& mAdapter; + LocApiBase& mApi; const GnssNiNotification mNotify; const void* mData; inline MsgReportNiNotify(GnssAdapter& adapter, + LocApiBase& api, const GnssNiNotification& notify, const void* data) : LocMsg(), mAdapter(adapter), + mApi(api), mNotify(notify), mData(data) {} inline virtual void proc() const { - mAdapter.requestNiNotify(mNotify, mData); + if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type || + GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) { + if (mAdapter.getE911State() || + ((GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES) && + (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type))) { + mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData); + } + else { + mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData); + } + } else { + mAdapter.requestNiNotify(mNotify, mData); + } } }; - sendMsg(new MsgReportNiNotify(*this, notify, data)); + sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data)); return true; } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9720ba41..7b73ec18 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -165,8 +165,10 @@ class GnssAdapter : public LocAdapterBase { /* ==== NFW =========================================================================== */ NfwStatusCb mNfwCb; + IsInEmergencySession mIsE911Session; inline void initNfw(const NfwCbInfo& cbInfo) { mNfwCb = (NfwStatusCb)cbInfo.visibilityControlCb; + mIsE911Session = (IsInEmergencySession)cbInfo.isInEmergencySession; } /* ==== ODCPI ========================================================================== */ @@ -396,6 +398,12 @@ public: mNfwCb(notification); } } + inline bool getE911State(void) { + if (NULL != mIsE911Session) { + return mIsE911Session(); + } + return false; + } /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 279fa20f..18517839 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2115,6 +2115,7 @@ typedef void (*AgnssStatusIpV4Cb)(AGnssExtStatusIpV4 status); * Callback with NFW information. */ typedef void(*NfwStatusCb)(GnssNfwNotification notification); +typedef bool(*IsInEmergencySession)(void); /* * Callback with AGNSS(IpV6) status information. From 0330e79d4a87db7e1ee358f0e87a49d34c8f3690 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 29 Mar 2019 16:59:07 -0700 Subject: [PATCH 831/945] Gnss adapter: fill in proper std deviation in position report The north and east standard deviation fields are not filled in properly in position report Change-Id: Ic243a6862f3fa4e723b507d391c9a904d65d3c30 CRs-fixed: 2426344 --- gnss/GnssAdapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 20394656..edfc1500 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -303,11 +303,11 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, } if (GPS_LOCATION_EXTENDED_HAS_NORTH_STD_DEV & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_NORTH_STD_DEV_BIT; - out.northVelocityStdDeviation = locationExtended.northStdDeviation; + out.northStdDeviation = locationExtended.northStdDeviation; } if (GPS_LOCATION_EXTENDED_HAS_EAST_STD_DEV & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_EAST_STD_DEV_BIT; - out.eastVelocityStdDeviation = locationExtended.eastStdDeviation; + out.eastStdDeviation = locationExtended.eastStdDeviation; } if (GPS_LOCATION_EXTENDED_HAS_NORTH_VEL & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_NORTH_VEL_BIT; From 81f47db3f25e00ca7f2571c9211ce47d273d6f97 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 30 Apr 2019 15:02:43 -0700 Subject: [PATCH 832/945] GPS: add numSVUsedInFix in location api Add a count in location API for number of SV used in fix Change-Id: I3b396170948fa6c93a88d0fdcf17e28eff5ed5dc CRs-fixed: 2425599 --- gnss/GnssAdapter.cpp | 39 +++++++++++++++++++++++++++++++++++- gnss/GnssAdapter.h | 2 ++ location/LocationDataTypes.h | 9 +++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 20394656..a886495d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -225,6 +225,31 @@ GnssAdapter::convertLocation(Location& out, const UlpLocation& ulpLocation, } } +/* This is utility routine that computes number of SV used + in the fix from the svUsedIdsMask. + */ +#define MAX_SV_CNT_SUPPORTED_IN_ONE_CONSTELLATION 64 +uint16_t GnssAdapter::getNumSvUsed(uint64_t svUsedIdsMask, + int totalSvCntInThisConstellation) +{ + if (totalSvCntInThisConstellation > MAX_SV_CNT_SUPPORTED_IN_ONE_CONSTELLATION) { + LOC_LOGe ("error: total SV count in this constellation %d exceeded limit of %d", + totalSvCntInThisConstellation, MAX_SV_CNT_SUPPORTED_IN_ONE_CONSTELLATION); + return 0; + } + + uint16_t numSvUsed = 0; + uint64_t mask = 0x1; + for (int i = 0; i < totalSvCntInThisConstellation; i++) { + if (svUsedIdsMask & mask) { + numSvUsed++; + } + mask <<= 1; + } + + return numSvUsed; +} + void GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, const GpsLocationExtended& locationExtended) @@ -345,8 +370,20 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; out.svUsedInPosition.qzssSvUsedIdsMask = locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; - out.numOfMeasReceived = locationExtended.numOfMeasReceived; + out.flags |= GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT; + out.numSvUsedInPosition = getNumSvUsed(out.svUsedInPosition.gpsSvUsedIdsMask, + GPS_SV_PRN_MAX - GPS_SV_PRN_MIN + 1); + out.numSvUsedInPosition += getNumSvUsed(out.svUsedInPosition.gloSvUsedIdsMask, + GLO_SV_PRN_MAX - GLO_SV_PRN_MIN + 1); + out.numSvUsedInPosition += getNumSvUsed(out.svUsedInPosition.qzssSvUsedIdsMask, + QZSS_SV_PRN_MAX - QZSS_SV_PRN_MIN + 1); + out.numSvUsedInPosition += getNumSvUsed(out.svUsedInPosition.bdsSvUsedIdsMask, + BDS_SV_PRN_MAX - BDS_SV_PRN_MIN + 1); + out.numSvUsedInPosition += getNumSvUsed(out.svUsedInPosition.galSvUsedIdsMask, + GAL_SV_PRN_MAX - GAL_SV_PRN_MIN + 1); + + out.numOfMeasReceived = locationExtended.numOfMeasReceived; for (int idx =0; idx < locationExtended.numOfMeasReceived; idx++) { out.measUsageInfo[idx].gnssSignalType = locationExtended.measUsageInfo[idx].gnssSignalType; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9720ba41..eb5a7e43 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -200,6 +200,8 @@ class GnssAdapter : public LocAdapterBase { const LocPosTechMask techMask); static void convertLocationInfo(GnssLocationInfoNotification& out, const GpsLocationExtended& locationExtended); + static uint16_t getNumSvUsed(uint64_t svUsedIdsMask, + int totalSvCntInThisConstellation); /* ======== UTILITIES ================================================================== */ inline void initOdcpi(const OdcpiRequestCallback& callback); diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index f8bb6cba..0c8e1573 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -153,7 +153,9 @@ typedef enum { GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MAJOR_BIT = (1<<5), // valid elipsode semi major GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_SEMI_MINOR_BIT = (1<<6), // valid elipsode semi minor GNSS_LOCATION_INFO_HOR_ACCURACY_ELIP_AZIMUTH_BIT = (1<<7), // valid accuracy elipsode azimuth - GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT = (1<<8), // valid gnss sv used in pos data + GNSS_LOCATION_INFO_GNSS_SV_USED_DATA_BIT = (1<<8), // valid svUsedInPosition, + // numOfMeasReceived + // and measUsageInfo GNSS_LOCATION_INFO_NAV_SOLUTION_MASK_BIT = (1<<9), // valid navSolutionMask GNSS_LOCATION_INFO_POS_TECH_MASK_BIT = (1<<10),// valid LocPosTechMask GNSS_LOCATION_INFO_SV_SOURCE_INFO_BIT = (1<<11),// valid LocSvInfoSource @@ -168,7 +170,9 @@ typedef enum { GNSS_LOCATION_INFO_EAST_VEL_UNC_BIT = (1<<20),// valid East Velocity Uncertainty GNSS_LOCATION_INFO_UP_VEL_UNC_BIT = (1<<21),// valid Up Velocity Uncertainty GNSS_LOCATION_INFO_LEAP_SECONDS_BIT = (1<<22),// valid leap seconds - GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23) // valid time uncertainty + GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23),// valid time uncertainty + GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT = (1<<24) // number of SV used in position + } GnssLocationInfoFlagBits; typedef enum { @@ -940,6 +944,7 @@ typedef struct { float northVelocityStdDeviation; float eastVelocityStdDeviation; float upVelocityStdDeviation; + uint16_t numSvUsedInPosition; GnssLocationSvUsedInPosition svUsedInPosition;// Gnss sv used in position data GnssLocationNavSolutionMask navSolutionMask; // Nav solution mask to indicate sbas corrections GnssLocationPosTechMask posTechMask; // Position technology used in computing this fix From 3e62412eb0233619684ecdbc39b19cbc8ebbdc93 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 22 Feb 2019 17:55:39 -0800 Subject: [PATCH 833/945] Gnss interface: add position injection for extended info Add position injection interface with extended info, e.g.: GnssLocationInfoNotification Change-Id: I6ba8f1111d1511c7071fe358687a478b26e8f9a4 CRs-fixed: 2417450 --- gnss/GnssAdapter.cpp | 27 +++++++++++++++++++++++++++ gnss/GnssAdapter.h | 2 ++ gnss/location_gnss.cpp | 11 ++++++++++- location/location_interface.h | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index edfc1500..436681a6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1819,6 +1819,33 @@ GnssAdapter::injectLocationCommand(double latitude, double longitude, float accu latitude, longitude, accuracy)); } +void +GnssAdapter::injectLocationExtCommand(const GnssLocationInfoNotification &locationInfo) +{ + LOC_LOGd("latitude %8.4f longitude %8.4f accuracy %8.4f, tech mask 0x%x", + locationInfo.location.latitude, locationInfo.location.longitude, + locationInfo.location.accuracy, locationInfo.location.techMask); + + struct MsgInjectLocationExt : public LocMsg { + LocApiBase& mApi; + ContextBase& mContext; + GnssLocationInfoNotification mLocationInfo; + inline MsgInjectLocationExt(LocApiBase& api, + ContextBase& context, + GnssLocationInfoNotification locationInfo) : + LocMsg(), + mApi(api), + mContext(context), + mLocationInfo(locationInfo) {} + inline virtual void proc() const { + // false to indicate for none-ODCPI + mApi.injectPosition(mLocationInfo, false); + } + }; + + sendMsg(new MsgInjectLocationExt(*mLocApi, *mContext, locationInfo)); +} + void GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty) { diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9720ba41..ae5f5f1e 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -430,6 +430,8 @@ public: GnssSvId initialSvId, GnssSvType svType); void injectLocationCommand(double latitude, double longitude, float accuracy); + void injectLocationExtCommand(const GnssLocationInfoNotification &locationInfo); + void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); void blockCPICommand(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 43665b44..88fa15d9 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -58,6 +58,7 @@ static void gnssGetSvTypeConfig(GnssSvTypeConfigCallback& callback); static void gnssResetSvTypeConfig(); static void injectLocation(double latitude, double longitude, float accuracy); +static void injectLocationExt(const GnssLocationInfoNotification &locationInfo); static void injectTime(int64_t time, int64_t timeReference, int32_t uncertainty); static void agpsInit(const AgpsCbInfo& cbInfo); @@ -113,7 +114,8 @@ static const GnssInterface gGnssInterface = { getGnssEnergyConsumed, enableNfwLocationAccess, nfwInit, - getPowerStateChanges + getPowerStateChanges, + injectLocationExt }; #ifndef DEBUG_X86 @@ -373,3 +375,10 @@ static void getPowerStateChanges(void* powerStateCb) gGnssAdapter->getPowerStateChangesCommand(powerStateCb); } } + +static void injectLocationExt(const GnssLocationInfoNotification &locationInfo) +{ + if (NULL != gGnssAdapter) { + gGnssAdapter->injectLocationExtCommand(locationInfo); + } +} diff --git a/location/location_interface.h b/location/location_interface.h index 4235a137..80f37c24 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -86,6 +86,7 @@ struct GnssInterface { void (*enableNfwLocationAccess)(bool enable); void (*nfwInit)(const NfwCbInfo& cbInfo); void (*getPowerStateChanges)(void* powerStateCb); + void (*injectLocationExt)(const GnssLocationInfoNotification &locationInfo); }; struct BatchingInterface { From 8890e5aeeeb972ea937d8a84f0e8507120a956b9 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 30 Apr 2019 14:44:12 -0700 Subject: [PATCH 834/945] When sending GPS LOCK status to XTRA mask NFW bit Change-Id: Icdc26358627abf4097dcb8dc4fb35af039fd921d CRs-fixed: 2444862 --- gnss/XtraSystemStatusObserver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 6e1902c5..b1c48d72 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -57,7 +57,9 @@ using namespace loc_core; #define LOG_TAG "LocSvc_XSSO" bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { - mGpsLock = lock; + // mask NI(NFW bit) since from XTRA's standpoint GPS is enabled if + // MO(AFW bit) is enabled and disabled when MO is disabled + mGpsLock = lock & ~GNSS_CONFIG_GPS_LOCK_NI; if (!mReqStatusReceived) { return true; From e7c30fa882af46d23f9eddf78fd66cd1bf89a65c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 1 May 2019 12:40:40 -0700 Subject: [PATCH 835/945] GNSS HIDL 2.0 updates Implement new GNSS HIDL 2.0 functions and callbacks gnssRequestLocationCb_2_0, getExtensionGnssBatching_2_0, getExtensionGnssDebug_2_0, getDebugData_2_0, injectBestLocation_2_0, gnssSetCapabilitiesCb_2_0, gnssLocationCb_2_0, gnssSvStatusCb_2_0, and gnssMeasurementCb_2_0. Fix VTS test failures from deprecated functions setGpsLock, setSuplEs, V1:0::getExtensionAGnss, and V1.0::getExtensionGnssNi CRs-fixed: 2433957 Change-Id: Id10cb41c32d6c50144b0501eb2d2eaf9c9a9aaec --- android/2.0/Gnss.cpp | 164 ++++++-- android/2.0/Gnss.h | 6 +- android/2.0/GnssBatching.cpp | 35 +- android/2.0/GnssBatching.h | 14 +- android/2.0/GnssConfiguration.cpp | 25 +- android/2.0/GnssDebug.cpp | 124 +++++- android/2.0/GnssDebug.h | 11 +- .../2.0/location_api/BatchingAPIClient.cpp | 112 ++++-- android/2.0/location_api/BatchingAPIClient.h | 11 +- android/2.0/location_api/GnssAPIClient.cpp | 369 ++++++++++++------ android/2.0/location_api/GnssAPIClient.h | 7 +- android/2.0/location_api/LocationUtil.cpp | 95 ++++- android/2.0/location_api/LocationUtil.h | 5 +- .../2.0/location_api/MeasurementAPIClient.cpp | 60 ++- .../1.0/MeasurementCorrections.cpp | 5 +- gnss/GnssAdapter.cpp | 7 +- 16 files changed, 804 insertions(+), 246 deletions(-) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 1021938e..0390af7d 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -81,7 +81,6 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who LOC_LOGE("%s] service died. cookie: %llu, who: %p", __FUNCTION__, static_cast(cookie), &who); if (mGnss != nullptr) { - mGnss->stop(); mGnss->cleanup(); } } @@ -102,26 +101,31 @@ Gnss::~Gnss() { } GnssAPIClient* Gnss::getApi() { - if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) { - mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); - if (mApi == nullptr) { - LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__); - return mApi; - } + if (mApi != nullptr) { + return mApi; + } - if (mPendingConfig.size == sizeof(GnssConfig)) { - // we have pending GnssConfig - mApi->gnssConfigurationUpdate(mPendingConfig); - // clear size to invalid mPendingConfig - mPendingConfig.size = 0; - if (mPendingConfig.assistanceServer.hostName != nullptr) { - free((void*)mPendingConfig.assistanceServer.hostName); - } + if (mGnssCbIface_2_0 != nullptr) { + mApi = new GnssAPIClient(mGnssCbIface_2_0); + } else if (mGnssCbIface_1_1 != nullptr) { + mApi = new GnssAPIClient(mGnssCbIface_1_1, mGnssNiCbIface); + } else if (mGnssCbIface != nullptr) { + mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); + } else { + LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__); + return mApi; + } + + if (mPendingConfig.size == sizeof(GnssConfig)) { + // we have pending GnssConfig + mApi->gnssConfigurationUpdate(mPendingConfig); + // clear size to invalid mPendingConfig + mPendingConfig.size = 0; + if (mPendingConfig.assistanceServer.hostName != nullptr) { + free((void*)mPendingConfig.assistanceServer.hostName); } } - if (mApi == nullptr) { - LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__); - } + return mApi; } @@ -273,7 +277,23 @@ Return Gnss::cleanup() { ENTRY_LOG_CALLFLOW(); if (mApi != nullptr) { + mApi->gnssStop(); mApi->gnssDisable(); + mApi->gnssUpdateCallbacks(nullptr, nullptr); + mApi->gnssUpdateCallbacks_2_0(nullptr); + } + mGnssNiCbIface = nullptr; + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface = nullptr; + } + if (mGnssCbIface_1_1 != nullptr) { + mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_1_1 = nullptr; + } + if (mGnssCbIface_2_0 != nullptr) { + mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_2_0 = nullptr; } return Void(); @@ -330,15 +350,14 @@ Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode, Return> Gnss::getExtensionAGnss() { ENTRY_LOG_CALLFLOW(); - //mAGnssIface = new ::android::hardware::gnss::V1_1::implementation::AGnss(this); //need V1_1 AGnss - //return mAGnssIface; + // deprecated function. Must return nullptr to pass VTS return nullptr; } Return> Gnss::getExtensionGnssNi() { ENTRY_LOG_CALLFLOW(); - mGnssNi = new GnssNi(this); - return mGnssNi; + // deprecated function. Must return nullptr to pass VTS + return nullptr; } Return> Gnss::getExtensionGnssMeasurement() { @@ -381,8 +400,19 @@ Return> Gnss::getExtensionAGnssRil() { // Methods from ::android::hardware::gnss::V1_1::IGnss follow. Return Gnss::setCallback_1_1(const sp& callback) { ENTRY_LOG_CALLFLOW(); - callback->gnssNameCb(getVersionString()); + auto r = callback->gnssNameCb(getVersionString()); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNameCb description=%s", + __func__, r.description().c_str()); + } + if (mGnssCbIface_1_1 != nullptr) { + mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); + } mGnssCbIface_1_1 = callback; + if (mGnssCbIface_1_1 != nullptr) { + mGnssCbIface_1_1->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/); + } + const GnssInterface* gnssInterface = getGnssInterface(); if (nullptr != gnssInterface) { OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { @@ -390,7 +420,15 @@ Return Gnss::setCallback_1_1(const sp& callback) { }; gnssInterface->odcpiInit(cb); } - return setCallback(callback); + + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks(mGnssCbIface_1_1, mGnssNiCbIface); + api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->requestCapabilities(); + } + + return true; } Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, @@ -442,7 +480,20 @@ Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { ENTRY_LOG_CALLFLOW(); - if (mGnssCbIface_1_1 != nullptr) { + + if (mGnssCbIface_2_0 != nullptr) { + // For emergency mode, request DBH (Device based hybrid) location + // Mark Independent from GNSS flag to false. + if (ODCPI_REQUEST_TYPE_START == request.type) { + auto r = mGnssCbIface_2_0->gnssRequestLocationCb_2_0(!request.isEmergencyMode, + request.isEmergencyMode); + if (!r.isOk()) { + LOC_LOGe("Error invoking gnssRequestLocationCb_2_0 %s", r.description().c_str()); + } + } else { + LOC_LOGv("Unsupported ODCPI request type: %d", request.type); + } + } else if (mGnssCbIface_1_1 != nullptr) { // For emergency mode, request DBH (Device based hybrid) location // Mark Independent from GNSS flag to false. if (ODCPI_REQUEST_TYPE_START == request.type) { @@ -461,8 +512,37 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { // Methods from ::android::hardware::gnss::V2_0::IGnss follow. Return Gnss::setCallback_2_0(const sp& callback) { ENTRY_LOG_CALLFLOW(); - return setCallback_1_1(callback); + auto r = callback->gnssNameCb(getVersionString()); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNameCb description=%s", + __func__, r.description().c_str()); + } + if (mGnssCbIface_2_0 != nullptr) { + mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); + } + mGnssCbIface_2_0 = callback; + if (mGnssCbIface_2_0 != nullptr) { + mGnssCbIface_2_0->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/); + } + + const GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { + odcpiRequestCb(odcpiRequest); + }; + gnssInterface->odcpiInit(cb); + } + + GnssAPIClient* api = getApi(); + if (api != nullptr) { + api->gnssUpdateCallbacks_2_0(mGnssCbIface_2_0); + api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS); + api->requestCapabilities(); + } + + return true; } + Return> Gnss::getExtensionAGnss_2_0() { ENTRY_LOG_CALLFLOW(); mAGnssIface_2_0 = new AGnss(this); @@ -490,10 +570,8 @@ Return> Gnss::getExtensionGnssMeasurement_2_0() { } Return> Gnss::getExtensionMeasurementCorrections() { - if (mGnssMeasCorr == nullptr) { - mGnssMeasCorr = new MeasurementCorrections(); - } - return mGnssMeasCorr; + // We do not support, so return nullptr to pass VTS + return nullptr; } Return> Gnss::getExtensionVisibilityControl() { @@ -504,21 +582,27 @@ Return Gnss::injectBestLocation_2_0( - const ::android::hardware::gnss::V2_0::GnssLocation& location) { +Return Gnss::injectBestLocation_2_0(const V2_0::GnssLocation& gnssLocation) { ENTRY_LOG_CALLFLOW(); - /* TBD */ - return false; -} - -Return> Gnss::getExtensionGnssBatching_2_0() { - ENTRY_LOG_CALLFLOW(); - return nullptr; + const GnssInterface* gnssInterface = getGnssInterface(); + if (nullptr != gnssInterface) { + Location location = {}; + convertGnssLocation(gnssLocation, location); + gnssInterface->odcpiInject(location); + } + return true; } Return> Gnss::getExtensionGnssDebug_2_0() { ENTRY_LOG_CALLFLOW(); - return nullptr; + mGnssDebug = new GnssDebug(this); + return mGnssDebug; +} + +Return> Gnss::getExtensionGnssBatching_2_0() { + ENTRY_LOG_CALLFLOW(); + mGnssBatching = new GnssBatching(); + return mGnssBatching; } V1_0::IGnss* HIDL_FETCH_IGnss(const char* hal) { diff --git a/android/2.0/Gnss.h b/android/2.0/Gnss.h index df629012..a403d613 100644 --- a/android/2.0/Gnss.h +++ b/android/2.0/Gnss.h @@ -142,6 +142,7 @@ struct Gnss : public IGnss { // Callback for ODCPI request void odcpiRequestCb(const OdcpiRequestInfo& request); + private: struct GnssDeathRecipient : hidl_death_recipient { GnssDeathRecipient(sp gnss) : mGnss(gnss) { @@ -156,8 +157,6 @@ struct Gnss : public IGnss { sp mGnssNi = nullptr; sp mGnssGeofencingIface = nullptr; - sp mGnssBatching = nullptr; - sp mGnssDebug = nullptr; sp mAGnssIface = nullptr; sp mGnssCbIface = nullptr; sp mGnssNiCbIface = nullptr; @@ -166,6 +165,9 @@ struct Gnss : public IGnss { sp mGnssRil = nullptr; sp mGnssMeasurement = nullptr; sp mGnssConfig = nullptr; + sp mGnssBatching = nullptr; + sp mGnssDebug = nullptr; + sp mGnssCbIface_2_0 = nullptr; sp mGnssMeasCorr = nullptr; sp mVisibCtrl = nullptr; diff --git a/android/2.0/GnssBatching.cpp b/android/2.0/GnssBatching.cpp index cf215ea7..7a937fc2 100644 --- a/android/2.0/GnssBatching.cpp +++ b/android/2.0/GnssBatching.cpp @@ -53,7 +53,7 @@ GnssBatching::~GnssBatching() { // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. -Return GnssBatching::init(const sp& callback) { +Return GnssBatching::init(const sp& callback) { if (mApi != nullptr) { LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__); delete mApi; @@ -117,12 +117,45 @@ Return GnssBatching::stop() { } Return GnssBatching::cleanup() { + if (mApi != nullptr) { + mApi->stopSession(); + } if (mGnssBatchingCbIface != nullptr) { mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient); + mGnssBatchingCbIface = nullptr; + } + if (mGnssBatchingCbIface_2_0 != nullptr) { + mGnssBatchingCbIface_2_0->unlinkToDeath(mGnssBatchingDeathRecipient); + mGnssBatchingCbIface_2_0 = nullptr; } return Void(); } +// Methods from ::android::hardware::gnss::V2_0::IGnssBatching follow. +Return GnssBatching::init_2_0(const sp& callback) { + if (mApi != nullptr) { + LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__); + delete mApi; + mApi = nullptr; + } + + mApi = new BatchingAPIClient(callback); + if (mApi == nullptr) { + LOC_LOGE("%s]: failed to create mApi", __FUNCTION__); + return false; + } + + if (mGnssBatchingCbIface_2_0 != nullptr) { + mGnssBatchingCbIface_2_0->unlinkToDeath(mGnssBatchingDeathRecipient); + } + mGnssBatchingCbIface_2_0 = callback; + if (mGnssBatchingCbIface_2_0 != nullptr) { + mGnssBatchingCbIface_2_0->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/); + } + + return true; +} + } // namespace implementation } // namespace V2_0 } // namespace gnss diff --git a/android/2.0/GnssBatching.h b/android/2.0/GnssBatching.h index f7dc65b8..4c8d1db7 100644 --- a/android/2.0/GnssBatching.h +++ b/android/2.0/GnssBatching.h @@ -21,7 +21,7 @@ #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H #define ANDROID_HARDWARE_GNSS_V2_0_GNSSBATCHING_H -#include +#include #include @@ -31,8 +31,8 @@ namespace gnss { namespace V2_0 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssBatching; -using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; +using ::android::hardware::gnss::V2_0::IGnssBatching; +using ::android::hardware::gnss::V2_0::IGnssBatchingCallback; using ::android::hidl::base::V1_0::IBase; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; @@ -48,13 +48,16 @@ struct GnssBatching : public IGnssBatching { ~GnssBatching(); // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. - Return init(const sp& callback) override; + Return init(const sp& callback) override; Return getBatchSize() override; Return start(const IGnssBatching::Options& options ) override; Return flush() override; Return stop() override; Return cleanup() override; + // Methods from ::android::hardware::gnss::V2_0::IGnssBatching follow. + Return init_2_0(const sp& callback) override; + private: struct GnssBatchingDeathRecipient : hidl_death_recipient { GnssBatchingDeathRecipient(sp gnssBatching) : @@ -67,8 +70,9 @@ struct GnssBatching : public IGnssBatching { private: sp mGnssBatchingDeathRecipient = nullptr; - sp mGnssBatchingCbIface = nullptr; + sp mGnssBatchingCbIface = nullptr; BatchingAPIClient* mApi = nullptr; + sp mGnssBatchingCbIface_2_0 = nullptr; }; } // namespace implementation diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index eb98be1a..671b6e7b 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -38,20 +38,8 @@ GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { // Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow. Return GnssConfiguration::setSuplEs(bool enabled) { - if (mGnss == nullptr) { - LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); - return false; - } - - GnssConfig config; - memset(&config, 0, sizeof(GnssConfig)); - config.size = sizeof(GnssConfig); - config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT; - config.suplEmergencyServices = (enabled ? - GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES : - GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO); - - return mGnss->updateConfiguration(config); + // deprecated function. Must return false to pass VTS + return false; } Return GnssConfiguration::setSuplVersion(uint32_t version) { @@ -174,10 +162,9 @@ Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) return mGnss->updateConfiguration(config); } -Return GnssConfiguration::setGpsLock(uint8_t lock) { - /* we no longer set GPS lock here, there is - visibility control for this */ - return true; +Return GnssConfiguration::setGpsLock(uint8_t /*lock*/) { + // deprecated function. Must return false to pass VTS + return false; } Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { @@ -268,7 +255,7 @@ bool GnssConfiguration::setBlacklistedSource( break; default: copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; - LOC_LOGe("Invalid constellation %d", copyFromSource.constellation); + LOC_LOGe("Invalid constellation %u", copyFromSource.constellation); retVal = false; break; } diff --git a/android/2.0/GnssDebug.cpp b/android/2.0/GnssDebug.cpp index 582acc92..b6b9bfed 100644 --- a/android/2.0/GnssDebug.cpp +++ b/android/2.0/GnssDebug.cpp @@ -33,6 +33,7 @@ namespace V2_0 { namespace implementation { using ::android::hardware::hidl_vec; +using ::android::hardware::gnss::V2_0::IGnssDebug; #define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000) #define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000) @@ -57,7 +58,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) { LOC_LOGD("%s]: ", __func__); - DebugData data = { }; + V1_0::IGnssDebug::DebugData data = { }; if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){ LOC_LOGE("GnssDebug - Null GNSS interface"); @@ -139,8 +140,8 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) } // satellite data block - SatelliteData s = { }; - std::vector s_array = { }; + V1_0::IGnssDebug::SatelliteData s = { }; + std::vector s_array; for (uint32_t i=0; i GnssDebug::getDebugData(getDebugData_cb _hidl_cb) return Void(); } +Return GnssDebug::getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) +{ + LOC_LOGD("%s]: ", __func__); + + V2_0::IGnssDebug::DebugData data = { }; + + if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){ + LOC_LOGE("GnssDebug - Null GNSS interface"); + _hidl_cb(data); + return Void(); + } + + // get debug report snapshot via hal interface + GnssDebugReport reports = { }; + mGnss->getGnssInterface()->getDebugReport(reports); + + // location block + if (reports.mLocation.mValid) { + data.position.valid = true; + data.position.latitudeDegrees = reports.mLocation.mLocation.latitude; + data.position.longitudeDegrees = reports.mLocation.mLocation.longitude; + data.position.altitudeMeters = reports.mLocation.mLocation.altitude; + + data.position.speedMetersPerSec = + (double)(reports.mLocation.mLocation.speed); + data.position.bearingDegrees = + (double)(reports.mLocation.mLocation.bearing); + data.position.horizontalAccuracyMeters = + (double)(reports.mLocation.mLocation.accuracy); + data.position.verticalAccuracyMeters = + reports.mLocation.verticalAccuracyMeters; + data.position.speedAccuracyMetersPerSecond = + reports.mLocation.speedAccuracyMetersPerSecond; + data.position.bearingAccuracyDegrees = + reports.mLocation.bearingAccuracyDegrees; + + timeval tv_now, tv_report; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; + gettimeofday(&tv_now, NULL); + data.position.ageSeconds = + (tv_now.tv_sec - tv_report.tv_sec) + + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; + } + else { + data.position.valid = false; + } + + if (data.position.horizontalAccuracyMeters <= 0 || + data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) { + data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS; + } + if (data.position.verticalAccuracyMeters <= 0 || + data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) { + data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS; + } + if (data.position.speedAccuracyMetersPerSecond <= 0 || + data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) { + data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC; + } + if (data.position.bearingAccuracyDegrees <= 0 || + data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) { + data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG; + } + + // time block + if (reports.mTime.mValid) { + data.time.timeEstimate = reports.mTime.timeEstimate; + data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs; + data.time.frequencyUncertaintyNsPerSec = + reports.mTime.frequencyUncertaintyNsPerSec; + } + + if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { + data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; + } + if (data.time.timeUncertaintyNs <= 0 || + data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + } + if (data.time.frequencyUncertaintyNsPerSec <= 0 || + data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { + data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC; + } + + // satellite data block + V2_0::IGnssDebug::SatelliteData s = { }; + std::vector s_array; + + for (uint32_t i=0; i +#include #include namespace android { @@ -31,7 +31,7 @@ namespace gnss { namespace V2_0 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssDebug; +using ::android::hardware::gnss::V2_0::IGnssDebug; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -44,11 +44,10 @@ struct GnssDebug : public IGnssDebug { GnssDebug(Gnss* gnss); ~GnssDebug() {}; - /* - * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. - * These declarations were generated from IGnssDebug.hal. - */ + // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow Return getDebugData(getDebugData_cb _hidl_cb) override; + // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. + Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; private: Gnss* mGnss = nullptr; diff --git a/android/2.0/location_api/BatchingAPIClient.cpp b/android/2.0/location_api/BatchingAPIClient.cpp index 48caee6f..49cd18a7 100644 --- a/android/2.0/location_api/BatchingAPIClient.cpp +++ b/android/2.0/location_api/BatchingAPIClient.cpp @@ -45,42 +45,35 @@ namespace gnss { namespace V2_0 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnssBatching; -using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; -using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::V2_0::IGnssBatching; +using ::android::hardware::gnss::V2_0::IGnssBatchingCallback; +using ::android::hardware::gnss::V2_0::GnssLocation; static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, LocationCapabilitiesMask mask); -BatchingAPIClient::BatchingAPIClient(const sp& callback) : +BatchingAPIClient::BatchingAPIClient(const sp& callback) : LocationAPIClientBase(), - mGnssBatchingCbIface(callback), + mGnssBatchingCbIface(nullptr), mDefaultId(UINT_MAX), - mLocationCapabilitiesMask(0) + mLocationCapabilitiesMask(0), + mGnssBatchingCbIface_2_0(nullptr) { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); - LocationCallbacks locationCallbacks; - memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); - locationCallbacks.size = sizeof(LocationCallbacks); + gnssUpdateCallbacks(callback); +} - locationCallbacks.trackingCb = nullptr; - locationCallbacks.batchingCb = nullptr; - if (mGnssBatchingCbIface != nullptr) { - locationCallbacks.batchingCb = [this](size_t count, Location* location, - BatchingOptions batchOptions) { - onBatchingCb(count, location, batchOptions); - }; - } - locationCallbacks.geofenceBreachCb = nullptr; - locationCallbacks.geofenceStatusCb = nullptr; - locationCallbacks.gnssLocationInfoCb = nullptr; - locationCallbacks.gnssNiCb = nullptr; - locationCallbacks.gnssSvCb = nullptr; - locationCallbacks.gnssNmeaCb = nullptr; - locationCallbacks.gnssMeasurementsCb = nullptr; +BatchingAPIClient::BatchingAPIClient(const sp& callback) : + LocationAPIClientBase(), + mGnssBatchingCbIface(nullptr), + mDefaultId(UINT_MAX), + mLocationCapabilitiesMask(0), + mGnssBatchingCbIface_2_0(nullptr) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); - locAPISetCallbacks(locationCallbacks); + gnssUpdateCallbacks_2_0(callback); } BatchingAPIClient::~BatchingAPIClient() @@ -94,6 +87,51 @@ int BatchingAPIClient::getBatchSize() return locAPIGetBatchSize(); } +void BatchingAPIClient::setCallbacks() +{ + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.batchingCb = nullptr; + locationCallbacks.batchingCb = [this](size_t count, Location* location, + BatchingOptions batchOptions) { + onBatchingCb(count, location, batchOptions); + }; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + +void BatchingAPIClient::gnssUpdateCallbacks(const sp& callback) +{ + mMutex.lock(); + mGnssBatchingCbIface = callback; + mMutex.unlock(); + + if (mGnssBatchingCbIface != nullptr) { + setCallbacks(); + } +} + +void BatchingAPIClient::gnssUpdateCallbacks_2_0(const sp& callback) +{ + mMutex.lock(); + mGnssBatchingCbIface_2_0 = callback; + mMutex.unlock(); + + if (mGnssBatchingCbIface_2_0 != nullptr) { + setCallbacks(); + } +} + int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) { LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, @@ -160,16 +198,32 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions /*batchOptions*/) { + mMutex.lock(); + auto gnssBatchingCbIface(mGnssBatchingCbIface); + auto gnssBatchingCbIface_2_0(mGnssBatchingCbIface_2_0); + mMutex.unlock(); + LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); - if (mGnssBatchingCbIface != nullptr && count > 0) { - hidl_vec locationVec; + if (gnssBatchingCbIface_2_0 != nullptr && count > 0) { + hidl_vec locationVec; locationVec.resize(count); for (size_t i = 0; i < count; i++) { convertGnssLocation(location[i], locationVec[i]); } - auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec); + auto r = gnssBatchingCbIface_2_0->gnssLocationBatchCb(locationVec); if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s", + LOC_LOGE("%s] Error from gnssLocationBatchCb 2.0 description=%s", + __func__, r.description().c_str()); + } + } else if (gnssBatchingCbIface != nullptr && count > 0) { + hidl_vec locationVec; + locationVec.resize(count); + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i]); + } + auto r = gnssBatchingCbIface->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb 1.0 description=%s", __func__, r.description().c_str()); } } diff --git a/android/2.0/location_api/BatchingAPIClient.h b/android/2.0/location_api/BatchingAPIClient.h index 33a8c2ef..7198341a 100644 --- a/android/2.0/location_api/BatchingAPIClient.h +++ b/android/2.0/location_api/BatchingAPIClient.h @@ -30,8 +30,9 @@ #ifndef BATCHING_API_CLINET_H #define BATCHING_API_CLINET_H -#include -#include +#include +#include +#include #include #include @@ -46,6 +47,9 @@ class BatchingAPIClient : public LocationAPIClientBase { public: BatchingAPIClient(const sp& callback); + BatchingAPIClient(const sp& callback); + void gnssUpdateCallbacks(const sp& callback); + void gnssUpdateCallbacks_2_0(const sp& callback); ~BatchingAPIClient(); int getBatchSize(); int startSession(const V1_0::IGnssBatching::Options& options); @@ -61,9 +65,12 @@ public: void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; private: + void setCallbacks(); + std::mutex mMutex; sp mGnssBatchingCbIface; uint32_t mDefaultId; LocationCapabilitiesMask mLocationCapabilitiesMask; + sp mGnssBatchingCbIface_2_0; }; } // namespace implementation diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index 44ae284c..5610f067 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -44,34 +44,46 @@ namespace gnss { namespace V2_0 { namespace implementation { -using ::android::hardware::gnss::V1_0::IGnss; -using ::android::hardware::gnss::V1_0::IGnssCallback; +using ::android::hardware::gnss::V2_0::IGnss; +using ::android::hardware::gnss::V2_0::IGnssCallback; using ::android::hardware::gnss::V1_0::IGnssNiCallback; -using ::android::hardware::gnss::V1_0::GnssLocation; +using ::android::hardware::gnss::V2_0::GnssLocation; -static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out); +static void convertGnssSvStatus(GnssSvNotification& in, V1_0::IGnssCallback::GnssSvStatus& out); +static void convertGnssSvStatus(GnssSvNotification& in, + hidl_vec& out); -GnssAPIClient::GnssAPIClient(const sp& gpsCb, - const sp& niCb) : +GnssAPIClient::GnssAPIClient(const sp& gpsCb, + const sp& niCb) : LocationAPIClientBase(), mGnssCbIface(nullptr), mGnssNiCbIface(nullptr), mControlClient(new LocationAPIControlClient()), mLocationCapabilitiesMask(0), - mLocationCapabilitiesCached(false) + mLocationCapabilitiesCached(false), + mGnssCbIface_2_0(nullptr) { LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); - // set default LocationOptions. - memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); - mTrackingOptions.size = sizeof(TrackingOptions); - mTrackingOptions.minInterval = 1000; - mTrackingOptions.minDistance = 0; - mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; - + initLocationOptions(); gnssUpdateCallbacks(gpsCb, niCb); } +GnssAPIClient::GnssAPIClient(const sp& gpsCb) : + LocationAPIClientBase(), + mGnssCbIface(nullptr), + mGnssNiCbIface(nullptr), + mControlClient(new LocationAPIControlClient()), + mLocationCapabilitiesMask(0), + mLocationCapabilitiesCached(false), + mGnssCbIface_2_0(nullptr) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb); + + initLocationOptions(); + gnssUpdateCallbacks_2_0(gpsCb); +} + GnssAPIClient::~GnssAPIClient() { LOC_LOGD("%s]: ()", __FUNCTION__); @@ -81,8 +93,62 @@ GnssAPIClient::~GnssAPIClient() } } +void GnssAPIClient::initLocationOptions() +{ + // set default LocationOptions. + memset(&mTrackingOptions, 0, sizeof(TrackingOptions)); + mTrackingOptions.size = sizeof(TrackingOptions); + mTrackingOptions.minInterval = 1000; + mTrackingOptions.minDistance = 0; + mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; +} + +void GnssAPIClient::setCallbacks() +{ + LocationCallbacks locationCallbacks; + memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); + locationCallbacks.size = sizeof(LocationCallbacks); + + locationCallbacks.trackingCb = nullptr; + locationCallbacks.trackingCb = [this](Location location) { + onTrackingCb(location); + }; + + locationCallbacks.batchingCb = nullptr; + locationCallbacks.geofenceBreachCb = nullptr; + locationCallbacks.geofenceStatusCb = nullptr; + locationCallbacks.gnssLocationInfoCb = nullptr; + locationCallbacks.gnssNiCb = nullptr; + if (mGnssNiCbIface != nullptr) { + loc_core::ContextBase* context = + loc_core::LocContext::getLocContext( + NULL, NULL, + loc_core::LocContext::mLocationHalName, false); + if (!context->hasAgpsExtendedCapabilities()) { + LOC_LOGD("Registering NI CB"); + locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotify) { + onGnssNiCb(id, gnssNiNotify); + }; + } + } + + locationCallbacks.gnssSvCb = nullptr; + locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { + onGnssSvCb(gnssSvNotification); + }; + + locationCallbacks.gnssNmeaCb = nullptr; + locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { + onGnssNmeaCb(gnssNmeaNotification); + }; + + locationCallbacks.gnssMeasurementsCb = nullptr; + + locAPISetCallbacks(locationCallbacks); +} + // for GpsInterface -void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, +void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, const sp& niCb) { LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); @@ -92,51 +158,22 @@ void GnssAPIClient::gnssUpdateCallbacks(const sp& gpsCb, mGnssNiCbIface = niCb; mMutex.unlock(); - LocationCallbacks locationCallbacks; - memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); - locationCallbacks.size = sizeof(LocationCallbacks); - - locationCallbacks.trackingCb = nullptr; - if (mGnssCbIface != nullptr) { - locationCallbacks.trackingCb = [this](Location location) { - onTrackingCb(location); - }; + if (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr) { + setCallbacks(); } +} - locationCallbacks.batchingCb = nullptr; - locationCallbacks.geofenceBreachCb = nullptr; - locationCallbacks.geofenceStatusCb = nullptr; - locationCallbacks.gnssLocationInfoCb = nullptr; +void GnssAPIClient::gnssUpdateCallbacks_2_0(const sp& gpsCb) +{ + LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb); - locationCallbacks.gnssNiCb = nullptr; - loc_core::ContextBase* context = - loc_core::LocContext::getLocContext( - NULL, NULL, - loc_core::LocContext::mLocationHalName, false); - if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) { - LOC_LOGD("Registering NI CB"); - locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) { - onGnssNiCb(id, gnssNiNotification); - }; + mMutex.lock(); + mGnssCbIface_2_0 = gpsCb; + mMutex.unlock(); + + if (mGnssCbIface_2_0 != nullptr) { + setCallbacks(); } - - locationCallbacks.gnssSvCb = nullptr; - if (mGnssCbIface != nullptr) { - locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) { - onGnssSvCb(gnssSvNotification); - }; - } - - locationCallbacks.gnssNmeaCb = nullptr; - if (mGnssCbIface != nullptr) { - locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) { - onGnssNmeaCb(gnssNmeaNotification); - }; - } - - locationCallbacks.gnssMeasurementsCb = nullptr; - - locAPISetCallbacks(locationCallbacks); } bool GnssAPIClient::gnssStart() @@ -307,9 +344,10 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (gnssCbIface != nullptr) { + if (gnssCbIface_2_0 != nullptr || gnssCbIface != nullptr) { uint32_t data = 0; if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) || (capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) || @@ -317,20 +355,18 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) (capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT)) data |= IGnssCallback::Capabilities::SCHEDULING; if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT) - data |= IGnssCallback::Capabilities::GEOFENCING; + data |= V1_0::IGnssCallback::Capabilities::GEOFENCING; if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) - data |= IGnssCallback::Capabilities::MEASUREMENTS; + data |= V1_0::IGnssCallback::Capabilities::MEASUREMENTS; if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) data |= IGnssCallback::Capabilities::MSB; if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) data |= IGnssCallback::Capabilities::MSA; - auto r = gnssCbIface->gnssSetCapabilitesCb(data); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", - __func__, r.description().c_str()); - } - } - if (gnssCbIface != nullptr) { + if (capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) + data |= IGnssCallback::Capabilities::LOW_POWER_MODE; + if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT) + data |= IGnssCallback::Capabilities::SATELLITE_BLACKLIST; + IGnssCallback::GnssSystemInfo gnssInfo; if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) { @@ -343,12 +379,33 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) gnssInfo.yearOfHw = 2015; } LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw); - auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", - __func__, r.description().c_str()); + + if (gnssCbIface_2_0 != nullptr) { + auto r = gnssCbIface_2_0->gnssSetCapabilitiesCb_2_0(data); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetCapabilitiesCb_2_0 description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface_2_0->gnssSetSystemInfoCb(gnssInfo); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", + __func__, r.description().c_str()); + } + } else if (gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssSetCapabilitesCb(data); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s", + __func__, r.description().c_str()); + } } + } + } void GnssAPIClient::onTrackingCb(Location location) @@ -356,17 +413,29 @@ void GnssAPIClient::onTrackingCb(Location location) LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (gnssCbIface != nullptr) { - GnssLocation gnssLocation; + if (gnssCbIface_2_0 != nullptr) { + V2_0::GnssLocation gnssLocation; + convertGnssLocation(location, gnssLocation); + auto r = gnssCbIface_2_0->gnssLocationCb_2_0(gnssLocation); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationCb_2_0 description=%s", + __func__, r.description().c_str()); + } + } else if (gnssCbIface != nullptr) { + V1_0::GnssLocation gnssLocation; convertGnssLocation(location, gnssLocation); auto r = gnssCbIface->gnssLocationCb(gnssLocation); if (!r.isOk()) { LOC_LOGE("%s] Error from gnssLocationCb description=%s", __func__, r.description().c_str()); } + } else { + LOC_LOGW("%s] No GNSS Interface ready for gnssLocationCb ", __FUNCTION__); } + } void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) @@ -449,10 +518,19 @@ void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (gnssCbIface != nullptr) { - IGnssCallback::GnssSvStatus svStatus; + if (gnssCbIface_2_0 != nullptr) { + hidl_vec svInfoList; + convertGnssSvStatus(gnssSvNotification, svInfoList); + auto r = gnssCbIface_2_0->gnssSvStatusCb_2_0(svInfoList); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssSvStatusCb_2_0 description=%s", + __func__, r.description().c_str()); + } + } else if (gnssCbIface != nullptr) { + V1_0::IGnssCallback::GnssSvStatus svStatus; convertGnssSvStatus(gnssSvNotification, svStatus); auto r = gnssCbIface->gnssSvStatusCb(svStatus); if (!r.isOk()) { @@ -466,9 +544,10 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) { mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (gnssCbIface != nullptr) { + if (gnssCbIface != nullptr || gnssCbIface_2_0 != nullptr) { const std::string s(gnssNmeaNotification.nmea); std::stringstream ss(s); std::string each; @@ -476,12 +555,22 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) each += '\n'; android::hardware::hidl_string nmeaString; nmeaString.setToExternal(each.c_str(), each.length()); - auto r = gnssCbIface->gnssNmeaCb( - static_cast(gnssNmeaNotification.timestamp), nmeaString); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__, - gnssNmeaNotification.nmea, gnssNmeaNotification.length, - r.description().c_str()); + if (gnssCbIface_2_0 != nullptr) { + auto r = gnssCbIface_2_0->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%zu description=%s", + __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, + r.description().c_str()); + } + } else if (gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssNmeaCb( + static_cast(gnssNmeaNotification.timestamp), nmeaString); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", + __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, + r.description().c_str()); + } } } } @@ -492,18 +581,32 @@ void GnssAPIClient::onStartTrackingCb(LocationError error) LOC_LOGD("%s]: (%d)", __FUNCTION__, error); mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { - auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", - __func__, r.description().c_str()); - } - r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", - __func__, r.description().c_str()); + if (error == LOCATION_ERROR_SUCCESS) { + if (gnssCbIface_2_0 != nullptr) { + auto r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb 2.0 ENGINE_ON description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb 2.0 SESSION_BEGIN description=%s", + __func__, r.description().c_str()); + } + } else if (gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s", + __func__, r.description().c_str()); + } } } } @@ -513,23 +616,38 @@ void GnssAPIClient::onStopTrackingCb(LocationError error) LOC_LOGD("%s]: (%d)", __FUNCTION__, error); mMutex.lock(); auto gnssCbIface(mGnssCbIface); + auto gnssCbIface_2_0(mGnssCbIface_2_0); mMutex.unlock(); - if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) { - auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", - __func__, r.description().c_str()); - } - r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", - __func__, r.description().c_str()); + if (error == LOCATION_ERROR_SUCCESS) { + if (gnssCbIface_2_0 != nullptr) { + auto r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb 2.0 SESSION_END description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface_2_0->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb 2.0 ENGINE_OFF description=%s", + __func__, r.description().c_str()); + } + + } else if (gnssCbIface != nullptr) { + auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s", + __func__, r.description().c_str()); + } + r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s", + __func__, r.description().c_str()); + } } } } -static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out) +static void convertGnssSvStatus(GnssSvNotification& in, V1_0::IGnssCallback::GnssSvStatus& out) { memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus)); out.numSvs = in.count; @@ -539,22 +657,45 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta out.numSvs = static_cast(V1_0::GnssMax::SVS_COUNT); } for (size_t i = 0; i < out.numSvs; i++) { - IGnssCallback::GnssSvInfo& info = out.gnssSvList[i]; - info.svid = in.gnssSvs[i].svId; - convertGnssConstellationType(in.gnssSvs[i].type, info.constellation); - info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; - info.elevationDegrees = in.gnssSvs[i].elevation; - info.azimuthDegrees = in.gnssSvs[i].azimuth; - info.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; - info.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); + out.gnssSvList[i].svid = in.gnssSvs[i].svId; + convertGnssConstellationType(in.gnssSvs[i].type, out.gnssSvList[i].constellation); + out.gnssSvList[i].cN0Dbhz = in.gnssSvs[i].cN0Dbhz; + out.gnssSvList[i].elevationDegrees = in.gnssSvs[i].elevation; + out.gnssSvList[i].azimuthDegrees = in.gnssSvs[i].azimuth; + out.gnssSvList[i].carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; + out.gnssSvList[i].svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) - info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; + out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) - info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; + out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) - info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT) - info.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; + out.gnssSvList[i].svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; + } +} + +static void convertGnssSvStatus(GnssSvNotification& in, + hidl_vec& out) +{ + out.resize(in.count); + for (size_t i = 0; i < in.count; i++) { + out[i].v1_0.svid = in.gnssSvs[i].svId; + out[i].v1_0.cN0Dbhz = in.gnssSvs[i].cN0Dbhz; + out[i].v1_0.elevationDegrees = in.gnssSvs[i].elevation; + out[i].v1_0.azimuthDegrees = in.gnssSvs[i].azimuth; + out[i].v1_0.carrierFrequencyHz = in.gnssSvs[i].carrierFrequencyHz; + out[i].v1_0.svFlag = static_cast(IGnssCallback::GnssSvFlags::NONE); + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT) + out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT) + out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT) + out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX; + if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_CARRIER_FREQUENCY_BIT) + out[i].v1_0.svFlag |= IGnssCallback::GnssSvFlags::HAS_CARRIER_FREQUENCY; + + convertGnssConstellationType(in.gnssSvs[i].type, out[i].constellation); } } diff --git a/android/2.0/location_api/GnssAPIClient.h b/android/2.0/location_api/GnssAPIClient.h index a129cee1..493f9ca1 100644 --- a/android/2.0/location_api/GnssAPIClient.h +++ b/android/2.0/location_api/GnssAPIClient.h @@ -33,7 +33,7 @@ #include #include -//#include +#include #include namespace android { @@ -49,6 +49,7 @@ class GnssAPIClient : public LocationAPIClientBase public: GnssAPIClient(const sp& gpsCb, const sp& niCb); + GnssAPIClient(const sp& gpsCb); virtual ~GnssAPIClient(); GnssAPIClient(const GnssAPIClient&) = delete; GnssAPIClient& operator=(const GnssAPIClient&) = delete; @@ -56,6 +57,7 @@ public: // for GpsInterface void gnssUpdateCallbacks(const sp& gpsCb, const sp& niCb); + void gnssUpdateCallbacks_2_0(const sp& gpsCb); bool gnssStart(); bool gnssStop(); bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode, @@ -91,6 +93,8 @@ public: void onStopTrackingCb(LocationError error) final; private: + void setCallbacks(); + void initLocationOptions(); sp mGnssCbIface; sp mGnssNiCbIface; std::mutex mMutex; @@ -98,6 +102,7 @@ private: LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; TrackingOptions mTrackingOptions; + sp mGnssCbIface_2_0; }; } // namespace implementation diff --git a/android/2.0/location_api/LocationUtil.cpp b/android/2.0/location_api/LocationUtil.cpp index c921154e..6bd50849 100644 --- a/android/2.0/location_api/LocationUtil.cpp +++ b/android/2.0/location_api/LocationUtil.cpp @@ -28,6 +28,8 @@ */ #include +#include +#include namespace android { namespace hardware { @@ -35,13 +37,13 @@ namespace gnss { namespace V2_0 { namespace implementation { -using ::android::hardware::gnss::V1_0::GnssLocation; -using ::android::hardware::gnss::V1_0::GnssConstellationType; +using ::android::hardware::gnss::V2_0::GnssLocation; +using ::android::hardware::gnss::V2_0::GnssConstellationType; using ::android::hardware::gnss::V1_0::GnssLocationFlags; -void convertGnssLocation(Location& in, GnssLocation& out) +void convertGnssLocation(Location& in, V1_0::GnssLocation& out) { - memset(&out, 0, sizeof(GnssLocation)); + memset(&out, 0, sizeof(V1_0::GnssLocation)); if (in.flags & LOCATION_HAS_LAT_LONG_BIT) { out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG; out.latitudeDegrees = in.latitude; @@ -79,7 +81,40 @@ void convertGnssLocation(Location& in, GnssLocation& out) out.timestamp = static_cast(in.timestamp); } -void convertGnssLocation(const GnssLocation& in, Location& out) +void convertGnssLocation(Location& in, V2_0::GnssLocation& out) +{ + memset(&out, 0, sizeof(V2_0::GnssLocation)); + convertGnssLocation(in, out.v1_0); + + struct timespec sinceBootTime; + struct timespec currentTime; + if (0 == clock_gettime(CLOCK_BOOTTIME,&sinceBootTime) && + 0 == clock_gettime(CLOCK_REALTIME,¤tTime)) { + + int64_t sinceBootTimeNanos = sinceBootTime.tv_sec*1000000000 + sinceBootTime.tv_nsec; + int64_t currentTimeNanos = currentTime.tv_sec*1000000000 + currentTime.tv_nsec; + int64_t locationTimeNanos = in.timestamp*1000000; + LOC_LOGD("%s]: sinceBootTimeNanos:%" PRIi64 " currentTimeNanos:%" PRIi64 "" + " locationTimeNanos:%" PRIi64 "", + __FUNCTION__, sinceBootTimeNanos, currentTimeNanos, locationTimeNanos); + if (currentTimeNanos >= locationTimeNanos) { + int64_t ageTimeNanos = currentTimeNanos - locationTimeNanos; + LOC_LOGD("%s]: ageTimeNanos:%" PRIi64 ")", __FUNCTION__, ageTimeNanos); + if (ageTimeNanos >= 0 && ageTimeNanos <= sinceBootTimeNanos) { + out.elapsedRealtime.flags |= ElapsedRealtimeFlags::HAS_TIMESTAMP_NS; + out.elapsedRealtime.timestampNs = sinceBootTimeNanos - ageTimeNanos; + out.elapsedRealtime.flags |= ElapsedRealtimeFlags::HAS_TIME_UNCERTAINTY_NS; + // time uncertainty is 1 ms since it is calculated from utc time that is in ms + out.elapsedRealtime.timeUncertaintyNs = 1000000; + LOC_LOGD("%s]: timestampNs:%" PRIi64 ")", + __FUNCTION__, out.elapsedRealtime.timestampNs); + } + } + } + +} + +void convertGnssLocation(const V1_0::GnssLocation& in, Location& out) { memset(&out, 0, sizeof(out)); if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG) { @@ -119,30 +154,64 @@ void convertGnssLocation(const GnssLocation& in, Location& out) out.timestamp = static_cast(in.timestamp); } -void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out) +void convertGnssLocation(const V2_0::GnssLocation& in, Location& out) +{ + memset(&out, 0, sizeof(out)); + convertGnssLocation(in.v1_0, out); +} + +void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out) { switch(in) { case GNSS_SV_TYPE_GPS: - out = GnssConstellationType::GPS; + out = V1_0::GnssConstellationType::GPS; break; case GNSS_SV_TYPE_SBAS: - out = GnssConstellationType::SBAS; + out = V1_0::GnssConstellationType::SBAS; break; case GNSS_SV_TYPE_GLONASS: - out = GnssConstellationType::GLONASS; + out = V1_0::GnssConstellationType::GLONASS; break; case GNSS_SV_TYPE_QZSS: - out = GnssConstellationType::QZSS; + out = V1_0::GnssConstellationType::QZSS; break; case GNSS_SV_TYPE_BEIDOU: - out = GnssConstellationType::BEIDOU; + out = V1_0::GnssConstellationType::BEIDOU; break; case GNSS_SV_TYPE_GALILEO: - out = GnssConstellationType::GALILEO; + out = V1_0::GnssConstellationType::GALILEO; break; case GNSS_SV_TYPE_UNKNOWN: default: - out = GnssConstellationType::UNKNOWN; + out = V1_0::GnssConstellationType::UNKNOWN; + break; + } +} + +void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& out) +{ + switch(in) { + case GNSS_SV_TYPE_GPS: + out = V2_0::GnssConstellationType::GPS; + break; + case GNSS_SV_TYPE_SBAS: + out = V2_0::GnssConstellationType::SBAS; + break; + case GNSS_SV_TYPE_GLONASS: + out = V2_0::GnssConstellationType::GLONASS; + break; + case GNSS_SV_TYPE_QZSS: + out = V2_0::GnssConstellationType::QZSS; + break; + case GNSS_SV_TYPE_BEIDOU: + out = V2_0::GnssConstellationType::BEIDOU; + break; + case GNSS_SV_TYPE_GALILEO: + out = V2_0::GnssConstellationType::GALILEO; + break; + case GNSS_SV_TYPE_UNKNOWN: + default: + out = V2_0::GnssConstellationType::UNKNOWN; break; } } diff --git a/android/2.0/location_api/LocationUtil.h b/android/2.0/location_api/LocationUtil.h index c6f5eadc..8426de72 100644 --- a/android/2.0/location_api/LocationUtil.h +++ b/android/2.0/location_api/LocationUtil.h @@ -30,7 +30,7 @@ #ifndef LOCATION_UTIL_H #define LOCATION_UTIL_H -#include +#include #include #include @@ -41,8 +41,11 @@ namespace V2_0 { namespace implementation { void convertGnssLocation(Location& in, V1_0::GnssLocation& out); +void convertGnssLocation(Location& in, V2_0::GnssLocation& out); void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); +void convertGnssLocation(const V2_0::GnssLocation& in, Location& out); void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); +void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& out); void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp index d9cae18b..23c3b168 100644 --- a/android/2.0/location_api/MeasurementAPIClient.cpp +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -54,6 +54,8 @@ static void convertGnssData_2_0(GnssMeasurementsNotification& in, static void convertGnssMeasurement(GnssMeasurementsData& in, V1_0::IGnssMeasurementCallback::GnssMeasurement& out); static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); +static void convertGnssMeasurementsCodeType(GnssMeasurementsCodeType& in, + ::android::hardware::hidl_string& out); MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), @@ -362,6 +364,8 @@ static void convertGnssData_2_0(GnssMeasurementsNotification& in, out.measurements.resize(in.count); for (size_t i = 0; i < in.count; i++) { convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_1.v1_0); + convertGnssConstellationType(in.measurements[i].svType, out.measurements[i].constellation); + convertGnssMeasurementsCodeType(in.measurements[i].codeType, out.measurements[i].codeType); if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT) out.measurements[i].v1_1.accumulatedDeltaRangeState |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID; @@ -374,11 +378,6 @@ static void convertGnssData_2_0(GnssMeasurementsNotification& in, if (in.measurements[i].adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_HALF_CYCLE_RESOLVED_BIT) out.measurements[i].v1_1.accumulatedDeltaRangeState |= IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_HALF_CYCLE_RESOLVED; - -// out.measurements[i].codeType = -// static_cast(in.measurements[i].codeType); -// out.measurements[i].otherCodeTypeName = in.measurements[i].otherCodeTypeName; - if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT) out.measurements[i].state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK; if (in.measurements[i].stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT) @@ -417,6 +416,57 @@ static void convertGnssData_2_0(GnssMeasurementsNotification& in, convertGnssClock(in.clock, out.clock); } +static void convertGnssMeasurementsCodeType(GnssMeasurementsCodeType& in, + ::android::hardware::hidl_string& out) +{ + switch(in) { + case GNSS_MEASUREMENTS_CODE_TYPE_A: + out = "A"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_B: + out = "B"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_C: + out = "C"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_I: + out = "I"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_L: + out = "L"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_M: + out = "M"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_P: + out = "P"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_Q: + out = "Q"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_S: + out = "S"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_W: + out = "W"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_X: + out = "X"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_Y: + out = "Y"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_Z: + out = "Z"; + break; + case GNSS_MEASUREMENTS_CODE_TYPE_N: + out = "N"; + break; + default: + out = "UNKNOWN"; + } +} + } // namespace implementation } // namespace V2_0 } // namespace gnss diff --git a/android/measurement_corrections/1.0/MeasurementCorrections.cpp b/android/measurement_corrections/1.0/MeasurementCorrections.cpp index c1a335aa..2c93cb3a 100644 --- a/android/measurement_corrections/1.0/MeasurementCorrections.cpp +++ b/android/measurement_corrections/1.0/MeasurementCorrections.cpp @@ -54,11 +54,12 @@ MeasurementCorrections::MeasurementCorrections() { MeasurementCorrections::~MeasurementCorrections() { } -Return MeasurementCorrections::setCorrections(const ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections& corrections) { +Return MeasurementCorrections::setCorrections(const ::android::hardware::gnss::measurement_corrections::V1_0::MeasurementCorrections& /*corrections*/) { return true; } -Return MeasurementCorrections::setCallback(const sp& callback) { +Return MeasurementCorrections::setCallback( + const sp& /*callback*/) { return true; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index edfc1500..5253a1b4 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1954,9 +1954,6 @@ GnssAdapter::updateClientsEventMask() if (it->second.trackingCb != nullptr || it->second.gnssLocationInfoCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT; } - if (it->second.gnssNiCb != nullptr) { - mask |= LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; - } if (it->second.gnssSvCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_SATELLITE_REPORT; } @@ -2005,6 +2002,10 @@ GnssAdapter::updateClientsEventMask() // need to register for leap second info // for proper nmea generation mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; + + // always register for NI NOTIFY VERIFY to handle internally in HAL + mask |= LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; + updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } From 2c71ec9e02ea234106d520717fc36eb4f3ad7c48 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Fri, 11 May 2018 14:59:44 -0700 Subject: [PATCH 836/945] feat: Add timeuncNs in PQWM1 message Add timeuncNs field in PQWM1 of debug NMEA message generated by modem. SystemStaus to parse it. GnssDebug adds this value in timeunc when it generates GNSS debug report. Change-Id: I649915f95730dc8db22e8b4cb88008edc6d8b9d0 CRs-Fixed: 2236950 --- android/1.1/GnssDebug.cpp | 10 ++++++---- android/2.0/GnssDebug.cpp | 18 +++++++++++------- core/SystemStatus.cpp | 19 ++++++++++++++----- core/SystemStatus.h | 4 +++- gnss/GnssAdapter.cpp | 15 ++++++++++++--- 5 files changed, 46 insertions(+), 20 deletions(-) diff --git a/android/1.1/GnssDebug.cpp b/android/1.1/GnssDebug.cpp index ce394767..f164c544 100644 --- a/android/1.1/GnssDebug.cpp +++ b/android/1.1/GnssDebug.cpp @@ -36,7 +36,8 @@ using ::android::hardware::hidl_vec; #define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) #define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT -#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN (999) // 999 ns +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX (1.57783680E17) // 5 years in ns #define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) @@ -125,9 +126,10 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } - if (data.time.timeUncertaintyNs <= 0 || - data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { - data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + if (data.time.timeUncertaintyNs <= 0) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN; + } else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX; } if (data.time.frequencyUncertaintyNsPerSec <= 0 || data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { diff --git a/android/2.0/GnssDebug.cpp b/android/2.0/GnssDebug.cpp index b6b9bfed..dc0d9f4d 100644 --- a/android/2.0/GnssDebug.cpp +++ b/android/2.0/GnssDebug.cpp @@ -41,7 +41,8 @@ using ::android::hardware::gnss::V2_0::IGnssDebug; #define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180) #define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT -#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN (999) // 999 ns +#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX (1.57783680E17) // 5 years in ns #define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) @@ -130,9 +131,10 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } - if (data.time.timeUncertaintyNs <= 0 || - data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { - data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + if (data.time.timeUncertaintyNs <= 0) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN; + } else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX; } if (data.time.frequencyUncertaintyNsPerSec <= 0 || data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { @@ -247,9 +249,11 @@ Return GnssDebug::getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) { data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME; } - if (data.time.timeUncertaintyNs <= 0 || - data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) { - data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC; + if (data.time.timeUncertaintyNs <= 0) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN; + } + else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) { + data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX; } if (data.time.frequencyUncertaintyNsPerSec <= 0 || data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) { diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 6ef49935..524963bd 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -126,6 +126,7 @@ public: uint32_t mBdsBpAmpQ; // x1C uint32_t mGalBpAmpI; // x1D uint32_t mGalBpAmpQ; // x1E + uint64_t mTimeUncNs; // x1F }; // parser @@ -157,7 +158,6 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, - eMax0 = eAgcGal, eLeapSeconds = 23, eLeapSecUnc = 24, eGloBpAmpI = 25, @@ -166,6 +166,8 @@ private: eBdsBpAmpQ = 28, eGalBpAmpI = 29, eGalBpAmpQ = 30, + eMax0 = eGalBpAmpQ, + eTimeUncNs = 31, eMax }; SystemStatusPQWM1 mM1; @@ -201,6 +203,7 @@ public: inline uint32_t getBdsBpAmpQ() { return mM1.mBdsBpAmpQ; } inline uint32_t getGalBpAmpI() { return mM1.mGalBpAmpI; } inline uint32_t getGalBpAmpQ() { return mM1.mGalBpAmpQ; } + inline uint64_t getTimeUncNs() { return mM1.mTimeUncNs; } SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) @@ -245,6 +248,9 @@ public: mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str()); mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str()); } + if (mField.size() > eTimeUncNs) { + mM1.mTimeUncNs = strtoull(mField[eTimeUncNs].c_str(), nullptr, 10); + } } inline SystemStatusPQWM1& get() { return mM1;} //getparser @@ -715,7 +721,8 @@ SystemStatusTimeAndClock::SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea mClockFreqBias(nmea.mClockFreqBias), mClockFreqBiasUnc(nmea.mClockFreqBiasUnc), mLeapSeconds(nmea.mLeapSeconds), - mLeapSecUnc(nmea.mLeapSecUnc) + mLeapSecUnc(nmea.mLeapSecUnc), + mTimeUncNs(nmea.mTimeUncNs) { } @@ -729,7 +736,8 @@ bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer) (mClockFreqBias != peer.mClockFreqBias) || (mClockFreqBiasUnc != peer.mClockFreqBiasUnc) || (mLeapSeconds != peer.mLeapSeconds) || - (mLeapSecUnc != peer.mLeapSecUnc)) { + (mLeapSecUnc != peer.mLeapSecUnc) || + (mTimeUncNs != peer.mTimeUncNs)) { return false; } return true; @@ -737,7 +745,7 @@ bool SystemStatusTimeAndClock::equals(const SystemStatusTimeAndClock& peer) void SystemStatusTimeAndClock::dump() { - LOC_LOGV("TimeAndClock: u=%ld:%ld g=%d:%d v=%d ts=%d tu=%d b=%d bu=%d ls=%d lu=%d", + LOC_LOGV("TimeAndClock: u=%ld:%ld g=%d:%d v=%d ts=%d tu=%d b=%d bu=%d ls=%d lu=%d un=%" PRIu64, mUtcTime.tv_sec, mUtcTime.tv_nsec, mGpsWeek, mGpsTowMs, @@ -747,7 +755,8 @@ void SystemStatusTimeAndClock::dump() mClockFreqBias, mClockFreqBiasUnc, mLeapSeconds, - mLeapSecUnc); + mLeapSecUnc, + mTimeUncNs); return; } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 73a220a0..399a6c49 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -116,6 +116,7 @@ public: int32_t mClockFreqBiasUnc; int32_t mLeapSeconds; int32_t mLeapSecUnc; + uint64_t mTimeUncNs; inline SystemStatusTimeAndClock() : mGpsWeek(0), mGpsTowMs(0), @@ -125,7 +126,8 @@ public: mClockFreqBias(0), mClockFreqBiasUnc(0), mLeapSeconds(0), - mLeapSecUnc(0) {} + mLeapSecUnc(0), + mTimeUncNs(0ULL) {} inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusTimeAndClock& peer); void dump(void); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5253a1b4..1a6bdd9f 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -4340,9 +4340,18 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) (int64_t)(reports.mTimeAndClock.back().mLeapSeconds))*1000ULL + (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); - r.mTime.timeUncertaintyNs = - ((float)(reports.mTimeAndClock.back().mTimeUnc) + - (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; + if (reports.mTimeAndClock.back().mTimeUncNs > 0) { + // TimeUncNs value is available + r.mTime.timeUncertaintyNs = + (float)(reports.mTimeAndClock.back().mLeapSecUnc)*1000.0f + + (float)(reports.mTimeAndClock.back().mTimeUncNs); + } else { + // fall back to legacy TimeUnc + r.mTime.timeUncertaintyNs = + ((float)(reports.mTimeAndClock.back().mTimeUnc) + + (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; + } + r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f", From bb5cbeed24bdf26ff6dc54592bbaca6e1f418865 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 25 Apr 2019 16:08:26 -0700 Subject: [PATCH 837/945] Age Second field in GNSS debug data is incorrect Change-Id: Iec28f9dbbc3b9cfe9a5d06e1f198a02cf09047be CRs-fixed: 2434780 --- core/SystemStatus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 399a6c49..0dbcf916 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -68,15 +68,15 @@ namespace loc_core class SystemStatusItemBase { public: - timespec mUtcTime; // UTC timestamp when this info was last updated - timespec mUtcReported; // UTC timestamp when this info was reported + timespec mUtcTime; + timespec mUtcReported; static const uint32_t maxItem = 5; SystemStatusItemBase() { - struct timespec tv; - clock_gettime(CLOCK_MONOTONIC, &tv); + timeval tv; + gettimeofday(&tv, NULL); mUtcTime.tv_sec = tv.tv_sec; - mUtcTime.tv_nsec = tv.tv_nsec; + mUtcTime.tv_nsec = tv.tv_usec*1000ULL; mUtcReported = mUtcTime; }; virtual ~SystemStatusItemBase() {}; From 76e761da5a0ebc4ae8d888416e1f8db27cc5f9e7 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Sun, 28 Apr 2019 08:16:57 -0700 Subject: [PATCH 838/945] SV "in-use" flags are not being set correctly for multiband enabled devices Change-Id: I875b535063c6aa6ecb713c7b6abff123d8402d62 CRs-fixed: 2443087 --- gnss/GnssAdapter.cpp | 99 +++++++++++++++++++++++++++++++++++++++--- gnss/GnssAdapter.h | 3 ++ utils/gps_extended_c.h | 25 +++++++++++ 3 files changed, 121 insertions(+), 6 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e1143fd2..fb5c54f0 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -95,7 +95,10 @@ GnssAdapter::GnssAdapter() : mAllowFlpNetworkFixes(0), mGnssEnergyConsumedCb(nullptr), mPowerStateCb(nullptr), - mIsE911Session(NULL) + mIsE911Session(NULL), + mGnssMbSvIdUsedInPosition{}, + mGnssMbSvIdUsedInPosAvail(false), + mGnssSignalType() { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -3136,10 +3139,18 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, } mGnssSvIdUsedInPosAvail = false; + mGnssMbSvIdUsedInPosAvail = false; if (reportToGnssClient) { if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) { mGnssSvIdUsedInPosAvail = true; mGnssSvIdUsedInPosition = locationExtended.gnss_sv_used_ids; + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MULTIBAND) { + mGnssMbSvIdUsedInPosAvail = true; + mGnssMbSvIdUsedInPosition = locationExtended.gnss_mb_sv_used_ids; + for (int i = 0; i < GNSS_SV_MAX; i++) { + mGnssSignalType[i] = locationExtended.measUsageInfo[i].gnssSignalType; + } + } } // if engine hub is running and the fix is from sensor, e.g.: DRE, @@ -3210,27 +3221,103 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) switch (svNotify.gnssSvs[i].type) { case GNSS_SV_TYPE_GPS: if (mGnssSvIdUsedInPosAvail) { - svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; + if (mGnssMbSvIdUsedInPosAvail) { + switch (mGnssSignalType[i]) { + case GNSS_SIGNAL_GPS_L1CA: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gps_l1ca_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GPS_L1C: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gps_l1c_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GPS_L2: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gps_l2_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GPS_L5: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gps_l5_sv_used_ids_mask; + break; + } + } else { + svUsedIdMask = mGnssSvIdUsedInPosition.gps_sv_used_ids_mask; + } } break; case GNSS_SV_TYPE_GLONASS: if (mGnssSvIdUsedInPosAvail) { - svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; + if (mGnssMbSvIdUsedInPosAvail) { + switch (mGnssSignalType[i]) { + case GNSS_SIGNAL_GLONASS_G1: + svUsedIdMask = mGnssMbSvIdUsedInPosition.glo_g1_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GLONASS_G2: + svUsedIdMask = mGnssMbSvIdUsedInPosition.glo_g2_sv_used_ids_mask; + break; + } + } else { + svUsedIdMask = mGnssSvIdUsedInPosition.glo_sv_used_ids_mask; + } } break; case GNSS_SV_TYPE_BEIDOU: if (mGnssSvIdUsedInPosAvail) { - svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; + if (mGnssMbSvIdUsedInPosAvail) { + switch (mGnssSignalType[i]) { + case GNSS_SIGNAL_BEIDOU_B1I: + svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b1i_sv_used_ids_mask; + break; + case GNSS_SIGNAL_BEIDOU_B1C: + svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b1c_sv_used_ids_mask; + break; + case GNSS_SIGNAL_BEIDOU_B2I: + svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b2i_sv_used_ids_mask; + break; + case GNSS_SIGNAL_BEIDOU_B2AI: + svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b2ai_sv_used_ids_mask; + break; + } + } else { + svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; + } } break; case GNSS_SV_TYPE_GALILEO: if (mGnssSvIdUsedInPosAvail) { - svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; + if (mGnssMbSvIdUsedInPosAvail) { + switch (mGnssSignalType[i]) { + case GNSS_SIGNAL_GALILEO_E1: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gal_e1_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GALILEO_E5A: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gal_e5a_sv_used_ids_mask; + break; + case GNSS_SIGNAL_GALILEO_E5B: + svUsedIdMask = mGnssMbSvIdUsedInPosition.gal_e5b_sv_used_ids_mask; + break; + } + } else { + svUsedIdMask = mGnssSvIdUsedInPosition.gal_sv_used_ids_mask; + } } break; case GNSS_SV_TYPE_QZSS: if (mGnssSvIdUsedInPosAvail) { - svUsedIdMask = mGnssSvIdUsedInPosition.qzss_sv_used_ids_mask; + if (mGnssMbSvIdUsedInPosAvail) { + switch (mGnssSignalType[i]) { + case GNSS_SIGNAL_QZSS_L1CA: + svUsedIdMask = mGnssMbSvIdUsedInPosition.qzss_l1ca_sv_used_ids_mask; + break; + case GNSS_SIGNAL_QZSS_L1S: + svUsedIdMask = mGnssMbSvIdUsedInPosition.qzss_l1s_sv_used_ids_mask; + break; + case GNSS_SIGNAL_QZSS_L2: + svUsedIdMask = mGnssMbSvIdUsedInPosition.qzss_l2_sv_used_ids_mask; + break; + case GNSS_SIGNAL_QZSS_L5: + svUsedIdMask = mGnssMbSvIdUsedInPosition.qzss_l5_sv_used_ids_mask; + break; + } + } else { + svUsedIdMask = mGnssSvIdUsedInPosition.qzss_sv_used_ids_mask; + } } // QZSS SV id's need to reported as it is to framework, since // framework expects it as it is. See GnssStatus.java. diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 6f652e63..13efab12 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -145,6 +145,9 @@ class GnssAdapter : public LocAdapterBase { LocPosMode mLocPositionMode; GnssSvUsedInPosition mGnssSvIdUsedInPosition; bool mGnssSvIdUsedInPosAvail; + GnssSvMbUsedInPosition mGnssMbSvIdUsedInPosition; + bool mGnssMbSvIdUsedInPosAvail; + GnssSignalTypeMask mGnssSignalType[GNSS_SV_MAX]; /* ==== CONTROL ======================================================================== */ LocationControlCallbacks mControlCallbacks; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 18517839..ba63c5c1 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -373,6 +373,8 @@ typedef uint64_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 /** GpsLocationExtended has heading rate **/ #define GPS_LOCATION_EXTENDED_HAS_HEADING_RATE 0x200000000 +/** GpsLocationExtended has multiband signals **/ +#define GPS_LOCATION_EXTENDED_HAS_MULTIBAND 0x400000000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -467,6 +469,27 @@ typedef struct { uint64_t qzss_sv_used_ids_mask; } GnssSvUsedInPosition; +typedef struct { + uint64_t gps_l1ca_sv_used_ids_mask; // GPS L1CA + uint64_t gps_l1c_sv_used_ids_mask; // GPS L1C + uint64_t gps_l2_sv_used_ids_mask; // GPS L2 + uint64_t gps_l5_sv_used_ids_mask; // GPS L5 + uint64_t glo_g1_sv_used_ids_mask; // GLO G1 + uint64_t glo_g2_sv_used_ids_mask; // GLO G2 + uint64_t gal_e1_sv_used_ids_mask; // GAL E1 + uint64_t gal_e5a_sv_used_ids_mask; // GAL E5A + uint64_t gal_e5b_sv_used_ids_mask; // GAL E5B + uint64_t bds_b1i_sv_used_ids_mask; // BDS B1I + uint64_t bds_b1c_sv_used_ids_mask; // BDS B1C + uint64_t bds_b2i_sv_used_ids_mask; // BDS B2I + uint64_t bds_b2ai_sv_used_ids_mask; // BDS B2AI + uint64_t qzss_l1ca_sv_used_ids_mask; // QZSS L1CA + uint64_t qzss_l1s_sv_used_ids_mask; // QZSS L1S + uint64_t qzss_l2_sv_used_ids_mask; // QZSS L2 + uint64_t qzss_l5_sv_used_ids_mask; // QZSS L5 + uint64_t sbas_l1_sv_used_ids_mask; // SBAS L1 +} GnssSvMbUsedInPosition; + /* Body Frame parameters */ typedef struct { /** Contains Body frame LocPosDataMask bits. */ @@ -689,6 +712,8 @@ typedef struct { Gnss_ApTimeStampStructType timeStamp; /** Gnss sv used in position data */ GnssSvUsedInPosition gnss_sv_used_ids; + /** Gnss sv used in position data for multiband */ + GnssSvMbUsedInPosition gnss_mb_sv_used_ids; /** Nav solution mask to indicate sbas corrections */ LocNavSolutionMask navSolutionMask; /** Position technology used in computing this fix */ From aa95ca27f8db9f0a47116344ca4d12042acdb63b Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 1 May 2019 13:19:19 -0700 Subject: [PATCH 839/945] Process CP_MTLR in emergency in different conditions Prcess CP_MTLR based on a new configuration item Change-Id: I9351f574f0b1a4bad2b88f2627ab188ac1522e92 CRs-fixed: 2444954 --- core/ContextBase.cpp | 4 +++- core/ContextBase.h | 1 + etc/gps.conf | 6 ++++++ gnss/GnssAdapter.cpp | 16 ++++++++++------ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 12e550ff..084b6bfb 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -79,6 +79,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' }, + {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' }, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -112,7 +113,8 @@ void ContextBase::readConfig() mGps_conf.GPS_LOCK = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; mGps_conf.SUPL_VER = 0x10000; mGps_conf.SUPL_MODE = 0x1; - mGps_conf.SUPL_ES = 1; + mGps_conf.SUPL_ES = 0; + mGps_conf.CP_MTLR_ES = 0; mGps_conf.SUPL_HOST[0] = 0; mGps_conf.SUPL_PORT = 0; mGps_conf.CAPABILITIES = 0x7; diff --git a/core/ContextBase.h b/core/ContextBase.h index 8fc2bd5f..ab61a084 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -72,6 +72,7 @@ typedef struct loc_gps_cfg_s uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET; uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING]; + uint32_t CP_MTLR_ES; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/etc/gps.conf b/etc/gps.conf index 2ec3f69a..35a0a7e6 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -288,3 +288,9 @@ MODEM_TYPE = 1 # This is a string that is sent to the framework # in nfwNotifyCb callback PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation + +##################################### +# CP_MTLR_ES +##################################### +# CP MTLR ES, 1=enable, 0=disable +CP_MTLR_ES=0 diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 31cd8869..a6d82bf4 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3409,16 +3409,20 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* mNotify(notify), mData(data) {} inline virtual void proc() const { - if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type || - GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) { + if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) { if (mAdapter.getE911State() || - ((GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES) && - (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type))) { + (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES)) { mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData); - } - else { + } else { mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData); } + } else if (GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) { + if (mAdapter.getE911State() && + (1 == ContextBase::mGps_conf.CP_MTLR_ES)) { + mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData); + } else { + mAdapter.requestNiNotify(mNotify, mData); + } } else { mAdapter.requestNiNotify(mNotify, mData); } From e8c1730e91fe1c743b6798cb78551bea67718617 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 16 Apr 2019 13:57:09 -0700 Subject: [PATCH 840/945] GPS exteneded: add dir name and file prefix for ext ap client Add directory to be reserved for hal daemon to keep track of location client sitting on external application processor Change-Id: I192fb011c786bab1752f0e604b86041a9f4cdc33 CRs-fixed: 2436612 --- utils/gps_extended_c.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index ba63c5c1..800af9b7 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2165,7 +2165,9 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" #define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" -#define SOCKET_TO_EXTERANL_AP_LOCATION_CLIENT_BASE "/dev/socket/loc_client/extap.toclient" + +#define DIR_FOR_EXT_AP_LOC_CLIENT "/data/vendor/location/extap_locclient/" +#define FILE_FOR_EXT_AP_LOC_CLIENT_BASE "/data/vendor/location/extap_locclient/client" typedef uint64_t NetworkHandle; #define NETWORK_HANDLE_UNKNOWN ~0 From ce5531372403e918b782d5b8d5d6c56de22bd69f Mon Sep 17 00:00:00 2001 From: Vamana Thuniki Date: Mon, 22 Apr 2019 22:45:43 +0530 Subject: [PATCH 841/945] Enablement of location modules for lito Change-Id: I24277533400f40d3a57b5176d53958dcd6b31a96 CRs-Fixed: 2443595 --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 83f3cdde..ad7f7e1d 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -43,6 +43,7 @@ GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) GNSS_HIDL_2_0_TARGET_LIST += kona GNSS_HIDL_2_0_TARGET_LIST += atoll +GNSS_HIDL_2_0_TARGET_LIST += lito ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 2.0 From b884edb7c8eac185fffc76bd5261d7b9dd06410d Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 2 May 2019 17:09:25 -0700 Subject: [PATCH 842/945] Set yearOfHw to 2019 if Location Privacy feature is supported Change-Id: If5ee31603491c83652082ce295abfcf9c9fec511 CRs-fixed: 2446241 --- android/2.0/location_api/GnssAPIClient.cpp | 4 +++- core/LocAdapterBase.cpp | 3 +++ location/LocationDataTypes.h | 2 ++ utils/gps_extended_c.h | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index 5610f067..68cf395d 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -368,7 +368,9 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) data |= IGnssCallback::Capabilities::SATELLITE_BLACKLIST; IGnssCallback::GnssSystemInfo gnssInfo; - if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || + if (capabilitiesMask & LOCATION_CAPABILITIES_PRIVACY_BIT) { + gnssInfo.yearOfHw = 2019; + } else if (capabilitiesMask & LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT || capabilitiesMask & LOCATION_CAPABILITIES_AGPM_BIT) { gnssInfo.yearOfHw = 2018; } else if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) { diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 6fad918b..5864fa83 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -298,6 +298,9 @@ LocAdapterBase::getCapabilities() if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) { mask |= LOCATION_CAPABILITIES_AGPM_BIT; } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_LOCATION_PRIVACY)) { + mask |= LOCATION_CAPABILITIES_PRIVACY_BIT; + } } else { LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__); } diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index f8bb6cba..09e243a4 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -218,6 +218,8 @@ typedef enum { LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT = (1<<10), // support agpm LOCATION_CAPABILITIES_AGPM_BIT = (1<<11), + // support location privacy + LOCATION_CAPABILITIES_PRIVACY_BIT = (1<<12), } LocationCapabilitiesBits; typedef enum { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 800af9b7..a3dcbd0f 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -126,7 +126,8 @@ typedef enum { LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02, /**< Support constellation enablement */ LOC_SUPPORTED_FEATURE_AGPM_V02, /**< Support AGPM feature */ LOC_SUPPORTED_FEATURE_XTRA_INTEGRITY, /**< Support XTRA integrity */ - LOC_SUPPORTED_FEATURE_FDCL_2 /**< Support FDCL V2 */ + LOC_SUPPORTED_FEATURE_FDCL_2, /**< Support FDCL V2 */ + LOC_SUPPORTED_FEATURE_LOCATION_PRIVACY /**< Support location privacy */ } loc_supported_feature_enum; typedef struct { From 2dab397e35c074a5ada5feba06ced80e574f8e2c Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 22 Apr 2019 12:00:53 -0700 Subject: [PATCH 843/945] Gnss adapter: retrieve pdop, hdop and vdop from extended struct For none-SPE engine, pdop, hdop and vdop are set in the extDop struct. Update code to retrieve it from there. Change-Id: I698e960cd90f3d72210cfd0a885080f1546c0c7d Crs-fixed: 2439750 --- gnss/GnssAdapter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 1c80443b..2958d9e7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -238,17 +238,19 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_ALTITUDE_MEAN_SEA_LEVEL_BIT; out.altitudeMeanSeaLevel = locationExtended.altitudeMeanSeaLevel; } - if (GPS_LOCATION_EXTENDED_HAS_DOP & locationExtended.flags) { + if (GPS_LOCATION_EXTENDED_HAS_EXT_DOP & locationExtended.flags) { + out.flags |= (GNSS_LOCATION_INFO_DOP_BIT|GNSS_LOCATION_INFO_EXT_DOP_BIT); + out.pdop = locationExtended.extDOP.PDOP; + out.hdop = locationExtended.extDOP.HDOP; + out.vdop = locationExtended.extDOP.VDOP; + out.gdop = locationExtended.extDOP.GDOP; + out.tdop = locationExtended.extDOP.TDOP; + } else if (GPS_LOCATION_EXTENDED_HAS_DOP & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_DOP_BIT; out.pdop = locationExtended.pdop; out.hdop = locationExtended.hdop; out.vdop = locationExtended.vdop; } - if (GPS_LOCATION_EXTENDED_HAS_EXT_DOP & locationExtended.flags) { - out.flags |= GNSS_LOCATION_INFO_EXT_DOP_BIT; - out.gdop = locationExtended.extDOP.GDOP; - out.tdop = locationExtended.extDOP.TDOP; - } if (GPS_LOCATION_EXTENDED_HAS_MAG_DEV & locationExtended.flags) { out.flags |= GNSS_LOCATION_INFO_MAGNETIC_DEVIATION_BIT; out.magneticDeviation = locationExtended.magneticDeviation; From 8f9d530d90c377eff7563cd58100166dd095de6b Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 6 May 2019 17:22:39 -0700 Subject: [PATCH 844/945] VINTF Manifest fragment for android.hardware.gnss To replace entry in device specific vendor manifest Change-Id: I330f4ef2658074218b5d2c105decaf6cfd959d3f CRs-fixed: 2444785 --- android/1.0/Android.mk | 1 + .../android.hardware.gnss@1.0-service-qti.xml | 35 ++++++++++++++++++ android/1.1/Android.mk | 1 + .../android.hardware.gnss@1.1-service-qti.xml | 35 ++++++++++++++++++ android/2.0/Android.mk | 1 + .../android.hardware.gnss@2.0-service-qti.xml | 36 +++++++++++++++++++ 6 files changed, 109 insertions(+) create mode 100644 android/1.0/android.hardware.gnss@1.0-service-qti.xml create mode 100644 android/1.1/android.hardware.gnss@1.1-service-qti.xml create mode 100644 android/2.0/android.hardware.gnss@2.0-service-qti.xml diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index 122ff8d1..5489f861 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -50,6 +50,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc diff --git a/android/1.0/android.hardware.gnss@1.0-service-qti.xml b/android/1.0/android.hardware.gnss@1.0-service-qti.xml new file mode 100644 index 00000000..46bcffb7 --- /dev/null +++ b/android/1.0/android.hardware.gnss@1.0-service-qti.xml @@ -0,0 +1,35 @@ + + + + android.hardware.gnss + hwbinder + @1.0::IGnss/default + + + diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index 5c97f400..0beaf208 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -51,6 +51,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-service-qti +LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc diff --git a/android/1.1/android.hardware.gnss@1.1-service-qti.xml b/android/1.1/android.hardware.gnss@1.1-service-qti.xml new file mode 100644 index 00000000..c9c83fbb --- /dev/null +++ b/android/1.1/android.hardware.gnss@1.1-service-qti.xml @@ -0,0 +1,35 @@ + + + + android.hardware.gnss + hwbinder + @1.1::IGnss/default + + + diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 2000bb8f..c33a7920 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -63,6 +63,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-service-qti +LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc diff --git a/android/2.0/android.hardware.gnss@2.0-service-qti.xml b/android/2.0/android.hardware.gnss@2.0-service-qti.xml new file mode 100644 index 00000000..ff9fb2c9 --- /dev/null +++ b/android/2.0/android.hardware.gnss@2.0-service-qti.xml @@ -0,0 +1,36 @@ + + + + android.hardware.gnss + hwbinder + @1.1::IGnss/default + @2.0::IGnss/default + + + From 2ba3f04c57196968d815eb6eb226531895a47190 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 24 Jan 2019 20:27:39 -0800 Subject: [PATCH 845/945] LocIpc redesign LocIpc now doesn't have any impelementation of sockets, but a framework that provides threading for any sockets that can be wrapped into LocIpcSender and LocIpcRever APIs. Also updated XtraSystemStatusObserver to using the new LocIpc and LocIpcLocalSender and LocIpcLocalRecver. Change-Id: I506c77198f9ce1e7d4dfd5e596dc0ac21d928e34 CRs-Fixed: 2443124 --- gnss/XtraSystemStatusObserver.cpp | 106 ++++--- gnss/XtraSystemStatusObserver.h | 29 +- utils/LocIpc.cpp | 496 ++++++++++++++++++++---------- utils/LocIpc.h | 186 ++++++----- utils/Makefile.am | 2 +- utils/gps_extended_c.h | 9 +- 6 files changed, 519 insertions(+), 309 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index b1c48d72..4cb6f5f8 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -49,6 +49,7 @@ #include #include +using namespace loc_util; using namespace loc_core; #ifdef LOG_TAG @@ -56,6 +57,61 @@ using namespace loc_core; #endif #define LOG_TAG "LocSvc_XSSO" +class XtraIpcListener : public ILocIpcListener { + IOsObserver* mSystemStatusObsrvr; + const MsgTask* mMsgTask; + XtraSystemStatusObserver& mXSSO; +public: + inline XtraIpcListener(IOsObserver* observer, const MsgTask* msgTask, + XtraSystemStatusObserver& xsso) : + mSystemStatusObsrvr(observer), mMsgTask(msgTask), mXSSO(xsso) {} + virtual void onReceive(const char* data, uint32_t length) override { +#define STRNCMP(str, constStr) strncmp(str, constStr, sizeof(constStr)-1) + if (!STRNCMP(data, "ping")) { + LOC_LOGd("ping received"); +#ifdef USE_GLIB + } else if (!STRNCMP(data, "connectBackhaul")) { + mSystemStatusObsrvr->connectBackhaul(); + } else if (!STRNCMP(data, "disconnectBackhaul")) { + mSystemStatusObsrvr->disconnectBackhaul(); +#endif + } else if (!STRNCMP(data, "requestStatus")) { + int32_t xtraStatusUpdated = 0; + sscanf(data, "%*s %d", &xtraStatusUpdated); + + struct HandleStatusRequestMsg : public LocMsg { + XtraSystemStatusObserver& mXSSO; + int32_t mXtraStatusUpdated; + inline HandleStatusRequestMsg(XtraSystemStatusObserver& xsso, + int32_t xtraStatusUpdated) : + mXSSO(xsso), mXtraStatusUpdated(xtraStatusUpdated) {} + inline void proc() const override { + mXSSO.onStatusRequested(mXtraStatusUpdated); + } + }; + mMsgTask->sendMsg(new HandleStatusRequestMsg(mXSSO, xtraStatusUpdated)); + } else { + LOC_LOGw("unknown event: %s", data); + } + } +}; + +XtraSystemStatusObserver::XtraSystemStatusObserver(IOsObserver* sysStatObs, + const MsgTask* msgTask) : + mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), + mGpsLock(-1), mConnections(~0), mXtraThrottle(true), + mReqStatusReceived(false), + mIsConnectivityStatusKnown(false), + mSender(LocIpc::getLocIpcLocalSender(LOC_IPC_XTRA)), + mDelayLocTimer(*mSender) { + subscribe(true); + auto recver = LocIpc::getLocIpcLocalRecver( + make_shared(sysStatObs, msgTask, *this), + LOC_IPC_HAL); + mIpc.startNonBlockingListening(recver); + mDelayLocTimer.start(100 /*.1 sec*/, false); +} + bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { // mask NI(NFW bit) since from XTRA's standpoint GPS is enabled if // MO(AFW bit) is enabled and disabled when MO is disabled @@ -68,7 +124,8 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { stringstream ss; ss << "gpslock"; ss << " " << lock; - return ( send(LOC_IPC_XTRA, ss.str()) ); + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections, @@ -85,8 +142,8 @@ bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections, stringstream ss; ss << "connection" << endl << mConnections << endl << wifiNetworkHandle << endl << mobileNetworkHandle; - - return ( send(LOC_IPC_XTRA, ss.str()) ); + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } bool XtraSystemStatusObserver::updateTac(const string& tac) { @@ -99,7 +156,8 @@ bool XtraSystemStatusObserver::updateTac(const string& tac) { stringstream ss; ss << "tac"; ss << " " << tac.c_str(); - return ( send(LOC_IPC_XTRA, ss.str()) ); + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { @@ -112,7 +170,8 @@ bool XtraSystemStatusObserver::updateMccMnc(const string& mccmnc) { stringstream ss; ss << "mncmcc"; ss << " " << mccmnc.c_str(); - return ( send(LOC_IPC_XTRA, ss.str()) ); + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } bool XtraSystemStatusObserver::updateXtraThrottle(const bool enabled) { @@ -125,7 +184,8 @@ bool XtraSystemStatusObserver::updateXtraThrottle(const bool enabled) { stringstream ss; ss << "xtrathrottle"; ss << " " << (enabled ? 1 : 0); - return ( send(LOC_IPC_XTRA, ss.str()) ); + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdated) { @@ -143,38 +203,8 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate << mWifiNetworkHandle << endl << mMobileNetworkHandle << endl << mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown; - return ( send(LOC_IPC_XTRA, ss.str()) ); -} - -void XtraSystemStatusObserver::onReceive(const std::string& data) { - if (!strncmp(data.c_str(), "ping", sizeof("ping") - 1)) { - LOC_LOGd("ping received"); - -#ifdef USE_GLIB - } else if (!strncmp(data.c_str(), "connectBackhaul", sizeof("connectBackhaul") - 1)) { - mSystemStatusObsrvr->connectBackhaul(); - - } else if (!strncmp(data.c_str(), "disconnectBackhaul", sizeof("disconnectBackhaul") - 1)) { - mSystemStatusObsrvr->disconnectBackhaul(); -#endif - - } else if (!strncmp(data.c_str(), "requestStatus", sizeof("requestStatus") - 1)) { - int32_t xtraStatusUpdated = 0; - sscanf(data.c_str(), "%*s %d", &xtraStatusUpdated); - - struct HandleStatusRequestMsg : public LocMsg { - XtraSystemStatusObserver& mXSSO; - int32_t mXtraStatusUpdated; - inline HandleStatusRequestMsg(XtraSystemStatusObserver& xsso, - int32_t xtraStatusUpdated) : - mXSSO(xsso), mXtraStatusUpdated(xtraStatusUpdated) {} - inline void proc() const override { mXSSO.onStatusRequested(mXtraStatusUpdated); } - }; - mMsgTask->sendMsg(new (nothrow) HandleStatusRequestMsg(*this, xtraStatusUpdated)); - - } else { - LOC_LOGw("unknown event: %s", data.c_str()); - } + string s = ss.str(); + return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } void XtraSystemStatusObserver::subscribe(bool yes) diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index b93ecf21..14f9393d 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -35,25 +35,18 @@ #include using namespace std; +using namespace loc_util; using loc_core::IOsObserver; using loc_core::IDataItemObserver; using loc_core::IDataItemCore; -using loc_util::LocIpc; -class XtraSystemStatusObserver : public IDataItemObserver, public LocIpc{ +class XtraSystemStatusObserver : public IDataItemObserver { public : // constructor & destructor - inline XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask): - mSystemStatusObsrvr(sysStatObs), mMsgTask(msgTask), - mGpsLock(-1), mConnections(~0), mXtraThrottle(true), mReqStatusReceived(false), - mIsConnectivityStatusKnown (false), mDelayLocTimer(*this) { - subscribe(true); - startListeningNonBlocking(LOC_IPC_HAL); - mDelayLocTimer.start(100 /*.1 sec*/, false); - } + XtraSystemStatusObserver(IOsObserver* sysStatObs, const MsgTask* msgTask); inline virtual ~XtraSystemStatusObserver() { subscribe(false); - stopListening(); + mIpc.stopNonBlockingListening(); } // IDataItemObserver overrides @@ -68,14 +61,13 @@ public : bool updateXtraThrottle(const bool enabled); inline const MsgTask* getMsgTask() { return mMsgTask; } void subscribe(bool yes); - -protected: - void onReceive(const std::string& data) override; + bool onStatusRequested(int32_t xtraStatusUpdated); private: IOsObserver* mSystemStatusObsrvr; const MsgTask* mMsgTask; GnssConfigGpsLock mGpsLock; + LocIpc mIpc; uint64_t mConnections; uint64_t mWifiNetworkHandle; uint64_t mMobileNetworkHandle; @@ -84,17 +76,16 @@ private: bool mXtraThrottle; bool mReqStatusReceived; bool mIsConnectivityStatusKnown; + shared_ptr mSender; class DelayLocTimer : public LocTimer { - XtraSystemStatusObserver& mXSSO; + LocIpcSender& mSender; public: - DelayLocTimer(XtraSystemStatusObserver& xsso) : mXSSO(xsso) {} + DelayLocTimer(LocIpcSender& sender) : mSender(sender) {} void timeOutCallback() override { - mXSSO.send(LOC_IPC_XTRA, "halinit"); + LocIpc::send(mSender, (const uint8_t*)"halinit", sizeof("halinit")); } } mDelayLocTimer; - - bool onStatusRequested(int32_t xtraStatusUpdated); }; #endif diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 4178d52a..ecaff01c 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -30,10 +30,14 @@ #include #include #include +#include +#include +#include #include -#include "LocIpc.h" +#include +#include -using std::string; +using namespace std; namespace loc_util { @@ -42,188 +46,346 @@ namespace loc_util { #endif #define LOG_TAG "LocSvc_LocIpc" -#define LOC_MSG_BUF_LEN 8192 -#define LOC_MSG_HEAD "$MSGLEN$" -#define LOC_MSG_ABORT "LocIpcMsg::ABORT" - -class LocIpcRunnable : public LocRunnable { -friend LocIpc; -public: - LocIpcRunnable(LocIpc& locIpc, const string& ipcName) - : mLocIpc(locIpc), mIpcName(ipcName) {} - bool run() override { - if (!mLocIpc.startListeningBlocking(mIpcName)) { - LOC_LOGe("listen to socket failed"); - } - - return false; +#define SOCK_OP_AND_LOG(buf, length, opable, rtv, exe) \ + if (nullptr == (buf) || 0 == (length)) { \ + LOC_LOGe("Invalid inputs: buf - %p, length - %d", (buf), (length)); \ + } else if (!(opable)) { \ + LOC_LOGe("Invalid object: operable - %d", (opable)); \ + } else { \ + rtv = (exe); \ + if (-1 == rtv) { \ + LOC_LOGw("failed reason: %s", strerror(errno)); \ + } \ + } + +const char Sock::MSG_ABORT[] = "LocIpc::Sock::ABORT"; +const char Sock::LOC_IPC_HEAD[] = "$MSGLEN$"; +ssize_t Sock::send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, + socklen_t addrlen) const { + ssize_t rtv = -1; + SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen)); + return rtv; +} +ssize_t Sock::recv(const shared_ptr& dataCb, int flags, struct sockaddr *srcAddr, + socklen_t *addrlen, int sid) const { + ssize_t rtv = -1; + if (-1 == sid) { + sid = mSid; + } // else it sid would be connection based socket id for recv + SOCK_OP_AND_LOG(dataCb.get(), mMaxTxSize, isValid(), rtv, + recvfrom(dataCb, sid, flags, srcAddr, addrlen)); + return rtv; +} +ssize_t Sock::sendto(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, + socklen_t addrlen) const { + ssize_t rtv = -1; + if (len <= mMaxTxSize) { + rtv = ::sendto(mSid, buf, len, flags, destAddr, addrlen); + } else { + std::string head(LOC_IPC_HEAD + to_string(len)); + rtv = ::sendto(mSid, head.c_str(), head.length(), flags, destAddr, addrlen); + if (rtv > 0) { + for (size_t offset = 0; offset < len && rtv > 0; offset += rtv) { + rtv = ::sendto(mSid, (char*)buf + offset, min(len - offset, (size_t)mMaxTxSize), + flags, destAddr, addrlen); + } + rtv = (rtv > 0) ? (head.length() + len) : -1; + } + } + return rtv; +} +ssize_t Sock::recvfrom(const shared_ptr& dataCb, int sid, int flags, + struct sockaddr *srcAddr, socklen_t *addrlen) const { + ssize_t nBytes = -1; + std::string msg(mMaxTxSize, 0); + + if ((nBytes = ::recvfrom(sid, (void*)msg.data(), msg.size(), flags, srcAddr, addrlen)) > 0) { + if (strncmp(msg.data(), MSG_ABORT, sizeof(MSG_ABORT)) == 0) { + LOC_LOGi("recvd abort msg.data %s", msg.data()); + nBytes = 0; + } else if (strncmp(msg.data(), LOC_IPC_HEAD, sizeof(LOC_IPC_HEAD) - 1)) { + // short message + msg.resize(nBytes); + dataCb->onReceive(msg.data(), nBytes); + } else { + // long message + size_t msgLen = 0; + sscanf(msg.data() + sizeof(LOC_IPC_HEAD) - 1, "%zu", &msgLen); + msg.resize(msgLen); + for (size_t msgLenReceived = 0; (msgLenReceived < msgLen) && (nBytes > 0); + msgLenReceived += nBytes) { + nBytes = ::recvfrom(sid, &(msg[msgLenReceived]), msg.size() - msgLenReceived, + flags, srcAddr, addrlen); + } + if (nBytes > 0) { + nBytes = msgLen; + dataCb->onReceive(msg.data(), nBytes); + } + } + } + + return nBytes; +} +ssize_t Sock::sendAbort(int flags, const struct sockaddr *destAddr, socklen_t addrlen) { + return send(MSG_ABORT, sizeof(MSG_ABORT), flags, destAddr, addrlen); +} + +class LocIpcLocalSender : public LocIpcSender { +protected: + shared_ptr mSock; + struct sockaddr_un mAddr; + inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } + inline virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t /* msgId */) const { + return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } +public: + inline LocIpcLocalSender(const char* name) : LocIpcSender(), + mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_UNIX, SOCK_DGRAM, 0)))), + mAddr({.sun_family = AF_UNIX, {}}) { + if (mSock != nullptr && mSock->isValid()) { + snprintf(mAddr.sun_path, sizeof(mAddr.sun_path), "%s", name); + } } -private: - LocIpc& mLocIpc; - const string mIpcName; }; -bool LocIpc::startListeningNonBlocking(const string& name) { - auto runnable = new LocIpcRunnable(*this, name); - string threadName("LocIpc-"); - threadName.append(name); - return mThread.start(threadName.c_str(), runnable); -} +class LocIpcLocalRecver : public LocIpcLocalSender, public LocIpcRecver { +protected: + inline virtual ssize_t recv() const override { + socklen_t size = sizeof(mAddr); + return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); + } +public: + inline LocIpcLocalRecver(const shared_ptr& listener, const char* name) : + LocIpcLocalSender(name), LocIpcRecver(listener, *this) { -bool LocIpc::startListeningBlocking(const string& name) { - bool stopRequested = false; - int fd = socket(AF_UNIX, SOCK_DGRAM, 0); + if ((unlink(mAddr.sun_path) < 0) && (errno != ENOENT)) { + LOC_LOGw("unlink socket error. reason:%s", strerror(errno)); + } - if (fd < 0) { - LOC_LOGe("create socket error. reason:%s", strerror(errno)); + umask(0157); + if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { + LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); + mSock->close(); + } + } + inline virtual ~LocIpcLocalRecver() { unlink(mAddr.sun_path); } + inline virtual const char* getName() const override { return mAddr.sun_path; }; + inline virtual void abort() const override { + if (isSendable()) { + mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } + } +}; + +class LocIpcInetTcpSender : public LocIpcSender { +protected: + shared_ptr mSock; + const string mName; + sockaddr_in mAddr; + mutable bool mFirstTime; + inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } + inline virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t /* msgId */) const { + if (mFirstTime) { + mFirstTime = false; + ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); + } + return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } +public: + inline LocIpcInetTcpSender(const char* name, int32_t port) : LocIpcSender(), + mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_INET, SOCK_STREAM, 0)))), + mName((nullptr == name) ? "" : name), + mAddr({.sin_family=AF_INET, .sin_port=htons(port), .sin_addr={htonl(INADDR_ANY)}}), + mFirstTime(true) { + if (mSock != nullptr && mSock->isValid() && nullptr != name) { + struct hostent* hp = gethostbyname(name); + if (nullptr != hp) { + memcpy((char*)&(mAddr.sin_addr.s_addr), hp->h_addr_list[0], hp->h_length); + } + } + } +}; + +class LocIpcInetTcpRecver : public LocIpcInetTcpSender, public LocIpcRecver { + mutable int32_t mConnFd; +protected: + inline virtual ssize_t recv() const override { + socklen_t size = sizeof(mAddr); + if (-1 == mConnFd && mSock->isValid()) { + if (::listen(mSock->mSid, 3) < 0 || + (mConnFd = accept(mSock->mSid, (struct sockaddr*)&mAddr, &size)) < 0) { + mSock->close(); + mConnFd = -1; + } + } + return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); + } +public: + inline LocIpcInetTcpRecver(const shared_ptr& listener, const char* name, + int32_t port) : + LocIpcInetTcpSender(name, port), LocIpcRecver(listener, *this), mConnFd(-1) { + if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { + LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); + mSock->close(); + } + } + inline virtual ~LocIpcInetTcpRecver() { if (-1 != mConnFd) ::close(mConnFd); } + inline virtual const char* getName() const override { return mName.data(); }; + inline virtual void abort() const override { + if (isSendable()) { + mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } + } +}; + +#ifdef NOT_DEFINED +class LocIpcQcsiSender : public LocIpcSender { +protected: + inline virtual bool isOperable() const override { + return mService != nullptr && mService->isServiceRegistered(); + } + inline virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t msgId) const override { + return mService->sendIndToClient(msgId, data, length); + } + inline LocIpcQcsiSender(shared_ptr& service) : mService(service) {} +public: + inline virtual ~LocIpcQcsi() {} +}; + +class LocIpcQcsiRecver : public LocIpcQcsiSender, public LocIpcRecver { +protected: + inline virtual ssize_t recv() const override { return mService->recv(); } +public: + inline LocIpcQcsiRecver(unique_ptr& service) : + LocIpcQcsiSender(service), LocIpcRecver(mService->getDataCallback(), *this) { + } + // only the dele + inline ~LocIpcQcsiRecver() {} + inline virtual const char* getName() const override { return mService->getName().data(); }; + inline virtual void abort() const override { if (isSendable()) mService->abort(); } + shared_ptr getSender() { return make_pare(mService); } +}; +#endif + +class LocIpcRunnable : public LocRunnable { + bool mAbortCalled; + LocIpc& mLocIpc; + unique_ptr mIpcRecver; +public: + inline LocIpcRunnable(LocIpc& locIpc, unique_ptr& ipcRecver) : + mAbortCalled(false), + mLocIpc(locIpc), + mIpcRecver(move(ipcRecver)) {} + inline bool run() override { + if (mIpcRecver != nullptr) { + mLocIpc.startBlockingListening(*(mIpcRecver.get())); + if (!mAbortCalled) { + LOC_LOGw("startListeningBlocking() returned w/o stopBlockingListening() called"); + } + } + // return false so the calling thread exits while loop return false; } - - if ((unlink(name.c_str()) < 0) && (errno != ENOENT)) { - LOC_LOGw("unlink socket error. reason:%s", strerror(errno)); + inline void abort() { + mAbortCalled = true; + if (mIpcRecver != nullptr) { + mIpcRecver->abort(); + } } +}; - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", name.c_str()); - - umask(0157); - - if (::bind(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("bind socket error. reason:%s", strerror(errno)); +bool LocIpc::startNonBlockingListening(unique_ptr& ipcRecver) { + if (ipcRecver != nullptr && ipcRecver->isRecvable()) { + std::string threadName("LocIpc-"); + threadName.append(ipcRecver->getName()); + mRunnable = new LocIpcRunnable(*this, ipcRecver); + return mThread.start(threadName.c_str(), mRunnable); } else { - mIpcFd = fd; - mIpcName = name; + LOC_LOGe("ipcRecver is null OR ipcRecver->recvable() is fasle"); + return false; + } +} +bool LocIpc::startBlockingListening(LocIpcRecver& ipcRecver) { + if (ipcRecver.isRecvable()) { // inform that the socket is ready to receive message - onListenerReady(); - - ssize_t nBytes = 0; - string msg = ""; - string abort = LOC_MSG_ABORT; - while (1) { - msg.resize(LOC_MSG_BUF_LEN); - nBytes = ::recvfrom(fd, (void*)(msg.data()), msg.size(), 0, NULL, NULL); - if (nBytes < 0) { - LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); - break; - } else if (0 == nBytes) { - continue; - } - - if (strncmp(msg.data(), abort.c_str(), abort.length()) == 0) { - LOC_LOGi("recvd abort msg.data %s", msg.data()); - stopRequested = true; - break; - } - - if (strncmp(msg.data(), LOC_MSG_HEAD, sizeof(LOC_MSG_HEAD) - 1)) { - // short message - msg.resize(nBytes); - onReceive(msg); - } else { - // long message - size_t msgLen = 0; - sscanf(msg.data(), LOC_MSG_HEAD"%zu", &msgLen); - msg.resize(msgLen); - size_t msgLenReceived = 0; - while ((msgLenReceived < msgLen) && (nBytes > 0)) { - nBytes = recvfrom(fd, (void*)&(msg[msgLenReceived]), - msg.size() - msgLenReceived, 0, NULL, NULL); - msgLenReceived += nBytes; - } - if (nBytes > 0) { - onReceive(msg); - } else { - LOC_LOGe("cannot read socket. reason:%s", strerror(errno)); - break; - } - } - } - } - - if (::close(fd)) { - LOC_LOGe("cannot close socket:%s", strerror(errno)); - } - unlink(name.c_str()); - - return stopRequested; -} - -void LocIpc::stopListening() { - if (mIpcFd >= 0) { - string abort = LOC_MSG_ABORT; - if (!mIpcName.empty()) { - send(mIpcName.c_str(), abort); - } - mIpcFd = -1; - } - if (!mIpcName.empty()) { - mIpcName.clear(); - } -} - -bool LocIpc::send(const char name[], const string& data) { - return send(name, (const uint8_t*)data.c_str(), data.length()); -} - -bool LocIpc::send(const char name[], const uint8_t data[], uint32_t length) { - - bool result = true; - int fd = ::socket(AF_UNIX, SOCK_DGRAM, 0); - if (fd < 0) { - LOC_LOGe("create socket error. reason:%s", strerror(errno)); + ipcRecver.onListenerReady(); + while (ipcRecver.recvData()); + return true; + } else { + LOC_LOGe("ipcRecver is null OR ipcRecver->recvable() is fasle"); return false; } - - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", name); - - result = sendData(fd, addr, data, length); - - (void)::close(fd); - return result; } - -bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uint32_t length) { - - bool result = true; - - if (length <= LOC_MSG_BUF_LEN) { - if (::sendto(fd, data, length, 0, - (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot send to socket:%s. reason:%s", - addr.sun_path, strerror(errno)); - result = false; - } - } else { - string head = LOC_MSG_HEAD; - head.append(std::to_string(length)); - if (::sendto(fd, head.c_str(), head.length(), 0, - (struct sockaddr*)&addr, sizeof(addr)) < 0) { - LOC_LOGe("cannot send to socket:%s. reason:%s", - addr.sun_path, strerror(errno)); - result = false; - } else { - size_t sentBytes = 0; - while(sentBytes < length) { - size_t partLen = length - sentBytes; - if (partLen > LOC_MSG_BUF_LEN) { - partLen = LOC_MSG_BUF_LEN; - } - ssize_t rv = ::sendto(fd, data + sentBytes, partLen, 0, - (struct sockaddr*)&addr, sizeof(addr)); - if (rv < 0) { - LOC_LOGe("cannot send to socket:%s. reason:%s", - addr.sun_path, strerror(errno)); - result = false; - break; - } - sentBytes += rv; - } - } +void LocIpc::stopNonBlockingListening() { + if (mRunnable) { + mRunnable->abort(); + mRunnable = nullptr; } - return result; +} + +void LocIpc::stopBlockingListening(LocIpcRecver& ipcRecver) { + if (ipcRecver.isRecvable()) { + ipcRecver.abort(); + } +} + +bool LocIpc::send(LocIpcSender& sender, const uint8_t data[], uint32_t length, int32_t msgId) { + return sender.sendData(data, length, msgId); +} + +shared_ptr LocIpc::getLocIpcLocalSender(const char* localSockName) { + return make_shared(localSockName); +} +unique_ptr LocIpc::getLocIpcLocalRecver(const shared_ptr& listener, + const char* localSockName) { + return make_unique(listener, localSockName); +} +static void* sLibQrtrHandle = nullptr; +static const char* sLibQrtrName = "libloc_socket.so"; +shared_ptr LocIpc::getLocIpcQrtrSender(int service, int instance) { + typedef shared_ptr (*creator_t) (int, int); + static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, + "_ZN8loc_util22createLocIpcQrtrSenderEii"); + return (nullptr == creator) ? nullptr : creator(service, instance); +} +unique_ptr LocIpc::getLocIpcQrtrRecver(const shared_ptr& listener, + int service, int instance) { + typedef unique_ptr (*creator_t)(const shared_ptr&, int, int); + static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, + "_ZN8loc_util22createLocIpcQrtrRecverERKNSt3__110shared_ptrINS_15ILocIpcListenerEEEii"); + return (nullptr == creator) ? nullptr : creator(listener, service, instance); +} +shared_ptr LocIpc::getLocIpcQsockSender(int service, int instance) { + typedef shared_ptr (*creator_t) (int, int); + static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, + "_ZN8loc_util23createLocIpcQsockSenderEii"); + return (nullptr == creator) ? nullptr : creator(service, instance); +} +unique_ptr LocIpc::getLocIpcQsockRecver(const shared_ptr& listener, + int service, int instance) { + typedef unique_ptr (*creator_t)(const shared_ptr&, int, int); + static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, + "_ZN8loc_util23createLocIpcQsockRecverERKSt10shared_ptrINS_15ILocIpcListenerEEii"); + return (nullptr == creator) ? nullptr : creator(listener, service, instance); +} +shared_ptr LocIpc::getLocIpcInetTcpSender(const char* serverName, int32_t port) { + return make_shared(serverName, port); +} +unique_ptr LocIpc::getLocIpcInetTcpRecver(const shared_ptr& listener, + const char* serverName, int32_t port) { + return make_unique(listener, serverName, port); +} +pair, unique_ptr> + LocIpc::getLocIpcQmiLocServiceSenderRecverPair(const shared_ptr& listener, int instance) { + typedef pair, unique_ptr> (*creator_t)(const shared_ptr&, int); + static void* sLibEmuHandle = nullptr; + static creator_t creator = (creator_t)dlGetSymFromLib(sLibEmuHandle, "libloc_emu.so", + "_ZN13QmiLocService41createLocIpcQmiLocServiceSenderRecverPairERKNSt3__110shared_ptrIN8loc_util15ILocIpcListenerEEEi"); + return (nullptr == creator) ? + make_pair, unique_ptr>(nullptr, nullptr) : + creator(listener, instance); } } diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 707df215..20a1c8f4 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -37,35 +37,71 @@ #include #include -using std::string; +using namespace std; namespace loc_util { + +class LocIpcRecver; class LocIpcSender; +class LocIpcRunnable; + +class ILocIpcListener { +protected: + inline virtual ~ILocIpcListener() {} +public: + // LocIpc client can overwrite this function to get notification + // when the socket for LocIpc is ready to receive messages. + inline virtual void onListenerReady() {} + virtual void onReceive(const char* data, uint32_t length)= 0; +}; + class LocIpc { -friend LocIpcSender; public: - inline LocIpc() : mIpcFd(-1) {} - inline virtual ~LocIpc() { stopListening(); } + inline LocIpc() : mRunnable(nullptr) {} + inline virtual ~LocIpc() { + stopNonBlockingListening(); + } + + static shared_ptr + getLocIpcLocalSender(const char* localSockName); + static shared_ptr + getLocIpcInetTcpSender(const char* serverName, int32_t port); + static shared_ptr + getLocIpcQrtrSender(int service, int instance); + static shared_ptr + getLocIpcQsockSender(int service, int instance); + + static unique_ptr + getLocIpcLocalRecver(const shared_ptr& listener, + const char* localSockName); + static unique_ptr + getLocIpcInetTcpRecver(const shared_ptr& listener, + const char* serverName, int32_t port); + static unique_ptr + getLocIpcQrtrRecver(const shared_ptr& listener, + int service, int instance); + static unique_ptr + getLocIpcQsockRecver(const shared_ptr& listener, + int service, int instance); + + static pair, unique_ptr> + getLocIpcQmiLocServiceSenderRecverPair(const shared_ptr& listener, + int instance); // Listen for new messages in current thread. Calling this funciton will - // block current thread. The listening can be stopped by calling stopListening(). - // - // Argument name is the path of the unix local socket to be listened. - // The function will return true on success, and false on failure. - bool startListeningBlocking(const std::string& name); + // block current thread. + // The listening can be stopped by calling stopBlockingListening() passing + // in the same ipcRecver obj handle. + static bool startBlockingListening(LocIpcRecver& ipcRecver); + static void stopBlockingListening(LocIpcRecver& ipcRecver); // Create a new LocThread and listen for new messages in it. // Calling this function will return immediately and won't block current thread. - // The listening can be stopped by calling stopListening(). - // - // Argument name is the path of the unix local socket to be be listened. - // The function will return true on success, and false on failure. - bool startListeningNonBlocking(const std::string& name); - - // Stop listening to new messages. - void stopListening(); + // The listening can be stopped by calling stopNonBlockingListening(). + bool startNonBlockingListening(unique_ptr& ipcRecver); + void stopNonBlockingListening(); // Send out a message. // Call this function to send a message in argument data to socket in argument name. @@ -73,78 +109,70 @@ public: // Argument name contains the name of the target unix socket. data contains the // message to be sent out. Convert your message to a string before calling this function. // The function will return true on success, and false on failure. - static bool send(const char name[], const std::string& data); - static bool send(const char name[], const uint8_t data[], uint32_t length); - -protected: - // Callback function for receiving incoming messages. - // Override this function in your derived class to process incoming messages. - // For each received message, this callback function will be called once. - // This callback function will be called in the calling thread of startListeningBlocking - // or in the new LocThread created by startListeningNonBlocking. - // - // Argument data contains the received message. You need to parse it. - inline virtual void onReceive(const std::string& /*data*/) {} - - // LocIpc client can overwrite this function to get notification - // when the socket for LocIpc is ready to receive messages. - inline virtual void onListenerReady() {} + static bool send(LocIpcSender& sender, const uint8_t data[], + uint32_t length, int32_t msgId = -1); private: - static bool sendData(int fd, const sockaddr_un& addr, - const uint8_t data[], uint32_t length); - - int mIpcFd; LocThread mThread; - string mIpcName; + LocIpcRunnable *mRunnable; }; +/* this is only when client needs to implement Sender / Recver that are not already provided by + the factor methods prvoided by LocIpc. */ + class LocIpcSender { +protected: + LocIpcSender() = default; + virtual ~LocIpcSender() = default; + virtual bool isOperable() const = 0; + virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t msgId) const = 0; public: - // Constructor of LocIpcSender class - // - // Argument destSocket contains the full path name of destination socket. - // This class hides generated fd and destination address object from user. - inline LocIpcSender(const char* destSocket): - LocIpcSender(std::make_shared(::socket(AF_UNIX, SOCK_DGRAM, 0)), destSocket) { - if (mSocket != nullptr && -1 == *mSocket) { - mSocket = nullptr; - } + inline bool isSendable() const { return isOperable(); } + inline bool sendData(const uint8_t data[], uint32_t length, int32_t msgId) const { + return isSendable() && (send(data, length, msgId) > 0); } +}; - // Replicate a new LocIpcSender object with new destination socket. - inline LocIpcSender* replicate(const char* destSocket) { - return (nullptr == mSocket) ? nullptr : new LocIpcSender(mSocket, destSocket); - } +class LocIpcRecver { + LocIpcSender& mIpcSender; +protected: + const shared_ptr mDataCb; + inline LocIpcRecver(const shared_ptr& listener, LocIpcSender& sender) : + mIpcSender(sender), mDataCb(listener) {} + LocIpcRecver(LocIpcRecver const& recver) = delete; + LocIpcRecver& operator=(LocIpcRecver const& recver) = delete; + virtual ssize_t recv() const = 0; +public: + virtual ~LocIpcRecver() = default; + inline bool recvData() const { return isRecvable() && (recv() > 0); } + inline bool isRecvable() const { return mDataCb != nullptr && mIpcSender.isSendable(); } + virtual void onListenerReady() { if (mDataCb != nullptr) mDataCb->onListenerReady(); } + virtual void abort() const = 0; + virtual const char* getName() const = 0; +}; - inline ~LocIpcSender() { - if (nullptr != mSocket && mSocket.unique()) { - ::close(*mSocket); - } - } - - // Send out a message. - // Call this function to send a message - // - // Argument data and length contains the message to be sent out. - // Return true when succeeded - inline bool send(const uint8_t data[], uint32_t length) { - bool rtv = false; - if (nullptr != mSocket && nullptr != data) { - rtv = LocIpc::sendData(*mSocket, mDestAddr, data, length); - } - return rtv; - } - -private: - std::shared_ptr mSocket; - struct sockaddr_un mDestAddr; - - inline LocIpcSender(const std::shared_ptr& mySocket, const char* destSocket) : - mSocket(mySocket), - mDestAddr({.sun_family = AF_UNIX, {}}) { - if ((nullptr != mSocket) && (-1 != *mSocket) && (nullptr != destSocket)) { - snprintf(mDestAddr.sun_path, sizeof(mDestAddr.sun_path), "%s", destSocket); +class Sock { + static const char MSG_ABORT[]; + static const char LOC_IPC_HEAD[]; + const uint32_t mMaxTxSize; + ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, + socklen_t addrlen) const; + ssize_t recvfrom(const shared_ptr& dataCb, int sid, int flags, + struct sockaddr *srcAddr, socklen_t *addrlen) const; +public: + int mSid; + inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {} + inline ~Sock() { close(); } + inline bool isValid() const { return -1 != mSid; } + ssize_t send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, + socklen_t addrlen) const; + ssize_t recv(const shared_ptr& dataCb, int flags, struct sockaddr *srcAddr, + socklen_t *addrlen, int sid = -1) const; + ssize_t sendAbort(int flags, const struct sockaddr *destAddr, socklen_t addrlen); + inline void close() { + if (isValid()) { + ::close(mSid); + mSid = -1; } } }; diff --git a/utils/Makefile.am b/utils/Makefile.am index 50e1e9a1..807916da 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -8,7 +8,7 @@ AM_CFLAGS = -Wundef \ -fno-short-enums \ -fpic \ -I./ \ - -std=c++11 \ + -std=c++14 \ $(LOCPLA_CFLAGS) libgps_utils_la_h_sources = \ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 800af9b7..65218ab8 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2163,11 +2163,10 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_DIR_EHUB "/dev/socket/location/ehub/" #define SOCKET_TO_LOCATION_HAL_DAEMON "/dev/socket/loc_client/hal_daemon" -#define SOCKET_DIR_TO_CLIENT "/dev/socket/loc_client/" -#define SOCKET_TO_LOCATION_CLIENT_BASE "/dev/socket/loc_client/toclient" - -#define DIR_FOR_EXT_AP_LOC_CLIENT "/data/vendor/location/extap_locclient/" -#define FILE_FOR_EXT_AP_LOC_CLIENT_BASE "/data/vendor/location/extap_locclient/client" +#define SOCKET_LOC_CLIENT_DIR "/dev/socket/loc_client/" +#define EAP_LOC_CLIENT_DIR "/data/vendor/location/extap_locclient/" + +#define LOC_CLIENT_NAME_PREFIX "toclient" typedef uint64_t NetworkHandle; #define NETWORK_HANDLE_UNKNOWN ~0 From 331c6d98932dc4b339b92bee65679dd5315c6ec0 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 24 Apr 2019 22:34:24 +0530 Subject: [PATCH 846/945] Adding NAVIC support NAVIC constellation support added. Change-Id: I30a61f53089177d4e02b617dc9b785c13e2ef6ee CRs-Fixed: 2399619 --- android/2.0/location_api/LocationUtil.cpp | 3 + core/SystemStatus.cpp | 27 ++++++++- core/SystemStatus.h | 42 +++++++++----- gnss/GnssAdapter.cpp | 19 +++++++ location/LocationDataTypes.h | 42 +++++++++----- utils/gps_extended_c.h | 67 +++++++++++++++-------- utils/loc_nmea.cpp | 34 +++++++++++- 7 files changed, 177 insertions(+), 57 deletions(-) diff --git a/android/2.0/location_api/LocationUtil.cpp b/android/2.0/location_api/LocationUtil.cpp index 6bd50849..38a083af 100644 --- a/android/2.0/location_api/LocationUtil.cpp +++ b/android/2.0/location_api/LocationUtil.cpp @@ -209,6 +209,9 @@ void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& o case GNSS_SV_TYPE_GALILEO: out = V2_0::GnssConstellationType::GALILEO; break; + case GNSS_SV_TYPE_NAVIC: + out = V2_0::GnssConstellationType::IRNSS; + break; case GNSS_SV_TYPE_UNKNOWN: default: out = V2_0::GnssConstellationType::UNKNOWN; diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 524963bd..18cb99c6 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -382,16 +382,19 @@ public: uint32_t mBdsXtraAge; uint32_t mGalXtraAge; uint32_t mQzssXtraAge; + uint32_t mNavicXtraAge; uint32_t mGpsXtraValid; uint32_t mGloXtraValid; uint64_t mBdsXtraValid; uint64_t mGalXtraValid; uint8_t mQzssXtraValid; + uint32_t mNavicXtraValid; }; class SystemStatusPQWP3parser : public SystemStatusNmeaBase { private: + // todo: update for navic once available enum { eTalker = 0, @@ -418,11 +421,13 @@ public: inline uint32_t getBdsXtraAge() { return mP3.mBdsXtraAge; } inline uint32_t getGalXtraAge() { return mP3.mGalXtraAge; } inline uint32_t getQzssXtraAge() { return mP3.mQzssXtraAge; } + inline uint32_t getNavicXtraAge() { return mP3.mNavicXtraAge; } inline uint32_t getGpsXtraValid() { return mP3.mGpsXtraValid; } inline uint32_t getGloXtraValid() { return mP3.mGloXtraValid; } inline uint64_t getBdsXtraValid() { return mP3.mBdsXtraValid; } inline uint64_t getGalXtraValid() { return mP3.mGalXtraValid; } inline uint8_t getQzssXtraValid() { return mP3.mQzssXtraValid; } + inline uint32_t getNavicXtraValid() { return mP3.mNavicXtraValid; } SystemStatusPQWP3parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) @@ -431,6 +436,7 @@ public: return; } memset(&mP3, 0, sizeof(mP3)); + // todo: update for navic once available mP3.mXtraValidMask = strtol(mField[eXtraValidMask].c_str(), NULL, 16); mP3.mGpsXtraAge = atoi(mField[eGpsXtraAge].c_str()); mP3.mGloXtraAge = atoi(mField[eGloXtraAge].c_str()); @@ -511,21 +517,25 @@ public: uint64_t mBdsUnknownMask; uint64_t mGalUnknownMask; uint8_t mQzssUnknownMask; + uint32_t mNavicUnknownMask; uint32_t mGpsGoodMask; uint32_t mGloGoodMask; uint64_t mBdsGoodMask; uint64_t mGalGoodMask; uint8_t mQzssGoodMask; + uint32_t mNavicGoodMask; uint32_t mGpsBadMask; uint32_t mGloBadMask; uint64_t mBdsBadMask; uint64_t mGalBadMask; uint8_t mQzssBadMask; + uint32_t mNavicBadMask; }; class SystemStatusPQWP5parser : public SystemStatusNmeaBase { private: + // todo: update for navic once available enum { eTalker = 0, @@ -555,16 +565,19 @@ public: inline uint64_t getBdsUnknownMask() { return mP5.mBdsUnknownMask; } inline uint64_t getGalUnknownMask() { return mP5.mGalUnknownMask; } inline uint8_t getQzssUnknownMask() { return mP5.mQzssUnknownMask; } + inline uint32_t getNavicUnknownMask() { return mP5.mNavicUnknownMask; } inline uint32_t getGpsGoodMask() { return mP5.mGpsGoodMask; } inline uint32_t getGloGoodMask() { return mP5.mGloGoodMask; } inline uint64_t getBdsGoodMask() { return mP5.mBdsGoodMask; } inline uint64_t getGalGoodMask() { return mP5.mGalGoodMask; } inline uint8_t getQzssGoodMask() { return mP5.mQzssGoodMask; } + inline uint32_t getNavicGoodMask() { return mP5.mNavicGoodMask; } inline uint32_t getGpsBadMask() { return mP5.mGpsBadMask; } inline uint32_t getGloBadMask() { return mP5.mGloBadMask; } inline uint64_t getBdsBadMask() { return mP5.mBdsBadMask; } inline uint64_t getGalBadMask() { return mP5.mGalBadMask; } inline uint8_t getQzssBadMask() { return mP5.mQzssBadMask; } + inline uint32_t getNavicBadMask() { return mP5.mNavicBadMask; } SystemStatusPQWP5parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) @@ -573,6 +586,7 @@ public: return; } memset(&mP5, 0, sizeof(mP5)); + // todo: update for navic once available mP5.mGpsUnknownMask = strtol(mField[eGpsUnknownMask].c_str(), NULL, 16); mP5.mGloUnknownMask = strtol(mField[eGloUnknownMask].c_str(), NULL, 16); mP5.mBdsUnknownMask = strtol(mField[eBdsUnknownMask].c_str(), NULL, 16); @@ -971,11 +985,13 @@ SystemStatusXtra::SystemStatusXtra(const SystemStatusPQWP3& nmea) : mBdsXtraAge(nmea.mBdsXtraAge), mGalXtraAge(nmea.mGalXtraAge), mQzssXtraAge(nmea.mQzssXtraAge), + mNavicXtraAge(nmea.mNavicXtraAge), mGpsXtraValid(nmea.mGpsXtraValid), mGloXtraValid(nmea.mGloXtraValid), mBdsXtraValid(nmea.mBdsXtraValid), mGalXtraValid(nmea.mGalXtraValid), - mQzssXtraValid(nmea.mQzssXtraValid) + mQzssXtraValid(nmea.mQzssXtraValid), + mNavicXtraValid(nmea.mNavicXtraValid) { } @@ -987,11 +1003,13 @@ bool SystemStatusXtra::equals(const SystemStatusXtra& peer) (mBdsXtraAge != peer.mBdsXtraAge) || (mGalXtraAge != peer.mGalXtraAge) || (mQzssXtraAge != peer.mQzssXtraAge) || + (mNavicXtraAge != peer.mNavicXtraAge) || (mGpsXtraValid != peer.mGpsXtraValid) || (mGloXtraValid != peer.mGloXtraValid) || (mBdsXtraValid != peer.mBdsXtraValid) || (mGalXtraValid != peer.mGalXtraValid) || - (mQzssXtraValid != peer.mQzssXtraValid)) { + (mQzssXtraValid != peer.mQzssXtraValid) || + (mNavicXtraValid != peer.mNavicXtraValid)) { return false; } return true; @@ -1060,16 +1078,19 @@ SystemStatusSvHealth::SystemStatusSvHealth(const SystemStatusPQWP5& nmea) : mBdsUnknownMask(nmea.mBdsUnknownMask), mGalUnknownMask(nmea.mGalUnknownMask), mQzssUnknownMask(nmea.mQzssUnknownMask), + mNavicUnknownMask(nmea.mNavicUnknownMask), mGpsGoodMask(nmea.mGpsGoodMask), mGloGoodMask(nmea.mGloGoodMask), mBdsGoodMask(nmea.mBdsGoodMask), mGalGoodMask(nmea.mGalGoodMask), mQzssGoodMask(nmea.mQzssGoodMask), + mNavicGoodMask(nmea.mNavicGoodMask), mGpsBadMask(nmea.mGpsBadMask), mGloBadMask(nmea.mGloBadMask), mBdsBadMask(nmea.mBdsBadMask), mGalBadMask(nmea.mGalBadMask), - mQzssBadMask(nmea.mQzssBadMask) + mQzssBadMask(nmea.mQzssBadMask), + mNavicBadMask(nmea.mNavicBadMask) { } diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 0dbcf916..f3467e2f 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -44,20 +44,22 @@ #include -#define GPS_MIN (1) //1-32 -#define SBAS_MIN (33) -#define GLO_MIN (65) //65-88 -#define QZSS_MIN (193) //193-197 -#define BDS_MIN (201) //201-237 -#define GAL_MIN (301) //301-336 +#define GPS_MIN (1) //1-32 +#define SBAS_MIN (33) +#define GLO_MIN (65) //65-88 +#define QZSS_MIN (193) //193-197 +#define BDS_MIN (201) //201-237 +#define GAL_MIN (301) //301-336 +#define NAVIC_MIN (401) //401-414 -#define GPS_NUM (32) -#define SBAS_NUM (32) -#define GLO_NUM (24) -#define QZSS_NUM (5) -#define BDS_NUM (37) -#define GAL_NUM (36) -#define SV_ALL_NUM (GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM) //=134 +#define GPS_NUM (32) +#define SBAS_NUM (32) +#define GLO_NUM (24) +#define QZSS_NUM (5) +#define BDS_NUM (37) +#define GAL_NUM (36) +#define NAVIC_NUM (14) +#define SV_ALL_NUM (GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM+NAVIC_NUM) //=148 namespace loc_core { @@ -258,11 +260,13 @@ public: uint32_t mBdsXtraAge; uint32_t mGalXtraAge; uint32_t mQzssXtraAge; + uint32_t mNavicXtraAge; uint32_t mGpsXtraValid; uint32_t mGloXtraValid; uint64_t mBdsXtraValid; uint64_t mGalXtraValid; uint8_t mQzssXtraValid; + uint32_t mNavicXtraValid; inline SystemStatusXtra() : mXtraValidMask(0), mGpsXtraAge(0), @@ -270,11 +274,13 @@ public: mBdsXtraAge(0), mGalXtraAge(0), mQzssXtraAge(0), + mNavicXtraAge(0), mGpsXtraValid(0), mGloXtraValid(0), mBdsXtraValid(0ULL), mGalXtraValid(0ULL), - mQzssXtraValid(0) {} + mQzssXtraValid(0), + mNavicXtraValid(0) {} inline SystemStatusXtra(const SystemStatusPQWP3& nmea); bool equals(const SystemStatusXtra& peer); void dump(void); @@ -309,32 +315,38 @@ public: uint64_t mBdsUnknownMask; uint64_t mGalUnknownMask; uint8_t mQzssUnknownMask; + uint32_t mNavicUnknownMask; uint32_t mGpsGoodMask; uint32_t mGloGoodMask; uint64_t mBdsGoodMask; uint64_t mGalGoodMask; uint8_t mQzssGoodMask; + uint32_t mNavicGoodMask; uint32_t mGpsBadMask; uint32_t mGloBadMask; uint64_t mBdsBadMask; uint64_t mGalBadMask; uint8_t mQzssBadMask; + uint32_t mNavicBadMask; inline SystemStatusSvHealth() : mGpsUnknownMask(0), mGloUnknownMask(0), mBdsUnknownMask(0ULL), mGalUnknownMask(0ULL), mQzssUnknownMask(0), + mNavicUnknownMask(0), mGpsGoodMask(0), mGloGoodMask(0), mBdsGoodMask(0ULL), mGalGoodMask(0ULL), mQzssGoodMask(0), + mNavicGoodMask(0), mGpsBadMask(0), mGloBadMask(0), mBdsBadMask(0ULL), mGalBadMask(0ULL), - mQzssBadMask(0) {} + mQzssBadMask(0), + mNavicBadMask(0) {} inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea); bool equals(const SystemStatusSvHealth& peer); void dump(void); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 549c8451..eaf88780 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3364,6 +3364,11 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) // SV id passed to here by LocApi is 1-based. svNotify.gnssSvs[i].svId += (QZSS_SV_PRN_MIN - 1); break; + case GNSS_SV_TYPE_NAVIC: + if (mGnssSvIdUsedInPosAvail) { + svUsedIdMask = mGnssSvIdUsedInPosition.navic_sv_used_ids_mask; + } + break; default: svUsedIdMask = 0; break; @@ -4384,6 +4389,19 @@ void GnssAdapter::convertSatelliteInfo(std::vector& out, server_perdiction_age = (float)(in.mXtra.back().mGalXtraAge); } break; + case GNSS_SV_TYPE_NAVIC: + svid_min = GNSS_BUGREPORT_NAVIC_MIN; + svid_num = NAVIC_NUM; + svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM+GAL_NUM; + if (!in.mSvHealth.empty()) { + eph_health_good_mask = in.mSvHealth.back().mNavicGoodMask; + eph_health_bad_mask = in.mSvHealth.back().mNavicBadMask; + } + if (!in.mXtra.empty()) { + server_perdiction_available_mask = in.mXtra.back().mNavicXtraValid; + server_perdiction_age = (float)(in.mXtra.back().mNavicXtraAge); + } + break; default: return; } @@ -4541,6 +4559,7 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_QZSS, reports); convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_BEIDOU, reports); convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_GALILEO, reports); + convertSatelliteInfo(r.mSatelliteInfo, GNSS_SV_TYPE_NAVIC, reports); LOC_LOGV("getDebugReport - satellite=%zu", r.mSatelliteInfo.size()); return true; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 0c8e1573..ad85cd71 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -41,12 +41,13 @@ #define GNSS_MEASUREMENTS_MAX (128) #define GNSS_UTC_TIME_OFFSET (3657) -#define GNSS_BUGREPORT_GPS_MIN (1) -#define GNSS_BUGREPORT_SBAS_MIN (120) -#define GNSS_BUGREPORT_GLO_MIN (1) -#define GNSS_BUGREPORT_QZSS_MIN (193) -#define GNSS_BUGREPORT_BDS_MIN (1) -#define GNSS_BUGREPORT_GAL_MIN (1) +#define GNSS_BUGREPORT_GPS_MIN (1) +#define GNSS_BUGREPORT_SBAS_MIN (120) +#define GNSS_BUGREPORT_GLO_MIN (1) +#define GNSS_BUGREPORT_QZSS_MIN (193) +#define GNSS_BUGREPORT_BDS_MIN (1) +#define GNSS_BUGREPORT_GAL_MIN (1) +#define GNSS_BUGREPORT_NAVIC_MIN (1) #define GNSS_MAX_NAME_LENGTH (8) @@ -349,6 +350,7 @@ typedef enum { GNSS_SV_TYPE_QZSS, GNSS_SV_TYPE_BEIDOU, GNSS_SV_TYPE_GALILEO, + GNSS_SV_TYPE_NAVIC, } GnssSvType; typedef enum { @@ -518,6 +520,7 @@ typedef enum { GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT = (1<<2), GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT = (1<<3), GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT = (1<<4), + GNSS_AIDING_DATA_SV_TYPE_NAVIC_BIT = (1<<5), } GnssAidingDataSvTypeBits; /* Gnss constellation type mask */ @@ -528,13 +531,15 @@ typedef enum { GNSS_CONSTELLATION_TYPE_QZSS_BIT = (1<<2), GNSS_CONSTELLATION_TYPE_BEIDOU_BIT = (1<<3), GNSS_CONSTELLATION_TYPE_GALILEO_BIT = (1<<4), - GNSS_CONSTELLATION_TYPE_SBAS_BIT = (1<<5) + GNSS_CONSTELLATION_TYPE_SBAS_BIT = (1<<5), + GNSS_CONSTELLATION_TYPE_NAVIC_BIT = (1<<6) } GnssConstellationTypeBits; #define GNSS_CONSTELLATION_TYPE_MASK_ALL\ (GNSS_CONSTELLATION_TYPE_GPS_BIT | GNSS_CONSTELLATION_TYPE_GLONASS_BIT |\ GNSS_CONSTELLATION_TYPE_QZSS_BIT | GNSS_CONSTELLATION_TYPE_BEIDOU_BIT |\ - GNSS_CONSTELLATION_TYPE_GALILEO_BIT | GNSS_CONSTELLATION_TYPE_SBAS_BIT) + GNSS_CONSTELLATION_TYPE_GALILEO_BIT | GNSS_CONSTELLATION_TYPE_SBAS_BIT |\ + GNSS_CONSTELLATION_TYPE_NAVIC_BIT) /** GNSS Signal Type and RF Band */ typedef uint32_t GnssSignalTypeMask; @@ -574,7 +579,9 @@ typedef enum { /** QZSS L5 RF Band */ GNSS_SIGNAL_QZSS_L5 = (1<<16), /** SBAS L1 RF Band */ - GNSS_SIGNAL_SBAS_L1 = (1<<17) + GNSS_SIGNAL_SBAS_L1 = (1<<17), + /** NAVIC L5 RF Band */ + GNSS_SIGNAL_NAVIC_L5 = (1<<18) } GnssSignalTypeBits; #define GNSS_SIGNAL_TYPE_MASK_ALL\ @@ -583,7 +590,8 @@ typedef enum { GNSS_SIGNAL_GALILEO_E1 | GNSS_SIGNAL_GALILEO_E5A | GNSS_SIGNAL_GALILEO_E5B |\ GNSS_SIGNAL_BEIDOU_B1I | GNSS_SIGNAL_BEIDOU_B1C | GNSS_SIGNAL_BEIDOU_B2I|\ GNSS_SIGNAL_BEIDOU_B2AI | GNSS_SIGNAL_QZSS_L1CA | GNSS_SIGNAL_QZSS_L1S |\ - GNSS_SIGNAL_QZSS_L2| GNSS_SIGNAL_QZSS_L5 | GNSS_SIGNAL_SBAS_L1) + GNSS_SIGNAL_QZSS_L2| GNSS_SIGNAL_QZSS_L5 | GNSS_SIGNAL_SBAS_L1 |\ + GNSS_SIGNAL_NAVIC_L5) typedef enum { @@ -599,7 +607,9 @@ typedef enum /**< GLONASS satellite. */ GNSS_LOC_SV_SYSTEM_BDS = 5, /**< BDS satellite. */ - GNSS_LOC_SV_SYSTEM_QZSS = 6 + GNSS_LOC_SV_SYSTEM_QZSS = 6, + /**< QZSS satellite. */ + GNSS_LOC_SV_SYSTEM_NAVIC = 7 /**< QZSS satellite. */ } Gnss_LocSvSystemEnumType; @@ -622,7 +632,8 @@ typedef enum { GNSS_LOC_SIGNAL_TYPE_QZSS_L2C_L = 15, /**< QZSS L2C_L RF Band */ GNSS_LOC_SIGNAL_TYPE_QZSS_L5_Q = 16, /**< QZSS L5_Q RF Band */ GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA = 17, /**< SBAS L1_CA RF Band */ - GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 18 /**< Maximum number of signal types */ + GNSS_LOC_SIGNAL_TYPE_NAVIC_L5 = 18, /**< NAVIC L5 RF Band */ + GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 19 /**< Maximum number of signal types */ } Gnss_LocSignalEnumType; typedef uint64_t GnssDataMask; @@ -799,6 +810,7 @@ typedef struct { uint64_t galSvUsedIdsMask; uint64_t bdsSvUsedIdsMask; uint64_t qzssSvUsedIdsMask; + uint64_t navicSvUsedIdsMask; } GnssLocationSvUsedInPosition; typedef struct { @@ -812,7 +824,8 @@ typedef struct { For SBAS: 120 to 151 For QZSS-L1CA:193 to 197 For BDS: 201 to 237 - For GAL: 301 to 336 */ + For GAL: 301 to 336 + For NAVIC: 401 to 414 */ uint16_t gnssSvId; } GnssMeasUsageInfo; @@ -907,7 +920,8 @@ typedef union { GnssSystemTimeStructType galSystemTime; GnssSystemTimeStructType bdsSystemTime; GnssSystemTimeStructType qzssSystemTime; - GnssGloTimeStructType gloSystemTime; + GnssGloTimeStructType gloSystemTime; + GnssSystemTimeStructType navicSystemTime; } SystemTimeStructUnion; /** Time applicability of PVT report */ typedef struct { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 65218ab8..70aa1be6 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -434,6 +434,8 @@ typedef uint32_t GnssAdditionalSystemInfoMask; #define BDS_SV_PRN_MAX 235 #define GAL_SV_PRN_MIN 301 #define GAL_SV_PRN_MAX 336 +#define NAVIC_SV_PRN_MIN 401 +#define NAVIC_SV_PRN_MAX 414 typedef uint32_t LocPosTechMask; #define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000) @@ -467,6 +469,7 @@ typedef struct { uint64_t gal_sv_used_ids_mask; uint64_t bds_sv_used_ids_mask; uint64_t qzss_sv_used_ids_mask; + uint64_t navic_sv_used_ids_mask; } GnssSvUsedInPosition; typedef struct { @@ -594,6 +597,8 @@ typedef uint32_t GnssSignalTypeMask; #define GNSS_SIGNAL_QZSS_L5 ((GnssSignalTypeMask)0x00010000ul) /** SBAS L1 RF Band */ #define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00020000ul) +/** NAVIC L5 RF Band */ +#define GNSS_SIGNAL_NAVIC_L5 ((GnssSignalTypeMask)0x00040000ul) typedef uint16_t GnssMeasUsageStatusBitMask; /** Used in fix */ @@ -1352,26 +1357,32 @@ typedef struct typedef uint64_t GpsSvMeasHeaderFlags; -#define GNSS_SV_MEAS_HEADER_HAS_LEAP_SECOND 0x00000001 -#define GNSS_SV_MEAS_HEADER_HAS_CLOCK_FREQ 0x00000002 -#define GNSS_SV_MEAS_HEADER_HAS_AP_TIMESTAMP 0x00000004 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_GLO_INTER_SYSTEM_BIAS 0x00000008 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_BDS_INTER_SYSTEM_BIAS 0x00000010 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_GAL_INTER_SYSTEM_BIAS 0x00000020 -#define GNSS_SV_MEAS_HEADER_HAS_BDS_GLO_INTER_SYSTEM_BIAS 0x00000040 -#define GNSS_SV_MEAS_HEADER_HAS_GAL_GLO_INTER_SYSTEM_BIAS 0x00000080 -#define GNSS_SV_MEAS_HEADER_HAS_GAL_BDS_INTER_SYSTEM_BIAS 0x00000100 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME 0x00000200 -#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME 0x00000400 -#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME 0x00000800 -#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME 0x00001000 -#define GNSS_SV_MEAS_HEADER_HAS_GLO_SYSTEM_TIME 0x00002000 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME_EXT 0x00004000 -#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME_EXT 0x00008000 -#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME_EXT 0x00010000 -#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME_EXT 0x00020000 -#define GNSS_SV_MEAS_HEADER_HAS_GPSL1L5_TIME_BIAS 0x00040000 -#define GNSS_SV_MEAS_HEADER_HAS_GALE1E5A_TIME_BIAS 0x00080000 +#define GNSS_SV_MEAS_HEADER_HAS_LEAP_SECOND 0x00000001 +#define GNSS_SV_MEAS_HEADER_HAS_CLOCK_FREQ 0x00000002 +#define GNSS_SV_MEAS_HEADER_HAS_AP_TIMESTAMP 0x00000004 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_GLO_INTER_SYSTEM_BIAS 0x00000008 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_BDS_INTER_SYSTEM_BIAS 0x00000010 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_GAL_INTER_SYSTEM_BIAS 0x00000020 +#define GNSS_SV_MEAS_HEADER_HAS_BDS_GLO_INTER_SYSTEM_BIAS 0x00000040 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_GLO_INTER_SYSTEM_BIAS 0x00000080 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_BDS_INTER_SYSTEM_BIAS 0x00000100 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME 0x00000200 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME 0x00000400 +#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME 0x00000800 +#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME 0x00001000 +#define GNSS_SV_MEAS_HEADER_HAS_GLO_SYSTEM_TIME 0x00002000 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_SYSTEM_TIME_EXT 0x00004000 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME_EXT 0x00008000 +#define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME_EXT 0x00010000 +#define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME_EXT 0x00020000 +#define GNSS_SV_MEAS_HEADER_HAS_GPSL1L5_TIME_BIAS 0x00040000 +#define GNSS_SV_MEAS_HEADER_HAS_GALE1E5A_TIME_BIAS 0x00080000 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_NAVIC_INTER_SYSTEM_BIAS 0x00100000 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_NAVIC_INTER_SYSTEM_BIAS 0x00200000 +#define GNSS_SV_MEAS_HEADER_HAS_GLO_NAVIC_INTER_SYSTEM_BIAS 0x00400000 +#define GNSS_SV_MEAS_HEADER_HAS_BDS_NAVIC_INTER_SYSTEM_BIAS 0x00800000 +#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME 0x01000000 +#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME_EXT 0x02000000 @@ -1393,6 +1404,10 @@ typedef struct Gnss_InterSystemBiasStructType bdsGloInterSystemBias; Gnss_InterSystemBiasStructType galGloInterSystemBias; Gnss_InterSystemBiasStructType galBdsInterSystemBias; + Gnss_InterSystemBiasStructType gpsNavicInterSystemBias; + Gnss_InterSystemBiasStructType galNavicInterSystemBias; + Gnss_InterSystemBiasStructType gloNavicInterSystemBias; + Gnss_InterSystemBiasStructType bdsNavicInterSystemBias; Gnss_InterSystemBiasStructType gpsL1L5TimeBias; Gnss_InterSystemBiasStructType galE1E5aTimeBias; @@ -1400,6 +1415,7 @@ typedef struct GnssSystemTimeStructType galSystemTime; GnssSystemTimeStructType bdsSystemTime; GnssSystemTimeStructType qzssSystemTime; + GnssSystemTimeStructType navicSystemTime; GnssGloTimeStructType gloSystemTime; /** GPS system RTC time information. */ @@ -1410,6 +1426,8 @@ typedef struct Gnss_LocGnssTimeExtStructType bdsSystemTimeExt; /** QZSS system RTC time information. */ Gnss_LocGnssTimeExtStructType qzssSystemTimeExt; + /** NAVIC system RTC time information. */ + Gnss_LocGnssTimeExtStructType navicSystemTimeExt; } GnssSvMeasurementHeader; @@ -2025,10 +2043,11 @@ typedef struct /* Mask indicating enabled or disabled constellations */ typedef uint64_t GnssSvTypesMask; typedef enum { - GNSS_SV_TYPES_MASK_GLO_BIT = (1<<0), - GNSS_SV_TYPES_MASK_BDS_BIT = (1<<1), - GNSS_SV_TYPES_MASK_QZSS_BIT = (1<<2), - GNSS_SV_TYPES_MASK_GAL_BIT = (1<<3), + GNSS_SV_TYPES_MASK_GLO_BIT = (1<<0), + GNSS_SV_TYPES_MASK_BDS_BIT = (1<<1), + GNSS_SV_TYPES_MASK_QZSS_BIT = (1<<2), + GNSS_SV_TYPES_MASK_GAL_BIT = (1<<3), + GNSS_SV_TYPES_MASK_NAVIC_BIT = (1<<4), } GnssSvTypesMaskBits; /* This SV Type config is injected directly to GNSS Adapter diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 9cd34720..45b4f067 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -123,6 +123,7 @@ typedef struct loc_sv_cache_info_s uint32_t gal_used_mask; uint32_t qzss_used_mask; uint32_t bds_used_mask; + uint32_t navic_used_mask; uint32_t gps_l1_count; uint32_t gps_l5_count; uint32_t glo_g1_count; @@ -133,6 +134,7 @@ typedef struct loc_sv_cache_info_s uint32_t qzss_l5_count; uint32_t bds_b1_count; uint32_t bds_b2_count; + uint32_t navic_l5_count; float hdop; float pdop; float vdop; @@ -324,6 +326,9 @@ static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) case GNSS_SIGNAL_BEIDOU_B2AI: signalId = SIGNAL_ID_BDS_B2A; break; + case GNSS_SIGNAL_NAVIC_L5: + signalId = SIGNAL_ID_NAVIC_L5SPS; + break; default: signalId = SIGNAL_ID_ALL_SIGNALS; } @@ -418,6 +423,16 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.svCount = sv_cache_info.bds_b2_count; } break; + case GNSS_SV_TYPE_NAVIC: + sv_meta.talker[0] = 'G'; + sv_meta.talker[1] = 'I'; + sv_meta.mask = sv_cache_info.navic_used_mask; + // NAVIC SV ids are from 401-414. So keep svIdOffset 0 + sv_meta.systemId = SYSTEM_ID_NAVIC; + if (GNSS_SIGNAL_NAVIC_L5 == signalType) { + sv_meta.svCount = sv_cache_info.navic_l5_count; + } + break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svType); return NULL; @@ -428,7 +443,8 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, (sv_cache_info.glo_used_mask ? 1 : 0) + (sv_cache_info.gal_used_mask ? 1 : 0) + (sv_cache_info.qzss_used_mask ? 1 : 0) + - (sv_cache_info.bds_used_mask ? 1 : 0) > 1) + (sv_cache_info.bds_used_mask ? 1 : 0) + + (sv_cache_info.navic_used_mask ? 1 : 0) > 1) { // If GPS, GLONASS, Galileo, QZSS, BDS etc. are combined // to obtain the reported position solution, @@ -701,6 +717,9 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, case GNSS_SV_TYPE_SBAS: signalType = GNSS_SIGNAL_SBAS_L1; break; + case GNSS_SV_TYPE_NAVIC: + signalType = GNSS_SIGNAL_NAVIC_L5; + break; default: LOC_LOGE("NMEA Error unknow constellation type: %d", svNotify.gnssSvs[svNumber - 1].type); @@ -1815,6 +1834,19 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, sv_cache_info.bds_b1_count++; } } + else if (GNSS_SV_TYPE_NAVIC == svNotify.gnssSvs[svNumber - 1].type) + { + // cache the used in fix mask, as it will be needed to send $PQGSA + // during the position report + if (GNSS_SV_OPTIONS_USED_IN_FIX_BIT == + (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & + GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) + { + sv_cache_info.navic_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + } + // GNSS_SIGNAL_NAVIC_L5 is the only signal type for NAVIC + sv_cache_info.navic_l5_count++; + } } loc_nmea_sv_meta sv_meta; From 61b7ed6bf0718c2b4a93350f130e8b13f980c823 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 15 May 2019 15:08:30 -0700 Subject: [PATCH 847/945] Fix few ASAN issues reported - Fix a Use After Free issue in Gnss Update Config If Engine Capabilities are not known yet at the time of the MsgGnssUpdateConfig, the ids arrray will be freed but the ids pointer will be copied into a new MsgGnssUpdateConfig that will access the ids array again - Issue in NetworkInfoDataItemBase which will result in array out of bound access which might result in heap buffer overflow. Change-Id: Ib5a6dc29fef9eb6676d4605f92d60f26a47d1d90 CRs-fixed: 2449980 --- core/data-items/DataItemConcreteTypesBase.h | 2 +- gnss/GnssAdapter.cpp | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 552d46a1..a6e68f1f 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -249,7 +249,7 @@ public: mId(NETWORKINFO_DATA_ITEM_ID) { memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN, sizeof (mAllNetworkHandles)); - mAllNetworkHandles[type] = networkHandle; + mAllNetworkHandles[initialType] = networkHandle; } virtual ~NetworkInfoDataItemBase() {} inline virtual DataItemId getId() { return mId; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index e1143fd2..6558714e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -997,9 +997,18 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) mConfig(config), mCount(count), mIds(ids) {} + inline MsgGnssUpdateConfig(const MsgGnssUpdateConfig& obj) : + MsgGnssUpdateConfig(obj.mAdapter, obj.mApi, obj.mConfig, + new uint32_t[obj.mCount], obj.mCount) { + if (mIds != nullptr) { + for (int i = 0; i < mCount; ++i) { + mIds[i] = obj.mIds[i]; + } + } + } inline virtual ~MsgGnssUpdateConfig() { - delete [] mIds; + delete[] mIds; } inline virtual void proc() const { @@ -1257,6 +1266,16 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) { mConfigMask(configMask), mIds(ids), mCount(count) {} + + inline MsgGnssGetConfig(const MsgGnssGetConfig& obj) : + MsgGnssGetConfig(obj.mAdapter, obj.mApi, obj.mConfigMask, + new uint32_t[obj.mCount], obj.mCount) { + if (mIds != nullptr) { + for (int i = 0; i < mCount; ++i) { + mIds[i] = obj.mIds[i]; + } + } + } inline virtual ~MsgGnssGetConfig() { delete[] mIds; From 02e5413b20c3dc0e3cbef6b77e400add6b451d12 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 16 May 2019 15:35:00 -0700 Subject: [PATCH 848/945] Send updated GPS lock value to xtra-daemon Send updated (masked) GPS lock value to xtra-daemon CRs-Fixed: 2454370 Change-Id: I17439a2aa10d776cff882a4fb09224489b86c796 --- gnss/XtraSystemStatusObserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 4cb6f5f8..af593fb8 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -123,7 +123,7 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { stringstream ss; ss << "gpslock"; - ss << " " << lock; + ss << " " << mGpsLock; string s = ss.str(); return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } From 210d3ca227393a46829988577aea95ec2e800c41 Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Thu, 16 May 2019 23:57:46 +0530 Subject: [PATCH 849/945] Addressing format related to formating Added formating related issue as genuine errors fixes Change-Id: Ie01e9ce3bf838a37871a4779ae1403b4dca3d87c CRs-Fixed: 2447200 --- android/2.0/GnssConfiguration.cpp | 2 +- android/2.0/location_api/GeofenceAPIClient.cpp | 2 +- android/2.0/location_api/GnssAPIClient.cpp | 6 +++--- android/2.0/location_api/MeasurementAPIClient.cpp | 2 +- build/target_specific_features.mk | 1 - core/LocApiBase.cpp | 2 +- pla/Android.mk | 1 - utils/LocIpc.cpp | 4 ++-- utils/LocIpc.h | 2 +- 9 files changed, 10 insertions(+), 12 deletions(-) diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index 671b6e7b..d2a87637 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -255,7 +255,7 @@ bool GnssConfiguration::setBlacklistedSource( break; default: copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN; - LOC_LOGe("Invalid constellation %u", copyFromSource.constellation); + LOC_LOGe("Invalid constellation %hhu", copyFromSource.constellation); retVal = false; break; } diff --git a/android/2.0/location_api/GeofenceAPIClient.cpp b/android/2.0/location_api/GeofenceAPIClient.cpp index fabf8bb1..a93c9886 100644 --- a/android/2.0/location_api/GeofenceAPIClient.cpp +++ b/android/2.0/location_api/GeofenceAPIClient.cpp @@ -141,7 +141,7 @@ void GeofenceAPIClient::geofenceRemoveAll() // callbacks void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) { - LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count); + LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceBreachNotification.count); if (mGnssGeofencingCbIface != nullptr) { for (size_t i = 0; i < geofenceBreachNotification.count; i++) { GnssLocation gnssLocation; diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index 68cf395d..15245e3a 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -517,7 +517,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification) { - LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count); + LOC_LOGD("%s]: (count: %u)", __FUNCTION__, gnssSvNotification.count); mMutex.lock(); auto gnssCbIface(mGnssCbIface); auto gnssCbIface_2_0(mGnssCbIface_2_0); @@ -561,7 +561,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) auto r = gnssCbIface_2_0->gnssNmeaCb( static_cast(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%zu description=%s", + LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%u description=%s", __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); } @@ -569,7 +569,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) auto r = gnssCbIface->gnssNmeaCb( static_cast(gnssNmeaNotification.timestamp), nmeaString); if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", + LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%u description=%s", __func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str()); } diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp index 23c3b168..eb0c7d1d 100644 --- a/android/2.0/location_api/MeasurementAPIClient.cpp +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -170,7 +170,7 @@ void MeasurementAPIClient::measurementClose() { void MeasurementAPIClient::onGnssMeasurementsCb( GnssMeasurementsNotification gnssMeasurementsNotification) { - LOC_LOGD("%s]: (count: %zu active: %d)", + LOC_LOGD("%s]: (count: %u active: %d)", __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { mMutex.lock(); diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index ad7f7e1d..ca6eb795 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -1,7 +1,6 @@ GNSS_CFLAGS := \ -Werror \ -Wno-error=unused-parameter \ - -Wno-error=format \ -Wno-error=macro-redefined \ -Wno-error=reorder \ -Wno-error=missing-braces \ diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index c1723766..a521ceb6 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -404,7 +404,7 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify) "QZSS", "BEIDOU", "GALILEO" }; // print the SV info before delivering - LOC_LOGV("num sv: %zu\n" + LOC_LOGV("num sv: %u\n" " sv: constellation svid cN0" " elevation azimuth flags", svNotify.count); diff --git a/pla/Android.mk b/pla/Android.mk index ce062bb5..a57861d9 100644 --- a/pla/Android.mk +++ b/pla/Android.mk @@ -1,7 +1,6 @@ GNSS_CFLAGS := \ -Werror \ -Wno-error=unused-parameter \ - -Wno-error=format \ -Wno-error=macro-redefined \ -Wno-error=reorder \ -Wno-error=missing-braces \ diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index ecaff01c..94968956 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -48,7 +48,7 @@ namespace loc_util { #define SOCK_OP_AND_LOG(buf, length, opable, rtv, exe) \ if (nullptr == (buf) || 0 == (length)) { \ - LOC_LOGe("Invalid inputs: buf - %p, length - %d", (buf), (length)); \ + LOC_LOGe("Invalid inputs: buf - %p, length - %u", (buf), (length)); \ } else if (!(opable)) { \ LOC_LOGe("Invalid object: operable - %d", (opable)); \ } else { \ @@ -60,7 +60,7 @@ namespace loc_util { const char Sock::MSG_ABORT[] = "LocIpc::Sock::ABORT"; const char Sock::LOC_IPC_HEAD[] = "$MSGLEN$"; -ssize_t Sock::send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, +ssize_t Sock::send(const void *buf, uint32_t len, int flags, const struct sockaddr *destAddr, socklen_t addrlen) const { ssize_t rtv = -1; SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen)); diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 20a1c8f4..c71c4e01 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -164,7 +164,7 @@ public: inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {} inline ~Sock() { close(); } inline bool isValid() const { return -1 != mSid; } - ssize_t send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, + ssize_t send(const void *buf, uint32_t len, int flags, const struct sockaddr *destAddr, socklen_t addrlen) const; ssize_t recv(const shared_ptr& dataCb, int flags, struct sockaddr *srcAddr, socklen_t *addrlen, int sid = -1) const; From 7490804ed9bcf7a2b9c371988466d22b1f659382 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 17 May 2019 18:04:32 -0700 Subject: [PATCH 850/945] fixed a potential race condition in managing gps lock gnssConfigRequested in setConfigCommand handling currently gets data into gnssConfigRequested in LocApi thread. This introduces race condition that adapter.getAfwControlId() could be called from a different thread than where adapter.setAfwControlId() is called. CRs-fixed: 2453439 Change-Id: I75ce482a4a87436dff04972ffd82b48db3af62c1 --- gnss/GnssAdapter.cpp | 159 ++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7253efe7..535f6de6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -714,90 +714,91 @@ GnssAdapter::setConfigCommand() loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; - mApi.sendMsg(new LocApiMsg( - [&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () { - //cache the injected configuration with GnssConfigRequested struct - GnssConfig gnssConfigRequested = {}; - gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | - GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; - gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) { - gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; - } + //cache the injected configuration with GnssConfigRequested struct + GnssConfig gnssConfigRequested = {}; + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) { + gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; + } - if (gpsConf.AGPS_CONFIG_INJECT) { - gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | - GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | - GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; - gnssConfigRequested.suplVersion = - adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); - gnssConfigRequested.lppProfile = - adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); - gnssConfigRequested.aGlonassPositionProtocolMask = - gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; - } - gnssConfigRequested.lppeControlPlaneMask = - adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); - gnssConfigRequested.lppeUserPlaneMask = - adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); - gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(), - adapter.mBlacklistedSvIds.end()); - adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested, - gnssConfigRequested); + if (gpsConf.AGPS_CONFIG_INJECT) { + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + gnssConfigRequested.suplVersion = + adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); + gnssConfigRequested.lppProfile = + adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); + gnssConfigRequested.aGlonassPositionProtocolMask = + gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; + } + gnssConfigRequested.lppeControlPlaneMask = + adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); + gnssConfigRequested.lppeUserPlaneMask = + adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); + gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(), + adapter.mBlacklistedSvIds.end()); + mApi.sendMsg(new LocApiMsg( + [&adapter, gpsConf, sapConf, oldServerUrl, + oldMoServerUrl, gnssConfigRequested] () { + adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested, + gnssConfigRequested); - // set nmea mask type - uint32_t mask = 0; - if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { - mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { - mask |= LOC_NMEA_MASK_DEBUG_V02; - } + // set nmea mask type + uint32_t mask = 0; + if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } - if (mask != 0) { - adapter.mLocApi->setNMEATypesSync(mask); - } + if (mask != 0) { + adapter.mLocApi->setNMEATypesSync(mask); + } - adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); - adapter.mLocApi->setConstrainedTuncMode( - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, - (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); - adapter.mLocApi->setPositionAssistedClockEstimatorMode( - gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); + adapter.mLocApi->setConstrainedTuncMode( + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, + (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); + adapter.mLocApi->setPositionAssistedClockEstimatorMode( + gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); - if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - adapter.mLocApi->setSensorPropertiesSync( - sapConf.GYRO_BIAS_RANDOM_WALK_VALID, - sapConf.GYRO_BIAS_RANDOM_WALK, - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); - } - adapter.mLocApi->setSensorPerfControlConfigSync( - sapConf.SENSOR_CONTROL_MODE, - sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, - sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, - sapConf.SENSOR_GYRO_BATCHES_PER_SEC, - sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - sapConf.SENSOR_ALGORITHM_CONFIG_MASK); + if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + adapter.mLocApi->setSensorPropertiesSync( + sapConf.GYRO_BIAS_RANDOM_WALK_VALID, + sapConf.GYRO_BIAS_RANDOM_WALK, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); + } + adapter.mLocApi->setSensorPerfControlConfigSync( + sapConf.SENSOR_CONTROL_MODE, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_ALGORITHM_CONFIG_MASK); } )); } }; @@ -1075,7 +1076,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) newGpsLock = GNSS_CONFIG_GPS_LOCK_MO; } if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK || - 0 != mAdapter.getAfwControlId()) { + 0 != mAdapter.getAfwControlId() || NULL != adapter.mNfwCb) { gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); } ContextBase::mGps_conf.GPS_LOCK = newGpsLock; From 89583a78f041efb6213044867650e20013500e35 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 7 Mar 2019 18:08:06 +0800 Subject: [PATCH 851/945] Add charger indication receiver in Gnss Hidl Register HEALTH Hal client in all Gnss Hidl impl to acquire charger indication. Change-Id: I3fcc00dd14a95e2375ab27a8c84c260300f9e90d CRs-fixed: 2411445 --- android/1.0/Android.mk | 9 +- android/1.0/Gnss.cpp | 7 + android/1.1/Android.mk | 9 +- android/1.1/Gnss.cpp | 8 + android/2.0/Android.mk | 11 +- android/2.0/Gnss.cpp | 7 + android/Android.mk | 9 +- android/utils/Android.mk | 37 ++++ android/utils/battery_listener.cpp | 266 +++++++++++++++++++++++++++++ android/utils/battery_listener.h | 32 ++++ 10 files changed, 388 insertions(+), 7 deletions(-) create mode 100644 android/utils/Android.mk create mode 100644 android/utils/battery_listener.cpp create mode 100644 android/utils/battery_listener.h diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index 5489f861..9337325f 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -28,7 +28,8 @@ LOCAL_HEADER_LIBRARIES := \ libgps.utils_headers \ libloc_core_headers \ libloc_pla_headers \ - liblocation_api_headers + liblocation_api_headers \ + liblocbatterylistener_headers LOCAL_SHARED_LIBRARIES := \ liblog \ @@ -38,6 +39,10 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ android.hardware.gnss@1.0 \ + android.hardware.health@1.0 \ + android.hardware.health@2.0 \ + android.hardware.power@1.2 \ + libbase LOCAL_SHARED_LIBRARIES += \ libloc_core \ @@ -46,6 +51,8 @@ LOCAL_SHARED_LIBRARIES += \ liblocation_api \ LOCAL_CFLAGS += $(GNSS_CFLAGS) +LOCAL_STATIC_LIBRARIES := liblocbatterylistener +LOCAL_STATIC_LIBRARIES += libhealthhalutils include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp index 93b320bc..873cf373 100644 --- a/android/1.0/Gnss.cpp +++ b/android/1.0/Gnss.cpp @@ -19,6 +19,7 @@ */ #define LOG_TAG "LocSvc_GnssInterface" +#define LOG_NDEBUG 0 #include #include @@ -26,6 +27,7 @@ #include #include "Gnss.h" #include +#include "battery_listener.h" typedef const GnssInterface* (getLocationInterface)(); @@ -44,8 +46,13 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } } +void location_on_battery_status_changed(bool charging) { + LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); +} Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + // register health client to listen on battery change + loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig memset(&mPendingConfig, 0, sizeof(GnssConfig)); diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index 0beaf208..fb72de11 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -28,7 +28,8 @@ LOCAL_HEADER_LIBRARIES := \ libgps.utils_headers \ libloc_core_headers \ libloc_pla_headers \ - liblocation_api_headers + liblocation_api_headers \ + liblocbatterylistener_headers LOCAL_SHARED_LIBRARIES := \ liblog \ @@ -39,6 +40,10 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ android.hardware.gnss@1.0 \ android.hardware.gnss@1.1 \ + android.hardware.health@1.0 \ + android.hardware.health@2.0 \ + android.hardware.power@1.2 \ + libbase LOCAL_SHARED_LIBRARIES += \ libloc_core \ @@ -47,6 +52,8 @@ LOCAL_SHARED_LIBRARIES += \ liblocation_api \ LOCAL_CFLAGS += $(GNSS_CFLAGS) +LOCAL_STATIC_LIBRARIES := liblocbatterylistener +LOCAL_STATIC_LIBRARIES += libhealthhalutils include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index 8d5d8a82..f0d74da0 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/Gnss.cpp @@ -19,6 +19,7 @@ */ #define LOG_TAG "LocSvc_GnssInterface" +#define LOG_NDEBUG 0 #include #include @@ -27,6 +28,8 @@ #include "Gnss.h" #include +#include "battery_listener.h" + typedef const GnssInterface* (getLocationInterface)(); #define IMAGES_INFO_FILE "/sys/devices/soc0/images" @@ -84,8 +87,13 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } } +void location_on_battery_status_changed(bool charging) { + LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); +} Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + // register health client to listen on battery change + loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig memset(&mPendingConfig, 0, sizeof(GnssConfig)); diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index c33a7920..7c555042 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -37,7 +37,8 @@ LOCAL_HEADER_LIBRARIES := \ libgps.utils_headers \ libloc_core_headers \ libloc_pla_headers \ - liblocation_api_headers + liblocation_api_headers \ + liblocbatterylistener_headers LOCAL_SHARED_LIBRARIES := \ liblog \ @@ -50,7 +51,11 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.gnss@1.1 \ android.hardware.gnss@2.0 \ android.hardware.gnss.measurement_corrections@1.0 \ - android.hardware.gnss.visibility_control@1.0 + android.hardware.gnss.visibility_control@1.0 \ + android.hardware.health@1.0 \ + android.hardware.health@2.0 \ + android.hardware.power@1.2 \ + libbase LOCAL_SHARED_LIBRARIES += \ libloc_core \ @@ -59,6 +64,8 @@ LOCAL_SHARED_LIBRARIES += \ liblocation_api \ LOCAL_CFLAGS += $(GNSS_CFLAGS) +LOCAL_STATIC_LIBRARIES := liblocbatterylistener +LOCAL_STATIC_LIBRARIES += libhealthhalutils include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 0390af7d..be4efac3 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -19,6 +19,7 @@ */ #define LOG_TAG "LocSvc_GnssInterface" +#define LOG_NDEBUG 0 #include #include @@ -26,6 +27,7 @@ #include #include "Gnss.h" #include "LocationUtil.h" +#include "battery_listener.h" typedef const GnssInterface* (getLocationInterface)(); @@ -85,8 +87,13 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } } +void location_on_battery_status_changed(bool charging) { + LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); +} Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + // register health client to listen on battery change + loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig memset(&mPendingConfig, 0, sizeof(GnssConfig)); mGnssDeathRecipient = new GnssDeathRecipient(this); diff --git a/android/Android.mk b/android/Android.mk index f117def1..8233b68e 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -1,12 +1,15 @@ LOCAL_PATH := $(call my-dir) ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) +include $(CLEAR_VARS) +DIR_LIST := $(LOCAL_PATH) +include $(DIR_LIST)/utils/Android.mk ifeq ($(GNSS_HIDL_VERSION),2.0) -include $(LOCAL_PATH)/2.0/Android.mk +include $(DIR_LIST)/2.0/Android.mk else ifeq ($(GNSS_HIDL_VERSION),1.1) -include $(LOCAL_PATH)/1.1/Android.mk +include $(DIR_LIST)/1.1/Android.mk else -include $(LOCAL_PATH)/1.0/Android.mk +include $(DIR_LIST)/1.0/Android.mk endif #GNSS HIDL 1.1 endif #GNSS HIDL 2.0 else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti diff --git a/android/utils/Android.mk b/android/utils/Android.mk new file mode 100644 index 00000000..47b40811 --- /dev/null +++ b/android/utils/Android.mk @@ -0,0 +1,37 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := liblocbatterylistener +LOCAL_VENDOR_MODULE := true + +LOCAL_CFLAGS += $(GNSS_CFLAGS) + +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH) \ + +LOCAL_SRC_FILES:= \ + battery_listener.cpp +LOCAL_SHARED_LIBRARIES := \ + liblog \ + libhidlbase \ + libhidltransport \ + libhwbinder \ + libcutils \ + libutils \ + android.hardware.health@1.0 \ + android.hardware.health@2.0 \ + android.hardware.power@1.2 \ + libbase + +LOCAL_STATIC_LIBRARIES := libhealthhalutils +LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED + +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := liblocbatterylistener_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + +include $(BUILD_HEADER_LIBRARY) + + diff --git a/android/utils/battery_listener.cpp b/android/utils/battery_listener.cpp new file mode 100644 index 00000000..a790702b --- /dev/null +++ b/android/utils/battery_listener.cpp @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2019, 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 "battery_listener.h" +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "LocSvc_BatteryListener" + +#include +#include +#include +#include +#include +using android::hardware::interfacesEqual; +using android::hardware::Return; +using android::hardware::Void; +using android::hardware::health::V1_0::BatteryStatus; +using android::hardware::health::V1_0::toString; +using android::hardware::health::V2_0::get_health_service; +using android::hardware::health::V2_0::HealthInfo; +using android::hardware::health::V2_0::IHealth; +using android::hardware::health::V2_0::Result; +using android::hidl::manager::V1_0::IServiceManager; +using namespace std::literals::chrono_literals; + +static bool sIsBatteryListened = false; +namespace android { + +#define GET_HEALTH_SVC_RETRY_CNT 5 +#define GET_HEALTH_SVC_WAIT_TIME_MS 500 + +struct BatteryListenerImpl : public hardware::health::V2_0::IHealthInfoCallback, + public hardware::hidl_death_recipient { + typedef std::function cb_fn_t; + BatteryListenerImpl(cb_fn_t cb); + virtual ~BatteryListenerImpl (); + virtual hardware::Return healthInfoChanged( + const hardware::health::V2_0::HealthInfo& info); + virtual void serviceDied(uint64_t cookie, + const wp& who); + bool isCharging() { + std::lock_guard _l(mLock); + return statusToBool(mStatus); + } + private: + sp mHealth; + status_t init(); + BatteryStatus mStatus; + cb_fn_t mCb; + std::mutex mLock; + std::condition_variable mCond; + std::unique_ptr mThread; + bool mDone; + bool statusToBool(const BatteryStatus &s) const { + return (s == BatteryStatus::CHARGING) || + (s == BatteryStatus::FULL); + } +}; + +status_t BatteryListenerImpl::init() +{ + int tries = 0; + + if (mHealth != NULL) + return INVALID_OPERATION; + + do { + mHealth = hardware::health::V2_0::get_health_service(); + if (mHealth != NULL) + break; + usleep(GET_HEALTH_SVC_WAIT_TIME_MS * 1000); + tries++; + } while(tries < GET_HEALTH_SVC_RETRY_CNT); + + if (mHealth == NULL) { + ALOGE("no health service found, retries %d", tries); + return NO_INIT; + } else { + ALOGI("Get health service in %d tries", tries); + } + mStatus = BatteryStatus::UNKNOWN; + auto ret = mHealth->getChargeStatus([&](Result r, BatteryStatus status) { + if (r != Result::SUCCESS) { + ALOGE("batterylistener: cannot get battery status"); + return; + } + mStatus = status; + }); + if (!ret.isOk()) + ALOGE("batterylistener: get charge status transaction error"); + + if (mStatus == BatteryStatus::UNKNOWN) + ALOGW("batterylistener: init: invalid battery status"); + mDone = false; + mThread = std::make_unique([this]() { + std::unique_lock l(mLock); + BatteryStatus local_status = mStatus; + while (!mDone) { + if (local_status == mStatus) { + mCond.wait(l); + continue; + } + local_status = mStatus; + switch (local_status) { + // NOT_CHARGING is a special event that indicates, a battery is connected, + // but not charging. This is seen for approx a second + // after charger is plugged in. A charging event is eventually received. + // We must try to avoid an unnecessary cb to HAL + // only to call it again shortly. + // An option to deal with this transient event would be to ignore this. + // Or process this event with a slight delay (i.e cancel this event + // if a different event comes in within a timeout + case BatteryStatus::NOT_CHARGING : { + auto mStatusnot_ncharging = + [this, local_status]() { return mStatus != local_status; }; + mCond.wait_for(l, 3s, mStatusnot_ncharging); + if (mStatusnot_ncharging()) // i.e event changed + break; + [[clang::fallthrough]]; //explicit fall-through between switch labels + } + default: + bool c = statusToBool(local_status); + ALOGI("healthInfo cb thread: cb %s", c ? "CHARGING" : "NOT CHARGING"); + l.unlock(); + mCb(c); + l.lock(); + break; + } + } + }); + auto reg = mHealth->registerCallback(this); + if (!reg.isOk()) { + ALOGE("Transaction error in registeringCb to HealthHAL death: %s", + reg.description().c_str()); + } + + auto linked = mHealth->linkToDeath(this, 0 /* cookie */); + if (!linked.isOk() || linked == false) { + ALOGE("Transaction error in linking to HealthHAL death: %s", linked.description().c_str()); + } + return NO_ERROR; +} + +BatteryListenerImpl::BatteryListenerImpl(cb_fn_t cb) : + mCb(cb) +{ + init(); +} + +BatteryListenerImpl::~BatteryListenerImpl() +{ + { + std::lock_guard _l(mLock); + if (mHealth != NULL) + mHealth->unlinkToDeath(this); + auto r = mHealth->unlinkToDeath(this); + if (!r.isOk() || r == false) { + ALOGE("Transaction error in unregister to HealthHAL death: %s", + r.description().c_str()); + } + } + mDone = true; + mThread->join(); +} + +void BatteryListenerImpl::serviceDied(uint64_t cookie __unused, + const wp& who) +{ + { + std::lock_guard _l(mLock); + if (mHealth == NULL || !interfacesEqual(mHealth, who.promote())) { + ALOGE("health not initialized or unknown interface died"); + return; + } + ALOGI("health service died, reinit"); + mDone = true; + } + mThread->join(); + std::lock_guard _l(mLock); + init(); +} + +// this callback seems to be a SYNC callback and so +// waits for return before next event is issued. +// therefore we need not have a queue to process +// NOT_CHARGING and CHARGING concurrencies. +// Replace single var by a list if this assumption is broken +Return BatteryListenerImpl::healthInfoChanged( + const hardware::health::V2_0::HealthInfo& info) +{ + ALOGV("healthInfoChanged: %d", info.legacy.batteryStatus); + std::unique_lock l(mLock); + if (info.legacy.batteryStatus != mStatus) { + mStatus = info.legacy.batteryStatus; + mCond.notify_one(); + } + return Void(); +} + +static sp batteryListener; +status_t batteryPropertiesListenerInit(BatteryListenerImpl::cb_fn_t cb) +{ + ALOGV("batteryPropertiesListenerInit entry"); + batteryListener = new BatteryListenerImpl(cb); + return NO_ERROR; +} + +status_t batteryPropertiesListenerDeinit() +{ + batteryListener.clear(); + return OK; +} + +bool batteryPropertiesListenerIsCharging() +{ + return batteryListener->isCharging(); +} + +} // namespace android + +void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn) +{ + ALOGV("loc_extn_battery_properties_listener_init entry"); + if (!sIsBatteryListened) { + std::thread t1(android::batteryPropertiesListenerInit, + [=](bool charging) { fn(charging); }); + t1.detach(); + sIsBatteryListened = true; + } +} + +void loc_extn_battery_properties_listener_deinit() +{ + android::batteryPropertiesListenerDeinit(); +} + +bool loc_extn_battery_properties_is_charging() +{ + return android::batteryPropertiesListenerIsCharging(); +} diff --git a/android/utils/battery_listener.h b/android/utils/battery_listener.h new file mode 100644 index 00000000..bb6b7151 --- /dev/null +++ b/android/utils/battery_listener.h @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2019, 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. +*/ +typedef void (* battery_status_change_fn_t)(bool); +void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); +void loc_extn_battery_properties_listener_deinit(); +bool loc_extn_battery_properties_is_charging(); From 1e4aefd8b6244ada0238b8fe645345ff297cc32a Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Mon, 27 May 2019 16:07:12 +0800 Subject: [PATCH 852/945] modify DTM talker id Change-Id: I1844cc64767c0e6b324331f2016091ed1053e360 CRs-Fixed: 2455848 --- utils/loc_nmea.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 45b4f067..abcf5b73 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -792,6 +792,7 @@ SIDE EFFECTS ===========================================================================*/ static void loc_nmea_generate_DTM(const LocLla &ref_lla, const LocLla &local_lla, + char *talker, char *sentence, int bufSize) { @@ -828,7 +829,7 @@ static void loc_nmea_generate_DTM(const LocLla &ref_lla, default: break; } - length = snprintf(pMarker , lengthRemaining , "$GPDTM,%s,," , local_datum); + length = snprintf(pMarker , lengthRemaining , "$%sDTM,%s,," , talker, local_datum); if (length < 0 || length >= lengthRemaining) { LOC_LOGE("NMEA Error in string formatting"); return; @@ -1226,7 +1227,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, // ------------------- // ------$--DTM------- // ------------------- - loc_nmea_generate_DTM(ref_lla, local_lla, sentence_DTM, sizeof(sentence_DTM)); + loc_nmea_generate_DTM(ref_lla, local_lla, talker, sentence_DTM, sizeof(sentence_DTM)); // ------------------- // ------$--RMC------- From 41a8510ce10241134f4a9b86d9e1182d06f96cde Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Tue, 28 May 2019 12:23:50 +0530 Subject: [PATCH 853/945] KW issues on LA.UM.8.12 Addressed KW issue in MeasurementAPIClient.cpp Change-Id: Id35187c9e8eb29a81a86d12423e965fef780d668 CRs-Fixed: 2460424 --- android/2.0/location_api/MeasurementAPIClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/2.0/location_api/MeasurementAPIClient.cpp b/android/2.0/location_api/MeasurementAPIClient.cpp index eb0c7d1d..dc972ec3 100644 --- a/android/2.0/location_api/MeasurementAPIClient.cpp +++ b/android/2.0/location_api/MeasurementAPIClient.cpp @@ -217,7 +217,7 @@ void MeasurementAPIClient::onGnssMeasurementsCb( static void convertGnssMeasurement(GnssMeasurementsData& in, V1_0::IGnssMeasurementCallback::GnssMeasurement& out) { - memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement)); + memset(&out, 0, sizeof(out)); if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT) out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR; if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT) From c7cbd60fb53693f31384468c180b7d220384c878 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 31 May 2019 00:12:00 +0530 Subject: [PATCH 854/945] Removing benign error message Removing error message from GNSS update SV Type config method for onDeviceUp scenario. Change-Id: I7a93f9ea2fd5f8c1182c9ce10d298fc5971bc1e3 CRs-Fixed: 2461765 --- gnss/GnssAdapter.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 535f6de6..8e1bf5f8 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1636,9 +1636,10 @@ GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config) void GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset) { - LOC_LOGd("constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 ", sendReset %d", - mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask, - sendReset); + LOC_LOGd("size %zu constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 + ", sendReset %d", + mGnssSvTypeConfig.size, mGnssSvTypeConfig.blacklistedSvTypesMask, + mGnssSvTypeConfig.enabledSvTypesMask, sendReset); if (mGnssSvTypeConfig.size == sizeof(mGnssSvTypeConfig)) { @@ -1674,8 +1675,6 @@ GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset) svTypeConfig.enabledSvTypesMask = mGnssSvTypeConfig.enabledSvTypesMask; mLocApi->setConstellationControl(svTypeConfig); } - } else { - LOC_LOGE("Invalid GnssSvTypeConfig size"); } } From 04db4be280bef79038482dc37d2972ab2525692c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 29 May 2019 17:59:00 -0700 Subject: [PATCH 855/945] Downgrade locApiStopTracking print error to debug On cleanup, the locApiStopTracking is called regardless if a session is active or not, where this error would be printed. This is an expected case, so it should not be an error print. Change-Id: Ieb10d159ad61a212821ef897d50d635354557cca CRs-fixed: 2461760 --- location/LocationAPIClientBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/location/LocationAPIClientBase.cpp b/location/LocationAPIClientBase.cpp index 67e559b9..5a09712e 100644 --- a/location/LocationAPIClientBase.cpp +++ b/location/LocationAPIClientBase.cpp @@ -366,7 +366,7 @@ void LocationAPIClientBase::locAPIStopTracking() mLocationAPI->stopTracking(session); mTracking = false; } else { - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); + LOC_LOGD("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, session); } } pthread_mutex_unlock(&mMutex); From 4c9b600ed7d558bfb6b929fc588a4764065a978c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 3 Jun 2019 18:09:03 -0700 Subject: [PATCH 856/945] Report Locations to AFW only when active tracking We want to avoid reporting locations to AFW while measurements is active but tracking is not active. Change-Id: Icbb581199e6f5eba3cfe81cb6ab39337bb7ea51a CRs-fixed: 2441384 --- android/2.0/location_api/GnssAPIClient.cpp | 20 +++++++++++++++++++- android/2.0/location_api/GnssAPIClient.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index 15245e3a..ffe90750 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -61,6 +61,7 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb, mControlClient(new LocationAPIControlClient()), mLocationCapabilitiesMask(0), mLocationCapabilitiesCached(false), + mTracking(false), mGnssCbIface_2_0(nullptr) { LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb); @@ -76,6 +77,7 @@ GnssAPIClient::GnssAPIClient(const sp& gpsCb) : mControlClient(new LocationAPIControlClient()), mLocationCapabilitiesMask(0), mLocationCapabilitiesCached(false), + mTracking(false), mGnssCbIface_2_0(nullptr) { LOC_LOGD("%s]: (%p)", __FUNCTION__, &gpsCb); @@ -179,6 +181,11 @@ void GnssAPIClient::gnssUpdateCallbacks_2_0(const sp& gpsCb bool GnssAPIClient::gnssStart() { LOC_LOGD("%s]: ()", __FUNCTION__); + + mMutex.lock(); + mTracking = true; + mMutex.unlock(); + bool retVal = true; locAPIStartTracking(mTrackingOptions); return retVal; @@ -187,6 +194,11 @@ bool GnssAPIClient::gnssStart() bool GnssAPIClient::gnssStop() { LOC_LOGD("%s]: ()", __FUNCTION__); + + mMutex.lock(); + mTracking = false; + mMutex.unlock(); + bool retVal = true; locAPIStopTracking(); return retVal; @@ -412,12 +424,18 @@ void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) void GnssAPIClient::onTrackingCb(Location location) { - LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags); mMutex.lock(); auto gnssCbIface(mGnssCbIface); auto gnssCbIface_2_0(mGnssCbIface_2_0); + bool isTracking = mTracking; mMutex.unlock(); + LOC_LOGD("%s]: (flags: %02x isTracking: %d)", __FUNCTION__, location.flags, isTracking); + + if (!isTracking) { + return; + } + if (gnssCbIface_2_0 != nullptr) { V2_0::GnssLocation gnssLocation; convertGnssLocation(location, gnssLocation); diff --git a/android/2.0/location_api/GnssAPIClient.h b/android/2.0/location_api/GnssAPIClient.h index 493f9ca1..63b45615 100644 --- a/android/2.0/location_api/GnssAPIClient.h +++ b/android/2.0/location_api/GnssAPIClient.h @@ -102,6 +102,7 @@ private: LocationCapabilitiesMask mLocationCapabilitiesMask; bool mLocationCapabilitiesCached; TrackingOptions mTrackingOptions; + bool mTracking; sp mGnssCbIface_2_0; }; From 2e7c04a82d85a3ddec7a7a024e00f65e1ee0b0c3 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 11 Apr 2019 08:33:46 +0800 Subject: [PATCH 857/945] Update SystemStatus with battery info in HealthHAL Change-Id: Ibc2157f1834eb65da48f9375e497628411a185c9 CRs-fixed: 2433570 --- android/1.0/Gnss.cpp | 8 +++++++- android/1.1/Gnss.cpp | 8 +++++++- android/2.0/Gnss.cpp | 9 +++++++-- core/SystemStatus.cpp | 13 +++++++++++++ core/SystemStatus.h | 1 + gnss/location_gnss.cpp | 10 +++++++++- location/location_interface.h | 1 + 7 files changed, 45 insertions(+), 5 deletions(-) diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp index 873cf373..d85e0a40 100644 --- a/android/1.0/Gnss.cpp +++ b/android/1.0/Gnss.cpp @@ -37,6 +37,7 @@ namespace gnss { namespace V1_0 { namespace implementation { +static sp sGnss; void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { LOC_LOGE("%s] service died. cookie: %llu, who: %p", __FUNCTION__, static_cast(cookie), &who); @@ -47,10 +48,14 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } void location_on_battery_status_changed(bool charging) { - LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); + LOC_LOGd("battery status changed to %s charging", charging ? "" : "not "); + if (sGnss != nullptr) { + sGnss->getGnssInterface()->updateBatteryStatus(charging); + } } Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + sGnss = this; // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig @@ -65,6 +70,7 @@ Gnss::~Gnss() { delete mApi; mApi = nullptr; } + sGnss = nullptr; } GnssAPIClient* Gnss::getApi() { diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index f0d74da0..bea556fe 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/Gnss.cpp @@ -41,6 +41,7 @@ namespace gnss { namespace V1_1 { namespace implementation { +static sp sGnss; static std::string getVersionString() { static std::string version; if (!version.empty()) @@ -88,10 +89,14 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } void location_on_battery_status_changed(bool charging) { - LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); + LOC_LOGd("battery status changed to %s charging", charging ? "" : "not"); + if (sGnss != nullptr) { + sGnss->getGnssInterface()->updateBatteryStatus(charging); + } } Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + sGnss = this; // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig @@ -106,6 +111,7 @@ Gnss::~Gnss() { delete mApi; mApi = nullptr; } + sGnss = nullptr; } GnssAPIClient* Gnss::getApi() { diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index be4efac3..4fa5b63a 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -41,7 +41,7 @@ namespace V2_0 { namespace implementation { using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl; - +static sp sGnss; static std::string getVersionString() { static std::string version; if (!version.empty()) @@ -88,10 +88,14 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who } void location_on_battery_status_changed(bool charging) { - LOC_LOGd("%s: battery status changed to %s charging", __func__, charging ? "" : "not "); + LOC_LOGd("battery status changed to %s charging", charging ? "" : "not"); + if (sGnss != nullptr) { + sGnss->getGnssInterface()->updateBatteryStatus(charging); + } } Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); + sGnss = this; // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig @@ -105,6 +109,7 @@ Gnss::~Gnss() { delete mApi; mApi = nullptr; } + sGnss = nullptr; } GnssAPIClient* Gnss::getApi() { diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 18cb99c6..9ca126f8 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1723,5 +1723,18 @@ bool SystemStatus::eventConnectionStatus(bool connected, int8_t type, return true; } +/****************************************************************************** +@brief API to update power connect state + +@param[In] power connect status + +@return true when successfully done +******************************************************************************/ +bool SystemStatus::updatePowerConnectState(bool charging) +{ + SystemStatusPowerConnectState s(charging); + mSysStatusObsvr.notify({&s}); + return true; +} } // namespace loc_core diff --git a/core/SystemStatus.h b/core/SystemStatus.h index f3467e2f..94f7f0be 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -858,6 +858,7 @@ public: bool setDefaultGnssEngineStates(void); bool eventConnectionStatus(bool connected, int8_t type, bool roaming, NetworkHandle networkHandle); + bool updatePowerConnectState(bool charging); }; } // namespace loc_core diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 88fa15d9..76839b62 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -78,6 +78,7 @@ static void odcpiInject(const Location& location); static void blockCPI(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); +static void updateBatteryStatus(bool charging); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -115,7 +116,8 @@ static const GnssInterface gGnssInterface = { enableNfwLocationAccess, nfwInit, getPowerStateChanges, - injectLocationExt + injectLocationExt, + updateBatteryStatus }; #ifndef DEBUG_X86 @@ -382,3 +384,9 @@ static void injectLocationExt(const GnssLocationInfoNotification &locationInfo) gGnssAdapter->injectLocationExtCommand(locationInfo); } } + +static void updateBatteryStatus(bool charging) { + if (NULL != gGnssAdapter) { + gGnssAdapter->getSystemStatus()->updatePowerConnectState(charging); + } +} diff --git a/location/location_interface.h b/location/location_interface.h index 80f37c24..fb15bea6 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -87,6 +87,7 @@ struct GnssInterface { void (*nfwInit)(const NfwCbInfo& cbInfo); void (*getPowerStateChanges)(void* powerStateCb); void (*injectLocationExt)(const GnssLocationInfoNotification &locationInfo); + void (*updateBatteryStatus)(bool charging); }; struct BatchingInterface { From 071fd823dd949cdbdf81a39a469bee279bac1437 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 3 Jun 2019 15:26:29 -0700 Subject: [PATCH 858/945] GPS getting locked after killing LocHIDL Change-Id: Ib6a9ed37f9198b9024042f8ba7ac9e9bf5f05190 CRs-fixed: 2463756 --- gnss/GnssAdapter.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8e1bf5f8..b9a31106 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -720,10 +720,7 @@ GnssAdapter::setConfigCommand() GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; - gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) { - gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; - } + gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; if (gpsConf.AGPS_CONFIG_INJECT) { gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | @@ -1075,10 +1072,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) { newGpsLock = GNSS_CONFIG_GPS_LOCK_MO; } - if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK || - 0 != mAdapter.getAfwControlId() || NULL != adapter.mNfwCb) { - gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); - } + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; index++; } @@ -2976,10 +2970,8 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) mAdapter.setAfwControlId(mSessionId); GnssConfigGpsLock gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - if (NULL != mAdapter.mNfwCb) { - ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI; - gpsLock = ContextBase::mGps_conf.GPS_LOCK; - } + ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI; + gpsLock = ContextBase::mGps_conf.GPS_LOCK; mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() { mApi.setGpsLockSync(gpsLock); })); @@ -3026,10 +3018,8 @@ GnssAdapter::disableCommand(uint32_t id) mContext.modemPowerVote(false); mAdapter.setAfwControlId(0); - if (NULL != mAdapter.mNfwCb) { - /* We need to disable MO (AFW) */ - ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO; - } + /* We need to disable MO (AFW) */ + ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO; GnssConfigGpsLock gpsLock = ContextBase::mGps_conf.GPS_LOCK; mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { mApi.setGpsLockSync(gpsLock); From 980dbf59b6b864d90eee122936a4c8ec484f948d Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Tue, 2 Apr 2019 14:20:36 -0700 Subject: [PATCH 859/945] Fix to use explicit sized structures Cross processor communication needs explicit sized structures. Avoid using platform defined values like size_t which may vary from 32-bit to 64-bit. Also use explicitly defined timespec32_t structure that will only use uint32_t fields. CRs-Fixed: 2428163 Change-Id: Ida72f53ac672d9c9b86879bb9861cecefe6f8c6d --- gnss/GnssAdapter.cpp | 2 +- utils/gps_extended_c.h | 43 +++++++++++++++++++++++------------------- utils/loc_gps.h | 2 +- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8e1bf5f8..0775c2a7 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1636,7 +1636,7 @@ GnssAdapter::gnssSvTypeConfigUpdate(const GnssSvTypeConfig& config) void GnssAdapter::gnssSvTypeConfigUpdate(bool sendReset) { - LOC_LOGd("size %zu constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 + LOC_LOGd("size %" PRIu32" constellations blacklisted 0x%" PRIx64 ", enabled 0x%" PRIx64 ", sendReset %d", mGnssSvTypeConfig.size, mGnssSvTypeConfig.blacklistedSvTypesMask, mGnssSvTypeConfig.enabledSvTypesMask, sendReset); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 9f4c13c3..9c63166a 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -35,7 +35,12 @@ #include #include #include -#include + +struct timespec32_t { + uint32_t tv_sec; /* seconds */ + uint32_t tv_nsec; /* and nanoseconds */ +}; + /** * @file @@ -132,7 +137,7 @@ typedef enum { typedef struct { /** set to sizeof(UlpLocation) */ - size_t size; + uint32_t size; LocGpsLocation gpsLocation; /* Provider indicator for HYBRID or GPS */ uint16_t position_source; @@ -142,7 +147,7 @@ typedef struct { typedef struct { /** set to sizeof(UlpNmea) */ - size_t size; + uint32_t size; char nmea_str[ULP_MAX_NMEA_STRING_SIZE]; unsigned int len; } UlpNmea; @@ -208,7 +213,7 @@ typedef struct { /** GPS extended callback structure. */ typedef struct { /** set to sizeof(LocGpsCallbacks) */ - size_t size; + uint32_t size; loc_gps_set_capabilities set_capabilities_cb; loc_gps_acquire_wakelock acquire_wakelock_cb; loc_gps_release_wakelock release_wakelock_cb; @@ -232,7 +237,7 @@ typedef struct { /** Represents the status of AGPS. */ typedef struct { /** set to sizeof(AGpsExtStatus) */ - size_t size; + uint32_t size; AGpsExtType type; LocAGpsStatusValue status; @@ -458,7 +463,7 @@ typedef enum { }LocReliability; typedef struct { - struct timespec apTimeStamp; + struct timespec32_t apTimeStamp; /*boottime received from pps-ktimer*/ float apTimeStampUncertaintyMs; /* timestamp uncertainty in milli seconds */ @@ -685,7 +690,7 @@ typedef struct { /** Represents gps location extended. */ typedef struct { /** set to sizeof(GpsLocationExtended) */ - size_t size; + uint32_t size; /** Contains GpsLocationExtendedFlags bits. */ uint64_t flags; /** Contains the Altitude wrt mean sea level */ @@ -1058,7 +1063,7 @@ typedef enum typedef struct { - size_t size; + uint32_t size; float clockDrift; /**< Receiver clock Drift \n - Units: meter per sec \n @@ -1072,7 +1077,7 @@ typedef struct typedef struct { - size_t size; + uint32_t size; uint8_t leapSec; /**< GPS time leap second delta to UTC time \n - Units: sec \n @@ -1093,7 +1098,7 @@ typedef enum typedef struct { - size_t size; + uint32_t size; uint32_t validMask; /* Validity mask as per Gnss_LocInterSystemBiasValidMaskType */ @@ -1110,7 +1115,7 @@ typedef struct typedef struct { - size_t size; + uint32_t size; uint8_t systemRtc_valid; /**< Validity indicator for System RTC */ @@ -1156,7 +1161,7 @@ typedef enum typedef struct { - size_t size; + uint32_t size; uint32_t svMs; /**< Satellite time milisecond.\n For GPS, BDS, GAL range of 0 thru (604800000-1) \n @@ -1216,7 +1221,7 @@ typedef enum typedef struct { - size_t size; + uint32_t size; Gnss_LocSvSystemEnumType gnssSystem; // 0 signal type mask indicates invalid value GnssSignalTypeMask gnssSignalTypeMask; @@ -1389,7 +1394,7 @@ typedef uint64_t GpsSvMeasHeaderFlags; typedef struct { - size_t size; + uint32_t size; // see defines in GNSS_SV_MEAS_HEADER_HAS_XXX_XXX uint64_t flags; @@ -1433,7 +1438,7 @@ typedef struct } GnssSvMeasurementHeader; typedef struct { - size_t size; + uint32_t size; bool isNhz; GnssSvMeasurementHeader svMeasSetHeader; uint32_t svMeasCount; @@ -1473,7 +1478,7 @@ typedef enum typedef struct { - size_t size; + uint32_t size; uint16_t gnssSvId; /* GPS: 1-32, GLO: 65-96, 0: Invalid, SBAS: 120-151, BDS:201-237,GAL:301 to 336 @@ -2034,7 +2039,7 @@ typedef enum { typedef struct { - size_t size; + uint32_t size; Gnss_SrnTech srnTechType; /* SRN Technology type in request */ bool srnRequest; /* scan - start(true) or stop(false) */ bool e911Mode; /* If in E911 emergency */ @@ -2054,7 +2059,7 @@ typedef enum { /* This SV Type config is injected directly to GNSS Adapter * bypassing Location API */ typedef struct { - size_t size; // set to sizeof(GnssSvTypeConfig) + uint32_t size; // set to sizeof(GnssSvTypeConfig) // Enabled Constellations GnssSvTypesMask enabledSvTypesMask; // Disabled Constellations @@ -2141,7 +2146,7 @@ enum OdcpiRequestType { ODCPI_REQUEST_TYPE_STOP }; struct OdcpiRequestInfo { - size_t size; + uint32_t size; OdcpiRequestType type; uint32_t tbfMillis; bool isEmergencyMode; diff --git a/utils/loc_gps.h b/utils/loc_gps.h index b58f20b0..eae7383e 100644 --- a/utils/loc_gps.h +++ b/utils/loc_gps.h @@ -548,7 +548,7 @@ typedef uint8_t LocGnssConstellationType; /** Represents a location. */ typedef struct { /** set to sizeof(LocGpsLocation) */ - size_t size; + uint32_t size; /** Contains LocGpsLocationFlags bits. */ uint16_t flags; /** The spoof mask */ From 0677be4e4626d05880180f74bc97bbc357ff4663 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 6 Jun 2019 14:01:52 -0700 Subject: [PATCH 860/945] Removing LocIpc::createLocIpcQsock* APIs Qrtr and Qsock bot have createLocIpc*Sender and Recver APIs in LocIpc. But Qrtr is really next gen of Qsock. The two will not co-exist. Their existence depends on kernel versions, i.e. 4.9 and earlier is Qsock; while 4.14 and later is Qrtr. Having 2 sets of APIs doesn't make sense, as client would have to know what are the right ones to use, which there is really only one set of backing implementations. Change-Id: Ia473f282bb271ae213d7dc5020b0b8c7b0a8cb8f CRs-Fixed: 2466857 --- utils/LocIpc.cpp | 17 ++++------------- utils/LocIpc.h | 5 ----- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 94968956..646d2d4f 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -354,20 +354,11 @@ unique_ptr LocIpc::getLocIpcQrtrRecver(const shared_ptr (*creator_t)(const shared_ptr&, int, int); static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, +#ifdef USE_GLIB + "_ZN8loc_util22createLocIpcQrtrRecverERKSt10shared_ptrINS_15ILocIpcListenerEEii"); +#else "_ZN8loc_util22createLocIpcQrtrRecverERKNSt3__110shared_ptrINS_15ILocIpcListenerEEEii"); - return (nullptr == creator) ? nullptr : creator(listener, service, instance); -} -shared_ptr LocIpc::getLocIpcQsockSender(int service, int instance) { - typedef shared_ptr (*creator_t) (int, int); - static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, - "_ZN8loc_util23createLocIpcQsockSenderEii"); - return (nullptr == creator) ? nullptr : creator(service, instance); -} -unique_ptr LocIpc::getLocIpcQsockRecver(const shared_ptr& listener, - int service, int instance) { - typedef unique_ptr (*creator_t)(const shared_ptr&, int, int); - static creator_t creator = (creator_t)dlGetSymFromLib(sLibQrtrHandle, sLibQrtrName, - "_ZN8loc_util23createLocIpcQsockRecverERKSt10shared_ptrINS_15ILocIpcListenerEEii"); +#endif return (nullptr == creator) ? nullptr : creator(listener, service, instance); } shared_ptr LocIpc::getLocIpcInetTcpSender(const char* serverName, int32_t port) { diff --git a/utils/LocIpc.h b/utils/LocIpc.h index c71c4e01..b91966cb 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -70,8 +70,6 @@ public: getLocIpcInetTcpSender(const char* serverName, int32_t port); static shared_ptr getLocIpcQrtrSender(int service, int instance); - static shared_ptr - getLocIpcQsockSender(int service, int instance); static unique_ptr getLocIpcLocalRecver(const shared_ptr& listener, @@ -82,9 +80,6 @@ public: static unique_ptr getLocIpcQrtrRecver(const shared_ptr& listener, int service, int instance); - static unique_ptr - getLocIpcQsockRecver(const shared_ptr& listener, - int service, int instance); static pair, unique_ptr> getLocIpcQmiLocServiceSenderRecverPair(const shared_ptr& listener, From 64514a57344208890eea76e10c460e9457fb2730 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Mon, 10 Jun 2019 13:48:15 -0700 Subject: [PATCH 861/945] SV used in fix satellites are not updated for B2A-Q Change-Id: If9d6f4ff694572f22b95b3ccb6015ebcb6310ffa CRs-fixed: 2468528 --- gnss/GnssAdapter.cpp | 3 +++ location/LocationDataTypes.h | 9 ++++++--- utils/gps_extended_c.h | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8e1bf5f8..4d329d87 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3332,6 +3332,9 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SIGNAL_BEIDOU_B2AI: svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b2ai_sv_used_ids_mask; break; + case GNSS_SIGNAL_BEIDOU_B2AQ: + svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b2aq_sv_used_ids_mask; + break; } } else { svUsedIdMask = mGnssSvIdUsedInPosition.bds_sv_used_ids_mask; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index d6abda2e..4571a88b 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -583,7 +583,9 @@ typedef enum { /** SBAS L1 RF Band */ GNSS_SIGNAL_SBAS_L1 = (1<<17), /** NAVIC L5 RF Band */ - GNSS_SIGNAL_NAVIC_L5 = (1<<18) + GNSS_SIGNAL_NAVIC_L5 = (1<<18), + /** BEIDOU B2A_Q RF Band */ + GNSS_SIGNAL_BEIDOU_B2AQ = (1<<19) } GnssSignalTypeBits; #define GNSS_SIGNAL_TYPE_MASK_ALL\ @@ -593,7 +595,7 @@ typedef enum { GNSS_SIGNAL_BEIDOU_B1I | GNSS_SIGNAL_BEIDOU_B1C | GNSS_SIGNAL_BEIDOU_B2I|\ GNSS_SIGNAL_BEIDOU_B2AI | GNSS_SIGNAL_QZSS_L1CA | GNSS_SIGNAL_QZSS_L1S |\ GNSS_SIGNAL_QZSS_L2| GNSS_SIGNAL_QZSS_L5 | GNSS_SIGNAL_SBAS_L1 |\ - GNSS_SIGNAL_NAVIC_L5) + GNSS_SIGNAL_NAVIC_L5) | GNSS_SIGNAL_BEIDOU_B2AQ typedef enum { @@ -635,7 +637,8 @@ typedef enum { GNSS_LOC_SIGNAL_TYPE_QZSS_L5_Q = 16, /**< QZSS L5_Q RF Band */ GNSS_LOC_SIGNAL_TYPE_SBAS_L1_CA = 17, /**< SBAS L1_CA RF Band */ GNSS_LOC_SIGNAL_TYPE_NAVIC_L5 = 18, /**< NAVIC L5 RF Band */ - GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 19 /**< Maximum number of signal types */ + GNSS_LOC_SIGNAL_TYPE_BEIDOU_B2A_Q = 19, /**< BEIDOU B2A_Q RF Band */ + GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 20 /**< Maximum number of signal types */ } Gnss_LocSignalEnumType; typedef uint64_t GnssDataMask; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 9f4c13c3..7fce3d7c 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -492,6 +492,7 @@ typedef struct { uint64_t qzss_l2_sv_used_ids_mask; // QZSS L2 uint64_t qzss_l5_sv_used_ids_mask; // QZSS L5 uint64_t sbas_l1_sv_used_ids_mask; // SBAS L1 + uint64_t bds_b2aq_sv_used_ids_mask; // BDS B2AQ } GnssSvMbUsedInPosition; /* Body Frame parameters */ @@ -600,6 +601,8 @@ typedef uint32_t GnssSignalTypeMask; #define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00020000ul) /** NAVIC L5 RF Band */ #define GNSS_SIGNAL_NAVIC_L5 ((GnssSignalTypeMask)0x00040000ul) +/** BEIDOU B2A_Q RF Band */ +#define GNSS_SIGNAL_BEIDOU_B2AQ ((GnssSignalTypeMask)0x00080000ul) typedef uint16_t GnssMeasUsageStatusBitMask; /** Used in fix */ From de13fc3868bbaa8b136ba0760145aef639bf5bd5 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Wed, 12 Jun 2019 12:09:18 -0700 Subject: [PATCH 862/945] Gnss adapter: do not send out empty sv measurement to Android Do not send out empty sv measurement to Android Change-Id: I4ab807d647be8b44f3f48a3ad5e5ca7f33ac2485 CRs-fixed: 2439716 --- gnss/GnssAdapter.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 16d5f9db..c50eeb9d 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3769,26 +3769,28 @@ GnssAdapter::reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurement { LOC_LOGD("%s]: msInWeek=%d", __func__, msInWeek); - struct MsgReportGnssMeasurementData : public LocMsg { - GnssAdapter& mAdapter; - GnssMeasurements mGnssMeasurements; - GnssMeasurementsNotification mMeasurementsNotify; - inline MsgReportGnssMeasurementData(GnssAdapter& adapter, - const GnssMeasurements& gnssMeasurements, - int msInWeek) : - LocMsg(), - mAdapter(adapter), - mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) { - if (-1 != msInWeek) { - mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek); + if (0 != gnssMeasurements.gnssMeasNotification.count) { + struct MsgReportGnssMeasurementData : public LocMsg { + GnssAdapter& mAdapter; + GnssMeasurements mGnssMeasurements; + GnssMeasurementsNotification mMeasurementsNotify; + inline MsgReportGnssMeasurementData(GnssAdapter& adapter, + const GnssMeasurements& gnssMeasurements, + int msInWeek) : + LocMsg(), + mAdapter(adapter), + mMeasurementsNotify(gnssMeasurements.gnssMeasNotification) { + if (-1 != msInWeek) { + mAdapter.getAgcInformation(mMeasurementsNotify, msInWeek); + } } - } - inline virtual void proc() const { - mAdapter.reportGnssMeasurementData(mMeasurementsNotify); - } - }; + inline virtual void proc() const { + mAdapter.reportGnssMeasurementData(mMeasurementsNotify); + } + }; - sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek)); + sendMsg(new MsgReportGnssMeasurementData(*this, gnssMeasurements, msInWeek)); + } mEngHubProxy->gnssReportSvMeasurement(gnssMeasurements.gnssSvMeasurementSet); } From 061857b0799db463d6f0e038d4cb8c59a4124bb5 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 10 Jun 2019 10:10:53 -0700 Subject: [PATCH 863/945] GnssLocationInfoNotification: move basic location info to top Move basic location info to top so if a new field is added to GnssLocationInfoNotification, it will not impact the basic location info. Change-Id: I362ee0f6f09c10e3df64ed6993b73a256690c38d CRs-fixed: 2468348 --- location/LocationDataTypes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index d6abda2e..fa0b714b 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -938,7 +938,8 @@ typedef struct { } GnssSystemTime; typedef struct { - uint32_t size; // set to sizeof(GnssLocationInfo) + uint32_t size; // set to sizeof(GnssLocationInfo) + Location location; // basic locaiton info, latitude, longitude, and etc GnssLocationInfoFlagMask flags; // bitwise OR of GnssLocationInfoBits for param validity float altitudeMeanSeaLevel; // altitude wrt mean sea level float pdop; // position dilusion of precision @@ -971,7 +972,6 @@ typedef struct { GnssMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; // GNSS Measurement Usage info uint8_t leapSeconds; // leap second float timeUncMs; // Time uncertainty in milliseconds - Location location; } GnssLocationInfoNotification; typedef struct { From 61fd929fb6f9466b02706f9af0c4b36f3e16a2d6 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 3 Apr 2019 18:12:52 -0700 Subject: [PATCH 864/945] Redesign Inet sender and receiver Redesign the inet sender and receiver to be able to accomodate udp and tcp types into one base class. CRs-Fixed: 2429102 Change-Id: Ie138839a5c8842813c99053816e06e4ed7f6b314 --- utils/LocIpc.cpp | 103 ++++++++++++++++++++++++++++++++++------------- utils/LocIpc.h | 5 +++ 2 files changed, 81 insertions(+), 27 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index 646d2d4f..e8578174 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -164,7 +164,8 @@ public: umask(0157); if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { - LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); + LOC_LOGe("bind socket error. sock fd: %d: %s, reason: %s", mSock->mSid, + mAddr.sun_path, strerror(errno)); mSock->close(); } } @@ -177,26 +178,22 @@ public: } }; -class LocIpcInetTcpSender : public LocIpcSender { +class LocIpcInetSender : public LocIpcSender { protected: + int mSockType; shared_ptr mSock; const string mName; sockaddr_in mAddr; - mutable bool mFirstTime; inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } - inline virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t /* msgId */) const { - if (mFirstTime) { - mFirstTime = false; - ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); - } + virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t /* msgId */) const { return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); } public: - inline LocIpcInetTcpSender(const char* name, int32_t port) : LocIpcSender(), - mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_INET, SOCK_STREAM, 0)))), + inline LocIpcInetSender(const char* name, int32_t port, int sockType) : LocIpcSender(), + mSockType(sockType), + mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_INET, mSockType, 0)))), mName((nullptr == name) ? "" : name), - mAddr({.sin_family=AF_INET, .sin_port=htons(port), .sin_addr={htonl(INADDR_ANY)}}), - mFirstTime(true) { + mAddr({.sin_family=AF_INET, .sin_port=htons(port), .sin_addr={htonl(INADDR_ANY)}}) { if (mSock != nullptr && mSock->isValid() && nullptr != name) { struct hostent* hp = gethostbyname(name); if (nullptr != hp) { @@ -206,7 +203,47 @@ public: } }; -class LocIpcInetTcpRecver : public LocIpcInetTcpSender, public LocIpcRecver { +class LocIpcInetTcpSender : public LocIpcInetSender { +protected: + mutable bool mFirstTime; + + virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t /* msgId */) const { + if (mFirstTime) { + mFirstTime = false; + ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); + } + return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } + +public: + inline LocIpcInetTcpSender(const char* name, int32_t port) : + LocIpcInetSender(name, port, SOCK_STREAM), + mFirstTime(true) {} +}; + +class LocIpcInetRecver : public LocIpcInetSender, public LocIpcRecver { +protected: + virtual ssize_t recv() const = 0; +public: + inline LocIpcInetRecver(const shared_ptr& listener, const char* name, + int32_t port, int sockType) : + LocIpcInetSender(name, port, sockType), LocIpcRecver(listener, *this) { + if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { + LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); + mSock->close(); + } + } + inline virtual ~LocIpcInetRecver() {} + inline virtual const char* getName() const override { return mName.data(); }; + inline virtual void abort() const override { + if (isSendable()) { + mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + } + } + +}; + +class LocIpcInetTcpRecver : public LocIpcInetRecver { mutable int32_t mConnFd; protected: inline virtual ssize_t recv() const override { @@ -223,21 +260,26 @@ protected: public: inline LocIpcInetTcpRecver(const shared_ptr& listener, const char* name, int32_t port) : - LocIpcInetTcpSender(name, port), LocIpcRecver(listener, *this), mConnFd(-1) { - if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { - LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); - mSock->close(); - } - } - inline virtual ~LocIpcInetTcpRecver() { if (-1 != mConnFd) ::close(mConnFd); } - inline virtual const char* getName() const override { return mName.data(); }; - inline virtual void abort() const override { - if (isSendable()) { - mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); - } - } + LocIpcInetRecver(listener, name, port, SOCK_STREAM), mConnFd(-1) {} + inline virtual ~LocIpcInetTcpRecver() { if (-1 != mConnFd) ::close(mConnFd);} }; +class LocIpcInetUdpRecver : public LocIpcInetRecver { +protected: + inline virtual ssize_t recv() const override { + socklen_t size = sizeof(mAddr); + return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); + } +public: + inline LocIpcInetUdpRecver(const shared_ptr& listener, const char* name, + int32_t port) : + LocIpcInetRecver(listener, name, port, SOCK_DGRAM) {} + + inline virtual ~LocIpcInetUdpRecver() {} +}; + + + #ifdef NOT_DEFINED class LocIpcQcsiSender : public LocIpcSender { protected: @@ -365,9 +407,16 @@ shared_ptr LocIpc::getLocIpcInetTcpSender(const char* serverName, return make_shared(serverName, port); } unique_ptr LocIpc::getLocIpcInetTcpRecver(const shared_ptr& listener, - const char* serverName, int32_t port) { + const char* serverName, int32_t port) { return make_unique(listener, serverName, port); } +shared_ptr LocIpc::getLocIpcInetUdpSender(const char* serverName, int32_t port) { + return make_shared(serverName, port, SOCK_DGRAM); +} +unique_ptr LocIpc::getLocIpcInetUdpRecver(const shared_ptr& listener, + const char* serverName, int32_t port) { + return make_unique(listener, serverName, port); +} pair, unique_ptr> LocIpc::getLocIpcQmiLocServiceSenderRecverPair(const shared_ptr& listener, int instance) { typedef pair, unique_ptr> (*creator_t)(const shared_ptr&, int); diff --git a/utils/LocIpc.h b/utils/LocIpc.h index b91966cb..42fbff31 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -66,6 +66,8 @@ public: static shared_ptr getLocIpcLocalSender(const char* localSockName); + static shared_ptr + getLocIpcInetUdpSender(const char* serverName, int32_t port); static shared_ptr getLocIpcInetTcpSender(const char* serverName, int32_t port); static shared_ptr @@ -74,6 +76,9 @@ public: static unique_ptr getLocIpcLocalRecver(const shared_ptr& listener, const char* localSockName); + static unique_ptr + getLocIpcInetUdpRecver(const shared_ptr& listener, + const char* serverName, int32_t port); static unique_ptr getLocIpcInetTcpRecver(const shared_ptr& listener, const char* serverName, int32_t port); From ff98fecec453ceac6d7f665c5a746352a41aaecd Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Tue, 4 Jun 2019 12:09:01 +0530 Subject: [PATCH 865/945] AP Default Setting CRM Builds SM8250 and Beyond loc_service_mask should not be populated with any SAP(Basic or Premium) value if the SAP value is MODEM_DEFAULT. Change-Id: I665bb90e4a814dc31bed566cc0b2ecffcfae52ac CRs-Fixed: 2457874 --- utils/loc_cfg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index de887eec..55e4804e 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -622,6 +622,9 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p LOC_LOGD("%s:%d]: Setting SAP to mode: BASIC", __func__, __LINE__); loc_service_mask |= LOC_FEATURE_MASK_SAP_BASIC; } + else if(strcmp(conf.feature_sap, "MODEM_DEFAULT") == 0) { + LOC_LOGD("%s:%d]: Setting SAP to mode: MODEM_DEFAULT", __func__, __LINE__); + } else if(strcmp(conf.feature_sap, "DISABLED") == 0) { LOC_LOGD("%s:%d]: Setting SAP to mode: DISABLED", __func__, __LINE__); } From c3d1f8fb94442219916afd648df478d4579bdfe6 Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Wed, 29 May 2019 15:45:08 +0800 Subject: [PATCH 866/945] fix nmea GSV/GNS/GSA issues 1. remove blank GSV sentences 2. modify GNS mode indicator field 3. modify GSA mode field, remove blank sentence Change-Id: Ibe196328938e2674f0100224209cef0b229328e1 CRs-Fixed: 2460129 --- utils/loc_nmea.cpp | 170 ++++++++++++++++++++++++++++++++------------- 1 file changed, 123 insertions(+), 47 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index abcf5b73..92ff8eab 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -36,6 +36,7 @@ #include #define GLONASS_SV_ID_OFFSET 64 +#define MAX_SV_COUNT_SUPPORTED_IN_ONE_CONSTELLATION 64 #define MAX_SATELLITES_IN_USE 12 #define MSEC_IN_ONE_WEEK 604800000ULL #define UTC_GPS_OFFSET_MSECS 315964800000ULL @@ -109,8 +110,9 @@ typedef struct loc_nmea_sv_meta_s { char talker[3]; LocGnssConstellationType svType; - uint32_t mask; + uint64_t mask; uint32_t svCount; + uint32_t totalSvUsedCount; uint32_t svIdOffset; uint32_t signalId; uint32_t systemId; @@ -118,12 +120,12 @@ typedef struct loc_nmea_sv_meta_s typedef struct loc_sv_cache_info_s { - uint32_t gps_used_mask; - uint32_t glo_used_mask; - uint32_t gal_used_mask; - uint32_t qzss_used_mask; - uint32_t bds_used_mask; - uint32_t navic_used_mask; + uint64_t gps_used_mask; + uint64_t glo_used_mask; + uint64_t gal_used_mask; + uint64_t qzss_used_mask; + uint64_t bds_used_mask; + uint64_t navic_used_mask; uint32_t gps_l1_count; uint32_t gps_l5_count; uint32_t glo_g1_count; @@ -337,6 +339,39 @@ static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) } +/*=========================================================================== +FUNCTION get_sv_count_from_mask + +DESCRIPTION + get the sv count from bit mask + +DEPENDENCIES + NONE + +RETURN VALUE + value of sv count + +SIDE EFFECTS + N/A + +===========================================================================*/ +static uint32_t get_sv_count_from_mask(uint64_t svMask, int totalSvCount) +{ + int index = 0; + uint32_t svCount = 0; + + if(totalSvCount > MAX_SV_COUNT_SUPPORTED_IN_ONE_CONSTELLATION) { + LOC_LOGE("total SV count in this constellation %d exceeded limit %d", + totalSvCount, MAX_SV_COUNT_SUPPORTED_IN_ONE_CONSTELLATION); + } + for(index = 0; index < totalSvCount; index++) { + if(svMask & 0x1) + svCount += 1; + svMask >>= 1; + } + return svCount; +} + /*=========================================================================== FUNCTION loc_nmea_sv_meta_init @@ -438,6 +473,19 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, return NULL; } sv_meta.signalId = convert_signalType_to_signalId(signalType); + sv_meta.totalSvUsedCount = + get_sv_count_from_mask(sv_cache_info.gps_used_mask, + GPS_SV_PRN_MAX - GPS_SV_PRN_MIN + 1) + + get_sv_count_from_mask(sv_cache_info.glo_used_mask, + GLO_SV_PRN_MAX - GLO_SV_PRN_MIN + 1) + + get_sv_count_from_mask(sv_cache_info.gal_used_mask, + GAL_SV_PRN_MAX - GAL_SV_PRN_MIN + 1) + + get_sv_count_from_mask(sv_cache_info.qzss_used_mask, + QZSS_SV_PRN_MAX - QZSS_SV_PRN_MIN + 1) + + get_sv_count_from_mask(sv_cache_info.bds_used_mask, + BDS_SV_PRN_MAX - BDS_SV_PRN_MIN + 1) + + get_sv_count_from_mask(sv_cache_info.navic_used_mask, + NAVIC_SV_PRN_MAX - NAVIC_SV_PRN_MIN + 1); if (needCombine && (sv_cache_info.gps_used_mask ? 1 : 0) + (sv_cache_info.glo_used_mask ? 1 : 0) + @@ -532,27 +580,27 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende int length = 0; uint32_t svUsedCount = 0; - uint32_t svUsedList[32] = {0}; + uint32_t svUsedList[64] = {0}; char fixType = '\0'; const char* talker = sv_meta_p->talker; uint32_t svIdOffset = sv_meta_p->svIdOffset; - uint32_t mask = sv_meta_p->mask; + uint64_t mask = sv_meta_p->mask; - for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) + for (uint8_t i = 1; mask > 0 && svUsedCount < 64; i++) { if (mask & 1) svUsedList[svUsedCount++] = i + svIdOffset; mask = mask >> 1; } - if (svUsedCount == 0 && GNSS_SV_TYPE_GPS != sv_meta_p->svType) + if (svUsedCount == 0) return 0; - if (svUsedCount == 0) + if (sv_meta_p->totalSvUsedCount == 0) fixType = '1'; // no fix - else if (svUsedCount <= 3) + else if (sv_meta_p->totalSvUsedCount <= 3) fixType = '2'; // 2D fix else fixType = '3'; // 3D fix @@ -665,10 +713,7 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, int svCount = sv_meta_p->svCount; if (svCount <= 0) { - // no svs in view, so just send a blank $--GSV sentence - snprintf(sentence, lengthRemaining, "$%sGSV,1,1,0,%X", talker, sv_meta_p->signalId); - length = loc_nmea_put_checksum(sentence, bufSize); - nmeaArraystr.push_back(sentence); + LOC_LOGV("No SV in view for talker ID:%s, signal ID:%X", talker, sv_meta_p->signalId); return; } @@ -1035,19 +1080,22 @@ void loc_nmea_generate_pos(const UlpLocation &location, if (GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA & locationExtended.flags) { sv_cache_info.gps_used_mask = - (uint32_t)locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask; + locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask; sv_cache_info.glo_used_mask = - (uint32_t)locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask; + locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask; sv_cache_info.gal_used_mask = - (uint32_t)locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask; - sv_cache_info.qzss_used_mask = - (uint32_t)locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; + locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask; sv_cache_info.bds_used_mask = - (uint32_t)locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask; + sv_cache_info.qzss_used_mask = + locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask; + sv_cache_info.navic_used_mask = + locationExtended.gnss_sv_used_ids.navic_sv_used_ids_mask; } if (generate_nmea) { char talker[3] = {'G', 'P', '\0'}; + char modeIndicator[7] = {0}; uint32_t svUsedCount = 0; uint32_t count = 0; loc_nmea_sv_meta sv_meta; @@ -1093,13 +1141,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } - // -------------------------- - // ---$PQGSA/$GNGSA (QZSS)--- - // -------------------------- - + // ---------------------------- + // ---$GBGSA/$GNGSA (BEIDOU)--- + // ---------------------------- count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, - GNSS_SIGNAL_QZSS_L1CA, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, + GNSS_SIGNAL_BEIDOU_B1I, true), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -1107,12 +1154,13 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } - // ---------------------------- - // ---$PQGSA/$GNGSA (BEIDOU)--- - // ---------------------------- + // -------------------------- + // ---$GQGSA/$GNGSA (QZSS)--- + // -------------------------- + count = loc_nmea_generate_GSA(locationExtended, sentence, sizeof(sentence), - loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, - GNSS_SIGNAL_BEIDOU_B1I, true), nmeaArraystr); + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_QZSS, + GNSS_SIGNAL_QZSS_L1CA, true), nmeaArraystr); if (count > 0) { svUsedCount += count; @@ -1461,17 +1509,49 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker += length; lengthRemaining -= length; - if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) - // N means no fix - length = snprintf(pMarker, lengthRemaining, "%c,", 'N'); + if(!(sv_cache_info.gps_used_mask ? 1 : 0)) + modeIndicator[0] = 'N'; else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) - // D means differential - length = snprintf(pMarker, lengthRemaining, "%c,", 'D'); + modeIndicator[0] = 'D'; else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) - // E means estimated (dead reckoning) - length = snprintf(pMarker, lengthRemaining, "%c,", 'E'); - else // A means autonomous - length = snprintf(pMarker, lengthRemaining, "%c,", 'A'); + modeIndicator[0] = 'E'; + else + modeIndicator[0] = 'A'; + if(!(sv_cache_info.glo_used_mask ? 1 : 0)) + modeIndicator[1] = 'N'; + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + modeIndicator[1] = 'E'; + else + modeIndicator[1] = 'A'; + if(!(sv_cache_info.gal_used_mask ? 1 : 0)) + modeIndicator[2] = 'N'; + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + modeIndicator[2] = 'E'; + else + modeIndicator[2] = 'A'; + if(!(sv_cache_info.bds_used_mask ? 1 : 0)) + modeIndicator[3] = 'N'; + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + modeIndicator[3] = 'E'; + else + modeIndicator[3] = 'A'; + if(!(sv_cache_info.qzss_used_mask ? 1 : 0)) + modeIndicator[4] = 'N'; + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + modeIndicator[4] = 'E'; + else + modeIndicator[4] = 'A'; + if(!(sv_cache_info.navic_used_mask ? 1 : 0)) + modeIndicator[5] = 'N'; + else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) + modeIndicator[5] = 'E'; + else + modeIndicator[5] = 'A'; + modeIndicator[6] = '\0'; + for(int index = 5; index > 0 && 'N' == modeIndicator[index]; index--) { + modeIndicator[index] = '\0'; + } + length = snprintf(pMarker, lengthRemaining,"%s,", modeIndicator); pMarker += length; lengthRemaining -= length; @@ -1687,10 +1767,6 @@ void loc_nmea_generate_pos(const UlpLocation &location, length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); - length = loc_nmea_put_checksum(sentence, sizeof(sentence)); - nmeaArraystr.push_back(sentence); - strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); From aadad658408d14d22533991cebfff2a278c94849 Mon Sep 17 00:00:00 2001 From: haohuang Date: Tue, 18 Jun 2019 18:10:43 +0800 Subject: [PATCH 867/945] Fix SV in use mask isn't correct for multiband SVs Fix the issue that SV in use mask isn't set correct in reportSv function in GnssAdapter.cpp. Change-Id: Ie90fc4b938875817b105745cf531ee8dc31e74bc CRs-Fixed: 2473868 --- gnss/GnssAdapter.cpp | 17 +++++++---------- gnss/GnssAdapter.h | 1 - 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7ef46e67..d1651487 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -97,8 +97,7 @@ GnssAdapter::GnssAdapter() : mPowerStateCb(nullptr), mIsE911Session(NULL), mGnssMbSvIdUsedInPosition{}, - mGnssMbSvIdUsedInPosAvail(false), - mGnssSignalType() + mGnssMbSvIdUsedInPosAvail(false) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -3196,9 +3195,6 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MULTIBAND) { mGnssMbSvIdUsedInPosAvail = true; mGnssMbSvIdUsedInPosition = locationExtended.gnss_mb_sv_used_ids; - for (int i = 0; i < GNSS_SV_MAX; i++) { - mGnssSignalType[i] = locationExtended.measUsageInfo[i].gnssSignalType; - } } } @@ -3267,11 +3263,12 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) for (int i=0; i < numSv; i++) { svUsedIdMask = 0; gnssSvId = svNotify.gnssSvs[i].svId; + GnssSignalTypeMask signalTypeMask = svNotify.gnssSvs[i].gnssSignalTypeMask; switch (svNotify.gnssSvs[i].type) { case GNSS_SV_TYPE_GPS: if (mGnssSvIdUsedInPosAvail) { if (mGnssMbSvIdUsedInPosAvail) { - switch (mGnssSignalType[i]) { + switch (signalTypeMask) { case GNSS_SIGNAL_GPS_L1CA: svUsedIdMask = mGnssMbSvIdUsedInPosition.gps_l1ca_sv_used_ids_mask; break; @@ -3293,7 +3290,7 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SV_TYPE_GLONASS: if (mGnssSvIdUsedInPosAvail) { if (mGnssMbSvIdUsedInPosAvail) { - switch (mGnssSignalType[i]) { + switch (signalTypeMask) { case GNSS_SIGNAL_GLONASS_G1: svUsedIdMask = mGnssMbSvIdUsedInPosition.glo_g1_sv_used_ids_mask; break; @@ -3309,7 +3306,7 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SV_TYPE_BEIDOU: if (mGnssSvIdUsedInPosAvail) { if (mGnssMbSvIdUsedInPosAvail) { - switch (mGnssSignalType[i]) { + switch (signalTypeMask) { case GNSS_SIGNAL_BEIDOU_B1I: svUsedIdMask = mGnssMbSvIdUsedInPosition.bds_b1i_sv_used_ids_mask; break; @@ -3334,7 +3331,7 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SV_TYPE_GALILEO: if (mGnssSvIdUsedInPosAvail) { if (mGnssMbSvIdUsedInPosAvail) { - switch (mGnssSignalType[i]) { + switch (signalTypeMask) { case GNSS_SIGNAL_GALILEO_E1: svUsedIdMask = mGnssMbSvIdUsedInPosition.gal_e1_sv_used_ids_mask; break; @@ -3353,7 +3350,7 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) case GNSS_SV_TYPE_QZSS: if (mGnssSvIdUsedInPosAvail) { if (mGnssMbSvIdUsedInPosAvail) { - switch (mGnssSignalType[i]) { + switch (signalTypeMask) { case GNSS_SIGNAL_QZSS_L1CA: svUsedIdMask = mGnssMbSvIdUsedInPosition.qzss_l1ca_sv_used_ids_mask; break; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1e6d1b8d..9a727a20 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -147,7 +147,6 @@ class GnssAdapter : public LocAdapterBase { bool mGnssSvIdUsedInPosAvail; GnssSvMbUsedInPosition mGnssMbSvIdUsedInPosition; bool mGnssMbSvIdUsedInPosAvail; - GnssSignalTypeMask mGnssSignalType[GNSS_SV_MAX]; /* ==== CONTROL ======================================================================== */ LocationControlCallbacks mControlCallbacks; From 90a01875dae528c7753133da485854e28814977c Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 18 Jun 2019 16:42:58 -0700 Subject: [PATCH 868/945] Add B2A-Q support in NMEA messages Change-Id: Ia58935df454e7bfffa91416159e5c9ba4fe1ac75 CRs-fixed: 2474222 --- utils/loc_nmea.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index abcf5b73..2363e95b 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -324,6 +324,7 @@ static uint32_t convert_signalType_to_signalId(GnssSignalTypeMask signalType) signalId = SIGNAL_ID_BDS_B2I; break; case GNSS_SIGNAL_BEIDOU_B2AI: + case GNSS_SIGNAL_BEIDOU_B2AQ: signalId = SIGNAL_ID_BDS_B2A; break; case GNSS_SIGNAL_NAVIC_L5: From 32801f1c0c42e2fd50cf24c36ad618ed6c9ef9ce Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 18 Jun 2019 17:11:03 -0700 Subject: [PATCH 869/945] Do not clear callbacks during gnss hidl cleanup() This allows HAL to request locations into AFW even when Location is disabled in Settings. Change-Id: I0c1d4fef55937f3094980dad29ff09d212f541fe CRs-fixed: 2475037 --- android/2.0/Gnss.cpp | 67 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index 4fa5b63a..af76b727 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -170,6 +170,23 @@ const GnssInterface* Gnss::getGnssInterface() { Return Gnss::setCallback(const sp& callback) { ENTRY_LOG_CALLFLOW(); + + // In case where previous call to setCallback_1_1 or setCallback_2_0, then + // we need to cleanup these interfaces/callbacks here since we no longer + // do so in cleanup() function to keep callbacks around after cleanup() + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks_2_0(nullptr); + } + if (mGnssCbIface_1_1 != nullptr) { + mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_1_1 = nullptr; + } + if (mGnssCbIface_2_0 != nullptr) { + mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_2_0 = nullptr; + } + + if (mGnssCbIface != nullptr) { mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); } @@ -291,21 +308,6 @@ Return Gnss::cleanup() { if (mApi != nullptr) { mApi->gnssStop(); mApi->gnssDisable(); - mApi->gnssUpdateCallbacks(nullptr, nullptr); - mApi->gnssUpdateCallbacks_2_0(nullptr); - } - mGnssNiCbIface = nullptr; - if (mGnssCbIface != nullptr) { - mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); - mGnssCbIface = nullptr; - } - if (mGnssCbIface_1_1 != nullptr) { - mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); - mGnssCbIface_1_1 = nullptr; - } - if (mGnssCbIface_2_0 != nullptr) { - mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); - mGnssCbIface_2_0 = nullptr; } return Void(); @@ -417,6 +419,23 @@ Return Gnss::setCallback_1_1(const sp& callback) { LOC_LOGE("%s] Error from gnssNameCb description=%s", __func__, r.description().c_str()); } + + // In case where previous call to setCallback or setCallback_2_1, then + // we need to cleanup these interfaces/callbacks here since we no longer + // do so in cleanup() function to keep callbacks around after cleanup() + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks_2_0(nullptr); + } + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface = nullptr; + } + if (mGnssCbIface_2_0 != nullptr) { + mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_2_0 = nullptr; + } + + if (mGnssCbIface_1_1 != nullptr) { mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); } @@ -497,6 +516,7 @@ void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { // For emergency mode, request DBH (Device based hybrid) location // Mark Independent from GNSS flag to false. if (ODCPI_REQUEST_TYPE_START == request.type) { + LOC_LOGd("gnssRequestLocationCb_2_0 isUserEmergency = %d", request.isEmergencyMode); auto r = mGnssCbIface_2_0->gnssRequestLocationCb_2_0(!request.isEmergencyMode, request.isEmergencyMode); if (!r.isOk()) { @@ -529,6 +549,23 @@ Return Gnss::setCallback_2_0(const sp& callback) { LOC_LOGE("%s] Error from gnssNameCb description=%s", __func__, r.description().c_str()); } + + // In case where previous call to setCallback or setCallback_1_1, then + // we need to cleanup these interfaces/callbacks here since we no longer + // do so in cleanup() function to keep callbacks around after cleanup() + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks(nullptr, nullptr); + } + mGnssNiCbIface = nullptr; + if (mGnssCbIface != nullptr) { + mGnssCbIface->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface = nullptr; + } + if (mGnssCbIface_1_1 != nullptr) { + mGnssCbIface_1_1->unlinkToDeath(mGnssDeathRecipient); + mGnssCbIface_1_1 = nullptr; + } + if (mGnssCbIface_2_0 != nullptr) { mGnssCbIface_2_0->unlinkToDeath(mGnssDeathRecipient); } From 49f7e15a816f9c4139ac3406374a608c2168f50b Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 19 Apr 2019 15:21:27 -0700 Subject: [PATCH 870/945] GnssAdapter: add support for ppe fix type and calibration info (1) Add support to report out calibration confidence in position report (2) Update gps quality of GGA, mode indicator for GMC and VTG NMEA sentences Change-Id: Ia1aa5283deffed6638172b90a41b481c2d199229 CRs-fixed: 2438838 --- gnss/GnssAdapter.cpp | 10 +++ location/LocationDataTypes.h | 28 ++++++- utils/gps_extended_c.h | 19 +++-- utils/loc_nmea.cpp | 147 +++++++++++++++++++++++++---------- 4 files changed, 155 insertions(+), 49 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7ef46e67..0f74e979 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -475,6 +475,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_TIME_UNC_BIT; out.timeUncMs = locationExtended.timeUncMs; } + + if (GPS_LOCATION_EXTENDED_HAS_CALIBRATION_CONFIDENCE & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_CALIBRATION_CONFIDENCE_BIT; + out.calibrationConfidence = locationExtended.calibrationConfidence; + } + + if (GPS_LOCATION_EXTENDED_HAS_CALIBRATION_STATUS & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT; + out.calibrationStatus = locationExtended.calibrationStatus; + } } diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 406a75cc..0d0753f8 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -172,8 +172,9 @@ typedef enum { GNSS_LOCATION_INFO_UP_VEL_UNC_BIT = (1<<21),// valid Up Velocity Uncertainty GNSS_LOCATION_INFO_LEAP_SECONDS_BIT = (1<<22),// valid leap seconds GNSS_LOCATION_INFO_TIME_UNC_BIT = (1<<23),// valid time uncertainty - GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT = (1<<24) // number of SV used in position - + GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT = (1<<24), // number of SV used in position + GNSS_LOCATION_INFO_CALIBRATION_CONFIDENCE_BIT = (1<<25), // valid sensor cal confidence + GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT = (1<<26), // valid sensor cal status } GnssLocationInfoFlagBits; typedef enum { @@ -601,6 +602,8 @@ typedef enum { GNSS_LOC_SV_SYSTEM_UNKNOWN = 0, /** unknown sv system. */ + GNSS_LOC_SV_SYSTEM_MIN = 1, + /**< Min enum of valid SV system. */ GNSS_LOC_SV_SYSTEM_GPS = 1, /**< GPS satellite. */ GNSS_LOC_SV_SYSTEM_GALILEO = 2, @@ -613,8 +616,10 @@ typedef enum /**< BDS satellite. */ GNSS_LOC_SV_SYSTEM_QZSS = 6, /**< QZSS satellite. */ - GNSS_LOC_SV_SYSTEM_NAVIC = 7 + GNSS_LOC_SV_SYSTEM_NAVIC = 7, /**< QZSS satellite. */ + GNSS_LOC_SV_SYSTEM_MAX = 7, + /**< Max enum of valid SV system. */ } Gnss_LocSvSystemEnumType; typedef enum { @@ -695,6 +700,20 @@ typedef struct { GnssAidingDataCommon common; // common aiding data } GnssAidingData; +typedef uint16_t DrCalibrationStatusMask; +typedef enum { + // Indicate that roll calibration is needed. Need to take more turns on level ground + DR_ROLL_CALIBRATION_NEEDED = (1<<0), + // Indicate that pitch calibration is needed. Need to take more turns on level ground + DR_PITCH_CALIBRATION_NEEDED = (1<<1), + // Indicate that yaw calibration is needed. Need to accelerate in a straight line + DR_YAW_CALIBRATION_NEEDED = (1<<2), + // Indicate that odo calibration is needed. Need to accelerate in a straight line + DR_ODO_CALIBRATION_NEEDED = (1<<3), + // Indicate that gyro calibration is needed. Need to take more turns on level ground + DR_GYRO_CALIBRATION_NEEDED = (1<<4) +} DrCalibrationStatusBits; + typedef struct { uint32_t size; // set to sizeof(Location) LocationFlagsMask flags; // bitwise OR of LocationFlagsBits to mark which params are valid @@ -975,6 +994,9 @@ typedef struct { GnssMeasUsageInfo measUsageInfo[GNSS_SV_MAX]; // GNSS Measurement Usage info uint8_t leapSeconds; // leap second float timeUncMs; // Time uncertainty in milliseconds + uint8_t calibrationConfidence; // Sensor calibration confidence percent, + // in range of [0, 100] + DrCalibrationStatusMask calibrationStatus; // Sensor calibration status } GnssLocationInfoNotification; typedef struct { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 1ccfc46f..d1a2811f 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -372,15 +372,19 @@ typedef uint64_t GpsLocationExtendedFlags; /** GpsLocationExtended has Clock drift*/ #define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT 0x20000000 /** GpsLocationExtended has Clock drift std deviation**/ -#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 +#define GPS_LOCATION_EXTENDED_HAS_CLOCK_DRIFT_STD_DEV 0x40000000 /** GpsLocationExtended has leap seconds **/ -#define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000 +#define GPS_LOCATION_EXTENDED_HAS_LEAP_SECONDS 0x80000000 /** GpsLocationExtended has time uncertainty **/ -#define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 +#define GPS_LOCATION_EXTENDED_HAS_TIME_UNC 0x100000000 /** GpsLocationExtended has heading rate **/ -#define GPS_LOCATION_EXTENDED_HAS_HEADING_RATE 0x200000000 +#define GPS_LOCATION_EXTENDED_HAS_HEADING_RATE 0x200000000 /** GpsLocationExtended has multiband signals **/ -#define GPS_LOCATION_EXTENDED_HAS_MULTIBAND 0x400000000 +#define GPS_LOCATION_EXTENDED_HAS_MULTIBAND 0x400000000 +/** GpsLocationExtended has sensor calibration confidence */ +#define GPS_LOCATION_EXTENDED_HAS_CALIBRATION_CONFIDENCE 0x800000000 +/** GpsLocationExtended has sensor calibration status */ +#define GPS_LOCATION_EXTENDED_HAS_CALIBRATION_STATUS 0x1000000000 typedef uint32_t LocNavSolutionMask; /* Bitmask to specify whether SBAS ionospheric correction is used */ @@ -397,6 +401,8 @@ typedef uint32_t LocNavSolutionMask; #define LOC_NAV_MASK_RTK_CORRECTION ((LocNavSolutionMask)0x0020) /**< Bitmask to specify whether Position Report is PPP corrected */ #define LOC_NAV_MASK_PPP_CORRECTION ((LocNavSolutionMask)0x0040) +/**< Bitmask to specify whether Position Report is RTK fixed corrected */ +#define LOC_NAV_MASK_RTK_FIXED_CORRECTION ((LocNavSolutionMask)0x0080) typedef uint32_t LocPosDataMask; /* Bitmask to specify whether Navigation data has Forward Acceleration */ @@ -792,6 +798,9 @@ typedef struct { Range: 0 to 359.999. 946 Unit: Degrees per Seconds */ float headingRateDeg; + /** Sensor calibration confidence percent. Range: 0 - 100 */ + uint8_t calibrationConfidence; + DrCalibrationStatusMask calibrationStatus; } GpsLocationExtended; enum loc_sess_status { diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index abcf5b73..12f6ca68 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -880,7 +880,7 @@ static void loc_nmea_generate_DTM(const LocLla &ref_lla, } /*=========================================================================== -FUNCTION getUtcTimeWithLeapSecondTransition +FUNCTION get_utctime_with_leapsecond_transition DESCRIPTION This function returns true if the position report is generated during @@ -900,10 +900,12 @@ SIDE EFFECTS N/A ===========================================================================*/ -bool getUtcTimeWithLeapSecondTransition(const UlpLocation &location, - const GpsLocationExtended &locationExtended, - const LocationSystemInfo &systemInfo, - LocGpsUtcTime &utcPosTimestamp) { +static bool get_utctime_with_leapsecond_transition( + const UlpLocation &location, + const GpsLocationExtended &locationExtended, + const LocationSystemInfo &systemInfo, + LocGpsUtcTime &utcPosTimestamp) +{ bool inTransition = false; // position report is not generated during leap second transition, @@ -952,6 +954,94 @@ bool getUtcTimeWithLeapSecondTransition(const UlpLocation &location, return inTransition; } +/*=========================================================================== +FUNCTION loc_nmea_get_fix_quality + +DESCRIPTION + This function obtains the fix quality for GGA sentence, mode indicator + for RMC and VTG sentence based on nav solution mask and tech mask in + the postion report. + +DEPENDENCIES + NONE + +Output parameter + ggaGpsQuality: gps quality field in GGA sentence + rmcModeIndicator: mode indicator field in RMC sentence + vtgModeIndicator: mode indicator field in VTG sentence + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_nmea_get_fix_quality(const UlpLocation & location, + const GpsLocationExtended & locationExtended, + char & ggaGpsQuality, + char & rmcModeIndicator, + char & vtgModeIndicator) { + + ggaGpsQuality = '0'; + rmcModeIndicator = 'N'; + vtgModeIndicator = 'N'; + + do { + if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)){ + ggaGpsQuality = '0'; // 0 means no fix + rmcModeIndicator = 'N'; + vtgModeIndicator = 'N'; + break; + } + // NOTE: Order of the check is important + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK) { + if (LOC_NAV_MASK_PPP_CORRECTION & locationExtended.navSolutionMask) { + ggaGpsQuality = '2'; // 2 means DGPS fix + rmcModeIndicator = 'P'; // P means precise + vtgModeIndicator = 'P'; // P means precise + break; + } else if (LOC_NAV_MASK_RTK_FIXED_CORRECTION & locationExtended.navSolutionMask){ + ggaGpsQuality = '4'; // 4 means RTK Fixed fix + rmcModeIndicator = 'R'; // use R (RTK fixed) + vtgModeIndicator = 'D'; // use D (differential) as + // no RTK fixed defined for VTG in NMEA 183 spec + break; + } else if (LOC_NAV_MASK_RTK_CORRECTION & locationExtended.navSolutionMask){ + ggaGpsQuality = '5'; // 5 means RTK float fix + rmcModeIndicator = 'F'; // F means RTK float fix + vtgModeIndicator = 'D'; // use D (differential) as + // no RTK float defined for VTG in NMEA 183 spec + break; + } else if (LOC_NAV_MASK_DGNSS_CORRECTION & locationExtended.navSolutionMask){ + ggaGpsQuality = '2'; // 2 means DGPS fix + rmcModeIndicator = 'D'; // D means differential + vtgModeIndicator = 'D'; // D means differential + break; + } else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask){ + ggaGpsQuality = '2'; // 2 means DGPS fix + rmcModeIndicator = 'D'; // D means differential + vtgModeIndicator = 'D'; // D means differential + break; + } + } + // NOTE: Order of the check is important + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK) { + if (LOC_POS_TECH_MASK_SATELLITE & locationExtended.tech_mask){ + ggaGpsQuality = '1'; // 1 means GPS + rmcModeIndicator = 'A'; // A means autonomous + vtgModeIndicator = 'A'; // A means autonomous + break; + } else if (LOC_POS_TECH_MASK_SENSORS & locationExtended.tech_mask){ + ggaGpsQuality = '6'; // 6 means estimated (dead reckoning) + rmcModeIndicator = 'E'; // E means estimated (dead reckoning) + vtgModeIndicator = 'E'; // E means estimated (dead reckoning) + break; + } + } + } while (0); + + LOC_LOGv("gps quality: %c, rmc mode indicator: %c, vtg mode indicator: %c", + ggaGpsQuality, rmcModeIndicator, vtgModeIndicator); +} + /*=========================================================================== FUNCTION loc_nmea_generate_pos @@ -987,7 +1077,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, LocGpsUtcTime utcPosTimestamp = 0; bool inLsTransition = false; - inLsTransition = getUtcTimeWithLeapSecondTransition + inLsTransition = get_utctime_with_leapsecond_transition (location, locationExtended, systemInfo, utcPosTimestamp); time_t utcTime(utcPosTimestamp/1000); @@ -1120,6 +1210,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } + char ggaGpsQuality = '0'; + char rmcModeIndicator = 'N'; + char vtgModeIndicator = 'N'; + loc_nmea_get_fix_quality(location, locationExtended, + ggaGpsQuality, rmcModeIndicator, vtgModeIndicator); + // ------------------- // ------$--VTG------- // ------------------- @@ -1174,17 +1270,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker += length; lengthRemaining -= length; - if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) - // N means no fix - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); - else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) - // D means differential - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); - else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) - // E means estimated (dead reckoning) - length = snprintf(pMarker, lengthRemaining, "%c", 'E'); - else // A means autonomous - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); + length = snprintf(pMarker, lengthRemaining, "%c", vtgModeIndicator); length = loc_nmea_put_checksum(sentence, sizeof(sentence)); nmeaArraystr.push_back(sentence); @@ -1372,18 +1458,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker += length; lengthRemaining -= length; - if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) - // N means no fix - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); - else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) - // D means differential - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); - else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) - // E means estimated (dead reckoning) - length = snprintf(pMarker, lengthRemaining, "%c", 'E'); - else // A means autonomous - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); - + length = snprintf(pMarker, lengthRemaining, "%c", rmcModeIndicator); pMarker += length; lengthRemaining -= length; @@ -1600,28 +1675,18 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker += length; lengthRemaining -= length; - char gpsQuality; - if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)) - gpsQuality = '0'; // 0 means no fix - else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask) - gpsQuality = '2'; // 2 means DGPS fix - else if (LOC_POS_TECH_MASK_SENSORS == locationExtended.tech_mask) - gpsQuality = '6'; // 6 means estimated (dead reckoning) - else - gpsQuality = '1'; // 1 means GPS fix - // Number of satellites in use, 00-12 if (svUsedCount > MAX_SATELLITES_IN_USE) svUsedCount = MAX_SATELLITES_IN_USE; if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", - gpsQuality, svUsedCount, locationExtended.hdop); + ggaGpsQuality, svUsedCount, locationExtended.hdop); } else { // no hdop length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", - gpsQuality, svUsedCount); + ggaGpsQuality, svUsedCount); } if (length < 0 || length >= lengthRemaining) From acf2aeaec83e44e0310b3927e6dec2820b390c3c Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 19 Jun 2019 10:43:16 -0700 Subject: [PATCH 871/945] NV is not set to blank when SUPL_HOST is set to NONE Change-Id: Ib53e30dde614a9bee348a41083e177a5999dcfc1 CRs-fixed: 2473365 --- gnss/GnssAdapter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7ef46e67..5d5a0d51 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -659,7 +659,7 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) LOC_LOGe("Invalid type=%d", type); } else { string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl(); - if (length > 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) { + if (length >= 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) { url.assign(serverUrl); if (LOC_AGPS_SUPL_SERVER == type) { @@ -837,7 +837,7 @@ std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldS GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (gnssConfigNeedEngineUpdate.assistanceServer.type == GNSS_ASSISTANCE_TYPE_SUPL) { - if ((serverUrlLen != 0) && (oldServerUrl.compare(serverUrl) !=0)) { + if (0 != oldServerUrl.compare(serverUrl)) { err = mLocApi->setServerSync( serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); @@ -845,7 +845,7 @@ std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldS errsList[index] = err; } } - if ((moServerUrlLen != 0) && (oldMoServerUrl.compare(moServerUrl) != 0)) { + if (0 != oldMoServerUrl.compare(moServerUrl)) { LocationError locErr = mLocApi->setServerSync(moServerUrl.c_str(), moServerUrlLen, From 333e69585b2f89705fd68b1c2bfeb7981a383def Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Wed, 5 Jun 2019 15:29:31 -0700 Subject: [PATCH 872/945] Loc Ipc: add routine to notify sender that receiver has restarted When qrtr socket receiver has restarted, need a way to inform sender so sender can restart the service discovery process Change-Id: Id665da649e0962691277124b42f1ee9cc6160fa8 CRs-fixed: 2445555 --- utils/LocIpc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/LocIpc.h b/utils/LocIpc.h index 42fbff31..af4c2c3a 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -127,6 +127,7 @@ protected: virtual bool isOperable() const = 0; virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t msgId) const = 0; public: + virtual void informRecverRestarted() {} inline bool isSendable() const { return isOperable(); } inline bool sendData(const uint8_t data[], uint32_t length, int32_t msgId) const { return isSendable() && (send(data, length, msgId) > 0); From 90cbefa0170421a0b9675875e83ce86b8dea892e Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 14 Jun 2019 10:03:51 -0700 Subject: [PATCH 873/945] B2A-Q "in use" bit is not correctly set Change-Id: I101deb7dd449c64cc9924152d252f70fe332c2de CRs-fixed: 2472108 --- location/LocationDataTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 0d0753f8..49822fa5 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -596,7 +596,7 @@ typedef enum { GNSS_SIGNAL_BEIDOU_B1I | GNSS_SIGNAL_BEIDOU_B1C | GNSS_SIGNAL_BEIDOU_B2I|\ GNSS_SIGNAL_BEIDOU_B2AI | GNSS_SIGNAL_QZSS_L1CA | GNSS_SIGNAL_QZSS_L1S |\ GNSS_SIGNAL_QZSS_L2| GNSS_SIGNAL_QZSS_L5 | GNSS_SIGNAL_SBAS_L1 |\ - GNSS_SIGNAL_NAVIC_L5) | GNSS_SIGNAL_BEIDOU_B2AQ + GNSS_SIGNAL_NAVIC_L5 | GNSS_SIGNAL_BEIDOU_B2AQ) typedef enum { From 9fbe4b70ca79e045c26552991595c395555d0c7f Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 15 Apr 2019 15:39:37 -0700 Subject: [PATCH 874/945] Add validity bit and field for Glonass system RTC CRs-Fixed: 2447850 Change-Id: I45daa7c5415a897c12c107b9eb3e2451e43155b7 --- utils/gps_extended_c.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 1ccfc46f..5fca7260 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -1384,16 +1384,15 @@ typedef uint64_t GpsSvMeasHeaderFlags; #define GNSS_SV_MEAS_HEADER_HAS_GAL_SYSTEM_TIME_EXT 0x00008000 #define GNSS_SV_MEAS_HEADER_HAS_BDS_SYSTEM_TIME_EXT 0x00010000 #define GNSS_SV_MEAS_HEADER_HAS_QZSS_SYSTEM_TIME_EXT 0x00020000 -#define GNSS_SV_MEAS_HEADER_HAS_GPSL1L5_TIME_BIAS 0x00040000 -#define GNSS_SV_MEAS_HEADER_HAS_GALE1E5A_TIME_BIAS 0x00080000 -#define GNSS_SV_MEAS_HEADER_HAS_GPS_NAVIC_INTER_SYSTEM_BIAS 0x00100000 -#define GNSS_SV_MEAS_HEADER_HAS_GAL_NAVIC_INTER_SYSTEM_BIAS 0x00200000 -#define GNSS_SV_MEAS_HEADER_HAS_GLO_NAVIC_INTER_SYSTEM_BIAS 0x00400000 -#define GNSS_SV_MEAS_HEADER_HAS_BDS_NAVIC_INTER_SYSTEM_BIAS 0x00800000 -#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME 0x01000000 -#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME_EXT 0x02000000 - - +#define GNSS_SV_MEAS_HEADER_HAS_GLO_SYSTEM_TIME_EXT 0x00040000 +#define GNSS_SV_MEAS_HEADER_HAS_GPSL1L5_TIME_BIAS 0x00080000 +#define GNSS_SV_MEAS_HEADER_HAS_GALE1E5A_TIME_BIAS 0x00100000 +#define GNSS_SV_MEAS_HEADER_HAS_GPS_NAVIC_INTER_SYSTEM_BIAS 0x00200000 +#define GNSS_SV_MEAS_HEADER_HAS_GAL_NAVIC_INTER_SYSTEM_BIAS 0x00400000 +#define GNSS_SV_MEAS_HEADER_HAS_GLO_NAVIC_INTER_SYSTEM_BIAS 0x00800000 +#define GNSS_SV_MEAS_HEADER_HAS_BDS_NAVIC_INTER_SYSTEM_BIAS 0x01000000 +#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME 0x02000000 +#define GNSS_SV_MEAS_HEADER_HAS_NAVIC_SYSTEM_TIME_EXT 0x04000000 typedef struct { @@ -1435,9 +1434,10 @@ typedef struct Gnss_LocGnssTimeExtStructType bdsSystemTimeExt; /** QZSS system RTC time information. */ Gnss_LocGnssTimeExtStructType qzssSystemTimeExt; + /** GLONASS system RTC time information. */ + Gnss_LocGnssTimeExtStructType gloSystemTimeExt; /** NAVIC system RTC time information. */ Gnss_LocGnssTimeExtStructType navicSystemTimeExt; - } GnssSvMeasurementHeader; typedef struct { From 5f21e4fdef66129845322113ab98b33db420ca75 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Thu, 30 May 2019 16:33:04 -0700 Subject: [PATCH 875/945] Send abort msg explictly to loopback address To abort inet receiver thread, an abort message must be sent explictly to loopback address. For reciever to receive abort message it must be open to receive messages on INADDR_ANY and not just specific IP address. CRs-Fixed: 2462833 Change-Id: I9ab3266d582bc774655fcabfc086dab33010f7d8 --- utils/LocIpc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index e8578174..f4dd0b40 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -193,7 +193,8 @@ public: mSockType(sockType), mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_INET, mSockType, 0)))), mName((nullptr == name) ? "" : name), - mAddr({.sin_family=AF_INET, .sin_port=htons(port), .sin_addr={htonl(INADDR_ANY)}}) { + mAddr({.sin_family = AF_INET, .sin_port = htons(port), + .sin_addr = {htonl(INADDR_ANY)}}) { if (mSock != nullptr && mSock->isValid() && nullptr != name) { struct hostent* hp = gethostbyname(name); if (nullptr != hp) { @@ -222,12 +223,14 @@ public: }; class LocIpcInetRecver : public LocIpcInetSender, public LocIpcRecver { + int32_t mPort; protected: virtual ssize_t recv() const = 0; public: inline LocIpcInetRecver(const shared_ptr& listener, const char* name, int32_t port, int sockType) : - LocIpcInetSender(name, port, sockType), LocIpcRecver(listener, *this) { + LocIpcInetSender(name, port, sockType), LocIpcRecver(listener, *this), + mPort(port) { if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); mSock->close(); @@ -237,7 +240,9 @@ public: inline virtual const char* getName() const override { return mName.data(); }; inline virtual void abort() const override { if (isSendable()) { - mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); + sockaddr_in loopBackAddr = {.sin_family = AF_INET, .sin_port = htons(mPort), + .sin_addr = {htonl(INADDR_LOOPBACK)}}; + mSock->sendAbort(0, (struct sockaddr*)&loopBackAddr, sizeof(loopBackAddr)); } } From 18d9283e40353e7064f8e190e045e1d4d6bfe587 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 28 Jun 2019 12:49:52 +0800 Subject: [PATCH 876/945] Fix updateConnectionStatus call in gnss hidl 1.0/1 Change-Id: I4c3b66ec440c982714ccd7a3f6111319ad1601fb CRs-fixed: 2480731 --- android/1.0/AGnssRil.cpp | 2 +- android/1.1/AGnssRil.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/1.0/AGnssRil.cpp b/android/1.0/AGnssRil.cpp index 0ab4fadd..0437cf15 100644 --- a/android/1.0/AGnssRil.cpp +++ b/android/1.0/AGnssRil.cpp @@ -102,7 +102,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool } break; } - mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); + mGnss->getGnssInterface()->updateConnectionStatus(connected, false, typeout, 0); } return true; } diff --git a/android/1.1/AGnssRil.cpp b/android/1.1/AGnssRil.cpp index 96e3597a..1e774f1a 100644 --- a/android/1.1/AGnssRil.cpp +++ b/android/1.1/AGnssRil.cpp @@ -102,7 +102,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool } break; } - mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); + mGnss->getGnssInterface()->updateConnectionStatus(connected, false, typeout, 0); } return true; } From 974fedbeaf4a75cfbf0d6f44df52077d15bb84b5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 3 Jul 2019 16:17:06 -0700 Subject: [PATCH 877/945] Remove support GNSS HIDL 1.1 for legacy devices Legacy devices are failing VTS Test for GNSS HIDL 1.1 because they do not support some of the features, like Black Listing and Power Modes, that are enforced through VTS testing. Removed declaration of 1.1 support in vendor manifest fragment to avoid the VTS test for GNSS HIDL 1.1 from running. Change-Id: Ife66490351ca54a5feaa7a369b519c9794254a5c CRs-fixed: 2484196 --- android/2.0/Android.mk | 4 +++ .../android.hardware.gnss@2.0-service-qti.xml | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 7c555042..83113a32 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -70,7 +70,11 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-service-qti +ifeq ($(GNSS_HIDL_LEGACY_MEASURMENTS),true) +LOCAL_VINTF_FRAGMENTS := legacy/android.hardware.gnss@2.0-service-qti.xml +else LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml +endif LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc diff --git a/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml b/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml new file mode 100644 index 00000000..64344f7a --- /dev/null +++ b/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml @@ -0,0 +1,36 @@ + + + + android.hardware.gnss + hwbinder + @1.0::IGnss/default + @2.0::IGnss/default + + + From 23e09131f98a17c7c6565af66e1322a6e1996c95 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 4 Jul 2019 10:45:57 +0800 Subject: [PATCH 878/945] Remove redundant LocPosTechMask definition Change-Id: I0de0413b31ff12def49f459f2d2993c354e99aa9 CRs-fixed: 2484085 --- utils/gps_extended_c.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 3d7eb971..3396b99c 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -449,17 +449,6 @@ typedef uint32_t GnssAdditionalSystemInfoMask; #define NAVIC_SV_PRN_MIN 401 #define NAVIC_SV_PRN_MAX 414 -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) - typedef enum { LOC_RELIABILITY_NOT_SET = 0, LOC_RELIABILITY_VERY_LOW = 1, From 18eb6db4863c47cbde432727f6ee8adb683eaa17 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Mon, 1 Jul 2019 10:52:36 +0800 Subject: [PATCH 879/945] Remove params duplicate check for DSDS issue Filtering duplicated updates causes issues to parameters that have multiple copies in the modem. Remove the check. Change-Id: I3e62bdee0f5d2a4dd005e3ab5a31f14109213d95 CRs-fixed: 2481714 --- gnss/GnssAdapter.cpp | 48 +++++++++----------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 8c65c826..9413def6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1088,12 +1088,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { uint32_t newSuplVersion = mAdapter.convertSuplVersion(gnssConfigRequested.suplVersion); - if (newSuplVersion != ContextBase::mGps_conf.SUPL_VER && - ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - ContextBase::mGps_conf.SUPL_VER = newSuplVersion; - } else { - gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT); - } + ContextBase::mGps_conf.SUPL_VER = newSuplVersion; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { @@ -1112,47 +1107,26 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { uint32_t newLppProfile = mAdapter.convertLppProfile(gnssConfigRequested.lppProfile); - if (newLppProfile != ContextBase::mGps_conf.LPP_PROFILE && - ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - ContextBase::mGps_conf.LPP_PROFILE = newLppProfile; - } else { - gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT); - } + ContextBase::mGps_conf.LPP_PROFILE = newLppProfile; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { uint32_t newLppeControlPlaneMask = - mAdapter.convertLppeCp(gnssConfigRequested.lppeControlPlaneMask); - if (newLppeControlPlaneMask != ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY) { - ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY = newLppeControlPlaneMask; - } else { - gnssConfigNeedEngineUpdate.flags &= - ~(GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT); - } + mAdapter.convertLppeCp(gnssConfigRequested.lppeControlPlaneMask); + ContextBase::mGps_conf.LPPE_CP_TECHNOLOGY = newLppeControlPlaneMask; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { uint32_t newLppeUserPlaneMask = - mAdapter.convertLppeUp(gnssConfigRequested.lppeUserPlaneMask); - if (newLppeUserPlaneMask != ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY) { - ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY = newLppeUserPlaneMask; - } else { - gnssConfigNeedEngineUpdate.flags &= - ~(GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT); - } + mAdapter.convertLppeUp(gnssConfigRequested.lppeUserPlaneMask); + ContextBase::mGps_conf.LPPE_UP_TECHNOLOGY = newLppeUserPlaneMask; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { uint32_t newAGloProtMask = - mAdapter.convertAGloProt(gnssConfigRequested.aGlonassPositionProtocolMask); - if (newAGloProtMask != ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT && - ContextBase::mGps_conf.AGPS_CONFIG_INJECT) { - ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = newAGloProtMask; - } else { - gnssConfigNeedEngineUpdate.flags &= - ~(GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT); - } + mAdapter.convertAGloProt(gnssConfigRequested.aGlonassPositionProtocolMask); + ContextBase::mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = newAGloProtMask; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { @@ -1173,10 +1147,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { uint32_t newSuplMode = mAdapter.convertSuplMode(gnssConfigRequested.suplModeMask); - if (newSuplMode != ContextBase::mGps_conf.SUPL_MODE) { - ContextBase::mGps_conf.SUPL_MODE = newSuplMode; - mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); - } + ContextBase::mGps_conf.SUPL_MODE = newSuplMode; + mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); index++; } From 14cba9c544680b527c753fcdb7be6903ee077077 Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Wed, 12 Jun 2019 09:38:08 +0530 Subject: [PATCH 880/945] Enable GTP_WAA feature CRs-Fixed: 2469727 Change-Id: Ib9d47e1a2778fd9ee574ff03290c59d7b2514087 --- utils/loc_cfg.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 55e4804e..9c1f0b35 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -467,6 +467,7 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta #define LOC_FEATURE_MASK_GTP_CELL_PREMIUM 0X08 #define LOC_FEATURE_MASK_SAP_BASIC 0x40 #define LOC_FEATURE_MASK_SAP_PREMIUM 0X80 +#define LOC_FEATURE_MASK_GTP_WAA_BASIC 0X100 #define LOC_FEATURE_MASK_GTP_MODEM_CELL_BASIC 0X400 #define LOC_FEATURE_MASK_ODCPI 0x1000 #define LOC_FEATURE_MASK_FREE_WIFI_SCAN_INJECT 0x2000 @@ -484,6 +485,7 @@ typedef struct { char baseband[LOC_MAX_PARAM_STRING]; unsigned int sglte_target; char feature_gtp_mode[LOC_MAX_PARAM_STRING]; + char feature_gtp_waa[LOC_MAX_PARAM_STRING]; char feature_sap[LOC_MAX_PARAM_STRING]; char feature_odcpi[LOC_MAX_PARAM_STRING]; char feature_free_wifi_scan_inject[LOC_MAX_PARAM_STRING]; @@ -504,6 +506,7 @@ static const loc_param_s_type gps_conf_parameter_table[] = { /* location feature conf, e.g.: izat.conf feature mode table*/ static const loc_param_s_type loc_feature_conf_table[] = { {"GTP_MODE", &conf.feature_gtp_mode, NULL, 's'}, + {"GTP_WAA", &conf.feature_gtp_waa, NULL, 's'}, {"SAP", &conf.feature_sap, NULL, 's'}, {"ODCPI", &conf.feature_odcpi, NULL, 's'}, {"FREE_WIFI_SCAN_INJECT", &conf.feature_free_wifi_scan_inject, NULL, 's'}, @@ -567,6 +570,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p char config_mask = 0; unsigned char proc_list_length=0; int gtp_cell_ap_enabled = 0; + char arg_gtp_waa[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_gtp_modem_cell[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_gtp_wifi[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; char arg_sap[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; @@ -582,6 +586,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p UTIL_READ_CONF(LOC_PATH_GPS_CONF, gps_conf_parameter_table); //Form argument strings + strlcat(arg_gtp_waa, LOC_FEATURE_GTP_WAA, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_gtp_modem_cell, LOC_FEATURE_GTP_MODEM_CELL, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_gtp_wifi, LOC_FEATURE_GTP_WIFI, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); strlcat(arg_sap, LOC_FEATURE_SAP, LOC_PROCESS_MAX_ARG_STR_LENGTH-3); @@ -612,6 +617,19 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p LOC_LOGE("%s:%d]: Unrecognized value for GTP MODE Mode."\ " Setting GTP WIFI to default mode: DISABLED", __func__, __LINE__); } + //Set service mask for GTP_WAA + if(strcmp(conf.feature_gtp_waa, "BASIC") == 0) { + LOC_LOGD("%s:%d]: Setting GTP WAA to mode: BASIC", __func__, __LINE__); + loc_service_mask |= LOC_FEATURE_MASK_GTP_WAA_BASIC; + } + else if(strcmp(conf.feature_gtp_waa, "DISABLED") == 0) { + LOC_LOGD("%s:%d]: GTP WAA DISABLED", __func__, __LINE__); + } + //conf file has a garbage value + else { + LOC_LOGE("%s:%d]: Unrecognized value for GTP WAA Mode."\ + " Setting GTP WAA to default mode: DISABLED", __func__, __LINE__); + } //Set service mask for SAP if(strcmp(conf.feature_sap, "PREMIUM") == 0) { @@ -957,6 +975,22 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p LOC_PROCESS_MAX_ARG_STR_LENGTH); } } + + if(conf.loc_feature_mask & LOC_FEATURE_MASK_GTP_WAA_BASIC) { + if(loc_service_mask & LOC_FEATURE_MASK_GTP_WAA_BASIC) { + strlcpy(child_proc[j].args[i++], arg_gtp_waa, + LOC_PROCESS_MAX_ARG_STR_LENGTH); + strlcpy(child_proc[j].args[i++], arg_basic, + LOC_PROCESS_MAX_ARG_STR_LENGTH); + } + else + { + strlcpy(child_proc[j].args[i++], arg_gtp_waa, + LOC_PROCESS_MAX_ARG_STR_LENGTH); + strlcpy(child_proc[j].args[i++], arg_disabled, + LOC_PROCESS_MAX_ARG_STR_LENGTH); + } + } IF_LOC_LOGD { LOC_LOGD("%s:%d]: %s args\n", __func__, __LINE__, child_proc[j].name[0]); for(unsigned int k=0; k Date: Mon, 8 Jul 2019 11:17:06 -0700 Subject: [PATCH 881/945] Add XSSO support for multiple network handles Add support in HAL for multiple network handles with same type. Change-Id: Idc9e6fc1c7876dc868264500d60a5d086ab003b0 CRs-Fixed: 2477395 --- android/2.0/AGnssRil.cpp | 30 ++++---- core/SystemStatus.h | 56 +++++++++++++- core/data-items/DataItemConcreteTypesBase.h | 84 ++++++++++++++++----- gnss/XtraSystemStatusObserver.cpp | 42 ++++++++--- gnss/XtraSystemStatusObserver.h | 5 +- utils/gps_extended_c.h | 3 +- 6 files changed, 168 insertions(+), 52 deletions(-) diff --git a/android/2.0/AGnssRil.cpp b/android/2.0/AGnssRil.cpp index 9de8b7d6..a477fc2f 100644 --- a/android/2.0/AGnssRil.cpp +++ b/android/2.0/AGnssRil.cpp @@ -57,29 +57,29 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool // for XTRA if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { - int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + int8_t typeout = loc_core::TYPE_UNKNOWN; switch(type) { case IAGnssRil::NetworkType::MOBILE: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + typeout = loc_core::TYPE_MOBILE; break; case IAGnssRil::NetworkType::WIFI: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + typeout = loc_core::TYPE_WIFI; break; case IAGnssRil::NetworkType::MMS: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS; + typeout = loc_core::TYPE_MMS; break; case IAGnssRil::NetworkType::SUPL: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL; + typeout = loc_core::TYPE_SUPL; break; case IAGnssRil::NetworkType::DUN: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN; + typeout = loc_core::TYPE_DUN; break; case IAGnssRil::NetworkType::HIPRI: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI; + typeout = loc_core::TYPE_HIPRI; break; case IAGnssRil::NetworkType::WIMAX: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; + typeout = loc_core::TYPE_WIMAX; break; default: { @@ -88,16 +88,16 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool switch(networkType) { case NetworkType_BLUETOOTH: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_BLUETOOTH; + typeout = loc_core::TYPE_BLUETOOTH; break; case NetworkType_ETHERNET: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_ETHERNET; + typeout = loc_core::TYPE_ETHERNET; break; case NetworkType_PROXY: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_PROXY; + typeout = loc_core::TYPE_PROXY; break; default: - typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + typeout = loc_core::TYPE_UNKNOWN; } } break; @@ -110,12 +110,12 @@ Return AGnssRil::updateNetworkState_2_0(const V2_0::IAGnssRil::NetworkAttr ENTRY_LOG_CALLFLOW(); if (nullptr != mGnss && (nullptr != mGnss->getGnssInterface())) { - int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; + int8_t typeout = loc_core::TYPE_UNKNOWN; bool roaming = false; if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_METERED) { - typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; + typeout = loc_core::TYPE_WIFI; } else { - typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; + typeout = loc_core::TYPE_MOBILE; } if (attributes.capabilities & IAGnssRil::NetworkCapability::NOT_ROAMING) { roaming = false; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 94f7f0be..d119a1c0 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -501,19 +501,67 @@ public: mType = itemBase.getType(); } inline bool equals(const SystemStatusNetworkInfo& peer) { - return (mAllTypes == peer.mAllTypes); + for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) { + if (!(mAllNetworkHandles[i] == peer.mAllNetworkHandles[i])) { + return false; + } + } + return true; } inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { uint64_t allTypes = (static_cast(curInfo)).mAllTypes; uint64_t networkHandle = (static_cast(curInfo)).mNetworkHandle; int32_t type = (static_cast(curInfo)).mType; + // Replace current with cached table for now and then update + memcpy(mAllNetworkHandles, + (static_cast(curInfo)).getNetworkHandle(), + sizeof(mAllNetworkHandles)); if (mConnected) { mAllTypes |= allTypes; - mAllNetworkHandles[type] = networkHandle; + for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) { + if (mNetworkHandle == mAllNetworkHandles[i].networkHandle) { + LOC_LOGD("collate duplicate detected, not updating"); + break; + } + if (NETWORK_HANDLE_UNKNOWN == mAllNetworkHandles[i].networkHandle) { + mAllNetworkHandles[i].networkHandle = mNetworkHandle; + mAllNetworkHandles[i].networkType = (loc_core::NetworkType) mType; + break; + } + } } else if (0 != mAllTypes) { - mAllTypes = (allTypes & (~mAllTypes)); - mAllNetworkHandles[type] = NETWORK_HANDLE_UNKNOWN; + uint8_t deletedIndex = MAX_NETWORK_HANDLES; + uint8_t lastValidIndex = 0; + uint8_t typeCount = 0; + for (; lastValidIndex < MAX_NETWORK_HANDLES && + NETWORK_HANDLE_UNKNOWN != mAllNetworkHandles[lastValidIndex].networkHandle; + ++lastValidIndex) { + // Maintain count for number of network handles still + // connected for given type + if (mType == mAllNetworkHandles[lastValidIndex].networkType) { + typeCount++; + } + + if (mNetworkHandle == mAllNetworkHandles[lastValidIndex].networkHandle) { + deletedIndex = lastValidIndex; + typeCount--; + } + } + + if (MAX_NETWORK_HANDLES != deletedIndex) { + LOC_LOGD("deletedIndex:%u, lastValidIndex:%u, typeCount:%u", + deletedIndex, lastValidIndex, typeCount); + mAllNetworkHandles[deletedIndex] = mAllNetworkHandles[lastValidIndex]; + mAllNetworkHandles[lastValidIndex].networkHandle = NETWORK_HANDLE_UNKNOWN; + mAllNetworkHandles[lastValidIndex].networkType = TYPE_UNKNOWN; + } + + // If no more handles of given type, set bitmask + if (0 == typeCount) { + mAllTypes = (allTypes & (~mAllTypes)); + LOC_LOGD("mAllTypes:%" PRIx64, mAllTypes); + } } // else (mConnected == false && mAllTypes == 0) // we keep mAllTypes as 0, which means no more connections. diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index a6e68f1f..c32d65d7 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -32,9 +32,11 @@ #include #include +#include #include #include #include +#include #define MAC_ADDRESS_LENGTH 6 // MAC address length in bytes @@ -42,10 +44,68 @@ #define SRN_MAC_ADDRESS_LENGTH 6 #define WIFI_SUPPLICANT_DEFAULT_STATE 0 +static constexpr char sDelimit = ':'; + namespace loc_core { using namespace std; +enum NetworkType { + TYPE_MOBILE = 0, + TYPE_WIFI, + TYPE_ETHERNET, + TYPE_BLUETOOTH, + TYPE_MMS, + TYPE_SUPL, + TYPE_DUN, + TYPE_HIPRI, + TYPE_WIMAX, + TYPE_PROXY, + TYPE_UNKNOWN, +}; + +typedef struct NetworkInfoType +{ + // Unique network handle ID + uint64_t networkHandle; + // Type of network for corresponding network handle + NetworkType networkType; + NetworkInfoType() : networkHandle(NETWORK_HANDLE_UNKNOWN), networkType(TYPE_UNKNOWN) {} + NetworkInfoType(string strObj) { + size_t posDelimit = strObj.find(sDelimit); + + if ( posDelimit != string::npos) { + int32_t type = TYPE_UNKNOWN; + string handleStr = strObj.substr(0, posDelimit); + string typeStr = strObj.substr(posDelimit + 1, strObj.length() - posDelimit - 1); + stringstream(handleStr) >> networkHandle; + stringstream(typeStr) >> type; + networkType = (NetworkType) type; + } else { + networkHandle = NETWORK_HANDLE_UNKNOWN; + networkType = TYPE_UNKNOWN; + } + } + bool operator== (const NetworkInfoType& other) { + return ((networkHandle == other.networkHandle) && (networkType == other.networkType)); + } + string toString() { + string valueStr; + valueStr.clear (); + char nethandle [32]; + memset (nethandle, 0, 32); + snprintf(nethandle, sizeof(nethandle), "%" PRIu64, networkHandle); + valueStr += string(nethandle); + valueStr += sDelimit; + char type [12]; + memset (type, 0, 12); + snprintf (type, 12, "%u", networkType); + valueStr += string (type); + return valueStr; + } +} NetworkInfoType; + + class AirplaneModeDataItemBase : public IDataItemCore { public: AirplaneModeDataItemBase(bool mode): @@ -222,19 +282,6 @@ protected: class NetworkInfoDataItemBase : public IDataItemCore { public: - enum NetworkType { - TYPE_MOBILE = 0, - TYPE_WIFI, - TYPE_ETHERNET, - TYPE_BLUETOOTH, - TYPE_MMS, - TYPE_SUPL, - TYPE_DUN, - TYPE_HIPRI, - TYPE_WIMAX, - TYPE_PROXY, - TYPE_UNKNOWN, - }; NetworkInfoDataItemBase( NetworkType initialType, int32_t type, string typeName, string subTypeName, bool available, bool connected, bool roaming, uint64_t networkHandle ): @@ -247,9 +294,8 @@ public: mRoaming(roaming), mNetworkHandle(networkHandle), mId(NETWORKINFO_DATA_ITEM_ID) { - memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN, - sizeof (mAllNetworkHandles)); - mAllNetworkHandles[initialType] = networkHandle; + mAllNetworkHandles[0].networkHandle = networkHandle; + mAllNetworkHandles[0].networkType = initialType; } virtual ~NetworkInfoDataItemBase() {} inline virtual DataItemId getId() { return mId; } @@ -259,8 +305,8 @@ public: return (NetworkType)mType; } inline uint64_t getAllTypes() { return mAllTypes; } - inline uint64_t getNetworkHandle(NetworkType type) { - return mAllNetworkHandles[type]; + inline NetworkInfoType* getNetworkHandle() { + return &mAllNetworkHandles[0]; } // Data members uint64_t mAllTypes; @@ -270,7 +316,7 @@ public: bool mAvailable; bool mConnected; bool mRoaming; - uint64_t mAllNetworkHandles[TYPE_UNKNOWN + 1]; + NetworkInfoType mAllNetworkHandles[MAX_NETWORK_HANDLES]; uint64_t mNetworkHandle; protected: DataItemId mId; diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index af593fb8..1671c76d 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -129,19 +129,33 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) { } bool XtraSystemStatusObserver::updateConnections(uint64_t allConnections, - uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle) { + NetworkInfoType* networkHandleInfo) { mIsConnectivityStatusKnown = true; mConnections = allConnections; - mWifiNetworkHandle = wifiNetworkHandle; - mMobileNetworkHandle = mobileNetworkHandle; + + LOC_LOGd("updateConnections mConnections:%" PRIx64, mConnections); + for (uint8_t i = 0; i < MAX_NETWORK_HANDLES; ++i) { + mNetworkHandle[i] = networkHandleInfo[i]; + LOC_LOGd("updateConnections [%d] networkHandle:%" PRIx64 " networkType:%u", + i, mNetworkHandle[i].networkHandle, mNetworkHandle[i].networkType); + } if (!mReqStatusReceived) { return true; } stringstream ss; - ss << "connection" << endl << mConnections << endl << wifiNetworkHandle - << endl << mobileNetworkHandle; + ss << "connection" << endl << mConnections << endl + << mNetworkHandle[0].toString() << endl + << mNetworkHandle[1].toString() << endl + << mNetworkHandle[2].toString() << endl + << mNetworkHandle[3].toString() << endl + << mNetworkHandle[4].toString() << endl + << mNetworkHandle[5].toString() << endl + << mNetworkHandle[6].toString() << endl + << mNetworkHandle[7].toString() << endl + << mNetworkHandle[8].toString() << endl + << mNetworkHandle[MAX_NETWORK_HANDLES-1].toString(); string s = ss.str(); return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) ); } @@ -200,7 +214,16 @@ inline bool XtraSystemStatusObserver::onStatusRequested(int32_t xtraStatusUpdate ss << "respondStatus" << endl; (mGpsLock == -1 ? ss : ss << mGpsLock) << endl; (mConnections == (uint64_t)~0 ? ss : ss << mConnections) << endl - << mWifiNetworkHandle << endl << mMobileNetworkHandle << endl + << mNetworkHandle[0].toString() << endl + << mNetworkHandle[1].toString() << endl + << mNetworkHandle[2].toString() << endl + << mNetworkHandle[3].toString() << endl + << mNetworkHandle[4].toString() << endl + << mNetworkHandle[5].toString() << endl + << mNetworkHandle[6].toString() << endl + << mNetworkHandle[7].toString() << endl + << mNetworkHandle[8].toString() << endl + << mNetworkHandle[MAX_NETWORK_HANDLES-1].toString() << endl << mTac << endl << mMccmnc << endl << mIsConnectivityStatusKnown; string s = ss.str(); @@ -272,11 +295,10 @@ void XtraSystemStatusObserver::notify(const list& dlist) { NetworkInfoDataItemBase* networkInfo = static_cast(each); + NetworkInfoType* networkHandleInfo = + static_cast(networkInfo->getNetworkHandle()); mXtraSysStatObj->updateConnections(networkInfo->getAllTypes(), - (NetworkHandle) networkInfo->getNetworkHandle( - loc_core::NetworkInfoDataItemBase::TYPE_WIFI), - (NetworkHandle) networkInfo->getNetworkHandle( - loc_core::NetworkInfoDataItemBase::TYPE_MOBILE)); + networkHandleInfo); } break; diff --git a/gnss/XtraSystemStatusObserver.h b/gnss/XtraSystemStatusObserver.h index 14f9393d..3a5259d4 100644 --- a/gnss/XtraSystemStatusObserver.h +++ b/gnss/XtraSystemStatusObserver.h @@ -55,7 +55,7 @@ public : bool updateLockStatus(GnssConfigGpsLock lock); bool updateConnections(uint64_t allConnections, - uint64_t wifiNetworkHandle, uint64_t mobileNetworkHandle); + loc_core::NetworkInfoType* networkHandleInfo); bool updateTac(const string& tac); bool updateMccMnc(const string& mccmnc); bool updateXtraThrottle(const bool enabled); @@ -69,8 +69,7 @@ private: GnssConfigGpsLock mGpsLock; LocIpc mIpc; uint64_t mConnections; - uint64_t mWifiNetworkHandle; - uint64_t mMobileNetworkHandle; + loc_core::NetworkInfoType mNetworkHandle[MAX_NETWORK_HANDLES]; string mTac; string mMccmnc; bool mXtraThrottle; diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 3d7eb971..f873ef2e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2202,11 +2202,12 @@ typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* #define SOCKET_LOC_CLIENT_DIR "/dev/socket/loc_client/" #define EAP_LOC_CLIENT_DIR "/data/vendor/location/extap_locclient/" - + #define LOC_CLIENT_NAME_PREFIX "toclient" typedef uint64_t NetworkHandle; #define NETWORK_HANDLE_UNKNOWN ~0 +#define MAX_NETWORK_HANDLES 10 #ifdef __cplusplus } From a88f0920861b968ea878f61c2a624dda7b663900 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 Jul 2019 12:59:23 -0700 Subject: [PATCH 882/945] Revert "Remove support GNSS HIDL 1.1 for legacy devices" This reverts commit 974fedbe Legacy devices must support GNSS HIDL 1.1 afterall to avoid failure of VtsTrebleFrameworkVintfTest and VTS test for GNSS HIDL 1.1 are being changed to support legacy devices that do not support features Blacklisting and Power Modes. Change-Id: I2ad0776295979d5cddcfa0f76692253d7c084fd2 CRs-fixed: 2487572 --- android/2.0/Android.mk | 4 --- .../android.hardware.gnss@2.0-service-qti.xml | 36 ------------------- 2 files changed, 40 deletions(-) delete mode 100644 android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 83113a32..7c555042 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -70,11 +70,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-service-qti -ifeq ($(GNSS_HIDL_LEGACY_MEASURMENTS),true) -LOCAL_VINTF_FRAGMENTS := legacy/android.hardware.gnss@2.0-service-qti.xml -else LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml -endif LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc diff --git a/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml b/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml deleted file mode 100644 index 64344f7a..00000000 --- a/android/2.0/legacy/android.hardware.gnss@2.0-service-qti.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - android.hardware.gnss - hwbinder - @1.0::IGnss/default - @2.0::IGnss/default - - - From 2b5e2c4ab5218da1ee36d40f63546845b9e14955 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Tue, 9 Jul 2019 10:13:03 +0800 Subject: [PATCH 883/945] Enable TARGET_USES_QMAA flag and remove dummy hal Add check for TARGET_USES_QMAA_OVERRIDE_GPS and TARGET_USES_QMAA flag to enable minimal QMAA Gnss HAL; Remove Dummy Hal as TARGET_USES_QMAA flag could turn off gps hal Change-Id: I7ee23f869bd452f7b40ae8b3c339c0ef60fcdc84 CRs-fixed: 2379305 --- Android.mk | 4 +- android/Android.mk | 2 - android/dummy/Android.mk | 54 -------- android/dummy/GnssDummy.cpp | 115 ------------------ android/dummy/GnssDummy.h | 96 --------------- .../android.hardware.gnss@2.0-service-qti.rc | 4 - android/dummy/serviceDummy.cpp | 32 ----- gps_vendor_board.mk | 4 + 8 files changed, 5 insertions(+), 306 deletions(-) delete mode 100644 android/dummy/Android.mk delete mode 100644 android/dummy/GnssDummy.cpp delete mode 100644 android/dummy/GnssDummy.h delete mode 100644 android/dummy/android.hardware.gnss@2.0-service-qti.rc delete mode 100644 android/dummy/serviceDummy.cpp diff --git a/Android.mk b/Android.mk index a995aff2..f1088a43 100644 --- a/Android.mk +++ b/Android.mk @@ -1,7 +1,5 @@ +ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) LOCAL_PATH := $(call my-dir) include $(LOCAL_PATH)/build/target_specific_features.mk -ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) include $(call all-makefiles-under,$(LOCAL_PATH)) -else -include $(LOCAL_PATH)/android/Android.mk endif diff --git a/android/Android.mk b/android/Android.mk index 8233b68e..3b5c01fe 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -12,6 +12,4 @@ else include $(DIR_LIST)/1.0/Android.mk endif #GNSS HIDL 1.1 endif #GNSS HIDL 2.0 -else #QMAA flag set, build dummy android.hardware.gnss@1.0-impl-qti -include $(LOCAL_PATH)/dummy/Android.mk endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE diff --git a/android/dummy/Android.mk b/android/dummy/Android.mk deleted file mode 100644 index 05114e18..00000000 --- a/android/dummy/Android.mk +++ /dev/null @@ -1,54 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -#build dummy android.hardware.gnss@2.0-impl-qti -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_SRC_FILES := GnssDummy.cpp - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libhidlbase \ - libhidltransport \ - libhwbinder \ - libcutils \ - libutils \ - android.hardware.gnss@1.0 \ - -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@2.0-service-qti -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc -LOCAL_SRC_FILES := \ - serviceDummy.cpp \ - -#LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/location_api -#LOCAL_HEADER_LIBRARIES := \ - libgps.utils_headers \ - libloc_core_headers \ - libloc_pla_headers \ - liblocation_api_headers - - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils \ - libdl \ - libbase \ - libutils \ - -LOCAL_SHARED_LIBRARIES += \ - libhwbinder \ - libhidlbase \ - libhidltransport \ - android.hardware.gnss@1.0 \ - -LOCAL_CFLAGS += $(GNSS_CFLAGS) -include $(BUILD_EXECUTABLE) diff --git a/android/dummy/GnssDummy.cpp b/android/dummy/GnssDummy.cpp deleted file mode 100644 index b30b4370..00000000 --- a/android/dummy/GnssDummy.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Not a Contribution - */ -/* - * Copyright (C) 2016 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. - */ -#include "GnssDummy.h" - -namespace android { -namespace hardware { -namespace gnss { -namespace V1_0 { -namespace implementation { - -Gnss::Gnss() { -} - -Gnss::~Gnss() { -} - -Return Gnss::setCallback(const sp& /*callback*/) { - return false; -} - -Return Gnss::start() { - return false; -} - -Return Gnss::stop() { - return false; -} - -Return Gnss::cleanup() { - return Void(); -} - -Return Gnss::injectLocation(double /*latitudeDegrees*/, - double /*longitudeDegrees*/, - float /*accuracyMeters*/) { - return false; -} - -Return Gnss::injectTime(int64_t /*timeMs*/, int64_t /*timeReferenceMs*/, - int32_t /*uncertaintyMs*/) { - return false; -} - -Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData /*aidingDataFlags*/) { - return Void(); -} - -Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode /*mode*/, - V1_0::IGnss::GnssPositionRecurrence /*recurrence*/, - uint32_t /*minIntervalMs*/, - uint32_t /*preferredAccuracyMeters*/, - uint32_t /*preferredTimeMs*/) { - return false; -} - -Return> Gnss::getExtensionAGnss() { - return nullptr; -} - -Return> Gnss::getExtensionGnssNi() { - return nullptr; -} - -Return> Gnss::getExtensionGnssMeasurement() { - return nullptr; -} - -Return> Gnss::getExtensionGnssConfiguration() { - return nullptr; -} - -Return> Gnss::getExtensionGnssGeofencing() { - return nullptr; -} - -Return> Gnss::getExtensionGnssBatching() { - return nullptr; -} - -Return> Gnss::getExtensionGnssDebug() { - return nullptr; -} - -Return> Gnss::getExtensionAGnssRil() { - return nullptr; -} - -IGnss* HIDL_FETCH_IGnss(const char* /*hal*/) { - IGnss* iface = nullptr; - iface = new Gnss(); - return iface; -} - -} // namespace implementation -} // namespace V1_0 -} // namespace gnss -} // namespace hardware -} // namespace android diff --git a/android/dummy/GnssDummy.h b/android/dummy/GnssDummy.h deleted file mode 100644 index 89c876f0..00000000 --- a/android/dummy/GnssDummy.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Not a Contribution - */ -/* - * Copyright (C) 2016 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. - */ - -#define LOG_TAG "LocSvc_GnssInterface" - -#include -#include -#include - -#include -#include -#include -namespace android { -namespace hardware { -namespace gnss { -namespace V1_0 { -namespace implementation { - -using ::android::hardware::hidl_array; -using ::android::hardware::hidl_memory; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; -using ::android::hardware::Void; -using ::android::sp; -using ::android::hardware::gnss::V1_0::GnssLocation; - -struct Gnss : public IGnss { - Gnss(); - ~Gnss(); - - /* - * Methods from ::android::hardware::gnss::V1_0::IGnss follow. - * These declarations were generated from Gnss.hal. - */ - Return setCallback(const sp& callback) override; - Return start() override; - Return stop() override; - Return cleanup() override; - Return injectLocation(double latitudeDegrees, - double longitudeDegrees, - float accuracyMeters) override; - Return injectTime(int64_t timeMs, - int64_t timeReferenceMs, - int32_t uncertaintyMs) override; - Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override; - Return setPositionMode(V1_0::IGnss::GnssPositionMode mode, - V1_0::IGnss::GnssPositionRecurrence recurrence, - uint32_t minIntervalMs, - uint32_t preferredAccuracyMeters, - uint32_t preferredTimeMs) override; - Return> getExtensionAGnss() override; - Return> getExtensionGnssNi() override; - Return> getExtensionGnssMeasurement() override; - Return> getExtensionGnssConfiguration() override; - Return> getExtensionGnssGeofencing() override; - Return> getExtensionGnssBatching() override; - - Return> getExtensionAGnssRil() override; - - inline Return> getExtensionGnssNavigationMessage() override { - return nullptr; - } - - inline Return> getExtensionXtra() override { - return nullptr; - } - - Return> getExtensionGnssDebug() override; -}; - -extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); - -} // namespace implementation -} // namespace V1_0 -} // namespace gnss -} // namespace hardware -} // namespace android - diff --git a/android/dummy/android.hardware.gnss@2.0-service-qti.rc b/android/dummy/android.hardware.gnss@2.0-service-qti.rc deleted file mode 100644 index 36ee47c7..00000000 --- a/android/dummy/android.hardware.gnss@2.0-service-qti.rc +++ /dev/null @@ -1,4 +0,0 @@ -service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti - class hal - user gps - group system gps radio diff --git a/android/dummy/serviceDummy.cpp b/android/dummy/serviceDummy.cpp deleted file mode 100644 index 10ce60b2..00000000 --- a/android/dummy/serviceDummy.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. - * Not a Contribution - */ -/* - * Copyright (C) 2016 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. - */ - -#define LOG_TAG "android.hardware.gnss@1.0-service-qti" - -#include -#include - -using android::hardware::gnss::V1_0::IGnss; -using android::hardware::defaultPassthroughServiceImplementation; - -int main() { - ALOGI("%s", __FUNCTION__); - return defaultPassthroughServiceImplementation(); -} diff --git a/gps_vendor_board.mk b/gps_vendor_board.mk index be346dcd..e1915eaa 100644 --- a/gps_vendor_board.mk +++ b/gps_vendor_board.mk @@ -1,3 +1,7 @@ # Flags from BoardConfigVendor.mk +ifneq ($(TARGET_USES_QMAA),true) BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default +else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false) +BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default +endif From 1608ffb38b3d156ae5db6483258fca3008ae5c0b Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Wed, 3 Jul 2019 17:55:17 -0700 Subject: [PATCH 884/945] SUPL-2.0-con-034-1/2 test case fails SUPL-2.0-con-034-1/2 Fail because Emergency-NI did not check inprogress session Change-Id: I377955c455830bf3bb7cb7fe05d45c4536dabfbc CRs-fixed: 2483780 --- core/LocAdapterBase.cpp | 4 ++- core/LocAdapterBase.h | 3 ++- core/LocApiBase.cpp | 8 ++++-- core/LocApiBase.h | 3 ++- gnss/GnssAdapter.cpp | 54 +++++++++++++++++++++++++++++++---------- gnss/GnssAdapter.h | 6 +++-- utils/gps_extended_c.h | 6 +++++ 7 files changed, 64 insertions(+), 20 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 5864fa83..ffd3d5a1 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -154,7 +154,9 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) bool LocAdapterBase:: - requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/) + requestNiNotifyEvent(const GnssNiNotification &/*notify*/, + const void* /*data*/, + const LocInEmergency emergencyState) DEFAULT_IMPL(false) void LocAdapterBase:: diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 13c84936..b9b1f1e8 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -171,7 +171,8 @@ public: virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); virtual bool releaseATL(int connHandle); - virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data); + virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data, + const LocInEmergency emergencyState); inline virtual bool isInSession() { return false; } ContextBase* getContext() const { return mContext; } virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements, diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index a521ceb6..029f57b6 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -514,10 +514,14 @@ void LocApiBase::releaseATL(int connHandle) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); } -void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data) +void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data, + const LocInEmergency emergencyState) { // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data)); + TO_1ST_HANDLING_LOCADAPTERS( + mLocAdapters[i]->requestNiNotifyEvent(notify, + data, + emergencyState)); } void* LocApiBase :: getSibling() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 1c2afafe..8c885f7f 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -177,7 +177,8 @@ public: void requestLocation(); void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask apn_type_mask); void releaseATL(int connHandle); - void requestNiNotify(GnssNiNotification ¬ify, const void* data); + void requestNiNotify(GnssNiNotification ¬ify, const void* data, + const LocInEmergency emergencyState); void reportGnssMeasurements(GnssMeasurements& gnssMeasurements, int msInWeek); void reportWwanZppFix(LocGpsLocation &zppLoc); void reportZppBestAvailableFix(LocGpsLocation &zppLoc, GpsLocationExtended &location_extended, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9413def6..2481dd55 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3508,7 +3508,8 @@ GnssAdapter::reportData(GnssDataNotification& dataNotify) } bool -GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data) +GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data, + const LocInEmergency emergencyState) { LOC_LOGI("%s]: notif_type: %d, timeout: %d, default_resp: %d" "requestor_id: %s (encoding: %d) text: %s text (encoding: %d) extras: %s", @@ -3521,37 +3522,49 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* LocApiBase& mApi; const GnssNiNotification mNotify; const void* mData; + const LocInEmergency mEmergencyState; inline MsgReportNiNotify(GnssAdapter& adapter, LocApiBase& api, const GnssNiNotification& notify, - const void* data) : + const void* data, + const LocInEmergency emergencyState) : LocMsg(), mAdapter(adapter), mApi(api), mNotify(notify), - mData(data) {} + mData(data), + mEmergencyState(emergencyState) {} inline virtual void proc() const { + bool bIsInEmergency = false; + bool bInformNiAccept = false; + + bIsInEmergency = ((LOC_IN_EMERGENCY_UNKNOWN == mEmergencyState) && + mAdapter.getE911State()) || // older modems + (LOC_IN_EMERGENCY_SET == mEmergencyState); // newer modems + if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) { - if (mAdapter.getE911State() || - (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES)) { - mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData); + bInformNiAccept = bIsInEmergency || + (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES); + + if (bInformNiAccept) { + mAdapter.requestNiNotify(mNotify, mData, bInformNiAccept); } else { mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData); } } else if (GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) { - if (mAdapter.getE911State() && - (1 == ContextBase::mGps_conf.CP_MTLR_ES)) { + if (bIsInEmergency && (1 == ContextBase::mGps_conf.CP_MTLR_ES)) { mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData); - } else { - mAdapter.requestNiNotify(mNotify, mData); + } + else { + mAdapter.requestNiNotify(mNotify, mData, false); } } else { - mAdapter.requestNiNotify(mNotify, mData); + mAdapter.requestNiNotify(mNotify, mData, false); } } }; - sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data)); + sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data, emergencyState)); return true; } @@ -3674,7 +3687,8 @@ static void* niThreadProc(void *args) } bool -GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data) +GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data, + const bool bInformNiAccept) { NiSession* pSession = NULL; gnssNiCallback gnssNiCb = nullptr; @@ -3686,6 +3700,20 @@ GnssAdapter::requestNiNotify(const GnssNiNotification& notify, const void* data) } } if (nullptr == gnssNiCb) { + if (GNSS_NI_TYPE_EMERGENCY_SUPL == notify.type) { + if (bInformNiAccept) { + mLocApi->informNiResponse(GNSS_NI_RESPONSE_ACCEPT, data); + NiData& niData = getNiData(); + // ignore any SUPL NI non-Es session if a SUPL NI ES is accepted + if (NULL != niData.session.rawRequest) { + pthread_mutex_lock(&niData.session.tLock); + niData.session.resp = GNSS_NI_RESPONSE_IGNORE; + niData.session.respRecvd = true; + pthread_cond_signal(&niData.session.tCond); + pthread_mutex_unlock(&niData.session.tLock); + } + } + } EXIT_LOG(%s, "no clients with gnssNiCb."); return false; } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9a727a20..a44e68c2 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -359,7 +359,8 @@ public: bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length); virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); - virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data); + virtual bool requestNiNotifyEvent(const GnssNiNotification& notify, const void* data, + const LocInEmergency emergencyState); virtual void reportGnssMeasurementsEvent(const GnssMeasurements& gnssMeasurements, int msInWeek); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); @@ -389,7 +390,8 @@ public: void reportSv(GnssSvNotification& svNotify); void reportNmea(const char* nmea, size_t length); void reportData(GnssDataNotification& dataNotify); - bool requestNiNotify(const GnssNiNotification& notify, const void* data); + bool requestNiNotify(const GnssNiNotification& notify, const void* data, + const bool bInformNiAccept); void reportGnssMeasurementData(const GnssMeasurementsNotification& measurements); void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 07d67edf..90ec3395 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -457,6 +457,12 @@ typedef enum { LOC_RELIABILITY_HIGH = 4 }LocReliability; +typedef enum { + LOC_IN_EMERGENCY_UNKNOWN = 0, + LOC_IN_EMERGENCY_SET = 1, + LOC_IN_EMERGENCY_NOT_SET = 2 +}LocInEmergency; + typedef struct { struct timespec32_t apTimeStamp; /*boottime received from pps-ktimer*/ From a66440949c8b4ebfd72d15e6298f787497632704 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Wed, 10 Jul 2019 13:02:35 +0800 Subject: [PATCH 885/945] Drop SUPL URL dup check in set and update command Get rid of Supl url duplication check both in setConfig and updateConfig commands. Also clean gnssUpdateConfig() params Change-Id: I432995a44c08192955bd50630649120933006ff9 CRs-fixed: 2487784 --- gnss/GnssAdapter.cpp | 49 +++++++++++++++++--------------------------- gnss/GnssAdapter.h | 4 ++-- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 9413def6..645ac013 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -666,17 +666,15 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) } if (LOC_AGPS_SUPL_SERVER != type && LOC_AGPS_MO_SUPL_SERVER != type) { LOC_LOGe("Invalid type=%d", type); - } else { - string& url = (LOC_AGPS_SUPL_SERVER == type) ? getServerUrl() : getMoServerUrl(); - if (length >= 0 && strncasecmp(url.c_str(), serverUrl, sizeof(serverUrl)) != 0) { - url.assign(serverUrl); - - if (LOC_AGPS_SUPL_SERVER == type) { - strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING); - ContextBase::mGps_conf.SUPL_PORT = port; + } else if (length >= 0) { + if (LOC_AGPS_SUPL_SERVER == type) { + getServerUrl().assign(serverUrl); + strlcpy(ContextBase::mGps_conf.SUPL_HOST, server, LOC_MAX_PARAM_STRING); + ContextBase::mGps_conf.SUPL_PORT = port; + } else { + if (strncasecmp(getMoServerUrl().c_str(), serverUrl, sizeof(serverUrl)) != 0) { + getMoServerUrl().assign(serverUrl); } - - LOC_LOGv("serverUrl=%s length=%d type=%d", serverUrl, length, type); } } } @@ -709,7 +707,6 @@ GnssAdapter::setConfigCommand() } mAdapter.mNmeaMask= mask; - std::string oldServerUrl = mAdapter.getServerUrl(); std::string oldMoServerUrl = mAdapter.getMoServerUrl(); mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, ContextBase::mGps_conf.SUPL_PORT, @@ -750,10 +747,8 @@ GnssAdapter::setConfigCommand() gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(), adapter.mBlacklistedSvIds.end()); mApi.sendMsg(new LocApiMsg( - [&adapter, gpsConf, sapConf, oldServerUrl, - oldMoServerUrl, gnssConfigRequested] () { - adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested, - gnssConfigRequested); + [&adapter, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () { + adapter.gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested); // set nmea mask type uint32_t mask = 0; @@ -812,8 +807,8 @@ GnssAdapter::setConfigCommand() sendMsg(new MsgSetConfig(*this, *mLocApi)); } -std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldServerUrl, - const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested, +std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl, + const GnssConfig& gnssConfigRequested, const GnssConfig& gnssConfigNeedEngineUpdate, size_t count) { loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; size_t index = 0; @@ -846,13 +841,10 @@ std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldS GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (gnssConfigNeedEngineUpdate.assistanceServer.type == GNSS_ASSISTANCE_TYPE_SUPL) { - if (0 != oldServerUrl.compare(serverUrl)) { - - err = mLocApi->setServerSync( - serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); - if (index < count) { - errsList[index] = err; - } + err = mLocApi->setServerSync( + serverUrl.c_str(), serverUrlLen, LOC_AGPS_SUPL_SERVER); + if (index < count) { + errsList[index] = err; } if (0 != oldMoServerUrl.compare(moServerUrl)) { LocationError locErr = @@ -1069,7 +1061,6 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) size_t countOfConfigs = mCount; GnssConfig gnssConfigRequested = mConfig; GnssConfig gnssConfigNeedEngineUpdate = mConfig; - std::string oldServerUrl = mAdapter.getServerUrl(); std::vector sessionIds; sessionIds.assign(mIds, mIds + mCount); @@ -1162,11 +1153,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) mApi.sendMsg(new LocApiMsg( [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, - countOfConfigs, configCollectiveResponse, errs, oldServerUrl] () { - std::string serverUrl = adapter.getServerUrl(); - int serverUrlLen = serverUrl.length(); - std::vector errsList = adapter.gnssUpdateConfig(oldServerUrl, - "", gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs); + countOfConfigs, configCollectiveResponse, errs] () { + std::vector errsList = adapter.gnssUpdateConfig("", + gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs); configCollectiveResponse->returnToSender(errsList); })); diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 9a727a20..52004222 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -289,8 +289,8 @@ public: uint32_t gnssDeleteAidingDataCommand(GnssAidingData& data); void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); - std::vector gnssUpdateConfig(const std::string& oldServerUrl, - const std::string& oldMoServerUrl, const GnssConfig& gnssConfigRequested, + std::vector gnssUpdateConfig(const std::string& oldMoServerUrl, + const GnssConfig& gnssConfigRequested, const GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0); /* ==== GNSS SV TYPE CONFIG ============================================================ */ From 903040f8c255f5387be71b240c90283afc0e9679 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Fri, 10 May 2019 11:34:13 -0700 Subject: [PATCH 886/945] Add support for MB SV Poly fields CRs-Fixed: 2478704 Change-Id: I95bcfa28989d65e3c75a761b51d778606fca61c4 --- utils/gps_extended_c.h | 44 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 90ec3395..b7497835 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -643,10 +643,12 @@ typedef uint16_t GnssSvPolyStatusMask; #define GNSS_SV_POLY_SRC_ALM_CORR_V02 ((GnssSvPolyStatusMask)0x01) #define GNSS_SV_POLY_GLO_STR4_V02 ((GnssSvPolyStatusMask)0x02) #define GNSS_SV_POLY_DELETE_V02 ((GnssSvPolyStatusMask)0x04) +#define GNSS_SV_POLY_SRC_GAL_FNAV_OR_INAV_V02 ((GnssSvPolyStatusMask)0x08) typedef uint16_t GnssSvPolyStatusMaskValidity; #define GNSS_SV_POLY_SRC_ALM_CORR_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x01) #define GNSS_SV_POLY_GLO_STR4_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x02) #define GNSS_SV_POLY_DELETE_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x04) +#define GNSS_SV_POLY_SRC_GAL_FNAV_OR_INAV_VALID_V02 ((GnssSvPolyStatusMaskValidity)0x08) typedef struct { @@ -1032,9 +1034,19 @@ enum ulp_gnss_sv_poly_valid_flags{ ULP_GNSS_SV_POLY_ELEVATIONUNC, ULP_GNSS_SV_POLY_VELO_COEFF, ULP_GNSS_SV_POLY_ENHANCED_IOD, - - ULP_GNSS_SV_POLY_VALID_FLAGS - + ULP_GNSS_SV_POLY_GPS_ISC_L1CA, + ULP_GNSS_SV_POLY_GPS_ISC_L2C, + ULP_GNSS_SV_POLY_GPS_ISC_L5I5, + ULP_GNSS_SV_POLY_GPS_ISC_L5Q5, + ULP_GNSS_SV_POLY_GPS_TGD, + ULP_GNSS_SV_POLY_GLO_TGD_G1G2, + ULP_GNSS_SV_POLY_BDS_TGD_B1, + ULP_GNSS_SV_POLY_BDS_TGD_B2, + ULP_GNSS_SV_POLY_BDS_TGD_B2A, + ULP_GNSS_SV_POLY_BDS_ISC_B2A, + ULP_GNSS_SV_POLY_GAL_BGD_E1E5A, + ULP_GNSS_SV_POLY_GAL_BGD_E1E5B, + ULP_GNSS_SV_POLY_NAVIC_TGD_L5 }; #define ULP_GNSS_SV_POLY_BIT_GLO_FREQ (1< Date: Wed, 17 Jul 2019 12:30:17 +0800 Subject: [PATCH 887/945] modify QZSS SVID according to NMEA spec 4.11 Change-Id: I7c82c210174076f9620b52cfb749a4c73824ffdf CRs-Fixed: 2473699 --- utils/loc_nmea.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index f5090d05..2074e3e5 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -36,6 +36,7 @@ #include #define GLONASS_SV_ID_OFFSET 64 +#define QZSS_SV_ID_OFFSET (-192) #define MAX_SV_COUNT_SUPPORTED_IN_ONE_CONSTELLATION 64 #define MAX_SATELLITES_IN_USE 12 #define MSEC_IN_ONE_WEEK 604800000ULL @@ -439,7 +440,8 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_nmea_sv_meta& sv_meta, sv_meta.talker[0] = 'G'; sv_meta.talker[1] = 'Q'; sv_meta.mask = sv_cache_info.qzss_used_mask; - // QZSS SV ids are from 193-197. So keep svIdOffset 0 + // QZSS SV ids are from 193-199. So keep svIdOffset -192 + sv_meta.svIdOffset = QZSS_SV_ID_OFFSET; sv_meta.systemId = SYSTEM_ID_QZSS; if (GNSS_SIGNAL_QZSS_L1CA == signalType) { sv_meta.svCount = sv_cache_info.qzss_l1_count; @@ -589,6 +591,10 @@ static uint32_t loc_nmea_generate_GSA(const GpsLocationExtended &locationExtende uint32_t svIdOffset = sv_meta_p->svIdOffset; uint64_t mask = sv_meta_p->mask; + if(sv_meta_p->svType != GNSS_SV_TYPE_GLONASS) { + svIdOffset = 0; + } + for (uint8_t i = 1; mask > 0 && svUsedCount < 64; i++) { if (mask & 1) From 1a16ef3803aca2b2d8f1468e9aa99961781dfac3 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 17 Jul 2019 12:06:57 -0700 Subject: [PATCH 888/945] Report ErrRecovery only when there is actual event SystemStatus needs to report ErrRecovery events only when they actually happen (value != 0). Change-Id: I282d9c703542ef4bfd61ded78b903017816bd2cb CRs-Fixed: 2491022 --- core/SystemStatus.cpp | 3 +++ core/SystemStatus.h | 32 +++++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 9ca126f8..1c326c1e 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -1338,6 +1338,9 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) : template bool SystemStatus::setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s) { + if (s.ignore()) { + return false; + } if (!report.empty() && report.back().equals(static_cast(s.collate(report.back())))) { // there is no change - just update reported timestamp report.back().mUtcReported = s.mUtcReported; diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 94f7f0be..8a6fd72d 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -86,6 +86,7 @@ public: return *this; } virtual void dump(void) {}; + inline virtual bool ignore() { return false; }; }; class SystemStatusLocation : public SystemStatusItemBase @@ -102,7 +103,7 @@ public: mLocation(location), mLocationEx(locationEx) {} bool equals(const SystemStatusLocation& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWM1; @@ -132,7 +133,7 @@ public: mTimeUncNs(0ULL) {} inline SystemStatusTimeAndClock(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusTimeAndClock& peer); - void dump(void); + void dump(void) override; }; class SystemStatusXoState : public SystemStatusItemBase @@ -143,7 +144,7 @@ public: mXoState(0) {} inline SystemStatusXoState(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusXoState& peer); - void dump(void); + void dump(void) override; }; class SystemStatusRfAndParams : public SystemStatusItemBase @@ -190,7 +191,7 @@ public: mGalBpAmpQ(0) {} inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusRfAndParams& peer); - void dump(void); + void dump(void) override; }; class SystemStatusErrRecovery : public SystemStatusItemBase @@ -201,7 +202,8 @@ public: mRecErrorRecovery(0) {}; inline SystemStatusErrRecovery(const SystemStatusPQWM1& nmea); bool equals(const SystemStatusErrRecovery& peer); - void dump(void); + inline bool ignore() override { return 0 == mRecErrorRecovery; }; + void dump(void) override; }; class SystemStatusPQWP1; @@ -225,7 +227,7 @@ public: mEpiSrc(0) {} inline SystemStatusInjectedPosition(const SystemStatusPQWP1& nmea); bool equals(const SystemStatusInjectedPosition& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP2; @@ -247,7 +249,7 @@ public: mBestAltUnc(0) {} inline SystemStatusBestPosition(const SystemStatusPQWP2& nmea); bool equals(const SystemStatusBestPosition& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP3; @@ -283,7 +285,7 @@ public: mNavicXtraValid(0) {} inline SystemStatusXtra(const SystemStatusPQWP3& nmea); bool equals(const SystemStatusXtra& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP4; @@ -303,7 +305,7 @@ public: mQzssEpheValid(0) {} inline SystemStatusEphemeris(const SystemStatusPQWP4& nmea); bool equals(const SystemStatusEphemeris& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP5; @@ -349,7 +351,7 @@ public: mNavicBadMask(0) {} inline SystemStatusSvHealth(const SystemStatusPQWP5& nmea); bool equals(const SystemStatusSvHealth& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP6; @@ -361,7 +363,7 @@ public: mFixInfoMask(0) {} inline SystemStatusPdr(const SystemStatusPQWP6& nmea); bool equals(const SystemStatusPdr& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWP7; @@ -385,7 +387,7 @@ public: } inline SystemStatusNavData(const SystemStatusPQWP7& nmea); bool equals(const SystemStatusNavData& peer); - void dump(void); + void dump(void) override; }; class SystemStatusPQWS1; @@ -399,7 +401,7 @@ public: mHepeLimit(0) {} inline SystemStatusPositionFailure(const SystemStatusPQWS1& nmea); bool equals(const SystemStatusPositionFailure& peer); - void dump(void); + void dump(void) override; }; /****************************************************************************** @@ -710,7 +712,7 @@ public: inline bool equals(const SystemStatusTac& peer) { return (mValue == peer.mValue); } - inline void dump(void) { + inline void dump(void) override { LOC_LOGD("Tac: value=%s", mValue.c_str()); } }; @@ -726,7 +728,7 @@ public: inline bool equals(const SystemStatusMccMnc& peer) { return (mValue == peer.mValue); } - inline void dump(void) { + inline void dump(void) override { LOC_LOGD("TacMccMnc value=%s", mValue.c_str()); } }; From 3b4814e3863ee94598a396e2a6ad75cac28b2e34 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 24 Jul 2019 17:36:30 +0530 Subject: [PATCH 889/945] Use getVendorEnhancedInfo API Change of API for vendor enhanced framework detection CRs-Fixed: 2496231 Change-Id: Iaf173615f8fe847a8b5d5ed71602d933febb31d1 --- android/1.0/service.cpp | 3 ++- android/1.1/service.cpp | 3 ++- android/2.0/service.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/android/1.0/service.cpp b/android/1.0/service.cpp index 04bb8abf..2a6f60fe 100644 --- a/android/1.0/service.cpp +++ b/android/1.0/service.cpp @@ -48,7 +48,8 @@ int main() { ALOGI("%s", __FUNCTION__); - bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + int vendorInfo = getVendorEnhancedInfo(); + bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); setVendorEnhanced(vendorEnhanced); #ifdef ARCH_ARM_32 diff --git a/android/1.1/service.cpp b/android/1.1/service.cpp index bf7ad07c..0cb91f7d 100644 --- a/android/1.1/service.cpp +++ b/android/1.1/service.cpp @@ -48,7 +48,8 @@ int main() { ALOGI("%s", __FUNCTION__); - bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + int vendorInfo = getVendorEnhancedInfo(); + bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); setVendorEnhanced(vendorEnhanced); #ifdef ARCH_ARM_32 diff --git a/android/2.0/service.cpp b/android/2.0/service.cpp index 16f0b06b..664c661f 100644 --- a/android/2.0/service.cpp +++ b/android/2.0/service.cpp @@ -48,7 +48,8 @@ int main() { ALOGI("%s", __FUNCTION__); - bool vendorEnhanced = isRunningWithVendorEnhancedFramework(); + int vendorInfo = getVendorEnhancedInfo(); + bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); setVendorEnhanced(vendorEnhanced); #ifdef ARCH_ARM_32 From 83c197246fedbcdea6616b82cfa043cd56f46611 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Mon, 8 Jul 2019 01:25:38 +0530 Subject: [PATCH 890/945] Adding NAVIC to constellation string array Adding NAVIC to the array of constellation strings while reporting SV to clients. CRs-Fixed: 2494936 Change-Id: Ifabc3bc3d0583119f3e1e80c9f69c60ff68e3602 --- core/LocApiBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 029f57b6..ef204ec3 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -401,7 +401,7 @@ void LocApiBase::sendNfwNotification(GnssNfwNotification& notification) void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", - "QZSS", "BEIDOU", "GALILEO" }; + "QZSS", "BEIDOU", "GALILEO", "NAVIC" }; // print the SV info before delivering LOC_LOGV("num sv: %u\n" From fc6f5be4f883675a38d7dd487820e49417fbc0b5 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Sat, 20 Jul 2019 10:26:55 -0700 Subject: [PATCH 891/945] Fix potential NMEA event registration issue The NMEA event may not be registered because of a race condition. Change-Id: Icc04039f0b3a3bc34101b667778881323edf9131 CRs-fixed: 2493919 --- gnss/GnssAdapter.cpp | 234 +++++++++++++++++++++---------------------- gnss/GnssAdapter.h | 2 +- 2 files changed, 116 insertions(+), 120 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index ef4664bf..a393fc81 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -681,130 +681,125 @@ GnssAdapter::setSuplHostServer(const char* server, int port, LocServerType type) } void -GnssAdapter::setConfigCommand() +GnssAdapter::setConfig() { LOC_LOGD("%s]: ", __func__); - struct MsgSetConfig : public LocMsg { - GnssAdapter& mAdapter; - LocApiBase& mApi; - inline MsgSetConfig(GnssAdapter& adapter, LocApiBase& api) : - LocMsg(), - mAdapter(adapter), - mApi(api) {} - inline virtual void proc() const { - if (!mAdapter.isEngineCapabilitiesKnown()) { - mAdapter.mPendingMsgs.push_back(new MsgSetConfig(*this)); - return; + // set nmea mask type + uint32_t mask = 0; + if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } + if (mNmeaMask != mask) { + mNmeaMask = mask; + if (mNmeaMask) { + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if ((it->second.gnssNmeaCb != nullptr)) { + updateEvtMask(LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT, + LOC_REGISTRATION_MASK_ENABLED); + break; + } } - // set nmea mask type - uint32_t mask = 0; - if (NMEA_PROVIDER_MP == ContextBase::mGps_conf.NMEA_PROVIDER) { - mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { - mask |= LOC_NMEA_MASK_DEBUG_V02; - } - mAdapter.mNmeaMask= mask; - - std::string oldMoServerUrl = mAdapter.getMoServerUrl(); - mAdapter.setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, - ContextBase::mGps_conf.SUPL_PORT, - LOC_AGPS_SUPL_SERVER); - mAdapter.setSuplHostServer(ContextBase::mGps_conf.MO_SUPL_HOST, - ContextBase::mGps_conf.MO_SUPL_PORT, - LOC_AGPS_MO_SUPL_SERVER); - - // inject the configurations into modem - GnssAdapter& adapter = mAdapter; - loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; - loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; - - //cache the injected configuration with GnssConfigRequested struct - GnssConfig gnssConfigRequested = {}; - gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | - GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; - gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; - - if (gpsConf.AGPS_CONFIG_INJECT) { - gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | - GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | - GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | - GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; - gnssConfigRequested.suplVersion = - adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); - gnssConfigRequested.lppProfile = - adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); - gnssConfigRequested.aGlonassPositionProtocolMask = - gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; - } - gnssConfigRequested.lppeControlPlaneMask = - adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); - gnssConfigRequested.lppeUserPlaneMask = - adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); - gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(), - adapter.mBlacklistedSvIds.end()); - mApi.sendMsg(new LocApiMsg( - [&adapter, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () { - adapter.gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested); - - // set nmea mask type - uint32_t mask = 0; - if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { - mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; - } - if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { - mask |= LOC_NMEA_MASK_DEBUG_V02; - } - - if (mask != 0) { - adapter.mLocApi->setNMEATypesSync(mask); - } - - adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); - - adapter.mLocApi->setConstrainedTuncMode( - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, - (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); - adapter.mLocApi->setPositionAssistedClockEstimatorMode( - gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); - - if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - adapter.mLocApi->setSensorPropertiesSync( - sapConf.GYRO_BIAS_RANDOM_WALK_VALID, - sapConf.GYRO_BIAS_RANDOM_WALK, - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); - } - adapter.mLocApi->setSensorPerfControlConfigSync( - sapConf.SENSOR_CONTROL_MODE, - sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, - sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, - sapConf.SENSOR_GYRO_BATCHES_PER_SEC, - sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - sapConf.SENSOR_ALGORITHM_CONFIG_MASK); - } )); } - }; + } + + std::string oldMoServerUrl = getMoServerUrl(); + setSuplHostServer(ContextBase::mGps_conf.SUPL_HOST, + ContextBase::mGps_conf.SUPL_PORT, + LOC_AGPS_SUPL_SERVER); + setSuplHostServer(ContextBase::mGps_conf.MO_SUPL_HOST, + ContextBase::mGps_conf.MO_SUPL_PORT, + LOC_AGPS_MO_SUPL_SERVER); + + // inject the configurations into modem + loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; + loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; + + //cache the injected configuration with GnssConfigRequested struct + GnssConfig gnssConfigRequested = {}; + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | + GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; + gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; + + if (gpsConf.AGPS_CONFIG_INJECT) { + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | + GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | + GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | + GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; + gnssConfigRequested.suplVersion = + mLocApi->convertSuplVersion(gpsConf.SUPL_VER); + gnssConfigRequested.lppProfile = + mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); + gnssConfigRequested.aGlonassPositionProtocolMask = + gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; + } + gnssConfigRequested.lppeControlPlaneMask = + mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); + gnssConfigRequested.lppeUserPlaneMask = + mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); + gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(), + mBlacklistedSvIds.end()); + mLocApi->sendMsg(new LocApiMsg( + [this, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () { + gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested); + + // set nmea mask type + uint32_t mask = 0; + if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { + mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; + } + if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { + mask |= LOC_NMEA_MASK_DEBUG_V02; + } + + if (mask != 0) { + mLocApi->setNMEATypesSync(mask); + } + + mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + + mLocApi->setConstrainedTuncMode( + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, + (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); + mLocApi->setPositionAssistedClockEstimatorMode( + gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); + + if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + mLocApi->setSensorPropertiesSync( + sapConf.GYRO_BIAS_RANDOM_WALK_VALID, + sapConf.GYRO_BIAS_RANDOM_WALK, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); + } + mLocApi->setSensorPerfControlConfigSync( + sapConf.SENSOR_CONTROL_MODE, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC, + sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sapConf.SENSOR_ALGORITHM_CONFIG_MASK); + } )); - sendMsg(new MsgSetConfig(*this, *mLocApi)); } std::vector GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl, @@ -2075,6 +2070,8 @@ GnssAdapter::handleEngineUpEvent() virtual void proc() const { mAdapter.setEngineCapabilitiesKnown(true); mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); + // must be called only after capabilities are known + mAdapter.setConfig(); mAdapter.restartSessions(); mAdapter.gnssSvIdConfigUpdate(); mAdapter.gnssSvTypeConfigUpdate(); @@ -2086,7 +2083,6 @@ GnssAdapter::handleEngineUpEvent() }; readConfigCommand(); - setConfigCommand(); sendMsg(new MsgHandleEngineUpEvent(*this)); } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b392e886..80258518 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -281,7 +281,6 @@ public: void disableCommand(uint32_t id); void setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks); void readConfigCommand(); - void setConfigCommand(); void requestUlpCommand(); void initEngHubProxyCommand(); uint32_t* gnssUpdateConfigCommand(GnssConfig config); @@ -313,6 +312,7 @@ public: { mGnssSvTypeConfigCb = callback; } inline GnssSvTypeConfigCallback gnssGetSvTypeConfigCallback() { return mGnssSvTypeConfigCb; } + void setConfig(); /* ========= AGPS ====================================================================== */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ From 867091ebcd28b1148ae55a184373c6a89c72b045 Mon Sep 17 00:00:00 2001 From: "P.V. Phani Kumar" Date: Sat, 20 Jul 2019 00:13:28 +0530 Subject: [PATCH 892/945] Initial target definition for bengal. Change-Id: Idb3f34bc75d9ec98c5d2468136c5ca8b7d31bc6c --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index ca6eb795..766402a3 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -43,6 +43,7 @@ GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) GNSS_HIDL_2_0_TARGET_LIST += kona GNSS_HIDL_2_0_TARGET_LIST += atoll GNSS_HIDL_2_0_TARGET_LIST += lito +GNSS_HIDL_2_0_TARGET_LIST += bengal ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_VERSION = 2.0 From 8a6244be7c1debde865c7770b786ee48b5f06b13 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Thu, 11 Jul 2019 10:59:46 -0700 Subject: [PATCH 893/945] Allow NFW enable/disable as in 'P' Make changes in HAL coupled with a few recommended changes in JAVA/JNI layer to allow 'P' behavior for setting NFW GPS LOCK Change-Id: I6580eaeffefe0c10bc226660439701057e09e4a4 CRs-fixed: 2488332 --- android/2.0/GnssConfiguration.cpp | 38 ++++++++++++-- gnss/GnssAdapter.cpp | 84 ++++++++++++++++++++++++------- gnss/GnssAdapter.h | 9 ++-- 3 files changed, 104 insertions(+), 27 deletions(-) diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index d2a87637..363d2b1e 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -23,6 +23,7 @@ #include #include "Gnss.h" #include "GnssConfiguration.h" +#include "ContextBase.h" #include namespace android { @@ -32,6 +33,7 @@ namespace V2_0 { namespace implementation { using ::android::hardware::gnss::V1_0::GnssConstellationType; +using namespace loc_core; GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { } @@ -109,8 +111,7 @@ Return GnssConfiguration::setLppProfile(uint8_t lppProfile) { return false; } - GnssConfig config; - memset(&config, 0, sizeof(GnssConfig)); + GnssConfig config = {}; config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; switch (lppProfile) { @@ -162,8 +163,37 @@ Return GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) return mGnss->updateConfiguration(config); } -Return GnssConfiguration::setGpsLock(uint8_t /*lock*/) { - // deprecated function. Must return false to pass VTS +Return GnssConfiguration::setGpsLock(uint8_t lock) { + + if (mGnss == nullptr) { + LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); + return false; + } + + GnssConfig config = {}; + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; + switch (lock) { + case 0: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + break; + case 1: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; + break; + case 2: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; + break; + case 3: + config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; + break; + default: + LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); + return false; + break; + } + + mGnss->updateConfiguration(config); + // Must return false to pass VTS return false; } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index a393fc81..252b76c9 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -73,7 +73,7 @@ GnssAdapter::GnssAdapter() : mGnssSvIdUsedInPosition(), mGnssSvIdUsedInPosAvail(false), mControlCallbacks(), - mPowerVoteId(0), + mAfwControlId(0), mNmeaMask(0), mGnssSvIdConfig(), mGnssSvTypeConfig(), @@ -97,7 +97,8 @@ GnssAdapter::GnssAdapter() : mPowerStateCb(nullptr), mIsE911Session(NULL), mGnssMbSvIdUsedInPosition{}, - mGnssMbSvIdUsedInPosAvail(false) + mGnssMbSvIdUsedInPosAvail(false), + mSupportNfwControl(true) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -724,7 +725,24 @@ GnssAdapter::setConfig() GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; - gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; + /* Here we process an SSR. We need to set the GPS_LOCK to the proper values, as follows: + 1. Q behavior. This is identified by mSupportNfwControl being 1. In this case + ContextBase::mGps_conf.GPS_LOCK is a "state", meaning it should reflect the + NV value. Therefore we will set the NV to ContextBase::mGps_conf.GPS_LOCK + 2. P behavior. This is identified by mSupportNfwControl being 0. In this case + ContextBase::mGps_conf.GPS_LOCK is a "configuration", meaning it should hold + the "mask" for NI. There are two subcases: + a. Location enabled in GUI (1 == getAfwControlId()). We need to set + the NV to GNSS_CONFIG_GPS_LOCK_NONE (both MO and NI enabled) + b. Location disabled in GUI (0 == getAfwControlId()). We need to set + the NV to ContextBase::mGps_conf.GPS_LOCK (the "mask", which is SIM-card + specific) + */ + if (mSupportNfwControl || (0 == getAfwControlId())) { + gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK; + } else { + gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; + } if (gpsConf.AGPS_CONFIG_INJECT) { gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | @@ -1067,8 +1085,31 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) { newGpsLock = GNSS_CONFIG_GPS_LOCK_MO; } - gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); ContextBase::mGps_conf.GPS_LOCK = newGpsLock; + /* If we get here it means that the changes in the framework to request for + 'P' behavior were made, and therefore we need to "behave" as in 'P' + However, we need to determine if enableCommand function has already been + called, since it could get called before this function.*/ + if (0 != mAdapter.getAfwControlId()) { + /* enableCommand function has already been called since getAfwControlId + returns non zero. Now there are two possible cases: + 1. This is the first time this function is called + (mSupportNfwControl is true). We need to behave as in 'P', but + for the first time, meaning MO was enabled, but NI was not, so + we need to unlock NI + 2. This is not the first time this function is called, meaning we + are already behaving as in 'P'. No need to update the configuration + in this case (return to 'P' code) */ + if (mAdapter.mSupportNfwControl) { + // case 1 above + newGpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI; + } else { + // case 2 above + gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); + } + } + gnssConfigRequested.gpsLock = newGpsLock; + mAdapter.mSupportNfwControl = false; index++; } if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { @@ -2926,18 +2967,20 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) mTechType(techType) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t powerVoteId = mAdapter.getAfwControlId(); + uint32_t afwControlId = mAdapter.getAfwControlId(); if (mTechType != LOCATION_TECHNOLOGY_TYPE_GNSS) { err = LOCATION_ERROR_INVALID_PARAMETER; - } else if (powerVoteId > 0) { + } else if (afwControlId > 0) { err = LOCATION_ERROR_ALREADY_STARTED; } else { mContext.modemPowerVote(true); mAdapter.setAfwControlId(mSessionId); GnssConfigGpsLock gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI; - gpsLock = ContextBase::mGps_conf.GPS_LOCK; + if (mAdapter.mSupportNfwControl) { + ContextBase::mGps_conf.GPS_LOCK &= GNSS_CONFIG_GPS_LOCK_NI; + gpsLock = ContextBase::mGps_conf.GPS_LOCK; + } mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() { mApi.setGpsLockSync(gpsLock); })); @@ -2977,21 +3020,22 @@ GnssAdapter::disableCommand(uint32_t id) mSessionId(sessionId) {} inline virtual void proc() const { LocationError err = LOCATION_ERROR_SUCCESS; - uint32_t powerVoteId = mAdapter.getAfwControlId(); - if (powerVoteId != mSessionId) { + uint32_t afwControlId = mAdapter.getAfwControlId(); + if (afwControlId != mSessionId) { err = LOCATION_ERROR_ID_UNKNOWN; } else { mContext.modemPowerVote(false); mAdapter.setAfwControlId(0); - /* We need to disable MO (AFW) */ - ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO; + if (mAdapter.mSupportNfwControl) { + /* We need to disable MO (AFW) */ + ContextBase::mGps_conf.GPS_LOCK |= GNSS_CONFIG_GPS_LOCK_MO; + } GnssConfigGpsLock gpsLock = ContextBase::mGps_conf.GPS_LOCK; - mApi.sendMsg(new LocApiMsg([&mApi = mApi,gpsLock] () { + mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() { mApi.setGpsLockSync(gpsLock); })); - mAdapter.mXtraObserver.updateLockStatus( - ContextBase::mGps_conf.GPS_LOCK); + mAdapter.mXtraObserver.updateLockStatus(gpsLock); } mAdapter.reportResponse(err, mSessionId); } @@ -4775,11 +4819,11 @@ GnssAdapter::getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsu void GnssAdapter::nfwControlCommand(bool enable) { - struct MsgenableNfwLocationAccess : public LocMsg { + struct MsgControlNfwLocationAccess : public LocMsg { GnssAdapter& mAdapter; LocApiBase& mApi; bool mEnable; - inline MsgenableNfwLocationAccess(GnssAdapter& adapter, LocApiBase& api, + inline MsgControlNfwLocationAccess(GnssAdapter& adapter, LocApiBase& api, bool enable) : LocMsg(), mAdapter(adapter), @@ -4801,7 +4845,11 @@ GnssAdapter::nfwControlCommand(bool enable) { } }; - sendMsg(new MsgenableNfwLocationAccess(*this, *mLocApi, enable)); + if (mSupportNfwControl) { + sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable)); + } else { + LOC_LOGw("NFW control is not supported, do not use this for NFW"); + } } /* ==== Eng Hub Proxy ================================================================= */ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 80258518..b84c3652 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -150,11 +150,12 @@ class GnssAdapter : public LocAdapterBase { /* ==== CONTROL ======================================================================== */ LocationControlCallbacks mControlCallbacks; - uint32_t mPowerVoteId; + uint32_t mAfwControlId; uint32_t mNmeaMask; GnssSvIdConfig mGnssSvIdConfig; GnssSvTypeConfig mGnssSvTypeConfig; GnssSvTypeConfigCallback mGnssSvTypeConfigCb; + bool mSupportNfwControl; /* ==== NI ============================================================================= */ NiData mNiData; @@ -337,10 +338,8 @@ public: LocationControlCallbacks& getControlCallbacks() { return mControlCallbacks; } void setControlCallbacks(const LocationControlCallbacks& controlCallbacks) { mControlCallbacks = controlCallbacks; } - void setAfwControlId(uint32_t id) { mPowerVoteId = id; } - uint32_t getAfwControlId() { return mPowerVoteId; } - void setPowerVoteId(uint32_t id) { mPowerVoteId = id; } - uint32_t getPowerVoteId() { return mPowerVoteId; } + void setAfwControlId(uint32_t id) { mAfwControlId = id; } + uint32_t getAfwControlId() { return mAfwControlId; } virtual bool isInSession() { return !mTimeBasedTrackingSessions.empty(); } void initDefaultAgps(); bool initEngHubProxy(); From 818dacd2345041fd13ab96b5beefa1480689a519 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 30 Jul 2019 18:35:42 -0700 Subject: [PATCH 894/945] GPS_LOCK has the wrong value after killing GNSS process CRs-fixed: 2500864 Change-Id: I5b6cd779ef5c378eedfb54b74b29dbf3191784a1 --- gnss/GnssAdapter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 252b76c9..47e55270 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1082,9 +1082,8 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) if (gnssConfigRequested.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) { GnssConfigGpsLock newGpsLock = gnssConfigRequested.gpsLock; - if (GNSS_CONFIG_GPS_LOCK_NONE == newGpsLock) { - newGpsLock = GNSS_CONFIG_GPS_LOCK_MO; - } + + newGpsLock |= GNSS_CONFIG_GPS_LOCK_MO; ContextBase::mGps_conf.GPS_LOCK = newGpsLock; /* If we get here it means that the changes in the framework to request for 'P' behavior were made, and therefore we need to "behave" as in 'P' @@ -1102,7 +1101,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) in this case (return to 'P' code) */ if (mAdapter.mSupportNfwControl) { // case 1 above - newGpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI; + newGpsLock = GNSS_CONFIG_GPS_LOCK_NONE; } else { // case 2 above gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT); From e549c9be3b4719dfa2aa5fbc64684c2b358e4213 Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Fri, 9 Aug 2019 11:01:22 +0530 Subject: [PATCH 895/945] Set NMEA masks for multiband related and NAVIC(GIGSV) Change-Id: Idbe1af49b5c10e6dbb2c904cddc82601db1eba49 CRs-Fixed: 2506574 --- utils/gps_extended_c.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index b7497835..e49b088b 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -826,6 +826,20 @@ typedef uint32_t NmeaSentenceTypesMask; #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_MASK_DEBUG_V02 ((NmeaSentenceTypesMask)0x00020000) /**< Enable DEBUG type */ +#define LOC_NMEA_MASK_GPDTM_V02 ((NmeaSentenceTypesMask)0x00040000) /**< Enable GPDTM type */ +#define LOC_NMEA_MASK_GNGGA_V02 ((NmeaSentenceTypesMask)0x00080000) /**< Enable GNGGA type */ +#define LOC_NMEA_MASK_GNRMC_V02 ((NmeaSentenceTypesMask)0x00100000) /**< Enable GNRMC type */ +#define LOC_NMEA_MASK_GNVTG_V02 ((NmeaSentenceTypesMask)0x00200000) /**< Enable GNVTG type */ +#define LOC_NMEA_MASK_GAGNS_V02 ((NmeaSentenceTypesMask)0x00400000) /**< Enable GAGNS type */ +#define LOC_NMEA_MASK_GBGGA_V02 ((NmeaSentenceTypesMask)0x00800000) /**< Enable GBGGA type */ +#define LOC_NMEA_MASK_GBGSA_V02 ((NmeaSentenceTypesMask)0x01000000) /**< Enable GBGSA type */ +#define LOC_NMEA_MASK_GBGSV_V02 ((NmeaSentenceTypesMask)0x02000000) /**< Enable GBGSV type */ +#define LOC_NMEA_MASK_GBRMC_V02 ((NmeaSentenceTypesMask)0x04000000) /**< Enable GBRMC type */ +#define LOC_NMEA_MASK_GBVTG_V02 ((NmeaSentenceTypesMask)0x08000000) /**< Enable GBVTG type */ +#define LOC_NMEA_MASK_GQGSV_V02 ((NmeaSentenceTypesMask)0x10000000) /**< Enable GQGSV type */ +#define LOC_NMEA_MASK_GIGSV_V02 ((NmeaSentenceTypesMask)0x20000000) /**< Enable GIGSV type */ +#define LOC_NMEA_MASK_GNDTM_V02 ((NmeaSentenceTypesMask)0x40000000) /**< Enable GNDTM type */ + // all bitmasks of general supported NMEA sentenses - debug is not part of this #define LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \ @@ -833,7 +847,12 @@ typedef uint32_t NmeaSentenceTypesMask; 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) + LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 | \ + LOC_NMEA_MASK_GPDTM_V02 | LOC_NMEA_MASK_GNGGA_V02 | LOC_NMEA_MASK_GNRMC_V02 | \ + LOC_NMEA_MASK_GNVTG_V02 | LOC_NMEA_MASK_GAGNS_V02 | LOC_NMEA_MASK_GBGGA_V02 | \ + LOC_NMEA_MASK_GBGSA_V02 | LOC_NMEA_MASK_GBGSV_V02 | LOC_NMEA_MASK_GBRMC_V02 | \ + LOC_NMEA_MASK_GBVTG_V02 | LOC_NMEA_MASK_GQGSV_V02 | LOC_NMEA_MASK_GIGSV_V02 | \ + LOC_NMEA_MASK_GNDTM_V02) typedef enum { LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0, From bbc8da3a74778f214cb9cb93a536d4bf0626121f Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Tue, 13 Aug 2019 23:00:15 +0530 Subject: [PATCH 896/945] Generate Navic SV NMEA sentence - GIGSV NMEA Sentence is generated when NMEA_PROVIDER is set to 0. Change-Id: I12db25a4f32d1b8fb325048c43b23aa7d0b5f671 CRs-Fixed: 2509063 --- utils/loc_nmea.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 2074e3e5..41a707dc 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -2076,5 +2076,13 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_BEIDOU, GNSS_SIGNAL_BEIDOU_B2AI,false), nmeaArraystr); + // ----------------------------- + // ------$GIGSV (NAVIC:L5)------ + // ----------------------------- + + loc_nmea_generate_GSV(svNotify, sentence, sizeof(sentence), + loc_nmea_sv_meta_init(sv_meta, sv_cache_info, GNSS_SV_TYPE_NAVIC, + GNSS_SIGNAL_NAVIC_L5,false), nmeaArraystr); + EXIT_LOG(%d, 0); } From f97d7aefe4a9c128a359aa32cc912aea60210ba4 Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Fri, 16 Aug 2019 11:02:27 +0530 Subject: [PATCH 897/945] Removing GPS_LOCK conf. from gps.conf To avoid confusion removing GPS_LOCK config. OEM can still configure gps_lock in carrier config.xml for Legacy devices that have the Android P type behavior CR's-Fixed: 2503505 Change-Id: I3e75c81f019dfda9eb5572acd9f6284503ff173e --- etc/gps.conf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 35a0a7e6..37b67d90 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -24,13 +24,6 @@ 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 – both MO and NI locked for maximal privacy -#GPS_LOCK = 3 - # supl version 1.0 SUPL_VER=0x10000 From 32e36b84e103862364a8a037272156b2b3814b6f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Thu, 15 Aug 2019 15:43:03 -0700 Subject: [PATCH 898/945] delete of shared LocApiBase::mMsgTask may cause issues mMsgTask is static, its delete would impact other LocApi objects which don't know it is deleted. Added refcount to manage this shared obj. Change-Id: Iea81039b9cd74081c5230d6bb18ea80c2ee05916 CRs-Fixed: 2505569 --- core/LocApiBase.cpp | 14 ++++++++------ core/LocApiBase.h | 9 +++++++-- utils/Makefile.am | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index ef204ec3..14472fa5 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -148,7 +148,8 @@ struct LocCloseMsg : public LocMsg { } }; -MsgTask* LocApiBase::mMsgTask; +MsgTask* LocApiBase::mMsgTask = nullptr; +volatile int32_t LocApiBase::mMsgTaskRefCount = 0; LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context) : @@ -157,6 +158,7 @@ LocApiBase::LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, { memset(mLocAdapters, 0, sizeof(mLocAdapters)); + android_atomic_inc(&mMsgTaskRefCount); if (nullptr == mMsgTask) { mMsgTask = new MsgTask("LocApiMsgTask", false); } @@ -230,7 +232,7 @@ 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)); + sendMsg(new LocOpenMsg(this, adapter)); break; } } @@ -263,10 +265,10 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) // if we have an empty list of adapters if (0 == i) { - mMsgTask->sendMsg(new LocCloseMsg(this)); + sendMsg(new LocCloseMsg(this)); } else { // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this)); + sendMsg(new LocOpenMsg(this)); } } } @@ -274,7 +276,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter) void LocApiBase::updateEvtMask() { - mMsgTask->sendMsg(new LocOpenMsg(this)); + sendMsg(new LocOpenMsg(this)); } void LocApiBase::updateNmeaMask(uint32_t mask) @@ -298,7 +300,7 @@ void LocApiBase::updateNmeaMask(uint32_t mask) } }; - mMsgTask->sendMsg(new LocSetNmeaMsg(this, mask)); + sendMsg(new LocSetNmeaMsg(this, mask)); } void LocApiBase::handleEngineUpEvent() diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 8c885f7f..6dac585b 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -34,6 +34,7 @@ #include #include #include +#include #include namespace loc_core { @@ -107,6 +108,7 @@ class LocApiBase { friend struct LocKillMsg; friend class ContextBase; static MsgTask* mMsgTask; + static volatile int32_t mMsgTaskRefCount; LocAdapterBase* mLocAdapters[MAX_ADAPTERS]; protected: @@ -121,7 +123,8 @@ protected: LocApiBase(LOC_API_ADAPTER_EVENT_MASK_T excludedMask, ContextBase* context = NULL); inline virtual ~LocApiBase() { - if (nullptr != mMsgTask) { + android_atomic_dec(&mMsgTaskRefCount); + if (nullptr != mMsgTask && 0 == mMsgTaskRefCount) { mMsgTask->destroy(); mMsgTask = nullptr; } @@ -132,7 +135,9 @@ protected: public: inline void sendMsg(const LocMsg* msg) const { - mMsgTask->sendMsg(msg); + if (nullptr != mMsgTask) { + mMsgTask->sendMsg(msg); + } } inline void destroy() { close(); diff --git a/utils/Makefile.am b/utils/Makefile.am index 807916da..9a9c67e9 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -29,6 +29,7 @@ libgps_utils_la_h_sources = \ gps_extended.h \ loc_gps.h \ log_util.h \ + LocSharedLock.h \ LocUnorderedSetMap.h libgps_utils_la_c_sources = \ From 39e34de194c0b1d4dc23e5eed05a63ad3b791393 Mon Sep 17 00:00:00 2001 From: haohuang Date: Thu, 15 Aug 2019 22:09:11 +0800 Subject: [PATCH 899/945] AgpsManager supports two clients AgpsManager supports two clients, QCOM AGPS Stack is to handle ATL type WWAN, AFW AGPS stack is used to handle ATL type SUPL and SUPL emergency. Change-Id: Id43c4919a1ae67d739e055c7fb5ba3abacc70b34 CRs-Fixed: 2509244 --- android/1.0/AGnss.cpp | 2 +- android/1.1/AGnss.cpp | 2 +- android/2.0/AGnss.cpp | 2 +- gnss/Agps.cpp | 16 ++++++++++++---- gnss/Agps.h | 15 +++++++++------ gnss/GnssAdapter.cpp | 24 ++++++------------------ gnss/GnssAdapter.h | 1 - utils/gps_extended_c.h | 11 +++++------ 8 files changed, 35 insertions(+), 38 deletions(-) diff --git a/android/1.0/AGnss.cpp b/android/1.0/AGnss.cpp index faaf75e5..79f665c5 100644 --- a/android/1.0/AGnss.cpp +++ b/android/1.0/AGnss.cpp @@ -105,7 +105,7 @@ Return AGnss::setCallback(const sp& callback) { AgpsCbInfo cbInfo = {}; cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; - cbInfo.cbPriority = AGPS_CB_PRIORITY_LOW; + cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES; mGnss->getGnssInterface()->agpsInit(cbInfo); return Void(); diff --git a/android/1.1/AGnss.cpp b/android/1.1/AGnss.cpp index fe50c9a0..d8f97065 100644 --- a/android/1.1/AGnss.cpp +++ b/android/1.1/AGnss.cpp @@ -105,7 +105,7 @@ Return AGnss::setCallback(const sp& callback) { AgpsCbInfo cbInfo = {}; cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; - cbInfo.cbPriority = AGPS_CB_PRIORITY_LOW; + cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES; mGnss->getGnssInterface()->agpsInit(cbInfo); return Void(); diff --git a/android/2.0/AGnss.cpp b/android/2.0/AGnss.cpp index 7bd015e7..a48f1a0d 100644 --- a/android/2.0/AGnss.cpp +++ b/android/2.0/AGnss.cpp @@ -107,7 +107,7 @@ Return AGnss::setCallback(const sp& callback) { AgpsCbInfo cbInfo = {}; cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb; - cbInfo.cbPriority = AGPS_CB_PRIORITY_HIGH; + cbInfo.atlType = AGPS_ATL_TYPE_SUPL | AGPS_ATL_TYPE_SUPL_ES; mGnss->getGnssInterface()->agpsInit(cbInfo); return Void(); diff --git a/gnss/Agps.cpp b/gnss/Agps.cpp index 7931d0c3..9255f88f 100644 --- a/gnss/Agps.cpp +++ b/gnss/Agps.cpp @@ -304,7 +304,7 @@ void AgpsStateMachine::requestOrReleaseDataConn(bool request){ nifRequest.status = LOC_GPS_RELEASE_AGPS_DATA_CONN; } - mAgpsManager->mFrameworkStatusV4Cb(nifRequest); + mFrameworkStatusV4Cb(nifRequest); } void AgpsStateMachine::notifyAllSubscribers( @@ -511,7 +511,7 @@ void AgpsStateMachine::dropAllSubscribers(){ /* CREATE AGPS STATE MACHINES * Must be invoked in Msg Handler context */ -void AgpsManager::createAgpsStateMachines() { +void AgpsManager::createAgpsStateMachines(const AgpsCbInfo& cbInfo) { LOC_LOGD("AgpsManager::createAgpsStateMachines"); @@ -519,13 +519,16 @@ void AgpsManager::createAgpsStateMachines() { ((loc_core::ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA) || (loc_core::ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB)); - if (NULL == mInternetNif) { + if (NULL == mInternetNif && (cbInfo.atlType & AGPS_ATL_TYPE_WWAN)) { mInternetNif = new AgpsStateMachine(this, LOC_AGPS_TYPE_WWAN_ANY); + mInternetNif->registerFrameworkStatusCallback((AgnssStatusIpV4Cb)cbInfo.statusV4Cb); LOC_LOGD("Internet NIF: %p", mInternetNif); } if (agpsCapable) { - if (NULL == mAgnssNif) { + if (NULL == mAgnssNif && (cbInfo.atlType & AGPS_ATL_TYPE_SUPL) && + (cbInfo.atlType & AGPS_ATL_TYPE_SUPL_ES)) { mAgnssNif = new AgpsStateMachine(this, LOC_AGPS_TYPE_SUPL); + mAgnssNif->registerFrameworkStatusCallback((AgnssStatusIpV4Cb)cbInfo.statusV4Cb); LOC_LOGD("AGNSS NIF: %p", mAgnssNif); } } @@ -544,6 +547,11 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) { LOC_LOGE("NULL AGNSS NIF !"); } return mAgnssNif; + case LOC_AGPS_TYPE_WWAN_ANY: + if (mInternetNif == NULL) { + LOC_LOGE("NULL Internet NIF !"); + } + return mInternetNif; default: return mInternetNif; } diff --git a/gnss/Agps.h b/gnss/Agps.h index 829cbd59..d559377a 100644 --- a/gnss/Agps.h +++ b/gnss/Agps.h @@ -137,6 +137,7 @@ protected: /* Current state for this state machine */ AgpsState mState; + AgnssStatusIpV4Cb mFrameworkStatusV4Cb; private: /* AGPS Type for this state machine LOC_AGPS_TYPE_ANY 0 @@ -154,6 +155,7 @@ private: public: /* CONSTRUCTOR */ AgpsStateMachine(AgpsManager* agpsManager, AGpsExtType agpsType): + mFrameworkStatusV4Cb(NULL), mAgpsManager(agpsManager), mSubscriberList(), mCurrentSubscriber(NULL), mState(AGPS_STATE_RELEASED), mAgpsType(agpsType), mAPN(NULL), mAPNLen(0), @@ -175,6 +177,10 @@ public: inline void setCurrentSubscriber(AgpsSubscriber* subscriber) { mCurrentSubscriber = subscriber; } + inline void registerFrameworkStatusCallback(AgnssStatusIpV4Cb frameworkStatusV4Cb) { + mFrameworkStatusV4Cb = frameworkStatusV4Cb; + } + /* Fetch subscriber with specified handle */ AgpsSubscriber* getSubscriber(int connHandle); @@ -234,7 +240,6 @@ class AgpsManager { public: /* CONSTRUCTOR */ AgpsManager(): - mFrameworkStatusV4Cb(NULL), mAtlOpenStatusCb(), mAtlCloseStatusCb(), mAgnssNif(NULL), mInternetNif(NULL)/*, mDsNif(NULL)*/ {} @@ -246,12 +251,11 @@ public: mAtlCloseStatusCb = atlCloseStatusCb; } - inline void registerFrameworkStatusCallback(AgnssStatusIpV4Cb frameworkStatusV4Cb) { - mFrameworkStatusV4Cb = frameworkStatusV4Cb; - } + /* Check if AGPS client is registered */ + inline bool isRegistered() { return nullptr != mAgnssNif || nullptr != mInternetNif; } /* Create all AGPS state machines */ - void createAgpsStateMachines(); + void createAgpsStateMachines(const AgpsCbInfo& cbInfo); /* Process incoming ATL requests */ void requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask apnTypeMask); @@ -266,7 +270,6 @@ public: void handleModemSSR(); protected: - AgnssStatusIpV4Cb mFrameworkStatusV4Cb; AgpsAtlOpenStatusCb mAtlOpenStatusCb; AgpsAtlCloseStatusCb mAtlCloseStatusCb; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 47e55270..f813c58f 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -80,7 +80,6 @@ GnssAdapter::GnssAdapter() : mGnssSvTypeConfigCb(nullptr), mNiData(), mAgpsManager(), - mAgpsCbInfo(), mOdcpiRequestCb(nullptr), mOdcpiRequestActive(false), mOdcpiTimer(this), @@ -2078,10 +2077,9 @@ GnssAdapter::updateClientsEventMask() mask); } - if (mAgpsCbInfo.statusV4Cb != NULL) { + if (mAgpsManager.isRegistered()) { mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; } - // Add ODCPI handling if (nullptr != mOdcpiRequestCb) { mask |= LOC_API_ADAPTER_BIT_REQUEST_WIFI; @@ -4111,27 +4109,17 @@ void GnssAdapter::initDefaultAgpsCommand() { /* INIT LOC AGPS MANAGER */ void GnssAdapter::initAgps(const AgpsCbInfo& cbInfo) { - LOC_LOGD("%s]: mAgpsCbInfo.cbPriority - %d; cbInfo.cbPriority - %d", - __func__, mAgpsCbInfo.cbPriority, cbInfo.cbPriority) + LOC_LOGD("%s]:cbInfo.atlType - %d", __func__, cbInfo.atlType); if (!((ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB) || (ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA))) { return; } - if (mAgpsCbInfo.cbPriority > cbInfo.cbPriority) { - return; - } else { - mAgpsCbInfo = cbInfo; - - mAgpsManager.registerFrameworkStatusCallback((AgnssStatusIpV4Cb)cbInfo.statusV4Cb); - - mAgpsManager.createAgpsStateMachines(); - - /* Register for AGPS event mask */ - updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, - LOC_REGISTRATION_MASK_ENABLED); - } + mAgpsManager.createAgpsStateMachines(cbInfo); + /* Register for AGPS event mask */ + updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, + LOC_REGISTRATION_MASK_ENABLED); } void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b84c3652..410a4b76 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -163,7 +163,6 @@ class GnssAdapter : public LocAdapterBase { /* ==== AGPS =========================================================================== */ // This must be initialized via initAgps() AgpsManager mAgpsManager; - AgpsCbInfo mAgpsCbInfo; void initAgps(const AgpsCbInfo& cbInfo); /* ==== NFW =========================================================================== */ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index e49b088b..20360324 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -194,15 +194,14 @@ typedef uint32_t LocApnTypeMask; /**< Denotes APN type for emergency */ #define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x00000200) -typedef enum { - AGPS_CB_PRIORITY_LOW = 1, - AGPS_CB_PRIORITY_MED = 2, - AGPS_CB_PRIORITY_HIGH = 3 -} AgpsCbPriority; +typedef uint32_t AGpsTypeMask; +#define AGPS_ATL_TYPE_SUPL ((AGpsTypeMask)0x00000001) +#define AGPS_ATL_TYPE_SUPL_ES ((AGpsTypeMask)0x00000002) +#define AGPS_ATL_TYPE_WWAN ((AGpsTypeMask)0x00000004) typedef struct { void* statusV4Cb; - AgpsCbPriority cbPriority; + AGpsTypeMask atlType; } AgpsCbInfo; typedef struct { From 1a1232c5949192d555f3e69aa7427dfcdbca7134 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Thu, 18 Jul 2019 15:50:55 -0700 Subject: [PATCH 900/945] GPS hw: report ppe/spe report with combined report When DRE/PPE are also running in the system, in addition to reporitng the combined final output, add the support to report the unmodified SPE/PPE report received from the engine Change-Id: Icb636824da32b175030dfcd2b270ac8b500ff75b CRs-fixed: 2487580 --- core/EngineHubProxyBase.h | 19 +++-- core/LocAdapterBase.cpp | 1 - core/LocAdapterBase.h | 6 +- core/LocApiBase.cpp | 1 - gnss/GnssAdapter.cpp | 132 ++++++++++++++++++++++++++++------- gnss/GnssAdapter.h | 6 +- location/LocationAPI.cpp | 1 + location/LocationDataTypes.h | 59 +++++++++++++++- utils/gps_extended_c.h | 24 +++++++ 9 files changed, 206 insertions(+), 43 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 4239a508..ec881f69 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -103,12 +103,8 @@ public: } }; -typedef std::function - GnssAdapterReportPositionEventCb; +typedef std::function + GnssAdapterReportEnginePositionsEventCb; typedef std::function @@ -119,11 +115,12 @@ typedef std::function // potential parameters: message queue: MsgTask * msgTask; // callback function to report back dr and ppe position and sv report -typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, - IOsObserver* osObserver, - GnssAdapterReportPositionEventCb positionEventCb, - GnssAdapterReportSvEventCb svEventCb, - GnssAdapterReqAidingDataCb reqAidingDataCb); +typedef EngineHubProxyBase* (getEngHubProxyFn)( + const MsgTask * msgTask, + IOsObserver* osObserver, + GnssAdapterReportEnginePositionsEventCb positionEventCb, + GnssAdapterReportSvEventCb svEventCb, + GnssAdapterReqAidingDataCb reqAidingDataCb); } // namespace loc_core diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index ffd3d5a1..1b844e57 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -81,7 +81,6 @@ void LocAdapterBase:: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool /*fromEngineHub*/, GnssDataNotification* pDataNotify, int msInWeek) { diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index b9b1f1e8..909b6fea 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -151,9 +151,13 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask, - bool fromEngineHub = false, GnssDataNotification* pDataNotify = nullptr, int msInWeek = -1); + virtual void reportEnginePositionsEvent(unsigned int count, + EngineLocationInfo* locationArr) { + (void)count; + (void)locationArr; + } virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub=false); virtual void reportDataEvent(const GnssDataNotification& dataNotify, int msInWeek); diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 14472fa5..8c79cf74 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -345,7 +345,6 @@ void LocApiBase::reportPosition(UlpLocation& location, TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPositionEvent(location, locationExtended, status, loc_technology_mask, - false, pDataNotify, msInWeek) ); } diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 47e55270..5e475692 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -485,6 +485,16 @@ GnssAdapter::convertLocationInfo(GnssLocationInfoNotification& out, out.flags |= GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT; out.calibrationStatus = locationExtended.calibrationStatus; } + + if (GPS_LOCATION_EXTENDED_HAS_OUTPUT_ENG_TYPE & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_OUTPUT_ENG_TYPE_BIT; + out.locOutputEngType = locationExtended.locOutputEngType; + } + + if (GPS_LOCATION_EXTENDED_HAS_OUTPUT_ENG_MASK & locationExtended.flags) { + out.flags |= GNSS_LOCATION_INFO_OUTPUT_ENG_MASK_BIT; + out.locOutputEngMask = locationExtended.locOutputEngMask; + } } @@ -3051,32 +3061,23 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromEngineHub, GnssDataNotification* pDataNotify, int msInWeek) { - // if this event is called from QMI LOC API, then send report to engine hub + // this position is from QMI LOC API, then send report to engine hub // if sending is successful, we return as we will wait for final report from engine hub // if the position is called from engine hub, then send it out directly - if (!fromEngineHub) { - // report QMI position (both propagated and unpropagated) to engine hub, - // and engine hub will be distributing it to the registered plugins + + if (true == initEngHubProxy()){ mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); - - if (true == ulpLocation.unpropagatedPosition) { - return; - } - - // engine hub is loaded, do not report qmi position to client as - // final position report should come from engine hub - if (true == initEngHubProxy()){ - return; - } + return; } - // for all other cases: - // case 1: fix is from engine hub, queue the msg - // case 2: fix is not from engine hub, e.g. from QMI, and it is not an + if (true == ulpLocation.unpropagatedPosition) { + return; + } + + // Fix is from QMI, and it is not an // unpropagated position and engine hub is not loaded, queue the msg // when message is queued, the position can be dispatched to requesting client struct MsgReportPosition : public LocMsg { @@ -3133,6 +3134,35 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, pDataNotify, msInWeek)); } +void +GnssAdapter::reportEnginePositionsEvent(unsigned int count, + EngineLocationInfo* locationArr) +{ + struct MsgReportEnginePositions : public LocMsg { + GnssAdapter& mAdapter; + unsigned int mCount; + EngineLocationInfo mEngLocInfo[LOC_OUTPUT_ENGINE_COUNT]; + inline MsgReportEnginePositions(GnssAdapter& adapter, + unsigned int count, + EngineLocationInfo* locationArr) : + LocMsg(), + mAdapter(adapter), + mCount(count) { + if (mCount > LOC_OUTPUT_ENGINE_COUNT) { + mCount = LOC_OUTPUT_ENGINE_COUNT; + } + if (mCount > 0) { + memcpy(mEngLocInfo, locationArr, sizeof(EngineLocationInfo)*mCount); + } + } + inline virtual void proc() const { + mAdapter.reportEnginePositions(mCount, mEngLocInfo); + } + }; + + sendMsg(new MsgReportEnginePositions(*this, count, locationArr)); +} + bool GnssAdapter::needReportForGnssClient(const UlpLocation& ulpLocation, enum loc_sess_status status, @@ -3187,9 +3217,20 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { if ((reportToFlpClient && isFlpClient(it->second)) || - (reportToGnssClient && !isFlpClient(it->second))) { + (reportToGnssClient && !isFlpClient(it->second))) { if (nullptr != it->second.gnssLocationInfoCb) { it->second.gnssLocationInfoCb(locationInfo); + } else if ((nullptr != it->second.engineLocationsInfoCb) && + (false == initEngHubProxy())) { + // if engine hub is disabled, this is SPE fix from modem + // we need to mark one copy marked as fused and one copy marked as PPE + // and dispatch it to the engineLocationsInfoCb + GnssLocationInfoNotification engLocationsInfo[2]; + engLocationsInfo[0] = locationInfo; + engLocationsInfo[0].locOutputEngType = LOC_OUTPUT_ENGINE_FUSED; + engLocationsInfo[0].flags |= GNSS_LOCATION_INFO_OUTPUT_ENG_TYPE_BIT; + engLocationsInfo[1] = locationInfo; + it->second.engineLocationsInfoCb(2, engLocationsInfo); } else if (nullptr != it->second.trackingCb) { it->second.trackingCb(locationInfo.location); } @@ -3237,6 +3278,48 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, } } +void +GnssAdapter::reportEnginePositions(unsigned int count, + const EngineLocationInfo* locationArr) +{ + bool needReportEnginePositions = false; + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.engineLocationsInfoCb) { + needReportEnginePositions = true; + break; + } + } + + GnssLocationInfoNotification locationInfo[LOC_OUTPUT_ENGINE_COUNT] = {}; + for (unsigned int i = 0; i < count; i++) { + const EngineLocationInfo* engLocation = (locationArr+i); + // if it is fused/default location, call reportPosition maintain legacy behavior + if ((GPS_LOCATION_EXTENDED_HAS_OUTPUT_ENG_TYPE & engLocation->locationExtended.flags) && + (LOC_OUTPUT_ENGINE_FUSED == engLocation->locationExtended.locOutputEngType)) { + reportPosition(engLocation->location, + engLocation->locationExtended, + engLocation->sessionStatus, + engLocation->location.tech_mask); + } + + if (needReportEnginePositions) { + convertLocationInfo(locationInfo[i], engLocation->locationExtended); + convertLocation(locationInfo[i].location, + engLocation->location, + engLocation->locationExtended, + engLocation->location.tech_mask); + } + } + + if (needReportEnginePositions) { + for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { + if (nullptr != it->second.engineLocationsInfoCb) { + it->second.engineLocationsInfoCb(count, locationInfo); + } + } + } +} + void GnssAdapter::reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub) @@ -4920,15 +5003,10 @@ GnssAdapter::initEngHubProxy() { // prepare the callback functions // callback function for engine hub to report back position event - GnssAdapterReportPositionEventCb reportPositionEventCb = - [this](const UlpLocation& ulpLocation, - const GpsLocationExtended& locationExtended, - enum loc_sess_status status, - LocPosTechMask techMask, - bool fromEngineHub) { + GnssAdapterReportEnginePositionsEventCb reportPositionEventCb = + [this](int count, EngineLocationInfo* locationArr) { // report from engine hub on behalf of PPE will be treated as fromUlp - reportPositionEvent(ulpLocation, locationExtended, status, - techMask, fromEngineHub); + reportEnginePositionsEvent(count, locationArr); }; // callback function for engine hub to report back sv event diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index b84c3652..752adcaa 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -351,9 +351,11 @@ public: const GpsLocationExtended& locationExtended, enum loc_sess_status status, LocPosTechMask techMask, - bool fromEngineHub = false, GnssDataNotification* pDataNotify = nullptr, int msInWeek = -1); + virtual void reportEnginePositionsEvent(unsigned int count, + EngineLocationInfo* locationArr); + virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromEngineHub=false); virtual void reportNmeaEvent(const char* nmea, size_t length); @@ -386,6 +388,8 @@ public: const GpsLocationExtended &locationExtended, enum loc_sess_status status, LocPosTechMask techMask); + void reportEnginePositions(unsigned int count, + const EngineLocationInfo* locationArr); void reportSv(GnssSvNotification& svNotify); void reportNmea(const char* nmea, size_t length); void reportData(GnssDataNotification& dataNotify); diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index a43178d1..4348c276 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -85,6 +85,7 @@ static bool isGnssClient(LocationCallbacks& locationCallbacks) return (locationCallbacks.gnssNiCb != nullptr || locationCallbacks.trackingCb != nullptr || locationCallbacks.gnssLocationInfoCb != nullptr || + locationCallbacks.engineLocationsInfoCb != nullptr || locationCallbacks.gnssMeasurementsCb != nullptr); } diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 49822fa5..27c5157b 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -175,6 +175,8 @@ typedef enum { GNSS_LOCATION_INFO_NUM_SV_USED_IN_POSITION_BIT = (1<<24), // number of SV used in position GNSS_LOCATION_INFO_CALIBRATION_CONFIDENCE_BIT = (1<<25), // valid sensor cal confidence GNSS_LOCATION_INFO_CALIBRATION_STATUS_BIT = (1<<26), // valid sensor cal status + GNSS_LOCATION_INFO_OUTPUT_ENG_TYPE_BIT = (1<<27), // valid output engine type + GNSS_LOCATION_INFO_OUTPUT_ENG_MASK_BIT = (1<<28), // valid output engine mask } GnssLocationInfoFlagBits; typedef enum { @@ -646,6 +648,13 @@ typedef enum { GNSS_LOC_MAX_NUMBER_OF_SIGNAL_TYPES = 20 /**< Maximum number of signal types */ } Gnss_LocSignalEnumType; +typedef uint32_t PositioningEngineMask; +typedef enum { + STANDARD_POSITIONING_ENGINE = (1 << 0), + DEAD_RECKONING_ENGINE = (1 << 1), + PRECISE_POSITIONING_ENGINE = (1 << 2) +} PositioningEngineBits; + typedef uint64_t GnssDataMask; typedef enum { // Jammer Indicator is available @@ -731,15 +740,35 @@ typedef struct { LocationSpoofMask spoofMask; } Location; +typedef enum { + LOC_REQ_ENGINE_FUSED_BIT = (1<<0), + LOC_REQ_ENGINE_SPE_BIT = (1<<1), + LOC_REQ_ENGINE_PPE_BIT = (1<<2), +} LocReqEngineTypeMask; + +typedef enum { + LOC_OUTPUT_ENGINE_FUSED = 0, + /** This is the GNSS fix from modem */ + LOC_OUTPUT_ENGINE_SPE = 1, + /** This is the GNSS fix with correction PPP/RTK correction */ + LOC_OUTPUT_ENGINE_PPE = 2, + LOC_OUTPUT_ENGINE_COUNT, +} LocOutputEngineType; + struct LocationOptions { uint32_t size; // set to sizeof(LocationOptions) uint32_t minInterval; // in milliseconds uint32_t minDistance; // in meters. if minDistance > 0, gnssSvCallback/gnssNmeaCallback/ // gnssMeasurementsCallback may not be called GnssSuplMode mode; // Standalone/MS-Based/MS-Assisted + // behavior when this field is 0: + // if engine hub is running, this will be fused fix, + // if engine hub is not running, this will be SPE fix + LocReqEngineTypeMask locReqEngTypeMask; inline LocationOptions() : - size(0), minInterval(0), minDistance(0), mode(GNSS_SUPL_MODE_STANDALONE) {} + size(0), minInterval(0), minDistance(0), mode(GNSS_SUPL_MODE_STANDALONE), + locReqEngTypeMask((LocReqEngineTypeMask)0) {} }; typedef enum { @@ -764,9 +793,11 @@ struct TrackingOptions : LocationOptions { inline TrackingOptions(const LocationOptions& options) : LocationOptions(options), powerMode(GNSS_POWER_MODE_INVALID), tbm(0) {} inline void setLocationOptions(const LocationOptions& options) { + size = sizeof(TrackingOptions); minInterval = options.minInterval; minDistance = options.minDistance; mode = options.mode; + locReqEngTypeMask = options.locReqEngTypeMask; } inline LocationOptions getLocationOptions() { LocationOptions locOption; @@ -774,6 +805,7 @@ struct TrackingOptions : LocationOptions { locOption.minDistance = minDistance; locOption.minInterval = minInterval; locOption.mode = mode; + locOption.locReqEngTypeMask = locReqEngTypeMask; return locOption; } }; @@ -997,6 +1029,16 @@ typedef struct { uint8_t calibrationConfidence; // Sensor calibration confidence percent, // in range of [0, 100] DrCalibrationStatusMask calibrationStatus; // Sensor calibration status + // location engine type. When the fix. when the type is set to + // LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated + // reports from all engines running on the system (e.g.: + // DR/SPE/PPE) based proprietary algorithm. To check which + // location engine contributes to the fused output, check for + // locOutputEngMask. + LocOutputEngineType locOutputEngType; + // when loc output eng type is set to fused, this field + // indicates the set of engines contribute to the fix. + PositioningEngineMask locOutputEngMask; } GnssLocationInfoNotification; typedef struct { @@ -1317,6 +1359,20 @@ typedef std::function gnssLocationInfoCallback; +/* Gives default combined location information from all engines and + location information individually from selected engines. + This callback is only used when there are multiple engines + running in the system. + + optional can be NULL + + engineLocationsInfoCallback is called only during a tracking session + broadcasted to all clients, no matter if a session has started by client */ +typedef std::function engineLocationsInfoCallback; + /* Used for addGeofences API, optional can be NULL geofenceBreachCallback is called when any number of geofences have a state change */ typedef std::function Date: Mon, 19 Aug 2019 10:57:41 +0800 Subject: [PATCH 901/945] Remove LPPe UP/CP config in gps.conf LPPE_CP_TECHNOLOGY and LPPE_UP_TECHNOLOGY can be configured per SIM so they should not be overriden by gps.conf by default. Leave commented out for testing purpose; Add check before LPPe injection when engine up. Change-Id: I1b9b33009ec45d0a14c2e50e29d0a9df636a6319 CRs-fixed: 2505512 --- etc/gps.conf | 4 ++-- gnss/GnssAdapter.cpp | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index 37b67d90..f773e818 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -117,7 +117,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe CP # 0x4: SRN AP measurement for CP # 0x8: Sensor Barometer Measurement LPPe CP -LPPE_CP_TECHNOLOGY = 0 +#LPPE_CP_TECHNOLOGY = 0 ################################################## # Select technology for LPPe User Plane @@ -126,7 +126,7 @@ LPPE_CP_TECHNOLOGY = 0 # 0x2: WLAN AP Measurements for LPPe UP # 0x4: SRN AP measurement for UP # 0x8: Sensor Barometer Measurement LPPe UP -LPPE_UP_TECHNOLOGY = 0 +#LPPE_UP_TECHNOLOGY = 0 ################################################## # AGPS_CONFIG_INJECT diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 47e55270..7b5527ac 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -722,8 +722,6 @@ GnssAdapter::setConfig() //cache the injected configuration with GnssConfigRequested struct GnssConfig gnssConfigRequested = {}; gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | - GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; /* Here we process an SSR. We need to set the GPS_LOCK to the proper values, as follows: 1. Q behavior. This is identified by mSupportNfwControl being 1. In this case @@ -756,10 +754,17 @@ GnssAdapter::setConfig() gnssConfigRequested.aGlonassPositionProtocolMask = gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; } - gnssConfigRequested.lppeControlPlaneMask = - mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); - gnssConfigRequested.lppeUserPlaneMask = - mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); + if (gpsConf.LPPE_CP_TECHNOLOGY) { + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT; + gnssConfigRequested.lppeControlPlaneMask = + mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); + } + + if (gpsConf.LPPE_UP_TECHNOLOGY) { + gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT; + gnssConfigRequested.lppeUserPlaneMask = + mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY); + } gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(), mBlacklistedSvIds.end()); mLocApi->sendMsg(new LocApiMsg( From 4e9fee0ebda64609d4ff50e06c567021cc945dc8 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Tue, 9 Jul 2019 15:46:46 +0530 Subject: [PATCH 902/945] gps: Add diag permissions for gnss service Change-Id: I1e65ce2a2e681f48b476fb8b310015f572f306e1 CRs-Fixed: 2413585 --- android/1.0/android.hardware.gnss@1.0-service-qti.rc | 2 +- android/1.1/android.hardware.gnss@1.1-service-qti.rc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/1.0/android.hardware.gnss@1.0-service-qti.rc b/android/1.0/android.hardware.gnss@1.0-service-qti.rc index b5da6f97..1fbd8935 100644 --- a/android/1.0/android.hardware.gnss@1.0-service-qti.rc +++ b/android/1.0/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class hal user gps - group system gps radio + group system gps radio vendor_qti_diag diff --git a/android/1.1/android.hardware.gnss@1.1-service-qti.rc b/android/1.1/android.hardware.gnss@1.1-service-qti.rc index 41b105b9..bd655841 100644 --- a/android/1.1/android.hardware.gnss@1.1-service-qti.rc +++ b/android/1.1/android.hardware.gnss@1.1-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti class hal user gps - group system gps radio + group system gps radio vendor_qti_diag From 42e8ab01901a627bef050179be7dbb725abd5787 Mon Sep 17 00:00:00 2001 From: Santoshkumar Zalake Date: Fri, 7 Jun 2019 13:55:19 +0530 Subject: [PATCH 903/945] Add GNSS Deployment Support. The GNSS Deployment is used to configure GNSS Hardware using gps.conf file CRs-Fixed: 2480150 Change-Id: Ia09d3165de0c2f80f23bef8c0431095b25d16ea2 --- core/ContextBase.cpp | 26 +++++++++++++++++++++----- core/ContextBase.h | 1 + etc/gps.conf | 10 ++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 084b6bfb..b6029895 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -40,6 +40,10 @@ namespace loc_core { +#define SLL_LOC_API_LIB_NAME "libsynergy_loc_api.so" +#define LOC_APIV2_0_LIB_NAME "libloc_api_v02.so" +#define IS_SS5_HW_ENABLED 1 + loc_gps_cfg_s_type ContextBase::mGps_conf {}; loc_sap_cfg_s_type ContextBase::mSap_conf {}; bool ContextBase::sIsEngineCapabilitiesKnown = false; @@ -80,6 +84,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' }, {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' }, + {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -171,10 +176,16 @@ void ContextBase::readConfig() mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; /* default configuration value of position assisted clock estimator mode */ mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; + /* default configuration QCOM GNSS H/W */ + mGps_conf.GNSS_DEPLOYMENT = 0; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); + LOC_LOGI("%s] GNSS Deployment: %s", __FUNCTION__, + ((mGps_conf.GNSS_DEPLOYMENT == 1) ? "SS5" : + ((mGps_conf.GNSS_DEPLOYMENT == 2) ? "QFUSION" : "QGNSS"))); + switch (getTargetGnssType(loc_get_target())) { case GNSS_GSS: case GNSS_AUTO: @@ -231,19 +242,24 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName) LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) { LocApiBase* locApi = NULL; + const char* libname = LOC_APIV2_0_LIB_NAME; // Check the target if (TARGET_NO_GNSS != loc_get_target()){ if (NULL == (locApi = mLBSProxy->getLocApi(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__); + + if (IS_SS5_HW_ENABLED == mGps_conf.GNSS_DEPLOYMENT) { + libname = SLL_LOC_API_LIB_NAME; + } + + if ((handle = dlopen(libname, RTLD_NOW)) != NULL) { + LOC_LOGD("%s:%d]: %s is present", __func__, __LINE__, libname); getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); if (getter != NULL) { - LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, - __LINE__); + LOC_LOGD("%s:%d]: getter is not NULL of %s", __func__, + __LINE__, libname); locApi = (*getter)(exMask, this); } } diff --git a/core/ContextBase.h b/core/ContextBase.h index ab61a084..5da76e26 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -73,6 +73,7 @@ typedef struct loc_gps_cfg_s uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING]; uint32_t CP_MTLR_ES; + uint32_t GNSS_DEPLOYMENT; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/etc/gps.conf b/etc/gps.conf index f773e818..c247cbd3 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -287,3 +287,13 @@ PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation ##################################### # CP MTLR ES, 1=enable, 0=disable CP_MTLR_ES=0 + +################################################## +# GNSS_DEPLOYMENT +################################################## +# 0 : Enable QCOM GNSS (default) +# 1 : Enable QCSR SS5 +# This setting use to select between QCOM GNSS +# and QCSR SS5 hardware receiver. +# By default QCOM GNSS receiver is enabled. +# GNSS_DEPLOYMENT = 0 From 0df749e3635c8568c38babdfad81a4b0d1e5ce39 Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Thu, 29 Aug 2019 14:24:46 +0530 Subject: [PATCH 904/945] Adding one level of context swith for Geofence_add Added one more context switch for geofence add command. To even out total number of the context switch as it is for remove/modify/pause command. This will prevent out of order execution of sent msg tasks. Change-Id: Icf1f39ee3526e2e45cfe3e84945f71524941069b CRs-Fixed: 2516790 --- geofence/GeofenceAdapter.cpp | 49 +++++++++++++++++--------------- location/LocationAPIClientBase.h | 2 ++ 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/geofence/GeofenceAdapter.cpp b/geofence/GeofenceAdapter.cpp index b8746fbc..e2995896 100644 --- a/geofence/GeofenceAdapter.cpp +++ b/geofence/GeofenceAdapter.cpp @@ -242,30 +242,33 @@ GeofenceAdapter::addGeofencesCommand(LocationAPI* client, size_t count, Geofence if (NULL == mIds || NULL == mOptions || NULL == mInfos) { errs[i] = LOCATION_ERROR_INVALID_PARAMETER; } else { - mApi.addGeofence(mIds[i], - mOptions[i], - mInfos[i], - new LocApiResponseData(*mAdapter.getContext(), - [&mAdapter = mAdapter, mOptions = mOptions, mClient = mClient, - mCount = mCount, mIds = mIds, mInfos = mInfos, errs, i] - (LocationError err, LocApiGeofenceData data) { - if (LOCATION_ERROR_SUCCESS == err) { - mAdapter.saveGeofenceItem(mClient, - mIds[i], - data.hwId, - mOptions[i], - mInfos[i]); - } - errs[i] = err; + mApi.addToCallQueue(new LocApiResponse(*mAdapter.getContext(), + [&mAdapter = mAdapter, mCount = mCount, mClient = mClient, + mOptions = mOptions, mInfos = mInfos, mIds = mIds, &mApi = mApi, + errs, i] (LocationError err ) { + mApi.addGeofence(mIds[i], mOptions[i], mInfos[i], + new LocApiResponseData(*mAdapter.getContext(), + [&mAdapter = mAdapter, mOptions = mOptions, mClient = mClient, + mCount = mCount, mIds = mIds, mInfos = mInfos, errs, i] + (LocationError err, LocApiGeofenceData data) { + if (LOCATION_ERROR_SUCCESS == err) { + mAdapter.saveGeofenceItem(mClient, + mIds[i], + data.hwId, + mOptions[i], + mInfos[i]); + } + errs[i] = err; - // Send aggregated response on last item and cleanup - if (i == mCount-1) { - mAdapter.reportResponse(mClient, mCount, errs, mIds); - delete[] errs; - delete[] mIds; - delete[] mOptions; - delete[] mInfos; - } + // Send aggregated response on last item and cleanup + if (i == mCount-1) { + mAdapter.reportResponse(mClient, mCount, errs, mIds); + delete[] errs; + delete[] mIds; + delete[] mOptions; + delete[] mInfos; + } + })); })); } } diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index fddae604..098000c5 100644 --- a/location/LocationAPIClientBase.h +++ b/location/LocationAPIClientBase.h @@ -488,6 +488,7 @@ private: for (size_t i = 0; i < count; i++) { ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); } + LOC_LOGD("%s:]Returned geofence-id: %d in add geofence", __FUNCTION__, *ids); mAPI.onAddGeofencesCb(count, errors, ids); free(ids); } @@ -505,6 +506,7 @@ private: for (size_t i = 0; i < count; i++) { ids[i] = mRemovedGeofenceBiDict->getId(sessions[i]); } + LOC_LOGD("%s:]Returned geofence-id: %d in remove geofence", __FUNCTION__, *ids); mAPI.onRemoveGeofencesCb(count, errors, ids); free(ids); delete(mRemovedGeofenceBiDict); From 1209591f9428c6777ad52461f901cb4c9351d5cd Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 6 Aug 2019 16:38:12 -0700 Subject: [PATCH 905/945] change some of the comments that contain prohibited words Change-Id: Iaa8009e245edbcbc5adbe2348de4a014271c0ef9 CRs-Fixed: 2504418 --- location/LocationDataTypes.h | 5 ++--- utils/gps_extended_c.h | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 27c5157b..504b5cc5 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1032,9 +1032,8 @@ typedef struct { // location engine type. When the fix. when the type is set to // LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated // reports from all engines running on the system (e.g.: - // DR/SPE/PPE) based proprietary algorithm. To check which - // location engine contributes to the fused output, check for - // locOutputEngMask. + // DR/SPE/PPE). To check which location engine contributes to + // the fused output, check for locOutputEngMask. LocOutputEngineType locOutputEngType; // when loc output eng type is set to fused, this field // indicates the set of engines contribute to the fix. diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 819e77b2..69a659ee 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -807,9 +807,8 @@ typedef struct { /* location engine type. When the fix. when the type is set to LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated reports from all engines running on the system (e.g.: - DR/SPE/PPE) based proprietary algorithm. To check which - location engine contributes to the fused output, check for - locOutputEngMask. */ + DR/SPE/PPE). To check which location engine contributes to + the fused output, check for locOutputEngMask. */ LocOutputEngineType locOutputEngType; /* when loc output eng type is set to fused, this field indicates the set of engines contribute to the fix. */ From f4dc944333c54a5455d17b6bd7c02d2ededb6e4a Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Sun, 1 Sep 2019 10:52:23 +0530 Subject: [PATCH 906/945] Make use of USE_GLIB flags for LE related functions We were making use of USE_QCMAP which was not defined in configure files. Change-Id: I12f823a79b0036502b832a3fb40a93828bde6f59 CRs-Fixed: 2521803 --- core/SystemStatusOsObserver.cpp | 2 +- core/SystemStatusOsObserver.h | 8 ++++---- core/observer/IFrameworkActionReq.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/SystemStatusOsObserver.cpp b/core/SystemStatusOsObserver.cpp index 3fdb5130..0427380c 100644 --- a/core/SystemStatusOsObserver.cpp +++ b/core/SystemStatusOsObserver.cpp @@ -448,7 +448,7 @@ void SystemStatusOsObserver::turnOff(DataItemId dit) } } -#ifdef USE_QCMAP +#ifdef USE_GLIB bool SystemStatusOsObserver::connectBackhaul() { bool result = false; diff --git a/core/SystemStatusOsObserver.h b/core/SystemStatusOsObserver.h index 87109762..fd606063 100644 --- a/core/SystemStatusOsObserver.h +++ b/core/SystemStatusOsObserver.h @@ -84,7 +84,7 @@ public: mSystemStatus(systemstatus), mContext(msgTask, this), mAddress("SystemStatusOsObserver"), mClientToDataItems(MAX_DATA_ITEM_ID), mDataItemToClients(MAX_DATA_ITEM_ID) -#ifdef USE_QCMAP +#ifdef USE_GLIB , mBackHaulConnectReqCount(0) #endif { @@ -106,7 +106,7 @@ public: // To set the framework action request object inline void setFrameworkActionReqObj(IFrameworkActionReq* frameworkActionReqObj) { mContext.mFrameworkActionReqObj = frameworkActionReqObj; -#ifdef USE_QCMAP +#ifdef USE_GLIB if (mBackHaulConnectReqCount > 0) { connectBackhaul(); mBackHaulConnectReqCount = 0; @@ -134,7 +134,7 @@ public: // IFrameworkActionReq Overrides virtual void turnOn(DataItemId dit, int timeOut = 0) override; virtual void turnOff(DataItemId dit) override; -#ifdef USE_QCMAP +#ifdef USE_GLIB virtual bool connectBackhaul() override; virtual bool disconnectBackhaul(); #endif @@ -151,7 +151,7 @@ private: // Cache the subscribe and requestData till subscription obj is obtained void cacheObserverRequest(ObserverReqCache& reqCache, const list& l, IDataItemObserver* client); -#ifdef USE_QCMAP +#ifdef USE_GLIB // Cache the framework action request for connect/disconnect int mBackHaulConnectReqCount; #endif diff --git a/core/observer/IFrameworkActionReq.h b/core/observer/IFrameworkActionReq.h index a4ccad8a..4be947ff 100644 --- a/core/observer/IFrameworkActionReq.h +++ b/core/observer/IFrameworkActionReq.h @@ -70,7 +70,7 @@ public: */ virtual void turnOff (DataItemId dit) = 0; -#ifdef USE_QCMAP +#ifdef USE_GLIB /** * @brief Setup WWAN backhaul * @details Setup WWAN backhaul From c891e738f547e1ae9c4fa246e574a47c7c83e496 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Wed, 28 Aug 2019 18:18:21 -0700 Subject: [PATCH 907/945] LocIpc sender recv and recver send Added two APIs, which allow ILocIpcListener to provide a sender for sending data back to LocIpcSender; and to allow a LocIpcSender to get a recver from the last send target so that it can receive data from it. Change-Id: I94e2204a2588d375805d0674d1e877bbe414c99f CRs-Fixed: 2524039 --- gnss/XtraSystemStatusObserver.cpp | 3 +- utils/LocIpc.cpp | 70 +++++++++++-------------------- utils/LocIpc.h | 35 +++++++++++++--- 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/gnss/XtraSystemStatusObserver.cpp b/gnss/XtraSystemStatusObserver.cpp index 1671c76d..a58f7357 100644 --- a/gnss/XtraSystemStatusObserver.cpp +++ b/gnss/XtraSystemStatusObserver.cpp @@ -65,7 +65,8 @@ public: inline XtraIpcListener(IOsObserver* observer, const MsgTask* msgTask, XtraSystemStatusObserver& xsso) : mSystemStatusObsrvr(observer), mMsgTask(msgTask), mXSSO(xsso) {} - virtual void onReceive(const char* data, uint32_t length) override { + virtual void onReceive(const char* data, uint32_t length, + const LocIpcRecver* recver) override { #define STRNCMP(str, constStr) strncmp(str, constStr, sizeof(constStr)-1) if (!STRNCMP(data, "ping")) { LOC_LOGd("ping received"); diff --git a/utils/LocIpc.cpp b/utils/LocIpc.cpp index f4dd0b40..e9dbe9da 100644 --- a/utils/LocIpc.cpp +++ b/utils/LocIpc.cpp @@ -66,18 +66,18 @@ ssize_t Sock::send(const void *buf, uint32_t len, int flags, const struct sockad SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen)); return rtv; } -ssize_t Sock::recv(const shared_ptr& dataCb, int flags, struct sockaddr *srcAddr, - socklen_t *addrlen, int sid) const { +ssize_t Sock::recv(const LocIpcRecver& recver, const shared_ptr& dataCb, int flags, + struct sockaddr *srcAddr, socklen_t *addrlen, int sid) const { ssize_t rtv = -1; if (-1 == sid) { sid = mSid; } // else it sid would be connection based socket id for recv SOCK_OP_AND_LOG(dataCb.get(), mMaxTxSize, isValid(), rtv, - recvfrom(dataCb, sid, flags, srcAddr, addrlen)); + recvfrom(recver, dataCb, sid, flags, srcAddr, addrlen)); return rtv; } ssize_t Sock::sendto(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, - socklen_t addrlen) const { + socklen_t addrlen) const { ssize_t rtv = -1; if (len <= mMaxTxSize) { rtv = ::sendto(mSid, buf, len, flags, destAddr, addrlen); @@ -94,19 +94,18 @@ ssize_t Sock::sendto(const void *buf, size_t len, int flags, const struct sockad } return rtv; } -ssize_t Sock::recvfrom(const shared_ptr& dataCb, int sid, int flags, - struct sockaddr *srcAddr, socklen_t *addrlen) const { - ssize_t nBytes = -1; +ssize_t Sock::recvfrom(const LocIpcRecver& recver, const shared_ptr& dataCb, + int sid, int flags, struct sockaddr *srcAddr, socklen_t *addrlen) const { std::string msg(mMaxTxSize, 0); - - if ((nBytes = ::recvfrom(sid, (void*)msg.data(), msg.size(), flags, srcAddr, addrlen)) > 0) { + ssize_t nBytes = ::recvfrom(sid, (void*)msg.data(), msg.size(), flags, srcAddr, addrlen); + if (nBytes > 0) { if (strncmp(msg.data(), MSG_ABORT, sizeof(MSG_ABORT)) == 0) { LOC_LOGi("recvd abort msg.data %s", msg.data()); nBytes = 0; } else if (strncmp(msg.data(), LOC_IPC_HEAD, sizeof(LOC_IPC_HEAD) - 1)) { // short message msg.resize(nBytes); - dataCb->onReceive(msg.data(), nBytes); + dataCb->onReceive(msg.data(), nBytes, &recver); } else { // long message size_t msgLen = 0; @@ -119,7 +118,7 @@ ssize_t Sock::recvfrom(const shared_ptr& dataCb, int sid, int f } if (nBytes > 0) { nBytes = msgLen; - dataCb->onReceive(msg.data(), nBytes); + dataCb->onReceive(msg.data(), nBytes, &recver); } } } @@ -152,7 +151,7 @@ class LocIpcLocalRecver : public LocIpcLocalSender, public LocIpcRecver { protected: inline virtual ssize_t recv() const override { socklen_t size = sizeof(mAddr); - return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); + return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size); } public: inline LocIpcLocalRecver(const shared_ptr& listener, const char* name) : @@ -189,6 +188,10 @@ protected: return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); } public: + inline LocIpcInetSender(const LocIpcInetSender& sender) : + mSockType(sender.mSockType), mSock(sender.mSock), + mName(sender.mName), mAddr(sender.mAddr) { + } inline LocIpcInetSender(const char* name, int32_t port, int sockType) : LocIpcSender(), mSockType(sockType), mSock(make_shared((nullptr == name) ? -1 : (::socket(AF_INET, mSockType, 0)))), @@ -202,6 +205,10 @@ public: } } } + + unique_ptr getRecver(const shared_ptr& listener) override { + return make_unique(listener, *this, mSock); + } }; class LocIpcInetTcpSender : public LocIpcInetSender { @@ -245,7 +252,9 @@ public: mSock->sendAbort(0, (struct sockaddr*)&loopBackAddr, sizeof(loopBackAddr)); } } - + inline virtual unique_ptr getLastSender() const override { + return make_unique(static_cast(*this)); + } }; class LocIpcInetTcpRecver : public LocIpcInetRecver { @@ -260,7 +269,7 @@ protected: mConnFd = -1; } } - return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); + return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); } public: inline LocIpcInetTcpRecver(const shared_ptr& listener, const char* name, @@ -273,7 +282,7 @@ class LocIpcInetUdpRecver : public LocIpcInetRecver { protected: inline virtual ssize_t recv() const override { socklen_t size = sizeof(mAddr); - return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); + return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size); } public: inline LocIpcInetUdpRecver(const shared_ptr& listener, const char* name, @@ -283,37 +292,6 @@ public: inline virtual ~LocIpcInetUdpRecver() {} }; - - -#ifdef NOT_DEFINED -class LocIpcQcsiSender : public LocIpcSender { -protected: - inline virtual bool isOperable() const override { - return mService != nullptr && mService->isServiceRegistered(); - } - inline virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t msgId) const override { - return mService->sendIndToClient(msgId, data, length); - } - inline LocIpcQcsiSender(shared_ptr& service) : mService(service) {} -public: - inline virtual ~LocIpcQcsi() {} -}; - -class LocIpcQcsiRecver : public LocIpcQcsiSender, public LocIpcRecver { -protected: - inline virtual ssize_t recv() const override { return mService->recv(); } -public: - inline LocIpcQcsiRecver(unique_ptr& service) : - LocIpcQcsiSender(service), LocIpcRecver(mService->getDataCallback(), *this) { - } - // only the dele - inline ~LocIpcQcsiRecver() {} - inline virtual const char* getName() const override { return mService->getName().data(); }; - inline virtual void abort() const override { if (isSendable()) mService->abort(); } - shared_ptr getSender() { return make_pare(mService); } -}; -#endif - class LocIpcRunnable : public LocRunnable { bool mAbortCalled; LocIpc& mLocIpc; diff --git a/utils/LocIpc.h b/utils/LocIpc.h index af4c2c3a..d6f8d1d8 100644 --- a/utils/LocIpc.h +++ b/utils/LocIpc.h @@ -53,7 +53,7 @@ public: // LocIpc client can overwrite this function to get notification // when the socket for LocIpc is ready to receive messages. inline virtual void onListenerReady() {} - virtual void onReceive(const char* data, uint32_t length)= 0; + virtual void onReceive(const char* data, uint32_t len, const LocIpcRecver* recver) = 0; }; @@ -123,15 +123,18 @@ private: class LocIpcSender { protected: LocIpcSender() = default; - virtual ~LocIpcSender() = default; virtual bool isOperable() const = 0; virtual ssize_t send(const uint8_t data[], uint32_t length, int32_t msgId) const = 0; public: + virtual ~LocIpcSender() = default; virtual void informRecverRestarted() {} inline bool isSendable() const { return isOperable(); } inline bool sendData(const uint8_t data[], uint32_t length, int32_t msgId) const { return isSendable() && (send(data, length, msgId) > 0); } + virtual unique_ptr getRecver(const shared_ptr& listener) { + return nullptr; + } }; class LocIpcRecver { @@ -148,6 +151,9 @@ public: inline bool recvData() const { return isRecvable() && (recv() > 0); } inline bool isRecvable() const { return mDataCb != nullptr && mIpcSender.isSendable(); } virtual void onListenerReady() { if (mDataCb != nullptr) mDataCb->onListenerReady(); } + inline virtual unique_ptr getLastSender() const { + return nullptr; + } virtual void abort() const = 0; virtual const char* getName() const = 0; }; @@ -158,8 +164,8 @@ class Sock { const uint32_t mMaxTxSize; ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *destAddr, socklen_t addrlen) const; - ssize_t recvfrom(const shared_ptr& dataCb, int sid, int flags, - struct sockaddr *srcAddr, socklen_t *addrlen) const; + ssize_t recvfrom(const LocIpcRecver& recver, const shared_ptr& dataCb, + int sid, int flags, struct sockaddr *srcAddr, socklen_t *addrlen) const; public: int mSid; inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {} @@ -167,8 +173,8 @@ public: inline bool isValid() const { return -1 != mSid; } ssize_t send(const void *buf, uint32_t len, int flags, const struct sockaddr *destAddr, socklen_t addrlen) const; - ssize_t recv(const shared_ptr& dataCb, int flags, struct sockaddr *srcAddr, - socklen_t *addrlen, int sid = -1) const; + ssize_t recv(const LocIpcRecver& recver, const shared_ptr& dataCb, int flags, + struct sockaddr *srcAddr, socklen_t *addrlen, int sid = -1) const; ssize_t sendAbort(int flags, const struct sockaddr *destAddr, socklen_t addrlen); inline void close() { if (isValid()) { @@ -178,6 +184,23 @@ public: } }; +class SockRecver : public LocIpcRecver { + shared_ptr mSock; +protected: + inline virtual ssize_t recv() const override { + return mSock->recv(*this, mDataCb, 0, nullptr, nullptr); + } +public: + inline SockRecver(const shared_ptr& listener, + LocIpcSender& sender, shared_ptr sock) : + LocIpcRecver(listener, sender), mSock(sock) { + } + inline virtual const char* getName() const override { + return "SockRecver"; + } + inline virtual void abort() const override {} +}; + } #endif //__LOC_IPC__ From 92ba006e1b419b29b08d350f0fa7c3ea78fd2b68 Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Fri, 6 Sep 2019 17:50:56 +0530 Subject: [PATCH 908/945] Support PQWP7 parsing without NAVIC Support PQWP7 NMEA parsing for older GNSS engine without NAVIC support. CRs-Fixed: 2516292 Change-Id: I62bd4467f15b8c5fc77e7c979eefb146276ff2a0 --- core/SystemStatus.cpp | 12 ++++++++++-- core/SystemStatus.h | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 9ca126f8..7d766517 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -660,6 +660,7 @@ private: { eTalker = 0, eUtcTime = 1, + eMin = 2 + SV_ALL_NUM_MIN*3, eMax = 2 + SV_ALL_NUM*3 }; SystemStatusPQWP7 mP7; @@ -668,11 +669,18 @@ public: SystemStatusPQWP7parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) { - if (mField.size() < eMax) { + uint32_t svLimit = SV_ALL_NUM; + if (mField.size() < eMin) { LOC_LOGE("PQWP7parser - invalid size=%zu", mField.size()); return; } - for (uint32_t i=0; i Date: Fri, 21 Jun 2019 14:32:15 -0700 Subject: [PATCH 909/945] Selectively send deleteAll command to engines Modify GNSS interface API's to accept positioning engine mask to perform deleteAll command on CRs-Fixed: 2477966 Change-Id: I54a32d76de98ba6bfa88d7fd1925c44b3079af08 --- android/1.0/location_api/GnssAPIClient.cpp | 1 + android/1.1/location_api/GnssAPIClient.cpp | 1 + gnss/GnssAdapter.cpp | 11 +++++++---- location/LocationDataTypes.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/android/1.0/location_api/GnssAPIClient.cpp b/android/1.0/location_api/GnssAPIClient.cpp index a36d2b48..b9fe2b25 100644 --- a/android/1.0/location_api/GnssAPIClient.cpp +++ b/android/1.0/location_api/GnssAPIClient.cpp @@ -231,6 +231,7 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; + data.posEngineMask = STANDARD_POSITIONING_ENGINE; if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) data.deleteAll = true; diff --git a/android/1.1/location_api/GnssAPIClient.cpp b/android/1.1/location_api/GnssAPIClient.cpp index 89877e5e..9a95fdfe 100644 --- a/android/1.1/location_api/GnssAPIClient.cpp +++ b/android/1.1/location_api/GnssAPIClient.cpp @@ -231,6 +231,7 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; + data.posEngineMask = STANDARD_POSITIONING_ENGINE; if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) data.deleteAll = true; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 578953d7..c2e4a091 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1816,12 +1816,15 @@ GnssAdapter::gnssDeleteAidingDataCommand(GnssAidingData& data) mSessionId(sessionId), mData(data) {} inline virtual void proc() const { - mAdapter.deleteAidingData(mData, mSessionId); + if ((mData.posEngineMask & STANDARD_POSITIONING_ENGINE) != 0) { + mAdapter.deleteAidingData(mData, mSessionId); - SystemStatus* s = mAdapter.getSystemStatus(); - if ((nullptr != s) && (mData.deleteAll)) { - s->setDefaultGnssEngineStates(); + SystemStatus* s = mAdapter.getSystemStatus(); + if ((nullptr != s) && (mData.deleteAll)) { + s->setDefaultGnssEngineStates(); + } } + mAdapter.mEngHubProxy->gnssDeleteAidingData(mData); } }; diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 27c5157b..40b1c73f 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -707,6 +707,7 @@ typedef struct { bool deleteAll; // if true, delete all aiding data and ignore other params GnssAidingDataSv sv; // SV specific aiding data GnssAidingDataCommon common; // common aiding data + PositioningEngineMask posEngineMask; // engines to perform the delete operation on. } GnssAidingData; typedef uint16_t DrCalibrationStatusMask; From d4740c6e1f4c92ac5c7328f82c3e81201dec3657 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 6 Aug 2019 16:38:12 -0700 Subject: [PATCH 910/945] change some of the comments that contain prohibited words Change-Id: Iaa8009e245edbcbc5adbe2348de4a014271c0ef9 CRs-Fixed: 2504418 --- location/LocationDataTypes.h | 5 ++--- utils/gps_extended_c.h | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 27c5157b..504b5cc5 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -1032,9 +1032,8 @@ typedef struct { // location engine type. When the fix. when the type is set to // LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated // reports from all engines running on the system (e.g.: - // DR/SPE/PPE) based proprietary algorithm. To check which - // location engine contributes to the fused output, check for - // locOutputEngMask. + // DR/SPE/PPE). To check which location engine contributes to + // the fused output, check for locOutputEngMask. LocOutputEngineType locOutputEngType; // when loc output eng type is set to fused, this field // indicates the set of engines contribute to the fix. diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 819e77b2..69a659ee 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -807,9 +807,8 @@ typedef struct { /* location engine type. When the fix. when the type is set to LOC_ENGINE_SRC_FUSED, the fix is the propagated/aggregated reports from all engines running on the system (e.g.: - DR/SPE/PPE) based proprietary algorithm. To check which - location engine contributes to the fused output, check for - locOutputEngMask. */ + DR/SPE/PPE). To check which location engine contributes to + the fused output, check for locOutputEngMask. */ LocOutputEngineType locOutputEngType; /* when loc output eng type is set to fused, this field indicates the set of engines contribute to the fix. */ From 2cae87f908a669561f08b1dac75294f63870a401 Mon Sep 17 00:00:00 2001 From: Santoshkumar Zalake Date: Fri, 13 Sep 2019 15:30:41 +0530 Subject: [PATCH 911/945] Change word in comments CRs-Fixed: 2527266 Change-Id: If368406f561836a82f548ad99171a730256cbfdf --- etc/gps.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/gps.conf b/etc/gps.conf index c247cbd3..fc376530 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -291,9 +291,9 @@ CP_MTLR_ES=0 ################################################## # GNSS_DEPLOYMENT ################################################## -# 0 : Enable QCOM GNSS (default) +# 0 : Enable QTI GNSS (default) # 1 : Enable QCSR SS5 -# This setting use to select between QCOM GNSS +# This setting use to select between QTI GNSS # and QCSR SS5 hardware receiver. -# By default QCOM GNSS receiver is enabled. +# By default QTI GNSS receiver is enabled. # GNSS_DEPLOYMENT = 0 From 2379d8bc3046deed80453076830467683f2681b8 Mon Sep 17 00:00:00 2001 From: Santoshkumar Zalake Date: Mon, 16 Sep 2019 12:04:02 +0530 Subject: [PATCH 912/945] Change Word in comments in default configuration CRs-Fixed: 2528185 Change-Id: Iec09e2dd19eb27a64b18ce0cd22aeba71d2e97de --- core/ContextBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index b6029895..d5c3108f 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -176,7 +176,7 @@ void ContextBase::readConfig() mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; /* default configuration value of position assisted clock estimator mode */ mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; - /* default configuration QCOM GNSS H/W */ + /* default configuration QTI GNSS H/W */ mGps_conf.GNSS_DEPLOYMENT = 0; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); From 704ec016f51e56109069157eabe9eedfcaf9fc10 Mon Sep 17 00:00:00 2001 From: Vijayakumar Badiger Date: Mon, 16 Sep 2019 16:15:40 -0700 Subject: [PATCH 913/945] Preliminary Android target definition for sdmshrike Change-Id: Iadfeb1601be2a847de9e2645df8e017816a0f5bf --- build/target_specific_features.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 766402a3..6093f4a8 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -38,6 +38,7 @@ GNSS_HIDL_2_0_TARGET_LIST += qcs605 GNSS_HIDL_2_0_TARGET_LIST += sdm845 GNSS_HIDL_2_0_TARGET_LIST += sdm660 GNSS_HIDL_2_0_TARGET_LIST += msmnile +GNSS_HIDL_2_0_TARGET_LIST += sdmshrike GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) GNSS_HIDL_2_0_TARGET_LIST += kona From 4d2c7279b56707b08eb67236f7a0e9c85fcbac47 Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Mon, 28 Jan 2019 12:48:11 +0530 Subject: [PATCH 914/945] Add API to read the device SOC ID. CRs-Fixed: 2385448 Change-Id: Ia154c908e610e2e475171d9a45822bae84210d5b --- utils/loc_target.cpp | 21 +++++++++++++++++++++ utils/loc_target.h | 1 + 2 files changed, 22 insertions(+) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index f6fd728a..a286fe1f 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -208,3 +208,24 @@ detected: LOC_LOGW("HAL: %s returned %d", __FUNCTION__, gTarget); return gTarget; } + +int loc_read_device_soc_id() +{ + char buf[10] = {0}; + int soc_id = 0; + int fd = open("/sys/devices/soc0/soc_id", O_RDONLY); + if (fd >= 0) + { + if (read(fd, buf, sizeof(buf) - 1) == -1) + { + LOC_LOGI ("%s: unable to read soc_id", __FUNCTION__); + } + else + { + soc_id = atoi(buf); + LOC_LOGI ("%s: Soc ID :%d", __FUNCTION__, soc_id); + } + close(fd); + } + return soc_id; +} diff --git a/utils/loc_target.h b/utils/loc_target.h index 172b4752..6abee89b 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -54,6 +54,7 @@ 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); +int loc_read_device_soc_id(); /* Please remember to update 'target_name' in loc_log.cpp, if do any changes to this enum. */ From d66fc2cdb471bdd02b2b3541f9eddff1b7d59928 Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Fri, 20 Sep 2019 09:47:40 +0530 Subject: [PATCH 915/945] Reversing the Added API to read the device SOC ID Change-Id: I96bd498fdd9509a1d52063ec26732a99365415d5 CRs-Fixed: 2531660 --- utils/loc_target.cpp | 21 --------------------- utils/loc_target.h | 1 - 2 files changed, 22 deletions(-) diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index a286fe1f..f6fd728a 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -208,24 +208,3 @@ detected: LOC_LOGW("HAL: %s returned %d", __FUNCTION__, gTarget); return gTarget; } - -int loc_read_device_soc_id() -{ - char buf[10] = {0}; - int soc_id = 0; - int fd = open("/sys/devices/soc0/soc_id", O_RDONLY); - if (fd >= 0) - { - if (read(fd, buf, sizeof(buf) - 1) == -1) - { - LOC_LOGI ("%s: unable to read soc_id", __FUNCTION__); - } - else - { - soc_id = atoi(buf); - LOC_LOGI ("%s: Soc ID :%d", __FUNCTION__, soc_id); - } - close(fd); - } - return soc_id; -} diff --git a/utils/loc_target.h b/utils/loc_target.h index 6abee89b..172b4752 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -54,7 +54,6 @@ 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); -int loc_read_device_soc_id(); /* Please remember to update 'target_name' in loc_log.cpp, if do any changes to this enum. */ From f07b76bdc24c318281e6dfef49340675b514d6be Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Wed, 18 Sep 2019 14:38:41 +0530 Subject: [PATCH 916/945] Adding NAVIC in delete aiding data Adding NAVIC to the SV type mask while deleting aiding data Change-Id: I704595b60e061e83c8c08f69f770e4a78b3ae409 CRs-Fixed: 2529784 --- android/2.0/location_api/GnssAPIClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index ffe90750..0d813f47 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -279,7 +279,8 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT | GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT | GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | - GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT; + GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT | + GNSS_AIDING_DATA_SV_TYPE_NAVIC_BIT; if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) data.deleteAll = true; From b6f19637e37de64478b743bbd8bea5955900190a Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Mon, 23 Sep 2019 10:08:23 -0700 Subject: [PATCH 917/945] Fix deleteAll case for GNSS HIDL 2.0 For GNSS HIDL 2.0, delete command should explicitly specify the engine the delete command is to be performed on. CRs-Fixed: 2533225 Change-Id: Ib69c3f11eb4df94a3becdbb2b0cff9288283067e --- android/2.0/location_api/GnssAPIClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index 0d813f47..a3cdd278 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -281,6 +281,7 @@ void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags) GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT | GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT | GNSS_AIDING_DATA_SV_TYPE_NAVIC_BIT; + data.posEngineMask = STANDARD_POSITIONING_ENGINE; if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL) data.deleteAll = true; From bf12ff26d542acd9e72344037cdcac5d301f1ade Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Mon, 23 Sep 2019 15:49:43 +0530 Subject: [PATCH 918/945] Use 'subdir-objects' option in HAL configure options If a source file is in a subdirectory, but the 'subdir-objects' automake option hasn't been enabled. For now, the corresponding output object file(s) will be placed in the top-level directory. However, this behaviour will change in future Automake versions, they will unconditionally cause object files to be placed in the same subdirectory of the corresponding sources. So to avoid future incompatibilities, enable the 'subdir-objects' option in location module configure options. Change-Id: If9e94c0f6fcd9922ee7f0f9d1909d5d6579a5715 CRs-Fixed: 2533108 --- configure.ac | 2 +- core/configure.ac | 2 +- location/configure.ac | 2 +- utils/configure.ac | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 0ab8e68e..2a44051b 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ 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]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) # Disables auto rebuilding of configure, Makefile.ins AM_MAINTAINER_MODE # Verifies the --srcdir is correct by checking for the path diff --git a/core/configure.ac b/core/configure.ac index ea0a128d..c3e062b6 100644 --- a/core/configure.ac +++ b/core/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ(2.61) # Initialize the gps loc-hal package version 1.0.0 AC_INIT([loc-core],1.0.0) # Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) # Disables auto rebuilding of configure, Makefile.ins AM_MAINTAINER_MODE # Verifies the --srcdir is correct by checking for the path diff --git a/location/configure.ac b/location/configure.ac index 6391d65d..39abb69f 100644 --- a/location/configure.ac +++ b/location/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ(2.61) # Initialize the gps location-api-iface package version 1.0.0 AC_INIT([location-api-iface],1.0.0) # Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) # Disables auto rebuilding of configure, Makefile.ins AM_MAINTAINER_MODE # Verifies the --srcdir is correct by checking for the path diff --git a/utils/configure.ac b/utils/configure.ac index fd164943..2a04f450 100644 --- a/utils/configure.ac +++ b/utils/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ(2.61) # Initialize the gps gps-utils package version 1.0.0 AC_INIT([gps-utils],1.0.0) # Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) # Disables auto rebuilding of configure, Makefile.ins AM_MAINTAINER_MODE # Verifies the --srcdir is correct by checking for the path From 2ef1adca4524dd44d92dcd002575ce1bec87ec71 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 1 Oct 2019 11:50:44 -0700 Subject: [PATCH 919/945] Systemstatus - add support older version of PQWME Add support of older (shorter) version of PQWME strings from modem. Systemstatus currently discards those shorter strings. This change is to fill out all zeros in those missing fields instead of discarding the whole sentence. Change-Id: I0276e595c738253608071f12170232a59e3b2e9e CRs-Fixed: 2153513 --- core/SystemStatus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/SystemStatus.cpp b/core/SystemStatus.cpp index 7d766517..0624580b 100644 --- a/core/SystemStatus.cpp +++ b/core/SystemStatus.cpp @@ -158,6 +158,7 @@ private: eAgcGlo = 20, eAgcBds = 21, eAgcGal = 22, + eMax0 = eAgcGal, eLeapSeconds = 23, eLeapSecUnc = 24, eGloBpAmpI = 25, @@ -166,7 +167,6 @@ private: eBdsBpAmpQ = 28, eGalBpAmpI = 29, eGalBpAmpQ = 30, - eMax0 = eGalBpAmpQ, eTimeUncNs = 31, eMax }; From 2f8791ecd433f5335d56a4a03ac35c3d95a2b90c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 1 Oct 2019 16:37:20 -0700 Subject: [PATCH 920/945] Update SSL cert path Update to use SSL1.1 certificate path CRs-Fixed: 2538925 Change-Id: I00d2566e4d1cb793aaf6b539dea2d8160387f6ba --- etc/gps.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/gps.conf b/etc/gps.conf index fc376530..63547653 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -14,7 +14,7 @@ ERR_ESTIMATE=0 NTP_SERVER=time.izatcloud.net #XTRA CA path -XTRA_CA_PATH=/usr/lib/ssl/certs +XTRA_CA_PATH=/usr/lib/ssl-1.1/certs # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose From fa7f9e3f087ef2168f716159015ed36decae8450 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Fri, 20 Sep 2019 17:15:11 -0700 Subject: [PATCH 921/945] Prevent left shift by a large number CRs-fixed: 2534443 Change-Id: I3c52f6f62620c69bc79bc9bc5343e5d1ec08656d --- gnss/GnssAdapter.cpp | 2 +- utils/loc_nmea.cpp | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index c2e4a091..43fb63bf 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3484,7 +3484,7 @@ GnssAdapter::reportSv(GnssSvNotification& svNotify) // 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))) { + if ((gnssSvId < 64) && (svUsedIdMask & (1ULL << (gnssSvId - 1)))) { svNotify.gnssSvs[i].gnssSvOptionsMask |= GNSS_SV_OPTIONS_USED_IN_FIX_BIT; } } diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 41a707dc..d5e4b57a 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2019, 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 @@ -782,8 +782,13 @@ static void loc_nmea_generate_GSV(const GnssSvNotification &svNotify, if (sv_meta_p->svType == svNotify.gnssSvs[svNumber - 1].type && sv_meta_p->signalId == convert_signalType_to_signalId(signalType)) { + uint16_t svId = svNotify.gnssSvs[svNumber - 1].svId; + // For QZSS we adjusted SV id's in GnssAdapter, we need to re-adjust here + if (GNSS_SV_TYPE_QZSS == svNotify.gnssSvs[svNumber - 1].type) { + svId = svId - (QZSS_SV_PRN_MIN - 1); + } length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svNotify.gnssSvs[svNumber - 1].svId + svIdOffset, + svId + svIdOffset, (int)(0.5 + svNotify.gnssSvs[svNumber - 1].elevation), //float to int (int)(0.5 + svNotify.gnssSvs[svNumber - 1].azimuth)); //float to int @@ -1901,7 +1906,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.gps_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + sv_cache_info.gps_used_mask |= (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } if (GNSS_SIGNAL_GPS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { sv_cache_info.gps_l5_count++; @@ -1919,7 +1924,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.glo_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + sv_cache_info.glo_used_mask |= (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } if (GNSS_SIGNAL_GLONASS_G2 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.glo_g2_count++; @@ -1937,7 +1942,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.gal_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + sv_cache_info.gal_used_mask |= (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } if(GNSS_SIGNAL_GALILEO_E5A == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.gal_e5_count++; @@ -1955,7 +1960,9 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.qzss_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + // For QZSS we adjusted SV id's in GnssAdapter, we need to re-adjust here + sv_cache_info.qzss_used_mask |= + (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - (QZSS_SV_PRN_MIN - 1) - 1)); } if (GNSS_SIGNAL_QZSS_L5 == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) { sv_cache_info.qzss_l5_count++; @@ -1973,7 +1980,7 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.bds_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + sv_cache_info.bds_used_mask |= (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } if(GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ sv_cache_info.bds_b2_count++; @@ -1991,7 +1998,8 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, (svNotify.gnssSvs[svNumber - 1].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)) { - sv_cache_info.navic_used_mask |= (1 << (svNotify.gnssSvs[svNumber - 1].svId - 1)); + sv_cache_info.navic_used_mask |= + (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } // GNSS_SIGNAL_NAVIC_L5 is the only signal type for NAVIC sv_cache_info.navic_l5_count++; From 73f69ef469c45e329a483a1f39f2757affb34ba3 Mon Sep 17 00:00:00 2001 From: Mike Cailean Date: Tue, 24 Sep 2019 14:15:57 -0700 Subject: [PATCH 922/945] Enable Android sanitizers Change-Id: I6724d0e171e42f779e8eed6aea126f3f69496f6d CRs-fixed: 2534375 --- android/1.0/Android.mk | 6 ++++++ android/1.1/Android.mk | 6 ++++++ android/2.0/Android.mk | 6 ++++++ android/utils/Android.mk | 3 +++ batching/Android.mk | 3 +++ build/target_specific_features.mk | 6 ++++-- core/Android.mk | 3 +++ geofence/Android.mk | 3 +++ gnss/Android.mk | 3 +++ location/Android.mk | 3 +++ utils/Android.mk | 3 +++ 11 files changed, 43 insertions(+), 2 deletions(-) diff --git a/android/1.0/Android.mk b/android/1.0/Android.mk index 9337325f..112ae8bd 100644 --- a/android/1.0/Android.mk +++ b/android/1.0/Android.mk @@ -2,6 +2,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ @@ -57,6 +60,9 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/android/1.1/Android.mk b/android/1.1/Android.mk index fb72de11..132c1e1e 100644 --- a/android/1.1/Android.mk +++ b/android/1.1/Android.mk @@ -2,6 +2,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ @@ -58,6 +61,9 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-service-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/android/2.0/Android.mk b/android/2.0/Android.mk index 7c555042..d9ac77ca 100644 --- a/android/2.0/Android.mk +++ b/android/2.0/Android.mk @@ -2,6 +2,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ @@ -70,6 +73,9 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-service-qti +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/android/utils/Android.mk b/android/utils/Android.mk index 47b40811..76732c2c 100644 --- a/android/utils/Android.mk +++ b/android/utils/Android.mk @@ -2,6 +2,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := liblocbatterylistener +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_CFLAGS += $(GNSS_CFLAGS) diff --git a/batching/Android.mk b/batching/Android.mk index b08d1558..b4876cd5 100644 --- a/batching/Android.mk +++ b/batching/Android.mk @@ -6,6 +6,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libbatching +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/build/target_specific_features.mk b/build/target_specific_features.mk index 6093f4a8..241d67c8 100644 --- a/build/target_specific_features.mk +++ b/build/target_specific_features.mk @@ -15,8 +15,6 @@ GNSS_CFLAGS := \ -Wno-error=switch \ -Wno-error=date-time -LOCAL_SANITIZE := signed-integer-overflow, unsigned-integer-overflow - # GPS-HIDL GNSS_HIDL_1_0_TARGET_LIST := msm8960 GNSS_HIDL_1_0_TARGET_LIST += msm8974 @@ -68,3 +66,7 @@ GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) GNSS_HIDL_LEGACY_MEASURMENTS = true endif + +# Activate the following two lines for regression testing +#GNSS_SANITIZE := address cfi alignment bounds null unreachable integer +#GNSS_SANITIZE_DIAG := address cfi alignment bounds null unreachable integer diff --git a/core/Android.mk b/core/Android.mk index bd955c1f..ce5d6a8e 100644 --- a/core/Android.mk +++ b/core/Android.mk @@ -6,6 +6,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libloc_core +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/geofence/Android.mk b/geofence/Android.mk index 6e9e8706..7e0e34e8 100644 --- a/geofence/Android.mk +++ b/geofence/Android.mk @@ -6,6 +6,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgeofencing +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/gnss/Android.mk b/gnss/Android.mk index d809bc2a..c1b5944a 100644 --- a/gnss/Android.mk +++ b/gnss/Android.mk @@ -6,6 +6,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libgnss +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/location/Android.mk b/location/Android.mk index bbd6fbd8..2a595414 100644 --- a/location/Android.mk +++ b/location/Android.mk @@ -6,6 +6,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := liblocation_api +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional diff --git a/utils/Android.mk b/utils/Android.mk index 38876965..88ad487b 100644 --- a/utils/Android.mk +++ b/utils/Android.mk @@ -47,6 +47,9 @@ LOCAL_HEADER_LIBRARIES := \ liblocation_api_headers LOCAL_MODULE := libgps.utils +LOCAL_SANITIZE += $(GNSS_SANITIZE) +# activate the following line for debug purposes only, comment out for production +#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional From f80980210e4b9ba5da41bc7f615943e164c68f39 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Mon, 30 Sep 2019 16:24:03 -0700 Subject: [PATCH 923/945] Assure accurate elapsedRealTimeNanos calculations If a context switch or interrupt happens between getting current time and getting boot time, this can throw off the calculation for the elapsedRealTimeNanos timestamp. Avoid this by retrying if there is a large enough delta between getting current time and getting boot time. Change-Id: I47d7a99b480423a50eaf951a904f21928587eda6 CRs-fixed: 2541719 --- android/2.0/location_api/LocationUtil.cpp | 41 ++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/android/2.0/location_api/LocationUtil.cpp b/android/2.0/location_api/LocationUtil.cpp index 38a083af..8a30066f 100644 --- a/android/2.0/location_api/LocationUtil.cpp +++ b/android/2.0/location_api/LocationUtil.cpp @@ -88,10 +88,41 @@ void convertGnssLocation(Location& in, V2_0::GnssLocation& out) struct timespec sinceBootTime; struct timespec currentTime; - if (0 == clock_gettime(CLOCK_BOOTTIME,&sinceBootTime) && - 0 == clock_gettime(CLOCK_REALTIME,¤tTime)) { + struct timespec sinceBootTimeTest; + int64_t sinceBootTimeNanos = 0; + bool clockGetTimeSuccess = false; + const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 10000; + const uint32_t MAX_GET_TIME_COUNT = 20; + /* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption + or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */ + for (uint32_t i=0; i < MAX_GET_TIME_COUNT; i++) { + if (clock_gettime(CLOCK_BOOTTIME, &sinceBootTime) != 0) { + break; + }; + if (clock_gettime(CLOCK_REALTIME, ¤tTime) != 0) { + break; + } + if (clock_gettime(CLOCK_BOOTTIME, &sinceBootTimeTest) != 0) { + break; + }; + sinceBootTimeNanos = sinceBootTime.tv_sec*1000000000 + sinceBootTime.tv_nsec; + int64_t sinceBootTimeTestNanos = + sinceBootTimeTest.tv_sec*1000000000 + sinceBootTimeTest.tv_nsec; + int64_t sinceBootTimeDeltaNanos = sinceBootTimeTestNanos - sinceBootTimeNanos; - int64_t sinceBootTimeNanos = sinceBootTime.tv_sec*1000000000 + sinceBootTime.tv_nsec; + /* sinceBootTime and sinceBootTimeTest should have a close value if there was no + interruption or context switch between clock_gettime for CLOCK_BOOTIME and + clock_gettime for CLOCK_REALTIME */ + if (sinceBootTimeDeltaNanos < MAX_TIME_DELTA_VALUE_NANOS) { + clockGetTimeSuccess = true; + break; + } else { + LOC_LOGD("%s]: Delta:%" PRIi64 "ns time too large, retry number #%u...", + __FUNCTION__, sinceBootTimeDeltaNanos, i+1); + } + } + + if (clockGetTimeSuccess) { int64_t currentTimeNanos = currentTime.tv_sec*1000000000 + currentTime.tv_nsec; int64_t locationTimeNanos = in.timestamp*1000000; LOC_LOGD("%s]: sinceBootTimeNanos:%" PRIi64 " currentTimeNanos:%" PRIi64 "" @@ -110,8 +141,10 @@ void convertGnssLocation(Location& in, V2_0::GnssLocation& out) __FUNCTION__, out.elapsedRealtime.timestampNs); } } + } else { + LOC_LOGE("%s]: Failed to calculate elapsedRealtimeNanos timestamp after %u tries", + __FUNCTION__, MAX_GET_TIME_COUNT); } - } void convertGnssLocation(const V1_0::GnssLocation& in, Location& out) From 8e7733ba7fa7e307213af81e3447006d8a7a8b1f Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Thu, 3 Oct 2019 23:32:30 +0530 Subject: [PATCH 924/945] Disable few process launch in loc_launcher for low ram targets Use ro.config.low_ram property to identify low ram targets and disable the process in izat.conf whose property value LOW_RAM_TARGETS is set to DISABLED. Change-Id: Idb8b0b91c4ed127b4fa58c41683f9720252dff84 CRs-Fixed: 2542145 --- utils/loc_cfg.cpp | 12 ++++++++++++ utils/loc_target.cpp | 15 +++++++++++++++ utils/loc_target.h | 1 + 3 files changed, 28 insertions(+) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 9c1f0b35..36482ac0 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -483,6 +483,7 @@ typedef struct { unsigned int loc_feature_mask; char platform_list[LOC_MAX_PARAM_STRING]; char baseband[LOC_MAX_PARAM_STRING]; + char low_ram_targets[LOC_MAX_PARAM_STRING]; unsigned int sglte_target; char feature_gtp_mode[LOC_MAX_PARAM_STRING]; char feature_gtp_waa[LOC_MAX_PARAM_STRING]; @@ -524,6 +525,7 @@ static const loc_param_s_type loc_process_conf_parameter_table[] = { {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, {"PLATFORMS", &conf.platform_list, NULL, 's'}, {"BASEBAND", &conf.baseband, NULL, 's'}, + {"LOW_RAM_TARGETS", &conf.low_ram_targets, NULL, 's'}, {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, {"VENDOR_ENHANCED_PROCESS", &conf.vendor_enhanced_process, NULL, 'n'}, }; @@ -565,6 +567,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p int group_index=0, nstrings=0, status_length=0; FILE* conf_fp = nullptr; char platform_name[PROPERTY_VALUE_MAX], baseband_name[PROPERTY_VALUE_MAX]; + int low_ram_target=0; char autoplatform_name[PROPERTY_VALUE_MAX]; unsigned int loc_service_mask=0; char config_mask = 0; @@ -597,6 +600,8 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p loc_get_target_baseband(baseband_name, sizeof(baseband_name)); //Identify if this is an automotive platform loc_get_auto_platform_name(autoplatform_name,sizeof(autoplatform_name)); + //Identify if this is a low ram target from ro.config.low_ram property + low_ram_target = loc_identify_low_ram_target(); UTIL_READ_CONF(conf_file_name, loc_feature_conf_table); @@ -894,6 +899,13 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } } + nstrings = loc_util_split_string(conf.low_ram_targets, split_strings, MAX_NUM_STRINGS, ' '); + if (!strcmp("DISABLED", split_strings[0]) && low_ram_target) { + LOC_LOGd("Disabled for low ram targets\n"); + child_proc[j].proc_status = DISABLED; + continue; + } + if((config_mask & CONFIG_MASK_TARGET_CHECK) && (config_mask & CONFIG_MASK_BASEBAND_CHECK) && (config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) && diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index f6fd728a..1cab7b8e 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -130,6 +130,21 @@ void loc_get_auto_platform_name(char *platform_name, int array_length) } } +/*Reads the property ro.config.low_ram to identify if this is a low ram target + Returns: + 0 if not a low ram target + 1 if this is a low ram target +*/ +int loc_identify_low_ram_target() +{ + int ret = 0; + char low_ram_target[PROPERTY_VALUE_MAX]; + property_get("ro.config.low_ram", low_ram_target, ""); + LOC_LOGd("low ram target: %s\n", low_ram_target); + return !(strncmp(low_ram_target, "true", PROPERTY_VALUE_MAX)); +} + + unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) diff --git a/utils/loc_target.h b/utils/loc_target.h index 172b4752..e9ff918b 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -54,6 +54,7 @@ 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); +int loc_identify_low_ram_target(); /* Please remember to update 'target_name' in loc_log.cpp, if do any changes to this enum. */ From a44fc0383de405ba1527df6df308fcd8990aa8b5 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Fri, 11 Oct 2019 14:50:06 +0530 Subject: [PATCH 925/945] gps: Add diag permissions for gnss service android interface 2.0 Change-Id: Ib53b8bef8641166c1a7495e9051a092a34830016 CRs-Fixed:2543639 --- android/2.0/android.hardware.gnss@2.0-service-qti.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/2.0/android.hardware.gnss@2.0-service-qti.rc b/android/2.0/android.hardware.gnss@2.0-service-qti.rc index 36ee47c7..ad46d5d2 100644 --- a/android/2.0/android.hardware.gnss@2.0-service-qti.rc +++ b/android/2.0/android.hardware.gnss@2.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti class hal user gps - group system gps radio + group system gps radio vendor_qti_diag From 201f6120408a47acc37c75ee9029c02f4a71c7b6 Mon Sep 17 00:00:00 2001 From: Harikrishnan Hariharan Date: Fri, 4 Oct 2019 16:54:22 +0530 Subject: [PATCH 926/945] Enable/Disable process launch by loc_launcher based on SOC-Id Add a parameter SOC_IDS for process configuration in izat.conf to include/exclude the process based on SOC-Id. Read the value of this parameter to enable or disable the process launch by loc_launcher. Fixed an issue in read_a_line function to handle newline at the end of line in the file to be read. Change-Id: I66777856ebbb928ce4f49a44dfd9d2f1fbca69b5 CRs-Fixed: 2540349 --- utils/loc_cfg.cpp | 45 ++++++++++++++++++++++++++++++++++++++++---- utils/loc_target.cpp | 38 ++++++++++++++++++++++++++++++------- utils/loc_target.h | 3 +++ 3 files changed, 75 insertions(+), 11 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 36482ac0..8baf8ca0 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -460,6 +460,9 @@ void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_ta #define CONFIG_MASK_AUTOPLATFORM_ALL 0x10 #define CONFIG_MASK_AUTOPLATFORM_FOUND 0x20 #define CONFIG_MASK_AUTOPLATFORM_CHECK 0x30 +#define CONFIG_MASK_SOCID_ALL 0x40 +#define CONFIG_MASK_SOCID_FOUND 0x80 +#define CONFIG_MASK_SOCID_CHECK 0xc0 #define LOC_FEATURE_MASK_GTP_WIFI_BASIC 0x01 #define LOC_FEATURE_MASK_GTP_WIFI_PREMIUM 0X02 @@ -484,6 +487,7 @@ typedef struct { char platform_list[LOC_MAX_PARAM_STRING]; char baseband[LOC_MAX_PARAM_STRING]; char low_ram_targets[LOC_MAX_PARAM_STRING]; + char soc_id_list[LOC_MAX_PARAM_STRING]; unsigned int sglte_target; char feature_gtp_mode[LOC_MAX_PARAM_STRING]; char feature_gtp_waa[LOC_MAX_PARAM_STRING]; @@ -524,6 +528,7 @@ static const loc_param_s_type loc_process_conf_parameter_table[] = { {"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'}, {"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'}, {"PLATFORMS", &conf.platform_list, NULL, 's'}, + {"SOC_IDS", &conf.soc_id_list, NULL, 's'}, {"BASEBAND", &conf.baseband, NULL, 's'}, {"LOW_RAM_TARGETS", &conf.low_ram_targets, NULL, 's'}, {"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'}, @@ -563,14 +568,14 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p gid_t gid_list[LOC_PROCESS_MAX_NUM_GROUPS]; char *split_strings[MAX_NUM_STRINGS]; int name_length=0, group_list_length=0, platform_length=0, baseband_length=0, ngroups=0, ret=0; - int auto_platform_length = 0; + int auto_platform_length = 0, soc_id_list_length=0; int group_index=0, nstrings=0, status_length=0; FILE* conf_fp = nullptr; char platform_name[PROPERTY_VALUE_MAX], baseband_name[PROPERTY_VALUE_MAX]; int low_ram_target=0; - char autoplatform_name[PROPERTY_VALUE_MAX]; + char autoplatform_name[PROPERTY_VALUE_MAX], socid_value[PROPERTY_VALUE_MAX]; unsigned int loc_service_mask=0; - char config_mask = 0; + unsigned char config_mask = 0; unsigned char proc_list_length=0; int gtp_cell_ap_enabled = 0; char arg_gtp_waa[LOC_PROCESS_MAX_ARG_STR_LENGTH] = "--"; @@ -602,6 +607,8 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p loc_get_auto_platform_name(autoplatform_name,sizeof(autoplatform_name)); //Identify if this is a low ram target from ro.config.low_ram property low_ram_target = loc_identify_low_ram_target(); + // Get the soc-id for this device. + loc_get_device_soc_id(socid_value, sizeof(socid_value)); UTIL_READ_CONF(conf_file_name, loc_feature_conf_table); @@ -774,9 +781,10 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p baseband_length = (int)strlen(conf.baseband); status_length = (int)strlen(conf.proc_status); auto_platform_length = (int)strlen(conf.auto_platform); + soc_id_list_length = (int)strlen(conf.soc_id_list); if(!name_length || !group_list_length || !platform_length || - !baseband_length || !status_length || !auto_platform_length) { + !baseband_length || !status_length || !auto_platform_length || !soc_id_list_length) { LOC_LOGE("%s:%d]: Error: i: %d; One of the parameters not specified in conf file", __func__, __LINE__, i); continue; @@ -847,6 +855,34 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p } } + // SOC Id's check + nstrings = loc_util_split_string(conf.soc_id_list, split_strings, MAX_NUM_STRINGS, ' '); + if (strcmp("all", split_strings[0]) == 0) { + if (nstrings == 1 || (nstrings == 2 && (strcmp("exclude", split_strings[1]) == 0))) { + LOC_LOGd("Enabled for all SOC ids\n"); + config_mask |= CONFIG_MASK_SOCID_ALL; + } + else if (nstrings > 2 && (strcmp("exclude", split_strings[1]) == 0)) { + config_mask |= CONFIG_MASK_SOCID_FOUND; + for (i = 2; i < nstrings; i++) { + if (strcmp(socid_value, split_strings[i]) == 0) { + LOC_LOGd("Disabled for SOC id %s\n", socid_value); + config_mask &= ~CONFIG_MASK_SOCID_FOUND; + break; + } + } + } + } + else { + for (i = 0; i < nstrings; i++) { + if (strcmp(socid_value, split_strings[i]) == 0) { + LOC_LOGd("Matched SOC id : %s\n", split_strings[i]); + config_mask |= CONFIG_MASK_SOCID_FOUND; + break; + } + } + } + nstrings = loc_util_split_string(conf.baseband, split_strings, MAX_NUM_STRINGS, ' '); if(strcmp("all", split_strings[0]) == 0) { if (nstrings == 1 || (nstrings == 2 && (strcmp("exclude", split_strings[1]) == 0))) { @@ -909,6 +945,7 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p if((config_mask & CONFIG_MASK_TARGET_CHECK) && (config_mask & CONFIG_MASK_BASEBAND_CHECK) && (config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) && + (config_mask & CONFIG_MASK_SOCID_CHECK) && (child_proc[j].proc_status != DISABLED_FROM_CONF) && (child_proc[j].proc_status != DISABLED_VIA_VENDOR_ENHANCED_CHECK)) { diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 1cab7b8e..3ee42e62 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -80,6 +80,11 @@ static int read_a_line(const char * file_path, char * line, int line_size) int len; fgets(line, line_size, fp); len = strlen(line); + while ('\n' == line[len-1]) { + // If there is a new line at end of string, replace it with NULL + line[len-1] = '\0'; + len--; + } len = len < line_size - 1? len : line_size - 1; line[len] = '\0'; LOC_LOGD("cat %s: %s", file_path, line); @@ -144,6 +149,30 @@ int loc_identify_low_ram_target() return !(strncmp(low_ram_target, "true", PROPERTY_VALUE_MAX)); } +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +/* Reads the soc_id node and return the soc_id value */ +void loc_get_device_soc_id(char *soc_id_value, int array_length) +{ + static const char soc_id[] = "/sys/devices/soc0/soc_id"; + static const char soc_id_dep[] = "/sys/devices/system/soc/soc0/id"; + int return_val = 0; + + if (soc_id_value && (array_length >= PROPERTY_VALUE_MAX)) { + if (!access(soc_id, F_OK)) { + return_val = read_a_line(soc_id, soc_id_value, array_length); + } else { + return_val = read_a_line(soc_id_dep, soc_id_value, array_length); + } + if (0 == return_val) { + LOC_LOGd("SOC Id value: %s\n", soc_id_value); + } else { + LOC_LOGe("Unable to read the soc_id value\n"); + } + } else { + LOC_LOGe("Null parameter or array length less than PROPERTY_VALUE_MAX\n"); + } +} unsigned int loc_get_target(void) { @@ -151,10 +180,8 @@ unsigned int loc_get_target(void) 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[] = "/target"; // mdm target we are using char rd_hw_platform[LINE_LEN]; @@ -170,11 +197,8 @@ unsigned int loc_get_target(void) } 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); - } + // Get the soc-id for this device. + loc_get_device_soc_id(rd_id, sizeof(rd_id)); /*check automotive platform*/ loc_get_auto_platform_name(rd_auto_platform, sizeof(rd_auto_platform)); diff --git a/utils/loc_target.h b/utils/loc_target.h index e9ff918b..2dcd895e 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -55,6 +55,9 @@ void loc_get_platform_name(char *platform_name, int array_length); of atleast PROPERTY_VALUE_MAX*/ void loc_get_auto_platform_name(char *platform_name, int array_length); int loc_identify_low_ram_target(); +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_device_soc_id(char *soc_id_value, int array_length); /* Please remember to update 'target_name' in loc_log.cpp, if do any changes to this enum. */ From 87923e48c1b0ad158c0ca92bd049524d7ff672fd Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 16 Sep 2019 13:30:54 -0700 Subject: [PATCH 927/945] GPS: enable tunc constrained feature by default for auto PL Enable TUNC feature by default if DISTRO is set to "auto" Change-Id: I5d05a40fd6c6fb5c9f37cf2a7478f66b9384f5df CRs-fixed: 2528781 --- core/ContextBase.cpp | 5 +++++ core/Makefile.am | 4 ++++ core/configure.ac | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index d5c3108f..22ac849c 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -171,9 +171,14 @@ void ContextBase::readConfig() /* default configuration value of constrained time uncertainty mode: feature disabled, time uncertainty threshold defined by modem, and unlimited power budget */ +#ifdef FEATURE_AUTOMOTIVE + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 1; +#else mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0; +#endif mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0; mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; + /* default configuration value of position assisted clock estimator mode */ mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; /* default configuration QTI GNSS H/W */ diff --git a/core/Makefile.am b/core/Makefile.am index ffd93579..1199a523 100644 --- a/core/Makefile.am +++ b/core/Makefile.am @@ -56,6 +56,10 @@ libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) endif +if USE_FEATURE_AUTOMOTIVE +AM_CFLAGS += -DFEATURE_AUTOMOTIVE +endif + libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) #Create and Install libraries diff --git a/core/configure.ac b/core/configure.ac index c3e062b6..548c5e59 100644 --- a/core/configure.ac +++ b/core/configure.ac @@ -74,6 +74,18 @@ fi AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") +AC_ARG_WITH([auto_feature], + AC_HELP_STRING([--with-auto_feature=@<:@dir@:>@], + [Using Automotive feature]), + [], + with_auto_feature=no) + +if test "x$with_auto_feature" != "xno"; then + CPPFLAGS="${CPPFLAGS} -DFEATURE_AUTOMOTIVE" +fi + +AM_CONDITIONAL(USE_FEATURE_AUTOMOTIVE, test "x${with_auto_feature}" = "xyes") + AC_CONFIG_FILES([ \ Makefile \ loc-core.pc \ From ba93fa33fb1a98e0cfd1f536512083c63b69fdb9 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 27 Sep 2019 13:16:13 -0700 Subject: [PATCH 928/945] GPS log util: add capability to log modem callflow with debug level Add debug level to log high frequency modem calls so those high frequency modem calls do not get outputted with default gps.conf Change-Id: I2c34471ae97f5cdfebf99c3d7edcdaff7ff63018 CRs-fixed: 2537163 --- utils/log_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/log_util.h b/utils/log_util.h index ed7e19e1..192baebb 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -176,6 +176,7 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #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 LOG_D(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGD, ID, WHAT, SPEC, VAL) #define ENTRY_LOG() LOG_V(ENTRY_TAG, __FUNCTION__, %s, "") #define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __FUNCTION__, SPEC, VAL) @@ -193,6 +194,8 @@ extern char* get_timestamp(char* str, unsigned long buf_size); #define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __FUNCTION__, SPEC, VAL) // Used for logging callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") #define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __FUNCTION__, SPEC, VAL) +// Used for logging high frequency callflow from Modem(TO_MODEM, __FUNCTION__, %s, "") +#define MODEM_LOG_CALLFLOW_DEBUG(SPEC, VAL) LOG_D(FROM_MODEM, __FUNCTION__, SPEC, VAL) // Used for logging callflow to Android Framework #define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) From 3a84bfac176e1e52ddb010ab61f67d70b67f9fd5 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 30 Sep 2019 11:46:56 -0700 Subject: [PATCH 929/945] GPS NMEA: enhance gga fix qualtiy for sensor contributed fix This enhancement will be enabled if CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED is set to 1 in gps.conf. PPP fix w/o sensor: fix quality will now be 59 PPP fix w sensor: fix quality will now be 69 RTK fixed fix w/ sensor: fix quality will now be 64 RTK float fix w/ sensor: 65 DGNSS and/or SBAS correction fix and w/ sensor: 62 GPS fix without correction but and w/ sensor: 61 Change-Id: I7bc1bb5504e023de40f271d97d31c602f27bd94e CRs-fixed: 2537211 --- core/ContextBase.cpp | 18 ++++++--- core/ContextBase.h | 1 + etc/gps.conf | 25 ++++++++++++ gnss/GnssAdapter.cpp | 3 +- utils/loc_nmea.cpp | 95 +++++++++++++++++++++++++++++++++++--------- utils/loc_nmea.h | 1 + 6 files changed, 118 insertions(+), 25 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 22ac849c..74345909 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -70,7 +70,8 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"XTRA_SERVER_1", &mGps_conf.XTRA_SERVER_1, NULL, 's'}, {"XTRA_SERVER_2", &mGps_conf.XTRA_SERVER_2, NULL, 's'}, {"XTRA_SERVER_3", &mGps_conf.XTRA_SERVER_3, NULL, 's'}, - {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, + {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", + &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, {"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'}, {"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'}, @@ -78,13 +79,19 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' }, {"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' }, {"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' }, - {"CONSTRAINED_TIME_UNCERTAINTY_ENABLED", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'}, - {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'}, - {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, - {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, + {"CONSTRAINED_TIME_UNCERTAINTY_ENABLED", + &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'}, + {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD", + &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'}, + {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", + &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, + {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", + &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, {"PROXY_APP_PACKAGE_NAME", &mGps_conf.PROXY_APP_PACKAGE_NAME, NULL, 's' }, {"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' }, {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'}, + {"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED", + &mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -183,6 +190,7 @@ void ContextBase::readConfig() mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; /* default configuration QTI GNSS H/W */ mGps_conf.GNSS_DEPLOYMENT = 0; + mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); diff --git a/core/ContextBase.h b/core/ContextBase.h index 5da76e26..6701600e 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -74,6 +74,7 @@ typedef struct loc_gps_cfg_s char PROXY_APP_PACKAGE_NAME[LOC_MAX_PARAM_STRING]; uint32_t CP_MTLR_ES; uint32_t GNSS_DEPLOYMENT; + uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/etc/gps.conf b/etc/gps.conf index 63547653..47aa8efb 100644 --- a/etc/gps.conf +++ b/etc/gps.conf @@ -99,6 +99,31 @@ DATUM_TYPE = 0 ################################ # NMEA provider (1=Modem Processor, 0=Application Processor) NMEA_PROVIDER=0 + +# Customized NMEA GGA fix quality that can be used to tell +# whether SENSOR contributed to the fix. +# +# When this configuration item is not enabled (set to any value that is not 1), +# GGA fix quality conforms to NMEA standard spec as below: +# PPP/DGNSS/SBAS correction fix w/ or w/o sensor: 2 +# RTK fixed fix w/ or w/o sensor: 4 +# RTK float fix w/ or w/o sensor: 5 +# SPE fix w/ or w/o sensor: 1 +# Sensor dead reckoning fix: 6 +# +# When this configuration is enabled (set to 1), GGA fix quality +# will be output as below: +# PPP fix w/o sensor: 59, w/ sensor: 69 +# DGNSS/SBAS correction fix w/o sensor: 2, w/ sensor: 62 +# RTK fixed fix w/o sensor: 4, w/ sensor: 64 +# RTK float fix w/o sensor: 5, w/ sensor: 65, +# SPE fix w/o sensor: 1, and w/ sensor: 61 +# Sensor dead reckoning fix: 6 +# +# any value that is not 1 - disabled +# 1 - enabled +CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0 + # Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE) SGLTE_TARGET=0 diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 43fb63bf..980d4895 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3272,9 +3272,10 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, (0 == ulpLocation.gpsLocation.longitude) && (LOC_RELIABILITY_NOT_SET == locationExtended.horizontal_reliability)); uint8_t generate_nmea = (reportToGnssClient && status != LOC_SESS_FAILURE && !blank_fix); + bool custom_nmea_gga = (1 == ContextBase::mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED); std::vector nmeaArraystr; loc_nmea_generate_pos(ulpLocation, locationExtended, mLocSystemInfo, - generate_nmea, nmeaArraystr); + generate_nmea, custom_nmea_gga, nmeaArraystr); stringstream ss; for (auto itor = nmeaArraystr.begin(); itor != nmeaArraystr.end(); ++itor) { ss << *itor; diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index d5e4b57a..24197ff0 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1033,47 +1033,56 @@ SIDE EFFECTS ===========================================================================*/ static void loc_nmea_get_fix_quality(const UlpLocation & location, const GpsLocationExtended & locationExtended, - char & ggaGpsQuality, + bool custom_gga_fix_quality, + char ggaGpsQuality[3], char & rmcModeIndicator, char & vtgModeIndicator) { - ggaGpsQuality = '0'; - rmcModeIndicator = 'N'; - vtgModeIndicator = 'N'; + ggaGpsQuality[0] = '0'; // 0 means no fix + rmcModeIndicator = 'N'; // N means no fix + vtgModeIndicator = 'N'; // N means no fix do { + // GGA fix quality is defined in NMEA spec as below: + // https://www.trimble.com/OEM_ReceiverHelp/V4.44/en/NMEA-0183messages_GGA.html + // Fix quality: 0 = invalid + // 1 = GPS fix (SPS) + // 2 = DGPS fix + // 3 = PPS fix + // 4 = Real Time Kinematic + // 5 = Float RTK + // 6 = estimated (dead reckoning) (2.3 feature) + // 7 = Manual input mode + // 8 = Simulation mode if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)){ - ggaGpsQuality = '0'; // 0 means no fix - rmcModeIndicator = 'N'; - vtgModeIndicator = 'N'; break; } // NOTE: Order of the check is important if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK) { if (LOC_NAV_MASK_PPP_CORRECTION & locationExtended.navSolutionMask) { - ggaGpsQuality = '2'; // 2 means DGPS fix + ggaGpsQuality[0] = '2'; // 2 means DGPS fix rmcModeIndicator = 'P'; // P means precise vtgModeIndicator = 'P'; // P means precise break; } else if (LOC_NAV_MASK_RTK_FIXED_CORRECTION & locationExtended.navSolutionMask){ - ggaGpsQuality = '4'; // 4 means RTK Fixed fix + ggaGpsQuality[0] = '4'; // 4 means RTK Fixed fix rmcModeIndicator = 'R'; // use R (RTK fixed) vtgModeIndicator = 'D'; // use D (differential) as // no RTK fixed defined for VTG in NMEA 183 spec break; } else if (LOC_NAV_MASK_RTK_CORRECTION & locationExtended.navSolutionMask){ - ggaGpsQuality = '5'; // 5 means RTK float fix + ggaGpsQuality[0] = '5'; // 5 means RTK float fix rmcModeIndicator = 'F'; // F means RTK float fix vtgModeIndicator = 'D'; // use D (differential) as // no RTK float defined for VTG in NMEA 183 spec break; } else if (LOC_NAV_MASK_DGNSS_CORRECTION & locationExtended.navSolutionMask){ - ggaGpsQuality = '2'; // 2 means DGPS fix + ggaGpsQuality[0] = '2'; // 2 means DGPS fix rmcModeIndicator = 'D'; // D means differential vtgModeIndicator = 'D'; // D means differential break; } else if (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask){ - ggaGpsQuality = '2'; // 2 means DGPS fix + ggaGpsQuality[0] = '2'; // 2 means DGPS fix rmcModeIndicator = 'D'; // D means differential vtgModeIndicator = 'D'; // D means differential break; @@ -1082,12 +1091,12 @@ static void loc_nmea_get_fix_quality(const UlpLocation & location, // NOTE: Order of the check is important if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK) { if (LOC_POS_TECH_MASK_SATELLITE & locationExtended.tech_mask){ - ggaGpsQuality = '1'; // 1 means GPS + ggaGpsQuality[0] = '1'; // 1 means GPS rmcModeIndicator = 'A'; // A means autonomous vtgModeIndicator = 'A'; // A means autonomous break; } else if (LOC_POS_TECH_MASK_SENSORS & locationExtended.tech_mask){ - ggaGpsQuality = '6'; // 6 means estimated (dead reckoning) + ggaGpsQuality[0] = '6'; // 6 means estimated (dead reckoning) rmcModeIndicator = 'E'; // E means estimated (dead reckoning) vtgModeIndicator = 'E'; // E means estimated (dead reckoning) break; @@ -1095,7 +1104,54 @@ static void loc_nmea_get_fix_quality(const UlpLocation & location, } } while (0); - LOC_LOGv("gps quality: %c, rmc mode indicator: %c, vtg mode indicator: %c", + do { + // check for customized nmea enabled or not + // with customized GGA quality enabled + // PPP fix w/o sensor: 59, PPP fix w/ sensor: 69 + // DGNSS/SBAS correction fix w/o sensor: 2, w/ sensor: 62 + // RTK fixed fix w/o sensor: 4, w/ sensor: 64 + // RTK float fix w/o sensor: 5, w/ sensor: 65 + // SPE fix w/o sensor: 1, and w/ sensor: 61 + // Sensor dead reckoning fix: 6 + if (true == custom_gga_fix_quality) { + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK) { + // PPP fix w/o sensor: fix quality will now be 59 + // PPP fix w sensor: fix quality will now be 69 + if (LOC_NAV_MASK_PPP_CORRECTION & locationExtended.navSolutionMask) { + if ((locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK) && + (LOC_POS_TECH_MASK_SENSORS & locationExtended.tech_mask)) { + ggaGpsQuality[0] = '6'; + ggaGpsQuality[1] = '9'; + } else { + ggaGpsQuality[0] = '5'; + ggaGpsQuality[1] = '9'; + } + break; + } + } + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK) { + if (LOC_POS_TECH_MASK_SENSORS & locationExtended.tech_mask){ + char ggaQuality_copy = ggaGpsQuality[0]; + ggaGpsQuality[0] = '6'; // 6 sensor assisted + // RTK fixed fix w/ sensor: fix quality will now be 64 + // RTK float fix w/ sensor: 65 + // DGNSS and/or SBAS correction fix and w/ sensor: 62 + // GPS fix without correction and w/ sensor: 61 + if ((LOC_NAV_MASK_RTK_FIXED_CORRECTION & locationExtended.navSolutionMask)|| + (LOC_NAV_MASK_RTK_CORRECTION & locationExtended.navSolutionMask)|| + (LOC_NAV_MASK_DGNSS_CORRECTION & locationExtended.navSolutionMask)|| + (LOC_NAV_MASK_SBAS_CORRECTION_IONO & locationExtended.navSolutionMask)|| + (LOC_POS_TECH_MASK_SATELLITE & locationExtended.tech_mask)) { + ggaGpsQuality[1] = ggaQuality_copy; + break; + } + } + } + } + } while (0); + + LOC_LOGv("gps quality: %s, rmc mode indicator: %c, vtg mode indicator: %c", ggaGpsQuality, rmcModeIndicator, vtgModeIndicator); } @@ -1127,6 +1183,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, const GpsLocationExtended &locationExtended, const LocationSystemInfo &systemInfo, unsigned char generate_nmea, + bool custom_gga_fix_quality, std::vector &nmeaArraystr) { ENTRY_LOG(); @@ -1270,10 +1327,10 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } - char ggaGpsQuality = '0'; + char ggaGpsQuality[3] = {'0', '\0', '\0'}; char rmcModeIndicator = 'N'; char vtgModeIndicator = 'N'; - loc_nmea_get_fix_quality(location, locationExtended, + loc_nmea_get_fix_quality(location, locationExtended, custom_gga_fix_quality, ggaGpsQuality, rmcModeIndicator, vtgModeIndicator); // ------------------- @@ -1772,12 +1829,12 @@ void loc_nmea_generate_pos(const UlpLocation &location, svUsedCount = MAX_SATELLITES_IN_USE; if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) { - length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", + length = snprintf(pMarker, lengthRemaining, "%s,%02d,%.1f,", ggaGpsQuality, svUsedCount, locationExtended.hdop); } else { // no hdop - length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", + length = snprintf(pMarker, lengthRemaining, "%s,%02d,,", ggaGpsQuality, svUsedCount); } diff --git a/utils/loc_nmea.h b/utils/loc_nmea.h index c6c83db4..a9cafb76 100644 --- a/utils/loc_nmea.h +++ b/utils/loc_nmea.h @@ -79,6 +79,7 @@ void loc_nmea_generate_pos(const UlpLocation &location, const GpsLocationExtended &locationExtended, const LocationSystemInfo &systemInfo, unsigned char generate_nmea, + bool custom_gga_fix_quality, std::vector &nmeaArraystr); #define DEBUG_NMEA_MINSIZE 6 From 5c568ca1bdd64c4de4a29695457db6bd81d0f5d8 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 1 Oct 2019 14:18:29 -0700 Subject: [PATCH 930/945] GNSS adapter: fix a race condition Fix the race condition that handleEngineUp gets called before GNSS adapter constructor finishes CRs-fixed: 2538904 Change-Id: I0946dd44ce3a4b03f2c8a45a855bbfbd4b7b8468 --- core/LocAdapterBase.cpp | 11 +++++++++-- core/LocAdapterBase.h | 24 ++++++++++++++++++++++-- gnss/GnssAdapter.cpp | 11 ++++++++--- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 1b844e57..1e91cf83 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -43,13 +43,20 @@ namespace loc_core { // the right locApi should get created. LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context, bool isMaster, - LocAdapterProxyBase *adapterProxyBase) : + LocAdapterProxyBase *adapterProxyBase, + bool waitForDoneInit) : mIsMaster(isMaster), mEvtMask(mask), mContext(context), mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), mMsgTask(context->getMsgTask()), mIsEngineCapabilitiesKnown(ContextBase::sIsEngineCapabilitiesKnown) { - mLocApi->addAdapter(this); + LOC_LOGd("waitForDoneInit: %d", waitForDoneInit); + if (!waitForDoneInit) { + mLocApi->addAdapter(this); + mAdapterAdded = true; + } else { + mAdapterAdded = false; + } } uint32_t LocAdapterBase::mSessionIdCounter(1); diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 909b6fea..7ca3ecda 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -70,9 +70,11 @@ protected: LocApiBase* mLocApi; LocAdapterProxyBase* mLocAdapterProxyBase; const MsgTask* mMsgTask; + bool mAdapterAdded; + inline LocAdapterBase(const MsgTask* msgTask) : mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL), - mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} + mLocAdapterProxyBase(NULL), mMsgTask(msgTask), mAdapterAdded(false) {} /* ==== CLIENT ========================================================================= */ typedef std::map ClientDataMap; @@ -89,9 +91,27 @@ protected: public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } + // When waitForDoneInit is not specified or specified as false, + // handleEngineUpEvent may be called on the child adapter object from + // a different thread before the constructor of the child + // object finishes. + // + // If the handleEngineUpEvent relies on member variables of the constructor + // of the child adapter to be initialized first, we need to specify the + // waitForDoneInit to *TRUE* to delay handleEngineUpEvent to get called + // until when the child adapter finishes its initialization and notify + // LocAdapterBase via doneInit method. LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, ContextBase* context, bool isMaster = false, - LocAdapterProxyBase *adapterProxyBase = NULL); + LocAdapterProxyBase *adapterProxyBase = NULL, + bool waitForDoneInit = false); + + inline void doneInit() { + if (!mAdapterAdded) { + mLocApi->addAdapter(this); + mAdapterAdded = true; + } + } inline LOC_API_ADAPTER_EVENT_MASK_T checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 980d4895..11f6777e 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -65,9 +65,10 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD GnssAdapter::GnssAdapter() : LocAdapterBase(0, LocContext::getLocContext(NULL, - NULL, - LocContext::mLocationHalName, - false), true, nullptr), + NULL, + LocContext::mLocationHalName, + false), + true, nullptr, true), mEngHubProxy(new EngineHubProxyBase()), mLocPositionMode(), mGnssSvIdUsedInPosition(), @@ -127,6 +128,10 @@ GnssAdapter::GnssAdapter() : readConfigCommand(); initDefaultAgpsCommand(); initEngHubProxyCommand(); + + // at last step, let us inform adapater base that we are done + // with initialization, e.g.: ready to process handleEngineUpEvent + doneInit(); } void From f195c219e601fd1c99e65353371a571e77043622 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Mon, 30 Sep 2019 17:27:36 +0530 Subject: [PATCH 931/945] nmea: fix status and mode indicator fields of RMC Fix status and mode indicator fields to proper values as per NMEA standard for GPRMC string. Change-Id: I7fe0e292079c0f71bb37f6a1462f669e14f54b81 CRs-Fixed: 2537924 --- utils/loc_nmea.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 24197ff0..61db2beb 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1439,8 +1439,19 @@ void loc_nmea_generate_pos(const UlpLocation &location, pMarker = sentence_RMC; lengthRemaining = sizeof(sentence_RMC); - length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A," , - talker, utcHours, utcMinutes, utcSeconds,utcMSeconds/10); + bool validFix = ((0 != sv_cache_info.gps_used_mask) || + (0 != sv_cache_info.glo_used_mask) || + (0 != sv_cache_info.gal_used_mask) || + (0 != sv_cache_info.qzss_used_mask) || + (0 != sv_cache_info.bds_used_mask)); + + if (validFix) { + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,A,", + talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); + } else { + length = snprintf(pMarker, lengthRemaining, "$%sRMC,%02d%02d%02d.%02d,V,", + talker, utcHours, utcMinutes, utcSeconds, utcMSeconds/10); + } if (length < 0 || length >= lengthRemaining) { @@ -1581,8 +1592,6 @@ void loc_nmea_generate_pos(const UlpLocation &location, // hardcode Navigation Status field to 'V' length = snprintf(pMarker, lengthRemaining, ",%c", 'V'); - pMarker += length; - lengthRemaining -= length; length = loc_nmea_put_checksum(sentence_RMC, sizeof(sentence_RMC)); From ae1d9031eff622838da1596737d871c16dcc9e2e Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Mon, 14 Oct 2019 18:21:15 +0800 Subject: [PATCH 932/945] Add listener for the initial battery status Listen to the initial charging status as DPO mode depends on it; Change ALOG to LOC_LOG. Change-Id: Ic61f76038f0e464b18ade8c9b20c058de35748c8 CRs-fixed: 2544828 --- android/1.0/Gnss.cpp | 2 + android/1.1/Gnss.cpp | 2 + android/2.0/Gnss.cpp | 2 + android/utils/Android.mk | 3 ++ android/utils/battery_listener.cpp | 70 +++++++++++++++--------------- 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp index d85e0a40..4aac432f 100644 --- a/android/1.0/Gnss.cpp +++ b/android/1.0/Gnss.cpp @@ -56,6 +56,8 @@ void location_on_battery_status_changed(bool charging) { Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); sGnss = this; + // initilize gnss interface at first in case needing notify battery status + sGnss->getGnssInterface()->initialize(); // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index bea556fe..277dbc16 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/Gnss.cpp @@ -97,6 +97,8 @@ void location_on_battery_status_changed(bool charging) { Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); sGnss = this; + // initilize gnss interface at first in case needing notify battery status + sGnss->getGnssInterface()->initialize(); // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp index af76b727..2276c148 100644 --- a/android/2.0/Gnss.cpp +++ b/android/2.0/Gnss.cpp @@ -96,6 +96,8 @@ void location_on_battery_status_changed(bool charging) { Gnss::Gnss() { ENTRY_LOG_CALLFLOW(); sGnss = this; + // initilize gnss interface at first in case needing notify battery status + sGnss->getGnssInterface()->initialize(); // register health client to listen on battery change loc_extn_battery_properties_listener_init(location_on_battery_status_changed); // clear pending GnssConfig diff --git a/android/utils/Android.mk b/android/utils/Android.mk index 76732c2c..0e4c9536 100644 --- a/android/utils/Android.mk +++ b/android/utils/Android.mk @@ -26,6 +26,9 @@ LOCAL_SHARED_LIBRARIES := \ android.hardware.power@1.2 \ libbase +LOCAL_HEADER_LIBRARIES := \ + libgps.utils_headers \ + LOCAL_STATIC_LIBRARIES := libhealthhalutils LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED diff --git a/android/utils/battery_listener.cpp b/android/utils/battery_listener.cpp index a790702b..8547e41e 100644 --- a/android/utils/battery_listener.cpp +++ b/android/utils/battery_listener.cpp @@ -31,12 +31,15 @@ #undef LOG_TAG #endif #define LOG_TAG "LocSvc_BatteryListener" +#define LOG_NDEBUG 0 #include #include #include #include #include +#include + using android::hardware::interfacesEqual; using android::hardware::Return; using android::hardware::Void; @@ -99,24 +102,25 @@ status_t BatteryListenerImpl::init() } while(tries < GET_HEALTH_SVC_RETRY_CNT); if (mHealth == NULL) { - ALOGE("no health service found, retries %d", tries); + LOC_LOGe("no health service found, retries %d", tries); return NO_INIT; } else { - ALOGI("Get health service in %d tries", tries); + LOC_LOGi("Get health service in %d tries", tries); } mStatus = BatteryStatus::UNKNOWN; auto ret = mHealth->getChargeStatus([&](Result r, BatteryStatus status) { if (r != Result::SUCCESS) { - ALOGE("batterylistener: cannot get battery status"); + LOC_LOGe("batterylistener: cannot get battery status"); return; } mStatus = status; }); - if (!ret.isOk()) - ALOGE("batterylistener: get charge status transaction error"); - - if (mStatus == BatteryStatus::UNKNOWN) - ALOGW("batterylistener: init: invalid battery status"); + if (!ret.isOk()) { + LOC_LOGe("batterylistener: get charge status transaction error"); + } + if (mStatus == BatteryStatus::UNKNOWN) { + LOC_LOGw("batterylistener: init: invalid battery status"); + } mDone = false; mThread = std::make_unique([this]() { std::unique_lock l(mLock); @@ -146,7 +150,7 @@ status_t BatteryListenerImpl::init() } default: bool c = statusToBool(local_status); - ALOGI("healthInfo cb thread: cb %s", c ? "CHARGING" : "NOT CHARGING"); + LOC_LOGi("healthInfo cb thread: cb %s", c ? "CHARGING" : "NOT CHARGING"); l.unlock(); mCb(c); l.lock(); @@ -156,13 +160,14 @@ status_t BatteryListenerImpl::init() }); auto reg = mHealth->registerCallback(this); if (!reg.isOk()) { - ALOGE("Transaction error in registeringCb to HealthHAL death: %s", + LOC_LOGe("Transaction error in registeringCb to HealthHAL death: %s", reg.description().c_str()); } auto linked = mHealth->linkToDeath(this, 0 /* cookie */); if (!linked.isOk() || linked == false) { - ALOGE("Transaction error in linking to HealthHAL death: %s", linked.description().c_str()); + LOC_LOGe("Transaction error in linking to HealthHAL death: %s", + linked.description().c_str()); } return NO_ERROR; } @@ -181,7 +186,7 @@ BatteryListenerImpl::~BatteryListenerImpl() mHealth->unlinkToDeath(this); auto r = mHealth->unlinkToDeath(this); if (!r.isOk() || r == false) { - ALOGE("Transaction error in unregister to HealthHAL death: %s", + LOC_LOGe("Transaction error in unregister to HealthHAL death: %s", r.description().c_str()); } } @@ -195,10 +200,10 @@ void BatteryListenerImpl::serviceDied(uint64_t cookie __unused, { std::lock_guard _l(mLock); if (mHealth == NULL || !interfacesEqual(mHealth, who.promote())) { - ALOGE("health not initialized or unknown interface died"); + LOC_LOGe("health not initialized or unknown interface died"); return; } - ALOGI("health service died, reinit"); + LOC_LOGi("health service died, reinit"); mDone = true; } mThread->join(); @@ -212,9 +217,8 @@ void BatteryListenerImpl::serviceDied(uint64_t cookie __unused, // NOT_CHARGING and CHARGING concurrencies. // Replace single var by a list if this assumption is broken Return BatteryListenerImpl::healthInfoChanged( - const hardware::health::V2_0::HealthInfo& info) -{ - ALOGV("healthInfoChanged: %d", info.legacy.batteryStatus); + const hardware::health::V2_0::HealthInfo& info) { + LOC_LOGv("healthInfoChanged: %d", info.legacy.batteryStatus); std::unique_lock l(mLock); if (info.legacy.batteryStatus != mStatus) { mStatus = info.legacy.batteryStatus; @@ -224,29 +228,29 @@ Return BatteryListenerImpl::healthInfoChanged( } static sp batteryListener; -status_t batteryPropertiesListenerInit(BatteryListenerImpl::cb_fn_t cb) -{ - ALOGV("batteryPropertiesListenerInit entry"); + +bool batteryPropertiesListenerIsCharging() { + return batteryListener->isCharging(); +} + +status_t batteryPropertiesListenerInit(BatteryListenerImpl::cb_fn_t cb) { batteryListener = new BatteryListenerImpl(cb); + bool isCharging = batteryPropertiesListenerIsCharging(); + LOC_LOGv("charging status: %s charging", isCharging ? "" : "not");; + if (isCharging) { + cb(isCharging); + } return NO_ERROR; } -status_t batteryPropertiesListenerDeinit() -{ +status_t batteryPropertiesListenerDeinit() { batteryListener.clear(); return OK; } -bool batteryPropertiesListenerIsCharging() -{ - return batteryListener->isCharging(); -} - } // namespace android -void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn) -{ - ALOGV("loc_extn_battery_properties_listener_init entry"); +void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn) { if (!sIsBatteryListened) { std::thread t1(android::batteryPropertiesListenerInit, [=](bool charging) { fn(charging); }); @@ -255,12 +259,10 @@ void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn) } } -void loc_extn_battery_properties_listener_deinit() -{ +void loc_extn_battery_properties_listener_deinit() { android::batteryPropertiesListenerDeinit(); } -bool loc_extn_battery_properties_is_charging() -{ +bool loc_extn_battery_properties_is_charging() { return android::batteryPropertiesListenerIsCharging(); } From 755bba2813a8acda140ead88debbed8dd6b78bef Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 8 Oct 2019 14:28:08 -0700 Subject: [PATCH 933/945] GnssSv struct: make it in sync between 3.0.c5, 4.0 and 5.0 Make GnssSv struct in sync between 3.0.c5, 4.0 and 5.0 to allow 3.0.C5 hal daemon to work with 4.0/5.0 location client API app Change-Id: I421fc3a36055fa278ef42bca4816d07f18c75d68 CRs-fixed: 2541020 --- location/LocationDataTypes.h | 34 +++++++++++++++------------- utils/gps_extended_c.h | 43 ------------------------------------ 2 files changed, 19 insertions(+), 58 deletions(-) diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 17094ab5..956754ad 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -567,28 +567,32 @@ typedef enum { GNSS_SIGNAL_GALILEO_E5A = (1<<7), /** GALILEO E5B RF Band */ GNSS_SIGNAL_GALILEO_E5B = (1<<8), - /** BEIDOU B1_I RF Band */ - GNSS_SIGNAL_BEIDOU_B1I = (1<<9), - /** BEIDOU B1C RF Band */ - GNSS_SIGNAL_BEIDOU_B1C = (1<<10), - /** BEIDOU B2_I RF Band */ - GNSS_SIGNAL_BEIDOU_B2I = (1<<11), - /** BEIDOU B2A_I RF Band */ - GNSS_SIGNAL_BEIDOU_B2AI = (1<<12), + /** BEIDOU B1 RF Band */ + GNSS_SIGNAL_BEIDOU_B1 = (1<<9), + /** BEIDOU B2 RF Band */ + GNSS_SIGNAL_BEIDOU_B2 = (1<<10), /** QZSS L1CA RF Band */ - GNSS_SIGNAL_QZSS_L1CA = (1<<13), + GNSS_SIGNAL_QZSS_L1CA = (1<<11), /** QZSS L1S RF Band */ - GNSS_SIGNAL_QZSS_L1S = (1<<14), + GNSS_SIGNAL_QZSS_L1S = (1<<12), /** QZSS L2 RF Band */ - GNSS_SIGNAL_QZSS_L2 = (1<<15), + GNSS_SIGNAL_QZSS_L2 = (1<<13), /** QZSS L5 RF Band */ - GNSS_SIGNAL_QZSS_L5 = (1<<16), + GNSS_SIGNAL_QZSS_L5 = (1<<14), /** SBAS L1 RF Band */ - GNSS_SIGNAL_SBAS_L1 = (1<<17), + GNSS_SIGNAL_SBAS_L1 = (1<<15), + /** BEIDOU B1I RF Band */ + GNSS_SIGNAL_BEIDOU_B1I = (1<<16), + /** BEIDOU B1C RF Band */ + GNSS_SIGNAL_BEIDOU_B1C = (1<<17), + /** BEIDOU B2I RF Band */ + GNSS_SIGNAL_BEIDOU_B2I = (1<<18), + /** BEIDOU B2AI RF Band */ + GNSS_SIGNAL_BEIDOU_B2AI = (1<<19), /** NAVIC L5 RF Band */ - GNSS_SIGNAL_NAVIC_L5 = (1<<18), + GNSS_SIGNAL_NAVIC_L5 = (1<<20), /** BEIDOU B2A_Q RF Band */ - GNSS_SIGNAL_BEIDOU_B2AQ = (1<<19) + GNSS_SIGNAL_BEIDOU_B2AQ = (1<<21), } GnssSignalTypeBits; #define GNSS_SIGNAL_TYPE_MASK_ALL\ diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 69a659ee..3ef49e3d 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -573,49 +573,6 @@ typedef uint8_t CarrierPhaseAmbiguityType; #define CARRIER_PHASE_AMBIGUITY_RESOLUTION_FLOAT ((CarrierPhaseAmbiguityType)1) #define CARRIER_PHASE_AMBIGUITY_RESOLUTION_FIXED ((CarrierPhaseAmbiguityType)2) -/** GNSS Signal Type and RF Band */ -typedef uint32_t GnssSignalTypeMask; -/** GPS L1CA Signal */ -#define GNSS_SIGNAL_GPS_L1CA ((GnssSignalTypeMask)0x00000001ul) -/** GPS L1C Signal */ -#define GNSS_SIGNAL_GPS_L1C ((GnssSignalTypeMask)0x00000002ul) -/** GPS L2 RF Band */ -#define GNSS_SIGNAL_GPS_L2 ((GnssSignalTypeMask)0x00000004ul) -/** GPS L5 RF Band */ -#define GNSS_SIGNAL_GPS_L5 ((GnssSignalTypeMask)0x00000008ul) -/** GLONASS G1 (L1OF) RF Band */ -#define GNSS_SIGNAL_GLONASS_G1 ((GnssSignalTypeMask)0x00000010ul) -/** GLONASS G2 (L2OF) RF Band */ -#define GNSS_SIGNAL_GLONASS_G2 ((GnssSignalTypeMask)0x00000020ul) -/** GALILEO E1 RF Band */ -#define GNSS_SIGNAL_GALILEO_E1 ((GnssSignalTypeMask)0x00000040ul) -/** GALILEO E5A RF Band */ -#define GNSS_SIGNAL_GALILEO_E5A ((GnssSignalTypeMask)0x00000080ul) -/** GALILEO E5B RF Band */ -#define GNSS_SIGNAL_GALILIEO_E5B ((GnssSignalTypeMask)0x00000100ul) -/** BEIDOU B1_I RF Band */ -#define GNSS_SIGNAL_BEIDOU_B1I ((GnssSignalTypeMask)0x00000200ul) -/** BEIDOU B1C RF Band */ -#define GNSS_SIGNAL_BEIDOU_B1C ((GnssSignalTypeMask)0x00000400ul) -/** BEIDOU B2_I RF Band */ -#define GNSS_SIGNAL_BEIDOU_B2I ((GnssSignalTypeMask)0x00000800ul) -/** BEIDOU B2A_I RF Band */ -#define GNSS_SIGNAL_BEIDOU_B2AI ((GnssSignalTypeMask)0x00001000ul) -/** QZSS L1CA RF Band */ -#define GNSS_SIGNAL_QZSS_L1CA ((GnssSignalTypeMask)0x00002000ul) -/** QZSS L1S RF Band */ -#define GNSS_SIGNAL_QZSS_L1S ((GnssSignalTypeMask)0x00004000ul) -/** QZSS L2 RF Band */ -#define GNSS_SIGNAL_QZSS_L2 ((GnssSignalTypeMask)0x00008000ul) -/** QZSS L5 RF Band */ -#define GNSS_SIGNAL_QZSS_L5 ((GnssSignalTypeMask)0x00010000ul) -/** SBAS L1 RF Band */ -#define GNSS_SIGNAL_SBAS_L1 ((GnssSignalTypeMask)0x00020000ul) -/** NAVIC L5 RF Band */ -#define GNSS_SIGNAL_NAVIC_L5 ((GnssSignalTypeMask)0x00040000ul) -/** BEIDOU B2A_Q RF Band */ -#define GNSS_SIGNAL_BEIDOU_B2AQ ((GnssSignalTypeMask)0x00080000ul) - typedef uint16_t GnssMeasUsageStatusBitMask; /** Used in fix */ #define GNSS_MEAS_USED_IN_PVT ((GnssMeasUsageStatusBitMask)0x00000001ul) From 7eb1dcf0c743c27dde4814ad6ce22ee50876bbec Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Thu, 3 Oct 2019 13:29:47 -0700 Subject: [PATCH 934/945] GPS NMEA: generate empty GSA sentence for dead reckoning fixes For dead reckoning fixes when number of SV used in fix is 0, we need to generate an empty GSA sentence CRs-fixed: 2542163 Change-Id: Icb89981d04ecdfeb81fbdc16b2a8d3676319b18d --- utils/loc_nmea.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 24197ff0..64a35250 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1327,6 +1327,14 @@ void loc_nmea_generate_pos(const UlpLocation &location, talker[1] = sv_meta.talker[1]; } + // if svUsedCount is 0, it means we do not generate any GSA sentence yet. + // in this case, generate an empty GSA sentence + if (svUsedCount == 0) { + strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,,", sizeof(sentence)); + length = loc_nmea_put_checksum(sentence, sizeof(sentence)); + nmeaArraystr.push_back(sentence); + } + char ggaGpsQuality[3] = {'0', '\0', '\0'}; char rmcModeIndicator = 'N'; char vtgModeIndicator = 'N'; From 386a7413091314c2ba33ef06f7444cdbeaba7bf1 Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Tue, 22 Oct 2019 08:18:52 -0700 Subject: [PATCH 935/945] Add NI_SUPL_DENY_ON_NFW_LOCKED configuration If an NI SUPL Request that does not have Privacy Override option comes when NFW is locked and config item NI_SUPL_DENY_ON_NFW_LOCKED = 1, then deny it Change-Id: I0a769c4696751069d5a034dde8569ecfcf63b41a CRs-fixed: 2550126 --- core/ContextBase.cpp | 3 +++ core/ContextBase.h | 1 + gnss/GnssAdapter.cpp | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 74345909..3b8ffc6e 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -92,6 +92,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'}, {"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED", &mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'}, + {"NI_SUPL_DENY_ON_NFW_LOCKED", &mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -191,6 +192,8 @@ void ContextBase::readConfig() /* default configuration QTI GNSS H/W */ mGps_conf.GNSS_DEPLOYMENT = 0; mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0; + /* default configuration for NI_SUPL_DENY_ON_NFW_LOCKED */ + mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED = 0; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); diff --git a/core/ContextBase.h b/core/ContextBase.h index 6701600e..e63450ff 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -75,6 +75,7 @@ typedef struct loc_gps_cfg_s uint32_t CP_MTLR_ES; uint32_t GNSS_DEPLOYMENT; uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED; + uint32_t NI_SUPL_DENY_ON_NFW_LOCKED; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 980d4895..b4630468 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3676,6 +3676,15 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* else { mAdapter.requestNiNotify(mNotify, mData, false); } + } else if ((mAdapter.mSupportNfwControl || 0 == mAdapter.getAfwControlId()) && + GNSS_NI_TYPE_SUPL == mNotify.type && !bIsInEmergency && + !(GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT & mNotify.options) && + (GNSS_CONFIG_GPS_LOCK_NI & ContextBase::mGps_conf.GPS_LOCK) && + 1 == ContextBase::mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED) { + // If 'Q' Lock behavior OR 'P' Lock behavior and GNSS is Locked + // If an NI SUPL Request that does not have Privacy Override option comes when + // NFW is locked and config item NI_SUPL_DENY_ON_NFW_LOCKED = 1, then deny it + mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData); } else { mAdapter.requestNiNotify(mNotify, mData, false); } From 52d928e06956bad27f03c78d67cbaadd80cef74d Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 13 Sep 2019 15:43:27 -0700 Subject: [PATCH 936/945] GPS HAL: send platform power state event to modem Send platform power state event, suspend/resume/shutdown to modem Change-Id: I19960f5fb4935de9e4f5513abd95aed6241a2fd9 CRs-fixed: 2527622 --- core/LocApiBase.cpp | 2 ++ core/LocApiBase.h | 1 + gnss/GnssAdapter.cpp | 35 +++++++++++++++++++++++++++++++++-- gnss/GnssAdapter.h | 6 ++++++ gnss/location_gnss.cpp | 10 +++++++++- location/location_interface.h | 1 + utils/gps_extended_c.h | 7 +++++++ 7 files changed, 59 insertions(+), 3 deletions(-) diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 8c79cf74..595fa49f 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -873,5 +873,7 @@ DEFAULT_IMPL() void LocApiBase::addToCallQueue(LocApiResponse* /*adapterResponse*/) DEFAULT_IMPL() +void LocApiBase::updateSystemPowerState(PowerStateType /*powerState*/) +DEFAULT_IMPL() } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 6dac585b..3c85b099 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -312,6 +312,7 @@ public: void updateEvtMask(); void updateNmeaMask(uint32_t mask); + virtual void updateSystemPowerState(PowerStateType systemPowerState); }; typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 11f6777e..7d42106b 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -98,7 +98,8 @@ GnssAdapter::GnssAdapter() : mIsE911Session(NULL), mGnssMbSvIdUsedInPosition{}, mGnssMbSvIdUsedInPosAvail(false), - mSupportNfwControl(true) + mSupportNfwControl(true), + mSystemPowerState(POWER_STATE_UNKNOWN) { LOC_LOGD("%s]: Constructor %p", __func__, this); mLocPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -1997,6 +1998,35 @@ GnssAdapter::blockCPICommand(double latitude, double longitude, sendMsg(new MsgBlockCPI(mBlockCPIInfo, blockCPIInfo)); } +void +GnssAdapter::updateSystemPowerState(PowerStateType systemPowerState) { + if (POWER_STATE_UNKNOWN != systemPowerState) { + mSystemPowerState = systemPowerState; + mLocApi->updateSystemPowerState(mSystemPowerState); + } +} + +void +GnssAdapter::updateSystemPowerStateCommand(PowerStateType systemPowerState) { + LOC_LOGd("power event %d", systemPowerState); + + struct MsgUpdatePowerState : public LocMsg { + GnssAdapter& mAdapter; + PowerStateType mSystemPowerState; + + inline MsgUpdatePowerState(GnssAdapter& adapter, + PowerStateType systemPowerState) : + LocMsg(), + mAdapter(adapter), + mSystemPowerState(systemPowerState) {} + inline virtual void proc() const { + mAdapter.updateSystemPowerState(mSystemPowerState); + } + }; + + sendMsg(new MsgUpdatePowerState(*this, systemPowerState)); +} + void GnssAdapter::addClientCommand(LocationAPI* client, const LocationCallbacks& callbacks) { @@ -2133,9 +2163,10 @@ GnssAdapter::handleEngineUpEvent() mAdapter.broadcastCapabilities(mAdapter.getCapabilities()); // must be called only after capabilities are known mAdapter.setConfig(); - mAdapter.restartSessions(); mAdapter.gnssSvIdConfigUpdate(); mAdapter.gnssSvTypeConfigUpdate(); + mAdapter.updateSystemPowerState(mAdapter.getSystemPowerState()); + mAdapter.restartSessions(); for (auto msg: mAdapter.mPendingMsgs) { mAdapter.sendMsg(msg); } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3ccdd96d..b3ffeaf8 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -187,6 +187,7 @@ class GnssAdapter : public LocAdapterBase { XtraSystemStatusObserver mXtraObserver; LocationSystemInfo mLocSystemInfo; std::vector mBlacklistedSvIds; + PowerStateType mSystemPowerState; /* === Misc ===================================================================== */ BlockCPIInfo mBlockCPIInfo; @@ -413,6 +414,8 @@ public: return false; } + void updateSystemPowerState(PowerStateType systemPowerState); + /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); /* get AGC information from system status and fill it */ @@ -459,11 +462,14 @@ public: void reportPowerStateIfChanged(); void savePowerStateCallback(powerStateCallback powerStateCb){ mPowerStateCb = powerStateCb; } bool getPowerState() { return mPowerOn; } + inline PowerStateType getSystemPowerState() { return mSystemPowerState; } + void setAllowFlpNetworkFixes(uint32_t allow) { mAllowFlpNetworkFixes = allow; } uint32_t getAllowFlpNetworkFixes() { return mAllowFlpNetworkFixes; } void setSuplHostServer(const char* server, int port, LocServerType type); void notifyClientOfCachedLocationSystemInfo(LocationAPI* client, const LocationCallbacks& callbacks); + void updateSystemPowerStateCommand(PowerStateType systemPowerState); }; #endif //GNSS_ADAPTER_H diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 76839b62..5380f05a 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -79,6 +79,7 @@ static void odcpiInject(const Location& location); static void blockCPI(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); static void updateBatteryStatus(bool charging); +static void updateSystemPowerState(PowerStateType systemPowerState); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -117,7 +118,8 @@ static const GnssInterface gGnssInterface = { nfwInit, getPowerStateChanges, injectLocationExt, - updateBatteryStatus + updateBatteryStatus, + updateSystemPowerState }; #ifndef DEBUG_X86 @@ -390,3 +392,9 @@ static void updateBatteryStatus(bool charging) { gGnssAdapter->getSystemStatus()->updatePowerConnectState(charging); } } + +static void updateSystemPowerState(PowerStateType systemPowerState) { + if (NULL != gGnssAdapter) { + gGnssAdapter->updateSystemPowerStateCommand(systemPowerState); + } +} diff --git a/location/location_interface.h b/location/location_interface.h index fb15bea6..d08dfb3c 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -88,6 +88,7 @@ struct GnssInterface { void (*getPowerStateChanges)(void* powerStateCb); void (*injectLocationExt)(const GnssLocationInfoNotification &locationInfo); void (*updateBatteryStatus)(bool charging); + void (*updateSystemPowerState)(PowerStateType systemPowerState); }; struct BatchingInterface { diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 3ef49e3d..cd7c2358 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -2223,6 +2223,13 @@ typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr); +enum PowerStateType { + POWER_STATE_UNKNOWN = 0, + POWER_STATE_SUSPEND = 1, + POWER_STATE_RESUME = 2, + POWER_STATE_SHUTDOWN = 3 +}; + /* Shared resources of LocIpc */ #define LOC_IPC_HAL "/dev/socket/location/socket_hal" #define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra" From 6bfa690c483ed3f58a28062dbafc2843e0502a52 Mon Sep 17 00:00:00 2001 From: Bhavna Sharma Date: Wed, 2 Oct 2019 16:29:38 -0700 Subject: [PATCH 937/945] Handle SPE session TBF and nHz subscription for automotive 1. Requirement is to run SPE session only at 100ms TBF if any nHz capable engine subscribes for nHz measurement or nHz position reports. 2. Second requirement is to subscribe for nHz measurement only if an an actual nHz engine subscribes for nHz measurement CRs-Fixed: 2540001 Change-Id: I5a2c93a9d880967ab59ce6cd12cd415c98f29e6c --- core/EngineHubProxyBase.h | 6 +- gnss/GnssAdapter.cpp | 138 ++++++++++++++++++++++++++++++-------- gnss/GnssAdapter.h | 4 ++ 3 files changed, 118 insertions(+), 30 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index ec881f69..2d30c5bc 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -113,6 +113,9 @@ typedef std::function GnssAdapterReqAidingDataCb; +typedef std::function + GnssAdapterUpdateNHzRequirementCb; + // potential parameters: message queue: MsgTask * msgTask; // callback function to report back dr and ppe position and sv report typedef EngineHubProxyBase* (getEngHubProxyFn)( @@ -120,7 +123,8 @@ typedef EngineHubProxyBase* (getEngHubProxyFn)( IOsObserver* osObserver, GnssAdapterReportEnginePositionsEventCb positionEventCb, GnssAdapterReportSvEventCb svEventCb, - GnssAdapterReqAidingDataCb reqAidingDataCb); + GnssAdapterReqAidingDataCb reqAidingDataCb, + GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb); } // namespace loc_core diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 11f6777e..dee969ab 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -45,7 +45,6 @@ #include #include #include - #include #define RAD2DEG (180.0 / M_PI) @@ -71,6 +70,8 @@ GnssAdapter::GnssAdapter() : true, nullptr, true), mEngHubProxy(new EngineHubProxyBase()), mLocPositionMode(), + mNHzNeeded(false), + mSPEAlreadyRunningAtHighestInterval(false), mGnssSvIdUsedInPosition(), mGnssSvIdUsedInPosAvail(false), mControlCallbacks(), @@ -173,6 +174,30 @@ GnssAdapter::convertOptions(LocPosMode& out, const TrackingOptions& trackingOpti out.timeBetweenMeasurements = trackingOptions.tbm; } +bool +GnssAdapter::checkAndSetSPEToRunforNHz(TrackingOptions & out) { + // first check if NHz meas is needed at all, if not, just return false + // if a NHz capable engine is subscribed for NHz measurement or NHz positions, + // always run the SPE only session at 100ms TBF. + // If SPE session is already set to highest interval, no need to start it again. + + bool isSPERunningAtHighestInterval = false; + + if (!mNHzNeeded) { + LOC_LOGd("No nHz session needed."); + } else if (mSPEAlreadyRunningAtHighestInterval) { + LOC_LOGd("SPE is already running at highest interval."); + isSPERunningAtHighestInterval = true; + } else if (out.minInterval > MIN_TRACKING_INTERVAL) { + out.minInterval = MIN_TRACKING_INTERVAL; + LOC_LOGd("nHz session is needed, starting SPE only session at 100ms TBF."); + mSPEAlreadyRunningAtHighestInterval = true; + } + + return isSPERunningAtHighestInterval; +} + + void GnssAdapter::convertLocation(Location& out, const UlpLocation& ulpLocation, const GpsLocationExtended& locationExtended, @@ -2089,13 +2114,16 @@ GnssAdapter::updateClientsEventMask() if((1 == ContextBase::mGps_conf.EXTERNAL_DR_ENABLED) || (true == initEngHubProxy())) { mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; - mask |= LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT; mask |= LOC_API_ADAPTER_BIT_GNSS_SV_EPHEMERIS_REPORT; mask |= LOC_API_ADAPTER_BIT_LOC_SYSTEM_INFO; mask |= LOC_API_ADAPTER_BIT_EVENT_REPORT_INFO; + // Nhz measurement bit is set based on callback from loc eng hub + // for Nhz engines. + mask |= checkMask(LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT); + LOC_LOGd("Auto usecase, Enable MEAS/POLY/EPHEMERIS - mask 0x%" PRIx64 "", mask); } @@ -2155,13 +2183,31 @@ GnssAdapter::restartSessions() // odcpi session is no longer active after restart mOdcpiRequestActive = false; + // SPE will be restarted now, so set this variable to false. + mSPEAlreadyRunningAtHighestInterval = false; + + checkAndRestartTimeBasedSession(); + + for (auto it = mDistanceBasedTrackingSessions.begin(); + it != mDistanceBasedTrackingSessions.end(); ++it) { + mLocApi->startDistanceBasedTracking(it->first.id, it->second, + new LocApiResponse(*getContext(), + [] (LocationError /*err*/) {})); + } +} + +void GnssAdapter::checkAndRestartTimeBasedSession() +{ + LOC_LOGD("%s]: ", __func__); + if (!mTimeBasedTrackingSessions.empty()) { // get the LocationOptions that has the smallest interval, which should be the active one TrackingOptions smallestIntervalOptions; // size is zero until set for the first time TrackingOptions highestPowerTrackingOptions; memset(&smallestIntervalOptions, 0, sizeof(smallestIntervalOptions)); memset(&highestPowerTrackingOptions, 0, sizeof(highestPowerTrackingOptions)); - for (auto it = mTimeBasedTrackingSessions.begin(); it != mTimeBasedTrackingSessions.end(); ++it) { + for (auto it = mTimeBasedTrackingSessions.begin(); + it != mTimeBasedTrackingSessions.end(); ++it) { // size of zero means we havent set it yet if (0 == smallestIntervalOptions.size || it->second.minInterval < smallestIntervalOptions.minInterval) { @@ -2177,14 +2223,10 @@ GnssAdapter::restartSessions() } highestPowerTrackingOptions.setLocationOptions(smallestIntervalOptions); - mLocApi->startTimeBasedTracking(highestPowerTrackingOptions, nullptr); - } - - for (auto it = mDistanceBasedTrackingSessions.begin(); - it != mDistanceBasedTrackingSessions.end(); ++it) { - mLocApi->startDistanceBasedTracking(it->first.id, it->second, - new LocApiResponse(*getContext(), - [] (LocationError /*err*/) {})); + // want to run SPE session at a fixed min interval in some automotive scenarios + if(!checkAndSetSPEToRunforNHz(highestPowerTrackingOptions)) { + mLocApi->startTimeBasedTracking(highestPowerTrackingOptions, nullptr); + } } } @@ -2491,6 +2533,7 @@ GnssAdapter::startTimeBasedTrackingMultiplex(LocationAPI* client, uint32_t sessi multiplexedOptions.minInterval = options.minInterval; updateOptions = true; } + // if session we are starting has smaller powerMode then next smallest if (options.powerMode < multiplexedPowerMode) { multiplexedOptions.powerMode = options.powerMode; @@ -2524,15 +2567,24 @@ GnssAdapter::startTimeBasedTracking(LocationAPI* client, uint32_t sessionId, mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - mLocApi->startTimeBasedTracking(trackingOptions, new LocApiResponse(*getContext(), - [this, client, sessionId] (LocationError err) { - if (LOCATION_ERROR_SUCCESS != err) { - eraseTrackingSession(client, sessionId); - } + // want to run SPE session at a fixed min interval in some automotive scenarios + // use a local copy of TrackingOptions as the TBF may get modified in the + // checkAndSetSPEToRunforNHz function + TrackingOptions tempOptions(trackingOptions); + if (!checkAndSetSPEToRunforNHz(tempOptions)) { + mLocApi->startTimeBasedTracking(tempOptions, new LocApiResponse(*getContext(), + [this, client, sessionId] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + eraseTrackingSession(client, sessionId); + } + + reportResponse(client, err, sessionId); + } + )); + } else { + reportResponse(client, LOCATION_ERROR_SUCCESS, sessionId); + } - reportResponse(client, err, sessionId); - } - )); } void @@ -2546,16 +2598,23 @@ GnssAdapter::updateTracking(LocationAPI* client, uint32_t sessionId, mEngHubProxy->gnssSetFixMode(locPosMode); mEngHubProxy->gnssStartFix(); - mLocApi->startTimeBasedTracking(updatedOptions, new LocApiResponse(*getContext(), - [this, client, sessionId, oldOptions] (LocationError err) { - if (LOCATION_ERROR_SUCCESS != err) { - // restore the old LocationOptions - saveTrackingSession(client, sessionId, oldOptions); + // want to run SPE session at a fixed min interval in some automotive scenarios + // use a local copy of TrackingOptions as the TBF may get modified in the + // checkAndSetSPEToRunforNHz function + TrackingOptions tempOptions(updatedOptions); + if(!checkAndSetSPEToRunforNHz(tempOptions)) { + mLocApi->startTimeBasedTracking(tempOptions, new LocApiResponse(*getContext(), + [this, client, sessionId, oldOptions] (LocationError err) { + if (LOCATION_ERROR_SUCCESS != err) { + // restore the old LocationOptions + saveTrackingSession(client, sessionId, oldOptions); + } + reportResponse(client, err, sessionId); } - - reportResponse(client, err, sessionId); - } - )); + )); + } else { + reportResponse(client, LOCATION_ERROR_SUCCESS, sessionId); + } } void @@ -2856,6 +2915,8 @@ GnssAdapter::stopTracking(LocationAPI* client, uint32_t id) [this, client, id] (LocationError err) { reportResponse(client, err, id); })); + + mSPEAlreadyRunningAtHighestInterval = false; } bool @@ -5023,11 +5084,30 @@ GnssAdapter::initEngHubProxy() { mLocApi->requestForAidingData(svDataMask); }; + GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb = + [this] (bool nHzNeeded, bool nHzMeasNeeded) { + + if (nHzMeasNeeded && + (!checkMask(LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT))) { + updateEvtMask(LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT, + LOC_REGISTRATION_MASK_ENABLED); + } else if (checkMask(LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT)) { + updateEvtMask(LOC_API_ADAPTER_BIT_GNSS_NHZ_MEASUREMENT, + LOC_REGISTRATION_MASK_DISABLED); + } + + if (mNHzNeeded != nHzNeeded) { + mNHzNeeded = nHzNeeded; + checkAndRestartTimeBasedSession(); + } + }; + getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy"); if(getter != nullptr) { EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(), reportPositionEventCb, - reportSvEventCb, reqAidingDataCb); + reportSvEventCb, reqAidingDataCb, + updateNHzRequirementCb); if (hubProxy != nullptr) { mEngHubProxy = hubProxy; engHubLoadSuccessful = true; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 3ccdd96d..1bcf4b7a 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -138,6 +138,8 @@ class GnssAdapter : public LocAdapterBase { /* ==== Engine Hub ===================================================================== */ EngineHubProxyBase* mEngHubProxy; + bool mNHzNeeded; + bool mSPEAlreadyRunningAtHighestInterval; /* ==== TRACKING ======================================================================= */ TrackingOptionsMap mTimeBasedTrackingSessions; @@ -228,6 +230,7 @@ public: virtual void handleEngineUpEvent(); /* ======== UTILITIES ================================================================== */ void restartSessions(); + void checkAndRestartTimeBasedSession(); /* ==== CLIENT ========================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ @@ -265,6 +268,7 @@ public: const TrackingOptions& trackingOptions); void updateTracking(LocationAPI* client, uint32_t sessionId, const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); + bool checkAndSetSPEToRunforNHz(TrackingOptions & out); /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ From 569517b808735f514f6d2e9fadb7922af4610960 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 1 Nov 2019 11:31:41 -0700 Subject: [PATCH 938/945] GPS HW module: fix << overflow issue Fix shift overflow when the number of bits shifted can exceed 31 bits Change-Id: Ib4334fd9b3bf574b8d8143a5f706ca9e963a6053 CRs-fixed: 2557855 --- gnss/GnssAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index dee969ab..f7e1c0d2 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -1518,7 +1518,7 @@ GnssAdapter::convertToGnssSvIdConfig( LOC_LOGe("Invalid sv id %d for sv type %d", source.svId, source.constellation); } else { - *svMaskPtr |= (1 << (source.svId - initialSvId)); + *svMaskPtr |= (1ULL << (source.svId - initialSvId)); } } } From e14cbf37981a9c86c387590d85e627e6405d819a Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 4 Nov 2019 12:55:24 -0800 Subject: [PATCH 939/945] GNSS BDS max SV ID: update to 237 from 235 Change-Id: I0c373c91f9763c67d1b877f77216ae0efc7a6273 CRs-fixed: 2558927 --- utils/gps_extended_c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/gps_extended_c.h b/utils/gps_extended_c.h index 3ef49e3d..3c6a0a4e 100644 --- a/utils/gps_extended_c.h +++ b/utils/gps_extended_c.h @@ -449,7 +449,7 @@ typedef uint32_t GnssAdditionalSystemInfoMask; #define QZSS_SV_PRN_MIN 193 #define QZSS_SV_PRN_MAX 197 #define BDS_SV_PRN_MIN 201 -#define BDS_SV_PRN_MAX 235 +#define BDS_SV_PRN_MAX 237 #define GAL_SV_PRN_MIN 301 #define GAL_SV_PRN_MAX 336 #define NAVIC_SV_PRN_MIN 401 From 61c8aaca033ea9c883a71edc741361d2fbc5cdc3 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Tue, 15 Oct 2019 15:36:46 -0700 Subject: [PATCH 940/945] Concurrent position report: report out SPE fix promptly For concurrent position report, we need to report SPE fix promptly Change-Id: Iba7807ccb158dc4092abd9bbf540cbf0a6c7345b CRs-fixed: 2546089 --- gnss/GnssAdapter.cpp | 53 ++++++++++++++++++++++++++++++-------------- gnss/GnssAdapter.h | 3 +-- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index dee969ab..f06deb06 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -2086,7 +2086,9 @@ GnssAdapter::updateClientsEventMask() { LOC_API_ADAPTER_EVENT_MASK_T mask = 0; for (auto it=mClientData.begin(); it != mClientData.end(); ++it) { - if (it->second.trackingCb != nullptr || it->second.gnssLocationInfoCb != nullptr) { + if (it->second.trackingCb != nullptr || + it->second.gnssLocationInfoCb != nullptr || + it->second.engineLocationsInfoCb != nullptr) { mask |= LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT; } if (it->second.gnssSvCb != nullptr) { @@ -2259,13 +2261,6 @@ GnssAdapter::notifyClientOfCachedLocationSystemInfo( } } -bool -GnssAdapter::hasTrackingCallback(LocationAPI* client) -{ - auto it = mClientData.find(client); - return (it != mClientData.end() && (it->second.trackingCb || it->second.gnssLocationInfoCb)); -} - bool GnssAdapter::isTimeBasedTrackingSession(LocationAPI* client, uint32_t sessionId) { @@ -2281,10 +2276,21 @@ GnssAdapter::isDistanceBasedTrackingSession(LocationAPI* client, uint32_t sessio } bool -GnssAdapter::hasMeasurementsCallback(LocationAPI* client) +GnssAdapter::hasCallbacksToStartTracking(LocationAPI* client) { + bool allowed = false; auto it = mClientData.find(client); - return (it != mClientData.end() && it->second.gnssMeasurementsCb); + if (it != mClientData.end()) { + if (it->second.trackingCb || it->second.gnssLocationInfoCb || + it->second.engineLocationsInfoCb || it->second.gnssMeasurementsCb) { + allowed = true; + } else { + LOC_LOGi("missing right callback to start tracking") + } + } else { + LOC_LOGi("client %p not found", client) + } + return allowed; } bool @@ -2452,8 +2458,7 @@ GnssAdapter::startTrackingCommand(LocationAPI* client, TrackingOptions& options) return; } LocationError err = LOCATION_ERROR_SUCCESS; - if (!mAdapter.hasTrackingCallback(mClient) && - !mAdapter.hasMeasurementsCallback(mClient)) { + if (!mAdapter.hasCallbacksToStartTracking(mClient)) { err = LOCATION_ERROR_CALLBACK_MISSING; } else if (0 == mOptions.size) { err = LOCATION_ERROR_INVALID_PARAMETER; @@ -3137,21 +3142,35 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, int msInWeek) { // this position is from QMI LOC API, then send report to engine hub - // if sending is successful, we return as we will wait for final report from engine hub - // if the position is called from engine hub, then send it out directly + // also, send out SPE fix promptly to the clients that have registered + // with SPE report + LOC_LOGd("reportPositionEvent, eng type: %d, unpro %d, sess status %d", + locationExtended.locOutputEngType, ulpLocation.unpropagatedPosition, + status); if (true == initEngHubProxy()){ + // send the SPE fix to engine hub mEngHubProxy->gnssReportPosition(ulpLocation, locationExtended, status); + // report out all SPE fix if it is not propagated, even for failed fix + if (false == ulpLocation.unpropagatedPosition) { + EngineLocationInfo engLocationInfo = {}; + engLocationInfo.location = ulpLocation; + engLocationInfo.locationExtended = locationExtended; + engLocationInfo.sessionStatus = status; + reportEnginePositionsEvent(1, &engLocationInfo); + } return; } + // unpropagated report: is only for engine hub to consume and no need + // to send out to the clients if (true == ulpLocation.unpropagatedPosition) { return; } - // Fix is from QMI, and it is not an - // unpropagated position and engine hub is not loaded, queue the msg - // when message is queued, the position can be dispatched to requesting client + // Fix is from QMI, and it is not an unpropagated position and engine hub + // is not loaded, queue the message when message is processed, the position + // can be dispatched to requesting client that registers for SPE report struct MsgReportPosition : public LocMsg { GnssAdapter& mAdapter; const UlpLocation mUlpLocation; diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 1bcf4b7a..1feb985f 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -246,10 +246,9 @@ public: /* ======== RESPONSES ================================================================== */ void reportResponse(LocationAPI* client, LocationError err, uint32_t sessionId); /* ======== UTILITIES ================================================================== */ - bool hasTrackingCallback(LocationAPI* client); bool isTimeBasedTrackingSession(LocationAPI* client, uint32_t sessionId); bool isDistanceBasedTrackingSession(LocationAPI* client, uint32_t sessionId); - bool hasMeasurementsCallback(LocationAPI* client); + bool hasCallbacksToStartTracking(LocationAPI* client); bool isTrackingSession(LocationAPI* client, uint32_t sessionId); void saveTrackingSession(LocationAPI* client, uint32_t sessionId, const TrackingOptions& trackingOptions); From 62042a27ebbbdd230ada2693d4a90fadde0d6c6e Mon Sep 17 00:00:00 2001 From: Hoss Zhou Date: Wed, 6 Nov 2019 16:26:30 +0800 Subject: [PATCH 941/945] fix nmea B2AQ issues Change-Id: I07e17eac2eb663155d138fc67881f9926dea2f5e CRs-Fixed: 2560784 --- utils/loc_nmea.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index cf738ba6..876620f4 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -2056,7 +2056,8 @@ void loc_nmea_generate_sv(const GnssSvNotification &svNotify, { sv_cache_info.bds_used_mask |= (1ULL << (svNotify.gnssSvs[svNumber - 1].svId - 1)); } - if(GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask){ + if ((GNSS_SIGNAL_BEIDOU_B2AI == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask) || + (GNSS_SIGNAL_BEIDOU_B2AQ == svNotify.gnssSvs[svNumber - 1].gnssSignalTypeMask)) { sv_cache_info.bds_b2_count++; } else { // GNSS_SIGNAL_BEIDOU_B1I or default From 31f3995e14c4b2d61903a2b6dbda47b155c6f6a6 Mon Sep 17 00:00:00 2001 From: haohuang Date: Thu, 14 Nov 2019 10:26:10 +0800 Subject: [PATCH 942/945] Remove assigning preferredAccuracyMeters to minDistance Remove this assigning in gnssSetPositionMode. We shouldn't assign preferredAccuracyMeters to minDistance, because if preferredAccuracyMeters is larger than 0, GnssAdapter will start distance based tracking which is not expected. Change-Id: I2c2acedd121e02bf9da1136540cc34b9257197fd CRs-fixed: 2566229 --- android/1.0/location_api/GnssAPIClient.cpp | 1 - android/1.1/location_api/GnssAPIClient.cpp | 1 - android/2.0/location_api/GnssAPIClient.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/android/1.0/location_api/GnssAPIClient.cpp b/android/1.0/location_api/GnssAPIClient.cpp index b9fe2b25..eb785915 100644 --- a/android/1.0/location_api/GnssAPIClient.cpp +++ b/android/1.0/location_api/GnssAPIClient.cpp @@ -174,7 +174,6 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, // For MSA, we always treat it as SINGLE mode. mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; } - mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; else if (mode == IGnss::GnssPositionMode::MS_BASED) diff --git a/android/1.1/location_api/GnssAPIClient.cpp b/android/1.1/location_api/GnssAPIClient.cpp index 9a95fdfe..be4d6596 100644 --- a/android/1.1/location_api/GnssAPIClient.cpp +++ b/android/1.1/location_api/GnssAPIClient.cpp @@ -174,7 +174,6 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, // For MSA, we always treat it as SINGLE mode. mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; } - mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; else if (mode == IGnss::GnssPositionMode::MS_BASED) diff --git a/android/2.0/location_api/GnssAPIClient.cpp b/android/2.0/location_api/GnssAPIClient.cpp index a3cdd278..d505241c 100644 --- a/android/2.0/location_api/GnssAPIClient.cpp +++ b/android/2.0/location_api/GnssAPIClient.cpp @@ -223,7 +223,6 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode, // For MSA, we always treat it as SINGLE mode. mTrackingOptions.minInterval = SINGLE_SHOT_MIN_TRACKING_INTERVAL_MSEC; } - mTrackingOptions.minDistance = preferredAccuracyMeters; if (mode == IGnss::GnssPositionMode::STANDALONE) mTrackingOptions.mode = GNSS_SUPL_MODE_STANDALONE; else if (mode == IGnss::GnssPositionMode::MS_BASED) From c7b6382ede2ada8cbe6d94a58fc27d91bf8da398 Mon Sep 17 00:00:00 2001 From: Nilesh Gharde Date: Wed, 20 Nov 2019 17:59:43 +0530 Subject: [PATCH 943/945] SUPL Version for 5G and LPP Rel 15 Change-Id: Id00ea3bfb72c88c7c68425aa8c8829579ebd6237 CRs-fixed: 2570450 --- android/1.0/GnssConfiguration.cpp | 3 +++ android/1.1/GnssConfiguration.cpp | 3 +++ android/2.0/GnssConfiguration.cpp | 3 +++ gnss/GnssAdapter.cpp | 2 ++ location/LocationDataTypes.h | 1 + 5 files changed, 12 insertions(+) diff --git a/android/1.0/GnssConfiguration.cpp b/android/1.0/GnssConfiguration.cpp index 0b622494..73c9d5c2 100644 --- a/android/1.0/GnssConfiguration.cpp +++ b/android/1.0/GnssConfiguration.cpp @@ -65,6 +65,9 @@ Return GnssConfiguration::setSuplVersion(uint32_t version) { config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; switch (version) { + case 0x00020004: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4; + break; case 0x00020002: config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; break; diff --git a/android/1.1/GnssConfiguration.cpp b/android/1.1/GnssConfiguration.cpp index 93f96457..708e2c1a 100644 --- a/android/1.1/GnssConfiguration.cpp +++ b/android/1.1/GnssConfiguration.cpp @@ -65,6 +65,9 @@ Return GnssConfiguration::setSuplVersion(uint32_t version) { config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; switch (version) { + case 0x00020004: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4; + break; case 0x00020002: config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; break; diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index 363d2b1e..069c0365 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -55,6 +55,9 @@ Return GnssConfiguration::setSuplVersion(uint32_t version) { config.size = sizeof(GnssConfig); config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT; switch (version) { + case 0x00020004: + config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_4; + break; case 0x00020002: config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2; break; diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 19dcb6de..0382f19f 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -533,6 +533,8 @@ inline uint32_t GnssAdapter::convertSuplVersion(const GnssConfigSuplVersion suplVersion) { switch (suplVersion) { + case GNSS_CONFIG_SUPL_VERSION_2_0_4: + return 0x00020004; case GNSS_CONFIG_SUPL_VERSION_2_0_0: return 0x00020000; case GNSS_CONFIG_SUPL_VERSION_2_0_2: diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 956754ad..2fb35bf8 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -248,6 +248,7 @@ typedef enum { GNSS_CONFIG_SUPL_VERSION_1_0_0 = 1, GNSS_CONFIG_SUPL_VERSION_2_0_0, GNSS_CONFIG_SUPL_VERSION_2_0_2, + GNSS_CONFIG_SUPL_VERSION_2_0_4, } GnssConfigSuplVersion; // LTE Positioning Profile From 97c612b5a0153169e29bf28ef8098ca4bb104786 Mon Sep 17 00:00:00 2001 From: Santoshkumar Zalake Date: Thu, 21 Nov 2019 10:49:19 +0530 Subject: [PATCH 944/945] Use gmtime_r function to avoid UTC time corruption. The gmtime library function is outputting corrupted UTC time as this function is not thread safer. CRs-Fixed: 2571035 Change-Id: Ieed088392e3094eb20fa9b526931a3a89d4f231c --- utils/loc_nmea.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/loc_nmea.cpp b/utils/loc_nmea.cpp index 876620f4..9ee27164 100644 --- a/utils/loc_nmea.cpp +++ b/utils/loc_nmea.cpp @@ -1195,7 +1195,8 @@ void loc_nmea_generate_pos(const UlpLocation &location, (location, locationExtended, systemInfo, utcPosTimestamp); time_t utcTime(utcPosTimestamp/1000); - tm * pTm = gmtime(&utcTime); + struct tm result; + tm * pTm = gmtime_r(&utcTime, &result); if (NULL == pTm) { LOC_LOGE("gmtime failed"); return; From 6c35439ef28c99928ae26360bdc4952f97d8d66e Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 16 Aug 2019 14:59:23 -0700 Subject: [PATCH 945/945] FR 57252: GPS hal changes to allow configuration for LE target (1) runtime enable/disable TUNC (2) runtime enable/disable PACE (3) runtime enable/disable constellations (4) delete all aiding data (5) config lever arm Change-Id: I6cffd08e4c6fa45ff8d62bfef2da1156f3b61956 CRs-fixed: 2497326 --- core/EngineHubProxyBase.h | 5 + core/LocApiBase.cpp | 19 ++- core/LocApiBase.h | 15 +- gnss/GnssAdapter.cpp | 295 +++++++++++++++++++++++++++++++++- gnss/GnssAdapter.h | 33 ++++ gnss/location_gnss.cpp | 57 ++++++- location/ILocationAPI.h | 113 +++++++++++++ location/LocationAPI.cpp | 76 +++++++++ location/LocationAPI.h | 113 +++++++++++++ location/LocationDataTypes.h | 69 ++++++++ location/location_interface.h | 6 + utils/gps_extended_c.h | 21 +-- 12 files changed, 780 insertions(+), 42 deletions(-) diff --git a/core/EngineHubProxyBase.h b/core/EngineHubProxyBase.h index 2d30c5bc..d46bca25 100644 --- a/core/EngineHubProxyBase.h +++ b/core/EngineHubProxyBase.h @@ -101,6 +101,11 @@ public: (void) additionalSystemInfo; return false; } + + inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) { + (void) configInfo; + return false; + } }; typedef std::function diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 595fa49f..71abdf9f 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -756,24 +756,27 @@ DEFAULT_IMPL() void LocApiBase::getBlacklistSv() DEFAULT_IMPL() -void LocApiBase::setConstellationControl(const GnssSvTypeConfig& /*config*/) +void LocApiBase::setConstellationControl(const GnssSvTypeConfig& /*config*/, + LocApiResponse* /*adapterResponse*/) DEFAULT_IMPL() void LocApiBase::getConstellationControl() DEFAULT_IMPL() -void LocApiBase::resetConstellationControl() +void LocApiBase::resetConstellationControl(LocApiResponse* /*adapterResponse*/) DEFAULT_IMPL() -LocationError LocApiBase:: +void LocApiBase:: setConstrainedTuncMode(bool /*enabled*/, float /*tuncConstraint*/, - uint32_t /*energyBudget*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + uint32_t /*energyBudget*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() -LocationError LocApiBase:: - setPositionAssistedClockEstimatorMode(bool /*enabled*/) -DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) +void LocApiBase:: + setPositionAssistedClockEstimatorMode(bool /*enabled*/, + LocApiResponse* /*adapterResponse*/) +DEFAULT_IMPL() LocationError LocApiBase::getGnssEnergyConsumed() DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) diff --git a/core/LocApiBase.h b/core/LocApiBase.h index 3c85b099..9c76bab2 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -260,12 +260,17 @@ public: virtual LocationError setBlacklistSvSync(const GnssSvIdConfig& config); virtual void setBlacklistSv(const GnssSvIdConfig& config); virtual void getBlacklistSv(); - virtual void setConstellationControl(const GnssSvTypeConfig& config); + virtual void setConstellationControl(const GnssSvTypeConfig& config, + LocApiResponse *adapterResponse=nullptr); virtual void getConstellationControl(); - virtual void resetConstellationControl(); - virtual LocationError setConstrainedTuncMode(bool enabled, float tuncConstraint, - uint32_t energyBudget); - virtual LocationError setPositionAssistedClockEstimatorMode(bool enabled); + virtual void resetConstellationControl(LocApiResponse *adapterResponse=nullptr); + + virtual void setConstrainedTuncMode(bool enabled, + float tuncConstraint, + uint32_t energyBudget, + LocApiResponse* adapterResponse=nullptr); + virtual void setPositionAssistedClockEstimatorMode(bool enabled, + LocApiResponse* adapterResponse=nullptr); virtual LocationError getGnssEnergyConsumed(); virtual void addGeofence(uint32_t clientId, const GeofenceOption& options, diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 19dcb6de..38818897 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -80,6 +80,7 @@ GnssAdapter::GnssAdapter() : mGnssSvIdConfig(), mGnssSvTypeConfig(), mGnssSvTypeConfigCb(nullptr), + mLocConfigInfo{}, mNiData(), mAgpsManager(), mOdcpiRequestCb(nullptr), @@ -826,12 +827,32 @@ GnssAdapter::setConfig() mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); + // load tunc configuration from config file on first boot-up, + // e.g.: adapter.mLocConfigInfo.tuncConfigInfo.isValid is false + if (mLocConfigInfo.tuncConfigInfo.isValid == false) { + mLocConfigInfo.tuncConfigInfo.isValid = true; + mLocConfigInfo.tuncConfigInfo.enable = + (gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1); + mLocConfigInfo.tuncConfigInfo.tuncThresholdMs = + (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD; + mLocConfigInfo.tuncConfigInfo.energyBudget = + gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET; + } + mLocApi->setConstrainedTuncMode( - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, - (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, - gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); + mLocConfigInfo.tuncConfigInfo.enable, + mLocConfigInfo.tuncConfigInfo.tuncThresholdMs, + mLocConfigInfo.tuncConfigInfo.energyBudget); + + // load pace configuration from config file on first boot-up, + // e.g.: adapter.mLocConfigInfo.paceConfigInfo.isValid is false + if (mLocConfigInfo.paceConfigInfo.isValid == false) { + mLocConfigInfo.paceConfigInfo.isValid = true; + mLocConfigInfo.paceConfigInfo.enable = + (gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED==1); + } mLocApi->setPositionAssistedClockEstimatorMode( - gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); + mLocConfigInfo.paceConfigInfo.enable); if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || @@ -3371,10 +3392,11 @@ GnssAdapter::reportPosition(const UlpLocation& ulpLocation, } } - // if engine hub is running and the fix is from sensor, e.g.: DRE, - // inject DRE fix to modem - if ((1 == ContextBase::mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED) && - (true == initEngHubProxy()) && (LOC_POS_TECH_MASK_SENSORS & techMask)) { + // if PACE is enabled and engine hub is running and the fix is from sensor, + // e.g.: DRE, inject DRE fix to modem + if ((true == mLocConfigInfo.paceConfigInfo.isValid && + true == mLocConfigInfo.paceConfigInfo.enable) && + (true == initEngHubProxy()) && (LOC_POS_TECH_MASK_SENSORS & techMask)) { mLocApi->injectPosition(locationInfo, false); } } @@ -5056,6 +5078,263 @@ GnssAdapter::nfwControlCommand(bool enable) { } } +// Set tunc constrained mode, use 0 session id to indicate +// that no callback is needed. Session id 0 is used for calls that +// are not invoked from the integration api, e.g.: initial configuration +// from the configure file +void +GnssAdapter::setConstrainedTunc(bool enable, float tuncConstraint, + uint32_t energyBudget, uint32_t sessionId) { + + mLocConfigInfo.tuncConfigInfo.isValid = true; + mLocConfigInfo.tuncConfigInfo.enable = enable; + mLocConfigInfo.tuncConfigInfo.tuncThresholdMs = tuncConstraint; + mLocConfigInfo.tuncConfigInfo.energyBudget = energyBudget; + + LocApiResponse* locApiResponse = nullptr; + if (sessionId != 0) { + locApiResponse = + new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId);}); + if (!locApiResponse) { + LOC_LOGe("memory alloc failed"); + } + } + mLocApi->setConstrainedTuncMode( + enable, tuncConstraint, energyBudget, locApiResponse); +} + +uint32_t +GnssAdapter::setConstrainedTuncCommand (bool enable, float tuncConstraint, + uint32_t energyBudget) { + // generated session id will be none-zero + uint32_t sessionId = generateSessionId(); + LOC_LOGd("session id %u", sessionId); + + struct MsgEnableTUNC : public LocMsg { + GnssAdapter& mAdapter; + uint32_t mSessionId; + bool mEnable; + float mTuncConstraint; + uint32_t mEnergyBudget; + + inline MsgEnableTUNC(GnssAdapter& adapter, + uint32_t sessionId, + bool enable, + float tuncConstraint, + uint32_t energyBudget) : + LocMsg(), + mAdapter(adapter), + mSessionId(sessionId), + mEnable(enable), + mTuncConstraint(tuncConstraint), + mEnergyBudget(energyBudget) {} + inline virtual void proc() const { + mAdapter.setConstrainedTunc(mEnable, mTuncConstraint, + mEnergyBudget, mSessionId); + } + }; + + sendMsg(new MsgEnableTUNC(*this, sessionId, enable, + tuncConstraint, energyBudget)); + + return sessionId; +} + +// Set position assisted clock estimator, use 0 session id to indicate +// that no callback is needed. Session id 0 is used for calls that are +// not invoked from the integration api, e.g.: initial configuration +// from the configure file. +void +GnssAdapter::setPositionAssistedClockEstimator(bool enable, + uint32_t sessionId) { + + mLocConfigInfo.paceConfigInfo.isValid = true; + mLocConfigInfo.paceConfigInfo.enable = enable; + LocApiResponse* locApiResponse = nullptr; + if (sessionId != 0) { + locApiResponse = + new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId);}); + if (!locApiResponse) { + LOC_LOGe("memory alloc failed"); + } + } + mLocApi->setPositionAssistedClockEstimatorMode(enable, locApiResponse); +} + +uint32_t +GnssAdapter::setPositionAssistedClockEstimatorCommand(bool enable) { + // generated session id will be none-zero + uint32_t sessionId = generateSessionId(); + LOC_LOGd("session id %u", sessionId); + + struct MsgEnablePACE : public LocMsg { + GnssAdapter& mAdapter; + uint32_t mSessionId; + bool mEnable; + inline MsgEnablePACE(GnssAdapter& adapter, + uint32_t sessionId, bool enable) : + LocMsg(), + mAdapter(adapter), + mSessionId(sessionId), + mEnable(enable){} + inline virtual void proc() const { + mAdapter.setPositionAssistedClockEstimator(mEnable, mSessionId); + } + }; + + sendMsg(new MsgEnablePACE(*this, sessionId, enable)); + return sessionId; +} + +void +GnssAdapter::updateSvConfig(uint32_t sessionId, + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) { + + // check whether if any constellation is removed from the new config + GnssSvTypesMask enabledRemoved = mGnssSvTypeConfig.enabledSvTypesMask & + (mGnssSvTypeConfig.enabledSvTypesMask ^ svTypeConfig.enabledSvTypesMask); + // Send reset if any constellation is removed from the enabled list + if (enabledRemoved != 0) { + mLocApi->resetConstellationControl(); + } + + mGnssSvTypeConfig = svTypeConfig; + mGnssSvIdConfig = svIdConfig; + + // Send blacklist info + mLocApi->setBlacklistSv(mGnssSvIdConfig); + + // Send only enabled constellation config + GnssSvTypeConfig svTypeConfigCopy = {sizeof(GnssSvTypeConfig), 0, 0}; + svTypeConfigCopy.enabledSvTypesMask = mGnssSvTypeConfig.enabledSvTypesMask; + LocApiResponse* locApiResponse = new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId);}); + if (!locApiResponse) { + LOC_LOGe("memory alloc failed"); + } + mLocApi->setConstellationControl(svTypeConfigCopy, locApiResponse); +} + +uint32_t GnssAdapter::gnssUpdateSvConfigCommand( + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) { + + // generated session id will be none-zero + uint32_t sessionId = generateSessionId(); + LOC_LOGd("session id %u", sessionId); + + struct MsgUpdateSvConfig : public LocMsg { + GnssAdapter& mAdapter; + uint32_t mSessionId; + GnssSvTypeConfig mSvTypeConfig; + GnssSvIdConfig mSvIdConfig; + + inline MsgUpdateSvConfig(GnssAdapter& adapter, + uint32_t sessionId, + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) : + LocMsg(), + mAdapter(adapter), + mSessionId(sessionId), + mSvTypeConfig(svTypeConfig), + mSvIdConfig(svIdConfig) {} + inline virtual void proc() const { + mAdapter.updateSvConfig(mSessionId, mSvTypeConfig, mSvIdConfig); + } + }; + + if (sessionId != 0) { + sendMsg(new MsgUpdateSvConfig(*this, sessionId, + svTypeConfig, svIdConfig)); + } + return sessionId; +} + +void +GnssAdapter::resetSvConfig(uint32_t sessionId) { + + LocApiResponse* locApiResponse = nullptr; + if (sessionId != 0) { + locApiResponse = + new LocApiResponse(*getContext(), + [this, sessionId] (LocationError err) { + reportResponse(err, sessionId);}); + if (!locApiResponse) { + LOC_LOGe("memory alloc failed"); + } + } + mLocApi->resetConstellationControl(locApiResponse); +} + +uint32_t GnssAdapter::gnssResetSvConfigCommand() { + + // generated session id will be none-zero + uint32_t sessionId = generateSessionId(); + LOC_LOGd("session id %u", sessionId); + + struct MsgResetSvConfig : public LocMsg { + GnssAdapter& mAdapter; + uint32_t mSessionId; + + inline MsgResetSvConfig(GnssAdapter& adapter, + uint32_t sessionId) : + LocMsg(), + mAdapter(adapter), + mSessionId(sessionId) {} + inline virtual void proc() const { + mAdapter.resetSvConfig(mSessionId); + } + }; + + sendMsg(new MsgResetSvConfig(*this, sessionId)); + return sessionId; +} + +void +GnssAdapter::configLeverArm(uint32_t sessionId, + const LeverArmConfigInfo& configInfo) { + + LocationError err = LOCATION_ERROR_NOT_SUPPORTED; + if (true == mEngHubProxy->configLeverArm(configInfo)) { + err = LOCATION_ERROR_SUCCESS; + } + reportResponse(err, sessionId); +} + +uint32_t +GnssAdapter::configLeverArmCommand(const LeverArmConfigInfo& configInfo) { + + // generated session id will be none-zero + uint32_t sessionId = generateSessionId(); + LOC_LOGd("session id %u", sessionId); + + struct MsgConfigLeverArm : public LocMsg { + GnssAdapter& mAdapter; + uint32_t mSessionId; + LeverArmConfigInfo mConfigInfo; + + inline MsgConfigLeverArm(GnssAdapter& adapter, + uint32_t sessionId, + const LeverArmConfigInfo& configInfo) : + LocMsg(), + mAdapter(adapter), + mSessionId(sessionId), + mConfigInfo(configInfo) {} + inline virtual void proc() const { + mAdapter.configLeverArm(mSessionId, mConfigInfo); + } + }; + + sendMsg(new MsgConfigLeverArm(*this, sessionId, configInfo)); + return sessionId; +} + /* ==== Eng Hub Proxy ================================================================= */ /* ======== UTILITIES ================================================================= */ void diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 37a4892d..ff8131ff 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -122,6 +122,23 @@ typedef struct { double latLonDiffThreshold; } BlockCPIInfo; +typedef struct { + bool isValid; + bool enable; + float tuncThresholdMs; // need to be specified if enable is true + uint32_t energyBudget; // need to be specified if enable is true +} TuncConfigInfo; + +typedef struct { + bool isValid; + bool enable; +} PaceConfigInfo; + +typedef struct { + TuncConfigInfo tuncConfigInfo; + PaceConfigInfo paceConfigInfo; +} LocIntegrationConfigInfo; + using namespace loc_core; namespace loc_core { @@ -158,6 +175,7 @@ class GnssAdapter : public LocAdapterBase { GnssSvTypeConfig mGnssSvTypeConfig; GnssSvTypeConfigCallback mGnssSvTypeConfigCb; bool mSupportNfwControl; + LocIntegrationConfigInfo mLocConfigInfo; /* ==== NI ============================================================================= */ NiData mNiData; @@ -270,6 +288,14 @@ public: const TrackingOptions& updatedOptions, const TrackingOptions& oldOptions); bool checkAndSetSPEToRunforNHz(TrackingOptions & out); + void setConstrainedTunc(bool enable, float tuncConstraint, + uint32_t energyBudget, uint32_t sessionId); + void setPositionAssistedClockEstimator(bool enable, uint32_t sessionId); + void updateSvConfig(uint32_t sessionId, const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig); + void resetSvConfig(uint32_t sessionId); + void configLeverArm(uint32_t sessionId, const LeverArmConfigInfo& configInfo); + /* ==== NI ============================================================================= */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ void gnssNiResponseCommand(LocationAPI* client, uint32_t id, GnssNiResponse response); @@ -329,6 +355,13 @@ public: void dataConnFailedCommand(AGpsExtType agpsType); void getGnssEnergyConsumedCommand(GnssEnergyConsumedCallback energyConsumedCb); void nfwControlCommand(bool enable); + uint32_t setConstrainedTuncCommand (bool enable, float tuncConstraint, + uint32_t energyBudget); + uint32_t setPositionAssistedClockEstimatorCommand (bool enable); + uint32_t gnssUpdateSvConfigCommand(const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig); + uint32_t gnssResetSvConfigCommand(); + uint32_t configLeverArmCommand(const LeverArmConfigInfo& configInfo); /* ========= ODCPI ===================================================================== */ /* ======== COMMANDS ====(Called from Client Thread)==================================== */ diff --git a/gnss/location_gnss.cpp b/gnss/location_gnss.cpp index 5380f05a..97e99e42 100644 --- a/gnss/location_gnss.cpp +++ b/gnss/location_gnss.cpp @@ -80,6 +80,13 @@ static void blockCPI(double latitude, double longitude, float accuracy, int blockDurationMsec, double latLonDiffThreshold); static void updateBatteryStatus(bool charging); static void updateSystemPowerState(PowerStateType systemPowerState); +static uint32_t setConstrainedTunc (bool enable, float tuncConstraint, + uint32_t energyBudget); +static uint32_t setPositionAssistedClockEstimator(bool enable); +static uint32_t gnssUpdateSvConfig(const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig); +static uint32_t gnssResetSvConfig(); +static uint32_t configLeverArm(const LeverArmConfigInfo& configInfo); static const GnssInterface gGnssInterface = { sizeof(GnssInterface), @@ -119,7 +126,12 @@ static const GnssInterface gGnssInterface = { getPowerStateChanges, injectLocationExt, updateBatteryStatus, - updateSystemPowerState + updateSystemPowerState, + setConstrainedTunc, + setPositionAssistedClockEstimator, + gnssUpdateSvConfig, + gnssResetSvConfig, + configLeverArm, }; #ifndef DEBUG_X86 @@ -398,3 +410,46 @@ static void updateSystemPowerState(PowerStateType systemPowerState) { gGnssAdapter->updateSystemPowerStateCommand(systemPowerState); } } + +static uint32_t setConstrainedTunc (bool enable, float tuncConstraint, uint32_t energyBudget) { + if (NULL != gGnssAdapter) { + return gGnssAdapter->setConstrainedTuncCommand(enable, tuncConstraint, energyBudget); + } else { + return 0; + } +} + +static uint32_t setPositionAssistedClockEstimator(bool enable) { + if (NULL != gGnssAdapter) { + return gGnssAdapter->setPositionAssistedClockEstimatorCommand(enable); + } else { + return 0; + } +} + +static uint32_t gnssUpdateSvConfig( + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) { + if (NULL != gGnssAdapter) { + return gGnssAdapter->gnssUpdateSvConfigCommand( + svTypeConfig, svIdConfig); + } else { + return 0; + } +} + +static uint32_t gnssResetSvConfig() { + if (NULL != gGnssAdapter) { + return gGnssAdapter->gnssResetSvConfigCommand(); + } else { + return 0; + } +} + +static uint32_t configLeverArm(const LeverArmConfigInfo& configInfo){ + if (NULL != gGnssAdapter) { + return gGnssAdapter->configLeverArmCommand(configInfo); + } else { + return 0; + } +} diff --git a/location/ILocationAPI.h b/location/ILocationAPI.h index 3df6f799..87aa99bd 100644 --- a/location/ILocationAPI.h +++ b/location/ILocationAPI.h @@ -189,6 +189,119 @@ public: LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */ virtual uint32_t gnssDeleteAidingData(GnssAidingData& data) = 0; + + /** @brief + Reset the constellation settings to modem default. + + @param + None + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t resetConstellationConfig() = 0; + + /** @brief + Configure the constellation to be used by the GNSS engine on + modem. + + @param + constellationConfig: specify the constellation configuration + used by GNSS engine. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configConstellations( + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) = 0; + + /** @brief + Enable or disable the constrained time uncertainty feature. + + @param + enable: true to enable the constrained time uncertainty + feature and false to disable the constrainted time + uncertainty feature. + + @param + tuncThreshold: this specifies the time uncertainty threshold + that gps engine need to maintain, in units of milli-seconds. + Default is 0.0 meaning that modem default value of time + uncertainty threshold will be used. This parameter is + ignored when requesting to disable this feature. + + @param + energyBudget: this specifies the power budget that gps + engine is allowed to spend to maintain the time uncertainty. + Default is 0 meaning that GPS engine is not constained by + power budget and can spend as much power as needed. The + parameter need to be specified in units of 0.1 milli watt + second. This parameter is ignored requesting to disable this + feature. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters + are invalid + */ + virtual uint32_t configConstrainedTimeUncertainty( + bool enable, float tuncThreshold = 0.0, + uint32_t energyBudget = 0) = 0; + + /** @brief + Enable or disable position assisted clock estimator feature. + + @param + enable: true to enable position assisted clock estimator and + false to disable the position assisted clock estimator + feature. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configPositionAssistedClockEstimator(bool enable) = 0; + + /** @brief + Sets the lever arm parameters for the vehicle. + + @param + configInfo: lever arm configuration info regarding below two + types of lever arm info: + a: GNSS Antenna w.r.t the origin at the IMU e.g.: inertial + measurement unit. + b: lever arm parameters regarding the OPF (output frame) + w.r.t the origin (at the GPS Antenna). Vehicle manufacturers + prefer the position output to be tied to a specific point in + the vehicle rather than where the antenna is placed + (midpoint of the rear axle is typical). + + Caller can choose types of lever arm info to configure via the + leverMarkTypeMask. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configLeverArm(const LeverArmConfigInfo& configInfo) = 0; }; #endif /* ILOCATIONAPI_H */ diff --git a/location/LocationAPI.cpp b/location/LocationAPI.cpp index 4348c276..7c125b81 100644 --- a/location/LocationAPI.cpp +++ b/location/LocationAPI.cpp @@ -723,3 +723,79 @@ LocationControlAPI::gnssDeleteAidingData(GnssAidingData& data) pthread_mutex_unlock(&gDataMutex); return id; } + +uint32_t LocationControlAPI::resetConstellationConfig() { + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->gnssResetSvConfig(); + } else { + LOC_LOGe("No gnss interface available for Location Control API"); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +uint32_t LocationControlAPI::configConstellations( + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) { + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->gnssUpdateSvConfig( + svTypeConfig, svIdConfig); + } else { + LOC_LOGe("No gnss interface available for Location Control API"); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +uint32_t LocationControlAPI::configConstrainedTimeUncertainty( + bool enable, float tuncThreshold, uint32_t energyBudget) { + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->setConstrainedTunc(enable, + tuncThreshold, + energyBudget); + } else { + LOC_LOGe("No gnss interface available for Location Control API"); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +uint32_t LocationControlAPI::configPositionAssistedClockEstimator(bool enable) { + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->setPositionAssistedClockEstimator(enable); + } else { + LOC_LOGe("No gnss interface available for Location Control API"); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} + +uint32_t LocationControlAPI::configLeverArm(const LeverArmConfigInfo& configInfo) { + uint32_t id = 0; + pthread_mutex_lock(&gDataMutex); + + if (gData.gnssInterface != NULL) { + id = gData.gnssInterface->configLeverArm(configInfo); + } else { + LOC_LOGe("No gnss interface available for Location Control API"); + } + + pthread_mutex_unlock(&gDataMutex); + return id; +} diff --git a/location/LocationAPI.h b/location/LocationAPI.h index 6f5987ca..f70fc2f8 100644 --- a/location/LocationAPI.h +++ b/location/LocationAPI.h @@ -261,6 +261,119 @@ public: LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */ virtual uint32_t gnssDeleteAidingData(GnssAidingData& data) override; + + /** @brief + Reset the constellation settings to modem default. + + @param + None + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t resetConstellationConfig() override; + + /** @brief + Configure the constellation to be used by the GNSS engine on + modem. + + @param + constellationConfig: specify the constellation configuration + used by GNSS engine. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configConstellations( + const GnssSvTypeConfig& svTypeConfig, + const GnssSvIdConfig& svIdConfig) override; + + /** @brief + Enable or disable the constrained time uncertainty feature. + + @param + enable: true to enable the constrained time uncertainty + feature and false to disable the constrainted time + uncertainty feature. + + @param + tuncThreshold: this specifies the time uncertainty threshold + that gps engine need to maintain, in units of milli-seconds. + Default is 0.0 meaning that modem default value of time + uncertainty threshold will be used. This parameter is + ignored when requesting to disable this feature. + + @param + energyBudget: this specifies the power budget that gps + engine is allowed to spend to maintain the time uncertainty. + Default is 0 meaning that GPS engine is not constained by + power budget and can spend as much power as needed. The + parameter need to be specified in units of 0.1 milli watt + second. This parameter is ignored requesting to disable this + feature. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters + are invalid + */ + virtual uint32_t configConstrainedTimeUncertainty( + bool enable, float tuncThreshold = 0.0, + uint32_t energyBudget = 0) override; + + /** @brief + Enable or disable position assisted clock estimator feature. + + @param + enable: true to enable position assisted clock estimator and + false to disable the position assisted clock estimator + feature. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configPositionAssistedClockEstimator(bool enable) override; + + /** @brief + Sets the lever arm parameters for the vehicle. + + @param + configInfo: lever arm configuration info regarding below two + types of lever arm info: + a: GNSS Antenna w.r.t the origin at the IMU e.g.: inertial + measurement unit. + b: lever arm parameters regarding the OPF (output frame) + w.r.t the origin (at the GPS Antenna). Vehicle manufacturers + prefer the position output to be tied to a specific point in + the vehicle rather than where the antenna is placed + (midpoint of the rear axle is typical). + + Caller can choose types of lever arm info to configure via the + leverMarkTypeMask. + + @return + A session id that will be returned in responseCallback to + match command with response. This effect is global for all + clients of LocationAPI responseCallback returns: + LOCATION_ERROR_SUCCESS if successful + LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid + */ + virtual uint32_t configLeverArm(const LeverArmConfigInfo& configInfo) override; }; #endif /* LOCATIONAPI_H */ diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 956754ad..f36d9c19 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -658,6 +658,8 @@ typedef enum { DEAD_RECKONING_ENGINE = (1 << 1), PRECISE_POSITIONING_ENGINE = (1 << 2) } PositioningEngineBits; +#define POSITION_ENGINE_MASK_ALL \ + (STANDARD_POSITIONING_ENGINE|DEAD_RECKONING_ENGINE|PRECISE_POSITIONING_ENGINE) typedef uint64_t GnssDataMask; typedef enum { @@ -1186,6 +1188,13 @@ typedef struct { // GAL - SV 301 maps to bit 0 #define GNSS_SV_CONFIG_GAL_INITIAL_SV_ID 301 uint64_t galBlacklistSvMask; + + // SBAS - SV 120 to 158, maps to 0 to 38 + // SV 183 to 191, maps to 39 to 47 +#define GNSS_SV_CONFIG_SBAS_INITIAL_SV_ID 120 +#define GNSS_SV_CONFIG_SBAS_INITIAL_SV_LENGTH 39 +#define GNSS_SV_CONFIG_SBAS_INITIAL2_SV_ID 183 + uint64_t sbasBlacklistSvMask; } GnssSvIdConfig; struct GnssConfig{ @@ -1313,6 +1322,66 @@ struct LocationSystemInfo { LeapSecondSystemInfo leapSecondSysInfo; }; +/* Mask indicating enabled or disabled constellations */ +typedef uint64_t GnssSvTypesMask; +typedef enum { + GNSS_SV_TYPES_MASK_GLO_BIT = (1<<0), + GNSS_SV_TYPES_MASK_BDS_BIT = (1<<1), + GNSS_SV_TYPES_MASK_QZSS_BIT = (1<<2), + GNSS_SV_TYPES_MASK_GAL_BIT = (1<<3), + GNSS_SV_TYPES_MASK_NAVIC_BIT = (1<<4), +} GnssSvTypesMaskBits; + +/* This SV Type config is injected directly to GNSS Adapter + * bypassing Location API */ +typedef struct { + uint32_t size; // set to sizeof(GnssSvTypeConfig) + // Enabled Constellations + GnssSvTypesMask enabledSvTypesMask; + // Disabled Constellations + GnssSvTypesMask blacklistedSvTypesMask; +} GnssSvTypeConfig; + +// Specify parameters related to lever arm +struct LeverArmParams { + // Offset along the vehicle forward axis + float forwardOffsetMeters; + // Offset along the vehicle starboard axis + float sidewaysOffsetMeters; + // Offset along the vehicle up axis + float upOffsetMeters; +}; + +typedef uint32_t LeverArmTypeMask; + +enum LeverArmTypeBits { + // Lever arm regarding the VRP (Vehicle Reference Point) w.r.t + // the origin (at the GPS Antenna) + LEVER_ARM_TYPE_GNSS_TO_VRP_BIT = (1<<0), + // Lever arm regarding GNSS Antenna w.r.t the origin at the IMU + // e.g.: inertial measurement unit for DR (dead reckoning + // engine) + LEVER_ARM_TYPE_DR_IMU_TO_GNSS_BIT = (1<<1), + // Lever arm regarding GNSS Antenna w.r.t the origin at the + // IMU (inertial measurement unit) for VEPP (vision enhanced + // precise positioning engine) + LEVER_ARM_TYPE_VEPP_IMU_TO_GNSS_BIT = (1<<2) +}; + +struct LeverArmConfigInfo { + // Valid mask for the types of lever arm parameters provided + LeverArmTypeMask leverArmValidMask; + // Lever arm regarding the VRP (Vehicle Reference Point) w.r.t the origin + // (at the GPS Antenna) + LeverArmParams gnssToVRP; + // Lever arm parameters regarding GNSS Antenna w.r.t the origin at the IMU + // (inertial measurement unit) for DR (dead reckoning engine) + LeverArmParams drImuToGnss; + // Lever arm regarding GNSS Antenna w.r.t the origin at the IMU + // (inertial measurement unit) for VEPP (vision enhanced precise position engine) + LeverArmParams veppImuToGnss; +}; + /* Provides the capabilities of the system capabilities callback is called once soon after createInstance is called */ typedef std::function